copilotkit 4.13.1 → 4.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +150 -12
  2. package/cli-build-info.json +8 -8
  3. package/index.js +76560 -73271
  4. package/onboarding/index.json +1 -1
  5. package/onboarding/prompts/authenticate/start.md +48 -28
  6. package/onboarding/prompts/conversion/plan.md +3 -3
  7. package/onboarding/prompts/credentials/finalize-plan.md +13 -12
  8. package/onboarding/prompts/credentials/plan.md +21 -21
  9. package/onboarding/prompts/credentials/settle-credentials.md +19 -12
  10. package/onboarding/prompts/credentials/write-plan.md +20 -13
  11. package/onboarding/prompts/fallback/best-effort.md +10 -10
  12. package/onboarding/prompts/feature/a2ui/implement.md +6 -6
  13. package/onboarding/prompts/feature/a2ui/proof.md +6 -6
  14. package/onboarding/prompts/feature/a2ui/start.md +7 -7
  15. package/onboarding/prompts/feature/channels/implement.md +33 -15
  16. package/onboarding/prompts/feature/channels/proof.md +12 -10
  17. package/onboarding/prompts/feature/channels/start.md +13 -12
  18. package/onboarding/prompts/feature/chat-suggestions/implement.md +6 -6
  19. package/onboarding/prompts/feature/chat-suggestions/proof.md +6 -6
  20. package/onboarding/prompts/feature/chat-suggestions/start.md +7 -7
  21. package/onboarding/prompts/feature/complete.md +19 -1
  22. package/onboarding/prompts/feature/learning/implement.md +17 -17
  23. package/onboarding/prompts/feature/learning/proof.md +7 -7
  24. package/onboarding/prompts/feature/learning/start.md +9 -9
  25. package/onboarding/prompts/feature/open-generative-ui/implement.md +6 -6
  26. package/onboarding/prompts/feature/open-generative-ui/proof.md +6 -6
  27. package/onboarding/prompts/feature/open-generative-ui/start.md +7 -7
  28. package/onboarding/prompts/feature/realtime-sync/implement.md +7 -7
  29. package/onboarding/prompts/feature/realtime-sync/proof.md +6 -6
  30. package/onboarding/prompts/feature/realtime-sync/start.md +6 -6
  31. package/onboarding/prompts/feature/rich-threads/implement.md +10 -10
  32. package/onboarding/prompts/feature/rich-threads/proof.md +6 -6
  33. package/onboarding/prompts/feature/rich-threads/start.md +6 -6
  34. package/onboarding/prompts/feature/stop.md +37 -3
  35. package/onboarding/prompts/feature/voice/implement.md +7 -7
  36. package/onboarding/prompts/feature/voice/proof.md +6 -6
  37. package/onboarding/prompts/feature/voice/start.md +8 -8
  38. package/onboarding/prompts/framework/ag2.md +2 -2
  39. package/onboarding/prompts/framework/agno.md +2 -2
  40. package/onboarding/prompts/framework/built-in.md +2 -2
  41. package/onboarding/prompts/framework/claude-sdk-python.md +2 -2
  42. package/onboarding/prompts/framework/claude-sdk-typescript.md +2 -2
  43. package/onboarding/prompts/framework/crewai-flows.md +2 -2
  44. package/onboarding/prompts/framework/deep-agents.md +2 -2
  45. package/onboarding/prompts/framework/google-adk.md +2 -2
  46. package/onboarding/prompts/framework/langgraph-fastapi.md +2 -2
  47. package/onboarding/prompts/framework/langgraph-python.md +2 -2
  48. package/onboarding/prompts/framework/langgraph-typescript.md +2 -2
  49. package/onboarding/prompts/framework/llamaindex.md +2 -2
  50. package/onboarding/prompts/framework/mastra.md +2 -2
  51. package/onboarding/prompts/framework/ms-agent-dotnet.md +2 -2
  52. package/onboarding/prompts/framework/ms-agent-harness-dotnet.md +2 -2
  53. package/onboarding/prompts/framework/ms-agent-python.md +2 -2
  54. package/onboarding/prompts/framework/pydantic-ai.md +2 -2
  55. package/onboarding/prompts/framework/strands-python.md +2 -2
  56. package/onboarding/prompts/framework/strands-typescript.md +2 -2
  57. package/onboarding/prompts/frontend/angular.md +3 -3
  58. package/onboarding/prompts/frontend/nextjs.md +3 -3
  59. package/onboarding/prompts/frontend/plan.md +7 -7
  60. package/onboarding/prompts/frontend/react-native.md +5 -2
  61. package/onboarding/prompts/frontend/react-spa.md +5 -2
  62. package/onboarding/prompts/frontend/vue.md +5 -2
  63. package/onboarding/prompts/implementation/build-and-validate.md +25 -24
  64. package/onboarding/prompts/proof/complete.md +9 -9
  65. package/onboarding/prompts/proof/oss-baseline.md +5 -5
  66. package/onboarding/prompts/proof/round-trip.md +12 -12
  67. package/onboarding/prompts/research/gather.md +36 -7
  68. package/onboarding/prompts/research/merge.md +3 -3
  69. package/onboarding/prompts/research/preflight.md +4 -4
  70. package/onboarding/prompts/research/route.md +8 -6
  71. package/onboarding/prompts/starter/clone.md +97 -26
  72. package/onboarding/prompts/stopped/run-failed.md +4 -4
  73. package/onboarding/prompts/subagent/create-plan.md +4 -4
  74. package/onboarding/prompts/subagent/implement-and-validate.md +19 -6
  75. package/onboarding/prompts/subagent/inspect-repository.md +2 -2
  76. package/onboarding/prompts/subagent/prove-oss-baseline.md +9 -2
  77. package/onboarding/prompts/subagent/prove-round-trip.md +21 -19
  78. package/onboarding/prompts/unsupported/no-validated-path.md +3 -3
  79. package/package.json +5 -1
  80. package/release/release-tool.js +230 -72
