copilotkit 4.11.0 → 4.13.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 (82) hide show
  1. package/LICENSE +11 -0
  2. package/README.md +155 -12
  3. package/cli-build-info.json +8 -8
  4. package/index.js +5969 -4751
  5. package/onboarding/index.json +27 -2
  6. package/onboarding/prompts/authenticate/start.md +45 -38
  7. package/onboarding/prompts/conversion/plan.md +3 -3
  8. package/onboarding/prompts/credentials/finalize-plan.md +14 -13
  9. package/onboarding/prompts/credentials/plan.md +26 -20
  10. package/onboarding/prompts/credentials/settle-credentials.md +55 -23
  11. package/onboarding/prompts/credentials/write-plan.md +19 -6
  12. package/onboarding/prompts/fallback/best-effort.md +6 -6
  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 +68 -13
  18. package/onboarding/prompts/feature/channels/proof.md +13 -6
  19. package/onboarding/prompts/feature/channels/start.md +30 -11
  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 +2 -2
  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 +4 -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 +5 -2
  47. package/onboarding/prompts/framework/google-adk.md +4 -2
  48. package/onboarding/prompts/framework/langgraph-fastapi.md +4 -3
  49. package/onboarding/prompts/framework/langgraph-python.md +6 -2
  50. package/onboarding/prompts/framework/langgraph-typescript.md +6 -2
  51. package/onboarding/prompts/framework/llamaindex.md +2 -2
  52. package/onboarding/prompts/framework/mastra.md +4 -2
  53. package/onboarding/prompts/framework/ms-agent-dotnet.md +4 -2
  54. package/onboarding/prompts/framework/ms-agent-harness-dotnet.md +2 -2
  55. package/onboarding/prompts/framework/ms-agent-python.md +4 -2
  56. package/onboarding/prompts/framework/pydantic-ai.md +2 -2
  57. package/onboarding/prompts/framework/strands-python.md +4 -2
  58. package/onboarding/prompts/framework/strands-typescript.md +4 -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 +21 -10
  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 +39 -16
  66. package/onboarding/prompts/proof/complete.md +35 -15
  67. package/onboarding/prompts/proof/oss-baseline.md +5 -5
  68. package/onboarding/prompts/proof/round-trip.md +23 -12
  69. package/onboarding/prompts/research/gather.md +33 -91
  70. package/onboarding/prompts/research/merge.md +60 -0
  71. package/onboarding/prompts/research/preflight.md +75 -0
  72. package/onboarding/prompts/research/route.md +49 -4
  73. package/onboarding/prompts/starter/clone.md +5 -5
  74. package/onboarding/prompts/stopped/run-failed.md +30 -1
  75. package/onboarding/prompts/subagent/create-plan.md +24 -1
  76. package/onboarding/prompts/subagent/implement-and-validate.md +32 -1
  77. package/onboarding/prompts/subagent/inspect-repository.md +43 -16
  78. package/onboarding/prompts/subagent/prove-oss-baseline.md +1 -1
  79. package/onboarding/prompts/subagent/prove-round-trip.md +37 -10
  80. package/onboarding/prompts/unsupported/no-validated-path.md +2 -2
  81. package/package.json +7 -3
  82. 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
@@ -12,6 +12,10 @@ Use the published package for normal onboarding:
12
12
  npx copilotkit@latest init
13
13
  ```
14
14
 
15
+ The CLI needs Node.js 20.9.0 or later. `package.json` declares that floor, so
16
+ npm warns about an older one, and the CLI itself stops with the same message
17
+ rather than failing somewhere deeper.
18
+
15
19
  For this workspace, build and run the local CLI with Nx:
16
20
 
17
21
  ```bash
@@ -19,6 +23,29 @@ CLI_ENV=local pnpm nx build cli
19
23
  node dist/apps/cli/index.js --help
20
24
  ```
21
25
 
26
+ Everything above installs with no compiler on the machine.
27
+
28
+ Microsoft Teams channel setup is the one exception. It runs
29
+ `@microsoft/teams.cli`. That package depends on `keytar`, which builds a native
30
+ keychain addon. So the CLI declares it as an **optional** dependency. A machine
31
+ that cannot build it still installs and runs the CLI. Only Teams setup fails,
32
+ and it reports the reason.
33
+
34
+ To set up a Teams channel on such a machine, install the package yourself:
35
+
36
+ ```bash
37
+ npm install @microsoft/teams.cli@3.0.3
38
+ ```
39
+
40
+ That build needs a prebuilt binary, or `python3`, a C++ toolchain and the
41
+ libsecret headers.
42
+
43
+ Both of the commands the CLI runs for you are bounded. A dependency install is
44
+ stopped after 10 minutes, and the skills installer after 5. A registry that
45
+ accepts the connection and then sends nothing therefore ends in a message that
46
+ names the command and the wait, rather than in a CLI that never returns. A stall
47
+ is not retried, because retrying it would spend the same wait a second time.
48
+
22
49
  ## Type-safe agent IDs
23
50
 
24
51
  `copilotkit typegen` reads a running CopilotKit runtime's `/info` route and
@@ -98,7 +125,11 @@ press Enter again to take it, or type a different one.
98
125
  "config_path": "/work/my-repo/.copilotkit/project.json",
99
126
  "project_file_written": true,
100
127
  "api_key_provisioned": true,
101
- "environment_file_written": true
128
+ "environment_file_written": true,
129
+ "environment_file": {
130
+ "path": "/work/my-repo/web/.env",
131
+ "loadable_by_app": "pass"
132
+ }
102
133
  }
103
134
  ```
