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
package/README.md CHANGED
@@ -19,6 +19,25 @@ CLI_ENV=local pnpm nx build cli
19
19
  node dist/apps/cli/index.js --help
20
20
  ```
21
21
 
22
+ ## Type-safe agent IDs
23
+
24
+ `copilotkit typegen` reads a running CopilotKit runtime's `/info` route and
25
+ writes `.copilotkit/types.ts` plus `.copilotkit/register.d.ts`. After
26
+ TypeScript includes `register.d.ts`, `agentId` on `@copilotkit/react-core/v2`
27
+ is the union of the agents that runtime declared.
28
+
29
+ ```bash
30
+ npx copilotkit typegen
31
+ npx copilotkit typegen http://localhost:3000/api/copilotkit
32
+ ```
33
+
34
+ The default URL matches `copilotkit verify`. Generated files sit next to
35
+ `.copilotkit/project.json`. The command ignores those two files only. It does
36
+ not ignore the whole `.copilotkit/` directory.
37
+
38
+ If `tsconfig.json` is JSONC, add `".copilotkit/register.d.ts"` to `include` by
39
+ hand.
40
+
22
41
  ## Manual local validation
23
42
 
24
43
  For manual login/session and hosted-project validation, run the supported built
@@ -83,16 +102,44 @@ directory you ran in, because that is the file the app process loads — so in a
83
102
  repository with a `web/` and an `agent/` half, run `project select` in the half
84
103
  that needs the key.
85
104
 
86
- **Check all four summary fields, not just the exit code.** Key provisioning is
87
- deliberately non-fatal: if it fails, the selection is still persisted, a warning
88
- goes to stderr, and the command still exits 0 — leaving a scaffold with no
89
- `CPK_INTELLIGENCE_API_KEY`, whose first run fails with an opaque "Failed to
90
- initialize thread". `api_key_provisioned` and `environment_file_written` are
91
- false in this state.
92
- Re-running `project select` is a valid recovery.
105
+ When the directory you ran in is not itself a CopilotKit package, `project
106
+ select` names the directory that is expected to load the key on stderr. Run from
107
+ the root of a `web/` + `agent/` repository, the key lands at the root while the
108
+ app in `web/` reads only `web/.env*`, and `copilotkit verify` fails **The app can
109
+ load the project API key** until it is written there instead.
110
+
111
+ ### When only half of it lands
112
+
113
+ Key provisioning does not throw away a selection it could not finish. If minting
114
+ the key fails, the project record is still written and the scaffold has no
115
+ `CPK_INTELLIGENCE_API_KEY` — whose first run fails with an opaque "Failed to
116
+ initialize thread".
117
+
118
+ That state has an exit status of its own. `project select` exits **75**
119
+ (`EX_TEMPFAIL`: partially applied, retry is safe), prints what was written and
120
+ what was not, and names the retry. With `--json` the payload is still emitted,
121
+ with `"type": "partial"`, `api_key_provisioned` and `environment_file_written`
122
+ false, and a `retry_command`:
123
+
124
+ ```json
125
+ {
126
+ "type": "partial",
127
+ "selected_project_slug": "my-app",
128
+ "project": { "id": "220", "slug": "my-app", "organizationId": "org_123" },
129
+ "config_path": "/work/my-repo/.copilotkit/project.json",
130
+ "project_file_written": true,
131
+ "api_key_provisioned": false,
132
+ "environment_file_written": false,
133
+ "retry_command": "copilotkit project select --project my-app"
134
+ }
135
+ ```
136
+
137
+ Keep the record and re-run the command it names. A retry converges on the same
138
+ state as a first-time success: the same project, the same binding, plus the key.
93
139
 
94
- Failures use the `login --json` shape, `{"error": "...", "type": "failed"}`, and
95
- exit 1.
140
+ Exit statuses: **0** everything landed, **75** the record was written and the key
141
+ was not, **1** nothing was applied. Failures use the `login --json` shape,
142
+ `{"error": "...", "type": "failed"}`.
96
143
 
97
144
  With `--json` the payload is the only thing on stdout — warnings, errors, and
98
145
  (when no selector is passed) the interactive picker all go to stderr — so
@@ -306,13 +353,17 @@ Use `copilotkit create` to start a **new** project. Use `copilotkit skills onboa
306
353
  when you already have an app and want your coding agent to add CopilotKit for you.