package/README.md CHANGED
@@ -259,6 +259,48 @@ The bundled onboarding prompt gives one short explanation before it opens the
259
259
  page: sign-in lets the coding agent create a project and API key, and the user
260
260
  can remove the key later to disconnect the workspace.
261
261
 
262
+ ### Signing in when the browser is on another machine
263
+
264
+ The flow above sends the browser back to a loopback server on the CLI's own
265
+ machine. That fails over SSH, in a VM, or in a container, because the browser
266
+ runs somewhere else. From 4.14.0, the CLI uses a device authorization grant
267
+ (RFC 8628) instead:
268
+
269
+ ```bash
270
+ copilotkit login --device # at a terminal
271
+ copilotkit login --json # for a coding agent
272
+ ```
273
+
274
+ The CLI prints a page URL that carries an eight-character code, such as
275
+ `WDJB-MJHT`, and prints the code too. Open the URL in a browser on any device
276
+ and sign in if asked. The page opens on the confirmation screen: check that it
277
+ shows the same code and where the request came from, then approve it. You can
278
+ also open the plain page and type the code. The CLI polls until you approve,
279
+ and gives up after 10 minutes.
280
+
281
+ Under `--json`, the first `authentication_url` record is the URL with the code
282
+ in it, and it also carries `user_code` and `expires_at`. A sign-in that ends without a session writes a `failed`
283
+ record with `reason: expired` or `reason: access_denied`. If the Ops service
284
+ has no device routes, `login --json` falls back to the loopback flow.
285
+
286
+ Approve a code only if your own terminal or coding agent showed it to you. If
287
+ someone sent you a code, deny the request: approving it signs their CLI in as
288
+ you.
289
+
290
+ ## Where onboarding runs
291
+
292
+ Run `onboard start` in the project folder, or in an empty folder for a new app.
293
+
294
+ - In the home folder or a system folder, `onboard start` refuses, and no run
295
+ starts.
296
+ - A folder that is not a project, but holds projects one or two levels down, is
297
+ a folder of projects. In one, `onboard start` lists the projects and tells the
298
+ coding agent to ask which one to use.
299
+ - `init` never creates an app in the home folder, a system folder or a folder of
300
+ projects. It can create an app in a new subfolder of one, such as `~/my-app`.
301
+ - A folder with its own Git repository is one project, even when its parts sit
302
+ in subfolders such as `frontend/` and `backend/`.
303
+
262
304
  ## Feature onboarding for existing apps