104
135
 
@@ -106,6 +137,15 @@ The four top-level summary fields let a coding agent read the result without
106
137
  searching the nested object or reading either file. The payload never contains
107
138
  the API key.
108
139
 
140
+ `environment_file` answers the two questions `environment_file_written` cannot:
141
+ which file the key went into, and whether an application will read it there.
142
+ `loadable_by_app` is `pass` when the key sits in a directory an app loads env
143
+ files from, `fail` when every such directory sits below it, and `undetermined`
144
+ when no application package was found. On a `fail` it also carries `apps`, the
145
+ directories that will not see the key. This command is the only step that can
146
+ work that out, so a caller that ignores the field learns the same thing later
147
+ from `copilotkit verify`.
148
+
109
149
  `config_path` is absolute, and it is not always under the directory you ran in.
110
150
  The project record is repository-scoped: it goes into an existing `.copilotkit/`
111
151
  at or above the current directory when there is one, and otherwise into the
@@ -119,9 +159,10 @@ repository with a `web/` and an `agent/` half, run `project select` in the half
119
159
  that needs the key.
120
160
 
121
161
  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
162
+ select` names the directory that is expected to load the key, on stderr and in
163
+ `environment_file`. Run from the root of a `web/` + `agent/` repository, the key
164
+ lands at the root while the app in `web/` reads only `web/.env*`, the payload
165
+ reports `"loadable_by_app": "fail"`, and `copilotkit verify` fails **The app can
125
166
  load the project API key** until it is written there instead.
126
167
 
127
168
  ### When only half of it lands
@@ -146,10 +187,19 @@ false, and a `retry_command`:
146
187
  "project_file_written": true,
147
188
  "api_key_provisioned": false,
148
189
  "environment_file_written": false,
190
+ "environment_file": {
191
+ "path": "/work/my-repo/web/.env",
192
+ "loadable_by_app": "pass"
193
+ },
149
194
  "retry_command": "copilotkit project select --project my-app"
150
195
  }
151
196
  ```
152
197
 
198
+ `environment_file` is still reported here. `path` is the file the retry will write
199
+ to rather than one this run wrote, and `loadable_by_app` describes that directory
200
+ rather than a key that does not exist yet. Run the retry where `loadable_by_app`
201
+ is `pass`, so it does not repeat the original mistake.
202
+
153
203
  Keep the record and re-run the command it names. A retry converges on the same
154
204
  state as a first-time success: the same project, the same binding, plus the key.
155
205
 
@@ -200,6 +250,11 @@ keep reading the same process until its terminal event. If the opener fails,
200
250
  show the URL for manual sign-in instead of retrying it. A failed sign-in prints
201
251
  one final failure object and exits nonzero.
202
252
 
253
+ After the CLI exchanges the browser token and saves its credentials, the
254
+ agent-onboarding callback page tries to close the tab. If the browser blocks
255
+ closing, the page keeps a visible success message so the user can close it
256
+ manually. Exchange or credential-save failures keep a visible error page open.
257
+
203
258
  The bundled onboarding prompt gives one short explanation before it opens the
204
259
  page: sign-in lets the coding agent create a project and API key, and the user
205
260
  can remove the key later to disconnect the workspace.
@@ -253,6 +308,36 @@ subagent returns, when the plan is approved, when implementation validation
253
308
  passes, and on each proof attempt and repair cycle. A run that cannot go on
254
309
  reads `feature/stop`, reports from there, and does not run `onboard complete`.
255
310
 
