@copilotkit/shared 2.0.0-rc.1 → 2.0.0-rc.10

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 (220) hide show
  1. package/README.md +3 -14
  2. package/dist/a2ui-prompts.cjs +21 -62
  3. package/dist/a2ui-prompts.cjs.map +1 -1
  4. package/dist/a2ui-prompts.d.cts +8 -1
  5. package/dist/a2ui-prompts.d.cts.map +1 -1
  6. package/dist/a2ui-prompts.d.mts +8 -1
  7. package/dist/a2ui-prompts.d.mts.map +1 -1
  8. package/dist/a2ui-prompts.mjs +22 -62
  9. package/dist/a2ui-prompts.mjs.map +1 -1
  10. package/dist/generative-ui/basic-functions.cjs +1 -1
  11. package/dist/generative-ui/basic-functions.cjs.map +1 -1
  12. package/dist/generative-ui/basic-functions.mjs +1 -1
  13. package/dist/generative-ui/basic-functions.mjs.map +1 -1
  14. package/dist/generative-ui/compact-schema.cjs +187 -0
  15. package/dist/generative-ui/compact-schema.cjs.map +1 -0
  16. package/dist/generative-ui/compact-schema.d.cts +55 -0
  17. package/dist/generative-ui/compact-schema.d.cts.map +1 -0
  18. package/dist/generative-ui/compact-schema.d.mts +55 -0
  19. package/dist/generative-ui/compact-schema.d.mts.map +1 -0
  20. package/dist/generative-ui/compact-schema.mjs +185 -0
  21. package/dist/generative-ui/compact-schema.mjs.map +1 -0
  22. package/dist/generative-ui/prompt-spec.cjs +225 -0
  23. package/dist/generative-ui/prompt-spec.cjs.map +1 -0
  24. package/dist/generative-ui/prompt-spec.d.cts +94 -0
  25. package/dist/generative-ui/prompt-spec.d.cts.map +1 -0
  26. package/dist/generative-ui/prompt-spec.d.mts +94 -0
  27. package/dist/generative-ui/prompt-spec.d.mts.map +1 -0
  28. package/dist/generative-ui/prompt-spec.mjs +220 -0
  29. package/dist/generative-ui/prompt-spec.mjs.map +1 -0
  30. package/dist/generative-ui/prompt.cjs +10 -36
  31. package/dist/generative-ui/prompt.cjs.map +1 -1
  32. package/dist/generative-ui/prompt.d.cts +2 -1
  33. package/dist/generative-ui/prompt.d.cts.map +1 -1
  34. package/dist/generative-ui/prompt.d.mts +2 -1
  35. package/dist/generative-ui/prompt.d.mts.map +1 -1
  36. package/dist/generative-ui/prompt.mjs +12 -38
  37. package/dist/generative-ui/prompt.mjs.map +1 -1
  38. package/dist/generative-ui/schema-render.cjs +242 -0
  39. package/dist/generative-ui/schema-render.cjs.map +1 -0
  40. package/dist/generative-ui/schema-render.d.cts +44 -0
  41. package/dist/generative-ui/schema-render.d.cts.map +1 -0
  42. package/dist/generative-ui/schema-render.d.mts +44 -0
  43. package/dist/generative-ui/schema-render.d.mts.map +1 -0
  44. package/dist/generative-ui/schema-render.mjs +239 -0
  45. package/dist/generative-ui/schema-render.mjs.map +1 -0
  46. package/dist/index.cjs +17 -15
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/index.d.cts +10 -9
  49. package/dist/index.d.cts.map +1 -1
  50. package/dist/index.d.mts +10 -9
  51. package/dist/index.d.mts.map +1 -1
  52. package/dist/index.mjs +9 -7
  53. package/dist/index.mjs.map +1 -1
  54. package/dist/index.umd.js +808 -438
  55. package/dist/index.umd.js.map +1 -1
  56. package/dist/package.cjs +1 -1
  57. package/dist/package.mjs +1 -1
  58. package/dist/standard-schema.cjs +20 -7
  59. package/dist/standard-schema.cjs.map +1 -1
  60. package/dist/standard-schema.d.cts +15 -16
  61. package/dist/standard-schema.d.cts.map +1 -1
  62. package/dist/standard-schema.d.mts +15 -16
  63. package/dist/standard-schema.d.mts.map +1 -1
  64. package/dist/standard-schema.mjs +20 -8
  65. package/dist/standard-schema.mjs.map +1 -1
  66. package/dist/telemetry/lambda-client.cjs.map +1 -1
  67. package/dist/telemetry/lambda-client.d.cts.map +1 -1
  68. package/dist/telemetry/lambda-client.d.mts.map +1 -1
  69. package/dist/telemetry/lambda-client.mjs.map +1 -1
  70. package/dist/telemetry/telemetry-disabled.cjs +3 -6
  71. package/dist/telemetry/telemetry-disabled.cjs.map +1 -1
  72. package/dist/telemetry/telemetry-disabled.d.cts +0 -5
  73. package/dist/telemetry/telemetry-disabled.d.cts.map +1 -1
  74. package/dist/telemetry/telemetry-disabled.d.mts +0 -5
  75. package/dist/telemetry/telemetry-disabled.d.mts.map +1 -1
  76. package/dist/telemetry/telemetry-disabled.mjs +4 -6
  77. package/dist/telemetry/telemetry-disabled.mjs.map +1 -1
  78. package/dist/types/message.d.cts +1 -18
  79. package/dist/types/message.d.cts.map +1 -1
  80. package/dist/types/message.d.mts +1 -18
  81. package/dist/types/message.d.mts.map +1 -1
  82. package/dist/utils/errors.cjs +4 -42
  83. package/dist/utils/errors.cjs.map +1 -1
  84. package/dist/utils/errors.d.cts +16 -34
  85. package/dist/utils/errors.d.cts.map +1 -1
  86. package/dist/utils/errors.d.mts +16 -34
  87. package/dist/utils/errors.d.mts.map +1 -1
  88. package/dist/utils/errors.mjs +5 -41
  89. package/dist/utils/errors.mjs.map +1 -1
  90. package/dist/utils/index.cjs +1 -2
  91. package/dist/utils/index.cjs.map +1 -1
  92. package/dist/utils/index.d.cts +4 -5
  93. package/dist/utils/index.d.cts.map +1 -1
  94. package/dist/utils/index.d.mts +4 -5
  95. package/dist/utils/index.d.mts.map +1 -1
  96. package/dist/utils/index.mjs +4 -5
  97. package/dist/utils/index.mjs.map +1 -1
  98. package/dist/utils/json-schema.cjs +0 -79
  99. package/dist/utils/json-schema.cjs.map +1 -1
  100. package/dist/utils/json-schema.d.cts +1 -4
  101. package/dist/utils/json-schema.d.cts.map +1 -1
  102. package/dist/utils/json-schema.d.mts +1 -4
  103. package/dist/utils/json-schema.d.mts.map +1 -1
  104. package/dist/utils/json-schema.mjs +1 -78
  105. package/dist/utils/json-schema.mjs.map +1 -1
  106. package/dist/utils/process-env.cjs +14 -0
  107. package/dist/utils/process-env.cjs.map +1 -0
  108. package/dist/utils/process-env.d.cts +10 -0
  109. package/dist/utils/process-env.d.cts.map +1 -0
  110. package/dist/utils/process-env.d.mts +10 -0
  111. package/dist/utils/process-env.d.mts.map +1 -0
  112. package/dist/utils/process-env.mjs +13 -0
  113. package/dist/utils/process-env.mjs.map +1 -0
  114. package/dist/utils/random-id.cjs +13 -26
  115. package/dist/utils/random-id.cjs.map +1 -1
  116. package/dist/utils/random-id.d.cts +6 -3
  117. package/dist/utils/random-id.d.cts.map +1 -1
  118. package/dist/utils/random-id.d.mts +6 -3
  119. package/dist/utils/random-id.d.mts.map +1 -1
  120. package/dist/utils/random-id.mjs +14 -25
  121. package/dist/utils/random-id.mjs.map +1 -1
  122. package/package.json +7 -31
  123. package/src/__tests__/a2ui-prompts.test.ts +42 -9
  124. package/src/__tests__/fixtures/prompt-goldens.json +354 -0
  125. package/src/__tests__/prompt-spec.test.ts +191 -0
  126. package/src/__tests__/root-entry-browser-safety.test.ts +5 -7
  127. package/src/__tests__/schema-render.test.ts +245 -0
  128. package/src/__tests__/standard-schema.test.ts +61 -101
  129. package/src/a2ui-prompts.ts +47 -96
  130. package/src/generative-ui/basic-functions.ts +1 -1
  131. package/src/generative-ui/compact-schema.ts +277 -0
  132. package/src/generative-ui/index.ts +3 -0
  133. package/src/generative-ui/prompt-spec.ts +335 -0
  134. package/src/generative-ui/prompt.ts +25 -75
  135. package/src/generative-ui/schema-render.ts +374 -0
  136. package/src/index.ts +3 -16
  137. package/src/standard-schema.ts +24 -27
  138. package/src/telemetry/lambda-client.ts +3 -2
  139. package/src/telemetry/telemetry-disabled.ts +7 -12
  140. package/src/types/message.ts +1 -19
  141. package/src/utils/__tests__/errors.test.ts +44 -0
  142. package/src/utils/__tests__/json-schema.test.ts +3 -479
  143. package/src/utils/__tests__/process-env.test.ts +22 -0
  144. package/src/utils/__tests__/random-id.test.ts +37 -0
  145. package/src/utils/errors.ts +27 -85
  146. package/src/utils/index.ts +1 -2
  147. package/src/utils/json-schema.ts +1 -152
  148. package/src/utils/process-env.ts +14 -0
  149. package/src/utils/random-id.ts +17 -37
  150. package/tsdown.config.ts +2 -19
  151. package/dist/event-transforms/index.cjs +0 -15
  152. package/dist/event-transforms/index.d.cts +0 -4
  153. package/dist/event-transforms/index.d.mts +0 -4
  154. package/dist/event-transforms/index.mjs +0 -5
  155. package/dist/event-transforms/open-generative-ui-middleware.cjs +0 -286
  156. package/dist/event-transforms/open-generative-ui-middleware.cjs.map +0 -1
  157. package/dist/event-transforms/open-generative-ui-middleware.d.cts +0 -60
  158. package/dist/event-transforms/open-generative-ui-middleware.d.cts.map +0 -1
  159. package/dist/event-transforms/open-generative-ui-middleware.d.mts +0 -60
  160. package/dist/event-transforms/open-generative-ui-middleware.d.mts.map +0 -1
  161. package/dist/event-transforms/open-generative-ui-middleware.mjs +0 -283
  162. package/dist/event-transforms/open-generative-ui-middleware.mjs.map +0 -1
  163. package/dist/event-transforms/recorded-events.cjs +0 -59
  164. package/dist/event-transforms/recorded-events.cjs.map +0 -1
  165. package/dist/event-transforms/recorded-events.d.cts +0 -23
  166. package/dist/event-transforms/recorded-events.d.cts.map +0 -1
  167. package/dist/event-transforms/recorded-events.d.mts +0 -23
  168. package/dist/event-transforms/recorded-events.d.mts.map +0 -1
  169. package/dist/event-transforms/recorded-events.mjs +0 -58
  170. package/dist/event-transforms/recorded-events.mjs.map +0 -1
  171. package/dist/telemetry/events.d.cts +0 -72
  172. package/dist/telemetry/events.d.cts.map +0 -1
  173. package/dist/telemetry/events.d.mts +0 -72
  174. package/dist/telemetry/events.d.mts.map +0 -1
  175. package/dist/telemetry/index.cjs +0 -18
  176. package/dist/telemetry/index.d.cts +0 -5
  177. package/dist/telemetry/index.d.mts +0 -5
  178. package/dist/telemetry/index.mjs +0 -6
  179. package/dist/telemetry/telemetry-client.cjs +0 -165
  180. package/dist/telemetry/telemetry-client.cjs.map +0 -1
  181. package/dist/telemetry/telemetry-client.d.cts +0 -87
  182. package/dist/telemetry/telemetry-client.d.cts.map +0 -1
  183. package/dist/telemetry/telemetry-client.d.mts +0 -87
  184. package/dist/telemetry/telemetry-client.d.mts.map +0 -1
  185. package/dist/telemetry/telemetry-client.mjs +0 -164
  186. package/dist/telemetry/telemetry-client.mjs.map +0 -1
  187. package/dist/telemetry/utils.cjs +0 -14
  188. package/dist/telemetry/utils.cjs.map +0 -1
  189. package/dist/telemetry/utils.mjs +0 -13
  190. package/dist/telemetry/utils.mjs.map +0 -1
  191. package/dist/utils/conditions.cjs +0 -32
  192. package/dist/utils/conditions.cjs.map +0 -1
  193. package/dist/utils/conditions.d.cts +0 -31
  194. package/dist/utils/conditions.d.cts.map +0 -1
  195. package/dist/utils/conditions.d.mts +0 -31
  196. package/dist/utils/conditions.d.mts.map +0 -1
  197. package/dist/utils/conditions.mjs +0 -31
  198. package/dist/utils/conditions.mjs.map +0 -1
  199. package/dist/utils/console-styling.cjs +0 -91
  200. package/dist/utils/console-styling.cjs.map +0 -1
  201. package/dist/utils/console-styling.d.cts +0 -65
  202. package/dist/utils/console-styling.d.cts.map +0 -1
  203. package/dist/utils/console-styling.d.mts +0 -65
  204. package/dist/utils/console-styling.d.mts.map +0 -1
  205. package/dist/utils/console-styling.mjs +0 -85
  206. package/dist/utils/console-styling.mjs.map +0 -1
  207. package/src/__tests__/zod-regression.test.ts +0 -319
  208. package/src/event-transforms/index.ts +0 -5
  209. package/src/event-transforms/open-generative-ui-middleware.ts +0 -392
  210. package/src/event-transforms/recorded-events.test.ts +0 -166
  211. package/src/event-transforms/recorded-events.ts +0 -74
  212. package/src/telemetry/events.ts +0 -68
  213. package/src/telemetry/index.ts +0 -9
  214. package/src/telemetry/telemetry-blank-license-identity.test.ts +0 -128
  215. package/src/telemetry/telemetry-client.test.ts +0 -798
  216. package/src/telemetry/telemetry-client.ts +0 -328
  217. package/src/telemetry/utils.ts +0 -15
  218. package/src/utils/__tests__/conditions.test.ts +0 -161
  219. package/src/utils/conditions.ts +0 -116
  220. package/src/utils/console-styling.ts +0 -126
