copilotkit 4.9.4 → 4.9.17

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 +13 -12
  2. package/cli-build-info.json +8 -8
  3. package/index.js +1752 -672
  4. package/onboarding/index.json +15 -1
  5. package/onboarding/prompts/authenticate/start.md +129 -65
  6. package/onboarding/prompts/conversion/plan.md +103 -0
  7. package/onboarding/prompts/credentials/finalize-plan.md +97 -122
  8. package/onboarding/prompts/credentials/plan.md +26 -21
  9. package/onboarding/prompts/fallback/best-effort.md +99 -19
  10. package/onboarding/prompts/framework/ag2.md +7 -7
  11. package/onboarding/prompts/framework/agno.md +11 -8
  12. package/onboarding/prompts/framework/built-in.md +2 -2
  13. package/onboarding/prompts/framework/claude-sdk-python.md +7 -7
  14. package/onboarding/prompts/framework/claude-sdk-typescript.md +9 -9
  15. package/onboarding/prompts/framework/crewai-flows.md +27 -11
  16. package/onboarding/prompts/framework/deep-agents.md +8 -7
  17. package/onboarding/prompts/framework/google-adk.md +3 -3
  18. package/onboarding/prompts/framework/langgraph-fastapi.md +3 -3
  19. package/onboarding/prompts/framework/langgraph-python.md +3 -3
  20. package/onboarding/prompts/framework/langgraph-typescript.md +3 -3
  21. package/onboarding/prompts/framework/llamaindex.md +6 -6
  22. package/onboarding/prompts/framework/mastra.md +3 -3
  23. package/onboarding/prompts/framework/ms-agent-dotnet.md +3 -3
  24. package/onboarding/prompts/framework/ms-agent-harness-dotnet.md +7 -9
  25. package/onboarding/prompts/framework/ms-agent-python.md +3 -3
  26. package/onboarding/prompts/framework/pydantic-ai.md +26 -15
  27. package/onboarding/prompts/framework/strands-python.md +7 -6
  28. package/onboarding/prompts/framework/strands-typescript.md +9 -7
  29. package/onboarding/prompts/frontend/angular.md +16 -3
  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 +7 -2
  33. package/onboarding/prompts/frontend/react-spa.md +2 -2
  34. package/onboarding/prompts/frontend/vue.md +7 -2
  35. package/onboarding/prompts/implementation/build-and-validate.md +45 -79
  36. package/onboarding/prompts/proof/complete.md +8 -6
  37. package/onboarding/prompts/proof/oss-baseline.md +15 -50
  38. package/onboarding/prompts/proof/round-trip.md +83 -263
  39. package/onboarding/prompts/starter/clone.md +4 -4
  40. package/onboarding/prompts/subagent/create-plan.md +45 -0
  41. package/onboarding/prompts/subagent/implement-and-validate.md +70 -44
  42. package/onboarding/prompts/subagent/inspect-repository.md +25 -3
  43. package/onboarding/prompts/subagent/prove-oss-baseline.md +2 -1
  44. package/onboarding/prompts/subagent/prove-round-trip.md +143 -34
  45. package/onboarding/prompts/unsupported/no-validated-path.md +10 -2
  46. package/package.json +1 -1
  47. package/release/release-tool.js +1 -1
@@ -1,6 +1,10 @@
1
1
  # Inspect the repository
2
2
 
3
- Inspect the repository without changing it. Find evidence for:
3
+ Work only on the packet you were assigned. Inspect the repository without changing it.
4
+
5
+ ## Project evidence packet
6
+
7
+ Find evidence for:
4
8
 
5
9
  - what the project is for, in the project's own words
6
10
  - the target app or runtime directory that owns `.env` and the CopilotKit setup
@@ -9,8 +13,18 @@ Inspect the repository without changing it. Find evidence for:
9
13
  - current CopilotKit integration and configuration, including whether
10
14
  `.copilotkit/project.json` has `projectId`, `projectSlug`, and `clerkOrgId`
