Commit Graph

1601 Commits

Author SHA1 Message Date
Alem Tuzlak fa239e99fc feat(bot-whatsapp): webhook ingress — listener + signed HTTP server 2026-06-15 14:46:50 +02:00
Alem Tuzlak 2dc28f4901 feat(bot-whatsapp): buffered run renderer (no streaming) 2026-06-15 14:40:05 +02:00
Alem Tuzlak b61cdc0e94 feat(bot-whatsapp): pluggable HistoryStore + per-turn history replay 2026-06-15 14:35:46 +02:00
Alem Tuzlak d261e70ebe feat(bot-whatsapp): interaction decode, Cloud API client, inbound media parts 2026-06-15 14:30:54 +02:00
Alem Tuzlak 4cbc178f6d feat(bot-whatsapp): map IR to Cloud API text/button/list payloads 2026-06-15 14:12:16 +02:00
Alem Tuzlak 185814ba61 feat(bot-whatsapp): add types, render limits, and markdown->WhatsApp transform 2026-06-15 14:03:56 +02:00
Alem Tuzlak 61c13f86bb chore(bot-whatsapp): scaffold package 2026-06-15 13:51:01 +02:00
Tyler Slaton f655013dd2 fix(showcase): harden built-in-agent root rollout 2026-06-12 17:17:18 -07:00
Mark dedaa66cef Merge branch 'main' into main 2026-06-12 12:40:55 -07:00
Mark Fogle 450d47f90e fix(react-ui): forward data-testid to chat textarea + align selector names
Addresses review feedback on #4215 / OSS-192.

- Thread an explicit `data-testid` prop through `AutoResizingTextarea` so it
  reaches the rendered <textarea>. The component destructures a fixed prop set
  with no `{...rest}` spread, so the id passed from Input.tsx was silently
  dropped and never landed in the DOM.
- Align selector names with the V2 components in @copilotkit/react-core:
  `copilot-chat-textarea` on the textarea and `copilot-send-button` on the send
  control. The legacy `data-test-id` values are preserved for back-compat.
- Add a source-level test asserting the Input wiring and that Textarea forwards
  the prop (the dropped-prop guard); the package's vitest runs in a node env
  with no DOM harness, matching the existing testids.test.ts convention.