263
305
 
264
306
  Use the optional `--intent` flag when an existing CopilotKit app needs one
@@ -285,8 +327,8 @@ npx --yes copilotkit@latest onboard start \
285
327
  | `add-voice` | Add documented voice transcription to the existing composer |
286
328
  | `add-realtime-sync` | Prove managed thread changes sync between active clients |
287
329
 
288
- Run `copilotkit channels setup` to copy the same small `onboard start --run <id>`
289
- prompt as the website CTA. There is no `--intent add-channels`. The copied
330
+ Run `copilotkit channels setup` to continue an unfinished Channels onboarding
331
+ run, or copy the same onboarding URL prompt as the website CTA for a new run. There is no `--intent add-channels`. The copied
290
332
  prompt has no Channel sentence. When the project has no frontend, the root graph
291
333
  asks which frontend they want and offers Slack and Microsoft Teams there. If the
292
334
  copied prompt came from a Slack or Teams docs page, that page is the named
@@ -319,11 +361,13 @@ The developer can widen the scope the graph will not. The agent names one fix an
319
361
  asks. When the developer approves it, the agent makes that one fix and runs:
320
362
 
321
363
  ```bash
322
- npx --yes copilotkit@latest onboard resume
364
+ npx --yes copilotkit@latest onboard resume --message "<the approved fix>"
323
365
  ```
324
366
 
325
- The approval goes to standard input, in one or two sentences and at most 500
326
- characters. The command puts the run back on the step that failed, keeps the same
367
+ The approval goes in `--message`, in one or two sentences and at most 500
368
+ characters. The command also reads the approval from standard input when
369
+ `--message` is absent. A piped approval puts its text in the command that a Codex
370
+ approval covers, so the next call needs a new approval. The command puts the run back on the step that failed, keeps the same
327
371
  run id, and records both the approval and the step it re-entered. So the repair
328
372
  and the second proof attempt belong to the run that stopped, rather than to
329
373
  nothing at all. The approval is guarded and sent under the same telemetry setting
@@ -334,9 +378,14 @@ credential shape, and a run that never stopped each print a reason, serve nothin
334
378
  and exit zero. A directory with no bound run is the one non-zero exit, and it is
335
379
  the refusal every other onboarding step makes there.
336
380
 
337
- Only `stopped/run-failed` resumes. `unsupported/no-validated-path` and
338
- `feature/stop` describe a stack this release does not serve, which no fix inside
339
- the run changes.
381
+ A feature run that broke reads `feature/stop` instead, and comes back the same
382
+ way. That ending also covers a failed validation, a proof that could not be
383
+ driven, and a missing Channel prerequisite, which one approved fix can answer.
384
+
385
+ Only `stopped/run-failed` and `feature/stop` resume.
386
+ `unsupported/no-validated-path` and `fallback/best-effort` describe a stack this
387
+ release does not serve, and `feature/blocked-by-plan` is a refusal by the
388
+ platform. No fix inside the run changes any of them.
340
389
 
341
390
  The onboarding commands are:
342
391
 
@@ -386,6 +435,10 @@ copilotkit init -n my-agent -f langgraph-py \
386
435
  slugs instead of creating something you did not ask for.
387
436
  - `-y`/`--yes` installs dependencies without asking; `--no-install` answers the
