copilotkit 4.9.17 → 4.9.31

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 (47) hide show
  1. package/README.md +152 -51
  2. package/cli-build-info.json +8 -8
  3. package/index.js +4590 -3234
  4. package/onboarding/index.json +1 -1
  5. package/onboarding/prompts/authenticate/start.md +27 -8
  6. package/onboarding/prompts/conversion/plan.md +24 -13
  7. package/onboarding/prompts/credentials/finalize-plan.md +119 -45
  8. package/onboarding/prompts/credentials/plan.md +20 -20
  9. package/onboarding/prompts/fallback/best-effort.md +19 -10
  10. package/onboarding/prompts/framework/ag2.md +2 -2
  11. package/onboarding/prompts/framework/agno.md +2 -2
  12. package/onboarding/prompts/framework/built-in.md +2 -2
  13. package/onboarding/prompts/framework/claude-sdk-python.md +2 -2
  14. package/onboarding/prompts/framework/claude-sdk-typescript.md +2 -2
  15. package/onboarding/prompts/framework/crewai-flows.md +2 -2
  16. package/onboarding/prompts/framework/deep-agents.md +2 -2
  17. package/onboarding/prompts/framework/google-adk.md +2 -2
  18. package/onboarding/prompts/framework/langgraph-fastapi.md +2 -2
  19. package/onboarding/prompts/framework/langgraph-python.md +2 -2
  20. package/onboarding/prompts/framework/langgraph-typescript.md +2 -2
  21. package/onboarding/prompts/framework/llamaindex.md +2 -2
  22. package/onboarding/prompts/framework/mastra.md +2 -2
  23. package/onboarding/prompts/framework/ms-agent-dotnet.md +2 -2
  24. package/onboarding/prompts/framework/ms-agent-harness-dotnet.md +2 -2
  25. package/onboarding/prompts/framework/ms-agent-python.md +2 -2
  26. package/onboarding/prompts/framework/pydantic-ai.md +3 -3
  27. package/onboarding/prompts/framework/strands-python.md +2 -2
  28. package/onboarding/prompts/framework/strands-typescript.md +2 -2
  29. package/onboarding/prompts/frontend/angular.md +32 -4
  30. package/onboarding/prompts/frontend/nextjs.md +3 -3
  31. package/onboarding/prompts/frontend/plan.md +6 -6
  32. package/onboarding/prompts/frontend/react-native.md +2 -2
  33. package/onboarding/prompts/frontend/react-spa.md +2 -2
  34. package/onboarding/prompts/frontend/vue.md +2 -2
  35. package/onboarding/prompts/implementation/build-and-validate.md +32 -10
  36. package/onboarding/prompts/proof/complete.md +33 -12
  37. package/onboarding/prompts/proof/oss-baseline.md +13 -6
  38. package/onboarding/prompts/proof/round-trip.md +20 -12
  39. package/onboarding/prompts/starter/clone.md +17 -8
  40. package/onboarding/prompts/subagent/create-plan.md +31 -3
  41. package/onboarding/prompts/subagent/implement-and-validate.md +30 -1
  42. package/onboarding/prompts/subagent/inspect-repository.md +1 -1
  43. package/onboarding/prompts/subagent/prove-oss-baseline.md +16 -7
  44. package/onboarding/prompts/subagent/prove-round-trip.md +31 -10
  45. package/onboarding/prompts/unsupported/no-validated-path.md +6 -2
  46. package/package.json +1 -1
  47. package/release/release-tool.js +15 -1
@@ -35,13 +35,40 @@ reference naming hosts that route nothing, and it requires the platform URLs the
35
35
  documentation calls optional. A run that reads that reference configures the runtime
36
36
  against a dead host, and the failure arrives as an empty-body 404 with no cause named.
37
37
 
38
- If any `@copilotkit/*` dependency is below 1.64.0, plan to upgrade every `@copilotkit/*`
38
+ If any `@copilotkit/*` dependency is below 1.70.0, plan to upgrade every `@copilotkit/*`
39
39
  dependency to its latest published version. Packages that share a version line must end
40
40
  on the same version. Never force a package onto a version line it does not publish on.
41
41
  Resolve each latest version at run time rather than from a remembered version number.
42
42
  Where every `@copilotkit/*` dependency already meets that floor, plan no dependency
43
43
  change.
44
44
 
