copilotkit 4.8.3 → 4.9.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 (47) hide show
  1. package/README.md +183 -2
  2. package/cli-build-info.json +7 -7
  3. package/index.js +5645 -3567
  4. package/onboarding/index.json +33 -33
  5. package/onboarding/prompts/authenticate/start.md +63 -10
  6. package/onboarding/prompts/credentials/finalize-plan.md +168 -15
  7. package/onboarding/prompts/credentials/plan.md +55 -49
  8. package/onboarding/prompts/fallback/best-effort.md +29 -0
  9. package/onboarding/prompts/framework/ag2.md +33 -7
  10. package/onboarding/prompts/framework/agno.md +32 -7
  11. package/onboarding/prompts/framework/built-in.md +30 -8
  12. package/onboarding/prompts/framework/claude-sdk-python.md +35 -7
  13. package/onboarding/prompts/framework/claude-sdk-typescript.md +39 -7
  14. package/onboarding/prompts/framework/crewai-flows.md +41 -7
  15. package/onboarding/prompts/framework/deep-agents.md +30 -6
  16. package/onboarding/prompts/framework/google-adk.md +32 -8
  17. package/onboarding/prompts/framework/langgraph-fastapi.md +24 -5
  18. package/onboarding/prompts/framework/langgraph-python.md +15 -5
  19. package/onboarding/prompts/framework/langgraph-typescript.md +15 -5
  20. package/onboarding/prompts/framework/llamaindex.md +35 -7
  21. package/onboarding/prompts/framework/mastra.md +48 -6
  22. package/onboarding/prompts/framework/ms-agent-dotnet.md +57 -7
  23. package/onboarding/prompts/framework/ms-agent-harness-dotnet.md +48 -8
  24. package/onboarding/prompts/framework/ms-agent-python.md +32 -7
  25. package/onboarding/prompts/framework/pydantic-ai.md +34 -9
  26. package/onboarding/prompts/framework/strands-python.md +28 -9
  27. package/onboarding/prompts/framework/strands-typescript.md +28 -9
  28. package/onboarding/prompts/frontend/angular.md +20 -5
  29. package/onboarding/prompts/frontend/nextjs.md +13 -3
  30. package/onboarding/prompts/frontend/plan.md +20 -19
  31. package/onboarding/prompts/frontend/react-native.md +9 -3
  32. package/onboarding/prompts/frontend/react-spa.md +20 -5
  33. package/onboarding/prompts/frontend/vue.md +9 -3
  34. package/onboarding/prompts/implementation/build-and-validate.md +82 -7
  35. package/onboarding/prompts/proof/complete.md +63 -2
  36. package/onboarding/prompts/proof/oss-baseline.md +59 -0
  37. package/onboarding/prompts/proof/round-trip.md +150 -8
  38. package/onboarding/prompts/subagent/create-plan.md +69 -2
  39. package/onboarding/prompts/subagent/implement-and-validate.md +48 -3
  40. package/onboarding/prompts/subagent/inspect-repository.md +13 -3
  41. package/onboarding/prompts/subagent/prove-oss-baseline.md +35 -0
  42. package/onboarding/prompts/subagent/prove-round-trip.md +118 -11
  43. package/onboarding/prompts/unsupported/no-validated-path.md +27 -9
  44. package/package.json +1 -1
  45. package/release/release-tool.js +32 -4
  46. package/onboarding/prompts/frontend/slack.md +0 -20
  47. package/onboarding/prompts/frontend/teams.md +0 -20
package/README.md CHANGED
@@ -36,6 +36,68 @@ its project-scoped `INTELLIGENCE_API_KEY`. Threads-enabled `init` and `create`
36
36
  scaffolds run the same hosted project selection and API-key provisioning path;
37
37
  use the built entrypoint when manually validating those steps too.
38
38
 