388
437
  same question without installing. `--install` is a longhand for `--yes`.
438
+ - `--no-key-prompt` skips the question about a missing model key. Use it where the
439
+ shell is a pseudo-terminal but nobody types, such as a coding agent's shell:
440
+ there `init` sees a terminal and would ask anyway. The next steps still name
441
+ each missing key.
389
442
 
390
443
  A run with no terminal is refused only for what it has not answered, and every
391
444
  missing flag is named at once. Sign-in is the one answer no flag supplies:
@@ -398,6 +451,20 @@ already have a valid CLI session, the CLI reuses that workspace connection;
398
451
  otherwise it opens browser sign-in. This workspace connection is required for
399
452
  project creation and is separate from license issuance.
400
453
 
454
+ ## Import Mastra History
455
+
456
+ Run `copilotkit import --source mastra --dry-run` to preview saved Mastra
457
+ threads, then omit `--dry-run` to use the standard import confirmation and
458
+ upload flow. Both a local persisted LibSQL database and a remote Mastra server
459
+ are supported. Configure source identity and access with the
460
+ [`MASTRA_IMPORT_*` variables](../../libs/import-mastra/README.md); destination
461
+ Intelligence credentials use the usual import options.
462
+
463
+ Local access requires Node 22.13+. Use the same source namespace when switching
464
+ between local and remote access so repeat imports deduplicate. Import while the
465
+ source is idle. This reads existing history and pending data; it does not execute
466
+ models, tools or native resume operations.
467
+
401
468
  ## Managed Channels
402
469
 
403
470
  `copilotkit channels` connects a hosted Intelligence project to Slack or
@@ -443,6 +510,10 @@ Teams credentials in `.env` or the process environment keep the by-hand attach
443
510
  path. Pass `--no-provision` to choose that path yourself. Non-interactive runs
444
511
  stay on the by-hand path unless they pass `--provision`.
445
512
 
513
+ If Microsoft sign-in fails, check the browser page for an `AADSTS` error code.
514
+ The CLI shows a known code or `invalid_request` when Microsoft returns one in
515
+ the terminal. It does not print the full Microsoft response.
516
+
446
517
  No flag accepts a credential value. Credentials are read from your project's
447
518
  `.env`, from a named environment variable, or from a JSON document on stdin; at a
448
519
  terminal the CLI offers a masked prompt instead.
@@ -458,7 +529,22 @@ copilotkit channels setup
458
529
  copilotkit channels setup --no-clipboard
