copilotkit 4.13.1 → 4.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +150 -12
  2. package/cli-build-info.json +8 -8
  3. package/index.js +76560 -73271
  4. package/onboarding/index.json +1 -1
  5. package/onboarding/prompts/authenticate/start.md +48 -28
  6. package/onboarding/prompts/conversion/plan.md +3 -3
  7. package/onboarding/prompts/credentials/finalize-plan.md +13 -12
  8. package/onboarding/prompts/credentials/plan.md +21 -21
  9. package/onboarding/prompts/credentials/settle-credentials.md +19 -12
  10. package/onboarding/prompts/credentials/write-plan.md +20 -13
  11. package/onboarding/prompts/fallback/best-effort.md +10 -10
  12. package/onboarding/prompts/feature/a2ui/implement.md +6 -6
  13. package/onboarding/prompts/feature/a2ui/proof.md +6 -6
  14. package/onboarding/prompts/feature/a2ui/start.md +7 -7
  15. package/onboarding/prompts/feature/channels/implement.md +33 -15
  16. package/onboarding/prompts/feature/channels/proof.md +12 -10
  17. package/onboarding/prompts/feature/channels/start.md +13 -12
  18. package/onboarding/prompts/feature/chat-suggestions/implement.md +6 -6
  19. package/onboarding/prompts/feature/chat-suggestions/proof.md +6 -6
  20. package/onboarding/prompts/feature/chat-suggestions/start.md +7 -7
  21. package/onboarding/prompts/feature/complete.md +19 -1
  22. package/onboarding/prompts/feature/learning/implement.md +17 -17
  23. package/onboarding/prompts/feature/learning/proof.md +7 -7
  24. package/onboarding/prompts/feature/learning/start.md +9 -9
  25. package/onboarding/prompts/feature/open-generative-ui/implement.md +6 -6
  26. package/onboarding/prompts/feature/open-generative-ui/proof.md +6 -6
  27. package/onboarding/prompts/feature/open-generative-ui/start.md +7 -7
  28. package/onboarding/prompts/feature/realtime-sync/implement.md +7 -7
  29. package/onboarding/prompts/feature/realtime-sync/proof.md +6 -6
  30. package/onboarding/prompts/feature/realtime-sync/start.md +6 -6
  31. package/onboarding/prompts/feature/rich-threads/implement.md +10 -10
  32. package/onboarding/prompts/feature/rich-threads/proof.md +6 -6
  33. package/onboarding/prompts/feature/rich-threads/start.md +6 -6
  34. package/onboarding/prompts/feature/stop.md +37 -3
  35. package/onboarding/prompts/feature/voice/implement.md +7 -7
  36. package/onboarding/prompts/feature/voice/proof.md +6 -6
  37. package/onboarding/prompts/feature/voice/start.md +8 -8
  38. package/onboarding/prompts/framework/ag2.md +2 -2
  39. package/onboarding/prompts/framework/agno.md +2 -2
  40. package/onboarding/prompts/framework/built-in.md +2 -2
  41. package/onboarding/prompts/framework/claude-sdk-python.md +2 -2
  42. package/onboarding/prompts/framework/claude-sdk-typescript.md +2 -2
  43. package/onboarding/prompts/framework/crewai-flows.md +2 -2
  44. package/onboarding/prompts/framework/deep-agents.md +2 -2
  45. package/onboarding/prompts/framework/google-adk.md +2 -2
  46. package/onboarding/prompts/framework/langgraph-fastapi.md +2 -2
  47. package/onboarding/prompts/framework/langgraph-python.md +2 -2
  48. package/onboarding/prompts/framework/langgraph-typescript.md +2 -2
  49. package/onboarding/prompts/framework/llamaindex.md +2 -2
  50. package/onboarding/prompts/framework/mastra.md +2 -2
  51. package/onboarding/prompts/framework/ms-agent-dotnet.md +2 -2
  52. package/onboarding/prompts/framework/ms-agent-harness-dotnet.md +2 -2
  53. package/onboarding/prompts/framework/ms-agent-python.md +2 -2
  54. package/onboarding/prompts/framework/pydantic-ai.md +2 -2
  55. package/onboarding/prompts/framework/strands-python.md +2 -2
  56. package/onboarding/prompts/framework/strands-typescript.md +2 -2
  57. package/onboarding/prompts/frontend/angular.md +3 -3
  58. package/onboarding/prompts/frontend/nextjs.md +3 -3
  59. package/onboarding/prompts/frontend/plan.md +7 -7
  60. package/onboarding/prompts/frontend/react-native.md +5 -2
  61. package/onboarding/prompts/frontend/react-spa.md +5 -2
  62. package/onboarding/prompts/frontend/vue.md +5 -2
  63. package/onboarding/prompts/implementation/build-and-validate.md +25 -24
  64. package/onboarding/prompts/proof/complete.md +9 -9
  65. package/onboarding/prompts/proof/oss-baseline.md +5 -5
  66. package/onboarding/prompts/proof/round-trip.md +12 -12
  67. package/onboarding/prompts/research/gather.md +36 -7
  68. package/onboarding/prompts/research/merge.md +3 -3
  69. package/onboarding/prompts/research/preflight.md +4 -4
  70. package/onboarding/prompts/research/route.md +8 -6
  71. package/onboarding/prompts/starter/clone.md +97 -26
  72. package/onboarding/prompts/stopped/run-failed.md +4 -4
  73. package/onboarding/prompts/subagent/create-plan.md +4 -4
  74. package/onboarding/prompts/subagent/implement-and-validate.md +19 -6
  75. package/onboarding/prompts/subagent/inspect-repository.md +2 -2
  76. package/onboarding/prompts/subagent/prove-oss-baseline.md +9 -2
  77. package/onboarding/prompts/subagent/prove-round-trip.md +21 -19
  78. package/onboarding/prompts/unsupported/no-validated-path.md +3 -3
  79. package/package.json +5 -1
  80. package/release/release-tool.js +230 -72
