@copilotkit/shared 1.61.0 → 1.61.2
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/index.cjs +14 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -17
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +17 -17
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +14 -7
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +15 -8
- package/dist/index.umd.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.mjs +1 -1
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/types.cjs.map +1 -1
- package/dist/utils/types.d.cts +8 -1
- package/dist/utils/types.d.cts.map +1 -1
- package/dist/utils/types.d.mts +8 -1
- package/dist/utils/types.d.mts.map +1 -1
- package/dist/utils/types.mjs.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/license-context.test.ts +33 -0
- package/src/index.ts +23 -20
- package/src/utils/types.ts +8 -0
- package/LICENSE +0 -21
package/dist/index.cjs
CHANGED
|
@@ -23,18 +23,25 @@ const require_a2ui_prompts = require('./a2ui-prompts.cjs');
|
|
|
23
23
|
//#region src/index.ts
|
|
24
24
|
const COPILOTKIT_VERSION = require_package.version;
|
|
25
25
|
/**
|
|
26
|
-
* Client-safe license context factory
|
|
26
|
+
* Client-safe license context factory, driven by the license status the
|
|
27
|
+
* runtime reports via /info.
|
|
27
28
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
29
|
+
* Features are enabled unless the runtime definitively reports the license
|
|
30
|
+
* as "expired" or "invalid". A null/"none"/"unknown" status fails open
|
|
31
|
+
* (unlicensed = unrestricted, with branding), and "expiring" keeps features
|
|
32
|
+
* on while the provider surfaces a warning banner. Per-feature data is not
|
|
33
|
+
* in /info yet, so checkFeature is uniform across features and getLimit has
|
|
34
|
+
* no limits to report. This is inlined here to avoid importing the full
|
|
35
|
+
* license-verifier bundle (which depends on Node's `crypto`) into browser
|
|
36
|
+
* bundles.
|
|
32
37
|
*/
|
|
33
38
|
function createLicenseContextValue(status) {
|
|
39
|
+
const resolvedStatus = status ?? null;
|
|
40
|
+
const featuresEnabled = resolvedStatus !== "expired" && resolvedStatus !== "invalid";
|
|
34
41
|
return {
|
|
35
|
-
status:
|
|
42
|
+
status: resolvedStatus,
|
|
36
43
|
license: null,
|
|
37
|
-
checkFeature: () =>
|
|
44
|
+
checkFeature: () => featuresEnabled,
|
|
38
45
|
getLimit: () => null
|
|
39
46
|
};
|
|
40
47
|
}
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["export * from \"./types\";\nexport * from \"./utils\";\nexport * from \"./constants\";\nexport * from \"./telemetry\";\nexport * from \"./debug\";\nexport * from \"./standard-schema\";\nexport * from \"./attachments\";\n\nexport { logger } from \"./logger\";\nexport { finalizeRunEvents } from \"./finalize-events\";\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 {
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["export * from \"./types\";\nexport * from \"./utils\";\nexport * from \"./constants\";\nexport * from \"./telemetry\";\nexport * from \"./debug\";\nexport * from \"./standard-schema\";\nexport * from \"./attachments\";\n\nexport { logger } from \"./logger\";\nexport { finalizeRunEvents } from \"./finalize-events\";\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 { RuntimeLicenseStatus } 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 /** Server-reported license status from the runtime's /info endpoint. 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 specific feature is licensed. Returns true if no licensing is active (no token). */\n checkFeature: (feature: string) => boolean;\n /** Get a numeric feature limit. Returns null if not applicable. */\n getLimit: (feature: string) => number | null;\n}\n\n/**\n * Client-safe license context factory, driven by the license status the\n * runtime reports via /info.\n *\n * Features are enabled unless the runtime definitively reports the license\n * as \"expired\" or \"invalid\". A null/\"none\"/\"unknown\" status fails open\n * (unlicensed = unrestricted, with branding), and \"expiring\" keeps features\n * on while the provider surfaces a warning banner. Per-feature data is not\n * in /info yet, so checkFeature is uniform across features and getLimit has\n * no limits to report. This is inlined here to avoid importing the full\n * license-verifier bundle (which depends on Node's `crypto`) into browser\n * bundles.\n */\nexport function createLicenseContextValue(\n status: RuntimeLicenseStatus | null | undefined,\n): LicenseContextValue {\n const resolvedStatus = status ?? null;\n const featuresEnabled =\n resolvedStatus !== \"expired\" && resolvedStatus !== \"invalid\";\n return {\n status: resolvedStatus,\n license: null,\n checkFeature: () => featuresEnabled,\n getLimit: () => null,\n };\n}\n\nexport {\n A2UI_DEFAULT_GENERATION_GUIDELINES,\n A2UI_DEFAULT_DESIGN_GUIDELINES,\n} from \"./a2ui-prompts\";\n\nexport type { DebugEventEnvelope } from \"./debug-event-envelope\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAa;;;;;;;;;;;;;;AAmDb,SAAgB,0BACd,QACqB;CACrB,MAAM,iBAAiB,UAAU;CACjC,MAAM,kBACJ,mBAAmB,aAAa,mBAAmB;AACrD,QAAO;EACL,QAAQ;EACR,SAAS;EACT,oBAAoB;EACpB,gBAAgB;EACjB"}
|
package/dist/index.d.cts
CHANGED
|
@@ -9,7 +9,7 @@ import { BaseCondition, ComparisonCondition, ComparisonRule, Condition, Existenc
|
|
|
9
9
|
import { ConsoleColors, ConsoleStyles, logCopilotKitPlatformMessage, logStyled, publicApiKeyRequired, styledConsole } from "./utils/console-styling.cjs";
|
|
10
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
11
|
import { JSONSchema, JSONSchemaArray, JSONSchemaBoolean, JSONSchemaNumber, JSONSchemaObject, JSONSchemaString, actionParametersToJsonSchema, convertJsonSchemaToZodSchema, getZodParameters, jsonSchemaToActionParameters } from "./utils/json-schema.cjs";
|
|
12
|
-
import { A2UIRuntimeInfo, AgentDescription, IntelligenceRuntimeInfo, MaybePromise, NonEmptyRecord, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode } from "./utils/types.cjs";
|
|
12
|
+
import { A2UIRuntimeInfo, AgentDescription, IntelligenceRuntimeInfo, MaybePromise, NonEmptyRecord, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, ThreadEndpointRuntimeInfo } from "./utils/types.cjs";
|
|
13
13
|
import { dataToUUID, isValidUUID, randomId, randomUUID } from "./utils/random-id.cjs";
|
|
14
14
|
import { readBody } from "./utils/requests.cjs";
|
|
15
15
|
import { isMacOS, parseJson, partialJSONParse, phoenixExponentialBackoff, safeParseToolArgs, tryMap } from "./utils/index.cjs";
|
|
@@ -25,7 +25,7 @@ import { finalizeRunEvents } from "./finalize-events.cjs";
|
|
|
25
25
|
import { TranscriptionErrorCode, TranscriptionErrorResponse, TranscriptionErrors } from "./transcription-errors.cjs";
|
|
26
26
|
import { A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES } from "./a2ui-prompts.cjs";
|
|
27
27
|
import { DebugEventEnvelope } from "./debug-event-envelope.cjs";
|
|
28
|
-
import { LicenseChecker, LicenseFeatures, LicenseOwner, LicensePayload, LicensePayload as LicensePayload$1, LicenseStatus,
|
|
28
|
+
import { LicenseChecker, LicenseFeatures, LicenseOwner, LicensePayload, LicensePayload as LicensePayload$1, LicenseStatus, LicenseTier } from "@copilotkit/license-verifier";
|
|
29
29
|
|
|
30
30
|
//#region src/index.d.ts
|
|
31
31
|
declare const COPILOTKIT_VERSION: string;
|
|
@@ -34,9 +34,9 @@ declare const COPILOTKIT_VERSION: string;
|
|
|
34
34
|
* Frontend providers create their own context using this shape.
|
|
35
35
|
*/
|
|
36
36
|
interface LicenseContextValue {
|
|
37
|
-
/**
|
|
38
|
-
status:
|
|
39
|
-
/**
|
|
37
|
+
/** Server-reported license status from the runtime's /info endpoint. Null until known. */
|
|
38
|
+
status: RuntimeLicenseStatus | null;
|
|
39
|
+
/** The license payload if available. Always null on the client; the payload stays server-side. */
|
|
40
40
|
license: LicensePayload$1 | null;
|
|
41
41
|
/** Whether a specific feature is licensed. Returns true if no licensing is active (no token). */
|
|
42
42
|
checkFeature: (feature: string) => boolean;
|
|
@@ -44,19 +44,19 @@ interface LicenseContextValue {
|
|
|
44
44
|
getLimit: (feature: string) => number | null;
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
|
-
* Client-safe license context factory
|
|
47
|
+
* Client-safe license context factory, driven by the license status the
|
|
48
|
+
* runtime reports via /info.
|
|
48
49
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
50
|
+
* Features are enabled unless the runtime definitively reports the license
|
|
51
|
+
* as "expired" or "invalid". A null/"none"/"unknown" status fails open
|
|
52
|
+
* (unlicensed = unrestricted, with branding), and "expiring" keeps features
|
|
53
|
+
* on while the provider surfaces a warning banner. Per-feature data is not
|
|
54
|
+
* in /info yet, so checkFeature is uniform across features and getLimit has
|
|
55
|
+
* no limits to report. This is inlined here to avoid importing the full
|
|
56
|
+
* license-verifier bundle (which depends on Node's `crypto`) into browser
|
|
57
|
+
* bundles.
|
|
53
58
|
*/
|
|
54
|
-
declare function createLicenseContextValue(status: null):
|
|
55
|
-
status: null;
|
|
56
|
-
license: null;
|
|
57
|
-
checkFeature: (feature: string) => boolean;
|
|
58
|
-
getLimit: (feature: string) => number | null;
|
|
59
|
-
};
|
|
59
|
+
declare function createLicenseContextValue(status: RuntimeLicenseStatus | null | undefined): LicenseContextValue;
|
|
60
60
|
//#endregion
|
|
61
|
-
export { A2UIRuntimeInfo, A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, AG_UI_CHANNEL_EVENT, AIMessage, Action, ActivityMessage, AgentDescription, AssistantMessage, Attachment, AttachmentModality, AttachmentUploadError, AttachmentUploadErrorReason, AttachmentUploadResult, AttachmentsConfig, AudioInputPart, BANNER_ERROR_NAMES, BaseCondition, COPILOTKIT_VERSION, COPILOT_CLOUD_API_URL, COPILOT_CLOUD_CHAT_URL, COPILOT_CLOUD_ERROR_NAMES, COPILOT_CLOUD_PUBLIC_API_KEY_HEADER, COPILOT_CLOUD_VERSION, CoAgentStateRenderHandler, CoAgentStateRenderHandlerArguments, ComparisonCondition, ComparisonRule, Condition, ConfigurationError, ConsoleColors, ConsoleStyles, CopilotCloudConfig, CopilotErrorEvent, CopilotErrorHandler, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, CopilotKitVersionMismatchError, CopilotRequestContext, DEFAULT_AGENT_ID, DebugConfig, type DebugEventEnvelope, DeveloperMessage, DocumentInputPart, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, ExistenceCondition, ExistenceRule, FunctionCallHandler, FunctionCallHandlerArguments, FunctionDefinition, ImageData, ImageInputPart, InferSchemaOutput, InputContent, InputContentDataSource, InputContentSource, InputContentUrlSource, IntelligenceRuntimeInfo, JSONSchema, JSONSchemaArray, JSONSchemaBoolean, JSONSchemaNumber, JSONSchemaObject, JSONSchemaString, JSONValue, LambdaSendOptions, type LicenseChecker, LicenseContextValue, type LicenseFeatures, type LicenseOwner, type LicensePayload, type LicenseStatus, type LicenseTier, LogicalCondition, LogicalRule, MappedParameterTypes, MaybePromise, Message, MissingPublicApiKeyError, NonEmptyRecord, Parameter, PartialBy, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, ReasoningMessage, RequiredBy, ResolvedCopilotKitError, ResolvedDebugConfig, Role, Rule, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SchemaToJsonSchemaOptions, Severity, StandardJSONSchemaV1, StandardSchemaV1, SystemMessage, TelemetryClient, TextInputPart, ToolCall, ToolDefinition, ToolResult, TranscriptionErrorCode, type TranscriptionErrorResponse, TranscriptionErrors, UpgradeRequiredError, UserMessage, VideoInputPart, actionParametersToJsonSchema, convertJsonSchemaToZodSchema, copyToClipboard, createLicenseContextValue, dataToUUID, ensureStructuredError, exceedsMaxSize, executeConditions, finalizeRunEvents, formatFileSize, generateVideoThumbnail, getDocumentIcon, getModalityFromMimeType, getPossibleVersionMismatch, getSourceUrl, getZodParameters, isMacOS, isStructuredCopilotKitError, isTelemetryDisabled, isValidUUID, jsonSchemaToActionParameters, lambdaClient, logCopilotKitPlatformMessage, logStyled, logger, matchesAcceptFilter, parseAndWarnTelemetryId, parseJson, parseTelemetryIdFromLicense, partialJSONParse, phoenixExponentialBackoff, publicApiKeyRequired, randomId, randomUUID, readBody, readFileAsBase64, resolveDebugConfig, safeParseToolArgs, schemaToJsonSchema, styledConsole, tryMap };
|
|
61
|
+
export { A2UIRuntimeInfo, A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, AG_UI_CHANNEL_EVENT, AIMessage, Action, ActivityMessage, AgentDescription, AssistantMessage, Attachment, AttachmentModality, AttachmentUploadError, AttachmentUploadErrorReason, AttachmentUploadResult, AttachmentsConfig, AudioInputPart, BANNER_ERROR_NAMES, BaseCondition, COPILOTKIT_VERSION, COPILOT_CLOUD_API_URL, COPILOT_CLOUD_CHAT_URL, COPILOT_CLOUD_ERROR_NAMES, COPILOT_CLOUD_PUBLIC_API_KEY_HEADER, COPILOT_CLOUD_VERSION, CoAgentStateRenderHandler, CoAgentStateRenderHandlerArguments, ComparisonCondition, ComparisonRule, Condition, ConfigurationError, ConsoleColors, ConsoleStyles, CopilotCloudConfig, CopilotErrorEvent, CopilotErrorHandler, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, CopilotKitVersionMismatchError, CopilotRequestContext, DEFAULT_AGENT_ID, DebugConfig, type DebugEventEnvelope, DeveloperMessage, DocumentInputPart, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, ExistenceCondition, ExistenceRule, FunctionCallHandler, FunctionCallHandlerArguments, FunctionDefinition, ImageData, ImageInputPart, InferSchemaOutput, InputContent, InputContentDataSource, InputContentSource, InputContentUrlSource, IntelligenceRuntimeInfo, JSONSchema, JSONSchemaArray, JSONSchemaBoolean, JSONSchemaNumber, JSONSchemaObject, JSONSchemaString, JSONValue, LambdaSendOptions, type LicenseChecker, LicenseContextValue, type LicenseFeatures, type LicenseOwner, type LicensePayload, type LicenseStatus, type LicenseTier, LogicalCondition, LogicalRule, MappedParameterTypes, MaybePromise, Message, MissingPublicApiKeyError, NonEmptyRecord, Parameter, PartialBy, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, ReasoningMessage, RequiredBy, ResolvedCopilotKitError, ResolvedDebugConfig, Role, Rule, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SchemaToJsonSchemaOptions, Severity, StandardJSONSchemaV1, StandardSchemaV1, SystemMessage, TelemetryClient, TextInputPart, ThreadEndpointRuntimeInfo, ToolCall, ToolDefinition, ToolResult, TranscriptionErrorCode, type TranscriptionErrorResponse, TranscriptionErrors, UpgradeRequiredError, UserMessage, VideoInputPart, actionParametersToJsonSchema, convertJsonSchemaToZodSchema, copyToClipboard, createLicenseContextValue, dataToUUID, ensureStructuredError, exceedsMaxSize, executeConditions, finalizeRunEvents, formatFileSize, generateVideoThumbnail, getDocumentIcon, getModalityFromMimeType, getPossibleVersionMismatch, getSourceUrl, getZodParameters, isMacOS, isStructuredCopilotKitError, isTelemetryDisabled, isValidUUID, jsonSchemaToActionParameters, lambdaClient, logCopilotKitPlatformMessage, logStyled, logger, matchesAcceptFilter, parseAndWarnTelemetryId, parseJson, parseTelemetryIdFromLicense, partialJSONParse, phoenixExponentialBackoff, publicApiKeyRequired, randomId, randomUUID, readBody, readFileAsBase64, resolveDebugConfig, safeParseToolArgs, schemaToJsonSchema, styledConsole, tryMap };
|
|
62
62
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkBa,kBAAA;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkBa,kBAAA;;;;;UA2BI,mBAAA;;EAEf,MAAA,EAAQ,oBAAA;;EAER,OAAA,EAAS,gBAAA;;EAET,YAAA,GAAe,OAAA;;EAEf,QAAA,GAAW,OAAA;AAAA;;;AAnCb;;;;;AA2BA;;;;;;iBAwBgB,yBAAA,CACd,MAAA,EAAQ,oBAAA,sBACP,mBAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -9,7 +9,7 @@ import { BaseCondition, ComparisonCondition, ComparisonRule, Condition, Existenc
|
|
|
9
9
|
import { ConsoleColors, ConsoleStyles, logCopilotKitPlatformMessage, logStyled, publicApiKeyRequired, styledConsole } from "./utils/console-styling.mjs";
|
|
10
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
11
|
import { JSONSchema, JSONSchemaArray, JSONSchemaBoolean, JSONSchemaNumber, JSONSchemaObject, JSONSchemaString, actionParametersToJsonSchema, convertJsonSchemaToZodSchema, getZodParameters, jsonSchemaToActionParameters } from "./utils/json-schema.mjs";
|
|
12
|
-
import { A2UIRuntimeInfo, AgentDescription, IntelligenceRuntimeInfo, MaybePromise, NonEmptyRecord, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode } from "./utils/types.mjs";
|
|
12
|
+
import { A2UIRuntimeInfo, AgentDescription, IntelligenceRuntimeInfo, MaybePromise, NonEmptyRecord, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, ThreadEndpointRuntimeInfo } from "./utils/types.mjs";
|
|
13
13
|
import { dataToUUID, isValidUUID, randomId, randomUUID } from "./utils/random-id.mjs";
|
|
14
14
|
import { readBody } from "./utils/requests.mjs";
|
|
15
15
|
import { isMacOS, parseJson, partialJSONParse, phoenixExponentialBackoff, safeParseToolArgs, tryMap } from "./utils/index.mjs";
|
|
@@ -26,7 +26,7 @@ import { finalizeRunEvents } from "./finalize-events.mjs";
|
|
|
26
26
|
import { TranscriptionErrorCode, TranscriptionErrorResponse, TranscriptionErrors } from "./transcription-errors.mjs";
|
|
27
27
|
import { A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES } from "./a2ui-prompts.mjs";
|
|
28
28
|
import { DebugEventEnvelope } from "./debug-event-envelope.mjs";
|
|
29
|
-
import { LicenseChecker, LicenseFeatures, LicenseOwner, LicensePayload, LicensePayload as LicensePayload$1, LicenseStatus,
|
|
29
|
+
import { LicenseChecker, LicenseFeatures, LicenseOwner, LicensePayload, LicensePayload as LicensePayload$1, LicenseStatus, LicenseTier } from "@copilotkit/license-verifier";
|
|
30
30
|
|
|
31
31
|
//#region src/index.d.ts
|
|
32
32
|
declare const COPILOTKIT_VERSION: string;
|
|
@@ -35,9 +35,9 @@ declare const COPILOTKIT_VERSION: string;
|
|
|
35
35
|
* Frontend providers create their own context using this shape.
|
|
36
36
|
*/
|
|
37
37
|
interface LicenseContextValue {
|
|
38
|
-
/**
|
|
39
|
-
status:
|
|
40
|
-
/**
|
|
38
|
+
/** Server-reported license status from the runtime's /info endpoint. Null until known. */
|
|
39
|
+
status: RuntimeLicenseStatus | null;
|
|
40
|
+
/** The license payload if available. Always null on the client; the payload stays server-side. */
|
|
41
41
|
license: LicensePayload$1 | null;
|
|
42
42
|
/** Whether a specific feature is licensed. Returns true if no licensing is active (no token). */
|
|
43
43
|
checkFeature: (feature: string) => boolean;
|
|
@@ -45,19 +45,19 @@ interface LicenseContextValue {
|
|
|
45
45
|
getLimit: (feature: string) => number | null;
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
|
-
* Client-safe license context factory
|
|
48
|
+
* Client-safe license context factory, driven by the license status the
|
|
49
|
+
* runtime reports via /info.
|
|
49
50
|
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
51
|
+
* Features are enabled unless the runtime definitively reports the license
|
|
52
|
+
* as "expired" or "invalid". A null/"none"/"unknown" status fails open
|
|
53
|
+
* (unlicensed = unrestricted, with branding), and "expiring" keeps features
|
|
54
|
+
* on while the provider surfaces a warning banner. Per-feature data is not
|
|
55
|
+
* in /info yet, so checkFeature is uniform across features and getLimit has
|
|
56
|
+
* no limits to report. This is inlined here to avoid importing the full
|
|
57
|
+
* license-verifier bundle (which depends on Node's `crypto`) into browser
|
|
58
|
+
* bundles.
|
|
54
59
|
*/
|
|
55
|
-
declare function createLicenseContextValue(status: null):
|
|
56
|
-
status: null;
|
|
57
|
-
license: null;
|
|
58
|
-
checkFeature: (feature: string) => boolean;
|
|
59
|
-
getLimit: (feature: string) => number | null;
|
|
60
|
-
};
|
|
60
|
+
declare function createLicenseContextValue(status: RuntimeLicenseStatus | null | undefined): LicenseContextValue;
|
|
61
61
|
//#endregion
|
|
62
|
-
export { A2UIRuntimeInfo, A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, AG_UI_CHANNEL_EVENT, AIMessage, Action, ActivityMessage, AgentDescription, AssistantMessage, Attachment, AttachmentModality, AttachmentUploadError, AttachmentUploadErrorReason, AttachmentUploadResult, AttachmentsConfig, AudioInputPart, BANNER_ERROR_NAMES, BaseCondition, COPILOTKIT_VERSION, COPILOT_CLOUD_API_URL, COPILOT_CLOUD_CHAT_URL, COPILOT_CLOUD_ERROR_NAMES, COPILOT_CLOUD_PUBLIC_API_KEY_HEADER, COPILOT_CLOUD_VERSION, CoAgentStateRenderHandler, CoAgentStateRenderHandlerArguments, ComparisonCondition, ComparisonRule, Condition, ConfigurationError, ConsoleColors, ConsoleStyles, CopilotCloudConfig, CopilotErrorEvent, CopilotErrorHandler, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, CopilotKitVersionMismatchError, CopilotRequestContext, DEFAULT_AGENT_ID, DebugConfig, type DebugEventEnvelope, DeveloperMessage, DocumentInputPart, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, ExistenceCondition, ExistenceRule, FunctionCallHandler, FunctionCallHandlerArguments, FunctionDefinition, ImageData, ImageInputPart, InferSchemaOutput, InputContent, InputContentDataSource, InputContentSource, InputContentUrlSource, IntelligenceRuntimeInfo, JSONSchema, JSONSchemaArray, JSONSchemaBoolean, JSONSchemaNumber, JSONSchemaObject, JSONSchemaString, JSONValue, LambdaSendOptions, type LicenseChecker, LicenseContextValue, type LicenseFeatures, type LicenseOwner, type LicensePayload, type LicenseStatus, type LicenseTier, LogicalCondition, LogicalRule, MappedParameterTypes, MaybePromise, Message, MissingPublicApiKeyError, NonEmptyRecord, Parameter, PartialBy, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, ReasoningMessage, RequiredBy, ResolvedCopilotKitError, ResolvedDebugConfig, Role, Rule, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SchemaToJsonSchemaOptions, Severity, StandardJSONSchemaV1, StandardSchemaV1, SystemMessage, TelemetryClient, TextInputPart, ToolCall, ToolDefinition, ToolResult, TranscriptionErrorCode, type TranscriptionErrorResponse, TranscriptionErrors, UpgradeRequiredError, UserMessage, VideoInputPart, actionParametersToJsonSchema, convertJsonSchemaToZodSchema, copyToClipboard, createLicenseContextValue, dataToUUID, ensureStructuredError, exceedsMaxSize, executeConditions, finalizeRunEvents, formatFileSize, generateVideoThumbnail, getDocumentIcon, getModalityFromMimeType, getPossibleVersionMismatch, getSourceUrl, getZodParameters, isMacOS, isStructuredCopilotKitError, isTelemetryDisabled, isValidUUID, jsonSchemaToActionParameters, lambdaClient, logCopilotKitPlatformMessage, logStyled, logger, matchesAcceptFilter, parseAndWarnTelemetryId, parseJson, parseTelemetryIdFromLicense, partialJSONParse, phoenixExponentialBackoff, publicApiKeyRequired, randomId, randomUUID, readBody, readFileAsBase64, resolveDebugConfig, safeParseToolArgs, schemaToJsonSchema, styledConsole, tryMap };
|
|
62
|
+
export { A2UIRuntimeInfo, A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, AG_UI_CHANNEL_EVENT, AIMessage, Action, ActivityMessage, AgentDescription, AssistantMessage, Attachment, AttachmentModality, AttachmentUploadError, AttachmentUploadErrorReason, AttachmentUploadResult, AttachmentsConfig, AudioInputPart, BANNER_ERROR_NAMES, BaseCondition, COPILOTKIT_VERSION, COPILOT_CLOUD_API_URL, COPILOT_CLOUD_CHAT_URL, COPILOT_CLOUD_ERROR_NAMES, COPILOT_CLOUD_PUBLIC_API_KEY_HEADER, COPILOT_CLOUD_VERSION, CoAgentStateRenderHandler, CoAgentStateRenderHandlerArguments, ComparisonCondition, ComparisonRule, Condition, ConfigurationError, ConsoleColors, ConsoleStyles, CopilotCloudConfig, CopilotErrorEvent, CopilotErrorHandler, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, CopilotKitVersionMismatchError, CopilotRequestContext, DEFAULT_AGENT_ID, DebugConfig, type DebugEventEnvelope, DeveloperMessage, DocumentInputPart, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, ExistenceCondition, ExistenceRule, FunctionCallHandler, FunctionCallHandlerArguments, FunctionDefinition, ImageData, ImageInputPart, InferSchemaOutput, InputContent, InputContentDataSource, InputContentSource, InputContentUrlSource, IntelligenceRuntimeInfo, JSONSchema, JSONSchemaArray, JSONSchemaBoolean, JSONSchemaNumber, JSONSchemaObject, JSONSchemaString, JSONValue, LambdaSendOptions, type LicenseChecker, LicenseContextValue, type LicenseFeatures, type LicenseOwner, type LicensePayload, type LicenseStatus, type LicenseTier, LogicalCondition, LogicalRule, MappedParameterTypes, MaybePromise, Message, MissingPublicApiKeyError, NonEmptyRecord, Parameter, PartialBy, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, ReasoningMessage, RequiredBy, ResolvedCopilotKitError, ResolvedDebugConfig, Role, Rule, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SchemaToJsonSchemaOptions, Severity, StandardJSONSchemaV1, StandardSchemaV1, SystemMessage, TelemetryClient, TextInputPart, ThreadEndpointRuntimeInfo, ToolCall, ToolDefinition, ToolResult, TranscriptionErrorCode, type TranscriptionErrorResponse, TranscriptionErrors, UpgradeRequiredError, UserMessage, VideoInputPart, actionParametersToJsonSchema, convertJsonSchemaToZodSchema, copyToClipboard, createLicenseContextValue, dataToUUID, ensureStructuredError, exceedsMaxSize, executeConditions, finalizeRunEvents, formatFileSize, generateVideoThumbnail, getDocumentIcon, getModalityFromMimeType, getPossibleVersionMismatch, getSourceUrl, getZodParameters, isMacOS, isStructuredCopilotKitError, isTelemetryDisabled, isValidUUID, jsonSchemaToActionParameters, lambdaClient, logCopilotKitPlatformMessage, logStyled, logger, matchesAcceptFilter, parseAndWarnTelemetryId, parseJson, parseTelemetryIdFromLicense, partialJSONParse, phoenixExponentialBackoff, publicApiKeyRequired, randomId, randomUUID, readBody, readFileAsBase64, resolveDebugConfig, safeParseToolArgs, schemaToJsonSchema, styledConsole, tryMap };
|
|
63
63
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkBa,kBAAA;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkBa,kBAAA;;;;;UA2BI,mBAAA;;EAEf,MAAA,EAAQ,oBAAA;;EAER,OAAA,EAAS,gBAAA;;EAET,YAAA,GAAe,OAAA;;EAEf,QAAA,GAAW,OAAA;AAAA;;;;AAnCb;;;;;AA2BA;;;;;iBAwBgB,yBAAA,CACd,MAAA,EAAQ,oBAAA,sBACP,mBAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -22,18 +22,25 @@ import { A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES } fr
|
|
|
22
22
|
//#region src/index.ts
|
|
23
23
|
const COPILOTKIT_VERSION = version;
|
|
24
24
|
/**
|
|
25
|
-
* Client-safe license context factory
|
|
25
|
+
* Client-safe license context factory, driven by the license status the
|
|
26
|
+
* runtime reports via /info.
|
|
26
27
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
28
|
+
* Features are enabled unless the runtime definitively reports the license
|
|
29
|
+
* as "expired" or "invalid". A null/"none"/"unknown" status fails open
|
|
30
|
+
* (unlicensed = unrestricted, with branding), and "expiring" keeps features
|
|
31
|
+
* on while the provider surfaces a warning banner. Per-feature data is not
|
|
32
|
+
* in /info yet, so checkFeature is uniform across features and getLimit has
|
|
33
|
+
* no limits to report. This is inlined here to avoid importing the full
|
|
34
|
+
* license-verifier bundle (which depends on Node's `crypto`) into browser
|
|
35
|
+
* bundles.
|
|
31
36
|
*/
|
|
32
37
|
function createLicenseContextValue(status) {
|
|
38
|
+
const resolvedStatus = status ?? null;
|
|
39
|
+
const featuresEnabled = resolvedStatus !== "expired" && resolvedStatus !== "invalid";
|
|
33
40
|
return {
|
|
34
|
-
status:
|
|
41
|
+
status: resolvedStatus,
|
|
35
42
|
license: null,
|
|
36
|
-
checkFeature: () =>
|
|
43
|
+
checkFeature: () => featuresEnabled,
|
|
37
44
|
getLimit: () => null
|
|
38
45
|
};
|
|
39
46
|
}
|
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\";\nexport * from \"./telemetry\";\nexport * from \"./debug\";\nexport * from \"./standard-schema\";\nexport * from \"./attachments\";\n\nexport { logger } from \"./logger\";\nexport { finalizeRunEvents } from \"./finalize-events\";\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 {
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["packageJson.version"],"sources":["../src/index.ts"],"sourcesContent":["export * from \"./types\";\nexport * from \"./utils\";\nexport * from \"./constants\";\nexport * from \"./telemetry\";\nexport * from \"./debug\";\nexport * from \"./standard-schema\";\nexport * from \"./attachments\";\n\nexport { logger } from \"./logger\";\nexport { finalizeRunEvents } from \"./finalize-events\";\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 { RuntimeLicenseStatus } 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 /** Server-reported license status from the runtime's /info endpoint. 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 specific feature is licensed. Returns true if no licensing is active (no token). */\n checkFeature: (feature: string) => boolean;\n /** Get a numeric feature limit. Returns null if not applicable. */\n getLimit: (feature: string) => number | null;\n}\n\n/**\n * Client-safe license context factory, driven by the license status the\n * runtime reports via /info.\n *\n * Features are enabled unless the runtime definitively reports the license\n * as \"expired\" or \"invalid\". A null/\"none\"/\"unknown\" status fails open\n * (unlicensed = unrestricted, with branding), and \"expiring\" keeps features\n * on while the provider surfaces a warning banner. Per-feature data is not\n * in /info yet, so checkFeature is uniform across features and getLimit has\n * no limits to report. This is inlined here to avoid importing the full\n * license-verifier bundle (which depends on Node's `crypto`) into browser\n * bundles.\n */\nexport function createLicenseContextValue(\n status: RuntimeLicenseStatus | null | undefined,\n): LicenseContextValue {\n const resolvedStatus = status ?? null;\n const featuresEnabled =\n resolvedStatus !== \"expired\" && resolvedStatus !== \"invalid\";\n return {\n status: resolvedStatus,\n license: null,\n checkFeature: () => featuresEnabled,\n getLimit: () => null,\n };\n}\n\nexport {\n A2UI_DEFAULT_GENERATION_GUIDELINES,\n A2UI_DEFAULT_DESIGN_GUIDELINES,\n} from \"./a2ui-prompts\";\n\nexport type { DebugEventEnvelope } from \"./debug-event-envelope\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAa,qBAAqBA;;;;;;;;;;;;;;AAmDlC,SAAgB,0BACd,QACqB;CACrB,MAAM,iBAAiB,UAAU;CACjC,MAAM,kBACJ,mBAAmB,aAAa,mBAAmB;AACrD,QAAO;EACL,QAAQ;EACR,SAAS;EACT,oBAAoB;EACpB,gBAAgB;EACjB"}
|
package/dist/index.umd.js
CHANGED
|
@@ -1534,7 +1534,7 @@ ${getSeeMoreMarkdown(troubleshootingLink)}`;
|
|
|
1534
1534
|
|
|
1535
1535
|
//#endregion
|
|
1536
1536
|
//#region package.json
|
|
1537
|
-
var version = "1.61.
|
|
1537
|
+
var version = "1.61.2";
|
|
1538
1538
|
|
|
1539
1539
|
//#endregion
|
|
1540
1540
|
//#region src/a2ui-prompts.ts
|
|
@@ -1656,18 +1656,25 @@ Use the SAME surfaceId as the main surface. Match action names to button action
|
|
|
1656
1656
|
//#region src/index.ts
|
|
1657
1657
|
const COPILOTKIT_VERSION = version;
|
|
1658
1658
|
/**
|
|
1659
|
-
* Client-safe license context factory
|
|
1659
|
+
* Client-safe license context factory, driven by the license status the
|
|
1660
|
+
* runtime reports via /info.
|
|
1660
1661
|
*
|
|
1661
|
-
*
|
|
1662
|
-
*
|
|
1663
|
-
*
|
|
1664
|
-
*
|
|
1662
|
+
* Features are enabled unless the runtime definitively reports the license
|
|
1663
|
+
* as "expired" or "invalid". A null/"none"/"unknown" status fails open
|
|
1664
|
+
* (unlicensed = unrestricted, with branding), and "expiring" keeps features
|
|
1665
|
+
* on while the provider surfaces a warning banner. Per-feature data is not
|
|
1666
|
+
* in /info yet, so checkFeature is uniform across features and getLimit has
|
|
1667
|
+
* no limits to report. This is inlined here to avoid importing the full
|
|
1668
|
+
* license-verifier bundle (which depends on Node's `crypto`) into browser
|
|
1669
|
+
* bundles.
|
|
1665
1670
|
*/
|
|
1666
1671
|
function createLicenseContextValue(status) {
|
|
1672
|
+
const resolvedStatus = status !== null && status !== void 0 ? status : null;
|
|
1673
|
+
const featuresEnabled = resolvedStatus !== "expired" && resolvedStatus !== "invalid";
|
|
1667
1674
|
return {
|
|
1668
|
-
status:
|
|
1675
|
+
status: resolvedStatus,
|
|
1669
1676
|
license: null,
|
|
1670
|
-
checkFeature: () =>
|
|
1677
|
+
checkFeature: () => featuresEnabled,
|
|
1671
1678
|
getLimit: () => null
|
|
1672
1679
|
};
|
|
1673
1680
|
}
|