459
530
  ```
460
531
 
461
- The command copies the small `onboard start --run <id>` prompt.
532
+ If this project already has an unfinished Channels run, the command prints its
533
+ existing ID and instructions to continue its route. It installs nothing, generates
534
+ no ID, and leaves the clipboard unchanged. This includes paused runs and older
535
+ bindings without timestamps; runs do not expire while waiting for you.
536
+
537
+ Use `--run <id>` to name this project's unfinished run explicitly. Unknown,
538
+ completed, or mismatched IDs are refused. Use `--new-run` instead to deliberately
539
+ start another journey. The flags cannot be combined. A completed run or a run
540
+ for another feature does not block a fresh Channels setup automatically.
541
+ `copilotkit skills onboard --channels` honors the same run choices.
542
+ If completion state cannot be saved, onboarding still completes and prints a
543
+ warning. The next setup may require `--new-run` to start a fresh run.
544
+
545
+ For a new run, the command copies an onboarding URL containing a fresh run ID.
546
+ Before installing, it names the `channels-setup` skill, its
547
+ `CopilotKit/CopilotKit/skills` source, and its project scope for all supported agents.
462
548
  It installs the `channels-setup` skill, then prints that prompt to paste
463
549
  into your coding agent and copies it to your clipboard. The prompt is always
464
550
  printed, so you can read it before handing it over. Pass `--no-clipboard` in a
@@ -500,6 +586,16 @@ those a project that never makes the call serves HTTP normally, reports no error
500
586
  and answers nothing. Mounts that own their process lifetime start on their own,
501
587
  and `status` distinguishes the two rather than warning about both.
502
588
 
589
+ Managed API and realtime URLs have defaults; preflight needs the project API key,
590
+ not an explicit WebSocket URL override. Runtime diagnostics refer to
591
+ `CopilotRuntime`. Dynamic options and unresolved `channels` shorthand remain
592
+ undetermined, while awaited optional chaining is recognized.
593
+
594
+ If an onboarding run is already in progress, use `copilotkit onboard route` and
595
+ `copilotkit onboard read <step>` to continue its current served step. Runtime
596
+ wiring is covered by `feature/channels/implement`; paused runs must follow their
597
+ stop instructions first. Outside a run, begin with `copilotkit channels setup`.
598
+
503
599
  `--json` emits a versioned envelope on stdout for agents and scripts, never
504
600
  prompts, and never opens a browser. See
505
601
  [Managed Channel CLI contracts](../../docs/channels-cli-contracts.md) for the
@@ -755,6 +851,14 @@ line on stdout so an already-issued token is not lost, and `project select` repo
755
851
  `api_key_provisioned: false` and exits 75. Untrack the file, then re-run. Outside a
756
852
  git work tree there is nothing to protect and both write as before.
757
853
 
854
+ ## Onboarding credential baselines
855
+
856
+ `copilotkit onboard protect --path .env` defers a credential file that does not
857
+ exist yet. After the credential step creates it, run
858
+ `copilotkit onboard protect --rebaseline --path .env` to protect its new contents.
859
+ Later changes still fail the audit. The same rule applies to
860
+ `.copilotkit/project.json`. Missing source files remain protected.
861
+
758
862
  ## Version Control
759
863
 
760
864
  Outside a repository, `copilotkit init` runs `git init` in the new app and makes
@@ -1023,7 +1127,7 @@ copilotkit logs --tail
1023
1127
  copilotkit logs --tail --lines 100
1024
1128
  ```
1025
1129
 
1026
- With no flags, `copilotkit logs` prints the log file path. `--tail` prints recent structured log lines. Add `--verbose` to a CLI command when you need high-signal diagnostics mirrored to stderr during the run.
1130
+ With no flags, `copilotkit logs` prints the log file path. The log lives in `~/.copilotkit/cli.log` (or `$XDG_STATE_HOME/copilotkit/cli.log`). If a sandbox refuses writes there, the CLI logs to `$TMPDIR/copilotkit-<uid>/cli.log` instead, and if that also fails, the CLI runs with no log file. `--tail` prints recent structured log lines. Add `--verbose` to a CLI command when you need high-signal diagnostics mirrored to stderr during the run.
1027
1131
 
1028
1132
  Project creation (`init`/`create`) connects to and revalidates the live Clerk
1029
1133
  workspace before scaffolding. License commands, including `license list`,
@@ -1122,11 +1226,11 @@ again on the next interactive run.
1122
1226
  ## Preview and release builds
1123
1227
 
1124
1228
  Tester-facing prerelease builds are produced by CI via `workflow_dispatch` on