@@ -10,7 +10,7 @@ either path is an ancestor directory on a path-segment boundary. `apps/a` overla
10
10
  `apps/a/src`, but not `apps/ab`. `app.ts` does not overlap `app.tsx`.
11
11
 
12
12
  Change only the files and directories the approved plan names as changeable. If the work
13
- requires a file the plan does not name, stop and return the blocker. Do not run a
13
+ requires a file the plan does not name, return the blocker and end your turn. Do not run a
14
14
  repository-wide formatter.
15
15
 
16
16
  All implementation work happens in the run root's own working tree: the target app
@@ -54,6 +54,17 @@ connection. Do not read, show, store, or return secrets. Do not read a file outs
54
54
  project directory: not for a credential, and not for an API question the fetched
55
55
  documentation answers. Ask the main coding agent for a missing credential.
56
56
 
57
+ Before running a scaffolder, check whether it writes an environment file. Never replace
58
+ an existing `.env` with `.env.example` or scaffolder output. Preserve its existing bytes,
59
+ including the provisioned Intelligence key. Do not use shell redirection or a force flag
60
+ to bypass this rule.
61
+
62
+ If the scaffolder cannot preserve a protected file, generate into a temporary directory
63
+ inside the project only when the approved plan permits it. Copy only approved paths that
64
+ do not overlap a protected path. Otherwise, return the conflict and end your turn before
65
+ running the scaffolder. Ask the main coding agent to revise credential setup when a
66
+ required variable is missing. Do not provision another key to repair a scaffold overwrite.
67
+
57
68
  ## What the existing agent's behavior is
58
69
 
59
70
  The existing agent's behavior is four things: its system prompt and instructions, its
@@ -112,8 +123,8 @@ it fails in the threads drawer rather than at the install.
112
123
 
113
124
  If one of them resolves to more than one version, restore the manifest and lockfile to
114
125
  their recorded state, leave Intelligence unwired, and report which package resolved to more
115
- than one version, which versions, and which declared range held the top of the tree. Stop.
116
- Do not wire Intelligence onto a tree carrying two copies of a package.
126
+ than one version, which versions, and which declared range held the top of the tree. Then
127
+ end your turn. Do not wire Intelligence onto a tree carrying two copies of a package.
117
128
 
118
129
  Never add an `overrides`, `resolutions`, or `pnpm.overrides` block to collapse the two
119
130
  copies. It forces a version the developer did not approve onto their whole tree, and it
@@ -121,8 +132,9 @@ turns a reportable mismatch between two published packages into a local workarou
121
132
  else can see.
122
133
 
123
134
  If the baseline regresses, restore the manifest and lockfile to their recorded state, leave