package/dist/index.d.cts CHANGED
@@ -3,17 +3,16 @@ import { Action, MappedParameterTypes, Parameter } from "./types/action.cjs";
3
3
  import { CopilotCloudConfig } from "./types/copilot-cloud-config.cjs";
4
4
  import { PartialBy, RequiredBy } from "./types/utility.cjs";
5
5
  import { CopilotErrorEvent, CopilotErrorHandler, CopilotRequestContext } from "./types/error.cjs";
6
- import { AIMessage, ActivityMessage, AudioInputPart, DeveloperMessage, DocumentInputPart, ImageData, ImageInputPart, InputContent, InputContentDataSource, InputContentSource, InputContentUrlSource, Message, ReasoningMessage, Role, SystemMessage, TextInputPart, ToolCall, ToolResult, UserMessage, VideoInputPart } from "./types/message.cjs";
6
+ import { AIMessage, ActivityMessage, AudioInputPart, DeveloperMessage, DocumentInputPart, ImageInputPart, InputContent, InputContentDataSource, InputContentSource, InputContentUrlSource, Message, ReasoningMessage, Role, SystemMessage, TextInputPart, ToolCall, ToolResult, UserMessage, VideoInputPart } from "./types/message.cjs";
7
7
  import { copyToClipboard } from "./utils/clipboard.cjs";
8
- import { BaseCondition, ComparisonCondition, ComparisonRule, Condition, ExistenceCondition, ExistenceRule, LogicalCondition, LogicalRule, Rule, executeConditions } from "./utils/conditions.cjs";
9
- import { ConsoleColors, ConsoleStyles, logCopilotKitPlatformMessage, logStyled, publicApiKeyRequired, styledConsole } from "./utils/console-styling.cjs";
10
- import { BANNER_ERROR_NAMES, COPILOT_CLOUD_ERROR_NAMES, ConfigurationError, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, CopilotKitVersionMismatchError, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, MissingPublicApiKeyError, ResolvedCopilotKitError, Severity, UpgradeRequiredError, ensureStructuredError, getPossibleVersionMismatch, isStructuredCopilotKitError } from "./utils/errors.cjs";
11
- import { JSONSchema, JSONSchemaArray, JSONSchemaBoolean, JSONSchemaNumber, JSONSchemaObject, JSONSchemaString, actionParametersToJsonSchema, convertJsonSchemaToZodSchema, getZodParameters, jsonSchemaToActionParameters } from "./utils/json-schema.cjs";
8
+ import { BANNER_ERROR_NAMES, COPILOT_CLOUD_ERROR_NAMES, ConfigurationError, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitErrorExtensions, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, MissingPublicApiKeyError, ResolvedCopilotKitError, Severity, UpgradeRequiredError, ensureStructuredError, isStructuredCopilotKitError } from "./utils/errors.cjs";
9
+ import { JSONSchema, JSONSchemaArray, JSONSchemaBoolean, JSONSchemaNumber, JSONSchemaObject, JSONSchemaString, actionParametersToJsonSchema, jsonSchemaToActionParameters } from "./utils/json-schema.cjs";
12
10
  import { InspectorMetadataV1, parseInspectorMetadataV1 } from "./utils/inspector-metadata.cjs";
13
11
  import { InspectorLearningEvidence, InspectorLearningInsight, InspectorLearningPage, InspectorLearningRequestV1, InspectorLearningSkill, InspectorLearningSnapshotV1, InspectorLearningTrajectoryEvidence, parseInspectorLearningRequestV1, parseInspectorLearningSnapshotV1, parseInspectorLearningUrl } from "./utils/inspector-learning.cjs";
14
12
  import { InspectorVisibilityOptions, shouldEnableInspector } from "./utils/inspector-visibility.cjs";
15
13
  import { A2UIRuntimeInfo, AgentDescription, IntelligenceRuntimeInfo, MaybePromise, NonEmptyRecord, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, RuntimeEntitlementResponse, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SingleRouteRuntimeInfo, ThreadEndpointRuntimeInfo } from "./utils/types.cjs";
16
- import { dataToUUID, isValidUUID, randomId, randomUUID } from "./utils/random-id.cjs";
14
+ import { randomId, randomUUID } from "./utils/random-id.cjs";
15
+ import { processEnv } from "./utils/process-env.cjs";
17
16
  import { readBody } from "./utils/requests.cjs";
18
17
  import { RowKeyStore, commitRowKeyStore, createRowKeyStore, pruneRowKeyStore, resolveRowRenderKeys, resolveRowRenderKeysById } from "./utils/row-render-keys.cjs";
19
18
  import { isMacOS, parseJson, partialJSONParse, phoenixExponentialBackoff, safeParseToolArgs, tryMap } from "./utils/index.cjs";
@@ -22,9 +21,8 @@ import { isTelemetryDisabled } from "./telemetry/telemetry-disabled.cjs";
22
21
  import { SamplingMeta, TELEMETRY_EMITTER_V1, TELEMETRY_EMITTER_V2, TELEMETRY_SURFACE_V1, TELEMETRY_SURFACE_V2, TelemetryEmitter, TelemetrySurface, TelemetryTransport, UNSAMPLED_RATE, computeSamplingMeta } from "./telemetry/sampling.cjs";
23
22
  import { MODEL_HOST_CLASSES, ModelHostClass, classifyModelHost } from "./telemetry/model-host.cjs";
24
23
  import { LambdaSendOptions, firstNonBlankTelemetryId, lambdaClient, parseAndWarnTelemetryId, parseTelemetryIdFromLicense } from "./telemetry/lambda-client.cjs";
25
- import { TelemetryCapture, TelemetryIdentity } from "./telemetry/telemetry-client.cjs";
26
24
  import { DebugConfig, ResolvedDebugConfig, resolveDebugConfig } from "./debug.cjs";
27
- import { InferSchemaOutput, SchemaToJsonSchemaOptions, StandardJSONSchemaV1, StandardSchemaV1, schemaToJsonSchema } from "./standard-schema.cjs";
25
+ import { InferSchemaOutput, StandardJSONSchemaV1, StandardSchemaV1, schemaToJsonSchema, ɵanySchema } from "./standard-schema.cjs";
28
26
  import { Attachment, AttachmentModality, AttachmentUploadError, AttachmentUploadErrorReason, AttachmentUploadResult, AttachmentsConfig } from "./attachments/types.cjs";
29
27
  import { createAttachmentContent } from "./attachments/content.cjs";
30
28
  import { exceedsMaxSize, formatFileSize, generateVideoThumbnail, getDocumentIcon, getModalityFromMimeType, getSourceUrl, matchesAcceptFilter, readFileAsBase64 } from "./attachments/utils.cjs";
@@ -34,6 +32,7 @@ import { stripIntelligenceRoutingFields } from "./intelligence-routing-fields.cj
34
32
  import { TranscriptionErrorCode, TranscriptionErrorResponse, TranscriptionErrors } from "./transcription-errors.cjs";
35
33
  import { A2UIAllowedCallers, A2UIBasicFunctionInfo, A2UIFunctionPermissions, A2UIFunctionReturnType, A2UIValidationResult, A2UIValidationSeverity, A2UI_BASIC_FUNCTIONS, A2UI_INDEX_FUNCTION, COPILOTKIT_FUNCTIONS, GENERATIVE_UI_DEFAULT_ALLOWED_CALLERS, GENERATIVE_UI_FUNCTIONS, functionCallers, isA2UIBasicFunction, isA2UIValueFunction, isCallBinding, isValidationResult } from "./generative-ui/basic-functions.cjs";
36
34
  import { A2UIActionMessage, A2UIComponentNode, A2UIFunctionCall, A2UIOperation, A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_VERSION, GENERATIVE_UI_ACTIVITY_TYPE, GENERATIVE_UI_AGENT_FUNCTION_CALLS, GENERATIVE_UI_AGENT_FUNCTION_CALLS_OFF_REASON, GENERATIVE_UI_CHAT_TARGET, GENERATIVE_UI_FUNCTION_CALL_ACTIVITY_TYPE, GENERATIVE_UI_MAX_REJECTION_LENGTH, GENERATIVE_UI_MAX_SUMMARY_REJECTIONS, GENERATIVE_UI_MAX_TARGET_COMPONENTS, GENERATIVE_UI_RENDER_TOOL, GENERATIVE_UI_ROOT_ID, GenerativeUIActionBinding, GenerativeUIComponentManifest, GenerativeUIFunctionCallContent, GenerativeUIFunctionManifest, GenerativeUIJSONSchema, GenerativeUIManifest, GenerativeUIRejectedOperation, GenerativeUISurfaceContent, GenerativeUISurfaceStatus, GenerativeUISurfaceSummary, GenerativeUITarget, GenerativeUITemplateChildren, GenerativeUIUserEvent, generativeUIFunctionCallMessageId, generativeUISurfaceMessageId, toA2UIActionMessage } from "./generative-ui/types.cjs";
35
+ import { GENERATIVE_UI_MARKDOWN_WHEN_TO_SHOW, GENERATIVE_UI_WHEN_TO_SHOW, GUIDE_COMPONENTS, GenerativeUIPromptFeature, GenerativeUIPromptFeatures, GenerativeUIPromptItem, GenerativeUIPromptSection, GenerativeUIPromptSpec, GenerativeUISchemaSettings, defaultGenerativeUIPromptSpec, generativeUIPromptFeatures, selectPromptItems } from "./generative-ui/prompt-spec.cjs";
37
36
  import { A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, ALL_GENERATIVE_UI_GUIDE_FEATURES, GENERATIVE_UI_MARKDOWN_GUIDELINES, GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION, GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION, GenerativeUIGuideFeatures, buildGenerativeUIMarkdownGuidelines, generativeUIGuideFeatures } from "./a2ui-prompts.cjs";
38
37
  import { COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_UI_ENVELOPE_FORMAT, CopilotKitUIEnvelope, envelopeToManifest, readCopilotKitUIEnvelope } from "./a2ui-envelope.cjs";
39
38
  import { DebugEventEnvelope } from "./debug-event-envelope.cjs";