307
354
 
308
355
  ```bash
356
+ # Default: install in this project, sign in, and get the agent prompt.
357
+ copilotkit skills onboard
358
+ copilotkit skills onboard --no-clipboard
359
+ copilotkit skills onboard --channels
360
+
361
+ # Custom: show the installer so you can inspect or change its choices.
309
362
  copilotkit skills install
310
363
  copilotkit skills install -y
311
364
  copilotkit skills install --skill react-core,runtime --agent claude-code
312
365
  copilotkit skills install --list
313
- copilotkit skills onboard
314
- copilotkit skills onboard --no-clipboard
315
- copilotkit skills onboard --channels
366
+
316
367
  # Run `copilotkit project select` in this directory first.
317
368
  copilotkit skills download <learning-container-id> --output ./learned-skills
318
369
  ```
@@ -332,42 +383,41 @@ add-CopilotKit-to-my-app prompt. It is the same prompt
332
383
  `copilotkit channels setup` prints; only the prompt differs, and the install
333
384
  and sign-in are unchanged.
334
385
 
335
- `copilotkit skills install` installs CopilotKit agent skills for your coding
336
- agent (Claude Code, Codex, Cursor, Gemini, and others) by running the standalone
337
- `skills` installer under the hood.
386
+ `copilotkit skills onboard` installs every CopilotKit skill in the current
387
+ project without showing the installer's picker. It writes the shared
388
+ `.agents/skills` path used by Codex, Cursor, Gemini CLI, and other compatible
389
+ agents, plus `.claude/skills` for Claude Code. The command shows one progress
390
+ line, then prints a short install receipt.
391
+
392
+ It then:
393
+
394
+ - signs you in with your CopilotKit account, reusing an existing session;
395
+ - stops before it changes the app itself;
396
+ - copies a ready-to-paste agent prompt, or prints it when no clipboard works.
338
397
 
339
- By default it installs every skill and prompts you to choose which coding agents
340
- to install them to. Narrow or automate the install with these flags (they work
341
- on both `install` and `onboard`):
398
+ Pass `--no-clipboard` to always print the prompt. `onboard` needs an interactive
399
+ terminal because it may open a browser for sign-in.
400
+
401
+ Use `copilotkit skills install` when you want to see or change the agent
402
+ selection. It shows the standalone installer's picker and output, then stops
403
+ before sign-in. CopilotKit keeps that output visible, exits nonzero when any
404
+ target fails, and does not print a false success receipt. These flags work on
405
+ both commands unless noted:
342
406
 
343
407
  - `-s, --skill <names>` — comma-separated skills to install (default: all),
344
408
  e.g. `--skill react-core,runtime`.
345
409
  - `-a, --agent <names>` — comma-separated coding agents to install to
346
- (default: choose interactively), e.g. `--agent claude-code,cursor`.
347
- - `-y, --yes` — install everything (all skills to all agents) non-interactively.
410
+ (`onboard` uses the shared and Claude Code paths; `install` asks), e.g.
411
+ `--agent claude-code,windsurf`.
412
+ - `-y, --yes` — skip prompts; omitted skill or agent selections default to all.
348
413
  - `--global` — install at the user level instead of the current project.
349
414
  - `--list` — list the available skills and exit without installing (`install`
350
415
  only).
351
416
 
352
- Choosing which coding agents to install to is interactive, so a non-interactive
353
- environment (CI, scripts) must make the choice deterministic: pass `-y` to
354
- install everything, or `--agent <name>` to target specific agents. Otherwise the
355
- command exits with guidance instead of hanging.
356
-
357
- `copilotkit skills onboard` is a superset of `install`. It also:
358
-
359
- - signs you in with your CopilotKit account, reusing your existing session and
360
- opening a browser sign-in only when you are not already signed in;
361
- - stops before any repo-specific file changes — your coding agent performs the
362
- actual integration using the installed skills;
363
- - copies a ready-to-paste agent prompt to your clipboard, and prints it instead
364
- when the clipboard is unavailable.
365
-
366
- Pass `--no-clipboard` to always print the prompt instead of copying it. This is
367
- useful in headless or remote shells where clipboard access is unavailable.
368
- `onboard` requires an interactive terminal because it opens a browser to sign
369
- in; use `skills install -y` (or `--agent <name>`) for non-interactive
370
- environments.
417
+ In CI or a script, run `skills install -y` to target every supported agent, or
418
+ pass `--agent <name>` for exact project-local targets. Add `--global` only for a
419
+ user-level install. Bare `skills install` exits with a clear message when it
420
+ cannot show the picker.
371
421
 