124
- Intelligence unwired, and report the regression with the failing check. Stop. Where the plan
125
- names no dependency change, report that the installed versions met the floor.
135
+ Intelligence unwired, and report the regression with the failing check. Then end your
136
+ turn. Where the plan names no dependency change, report that the installed versions met
137
+ the floor.
126
138
 
127
139
  When the documentation uses the framework's scaffolder,
128
140
  run that scaffolder rather than hand-authoring what it emits.
@@ -165,4 +177,5 @@ command rather than running them one at a time. Split a command only when its re
165
177
  what you run next.
166
178
 
167
179
  Start with `Status: passed`, `Status: failed`, or `Status: blocked`.
168
- Return exactly four sections: Status, Files changed, Validation, and Blockers. Stop.
180
+ Return exactly four sections: Status, Files changed, Validation, and Blockers. Then end
181
+ your turn.
@@ -7,7 +7,7 @@ Work only on the packet you were assigned. Inspect the repository without changi
7
7
  Run this first, from the target project directory:
8
8
 
9
9
  ```text
10
- npx --yes copilotkit@4.13.1 onboard inspect --json
10
+ npx --prefer-offline --yes copilotkit@4.15.0 onboard inspect --json
11
11
  ```
12
12
 
13
13
  It answers the deterministic half of both packets exactly, from the same code
@@ -87,4 +87,4 @@ Use only `proved`, `absent`, or `unproved` for the status. State each absent or
87
87
  Do not read, print, or return secret values. For `.env` and `.copilotkit/project.json`
88
88
  checks, return only paths, presence checks, and missing field names. Do not read a file
89
89
  outside the project directory. Do not run or return an onboarding command other than
90
- `onboard inspect`. Stop after returning the findings to the main coding agent.
90
+ `onboard inspect`. End your turn after returning the findings to the main coding agent.
@@ -7,6 +7,13 @@ Find the expected agent id from the project. Start the existing agent and fronte
7
7
  when they are not already running. Before using a port, identify its process and working
8
8
  directory. Do not stop a process outside this project.
9
9
 
10
+ If your harness runs commands in a sandbox, a sandboxed command cannot listen on a port or
11
+ connect to localhost. Before the first server start, request escalation with a prefix rule
12
+ for the project's own dev script. Before the first request to a local server, request
13
+ escalation with a prefix rule for `curl`. If a local request still fails after 0 ms
14
+ (`Failed to connect ... after 0 ms`) while the port shows a listener, the sandbox blocked
15
+ it. Run it again with escalation, and do not record a failed predicate or step.
16
+
10
17
  Prove the live runtime in this order:
11
18
 
12
19
  1. GET `/info` from the project's CopilotKit runtime and require a valid response.
@@ -19,7 +26,7 @@ Prove the live runtime in this order:
19
26
  4. Confirm from project files that the runtime constructor passes a `runner` option rather
20
27
  than an `intelligence` option. A package, import, project file, or key is not use proof.
21
28
  5. Run
22
- `npx --yes copilotkit@4.13.1 verify --expect-runtime oss --round-trip --agent <expected-agent-id> --json`,
29
+ `npx --prefer-offline --yes copilotkit@4.15.0 verify --expect-runtime oss --round-trip --agent <expected-agent-id> --json`,
23
30
  with the runtime URL or auth header options that this project needs. Require exit zero
24
31
  and the JSON `ok` field to be `true`.
25
32
  6. Drive one real request through the existing frontend, CopilotKit runtime, and expected
