copilotkit 4.10.1 → 4.12.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/LICENSE +11 -0
  2. package/README.md +153 -17
  3. package/cli-build-info.json +8 -8
  4. package/index.js +5104 -4673
  5. package/onboarding/index.json +9 -2
  6. package/onboarding/prompts/authenticate/start.md +35 -19
  7. package/onboarding/prompts/conversion/plan.md +3 -3
  8. package/onboarding/prompts/credentials/finalize-plan.md +37 -27
  9. package/onboarding/prompts/credentials/plan.md +20 -20
  10. package/onboarding/prompts/credentials/settle-credentials.md +57 -25
  11. package/onboarding/prompts/credentials/write-plan.md +7 -7
  12. package/onboarding/prompts/fallback/best-effort.md +9 -8
  13. package/onboarding/prompts/feature/a2ui/implement.md +7 -7
  14. package/onboarding/prompts/feature/a2ui/proof.md +6 -6
  15. package/onboarding/prompts/feature/a2ui/start.md +10 -8
  16. package/onboarding/prompts/feature/blocked-by-plan.md +32 -0
  17. package/onboarding/prompts/feature/channels/implement.md +9 -9
  18. package/onboarding/prompts/feature/channels/proof.md +6 -6
  19. package/onboarding/prompts/feature/channels/start.md +20 -15
  20. package/onboarding/prompts/feature/chat-suggestions/implement.md +7 -7
  21. package/onboarding/prompts/feature/chat-suggestions/proof.md +6 -6
  22. package/onboarding/prompts/feature/chat-suggestions/start.md +10 -8
  23. package/onboarding/prompts/feature/complete.md +1 -1
  24. package/onboarding/prompts/feature/learning/implement.md +73 -14
  25. package/onboarding/prompts/feature/learning/proof.md +10 -9
  26. package/onboarding/prompts/feature/learning/start.md +61 -7
  27. package/onboarding/prompts/feature/open-generative-ui/implement.md +7 -7
  28. package/onboarding/prompts/feature/open-generative-ui/proof.md +6 -6
  29. package/onboarding/prompts/feature/open-generative-ui/start.md +10 -8
  30. package/onboarding/prompts/feature/realtime-sync/implement.md +8 -8
  31. package/onboarding/prompts/feature/realtime-sync/proof.md +6 -6
  32. package/onboarding/prompts/feature/realtime-sync/start.md +9 -7
  33. package/onboarding/prompts/feature/rich-threads/implement.md +9 -9
  34. package/onboarding/prompts/feature/rich-threads/proof.md +6 -6
  35. package/onboarding/prompts/feature/rich-threads/start.md +9 -7
  36. package/onboarding/prompts/feature/stop.md +6 -6
  37. package/onboarding/prompts/feature/voice/implement.md +7 -7
  38. package/onboarding/prompts/feature/voice/proof.md +6 -6
  39. package/onboarding/prompts/feature/voice/start.md +10 -8
  40. package/onboarding/prompts/framework/ag2.md +2 -2
  41. package/onboarding/prompts/framework/agno.md +2 -2
  42. package/onboarding/prompts/framework/built-in.md +2 -2
  43. package/onboarding/prompts/framework/claude-sdk-python.md +2 -2
  44. package/onboarding/prompts/framework/claude-sdk-typescript.md +2 -2
  45. package/onboarding/prompts/framework/crewai-flows.md +2 -2
  46. package/onboarding/prompts/framework/deep-agents.md +2 -2
  47. package/onboarding/prompts/framework/google-adk.md +2 -2
  48. package/onboarding/prompts/framework/langgraph-fastapi.md +2 -2
  49. package/onboarding/prompts/framework/langgraph-python.md +2 -2
  50. package/onboarding/prompts/framework/langgraph-typescript.md +2 -2
  51. package/onboarding/prompts/framework/llamaindex.md +2 -2
  52. package/onboarding/prompts/framework/mastra.md +2 -2
  53. package/onboarding/prompts/framework/ms-agent-dotnet.md +2 -2
  54. package/onboarding/prompts/framework/ms-agent-harness-dotnet.md +2 -2
  55. package/onboarding/prompts/framework/ms-agent-python.md +2 -2
  56. package/onboarding/prompts/framework/pydantic-ai.md +2 -2
  57. package/onboarding/prompts/framework/strands-python.md +2 -2
  58. package/onboarding/prompts/framework/strands-typescript.md +2 -2
  59. package/onboarding/prompts/frontend/angular.md +5 -5
  60. package/onboarding/prompts/frontend/nextjs.md +4 -4
  61. package/onboarding/prompts/frontend/plan.md +17 -12
  62. package/onboarding/prompts/frontend/react-native.md +2 -2
  63. package/onboarding/prompts/frontend/react-spa.md +2 -2
  64. package/onboarding/prompts/frontend/vue.md +2 -2
  65. package/onboarding/prompts/implementation/build-and-validate.md +35 -18
  66. package/onboarding/prompts/proof/complete.md +26 -17
  67. package/onboarding/prompts/proof/oss-baseline.md +5 -5
  68. package/onboarding/prompts/proof/round-trip.md +16 -15
  69. package/onboarding/prompts/research/gather.md +55 -9
  70. package/onboarding/prompts/research/route.md +30 -10
  71. package/onboarding/prompts/starter/clone.md +6 -6
  72. package/onboarding/prompts/stopped/run-failed.md +32 -3
  73. package/onboarding/prompts/subagent/create-plan.md +7 -1
  74. package/onboarding/prompts/subagent/implement-and-validate.md +2 -1
  75. package/onboarding/prompts/subagent/inspect-repository.md +43 -16
  76. package/onboarding/prompts/subagent/prove-oss-baseline.md +1 -1
  77. package/onboarding/prompts/subagent/prove-round-trip.md +52 -18
  78. package/onboarding/prompts/unsupported/no-validated-path.md +4 -4
  79. package/package.json +4 -3
  80. package/release/release-tool.js +1 -1