45
+ The floor is 1.70.0 because the runtime resolves managed Intelligence entitlement
46
+ authority from that version. A runtime below it reports its license from a self-hosted
47
+ token alone. A managed project holds no such token, so the threads drawer this conversion
48
+ adds lists nothing even after every command-line check passes.
49
+
50
+ The upgrade moves more than the `@copilotkit/*` namespace. Intersect the dependencies the
51
+ app declares directly with what the target `@copilotkit/*` versions require, and name in the
52
+ plan every one whose declared range excludes the version the target needs, with the version
53
+ it moves to. The `@ag-ui/*` packages are the CopilotKit protocol layer, on their own version
54
+ line, so they are the ones this meets most often, but the rule is the intersection rather
55
+ than that namespace.
56
+
57
+ The intersection includes what a `@copilotkit/*` package on its own version line declares
58
+ about the `1.x` line. `@copilotkit/angular` is the one that has this, and its declaration
59
+ is materialized at publish time rather than written in the repository, so read it from the
60
+ registry rather than from any checkout. Where it cannot be satisfied by the version the
61
+ floor requires, there is no upgrade to plan: that is `unsupported/no-validated-path`.
62
+
63
+ An exact pin is usually deliberate. Naming the move here is what makes it a step the
64
+ developer approved rather than a repair the run invents halfway through. Do not move a pin
65
+ the developer did not approve moving. Where the developer needs one held, that is
66
+ `unsupported/no-validated-path`, and the upgrade step's revert is the way back.
67
+
68
+ Name the exact version the target requires. A caret does not stand in for it below `0.1.0`:
69
+ `^0.0.59` admits only `0.0.59`, so a pin rewritten that way is the same pin under a
70
+ different spelling, and it breaks again as soon as CopilotKit moves to `0.0.60`.
71
+
45
72
  Plan the upgrade as its own step before the Intelligence runtime wiring, and plan to
46
73
  re-run the recorded baseline checks immediately after it. Name the revert: restore the
47
74
  manifest and lockfile to their recorded state and stop, rather than wiring Intelligence
@@ -94,8 +121,9 @@ here is work the developer did not ask for.
94
121
 
95
122
  Plan the threads drawer itself: add it from the selected drawer page, where this frontend
96
123
  does not already render one. Where this journey's frontend framework ships no threads
97
- drawer -- React Native --, plan that the thread is proved in the managed Intelligence
98
- dashboard instead.
124
+ drawer -- React Native --, plan that the thread is proved by
125
+ `npx --yes copilotkit@4.9.31 verify --round-trip`, which needs no browser. Do not plan a
126
+ step that opens the managed Intelligence dashboard.
99
127
 
100
128
  ## Order the plan into steps
101
129
 
@@ -51,7 +51,36 @@ Where the plan names a CopilotKit dependency upgrade:
51
51
 
52
52
  1. Apply the planned CopilotKit dependency upgrade before you wire Intelligence.
53
53
  2. Report each `@copilotkit/*` version before and after the upgrade.
54
- 3. Then re-run the recorded baseline checks.
54
+ 3. Prove that every dependency the app declares directly resolves to exactly one version in
55
+ the installed tree.
56
+ 4. Then re-run the recorded baseline checks.
57
+
58
+ The package manager does not fail on this. Where the app pins a package exactly and the
59
+ upgraded CopilotKit needs a different version of it, npm keeps the pin at the top of the
60
+ tree and nests the other copy, so the install exits zero and `--dry-run` shows nothing.
61
+ Two copies of a package that carries types fail the type check in some field that has
62
+ nothing to do with either version, so the developer reads it as a bug in their own code.
63
+ Read the installed tree, not the manifest: ask the package manager how many versions of
64
+ each direct dependency it resolved, with `npm ls <name>`, `pnpm why <name>`, or the
65
+ equivalent for the lockfile this project uses. Direct dependencies are a short list, and
66
+ they are the ones whose duplicate breaks a build, so this catches `react`, `zod`,
67
+ `graphql`, and the next protocol package as well as `@ag-ui/*`.
68
+
69
+ `@copilotkit/*` counts here, not only third-party packages. `@copilotkit/angular`
70
+ publishes on a version line of its own and declares a `@copilotkit/core` chosen when that
71
+ Angular release was cut, so the upgrade can install one `@copilotkit/core` while the
72
+ Angular package demands another. That is the case this catches most expensively, because
73
+ it fails in the threads drawer rather than at the install.
74
+
75
+ If one of them resolves to more than one version, restore the manifest and lockfile to
76
+ their recorded state, leave Intelligence unwired, and report which package resolved to more
77
+ than one version, which versions, and which declared range held the top of the tree. Stop.
78
+ Do not wire Intelligence onto a tree carrying two copies of a package.
79
+
80
+ Never add an `overrides`, `resolutions`, or `pnpm.overrides` block to collapse the two
81
+ copies. It forces a version the developer did not approve onto their whole tree, and it
82
+ turns a reportable mismatch between two published packages into a local workaround nobody
83
+ else can see.
55
84
 