39
+ ### Selecting a project without a terminal
40
+
41
+ The bare `project select` renders an interactive picker and therefore needs a
42
+ TTY, which a coding agent's shell is not. `--project` and `--create` name the
43
+ answer up front and run anywhere:
44
+
45
+ ```bash
46
+ copilotkit project list --json # see the choices
47
+ copilotkit project list --search support --json # search name, slug, or id
48
+ copilotkit project select --project <slug-or-id> # pick an existing one
49
+ copilotkit project select --create "My App" --json # create one and select it
50
+ ```
51
+
52
+ `--project` and `--create` are mutually exclusive. `--project` is resolved
53
+ against the organization's real projects, so a typo fails with the available
54
+ slugs instead of recording a selection that points at nothing.
55
+
56
+ `--json` emits one object on stdout:
57
+
58
+ ```json
59
+ {
60
+ "type": "completed",
61
+ "selected_project_slug": "my-app",
62
+ "project": { "id": "220", "slug": "my-app", "organizationId": "org_123" },
63
+ "config_path": "/work/my-repo/.copilotkit/project.json",
64
+ "project_file_written": true,
65
+ "api_key_provisioned": true,
66
+ "environment_file_written": true
67
+ }
68
+ ```
69
+
70
+ The four top-level summary fields let a coding agent read the result without
71
+ searching the nested object or reading either file. The payload never contains
72
+ the API key.
73
+
74
+ `config_path` is absolute, and it is not always under the directory you ran in.
75
+ The project record is repository-scoped: it goes into an existing `.copilotkit/`
76
+ at or above the current directory when there is one, and otherwise into the
77
+ repository root, so every part of a repository finds the same project. When that
78
+ is not the current directory, `project select` says so on stderr. Read the path
79
+ from this field rather than assuming `./.copilotkit/project.json`.
80
+
81
+ The API key is not hoisted with it. It is written to the `.env` beside the
82
+ directory you ran in, because that is the file the app process loads — so in a
83
+ repository with a `web/` and an `agent/` half, run `project select` in the half
84
+ that needs the key.
85
+
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
+ `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.
93
+
94
+ Failures use the `login --json` shape, `{"error": "...", "type": "failed"}`, and
95
+ exit 1.
96
+
97
+ With `--json` the payload is the only thing on stdout — warnings, errors, and
98
+ (when no selector is passed) the interactive picker all go to stderr — so
99
+ piping stdout into a parser is safe.
100
+
39
101
  Do not run raw CLI source with commands such as
40
102
  `pnpm exec tsx apps/cli/src/index.ts login`; source execution bypasses the
41
103
  supported bundle, build-time defines, and packaging behavior, so it does not
@@ -337,6 +399,22 @@ The Microsoft Agent Framework .NET template uses GitHub Models. Set its C# agent
337
399
 
338
400
  Do not commit generated `.env` files or personal secrets.
339
401
 
402
+ ## Version Control
403
+
404
+ Outside a repository, `copilotkit init` runs `git init` in the new app and makes
405
+ an initial commit when a git identity is configured, so you have a restore point
406
+ before you start editing.
407
+
408
+ Inside a repository you already have, it does neither. A second `git init` would
409
+ make the new app a nested repository: commits made in it would go to the inner
410
+ repository, while the outer one saw only an untracked directory. The CLI names
411
+ the repository it found and leaves the new app for you to commit.
412
+
413
+ The project binding is recorded at that repository's root, so every directory in
414
+ it resolves to the same project, and the run says where it went. If the root
415
+ already binds a different project, the binding stays in the new app instead, so a
416
+ repository holding two Intelligence apps keeps one for each.
417
+
340
418
  ## Run A Generated Project
341
419
 
342
420
  After scaffolding, the CLI prompts you to install dependencies:
@@ -377,6 +455,108 @@ For the Intelligence threads template, keep Docker Desktop running before `npm r
377
455
 
378
456
  ## Diagnostics
379
457
 