372
422
  When to use which:
373
423
 
@@ -424,6 +474,19 @@ The Microsoft Agent Framework .NET template uses GitHub Models. Set its C# agent
424
474
 
425
475
  Do not commit generated `.env` files or personal secrets.
426
476
 
477
+ Before writing a credential, `copilotkit license --write` and
478
+ `copilotkit project select` ask git whether it ignores the target `.env`. When it
479
+ does not, they append `.env`, `.env.*` and `!.env.example` to your `.gitignore` as
480
+ one marked block, leaving your existing lines untouched. A `.gitignore` listing
481
+ only `.env` does not cover `.env.local`, so a credential written beside it is
482
+ staged by the next `git add -A`.
483
+
484
+ Appending a pattern cannot untrack a file git already tracks. In that one case
485
+ neither command writes the credential: `license` prints the `COPILOTKIT_LICENSE_TOKEN`
486
+ line on stdout so an already-issued token is not lost, and `project select` reports
487
+ `api_key_provisioned: false` and exits 75. Untrack the file, then re-run. Outside a
488
+ git work tree there is nothing to protect and both write as before.
489
+
427
490
  ## Version Control
428
491
 
429
492
  Outside a repository, `copilotkit init` runs `git init` in the new app and makes
@@ -491,19 +554,30 @@ copilotkit verify --round-trip # also run the agent
491
554
  copilotkit verify --expect-runtime oss --round-trip --agent incident_triage