package/LICENSE ADDED
@@ -0,0 +1,11 @@
1
+ Copyright (c) Tawkit, Inc. All rights reserved.
2
+
3
+ The CopilotKit CLI is proprietary software. No open-source license is granted
4
+ for this package. Use is governed by your applicable signed agreement with
5
+ Tawkit, Inc. or the CopilotKit Self-Service Agreement:
6
+ https://www.copilotkit.ai/self-service-agreement
7
+
8
+ Third-party components retain their own licenses. This notice does not change
9
+ those licenses or the licenses of projects created with the CLI.
10
+
11
+ Contact: legal@copilotkit.ai
package/README.md CHANGED
@@ -19,6 +19,23 @@ CLI_ENV=local pnpm nx build cli
19
19
  node dist/apps/cli/index.js --help
20
20
  ```
21
21
 
22
+ Everything above installs with no compiler on the machine.
23
+
24
+ Microsoft Teams channel setup is the one exception. It runs
25
+ `@microsoft/teams.cli`. That package depends on `keytar`, which builds a native
26
+ keychain addon. So the CLI declares it as an **optional** dependency. A machine
27
+ that cannot build it still installs and runs the CLI. Only Teams setup fails,
28
+ and it reports the reason.
29
+
30
+ To set up a Teams channel on such a machine, install the package yourself:
31
+
32
+ ```bash
33
+ npm install @microsoft/teams.cli@3.0.3
34
+ ```
35
+
36
+ That build needs a prebuilt binary, or `python3`, a C++ toolchain and the
37
+ libsecret headers.
38
+
22
39
  ## Type-safe agent IDs
23
40
 
24
41
  `copilotkit typegen` reads a running CopilotKit runtime's `/info` route and
@@ -98,7 +115,11 @@ press Enter again to take it, or type a different one.
98
115
  "config_path": "/work/my-repo/.copilotkit/project.json",
99
116
  "project_file_written": true,
100
117
  "api_key_provisioned": true,
101
- "environment_file_written": true
118
+ "environment_file_written": true,
119
+ "environment_file": {
120
+ "path": "/work/my-repo/web/.env",
121
+ "loadable_by_app": "pass"
122
+ }
102
123
  }
103
124
  ```
104
125
 
@@ -106,6 +127,15 @@ The four top-level summary fields let a coding agent read the result without
106
127
  searching the nested object or reading either file. The payload never contains