11
15
  - authentication boundaries
16
+ - initial changed and untracked paths, without file contents
17
+
18
+ Return the initial changed and untracked paths as paths only. Do not return their
19
+ contents. Do not retain a before-state for them. The CLI captures the baseline that the
20
+ protected-path audit compares against, so nothing later in the run depends on this
21
+ subagent still existing, and a path that can hold secrets is captured as a digest you
22
+ never read.
23
+
24
+ ## Environment evidence packet
25
+
12
26
  - names of required credential variables and whether `.env` has a non-empty
13
- `INTELLIGENCE_API_KEY`
27
+ `CPK_INTELLIGENCE_API_KEY`
14
28
  - retain the `.env` modification time for a later comparison without returning it
15
29
  - package manager and lockfile
16
30
  - required toolchains and their installed versions
@@ -19,6 +33,9 @@ Inspect the repository without changing it. Find evidence for:
19
33
  neither can be proved from project files
20
34
  - CopilotKit package versions and package compatibility risks
21
35
 
36
+ Key every environment finding by its app or runtime directory. Do not combine findings
37
+ from different directories.
38
+
22
39
  For the CopilotKit versions, report the exact installed version of every `@copilotkit/*`
23
40
  dependency, read from the lockfile rather than a manifest range, and state whether any of
24
41
  them is below 1.64.0. The conversion decides its upgrade from exactly that, and a caret
@@ -34,7 +51,12 @@ command rather than running them one at a time. Split a command only when its re
34
51
  what you run next. Keep this preflight read-only. Do not install packages, stop processes,
35
52
  or change a port. Check only the toolchains and ports that repository files require.
36
53
 
37
- Return the file paths and a short finding for each item. State each absent or unproved item.
54
+ Start with `Status: passed`, `Status: failed`, or `Status: blocked`.
55
+ Use `Status: passed` when the assigned inspection completed, even when a row is `absent` or
56
+ `unproved`. Use `Status: failed` for an inspection error. Use `Status: blocked` when project
57
+ access or an environment limit prevents the inspection.
58
+ Return one row for each assigned item with its status, evidence path, and a short finding.
59
+ Use only `proved`, `absent`, or `unproved` for the status. State each absent or unproved item.
38
60
  Do not read, print, or return secret values. For `.env` and `.copilotkit/project.json`
39
61
  checks, return only paths, presence checks, and missing field names. Do not read a file
40
62
  outside the project directory. Do not run or return another onboarding command. Stop after
@@ -16,7 +16,7 @@ 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.4 verify --expect-runtime oss --round-trip --agent <expected-agent-id> --json`,
19
+ `npx --yes copilotkit@4.9.17 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
@@ -32,4 +32,5 @@ The default in-memory OSS runner is ephemeral. SQLite, custom, or framework pers
32
32
  can be durable. Report the persistence that project evidence proves, or `unproved`. Do not
33
33
  replace it and do not describe all OSS runs as ephemeral.
34
34
 
35
+ Start with `Status: passed`, `Status: failed`, or `Status: blocked`.
35
36
  Stop after returning the baseline result, process ids and ports used, and evidence paths.
@@ -3,11 +3,24 @@
3
3
  Use the proof steps and documentation URLs from the approved plan. Follow the documentation
4
4
  policy the main coding agent gives you before you start.
5
5
 
6
+ During Steps 1 through 8, do not edit source files, configuration files, dependencies, or
7
+ tracked files.
8
+ You can make only operational repairs to project-owned processes, ports, and request options.
9
+ Do not write a path that overlaps a protected path. If a required proof or tool path
10
+ overlaps one, return `Status: blocked` before writing it.
11
+
6
12
  Run the steps below in the order they appear. They are the proof. Do not design a
7
13
  different sequence of your own, and do not drop a step because an earlier one looked
8
14
  convincing. Step 6 has a web form and a React Native form: run the one that matches this
9
15
  journey's frontend, and run only that one.
10
16
 