56
85
  If the baseline regresses, restore the manifest and lockfile to their recorded state, leave
57
86
  Intelligence unwired, and report the regression with the failing check. Stop. Where the plan
@@ -38,7 +38,7 @@ from different directories.
38
38
 
39
39
  For the CopilotKit versions, report the exact installed version of every `@copilotkit/*`
40
40
  dependency, read from the lockfile rather than a manifest range, and state whether any of
41
- them is below 1.64.0. The conversion decides its upgrade from exactly that, and a caret
41
+ them is below 1.70.0. The conversion decides its upgrade from exactly that, and a caret
42
42
  range does not answer it.
43
43
 
44
44
  A project states what it is for in its `README.md`, in its package description, or in
@@ -16,17 +16,26 @@ Prove the live runtime in this order:
16
16
  4. Confirm from project files that the runtime constructor passes a `runner` option rather
17
17
  than an `intelligence` option. A package, import, project file, or key is not use proof.
18
18
  5. Run
19
- `npx --yes copilotkit@4.9.17 verify --expect-runtime oss --round-trip --agent <expected-agent-id> --json`,
19
+ `npx --yes copilotkit@4.9.31 verify --expect-runtime oss --round-trip --agent <expected-agent-id> --json`,
20
20
  with the runtime URL or auth header options that this project needs. Require exit zero
21
21
  and the JSON `ok` field to be `true`.
22
22
  6. Drive one real request through the existing frontend, CopilotKit runtime, and expected
23
- agent. Require the existing user-visible result. If no browser tool is available, the
24
- round trip is not proved and the state is `unproved`.
23
+ agent. Require the existing user-visible result.
25
24
 
26
- Classify the state as `both-oss` only when all six predicates are true: agent present,
27
- interface present, CopilotKit present, CopilotKit round trip proven, runtime connection
28
- `oss`, and managed Intelligence not configured. Return each predicate and its secret-safe
29
- evidence.
25
+ Use the surface control the main coding agent recorded for your environment. It either had
26
+ one already or registered one before this step, so that finding is the answer and there is
27
+ nothing here for you to go looking for. Do not add a browser or device driver to this
28
+ project: a devDependency and a browser download land in the diff of a repository that never
29
+ asked for one, which is a different thing from a server registered against the coding agent.
30
+ Where the recorded control is `unavailable`, record predicate 6 as skipped, with that as the
31
+ reason, and prove the rest.
32
+
33
+ Classify the state as `both-oss` when predicates 1 to 5 are all true. Predicate 5 proves the
34
+ CopilotKit round trip from a shell, so those five settle the starting state on their own.
35
+ Predicate 6 adds the user-visible surface on top of a state already proved: record it as
36
+ passed, failed, or skipped, and do not withhold `both-oss` for a skip. A failed predicate 6
37
+ on an available surface is a baseline failure and is not a skip. Return each predicate and
38
+ its secret-safe evidence.
30
39
 
31
40
  The default in-memory OSS runner is ephemeral. SQLite, custom, or framework persistence
32
41
  can be durable. Report the persistence that project evidence proves, or `unproved`. Do not
@@ -90,8 +90,8 @@ A server that never answered has written the reason to its own output, and readi
90
90
  output is faster than starting it again.
91
91
 
92
92
  Leave the agent and frontend servers running after proof. Record each process ID and a
93
- safe command that stops that process. Record the frontend URL and the commands that start
94
- both servers again.
93
+ safe command that stops that process. Record the frontend URL, written with `localhost`
94
+ rather than an IP literal, and the commands that start both servers again.
95
95
 
96
96
  ## Step 3 -- Identify the process that answered
97
97
 
@@ -120,15 +120,25 @@ IPv6 only, so an IPv4 literal fails against the correct port.
120
120
  ## Step 4 -- Check the wiring