107
128
  the API key.
108
129
 
130
+ `environment_file` answers the two questions `environment_file_written` cannot:
131
+ which file the key went into, and whether an application will read it there.
132
+ `loadable_by_app` is `pass` when the key sits in a directory an app loads env
133
+ files from, `fail` when every such directory sits below it, and `undetermined`
134
+ when no application package was found. On a `fail` it also carries `apps`, the
135
+ directories that will not see the key. This command is the only step that can
136
+ work that out, so a caller that ignores the field learns the same thing later
137
+ from `copilotkit verify`.
138
+
109
139
  `config_path` is absolute, and it is not always under the directory you ran in.
110
140
  The project record is repository-scoped: it goes into an existing `.copilotkit/`
111
141
  at or above the current directory when there is one, and otherwise into the
@@ -119,9 +149,10 @@ repository with a `web/` and an `agent/` half, run `project select` in the half
119
149
  that needs the key.
120
150
 
121
151
  When the directory you ran in is not itself a CopilotKit package, `project
122
- select` names the directory that is expected to load the key on stderr. Run from
123
- the root of a `web/` + `agent/` repository, the key lands at the root while the
124
- app in `web/` reads only `web/.env*`, and `copilotkit verify` fails **The app can
152
+ select` names the directory that is expected to load the key, on stderr and in
153
+ `environment_file`. Run from the root of a `web/` + `agent/` repository, the key
154
+ lands at the root while the app in `web/` reads only `web/.env*`, the payload
155
+ reports `"loadable_by_app": "fail"`, and `copilotkit verify` fails **The app can
125
156
  load the project API key** until it is written there instead.
126
157
 
127
158
  ### When only half of it lands
@@ -146,10 +177,19 @@ false, and a `retry_command`:
146
177
  "project_file_written": true,
147
178
  "api_key_provisioned": false,
148
179
  "environment_file_written": false,
180
+ "environment_file": {
181
+ "path": "/work/my-repo/web/.env",
182
+ "loadable_by_app": "pass"
183
+ },
149
184
  "retry_command": "copilotkit project select --project my-app"
150
185
  }
151
186
  ```
152
187
 
188
+ `environment_file` is still reported here. `path` is the file the retry will write
189
+ to rather than one this run wrote, and `loadable_by_app` describes that directory
190
+ rather than a key that does not exist yet. Run the retry where `loadable_by_app`
191
+ is `pass`, so it does not repeat the original mistake.
192
+
153
193
  Keep the record and re-run the command it names. A retry converges on the same
154
194
  state as a first-time success: the same project, the same binding, plus the key.
155
195
 
@@ -200,6 +240,11 @@ keep reading the same process until its terminal event. If the opener fails,
200
240
  show the URL for manual sign-in instead of retrying it. A failed sign-in prints
201
241
  one final failure object and exits nonzero.
202
242
 
243
+ After the CLI exchanges the browser token and saves its credentials, the
244
+ agent-onboarding callback page tries to close the tab. If the browser blocks
245
+ closing, the page keeps a visible success message so the user can close it
246
+ manually. Exchange or credential-save failures keep a visible error page open.
247
+
203
248
  The bundled onboarding prompt gives one short explanation before it opens the
204
249
  page: sign-in lets the coding agent create a project and API key, and the user
205
250
  can remove the key later to disconnect the workspace.
@@ -229,10 +274,13 @@ npx --yes copilotkit@latest onboard start \
229
274
  | `add-chat-suggestions` | Configure and send visible chat suggestions |
230
275
  | `add-voice` | Add documented voice transcription to the existing composer |
231
276
  | `add-realtime-sync` | Prove managed thread changes sync between active clients |
232
- | `add-channels` | Connect Slack or Teams and prove a real mention |
233
277
 
234
- Run `copilotkit channels setup` to copy `onboard start --intent add-channels` with a run id.
235
- `add-channels` does not need a CopilotKit web app. The graph asks Slack or Teams.
278
+ Run `copilotkit channels setup` to copy the same small `onboard start --run <id>`
279
+ prompt as the website CTA. There is no `--intent add-channels`. The copied
280
+ prompt has no Channel sentence. When the project has no frontend, the root graph
281
+ asks which frontend they want and offers Slack and Microsoft Teams there. If the
282
+ copied prompt came from a Slack or Teams docs page, that page is the named
283
+ frontend.
236
284
  Its first prompt records the coding agent with `onboard identify`, including when