17
+ Where this is a second attempt after a repair, run every step from Step 2 through Step 7
18
+ again. The repair changed tracked files and restarted processes, so the wiring, the agent
19
+ identity, and both preconditions are stale. Step 1 is the exception, and it is carried
20
+ rather than derived a second time. Compare the Step 5a and Step 5b results against the
21
+ failed attempt's before you drive the surface. A repair that leaves the failed precondition
22
+ unchanged has not reached the cause, and that is readable before the most expensive step.
23
+
11
24
  Record the result of every step as you go. A step with nothing recorded did not happen.
12
25
  Write each captured file to `.copilotkit/proof/` inside the project and name the path in
13
26
  the record. That directory holds regenerable evidence rather than application code. Where
@@ -34,6 +47,11 @@ Where the plan named no request, write one that produces the outcome the plan na
34
47
  record the request you wrote. Every later step uses these words unchanged, so that the
35
48
  browser, the device, and the grounding check all speak about one request.
36
49
 
50
+ Where the handoff carries a pinned Step 1 record from a failed attempt, that record is this
51
+ step. Use its request words, expected agent id, entity list, and runtime URL unchanged, and
52
+ do not write a new request. A second attempt that asks a different question proves nothing
53
+ about the failure it was spawned to clear.
54
+
37
55
  ## Step 2 -- Start the agent and the frontend
38
56
 
39
57
  Read the port the developer's agent already serves from this project's own configuration.
@@ -102,27 +120,23 @@ IPv6 only, so an IPv4 literal fails against the correct port.
102
120
  ## Step 4 -- Check the wiring
103
121
 
104
122
  With both running, check the wiring in one command before you open a browser:
105
- `npx --yes copilotkit@4.9.4 verify --json`. Add `--runtime-url` when the runtime is not at
123
+ `npx --yes copilotkit@4.9.17 verify --json`. Add `--runtime-url` when the runtime is not at
106
124
  `http://localhost:3000/api/copilotkit`. Read the individual checks rather than the summary
107
- alone: a check reported `undetermined` did not run, and that is not a pass. Fix anything
108
- that is not a pass before the browser, because a browser failure stacked on broken wiring
109
- costs a round of debugging to reach an answer this command already gave.
110
-
111
- Treat `intelligence_consumed` as the check that matters most here. A journey that finishes
112
- with the Intelligence credential never read looks complete and proves nothing about the
113
- paid surface. `api_key_authenticates` passing beside it says the key is real and the
114
- runtime never used it.
115
-
116
- `intelligence_thread_routes` fails when the runtime reports a license but serves no
117
- thread routes, which means saved Threads cannot load in a browser. The usual cause is a
118
- handler mounted `mode: "single-route"`: remove that option so the handler serves its full
119
- route set, and mount it at a catch-all route. If instead that check is `undetermined`
120
- because the runtime reports no thread-endpoint state, the runtime predates the field.
121
- Record that and move on -- there is nothing to repair.
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.
128
+
129
+ Treat `intelligence_consumed` as the check that matters most here. It proves that the runtime
130
+ used the Intelligence credential. `api_key_authenticates` proves only that the key is valid.
131
+
132
+ `intelligence_thread_routes` fails when a licensed runtime serves no thread routes. A handler
133
+ mounted `mode: "single-route"` is the usual cause. Return it for implementation to remove the
134
+ option and use a catch-all route. Do not edit it. If the check is `undetermined` because no
135
+ thread-endpoint state exists, the runtime predates the field. Record that and continue.
122
136
 
123
137
  ## Step 5 -- Prove that the agent runs
124
138
 
125
- Run `npx --yes copilotkit@4.9.4 verify --round-trip --json`. It sends one request through
139
+ Run `npx --yes copilotkit@4.9.17 verify --round-trip --json`. It sends one request through
126
140
  the runtime and reads the answer back from the thread, so it separates an agent that is
127
141
  configured from an agent that works. Use `--agent <id>` when the runtime declares more