492
555
  ```
493
556
 
494
- It checks that a hosted project is selected, that a project API key is present
495
- and authenticates against Intelligence, that the CopilotKit runtime responds,
496
- that the runtime declares at least one agent, that the runtime is actually
497
- using the credential, and that it serves the thread routes the license pays
498
- for. It also reports the runtime version, the agent framework in use, the
499
- realtime gateway wiring, the plan, and the license state.
557
+ It checks that a hosted project is selected, that a project API key is present,
558
+ that the app's own process can load that key, that the key authenticates
559
+ against Intelligence, that the CopilotKit runtime responds, that the runtime
560
+ declares at least one agent, that the runtime is actually using the credential,
561
+ and that it serves the thread routes the license pays for. It also reports the
562
+ runtime version, the agent framework in use, the realtime gateway wiring, the
563
+ plan, and the license state.
500
564
 
501
565
  The selected project is read from the nearest `.copilotkit/project.json` at or
502
566
  above the current directory, stopping at the repository root, so running from
503
567
  one half of a repository finds the project the repository is bound to. `verify`
504
568
  names the directory it read the project from, and names where it searched when
505
- it found none. The API key is read from the `.env` beside the current directory
506
- only, because that is the file the app process loads.
569
+ it found none. The API key is searched for the same way: `.env` and `.env.local`
570
+ from the current directory up to the repository root.
571
+
572
+ Being found is not the same as being loadable. A framework's env loader does not
573
+ walk up — Next.js, Vite, Nuxt and Astro all read env files from the application's
574
+ own directory — so a key at the repository root is invisible to an app in a
575
+ subdirectory. `verify` reports the two facts separately: **A project API key is
576
+ present** says the credential exists somewhere in this repository, and **The app
577
+ can load the project API key** says the directory the app runs in supplies it.
578
+ The second is `UNKNOWN` rather than `FAIL` wherever it cannot decide: no package
579
+ declaring a `@copilotkit/*` dependency was found, more than one was, or a script
580
+ in the app names an env file itself with `dotenv`, `env-cmd`, or `--env-file`.
507
581
 
508
582
  That last check is the one a passing build cannot give you. A key in `.env`
509
583
  proves only that one was provisioned: the runtime reads no environment variable
@@ -526,10 +600,37 @@ exits zero only when `/info` is valid, declares the agent named by `--agent`,
526
600
  omits `licenseStatus`, and `--round-trip` passes. Both `--round-trip` and
527
601
  `--agent` are required for an OSS pass.
528
602
 
529
- The runtime URL defaults to `http://localhost:3000/api/copilotkit` and the
530
- report always states which URL it probed, because a wrong default is the most
531
- likely reason for a runtime failure. Pass `--runtime-url` when the frontend
532
- serves the runtime elsewhere.
603
+ ### Which runtime URL gets probed
604
+
605
+ `verify` works the port out from the project rather than assuming one. In order:
606
+
607
+ 1. `--runtime-url`, when you pass it.
608
+ 2. `"runtimeUrl"` in `.copilotkit/project.json` — an absolute URL you add by
609
+ hand for a project whose runtime is somewhere none of the below can find it.
610
+ The CLI never writes this field and never removes one you wrote.
611
+ 3. `COPILOTKIT_RUNTIME_URL` in the project's `.env` / `.env.local`, when it is
612
+ absolute.
613
+ 4. The port the app's own dev configuration declares: `PORT` in its env files,
614
+ or a `-p` / `--port` flag on its `dev` script, including a script that `dev`
615
+ delegates to through `concurrently`. Only a web dev server's port counts, so
616
+ the agent half's port is never mistaken for the frontend's.
617
+ 5. `http://localhost:3000/api/copilotkit`, assumed.
618
+
619
+ The app directory is the CopilotKit package you are in, or — running from the
620
+ repository root of a two-half project — the one package below you that depends
621
+ on CopilotKit. More than one, and `verify` names them instead of choosing.
622
+
623
+ The report always states the URL it probed **and where that URL came from**,
624
+ because those two facts mean opposite things when nothing answers. Silence at a
625
+ URL the project named is a `FAIL`. Silence at the assumed default is `UNKNOWN`,
626
+ with the two ways to tell the command where to look — a working application on
627
+ another port is not a wiring failure, and reporting it as one is how a developer
628
+ ends up undoing correct work.
629
+
630
+ The mount path is not discovered: every first-party starter serves the runtime
631
+ at `/api/copilotkit`, and reading a framework's routing conventions to find out
632
+ otherwise is the kind of check that drifts and starts reporting confident
633
+ nonsense. Where yours is elsewhere, use option 1 or 2.
533
634
 
534
635
  A runtime mounted `mode: "single-route"` refuses `GET /info`, so `verify` asks
535
636
  the same question again through the POST envelope that mount does answer.
@@ -2,20 +2,20 @@
2
2
  "schemaVersion": 1,
3
3
  "package": {
4
4
  "name": "copilotkit",
5
- "version": "4.9.17"
5
+ "version": "4.9.31"
6
6
  },
7
7
  "intelligence": {
8
- "commit": "2e15855e40f342daf1805da34a8ac3d9e708e082"
8
+ "commit": "5f88d6f4e26b643eb1223b12cc05dad94055b5ef"
9
9
  },
10
10
  "copilotKit": {
11
- "submittedInput": "f08f478cf73c46d34e8db03dedcc61f695f9b9b5",
12
- "commit": "f08f478cf73c46d34e8db03dedcc61f695f9b9b5"
11
+ "submittedInput": "c2038cf52ced16dc814e2ff0bd60894f2a53f5c1",
12
+ "commit": "c2038cf52ced16dc814e2ff0bd60894f2a53f5c1"
13
13
  },
14
14
  "channel": "production",
15
- "triggeringActor": "maxkorp",
15
+ "triggeringActor": "BenTaylorDev",
16
16
  "workflow": {
17
- "runId": "33436603154",
18
- "runUrl": "https://github.com/CopilotKit/Intelligence/actions/runs/33436603154"
17
+ "runId": "33679806270",
18
+ "runUrl": "https://github.com/CopilotKit/Intelligence/actions/runs/33679806270"
19
19
  },
20
20
  "validationResult": "passed",
21
21
  "ag2": {
@@ -24,5 +24,5 @@
24
24
  "revision": "main",
25
25
  "pinned": false
26
26
  },
27
- "builtAt": "2026-08-31T20:34:20Z"
27
+ "builtAt": "2026-09-02T20:33:23Z"
28
28
  }