121
121
 
122
122
  With both running, check the wiring in one command before you open a browser:
123
- `npx --yes copilotkit@4.9.17 verify --json`. Add `--runtime-url` when the runtime is not at
124
- `http://localhost:3000/api/copilotkit`. Read the individual checks rather than the summary
125
- alone: a check reported `undetermined` did not run, and that is not a pass. Repair a failed
126
- check only within the limits above. Otherwise, return the check and its evidence before the
127
- browser.
123
+ `npx --yes copilotkit@4.9.31 verify --json`. It reads the port from this project, so a
124
+ non-default port needs no flag. The payload reports `runtimeUrl` and `runtimeUrlSource`. A
125
+ `runtimeUrlSource` of `default` means nothing in the project named a port, so pass
126
+ `--runtime-url` with the URL from step 1 in that case. Read the individual checks rather than
127
+ the summary alone: a check reported `undetermined` did not run, and that is not a pass.
128
+ Repair a failed check only within the limits above. Otherwise, return the check and its
129
+ evidence before the browser.
128
130
 
129
131
  Treat `intelligence_consumed` as the check that matters most here. It proves that the runtime
130
132
  used the Intelligence credential. `api_key_authenticates` proves only that the key is valid.
131
133
 
134
+ `api_key_loadable_by_app` fails when the key is in a file the application's own process
135
+ will not read. `verify` searches upward for the credential and a framework's env loader
136
+ does not, so a key at the repository root is invisible to an app in a subdirectory. The
137
+ check names the file to write instead. Write the key there, or run
138
+ `npx --yes copilotkit@4.9.31 project select` from the app directory. Do not link,
139
+ copy, or symlink the file to work around it, and do not treat the credential as missing:
140
+ the check above already reported that it exists.
141
+
132
142
  `intelligence_thread_routes` fails when a licensed runtime serves no thread routes. A handler
133
143
  mounted `mode: "single-route"` is the usual cause. Return it for implementation to remove the
134
144
  option and use a catch-all route. Do not edit it. If the check is `undetermined` because no
@@ -136,7 +146,7 @@ thread-endpoint state exists, the runtime predates the field. Record that and co
136
146
 
137
147
  ## Step 5 -- Prove that the agent runs
138
148
 
139
- Run `npx --yes copilotkit@4.9.17 verify --round-trip --json`. It sends one request through
149
+ Run `npx --yes copilotkit@4.9.31 verify --round-trip --json`. It sends one request through
140
150
  the runtime and reads the answer back from the thread, so it separates an agent that is
141
151
  configured from an agent that works. Use `--agent <id>` when the runtime declares more
142
152
  than one. If it reports `user-not-identified`, this project's `identifyUser` reads a
@@ -212,8 +222,9 @@ journey, and the graph ends such a run as blocked rather than complete.
212
222
  For a recorded `both-oss` starting state, this step has no component to render. Send the
213
223
  same request the baseline recorded, require the same kind of user-visible result the
214
224
  baseline produced, and require that the thread for that request is listed in the drawer.
215
- Where this journey's frontend framework ships no threads drawer -- React Native --, find
216
- that thread in the managed Intelligence dashboard and record which of the two you proved.
225
+ Where this journey's frontend framework ships no threads drawer -- React Native --, prove
226
+ that thread with `npx --yes copilotkit@4.9.31 verify --round-trip`, which reads the
227
+ answer back off the thread and needs no browser. Record which of the two you proved.
217
228
 
218
229
  Use the surface control the main coding agent recorded for your environment. It either had
219
230
  one already or registered one before this step, so that finding is the answer and there is
@@ -237,6 +248,10 @@ The surface is a browser, and it also covers browser-origin CORS and CSP, which
237
248
  request never exercises. Drive it with the browser control step 6 named.
238
249
 
239
250
  1. Open the frontend URL from step 2 and wait for the page to finish loading.
251
+ Address it as `localhost` rather than an IP literal, for the reason step 3 gives
252
+ for the agent. A dev server reached on the IP literal can refuse its own static
253
+ assets, and a page that loads without them leaves the chat control dead. That
254
+ reads as a broken integration rather than as the host name you used.
240
255
  2. Take one page snapshot. Record whether the CopilotKit surface is on the page. A page
241
256
  that renders without it is a wiring failure rather than a proof to retry.
242
257
  3. Read the browser console before you type anything, and record every error already