311
+ ### Coming back after a run that broke
312
+
313
+ A run whose stack this release serves, and which broke anyway, reads
314
+ `stopped/run-failed`. That node used to be the end of it. The graph refuses to
315
+ widen its own scope, so a fix outside the approved plan had to happen outside the
316
+ tracked run, and nothing after that point was recorded.
317
+
318
+ The developer can widen the scope the graph will not. The agent names one fix and
319
+ asks. When the developer approves it, the agent makes that one fix and runs:
320
+
321
+ ```bash
322
+ npx --yes copilotkit@latest onboard resume
323
+ ```
324
+
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
327
+ run id, and records both the approval and the step it re-entered. So the repair
328
+ and the second proof attempt belong to the run that stopped, rather than to
329
+ nothing at all. The approval is guarded and sent under the same telemetry setting
330
+ as a friction report.
331
+
332
+ A refused resume is not a failed step. A missing approval, an approval carrying a
333
+ credential shape, and a run that never stopped each print a reason, serve nothing,
334
+ and exit zero. A directory with no bound run is the one non-zero exit, and it is
335
+ the refusal every other onboarding step makes there.
336
+
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.
340
+
256
341
  The onboarding commands are:
257
342
 
258
343
  - `copilotkit init`
@@ -267,8 +352,8 @@ copilotkit create --name my-agent --framework langgraph-py
267
352
 
268
353
  Every supported framework ships with CopilotKit Intelligence (durable threads,
269
354
  persistence, insights). Managed `init` selects an Intelligence project and
270
- writes its project-scoped API key; it does not issue or write a managed license
271
- token. Local/self-hosted builds retain legacy license setup where required. The
355
+ writes its project-scoped API key. It does not issue or write a license token.
356
+ Local/self-hosted builds use a deployment license token when required. The
272
357
  `-i`/`--intelligence` flag is a deprecated no-op kept for compatibility.
273
358
 
274
359
  Rather than maintaining the list of framework values here, ask the CLI:
@@ -279,8 +364,8 @@ copilotkit framework list --json
279
364
  ```
280
365
 
281
366
  It reports every value `-f` accepts, the language each framework's agent is
282
- written in, and which init flags that framework supports — `-i`, `--mock`, and
283
- `--channel` are each accepted only for some. It answers from a catalog compiled into the
367
+ written in, and which init flags that framework supports — `-i` and `--channel`
368
+ are each accepted only for some. It answers from a catalog compiled into the
284
369
  binary, so it needs no API call, no authentication, and no TTY.
285
370
 
286
371
  ### Scaffolding without a terminal
@@ -431,6 +516,7 @@ copilotkit learning containers create
431
516
  copilotkit learning containers select
432
517
  copilotkit learning containers update support-quality
433
518
  copilotkit learning containers delete support-quality
519
+ copilotkit learning containers default-id
434
520
  ```
435
521
 
436
522
  The create and update commands prompt for missing fields in a human terminal.
@@ -456,6 +542,7 @@ copilotkit learning containers create --id support-quality --name "Support quali
456
542
  copilotkit learning containers update support-quality --prompt-context "Use approved answers." --json
457
543
  copilotkit learning containers update support-quality --clear-prompt-context --json
458
544
  copilotkit learning containers delete support-quality --yes --json
545
+ copilotkit learning containers default-id --json
459
546
  ```
460
547
 
461
548
  `--json` emits one versioned JSON object on stdout and never prompts. Create
@@ -463,6 +550,16 @@ requires `--id` and `--name`. Update requires at least one change flag. Delete
463
550
  requires `--yes`. Errors use the same JSON envelope and exit with a nonzero
464
551
  status.
465
552
 
553
+ `default-id` prints the container id this project's slug derives to. One
554
+ container per project is the default scope, so the id is a pure function of the
555
+ slug the CLI already wrote into `.copilotkit/project.json`. It reads that record
556
+ only: no credential, no network call, and no entitlement check. A slug that
557
+ leaves nothing the id contract accepts reports `"status": "skipped"` with the
558
+ reason `slug-unusable`, and a directory with no selected project reports
559
+ `no-project-record`. Use it instead of deriving the id yourself. Two spellings
560
+ of one project's id give it two containers, each below the 15 distinct
561
+ conversations a first Learning run needs.
562
+
466
563
  A container keeps its stable ID. The list command returns at most 500 containers.
467
564
  If `nextCursor` is not null, pass it to `--cursor` to read the next page.
468
565
 
@@ -609,15 +706,15 @@ The CLI expects:
609
706
  Project creation requires a CopilotKit workspace connection through Ops/Clerk
610
707
  (browser sign-in when no session exists). Managed threads-framework templates
611
708
  use that connection to select a project and provision
612
- `CPK_INTELLIGENCE_API_KEY`; they do not request or write a license token.
613
- Local/self-hosted builds can still issue the legacy license where required.
709
+ `CPK_INTELLIGENCE_API_KEY`. They do not request or write a license token.
710
+ Local/self-hosted builds can still issue a deployment license token where required.
614
711
 
615
712
  ## Environment Files
616
713
 
617
714
  The scaffold step copies `.env.example` to `.env` when a template provides one.
618
715
  Managed scaffolds write `CPK_INTELLIGENCE_API_KEY` after project selection.
619
716
  Local/self-hosted scaffolds still ensure `COPILOTKIT_LICENSE_TOKEN` is present
620
- when the selected starter requires the legacy license.
717
+ when the selected starter requires a deployment license.
621
718
 
622
719
  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.
623
720
 
@@ -710,7 +807,9 @@ python3 -m venv agents/.venv
710
807
  agents/.venv/bin/pip install -r agents/requirements.txt
711
808
  ```
