Commit Graph

12916 Commits

Author SHA1 Message Date
Tyler Slaton 6852af941e fix(shell-docs): use lfs png for og logo 2026-06-29 15:16:28 -07:00
Tyler Slaton a093c4cc3b fix(shell-docs): simplify docs OG cards 2026-06-29 15:07:42 -07:00
Tyler Slaton 6a5a301b0c fix(shell-docs): restore docs OG previews 2026-06-29 15:01:30 -07:00
Mark 5c50d9c515 docs(cookbook): polish OpenBox recipe per launch feedback (#5770)
## What does this PR do?

Follow-up polish on the **OpenBox Governance** cookbook recipe (shipped
in #5686), addressing review feedback from the launch. All changes are
in the single recipe page; no functional/code changes.

| Feedback | Change |
| --- | --- |
| "Make this an actual diagram — hard to read as ASCII" | Replaced the
ASCII flow under **How it works** with a real, color-coded **inline-SVG
architecture diagram** (same self-contained pattern as the Oracle recipe
— no external assets). |
| "Huge, scary warning — condense it" | Cut the wall-of-text
**provisioning** warning down to a few lines while keeping the
essentials (idempotent, which keys it needs, how to verify). |
| "Prompts are unreadable in the chart layout → accordions" | Converted
the **Try it** governance-matrix table into one **accordion per prompt**
(verdict-labeled), so the long prompts are on-demand instead of crammed
into table cells. |
| "Highlight the important stuff — guide the user. Applies to all code."
| Added line highlighting across the bash + TypeScript samples so the
key lines (the runtime wrap, `selfGovernedToolNames`, middleware-first,
the provisioning command, the approval schema) stand out. |
| "Move this to the top top and make it an accordion" | Moved the
**coding-agent prompt** from the bottom to just under the intro,
collapsed in an accordion. |

## Verification

Rendered locally against `shell-docs` (`next dev`) and confirmed
in-browser: the SVG diagram renders, all five accordions expand
correctly, the warning is condensed, and code highlighting shows on both
bash and TS blocks (no leaked `[!code]` markers).

## Related

- Recipe (merged): #5686
- Source-link hotfix (merged): #5767
- Companion showcase (pending): #5685 — once it lands, restore the
direct `tree/main/...` source link in **Get the code**.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-06-29 14:31:27 -07:00
Ran Shemtov c45f471330 Merge branch 'main' into claude/happy-dirac-f6ed5e 2026-06-29 23:07:27 +02:00
GeneralJerel 819154a3e2 docs(cookbook): polish OpenBox recipe per launch feedback
Address review feedback on the OpenBox Governance recipe:
- Replace the ASCII flow with a real inline-SVG architecture diagram
- Condense the wall-of-text provisioning warning to a few lines
- Convert the governance-matrix table into per-prompt accordions
- Highlight the key lines across the code samples to guide the reader
- Move the coding-agent prompt to the top in a collapsed accordion
2026-06-29 14:06:10 -07:00
Ran Shem Tov 8582f59381 fix(react-core): render nothing for unhandled tool calls instead of auto default card
- Revert the v2 useRenderToolCall fallback: when no per-tool or wildcard renderer is
  registered, return null instead of auto-painting DefaultToolCallRenderer. Showing the
  card is opt-in via useDefaultRenderTool().
- The auto-card default shipped silently in v1.57.2 (commit ba60df5d33, buried in a
  showcase per-tool-testids commit, no CHANGELOG entry) and leaked internal tool names +
  raw args/result JSON (e.g. generate_a2ui) into every v2 app's chat in production.
- Remove the now-dead defaultToolCallRenderAdapter + __testOnly_ export + unused imports.
- Rewrite the resolver test to assert the 3-state opt-in contract: useDefaultRenderTool()
  -> card, useDefaultRenderTool({render}) -> custom, no hook -> nothing.
2026-06-29 22:49:15 +02:00
Martha Schumann 3fdccae88b ci: allow web inspector dev vite config 2026-06-29 13:03:48 -07:00
Martha Schumann 740e90af86 Merge origin/main into unified thread debugger 2026-06-29 13:00:27 -07:00
github-actions[bot] eae06ced22 style: auto-fix formatting 2026-06-29 19:58:11 +00:00
Martha Schumann 33fda98a41 Merge origin/main into unified thread debugger 2026-06-29 12:56:44 -07:00
Tyler Slaton 25bac6ce6b docs(cookbook): mark OpenBox recipe source as "to follow" until the showcase lands (#5767)
## What does this PR do?

The **OpenBox Governance** cookbook recipe (#5686) merged to `main`
ahead of its companion showcase (#5685), so the recipe's **"Get the
code"** section linked to:


`https://github.com/CopilotKit/CopilotKit/tree/main/examples/showcases/openbox-governed-copilotkit`

…which **404s** today because that code isn't on `main` yet.

This swaps the broken link for a plain-text **"Full source to follow"**
note (no hyperlink, so nothing 404s) that still describes what the
showcase will contain. The live **upstream reference-repo** link
directly below it is kept.

```diff
- Full source: [`examples/showcases/openbox-governed-copilotkit`](https://github.com/.../tree/main/examples/showcases/openbox-governed-copilotkit) — `agent/` … and `frontend/` …
+ Full source to follow — the runnable showcase (the `agent/` LangGraph service with OpenBox middleware and the `frontend/` CopilotKit V2 chat with the wrapped runtime and approval route) will be published under `examples/showcases/openbox-governed-copilotkit`.
```

**Follow-up:** once the showcase merges to `main`, restore the direct
`tree/main/...` link.

_Note:_ the recipe's run-instructions still `cd` into that path
(expected — the whole "run it yourself" flow assumes the code), so those
steps only work once the showcase lands. Left as-is since they read as
setup instructions, not a clickable link.

## Related PRs and Issues

- Docs recipe (merged): #5686
- Companion showcase (pending): #5685

## Checklist

- [x] I have read the [Contribution
Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md)
- [x] If the PR changes or adds functionality, I have updated the
relevant documentation
- [x] "Allow edits by maintainers" is checked

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01Fr5HVeDzDyC4S6DjyhAFWZ

---
_Generated by [Claude
Code](https://claude.ai/code/session_01Fr5HVeDzDyC4S6DjyhAFWZ)_
2026-06-29 12:34:08 -07:00
Claude 09291c09b0 docs(cookbook): mark OpenBox recipe source as "to follow" until the showcase lands
The OpenBox Governance recipe (#5686) merged ahead of its companion
showcase (#5685), so the "Get the code" link pointed at
github.com/.../tree/main/examples/showcases/openbox-governed-copilotkit,
which 404s while that code is not yet on main.

Replace the broken link with a plain "Full source to follow" note (no
hyperlink, so nothing 404s) that still describes what the showcase will
contain. The live upstream reference-repo link is kept. Swap the link
back in once the showcase merges to main.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fr5HVeDzDyC4S6DjyhAFWZ
2026-06-29 19:24:27 +00:00
Martha Schumann aed9ad924b fix(web-inspector): keep thread timeline populated 2026-06-29 12:24:17 -07:00
Mark 4afc47d750 docs(cookbook): OpenBox Governance recipe (#5686)
## What this adds

A new **"OpenBox Governance"** recipe in the cookbook
(`showcase/shell-docs`), documenting how to add **OpenBox runtime
governance** — guardrails, OPA/Rego policy, redaction, human-in-the-loop
approvals, and halt — to a **CopilotKit + LangGraph** agent, with
decisions rendered as generative UI.

Follows the existing cookbook recipe pattern (Oracle / Arcade /
Daytona):

- `src/content/docs/cookbook/openbox-governed-copilotkit.mdx` — the
recipe (how it works, the stack, prerequisites, run + **provisioning**
steps, the four-verdict governance matrix, the key pieces in code, going
further).
- `meta.json` — registers the recipe in cookbook nav.
- `index.mdx` — overview `<Card>`.
- `src/lib/sidebar-icon.tsx` — `custom/openbox` sidebar icon.
- `public/logos/openbox.png` — brand mark (Git LFS).

The recipe documents the companion showcase **at full parity**: the
provisioning step (`npm run openbox:admin:setup`), the Allow / Constrain
/ Approval / Block / Halt matrix using the demo's real suggestion
prompts, and "key pieces in code" snippets pulled verbatim from the
final showcase source (the LLM-driven governed engine, the
OpenBox-middleware-first agent, and the runtime + approval routes).

## Red → green (TDD)

The cookbook-nav test in `src/lib/__tests__/docs-render.test.ts` is the
red/green hook — it hard-asserts the recipe count, titles, slugs, and
URLs (6 entries incl. `["OpenBox Governance",
"cookbook/openbox-governed-copilotkit"]`).

## Verification

- `docs-render` test suite: **15/15** (nav asserts 6 entries).
- `next build`: ✅ (all cookbook routes, no MDX/link errors).
- The run-steps, four-verdict matrix, and code snippets were verified
against the **final** demo source (companion PR #5685), so the docs and
the runnable code stay in sync.

## Companion demo PR

The runnable showcase this recipe documents:
**https://github.com/CopilotKit/CopilotKit/pull/5685**

> **Ships standalone.** This recipe no longer links the hosted live demo
— that link now lives on the companion demo PR (#5685), so the cookbook
recipe can merge independently of the demo deployment.
2026-06-29 11:55:50 -07:00
Ran Shemtov 2d3bf689ee feat(react-core): add client-side onAction interceptor to v2 A2UI renderer (#5719)
## Problem

There is currently no way to intercept an A2UI action before it reaches
the agent when using `createA2UIMessageRenderer`. Every dispatched
action is forwarded to the agent unconditionally:

1. `A2UIMessageRendererOptions` exposed only `{ theme, catalog?,
loadingComponent?, recovery? }` with no `onAction`
(`packages/react-core/src/v2/a2ui/A2UIMessageRenderer.tsx`).
2. `ReactSurfaceHost` mounted `<A2UIProvider onAction={handleAction}>`
and `handleAction` always called `copilotkit.runAgent({ agent })`
unconditionally.
3. Per-component interception fails: `web_core@0.9.0`'s `GenericBinder`
classifies any prop whose Zod schema is a union containing `{ event }`
as `ACTION` and replaces the raw value with a zero-arg dispatching
closure (so `props.action` is a function, `props.action.event` is
undefined).
4. `functionCall` actions are dropped, not a workaround:
`surface-model.js` `dispatchAction` only emits when the payload has
`event`, and `createCatalog` provides no way to register client
functions.

Raised in Discord by a user with a custom catalog + custom Button who
needs a `navigate` event handled client-side. DevRel confirmed
`onAction` was not exposed.

## Change

Add an optional `onAction` interceptor to `createA2UIMessageRenderer`:

```ts
onAction?: (
  action: A2UIUserAction,
  forward: (action?: A2UIUserAction) => Promise<void>,
) => void | A2UIUserAction | null | Promise<void | A2UIUserAction | null>;
```

- Return `null` to handle the action client-side and stop forwarding
(agent is not run).
- Return an `A2UIUserAction` to forward the (possibly modified) action.
- Return `undefined` / `void` to forward unchanged.

The interceptor is threaded from `createA2UIMessageRenderer` options
through `ReactSurfaceHost` into `handleAction`. The forwarding logic is
extracted into a `runA2UIAction` helper so the three behaviors are
unit-testable. The original finally-block property cleanup is preserved,
and default behavior is byte-identical when `onAction` is not supplied.
New `A2UIActionInterceptor` type is exported from the v2 entrypoint.

## Tests

Added to
`packages/react-core/src/v2/__tests__/A2UIMessageRenderer.test.tsx`:
- `onAction` returning `null` does not run the agent.
- `onAction` returning a modified action forwards the modified payload.
- No `onAction` forwards the original message unchanged.
- `onAction` returning `undefined` forwards unchanged.

## Verify

- `nx test react-core` (1374 passed)
- `nx run-many -t lint build --projects=react-core` (clean)
2026-06-29 20:38:15 +02:00
Ran Shemtov ead9ed75ea Merge branch 'main' into claude/trusting-carson-933f4b 2026-06-29 20:37:40 +02:00
GeneralJerel 698f739e8a fix(examples): repair dangling HITL tool-calls + HTML-unescape persisted memory in oracle showcase
Ports two fixes from the canonical oracle-cookbook demo into the oracle-agent-memory
showcase agent (server.py was byte-identical to the demo's pre-fix version):

1. Dangling tool-calls: booking conversationally calls the book_flight HITL tool,
   which interrupts and emits an assistant tool_call awaiting the UI's Confirm/Cancel.
   If the traveler sends another chat message instead, the unanswered tool_call made
   the next turn 400 ("tool_call_ids did not have response messages"). _repair_dangling_tool_calls
   synthesizes a "not completed" tool result for any dangling call before the history
   reaches the graph. (Inverse of the duplicate-tool-block issue the history-replace
   already handled — documented in docs/known-issues/agentspec-multiturn-toolcall-correlation.md.)

2. HTML-escaped persistence: the agentspec exporter HTML-escapes streamed deltas
   (& < > -> &amp; &lt; &gt;); the SSE generator persisted them raw, so assistant
   replies were stored in Oracle Agent Memory as e.g. "fares &lt; $700".
   _clean_assistant_text html.unescapes the assembled text before persisting.

Both are reproduced + verified in oracle-cookbook (unit tests + in-browser); the ported
functions are byte-identical to the verified demo code.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 11:00:37 -07:00
GeneralJerel e6e26aea8d docs(cookbook): drop hosted-demo link from OpenBox recipe so it ships standalone 2026-06-29 10:53:43 -07:00
Jerel Velarde 152fdbbadd docs(cookbook): OpenBox recipe requires OPENAI_MODEL (gpt-5.4-mini-2026-03-17), no gpt-4o default
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 10:14:59 -07:00
Jerel Velarde 598fd7c51e docs(cookbook): point OpenBox recipe Try-it-live at hosted demo
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 10:10:24 -07:00
Jerel Velarde 529ab465bb Merge branch 'main' into showcase/openbox-cookbook-recipe 2026-06-30 00:59:02 +08:00
Ran Shemtov dac0e5154f test(showcase): wire a2ui-recovery into the d5/d6 harness fleet (#5722)
Follow-up to #5720 (merged). That PR added the **A2UI Error Recovery**
demo (`a2ui-recovery`) across google-adk +
langgraph-{python,fastapi,typescript} + strands{,-typescript}, but the
recovery flow was only exercised by the manual on-demand workflow
(`/test-aimock`). It was NOT covered by the per-PR d5/d6 fleet harness,
so a regression in heal/exhaust would not turn any automatic CI cell
red.

## What this does

Adds a `d5-a2ui-recovery` probe and wires it into the harness so
`a2ui-recovery` runs on every PR like `gen-ui-declarative`:

- **New probe**
`showcase/harness/src/probes/scripts/d5-a2ui-recovery.ts` drives both
pills in one session and asserts the stable end-states:
- **HEAL**: the healed surface paints (>= 2 newly-mounted
`declarative-metric` tiles) and NO "Couldn't generate the UI" card.
- **EXHAUST**: the hard-failure "Couldn't generate the UI" card appears
and NO surface paints.
- Assertions are delta-based against a pre-send baseline so the two
mutually-exclusive negatives stay correct across the shared two-turn
session. The transient "Retrying..." label is not asserted
(timing-flaky).
- **Per-slug prompts**: the recovery prompts are unique per integration
slug (the inner `render_a2ui` calls carry no `x-aimock-context`, so
identical prompts would collide in the shared aimock matcher). The probe
sends each slug's exact `suggestions.ts` message as typed input, which
is byte-identical to the pill dispatch and matches the same fixture.
Heal is sent exactly once (its fixture stages invalid->valid via
`sequenceIndex` 0->1).
- **Wiring**: register `a2ui-recovery` in `d5-registry`, map it in
`d5-feature-mapping` (`"a2ui-recovery": ["a2ui-recovery"]`), add its
representative fixture in `d5-representatives`, and mirror the mapping
in the dashboard `CATALOG_TO_D5_KEY` (kept in lock-step by the drift
test).

## Verification

Local fleet harness, both recovery paths green (heal + exhaust):

- `showcase test langgraph-python:a2ui-recovery --d6 --isolate` -> green
(backend-owned `get_a2ui_tools` path)
- `showcase test strands:a2ui-recovery --d6 --isolate` -> green
(auto-inject middleware path)

Harness unit tests pass (`d5-representatives`, `d5-mapping-drift`,
`starter-mapping-drift`); harness typecheck clean.

## Note (separate, pre-existing)

The on-demand workflow `test_e2e-showcase-on-demand.yml` is currently
broken for all slugs: it installs `@copilotkit/aimock@^1.16.4` then
invokes `aimock --fixtures ...`, but the resolved aimock CLI no longer
accepts `--fixtures` (`Error: Unknown option '--fixtures'`, only
`-c/--config`). aimock dies at the "Start aimock" step before any test
runs. This is unrelated to the recovery demo and is tracked separately.
2026-06-29 18:54:06 +02:00
Ran Shemtov 4cc25b56bf Merge branch 'main' into claude/jolly-brown-77c87b 2026-06-29 18:53:01 +02:00
github-actions[bot] a08b5f796d style: auto-fix formatting 2026-06-29 16:17:28 +00:00
greymoth 821c57e979 fix(angular): skip chat input submit during IME composition
The Angular CopilotChatInput sends the message on Enter without checking
for IME composition, so confirming a CJK candidate with Enter submits the
half-composed text. The React (react-core v2) and Vue (vue v2) bindings of
the same CopilotChatInput already guard this with isComposing/keyCode 229.
2026-06-30 01:16:51 +09:00
Markus Ecker 4a30b972bd fix(web-inspector): guard core.getMemoryStore() for older-core compatibility 2026-06-29 17:21:20 +02:00
Markus Ecker f40f3be41d test(web-inspector): memories tab + cpk-memory-list coverage 2026-06-29 17:14:49 +02:00
Markus Ecker 2e211c314d feat(web-inspector): memories view states + locked teaser 2026-06-29 17:03:49 +02:00
Markus Ecker d0aad77f1f feat(web-inspector): cpk-memory-list (card list + search + kind filter) 2026-06-29 17:00:11 +02:00
Markus Ecker bdacfbe0c7 feat(web-inspector): register the Memories tab + render dispatch + telemetry 2026-06-29 16:57:14 +02:00
Markus Ecker a37d86cfde feat(web-inspector): memories tab telemetry event + tracker 2026-06-29 16:52:55 +02:00
Markus Ecker 0e71e4900e fix(web-inspector): re-render on memory store updates 2026-06-29 16:50:52 +02:00
Markus Ecker 045414539a feat(web-inspector): subscribe to the core memory store 2026-06-29 16:47:53 +02:00
Alem Tuzlak 028542adc5 refactor(bot): dedup ingress event interfaces via IngressEventBase + IngressIds 2026-06-29 16:22:39 +02:00
Alem Tuzlak bab850e357 fix(bot-intelligence): guard resolveActivationEnv against a missing process global 2026-06-29 16:20:58 +02:00
Alem Tuzlak 818684ae70 refactor(bot-slack): point-free renderEgress/normalizeIngress in slackCodec 2026-06-29 16:13:22 +02:00
Markus Ecker ecbcd092ce feat(react-core): useMemories() is a no-arg consumer of the core memory store 2026-06-29 15:54:42 +02:00
GeneralJerel fac83b0ca6 feat(examples): add optional Oracle LangGraph checkpointer to oracle-agent-memory showcase
Flag-gated (LANGGRAPH_CHECKPOINTER=oracle, default memory) AsyncOracleSaver from
langgraph-oracledb for durable per-thread LangGraph graph state in Oracle,
complementing oracleagentmemory. Default-safe (in-memory fallback). Mirrors
jerelvelarde/oracle-cookbook#4. Draft, stacked on #5563.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 06:51:10 -07:00
GeneralJerel 2d5a6fe6aa Merge upstream/main into showcase/oracle-agent-memory (refresh for review) 2026-06-29 06:40:39 -07:00
Markus Ecker 0c1acf30c7 test(core): cover core-owned memory store singleton + context wiring 2026-06-29 15:34:54 +02:00
Markus Ecker 8650aa1129 feat(core): core owns a single user-scoped memory store (drop agentId registry) 2026-06-29 15:29:53 +02:00
Markus Ecker 35950615cf test(core): cover memory silent-degrade on unconfigured routes
Add three flat test cases verifying the silent-degrade contract:
404/501 list response sets available:false with no error; 500 response
sets error and keeps available:true; 404 subscribe response is silent
with no console.warn emitted.
2026-06-29 15:22:10 +02:00
Markus Ecker 4eadf9cbb5 feat(core): memory fetch/credentials tolerate unconfigured routes (404/501) 2026-06-29 15:19:51 +02:00
Markus Ecker 44147ff03a feat(core): add ɵselectMemoriesAvailable selector 2026-06-29 15:16:54 +02:00
Markus Ecker 8656aae530 feat(core): add listUnavailable/credentialsUnavailable actions and available state
Adds listUnavailable and credentialsUnavailable to memoryRestEvents, adds
available: boolean to MemoryState (defaulting to true), resets available to
true on contextChanged and listRequested, and handles listUnavailable by
clearing memories and setting available: false with a session guard.
2026-06-29 15:11:54 +02:00
Alem Tuzlak 57a684c6a5 feat(bot-intelligence): gather activation env + per-bot commands in metadata (OSS-360) 2026-06-29 14:47:36 +02:00
Alem Tuzlak 6d038d436e feat(bot-slack): extract pure Slack ingress normalization for shared reuse (OSS-363) 2026-06-29 14:41:16 +02:00
Alem Tuzlak 972dd64476 refactor(bot): split the Intelligence managed adapter into @copilotkit/bot-intelligence
Move the Intelligence-delivered managed-bot surface out of @copilotkit/bot into
its own package so the adapter, transports, contracts, and lifecycle ship
independently of bot core.

- New @copilotkit/bot-intelligence: intelligenceAdapter + DeliverySource/EgressSink
  (+ in-memory impls) + placeholder contracts + startManagedBots/validation/
  activation metadata. Production code imports only types from @copilotkit/bot
  and @copilotkit/bot-ui.
- @copilotkit/bot keeps the generic PlatformCodec seam (moved to src/codec.ts) and
  all core createBot changes (addAdapter, deferred store, id fields,
  __managed/skipIngressDedup, exclusive guard). It now also exports the
  FakeAdapter/FakeAgent test utilities for downstream adapter-package tests.
- Registered the new release scope: release.config.json, scripts/release/lib/
  config.ts, and the canary/publish/stable release workflows.

Tests preserved: bot 150 + bot-intelligence 19 (= the prior 169); bot-slack 261.
Builds typecheck across bot/bot-intelligence/bot-slack/runtime; publint/attw/
oxlint/oxfmt clean.
2026-06-29 14:30:28 +02:00
Alem Tuzlak 49767661ba feat(bot-slack): expose slackCodec via ./codec subpath for Bolt-free import 2026-06-29 14:03:32 +02:00