@@ -45,4 +52,4 @@ can be durable. Report the persistence that project evidence proves, or `unprove
45
52
  replace it and do not describe all OSS runs as ephemeral.
46
53
 
47
54
  Start with `Status: passed`, `Status: failed`, or `Status: blocked`.
48
- Stop after returning the baseline result, process ids and ports used, and evidence paths.
55
+ End your turn after returning the baseline result, process ids and ports used, and evidence paths.
@@ -13,8 +13,8 @@ The existing agent's behavior is outside every step of this proof. It is four th
13
13
  agent's system prompt and instructions, its tools and what those tools do, its model and
14
14
  provider configuration, and its memory or state handling. A failing predicate is repaired
15
15
  on the CopilotKit side -- the frontend rendering, the tool schema, the runtime wiring.
16
- Where the only fix you can find is a change to the agent's instructions or tools, stop and
17
- return the failing predicate with the change you propose, for the developer to approve.
16
+ Where the only fix you can find is a change to the agent's instructions or tools, return
17
+ the failing predicate with the change you propose, for the developer to approve.
18
18
  Such a change is a behavior change rather than a repair: it changes how the agent answers
19
19
  everywhere, not only in CopilotKit. Never rewrite the agent's prompt to make a component
20
20
  render, and never report a round trip proved by a prompt this run rewrote.
@@ -89,21 +89,23 @@ agent and the frontend from one `dev` script, which runs them under
89
89
  other. A second start against a project already running that script collides with a server
90
90
  that is up.
91
91
 
92
+ If your harness runs commands in a sandbox, a sandboxed command cannot listen on a port or
93
+ connect to localhost. Before the first server start, request escalation with a prefix rule
94
+ for the project's own dev script. Before the first request to a local server, request
95
+ escalation with a prefix rule for `curl`. If a local request still fails after 0 ms
96
+ (`Failed to connect ... after 0 ms`) while the port shows a listener, the sandbox blocked
97
+ it. Run it again with escalation, and do not record a failed predicate or step.
98
+
92
99
  Start each server in the background with the project's own script. Then wait for it to
93
100
  answer rather than for a fixed number of seconds:
94
101
 
95
102
  ```bash
96
- ready=
97
- for _ in $(seq 90); do
98
- curl -fs -o /dev/null "<url>" && ready=1 && break
99
- sleep 1
100
- done
101
- [ "$ready" = 1 ] && echo "up" || echo "no answer from <url> after 90 seconds"
103
+ curl -fs -o /dev/null --retry 90 --retry-delay 1 --retry-max-time 90 --retry-all-errors "<url>"
102
104
  ```
103
105
 
104
- Read the loop's own last line rather than assuming it ended because the server answered.
105
- A server that never answered has written the reason to its own output, and reading that
106
- output is faster than starting it again.
106
+ A zero exit means the server answered. Any other exit means that it did not answer in 90
107
+ seconds. A server that never answered has written the reason to its own output, and
108
+ reading that output is faster than starting it again.
107
109
 
108
110
  That coupling also turns an ordinary restart into a false failure. Where you stop a server
109
111
  to pick up an installed dependency, start both again and wait for both to answer before you
@@ -145,7 +147,7 @@ IPv6 only, so an IPv4 literal fails against the correct port.
145
147
  ## Step 4 -- Check the wiring
146
148
 
147
149
  With both running, check the wiring in one command before you open a browser:
148
- `npx --yes copilotkit@4.13.1 verify --json`. It reads the port from this project, so a
150
+ `npx --prefer-offline --yes copilotkit@4.15.0 verify --json`. It reads the port from this project, so a
149
151
  non-default port needs no flag. The payload reports `runtimeUrl` and `runtimeUrlSource`. A
150
152
  `runtimeUrlSource` of `default` means nothing in the project named a port, so pass
151
153
  `--runtime-url` with the URL from step 1 in that case. Read the individual checks rather than
@@ -179,7 +181,7 @@ named no port the CLI can read: keep step 2's URL, and rewrite its host as `loca
179
181
  before you use it.
180
182
 
181
183
  Then run the command once more with the URL you are about to open:
182
- `npx --yes copilotkit@4.13.1 verify --frontend-url <that url> --json`. The
184
+ `npx --prefer-offline --yes copilotkit@4.15.0 verify --frontend-url <that url> --json`. The
183
185
  `frontend_assets_served` check asks that server for its page and for one of the page's own
184
186
  assets, on that exact host. A `fail` there means the dev server refuses its own static
185
187
  assets on the host you were about to use, and the check names the URL to use instead. This
@@ -187,7 +189,7 @@ is the cheapest step that can save the most expensive one, so run it before the
187
189
 
188
190
  ## Step 5 -- Prove that the agent runs
189
191
 
190
- Run `npx --yes copilotkit@4.13.1 verify --round-trip --json`. It sends one request through
192
+ Run `npx --prefer-offline --yes copilotkit@4.15.0 verify --round-trip --json`. It sends one request through
191
193
  the runtime and reads the answer back from the thread, so it separates an agent that is
192
194
  configured from an agent that works. Use `--agent <id>` when the runtime declares more
193
195
  than one. If it reports `user-not-identified`, this project's `identifyUser` reads a
@@ -200,7 +202,7 @@ Where this run settled a Learning Container, add the flag to the call above rath
200
202
  running a second round trip:
201
203
 
