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,9 +1,10 @@
1
1
  {
2
- "graphTree": "1c6963da1f044e99a35706e1f6ba533c2ad835c2",
2
+ "graphTree": "613209959e8d5888a5770391381eeb0055fbe68d",
3
3
  "root": "authenticate/start",
4
4
  "prompts": [
5
5
  {
6
6
  "edges": [
7
+ "subagent/inspect-repository",
7
8
  "proof/oss-baseline",
8
9
  "credentials/plan",
9
10
  "unsupported/no-validated-path"
@@ -13,6 +14,15 @@
13
14
  },
14
15
  {
15
16
  "edges": [
17
+ "credentials/finalize-plan",
18
+ "unsupported/no-validated-path"
19
+ ],
20
+ "milestone": "conversion",
21
+ "name": "conversion/plan"
22
+ },
23
+ {
24
+ "edges": [
25
+ "subagent/create-plan",
16
26
  "implementation/build-and-validate",
17
27
  "unsupported/no-validated-path"
18
28
  ],
@@ -258,6 +268,7 @@
258
268
  },
259
269
  {
260
270
  "edges": [
271
+ "subagent/implement-and-validate",
261
272
  "proof/round-trip",
262
273
  "unsupported/no-validated-path"
263
274
  ],
@@ -271,6 +282,8 @@
271
282
  },
272
283
  {
273
284
  "edges": [
285
+ "subagent/prove-oss-baseline",
286
+ "conversion/plan",
274
287
  "credentials/plan",
275
288
  "unsupported/no-validated-path"
276
289
  ],
@@ -279,6 +292,7 @@
279
292
  },
280
293
  {
281
294
  "edges": [
295
+ "subagent/prove-round-trip",
282
296
  "proof/complete",
283
297
  "unsupported/no-validated-path"
284
298
  ],
@@ -8,6 +8,19 @@ Do not show prompt names, internal route IDs, subagent names, or storage field n
8
8
  Work from the target project directory. For an existing project, start at its inspection
9
9
  root.
10
10
 
11
+ The command that began this run printed a line reading `onboarding_run_id:` followed by an
12
+ id. Keep that id for the whole run. Every later command reports against it, and it is
13
+ printed once.
14
+
15
+ Every later command must run from the directory this run started in. A command run
16
+ somewhere else, such as a sibling of that directory, is refused rather than answered,
17
+ because the run it belongs to cannot be found from there. That refusal is a step to take,
18
+ not a stop to report: run
19
+ `npx --yes copilotkit@4.9.17 onboard start --run <onboarding_run_id>` in the directory
20
+ you are now in, which binds it to the same run, then run the refused command again. Do not
21
+ start a run without that id. A run started without it is a second run, and the work already
22
+ done stops counting toward the first.
23
+
11
24
  Read only inside the target project directory. Every subagent you spawn inherits that
12
25
  limit, including one this graph does not name. Answer a CopilotKit API or configuration
13
26
  question from the documentation this graph gives you. Another checkout on this machine is
@@ -28,7 +41,33 @@ first send, and a developer who reads it repeatedly learns to skim the region it
28
41
  Do not ask for separate feedback consent. The feedback commands enforce the developer's
29
42
  CLI telemetry setting when a later step tries to send a report.
30
43
 
31
- Run `npx --yes copilotkit@4.9.4 login --json` before any project work. This command
44
+ ## Report a stop, wherever it happens
45
+
46
+ This run reports its own stops. If you stop this run at any point, send one short report
47
+ before you stop. That covers a stop this prompt names, a stop a later prompt names, and a
48
+ stop no prompt anticipated, including one your own harness causes. Run the feedback command
49
+ without another developer question. The CLI telemetry gate decides whether the report is
50
+ sent.
51
+
52
+ ```text
53
+ npx --yes copilotkit@4.9.17 onboard feedback
54
+ ```
55
+
56
+ Write at most four lines to the command's standard input: the step you stopped at and what
57
+ stopped it. Send no secrets, source code, logs, or command output. The command refuses a
58
+ report that carries any of those, prints the reason, and exits zero. A refused report is
59
+ not a failed step. Reword it and send it again, or stop without a report.
60
+
61
+ Reporting a stop is not a route change. It does not resume the run, it is not a question
62
+ for the developer, and it does not replace whatever the rule that stopped you says to do
63
+ next: send the report, then stop. Report friction only from a run that finished, never from
64
+ a stop.
65
+
66
+ Until now the route out of an unsupported path was the only place that asked for a report,
67
+ so a stop anywhere else left no trace at all. A stop nobody hears about is a stop this
68
+ graph cannot fix.
69
+
70
+ Run `npx --yes copilotkit@4.9.17 login --json` before any project work. This command
32
71
  checks the current session. It starts sign-in only as needed. Treat this as a long-lived
33
72
  streaming process. Do not wait for the command to exit before you read its standard output.
34
73
 
@@ -48,6 +87,20 @@ zero. Do not put account tokens or credentials in the conversation.
48
87
  Before you ask the developer any setup question, finish every read-only investigation and
49
88
  preflight check in this section.
50
89
 
90
+ Prepare two research assignments. Give each research subagent one assignment. Tell it to run
91
+ `npx --yes copilotkit@4.9.17 onboard read subagent/inspect-repository` first and follow the
92
+ prompt it returns. If that read fails because the subagent cannot use the shell, stop that
93
+ subagent. Run the same command yourself, then spawn a fresh subagent with the returned prompt
94
+ and the same handoff. Require only its assigned packet.
95
+
96
+ Start both research subagents in parallel:
97
+
98
+ 1. Spawn one research subagent. Assign it the project evidence packet.
99
+ 2. Spawn a second research subagent. Assign it the environment evidence packet.
100
+ 3. Start both research subagents. Then continue.
101
+
102
+ Continue to the surface-control preflight.
103
+
51
104
  Prove whether your coding-agent environment has browser or device control. Do not assume it
52
105
  either way, and do not report what you expect to be true: a run that guesses here records a
53
106
  capability the rest of the graph then trusts. Use a browser or device tool already
@@ -95,77 +148,88 @@ trying, and do not ask the developer about this tool limit.
95
148
  Registering a server does not boot a device. Where the device probe found none, that is the
96
149
  whole finding, and a browser is not a substitute for a device.
97
150
 
98
- Spawn one research subagent. Give it the full text of the research brief at the end of this
99
- prompt and tell it to follow that brief and return only its findings. Wait for the
100
- subagent to finish.
151
+ Wait for both research subagents to finish.
152
+
153
+ Continue only if both research results start with `Status: passed`. For `Status: failed`,
154
+ retry only that packet with its failed items, up to three attempts. For `Status: blocked`,
155
+ or a third failed result, use the stop route at the end of this prompt.
156
+
157
+ Merge both evidence packets by item. On a conflict, spawn one fresh read-only verifier with
158
+ the item, both cited findings, and the research limits. Require its result to start with
159
+ `Status: passed`, `Status: failed`, or `Status: blocked`. Use only a passed cited result. Do
160
+ not inspect the project to settle the conflict yourself. Use the stop route for a non-pass
161
+ verifier result.
162
+
163
+ Match environment evidence to the target app directory from the project packet. Require one
164
+ target app directory and one matching environment row. If either packet gives no match or
165
+ more than one match, send each research worker a focused directory check. Continue only when
166
+ both workers return the same one target app directory. Both results must start with
167
+ `Status: passed`. Otherwise, use the stop route.
101
168
 
102
- If neither the developer nor the repository findings prove what the project is for, ask
103
- one guided question about the user outcome. This asks what the developer wants to build
104
- before you select a framework. Give two or three short examples and offer a minimal
105
- starter. Record the answer and give it to each later subagent.
169
+ ## Capture the protected-path baseline
106
170
 
107
- If a repository file exists, each finding must cite it. For an empty project, the subagent
108
- must cite its directory check and report absent parts.
171
+ Before you route on, run this from the target app directory:
172
+
173
+ ```text
174
+ npx --yes copilotkit@4.9.17 onboard protect
175
+ ```
176
+
177
+ It reads the working tree itself, records every changed or untracked path with a digest,
178
+ and prints the list. Require its result to start with `Status: passed`.
179
+
180
+ Use the printed list as the protected path list for the rest of the run. Do not assemble
181
+ that list yourself, and do not ask a subagent to hold it: every later audit reads the
182
+ captured baseline back from the CLI, so no step depends on a subagent that has since
183
+ finished.
184
+
185
+ Paths printed as `deferred` are the ones onboarding itself writes, `.env` and
186
+ `.copilotkit/project.json`. Every audit reports them and none fails on them until the step
187
+ that writes them re-captures them, so a run whose only untracked files are the two this
188
+ graph exists to create is never stopped by them.
189
+
190
+ If the result starts with `Status: blocked`, report the printed reason and use the stop
191
+ route at the end of this prompt.
192
+
193
+ ## What the merged findings must contain
194
+
195
+ If a repository file exists, each finding must cite it. For an empty project, the subagents
196
+ must cite the directory check and report absent parts.
109
197
 
110
198
  The findings must cover what the project is for, the agent, frontend, CopilotKit setup,
111
199
  authentication, credential names, and validation path. Do not ask the developer for facts
112
200
  that the repository answers.
113
201
 
114
- Do not infer a working OSS path from packages, imports, project files, or keys. If an
115
- agent, frontend, and CopilotKit integration are present, prove the live starting state
116
- before any project file changes. Run
117
- `npx --yes copilotkit@4.9.4 onboard read proof/oss-baseline`.
202
+ ## Route on the merged findings
203
+
204
+ Read the route off the merged findings. Three of them decide it, and you already hold all
205
+ three:
206
+
207
+ 1. an agent is present,
208
+ 2. a frontend is present,
209
+ 3. a CopilotKit integration is present.
210
+
211
+ Do not infer a working OSS path from packages, imports, project files, or keys, and do not
212
+ settle these three from your own reading of the project. Each one comes from the merged
213
+ packets or it is not proved.
214
+
215
+ If all three are proved, prove the live starting state before any project file changes. Run
216
+ `npx --yes copilotkit@4.9.17 onboard read proof/oss-baseline`.
217
+
218
+ Route there before you ask the developer anything else. The questions after this prompt
219
+ select a framework and a frontend that the findings already name, so a developer who
220
+ answers them has answered for work the next node exists to check. Their existing
221
+ application is what that node protects. Whether it works is what the proof decides, not
222
+ these three findings.
223
+
224
+ For every other combination of the three, take one more step first. If neither the
225
+ developer nor the repository findings prove what the project is for, ask one guided
226
+ question about the user outcome. This asks what the developer wants to build before you
227
+ select a framework. Give two or three short examples and offer a minimal starter. Record
228
+ the answer and give it to each later subagent. Then run
229
+ `npx --yes copilotkit@4.9.17 onboard read credentials/plan`.
118
230
 
119
- For every other inspected state, run
120
- `npx --yes copilotkit@4.9.4 onboard read credentials/plan`.
231
+ Do not ask that question on the route above. A project carrying all three states its
232
+ purpose in the application it already serves.
121
233
 
122
234
  If authentication or inspection stops onboarding, run
123
- `npx --yes copilotkit@4.9.4 onboard read unsupported/no-validated-path`.
124
-
125
- ## Research subagent brief
126
-
127
- Everything below the rule is the subagent's prompt. Give it verbatim.
128
-
129
- ---
130
-
131
- # Inspect the repository
132
-
133
- Inspect the repository without changing it. Find evidence for:
134
-
135
- - what the project is for, in the project's own words
136
- - the target app or runtime directory that owns `.env` and the CopilotKit setup
137
- - whether the target project directory contains any entries
138
- - any existing agent framework and frontend
139
- - current CopilotKit integration and configuration, including whether
140
- `.copilotkit/project.json` has `projectId`, `projectSlug`, and `clerkOrgId`
141
- - authentication boundaries
142
- - names of required credential variables and whether `.env` has a non-empty
143
- `INTELLIGENCE_API_KEY`
144
- - retain the `.env` modification time for a later comparison without returning it
145
- - package manager and lockfile
146
- - required toolchains and their installed versions
147
- - declared ports and whether each port is available
148
- - whether the runtime constructor uses a `runner` option, an `intelligence` option, or
149
- neither can be proved from project files
150
- - CopilotKit package versions and package compatibility risks
151
-
152
- For the CopilotKit versions, report the exact installed version of every `@copilotkit/*`
153
- dependency, read from the lockfile rather than a manifest range, and state whether any of
154
- them is below 1.64.0. The conversion decides its upgrade from exactly that, and a caret
155
- range does not answer it.
156
-
157
- A project states what it is for in its `README.md`, in its package description, or in
158
- the prompt of an agent it already has. Quote that statement rather than rewriting it. An
159
- empty project carries it in the README alone, and that makes the README the whole of the
160
- evidence. State the purpose as unproved when the project never says.
161
-
162
- Gather what you need in as few commands as possible. Combine independent reads into one
163
- command rather than running them one at a time. Split a command only when its result decides
164
- what you run next. Keep this preflight read-only. Do not install packages, stop processes,
165
- or change a port. Check only the toolchains and ports that repository files require.
166
-
167
- Return the file paths and a short finding for each item. State each absent or unproved item.
168
- Do not read, print, or return secret values. For `.env` and `.copilotkit/project.json`
169
- checks, return only paths, presence checks, and missing field names. Do not read a file
170
- outside the project directory. Do not run or return another onboarding command. Stop after
171
- returning the findings to the main coding agent.
235
+ `npx --yes copilotkit@4.9.17 onboard read unsupported/no-validated-path`.
@@ -0,0 +1,103 @@
1
+ # Convert the working application to Intelligence
2
+
3
+ This project already works. The baseline proved the agent answers, the frontend reaches
4
+ it, and CopilotKit carries the round trip. Nothing here rebuilds any of that.
5
+
6
+ What changes is which runtime object this project constructs, and whether its threads
7
+ persist. That is the whole conversion, and it is the journey where the least work is
8
+ genuinely required.
9
+
10
+ ## Read what the baseline already proved
11
+
12
+ Take each of these from the baseline evidence rather than from the developer:
13
+
14
+ - the agent framework and the frontend,
15
+ - the expected agent id,
16
+ - the exact request the baseline drove through the frontend, in its own words,
17
+ - the user-visible result that request produced,
18
+ - the persistence the baseline found, or `unproved`.
19
+
20
+ Do not ask which framework or frontend to use. Both exist and are proved, and a question
21
+ whose answer is already recorded costs the developer a turn and invites an answer that
22
+ contradicts the evidence. Record what you read, and carry the request's exact words
23
+ forward. The proof compares the same request before and after.
24
+
25
+ Preserve the model configuration the baseline found. The conversion changes no model,
26
+ vendor, or model credential. Where the project already has one, the next prompt has
27
+ nothing to place.
28
+
29
+ ## Do not widen the conversion
30
+
31
+ Do not add generative UI. The conversion adds no generative-UI surface. If this application
32
+ answered in prose, the converted one answers in prose. A component the developer did not ask
33
+ for is new work for them to review, new failure surface in the proof, and it is not what
34
+ converting to the platform means. Where the developer asks for one, it is their next piece
35
+ of work rather than part of this conversion.
36
+
37
+ Do not change the agent framework. Do not change the frontend framework. Do not add an
38
+ agent. Do not rebuild a path that already works.
39
+
40
+ The threads drawer is the one thing this conversion adds, and it is the point of the
41
+ conversion rather than a widening of it. Plan it from the drawer page selected below, and
42
+ add it where this frontend does not already render one.
43
+
44
+ ## Select the documentation
45
+
46
+ Select this page for every later step:
47
+
48
+ - https://docs.copilotkit.ai/threads.md
49
+
50
+ Then select the drawer page for the frontend the baseline found:
51
+
52
+ 1. React SPA or Next.js: https://docs.copilotkit.ai/prebuilt-components/copilot-threads-drawer.md
53
+ 2. Angular: https://docs.copilotkit.ai/angular/guides/threads-memory-attachments-headless.md
54
+ 3. Vue 3: https://docs.copilotkit.ai/vue/guides/threads-and-drawer.md
55
+ 4. React Native: select no drawer page, and select the managed Intelligence dashboard as
56
+ the proof surface instead. No page documents a threads drawer for React Native, and
57
+ `@copilotkit/react-native` ships no thread components. The closing prompt gives a
58
+ mobile developer a different debugging surface for the same reason.
59
+
60
+ The next prompt adds the runtime pages and fetches everything in one pass, so do not fetch
61
+ these on their own.
62
+
63
+ ## Documentation policy
64
+
65
+ This documentation policy applies to every page this route selects. Deduplicate the
66
+ selected URL list and fetch each URL once. Fetch all selected URLs in one step. Do not use
67
+ remembered CopilotKit instructions. A fetch tool that refuses a URL, or fails to reach it,
68
+ reports a limit of the tool and not a fact about the page. Retrieve the same URL a second
69
+ way before you judge it. Run `curl -fsSL <url>`, or read the same page without the `.md`
70
+ suffix. Treat a page as unavailable only after a second method also fails. Give this policy
71
+ to every documentation subagent. A page that is still unavailable after the second method
72
+ does not support the selection.
73
+
74
+ ## The criterion this conversion is judged against
75
+
76
+ Freeze this before any project work, and give it to the planning, implementation and proof
77
+ steps unchanged. This conversion succeeded when all five are true:
78
+
79
+ 1. The same request the OSS baseline made still produces the same kind of user-visible
80
+ result, on the same frontend.
81
+ 2. The runtime is constructed with an `intelligence` option rather than a `runner` option.
82
+ 3. `verify --json` exits zero with `ok` true and all seven checks passing, including
83
+ `intelligence_consumed` and `intelligence_thread_routes`.
84
+ 4. `/info` now reports `licenseStatus`, which the runtime emits exactly when an
85
+ Intelligence client was constructed and passed.
86
+ 5. A thread for that request is persisted and visible to the developer.
87
+
88
+ The drawer is what makes the fifth item something the developer can see. Before the
89
+ conversion it renders its locked state, because it reads the license context and this
90
+ project has none. After it, it lists the thread the proven request created. That before and
91
+ after is the conversion's whole user-visible result, and it is why a conversion that only
92
+ passes the command-line checks is worth less to the developer than one that does not.
93
+
94
+ Where this journey's frontend framework ships no threads drawer -- React Native --, the
95
+ fifth item is proved in the managed Intelligence dashboard instead, and the run says which
96
+ of the two it proved.
97
+
98
+ Record this criterion as `conversion-v1` for the run report.
99
+
100
+ Then run `npx --yes copilotkit@4.9.17 onboard read credentials/finalize-plan`.
101
+
102
+ If a selected page does not load after the second method, run
103
+ `npx --yes copilotkit@4.9.17 onboard read unsupported/no-validated-path`.