@copilotkit/shared 2.0.0-rc.42 → 2.0.0-rc.43

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/package.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  //#region package.json
3
- var version = "2.0.0-rc.42";
3
+ var version = "2.0.0-rc.43";
4
4
 
5
5
  //#endregion
6
6
  Object.defineProperty(exports, 'version', {
package/dist/package.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "2.0.0-rc.42";
2
+ var version = "2.0.0-rc.43";
3
3
 
4
4
  //#endregion
5
5
  export { version };
@@ -4,7 +4,7 @@ import { JSONSchema, JSONSchemaArray, JSONSchemaBoolean, JSONSchemaNumber, JSONS
4
4
  import { InspectorMetadataV1, parseInspectorMetadataV1 } from "./inspector-metadata.cjs";
5
5
  import { InspectorLearningEvidence, InspectorLearningInsight, InspectorLearningPage, InspectorLearningRequestV1, InspectorLearningSkill, InspectorLearningSnapshotV1, InspectorLearningTrajectoryEvidence, parseInspectorLearningRequestV1, parseInspectorLearningSnapshotV1, parseInspectorLearningUrl } from "./inspector-learning.cjs";
6
6
  import { InspectorVisibilityOptions, shouldEnableInspector, ɵINSPECTOR_LOOPBACK_HOSTS } from "./inspector-visibility.cjs";
7
- import { A2UIRuntimeInfo, AgentDescription, IntelligenceRuntimeInfo, MaybePromise, NonEmptyRecord, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, RuntimeEntitlementResponse, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SingleRouteRuntimeInfo, ThreadEndpointRuntimeInfo } from "./types.cjs";
7
+ import { AgentDescription, GenerativeUIRuntimeInfo, IntelligenceRuntimeInfo, MaybePromise, NonEmptyRecord, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, RuntimeEntitlementResponse, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SingleRouteRuntimeInfo, ThreadEndpointRuntimeInfo } from "./types.cjs";
8
8
  import { randomId, randomUUID } from "./random-id.cjs";
9
9
  import { processEnv } from "./process-env.cjs";
10
10
  import { readBody } from "./requests.cjs";
@@ -4,7 +4,7 @@ import { JSONSchema, JSONSchemaArray, JSONSchemaBoolean, JSONSchemaNumber, JSONS
4
4
  import { InspectorMetadataV1, parseInspectorMetadataV1 } from "./inspector-metadata.mjs";
5
5
  import { InspectorLearningEvidence, InspectorLearningInsight, InspectorLearningPage, InspectorLearningRequestV1, InspectorLearningSkill, InspectorLearningSnapshotV1, InspectorLearningTrajectoryEvidence, parseInspectorLearningRequestV1, parseInspectorLearningSnapshotV1, parseInspectorLearningUrl } from "./inspector-learning.mjs";
6
6
  import { InspectorVisibilityOptions, shouldEnableInspector, ɵINSPECTOR_LOOPBACK_HOSTS } from "./inspector-visibility.mjs";
7
- import { A2UIRuntimeInfo, AgentDescription, IntelligenceRuntimeInfo, MaybePromise, NonEmptyRecord, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, RuntimeEntitlementResponse, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SingleRouteRuntimeInfo, ThreadEndpointRuntimeInfo } from "./types.mjs";
7
+ import { AgentDescription, GenerativeUIRuntimeInfo, IntelligenceRuntimeInfo, MaybePromise, NonEmptyRecord, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, RuntimeEntitlementResponse, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SingleRouteRuntimeInfo, ThreadEndpointRuntimeInfo } from "./types.mjs";
8
8
  import { randomId, randomUUID } from "./random-id.mjs";
9
9
  import { processEnv } from "./process-env.mjs";
10
10
  import { readBody } from "./requests.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","names":[],"sources":["../../src/utils/types.ts"],"sourcesContent":["import type { AgentCapabilities } from \"@ag-ui/core\";\n\nexport type MaybePromise<T> = T | PromiseLike<T>;\n\n/**\n * More specific utility for records with at least one key\n */\nexport type NonEmptyRecord<T> =\n T extends Record<string, unknown>\n ? keyof T extends never\n ? never\n : T\n : never;\n\n/**\n * Type representing an agent's basic information\n */\nexport interface AgentDescription {\n name: string;\n className: string;\n description: string;\n capabilities?: AgentCapabilities;\n}\n\nexport type RuntimeMode = \"sse\" | \"intelligence\";\n\nexport const RUNTIME_MODE_SSE = \"sse\" as const;\nexport const RUNTIME_MODE_INTELLIGENCE = \"intelligence\" as const;\n\nexport interface IntelligenceRuntimeInfo {\n wsUrl: string;\n}\n\nexport interface ThreadEndpointRuntimeInfo {\n list: boolean;\n inspect: boolean;\n mutations: boolean;\n realtimeMetadata: boolean;\n}\n\nexport type RuntimeLicenseStatus =\n | \"valid\"\n | \"none\"\n | \"expired\"\n | \"expiring\"\n | \"invalid\"\n | \"unknown\";\n\n/** Runtime entitlement authority resolved by a managed or self-hosted backend. */\ninterface RuntimeEntitlement {\n /** Whether the resolved entitlement currently grants product access. */\n active: boolean;\n /** Deployment authority that produced this entitlement. */\n source:\n | \"managedOrgSubscription\"\n | \"selfHostedDeploymentLicense\"\n | \"awsMarketplaceDeploymentLicense\";\n /** Boolean feature grants keyed by stable feature id. */\n features: Record<string, boolean>;\n /** Numeric limits keyed by stable feature id. */\n limits: Record<string, number>;\n /** Optional catalog plan code supplied by the entitlement authority. */\n planCode?: string;\n /** Optional lower-level source metadata supplied by the authority. */\n entitlementSource?: string;\n}\n\n/** Public diagnostic returned when Runtime entitlement resolution is not ready. */\ninterface RuntimeEntitlementError {\n /** Stable backend or SDK error code. */\n code: string;\n /** Safe human-readable diagnostic. */\n message: string;\n /** Whether a later resolution attempt may succeed without reconfiguration. */\n retryable: boolean;\n /** Optional originating request correlation id. */\n requestId?: string;\n /** Optional originating trace correlation id. */\n traceId?: string;\n}\n\n/** Successfully resolved Runtime entitlement response. */\ninterface RuntimeEntitlementReadyResponse {\n status: \"ready\";\n entitlement: RuntimeEntitlement;\n error?: never;\n}\n\n/** Structured non-ready Runtime entitlement response. */\ninterface RuntimeEntitlementErrorResponse {\n status: \"degraded\" | \"misconfigured\" | \"unavailable\";\n entitlement?: never;\n error: RuntimeEntitlementError;\n}\n\n/** Final structured Runtime entitlement response exposed through `/info`. */\nexport type RuntimeEntitlementResponse =\n | RuntimeEntitlementReadyResponse\n | RuntimeEntitlementErrorResponse;\n\nexport interface A2UIRuntimeInfo {\n enabled: boolean;\n /**\n * Agent ids the runtime applies A2UI to. When omitted, A2UI applies to\n * every agent served by the runtime.\n */\n agents?: string[];\n}\n\n/** Intelligence resource support available through a single runtime route. */\nexport interface SingleRouteRuntimeInfo {\n /** Whether the runtime accepts resource requests through the single route. */\n resourceOperations: boolean;\n /** Thread features available through the single-route resource bridge. */\n threadEndpoints: ThreadEndpointRuntimeInfo;\n}\n\nexport interface RuntimeInfo {\n version: string;\n agents: Record<string, AgentDescription>;\n audioFileTranscriptionEnabled: boolean;\n mode: RuntimeMode;\n intelligence?: IntelligenceRuntimeInfo;\n threadEndpoints?: ThreadEndpointRuntimeInfo;\n /** Optional capabilities exposed by runtimes that use one HTTP route. */\n singleRoute?: SingleRouteRuntimeInfo;\n /** Whether this runtime exposes trusted inspector metadata. */\n inspectorMetadata?: boolean;\n /** Whether this runtime exposes the debug-authorized Learning snapshot. */\n inspectorLearning?: boolean;\n /**\n * When true, the runtime exposes POST /agent/:agentId/suggest for stateless\n * suggestion generation. Absent on older runtimes; clients fall back to a\n * client-side agent run.\n */\n suggestions?: boolean;\n /**\n * @deprecated Use `a2ui` instead, which preserves per-agent scoping.\n * Kept for backward compatibility with older clients.\n */\n a2uiEnabled?: boolean;\n a2ui?: A2UIRuntimeInfo;\n openGenerativeUIEnabled?: boolean;\n /** Structured Runtime-level entitlement authority, when advertised. */\n runtimeEntitlements?: RuntimeEntitlementResponse;\n /** Legacy compatibility diagnostic retained for older Core/Inspector clients. */\n licenseStatus?: RuntimeLicenseStatus;\n telemetryDisabled?: boolean;\n}\n"],"mappings":";;AA0BA,MAAa,mBAAmB;AAChC,MAAa,4BAA4B"}
1
+ {"version":3,"file":"types.cjs","names":[],"sources":["../../src/utils/types.ts"],"sourcesContent":["import type { AgentCapabilities } from \"@ag-ui/core\";\n\nexport type MaybePromise<T> = T | PromiseLike<T>;\n\n/**\n * More specific utility for records with at least one key\n */\nexport type NonEmptyRecord<T> =\n T extends Record<string, unknown>\n ? keyof T extends never\n ? never\n : T\n : never;\n\n/**\n * Type representing an agent's basic information\n */\nexport interface AgentDescription {\n name: string;\n className: string;\n description: string;\n capabilities?: AgentCapabilities;\n}\n\nexport type RuntimeMode = \"sse\" | \"intelligence\";\n\nexport const RUNTIME_MODE_SSE = \"sse\" as const;\nexport const RUNTIME_MODE_INTELLIGENCE = \"intelligence\" as const;\n\nexport interface IntelligenceRuntimeInfo {\n wsUrl: string;\n}\n\nexport interface ThreadEndpointRuntimeInfo {\n list: boolean;\n inspect: boolean;\n mutations: boolean;\n realtimeMetadata: boolean;\n}\n\nexport type RuntimeLicenseStatus =\n | \"valid\"\n | \"none\"\n | \"expired\"\n | \"expiring\"\n | \"invalid\"\n | \"unknown\";\n\n/** Runtime entitlement authority resolved by a managed or self-hosted backend. */\ninterface RuntimeEntitlement {\n /** Whether the resolved entitlement currently grants product access. */\n active: boolean;\n /** Deployment authority that produced this entitlement. */\n source:\n | \"managedOrgSubscription\"\n | \"selfHostedDeploymentLicense\"\n | \"awsMarketplaceDeploymentLicense\";\n /** Boolean feature grants keyed by stable feature id. */\n features: Record<string, boolean>;\n /** Numeric limits keyed by stable feature id. */\n limits: Record<string, number>;\n /** Optional catalog plan code supplied by the entitlement authority. */\n planCode?: string;\n /** Optional lower-level source metadata supplied by the authority. */\n entitlementSource?: string;\n}\n\n/** Public diagnostic returned when Runtime entitlement resolution is not ready. */\ninterface RuntimeEntitlementError {\n /** Stable backend or SDK error code. */\n code: string;\n /** Safe human-readable diagnostic. */\n message: string;\n /** Whether a later resolution attempt may succeed without reconfiguration. */\n retryable: boolean;\n /** Optional originating request correlation id. */\n requestId?: string;\n /** Optional originating trace correlation id. */\n traceId?: string;\n}\n\n/** Successfully resolved Runtime entitlement response. */\ninterface RuntimeEntitlementReadyResponse {\n status: \"ready\";\n entitlement: RuntimeEntitlement;\n error?: never;\n}\n\n/** Structured non-ready Runtime entitlement response. */\ninterface RuntimeEntitlementErrorResponse {\n status: \"degraded\" | \"misconfigured\" | \"unavailable\";\n entitlement?: never;\n error: RuntimeEntitlementError;\n}\n\n/** Final structured Runtime entitlement response exposed through `/info`. */\nexport type RuntimeEntitlementResponse =\n | RuntimeEntitlementReadyResponse\n | RuntimeEntitlementErrorResponse;\n\n/** Generative UI (A2UI 1.0) as the runtime reports it in `GET /info`. */\nexport interface GenerativeUIRuntimeInfo {\n enabled: boolean;\n /** Agent ids generative UI is limited to. Omitted: every agent. */\n agents?: string[];\n}\n\n/** Intelligence resource support available through a single runtime route. */\nexport interface SingleRouteRuntimeInfo {\n /** Whether the runtime accepts resource requests through the single route. */\n resourceOperations: boolean;\n /** Thread features available through the single-route resource bridge. */\n threadEndpoints: ThreadEndpointRuntimeInfo;\n}\n\nexport interface RuntimeInfo {\n version: string;\n agents: Record<string, AgentDescription>;\n audioFileTranscriptionEnabled: boolean;\n mode: RuntimeMode;\n intelligence?: IntelligenceRuntimeInfo;\n threadEndpoints?: ThreadEndpointRuntimeInfo;\n /** Optional capabilities exposed by runtimes that use one HTTP route. */\n singleRoute?: SingleRouteRuntimeInfo;\n /** Whether this runtime exposes trusted inspector metadata. */\n inspectorMetadata?: boolean;\n /** Whether this runtime exposes the debug-authorized Learning snapshot. */\n inspectorLearning?: boolean;\n /**\n * When true, the runtime exposes POST /agent/:agentId/suggest for stateless\n * suggestion generation. Absent on older runtimes; clients fall back to a\n * client-side agent run.\n */\n suggestions?: boolean;\n generativeUI?: GenerativeUIRuntimeInfo;\n openGenerativeUIEnabled?: boolean;\n /** Structured Runtime-level entitlement authority, when advertised. */\n runtimeEntitlements?: RuntimeEntitlementResponse;\n /** Legacy compatibility diagnostic retained for older Core/Inspector clients. */\n licenseStatus?: RuntimeLicenseStatus;\n telemetryDisabled?: boolean;\n}\n"],"mappings":";;AA0BA,MAAa,mBAAmB;AAChC,MAAa,4BAA4B"}
@@ -70,12 +70,10 @@ interface RuntimeEntitlementErrorResponse {
70
70
  }
71
71
  /** Final structured Runtime entitlement response exposed through `/info`. */
72
72
  type RuntimeEntitlementResponse = RuntimeEntitlementReadyResponse | RuntimeEntitlementErrorResponse;
73
- interface A2UIRuntimeInfo {
73
+ /** Generative UI (A2UI 1.0) as the runtime reports it in `GET /info`. */
74
+ interface GenerativeUIRuntimeInfo {
74
75
  enabled: boolean;
75
- /**
76
- * Agent ids the runtime applies A2UI to. When omitted, A2UI applies to
77
- * every agent served by the runtime.
78
- */
76
+ /** Agent ids generative UI is limited to. Omitted: every agent. */
79
77
  agents?: string[];
80
78
  }
81
79
  /** Intelligence resource support available through a single runtime route. */
@@ -104,12 +102,7 @@ interface RuntimeInfo {
104
102
  * client-side agent run.
105
103
  */
106
104
  suggestions?: boolean;
107
- /**
108
- * @deprecated Use `a2ui` instead, which preserves per-agent scoping.
109
- * Kept for backward compatibility with older clients.
110
- */
111
- a2uiEnabled?: boolean;
112
- a2ui?: A2UIRuntimeInfo;
105
+ generativeUI?: GenerativeUIRuntimeInfo;
113
106
  openGenerativeUIEnabled?: boolean;
114
107
  /** Structured Runtime-level entitlement authority, when advertised. */
115
108
  runtimeEntitlements?: RuntimeEntitlementResponse;
@@ -118,5 +111,5 @@ interface RuntimeInfo {
118
111
  telemetryDisabled?: boolean;
119
112
  }
120
113
  //#endregion
121
- export { A2UIRuntimeInfo, AgentDescription, IntelligenceRuntimeInfo, MaybePromise, NonEmptyRecord, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, RuntimeEntitlementResponse, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SingleRouteRuntimeInfo, ThreadEndpointRuntimeInfo };
114
+ export { AgentDescription, GenerativeUIRuntimeInfo, IntelligenceRuntimeInfo, MaybePromise, NonEmptyRecord, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, RuntimeEntitlementResponse, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SingleRouteRuntimeInfo, ThreadEndpointRuntimeInfo };
122
115
  //# sourceMappingURL=types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","names":[],"sources":["../../src/utils/types.ts"],"mappings":";;;KAEY,YAAA,MAAkB,CAAA,GAAI,WAAA,CAAY,CAAA;;AAA9C;;KAKY,cAAA,MACV,CAAA,SAAU,MAAA,0BACA,CAAA,yBAEJ,CAAA;;;;UAMS,gBAAA;EACf,IAAA;EACA,SAAA;EACA,WAAA;EACA,YAAA,GAAe,iBAAA;AAAA;AAAA,KAGL,WAAA;AAAA,cAEC,gBAAA;AAAA,cACA,yBAAA;AAAA,UAEI,uBAAA;EACf,KAAA;AAAA;AAAA,UAGe,yBAAA;EACf,IAAA;EACA,OAAA;EACA,SAAA;EACA,gBAAA;AAAA;AAAA,KAGU,oBAAA;;UASF,kBAAA;EAtCF;EAwCN,MAAA;EAxCO;EA0CP,MAAA;EApC+B;EAyC/B,QAAA,EAAU,MAAA;EArCsB;EAuChC,MAAA,EAAQ,MAAA;EAzCR;EA2CA,QAAA;EAzCA;EA2CA,iBAAA;AAAA;;UAIQ,uBAAA;EA5Ca;EA8CrB,IAAA;EA9CqB;EAgDrB,OAAA;EA9CW;EAgDX,SAAA;;EAEA,SAAA;EAlD4C;EAoD5C,OAAA;AAAA;;UAIQ,+BAAA;EACR,MAAA;EACA,WAAA,EAAa,kBAAA;EACb,KAAA;AAAA;;UAIQ,+BAAA;EACR,MAAA;EACA,WAAA;EACA,KAAA,EAAO,uBAAA;AAAA;;KAIG,0BAAA,GACR,+BAAA,GACA,+BAAA;AAAA,UAEa,eAAA;EACf,OAAA;EAhEgB;;AAGlB;;EAkEE,MAAA;AAAA;;UAIe,sBAAA;EA7DW;EA+D1B,kBAAA;EApDc;EAsDd,eAAA,EAAiB,yBAAA;AAAA;AAAA,UAGF,WA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WAAA;EACA,KAAA,EAAO,uBAAA;AAAA;;KAIG,0BAAA,GACR,+BAAA,GACA,+BAAA;;UAGa,uBAAA;EACf,OAAA;EAjEgB;EAmEhB,MAAA;AAAA;;UAIe,sBAAA;EApEe;EAsE9B,kBAAA;EA7D0B;EA+D1B,eAAA,EAAiB,yBAAA;AAAA;AAAA,UAGF,WAAA;EACf,OAAA;EACA,MAAA,EAAQ,MAAA,SAAe,gBAAA;EACvB,6BAAA;EACA,IAAA,EAAM,WAAA;EACN,YAAA,GAAe,uBAAA;EACf,eAAA,GAAkB,yBAAA;EAzDlB;EA2DA,WAAA,GAAc,sBAAA;EA3DG;EA6DjB,iBAAA;EAzD+B;EA2D/B,iBAAA;EA3D+B;;;;;EAiE/B,WAAA;EACA,YAAA,GAAe,uBAAA;EACf,uBAAA;EArDQ;EAuDR,mBAAA,GAAsB,0BAAA;;EAEtB,aAAA,GAAgB,oBAAA;EAChB,iBAAA;AAAA"}
@@ -70,12 +70,10 @@ interface RuntimeEntitlementErrorResponse {
70
70
  }
71
71
  /** Final structured Runtime entitlement response exposed through `/info`. */
72
72
  type RuntimeEntitlementResponse = RuntimeEntitlementReadyResponse | RuntimeEntitlementErrorResponse;
73
- interface A2UIRuntimeInfo {
73
+ /** Generative UI (A2UI 1.0) as the runtime reports it in `GET /info`. */
74
+ interface GenerativeUIRuntimeInfo {
74
75
  enabled: boolean;
75
- /**
76
- * Agent ids the runtime applies A2UI to. When omitted, A2UI applies to
77
- * every agent served by the runtime.
78
- */
76
+ /** Agent ids generative UI is limited to. Omitted: every agent. */
79
77
  agents?: string[];
80
78
  }
81
79
  /** Intelligence resource support available through a single runtime route. */
@@ -104,12 +102,7 @@ interface RuntimeInfo {
104
102
  * client-side agent run.
105
103
  */
106
104
  suggestions?: boolean;
107
- /**
108
- * @deprecated Use `a2ui` instead, which preserves per-agent scoping.
109
- * Kept for backward compatibility with older clients.
110
- */
111
- a2uiEnabled?: boolean;
112
- a2ui?: A2UIRuntimeInfo;
105
+ generativeUI?: GenerativeUIRuntimeInfo;
113
106
  openGenerativeUIEnabled?: boolean;
114
107
  /** Structured Runtime-level entitlement authority, when advertised. */
115
108
  runtimeEntitlements?: RuntimeEntitlementResponse;
@@ -118,5 +111,5 @@ interface RuntimeInfo {
118
111
  telemetryDisabled?: boolean;
119
112
  }
120
113
  //#endregion
121
- export { A2UIRuntimeInfo, AgentDescription, IntelligenceRuntimeInfo, MaybePromise, NonEmptyRecord, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, RuntimeEntitlementResponse, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SingleRouteRuntimeInfo, ThreadEndpointRuntimeInfo };
114
+ export { AgentDescription, GenerativeUIRuntimeInfo, IntelligenceRuntimeInfo, MaybePromise, NonEmptyRecord, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, RuntimeEntitlementResponse, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SingleRouteRuntimeInfo, ThreadEndpointRuntimeInfo };
122
115
  //# sourceMappingURL=types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","names":[],"sources":["../../src/utils/types.ts"],"mappings":";;;KAEY,YAAA,MAAkB,CAAA,GAAI,WAAA,CAAY,CAAA;;AAA9C;;KAKY,cAAA,MACV,CAAA,SAAU,MAAA,0BACA,CAAA,yBAEJ,CAAA;;;;UAMS,gBAAA;EACf,IAAA;EACA,SAAA;EACA,WAAA;EACA,YAAA,GAAe,iBAAA;AAAA;AAAA,KAGL,WAAA;AAAA,cAEC,gBAAA;AAAA,cACA,yBAAA;AAAA,UAEI,uBAAA;EACf,KAAA;AAAA;AAAA,UAGe,yBAAA;EACf,IAAA;EACA,OAAA;EACA,SAAA;EACA,gBAAA;AAAA;AAAA,KAGU,oBAAA;;UASF,kBAAA;EAtCF;EAwCN,MAAA;EAxCO;EA0CP,MAAA;EApC+B;EAyC/B,QAAA,EAAU,MAAA;EArCsB;EAuChC,MAAA,EAAQ,MAA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uBAAA;EACf,KAAA;AAAA;AAAA,UAGe,yBAAA;EACf,IAAA;EACA,OAAA;EACA,SAAA;EACA,gBAAA;AAAA;AAAA,KAGU,oBAAA;;UASF,kBAAA;EAtCF;EAwCN,MAAA;EAxCO;EA0CP,MAAA;EApC+B;EAyC/B,QAAA,EAAU,MAAA;EArCsB;EAuChC,MAAA,EAAQ,MAAA;EAzCR;EA2CA,QAAA;EAzCA;EA2CA,iBAAA;AAAA;;UAIQ,uBAAA;EA5Ca;EA8CrB,IAAA;EA9CqB;EAgDrB,OAAA;EA9CW;EAgDX,SAAA;;EAEA,SAAA;EAlD4C;EAoD5C,OAAA;AAAA;;UAIQ,+BAAA;EACR,MAAA;EACA,WAAA,EAAa,kBAAA;EACb,KAAA;AAAA;;UAIQ,+BAAA;EACR,MAAA;EACA,WAAA;EACA,KAAA,EAAO,uBAAA;AAAA;;KAIG,0BAAA,GACR,+BAAA,GACA,+BAAA;;UAGa,uBAAA;EACf,OAAA;EAjEgB;EAmEhB,MAAA;AAAA;;UAIe,sBAAA;EApEe;EAsE9B,kBAAA;EA7D0B;EA+D1B,eAAA,EAAiB,yBAAA;AAAA;AAAA,UAGF,WAAA;EACf,OAAA;EACA,MAAA,EAAQ,MAAA,SAAe,gBAAA;EACvB,6BAAA;EACA,IAAA,EAAM,WAAA;EACN,YAAA,GAAe,uBAAA;EACf,eAAA,GAAkB,yBAAA;EAzDlB;EA2DA,WAAA,GAAc,sBAAA;EA3DG;EA6DjB,iBAAA;EAzD+B;EA2D/B,iBAAA;EA3D+B;;;;;EAiE/B,WAAA;EACA,YAAA,GAAe,uBAAA;EACf,uBAAA;EArDQ;EAuDR,mBAAA,GAAsB,0BAAA;;EAEtB,aAAA,GAAgB,oBAAA;EAChB,iBAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","names":[],"sources":["../../src/utils/types.ts"],"sourcesContent":["import type { AgentCapabilities } from \"@ag-ui/core\";\n\nexport type MaybePromise<T> = T | PromiseLike<T>;\n\n/**\n * More specific utility for records with at least one key\n */\nexport type NonEmptyRecord<T> =\n T extends Record<string, unknown>\n ? keyof T extends never\n ? never\n : T\n : never;\n\n/**\n * Type representing an agent's basic information\n */\nexport interface AgentDescription {\n name: string;\n className: string;\n description: string;\n capabilities?: AgentCapabilities;\n}\n\nexport type RuntimeMode = \"sse\" | \"intelligence\";\n\nexport const RUNTIME_MODE_SSE = \"sse\" as const;\nexport const RUNTIME_MODE_INTELLIGENCE = \"intelligence\" as const;\n\nexport interface IntelligenceRuntimeInfo {\n wsUrl: string;\n}\n\nexport interface ThreadEndpointRuntimeInfo {\n list: boolean;\n inspect: boolean;\n mutations: boolean;\n realtimeMetadata: boolean;\n}\n\nexport type RuntimeLicenseStatus =\n | \"valid\"\n | \"none\"\n | \"expired\"\n | \"expiring\"\n | \"invalid\"\n | \"unknown\";\n\n/** Runtime entitlement authority resolved by a managed or self-hosted backend. */\ninterface RuntimeEntitlement {\n /** Whether the resolved entitlement currently grants product access. */\n active: boolean;\n /** Deployment authority that produced this entitlement. */\n source:\n | \"managedOrgSubscription\"\n | \"selfHostedDeploymentLicense\"\n | \"awsMarketplaceDeploymentLicense\";\n /** Boolean feature grants keyed by stable feature id. */\n features: Record<string, boolean>;\n /** Numeric limits keyed by stable feature id. */\n limits: Record<string, number>;\n /** Optional catalog plan code supplied by the entitlement authority. */\n planCode?: string;\n /** Optional lower-level source metadata supplied by the authority. */\n entitlementSource?: string;\n}\n\n/** Public diagnostic returned when Runtime entitlement resolution is not ready. */\ninterface RuntimeEntitlementError {\n /** Stable backend or SDK error code. */\n code: string;\n /** Safe human-readable diagnostic. */\n message: string;\n /** Whether a later resolution attempt may succeed without reconfiguration. */\n retryable: boolean;\n /** Optional originating request correlation id. */\n requestId?: string;\n /** Optional originating trace correlation id. */\n traceId?: string;\n}\n\n/** Successfully resolved Runtime entitlement response. */\ninterface RuntimeEntitlementReadyResponse {\n status: \"ready\";\n entitlement: RuntimeEntitlement;\n error?: never;\n}\n\n/** Structured non-ready Runtime entitlement response. */\ninterface RuntimeEntitlementErrorResponse {\n status: \"degraded\" | \"misconfigured\" | \"unavailable\";\n entitlement?: never;\n error: RuntimeEntitlementError;\n}\n\n/** Final structured Runtime entitlement response exposed through `/info`. */\nexport type RuntimeEntitlementResponse =\n | RuntimeEntitlementReadyResponse\n | RuntimeEntitlementErrorResponse;\n\nexport interface A2UIRuntimeInfo {\n enabled: boolean;\n /**\n * Agent ids the runtime applies A2UI to. When omitted, A2UI applies to\n * every agent served by the runtime.\n */\n agents?: string[];\n}\n\n/** Intelligence resource support available through a single runtime route. */\nexport interface SingleRouteRuntimeInfo {\n /** Whether the runtime accepts resource requests through the single route. */\n resourceOperations: boolean;\n /** Thread features available through the single-route resource bridge. */\n threadEndpoints: ThreadEndpointRuntimeInfo;\n}\n\nexport interface RuntimeInfo {\n version: string;\n agents: Record<string, AgentDescription>;\n audioFileTranscriptionEnabled: boolean;\n mode: RuntimeMode;\n intelligence?: IntelligenceRuntimeInfo;\n threadEndpoints?: ThreadEndpointRuntimeInfo;\n /** Optional capabilities exposed by runtimes that use one HTTP route. */\n singleRoute?: SingleRouteRuntimeInfo;\n /** Whether this runtime exposes trusted inspector metadata. */\n inspectorMetadata?: boolean;\n /** Whether this runtime exposes the debug-authorized Learning snapshot. */\n inspectorLearning?: boolean;\n /**\n * When true, the runtime exposes POST /agent/:agentId/suggest for stateless\n * suggestion generation. Absent on older runtimes; clients fall back to a\n * client-side agent run.\n */\n suggestions?: boolean;\n /**\n * @deprecated Use `a2ui` instead, which preserves per-agent scoping.\n * Kept for backward compatibility with older clients.\n */\n a2uiEnabled?: boolean;\n a2ui?: A2UIRuntimeInfo;\n openGenerativeUIEnabled?: boolean;\n /** Structured Runtime-level entitlement authority, when advertised. */\n runtimeEntitlements?: RuntimeEntitlementResponse;\n /** Legacy compatibility diagnostic retained for older Core/Inspector clients. */\n licenseStatus?: RuntimeLicenseStatus;\n telemetryDisabled?: boolean;\n}\n"],"mappings":";AA0BA,MAAa,mBAAmB;AAChC,MAAa,4BAA4B"}
1
+ {"version":3,"file":"types.mjs","names":[],"sources":["../../src/utils/types.ts"],"sourcesContent":["import type { AgentCapabilities } from \"@ag-ui/core\";\n\nexport type MaybePromise<T> = T | PromiseLike<T>;\n\n/**\n * More specific utility for records with at least one key\n */\nexport type NonEmptyRecord<T> =\n T extends Record<string, unknown>\n ? keyof T extends never\n ? never\n : T\n : never;\n\n/**\n * Type representing an agent's basic information\n */\nexport interface AgentDescription {\n name: string;\n className: string;\n description: string;\n capabilities?: AgentCapabilities;\n}\n\nexport type RuntimeMode = \"sse\" | \"intelligence\";\n\nexport const RUNTIME_MODE_SSE = \"sse\" as const;\nexport const RUNTIME_MODE_INTELLIGENCE = \"intelligence\" as const;\n\nexport interface IntelligenceRuntimeInfo {\n wsUrl: string;\n}\n\nexport interface ThreadEndpointRuntimeInfo {\n list: boolean;\n inspect: boolean;\n mutations: boolean;\n realtimeMetadata: boolean;\n}\n\nexport type RuntimeLicenseStatus =\n | \"valid\"\n | \"none\"\n | \"expired\"\n | \"expiring\"\n | \"invalid\"\n | \"unknown\";\n\n/** Runtime entitlement authority resolved by a managed or self-hosted backend. */\ninterface RuntimeEntitlement {\n /** Whether the resolved entitlement currently grants product access. */\n active: boolean;\n /** Deployment authority that produced this entitlement. */\n source:\n | \"managedOrgSubscription\"\n | \"selfHostedDeploymentLicense\"\n | \"awsMarketplaceDeploymentLicense\";\n /** Boolean feature grants keyed by stable feature id. */\n features: Record<string, boolean>;\n /** Numeric limits keyed by stable feature id. */\n limits: Record<string, number>;\n /** Optional catalog plan code supplied by the entitlement authority. */\n planCode?: string;\n /** Optional lower-level source metadata supplied by the authority. */\n entitlementSource?: string;\n}\n\n/** Public diagnostic returned when Runtime entitlement resolution is not ready. */\ninterface RuntimeEntitlementError {\n /** Stable backend or SDK error code. */\n code: string;\n /** Safe human-readable diagnostic. */\n message: string;\n /** Whether a later resolution attempt may succeed without reconfiguration. */\n retryable: boolean;\n /** Optional originating request correlation id. */\n requestId?: string;\n /** Optional originating trace correlation id. */\n traceId?: string;\n}\n\n/** Successfully resolved Runtime entitlement response. */\ninterface RuntimeEntitlementReadyResponse {\n status: \"ready\";\n entitlement: RuntimeEntitlement;\n error?: never;\n}\n\n/** Structured non-ready Runtime entitlement response. */\ninterface RuntimeEntitlementErrorResponse {\n status: \"degraded\" | \"misconfigured\" | \"unavailable\";\n entitlement?: never;\n error: RuntimeEntitlementError;\n}\n\n/** Final structured Runtime entitlement response exposed through `/info`. */\nexport type RuntimeEntitlementResponse =\n | RuntimeEntitlementReadyResponse\n | RuntimeEntitlementErrorResponse;\n\n/** Generative UI (A2UI 1.0) as the runtime reports it in `GET /info`. */\nexport interface GenerativeUIRuntimeInfo {\n enabled: boolean;\n /** Agent ids generative UI is limited to. Omitted: every agent. */\n agents?: string[];\n}\n\n/** Intelligence resource support available through a single runtime route. */\nexport interface SingleRouteRuntimeInfo {\n /** Whether the runtime accepts resource requests through the single route. */\n resourceOperations: boolean;\n /** Thread features available through the single-route resource bridge. */\n threadEndpoints: ThreadEndpointRuntimeInfo;\n}\n\nexport interface RuntimeInfo {\n version: string;\n agents: Record<string, AgentDescription>;\n audioFileTranscriptionEnabled: boolean;\n mode: RuntimeMode;\n intelligence?: IntelligenceRuntimeInfo;\n threadEndpoints?: ThreadEndpointRuntimeInfo;\n /** Optional capabilities exposed by runtimes that use one HTTP route. */\n singleRoute?: SingleRouteRuntimeInfo;\n /** Whether this runtime exposes trusted inspector metadata. */\n inspectorMetadata?: boolean;\n /** Whether this runtime exposes the debug-authorized Learning snapshot. */\n inspectorLearning?: boolean;\n /**\n * When true, the runtime exposes POST /agent/:agentId/suggest for stateless\n * suggestion generation. Absent on older runtimes; clients fall back to a\n * client-side agent run.\n */\n suggestions?: boolean;\n generativeUI?: GenerativeUIRuntimeInfo;\n openGenerativeUIEnabled?: boolean;\n /** Structured Runtime-level entitlement authority, when advertised. */\n runtimeEntitlements?: RuntimeEntitlementResponse;\n /** Legacy compatibility diagnostic retained for older Core/Inspector clients. */\n licenseStatus?: RuntimeLicenseStatus;\n telemetryDisabled?: boolean;\n}\n"],"mappings":";AA0BA,MAAa,mBAAmB;AAChC,MAAa,4BAA4B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@copilotkit/shared",
3
- "version": "2.0.0-rc.42",
3
+ "version": "2.0.0-rc.43",
4
4
  "private": false,
5
5
  "keywords": [
6
6
  "ai",
@@ -181,6 +181,20 @@ describe("readCopilotKitUIEnvelope", () => {
181
181
  expect(readUI(envelope)).toEqual(envelope);
182
182
  });
183
183
 
184
+ it("reads a surface that the runtime converted from A2UI v0.9", () => {
185
+ const envelope = createEnvelope({
186
+ extensions: {
187
+ copilotkit_surfaces: {
188
+ plans: { target: "chat", a2uiSourceVersion: "0.9" },
189
+ },
190
+ },
191
+ });
192
+ expect(readUI(envelope)).toEqual(envelope);
193
+ expect(envelopeToManifest(readUI(envelope)!).surfaces).toEqual({
194
+ plans: { target: "chat", a2uiSourceVersion: "0.9" },
195
+ });
196
+ });
197
+
184
198
  it("returns undefined when there is no envelope", () => {
185
199
  expect(readCopilotKitUIEnvelope(undefined)).toBeUndefined();
186
200
  expect(readCopilotKitUIEnvelope("copilotkit")).toBeUndefined();
@@ -290,6 +304,12 @@ describe("readCopilotKitUIEnvelope", () => {
290
304
  cart: { target: "chat", status: "closed" },
291
305
  }),
292
306
  ],
307
+ [
308
+ "an unknown surface source version",
309
+ withExtension("copilotkit_surfaces", {
310
+ cart: { target: "chat", a2uiSourceVersion: "1.0" },
311
+ }),
312
+ ],
293
313
  [
294
314
  "a surface rejection longer than 500 characters",
295
315
  withExtension("copilotkit_surfaces", {
@@ -201,7 +201,8 @@ function isSurfaceEntry(value: unknown): value is GenerativeUISurfaceSummary {
201
201
  (value.rejected === undefined || isRejectionList(value.rejected)) &&
202
202
  (value.status === undefined ||
203
203
  value.status === "deleted" ||
204
- value.status === "failed")
204
+ value.status === "failed") &&
205
+ (value.a2uiSourceVersion === undefined || value.a2uiSourceVersion === "0.9")
205
206
  );
206
207
  }
207
208
 
@@ -153,6 +153,12 @@ export interface GenerativeUISurfaceContent {
153
153
  operations: A2UIOperation[];
154
154
  status: GenerativeUISurfaceStatus;
155
155
  rejected: GenerativeUIRejectedOperation[];
156
+ /**
157
+ * `"0.9"` when the runtime converted the surface from A2UI v0.9 operations,
158
+ * so a user event on it goes back to the agent as a v0.9 action. Left out
159
+ * for a surface that the agent wrote in 1.0.
160
+ */
161
+ a2uiSourceVersion?: "0.9";
156
162
  }
157
163
 
158
164
  /** Content of a `generative-ui-function-call` activity message. */
@@ -255,6 +261,13 @@ export interface GenerativeUISurfaceSummary {
255
261
  * rejected, so it does not exist; a corrected createSurface can use the id.
256
262
  */
257
263
  status?: "deleted" | "failed";
264
+ /**
265
+ * `"0.9"` when the runtime converted the surface from A2UI v0.9 (copied
266
+ * from {@link GenerativeUISurfaceContent.a2uiSourceVersion}), so the
267
+ * runtime sends a user event on it to the agent as a v0.9 action. Left out
268
+ * for a surface that the agent wrote in 1.0.
269
+ */
270
+ a2uiSourceVersion?: "0.9";
258
271
  }
259
272
 
260
273
  /** A user interaction bound to `{ event }`, sent to the agent. */
@@ -98,12 +98,10 @@ export type RuntimeEntitlementResponse =
98
98
  | RuntimeEntitlementReadyResponse
99
99
  | RuntimeEntitlementErrorResponse;
100
100
 
101
- export interface A2UIRuntimeInfo {
101
+ /** Generative UI (A2UI 1.0) as the runtime reports it in `GET /info`. */
102
+ export interface GenerativeUIRuntimeInfo {
102
103
  enabled: boolean;
103
- /**
104
- * Agent ids the runtime applies A2UI to. When omitted, A2UI applies to
105
- * every agent served by the runtime.
106
- */
104
+ /** Agent ids generative UI is limited to. Omitted: every agent. */
107
105
  agents?: string[];
108
106
  }
109
107
 
@@ -134,12 +132,7 @@ export interface RuntimeInfo {
134
132
  * client-side agent run.
135
133
  */
136
134
  suggestions?: boolean;
137
- /**
138
- * @deprecated Use `a2ui` instead, which preserves per-agent scoping.
139
- * Kept for backward compatibility with older clients.
140
- */
141
- a2uiEnabled?: boolean;
142
- a2ui?: A2UIRuntimeInfo;
135
+ generativeUI?: GenerativeUIRuntimeInfo;
143
136
  openGenerativeUIEnabled?: boolean;
144
137
  /** Structured Runtime-level entitlement authority, when advertised. */
145
138
  runtimeEntitlements?: RuntimeEntitlementResponse;