@copilotkit/web-inspector 1.66.4 → 1.67.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 (56) hide show
  1. package/README.md +92 -13
  2. package/dist/index.cjs +1436 -429
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +118 -8
  5. package/dist/index.d.cts.map +1 -1
  6. package/dist/index.d.mts +118 -8
  7. package/dist/index.d.mts.map +1 -1
  8. package/dist/index.mjs +1438 -431
  9. package/dist/index.mjs.map +1 -1
  10. package/dist/index.umd.js +1721 -533
  11. package/dist/index.umd.js.map +1 -1
  12. package/dist/lib/inspector-metadata.cjs +60 -0
  13. package/dist/lib/inspector-metadata.cjs.map +1 -0
  14. package/dist/lib/inspector-metadata.mjs +60 -0
  15. package/dist/lib/inspector-metadata.mjs.map +1 -0
  16. package/dist/lib/telemetry.cjs +117 -32
  17. package/dist/lib/telemetry.cjs.map +1 -1
  18. package/dist/lib/telemetry.mjs +116 -33
  19. package/dist/lib/telemetry.mjs.map +1 -1
  20. package/dist/lib/thread-selection.cjs +36 -0
  21. package/dist/lib/thread-selection.cjs.map +1 -0
  22. package/dist/lib/thread-selection.mjs +35 -0
  23. package/dist/lib/thread-selection.mjs.map +1 -0
  24. package/dist/package.cjs +1 -1
  25. package/dist/package.mjs +1 -1
  26. package/dist/styles/generated.cjs +1 -1
  27. package/dist/styles/generated.cjs.map +1 -1
  28. package/dist/styles/generated.mjs +1 -1
  29. package/dist/styles/generated.mjs.map +1 -1
  30. package/package.json +9 -4
  31. package/CHANGELOG.md +0 -505
  32. package/dev/css-raw-import.spec.ts +0 -31
  33. package/dev/index.html +0 -115
  34. package/dev/main.ts +0 -165
  35. package/dev/vite.config.ts +0 -30
  36. package/src/__tests__/memory-recall.spec.ts +0 -76
  37. package/src/__tests__/telemetry-egress-guard.spec.ts +0 -41
  38. package/src/__tests__/web-inspector.spec.ts +0 -3935
  39. package/src/assets/inspector-logo-icon.svg +0 -8
  40. package/src/assets/inspector-logo.svg +0 -40
  41. package/src/components.d.ts +0 -20
  42. package/src/index.ts +0 -11849
  43. package/src/lib/__tests__/telemetry.test.ts +0 -557
  44. package/src/lib/context-helpers.ts +0 -166
  45. package/src/lib/persistence.ts +0 -206
  46. package/src/lib/telemetry.ts +0 -474
  47. package/src/lib/testing/telemetry-egress-guard.ts +0 -33
  48. package/src/lib/types.ts +0 -19
  49. package/src/styles/generated.css +0 -2
  50. package/src/styles/tailwind.css +0 -23
  51. package/src/types/css.d.ts +0 -4
  52. package/src/types/svg.d.ts +0 -4
  53. package/tsconfig.json +0 -14
  54. package/tsdown.config.ts +0 -45
  55. package/vitest.config.ts +0 -66
  56. package/vitest.setup.ts +0 -84
package/README.md CHANGED
@@ -1,21 +1,100 @@
1
1
  # @copilotkit/web-inspector
2
2
 
3
- ## Standalone Thread Inspector QA
3
+ ## Trusted project context
4
4
 
5
- Run the shared inspector without an app shell:
5
+ The Web Inspector reads optional `InspectorMetadataV1` data from
6
+ `@copilotkit/core`. It parses the value again at the UI boundary and renders each
7
+ valid module on its own:
6
8
 
7
- ```bash
8
- pnpm nx run @copilotkit/web-inspector:dev:standalone
9
- ```
9
+ - `identity` shows the organization and project in the account strip.
10
+ - `plan` shows the plan label in the account strip.
11
+ - `action` can show one trusted link in the Threads footer or locked Threads view.
12
+ - `usage` shows trusted Thread counts and expiry data in the Threads footer.
10
13
 