237
285
  the entry command omitted `--coding-agent`. Channel setup stage events include
238
286
  the existing `onboarding_run_id` when the command runs inside an onboarding run;
@@ -250,6 +298,36 @@ subagent returns, when the plan is approved, when implementation validation
250
298
  passes, and on each proof attempt and repair cycle. A run that cannot go on
251
299
  reads `feature/stop`, reports from there, and does not run `onboard complete`.
252
300
 
301
+ ### Coming back after a run that broke
302
+
303
+ A run whose stack this release serves, and which broke anyway, reads
304
+ `stopped/run-failed`. That node used to be the end of it. The graph refuses to
305
+ widen its own scope, so a fix outside the approved plan had to happen outside the
306
+ tracked run, and nothing after that point was recorded.
307
+
308
+ The developer can widen the scope the graph will not. The agent names one fix and
309
+ asks. When the developer approves it, the agent makes that one fix and runs:
310
+
311
+ ```bash
312
+ npx --yes copilotkit@latest onboard resume
313
+ ```
314
+
315
+ The approval goes to standard input, in one or two sentences and at most 500
316
+ characters. The command puts the run back on the step that failed, keeps the same
317
+ run id, and records both the approval and the step it re-entered. So the repair
318
+ and the second proof attempt belong to the run that stopped, rather than to
319
+ nothing at all. The approval is guarded and sent under the same telemetry setting
320
+ as a friction report.
321
+
322
+ A refused resume is not a failed step. A missing approval, an approval carrying a
323
+ credential shape, and a run that never stopped each print a reason, serve nothing,
324
+ and exit zero. A directory with no bound run is the one non-zero exit, and it is
325
+ the refusal every other onboarding step makes there.
326
+
327
+ Only `stopped/run-failed` resumes. `unsupported/no-validated-path` and
328
+ `feature/stop` describe a stack this release does not serve, which no fix inside
329
+ the run changes.
330
+
253
331
  The onboarding commands are:
254
332
 
255
333
  - `copilotkit init`
@@ -264,8 +342,8 @@ copilotkit create --name my-agent --framework langgraph-py
264
342
 
265
343
  Every supported framework ships with CopilotKit Intelligence (durable threads,
266
344
  persistence, insights). Managed `init` selects an Intelligence project and
267
- writes its project-scoped API key; it does not issue or write a managed license
268
- token. Local/self-hosted builds retain legacy license setup where required. The
345
+ writes its project-scoped API key. It does not issue or write a license token.
346
+ Local/self-hosted builds use a deployment license token when required. The
269
347
  `-i`/`--intelligence` flag is a deprecated no-op kept for compatibility.
270
348
 
271
349
  Rather than maintaining the list of framework values here, ask the CLI:
@@ -276,8 +354,8 @@ copilotkit framework list --json
276
354
  ```
277
355
 
278
356
  It reports every value `-f` accepts, the language each framework's agent is
279
- written in, and which init flags that framework supports — `-i`, `--mock`, and
280
- `--channel` are each accepted only for some. It answers from a catalog compiled into the
357
+ written in, and which init flags that framework supports — `-i` and `--channel`
358
+ are each accepted only for some. It answers from a catalog compiled into the
281
359
  binary, so it needs no API call, no authentication, and no TTY.
282
360
 
283
361
  ### Scaffolding without a terminal
@@ -370,8 +448,8 @@ copilotkit channels setup
370
448
  copilotkit channels setup --no-clipboard
371
449
  ```
372
450
 
373
- The command copies `onboard start --intent add-channels` with a run id.
374
- It installs the `channels-setup` skill, then prints a one-line prompt to paste
451
+ The command copies the small `onboard start --run <id>` prompt.
452
+ It installs the `channels-setup` skill, then prints that prompt to paste
375
453
  into your coding agent and copies it to your clipboard. The prompt is always
376
454
  printed, so you can read it before handing it over. Pass `--no-clipboard` in a
