@copilotkit/shared 0.0.0-0.0.0-max-changeset-10101010101010-20260109191632

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/CHANGELOG.md +1800 -0
  2. package/LICENSE +21 -0
  3. package/README.md +141 -0
  4. package/dist/chunk-2OJ5OJ2D.mjs +1 -0
  5. package/dist/chunk-2OJ5OJ2D.mjs.map +1 -0
  6. package/dist/chunk-5YXKLIUO.mjs +38 -0
  7. package/dist/chunk-5YXKLIUO.mjs.map +1 -0
  8. package/dist/chunk-64DYJ27R.mjs +201 -0
  9. package/dist/chunk-64DYJ27R.mjs.map +1 -0
  10. package/dist/chunk-6QGXWNS5.mjs +34 -0
  11. package/dist/chunk-6QGXWNS5.mjs.map +1 -0
  12. package/dist/chunk-6W2UEO2M.mjs +94 -0
  13. package/dist/chunk-6W2UEO2M.mjs.map +1 -0
  14. package/dist/chunk-BOKE4OKY.mjs +41 -0
  15. package/dist/chunk-BOKE4OKY.mjs.map +1 -0
  16. package/dist/chunk-FCCOSO5L.mjs +1 -0
  17. package/dist/chunk-FCCOSO5L.mjs.map +1 -0
  18. package/dist/chunk-GYZIHHE6.mjs +13 -0
  19. package/dist/chunk-GYZIHHE6.mjs.map +1 -0
  20. package/dist/chunk-IAFBVORQ.mjs +1 -0
  21. package/dist/chunk-IAFBVORQ.mjs.map +1 -0
  22. package/dist/chunk-MSUB6DGR.mjs +1 -0
  23. package/dist/chunk-MSUB6DGR.mjs.map +1 -0
  24. package/dist/chunk-N5EP5OD5.mjs +1 -0
  25. package/dist/chunk-N5EP5OD5.mjs.map +1 -0
  26. package/dist/chunk-NAFEBKSO.mjs +1 -0
  27. package/dist/chunk-NAFEBKSO.mjs.map +1 -0
  28. package/dist/chunk-NBLG4PC5.mjs +426 -0
  29. package/dist/chunk-NBLG4PC5.mjs.map +1 -0
  30. package/dist/chunk-P7STFMPO.mjs +1 -0
  31. package/dist/chunk-P7STFMPO.mjs.map +1 -0
  32. package/dist/chunk-PL5WNHFZ.mjs +50 -0
  33. package/dist/chunk-PL5WNHFZ.mjs.map +1 -0
  34. package/dist/chunk-UYARLQNA.mjs +1 -0
  35. package/dist/chunk-UYARLQNA.mjs.map +1 -0
  36. package/dist/chunk-WUPFNPXO.mjs +107 -0
  37. package/dist/chunk-WUPFNPXO.mjs.map +1 -0
  38. package/dist/chunk-XEMZTHQZ.mjs +67 -0
  39. package/dist/chunk-XEMZTHQZ.mjs.map +1 -0
  40. package/dist/chunk-XTHC46M2.mjs +1 -0
  41. package/dist/chunk-XTHC46M2.mjs.map +1 -0
  42. package/dist/constants/index.d.ts +6 -0
  43. package/dist/constants/index.js +40 -0
  44. package/dist/constants/index.js.map +1 -0
  45. package/dist/constants/index.mjs +13 -0
  46. package/dist/constants/index.mjs.map +1 -0
  47. package/dist/index.d.ts +25 -0
  48. package/dist/index.js +1098 -0
  49. package/dist/index.js.map +1 -0
  50. package/dist/index.mjs +124 -0
  51. package/dist/index.mjs.map +1 -0
  52. package/dist/telemetry/events.d.ts +45 -0
  53. package/dist/telemetry/events.js +19 -0
  54. package/dist/telemetry/events.js.map +1 -0
  55. package/dist/telemetry/events.mjs +1 -0
  56. package/dist/telemetry/events.mjs.map +1 -0
  57. package/dist/telemetry/index.d.ts +3 -0
  58. package/dist/telemetry/index.js +188 -0
  59. package/dist/telemetry/index.js.map +1 -0
  60. package/dist/telemetry/index.mjs +12 -0
  61. package/dist/telemetry/index.mjs.map +1 -0
  62. package/dist/telemetry/scarf-client.d.ts +7 -0
  63. package/dist/telemetry/scarf-client.js +59 -0
  64. package/dist/telemetry/scarf-client.js.map +1 -0
  65. package/dist/telemetry/scarf-client.mjs +7 -0
  66. package/dist/telemetry/scarf-client.mjs.map +1 -0
  67. package/dist/telemetry/security-check.d.ts +2 -0
  68. package/dist/telemetry/security-check.js +2 -0
  69. package/dist/telemetry/security-check.js.map +1 -0
  70. package/dist/telemetry/security-check.mjs +1 -0
  71. package/dist/telemetry/security-check.mjs.map +1 -0
  72. package/dist/telemetry/telemetry-client.d.ts +40 -0
  73. package/dist/telemetry/telemetry-client.js +186 -0
  74. package/dist/telemetry/telemetry-client.js.map +1 -0
  75. package/dist/telemetry/telemetry-client.mjs +11 -0
  76. package/dist/telemetry/telemetry-client.mjs.map +1 -0
  77. package/dist/telemetry/utils.d.ts +8 -0
  78. package/dist/telemetry/utils.js +69 -0
  79. package/dist/telemetry/utils.js.map +1 -0
  80. package/dist/telemetry/utils.mjs +9 -0
  81. package/dist/telemetry/utils.mjs.map +1 -0
  82. package/dist/types/action.d.ts +59 -0
  83. package/dist/types/action.js +19 -0
  84. package/dist/types/action.js.map +1 -0
  85. package/dist/types/action.mjs +2 -0
  86. package/dist/types/action.mjs.map +1 -0
  87. package/dist/types/copilot-cloud-config.d.ts +13 -0
  88. package/dist/types/copilot-cloud-config.js +19 -0
  89. package/dist/types/copilot-cloud-config.js.map +1 -0
  90. package/dist/types/copilot-cloud-config.mjs +2 -0
  91. package/dist/types/copilot-cloud-config.mjs.map +1 -0
  92. package/dist/types/error.d.ts +55 -0
  93. package/dist/types/error.js +19 -0
  94. package/dist/types/error.js.map +1 -0
  95. package/dist/types/error.mjs +2 -0
  96. package/dist/types/error.mjs.map +1 -0
  97. package/dist/types/index.d.ts +7 -0
  98. package/dist/types/index.js +19 -0
  99. package/dist/types/index.js.map +1 -0
  100. package/dist/types/index.mjs +8 -0
  101. package/dist/types/index.mjs.map +1 -0
  102. package/dist/types/message.d.ts +26 -0
  103. package/dist/types/message.js +19 -0
  104. package/dist/types/message.js.map +1 -0
  105. package/dist/types/message.mjs +2 -0
  106. package/dist/types/message.mjs.map +1 -0
  107. package/dist/types/openai-assistant.d.ts +53 -0
  108. package/dist/types/openai-assistant.js +19 -0
  109. package/dist/types/openai-assistant.js.map +1 -0
  110. package/dist/types/openai-assistant.mjs +2 -0
  111. package/dist/types/openai-assistant.mjs.map +1 -0
  112. package/dist/types/utility.d.ts +6 -0
  113. package/dist/types/utility.js +19 -0
  114. package/dist/types/utility.js.map +1 -0
  115. package/dist/types/utility.mjs +2 -0
  116. package/dist/types/utility.mjs.map +1 -0
  117. package/dist/utils/conditions.d.ts +26 -0
  118. package/dist/utils/conditions.js +74 -0
  119. package/dist/utils/conditions.js.map +1 -0
  120. package/dist/utils/conditions.mjs +7 -0
  121. package/dist/utils/conditions.mjs.map +1 -0
  122. package/dist/utils/console-styling.d.ts +84 -0
  123. package/dist/utils/console-styling.js +123 -0
  124. package/dist/utils/console-styling.js.map +1 -0
  125. package/dist/utils/console-styling.mjs +17 -0
  126. package/dist/utils/console-styling.mjs.map +1 -0
  127. package/dist/utils/errors.d.ts +280 -0
  128. package/dist/utils/errors.js +443 -0
  129. package/dist/utils/errors.js.map +1 -0
  130. package/dist/utils/errors.mjs +65 -0
  131. package/dist/utils/errors.mjs.map +1 -0
  132. package/dist/utils/index.d.ts +32 -0
  133. package/dist/utils/index.js +927 -0
  134. package/dist/utils/index.js.map +1 -0
  135. package/dist/utils/index.mjs +108 -0
  136. package/dist/utils/index.mjs.map +1 -0
  137. package/dist/utils/json-schema.d.ts +34 -0
  138. package/dist/utils/json-schema.js +228 -0
  139. package/dist/utils/json-schema.js.map +1 -0
  140. package/dist/utils/json-schema.mjs +13 -0
  141. package/dist/utils/json-schema.mjs.map +1 -0
  142. package/dist/utils/random-id.d.ts +6 -0
  143. package/dist/utils/random-id.js +68 -0
  144. package/dist/utils/random-id.js.map +1 -0
  145. package/dist/utils/random-id.mjs +13 -0
  146. package/dist/utils/random-id.mjs.map +1 -0
  147. package/dist/utils/requests.d.ts +10 -0
  148. package/dist/utils/requests.js +91 -0
  149. package/dist/utils/requests.js.map +1 -0
  150. package/dist/utils/requests.mjs +7 -0
  151. package/dist/utils/requests.mjs.map +1 -0
  152. package/dist/utils/types.d.ts +20 -0
  153. package/dist/utils/types.js +19 -0
  154. package/dist/utils/types.js.map +1 -0
  155. package/dist/utils/types.mjs +2 -0
  156. package/dist/utils/types.mjs.map +1 -0
  157. package/jest.config.js +5 -0
  158. package/package.json +68 -0
  159. package/src/constants/index.ts +4 -0
  160. package/src/index.ts +7 -0
  161. package/src/telemetry/events.ts +41 -0
  162. package/src/telemetry/index.ts +1 -0
  163. package/src/telemetry/scarf-client.ts +39 -0
  164. package/src/telemetry/security-check.ts +0 -0
  165. package/src/telemetry/telemetry-client.ts +142 -0
  166. package/src/telemetry/utils.ts +39 -0
  167. package/src/types/action.ts +129 -0
  168. package/src/types/copilot-cloud-config.ts +11 -0
  169. package/src/types/error.ts +70 -0
  170. package/src/types/index.ts +6 -0
  171. package/src/types/message.ts +37 -0
  172. package/src/types/openai-assistant.ts +62 -0
  173. package/src/types/utility.ts +2 -0
  174. package/src/utils/conditions.ts +98 -0
  175. package/src/utils/console-styling.ts +124 -0
  176. package/src/utils/errors.ts +525 -0
  177. package/src/utils/index.ts +49 -0
  178. package/src/utils/json-schema.test.ts +383 -0
  179. package/src/utils/json-schema.ts +258 -0
  180. package/src/utils/random-id.ts +42 -0
  181. package/src/utils/requests.ts +77 -0
  182. package/src/utils/types.ts +22 -0
  183. package/tsconfig.json +9 -0
  184. package/tsup.config.ts +11 -0
  185. package/typedoc.json +4 -0