11
- Open [http://127.0.0.1:5177/](http://127.0.0.1:5177/).
14
+ Missing or invalid metadata hides these trusted modules. The existing tabs,
15
+ debug views, and Threads endpoint behavior remain available. A licensed Runtime
16
+ without Threads endpoints offers a static, docs-backed coding-agent prompt and
17
+ links to the public route setup guide.
12
18
 
13
- Validation steps:
19
+ The footer sits at the bottom of the Threads list sidebar. It stays out of the
20
+ account strip, other navigation groups, and Settings. Usage and the footer
21
+ action render on their own, so either module can appear without the other.
14
22
 
15
- 1. Confirm the initial `AG-UI events` scenario opens on the Timeline tab and renders run, message, and tool rows.
16
- 2. Click `Messages only` and confirm the first-visible Timeline renders persisted message content instead of an empty Timeline.
17
- 3. Click `Raw event only` and confirm the Timeline renders a `THREAD_STATE_WRITTEN` row with a source-event link.
18
- 4. Use a Timeline source-event link and confirm it opens the Raw AG-UI Events tab on the corresponding event.
19
- 5. Open the State tab and confirm the demo state is visible.
23
+ The primary navigation groups the Inspector into Threads, Agents, and Learning.
24
+ Metadata is display-only: it never authorizes or gates Thread work. Core starts
25
+ real Thread work only for object-valued `threadEndpoints` with `list !== false`.
26
+ Absent endpoints, literal `false`, or an endpoint object with `list: false`
27
+ produce zero list, subscribe, inspect, messages, events, and state requests.
20
28
 
21
- This harness uses demo provider data only. Manual product validation for Intelligence-backed threads still needs a real Intelligence backend.
29
+ ### License and action matrix
30
+
31
+ | Effective license state | Threads footer | Locked Threads view |
32
+ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
33
+ | `valid` | Shows `Manage Your Plan` below 90% finite usage and a purple `Upgrade Your Plan` at 90% or higher for a trusted `manage_plan` action | Copies a coding-agent repair prompt and links to the Rich Threads route setup guide when the Runtime has no Threads endpoints |
34
+ | `none` | No footer action | Shows `Enable Intelligence` only for a trusted `enable_intelligence` action |
35
+ | `expired` | No footer action | Shows `Renew` for `renew`, or `Manage Your Plan` for `manage_plan` |
36
+ | `unknown` | No footer action | Uses neutral unavailable copy with no action |
37
+
38
+ Finite usage shows `used / limit Threads` with a native progress bar. The bar is
39
+ green below 90%, orange from 90% up to the limit, and red at or above the limit.
40
+ At 90%, a trusted `manage_plan` footer link changes from `Manage Your Plan` to
41
+ the purple `Upgrade Your Plan` action without changing its URL or action kind. An overage shows
42
+ `limit+ / limit Threads` and caps the bar at 100%. Unlimited limits use text
43
+ only. An unknown limit shows the trusted used count with `Limit unavailable`;
44
+ it invents neither a numeric limit nor progress. A known zero expiry count stays
45
+ visible; missing or malformed expiry data stays hidden.
46
+
47
+ `Expiring Soon` describes a future retention-policy threshold in the next 24
48
+ hours. The Inspector does not enforce retention, lock or delete Threads, or run
49
+ the thread culler.
50
+
51
+ Managed Enterprise metadata has no manage-plan action, and Team Self-Hosted
52
+ metadata has no hosted action. Any supplied action must match the effective
53
+ license state and action kind in the matrix above.
54
+
55
+ The Inspector compares metadata license state with `licenseStatus` from the
56
+ runtime-info response. If both are known and disagree, it uses the Runtime
57
+ status for copy and hides the action. This avoids sending a user to an action
58
+ that does not match the runtime's current state without hiding valid usage.
59
+
60
+ Every action opens the exact URL accepted by the shared parser. The Inspector
61
+ does not add query parameters, derive URLs from names or IDs, or provide a
62
+ hard-coded signup fallback for the locked Threads metadata action.
63
+
64
+ ### Thread selection stays unchanged
65
+
66
+ Metadata arrival, refresh, failure, and removal do not select or reselect a
67
+ thread. The Inspector keeps the existing selected row and detail view.
68
+
69
+ ### Mixed versions
70
+
71
+ | Combination | Result |
72
+ | ---------------------------------------------- | --------------------------------------------------------------------------------------------- |
73
+ | Old producer with new Shared and Runtime | V1 usage remains valid without `expiringSoonCount`; expiry stays absent. |
74
+ | New producer with pre-expiry Shared or Runtime | The older consumer ignores or removes the additive expiry leaf and keeps valid base V1 usage. |
75
+ | Old App API with new Runtime | The provider `404` becomes a private `204`; Core stays connected and metadata stays absent. |
76
+ | New App API with old Runtime | The Runtime makes no metadata request, and the current Inspector behavior stays unchanged. |
77
+ | New Runtime or Core with old Inspector | The old Inspector ignores metadata it does not render. |
78
+ | New Inspector with old Core or Runtime | The Inspector feature-detects support and renders the safe missing-metadata fallback. |
79
+
80
+ These combinations do not require synchronized deployment. Roll out the
81
+ Intelligence producer first, then release each consumer when ready. Explicit
82
+ `threadEndpoints` remain the authority in every mix; metadata never enables
83
+ Thread work, and a license conflict suppresses an incompatible action without
84
+ suppressing valid usage.
85
+
86
+ ### Privacy allowlist
87
+
88
+ The UI may render only the parsed organization name, project name, plan label,
89
+ license bucket, action kind, trusted action URL, and trusted Thread usage fields:
90
+ used count, limit kind and value, and expiry count. Metadata telemetry is
91
+ coarse: its feature-specific properties may include only `module`,
92
+ `action_kind`, `license_bucket`, `usage_bucket`, `expiry_bucket`, `group_key`,
93
+ `leaf_key`, and `action_placement`. It must never copy exact usage, limits,
94
+ expiry counts, content, names, URLs, or Thread, agent, message, account, project,
95
+ or other product IDs into those events. It retains only the anonymous
96
+ identifiers already used by Inspector telemetry.
97
+
98
+ The usage UI does not add usage impressions or values to telemetry. Grouped
99
+ Inspector navigation shows the footer only on Threads. The existing metadata
100
+ action impression and click events keep their coarse allowlist.