377
455
  headless or remote shell.
@@ -428,6 +506,7 @@ copilotkit learning containers create
428
506
  copilotkit learning containers select
429
507
  copilotkit learning containers update support-quality
430
508
  copilotkit learning containers delete support-quality
509
+ copilotkit learning containers default-id
431
510
  ```
432
511
 
433
512
  The create and update commands prompt for missing fields in a human terminal.
@@ -453,6 +532,7 @@ copilotkit learning containers create --id support-quality --name "Support quali
453
532
  copilotkit learning containers update support-quality --prompt-context "Use approved answers." --json
454
533
  copilotkit learning containers update support-quality --clear-prompt-context --json
455
534
  copilotkit learning containers delete support-quality --yes --json
535
+ copilotkit learning containers default-id --json
456
536
  ```
457
537
 
458
538
  `--json` emits one versioned JSON object on stdout and never prompts. Create
@@ -460,6 +540,16 @@ requires `--id` and `--name`. Update requires at least one change flag. Delete
460
540
  requires `--yes`. Errors use the same JSON envelope and exit with a nonzero
461
541
  status.
462
542
 
543
+ `default-id` prints the container id this project's slug derives to. One
544
+ container per project is the default scope, so the id is a pure function of the
545
+ slug the CLI already wrote into `.copilotkit/project.json`. It reads that record
546
+ only: no credential, no network call, and no entitlement check. A slug that
547
+ leaves nothing the id contract accepts reports `"status": "skipped"` with the
548
+ reason `slug-unusable`, and a directory with no selected project reports
549
+ `no-project-record`. Use it instead of deriving the id yourself. Two spellings
550
+ of one project's id give it two containers, each below the 15 distinct
551
+ conversations a first Learning run needs.
552
+
463
553
  A container keeps its stable ID. The list command returns at most 500 containers.
464
554
  If `nextCursor` is not null, pass it to `--cursor` to read the next page.
465
555
 
@@ -606,15 +696,15 @@ The CLI expects:
606
696
  Project creation requires a CopilotKit workspace connection through Ops/Clerk
607
697
  (browser sign-in when no session exists). Managed threads-framework templates
608
698
  use that connection to select a project and provision
609
- `CPK_INTELLIGENCE_API_KEY`; they do not request or write a license token.
610
- Local/self-hosted builds can still issue the legacy license where required.
699
+ `CPK_INTELLIGENCE_API_KEY`. They do not request or write a license token.
700
+ Local/self-hosted builds can still issue a deployment license token where required.
611
701
 
612
702
  ## Environment Files
613
703
 
614
704
  The scaffold step copies `.env.example` to `.env` when a template provides one.
615
705
  Managed scaffolds write `CPK_INTELLIGENCE_API_KEY` after project selection.
616
706
  Local/self-hosted scaffolds still ensure `COPILOTKIT_LICENSE_TOKEN` is present
617
- when the selected starter requires the legacy license.
707
+ when the selected starter requires a deployment license.
618
708
 
619
709
  During scaffolding, `copilotkit init` interactively prompts for any required LLM vendor API key (`OPENAI_API_KEY` or `GOOGLE_API_KEY`) and writes it into `.env` for you — press Enter to skip and set it manually later.
620
710
 
@@ -707,7 +797,9 @@ python3 -m venv agents/.venv
707
797
  agents/.venv/bin/pip install -r agents/requirements.txt
