Commit Graph

1227 Commits

Author SHA1 Message Date
Markus Ecker 40205f3900 fix(deps): resolve @ag-ui peers to the renamed build, not the old canary
The lockfile installed TWO incompatible copies of the protocol: the PR-2350
preview carrying `subagentRunId`, and the old `0.0.59-canary.1785518626.0`
carrying `subagentId`. Any subagent-attributed event passing through a package
bound to the canary copy lost its attribution silently -- the registry would read
a field the stream no longer emits, so every lookup returned undefined with no
error. Reported in review of the rename commit.

The cause is peer auto-install, which took a while to find. `pnpm.overrides`
governs DECLARED dependencies. `@ag-ui/langgraph`, `@ag-ui/a2a` and
`@ag-ui/mcp-apps-middleware` declare `@ag-ui/core` / `@ag-ui/client` as PEERS,
and four workspace packages depended on them without declaring those peers
themselves -- so pnpm auto-installed the peers straight from the registry,
resolving to the canary and bypassing the overrides. That is why the overrides
looked ignored: they were never consulted for those edges.

Fixed the conventional way, by declaring the peers so they resolve from the graph
instead of being fetched:

- `packages/sdk-js` -- @ag-ui/core, @ag-ui/client
- `examples/v2/angular/demo-server` -- @ag-ui/core, @ag-ui/client
- `examples/showcases/generative-ui-playground` -- @ag-ui/core
- `examples/v2/vue/demo` -- @ag-ui/client (it declared mcp-apps-middleware but no
  client, which was the last remaining edge)

Result: zero references to the canary in the lockfile, and exactly ONE
@ag-ui/core installed -- the renamed preview. Verified by deleting the stale
store directories and reinstalling from the committed lockfile alone: they are
not recreated, so nothing can reach the old copy.

Things that did NOT work, recorded so they are not retried: plain install,
`--force`, `pnpm dedupe`, `>`-scoped overrides (`@ag-ui/a2a>@ag-ui/core`),
version-specific overrides, and deleting the lockfile to regenerate from scratch
-- which reproduced it byte-identically, since the resolution was correct given
the package.json files rather than stale.

These four declarations are TEMPORARY, like the overrides they support, and come
out with them when @ag-ui publishes the rename.

Verified: @copilotkit/core, react-core and sdk-js typecheck; react-core 1424
tests and vue 1071 tests pass.
2026-08-10 15:10:17 +02:00
Maxim 258820e4ce fix(banking-demo): cap native TEI warmup batch to survive Metal fault
The self-hosted `run-demo.sh` path launches a native Metal
`text-embeddings-router` on :7067 for the durable-memory demo. TEI's
default `--max-batch-tokens` (16384) can fault the Metal backend during
its warmup forward pass on some Apple Silicon machines. The process then
either deadlocks (every thread parked in a pthread cond wait at 0% CPU)
or dies silently with no panic — a GPU-level abort — so it never binds
:7067 and the 300s health wait times out. The demo appears to "crash"
with no actionable error.

Pass `--max-batch-tokens 512` so warmup uses a small forward pass, which
clears reliably. This only bounds per-request tokens (memory texts are
short), not the embedding vectors, so recall stays byte-identical to the
docker/CI embedder.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 16:18:35 +02:00
David McKay ad89876df1 Merge branch 'main' into feat/banking-durable-memory 2026-07-06 10:12:52 -05:00
github-actions[bot] 57ec68ecf9 style: auto-fix formatting 2026-07-06 14:22:05 +00:00
Maxim 6d5d407624 fix(banking): make fresh setup work on Apple Silicon (native TEI + run-demo.sh)
The bundled tei embedder image is amd64-only; under arm64 emulation the Candle
backend is unavailable and TEI falls back to the ONNX/ORT backend, which needs
onnx/model.onnx files Qwen3-Embedding-0.6B doesn't publish (404) -> crash-loop.
A fresh clone on Apple Silicon therefore couldn't stand up the embedder, so
memory save/recall were dead. Ports the proven pattern from the Intelligence
repo's docker-compose.deps.yml + demos/splat-demo/run-demo.sh into this demo:

- docker-compose.yml: gate the bundled `tei` behind the `cpu-fallback` profile,
  so a bare `docker compose up` skips the crash-looping emulated image. amd64/CI
  opt back in with `--profile cpu-fallback`. (intelligence's tei dep is
  required:false, so it starts fine without it, using MEMORY_EMBEDDINGS_URL.)
- run-demo.sh: one-command cold start. On Apple Silicon it runs a native Metal
  TEI on :7067 (same 1.9.3 + Qwen3-Embedding-0.6B => byte-identical embeddings,
  ~20x faster) and points app-api at it; on amd64/CI it uses the docker tei via
  the profile. Mints a dev license if .env lacks one, then starts `pnpm dev`.
- README: correct the failure description (emulation->ONNX crash-loop, not OOM),
  document run-demo.sh as the recommended start, and the profile-gated manual path.

All CopilotKit-repo-only (banking's compose is standalone); no Intelligence
changes. Validated: shellcheck clean, compose valid, bare `up` skips tei and
keeps intelligence healthy, memory save/recall verified through the native TEI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 16:20:03 +02:00
Maxim 771f78c095 docs(banking): document PRESENTER_RESET_ENABLED 2026-07-06 16:20:03 +02:00
Maxim bfb91085e4 feat(banking): add env-gated presenter reset button to sidebar 2026-07-06 16:20:03 +02:00
Maxim 86ef09cdb3 feat(banking): thread resetEnabled flag to the layout 2026-07-06 16:20:02 +02:00
Maxim 271928249d fix(banking): report partial progress on reset memory failure 2026-07-06 16:20:02 +02:00
Maxim 7cbbaef5a9 feat(banking): gate reset endpoint on flag, forget all personas 2026-07-06 16:20:02 +02:00
Maxim 8be514df0b feat(banking): export SEEDED_USER_IDS for full-slate reset 2026-07-06 16:20:01 +02:00
Maxim 9744c104e2 feat(banking): add presenterResetEnabled env flag 2026-07-06 16:20:01 +02:00
Maxim 157d9fc723 feat(banking): reproducible dev-license mint helper (self-hosted memory)
Phase 3 of the banking->Intelligence-main migration. Self-hosted Intelligence
gates the paid `memory` feature behind a signed offline license; a locally-built
(unbaked) app-api trusts a runtime BAKED_LICENSE_KEYS_JSON, so a throwaway
keypair can sign an enterprise license with features.memory=true.

- scripts/mint-dev-license.mjs: prints (or --write upserts into .env)
  COPILOTKIT_LICENSE_TOKEN + BAKED_LICENSE_KEYS_JSON + INTELLIGENCE_DEPLOYMENT_MODE.
  Drives the signer from the PRIVATE Intelligence source via INTELLIGENCE_REPO
  (same coupling the docker-compose image build already has) rather than
  vendoring any signing code into this public repo. No secret is embedded; the
  script is dev-only and never imported by the app runtime.
- .env.example: documents BOTH the managed path (CopilotKit-issued token, no
  baked key — the eventual hosting target) and the self-hosted dev path, so the
  demo is not locked to the local stack.
- package.json: add `mint-dev-license` script.

Replaces the ephemeral Intelligence/tmp/mint-banking-license.ts. .env stays
gitignored; nothing sensitive is committed. Local-only until verified.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 16:20:01 +02:00
Maxim 3b1e04275e chore(banking): rename memory kinds to Intelligence main enum
Phase 2 of the banking->Intelligence-main migration. Main's memory lib
(libs/memory/src/types.ts) closes MemoryKind to topical|episodic|operational;
the demo was authored against the legacy semantic|procedural names, which the
backend now rejects/misfiles. Rename across the whole surface:
- agent prompt (route.ts CLASSIFY + SAVE-THE-PROCEDURE): semantic->topical,
  procedural->operational
- recorder instruction (copilot-context.tsx), learning-tab dual-read dropped,
  memory-tab KIND_COLORS, memory unit-test fixture
- smokes (facts + drift) and the e2e spec seed + fixtures comment

Only true kind: values renamed; "semantic recall"/"top-k semantic search"
mechanism descriptions left intact (recall is vector search regardless of enum).
aimock fixture re-record was a no-op: the one fixture pins the recall-and-apply
arc (no kind: values); the seed is REST-side in the spec.

Verified: pnpm test:unit 47/47, tsc --noEmit clean, eslint clean on touched files.
Local-only until the full migration is verified against the main stack.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 16:20:00 +02:00
Maxim ccd1c974f5 wip(banking): migrate compose auth to Intelligence main (Phase 1 spike)
Phase 1 of the banking->Intelligence-main migration (branch:
feat/banking-intelligence-main-migration). PROVEN GREEN against main:
- INTELLIGENCE_DEPLOYMENT_MODE=self_hosted (renamed from legacy DEPLOYMENT_MODE)
- dropped legacy DEFAULT_ORGANIZATION_ID (main's loadAuthEnv rejects it)
- BAKED_LICENSE_KEYS_JSON wired: main gates memory behind a signed license
  carrying the "memory" feature (MEMORY_NOT_ENTITLED otherwise). A locally
  minted dev enterprise license + baked public key unlocks it (recipe mirrors
  Intelligence apps/app-api-e2e global-setup). Verified: /mcp attaches
  recall/save/forget_memory and save_memory(kind=topical) round-trips via the
  cpk key.

REMAINING (next session): (1) reproducible dev-license mint helper + .env wiring
(mint script currently at Intelligence/tmp/mint-banking-license.ts, ephemeral);
(2) kind rename semantic->topical, procedural->operational across prompt, memory
lib, smokes, e2e spec; (3) aimock fixture re-record for new kinds; (4) re-verify
e2e/smokes/manual arc. Working demo (PR #5763, demo branch) is untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 16:18:52 +02:00
github-actions[bot] 40fe2c64a6 style: auto-fix formatting 2026-07-03 18:15:03 +00:00
Maxim f568c7e3d6 fix(banking): tell the agent to omit save_memory supersedes unless it has a real memory UUID 2026-07-03 19:30:56 +02:00
Maxim ca5f6f7da9 test(banking): use UUID thread/run ids in smokes (backend validates thread id as UUID) 2026-07-03 17:26:39 +02:00
Maxim 277b037193 test(banking): smokes preflight the demo dev server for a clear 'run pnpm dev' error 2026-07-03 17:23:45 +02:00
Maxim 84095d63ec test(banking): add /mcp readiness gate to memory smokes; document backend boot-window flake 2026-07-03 17:17:50 +02:00
Maxim fba5b085c3 test(banking): drain full turn in drift smoke so rule-9 negative save assertion is reliable 2026-07-03 16:28:24 +02:00
Maxim c3728848c2 fix(banking): add memberId to learning-tab fetch useCallback deps 2026-07-03 16:22:38 +02:00
Maxim 40babda9d0 docs(banking): document general memory and the 2-persona cross-user demo 2026-07-03 16:14:26 +02:00
Maxim 6bbe4bb819 test(banking): add real-LLM general-memory smoke (save/no-save/recall/isolation) 2026-07-03 16:12:16 +02:00
Maxim c401b3d4e3 test(banking): drift smoke asserts identity and no spurious save in teach flow 2026-07-03 16:12:12 +02:00
Maxim 0c9c16a4e2 feat(banking): teach the copilot general durable memory for facts and preferences 2026-07-03 16:08:18 +02:00
Maxim cb52e5f9a4 feat(banking): unpin identity for the live demo so persona switch drives memory 2026-07-03 16:03:49 +02:00
Maxim 72a42e6227 feat(banking): reduce roster to two personas for 1:1 memory identity 2026-07-03 16:02:52 +02:00
Maxim f9d798255b feat(banking): forward active member id to runtime and inspector proxies 2026-07-03 15:58:44 +02:00
Maxim 04d155639c feat(banking): resolve memory identity from member id across runtime and proxies 2026-07-03 15:57:01 +02:00
Maxim 40024c9be8 feat(banking): map member id to seeded identity for memory scope 2026-07-03 15:51:22 +02:00
Markus Ecker 7b72bd491a Merge branch 'main' into mme/memory-core 2026-07-03 10:20:47 +02:00
Benjamin Taylor 9b5a124a1c chore(examples): normalize @copilotkit/runtime pins to raw versions
The langgraph/strands examples pinned @copilotkit/runtime via a
self-referential npm alias (npm:@copilotkit/runtime@x) left over from the
de-fork branch (2155821b8), where it forced registry resolution while
react-core used workspace:*. That alias is functionally identical to a
raw pin and react-core was already reverted, so drop the alias in the four
remaining files (langgraph-fastapi, langgraph-js, langgraph-python,
strands-python) and regenerate their lockfiles.
2026-07-02 18:08:32 -05:00
Benjamin Taylor b0ea64c718 chore(examples): bump integration scaffolds to @copilotkit 1.62.2
Bump the 16 integration examples already on the 1.62.x line from 1.62.1
to 1.62.2 (the just-published release), including their in-tree agent
sub-packages (langgraph-js/agent sdk-js, agentcore CDK lambda runtime)
that had drifted to 1.61.0. Regenerated the co-located package-lock.json
files against the published 1.62.2.

a2a-a2ui and agent-spec remain at 1.61.0 (QA-held; out of scope).
2026-07-02 17:55:47 -05:00
Maxim 634e1d908f docs(showcase): fix banking docker-compose header infra port comments
Header documented 70xx ports but actual host-port mappings default to
71xx. Update postgres/redis/minio/minio-console/tei comment ports to
match the real mappings. Comment-only; no ports: mapping changed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 00:47:51 +02:00
Maxim af44459e74 fix(showcase): record approve step before beginRecording resets the feed
In handleApprove for both TransactionsList (transactions-list.tsx) and
PendingApprovalsChat (wow/pending-approvals-chat.tsx) the recorder-feed
narration ran in the wrong order:

    logStep("Approved the charge");
    beginRecording();
    endRecording();

`logStep` early-returns unless `activeRef.current` is true, and that ref is
only set inside `beginRecording()`. Worse, `beginRecording()` calls
`setSteps([])`, resetting the feed. So calling `logStep` first was a no-op and
the "Approved the charge" line never appeared in the recorder HUD.

Reorder to match the correct pattern already used in policy-exception-inline.tsx:

    beginRecording();
    logStep("Approved the charge");
    endRecording();

Adds recording-context.test.tsx (vitest + testing-library): a provider-level
ordering invariant plus a component-level test that clicking Approve in
PendingApprovalsChat lands "Approved the charge" in the feed. RED verified
(step dropped with the inverted order) / GREEN with the fix.

Call-site enumeration (grep logStep/beginRecording/endRecording, all src):
- transactions-list.tsx handleApprove — FIXED (was inverted)
- wow/pending-approvals-chat.tsx handleApprove — FIXED (was inverted)
- policy-exception-inline.tsx handleSubmit — already correct (begin -> logStep -> end)
- transactions-list.tsx:254 / pending-approvals-chat.tsx:184 "Opened the
  exception form" — logStep inside an already-active window; correct
- dashboard/page.tsx, layout.tsx — unconditional nav/tab logStep that
  correctly no-ops when no recording is active; correct
No other site has the inverted begin/log order.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 00:47:50 +02:00
Maxim ad922750cf fix(showcase): align banking memory docs/smoke to kind procedural
The durable memory feature saves kind:"procedural" (route.ts:150) but the
README and drift-smoke script described/seeded kind:"operational", a
doc/code contradiction. Update both to procedural. The learning-tab
back-compat (operational || procedural) is intentionally left untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 00:47:50 +02:00
Maxim 2d9275da1f fix(showcase): correct memory-learning spec path in banking docs
The README, .env.example, and memory-drift-smoke.mjs referenced a
non-existent path 'tests/e2e/memory-learning.spec.ts'. The actual spec
lives at 'e2e/memory-learning.spec.ts' (matching the test:self-learning
script in package.json). Corrected all three references.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 00:47:50 +02:00
Maxim 02c317e55d fix(showcase): resolve rebase fallout in banking demo
Two collisions from rebasing onto main surfaced only at build time (git
didn't flag them since the sides touched different files):

- pending-approvals-chat: a feature commit removed the record-user-action
  seam and migrated its call sites, but this file was added on main later
  and still imported it. Migrate to the same begin/endRecording bracketing
  the sibling approval surfaces use.
- store.reset(): written when DB had no `reports`; main added `reports` to
  the type. Mirror the module-init `Omit<DB, "reports">` seam and re-seed
  reports to [].

Verified: tsc --noEmit clean, next build succeeds.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:55:52 +02:00
Maxim 7257068466 feat(showcase): add A2UI Transactions catalog node with status filter
Replace the catalog's fixed PendingTable node with a general Transactions node
that takes a status filter (all | pending | approved | denied, default all);
the agent picks the slice when composing a report and the client binds live
data via useReportData(). render_report's `pendingTable: boolean` param becomes
`transactions: <status>` (presence includes the table). The shared
TransactionsList component and the chat's showPendingApprovals flow are
unchanged — only the A2UI catalog node is generalized.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:41:47 +02:00
Maxim cb50f777ef style(showcase): satisfy lint (no-explicit-any, no-children-prop, react-compiler) + prettier
Post-gate cleanup on the A2UI re-architecture: type the op-builder test helpers
instead of `as any`, disable react/no-children-prop on the RendererProps
render-callback in the StatCard test, drop the manual useMemo in useReportSurface
(the React Compiler can't preserve it; downstream consumers guard on values), and
apply prettier.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:41:46 +02:00
Maxim 128e0894aa test(showcase): rewrite A2UI canvas e2e for the render_report flow
The spec described the abandoned render_a2ui/mirror/injectA2UITool:true path.
Update its docblock + fixture to the render_report backend-tool flow
(injectA2UITool:false, ops detected from the tool result, canvas reads the
agent message stream). Still test.fixme — the aimock fixture isn't wired into
aimock-server.mjs and no headless green run is confirmed; the live path is
verified manually.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:41:46 +02:00
Maxim 45a9b94fde fix(showcase): re-architect A2UI canvas to injectA2UITool:false + render_report tool
The injectA2UITool:true path stalled: it forced the reasoning agent (gpt-5.4)
to author the full A2UI component JSON inline via the injected tool's streamed
args, so RUN_FINISHED never fired and the surface hung at status:'building'.

Adopt the pattern both working a2ui-canvas apps use (pdf-analyst, genaiui
apartment-finder): injectA2UITool:false + an agent tool that returns
a2ui_operations, which the middleware detects and renders. Adapted to the
built-in TS agent + our bounded catalog:

- render_report: a BuiltInAgent backend tool (execute server-side) taking a
  small selection {title,kpis,charts,pendingTable,summary}; a deterministic
  op-builder expands it into A2UI v0.9 ops. The reasoning model emits only the
  tiny selection, so generation is instant — no stall.
- ReportCanvas now reads the latest a2ui-surface activity ops from the agent
  message stream (useReportSurface) and renders via A2UIProvider +
  SurfaceMessageProcessor + A2UIRenderer with the banking catalog + live
  useReportData. Deletes the legacy surface-bus + mirror-renderer relay.
- CanvasProvider derives active-surface from the stream + a local dismiss.
- wrapper: status-only a2ui-surface renderer (handoff pill); drop includeSchema.

Verified live: report prompt paints KPIs + charts on the canvas with live
figures, run completes in ~100ms, zero console errors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:41:45 +02:00
Maxim fd7ca293ba refactor(showcase): drop dead surfaceIdRef + use cn convention (A2UI canvas)
Post-review cleanup: remove the write-only surfaceIdRef in ReportCanvas
(surfaceId is read from the bus snapshot at render) and switch renderers.tsx
from direct clsx to the app-wide cn helper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:41:45 +02:00
Maxim e17a389135 test(showcase): A2UI canvas e2e + surface testid
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:41:44 +02:00
Maxim 5f21e23f4d test(showcase): A2UI banking StatCard renderer unit tests
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:41:44 +02:00
Maxim 36df34bd34 feat(showcase): wire A2UI (runtime tool, catalog context, mirror, canvas, chip)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:41:43 +02:00
Maxim 0567e5871c feat(showcase): swap content region for the A2UI report canvas
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:40:39 +02:00
Maxim 895a3021b9 feat(showcase): CanvasProvider + ReportCanvas (A2UI surface render slot)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:40:39 +02:00
Maxim 961d847abc feat(showcase): A2UI mirror renderer → surface bus + chat pill
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:40:38 +02:00