712
809
 
713
- 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.
810
+ Managed Intelligence scaffolds connect to hosted services with
811
+ `CPK_INTELLIGENCE_API_KEY`. Their `npm run dev` command does not start a local
812
+ Intelligence stack or require `COPILOTKIT_LICENSE_TOKEN`.
714
813
 
715
814
  ## Diagnostics
716
815
 
@@ -932,6 +1031,44 @@ revalidate the live Clerk organization before using local auth as needed. If a
932
1031
  workspace or organization check fails because the cached session is stale, the
933
1032
  CLI may clear local auth and rerun browser login before continuing.
934
1033
 
1034
+ ### A model call returns 401 after the credential was written
1035
+
1036
+ A long-lived process reads its env file once, at launch. A credential written
1037
+ into that file afterwards is correct on disk and absent from the process, so
1038
+ every model call fails and the stack trace points at the agent framework rather
1039
+ than at the key.
1040
+
1041
+ Ask which running processes predate the file they read:
1042
+
1043
+ ```bash
1044
+ copilotkit onboard env-staleness
1045
+ copilotkit onboard env-staleness --json
1046
+ ```
1047
+
1048
+ It reports one line per listening process inside the project: `stale` names the
1049
+ env file and how long after launch it was written, `current` means no file it
1050
+ reads changed since it started, and `unknown` names why it could not be placed.
1051
+ A probe that could not run reports that too, because an empty list otherwise
1052
+ reads as "nothing is stale" and rules out the cause.
1053
+
1054
+ It reads only. No credential, no network call, and no bound run. It reports the
1055
+ first token of the executable name as `ps` reports it, never the arguments, and
1056
+ never a value from an env file.
1057
+
1058
+ Candidates are listening TCP sockets, owned by you, whose working directory is
1059
+ inside the project. Everything else is counted on one line and never examined, so
1060
+ the answer is not buried under your containers and editors. That bounds what the
1061
+ reading can see, and an empty result is not a clean bill of health: a server in a
1062
+ container, behind a unix socket, or run by another user does not appear, and a
1063
+ container exposes its port through the container runtime rather than from a
1064
+ directory inside the project. The command says so rather than reporting that
1065
+ nothing is stale.
1066
+
1067
+ It recommends stopping nothing. The CLI cannot prove which processes a run
1068
+ started, and a starter that serves both halves from one script loses both when
1069
+ either one goes down. Restart what you started, with the command you started it
1070
+ with, and leave the rest running.
1071
+
935
1072
  ### A command, subcommand, or flag that should exist is rejected
936
1073
 
937
1074
  `npx` keys its cache on the spec string, so `copilotkit@latest` can keep serving
@@ -1020,3 +1157,9 @@ first.
1020
1157
  Production validation, publication, provenance inspection, post-npm recovery,
1021
1158
  and rollback are documented in the
1022
1159
  [CLI release runbook](../../docs/runbooks/cli-release.md).
1160
+
1161
+ ## Package license
1162
+
1163
+ The CLI is commercial software. Its npm manifest uses `SEE LICENSE IN LICENSE` and includes
1164
+ a [commercial notice](LICENSE). This notice does not change the licenses of
1165
+ 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.11.0"
5
+ "version": "4.13.0"
6
6
  },
7
7
  "intelligence": {
8
- "commit": "362d341410722307c1067c71ac14710245300cff"
8
+ "commit": "addb7285609bab57a4a8ef12d73351fdf5dfaf3f"
9
9
  },
10
10
  "copilotKit": {
11
- "submittedInput": "dc1238c0bd473e259c992b85026cb30fe6b3b726",
12
- "commit": "dc1238c0bd473e259c992b85026cb30fe6b3b726"
11
+ "submittedInput": "1e13b4945b44c6afa2e398a0c9935415d4aa7577",
12
+ "commit": "1e13b4945b44c6afa2e398a0c9935415d4aa7577"
13
13
  },
14
14
  "channel": "production",
15
- "triggeringActor": "tylerslaton",
15
+ "triggeringActor": "AlemTuzlak",
16
16
  "workflow": {
17
- "runId": "35162202498",
18
- "runUrl": "https://github.com/CopilotKit/Intelligence/actions/runs/35162202498"
17
+ "runId": "35742767211",
18
+ "runUrl": "https://github.com/CopilotKit/Intelligence/actions/runs/35742767211"
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-16T23:26:51Z"
27
+ "builtAt": "2026-09-22T14:49:50Z"
28
28
  }