@@ -317,6 +332,12 @@ result. The runtime must now report `licenseStatus`, and the authenticated Intel
317
332
  checks must pass. A thread for that request must be persisted and visible. Record both
318
333
  before and after evidence, and record that the criterion was `conversion-v1`.
319
334
 
335
+ `licenseStatus` reports `unknown` while the runtime entitlement lookup for this project
336
+ has not resolved yet. That value is transient rather than a failure, and the drawer
337
+ renders its locked view for as long as it stands. Re-read `/info` and re-open the drawer
338
+ before you judge either one. Criterion 4 requires `licenseStatus` to be present, and a
339
+ present `unknown` meets it.
340
+
320
341
  For every other starting state, record Step 8 as not applicable.
321
342
 
322
343
  The application edit ban ends only after Step 8 passes or is recorded as not applicable.
@@ -6,6 +6,10 @@ Explain the exact step that failed. State whether authentication, project select
6
6
  credentials, the journey, a documentation URL, implementation, validation, or the round
7
7
  trip caused the route change. Do not say a path works when this release does not support it.
8
8
 
9
+ If a protected path stopped this run, name that path and how it changed, in the words the
10
+ audit printed. A report that says only that protected files changed cannot be acted on:
11
+ nobody reading it can tell which file moved, or whether this run or the developer moved it.
12
+
9
13
  Stop onboarding without making more repository changes by default.
10
14
 
11
15
  The documentation-gap exception applies only before implementation starts. If implementation,
@@ -26,13 +30,13 @@ Before you show the best-effort plan, require this complete packet:
26
30
  - Give the ordered proof rules.
27
31
 
28
32
  After the developer approves the best-effort plan, run
29
- `npx --yes copilotkit@4.9.17 onboard read fallback/best-effort`.
33
+ `npx --yes copilotkit@4.9.31 onboard read fallback/best-effort`.
30
34
 
31
35
  Send one short report. Run the feedback command without another developer question. The
32
36
  CLI telemetry gate decides whether the report is sent.
33
37
 
34
38
  ```text
35
- npx --yes copilotkit@4.9.17 onboard feedback
39
+ npx --yes copilotkit@4.9.31 onboard feedback
36
40
  ```
37
41
 
38
42
  Write the feedback message to the command's standard input, in at most four lines.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "copilotkit",
3
- "version": "4.9.17",
3
+ "version": "4.9.31",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14698,7 +14698,7 @@ import * as path4 from "node:path";
14698
14698
 
14699
14699
  // apps/cli/src/config.ts
14700
14700
  function getTemplateRef() {
14701
- return true ? "f08f478cf73c46d34e8db03dedcc61f695f9b9b5" : "main";
14701
+ return true ? "c2038cf52ced16dc814e2ff0bd60894f2a53f5c1" : "main";
14702
14702
  }
14703
14703
 
14704
14704
  // apps/cli/src/services/agentcore-config.ts
@@ -14881,6 +14881,20 @@ var TELEMETRY_ERROR_CODES = {
14881
14881
  * tell "the caller guessed a slug" from a malformed request.
14882
14882
  */
14883
14883
  PROJECT_NOT_FOUND: "PROJECT_NOT_FOUND",
14884
+ /**
14885
+ * `project select` persisted the record and the key-provisioning call did
14886
+ * not succeed. Buckets as `network` because that is what it almost always
14887
+ * is, and because the funnel needs half-applied selections visible next to
14888
+ * the upstream failures that cause them (OSS-1089).
14889
+ */
14890
+ KEY_PROVISION_FAILED: "KEY_PROVISION_FAILED",
14891
+ /**
14892
+ * `project select` persisted the record and declined to write the key
14893
+ * because git tracks the env file. Distinct from
14894
+ * {@link TELEMETRY_ERROR_CODES.KEY_PROVISION_FAILED}: nothing upstream
14895
+ * failed, and a retry alone will not clear it.
14896
+ */
14897
+ KEY_PROVISION_REFUSED: "KEY_PROVISION_REFUSED",
14884
14898
  CLI_PRODUCT_BINARY_TOO_LARGE: "CLI_PRODUCT_BINARY_TOO_LARGE",
14885
14899
  LEARNING_CONTAINER_ID_INVALID: "LEARNING_CONTAINER_ID_INVALID",
14886
14900
  LEARNING_PROJECT_ID_INVALID: "LEARNING_PROJECT_ID_INVALID",