1125
- the `pkg-pr-new (cli)` workflow — never built locally (the repo root `.env`
1229
+ the `CLI / Publish preview` workflow — never built locally (the repo root `.env`
1126
1230
  targets local services, and CI is the reproducible path).
1127
1231
 
1128
1232
  ```bash
1129
- gh workflow run "pkg-pr-new (cli)" --ref <feature-branch> \
1233
+ gh workflow run publish-cli.yml --ref <feature-branch> \
1130
1234
  -f cli_env=production \
1131
1235
  -f template_ref=<copilotkit-branch-tag-or-commit>
1132
1236
  ```
@@ -1163,3 +1267,37 @@ and rollback are documented in the
1163
1267
  The CLI is commercial software. Its npm manifest uses `SEE LICENSE IN LICENSE` and includes
1164
1268
  a [commercial notice](LICENSE). This notice does not change the licenses of
1165
1269
  projects created with the CLI. See the [package license map](../../docs/licensing/package-licenses.md).
1270
+
1271
+ ### Add existing threads to Learning
1272
+
1273
+ Use `learning threads` to add prior conversations to a Container. A thread can
1274
+ join one Container permanently. Already-bound threads are ineligible.
1275
+
1276
+ ```bash
1277
+ copilotkit learning threads list support --binding all --json
1278
+ copilotkit learning threads list support --source slack --json
1279
+ copilotkit learning threads preview support --all --agent support-agent --from 2026-09-01 --to 2026-10-01 --json
1280
+ copilotkit learning threads commit support <operation-id> --yes --json
1281
+ copilotkit learning threads status support <operation-id> --json
1282
+ ```
1283
+
1284
+ Preview returns an operation ID, a frozen selection, and recovery counts. Use
1285
+ repeated `--thread <id>` flags instead of `--all` to select specific threads.
1286
+ Filters apply to thread creation time. `--from` is inclusive and `--to` is
1287
+ exclusive; date-only values use UTC. `list` accepts `--cursor` for the next page.
1288
+ The binding filter accepts `all`, `unbound`, `this_container`, or `other_container`.
1289
+ The source filter accepts `all`, `app`, `slack`, or `teams`, where `app` means the
1290
+ thread arrived straight from the Runtime and the provider values select threads a
1291
+ Channel created.
1292
+
1293
+ Read the preview before commit. `--yes` approves permanent assignment of that
1294
+ saved selection. Each operation accepts at most 10,000 threads. New matching
1295
+ threads cannot enter an existing preview, and a repeated commit cannot bind a
1296
+ second batch. Threads bound by another action after preview are skipped and
1297
+ reported. Recovery continues in the background after the CLI exits.
1298
+
1299
+ Results distinguish threads bound, runs harvested, runs unrecoverable, other
1300
+ skipped runs, and pending runs. Pending work is not a completed harvest. The
1301
+ preview reflects retained history at its timestamp; delayed events or retention
1302
+ changes can change the final result. `--json` prints a versioned result envelope
1303
+ on stdout, including errors, and failures exit nonzero.
@@ -2,20 +2,20 @@
2
2
  "schemaVersion": 1,
3
3
  "package": {
4
4
  "name": "copilotkit",
5
- "version": "4.13.1"
5
+ "version": "4.15.0"
6
6
  },
7
7
  "intelligence": {
8
- "commit": "a629bd48ce4223ba2ea4fc1fb488973f8915807e"
8
+ "commit": "f6de0940e2aac5d2e323767f3d6431354715d2e6"
9
9
  },
10
10
  "copilotKit": {
11
- "submittedInput": "f8047217b909a3e18404034f31f47157c4312241",
12
- "commit": "f8047217b909a3e18404034f31f47157c4312241"
11
+ "submittedInput": "33db9a81ccfd",
12
+ "commit": "33db9a81ccfd2d6e820defe3c1616594909439af"
13
13
  },
14
14
  "channel": "production",
15
- "triggeringActor": "BenTaylorDev",
15
+ "triggeringActor": "AlemTuzlak",
16
16
  "workflow": {
17
- "runId": "35769780196",
18
- "runUrl": "https://github.com/CopilotKit/Intelligence/actions/runs/35769780196"
17
+ "runId": "36016174452",
18
+ "runUrl": "https://github.com/CopilotKit/Intelligence/actions/runs/36016174452"
19
19
  },
20
20
  "validationResult": "passed",
21
21
  "ag2": {
@@ -24,5 +24,5 @@
24
24
  "revision": "main",
25
25
  "pinned": false
26
26
  },
27
- "builtAt": "2026-09-22T18:52:16Z"
27
+ "builtAt": "2026-09-24T14:55:57Z"
28
28
  }