458
+ Use `copilotkit verify` to check that a project's wiring works before debugging
459
+ anything else:
460
+
461
+ ```bash
462
+ copilotkit verify
463
+ copilotkit verify --json # machine-readable output
464
+ copilotkit verify --runtime-url http://localhost:8080/copilotkit
465
+ copilotkit verify --round-trip # also run the agent
466
+ copilotkit verify --expect-runtime oss --round-trip --agent incident_triage
467
+ ```
468
+
469
+ It checks that a hosted project is selected, that a project API key is present
470
+ and authenticates against Intelligence, that the CopilotKit runtime responds,
471
+ that the runtime declares at least one agent, that the runtime is actually
472
+ using the credential, and that it serves the thread routes the license pays
473
+ for. It also reports the runtime version, the agent framework in use, the
474
+ realtime gateway wiring, the plan, and the license state.
475
+
476
+ The selected project is read from the nearest `.copilotkit/project.json` at or
477
+ above the current directory, stopping at the repository root, so running from
478
+ one half of a repository finds the project the repository is bound to. `verify`
479
+ names the directory it read the project from, and names where it searched when
480
+ it found none. The API key is read from the `.env` beside the current directory
481
+ only, because that is the file the app process loads.
482
+
483
+ That last check is the one a passing build cannot give you. A key in `.env`
484
+ proves only that one was provisioned: the runtime reads no environment variable
485
+ for it, so a runtime built without an Intelligence client runs in SSE mode and
486
+ never reads the key — while still compiling, serving, and answering in a
487
+ browser. `verify` reads the runtime's own reported license to tell the two
488
+ apart, and only a running runtime can answer that, so the check stays `UNKNOWN`
489
+ when the runtime is unreachable.
490
+
491
+ Every check reports `PASS`, `FAIL`, or `UNKNOWN`, and `UNKNOWN` never means the
492
+ check passed — an unreachable Intelligence API leaves the API key unproven
493
+ rather than condemning it. `verify` exits non-zero unless every check passed, so
494
+ a caller can branch on the command instead of parsing it. With `--json` the
495
+ payload is the only thing on stdout and every diagnostic goes to stderr, so
496
+ piping is safe.
497
+
498
+ Use `--expect-runtime oss` to prove an open-source runtime instead. In this
499
+ mode, hosted project, key, and thread-route checks do not apply. The command
500
+ exits zero only when `/info` is valid, declares the agent named by `--agent`,
501
+ omits `licenseStatus`, and `--round-trip` passes. Both `--round-trip` and
502
+ `--agent` are required for an OSS pass.
503
+
504
+ The runtime URL defaults to `http://localhost:3000/api/copilotkit` and the
505
+ report always states which URL it probed, because a wrong default is the most
506
+ likely reason for a runtime failure. Pass `--runtime-url` when the frontend
507
+ serves the runtime elsewhere.
508
+
509
+ A runtime mounted `mode: "single-route"` refuses `GET /info`, so `verify` asks
510
+ the same question again through the POST envelope that mount does answer.
511
+ Reaching it that way counts as reachable, and the report says which shape
512
+ answered. That mount carries no thread or memory route, though, so a licensed
513
+ project on it fails the thread-route check with the mount named as the cause.
514
+ Removing `mode: "single-route"` fixes it.
515
+
516
+ ### Proving the agent runs, not just that it is configured
517
+
518
+ Every check above describes the project. `--round-trip` makes it work: it sends
519
+ one real request through the runtime and reads the answer back from the thread.
520
+
521
+ ```bash
522
+ copilotkit verify --round-trip
523
+ copilotkit verify --round-trip --agent incident_triage # several declared
524
+ copilotkit verify --round-trip --header "Cookie: session=…" # auth-gated app
525
+ ```
526
+
527
+ It reads the answer back from `GET /threads/:id/messages` rather than from the
528
+ run's response, because those responses differ by mode. In Intelligence mode the
529
+ run returns a thread lock and a gateway URL, and the agent's events travel to the
530
+ browser over the realtime gateway — so a 200 there proves a run started, which is
531
+ precisely the outcome a runtime that dies mid-turn also produces. Reading the
532
+ thread is one assertion for both modes, and it proves the stronger fact: the
533
+ answer was recorded, not merely emitted. The thread the run reports wins over the
534
+ one the CLI sent, because Intelligence rewrites both ids when it takes the lock.
535
+
536
+ The assertion is that a non-empty answer came back, never what it said, so the
537
+ verdict does not depend on the model behind the agent. It costs a model call and
538
+ records a thread, which is why it is opt-in rather than part of the bare command.
539
+
540
+ `user-not-identified` is reported as `UNKNOWN` rather than `FAIL`. `identifyUser`
541
+ is the project's own code and usually reads a signed-in session, which a CLI
542
+ request does not carry, so an auth-gated app refusing it is that app working
543
+ correctly. Pass what it reads with `--header`, repeatable.
544
+
545
+ ### What `verify` still does not prove
546
+
547
+ It does not drive a browser. Realtime delivery to a browser over the gateway,
548
+ browser-origin CORS and CSP, the frontend provider being wired to this runtime,
549
+ and a generative UI component actually rendering are all invisible to a
550
+ command-line check, and a round trip that passes here leaves every one of them
551
+ unverified.
552
+
553
+ It also cannot prove _which deployment_ answered. `--round-trip` proves that an
554
+ executable agent stands behind the id this project declares — which `/info`
555
+ alone cannot show, since it reports the names the runtime was configured with —
556
+ but a runtime pointed at another project's agent answers under that same id, and
557
+ a stale agent left running from earlier work still answers as though it were the
558
+ new one.
559
+
380
560
  Use `copilotkit logs` when onboarding fails or support needs local CLI diagnostics:
381
561
 
382
562
  ```bash
@@ -470,8 +650,9 @@ report `<version>-pre.<shortsha>` from `copilotkit --version`, so a tester's
470
650
  build is always identifiable. `copilotkit version` also reports the canonical
471
651
  Intelligence and first-party CopilotKit commits embedded in the artifact.
472
652
 
473
- Pushes and PRs continue to publish `CLI_ENV=local` builds automatically, as
474
- before.
653
+ Pushes publish `CLI_ENV=local` builds automatically. Pull requests publish
654
+ `CLI_ENV=production` builds under the separate `copilotkit-pr` package name so
655
+ testers can use hosted login without confusing the artifact with a release.
475
656
 
476
657
  Note: `workflow_dispatch` only works against refs that contain the dispatch
477
658
  trigger — branches cut before this workflow landed need a merge from `main`
@@ -2,20 +2,20 @@
2
2
  "schemaVersion": 1,
3
3
  "package": {
4
4
  "name": "copilotkit",
5
- "version": "4.8.3"
5
+ "version": "4.9.0"
6
6
  },
7
7
  "intelligence": {
8
- "commit": "a000695b07fd11c83d6a82d51079f839a876be66"
8
+ "commit": "fab380427c6324aaf090b195af0f51eaf4a1a407"
9
9
  },
10
10
  "copilotKit": {
11
- "submittedInput": "e0a2f00cca326c76739217e8ca40902e609539a4",
12
- "commit": "e0a2f00cca326c76739217e8ca40902e609539a4"
11
+ "submittedInput": "bf2068734bcc42b9dc9999b183d0fd07a673f713",
12
+ "commit": "bf2068734bcc42b9dc9999b183d0fd07a673f713"
13
13
  },
14
14
  "channel": "production",
15
15
  "triggeringActor": "MikeRyanDev",
16
16
  "workflow": {
17
- "runId": "32159069979",
18
- "runUrl": "https://github.com/CopilotKit/Intelligence/actions/runs/32159069979"
17
+ "runId": "32886074334",
18
+ "runUrl": "https://github.com/CopilotKit/Intelligence/actions/runs/32886074334"
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-18T16:14:50Z"
27
+ "builtAt": "2026-08-25T18:51:51Z"
28
28
  }