708
798
  ```
709
799
 
710
- For the Intelligence threads template, keep Docker Desktop running before `npm run dev`. The root dev script starts the required Docker Compose services automatically when a license token is present in `.env` (without one it prints a "threads locked" hint and skips Docker), so a separate `docker compose up` step is only needed when you intentionally want to manage infrastructure by hand.
800
+ Managed Intelligence scaffolds connect to hosted services with
801
+ `CPK_INTELLIGENCE_API_KEY`. Their `npm run dev` command does not start a local
802
+ Intelligence stack or require `COPILOTKIT_LICENSE_TOKEN`.
711
803
 
712
804
  ## Diagnostics
713
805
 
@@ -929,6 +1021,44 @@ revalidate the live Clerk organization before using local auth as needed. If a
929
1021
  workspace or organization check fails because the cached session is stale, the
930
1022
  CLI may clear local auth and rerun browser login before continuing.
931
1023
 
1024
+ ### A model call returns 401 after the credential was written
1025
+
1026
+ A long-lived process reads its env file once, at launch. A credential written
1027
+ into that file afterwards is correct on disk and absent from the process, so
1028
+ every model call fails and the stack trace points at the agent framework rather
1029
+ than at the key.
1030
+
1031
+ Ask which running processes predate the file they read:
1032
+
1033
+ ```bash
1034
+ copilotkit onboard env-staleness
1035
+ copilotkit onboard env-staleness --json
1036
+ ```
1037
+
1038
+ It reports one line per listening process inside the project: `stale` names the
1039
+ env file and how long after launch it was written, `current` means no file it
1040
+ reads changed since it started, and `unknown` names why it could not be placed.
1041
+ A probe that could not run reports that too, because an empty list otherwise
1042
+ reads as "nothing is stale" and rules out the cause.
1043
+
1044
+ It reads only. No credential, no network call, and no bound run. It reports the
1045
+ first token of the executable name as `ps` reports it, never the arguments, and
1046
+ never a value from an env file.
1047
+
1048
+ Candidates are listening TCP sockets, owned by you, whose working directory is
1049
+ inside the project. Everything else is counted on one line and never examined, so
1050
+ the answer is not buried under your containers and editors. That bounds what the
1051
+ reading can see, and an empty result is not a clean bill of health: a server in a
1052
+ container, behind a unix socket, or run by another user does not appear, and a
1053
+ container exposes its port through the container runtime rather than from a
1054
+ directory inside the project. The command says so rather than reporting that
1055
+ nothing is stale.
1056
+
1057
+ It recommends stopping nothing. The CLI cannot prove which processes a run
1058
+ started, and a starter that serves both halves from one script loses both when
1059
+ either one goes down. Restart what you started, with the command you started it
1060
+ with, and leave the rest running.
1061
+
932
1062
  ### A command, subcommand, or flag that should exist is rejected
933
1063
 
934
1064
  `npx` keys its cache on the spec string, so `copilotkit@latest` can keep serving
@@ -1017,3 +1147,9 @@ first.
1017
1147
  Production validation, publication, provenance inspection, post-npm recovery,
1018
1148
  and rollback are documented in the
1019
1149
  [CLI release runbook](../../docs/runbooks/cli-release.md).
1150
+
1151
+ ## Package license
1152
+
1153
+ The CLI is commercial software. Its npm manifest uses `SEE LICENSE IN LICENSE` and includes
1154
+ a [commercial notice](LICENSE). This notice does not change the licenses of
1155
+ projects created with the CLI. See the [package license map](../../docs/licensing/package-licenses.md).
@@ -2,20 +2,20 @@
2
2
  "schemaVersion": 1,
3
3
  "package": {
4
4
  "name": "copilotkit",
5
- "version": "4.10.1"
5
+ "version": "4.12.0"
6
6
  },
7
7
  "intelligence": {
8
- "commit": "b5b41dba88259cb723cfd2560be82b234417efa7"
8
+ "commit": "894cde3a9735b1605afef07a1250bef02a123ca4"
9
9
  },
10
10
  "copilotKit": {
11
- "submittedInput": "7e6964f",
12
- "commit": "7e6964fc11092b685bbea62bc331d5d177b738c1"
11
+ "submittedInput": "0048ba241fdf14a9036cdad11a4f31aa021a9c8d",
12
+ "commit": "0048ba241fdf14a9036cdad11a4f31aa021a9c8d"
13
13
  },
14
14
  "channel": "production",
15
- "triggeringActor": "AlemTuzlak",
15
+ "triggeringActor": "BenTaylorDev",
16
16
  "workflow": {
17
- "runId": "35080956003",
18
- "runUrl": "https://github.com/CopilotKit/Intelligence/actions/runs/35080956003"
17
+ "runId": "35617651318",
18
+ "runUrl": "https://github.com/CopilotKit/Intelligence/actions/runs/35617651318"
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-16T09:44:44Z"
27
+ "builtAt": "2026-09-21T15:17:52Z"
28
28
  }