128
142
  than one. If it reports `user-not-identified`, this project's `identifyUser` reads a
@@ -131,15 +145,75 @@ it again, because an auth-gated app refusing an unauthenticated caller is that a
131
145
  working. Do not continue until this passes, and never report a round trip proven without
132
146
  it.
133
147
 
148
+ ### Step 5a -- Prove that the page's data reaches the model
149
+
150
+ `verify --round-trip` sends `context: []` and asks a question that needs no context. It
151
+ passes against an agent the page's data never reaches, and that is the right job for an
152
+ install check. Nothing else before the browser reads that path, so a page whose data the
153
+ agent never sees answers fluently over a record it invented, and the first thing to notice
154
+ is a card in a screenshot.
155
+
156
+ Where this journey shares page data with the agent, prove that path here. Read the context
157
+ entries this project's frontend publishes, from its own context call. Read the tool
158
+ declarations it registers as well, and carry both the way the page carries them, so that
159
+ the agent sees the request the browser sends rather than a thinner one. Send the same run
160
+ body twice, to `<runtime>/agent/<agent id>/run`: once carrying the context entries the page
161
+ publishes, and once carrying `context: []`. Use the step 1 request both times. Record the
162
+ streamed events from each, and name both capture paths.
163
+
164
+ Read the two answers against each other. The run carrying the page's context has to name
165
+ the project's own records. The run carrying an empty context has to say the page sent
166
+ nothing. Two answers that describe the same record mean the context changed nothing, and
167
+ the page's data is not reaching the model.
168
+
169
+ Return the cause and both captures on a failed comparison. Do not open a browser on a
170
+ failed comparison, and do not edit the project here.
171
+
172
+ Where this journey shares no page data with the agent, record that and continue.
173
+
174
+ ### Step 5b -- Prove that the plan's component is wired to a tool call
175
+
176
+ The plan ends at a component this frontend registers itself, through `useComponent` or
177
+ Angular's `registerComponent`. Both declare a tool from the frontend and forward it to the
178
+ agent in the run body, so the component paints only where three things line up: the
179
+ frontend registers the name, the run carries the declaration, and the agent calls it.
180
+
181
+ Nothing reports a gap between them. A tool call the frontend registers no component for
182
+ paints an empty message, and a generative-UI payload naming a surface or a catalog the
183
+ frontend does not know falls to a surface nothing draws. Neither writes anything to the
184
+ browser console, so the browser step reports a finished turn, a blank card, and no error
185
+ to read.
186
+
187
+ Read the registrations this project's frontend declares, by name. Send the step 1 request
188
+ to the route step 5a used, carrying those declarations, and read the tool calls out of
189
+ that run's own events. The agent has to call one of the names the frontend registered. An
190
+ agent that calls nothing, or calls a name no registration matches, is a wiring gap for
191
+ implementation to close rather than a proof repair. Return the name and the frontend file
192
+ you read, before the browser.
193
+
194
+ Where this journey renders a tool the agent owns rather than one the frontend declares,
195
+ pair the called names against the frontend's renderers the same way. For A2UI, also
196
+ compare the catalog id this project's provider registers with the catalog id the agent's
197
+ payload names. Record every pair you matched.
198
+
134
199
  ## Step 6 -- Drive the surface
135
200
 
136
201
  Now send one real request through the running frontend, on this journey's own surface.
137
202
  Make sure that the request passes through CopilotKit and reaches the selected agent, and
