@copilotkit/shared 2.0.0-rc.3 → 2.0.0-rc.30

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 (287) hide show
  1. package/README.md +3 -14
  2. package/dist/a2ui-envelope.cjs +2 -2
  3. package/dist/a2ui-envelope.cjs.map +1 -1
  4. package/dist/a2ui-envelope.d.cts +1 -1
  5. package/dist/a2ui-envelope.d.cts.map +1 -1
  6. package/dist/a2ui-envelope.d.mts +1 -1
  7. package/dist/a2ui-envelope.d.mts.map +1 -1
  8. package/dist/a2ui-envelope.mjs +2 -2
  9. package/dist/a2ui-envelope.mjs.map +1 -1
  10. package/dist/a2ui-prompts.cjs +21 -62
  11. package/dist/a2ui-prompts.cjs.map +1 -1
  12. package/dist/a2ui-prompts.d.cts +8 -1
  13. package/dist/a2ui-prompts.d.cts.map +1 -1
  14. package/dist/a2ui-prompts.d.mts +8 -1
  15. package/dist/a2ui-prompts.d.mts.map +1 -1
  16. package/dist/a2ui-prompts.mjs +22 -62
  17. package/dist/a2ui-prompts.mjs.map +1 -1
  18. package/dist/attachments/types.d.cts +1 -3
  19. package/dist/attachments/types.d.cts.map +1 -1
  20. package/dist/attachments/types.d.mts +1 -3
  21. package/dist/attachments/types.d.mts.map +1 -1
  22. package/dist/attachments/utils.cjs +16 -5
  23. package/dist/attachments/utils.cjs.map +1 -1
  24. package/dist/attachments/utils.d.cts +3 -1
  25. package/dist/attachments/utils.d.cts.map +1 -1
  26. package/dist/attachments/utils.d.mts +3 -1
  27. package/dist/attachments/utils.d.mts.map +1 -1
  28. package/dist/attachments/utils.mjs +16 -5
  29. package/dist/attachments/utils.mjs.map +1 -1
  30. package/dist/finalize-events.cjs +16 -0
  31. package/dist/finalize-events.cjs.map +1 -1
  32. package/dist/finalize-events.d.cts.map +1 -1
  33. package/dist/finalize-events.d.mts.map +1 -1
  34. package/dist/finalize-events.mjs +16 -0
  35. package/dist/finalize-events.mjs.map +1 -1
  36. package/dist/generative-ui/basic-functions.cjs +1 -1
  37. package/dist/generative-ui/basic-functions.cjs.map +1 -1
  38. package/dist/generative-ui/basic-functions.mjs +1 -1
  39. package/dist/generative-ui/basic-functions.mjs.map +1 -1
  40. package/dist/generative-ui/child-refs.cjs +3 -3
  41. package/dist/generative-ui/child-refs.cjs.map +1 -1
  42. package/dist/generative-ui/child-refs.d.cts.map +1 -1
  43. package/dist/generative-ui/child-refs.d.mts.map +1 -1
  44. package/dist/generative-ui/child-refs.mjs +3 -3
  45. package/dist/generative-ui/child-refs.mjs.map +1 -1
  46. package/dist/generative-ui/compact-schema.cjs +187 -0
  47. package/dist/generative-ui/compact-schema.cjs.map +1 -0
  48. package/dist/generative-ui/compact-schema.d.cts +55 -0
  49. package/dist/generative-ui/compact-schema.d.cts.map +1 -0
  50. package/dist/generative-ui/compact-schema.d.mts +55 -0
  51. package/dist/generative-ui/compact-schema.d.mts.map +1 -0
  52. package/dist/generative-ui/compact-schema.mjs +185 -0
  53. package/dist/generative-ui/compact-schema.mjs.map +1 -0
  54. package/dist/generative-ui/prompt-spec.cjs +225 -0
  55. package/dist/generative-ui/prompt-spec.cjs.map +1 -0
  56. package/dist/generative-ui/prompt-spec.d.cts +94 -0
  57. package/dist/generative-ui/prompt-spec.d.cts.map +1 -0
  58. package/dist/generative-ui/prompt-spec.d.mts +94 -0
  59. package/dist/generative-ui/prompt-spec.d.mts.map +1 -0
  60. package/dist/generative-ui/prompt-spec.mjs +220 -0
  61. package/dist/generative-ui/prompt-spec.mjs.map +1 -0
  62. package/dist/generative-ui/prompt.cjs +10 -36
  63. package/dist/generative-ui/prompt.cjs.map +1 -1
  64. package/dist/generative-ui/prompt.d.cts +2 -1
  65. package/dist/generative-ui/prompt.d.cts.map +1 -1
  66. package/dist/generative-ui/prompt.d.mts +2 -1
  67. package/dist/generative-ui/prompt.d.mts.map +1 -1
  68. package/dist/generative-ui/prompt.mjs +12 -38
  69. package/dist/generative-ui/prompt.mjs.map +1 -1
  70. package/dist/generative-ui/render-ui-args.cjs +1 -0
  71. package/dist/generative-ui/render-ui-args.cjs.map +1 -1
  72. package/dist/generative-ui/render-ui-args.d.cts.map +1 -1
  73. package/dist/generative-ui/render-ui-args.d.mts.map +1 -1
  74. package/dist/generative-ui/render-ui-args.mjs +1 -0
  75. package/dist/generative-ui/render-ui-args.mjs.map +1 -1
  76. package/dist/generative-ui/schema-render.cjs +242 -0
  77. package/dist/generative-ui/schema-render.cjs.map +1 -0
  78. package/dist/generative-ui/schema-render.d.cts +44 -0
  79. package/dist/generative-ui/schema-render.d.cts.map +1 -0
  80. package/dist/generative-ui/schema-render.d.mts +44 -0
  81. package/dist/generative-ui/schema-render.d.mts.map +1 -0
  82. package/dist/generative-ui/schema-render.mjs +239 -0
  83. package/dist/generative-ui/schema-render.mjs.map +1 -0
  84. package/dist/generative-ui/types.cjs +2 -2
  85. package/dist/generative-ui/types.cjs.map +1 -1
  86. package/dist/generative-ui/types.d.cts +7 -7
  87. package/dist/generative-ui/types.d.cts.map +1 -1
  88. package/dist/generative-ui/types.d.mts +7 -7
  89. package/dist/generative-ui/types.d.mts.map +1 -1
  90. package/dist/generative-ui/types.mjs +2 -2
  91. package/dist/generative-ui/types.mjs.map +1 -1
  92. package/dist/generative-ui/validate-operation.cjs +2 -2
  93. package/dist/generative-ui/validate-operation.cjs.map +1 -1
  94. package/dist/generative-ui/validate-operation.mjs +2 -2
  95. package/dist/generative-ui/validate-operation.mjs.map +1 -1
  96. package/dist/index.cjs +16 -15
  97. package/dist/index.cjs.map +1 -1
  98. package/dist/index.d.cts +10 -10
  99. package/dist/index.d.cts.map +1 -1
  100. package/dist/index.d.mts +10 -10
  101. package/dist/index.d.mts.map +1 -1
  102. package/dist/index.mjs +9 -8
  103. package/dist/index.mjs.map +1 -1
  104. package/dist/index.umd.js +866 -455
  105. package/dist/index.umd.js.map +1 -1
  106. package/dist/package.cjs +1 -1
  107. package/dist/package.mjs +1 -1
  108. package/dist/standard-schema.cjs +20 -7
  109. package/dist/standard-schema.cjs.map +1 -1
  110. package/dist/standard-schema.d.cts +15 -16
  111. package/dist/standard-schema.d.cts.map +1 -1
  112. package/dist/standard-schema.d.mts +15 -16
  113. package/dist/standard-schema.d.mts.map +1 -1
  114. package/dist/standard-schema.mjs +20 -8
  115. package/dist/standard-schema.mjs.map +1 -1
  116. package/dist/telemetry/lambda-client.cjs +1 -1
  117. package/dist/telemetry/lambda-client.cjs.map +1 -1
  118. package/dist/telemetry/lambda-client.d.cts.map +1 -1
  119. package/dist/telemetry/lambda-client.d.mts.map +1 -1
  120. package/dist/telemetry/lambda-client.mjs +1 -1
  121. package/dist/telemetry/lambda-client.mjs.map +1 -1
  122. package/dist/telemetry/telemetry-disabled.cjs +0 -5
  123. package/dist/telemetry/telemetry-disabled.cjs.map +1 -1
  124. package/dist/telemetry/telemetry-disabled.d.cts +0 -5
  125. package/dist/telemetry/telemetry-disabled.d.cts.map +1 -1
  126. package/dist/telemetry/telemetry-disabled.d.mts +0 -5
  127. package/dist/telemetry/telemetry-disabled.d.mts.map +1 -1
  128. package/dist/telemetry/telemetry-disabled.mjs +0 -5
  129. package/dist/telemetry/telemetry-disabled.mjs.map +1 -1
  130. package/dist/types/message.d.cts +1 -18
  131. package/dist/types/message.d.cts.map +1 -1
  132. package/dist/types/message.d.mts +1 -18
  133. package/dist/types/message.d.mts.map +1 -1
  134. package/dist/utils/errors.cjs +5 -42
  135. package/dist/utils/errors.cjs.map +1 -1
  136. package/dist/utils/errors.d.cts +16 -34
  137. package/dist/utils/errors.d.cts.map +1 -1
  138. package/dist/utils/errors.d.mts +16 -34
  139. package/dist/utils/errors.d.mts.map +1 -1
  140. package/dist/utils/errors.mjs +6 -41
  141. package/dist/utils/errors.mjs.map +1 -1
  142. package/dist/utils/index.cjs +0 -2
  143. package/dist/utils/index.cjs.map +1 -1
  144. package/dist/utils/index.d.cts +4 -6
  145. package/dist/utils/index.d.cts.map +1 -1
  146. package/dist/utils/index.d.mts +4 -6
  147. package/dist/utils/index.d.mts.map +1 -1
  148. package/dist/utils/index.mjs +4 -6
  149. package/dist/utils/index.mjs.map +1 -1
  150. package/dist/utils/inspector-visibility.cjs +25 -3
  151. package/dist/utils/inspector-visibility.cjs.map +1 -1
  152. package/dist/utils/inspector-visibility.d.cts +26 -3
  153. package/dist/utils/inspector-visibility.d.cts.map +1 -1
  154. package/dist/utils/inspector-visibility.d.mts +26 -3
  155. package/dist/utils/inspector-visibility.d.mts.map +1 -1
  156. package/dist/utils/inspector-visibility.mjs +25 -4
  157. package/dist/utils/inspector-visibility.mjs.map +1 -1
  158. package/dist/utils/json-schema.cjs +4 -79
  159. package/dist/utils/json-schema.cjs.map +1 -1
  160. package/dist/utils/json-schema.d.cts +1 -4
  161. package/dist/utils/json-schema.d.cts.map +1 -1
  162. package/dist/utils/json-schema.d.mts +1 -4
  163. package/dist/utils/json-schema.d.mts.map +1 -1
  164. package/dist/utils/json-schema.mjs +5 -78
  165. package/dist/utils/json-schema.mjs.map +1 -1
  166. package/dist/utils/random-id.cjs +13 -26
  167. package/dist/utils/random-id.cjs.map +1 -1
  168. package/dist/utils/random-id.d.cts +6 -3
  169. package/dist/utils/random-id.d.cts.map +1 -1
  170. package/dist/utils/random-id.d.mts +6 -3
  171. package/dist/utils/random-id.d.mts.map +1 -1
  172. package/dist/utils/random-id.mjs +14 -25
  173. package/dist/utils/random-id.mjs.map +1 -1
  174. package/package.json +10 -34
  175. package/scripts/verify-cjs-exports.cjs +1 -1
  176. package/src/__tests__/a2ui-envelope.test.ts +18 -13
  177. package/src/__tests__/a2ui-prompts.test.ts +47 -14
  178. package/src/__tests__/fixtures/prompt-goldens.json +354 -0
  179. package/src/__tests__/prompt-spec.test.ts +191 -0
  180. package/src/__tests__/root-entry-browser-safety.test.ts +5 -7
  181. package/src/__tests__/schema-render.test.ts +245 -0
  182. package/src/__tests__/standard-schema.test.ts +61 -101
  183. package/src/a2ui-envelope.ts +7 -6
  184. package/src/a2ui-prompts.ts +47 -96
  185. package/src/attachments/__tests__/utils.test.ts +22 -0
  186. package/src/attachments/types.ts +1 -3
  187. package/src/attachments/utils.ts +23 -5
  188. package/src/finalize-events.ts +16 -0
  189. package/src/generative-ui/__tests__/render-ui-args.test.ts +7 -7
  190. package/src/generative-ui/__tests__/validate-operation.test.ts +19 -13
  191. package/src/generative-ui/basic-functions.ts +1 -1
  192. package/src/generative-ui/child-refs.ts +5 -4
  193. package/src/generative-ui/compact-schema.ts +277 -0
  194. package/src/generative-ui/index.ts +3 -0
  195. package/src/generative-ui/prompt-spec.ts +335 -0
  196. package/src/generative-ui/prompt.ts +25 -75
  197. package/src/generative-ui/render-ui-args.ts +3 -0
  198. package/src/generative-ui/schema-render.ts +377 -0
  199. package/src/generative-ui/types.ts +10 -7
  200. package/src/generative-ui/validate-operation.ts +2 -2
  201. package/src/index.ts +3 -16
  202. package/src/standard-schema.ts +24 -27
  203. package/src/telemetry/lambda-client.ts +8 -3
  204. package/src/telemetry/model-host.test.ts +2 -5
  205. package/src/telemetry/telemetry-disabled.ts +0 -5
  206. package/src/types/message.ts +1 -19
  207. package/src/utils/__tests__/errors.test.ts +44 -0
  208. package/src/utils/__tests__/json-schema.test.ts +3 -479
  209. package/src/utils/__tests__/random-id.test.ts +37 -0
  210. package/src/utils/errors.ts +28 -85
  211. package/src/utils/index.ts +0 -2
  212. package/src/utils/inspector-visibility.test.ts +26 -0
  213. package/src/utils/inspector-visibility.ts +35 -3
  214. package/src/utils/json-schema.ts +5 -152
  215. package/src/utils/random-id.ts +17 -37
  216. package/tsconfig.json +3 -1
  217. package/tsdown.config.ts +2 -19
  218. package/dist/event-transforms/index.cjs +0 -15
  219. package/dist/event-transforms/index.d.cts +0 -4
  220. package/dist/event-transforms/index.d.mts +0 -4
  221. package/dist/event-transforms/index.mjs +0 -5
  222. package/dist/event-transforms/open-generative-ui-middleware.cjs +0 -286
  223. package/dist/event-transforms/open-generative-ui-middleware.cjs.map +0 -1
  224. package/dist/event-transforms/open-generative-ui-middleware.d.cts +0 -60
  225. package/dist/event-transforms/open-generative-ui-middleware.d.cts.map +0 -1
  226. package/dist/event-transforms/open-generative-ui-middleware.d.mts +0 -60
  227. package/dist/event-transforms/open-generative-ui-middleware.d.mts.map +0 -1
  228. package/dist/event-transforms/open-generative-ui-middleware.mjs +0 -283
  229. package/dist/event-transforms/open-generative-ui-middleware.mjs.map +0 -1
  230. package/dist/event-transforms/recorded-events.cjs +0 -59
  231. package/dist/event-transforms/recorded-events.cjs.map +0 -1
  232. package/dist/event-transforms/recorded-events.d.cts +0 -23
  233. package/dist/event-transforms/recorded-events.d.cts.map +0 -1
  234. package/dist/event-transforms/recorded-events.d.mts +0 -23
  235. package/dist/event-transforms/recorded-events.d.mts.map +0 -1
  236. package/dist/event-transforms/recorded-events.mjs +0 -58
  237. package/dist/event-transforms/recorded-events.mjs.map +0 -1
  238. package/dist/telemetry/events.d.cts +0 -72
  239. package/dist/telemetry/events.d.cts.map +0 -1
  240. package/dist/telemetry/events.d.mts +0 -72
  241. package/dist/telemetry/events.d.mts.map +0 -1
  242. package/dist/telemetry/index.cjs +0 -18
  243. package/dist/telemetry/index.d.cts +0 -5
  244. package/dist/telemetry/index.d.mts +0 -5
  245. package/dist/telemetry/index.mjs +0 -6
  246. package/dist/telemetry/telemetry-client.cjs +0 -165
  247. package/dist/telemetry/telemetry-client.cjs.map +0 -1
  248. package/dist/telemetry/telemetry-client.d.cts +0 -87
  249. package/dist/telemetry/telemetry-client.d.cts.map +0 -1
  250. package/dist/telemetry/telemetry-client.d.mts +0 -87
  251. package/dist/telemetry/telemetry-client.d.mts.map +0 -1
  252. package/dist/telemetry/telemetry-client.mjs +0 -164
  253. package/dist/telemetry/telemetry-client.mjs.map +0 -1
  254. package/dist/telemetry/utils.cjs +0 -14
  255. package/dist/telemetry/utils.cjs.map +0 -1
  256. package/dist/telemetry/utils.mjs +0 -13
  257. package/dist/telemetry/utils.mjs.map +0 -1
  258. package/dist/utils/conditions.cjs +0 -32
  259. package/dist/utils/conditions.cjs.map +0 -1
  260. package/dist/utils/conditions.d.cts +0 -31
  261. package/dist/utils/conditions.d.cts.map +0 -1
  262. package/dist/utils/conditions.d.mts +0 -31
  263. package/dist/utils/conditions.d.mts.map +0 -1
  264. package/dist/utils/conditions.mjs +0 -31
  265. package/dist/utils/conditions.mjs.map +0 -1
  266. package/dist/utils/console-styling.cjs +0 -91
  267. package/dist/utils/console-styling.cjs.map +0 -1
  268. package/dist/utils/console-styling.d.cts +0 -65
  269. package/dist/utils/console-styling.d.cts.map +0 -1
  270. package/dist/utils/console-styling.d.mts +0 -65
  271. package/dist/utils/console-styling.d.mts.map +0 -1
  272. package/dist/utils/console-styling.mjs +0 -85
  273. package/dist/utils/console-styling.mjs.map +0 -1
  274. package/src/__tests__/zod-regression.test.ts +0 -319
  275. package/src/event-transforms/index.ts +0 -5
  276. package/src/event-transforms/open-generative-ui-middleware.ts +0 -392
  277. package/src/event-transforms/recorded-events.test.ts +0 -166
  278. package/src/event-transforms/recorded-events.ts +0 -74
  279. package/src/telemetry/events.ts +0 -68
  280. package/src/telemetry/index.ts +0 -9
  281. package/src/telemetry/telemetry-blank-license-identity.test.ts +0 -128
  282. package/src/telemetry/telemetry-client.test.ts +0 -798
  283. package/src/telemetry/telemetry-client.ts +0 -328
  284. package/src/telemetry/utils.ts +0 -15
  285. package/src/utils/__tests__/conditions.test.ts +0 -161
  286. package/src/utils/conditions.ts +0 -116
  287. package/src/utils/console-styling.ts +0 -126