@@ -42,6 +41,8 @@ import { AllowedComponents, OperationKind, OperationValidation, ValidateOperatio
42
41
  import { ExtractedRenderUIArgs, RenderUIArgsStream, extractRenderUIArgs } from "./generative-ui/render-ui-args.cjs";
43
42
  import { A2UI_CHILD_LIST_MARK, A2UI_CHILD_LIST_REF, A2UI_COMPONENT_ID_MARK, A2UI_COMPONENT_ID_REF, ChildRef, ChildRefKind, applyChildRefMarks, childIdsAtRefs, childRefKind, collectChildRefs, hasBoundChildRef, mapAtChildRef } from "./generative-ui/child-refs.cjs";
44
43
  import { GENERATIVE_UI_CONTEXT_DESCRIPTION, buildGenerativeUIPrompt } from "./generative-ui/prompt.cjs";
44
+ import { buildCompactGenerativeUISchema } from "./generative-ui/compact-schema.cjs";
45
+ import { applyDescriptionOverrides, renderGenerativeUIComponentList, renderGenerativeUISchema, schemaCoverage } from "./generative-ui/schema-render.cjs";
45
46
  import { LicenseChecker, LicenseFeatures, LicenseOwner, LicensePayload, LicensePayload as LicensePayload$1, LicenseStatus, LicenseTier } from "@copilotkit/license-verifier";
46
47
 
47
48
  //#region src/index.d.ts
@@ -76,5 +77,5 @@ interface LicenseContextValue {
76
77
  */
77
78
  declare function createLicenseContextValue(status: RuntimeLicenseStatus | null | undefined, runtimeEntitlements?: RuntimeEntitlementResponse): LicenseContextValue;
78
79
  //#endregion
79
- export { A2UIActionMessage, A2UIAllowedCallers, A2UIBasicFunctionInfo, A2UIComponentNode, A2UIFunctionCall, A2UIFunctionPermissions, A2UIFunctionReturnType, A2UIOperation, A2UIRuntimeInfo, A2UIValidationResult, A2UIValidationSeverity, A2UI_BASIC_FUNCTIONS, A2UI_CHILD_LIST_MARK, A2UI_CHILD_LIST_REF, A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_COMPONENT_ID_MARK, A2UI_COMPONENT_ID_REF, A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, A2UI_INDEX_FUNCTION, A2UI_VERSION, AG_UI_CHANNEL_EVENT, AIMessage, ALL_GENERATIVE_UI_GUIDE_FEATURES, Action, ActivityMessage, AgentDescription, AllowedComponents, AssistantMessage, Attachment, AttachmentModality, AttachmentUploadError, AttachmentUploadErrorReason, AttachmentUploadResult, AttachmentsConfig, AudioInputPart, BANNER_ERROR_NAMES, BaseCondition, COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_FUNCTIONS, COPILOTKIT_UI_ENVELOPE_FORMAT, COPILOTKIT_VERSION, COPILOT_CLOUD_API_URL, COPILOT_CLOUD_CHAT_URL, COPILOT_CLOUD_ERROR_NAMES, COPILOT_CLOUD_PUBLIC_API_KEY_HEADER, COPILOT_CLOUD_VERSION, ChildRef, ChildRefKind, CoAgentStateRenderHandler, CoAgentStateRenderHandlerArguments, ComparisonCondition, ComparisonRule, Condition, ConfigurationError, ConsoleColors, ConsoleStyles, CopilotCloudConfig, CopilotErrorEvent, CopilotErrorHandler, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, type CopilotKitUIEnvelope, CopilotKitVersionMismatchError, CopilotRequestContext, DEFAULT_AGENT_ID, DebugConfig, type DebugEventEnvelope, DeveloperMessage, DocumentInputPart, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, ExistenceCondition, ExistenceRule, ExtractedRenderUIArgs, type FinalizeRunOptions, FunctionCallHandler, FunctionCallHandlerArguments, FunctionDefinition, GENERATE_SANDBOXED_UI_DESCRIPTION, GENERATIVE_UI_ACTIVITY_TYPE, GENERATIVE_UI_AGENT_FUNCTION_CALLS, GENERATIVE_UI_AGENT_FUNCTION_CALLS_OFF_REASON, GENERATIVE_UI_CHAT_TARGET, GENERATIVE_UI_CONTEXT_DESCRIPTION, GENERATIVE_UI_DEFAULT_ALLOWED_CALLERS, GENERATIVE_UI_FUNCTIONS, GENERATIVE_UI_FUNCTION_CALL_ACTIVITY_TYPE, GENERATIVE_UI_MARKDOWN_GUIDELINES, GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION, GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION, GENERATIVE_UI_MAX_REJECTION_LENGTH, GENERATIVE_UI_MAX_SUMMARY_REJECTIONS, GENERATIVE_UI_MAX_TARGET_COMPONENTS, GENERATIVE_UI_RENDER_TOOL, GENERATIVE_UI_ROOT_ID, GenerativeUIActionBinding, GenerativeUIComponentManifest, GenerativeUIFunctionCallContent, GenerativeUIFunctionManifest, type GenerativeUIGuideFeatures, GenerativeUIJSONSchema, GenerativeUIManifest, GenerativeUIRejectedOperation, GenerativeUISurfaceContent, GenerativeUISurfaceStatus, GenerativeUISurfaceSummary, GenerativeUITarget, GenerativeUITemplateChildren, GenerativeUIUserEvent, ImageData, ImageInputPart, InferSchemaOutput, InputContent, InputContentDataSource, InputContentSource, InputContentUrlSource, InspectorLearningEvidence, InspectorLearningInsight, InspectorLearningPage, InspectorLearningRequestV1, InspectorLearningSkill, InspectorLearningSnapshotV1, InspectorLearningTrajectoryEvidence, InspectorMetadataV1, InspectorVisibilityOptions, IntelligenceRuntimeInfo, JSONSchema, JSONSchemaArray, JSONSchemaBoolean, JSONSchemaNumber, JSONSchemaObject, JSONSchemaString, JSONValue, type LambdaSendOptions, type LicenseChecker, LicenseContextValue, type LicenseFeatures, type LicenseOwner, type LicensePayload, type LicenseStatus, type LicenseTier, LogicalCondition, LogicalRule, MODEL_HOST_CLASSES, MappedParameterTypes, MaybePromise, Message, MissingPublicApiKeyError, ModelHostClass, NonEmptyRecord, OperationKind, OperationValidation, Parameter, PartialBy, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, ReasoningMessage, RenderUIArgsStream, RequiredBy, ResolvedCopilotKitError, ResolvedDebugConfig, Role, RowKeyStore, Rule, type RunEventFinalizer, RuntimeEntitlementResponse, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SamplingMeta, SchemaToJsonSchemaOptions, Severity, SingleRouteRuntimeInfo, StandardJSONSchemaV1, StandardSchemaV1, SystemMessage, TELEMETRY_EMITTER_V1, TELEMETRY_EMITTER_V2, TELEMETRY_SURFACE_V1, TELEMETRY_SURFACE_V2, THREAD_ALREADY_RUNNING_ERROR_CODE, type TelemetryCapture, TelemetryEmitter, type TelemetryIdentity, TelemetrySurface, TelemetryTransport, TextInputPart, ThreadEndpointRuntimeInfo, ToolCall, ToolDefinition, ToolResult, TranscriptionErrorCode, type TranscriptionErrorResponse, TranscriptionErrors, UNSAMPLED_RATE, UpgradeRequiredError, UserMessage, ValidateOperationOptions, VideoInputPart, actionParametersToJsonSchema, applyChildRefMarks, buildGenerativeUIMarkdownGuidelines, buildGenerativeUIPrompt, callerProblem, childIdsAtRefs, childRefKind, classifyModelHost, collectChildRefs, commitRowKeyStore, computeSamplingMeta, convertJsonSchemaToZodSchema, copyToClipboard, createAttachmentContent, createLicenseContextValue, createRowKeyStore, createRunEventFinalizer, dataToUUID, ensureStructuredError, envelopeToManifest, exceedsMaxSize, executeConditions, extractRenderUIArgs, finalizeRunEvents, firstNonBlankTelemetryId, formatFileSize, functionCallers, generateVideoThumbnail, generativeUIFunctionCallMessageId, generativeUIGuideFeatures, generativeUISurfaceMessageId, getDocumentIcon, getModalityFromMimeType, getOperationKind, getOperationSurfaceId, getPossibleVersionMismatch, getSourceUrl, getZodParameters, hasBoundChildRef, isA2UIBasicFunction, isA2UIValueFunction, isActionBinding, isCallBinding, isIndexCall, isMacOS, isPathBinding, isStructuredCopilotKitError, isTelemetryDisabled, isValidUUID, isValidationResult, jsonSchemaToActionParameters, lambdaClient, logCopilotKitPlatformMessage, logStyled, logger, mapAtChildRef, matchesAcceptFilter, parseAndWarnTelemetryId, parseInspectorLearningRequestV1, parseInspectorLearningSnapshotV1, parseInspectorLearningUrl, parseInspectorMetadataV1, parseJson, parseTelemetryIdFromLicense, partialJSONParse, phoenixExponentialBackoff, pruneRowKeyStore, publicApiKeyRequired, randomId, randomUUID, readBody, readCopilotKitUIEnvelope, readFileAsBase64, resolveDebugConfig, resolveRowRenderKeys, resolveRowRenderKeysById, safeParseToolArgs, schemaToJsonSchema, shouldEnableInspector, stripIntelligenceRoutingFields, styledConsole, toA2UIActionMessage, tryMap, validateOperation };
80
+ export { A2UIActionMessage, A2UIAllowedCallers, A2UIBasicFunctionInfo, A2UIComponentNode, A2UIFunctionCall, A2UIFunctionPermissions, A2UIFunctionReturnType, A2UIOperation, A2UIRuntimeInfo, A2UIValidationResult, A2UIValidationSeverity, A2UI_BASIC_FUNCTIONS, A2UI_CHILD_LIST_MARK, A2UI_CHILD_LIST_REF, A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_COMPONENT_ID_MARK, A2UI_COMPONENT_ID_REF, A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, A2UI_INDEX_FUNCTION, A2UI_VERSION, AG_UI_CHANNEL_EVENT, AIMessage, ALL_GENERATIVE_UI_GUIDE_FEATURES, Action, ActivityMessage, AgentDescription, AllowedComponents, AssistantMessage, Attachment, AttachmentModality, AttachmentUploadError, AttachmentUploadErrorReason, AttachmentUploadResult, AttachmentsConfig, AudioInputPart, BANNER_ERROR_NAMES, COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_FUNCTIONS, COPILOTKIT_UI_ENVELOPE_FORMAT, COPILOTKIT_VERSION, COPILOT_CLOUD_API_URL, COPILOT_CLOUD_CHAT_URL, COPILOT_CLOUD_ERROR_NAMES, COPILOT_CLOUD_PUBLIC_API_KEY_HEADER, COPILOT_CLOUD_VERSION, ChildRef, ChildRefKind, CoAgentStateRenderHandler, CoAgentStateRenderHandlerArguments, ConfigurationError, CopilotCloudConfig, CopilotErrorEvent, CopilotErrorHandler, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitErrorExtensions, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, type CopilotKitUIEnvelope, CopilotRequestContext, DEFAULT_AGENT_ID, DebugConfig, type DebugEventEnvelope, DeveloperMessage, DocumentInputPart, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, ExtractedRenderUIArgs, type FinalizeRunOptions, FunctionCallHandler, FunctionCallHandlerArguments, FunctionDefinition, GENERATE_SANDBOXED_UI_DESCRIPTION, GENERATIVE_UI_ACTIVITY_TYPE, GENERATIVE_UI_AGENT_FUNCTION_CALLS, GENERATIVE_UI_AGENT_FUNCTION_CALLS_OFF_REASON, GENERATIVE_UI_CHAT_TARGET, GENERATIVE_UI_CONTEXT_DESCRIPTION, GENERATIVE_UI_DEFAULT_ALLOWED_CALLERS, GENERATIVE_UI_FUNCTIONS, GENERATIVE_UI_FUNCTION_CALL_ACTIVITY_TYPE, GENERATIVE_UI_MARKDOWN_GUIDELINES, GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION, GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION, GENERATIVE_UI_MARKDOWN_WHEN_TO_SHOW, GENERATIVE_UI_MAX_REJECTION_LENGTH, GENERATIVE_UI_MAX_SUMMARY_REJECTIONS, GENERATIVE_UI_MAX_TARGET_COMPONENTS, GENERATIVE_UI_RENDER_TOOL, GENERATIVE_UI_ROOT_ID, GENERATIVE_UI_WHEN_TO_SHOW, GUIDE_COMPONENTS, GenerativeUIActionBinding, GenerativeUIComponentManifest, GenerativeUIFunctionCallContent, GenerativeUIFunctionManifest, type GenerativeUIGuideFeatures, GenerativeUIJSONSchema, GenerativeUIManifest, GenerativeUIPromptFeature, GenerativeUIPromptFeatures, GenerativeUIPromptItem, GenerativeUIPromptSection, GenerativeUIPromptSpec, GenerativeUIRejectedOperation, GenerativeUISchemaSettings, GenerativeUISurfaceContent, GenerativeUISurfaceStatus, GenerativeUISurfaceSummary, GenerativeUITarget, GenerativeUITemplateChildren, GenerativeUIUserEvent, ImageInputPart, InferSchemaOutput, InputContent, InputContentDataSource, InputContentSource, InputContentUrlSource, InspectorLearningEvidence, InspectorLearningInsight, InspectorLearningPage, InspectorLearningRequestV1, InspectorLearningSkill, InspectorLearningSnapshotV1, InspectorLearningTrajectoryEvidence, InspectorMetadataV1, InspectorVisibilityOptions, IntelligenceRuntimeInfo, JSONSchema, JSONSchemaArray, JSONSchemaBoolean, JSONSchemaNumber, JSONSchemaObject, JSONSchemaString, JSONValue, type LambdaSendOptions, type LicenseChecker, LicenseContextValue, type LicenseFeatures, type LicenseOwner, type LicensePayload, type LicenseStatus, type LicenseTier, MODEL_HOST_CLASSES, MappedParameterTypes, MaybePromise, Message, MissingPublicApiKeyError, ModelHostClass, NonEmptyRecord, OperationKind, OperationValidation, Parameter, PartialBy, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, ReasoningMessage, RenderUIArgsStream, RequiredBy, ResolvedCopilotKitError, ResolvedDebugConfig, Role, RowKeyStore, type RunEventFinalizer, RuntimeEntitlementResponse, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SamplingMeta, Severity, SingleRouteRuntimeInfo, StandardJSONSchemaV1, StandardSchemaV1, SystemMessage, TELEMETRY_EMITTER_V1, TELEMETRY_EMITTER_V2, TELEMETRY_SURFACE_V1, TELEMETRY_SURFACE_V2, THREAD_ALREADY_RUNNING_ERROR_CODE, TelemetryEmitter, TelemetrySurface, TelemetryTransport, TextInputPart, ThreadEndpointRuntimeInfo, ToolCall, ToolDefinition, ToolResult, TranscriptionErrorCode, type TranscriptionErrorResponse, TranscriptionErrors, UNSAMPLED_RATE, UpgradeRequiredError, UserMessage, ValidateOperationOptions, VideoInputPart, actionParametersToJsonSchema, applyChildRefMarks, applyDescriptionOverrides, buildCompactGenerativeUISchema, buildGenerativeUIMarkdownGuidelines, buildGenerativeUIPrompt, callerProblem, childIdsAtRefs, childRefKind, classifyModelHost, collectChildRefs, commitRowKeyStore, computeSamplingMeta, copyToClipboard, createAttachmentContent, createLicenseContextValue, createRowKeyStore, createRunEventFinalizer, defaultGenerativeUIPromptSpec, ensureStructuredError, envelopeToManifest, exceedsMaxSize, extractRenderUIArgs, finalizeRunEvents, firstNonBlankTelemetryId, formatFileSize, functionCallers, generateVideoThumbnail, generativeUIFunctionCallMessageId, generativeUIGuideFeatures, generativeUIPromptFeatures, generativeUISurfaceMessageId, getDocumentIcon, getModalityFromMimeType, getOperationKind, getOperationSurfaceId, getSourceUrl, hasBoundChildRef, isA2UIBasicFunction, isA2UIValueFunction, isActionBinding, isCallBinding, isIndexCall, isMacOS, isPathBinding, isStructuredCopilotKitError, isTelemetryDisabled, isValidationResult, jsonSchemaToActionParameters, lambdaClient, logger, mapAtChildRef, matchesAcceptFilter, parseAndWarnTelemetryId, parseInspectorLearningRequestV1, parseInspectorLearningSnapshotV1, parseInspectorLearningUrl, parseInspectorMetadataV1, parseJson, parseTelemetryIdFromLicense, partialJSONParse, phoenixExponentialBackoff, processEnv, pruneRowKeyStore, randomId, randomUUID, readBody, readCopilotKitUIEnvelope, readFileAsBase64, renderGenerativeUIComponentList, renderGenerativeUISchema, resolveDebugConfig, resolveRowRenderKeys, resolveRowRenderKeysById, safeParseToolArgs, schemaCoverage, schemaToJsonSchema, selectPromptItems, shouldEnableInspector, stripIntelligenceRoutingFields, toA2UIActionMessage, tryMap, validateOperation, ɵanySchema };
80
81
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmDa,kBAAA;;;;;UA8BI,mBAAA;;EAEf,MAAA,EAAQ,oBAAA;;EAER,OAAA,EAAS,gBAAA;;EAET,YAAA,GAAe,OAAA;;EAEf,QAAA,GAAW,OAAA;AAAA;;;;;;;;;;;;;;AAtCb;iBAsEgB,yBAAA,CACd,MAAA,EAAQ,oBAAA,qBACR,mBAAA,GAAsB,0BAAA,GACrB,mBAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsCa,kBAAA;;;;;UA8BI,mBAAA;;EAEf,MAAA,EAAQ,oBAAA;;EAER,OAAA,EAAS,gBAAA;;EAET,YAAA,GAAe,OAAA;;EAEf,QAAA,GAAW,OAAA;AAAA;;;;;;;;;;;;;;;iBAgCG,yBAAA,CACd,MAAA,EAAQ,oBAAA,qBACR,mBAAA,GAAsB,0BAAA,GACrB,mBAAA"}
package/dist/index.d.mts CHANGED
@@ -3,17 +3,16 @@ import { Action, MappedParameterTypes, Parameter } from "./types/action.mjs";
3
3
  import { CopilotCloudConfig } from "./types/copilot-cloud-config.mjs";
4
4
  import { PartialBy, RequiredBy } from "./types/utility.mjs";
5
5
  import { CopilotErrorEvent, CopilotErrorHandler, CopilotRequestContext } from "./types/error.mjs";
6
- import { AIMessage, ActivityMessage, AudioInputPart, DeveloperMessage, DocumentInputPart, ImageData, ImageInputPart, InputContent, InputContentDataSource, InputContentSource, InputContentUrlSource, Message, ReasoningMessage, Role, SystemMessage, TextInputPart, ToolCall, ToolResult, UserMessage, VideoInputPart } from "./types/message.mjs";
6
+ import { AIMessage, ActivityMessage, AudioInputPart, DeveloperMessage, DocumentInputPart, ImageInputPart, InputContent, InputContentDataSource, InputContentSource, InputContentUrlSource, Message, ReasoningMessage, Role, SystemMessage, TextInputPart, ToolCall, ToolResult, UserMessage, VideoInputPart } from "./types/message.mjs";
7
7
  import { copyToClipboard } from "./utils/clipboard.mjs";
8
- import { BaseCondition, ComparisonCondition, ComparisonRule, Condition, ExistenceCondition, ExistenceRule, LogicalCondition, LogicalRule, Rule, executeConditions } from "./utils/conditions.mjs";
9
- import { ConsoleColors, ConsoleStyles, logCopilotKitPlatformMessage, logStyled, publicApiKeyRequired, styledConsole } from "./utils/console-styling.mjs";
10
- import { BANNER_ERROR_NAMES, COPILOT_CLOUD_ERROR_NAMES, ConfigurationError, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, CopilotKitVersionMismatchError, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, MissingPublicApiKeyError, ResolvedCopilotKitError, Severity, UpgradeRequiredError, ensureStructuredError, getPossibleVersionMismatch, isStructuredCopilotKitError } from "./utils/errors.mjs";
11
- import { JSONSchema, JSONSchemaArray, JSONSchemaBoolean, JSONSchemaNumber, JSONSchemaObject, JSONSchemaString, actionParametersToJsonSchema, convertJsonSchemaToZodSchema, getZodParameters, jsonSchemaToActionParameters } from "./utils/json-schema.mjs";
8
+ import { BANNER_ERROR_NAMES, COPILOT_CLOUD_ERROR_NAMES, ConfigurationError, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitErrorExtensions, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, MissingPublicApiKeyError, ResolvedCopilotKitError, Severity, UpgradeRequiredError, ensureStructuredError, isStructuredCopilotKitError } from "./utils/errors.mjs";
9
+ import { JSONSchema, JSONSchemaArray, JSONSchemaBoolean, JSONSchemaNumber, JSONSchemaObject, JSONSchemaString, actionParametersToJsonSchema, jsonSchemaToActionParameters } from "./utils/json-schema.mjs";
12
10
  import { InspectorMetadataV1, parseInspectorMetadataV1 } from "./utils/inspector-metadata.mjs";
13
11
  import { InspectorLearningEvidence, InspectorLearningInsight, InspectorLearningPage, InspectorLearningRequestV1, InspectorLearningSkill, InspectorLearningSnapshotV1, InspectorLearningTrajectoryEvidence, parseInspectorLearningRequestV1, parseInspectorLearningSnapshotV1, parseInspectorLearningUrl } from "./utils/inspector-learning.mjs";
14
12
  import { InspectorVisibilityOptions, shouldEnableInspector } from "./utils/inspector-visibility.mjs";
15
13
  import { A2UIRuntimeInfo, AgentDescription, IntelligenceRuntimeInfo, MaybePromise, NonEmptyRecord, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, RuntimeEntitlementResponse, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SingleRouteRuntimeInfo, ThreadEndpointRuntimeInfo } from "./utils/types.mjs";
16
- import { dataToUUID, isValidUUID, randomId, randomUUID } from "./utils/random-id.mjs";
14
+ import { randomId, randomUUID } from "./utils/random-id.mjs";
15
+ import { processEnv } from "./utils/process-env.mjs";
17
16
  import { readBody } from "./utils/requests.mjs";
18
17
  import { RowKeyStore, commitRowKeyStore, createRowKeyStore, pruneRowKeyStore, resolveRowRenderKeys, resolveRowRenderKeysById } from "./utils/row-render-keys.mjs";
19
18
  import { isMacOS, parseJson, partialJSONParse, phoenixExponentialBackoff, safeParseToolArgs, tryMap } from "./utils/index.mjs";
@@ -22,9 +21,8 @@ import { isTelemetryDisabled } from "./telemetry/telemetry-disabled.mjs";
22
21
  import { SamplingMeta, TELEMETRY_EMITTER_V1, TELEMETRY_EMITTER_V2, TELEMETRY_SURFACE_V1, TELEMETRY_SURFACE_V2, TelemetryEmitter, TelemetrySurface, TelemetryTransport, UNSAMPLED_RATE, computeSamplingMeta } from "./telemetry/sampling.mjs";
23
22
  import { MODEL_HOST_CLASSES, ModelHostClass, classifyModelHost } from "./telemetry/model-host.mjs";
24
23
  import { LambdaSendOptions, firstNonBlankTelemetryId, lambdaClient, parseAndWarnTelemetryId, parseTelemetryIdFromLicense } from "./telemetry/lambda-client.mjs";
25
- import { TelemetryCapture, TelemetryIdentity } from "./telemetry/telemetry-client.mjs";
26
24
  import { DebugConfig, ResolvedDebugConfig, resolveDebugConfig } from "./debug.mjs";
27
- import { InferSchemaOutput, SchemaToJsonSchemaOptions, StandardJSONSchemaV1, StandardSchemaV1, schemaToJsonSchema } from "./standard-schema.mjs";
25
+ import { InferSchemaOutput, StandardJSONSchemaV1, StandardSchemaV1, schemaToJsonSchema, ɵanySchema } from "./standard-schema.mjs";
28
26
  import { Attachment, AttachmentModality, AttachmentUploadError, AttachmentUploadErrorReason, AttachmentUploadResult, AttachmentsConfig } from "./attachments/types.mjs";
29
27
  import { createAttachmentContent } from "./attachments/content.mjs";
30
28
  import { exceedsMaxSize, formatFileSize, generateVideoThumbnail, getDocumentIcon, getModalityFromMimeType, getSourceUrl, matchesAcceptFilter, readFileAsBase64 } from "./attachments/utils.mjs";
@@ -34,6 +32,7 @@ import { stripIntelligenceRoutingFields } from "./intelligence-routing-fields.mj
34
32
  import { TranscriptionErrorCode, TranscriptionErrorResponse, TranscriptionErrors } from "./transcription-errors.mjs";
35
33
  import { A2UIAllowedCallers, A2UIBasicFunctionInfo, A2UIFunctionPermissions, A2UIFunctionReturnType, A2UIValidationResult, A2UIValidationSeverity, A2UI_BASIC_FUNCTIONS, A2UI_INDEX_FUNCTION, COPILOTKIT_FUNCTIONS, GENERATIVE_UI_DEFAULT_ALLOWED_CALLERS, GENERATIVE_UI_FUNCTIONS, functionCallers, isA2UIBasicFunction, isA2UIValueFunction, isCallBinding, isValidationResult } from "./generative-ui/basic-functions.mjs";
36
34
  import { A2UIActionMessage, A2UIComponentNode, A2UIFunctionCall, A2UIOperation, A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_VERSION, GENERATIVE_UI_ACTIVITY_TYPE, GENERATIVE_UI_AGENT_FUNCTION_CALLS, GENERATIVE_UI_AGENT_FUNCTION_CALLS_OFF_REASON, GENERATIVE_UI_CHAT_TARGET, GENERATIVE_UI_FUNCTION_CALL_ACTIVITY_TYPE, GENERATIVE_UI_MAX_REJECTION_LENGTH, GENERATIVE_UI_MAX_SUMMARY_REJECTIONS, GENERATIVE_UI_MAX_TARGET_COMPONENTS, GENERATIVE_UI_RENDER_TOOL, GENERATIVE_UI_ROOT_ID, GenerativeUIActionBinding, GenerativeUIComponentManifest, GenerativeUIFunctionCallContent, GenerativeUIFunctionManifest, GenerativeUIJSONSchema, GenerativeUIManifest, GenerativeUIRejectedOperation, GenerativeUISurfaceContent, GenerativeUISurfaceStatus, GenerativeUISurfaceSummary, GenerativeUITarget, GenerativeUITemplateChildren, GenerativeUIUserEvent, generativeUIFunctionCallMessageId, generativeUISurfaceMessageId, toA2UIActionMessage } from "./generative-ui/types.mjs";
35
+ import { GENERATIVE_UI_MARKDOWN_WHEN_TO_SHOW, GENERATIVE_UI_WHEN_TO_SHOW, GUIDE_COMPONENTS, GenerativeUIPromptFeature, GenerativeUIPromptFeatures, GenerativeUIPromptItem, GenerativeUIPromptSection, GenerativeUIPromptSpec, GenerativeUISchemaSettings, defaultGenerativeUIPromptSpec, generativeUIPromptFeatures, selectPromptItems } from "./generative-ui/prompt-spec.mjs";
37
36
  import { A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, ALL_GENERATIVE_UI_GUIDE_FEATURES, GENERATIVE_UI_MARKDOWN_GUIDELINES, GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION, GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION, GenerativeUIGuideFeatures, buildGenerativeUIMarkdownGuidelines, generativeUIGuideFeatures } from "./a2ui-prompts.mjs";
38
37
  import { COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_UI_ENVELOPE_FORMAT, CopilotKitUIEnvelope, envelopeToManifest, readCopilotKitUIEnvelope } from "./a2ui-envelope.mjs";
39
38
  import { DebugEventEnvelope } from "./debug-event-envelope.mjs";
@@ -42,6 +41,8 @@ import { AllowedComponents, OperationKind, OperationValidation, ValidateOperatio
42
41
  import { ExtractedRenderUIArgs, RenderUIArgsStream, extractRenderUIArgs } from "./generative-ui/render-ui-args.mjs";
43
42
  import { A2UI_CHILD_LIST_MARK, A2UI_CHILD_LIST_REF, A2UI_COMPONENT_ID_MARK, A2UI_COMPONENT_ID_REF, ChildRef, ChildRefKind, applyChildRefMarks, childIdsAtRefs, childRefKind, collectChildRefs, hasBoundChildRef, mapAtChildRef } from "./generative-ui/child-refs.mjs";
44
43
  import { GENERATIVE_UI_CONTEXT_DESCRIPTION, buildGenerativeUIPrompt } from "./generative-ui/prompt.mjs";
44
+ import { buildCompactGenerativeUISchema } from "./generative-ui/compact-schema.mjs";
45
+ import { applyDescriptionOverrides, renderGenerativeUIComponentList, renderGenerativeUISchema, schemaCoverage } from "./generative-ui/schema-render.mjs";
45
46
  import { LicenseChecker, LicenseFeatures, LicenseOwner, LicensePayload, LicensePayload as LicensePayload$1, LicenseStatus, LicenseTier } from "@copilotkit/license-verifier";
46
47
 
47
48
  //#region src/index.d.ts
@@ -76,5 +77,5 @@ interface LicenseContextValue {
76
77
  */
77
78
  declare function createLicenseContextValue(status: RuntimeLicenseStatus | null | undefined, runtimeEntitlements?: RuntimeEntitlementResponse): LicenseContextValue;
78
79
  //#endregion
79
- export { A2UIActionMessage, A2UIAllowedCallers, A2UIBasicFunctionInfo, A2UIComponentNode, A2UIFunctionCall, A2UIFunctionPermissions, A2UIFunctionReturnType, A2UIOperation, A2UIRuntimeInfo, A2UIValidationResult, A2UIValidationSeverity, A2UI_BASIC_FUNCTIONS, A2UI_CHILD_LIST_MARK, A2UI_CHILD_LIST_REF, A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_COMPONENT_ID_MARK, A2UI_COMPONENT_ID_REF, A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, A2UI_INDEX_FUNCTION, A2UI_VERSION, AG_UI_CHANNEL_EVENT, AIMessage, ALL_GENERATIVE_UI_GUIDE_FEATURES, Action, ActivityMessage, AgentDescription, AllowedComponents, AssistantMessage, Attachment, AttachmentModality, AttachmentUploadError, AttachmentUploadErrorReason, AttachmentUploadResult, AttachmentsConfig, AudioInputPart, BANNER_ERROR_NAMES, BaseCondition, COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_FUNCTIONS, COPILOTKIT_UI_ENVELOPE_FORMAT, COPILOTKIT_VERSION, COPILOT_CLOUD_API_URL, COPILOT_CLOUD_CHAT_URL, COPILOT_CLOUD_ERROR_NAMES, COPILOT_CLOUD_PUBLIC_API_KEY_HEADER, COPILOT_CLOUD_VERSION, ChildRef, ChildRefKind, CoAgentStateRenderHandler, CoAgentStateRenderHandlerArguments, ComparisonCondition, ComparisonRule, Condition, ConfigurationError, ConsoleColors, ConsoleStyles, CopilotCloudConfig, CopilotErrorEvent, CopilotErrorHandler, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, type CopilotKitUIEnvelope, CopilotKitVersionMismatchError, CopilotRequestContext, DEFAULT_AGENT_ID, DebugConfig, type DebugEventEnvelope, DeveloperMessage, DocumentInputPart, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, ExistenceCondition, ExistenceRule, ExtractedRenderUIArgs, type FinalizeRunOptions, FunctionCallHandler, FunctionCallHandlerArguments, FunctionDefinition, GENERATE_SANDBOXED_UI_DESCRIPTION, GENERATIVE_UI_ACTIVITY_TYPE, GENERATIVE_UI_AGENT_FUNCTION_CALLS, GENERATIVE_UI_AGENT_FUNCTION_CALLS_OFF_REASON, GENERATIVE_UI_CHAT_TARGET, GENERATIVE_UI_CONTEXT_DESCRIPTION, GENERATIVE_UI_DEFAULT_ALLOWED_CALLERS, GENERATIVE_UI_FUNCTIONS, GENERATIVE_UI_FUNCTION_CALL_ACTIVITY_TYPE, GENERATIVE_UI_MARKDOWN_GUIDELINES, GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION, GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION, GENERATIVE_UI_MAX_REJECTION_LENGTH, GENERATIVE_UI_MAX_SUMMARY_REJECTIONS, GENERATIVE_UI_MAX_TARGET_COMPONENTS, GENERATIVE_UI_RENDER_TOOL, GENERATIVE_UI_ROOT_ID, GenerativeUIActionBinding, GenerativeUIComponentManifest, GenerativeUIFunctionCallContent, GenerativeUIFunctionManifest, type GenerativeUIGuideFeatures, GenerativeUIJSONSchema, GenerativeUIManifest, GenerativeUIRejectedOperation, GenerativeUISurfaceContent, GenerativeUISurfaceStatus, GenerativeUISurfaceSummary, GenerativeUITarget, GenerativeUITemplateChildren, GenerativeUIUserEvent, ImageData, ImageInputPart, InferSchemaOutput, InputContent, InputContentDataSource, InputContentSource, InputContentUrlSource, InspectorLearningEvidence, InspectorLearningInsight, InspectorLearningPage, InspectorLearningRequestV1, InspectorLearningSkill, InspectorLearningSnapshotV1, InspectorLearningTrajectoryEvidence, InspectorMetadataV1, InspectorVisibilityOptions, IntelligenceRuntimeInfo, JSONSchema, JSONSchemaArray, JSONSchemaBoolean, JSONSchemaNumber, JSONSchemaObject, JSONSchemaString, JSONValue, type LambdaSendOptions, type LicenseChecker, LicenseContextValue, type LicenseFeatures, type LicenseOwner, type LicensePayload, type LicenseStatus, type LicenseTier, LogicalCondition, LogicalRule, MODEL_HOST_CLASSES, MappedParameterTypes, MaybePromise, Message, MissingPublicApiKeyError, ModelHostClass, NonEmptyRecord, OperationKind, OperationValidation, Parameter, PartialBy, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, ReasoningMessage, RenderUIArgsStream, RequiredBy, ResolvedCopilotKitError, ResolvedDebugConfig, Role, RowKeyStore, Rule, type RunEventFinalizer, RuntimeEntitlementResponse, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SamplingMeta, SchemaToJsonSchemaOptions, Severity, SingleRouteRuntimeInfo, StandardJSONSchemaV1, StandardSchemaV1, SystemMessage, TELEMETRY_EMITTER_V1, TELEMETRY_EMITTER_V2, TELEMETRY_SURFACE_V1, TELEMETRY_SURFACE_V2, THREAD_ALREADY_RUNNING_ERROR_CODE, type TelemetryCapture, TelemetryEmitter, type TelemetryIdentity, TelemetrySurface, TelemetryTransport, TextInputPart, ThreadEndpointRuntimeInfo, ToolCall, ToolDefinition, ToolResult, TranscriptionErrorCode, type TranscriptionErrorResponse, TranscriptionErrors, UNSAMPLED_RATE, UpgradeRequiredError, UserMessage, ValidateOperationOptions, VideoInputPart, actionParametersToJsonSchema, applyChildRefMarks, buildGenerativeUIMarkdownGuidelines, buildGenerativeUIPrompt, callerProblem, childIdsAtRefs, childRefKind, classifyModelHost, collectChildRefs, commitRowKeyStore, computeSamplingMeta, convertJsonSchemaToZodSchema, copyToClipboard, createAttachmentContent, createLicenseContextValue, createRowKeyStore, createRunEventFinalizer, dataToUUID, ensureStructuredError, envelopeToManifest, exceedsMaxSize, executeConditions, extractRenderUIArgs, finalizeRunEvents, firstNonBlankTelemetryId, formatFileSize, functionCallers, generateVideoThumbnail, generativeUIFunctionCallMessageId, generativeUIGuideFeatures, generativeUISurfaceMessageId, getDocumentIcon, getModalityFromMimeType, getOperationKind, getOperationSurfaceId, getPossibleVersionMismatch, getSourceUrl, getZodParameters, hasBoundChildRef, isA2UIBasicFunction, isA2UIValueFunction, isActionBinding, isCallBinding, isIndexCall, isMacOS, isPathBinding, isStructuredCopilotKitError, isTelemetryDisabled, isValidUUID, isValidationResult, jsonSchemaToActionParameters, lambdaClient, logCopilotKitPlatformMessage, logStyled, logger, mapAtChildRef, matchesAcceptFilter, parseAndWarnTelemetryId, parseInspectorLearningRequestV1, parseInspectorLearningSnapshotV1, parseInspectorLearningUrl, parseInspectorMetadataV1, parseJson, parseTelemetryIdFromLicense, partialJSONParse, phoenixExponentialBackoff, pruneRowKeyStore, publicApiKeyRequired, randomId, randomUUID, readBody, readCopilotKitUIEnvelope, readFileAsBase64, resolveDebugConfig, resolveRowRenderKeys, resolveRowRenderKeysById, safeParseToolArgs, schemaToJsonSchema, shouldEnableInspector, stripIntelligenceRoutingFields, styledConsole, toA2UIActionMessage, tryMap, validateOperation };
80
+ export { A2UIActionMessage, A2UIAllowedCallers, A2UIBasicFunctionInfo, A2UIComponentNode, A2UIFunctionCall, A2UIFunctionPermissions, A2UIFunctionReturnType, A2UIOperation, A2UIRuntimeInfo, A2UIValidationResult, A2UIValidationSeverity, A2UI_BASIC_FUNCTIONS, A2UI_CHILD_LIST_MARK, A2UI_CHILD_LIST_REF, A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_COMPONENT_ID_MARK, A2UI_COMPONENT_ID_REF, A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, A2UI_INDEX_FUNCTION, A2UI_VERSION, AG_UI_CHANNEL_EVENT, AIMessage, ALL_GENERATIVE_UI_GUIDE_FEATURES, Action, ActivityMessage, AgentDescription, AllowedComponents, AssistantMessage, Attachment, AttachmentModality, AttachmentUploadError, AttachmentUploadErrorReason, AttachmentUploadResult, AttachmentsConfig, AudioInputPart, BANNER_ERROR_NAMES, COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_FUNCTIONS, COPILOTKIT_UI_ENVELOPE_FORMAT, COPILOTKIT_VERSION, COPILOT_CLOUD_API_URL, COPILOT_CLOUD_CHAT_URL, COPILOT_CLOUD_ERROR_NAMES, COPILOT_CLOUD_PUBLIC_API_KEY_HEADER, COPILOT_CLOUD_VERSION, ChildRef, ChildRefKind, CoAgentStateRenderHandler, CoAgentStateRenderHandlerArguments, ConfigurationError, CopilotCloudConfig, CopilotErrorEvent, CopilotErrorHandler, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitErrorExtensions, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, type CopilotKitUIEnvelope, CopilotRequestContext, DEFAULT_AGENT_ID, DebugConfig, type DebugEventEnvelope, DeveloperMessage, DocumentInputPart, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, ExtractedRenderUIArgs, type FinalizeRunOptions, FunctionCallHandler, FunctionCallHandlerArguments, FunctionDefinition, GENERATE_SANDBOXED_UI_DESCRIPTION, GENERATIVE_UI_ACTIVITY_TYPE, GENERATIVE_UI_AGENT_FUNCTION_CALLS, GENERATIVE_UI_AGENT_FUNCTION_CALLS_OFF_REASON, GENERATIVE_UI_CHAT_TARGET, GENERATIVE_UI_CONTEXT_DESCRIPTION, GENERATIVE_UI_DEFAULT_ALLOWED_CALLERS, GENERATIVE_UI_FUNCTIONS, GENERATIVE_UI_FUNCTION_CALL_ACTIVITY_TYPE, GENERATIVE_UI_MARKDOWN_GUIDELINES, GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION, GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION, GENERATIVE_UI_MARKDOWN_WHEN_TO_SHOW, GENERATIVE_UI_MAX_REJECTION_LENGTH, GENERATIVE_UI_MAX_SUMMARY_REJECTIONS, GENERATIVE_UI_MAX_TARGET_COMPONENTS, GENERATIVE_UI_RENDER_TOOL, GENERATIVE_UI_ROOT_ID, GENERATIVE_UI_WHEN_TO_SHOW, GUIDE_COMPONENTS, GenerativeUIActionBinding, GenerativeUIComponentManifest, GenerativeUIFunctionCallContent, GenerativeUIFunctionManifest, type GenerativeUIGuideFeatures, GenerativeUIJSONSchema, GenerativeUIManifest, GenerativeUIPromptFeature, GenerativeUIPromptFeatures, GenerativeUIPromptItem, GenerativeUIPromptSection, GenerativeUIPromptSpec, GenerativeUIRejectedOperation, GenerativeUISchemaSettings, GenerativeUISurfaceContent, GenerativeUISurfaceStatus, GenerativeUISurfaceSummary, GenerativeUITarget, GenerativeUITemplateChildren, GenerativeUIUserEvent, ImageInputPart, InferSchemaOutput, InputContent, InputContentDataSource, InputContentSource, InputContentUrlSource, InspectorLearningEvidence, InspectorLearningInsight, InspectorLearningPage, InspectorLearningRequestV1, InspectorLearningSkill, InspectorLearningSnapshotV1, InspectorLearningTrajectoryEvidence, InspectorMetadataV1, InspectorVisibilityOptions, IntelligenceRuntimeInfo, JSONSchema, JSONSchemaArray, JSONSchemaBoolean, JSONSchemaNumber, JSONSchemaObject, JSONSchemaString, JSONValue, type LambdaSendOptions, type LicenseChecker, LicenseContextValue, type LicenseFeatures, type LicenseOwner, type LicensePayload, type LicenseStatus, type LicenseTier, MODEL_HOST_CLASSES, MappedParameterTypes, MaybePromise, Message, MissingPublicApiKeyError, ModelHostClass, NonEmptyRecord, OperationKind, OperationValidation, Parameter, PartialBy, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, ReasoningMessage, RenderUIArgsStream, RequiredBy, ResolvedCopilotKitError, ResolvedDebugConfig, Role, RowKeyStore, type RunEventFinalizer, RuntimeEntitlementResponse, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SamplingMeta, Severity, SingleRouteRuntimeInfo, StandardJSONSchemaV1, StandardSchemaV1, SystemMessage, TELEMETRY_EMITTER_V1, TELEMETRY_EMITTER_V2, TELEMETRY_SURFACE_V1, TELEMETRY_SURFACE_V2, THREAD_ALREADY_RUNNING_ERROR_CODE, TelemetryEmitter, TelemetrySurface, TelemetryTransport, TextInputPart, ThreadEndpointRuntimeInfo, ToolCall, ToolDefinition, ToolResult, TranscriptionErrorCode, type TranscriptionErrorResponse, TranscriptionErrors, UNSAMPLED_RATE, UpgradeRequiredError, UserMessage, ValidateOperationOptions, VideoInputPart, actionParametersToJsonSchema, applyChildRefMarks, applyDescriptionOverrides, buildCompactGenerativeUISchema, buildGenerativeUIMarkdownGuidelines, buildGenerativeUIPrompt, callerProblem, childIdsAtRefs, childRefKind, classifyModelHost, collectChildRefs, commitRowKeyStore, computeSamplingMeta, copyToClipboard, createAttachmentContent, createLicenseContextValue, createRowKeyStore, createRunEventFinalizer, defaultGenerativeUIPromptSpec, ensureStructuredError, envelopeToManifest, exceedsMaxSize, extractRenderUIArgs, finalizeRunEvents, firstNonBlankTelemetryId, formatFileSize, functionCallers, generateVideoThumbnail, generativeUIFunctionCallMessageId, generativeUIGuideFeatures, generativeUIPromptFeatures, generativeUISurfaceMessageId, getDocumentIcon, getModalityFromMimeType, getOperationKind, getOperationSurfaceId, getSourceUrl, hasBoundChildRef, isA2UIBasicFunction, isA2UIValueFunction, isActionBinding, isCallBinding, isIndexCall, isMacOS, isPathBinding, isStructuredCopilotKitError, isTelemetryDisabled, isValidationResult, jsonSchemaToActionParameters, lambdaClient, logger, mapAtChildRef, matchesAcceptFilter, parseAndWarnTelemetryId, parseInspectorLearningRequestV1, parseInspectorLearningSnapshotV1, parseInspectorLearningUrl, parseInspectorMetadataV1, parseJson, parseTelemetryIdFromLicense, partialJSONParse, phoenixExponentialBackoff, processEnv, pruneRowKeyStore, randomId, randomUUID, readBody, readCopilotKitUIEnvelope, readFileAsBase64, renderGenerativeUIComponentList, renderGenerativeUISchema, resolveDebugConfig, resolveRowRenderKeys, resolveRowRenderKeysById, safeParseToolArgs, schemaCoverage, schemaToJsonSchema, selectPromptItems, shouldEnableInspector, stripIntelligenceRoutingFields, toA2UIActionMessage, tryMap, validateOperation, ɵanySchema };
80
81
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmDa,kBAAA;;;;;UA8BI,mBAAA;;EAEf,MAAA,EAAQ,oBAAA;;EAER,OAAA,EAAS,gBAAA;;EAET,YAAA,GAAe,OAAA;;EAEf,QAAA,GAAW,OAAA;AAAA;;;;;;;;;;;;;;AAtCb;iBAsEgB,yBAAA,CACd,MAAA,EAAQ,oBAAA,qBACR,mBAAA,GAAsB,0BAAA,GACrB,mBAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsCa,kBAAA;;;;;UA8BI,mBAAA;;EAEf,MAAA,EAAQ,oBAAA;;EAER,OAAA,EAAS,gBAAA;;EAET,YAAA,GAAe,OAAA;;EAEf,QAAA,GAAW,OAAA;AAAA;;;;;;;;;;;;;;;iBAgCG,yBAAA,CACd,MAAA,EAAQ,oBAAA,qBACR,mBAAA,GAAsB,0BAAA,GACrB,mBAAA"}
package/dist/index.mjs CHANGED
@@ -1,13 +1,12 @@
1
1
  import { copyToClipboard } from "./utils/clipboard.mjs";
2
- import { executeConditions } from "./utils/conditions.mjs";
3
- import { ConsoleColors, ConsoleStyles, logCopilotKitPlatformMessage, logStyled, publicApiKeyRequired, styledConsole } from "./utils/console-styling.mjs";
4
- import { BANNER_ERROR_NAMES, COPILOT_CLOUD_ERROR_NAMES, ConfigurationError, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, CopilotKitVersionMismatchError, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, MissingPublicApiKeyError, ResolvedCopilotKitError, Severity, UpgradeRequiredError, ensureStructuredError, getPossibleVersionMismatch, isStructuredCopilotKitError } from "./utils/errors.mjs";
5
- import { actionParametersToJsonSchema, convertJsonSchemaToZodSchema, getZodParameters, jsonSchemaToActionParameters } from "./utils/json-schema.mjs";
2
+ import { BANNER_ERROR_NAMES, COPILOT_CLOUD_ERROR_NAMES, ConfigurationError, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, MissingPublicApiKeyError, ResolvedCopilotKitError, Severity, UpgradeRequiredError, ensureStructuredError, isStructuredCopilotKitError } from "./utils/errors.mjs";
3
+ import { actionParametersToJsonSchema, jsonSchemaToActionParameters } from "./utils/json-schema.mjs";
6
4
  import { parseInspectorMetadataV1 } from "./utils/inspector-metadata.mjs";
7
5
  import { parseInspectorLearningRequestV1, parseInspectorLearningSnapshotV1, parseInspectorLearningUrl } from "./utils/inspector-learning.mjs";
8
6
  import { shouldEnableInspector } from "./utils/inspector-visibility.mjs";
9
7
  import { RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE } from "./utils/types.mjs";
10
- import { dataToUUID, isValidUUID, randomId, randomUUID } from "./utils/random-id.mjs";
8
+ import { randomId, randomUUID } from "./utils/random-id.mjs";
9
+ import { processEnv } from "./utils/process-env.mjs";
11
10
  import { readBody } from "./utils/requests.mjs";
12
11
  import { commitRowKeyStore, createRowKeyStore, pruneRowKeyStore, resolveRowRenderKeys, resolveRowRenderKeysById } from "./utils/row-render-keys.mjs";
13
12
  import { isMacOS, parseJson, partialJSONParse, phoenixExponentialBackoff, safeParseToolArgs, tryMap } from "./utils/index.mjs";
@@ -17,7 +16,7 @@ import { TELEMETRY_EMITTER_V1, TELEMETRY_EMITTER_V2, TELEMETRY_SURFACE_V1, TELEM
17
16
  import { MODEL_HOST_CLASSES, classifyModelHost } from "./telemetry/model-host.mjs";
18
17
  import { firstNonBlankTelemetryId, lambdaClient, parseAndWarnTelemetryId, parseTelemetryIdFromLicense } from "./telemetry/lambda-client.mjs";
19
18
  import { resolveDebugConfig } from "./debug.mjs";
20
- import { schemaToJsonSchema } from "./standard-schema.mjs";
19
+ import { schemaToJsonSchema, ɵanySchema } from "./standard-schema.mjs";
21
20
  import { createAttachmentContent } from "./attachments/content.mjs";
22
21
  import { exceedsMaxSize, formatFileSize, generateVideoThumbnail, getDocumentIcon, getModalityFromMimeType, getSourceUrl, matchesAcceptFilter, readFileAsBase64 } from "./attachments/utils.mjs";
23
22
  import { logger } from "./logger.mjs";
@@ -28,11 +27,14 @@ import { version } from "./package.mjs";
28
27
  import { A2UI_BASIC_FUNCTIONS, A2UI_INDEX_FUNCTION, COPILOTKIT_FUNCTIONS, GENERATIVE_UI_DEFAULT_ALLOWED_CALLERS, GENERATIVE_UI_FUNCTIONS, functionCallers, isA2UIBasicFunction, isA2UIValueFunction, isCallBinding, isValidationResult } from "./generative-ui/basic-functions.mjs";
29
28
  import { A2UI_CHILD_LIST_MARK, A2UI_CHILD_LIST_REF, A2UI_COMPONENT_ID_MARK, A2UI_COMPONENT_ID_REF, applyChildRefMarks, childIdsAtRefs, childRefKind, collectChildRefs, hasBoundChildRef, mapAtChildRef } from "./generative-ui/child-refs.mjs";
30
29
  import { A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_VERSION, GENERATIVE_UI_ACTIVITY_TYPE, GENERATIVE_UI_AGENT_FUNCTION_CALLS, GENERATIVE_UI_AGENT_FUNCTION_CALLS_OFF_REASON, GENERATIVE_UI_CHAT_TARGET, GENERATIVE_UI_FUNCTION_CALL_ACTIVITY_TYPE, GENERATIVE_UI_MAX_REJECTION_LENGTH, GENERATIVE_UI_MAX_SUMMARY_REJECTIONS, GENERATIVE_UI_MAX_TARGET_COMPONENTS, GENERATIVE_UI_RENDER_TOOL, GENERATIVE_UI_ROOT_ID, generativeUIFunctionCallMessageId, generativeUISurfaceMessageId, toA2UIActionMessage } from "./generative-ui/types.mjs";
30
+ import { GENERATIVE_UI_MARKDOWN_WHEN_TO_SHOW, GENERATIVE_UI_WHEN_TO_SHOW, GUIDE_COMPONENTS, defaultGenerativeUIPromptSpec, generativeUIPromptFeatures, selectPromptItems } from "./generative-ui/prompt-spec.mjs";
31
31
  import { A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, ALL_GENERATIVE_UI_GUIDE_FEATURES, GENERATIVE_UI_MARKDOWN_GUIDELINES, GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION, GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION, buildGenerativeUIMarkdownGuidelines, generativeUIGuideFeatures } from "./a2ui-prompts.mjs";
32
32
  import { COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_UI_ENVELOPE_FORMAT, envelopeToManifest, readCopilotKitUIEnvelope } from "./a2ui-envelope.mjs";
33
33
  import { GENERATE_SANDBOXED_UI_DESCRIPTION } from "./open-generative-ui-prompts.mjs";
34
34
  import { callerProblem, getOperationKind, getOperationSurfaceId, isActionBinding, isIndexCall, isPathBinding, validateOperation } from "./generative-ui/validate-operation.mjs";
35
35
  import { RenderUIArgsStream, extractRenderUIArgs } from "./generative-ui/render-ui-args.mjs";
36
+ import { buildCompactGenerativeUISchema } from "./generative-ui/compact-schema.mjs";
37
+ import { applyDescriptionOverrides, renderGenerativeUIComponentList, renderGenerativeUISchema, schemaCoverage } from "./generative-ui/schema-render.mjs";
36
38
  import { GENERATIVE_UI_CONTEXT_DESCRIPTION, buildGenerativeUIPrompt } from "./generative-ui/prompt.mjs";
37
39
 
38
40
  //#region src/index.ts
@@ -75,5 +77,5 @@ function createLicenseContextValue(status, runtimeEntitlements) {
75
77
  }
76
78
 
77
79
  //#endregion
78
- export { A2UI_BASIC_FUNCTIONS, A2UI_CHILD_LIST_MARK, A2UI_CHILD_LIST_REF, A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_COMPONENT_ID_MARK, A2UI_COMPONENT_ID_REF, A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, A2UI_INDEX_FUNCTION, A2UI_VERSION, AG_UI_CHANNEL_EVENT, ALL_GENERATIVE_UI_GUIDE_FEATURES, BANNER_ERROR_NAMES, COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_FUNCTIONS, COPILOTKIT_UI_ENVELOPE_FORMAT, COPILOTKIT_VERSION, COPILOT_CLOUD_API_URL, COPILOT_CLOUD_CHAT_URL, COPILOT_CLOUD_ERROR_NAMES, COPILOT_CLOUD_PUBLIC_API_KEY_HEADER, COPILOT_CLOUD_VERSION, ConfigurationError, ConsoleColors, ConsoleStyles, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, CopilotKitVersionMismatchError, DEFAULT_AGENT_ID, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, GENERATE_SANDBOXED_UI_DESCRIPTION, GENERATIVE_UI_ACTIVITY_TYPE, GENERATIVE_UI_AGENT_FUNCTION_CALLS, GENERATIVE_UI_AGENT_FUNCTION_CALLS_OFF_REASON, GENERATIVE_UI_CHAT_TARGET, GENERATIVE_UI_CONTEXT_DESCRIPTION, GENERATIVE_UI_DEFAULT_ALLOWED_CALLERS, GENERATIVE_UI_FUNCTIONS, GENERATIVE_UI_FUNCTION_CALL_ACTIVITY_TYPE, GENERATIVE_UI_MARKDOWN_GUIDELINES, GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION, GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION, GENERATIVE_UI_MAX_REJECTION_LENGTH, GENERATIVE_UI_MAX_SUMMARY_REJECTIONS, GENERATIVE_UI_MAX_TARGET_COMPONENTS, GENERATIVE_UI_RENDER_TOOL, GENERATIVE_UI_ROOT_ID, MODEL_HOST_CLASSES, MissingPublicApiKeyError, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, RenderUIArgsStream, ResolvedCopilotKitError, Severity, TELEMETRY_EMITTER_V1, TELEMETRY_EMITTER_V2, TELEMETRY_SURFACE_V1, TELEMETRY_SURFACE_V2, THREAD_ALREADY_RUNNING_ERROR_CODE, TranscriptionErrorCode, TranscriptionErrors, UNSAMPLED_RATE, UpgradeRequiredError, actionParametersToJsonSchema, applyChildRefMarks, buildGenerativeUIMarkdownGuidelines, buildGenerativeUIPrompt, callerProblem, childIdsAtRefs, childRefKind, classifyModelHost, collectChildRefs, commitRowKeyStore, computeSamplingMeta, convertJsonSchemaToZodSchema, copyToClipboard, createAttachmentContent, createLicenseContextValue, createRowKeyStore, createRunEventFinalizer, dataToUUID, ensureStructuredError, envelopeToManifest, exceedsMaxSize, executeConditions, extractRenderUIArgs, finalizeRunEvents, firstNonBlankTelemetryId, formatFileSize, functionCallers, generateVideoThumbnail, generativeUIFunctionCallMessageId, generativeUIGuideFeatures, generativeUISurfaceMessageId, getDocumentIcon, getModalityFromMimeType, getOperationKind, getOperationSurfaceId, getPossibleVersionMismatch, getSourceUrl, getZodParameters, hasBoundChildRef, isA2UIBasicFunction, isA2UIValueFunction, isActionBinding, isCallBinding, isIndexCall, isMacOS, isPathBinding, isStructuredCopilotKitError, isTelemetryDisabled, isValidUUID, isValidationResult, jsonSchemaToActionParameters, lambdaClient, logCopilotKitPlatformMessage, logStyled, logger, mapAtChildRef, matchesAcceptFilter, parseAndWarnTelemetryId, parseInspectorLearningRequestV1, parseInspectorLearningSnapshotV1, parseInspectorLearningUrl, parseInspectorMetadataV1, parseJson, parseTelemetryIdFromLicense, partialJSONParse, phoenixExponentialBackoff, pruneRowKeyStore, publicApiKeyRequired, randomId, randomUUID, readBody, readCopilotKitUIEnvelope, readFileAsBase64, resolveDebugConfig, resolveRowRenderKeys, resolveRowRenderKeysById, safeParseToolArgs, schemaToJsonSchema, shouldEnableInspector, stripIntelligenceRoutingFields, styledConsole, toA2UIActionMessage, tryMap, validateOperation };
80
+ export { A2UI_BASIC_FUNCTIONS, A2UI_CHILD_LIST_MARK, A2UI_CHILD_LIST_REF, A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_COMPONENT_ID_MARK, A2UI_COMPONENT_ID_REF, A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, A2UI_INDEX_FUNCTION, A2UI_VERSION, AG_UI_CHANNEL_EVENT, ALL_GENERATIVE_UI_GUIDE_FEATURES, BANNER_ERROR_NAMES, COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_FUNCTIONS, COPILOTKIT_UI_ENVELOPE_FORMAT, COPILOTKIT_VERSION, COPILOT_CLOUD_API_URL, COPILOT_CLOUD_CHAT_URL, COPILOT_CLOUD_ERROR_NAMES, COPILOT_CLOUD_PUBLIC_API_KEY_HEADER, COPILOT_CLOUD_VERSION, ConfigurationError, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, DEFAULT_AGENT_ID, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, GENERATE_SANDBOXED_UI_DESCRIPTION, GENERATIVE_UI_ACTIVITY_TYPE, GENERATIVE_UI_AGENT_FUNCTION_CALLS, GENERATIVE_UI_AGENT_FUNCTION_CALLS_OFF_REASON, GENERATIVE_UI_CHAT_TARGET, GENERATIVE_UI_CONTEXT_DESCRIPTION, GENERATIVE_UI_DEFAULT_ALLOWED_CALLERS, GENERATIVE_UI_FUNCTIONS, GENERATIVE_UI_FUNCTION_CALL_ACTIVITY_TYPE, GENERATIVE_UI_MARKDOWN_GUIDELINES, GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION, GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION, GENERATIVE_UI_MARKDOWN_WHEN_TO_SHOW, GENERATIVE_UI_MAX_REJECTION_LENGTH, GENERATIVE_UI_MAX_SUMMARY_REJECTIONS, GENERATIVE_UI_MAX_TARGET_COMPONENTS, GENERATIVE_UI_RENDER_TOOL, GENERATIVE_UI_ROOT_ID, GENERATIVE_UI_WHEN_TO_SHOW, GUIDE_COMPONENTS, MODEL_HOST_CLASSES, MissingPublicApiKeyError, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, RenderUIArgsStream, ResolvedCopilotKitError, Severity, TELEMETRY_EMITTER_V1, TELEMETRY_EMITTER_V2, TELEMETRY_SURFACE_V1, TELEMETRY_SURFACE_V2, THREAD_ALREADY_RUNNING_ERROR_CODE, TranscriptionErrorCode, TranscriptionErrors, UNSAMPLED_RATE, UpgradeRequiredError, actionParametersToJsonSchema, applyChildRefMarks, applyDescriptionOverrides, buildCompactGenerativeUISchema, buildGenerativeUIMarkdownGuidelines, buildGenerativeUIPrompt, callerProblem, childIdsAtRefs, childRefKind, classifyModelHost, collectChildRefs, commitRowKeyStore, computeSamplingMeta, copyToClipboard, createAttachmentContent, createLicenseContextValue, createRowKeyStore, createRunEventFinalizer, defaultGenerativeUIPromptSpec, ensureStructuredError, envelopeToManifest, exceedsMaxSize, extractRenderUIArgs, finalizeRunEvents, firstNonBlankTelemetryId, formatFileSize, functionCallers, generateVideoThumbnail, generativeUIFunctionCallMessageId, generativeUIGuideFeatures, generativeUIPromptFeatures, generativeUISurfaceMessageId, getDocumentIcon, getModalityFromMimeType, getOperationKind, getOperationSurfaceId, getSourceUrl, hasBoundChildRef, isA2UIBasicFunction, isA2UIValueFunction, isActionBinding, isCallBinding, isIndexCall, isMacOS, isPathBinding, isStructuredCopilotKitError, isTelemetryDisabled, isValidationResult, jsonSchemaToActionParameters, lambdaClient, logger, mapAtChildRef, matchesAcceptFilter, parseAndWarnTelemetryId, parseInspectorLearningRequestV1, parseInspectorLearningSnapshotV1, parseInspectorLearningUrl, parseInspectorMetadataV1, parseJson, parseTelemetryIdFromLicense, partialJSONParse, phoenixExponentialBackoff, processEnv, pruneRowKeyStore, randomId, randomUUID, readBody, readCopilotKitUIEnvelope, readFileAsBase64, renderGenerativeUIComponentList, renderGenerativeUISchema, resolveDebugConfig, resolveRowRenderKeys, resolveRowRenderKeysById, safeParseToolArgs, schemaCoverage, schemaToJsonSchema, selectPromptItems, shouldEnableInspector, stripIntelligenceRoutingFields, toA2UIActionMessage, tryMap, validateOperation, ɵanySchema };
79
81
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["packageJson.version"],"sources":["../src/index.ts"],"sourcesContent":["export * from \"./types\";\nexport * from \"./utils\";\nexport * from \"./constants\";\n// Telemetry is split deliberately. `TelemetryClient` imports\n// `@segment/analytics-node`, which imports `node-fetch`, which imports the\n// Node built-ins `stream`, `http`, `https` and `zlib`. Browser bundlers\n// resolve the whole module graph before they tree-shake, so re-exporting\n// that module here made every browser build of a dependent package print\n// \"Module ... has been externalized for browser compatibility\" warnings,\n// even when the consumer never touched telemetry (#4151). Only the\n// browser-safe telemetry surface is re-exported from this entry. Server\n// code that needs the client imports it from `@copilotkit/shared/telemetry`.\n// This mirrors the license-verifier note below.\nexport { isTelemetryDisabled } from \"./telemetry/telemetry-disabled\";\nexport * from \"./telemetry/sampling\";\n// Pure string classification with no imports, so it carries no runtime edge\n// into browser builds — same reasoning as `sampling` above.\nexport * from \"./telemetry/model-host\";\nexport {\n firstNonBlankTelemetryId,\n lambdaClient,\n parseTelemetryIdFromLicense,\n parseAndWarnTelemetryId,\n} from \"./telemetry/lambda-client\";\nexport type { LambdaSendOptions } from \"./telemetry/lambda-client\";\n// Types only: erased at build time, so they add no runtime edge to\n// `telemetry-client.ts` and therefore none to @segment/analytics-node.\nexport type {\n TelemetryCapture,\n TelemetryIdentity,\n} from \"./telemetry/telemetry-client\";\nexport * from \"./debug\";\nexport * from \"./standard-schema\";\nexport * from \"./attachments\";\n\nexport { logger } from \"./logger\";\nexport {\n createRunEventFinalizer,\n finalizeRunEvents,\n type FinalizeRunOptions,\n type RunEventFinalizer,\n} from \"./finalize-events\";\nexport { stripIntelligenceRoutingFields } from \"./intelligence-routing-fields\";\n\nexport {\n TranscriptionErrorCode,\n TranscriptionErrors,\n type TranscriptionErrorResponse,\n} from \"./transcription-errors\";\n\nimport * as packageJson from \"../package.json\";\nexport const COPILOTKIT_VERSION = packageJson.version;\n\n// Re-export only types from license-verifier (types are erased at compile time,\n// so they don't pull in the Node-only `crypto` dependency into client bundles).\n// Server-side packages (e.g. @copilotkit/runtime) should import runtime functions\n// like createLicenseChecker and getLicenseWarningHeader directly from\n// @copilotkit/license-verifier.\nexport type {\n LicenseChecker,\n LicenseStatus,\n LicensePayload,\n LicenseFeatures,\n LicenseTier,\n LicenseOwner,\n} from \"@copilotkit/license-verifier\";\n\nimport type { LicensePayload } from \"@copilotkit/license-verifier\";\nimport type {\n RuntimeEntitlementResponse,\n RuntimeLicenseStatus,\n} from \"./utils/types\";\n\n// LicenseContextValue was dropped from license-verifier's public API in\n// 0.3.0, so it is defined here. The context shape is owned by this package\n// anyway via createLicenseContextValue below.\n\n/**\n * License context value exposed to child components.\n * Frontend providers create their own context using this shape.\n */\nexport interface LicenseContextValue {\n /** Effective license status after structured entitlement precedence. Null until known. */\n status: RuntimeLicenseStatus | null;\n /** The license payload if available. Always null on the client; the payload stays server-side. */\n license: LicensePayload | null;\n /** Whether a feature is licensed. Ready entitlements override legacy status behavior. */\n checkFeature: (feature: string) => boolean;\n /** Get a numeric feature limit. Zero means unlimited; null means not applicable. */\n getLimit: (feature: string) => number | null;\n}\n\n/** Read a record value without traversing its prototype chain. */\nfunction getOwnRecordValue<Value>(\n record: Readonly<Record<string, Value>>,\n key: string,\n): Value | undefined {\n return Object.prototype.hasOwnProperty.call(record, key)\n ? record[key]\n : undefined;\n}\n\n/** Legacy UI surfaces that remain available for every active entitlement. */\nfunction isLegacyUiFeature(feature: string): boolean {\n return feature === \"chat\" || feature === \"popup\" || feature === \"sidebar\";\n}\n\n/**\n * Client-safe license context factory, driven by the license authority the\n * runtime reports via /info.\n *\n * A ready managed entitlement is authoritative in both directions. A ready\n * active self-hosted entitlement is also authoritative, while an inactive\n * self-hosted response preserves the legacy signed-license fallback. Active\n * entitlements supply feature grants and limits; authoritative inactive\n * entitlements deny every feature and limit. Older runtimes that report only a\n * status retain the legacy behavior: features are enabled unless the status is\n * \"expired\" or \"invalid\", and no limits are reported. This is inlined here to\n * avoid importing the full license-verifier bundle (which depends on Node's\n * `crypto`) into browser bundles.\n */\nexport function createLicenseContextValue(\n status: RuntimeLicenseStatus | null | undefined,\n runtimeEntitlements?: RuntimeEntitlementResponse,\n): LicenseContextValue {\n const readyEntitlement =\n runtimeEntitlements?.status === \"ready\"\n ? runtimeEntitlements.entitlement\n : null;\n const hasUsableSelfHostedLegacyFallback =\n readyEntitlement &&\n !readyEntitlement.active &&\n readyEntitlement.source === \"selfHostedDeploymentLicense\" &&\n (status === \"valid\" || status === \"expiring\");\n const featureAuthority =\n readyEntitlement && !hasUsableSelfHostedLegacyFallback\n ? readyEntitlement\n : null;\n const activeEntitlement = featureAuthority?.active ? featureAuthority : null;\n const resolvedStatus = activeEntitlement\n ? \"valid\"\n : readyEntitlement?.source === \"managedOrgSubscription\" ||\n readyEntitlement?.source === \"awsMarketplaceDeploymentLicense\"\n ? \"none\"\n : featureAuthority\n ? (status ?? \"none\")\n : (status ?? null);\n const featuresEnabled =\n resolvedStatus !== \"expired\" && resolvedStatus !== \"invalid\";\n\n return {\n status: resolvedStatus,\n license: null,\n checkFeature: (feature) =>\n featureAuthority\n ? activeEntitlement\n ? feature === \"threads\" &&\n Object.prototype.hasOwnProperty.call(\n activeEntitlement.limits,\n \"threads.max_count\",\n )\n ? true\n : (getOwnRecordValue(activeEntitlement.features, feature) ??\n isLegacyUiFeature(feature))\n : false\n : featuresEnabled,\n getLimit: (feature) =>\n activeEntitlement\n ? (getOwnRecordValue(activeEntitlement.limits, feature) ?? null)\n : null,\n };\n}\n\nexport {\n A2UI_DEFAULT_GENERATION_GUIDELINES,\n A2UI_DEFAULT_DESIGN_GUIDELINES,\n ALL_GENERATIVE_UI_GUIDE_FEATURES,\n buildGenerativeUIMarkdownGuidelines,\n generativeUIGuideFeatures,\n GENERATIVE_UI_MARKDOWN_GUIDELINES,\n GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION,\n GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION,\n} from \"./a2ui-prompts\";\nexport type { GenerativeUIGuideFeatures } from \"./a2ui-prompts\";\nexport {\n COPILOTKIT_FORWARDED_PROPS_KEY,\n COPILOTKIT_UI_ENVELOPE_FORMAT,\n envelopeToManifest,\n readCopilotKitUIEnvelope,\n} from \"./a2ui-envelope\";\nexport type { CopilotKitUIEnvelope } from \"./a2ui-envelope\";\n\nexport type { DebugEventEnvelope } from \"./debug-event-envelope\";\n\nexport { GENERATE_SANDBOXED_UI_DESCRIPTION } from \"./open-generative-ui-prompts\";\nexport * from \"./generative-ui\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,MAAa,qBAAqBA;;AA0ClC,SAAS,kBACP,QACA,KACmB;AACnB,QAAO,OAAO,UAAU,eAAe,KAAK,QAAQ,IAAI,GACpD,OAAO,OACP;;;AAIN,SAAS,kBAAkB,SAA0B;AACnD,QAAO,YAAY,UAAU,YAAY,WAAW,YAAY;;;;;;;;;;;;;;;;AAiBlE,SAAgB,0BACd,QACA,qBACqB;CACrB,MAAM,mBACJ,qBAAqB,WAAW,UAC5B,oBAAoB,cACpB;CACN,MAAM,oCACJ,oBACA,CAAC,iBAAiB,UAClB,iBAAiB,WAAW,kCAC3B,WAAW,WAAW,WAAW;CACpC,MAAM,mBACJ,oBAAoB,CAAC,oCACjB,mBACA;CACN,MAAM,oBAAoB,kBAAkB,SAAS,mBAAmB;CACxE,MAAM,iBAAiB,oBACnB,UACA,kBAAkB,WAAW,4BAC3B,kBAAkB,WAAW,oCAC7B,SACA,mBACG,UAAU,SACV,UAAU;CACnB,MAAM,kBACJ,mBAAmB,aAAa,mBAAmB;AAErD,QAAO;EACL,QAAQ;EACR,SAAS;EACT,eAAe,YACb,mBACI,oBACE,YAAY,aACZ,OAAO,UAAU,eAAe,KAC9B,kBAAkB,QAClB,oBACD,GACC,OACC,kBAAkB,kBAAkB,UAAU,QAAQ,IACvD,kBAAkB,QAAQ,GAC5B,QACF;EACN,WAAW,YACT,oBACK,kBAAkB,kBAAkB,QAAQ,QAAQ,IAAI,OACzD;EACP"}
1
+ {"version":3,"file":"index.mjs","names":["packageJson.version"],"sources":["../src/index.ts"],"sourcesContent":["export * from \"./types\";\nexport * from \"./utils\";\nexport * from \"./constants\";\n// Only browser-safe telemetry helpers live here. The runtime owns its\n// telemetry client (`packages/runtime/src/runtime/telemetry`), so this package\n// imports no Node-only analytics SDK (#4151).\nexport { isTelemetryDisabled } from \"./telemetry/telemetry-disabled\";\nexport * from \"./telemetry/sampling\";\n// Pure string classification with no imports, so it carries no runtime edge\n// into browser builds — same reasoning as `sampling` above.\nexport * from \"./telemetry/model-host\";\nexport {\n firstNonBlankTelemetryId,\n lambdaClient,\n parseTelemetryIdFromLicense,\n parseAndWarnTelemetryId,\n} from \"./telemetry/lambda-client\";\nexport type { LambdaSendOptions } from \"./telemetry/lambda-client\";\nexport * from \"./debug\";\nexport * from \"./standard-schema\";\nexport * from \"./attachments\";\n\nexport { logger } from \"./logger\";\nexport {\n createRunEventFinalizer,\n finalizeRunEvents,\n type FinalizeRunOptions,\n type RunEventFinalizer,\n} from \"./finalize-events\";\nexport { stripIntelligenceRoutingFields } from \"./intelligence-routing-fields\";\n\nexport {\n TranscriptionErrorCode,\n TranscriptionErrors,\n type TranscriptionErrorResponse,\n} from \"./transcription-errors\";\n\nimport * as packageJson from \"../package.json\";\nexport const COPILOTKIT_VERSION = packageJson.version;\n\n// Re-export only types from license-verifier (types are erased at compile time,\n// so they don't pull in the Node-only `crypto` dependency into client bundles).\n// Server-side packages (e.g. @copilotkit/runtime) should import runtime functions\n// like createLicenseChecker and getLicenseWarningHeader directly from\n// @copilotkit/license-verifier.\nexport type {\n LicenseChecker,\n LicenseStatus,\n LicensePayload,\n LicenseFeatures,\n LicenseTier,\n LicenseOwner,\n} from \"@copilotkit/license-verifier\";\n\nimport type { LicensePayload } from \"@copilotkit/license-verifier\";\nimport type {\n RuntimeEntitlementResponse,\n RuntimeLicenseStatus,\n} from \"./utils/types\";\n\n// LicenseContextValue was dropped from license-verifier's public API in\n// 0.3.0, so it is defined here. The context shape is owned by this package\n// anyway via createLicenseContextValue below.\n\n/**\n * License context value exposed to child components.\n * Frontend providers create their own context using this shape.\n */\nexport interface LicenseContextValue {\n /** Effective license status after structured entitlement precedence. Null until known. */\n status: RuntimeLicenseStatus | null;\n /** The license payload if available. Always null on the client; the payload stays server-side. */\n license: LicensePayload | null;\n /** Whether a feature is licensed. Ready entitlements override legacy status behavior. */\n checkFeature: (feature: string) => boolean;\n /** Get a numeric feature limit. Zero means unlimited; null means not applicable. */\n getLimit: (feature: string) => number | null;\n}\n\n/** Read a record value without traversing its prototype chain. */\nfunction getOwnRecordValue<Value>(\n record: Readonly<Record<string, Value>>,\n key: string,\n): Value | undefined {\n return Object.prototype.hasOwnProperty.call(record, key)\n ? record[key]\n : undefined;\n}\n\n/** Legacy UI surfaces that remain available for every active entitlement. */\nfunction isLegacyUiFeature(feature: string): boolean {\n return feature === \"chat\" || feature === \"popup\" || feature === \"sidebar\";\n}\n\n/**\n * Client-safe license context factory, driven by the license authority the\n * runtime reports via /info.\n *\n * A ready managed entitlement is authoritative in both directions. A ready\n * active self-hosted entitlement is also authoritative, while an inactive\n * self-hosted response preserves the legacy signed-license fallback. Active\n * entitlements supply feature grants and limits; authoritative inactive\n * entitlements deny every feature and limit. Older runtimes that report only a\n * status retain the legacy behavior: features are enabled unless the status is\n * \"expired\" or \"invalid\", and no limits are reported. This is inlined here to\n * avoid importing the full license-verifier bundle (which depends on Node's\n * `crypto`) into browser bundles.\n */\nexport function createLicenseContextValue(\n status: RuntimeLicenseStatus | null | undefined,\n runtimeEntitlements?: RuntimeEntitlementResponse,\n): LicenseContextValue {\n const readyEntitlement =\n runtimeEntitlements?.status === \"ready\"\n ? runtimeEntitlements.entitlement\n : null;\n const hasUsableSelfHostedLegacyFallback =\n readyEntitlement &&\n !readyEntitlement.active &&\n readyEntitlement.source === \"selfHostedDeploymentLicense\" &&\n (status === \"valid\" || status === \"expiring\");\n const featureAuthority =\n readyEntitlement && !hasUsableSelfHostedLegacyFallback\n ? readyEntitlement\n : null;\n const activeEntitlement = featureAuthority?.active ? featureAuthority : null;\n const resolvedStatus = activeEntitlement\n ? \"valid\"\n : readyEntitlement?.source === \"managedOrgSubscription\" ||\n readyEntitlement?.source === \"awsMarketplaceDeploymentLicense\"\n ? \"none\"\n : featureAuthority\n ? (status ?? \"none\")\n : (status ?? null);\n const featuresEnabled =\n resolvedStatus !== \"expired\" && resolvedStatus !== \"invalid\";\n\n return {\n status: resolvedStatus,\n license: null,\n checkFeature: (feature) =>\n featureAuthority\n ? activeEntitlement\n ? feature === \"threads\" &&\n Object.prototype.hasOwnProperty.call(\n activeEntitlement.limits,\n \"threads.max_count\",\n )\n ? true\n : (getOwnRecordValue(activeEntitlement.features, feature) ??\n isLegacyUiFeature(feature))\n : false\n : featuresEnabled,\n getLimit: (feature) =>\n activeEntitlement\n ? (getOwnRecordValue(activeEntitlement.limits, feature) ?? null)\n : null,\n };\n}\n\nexport {\n A2UI_DEFAULT_GENERATION_GUIDELINES,\n A2UI_DEFAULT_DESIGN_GUIDELINES,\n ALL_GENERATIVE_UI_GUIDE_FEATURES,\n buildGenerativeUIMarkdownGuidelines,\n generativeUIGuideFeatures,\n GENERATIVE_UI_MARKDOWN_GUIDELINES,\n GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION,\n GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION,\n} from \"./a2ui-prompts\";\nexport type { GenerativeUIGuideFeatures } from \"./a2ui-prompts\";\nexport {\n COPILOTKIT_FORWARDED_PROPS_KEY,\n COPILOTKIT_UI_ENVELOPE_FORMAT,\n envelopeToManifest,\n readCopilotKitUIEnvelope,\n} from \"./a2ui-envelope\";\nexport type { CopilotKitUIEnvelope } from \"./a2ui-envelope\";\n\nexport type { DebugEventEnvelope } from \"./debug-event-envelope\";\n\nexport { GENERATE_SANDBOXED_UI_DESCRIPTION } from \"./open-generative-ui-prompts\";\nexport * from \"./generative-ui\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,MAAa,qBAAqBA;;AA0ClC,SAAS,kBACP,QACA,KACmB;AACnB,QAAO,OAAO,UAAU,eAAe,KAAK,QAAQ,IAAI,GACpD,OAAO,OACP;;;AAIN,SAAS,kBAAkB,SAA0B;AACnD,QAAO,YAAY,UAAU,YAAY,WAAW,YAAY;;;;;;;;;;;;;;;;AAiBlE,SAAgB,0BACd,QACA,qBACqB;CACrB,MAAM,mBACJ,qBAAqB,WAAW,UAC5B,oBAAoB,cACpB;CACN,MAAM,oCACJ,oBACA,CAAC,iBAAiB,UAClB,iBAAiB,WAAW,kCAC3B,WAAW,WAAW,WAAW;CACpC,MAAM,mBACJ,oBAAoB,CAAC,oCACjB,mBACA;CACN,MAAM,oBAAoB,kBAAkB,SAAS,mBAAmB;CACxE,MAAM,iBAAiB,oBACnB,UACA,kBAAkB,WAAW,4BAC3B,kBAAkB,WAAW,oCAC7B,SACA,mBACG,UAAU,SACV,UAAU;CACnB,MAAM,kBACJ,mBAAmB,aAAa,mBAAmB;AAErD,QAAO;EACL,QAAQ;EACR,SAAS;EACT,eAAe,YACb,mBACI,oBACE,YAAY,aACZ,OAAO,UAAU,eAAe,KAC9B,kBAAkB,QAClB,oBACD,GACC,OACC,kBAAkB,kBAAkB,UAAU,QAAQ,IACvD,kBAAkB,QAAQ,GAC5B,QACF;EACN,WAAW,YACT,oBACK,kBAAkB,kBAAkB,QAAQ,QAAQ,IAAI,OACzD;EACP"}