@@ -0,0 +1,55 @@
1
+ interface CopilotErrorEvent {
2
+ type: "error" | "request" | "response" | "agent_state" | "action" | "message" | "performance";
3
+ timestamp: number;
4
+ context: CopilotRequestContext;
5
+ error?: any;
6
+ }
7
+ interface CopilotRequestContext {
8
+ threadId?: string;
9
+ runId?: string;
10
+ source: "runtime" | "ui" | "agent" | "network";
11
+ request?: {
12
+ operation: string;
13
+ method?: string;
14
+ url?: string;
15
+ path?: string;
16
+ headers?: Record<string, string>;
17
+ body?: any;
18
+ startTime: number;
19
+ };
20
+ response?: {
21
+ status?: number;
22
+ statusText?: string;
23
+ headers?: Record<string, string>;
24
+ body?: any;
25
+ endTime: number;
26
+ latency: number;
27
+ };
28
+ agent?: {
29
+ name?: string;
30
+ nodeName?: string;
31
+ state?: any;
32
+ };
33
+ messages?: {
34
+ input?: any[];
35
+ output?: any[];
36
+ messageCount?: number;
37
+ };
38
+ technical?: {
39
+ userAgent?: string;
40
+ host?: string;
41
+ environment?: string;
42
+ version?: string;
43
+ stackTrace?: string;
44
+ };
45
+ performance?: {
46
+ requestDuration?: number;
47
+ streamingDuration?: number;
48
+ actionExecutionTime?: number;
49
+ memoryUsage?: number;
50
+ };
51
+ metadata?: Record<string, any>;
52
+ }
53
+ type CopilotErrorHandler = (errorEvent: CopilotErrorEvent) => void | Promise<void>;
54
+
55
+ export { CopilotErrorEvent, CopilotErrorHandler, CopilotRequestContext };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/types/error.ts
17
+ var error_exports = {};
18
+ module.exports = __toCommonJS(error_exports);
19
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/error.ts"],"sourcesContent":["export interface CopilotErrorEvent {\n type: \"error\" | \"request\" | \"response\" | \"agent_state\" | \"action\" | \"message\" | \"performance\";\n timestamp: number;\n context: CopilotRequestContext;\n error?: any; // Present when type is 'error'\n}\n\nexport interface CopilotRequestContext {\n // Basic identifiers\n threadId?: string;\n runId?: string;\n source: \"runtime\" | \"ui\" | \"agent\" | \"network\";\n\n // Request details\n request?: {\n operation: string;\n method?: string;\n url?: string;\n path?: string;\n headers?: Record<string, string>;\n body?: any;\n startTime: number;\n };\n\n // Response details\n response?: {\n status?: number;\n statusText?: string;\n headers?: Record<string, string>;\n body?: any;\n endTime: number;\n latency: number;\n };\n\n // Agent context\n agent?: {\n name?: string;\n nodeName?: string;\n state?: any;\n };\n\n // Message flow context\n messages?: {\n input?: any[];\n output?: any[];\n messageCount?: number;\n };\n\n // Technical context\n technical?: {\n userAgent?: string;\n host?: string;\n environment?: string;\n version?: string;\n stackTrace?: string;\n };\n\n // Performance metrics\n performance?: {\n requestDuration?: number;\n streamingDuration?: number;\n actionExecutionTime?: number;\n memoryUsage?: number;\n };\n\n // Extensible metadata\n metadata?: Record<string, any>;\n}\n\nexport type CopilotErrorHandler = (errorEvent: CopilotErrorEvent) => void | Promise<void>;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1,2 @@
1
+ import "../chunk-2OJ5OJ2D.mjs";
2
+ //# sourceMappingURL=error.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,7 @@
1
+ export { AssistantMessage, CoAgentStateRenderHandler, CoAgentStateRenderHandlerArguments, FunctionCallHandler, FunctionCallHandlerArguments, FunctionDefinition, JSONValue, ToolDefinition } from './openai-assistant.js';
2
+ export { Action, MappedParameterTypes, Parameter } from './action.js';
3
+ export { CopilotCloudConfig } from './copilot-cloud-config.js';
4
+ export { PartialBy, RequiredBy } from './utility.js';
5
+ export { CopilotErrorEvent, CopilotErrorHandler, CopilotRequestContext } from './error.js';
6
+ export { AIMessage, ActivityMessage, DeveloperMessage, ImageData, Message, Role, SystemMessage, ToolCall, ToolResult, UserMessage } from './message.js';
7
+ import '@ag-ui/core';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/types/index.ts
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export * from \"./openai-assistant\";\nexport * from \"./action\";\nexport * from \"./copilot-cloud-config\";\nexport * from \"./utility\";\nexport * from \"./error\";\nexport * from \"./message\";\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1,8 @@
1
+ import "../chunk-N5EP5OD5.mjs";
2
+ import "../chunk-NAFEBKSO.mjs";
3
+ import "../chunk-MSUB6DGR.mjs";
4
+ import "../chunk-2OJ5OJ2D.mjs";
5
+ import "../chunk-UYARLQNA.mjs";
6
+ import "../chunk-IAFBVORQ.mjs";
7
+ import "../chunk-FCCOSO5L.mjs";
8
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,26 @@
1
+ import agui from '@ag-ui/core';
2
+
3
+ interface ImageData {
4
+ format: string;
5
+ bytes: string;
6
+ }
7
+ type Role = agui.Role;
8
+ type SystemMessage = agui.SystemMessage;
9
+ type DeveloperMessage = agui.DeveloperMessage;
10
+ type ToolCall = agui.ToolCall;
11
+ type ActivityMessage = agui.ActivityMessage;
12
+ type ToolResult = agui.ToolMessage & {
13
+ toolName?: string;
14
+ };
15
+ type AIMessage = agui.AssistantMessage & {
16
+ generativeUI?: (props?: any) => any;
17
+ agentName?: string;
18
+ state?: any;
19
+ image?: ImageData;
20
+ };
21
+ type UserMessage = agui.UserMessage & {
22
+ image?: ImageData;
23
+ };
24
+ type Message = AIMessage | ToolResult | UserMessage | SystemMessage | DeveloperMessage | ActivityMessage;
25
+
26
+ export { AIMessage, ActivityMessage, DeveloperMessage, ImageData, Message, Role, SystemMessage, ToolCall, ToolResult, UserMessage };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/types/message.ts
17
+ var message_exports = {};
18
+ module.exports = __toCommonJS(message_exports);
19
+ //# sourceMappingURL=message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/message.ts"],"sourcesContent":["import agui from \"@ag-ui/core\";\n\nexport interface ImageData {\n format: string;\n bytes: string;\n}\n\n// Pass through types\nexport type Role = agui.Role;\nexport type SystemMessage = agui.SystemMessage;\nexport type DeveloperMessage = agui.DeveloperMessage;\nexport type ToolCall = agui.ToolCall;\nexport type ActivityMessage = agui.ActivityMessage;\n\n// Extended message types\nexport type ToolResult = agui.ToolMessage & {\n toolName?: string;\n};\n\nexport type AIMessage = agui.AssistantMessage & {\n generativeUI?: (props?: any) => any;\n agentName?: string;\n state?: any;\n image?: ImageData;\n};\n\nexport type UserMessage = agui.UserMessage & {\n image?: ImageData;\n};\n\nexport type Message =\n | AIMessage\n | ToolResult\n | UserMessage\n | SystemMessage\n | DeveloperMessage\n | ActivityMessage;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1,2 @@
1
+ import "../chunk-UYARLQNA.mjs";
2
+ //# sourceMappingURL=message.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,53 @@
1
+ interface FunctionDefinition {
2
+ /**
3
+ * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain
4
+ * underscores and dashes, with a maximum length of 64.
5
+ */
6
+ name: string;
7
+ /**
8
+ * The parameters the functions accepts, described as a JSON Schema object. See the
9
+ * [guide](/docs/guides/gpt/function-calling) for examples, and the
10
+ * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
11
+ * documentation about the format.
12
+ *
13
+ * To describe a function that accepts no parameters, provide the value
14
+ * `{"type": "object", "properties": {}}`.
15
+ */
16
+ parameters: Record<string, unknown>;
17
+ /**
18
+ * A description of what the function does, used by the model to choose when and
19
+ * how to call the function.
20
+ */
21
+ description?: string;
22
+ }
23
+ interface ToolDefinition {
24
+ type: "function";
25
+ function: FunctionDefinition;
26
+ }
27
+ interface FunctionCallHandlerArguments {
28
+ messages: any[];
29
+ name: string;
30
+ args: any;
31
+ }
32
+ type FunctionCallHandler = (args: FunctionCallHandlerArguments) => Promise<any>;
33
+ type CoAgentStateRenderHandlerArguments = {
34
+ name: string;
35
+ nodeName: string;
36
+ state: any;
37
+ };
38
+ type CoAgentStateRenderHandler = (args: CoAgentStateRenderHandlerArguments) => Promise<any>;
39
+ type AssistantMessage = {
40
+ id: string;
41
+ role: "assistant";
42
+ content: Array<{
43
+ type: "text";
44
+ text: {
45
+ value: string;
46
+ };
47
+ }>;
48
+ };
49
+ type JSONValue = null | string | number | boolean | {
50
+ [x: string]: JSONValue;
51
+ } | Array<JSONValue>;
52
+
53
+ export { AssistantMessage, CoAgentStateRenderHandler, CoAgentStateRenderHandlerArguments, FunctionCallHandler, FunctionCallHandlerArguments, FunctionDefinition, JSONValue, ToolDefinition };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/types/openai-assistant.ts
17
+ var openai_assistant_exports = {};
18
+ module.exports = __toCommonJS(openai_assistant_exports);
19
+ //# sourceMappingURL=openai-assistant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/openai-assistant.ts"],"sourcesContent":["export interface FunctionDefinition {\n /**\n * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain\n * underscores and dashes, with a maximum length of 64.\n */\n name: string;\n /**\n * The parameters the functions accepts, described as a JSON Schema object. See the\n * [guide](/docs/guides/gpt/function-calling) for examples, and the\n * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for\n * documentation about the format.\n *\n * To describe a function that accepts no parameters, provide the value\n * `{\"type\": \"object\", \"properties\": {}}`.\n */\n parameters: Record<string, unknown>;\n /**\n * A description of what the function does, used by the model to choose when and\n * how to call the function.\n */\n description?: string;\n}\n\nexport interface ToolDefinition {\n type: \"function\";\n function: FunctionDefinition;\n}\n\nexport interface FunctionCallHandlerArguments {\n messages: any[];\n name: string;\n args: any;\n}\n\nexport type FunctionCallHandler = (args: FunctionCallHandlerArguments) => Promise<any>;\n\nexport type CoAgentStateRenderHandlerArguments = {\n name: string;\n nodeName: string;\n state: any;\n};\n\nexport type CoAgentStateRenderHandler = (args: CoAgentStateRenderHandlerArguments) => Promise<any>;\n\nexport type AssistantMessage = {\n id: string;\n role: \"assistant\";\n content: Array<{\n type: \"text\";\n text: {\n value: string;\n };\n }>;\n};\n\nexport type JSONValue =\n | null\n | string\n | number\n | boolean\n | { [x: string]: JSONValue }\n | Array<JSONValue>;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1,2 @@
1
+ import "../chunk-IAFBVORQ.mjs";
2
+ //# sourceMappingURL=openai-assistant.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,6 @@
1
+ type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
2
+ type RequiredBy<T, K extends keyof T> = T & {
3
+ [P in K]-?: T[P];
4
+ };
5
+
6
+ export { PartialBy, RequiredBy };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/types/utility.ts
17
+ var utility_exports = {};
18
+ module.exports = __toCommonJS(utility_exports);
19
+ //# sourceMappingURL=utility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/utility.ts"],"sourcesContent":["export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\nexport type RequiredBy<T, K extends keyof T> = T & { [P in K]-?: T[P] };\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1,2 @@
1
+ import "../chunk-FCCOSO5L.mjs";
2
+ //# sourceMappingURL=utility.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,26 @@
1
+ type ComparisonRule = "EQUALS" | "NOT_EQUALS" | "GREATER_THAN" | "LESS_THAN" | "CONTAINS" | "NOT_CONTAINS" | "MATCHES" | "STARTS_WITH" | "ENDS_WITH";
2
+ type LogicalRule = "AND" | "OR" | "NOT";
3
+ type ExistenceRule = "EXISTS" | "NOT_EXISTS";
4
+ type Rule = ComparisonRule | LogicalRule | ExistenceRule;
5
+ interface BaseCondition {
6
+ rule: Rule;
7
+ path?: string;
8
+ }
9
+ interface ComparisonCondition extends BaseCondition {
10
+ rule: ComparisonRule;
11
+ value: any;
12
+ }
13
+ interface LogicalCondition extends BaseCondition {
14
+ rule: LogicalRule;
15
+ conditions: Condition[];
16
+ }
17
+ interface ExistenceCondition extends BaseCondition {
18
+ rule: ExistenceRule;
19
+ }
20
+ type Condition = ComparisonCondition | LogicalCondition | ExistenceCondition;
21
+ declare function executeConditions({ conditions, value, }: {
22
+ conditions?: Condition[];
23
+ value: any;
24
+ }): boolean;
25
+
26
+ export { BaseCondition, ComparisonCondition, ComparisonRule, Condition, ExistenceCondition, ExistenceRule, LogicalCondition, LogicalRule, Rule, executeConditions };
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/utils/conditions.ts
21
+ var conditions_exports = {};
22
+ __export(conditions_exports, {
23
+ executeConditions: () => executeConditions
24
+ });
25
+ module.exports = __toCommonJS(conditions_exports);
26
+ function executeConditions({
27
+ conditions,
28
+ value
29
+ }) {
30
+ if (!(conditions == null ? void 0 : conditions.length))
31
+ return true;
32
+ return conditions.every((condition) => executeCondition(condition, value));
33
+ }
34
+ function executeCondition(condition, value) {
35
+ const targetValue = condition.path ? getValueFromPath(value, condition.path) : value;
36
+ switch (condition.rule) {
37
+ case "AND":
38
+ return condition.conditions.every((c) => executeCondition(c, value));
39
+ case "OR":
40
+ return condition.conditions.some((c) => executeCondition(c, value));
41
+ case "NOT":
42
+ return !condition.conditions.every((c) => executeCondition(c, value));
43
+ case "EQUALS":
44
+ return targetValue === condition.value;
45
+ case "NOT_EQUALS":
46
+ return targetValue !== condition.value;
47
+ case "GREATER_THAN":
48
+ return targetValue > condition.value;
49
+ case "LESS_THAN":
50
+ return targetValue < condition.value;
51
+ case "CONTAINS":
52
+ return Array.isArray(targetValue) && targetValue.includes(condition.value);
53
+ case "NOT_CONTAINS":
54
+ return Array.isArray(targetValue) && !targetValue.includes(condition.value);
55
+ case "MATCHES":
56
+ return new RegExp(condition.value).test(String(targetValue));
57
+ case "STARTS_WITH":
58
+ return String(targetValue).startsWith(condition.value);
59
+ case "ENDS_WITH":
60
+ return String(targetValue).endsWith(condition.value);
61
+ case "EXISTS":
62
+ return targetValue !== void 0 && targetValue !== null;
63
+ case "NOT_EXISTS":
64
+ return targetValue === void 0 || targetValue === null;
65
+ }
66
+ }
67
+ function getValueFromPath(obj, path) {
68
+ return path.split(".").reduce((acc, part) => acc == null ? void 0 : acc[part], obj);
69
+ }
70
+ // Annotate the CommonJS export names for ESM import in node:
71
+ 0 && (module.exports = {
72
+ executeConditions
73
+ });
74
+ //# sourceMappingURL=conditions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/conditions.ts"],"sourcesContent":["export type ComparisonRule =\n | \"EQUALS\"\n | \"NOT_EQUALS\"\n | \"GREATER_THAN\"\n | \"LESS_THAN\"\n | \"CONTAINS\"\n | \"NOT_CONTAINS\"\n | \"MATCHES\"\n | \"STARTS_WITH\"\n | \"ENDS_WITH\";\nexport type LogicalRule = \"AND\" | \"OR\" | \"NOT\";\nexport type ExistenceRule = \"EXISTS\" | \"NOT_EXISTS\";\n\nexport type Rule = ComparisonRule | LogicalRule | ExistenceRule;\n\nexport interface BaseCondition {\n rule: Rule;\n path?: string;\n}\n\nexport interface ComparisonCondition extends BaseCondition {\n rule: ComparisonRule;\n value: any;\n}\n\nexport interface LogicalCondition extends BaseCondition {\n rule: LogicalRule;\n conditions: Condition[];\n}\n\nexport interface ExistenceCondition extends BaseCondition {\n rule: ExistenceRule;\n}\n\nexport type Condition = ComparisonCondition | LogicalCondition | ExistenceCondition;\n\nexport function executeConditions({\n conditions,\n value,\n}: {\n conditions?: Condition[];\n value: any;\n}): boolean {\n // If no conditions, consider it a pass\n if (!conditions?.length) return true;\n\n // Run all conditions (implicit AND)\n return conditions.every((condition) => executeCondition(condition, value));\n}\n\nfunction executeCondition(condition: Condition, value: any): boolean {\n const targetValue = condition.path ? getValueFromPath(value, condition.path) : value;\n\n switch (condition.rule) {\n // Logical\n case \"AND\":\n return (condition as LogicalCondition).conditions.every((c) => executeCondition(c, value));\n case \"OR\":\n return (condition as LogicalCondition).conditions.some((c) => executeCondition(c, value));\n case \"NOT\":\n return !(condition as LogicalCondition).conditions.every((c) => executeCondition(c, value));\n\n // Comparison\n case \"EQUALS\":\n return targetValue === (condition as ComparisonCondition).value;\n case \"NOT_EQUALS\":\n return targetValue !== (condition as ComparisonCondition).value;\n case \"GREATER_THAN\":\n return targetValue > (condition as ComparisonCondition).value;\n case \"LESS_THAN\":\n return targetValue < (condition as ComparisonCondition).value;\n case \"CONTAINS\":\n return (\n Array.isArray(targetValue) && targetValue.includes((condition as ComparisonCondition).value)\n );\n case \"NOT_CONTAINS\":\n return (\n Array.isArray(targetValue) &&\n !targetValue.includes((condition as ComparisonCondition).value)\n );\n case \"MATCHES\":\n return new RegExp((condition as ComparisonCondition).value).test(String(targetValue));\n case \"STARTS_WITH\":\n return String(targetValue).startsWith((condition as ComparisonCondition).value);\n case \"ENDS_WITH\":\n return String(targetValue).endsWith((condition as ComparisonCondition).value);\n\n // Existence\n case \"EXISTS\":\n return targetValue !== undefined && targetValue !== null;\n case \"NOT_EXISTS\":\n return targetValue === undefined || targetValue === null;\n }\n}\n\nfunction getValueFromPath(obj: any, path: string): any {\n return path.split(\".\").reduce((acc, part) => acc?.[part], obj);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoCO,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA;AACF,GAGY;AAEV,MAAI,EAAC,yCAAY;AAAQ,WAAO;AAGhC,SAAO,WAAW,MAAM,CAAC,cAAc,iBAAiB,WAAW,KAAK,CAAC;AAC3E;AAEA,SAAS,iBAAiB,WAAsB,OAAqB;AACnE,QAAM,cAAc,UAAU,OAAO,iBAAiB,OAAO,UAAU,IAAI,IAAI;AAE/E,UAAQ,UAAU,MAAM;AAAA,IAEtB,KAAK;AACH,aAAQ,UAA+B,WAAW,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAAA,IAC3F,KAAK;AACH,aAAQ,UAA+B,WAAW,KAAK,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAAA,IAC1F,KAAK;AACH,aAAO,CAAE,UAA+B,WAAW,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAAA,IAG5F,KAAK;AACH,aAAO,gBAAiB,UAAkC;AAAA,IAC5D,KAAK;AACH,aAAO,gBAAiB,UAAkC;AAAA,IAC5D,KAAK;AACH,aAAO,cAAe,UAAkC;AAAA,IAC1D,KAAK;AACH,aAAO,cAAe,UAAkC;AAAA,IAC1D,KAAK;AACH,aACE,MAAM,QAAQ,WAAW,KAAK,YAAY,SAAU,UAAkC,KAAK;AAAA,IAE/F,KAAK;AACH,aACE,MAAM,QAAQ,WAAW,KACzB,CAAC,YAAY,SAAU,UAAkC,KAAK;AAAA,IAElE,KAAK;AACH,aAAO,IAAI,OAAQ,UAAkC,KAAK,EAAE,KAAK,OAAO,WAAW,CAAC;AAAA,IACtF,KAAK;AACH,aAAO,OAAO,WAAW,EAAE,WAAY,UAAkC,KAAK;AAAA,IAChF,KAAK;AACH,aAAO,OAAO,WAAW,EAAE,SAAU,UAAkC,KAAK;AAAA,IAG9E,KAAK;AACH,aAAO,gBAAgB,UAAa,gBAAgB;AAAA,IACtD,KAAK;AACH,aAAO,gBAAgB,UAAa,gBAAgB;AAAA,EACxD;AACF;AAEA,SAAS,iBAAiB,KAAU,MAAmB;AACrD,SAAO,KAAK,MAAM,GAAG,EAAE,OAAO,CAAC,KAAK,SAAS,2BAAM,OAAO,GAAG;AAC/D;","names":[]}
@@ -0,0 +1,7 @@
1
+ import {
2
+ executeConditions
3
+ } from "../chunk-PL5WNHFZ.mjs";
4
+ export {
5
+ executeConditions
6
+ };
7
+ //# sourceMappingURL=conditions.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Console styling utilities for CopilotKit branded messages
3
+ * Provides consistent, readable colors across light and dark console themes
4
+ */
5
+ /**
6
+ * Color palette optimized for console readability
7
+ */
8
+ declare const ConsoleColors: {
9
+ /** Primary brand blue - for titles and links */
10
+ readonly primary: "#007acc";
11
+ /** Success green - for positive messaging */
12
+ readonly success: "#22c55e";
13
+ /** Purple - for feature highlights */
14
+ readonly feature: "#a855f7";
15
+ /** Red - for calls-to-action */
16
+ readonly cta: "#ef4444";
17
+ /** Cyan - for closing statements */
18
+ readonly info: "#06b6d4";
19
+ /** Inherit console default - for body text */
20
+ readonly inherit: "inherit";
21
+ /** Warning style */
22
+ readonly warning: "#f59e0b";
23
+ };
24
+ /**
25
+ * Console style templates for common patterns
26
+ */
27
+ declare const ConsoleStyles: {
28
+ /** Large header style */
29
+ readonly header: "color: #f59e0b; font-weight: bold; font-size: 16px;";
30
+ /** Section header style */
31
+ readonly section: "color: #22c55e; font-weight: bold;";
32
+ /** Feature highlight style */
33
+ readonly highlight: "color: #a855f7; font-weight: bold;";
34
+ /** Call-to-action style */
35
+ readonly cta: "color: #22c55e; font-weight: bold;";
36
+ /** Info style */
37
+ readonly info: "color: #06b6d4; font-weight: bold;";
38
+ /** Link style */
39
+ readonly link: "color: #007acc; text-decoration: underline;";
40
+ /** Body text - inherits console theme */
41
+ readonly body: "color: inherit;";
42
+ /** Warning style */
43
+ readonly warning: "color: #ef4444; font-weight: bold;";
44
+ };
45
+ /**
46
+ * Styled console message for CopilotKit Platform promotion
47
+ * Displays a beautiful, branded advertisement in the console
48
+ */
49
+ declare function logCopilotKitPlatformMessage(): void;
50
+ declare function publicApiKeyRequired(feature: string): void;
51
+ /**
52
+ * Create a styled console message with custom content
53
+ *
54
+ * @param template - Template string with %c placeholders
55
+ * @param styles - Array of style strings matching the %c placeholders
56
+ *
57
+ * @example
58
+ * ```typescript
59
+ * logStyled(
60
+ * '%cCopilotKit%c Welcome to the platform!',
61
+ * [ConsoleStyles.header, ConsoleStyles.body]
62
+ * );
63
+ * ```
64
+ */
65
+ declare function logStyled(template: string, styles: string[]): void;
66
+ /**
67
+ * Quick styled console methods for common use cases
68
+ */
69
+ declare const styledConsole: {
70
+ /** Log a success message */
71
+ readonly success: (message: string) => void;
72
+ /** Log an info message */
73
+ readonly info: (message: string) => void;
74
+ /** Log a feature highlight */
75
+ readonly feature: (message: string) => void;
76
+ /** Log a call-to-action */
77
+ readonly cta: (message: string) => void;
78
+ /** Log the CopilotKit platform promotion */
79
+ readonly logCopilotKitPlatformMessage: typeof logCopilotKitPlatformMessage;
80
+ /** Log a `publicApiKeyRequired` warning */
81
+ readonly publicApiKeyRequired: typeof publicApiKeyRequired;
82
+ };
83
+
84
+ export { ConsoleColors, ConsoleStyles, logCopilotKitPlatformMessage, logStyled, publicApiKeyRequired, styledConsole };