138
- that the frontend receives working generative UI from the agent. This is the step that
139
- covers realtime delivery, the frontend provider being wired to this runtime, and a
140
- generative UI component actually rendering, and no command-line check reaches any of them.
141
- It is not optional polish: a run that skips it has proven the agent and not the journey,
142
- and the graph ends such a run as blocked rather than complete.
203
+ that the frontend renders the plan's component through this frontend's own registration --
204
+ the `useComponent` hook, or Angular's `registerComponent` -- over entities the project
205
+ holds. Streamed text alone is not this step's outcome, whatever it says.
206
+
207
+ This is the step that covers realtime delivery, the frontend provider being wired to this
208
+ runtime, and the component actually rendering, and no command-line check reaches any of
209
+ them. It is not optional polish: a run that skips it has proven the agent and not the
210
+ journey, and the graph ends such a run as blocked rather than complete.
211
+
212
+ For a recorded `both-oss` starting state, this step has no component to render. Send the
213
+ same request the baseline recorded, require the same kind of user-visible result the
214
+ 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.
143
217
 
144
218
  Use the surface control the main coding agent recorded for your environment. It either had
145
219
  one already or registered one before this step, so that finding is the answer and there is
@@ -151,6 +225,12 @@ this step rather than installing one, and report the skip outcome named below.
151
225
 
152
226
  Never report a result you did not see, on either surface.
153
227
 
228
+ A rendered result is not proof yet. Record this step's outcome after step 7 has compared
229
+ that result with the project's own data, not before: a card nothing compared is a card
230
+ whose fields nobody has read. Where that comparison fails and sends you back to a cause,
231
+ the attempt that failed it is `failed` and stays in the record with its own capture,
232
+ under a name that says what it was.
233
+
154
234
  ### Step 6a -- Web frontends: React SPA, Next.js, Angular, Vue 3
155
235
 
156
236
  The surface is a browser, and it also covers browser-origin CORS and CSP, which a CLI
@@ -165,7 +245,8 @@ request never exercises. Drive it with the browser control step 6 named.
165
245
  submit it.
166
246
  5. Wait for the assistant turn to finish rather than for a fixed number of seconds. The
167
247
  turn is finished when the streamed text stops growing and the generative UI component
168
- has rendered.
248
+ has rendered. For a recorded `both-oss` starting state, this step has no component, and
249
+ the turn is finished when the streamed text stops growing.
169
250
  6. Take one screenshot of the finished turn and record where you wrote it.
170
251
  7. Read the browser console a second time, and record every error that step 3 did not
171
252
  already list. Those belong to the request.
@@ -215,32 +296,60 @@ instead, and do not invent a comparison to pass this step.
215
296
  An answer that renders correctly over entities the project does not hold looks the same as
216
297
  a correct one in a browser, in a screenshot, and in a video, so this comparison is the only
217
298
  stage that separates them. An answer that names an entity the project does not hold is a
218
- failed proof, not a passing one. Find which of these it is before you change anything: the
219
- project's data never reaches the agent, the agent receives it and its instructions ignore
220
- it, the page loads its data after the context was registered, or the run wired a different
221
- source than the page renders. Fix that cause, then prove again.
299
+ failed proof, not a passing one.
300
+
301
+ An empty context set is the first case to rule out. Where the context the agent received
302
+ held no records, the answer had to say so, and a rendered record over an empty context set
303
+ is a fabrication rather than a near miss: the card is well formed, the prose reply agrees
304
+ with it, and nothing in the answer marks the gap.
305
+
306
+ Find which of these it is before you change anything: the project's data never reaches the
307
+ agent, the agent receives it and its instructions ignore it, the page loads its data after
308
+ the context was registered, or the run wired a different source than the page renders.
309
+ Return the cause and its evidence. Do not edit it during proof.
222
310
 
223
311
  ## Step 8 -- Compare with the recorded OSS baseline
224
312
 
225
313
  Run this step only for a recorded `both-oss` starting state. Compare the final round trip
226
- with the recorded OSS baseline. The same frontend request must still reach the same agent
227
- and produce the same kind of user-visible result. The runtime must now report
228
- `licenseStatus`, and the authenticated Intelligence checks must pass. Record both before
229
- and after evidence.
314
+ with the recorded OSS baseline against the criterion the conversion prompt froze. The same
315
+ frontend request must still reach the same agent and produce the same kind of user-visible
316
+ result. The runtime must now report `licenseStatus`, and the authenticated Intelligence
317
+ checks must pass. A thread for that request must be persisted and visible. Record both
318
+ before and after evidence, and record that the criterion was `conversion-v1`.
319
+
320
+ For every other starting state, record Step 8 as not applicable.
321
+
322
+ The application edit ban ends only after Step 8 passes or is recorded as not applicable.
323
+ Step 9 can write only the tool files named by its guide.
230
324
 