@@ -1,12 +1,13 @@
1
- import {
2
- GENERATIVE_UI_WHEN_TO_SHOW,
3
- generativeUIGuideFeatures,
4
- } from "../a2ui-prompts";
1
+ import { generativeUIGuideFeatures } from "../a2ui-prompts";
5
2
  import { functionCallers } from "./basic-functions";
6
3
  import {
7
- GENERATIVE_UI_AGENT_FUNCTION_CALLS,
8
- GENERATIVE_UI_RENDER_TOOL,
9
- } from "./types";
4
+ defaultGenerativeUIPromptSpec,
5
+ generativeUIPromptFeatures,
6
+ selectPromptItems,
7
+ } from "./prompt-spec";
8
+ import type { GenerativeUIPromptSpec } from "./prompt-spec";
9
+ import { renderGenerativeUIComponentList } from "./schema-render";
10
+ import { GENERATIVE_UI_AGENT_FUNCTION_CALLS } from "./types";
10
11
  import type { GenerativeUIManifest } from "./types";
11
12
 
12
13
  export const GENERATIVE_UI_CONTEXT_DESCRIPTION =
@@ -27,7 +28,10 @@ function shorten(text: string) {
27
28
  * the `render_ui` rules, the targets, components, functions, and surfaces of
28
29
  * the manifest. It is in shared so that the inspector shows the same text.
29
30
  */
30
- export function buildGenerativeUIPrompt(manifest: GenerativeUIManifest) {
31
+ export function buildGenerativeUIPrompt(
32
+ manifest: GenerativeUIManifest,
33
+ spec: GenerativeUIPromptSpec = defaultGenerativeUIPromptSpec(),
34
+ ) {
31
35
  const targets = manifest.targets
32
36
  .map((t) => {
33
37
  const place =
@@ -41,18 +45,10 @@ export function buildGenerativeUIPrompt(manifest: GenerativeUIManifest) {
41
45
  return `- "${t.id}" (${place}${limit})${description}`;
42
46
  })
43
47
  .join("\n");
44
- const components = Object.entries(manifest.components)
45
- .map(([name, c]) => {
46
- const lines = [
47
- `- **${name}**${c.description ? `: ${c.description}` : ""}`,
48
- ` props: ${JSON.stringify(c.props)}`,
49
- ];
50
- if (c.events) lines.push(` event props: ${JSON.stringify(c.events)}`);
51
- if (c.slots)
52
- lines.push(` slot props (component ids): ${JSON.stringify(c.slots)}`);
53
- return lines.join("\n");
54
- })
55
- .join("\n");
48
+ const components = renderGenerativeUIComponentList(
49
+ manifest.components,
50
+ spec.schema.tool,
51
+ );
56
52
  const functions = Object.entries(manifest.functions)
57
53
  .map(([name, f]) => {
58
54
  // A built-in function carries its short signature in the description
@@ -103,65 +99,19 @@ export function buildGenerativeUIPrompt(manifest: GenerativeUIManifest) {
103
99
 
104
100
  // Rules for functions, events, and templates go only to runs whose manifest
105
101
  // has them, so the guide stays small.
106
- const {
107
- functions: hasFunctions,
108
- events,
109
- templates,
110
- checks,
111
- } = generativeUIGuideFeatures(manifest);
112
- // The agent calls functions only while that path is on.
113
- const agentCalls = hasFunctions && GENERATIVE_UI_AGENT_FUNCTION_CALLS;
114
- const operations = [
115
- '{"version":"v1.0","createSurface":{"surfaceId":"<new id>","dataModel":{...},"components":[{"id":"root","component":"<Name>","children":["<child id>"]}]}}: the first operation of a new surface. "dataModel" and "components" are optional.',
116
- '{"version":"v1.0","updateComponents":{"surfaceId":"<id>","components":[<component>, ...]}}: add or replace components by id.',
117
- '{"version":"v1.0","updateDataModel":{"surfaceId":"<id>","path":"/some/path","value":<json>}}: set the value at "path". Always give "value". "value":null deletes the key at "path".',
118
- '{"version":"v1.0","deleteSurface":{"surfaceId":"<id>"}}: remove the surface.',
119
- ...(agentCalls
120
- ? [
121
- '{"version":"v1.0","callRendererFunction":{"functionCallId":"<unique id>","callFunction":{"@call":"<function>","args":{...}}}}: run an app function now, with no click. It needs no surface.',
122
- ]
123
- : []),
124
- ];
125
- const eventRule = hasFunctions
126
- ? 'Event props take an action. {"functionCall":{"@call":"<function>","args":{...}}} runs an app function in the browser immediately, and you are not told about it. {"event":{"name":"<name>","userMessage":"<text>","context":{...}}} sends the interaction back to you as a user message, with "userMessage" as its first line. "userMessage" is plain text: ${...} is not interpolated in it; put values in "context". Only call functions listed below.'
127
- : 'Event props take an action: {"event":{"name":"<name>","userMessage":"<text>","context":{...}}} sends the interaction back to you as a user message, with "userMessage" as its first line. "userMessage" is plain text: ${...} is not interpolated in it; put values in "context".';
128
- const rules = [
129
- 'Components are flat objects: {"id":"...","component":"<Name>", ...props}. Every surface renders from the component with id "root". Reference children by id in slot props.',
130
- 'A component may take "accessibility":{"label":"<1 to 3 words>","description":"<what it does>"} for screen readers: on the component it describes, when nothing visible names it. Not on every component, and "live":"polite" only on text that changes by itself.',
131
- 'Stream progressively: put the initial data in "dataModel" and the root in "components" of the createSurface operation, then send one updateComponents operation per child, so the UI appears while you are still writing. The root must already list the ids of its children in its slot props (for example "children":["card-1","card-2"]), even though the children come later. A component that no slot references is never shown.',
132
- "Updating a component replaces all of its props, so resend every prop.",
133
- 'Prop values are literals or data bindings {"@path":"/data/path"}. Never write {"path":"/data/path"} as a binding.',
134
- ...(events ? [eventRule] : []),
135
- "To show a different view, create a new surface with a new surfaceId (for example, a checkout form after a cart summary). Update an existing surface only when the user asks to change that same view: then do not send createSurface, use its surfaceId, and pass its existing target. Never reuse an earlier chat surface for a different view, because that replaces the earlier UI and anything the user typed into it.",
136
- "Never use a surfaceId again, also after deleteSurface.",
137
- 'A prop can also be a function value that updates with the data: {"@call":"formatCurrency","args":{"value":{"@path":"/total"},"currency":"EUR"}}. Only call functions listed below. formatString interpolates ${/path} and ${fn(arg: value)} in its value.',
138
- '${...} is evaluated only in the value of formatString and in the item of series; in other strings it stays literal text. Inside formatString, ${...} does not support operators. For arithmetic use calc, with the values as named args: {"@call":"calc","args":{"expression":"seats * 29 * (annual ? 0.8 : 1)","seats":{"@path":"/seats"},"annual":{"@path":"/annual"}}}.',
139
- "For a computed list (chart data, template items) use series. Its description under Functions gives the rules and an example.",
140
- ...(checks
141
- ? [
142
- 'Validate an input with "checks": [{"condition":{"@call":"email","args":{"value":{"@path":"/form/email"}}},"message":"Enter a valid email"}]. The check functions are required, regex, length, numeric and email. A failed check shows the message under the input and disables a Button that has the same checks.',
143
- ]
144
- : []),
145
- ...(templates
146
- ? [
147
- 'To repeat a component for each item of a list, give a multiple slot a template: "children":{"componentId":"row","path":"/items"}. Inside the template, paths are relative to the item ("name", not "/name"). {"@call":"@index"} gives the position of the item, from 0; {"@call":"@index","args":{"offset":1}} counts from 1.',
148
- ]
149
- : []),
150
- ...(agentCalls
151
- ? [
152
- "Give every callRendererFunction a new functionCallId. Call only a function marked (UI or agent) or (agent only); a function with no mark is for the UI only. A function marked (agent only) is only for callRendererFunction: do not bind an event to it.",
153
- 'The result of a callRendererFunction comes back to you in a new turn, as a developer message: {"version":"v1.0","rendererFunctionResponse":{"functionCallId":"<id>","value":...}}. If the call failed, it has "error" in place of "value". Do not wait for the result in this reply, and do not guess it.',
154
- ]
155
- : []),
156
- ];
102
+ const features = generativeUIPromptFeatures(
103
+ generativeUIGuideFeatures(manifest),
104
+ );
105
+ const { intro, whenToShow } = spec.tool;
106
+ const operations = selectPromptItems(spec.tool.operations ?? [], features);
107
+ const rules = selectPromptItems(spec.tool.rules, features);
108
+ const when = whenToShow ? `${whenToShow}\n\n` : "";
157
109
 
158
110
  return [
159
111
  `## Generative UI
160
- Call \`${GENERATIVE_UI_RENDER_TOOL}\` to show UI. Arguments: \`target\` first, then \`operations\` (A2UI v1.0 operations, applied in order).
161
-
162
- ${GENERATIVE_UI_WHEN_TO_SHOW}
112
+ ${intro}
163
113
 
164
- Every operation has "version":"v1.0" and exactly one of:
114
+ ${when}Every operation has "version":"1.0" and exactly one of:
165
115
  ${operations.map((op) => `- ${op}`).join("\n")}
166
116
 
167
117
  Rules:
@@ -140,6 +140,9 @@ class RenderUIArgsScanner {
140
140
  expectingValue = false;
141
141
  }
142
142
  break;
143
+ case undefined:
144
+ // Unreachable: `i < text.length`, so `text[i]` is always a char.
145
+ break;
143
146
  }
144
147
  }
145
148
  this.inString = inString;
@@ -0,0 +1,377 @@
1
+ import { functionCallers } from "./basic-functions";
2
+ import {
3
+ buildCompactGenerativeUISchema,
4
+ compactProps,
5
+ compactType,
6
+ } from "./compact-schema";
7
+ import type { GenerativeUISchemaSettings } from "./prompt-spec";
8
+ import { GENERATIVE_UI_AGENT_FUNCTION_CALLS } from "./types";
9
+ import type {
10
+ GenerativeUIComponentManifest,
11
+ GenerativeUIJSONSchema,
12
+ GenerativeUIManifest,
13
+ } from "./types";
14
+
15
+ type SchemaManifest = Pick<
16
+ GenerativeUIManifest,
17
+ "catalogId" | "components" | "functions" | "targets" | "surfaces"
18
+ >;
19
+
20
+ /** An own key (shared compiles to ES2017, which has no Object.hasOwn). */
21
+ const hasOwn = (target: object, key: string) =>
22
+ Object.prototype.hasOwnProperty.call(target, key);
23
+
24
+ function isRecord(value: unknown): value is Record<string, unknown> {
25
+ return typeof value === "object" && value !== null && !Array.isArray(value);
26
+ }
27
+
28
+ /** The props schema without the description of each prop. */
29
+ function withoutPropDescriptions(
30
+ schema: GenerativeUIJSONSchema,
31
+ ): GenerativeUIJSONSchema {
32
+ if (!isRecord(schema.properties)) return schema;
33
+ return {
34
+ ...schema,
35
+ properties: Object.fromEntries(
36
+ Object.entries(schema.properties).map(([key, value]) => {
37
+ if (!isRecord(value)) return [key, value];
38
+ const { description: _description, ...rest } = value;
39
+ return [key, rest];
40
+ }),
41
+ ),
42
+ };
43
+ }
44
+
45
+ /** The short signature of a function: its built-in signature, or its schema made short. */
46
+ function functionSignature(fn: GenerativeUIManifest["functions"][string]) {
47
+ const signature = fn.parameters.description;
48
+ const hasSignature =
49
+ typeof signature === "string" &&
50
+ signature.startsWith("{") &&
51
+ Object.keys(fn.parameters).length === 2;
52
+ return hasSignature ? signature : compactType(fn.parameters, 0);
53
+ }
54
+
55
+ /**
56
+ * A function name with its parameters: `pick{ id: string }`, `clearCart{}`
57
+ * for no arguments, `setVolume(number)` for a parameter that is not an object.
58
+ */
59
+ function nameWithParameters(name: string, parameters: string) {
60
+ if (parameters.startsWith("{")) return `${name}${parameters}`;
61
+ if (parameters === "object") return `${name}{}`;
62
+ return `${name}(${parameters})`;
63
+ }
64
+
65
+ /**
66
+ * One component as a TypeScript-like signature line, with its events and
67
+ * slots on the lines below:
68
+ * `- Text(text?: string // The text): Shows text`.
69
+ */
70
+ function signatureLines(
71
+ name: string,
72
+ component: GenerativeUIComponentManifest,
73
+ settings: GenerativeUISchemaSettings,
74
+ ) {
75
+ const props = Object.entries(
76
+ compactProps(component.props, settings.propDescriptions),
77
+ ).map(([key, type]) => `${key}: ${type}`);
78
+ const lines = [
79
+ `- ${name}(${props.join(", ")})${component.description ? `: ${oneLine(component.description)}` : ""}`,
80
+ ];
81
+ const events = Object.entries(component.events ?? {}).map(
82
+ ([event, definition]) =>
83
+ `${event}(${definition.description ? oneLine(definition.description) : compactType(definition.parameters, 0)})`,
84
+ );
85
+ if (events.length > 0) lines.push(` events: ${events.join(", ")}`);
86
+ const slots = Object.entries(component.slots ?? {}).map(
87
+ ([slot, kind]) => `${slot} (${kind})`,
88
+ );
89
+ if (slots.length > 0) lines.push(` slots: ${slots.join(", ")}`);
90
+ return lines;
91
+ }
92
+
93
+ /** The whole schema as signature text: targets, functions, components, surfaces. */
94
+ function signatureSchema(
95
+ manifest: SchemaManifest,
96
+ settings: GenerativeUISchemaSettings,
97
+ ) {
98
+ const targets = manifest.targets.map((t) => {
99
+ const limit = t.components ? `; only ${t.components.join(", ")}` : "";
100
+ return `- ${t.id} (${t.kind}${limit})${t.description ? `: ${oneLine(t.description)}` : ""}`;
101
+ });
102
+ const functions = Object.entries(manifest.functions).map(([name, fn]) => {
103
+ const callers = functionCallers(fn);
104
+ const who =
105
+ callers.agent && GENERATIVE_UI_AGENT_FUNCTION_CALLS
106
+ ? callers.renderer
107
+ ? " (UI or agent)"
108
+ : " (agent only)"
109
+ : "";
110
+ return `- ${nameWithParameters(name, functionSignature(fn))}${who}${fn.description ? `: ${oneLine(fn.description)}` : ""}`;
111
+ });
112
+ const components = Object.entries(manifest.components).flatMap(
113
+ ([name, component]) => signatureLines(name, component, settings),
114
+ );
115
+ const surfaces = Object.entries(manifest.surfaces).map(
116
+ ([id, s]) =>
117
+ `- ${id} (target ${s.target})${s.status ? ` status: ${s.status}` : ""}${s.dataModel ? ` user values: ${JSON.stringify(s.dataModel)}` : ""}${(s.rejected ?? []).map((r) => ` rejected: ${r}`).join("")}`,
118
+ );
119
+ return [
120
+ `Catalog: ${manifest.catalogId}`,
121
+ `Targets:\n${targets.join("\n") || "- none"}`,
122
+ `Functions:\n${functions.join("\n") || "- none"}`,
123
+ `Components:\n${components.join("\n") || "- none"}`,
124
+ `Surfaces:\n${surfaces.join("\n") || "- none"}`,
125
+ ].join("\n\n");
126
+ }
127
+
128
+ /** A description on one line, so its lines cannot read as new entries. */
129
+ function oneLine(text: string) {
130
+ return text.replace(/\s*\n\s*/g, " ");
131
+ }
132
+
133
+ /** Values that would read as a type or a number once their quotes are gone. */
134
+ const AMBIGUOUS_VALUE =
135
+ /^(?:string|number|integer|boolean|true|false|null|object|array|unknown|any|-?\d[\d.]*)$/;
136
+
137
+ /**
138
+ * A compact type with bare enum values and tight unions:
139
+ * `"sm" | "md" | "lg"` becomes `sm|md|lg`. A union keeps its quotes when it
140
+ * also holds a type (`"sm" | number`) or a value that reads as a type or a
141
+ * number (`"number" | "currency"`, `"1" | "2"`), and so do values that are
142
+ * not plain words.
143
+ */
144
+ function bareType(type: string) {
145
+ return type
146
+ .replace(
147
+ /"[A-Za-z0-9_#%.-]+"(?: \| "[A-Za-z0-9_#%.-]+")*(?! \|)/g,
148
+ (union: string, offset: number, whole: string) => {
149
+ if (whole.slice(offset - 2, offset) === "| ") return union;
150
+ const values = union.split(" | ").map((v) => v.slice(1, -1));
151
+ if (values.some((v) => AMBIGUOUS_VALUE.test(v))) return union;
152
+ return values.join("|");
153
+ },
154
+ )
155
+ .replace(/ \| /g, "|");
156
+ }
157
+
158
+ /** A compact prop (`type // description`) as `name: type - description`. */
159
+ function propLine(key: string, value: string) {
160
+ const name = key.endsWith("?") ? key.slice(0, -1) : `${key}*`;
161
+ const cut = value.indexOf(" // ");
162
+ const type = bareType(cut < 0 ? value : value.slice(0, cut));
163
+ const text = cut < 0 ? "" : value.slice(cut + 4).trim();
164
+ const description = text ? ` - ${oneLine(text)}` : "";
165
+ return ` ${name}: ${type}${description}`;
166
+ }
167
+
168
+ /**
169
+ * The whole schema as plain lines: a header line per component and one
170
+ * indented line per prop: events are `action` props and slots `componentId`
171
+ * or `childList` props. Props are optional unless marked `*`, enum values
172
+ * are bare, and the common props are listed once. It carries the same names, types and descriptions as
173
+ * `compact`, in fewer tokens.
174
+ */
175
+ function linesSchema(
176
+ manifest: SchemaManifest,
177
+ settings: GenerativeUISchemaSettings,
178
+ ) {
179
+ const compact = buildCompactGenerativeUISchema(manifest, {
180
+ propDescriptions: settings.propDescriptions,
181
+ commonProps: settings.commonProps,
182
+ });
183
+ const targets = compact.targets
184
+ .map((t) => {
185
+ const limit = t.components ? `, only ${t.components.join(", ")}` : "";
186
+ return `${t.id} (${t.kind}${limit})${t.description ? `: ${oneLine(t.description)}` : ""}`;
187
+ })
188
+ .join("; ");
189
+ const functions = Object.entries(compact.functions).map(
190
+ ([name, fn]) =>
191
+ `${nameWithParameters(name, fn.parameters)}${"callers" in fn ? ` (${fn.callers})` : ""}${fn.description ? `: ${oneLine(fn.description)}` : ""}`,
192
+ );
193
+ const common = compact.commonProps
194
+ ? Object.entries(compact.commonProps).map(([k, v]) => propLine(k, v))
195
+ : [];
196
+ const lineSets = Object.entries(compact.components).map(([name, c]) => ({
197
+ name,
198
+ c,
199
+ own: [
200
+ ...Object.entries(c.props).map(([k, v]) => propLine(k, v)),
201
+ ...Object.entries(c.events ?? {}).map(
202
+ ([e, d]) => ` ${e}: action - ${oneLine(d)}`,
203
+ ),
204
+ ],
205
+ }));
206
+ const components = lineSets.flatMap(({ name, c, own }) => {
207
+ const lines = [
208
+ `${name}${c.includesCommonProps ? " +common" : ""}${c.description ? `: ${oneLine(c.description)}` : ""}`,
209
+ ...own,
210
+ ];
211
+ // Slots are props that take component ids.
212
+ for (const [slot, kind] of Object.entries(c.slots ?? {})) {
213
+ lines.push(
214
+ ` ${slot}: ${kind === "single" ? "componentId" : "childList"}`,
215
+ );
216
+ }
217
+ return lines;
218
+ });
219
+ const surfaces = Object.keys(compact.surfaces).length
220
+ ? JSON.stringify(compact.surfaces)
221
+ : "none";
222
+ return [
223
+ `Catalog ${compact.catalogId}. Targets: ${targets || "none"}`,
224
+ 'Props are optional unless marked *. a|b|c is one of those strings, quoted when one reads as a type or a number. A component marked +common also takes every common prop. A prop of type action is an event prop: give it {"event":{...}} or {"functionCall":{...}}. A componentId prop takes one component id; a childList prop takes a list of ids or a template.',
225
+ `Functions:\n${functions.join("\n")}`,
226
+ ...(common.length ? [`Common props:\n${common.join("\n")}`] : []),
227
+ `Components:\n${components.join("\n")}`,
228
+ `Surfaces: ${surfaces}`,
229
+ ].join("\n\n");
230
+ }
231
+
232
+ /**
233
+ * The component schema of the markdown transport, as the text of its
234
+ * context entry, in the notation of `settings`. `compact` is the schema that
235
+ * ships (`buildCompactGenerativeUISchema`), `json-schema` the manifest parts
236
+ * as JSON, `ts-signature` one line per component, `lines` one line per
237
+ * prop with bare enums (the fewest tokens).
238
+ *
239
+ * @example
240
+ * ```ts
241
+ * const value = renderGenerativeUISchema(manifest, spec.schema.markdown);
242
+ * ```
243
+ */
244
+ export function renderGenerativeUISchema(
245
+ manifest: SchemaManifest,
246
+ settings: GenerativeUISchemaSettings,
247
+ ): string {
248
+ switch (settings.notation) {
249
+ case "compact":
250
+ return JSON.stringify(
251
+ buildCompactGenerativeUISchema(manifest, {
252
+ propDescriptions: settings.propDescriptions,
253
+ commonProps: settings.commonProps,
254
+ }),
255
+ );
256
+ case "json-schema": {
257
+ const components = Object.fromEntries(
258
+ Object.entries(manifest.components).map(([name, c]) => [
259
+ name,
260
+ settings.propDescriptions
261
+ ? c
262
+ : { ...c, props: withoutPropDescriptions(c.props) },
263
+ ]),
264
+ );
265
+ return JSON.stringify({
266
+ catalogId: manifest.catalogId,
267
+ targets: manifest.targets,
268
+ functions: manifest.functions,
269
+ components,
270
+ surfaces: manifest.surfaces,
271
+ });
272
+ }
273
+ case "ts-signature":
274
+ return signatureSchema(manifest, settings);
275
+ case "lines":
276
+ return linesSchema(manifest, settings);
277
+ }
278
+ }
279
+
280
+ /**
281
+ * The component list of the tool guide, one entry per component, in the
282
+ * notation of `settings`. `json-schema` is the list that ships.
283
+ */
284
+ export function renderGenerativeUIComponentList(
285
+ components: GenerativeUIManifest["components"],
286
+ settings: GenerativeUISchemaSettings,
287
+ ): string {
288
+ return Object.entries(components)
289
+ .map(([name, c]) => {
290
+ if (
291
+ settings.notation === "ts-signature" ||
292
+ settings.notation === "lines"
293
+ ) {
294
+ return signatureLines(name, c, settings).join("\n");
295
+ }
296
+ const props =
297
+ settings.notation === "compact"
298
+ ? compactProps(c.props, settings.propDescriptions)
299
+ : settings.propDescriptions
300
+ ? c.props
301
+ : withoutPropDescriptions(c.props);
302
+ const lines = [
303
+ `- **${name}**${c.description ? `: ${oneLine(c.description)}` : ""}`,
304
+ ` props: ${JSON.stringify(props)}`,
305
+ ];
306
+ if (c.events) lines.push(` event props: ${JSON.stringify(c.events)}`);
307
+ if (c.slots)
308
+ lines.push(` slot props (component ids): ${JSON.stringify(c.slots)}`);
309
+ return lines.join("\n");
310
+ })
311
+ .join("\n");
312
+ }
313
+
314
+ /**
315
+ * The manifest with replaced descriptions: `"Name"` replaces the
316
+ * description of a component, `"Name.prop"` the description of one of its
317
+ * props. Keys that name no component or prop are left out of the result
318
+ * and listed in `unknown`. The manifest is not changed.
319
+ */
320
+ export function applyDescriptionOverrides<
321
+ M extends Pick<GenerativeUIManifest, "components">,
322
+ >(
323
+ manifest: M,
324
+ overrides: Record<string, string>,
325
+ ): { manifest: M; unknown: string[] } {
326
+ const components = structuredClone(manifest.components);
327
+ const unknown: string[] = [];
328
+ for (const [key, description] of Object.entries(overrides)) {
329
+ const [name, prop, ...rest] = key.split(".");
330
+ // Own keys only: "__proto__" must never reach Object.prototype.
331
+ const component =
332
+ name !== undefined && hasOwn(components, name)
333
+ ? components[name]
334
+ : undefined;
335
+ if (!component || rest.length > 0) {
336
+ unknown.push(key);
337
+ continue;
338
+ }
339
+ if (prop === undefined) {
340
+ component.description = description;
341
+ continue;
342
+ }
343
+ const properties = component.props.properties;
344
+ const property =
345
+ isRecord(properties) && hasOwn(properties, prop)
346
+ ? properties[prop]
347
+ : undefined;
348
+ if (!isRecord(property)) {
349
+ unknown.push(key);
350
+ continue;
351
+ }
352
+ property.description = description;
353
+ }
354
+ return { manifest: { ...manifest, components }, unknown };
355
+ }
356
+
357
+ /**
358
+ * The components and props of `manifest` whose names do not appear in
359
+ * `rendered`. A schema notation that leaves one out would hide part of the
360
+ * catalog from the model.
361
+ */
362
+ export function schemaCoverage(
363
+ manifest: Pick<GenerativeUIManifest, "components">,
364
+ rendered: string,
365
+ ): { missing: string[] } {
366
+ const missing: string[] = [];
367
+ for (const [name, component] of Object.entries(manifest.components)) {
368
+ if (!rendered.includes(name)) missing.push(name);
369
+ const properties = isRecord(component.props.properties)
370
+ ? component.props.properties
371
+ : {};
372
+ for (const prop of Object.keys(properties)) {
373
+ if (!rendered.includes(prop)) missing.push(`${name}.${prop}`);
374
+ }
375
+ }
376
+ return { missing };
377
+ }
@@ -1,5 +1,5 @@
1
1
  /** A2UI protocol version used on the wire. */
2
- export const A2UI_VERSION = "v1.0";
2
+ export const A2UI_VERSION = "1.0";
3
3
  /** Activity type of a generated surface message. */
4
4
  export const GENERATIVE_UI_ACTIVITY_TYPE = "generative-ui-surface";
5
5
  /** Activity type of a function call that the agent asks the client to run. */
@@ -83,7 +83,7 @@ export type A2UIFunctionCall = {
83
83
 
84
84
  export type A2UIOperation =
85
85
  | {
86
- version: "v1.0";
86
+ version: typeof A2UI_VERSION;
87
87
  createSurface: {
88
88
  surfaceId: string;
89
89
  /** Left out by the model. The run's catalog id is filled in. */
@@ -97,20 +97,23 @@ export type A2UIOperation =
97
97
  };
98
98
  }
99
99
  | {
100
- version: "v1.0";
100
+ version: typeof A2UI_VERSION;
101
101
  updateComponents: { surfaceId: string; components: A2UIComponentNode[] };
102
102
  }
103
103
  | {
104
- version: "v1.0";
104
+ version: typeof A2UI_VERSION;
105
105
  /**
106
106
  * Sets `value` at `path`. A `null` value deletes the key at `path`.
107
107
  * With no `path`, or `"/"`, it sets the whole data model.
108
108
  */
109
109
  updateDataModel: { surfaceId: string; path?: string; value: unknown };
110
110
  }
111
- | { version: "v1.0"; deleteSurface: { surfaceId: string } }
112
111
  | {
113
- version: "v1.0";
112
+ version: typeof A2UI_VERSION;
113
+ deleteSurface: { surfaceId: string };
114
+ }
115
+ | {
116
+ version: typeof A2UI_VERSION;
114
117
  /** Runs an app function in the browser, with no user interaction. */
115
118
  callRendererFunction: {
116
119
  functionCallId: string;
@@ -292,7 +295,7 @@ export interface A2UIActionMessage {
292
295
  * @example
293
296
  * ```ts
294
297
  * toA2UIActionMessage({ name: "buy", surfaceId: "s1", componentId: "b", context: { sku: "a" } });
295
- * // { version: "v1.0", action: { name: "buy", surfaceId: "s1", sourceComponentId: "b", timestamp: "2026-…", context: { sku: "a" } } }
298
+ * // { version: "1.0", action: { name: "buy", surfaceId: "s1", sourceComponentId: "b", timestamp: "2026-…", context: { sku: "a" } } }
296
299
  * ```
297
300
  */
298
301
  export function toA2UIActionMessage(
@@ -703,11 +703,11 @@ function childRefProblem(
703
703
  // A bound or computed value, at the reference or above it, is known
704
704
  // only at render.
705
705
  if (isDynamic(value)) return undefined;
706
- if (steps.length === 0) {
706
+ const [head, ...rest] = steps;
707
+ if (head === undefined) {
707
708
  const reason = slotProblem(value, ref.kind, ownId);
708
709
  return reason ? `${label}: ${reason}` : undefined;
709
710
  }
710
- const [head, ...rest] = steps;
711
711
  if (head === "*") {
712
712
  if (!Array.isArray(value)) return undefined;
713
713
  for (const item of value) {
package/src/index.ts CHANGED
@@ -1,16 +1,9 @@
1
1
  export * from "./types";
2
2
  export * from "./utils";
3
3
  export * from "./constants";
4
- // Telemetry is split deliberately. `TelemetryClient` imports
5
- // `@segment/analytics-node`, which imports `node-fetch`, which imports the
6
- // Node built-ins `stream`, `http`, `https` and `zlib`. Browser bundlers
7
- // resolve the whole module graph before they tree-shake, so re-exporting
8
- // that module here made every browser build of a dependent package print
9
- // "Module ... has been externalized for browser compatibility" warnings,
10
- // even when the consumer never touched telemetry (#4151). Only the
11
- // browser-safe telemetry surface is re-exported from this entry. Server
12
- // code that needs the client imports it from `@copilotkit/shared/telemetry`.
13
- // This mirrors the license-verifier note below.
4
+ // Only browser-safe telemetry helpers live here. The runtime owns its
5
+ // telemetry client (`packages/runtime/src/runtime/telemetry`), so this package
6
+ // imports no Node-only analytics SDK (#4151).
14
7
  export { isTelemetryDisabled } from "./telemetry/telemetry-disabled";
15
8
  export * from "./telemetry/sampling";
16
9
  // Pure string classification with no imports, so it carries no runtime edge
@@ -23,12 +16,6 @@ export {
23
16
  parseAndWarnTelemetryId,
24
17
  } from "./telemetry/lambda-client";
25
18
  export type { LambdaSendOptions } from "./telemetry/lambda-client";
26
- // Types only: erased at build time, so they add no runtime edge to
27
- // `telemetry-client.ts` and therefore none to @segment/analytics-node.
28
- export type {
29
- TelemetryCapture,
30
- TelemetryIdentity,
31
- } from "./telemetry/telemetry-client";
32
19
  export * from "./debug";
33
20
  export * from "./standard-schema";
34
21
  export * from "./attachments";