Commit Graph

127 Commits

Author SHA1 Message Date
Alem Tuzlak ed28f3a908 fix(angular): export inspector development-mode token from public API 2026-08-27 13:01:01 +02:00
Alem Tuzlak 2dec983ed8 fix(angular): restore web-inspector workspace dependency 2026-08-27 12:15:03 +02:00
Alem Tuzlak 42d3c92fbd chore: merge origin/main into tyler/default-browser-inspector 2026-08-27 12:09:27 +02:00
Tyler Slaton b3b339f544 Revert "feat(web-inspector): add Event Snippets and save-as-snippet (#6649)"
This reverts commit ba4260ad66, reversing
changes made to 47c5510b49.
2026-08-26 02:11:19 +02:00
Tyler Slaton 2bb60b67c5 style: apply repository formatting 2026-08-25 11:36:12 +02:00
Tyler Slaton b53fa8f1ea refactor(inspector): consolidate framework integration 2026-08-25 11:25:08 +02:00
Tyler Slaton 39d5598f0e fix(inspector): simplify framework lifecycle mounts 2026-08-25 11:25:07 +02:00
Tyler Slaton 240ea8a575 test(angular): verify inspector configuration before append 2026-08-25 11:25:06 +02:00
Tyler Slaton a5e072301a fix(inspector): restrict defaults to development builds 2026-08-25 11:25:06 +02:00
Tyler Slaton 4691946a8f feat: enable the Inspector by default in browser frameworks 2026-08-25 11:25:04 +02:00
Alem Tuzlak ba4260ad66 feat(web-inspector): add Event Snippets and save-as-snippet (#6649)
Open Inspector Event Snippets on localhost. You can compile, save, and
replay AG-UI events in chat. Chat shows a bookmark icon next to a tool
call, an A2UI block, or generative UI. Click the icon to save that turn
as a snippet.

## What does this PR do?

This PR adds the Inspector Event Snippets pane.

You can:

- Compile a snippet from a recipe (tool-call, reasoning, text, activity,
raw)
- Save snippets in origin-scoped localStorage
(`cpk:inspector:event-snippets`)
- Import and export snippets from the pane header
- Replay a snippet into live chat through Inspector-only Core inject

Each Run remints `messageId`, `parentMessageId`, `toolCallId`, and
`runId`. The second Run of the same snippet is a new turn.

On localhost, chat shows a bookmark icon beside a tool call, A2UI block,
or generative UI. The icon is absolutely positioned. It hangs to the
right when there is room. Otherwise it hangs to the left. The card stays
full chat width.

The React demo adds `sayHello`, `getTime`, `addNumbers`, and a **Call 3
tools** suggestion.

## Related PRs and Issues

- Linear
[OSS-874](https://linear.app/copilotkit/issue/OSS-874/new-features-also-allow-users-to-emit-specific-events-from-the)

## 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 (lets us help iterate on
your PR directly — faster turnaround for everyone)

## Testing

### Commands run

1. Lefthook pre-commit ran `nx` targets `test`, `publint`, and `attw`
for 27 affected projects. All passed.
2. I did not run `pnpm test:pr` (full repo). Lefthook ran the affected
package matrix only.

### Manual test

1. Run `pnpm demo:react` from the repo root.
2. Open http://localhost:3000
3. Open Inspector and select Event Snippets.
4. In chat, click **Call 3 tools**. Confirm three tool cards at full
chat width, with the bookmark hanging outside the card.
5. Click a bookmark, then click Run twice. Chat shows a second turn with
new IDs.

### How this PR makes testing easy

- `packages/web-inspector/src/lib/__tests__/event-snippets.test.ts`
- `packages/core/src/__tests__/inspect-inject.test.ts` (covers two
injects)
- React demo: `examples/v2/react/demo/src/app/page.tsx`

## Linked issues

Linear
[OSS-874](https://linear.app/copilotkit/issue/OSS-874/new-features-also-allow-users-to-emit-specific-events-from-the)

## Risk / rollback

- If ID remint is wrong, a second Run can no-op or duplicate a turn.
- The save icon shows on localhost Inspector (or when `showDevConsole`
is `true`).
- Rollback: revert this PR.

## Public API change

**Before**

Angular has no Inspector service.

```ts
// no CopilotInspector export from @copilotkit/angular
```

**After**

```ts
import { CopilotInspector } from "@copilotkit/angular";

const inspector = inject(CopilotInspector);
inspector.openInspector({
  messageId: "msg-1",
  menu: "event-snippets",
});
```

React and Vue apps that already mount Inspector on localhost need no new
caller code. Chat wires the bookmark through Inspector context.

`@copilotkit/core` exports `ɵinjectInspectorEvents` for Inspector only.
App code must not call it. There is no public Core emit API.
2026-08-25 09:39:37 +02:00
Alem Tuzlak 98968b49c2 fix(web-inspector): address review on event snippets
- Raw recipe: the Events JSON input now calls requestUpdate, so Run and
  Save stop being permanently disabled.
- Tool args recovery: one depth scan replaces the parse-every-prefix loop.
  Truncated args from a streaming tool call now fail at once, not after
  seconds of blocked main thread.
- Chat bookmark: hidden while the tool arguments are incomplete, so a
  partial payload cannot be captured.
- saveEventSnippet: React, Vue, and Angular wrap the body, so a compile or
  storage failure is reported instead of becoming an unhandled rejection.
- Vue and Angular now gate the in-chat affordances on a dev build plus
  localhost, the same as React. showDevConsole: true on a staging URL no
  longer puts a bookmark into a production chat.
2026-08-24 19:10:06 +02:00
Mike Ryan db88826432 chore: rename Enterprise Intelligence product copy 2026-08-24 09:38:15 -07:00
Alem Tuzlak 4bd576d4ea Merge branch 'main' into alem/oss-874-inspector-event-snippets 2026-08-24 15:48:38 +02:00
Benjamin Taylor 6e0f5773f0 Merge remote-tracking branch 'origin/main' into ben1/v2-runtime-migration
# Conflicts:
#	showcase/shell-docs/src/content/snippets/shared/generative-ui/a2ui.mdx
2026-08-21 12:49:37 -05:00
Alem Tuzlak 76c8e23a0b feat(web-inspector): add Event Snippets and save-as-snippet
Developers can compile, save, and replay AG-UI events from Inspector.

Localhost chat can save a live turn as a snippet.
2026-08-21 19:39:18 +02:00
Rainer Hahnekamp 27685a30fb chore(angular): remove obsolete safe navigation wrappers 2026-08-21 15:19:22 +02:00
Rainer Hahnekamp 2247f548b3 chore(angular): compile library at Angular 22 floor 2026-08-21 15:19:21 +02:00
Rainer Hahnekamp d248f0a7f9 chore(angular): remove empty component imports 2026-08-21 15:18:03 +02:00
github-actions[bot] 8b8097508e style: auto-fix formatting 2026-08-21 15:18:02 +02:00
Rainer Hahnekamp 18d008c423 Align Angular 22 support policy and docs 2026-08-21 15:18:02 +02:00
Rainer Hahnekamp 79c235035a Apply Angular 22 framework migrations 2026-08-21 15:18:02 +02:00
Rainer Hahnekamp fea1a13b58 Upgrade Angular toolchains to version 22 2026-08-21 15:18:01 +02:00
Rainer Hahnekamp bf18677145 preserve interrupted run IDs when resuming Angular agents 2026-08-20 15:37:07 +02:00
Rainer Hahnekamp 736742f6f9 test(angular): document unobservable thread changes 2026-08-20 15:37:07 +02:00
Murat Sari ba41a31d7c feat: implement interrupt handling in AgentStore and add injectInterrupt function 2026-08-20 15:37:07 +02:00
Murat Sari 703944880d feat(angular): expose agent capabilities 2026-08-16 22:11:36 +02:00
Murat Sari 5720cd7fdc feat(angular): support fetch credentials 2026-08-16 21:03:52 +02:00
Murat Sari dde84a5804 fix(angular): prevent duplicate OpenGenerativeUI sandboxes 2026-08-13 14:32:40 +02:00
Murat Sari 01c7283210 fix(core): prevent duplicate interrupt tool results (#6201) 2026-08-13 01:18:16 +02:00
Murat Sari cbf79ef52a fix: align Angular 20 support and resolve packed smoke paths 2026-08-11 21:49:36 +02:00
Murat Sari 4d5e3da712 feat(chat): implement input height measurement and adjust scroll view styles 2026-08-06 12:04:54 +02:00
contextablemark bc968ce96b chore: release angular v0.3.1 2026-08-03 20:50:53 +00:00
Mike Ryan ec0e496bc2 fix(showcase): restore Angular runtime parity 2026-07-28 15:25:16 -07:00
MikeRyanDev cb4ab7fd8e chore: release angular v0.3.0 2026-07-23 16:47:06 +00:00
Mike Ryan 053b00e846 fix(angular): match React MCP Apps sandbox 2026-07-23 08:51:34 -07:00
Mike Ryan cd0b5b4061 fix(angular): address SDK review findings 2026-07-23 07:48:25 -07:00
Mike Ryan fec70d086f feat(angular): checkpoint 2 - core and package 2026-07-23 07:14:55 -07:00
Manfred Steyer b3de484be1 feat(angular): MCP Apps activity renderer
Adds the opt-in secondary entry point @copilotkit/angular/mcp-apps for
rendering MCP Apps (MCP ext-apps) inline in the chat:

- CopilotMCPAppsActivityRenderer plus a ready-to-register
  mcpAppsActivityRendererConfig for activityType mcp-apps
- CopilotMCPAppsWidget loads the app's ui:// resource from the configured
  MCP server, embeds it in a sandboxed iframe, and connects an AppBridge
  that relays tool input/result, size changes, links, and log messages
- provideMCPApps registers server URLs and the host identity, capabilities,
  and context announced to embedded apps
- @modelcontextprotocol/sdk and @modelcontextprotocol/ext-apps are optional
  peer dependencies; the main entry point stays free of MCP imports

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 07:14:55 -07:00
BenTaylorDev a90ff38b46 chore: release angular v0.2.0 2026-07-21 16:09:22 +00:00
Benjamin Taylor 0b4f6ca392 fix(threads-drawer): clear stale fetch-more error, trap Escape while confirming, shield rows behind open menu (ENT-1051)
Addresses PR #5823 review (MikeRyanDev + marthakelly):

- core/threads.ts: a full-list refetch (filter-change / retry) now clears
  fetchMoreError on both listRequested and listSucceeded, so the inline
  'couldn't load more - retry' banner no longer survives onto a fresh list.
- web-components: Escape while the confirm-delete <dialog> is open is now
  consumed by a confirm guard in the host keydown handler; previously the
  bubbled keydown fell through to the mobile branch and closed the whole drawer
  along with the confirmation.
- web-components: an open kebab popover now shields the rest of the list -
  .list.menu-open .row:not(.menu-open) gets pointer-events:none so other rows
  no longer reveal their kebab or paint a host ::part(row):hover background
  around/behind the menu. Click-away dismissal is preserved via the existing
  document pointerdown handler.
- README: drop the removed --cpk-drawer-rail-width from the documented tokens.

Tests: core clears-fetchMoreError-on-refetch; web-components Escape-while-
confirming, confirm-dialog backdrop-click, menu-open row shield; Angular
scoped-chat-input focus (ancestor copilot-chat-view over the global fallback).
Menu-shield verified live in the langgraph-js example (:3002).
2026-07-07 14:01:12 -05:00
Benjamin Taylor 8bfd245305 feat(web-components,react,vue,angular): restore collapse + drawer-centered modal [ENT-1051]
Design iteration (Ben's designer):

- RESTORE desktop collapse. Re-add collapsed/collapsible + collapse-change
  (element + all three wrappers, lockstep), the desktop header collapse toggle,
  and the CollapseChangeDetail type/re-export. Default is EXPANDED.
- UNIFY the closed affordance into one floating cluster (Figma 'closed' mockup):
  a sidebar-glyph toggle + a New Conversation (+) icon button, shown in BOTH the
  mobile-closed state (adds New Conversation to the old single launcher) and the
  desktop-collapsed state. Parts: launcher-cluster, launcher, launcher-new-thread.
- COLUMN RECLAIM (no empty reserved gap): on desktop-collapse the element sets
  --cpk-drawer-reserved-width: 0px on the document root (reaches the grid past
  the wrapper host via :root inheritance); hosts read it in grid-template-columns.
  Default expanded never sets it, so no hydration flicker.
- DELETE MODAL centered over the DRAWER PANEL, not the viewport: keeps the
  top-layer showModal() robustness (never clipped) but drives --confirm-cx/cy
  from the visible .root rect and caps width to the drawer band.
- Vue fix: default collapsible to true in the wrapper. Vue coerces an omitted
  Boolean prop to false, which was silently forcing collapsible=false (collapse
  toggle vanished) — React/Angular pass undefined and keep the element default.

Validated live in the Nuxt (Vue) and Angular demos against managed Intelligence:
collapse/expand, cluster + New Conversation, column reclaim, drawer-centered
top-layer modal, mobile cluster. Tests: web-components 89, react-core 1419,
vue 32, angular 34 — all green.
2026-07-07 08:35:22 -05:00
Benjamin Taylor 01d5850ae8 refactor(web-components,react,vue,angular): drop desktop collapse from threads drawer [ENT-1051]
The thread panel is a persistent always-visible sidebar on desktop; the Figma
"closed" mockup is the MOBILE state, already covered by off-canvas behavior.

- web-components: remove the `collapsed`/`collapsible` properties,
  `_toggleCollapsed`, the header collapse-toggle button, and the
  collapsed-cluster render branch; render() always paints the full panel body.
  Gate the now control-less header on a `_hasHeader` slotchange flag so no empty
  bar renders. Drop the unused `iconSidebar`, the `CollapseChangeDetail` type +
  `collapse-change` event-map entry, the index re-export, and the
  `.root.collapsed`/`.collapsed-cluster` styles.
- react: drop the `collapsible` prop + property assignment, the
  `onCollapseChange` prop + `collapse-change` listener/handler, and the local
  `CollapseChangeDetail` type.
- vue: drop the `collapsible` prop + element binding, the `collapse-change`
  emit + `@collapse-change` handler, and the local `CollapseChangeDetail` type.
- angular: drop the `collapsible` input + property push, the `collapseChange`
  @Output + event wiring (and now-unused EventEmitter/Output imports), and the
  local `CollapseChangeDetail` type.
- tests: remove all collapse tests across the four packages; add an element
  header-gating test. Mobile off-canvas (open-driven) behavior is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 14:15:58 -05:00
Benjamin Taylor 9c4dcabd52 feat(react,vue,angular): remove CopilotThreadsDrawer search passthrough [ENT-1051]
Also fixes the collapsible-default test assertion (element defaults collapsible=true,
mirroring licensed; the prior undefined assertion only passed vs a stale dist).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 13:44:20 -05:00
Benjamin Taylor c6af37f9fa feat(react,vue,angular): CopilotThreadsDrawer collapsible + onCollapseChange passthrough [ENT-1051]
Mirror the existing recentLabel (passthrough) and onSearch (element-event)
props with two additive props targeting the element's forthcoming
`collapsible` property and `collapse-change` event.

- react: add `collapsible?: boolean` (pushed as an element PROPERTY, like the
  default-true boolean `licensed`) and `onCollapseChange?: (collapsed) => void`
  (wired via the handler-ref addEventListener block, like onSearch).
- vue: add `collapsible?: boolean` (imperative property push in the
  watchEffect, like `licensed`) and re-emit the element's `collapse-change`
  event as `collapse-change(collapsed)` (matching the `search` emit convention).
- angular: add a `collapsible` signal input (property push in the effect, like
  `licensed`) and `@Output() collapseChange = new EventEmitter<boolean>()`
  wired from the element's `collapse-change` event (like `search`).

CollapseChangeDetail is declared locally in each wrapper with a TODO to switch
to the package export once the parallel element PR that adds the collapse
feature lands and is published (the built element types in this worktree
predate it).

Testing: added mirrored tests per framework (property-set + event-passthrough);
full nx test suites green (react-core 1420, vue 1070, angular 178); check-types
and build green for all three packages.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 13:13:55 -05:00
Benjamin Taylor ddcb4764ca fix(web-components,react,vue,angular): CR round 2 — open=false default + dead-CSS/comment/test cleanup [ENT-1051]
Bucket A — mobile open-flash:
- Default the drawer element's `open` property to `false`. On a mobile viewport
  the previous `open = true` default made the first render satisfy
  _isMobileModalOpen(), painting the modal + body scroll-lock + focus steal for
  one frame before any wrapper effect could close it. Desktop is unaffected
  (only .root.mobile.open / _isMobileModalOpen() consume `open`).
- Element tests: added an `open` option to setup(); updated the 6 mobile/desktop
  tests that relied on the old open=true default to opt in explicitly; added a
  regression test asserting a fresh mobile element defaults open=false and paints
  no backdrop / applies no scroll-lock until opened.

Bucket B — dead CSS + inert `confirming` machinery:
- styles.ts: removed the `.row-action[data-tooltip]` hover/focus tooltip rules
  and the `.root.confirming .row-action[data-tooltip]…` suppression rules — no
  rendered .row-action carries data-tooltip anymore (row actions moved into the
  kebab menu as labeled .row-menu-items). Kept the .row-action base rules (still
  used by the confirm-dialog Cancel button + fetch-more retry).
- element: removed the now-inert `confirming` root class (it gated only the
  dead CSS above) and its stale comment; deleted the test asserting the no-op
  tooltip suppression. Refreshed two comments that referenced the removed
  row-action tooltip lineage.

Bucket B — comment/test hygiene:
- react-core CopilotThreadsDrawer.tsx: reworded the imprecise event-rebind
  comment to describe the actual [mounted] deps.
- angular spec: added a beforeEach resetting the module-level threadsState
  signals + clearing mock fns to remove order-coupling (parity with react/vue).
- vue use-threads.test.ts: aligned MockThreadStore.unarchiveThread + its
  assertion to the real core contract (PATCH /threads/{id} { archived:false },
  not POST /threads/{id}/unarchive).

Verified: web-components (89), vue (1068), angular (176), react-core suites all
green; web-components + react-core builds green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 11:40:52 -05:00
Benjamin Taylor 9407cfdd7d fix(core,react,vue,angular): CR round 1 — fetchMoreError + Angular open-state/focus + parity nits [ENT-1051]
D2 — wire fetchMoreError end-to-end:
- core: add a dedicated `fetchMoreError` channel to the thread store, tracked
  separately from the initial-list `error`. `nextPageFailed` now writes
  `fetchMoreError` (was `error`), so a paginated-load failure preserves the
  loaded list and drives the element's inline "couldn't load more — retry"
  panel instead of a full-panel error. Cleared on fetch-more request (retry),
  on success, and reset on context change / stop. New symbols:
    * `ThreadState.fetchMoreError`
    * `ThreadSelectors.fetchMoreError` + `ɵselectFetchMoreError`
  Call sites of `ɵselectFetchMoreError`:
    * packages/core/src/threads.ts (export)
    * packages/react-core/src/v2/hooks/use-threads.tsx (selector read)
    * packages/vue/src/v2/hooks/use-threads.ts (bindThreadStoreSelector)
    * packages/angular/src/lib/threads.ts (bridge to signal)
    * packages/vue/src/v2/hooks/__tests__/use-threads.test.ts (core mock)
  Call sites of `ThreadSelectors.fetchMoreError` (mock objects updated):
    * packages/core/src/__tests__/core-thread-store-auto-unregister.test.ts
    * packages/core/src/__tests__/thread-store-registry.test.ts
- react/vue/angular: expose `fetchMoreError` on the hook/composable/store and
  push it onto `el.fetchMoreError`, making the dead `retry{scope:"fetch-more"}`
  handler reachable. Initial-list error behavior unchanged.

D1 — Angular wrapper open-state coordination: drive `el.open` from the config's
`drawerOpen` (default CLOSED) so the element no longer springs open full-screen
and scroll-locks on mobile load; handle `(open-change)` -> `config.setDrawerOpen`
with a provider-less local-state fallback; call `config.registerDrawer()` with
cleanup on destroy. The config's drawer members were fully functional (only
marked "RESERVED/unwired") — wiring them makes them consumed, so their comments
were updated accordingly (no reservation conflict).

D3 — Angular focus-return: add a `findChatInput` scoped to the Angular chat
selectors (`copilot-chat-view` container, `textarea[copilotChatTextarea]`) and
focus it on thread select, mirroring React/Vue.

A6 — react wrapper comment rot: "nine outbound events" -> "eleven" (2 spots).

DEFAULT_AGENT_ID parity (react): import `DEFAULT_AGENT_ID` from
`@copilotkit/shared` instead of hardcoding `"default"` (equal value).

Angular test isolation: three list-path tests now set `licenseStatusSignal`
explicitly instead of relying on inherited module-level state.

Tests: core 552, react-core 1417, vue 1068, angular 176 — all pass;
check-types passes for all four packages.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 11:12:29 -05:00
Benjamin Taylor 8e3c073a8f feat(angular): CopilotThreadsDrawer recentLabel + search parity [ENT-1051]
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 09:53:24 -05:00
Markus Ecker 01469359a8 merge: integrate origin/main into mme/memory-core
Resolve the single conflict in packages/web-inspector/src/index.ts by keeping
both additions: this branch's CpkMemoryList memory-tab element and main's
ɵCpkThreadDetails back-compat alias (independent top-level declarations).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 17:26:01 +02:00
Maximiliano Korp 12739f9b42 fix(core): gate idle reconnect fallback by cursor 2026-07-01 11:07:07 -07:00