Stable selectors let tests locate the controls; the headless input-driving
issue in #4215 remains a separate follow-up and should stay open.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12 18:06:31 +00:00
jinhyuk9714 9639b8d4d6 fix(react-core): refresh thread headers on provider updates 2026-06-12 12:47:32 -05:00
Tyler Slaton 468b28b0d1 fix(vue): adjust pin-to-send spacer in both directions to keep the user message pinned
Ports the usePinToSend half of #5386 to the Vue package, which is a
documented 1:1 parity port and retained the shrink-only ResizeObserver.
When content below the anchored user message loses height (suggestions
swap, input resize), the spacer now grows back so total scrollable space
below the bubble stays constant and the message stays pinned (#5355).
Vue has no scroll-to-bottom button, so the listener half of #5386 does
not apply.
2026-06-12 10:44:47 -07:00
Tyler Slaton 930e182d41 fix(react-core): stabilize pin-to-send scrolling (#5386)
## What does this PR do?

Fixes `pin-to-send` scrolling in the v2 chat view.

- Re-attaches the non-autoscroll scroll listener after the real scroll
element mounts by depending on `nonAutoScrollEl`, not the stable
`scrollRef` object.
- Lets the `usePinToSend` spacer adjust in both directions as content
below the pinned user message changes, so the user message stays
anchored after streaming finishes and layout height changes.
- Adds regression coverage for the scroll-to-bottom button and spacer
adjustment behavior.

## Related PRs and Issues

Fixes #5355

## Tests

- `corepack pnpm -C packages/react-core exec vitest run
src/v2/hooks/__tests__/use-pin-to-send.test.tsx
src/v2/components/chat/__tests__/CopilotChatView.pinToSend.test.tsx`
- `corepack pnpm exec oxfmt --check
packages/react-core/src/v2/components/chat/CopilotChatView.tsx
packages/react-core/src/v2/hooks/use-pin-to-send.ts
packages/react-core/src/v2/hooks/__tests__/use-pin-to-send.test.tsx
packages/react-core/src/v2/components/chat/__tests__/CopilotChatView.pinToSend.test.tsx`
- `git diff --check`

Attempted:

- `corepack pnpm -C packages/react-core run check-types`
- This failed in the local workspace on existing/type-resolution issues
outside this diff, including `react-markdown` JSX namespace errors,
missing `@copilotkit/runtime-client-gql` declarations, and existing e2e
mock `AbstractAgent` private member mismatches.

## 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 (N/A: bug fix only, no API/docs change)
- [x] "Allow edits by maintainers" is checked (lets us help iterate on
your PR directly — faster turnaround for everyone)
2026-06-12 10:34:38 -07:00
Austin Merrick 5e828aed9d fix(angular): emit fresh messages array so OnPush views render on addMessage (#5418)
Fixes #5416

## Problem

`AgentStore` mirrored the agent's messages into a signal via
`this.#messages.set(abstractAgent.messages)`. `AbstractAgent.addMessage`
pushes **in place** and notifies with the **same array reference**.
Angular signals compare with `Object.is`, so `set(sameRef)` is a no-op:
the signal never notifies, the OnPush `<copilot-chat>` view is never
marked dirty, and a freshly added message — including the user's own
bubble on submit — does not render until the run pipeline reassigns
`messages` to a new array at run completion.

## Fix

```ts
this.#messages.set([...abstractAgent.messages]);
```

A shallow copy gives the array a new identity, so the signal notifies
and OnPush views re-render immediately. The `Message` objects stay
referentially stable, so `trackBy` still avoids re-creating existing
bubbles.

`onStateChanged` is intentionally left unchanged: `AbstractAgent`
reassigns `this.state` to a freshly cloned reference on every change
(`setState(e) { this.state = clone(e) }`) and never mutates state in
place, so that signal already notifies correctly. Scoping the fix to
messages keeps it minimal.

## Tests

Added two regression tests in `agent.spec.ts`, both exercising the
in-place mutation path that the existing tests never hit (they assign a
fresh array each emit):

1. **Reference guard** — the store must not hand back the agent's live
`messages` array.
2. **OnPush re-render** — a count rendered in an OnPush *descendant* (a
root `detectChanges()` would force-check the root and hide the bug; only
a child whose dirty flag depends on the signal exposes it). Two in-place
pushes; the second is the same-reference no-op the fix repairs.

Both tests fail without the fix (`'1' to be '2' // Object.is equality`)
and pass with it.

## Verification

- `agent.spec.ts`: 6/6 pass
- full `@copilotkitnext/angular` suite: 50/50 pass
- `tsc --noEmit`: clean
2026-06-12 10:08:03 -07:00
Ben Taylor 6bbf33aee6 fix(shared): preserve lambda client cjs export (#5419)
## Summary
- export the telemetry lambda client as a named binding instead of
default-reexporting it through the shared barrel
- update shared telemetry internals/tests to consume the named binding
- add a built-package smoke check to ensure both CommonJS and ESM expose
`lambdaClient.send`

## Root Cause
`@copilotkit/shared` re-exported `lambdaClient` from a default export.
The unbundled CommonJS build emitted `exports.lambdaClient =
require_lambda_client`, so CommonJS consumers received the module
namespace object instead of the `{ send }` client. `@copilotkit/runtime`
then called `lambdaClient.send(...)` and crashed because `send` was
nested under `lambdaClient.default`.

## Validation
- `pnpm nx run @copilotkit/shared:build --skip-nx-cache`
- `node packages/shared/scripts/verify-cjs-exports.cjs`
- `pnpm nx run @copilotkit/shared:test --skip-nx-cache`
- `pnpm nx run @copilotkit/shared:check-types --skip-nx-cache`
- `pnpm nx run @copilotkit/shared:publint --skip-nx-cache`
- `pnpm nx run @copilotkit/runtime:build --skip-nx-cache`
- runtime CJS telemetry capture smoke test
- `pnpm nx run @copilotkit/runtime:test --skip-nx-cache --
src/v2/runtime/__tests__/telemetry.test.ts`
- pre-commit hook: `pnpm run test && pnpm run check:packages`
2026-06-12 12:01:14 -05:00
Austin Merrick 9275ec2ce0 fix(react-core): cover mermaid-block + sub/superscript streamdown styles 2026-06-12 09:49:45 -07:00
Tushar-Khandelwal-2004 f90c3dcfd7 fix(react-core): scope streamdown markdown styles 2026-06-12 09:49:44 -07:00
Mike Ryan 5eea242e1f fix(shared): preserve lambda client cjs export 2026-06-12 09:29:52 -07:00
Marco Castro d11fb33169 fix(angular): drop redundant comment on messages signal copy 2026-06-12 18:21:20 +02:00
Marco Castro aa71a6190c Merge branch 'main' into fix/5416-angular-agentstore-messages-ref 2026-06-12 18:17:36 +02:00
Marco Castro 05c6b9bdcd fix(angular): emit fresh messages array so OnPush views render on addMessage
AgentStore mirrored the agent's messages into a signal via
`this.#messages.set(abstractAgent.messages)`. AbstractAgent.addMessage
pushes in place and notifies with the same array reference, so the
signal's Object.is equality check treats set(sameRef) as a no-op: it
never notifies, the OnPush <copilot-chat> view is never marked dirty,
and a freshly added message (including the user's own on submit) does
not render until the run pipeline reassigns messages to a new array at
run completion.

Copy into a fresh array so the reference changes and the signal
notifies. Message objects stay referentially stable, so trackBy still
avoids re-creating existing bubbles. State is unaffected: AbstractAgent
reassigns this.state to a cloned reference on every change, so its
signal already notifies.

Adds regression tests covering the in-place mutation path: a reference
guard and an OnPush descendant re-render check. Both fail without the
fix.

Fixes #5416
2026-06-12 18:14:36 +02:00
Ran Shemtov e0f64c8f9e Merge branch 'main' into claude/a2ui-injection-config-9r2ve3 2026-06-12 17:01:20 +02:00
ranst91 02c3a8aef0 chore: release monorepo v1.60.1 2026-06-12 13:03:45 +00:00
Ran Shem Tov da5b50a929 fix(bot-slack): adapt runHttpRequest call to ag-ui 0.0.57 signature 2026-06-12 11:58:12 +02:00
Ran Shem Tov 7805a9a57b fix: update cpk to use latest agui core packages 2026-06-12 11:16:19 +02:00
Austin Merrick de9d46d1df docs(skills): migrate CopilotKit skills to the v2 API
Bring the agent skills in line with the shipped v2 API so their examples
install, compile, and connect. Extends #5345 (which migrated the
copilotkit-setup SKILL.md body) to the rest of the skills.

- Imports: drop the nonexistent @copilotkit/react and @copilotkit/agent
  packages and the bare @copilotkit/runtime/express subpath; use
  @copilotkit/react-core/v2 and @copilotkit/runtime/v2 (+ /v2/express),
  and createCopilotHonoHandler / createCopilotExpressHandler rather than
  the deprecated createCopilotEndpoint aliases.
- Provider: CopilotKit from @copilotkit/react-core/v2 with
  useSingleEndpoint={false} on multi-route setups (the v1-compat bridge
  defaults to single transport and would 404 a multi-route backend).
- Routes: v2 catch-all Hono handler exporting GET/POST/PATCH/DELETE via
  handle() from hono/vercel, replacing the v1
  copilotRuntimeNextJSAppRouterEndpoint + ExperimentalEmptyAdapter.
- Integrations: per-framework agent classes matched to the shipped
  examples (LangGraphAgent/LangGraphHttpAgent from @copilotkit/runtime/
  langgraph, CrewAIAgent, MastraAgent, LlamaIndexAgent, HttpAgent from
  @ag-ui/client; Agno via HttpAgent, not @ag-ui/agno).
- Hooks/props: correct useAgent, useThreads, useRenderTool, identifyUser,
  and the chat-component props (defaultOpen, onSubmitMessage, the headless
  CopilotChatView render prop).

Validated across review rounds and a build test against the published
@copilotkit/*@1.60.0 packages (tsc passes, every /v2 subpath resolves).
Regenerated the skills/runtime and skills/react-core mirrors.
2026-06-11 14:43:45 -07:00
MikeRyanDev a6e8000c94 chore: release monorepo v1.60.0 2026-06-11 16:27:00 +00:00
Mike Ryan 05cb21d325 fix(runtime): pass user ids to intelligence thread reads 2026-06-11 08:27:50 -07:00
Ran Shemtov 7f8c2dcf34 Merge branch 'main' into claude/a2ui-injection-config-9r2ve3 2026-06-11 16:38:10 +02:00
SeoyeonKim 8e440a9e7d fix(react-core): stabilize pin-to-send scrolling 2026-06-11 22:56:07 +09:00
Benjamin Taylor 8d68a95bc9 docs(packages): drop client license-key prop references; Angular no longer needs a key
Follow-up correction. The client publicLicenseKey/publicApiKey prop is the
header→cloud path and is NOT what activates the Intelligence runtime (that's
the server-side COPILOTKIT_LICENSE_TOKEN). So:

- Remove the `npx copilotkit@latest license` guidance from all client-prop
  contexts — that CLI yields the server-side license token, not the client
  prop value.
- Revert the client-prop docstrings (copilotkit-props, v2 CopilotKitProvider)
  to bare one-liners; drop the premium/"requires a license key" framing from
  the headless hook, react-ui observability docs, and runtime logging/onError
  JSDoc rather than reframing.
- Angular: remove all `licenseKey` mentions from the README — it is no longer
  a premium feature (the license watermark is disabled) and the key is not
  needed to function.

Server-side license-token documentation remains deferred to the example/runtime
setup pass (Bucket B).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 07:22:37 -05:00
Benjamin Taylor 8956c668bc docs(packages): retire Copilot Cloud framing in SDK doc references, point to the license key
Cloud is no longer promoted; the Intelligence license key is its replacement.
Scrub the old Copilot Cloud system from SDK JSDoc / doc-comments / console
messages / README prose so code references reflect how the license key is
obtained and used, mirroring examples/integrations/*:

- publicApiKey/publicLicenseKey docstrings (react-core props + v2 provider,
  vue legacy types, copilot-context) describe the CopilotKit public license
  key, acquired via `npx copilotkit@latest license` or the dashboard;
  publicApiKey framed as the legacy alias of publicLicenseKey.
- Premium-feature docs (headless hook, react-ui Chat/Popup/Sidebar
  observability, runtime logging/onError) drop "Copilot Cloud"/"requires a
  publicApiKey" wording and the publicApiKey examples in favor of the public
  license key + publicLicenseKey.
- console-styling messages and the angular README point at the license key
  and the `npx copilotkit@latest license` command.

Defunct features (guardrails_c, authConfig_c, useCopilotAuthenticatedAction_c)
keep their code but lose their JSDoc (marked @internal defunct).

Functional surfaces untouched: api.cloud.copilotkit.ai endpoint, the
X-CopilotCloud-Public-Api-Key header, prop names, gating logic, tests,
CHANGELOGs. Example-app migration (Bucket B) deferred.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 07:22:37 -05:00
Ran Shemtov 73e19983b3 Merge remote-tracking branch 'origin/main' into claude/a2ui-injection-config-9r2ve3
# Conflicts:
#	packages/runtime/src/v2/runtime/handlers/get-runtime-info.ts
2026-06-11 12:12:56 +00:00
Claude 924a78a2a7 fix(runtime): add a2ui enabled opt-out via shared isA2UIEnabled predicate
Route both the run path (agent-utils) and the /info response
(get-runtime-info) through a single isA2UIEnabled() predicate so the two
can no longer disagree on whether a2ui is on (the divergence behind #5369),
and add an optional `enabled` flag to the runtime a2ui config.

Backwards compatible: any existing a2ui config stays enabled; only an
explicit `a2ui: { enabled: false }` turns it off while keeping the rest
of the config (e.g. schema/catalog) in place.

https://claude.ai/code/session_01TYohiEJyhsU3mJS4jabdv6
2026-06-11 11:49:29 +00:00
Mark Fogle a6deb44926 fix(vue): scope the A2UI catalog context to the runtime's a2ui agents (#5369) 2026-06-11 05:07:14 +00:00
Mark Fogle c036a97efa fix(react-core): scope the A2UI catalog context to the runtime's a2ui agents (#5369) 2026-06-11 05:07:11 +00:00
Mark Fogle 47c993ccbb fix(core): scope context entries per agent and preserve the a2ui agent list (#5369) 2026-06-11 05:06:15 +00:00
Mark Fogle b9df2ecaa9 fix(runtime): forward per-agent a2ui scoping in the runtime info response (#5369) 2026-06-11 05:05:54 +00:00
Tyler Slaton 4296447aad fix(bot-slack): defer Bolt initialization to start()
Bolt's App constructor schedules a background auth.test that can't be
awaited or error-handled - in unit tests it phoned home to api.slack.com
with dummy tokens, leaving ~15 unhandled invalid_auth rejections racing
the run's end (the unit (20.x) flake). deferInitialization: true makes
construction genuinely side-effect-free; start() runs app.init() first,
so auth/config errors surface to the caller, followed by the existing
awaited auth.test. Test fake App grows the matching init() stub.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 12:57:13 -07:00
Tyler Slaton fe685eb46f feat(release): npm release scopes for bot(+bot-ui) and bot-slack
- release.config.json: 'bot' scope versions @copilotkit/bot and
  @copilotkit/bot-ui together (sharedVersion: true, source: bot);
  'bot-slack' is its own scope, mirroring the angular precedent
- ReleaseScope type + VALID_SCOPES arrays + usage strings extended across
  release scripts
- stable-release.yml / publish-release.yml: scope choice options
- bot, bot-ui, bot-slack manifests: drop private, add publishConfig (public),
  repository/homepage/keywords, publint/attw targets; first release v0.0.1
- internal bot-package deps use workspace:~ (tilde): caret on a 0.0.x version
  pins the exact patch, tilde tracks the 0.0.x line; core/shared stay
  workspace:^ (caret is correct at 1.x)

Verified: release-script tests 85/85; prepare-release --scope bot --dry-run
bumps bot AND bot-ui in lockstep; actionlint clean on touched lines.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 12:57:13 -07:00
Austin Merrick df191ffac4 fix(shared): drop dead LicenseMode type instead of redefining it
LicenseMode was removed from license-verifier 0.3.0 and has no consumers
anywhere in the repo; the prior re-export was already uncompilable, so no
external consumer could exist either.
2026-06-10 11:54:21 -07:00
Austin Merrick 081e076659 fix(angular): resolve workspace paths to dist first in typecheck
The paths entries pointed at sibling package sources, so the Angular
package's tsc run typechecked core and shared sources under Angular's
compiler settings — surfacing errors in files outside any Angular
change (reported on #5321). Resolve to the built declarations first,
same pattern as the Vue package; the src fallback remains for cold
checkouts.
2026-06-10 11:54:21 -07:00
Austin Merrick 6b1bb1a4af fix(shared): define license context types locally, fix check-types
@copilotkit/license-verifier dropped LicenseContextValue and
LicenseMode from its public API in 0.3.0, leaving shared re-exporting
two nonexistent members. tsdown's dts rollup never validated the
re-export, so the broken types shipped silently and check-types fails
on main. Define both types here — shared already owns the context
shape via createLicenseContextValue — using the definitions from
license-verifier 0.2.0. Also annotate the merged telemetry properties
record so string indexing typechecks.
2026-06-10 11:54:21 -07:00
Austin Merrick 5e3918d7e4 fix(a2ui-renderer): remove dead 0.8-era viewer files, fix check-types
A2UIViewer.tsx and theme/viewer-theme.ts were left behind by the
0.8 -> 0.9 migration: nothing imports them, they import @a2ui/lit
(no longer a dependency) and files that no longer exist, so
check-types fails on files no PR touches. Remove them along with the
now-inert @a2ui/lit external/global entries in tsdown.config.ts, and
underscore the unused type params kept on deprecated aliases for
call-site compatibility.
2026-06-10 11:54:21 -07:00
Alem Tuzlak e5522ce0c6 refactor(slack): remove PoC package, superseded by bot/bot-ui/bot-slack
The reusable mechanics (streaming, chunking, markdown-to-mrkdwn,
conversation store) live on in @copilotkit/bot-slack; UI authoring
moved from A2UI/defineSlackComponent to JSX -> IR -> Block Kit.
2026-06-10 10:46:08 -07:00
Alem Tuzlak 545fbdcda1 feat(bot-slack): Slack platform adapter
JSX -> Block Kit rendering with per-element budgets and degradation,
Socket Mode ingress, opaque-id interactions (ack within 3s, run async),
chat.update message streaming with chunking, accent attachments, and
sender-profile resolution. Preserves the PoC's streaming, chunking,
and mrkdwn mechanics behind the PlatformAdapter boundary.
2026-06-10 10:46:08 -07:00
Alem Tuzlak 16210c61b9 feat(bot): platform-agnostic bot engine
createBot with handler registration (onMention/onMessage/onInterrupt/
onCommand), the agent run/tool/interrupt loop, content-stable JSX
action binding with cold-path rehydration from a pluggable ActionStore,
the PlatformAdapter boundary, capability-gated thread methods, one
shared BotToolContext, defineBotTool / defineBotCommand, and typed
interaction/interrupt handlers. Includes fake-adapter/fake-agent
testing utilities.
2026-06-10 10:46:08 -07:00
Alem Tuzlak 9f3b3c7126 feat(bot-ui): JSX runtime, IR, and cross-platform component vocabulary
Pure JSX runtime (no React, no Slack) producing a BotNode IR tree.
Statically typed component props via a package-owned JSX namespace:
unknown attributes, bad values, and bad children are compile errors.
Components: Message, Header, Section, Markdown, Field, Context,
Actions, Button, Select, Input, Image, Divider; bind() escape hatch
for non-serializable handler captures.
2026-06-10 10:46:08 -07:00
Jordan Ritter e8104fa2d2 fix(web-inspector): shim localStorage in vitest setup for Node 25 compatibility
Node 25 unflagged the experimental Web Storage API; vitest's jsdom env
does not replace the method-less stub, so localStorage-touching tests
crash. Install a functional stub before the environment boots.
2026-06-10 10:46:08 -07:00
Alem Tuzlak f611667fe1 fix(runtime): make MCP server failures non-fatal (graceful degradation)
A single unavailable MCP server (down, 5xx, timeout, bad auth) no longer
fails the whole run - it is skipped with an error log and the run
continues with healthy servers and the agent's own tools.
2026-06-10 10:46:08 -07:00