202
204
  ```text
203
- npx --yes copilotkit@4.13.1 verify --round-trip --expect-learning-container <container id> --json
205
+ npx --prefer-offline --yes copilotkit@4.15.0 verify --round-trip --expect-learning-container <container id> --json
204
206
  ```
205
207
 
206
208
  The check reads the thread that this run created, so a second round trip proves a second
@@ -234,7 +236,7 @@ the credential was written holds an empty key while the file beside it carries t
234
236
  one. Run this from the target app directory:
235
237
 
236
238
  ```text
237
- npx --yes copilotkit@4.13.1 onboard env-staleness
239
+ npx --prefer-offline --yes copilotkit@4.15.0 onboard env-staleness
238
240
  ```
239
241
 
240
242
  A `stale` line names the env file and how long after launch it was written. Report that,
@@ -312,7 +314,7 @@ For a recorded `both-oss` starting state, this step has no component to render.
312
314
  same request the baseline recorded, require the same kind of user-visible result the
313
315
  baseline produced, and require that the thread for that request is listed in the drawer.
314
316
  Where this journey's frontend framework ships no threads drawer -- React Native --, prove
315
- that thread with `npx --yes copilotkit@4.13.1 verify --round-trip`, which reads the
317
+ that thread with `npx --prefer-offline --yes copilotkit@4.15.0 verify --round-trip`, which reads the
316
318
  answer back off the thread and needs no browser. Record which of the two you proved.
317
319
 
318
320
  Use the surface control the main coding agent recorded for your environment. It either had
@@ -340,7 +342,7 @@ request never exercises. Drive it with the browser control step 6 named.
340
342
  the page to finish loading. Do not retype the host, and do not substitute a URL a tool
341
343
  offers you by default. Where the page loads but its styling is missing or the chat
342
344
  control is dead, run
343
- `npx --yes copilotkit@4.13.1 verify --frontend-url <the url you opened> --json`
345
+ `npx --prefer-offline --yes copilotkit@4.15.0 verify --frontend-url <the url you opened> --json`
344
346
  before you diagnose anything else. A dev server can serve its page and refuse every
345
347
  static chunk behind it, and on screen that is indistinguishable from a broken
346
348
  integration. The `frontend_assets_served` check tells the two apart.
@@ -489,4 +491,4 @@ standard blocked completion route. Use `Status: failed` for a failed proof step.
489
491
  Return the proof or the exact failed step to the main coding agent, together with the
490
492
  input, the visible result, the relevant process status, the evidence locations, the
491
493
  surface-check outcome, and which surface that outcome speaks for. Do not return secret
492
- values. Stop after you return the result.
494
+ values. End your turn after you return the result.
@@ -30,16 +30,16 @@ Before you show the best-effort plan, require this complete packet:
30
30
  - Give the ordered proof rules.
31
31
 
32
32
  After the developer approves the best-effort plan, run
33
- `npx --yes copilotkit@4.13.1 onboard read fallback/best-effort`.
33
+ `npx --prefer-offline --yes copilotkit@4.15.0 onboard read fallback/best-effort`.
34
34
 
35
35
  Send one short report. Run the friction command without another developer question. Do not
36
36
  ask the developer about telemetry: the command applies the setting they already have.
37
37
 
38
38
  ```text
39
- npx --yes copilotkit@4.13.1 onboard friction --phase stop --category <slug>
39
+ npx --prefer-offline --yes copilotkit@4.15.0 onboard friction --phase stop --category <slug> --message "<sentences>"
40
40
  ```
41
41
 
42
- Write one or two sentences to standard input: the step you stopped at and what stopped it.
42
+ `--message` takes one or two sentences: the step you stopped at and what stopped it.
43
43
  Pick the category that fits from docs-missing, docs-wrong, docs-sequential, cli-gap,
44
44
  sdk-gap, environment, port-collision, credential, validation-loop, and other. Leave
45
45
  --cost-seconds off. A run that stopped cannot separate one papercut's cost from the cost
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "copilotkit",
3
- "version": "4.13.1",
3
+ "version": "4.15.0",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20.9.0"
@@ -16,5 +16,9 @@
16
16
  "optionalDependencies": {
17
17
  "@microsoft/teams.cli": "3.0.3"
18
18
  },
19
+ "dependencies": {
20
+ "@mastra/core": "1.48.0",
21
+ "@mastra/libsql": "1.14.3"
22
+ },
19
23
  "license": "SEE LICENSE IN LICENSE"
20
24
  }