231
325
  ## Step 9 -- Set up the continued-development tools
232
326
 
233
327
  Fetch the continued-development guide from the main coding agent with the proof
234
328
  documentation. Try the continued-development tools after the application passes proof.
329
+
330
+ Tell the developer what the skills install writes into this project before you run it: a
331
+ `.agents/skills` directory holding one folder per CopilotKit skill, linked into
332
+ `.claude/skills`. Both sit in the working tree, so the install shows up in `git status`
333
+ and can land in a commit. You cannot know whether this project keeps those directories in
334
+ version control, so name them before you write them rather than after.
335
+
235
336
  Use it to install the project-scoped CopilotKit Skills.
236
337
  Use it to configure the CopilotKit documentation MCP server for the current coding agent.
338
+ That registration goes in the coding agent's own configuration for this project, not in
339
+ the working tree.
237
340
 
238
- Do not validate whether the Skills or MCP server installed correctly. Record the command
239
- result for each attempt. Report each tool result separately. A tool error does not change
240
- the proof result.
341
+ Check whether each install succeeded and record what you found. Record the command result
342
+ for each attempt. Report the Skills result and the MCP result separately from the proof
343
+ result. A tool error does not change the proof result: this journey proved or it did not,
344
+ whatever these two tools did.
241
345
 
242
346
  ## Step 10 -- Return the result
243
347
 
348
+ Start with `Status: passed`, `Status: failed`, or `Status: blocked`.
349
+ Use `Status: passed` when the proof attempt completed with `performed`,
350
+ `skipped-no-browser-tool`, or `skipped-no-device`. The parent records a skip through the
351
+ standard blocked completion route. Use `Status: failed` for a failed proof step. Use
352
+ `Status: blocked` when a safety or access limit stops the attempt before a surface outcome.
244
353
  Return the proof or the exact failed step to the main coding agent, together with the
245
354
  input, the visible result, the relevant process status, the evidence locations, the
246
355
  surface-check outcome, and which surface that outcome speaks for. Do not return secret
@@ -17,14 +17,22 @@ are available. Search the broader official CopilotKit documentation before you i
17
17
  Mark each step that the selected pages do not prove. Do not treat the documentation gap as
18
18
  proof that the requested integration is unsupported.
19
19
 
20
+ Before you show the best-effort plan, require this complete packet:
21
+
22
+ - Name the exact target project directory and protected path list.
23
+ - Define the ordered implementation steps with outcomes and dependencies.
24
+ - Name the exact paths each step changes.
25
+ - Give the full validation command list.
26
+ - Give the ordered proof rules.
27
+
20
28
  After the developer approves the best-effort plan, run
21
- `npx --yes copilotkit@4.9.4 onboard read fallback/best-effort`.
29
+ `npx --yes copilotkit@4.9.17 onboard read fallback/best-effort`.
22
30
 
23
31
  Send one short report. Run the feedback command without another developer question. The
24
32
  CLI telemetry gate decides whether the report is sent.
25
33
 
26
34
  ```text
27
- npx --yes copilotkit@4.9.4 onboard feedback
35
+ npx --yes copilotkit@4.9.17 onboard feedback
28
36
  ```
29
37
 
30
38
  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.4",
3
+ "version": "4.9.17",
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 ? "f6f2dc4bb62b50d2f09384619f5b9e8fe7edde02" : "main";
14701
+ return true ? "f08f478cf73c46d34e8db03dedcc61f695f9b9b5" : "main";
14702
14702
  }
14703
14703
 
14704
14704
  // apps/cli/src/services/agentcore-config.ts