@copilotkit/shared 1.85.0 → 1.86.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/event-transforms/recorded-events.cjs +7 -1
- package/dist/event-transforms/recorded-events.cjs.map +1 -1
- package/dist/event-transforms/recorded-events.mjs +8 -2
- package/dist/event-transforms/recorded-events.mjs.map +1 -1
- package/dist/generative-ui/clone-value.cjs +364 -0
- package/dist/generative-ui/clone-value.cjs.map +1 -0
- package/dist/generative-ui/clone-value.d.cts +51 -0
- package/dist/generative-ui/clone-value.d.cts.map +1 -0
- package/dist/generative-ui/clone-value.d.mts +51 -0
- package/dist/generative-ui/clone-value.d.mts.map +1 -0
- package/dist/generative-ui/clone-value.mjs +363 -0
- package/dist/generative-ui/clone-value.mjs.map +1 -0
- package/dist/generative-ui/index.cjs +39 -0
- package/dist/generative-ui/index.d.cts +8 -2
- package/dist/generative-ui/index.d.mts +8 -2
- package/dist/generative-ui/index.mjs +8 -2
- package/dist/generative-ui/is-record.d.cts +3 -1
- package/dist/generative-ui/is-record.d.cts.map +1 -1
- package/dist/generative-ui/is-record.d.mts +3 -1
- package/dist/generative-ui/is-record.d.mts.map +1 -1
- package/dist/generative-ui/schema-render.cjs +2 -1
- package/dist/generative-ui/schema-render.cjs.map +1 -1
- package/dist/generative-ui/schema-render.d.cts.map +1 -1
- package/dist/generative-ui/schema-render.d.mts.map +1 -1
- package/dist/generative-ui/schema-render.mjs +2 -1
- package/dist/generative-ui/schema-render.mjs.map +1 -1
- package/dist/generative-ui/standard/chart-config.cjs +347 -0
- package/dist/generative-ui/standard/chart-config.cjs.map +1 -0
- package/dist/generative-ui/standard/chart-config.d.cts +97 -0
- package/dist/generative-ui/standard/chart-config.d.cts.map +1 -0
- package/dist/generative-ui/standard/chart-config.d.mts +97 -0
- package/dist/generative-ui/standard/chart-config.d.mts.map +1 -0
- package/dist/generative-ui/standard/chart-config.mjs +342 -0
- package/dist/generative-ui/standard/chart-config.mjs.map +1 -0
- package/dist/generative-ui/standard/chart.d.cts +10 -10
- package/dist/generative-ui/standard/chart.d.mts +10 -10
- package/dist/generative-ui/standard/composites.d.cts +46 -46
- package/dist/generative-ui/standard/composites.d.mts +46 -46
- package/dist/generative-ui/standard/data.d.cts +42 -42
- package/dist/generative-ui/standard/data.d.mts +42 -42
- package/dist/generative-ui/standard/declarations.d.cts +226 -226
- package/dist/generative-ui/standard/declarations.d.mts +226 -226
- package/dist/generative-ui/standard/feedback.d.cts +4 -4
- package/dist/generative-ui/standard/feedback.d.mts +4 -4
- package/dist/generative-ui/standard/index.d.mts +5 -1
- package/dist/generative-ui/standard/inputs.d.cts +72 -72
- package/dist/generative-ui/standard/inputs.d.mts +72 -72
- package/dist/generative-ui/standard/layout.d.cts +156 -156
- package/dist/generative-ui/standard/layout.d.mts +156 -156
- package/dist/generative-ui/standard/map-helpers.cjs +104 -0
- package/dist/generative-ui/standard/map-helpers.cjs.map +1 -0
- package/dist/generative-ui/standard/map-helpers.d.cts +88 -0
- package/dist/generative-ui/standard/map-helpers.d.cts.map +1 -0
- package/dist/generative-ui/standard/map-helpers.d.mts +88 -0
- package/dist/generative-ui/standard/map-helpers.d.mts.map +1 -0
- package/dist/generative-ui/standard/map-helpers.mjs +95 -0
- package/dist/generative-ui/standard/map-helpers.mjs.map +1 -0
- package/dist/generative-ui/standard/map.d.cts +10 -10
- package/dist/generative-ui/standard/map.d.mts +10 -10
- package/dist/generative-ui/standard/media.d.cts +76 -76
- package/dist/generative-ui/standard/media.d.mts +76 -76
- package/dist/generative-ui/standard/style-helpers.cjs +151 -0
- package/dist/generative-ui/standard/style-helpers.cjs.map +1 -0
- package/dist/generative-ui/standard/style-helpers.d.cts +56 -0
- package/dist/generative-ui/standard/style-helpers.d.cts.map +1 -0
- package/dist/generative-ui/standard/style-helpers.d.mts +56 -0
- package/dist/generative-ui/standard/style-helpers.d.mts.map +1 -0
- package/dist/generative-ui/standard/style-helpers.mjs +142 -0
- package/dist/generative-ui/standard/style-helpers.mjs.map +1 -0
- package/dist/generative-ui/standard/text.d.cts +28 -28
- package/dist/generative-ui/standard/text.d.mts +28 -28
- package/dist/generative-ui/standard/url.cjs +54 -0
- package/dist/generative-ui/standard/url.cjs.map +1 -0
- package/dist/generative-ui/standard/url.d.cts +32 -0
- package/dist/generative-ui/standard/url.d.cts.map +1 -0
- package/dist/generative-ui/standard/url.d.mts +32 -0
- package/dist/generative-ui/standard/url.d.mts.map +1 -0
- package/dist/generative-ui/standard/url.mjs +50 -0
- package/dist/generative-ui/standard/url.mjs.map +1 -0
- package/dist/generative-ui/thrown.cjs +69 -0
- package/dist/generative-ui/thrown.cjs.map +1 -0
- package/dist/generative-ui/thrown.d.cts +21 -0
- package/dist/generative-ui/thrown.d.cts.map +1 -0
- package/dist/generative-ui/thrown.d.mts +21 -0
- package/dist/generative-ui/thrown.d.mts.map +1 -0
- package/dist/generative-ui/thrown.mjs +67 -0
- package/dist/generative-ui/thrown.mjs.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +368 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.mjs +1 -1
- package/package.json +2 -2
- package/src/__tests__/schema-render.test.ts +78 -0
- package/src/event-transforms/recorded-events.test.ts +35 -3
- package/src/event-transforms/recorded-events.ts +15 -2
- package/src/generative-ui/__tests__/clone-value-differential.test.ts +480 -0
- package/src/generative-ui/__tests__/clone-value.test.ts +226 -0
- package/src/generative-ui/clone-value.ts +511 -0
- package/src/generative-ui/index.ts +6 -2
- package/src/generative-ui/schema-render.ts +2 -1
- package/src/generative-ui/standard/__tests__/standard-helpers.test.ts +407 -0
- package/src/generative-ui/standard/chart-config.ts +434 -0
- package/src/generative-ui/standard/index.ts +36 -0
- package/src/generative-ui/standard/map-helpers.ts +155 -0
- package/src/generative-ui/standard/style-helpers.ts +170 -0
- package/src/generative-ui/standard/url.ts +51 -0
- package/src/generative-ui/thrown.ts +90 -0
- package/src/index.ts +5 -0
package/dist/index.mjs.map
CHANGED
|
@@ -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 A2UI_BASIC_CATALOG_ID,\n A2UI_SCHEMA_CONTEXT_DESCRIPTION,\n buildA2UICatalogContextValue,\n extractA2UICatalogSchemas,\n serializeA2UISchema,\n} from \"./a2ui-catalog-schema\";\nexport type {\n A2UICatalogSchemaSource,\n A2UICommonTypes,\n A2UIFunctionSchema,\n A2UIInlineCatalogSchema,\n} from \"./a2ui-catalog-schema\";\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/base\";\n"],"mappings":"
|
|
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 A2UI_BASIC_CATALOG_ID,\n A2UI_SCHEMA_CONTEXT_DESCRIPTION,\n buildA2UICatalogContextValue,\n extractA2UICatalogSchemas,\n serializeA2UISchema,\n} from \"./a2ui-catalog-schema\";\nexport type {\n A2UICatalogSchemaSource,\n A2UICommonTypes,\n A2UIFunctionSchema,\n A2UIInlineCatalogSchema,\n} from \"./a2ui-catalog-schema\";\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/base\";\n// On the root, not only on `@copilotkit/shared/generative-ui`: the core\n// root entry needs it, and importing the generative UI barrel there would\n// load its validators and catalogs in every app (Metro does not\n// tree-shake), and leave the UMD build without a global for the subpath.\nexport { cloneValue } from \"./generative-ui/clone-value\";\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"}
|
package/dist/index.umd.js
CHANGED
|
@@ -2323,7 +2323,7 @@ ${getSeeMoreMarkdown(troubleshootingLink)}`;
|
|
|
2323
2323
|
|
|
2324
2324
|
//#endregion
|
|
2325
2325
|
//#region package.json
|
|
2326
|
-
var version = "1.
|
|
2326
|
+
var version = "1.86.0";
|
|
2327
2327
|
|
|
2328
2328
|
//#endregion
|
|
2329
2329
|
//#region src/generative-ui/basic-functions.ts
|
|
@@ -4132,6 +4132,371 @@ Use the SAME surfaceId as the main surface. Match action names to button action
|
|
|
4132
4132
|
}
|
|
4133
4133
|
};
|
|
4134
4134
|
|
|
4135
|
+
//#endregion
|
|
4136
|
+
//#region src/generative-ui/clone-value.ts
|
|
4137
|
+
/**
|
|
4138
|
+
* A deep copy of `value` with `structuredClone` semantics. Uses the global
|
|
4139
|
+
* `structuredClone` when there is one. Hermes (React Native) has none, so
|
|
4140
|
+
* there a local copy runs. It decides the kind of an object by the same
|
|
4141
|
+
* internal slots that `structuredClone` reads (brand checks), not by
|
|
4142
|
+
* `instanceof` or `Symbol.toStringTag`, and gives what the native
|
|
4143
|
+
* `structuredClone` of V8 gives:
|
|
4144
|
+
*
|
|
4145
|
+
* - `undefined`, `null`, strings, booleans, numbers (also `NaN`,
|
|
4146
|
+
* `Infinity` and `-0`) and bigints are returned as they are.
|
|
4147
|
+
* - Arrays and ordinary objects are copied deeply: own enumerable string
|
|
4148
|
+
* keys only, so a class instance, or an object with its own
|
|
4149
|
+
* `Symbol.toStringTag`, becomes a plain object. A sparse array keeps its
|
|
4150
|
+
* holes and its length.
|
|
4151
|
+
* - `Date`, `RegExp`, `Map`, `Set`, boxed primitives, `ArrayBuffer`s (a
|
|
4152
|
+
* resizable one stays resizable), typed arrays (as the base type, never a
|
|
4153
|
+
* subclass), `DataView`s, `Blob`s and `File`s are copied.
|
|
4154
|
+
* - An `Error` becomes an `Error` of its standard type (a custom name or
|
|
4155
|
+
* `AggregateError` becomes `Error`), with its own `message`, its `stack`
|
|
4156
|
+
* and its own `cause`. A `DOMException` stays one where the global exists.
|
|
4157
|
+
* - A `SharedArrayBuffer` is shared, not copied, like `structuredClone`.
|
|
4158
|
+
* - Cycles and shared references are kept: an object reached twice is
|
|
4159
|
+
* copied once.
|
|
4160
|
+
* - Functions, symbols, `Symbol` wrappers, `arguments`, `WeakMap`,
|
|
4161
|
+
* `WeakSet`, `WeakRef`, `Promise`, iterators, generators and the web
|
|
4162
|
+
* platform objects that cannot be cloned (`URL`, `Headers`, streams...)
|
|
4163
|
+
* throw an error named `"DataCloneError"`: a `DOMException` where the
|
|
4164
|
+
* global exists, else an `Error` (Hermes has no `DOMException`).
|
|
4165
|
+
*
|
|
4166
|
+
* Two differences are left. A `Proxy` cannot be told from its target in
|
|
4167
|
+
* JavaScript, so the local copy reads it through its traps, where the
|
|
4168
|
+
* native one throws. And an ordinary object takes a fast path that runs no
|
|
4169
|
+
* brand check (each failed one throws and catches an exception, slow on
|
|
4170
|
+
* Hermes), so a `Map`, `Set`, `Promise` or other object whose prototype
|
|
4171
|
+
* was changed to `Object.prototype` or `null` is copied as a plain object.
|
|
4172
|
+
*
|
|
4173
|
+
* It never installs a global `structuredClone`, and it does not use the
|
|
4174
|
+
* JSON round trip of `structuredClone_` from `@ag-ui/client`, which turns
|
|
4175
|
+
* `undefined` into `{}` and drops or changes values JSON cannot hold.
|
|
4176
|
+
*
|
|
4177
|
+
* @param value - The value to copy.
|
|
4178
|
+
* @returns A copy that shares no object with `value`, except a
|
|
4179
|
+
* `SharedArrayBuffer`.
|
|
4180
|
+
* @throws An error named `"DataCloneError"` for a value that cannot be
|
|
4181
|
+
* cloned.
|
|
4182
|
+
*/
|
|
4183
|
+
function cloneValue(value) {
|
|
4184
|
+
const native = globalThis.structuredClone;
|
|
4185
|
+
if (typeof native === "function") return native(value);
|
|
4186
|
+
return cloneInto(value, /* @__PURE__ */ new Map());
|
|
4187
|
+
}
|
|
4188
|
+
/** A global, or `undefined` when this engine does not have it. */
|
|
4189
|
+
function globalNamed(name) {
|
|
4190
|
+
return globalThis[name];
|
|
4191
|
+
}
|
|
4192
|
+
/** True when `method` accepts `value` as its `this`: a brand check. */
|
|
4193
|
+
function hasBrand(value, method, ...args) {
|
|
4194
|
+
if (typeof method !== "function") return false;
|
|
4195
|
+
try {
|
|
4196
|
+
method.call(value, ...args);
|
|
4197
|
+
return true;
|
|
4198
|
+
} catch (_unused) {
|
|
4199
|
+
return false;
|
|
4200
|
+
}
|
|
4201
|
+
}
|
|
4202
|
+
/** The getter of `key` on `proto`, for a brand check. */
|
|
4203
|
+
function getterOf(proto, key) {
|
|
4204
|
+
var _Object$getOwnPropert;
|
|
4205
|
+
if (!proto) return void 0;
|
|
4206
|
+
return (_Object$getOwnPropert = Object.getOwnPropertyDescriptor(proto, key)) === null || _Object$getOwnPropert === void 0 ? void 0 : _Object$getOwnPropert.get;
|
|
4207
|
+
}
|
|
4208
|
+
function protoOf(name) {
|
|
4209
|
+
var _globalNamed;
|
|
4210
|
+
return ((_globalNamed = globalNamed(name)) !== null && _globalNamed !== void 0 ? _globalNamed : {}).prototype;
|
|
4211
|
+
}
|
|
4212
|
+
function methodOf(name, key) {
|
|
4213
|
+
const proto = protoOf(name);
|
|
4214
|
+
return proto === null || proto === void 0 ? void 0 : proto[key];
|
|
4215
|
+
}
|
|
4216
|
+
const ERROR_NAMES$1 = new Set([
|
|
4217
|
+
"Error",
|
|
4218
|
+
"EvalError",
|
|
4219
|
+
"RangeError",
|
|
4220
|
+
"ReferenceError",
|
|
4221
|
+
"SyntaxError",
|
|
4222
|
+
"TypeError",
|
|
4223
|
+
"URIError"
|
|
4224
|
+
]);
|
|
4225
|
+
/** Web platform objects that `structuredClone` refuses, where they exist. */
|
|
4226
|
+
const PLATFORM_UNCLONEABLE = [
|
|
4227
|
+
"URL",
|
|
4228
|
+
"URLSearchParams",
|
|
4229
|
+
"Headers",
|
|
4230
|
+
"Request",
|
|
4231
|
+
"Response",
|
|
4232
|
+
"FormData",
|
|
4233
|
+
"ReadableStream",
|
|
4234
|
+
"WritableStream",
|
|
4235
|
+
"TransformStream",
|
|
4236
|
+
"MessagePort"
|
|
4237
|
+
];
|
|
4238
|
+
function* emptyGenerator() {}
|
|
4239
|
+
/** The prototypes of the built-in iterators and generators. */
|
|
4240
|
+
function iteratorPrototypes() {
|
|
4241
|
+
const protos = [];
|
|
4242
|
+
const add = (iterator) => {
|
|
4243
|
+
const proto = iterator && Object.getPrototypeOf(iterator);
|
|
4244
|
+
if (proto) protos.push(proto);
|
|
4245
|
+
};
|
|
4246
|
+
add([][Symbol.iterator]());
|
|
4247
|
+
add((/* @__PURE__ */ new Map())[Symbol.iterator]());
|
|
4248
|
+
add((/* @__PURE__ */ new Set())[Symbol.iterator]());
|
|
4249
|
+
add(""[Symbol.iterator]());
|
|
4250
|
+
protos.push(Object.getPrototypeOf(emptyGenerator.prototype));
|
|
4251
|
+
const matchAllKey = Symbol.matchAll;
|
|
4252
|
+
const matchAll = matchAllKey ? RegExp.prototype[matchAllKey] : void 0;
|
|
4253
|
+
if (typeof matchAll === "function") add(matchAll.call(/a/g, ""));
|
|
4254
|
+
return protos;
|
|
4255
|
+
}
|
|
4256
|
+
let iteratorProtos;
|
|
4257
|
+
function inheritsFrom(value, protos) {
|
|
4258
|
+
for (let proto = Object.getPrototypeOf(value); proto !== null; proto = Object.getPrototypeOf(proto)) if (protos.includes(proto)) return true;
|
|
4259
|
+
return false;
|
|
4260
|
+
}
|
|
4261
|
+
function dataCloneError(what) {
|
|
4262
|
+
const message = `${what} could not be cloned.`;
|
|
4263
|
+
const DOMExceptionClass = globalNamed("DOMException");
|
|
4264
|
+
if (typeof DOMExceptionClass === "function") return new DOMExceptionClass(message, "DataCloneError");
|
|
4265
|
+
const error = new Error(message);
|
|
4266
|
+
error.name = "DataCloneError";
|
|
4267
|
+
return error;
|
|
4268
|
+
}
|
|
4269
|
+
function describe(value) {
|
|
4270
|
+
if (typeof value === "function") return value.name ? `function ${value.name}` : "A function";
|
|
4271
|
+
if (typeof value === "symbol") return String(value);
|
|
4272
|
+
return Object.prototype.toString.call(value);
|
|
4273
|
+
}
|
|
4274
|
+
/** True for an object with the [[ErrorData]] slot. */
|
|
4275
|
+
function isError(value) {
|
|
4276
|
+
const isErrorCheck = Error.isError;
|
|
4277
|
+
if (typeof isErrorCheck === "function") return isErrorCheck.call(Error, value) === true;
|
|
4278
|
+
if (!(Symbol.toStringTag in value)) return Object.prototype.toString.call(value) === "[object Error]";
|
|
4279
|
+
return value instanceof Error;
|
|
4280
|
+
}
|
|
4281
|
+
function isDOMException(value) {
|
|
4282
|
+
return hasBrand(value, getterOf(protoOf("DOMException"), "code"));
|
|
4283
|
+
}
|
|
4284
|
+
/** The name of the base typed-array type of a view, or `undefined`. */
|
|
4285
|
+
function typedArrayName(value) {
|
|
4286
|
+
const getter = getterOf(Object.getPrototypeOf(Uint8Array.prototype), Symbol.toStringTag);
|
|
4287
|
+
if (!getter) return void 0;
|
|
4288
|
+
const name = getter.call(value);
|
|
4289
|
+
return typeof name === "string" ? name : void 0;
|
|
4290
|
+
}
|
|
4291
|
+
function cloneArrayBuffer(value) {
|
|
4292
|
+
const source = value;
|
|
4293
|
+
if (source.resizable === true) {
|
|
4294
|
+
const copy = new ArrayBuffer(source.byteLength, { maxByteLength: source.maxByteLength });
|
|
4295
|
+
new Uint8Array(copy).set(new Uint8Array(source));
|
|
4296
|
+
return copy;
|
|
4297
|
+
}
|
|
4298
|
+
return ArrayBuffer.prototype.slice.call(value, 0);
|
|
4299
|
+
}
|
|
4300
|
+
function cloneError(value, seen) {
|
|
4301
|
+
let copy;
|
|
4302
|
+
const own = (key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
4303
|
+
const messageDescriptor = Object.getOwnPropertyDescriptor(value, "message");
|
|
4304
|
+
const message = messageDescriptor && "value" in messageDescriptor ? `${messageDescriptor.value}` : void 0;
|
|
4305
|
+
if (isDOMException(value)) copy = new (globalNamed("DOMException"))(value.message, value.name);
|
|
4306
|
+
else {
|
|
4307
|
+
var _globalNamed2;
|
|
4308
|
+
const ErrorClass = (_globalNamed2 = globalNamed(ERROR_NAMES$1.has(value.name) ? value.name : "Error")) !== null && _globalNamed2 !== void 0 ? _globalNamed2 : Error;
|
|
4309
|
+
copy = message === void 0 ? new ErrorClass() : new ErrorClass(message);
|
|
4310
|
+
}
|
|
4311
|
+
seen.set(value, copy);
|
|
4312
|
+
if (typeof value.stack === "string") copy.stack = value.stack;
|
|
4313
|
+
if (!isDOMException(value)) {
|
|
4314
|
+
const causeDescriptor = Object.getOwnPropertyDescriptor(value, "cause");
|
|
4315
|
+
if (own("cause") && causeDescriptor && "value" in causeDescriptor) Object.defineProperty(copy, "cause", {
|
|
4316
|
+
value: cloneInto(causeDescriptor.value, seen),
|
|
4317
|
+
writable: true,
|
|
4318
|
+
enumerable: false,
|
|
4319
|
+
configurable: true
|
|
4320
|
+
});
|
|
4321
|
+
}
|
|
4322
|
+
return copy;
|
|
4323
|
+
}
|
|
4324
|
+
function cloneInto(value, seen) {
|
|
4325
|
+
if (typeof value === "function" || typeof value === "symbol") throw dataCloneError(describe(value));
|
|
4326
|
+
if (typeof value !== "object" || value === null) return value;
|
|
4327
|
+
const known = seen.get(value);
|
|
4328
|
+
if (known !== void 0) return known;
|
|
4329
|
+
if (Array.isArray(value)) {
|
|
4330
|
+
const copy = [];
|
|
4331
|
+
copy.length = value.length;
|
|
4332
|
+
seen.set(value, copy);
|
|
4333
|
+
copyKeys(value, copy, seen);
|
|
4334
|
+
return copy;
|
|
4335
|
+
}
|
|
4336
|
+
if (isPlainObject(value)) {
|
|
4337
|
+
const copy = {};
|
|
4338
|
+
seen.set(value, copy);
|
|
4339
|
+
copyKeys(value, copy, seen);
|
|
4340
|
+
return copy;
|
|
4341
|
+
}
|
|
4342
|
+
if (hasBrand(value, Date.prototype.getTime)) {
|
|
4343
|
+
const copy = new Date(Date.prototype.getTime.call(value));
|
|
4344
|
+
seen.set(value, copy);
|
|
4345
|
+
return copy;
|
|
4346
|
+
}
|
|
4347
|
+
if (hasBrand(value, getterOf(RegExp.prototype, "source"))) {
|
|
4348
|
+
const source = getterOf(RegExp.prototype, "source").call(value);
|
|
4349
|
+
const flags = getterOf(RegExp.prototype, "flags").call(value);
|
|
4350
|
+
const copy = new RegExp(source, flags);
|
|
4351
|
+
seen.set(value, copy);
|
|
4352
|
+
return copy;
|
|
4353
|
+
}
|
|
4354
|
+
if (hasBrand(value, Map.prototype.has, void 0)) {
|
|
4355
|
+
const copy = /* @__PURE__ */ new Map();
|
|
4356
|
+
seen.set(value, copy);
|
|
4357
|
+
const entries = [];
|
|
4358
|
+
Map.prototype.forEach.call(value, (entry, key) => {
|
|
4359
|
+
entries.push([key, entry]);
|
|
4360
|
+
});
|
|
4361
|
+
for (const [key, entry] of entries) copy.set(cloneInto(key, seen), cloneInto(entry, seen));
|
|
4362
|
+
return copy;
|
|
4363
|
+
}
|
|
4364
|
+
if (hasBrand(value, Set.prototype.has, void 0)) {
|
|
4365
|
+
const copy = /* @__PURE__ */ new Set();
|
|
4366
|
+
seen.set(value, copy);
|
|
4367
|
+
const entries = [];
|
|
4368
|
+
Set.prototype.forEach.call(value, (entry) => {
|
|
4369
|
+
entries.push(entry);
|
|
4370
|
+
});
|
|
4371
|
+
for (const entry of entries) copy.add(cloneInto(entry, seen));
|
|
4372
|
+
return copy;
|
|
4373
|
+
}
|
|
4374
|
+
if (hasBrand(value, getterOf(ArrayBuffer.prototype, "byteLength"))) {
|
|
4375
|
+
const copy = cloneArrayBuffer(value);
|
|
4376
|
+
seen.set(value, copy);
|
|
4377
|
+
return copy;
|
|
4378
|
+
}
|
|
4379
|
+
if (hasBrand(value, getterOf(protoOf("SharedArrayBuffer"), "byteLength"))) {
|
|
4380
|
+
seen.set(value, value);
|
|
4381
|
+
return value;
|
|
4382
|
+
}
|
|
4383
|
+
if (ArrayBuffer.isView(value)) {
|
|
4384
|
+
const view = value;
|
|
4385
|
+
const buffer = cloneInto(view.buffer, seen);
|
|
4386
|
+
const isDataView = hasBrand(value, getterOf(DataView.prototype, "byteLength"));
|
|
4387
|
+
let copy;
|
|
4388
|
+
if (isDataView) copy = new DataView(buffer, view.byteOffset, view.byteLength);
|
|
4389
|
+
else {
|
|
4390
|
+
const name = typedArrayName(value);
|
|
4391
|
+
const TypedArray = name ? globalNamed(name) : void 0;
|
|
4392
|
+
if (!TypedArray) throw dataCloneError(describe(value));
|
|
4393
|
+
const proto = Object.getPrototypeOf(Uint8Array.prototype);
|
|
4394
|
+
copy = new TypedArray(buffer, getterOf(proto, "byteOffset").call(value), getterOf(proto, "length").call(value));
|
|
4395
|
+
}
|
|
4396
|
+
seen.set(value, copy);
|
|
4397
|
+
return copy;
|
|
4398
|
+
}
|
|
4399
|
+
if (isError(value)) return cloneError(value, seen);
|
|
4400
|
+
for (const [name, Boxed] of [
|
|
4401
|
+
["Boolean", Boolean],
|
|
4402
|
+
["Number", Number],
|
|
4403
|
+
["String", String],
|
|
4404
|
+
["BigInt", globalNamed("BigInt")]
|
|
4405
|
+
]) {
|
|
4406
|
+
const valueOf = methodOf(name, "valueOf");
|
|
4407
|
+
if (Boxed && hasBrand(value, valueOf)) {
|
|
4408
|
+
const copy = Object(valueOf.call(value));
|
|
4409
|
+
seen.set(value, copy);
|
|
4410
|
+
return copy;
|
|
4411
|
+
}
|
|
4412
|
+
}
|
|
4413
|
+
if (hasBrand(value, methodOf("Symbol", "valueOf"))) throw dataCloneError(describe(value));
|
|
4414
|
+
const BlobClass = globalNamed("Blob");
|
|
4415
|
+
if (typeof BlobClass === "function" && value instanceof BlobClass) {
|
|
4416
|
+
const copy = cloneBlob(value);
|
|
4417
|
+
seen.set(value, copy);
|
|
4418
|
+
return copy;
|
|
4419
|
+
}
|
|
4420
|
+
if (isUncloneable(value)) throw dataCloneError(describe(value));
|
|
4421
|
+
const copy = {};
|
|
4422
|
+
seen.set(value, copy);
|
|
4423
|
+
copyKeys(value, copy, seen);
|
|
4424
|
+
return copy;
|
|
4425
|
+
}
|
|
4426
|
+
function cloneBlob(value) {
|
|
4427
|
+
const FileClass = globalNamed("File");
|
|
4428
|
+
if (typeof FileClass === "function" && value instanceof FileClass) {
|
|
4429
|
+
const file = value;
|
|
4430
|
+
return new FileClass([value], file.name, {
|
|
4431
|
+
type: value.type,
|
|
4432
|
+
lastModified: file.lastModified
|
|
4433
|
+
});
|
|
4434
|
+
}
|
|
4435
|
+
return new (globalNamed("Blob"))([value], { type: value.type });
|
|
4436
|
+
}
|
|
4437
|
+
/**
|
|
4438
|
+
* True for an ordinary object of this realm: its prototype is
|
|
4439
|
+
* `Object.prototype` or `null`, it has no `Symbol.toStringTag`, and its
|
|
4440
|
+
* built-in tag is "Object" (so not `arguments`, an `Error`, a `Date`, a
|
|
4441
|
+
* `RegExp` or a boxed primitive, whatever their prototype). Throws nothing.
|
|
4442
|
+
* An object with another slot (a `Map`, a `Set`, a `Promise`...) whose
|
|
4443
|
+
* prototype was changed to one of those passes too; only a brand check,
|
|
4444
|
+
* which throws, could tell, so it is copied as a plain object.
|
|
4445
|
+
*/
|
|
4446
|
+
function isPlainObject(value) {
|
|
4447
|
+
const proto = Object.getPrototypeOf(value);
|
|
4448
|
+
if (proto !== Object.prototype && proto !== null) return false;
|
|
4449
|
+
if (Symbol.toStringTag in value) return false;
|
|
4450
|
+
if (ArrayBuffer.isView(value)) return false;
|
|
4451
|
+
return Object.prototype.toString.call(value) === "[object Object]";
|
|
4452
|
+
}
|
|
4453
|
+
/** The globals of PLATFORM_UNCLONEABLE and their prototypes, when last read. */
|
|
4454
|
+
let platformCache;
|
|
4455
|
+
/**
|
|
4456
|
+
* The prototypes of the PLATFORM_UNCLONEABLE globals that exist. Kept
|
|
4457
|
+
* between calls, and built again only when one of the globals changed (a
|
|
4458
|
+
* polyfill installed late).
|
|
4459
|
+
*/
|
|
4460
|
+
function platformPrototypes() {
|
|
4461
|
+
const globals = globalThis;
|
|
4462
|
+
const cached = platformCache;
|
|
4463
|
+
if (cached && PLATFORM_UNCLONEABLE.every((name, index) => globals[name] === cached.classes[index])) return cached.protos;
|
|
4464
|
+
const classes = PLATFORM_UNCLONEABLE.map((name) => globals[name]);
|
|
4465
|
+
const protos = PLATFORM_UNCLONEABLE.map(protoOf).filter((proto) => proto !== void 0);
|
|
4466
|
+
platformCache = {
|
|
4467
|
+
classes,
|
|
4468
|
+
protos
|
|
4469
|
+
};
|
|
4470
|
+
return protos;
|
|
4471
|
+
}
|
|
4472
|
+
/** An object that structuredClone refuses, though it has no data slot. */
|
|
4473
|
+
function isUncloneable(value) {
|
|
4474
|
+
if (!(Symbol.toStringTag in value) && Object.prototype.toString.call(value) === "[object Arguments]") return true;
|
|
4475
|
+
if (hasBrand(value, methodOf("WeakMap", "has"), {}) || hasBrand(value, methodOf("WeakSet", "has"), {}) || hasBrand(value, methodOf("WeakRef", "deref")) || hasBrand(value, methodOf("FinalizationRegistry", "unregister"), {})) return true;
|
|
4476
|
+
const PromiseClass = globalNamed("Promise");
|
|
4477
|
+
if (PromiseClass && value instanceof PromiseClass) return true;
|
|
4478
|
+
if (!iteratorProtos) iteratorProtos = iteratorPrototypes();
|
|
4479
|
+
if (inheritsFrom(value, iteratorProtos)) return true;
|
|
4480
|
+
return inheritsFrom(value, platformPrototypes());
|
|
4481
|
+
}
|
|
4482
|
+
/** Copies the own enumerable string keys, as structuredClone does. */
|
|
4483
|
+
function copyKeys(source, target, seen) {
|
|
4484
|
+
for (const key of Object.keys(source)) assign(target, key, cloneInto(source[key], seen));
|
|
4485
|
+
}
|
|
4486
|
+
/**
|
|
4487
|
+
* Sets an own property. A plain assignment of "__proto__" would change the
|
|
4488
|
+
* prototype of the copy instead (JSON.parse makes "__proto__" an own key).
|
|
4489
|
+
*/
|
|
4490
|
+
function assign(target, key, value) {
|
|
4491
|
+
if (key === "__proto__") Object.defineProperty(target, key, {
|
|
4492
|
+
value,
|
|
4493
|
+
enumerable: true,
|
|
4494
|
+
configurable: true,
|
|
4495
|
+
writable: true
|
|
4496
|
+
});
|
|
4497
|
+
else target[key] = value;
|
|
4498
|
+
}
|
|
4499
|
+
|
|
4135
4500
|
//#endregion
|
|
4136
4501
|
//#region src/generative-ui/compact-schema.ts
|
|
4137
4502
|
/** Objects nested deeper than this show as `object`. */
|
|
@@ -4516,7 +4881,7 @@ Use the SAME surfaceId as the main surface. Match action names to button action
|
|
|
4516
4881
|
* and listed in `unknown`. The manifest is not changed.
|
|
4517
4882
|
*/
|
|
4518
4883
|
function applyDescriptionOverrides(manifest, overrides) {
|
|
4519
|
-
const components =
|
|
4884
|
+
const components = cloneValue(manifest.components);
|
|
4520
4885
|
const unknown = [];
|
|
4521
4886
|
for (const [key, description] of Object.entries(overrides)) {
|
|
4522
4887
|
const [name, prop, ...rest] = key.split(".");
|
|
@@ -4754,6 +5119,7 @@ exports.callerProblem = callerProblem;
|
|
|
4754
5119
|
exports.childIdsAtRefs = childIdsAtRefs;
|
|
4755
5120
|
exports.childRefKind = childRefKind;
|
|
4756
5121
|
exports.classifyModelHost = classifyModelHost;
|
|
5122
|
+
exports.cloneValue = cloneValue;
|
|
4757
5123
|
exports.collectChildRefs = collectChildRefs;
|
|
4758
5124
|
exports.commitRowKeyStore = commitRowKeyStore;
|
|
4759
5125
|
exports.computeSamplingMeta = computeSamplingMeta;
|