@copilotkit/runtime 1.5.9 → 1.5.10-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/__snapshots__/schema/schema.graphql +273 -0
  3. package/dist/chunk-44O2JGUY.mjs +12 -0
  4. package/dist/chunk-44O2JGUY.mjs.map +1 -0
  5. package/dist/chunk-5SDH2PVU.mjs +3395 -0
  6. package/dist/chunk-5SDH2PVU.mjs.map +1 -0
  7. package/dist/chunk-CLGKEUOA.mjs +1408 -0
  8. package/dist/chunk-CLGKEUOA.mjs.map +1 -0
  9. package/dist/chunk-D2WLFQS6.mjs +43 -0
  10. package/dist/chunk-D2WLFQS6.mjs.map +1 -0
  11. package/dist/chunk-DFOKBSIS.mjs +1 -0
  12. package/dist/chunk-DFOKBSIS.mjs.map +1 -0
  13. package/dist/chunk-OZLXON7T.mjs +25 -0
  14. package/dist/chunk-OZLXON7T.mjs.map +1 -0
  15. package/dist/chunk-RFF5IIZJ.mjs +66 -0
  16. package/dist/chunk-RFF5IIZJ.mjs.map +1 -0
  17. package/dist/chunk-T4EYPND5.mjs +25 -0
  18. package/dist/chunk-T4EYPND5.mjs.map +1 -0
  19. package/dist/chunk-U3V2BCGI.mjs +152 -0
  20. package/dist/chunk-U3V2BCGI.mjs.map +1 -0
  21. package/dist/chunk-YTXDY7ZM.mjs +80 -0
  22. package/dist/chunk-YTXDY7ZM.mjs.map +1 -0
  23. package/dist/copilot-runtime-36700e00.d.ts +196 -0
  24. package/dist/graphql/types/base/index.d.ts +6 -0
  25. package/dist/graphql/types/base/index.js +63 -0
  26. package/dist/graphql/types/base/index.js.map +1 -0
  27. package/dist/graphql/types/base/index.mjs +8 -0
  28. package/dist/graphql/types/base/index.mjs.map +1 -0
  29. package/dist/graphql/types/converted/index.d.ts +2 -0
  30. package/dist/graphql/types/converted/index.js +124 -0
  31. package/dist/graphql/types/converted/index.js.map +1 -0
  32. package/dist/graphql/types/converted/index.mjs +17 -0
  33. package/dist/graphql/types/converted/index.mjs.map +1 -0
  34. package/dist/groq-adapter-696b5d29.d.ts +281 -0
  35. package/dist/index-cc2b17be.d.ts +87 -0
  36. package/dist/index.d.ts +23 -0
  37. package/dist/index.js +5153 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/index.mjs +76 -0
  40. package/dist/index.mjs.map +1 -0
  41. package/dist/langserve-9125a12e.d.ts +176 -0
  42. package/dist/lib/cloud/index.d.ts +6 -0
  43. package/dist/lib/cloud/index.js +18 -0
  44. package/dist/lib/cloud/index.js.map +1 -0
  45. package/dist/lib/cloud/index.mjs +1 -0
  46. package/dist/lib/cloud/index.mjs.map +1 -0
  47. package/dist/lib/index.d.ts +20 -0
  48. package/dist/lib/index.js +4801 -0
  49. package/dist/lib/index.js.map +1 -0
  50. package/dist/lib/index.mjs +58 -0
  51. package/dist/lib/index.mjs.map +1 -0
  52. package/dist/lib/integrations/index.d.ts +33 -0
  53. package/dist/lib/integrations/index.js +2166 -0
  54. package/dist/lib/integrations/index.js.map +1 -0
  55. package/dist/lib/integrations/index.mjs +34 -0
  56. package/dist/lib/integrations/index.mjs.map +1 -0
  57. package/dist/lib/integrations/nest/index.d.ts +14 -0
  58. package/dist/lib/integrations/nest/index.js +2075 -0
  59. package/dist/lib/integrations/nest/index.js.map +1 -0
  60. package/dist/lib/integrations/nest/index.mjs +13 -0
  61. package/dist/lib/integrations/nest/index.mjs.map +1 -0
  62. package/dist/lib/integrations/node-express/index.d.ts +14 -0
  63. package/dist/lib/integrations/node-express/index.js +2075 -0
  64. package/dist/lib/integrations/node-express/index.js.map +1 -0
  65. package/dist/lib/integrations/node-express/index.mjs +13 -0
  66. package/dist/lib/integrations/node-express/index.mjs.map +1 -0
  67. package/dist/lib/integrations/node-http/index.d.ts +14 -0
  68. package/dist/lib/integrations/node-http/index.js +2061 -0
  69. package/dist/lib/integrations/node-http/index.js.map +1 -0
  70. package/dist/lib/integrations/node-http/index.mjs +12 -0
  71. package/dist/lib/integrations/node-http/index.mjs.map +1 -0
  72. package/dist/service-adapters/index.d.ts +84 -0
  73. package/dist/service-adapters/index.js +1448 -0
  74. package/dist/service-adapters/index.js.map +1 -0
  75. package/dist/service-adapters/index.mjs +26 -0
  76. package/dist/service-adapters/index.mjs.map +1 -0
  77. package/dist/utils/index.d.ts +49 -0
  78. package/dist/utils/index.js +174 -0
  79. package/dist/utils/index.js.map +1 -0
  80. package/dist/utils/index.mjs +12 -0
  81. package/dist/utils/index.mjs.map +1 -0
  82. package/package.json +2 -2
@@ -0,0 +1,80 @@
1
+ import {
2
+ getCommonConfig,
3
+ getRuntimeInstanceTelemetryInfo,
4
+ telemetry_client_default
5
+ } from "./chunk-5SDH2PVU.mjs";
6
+ import {
7
+ __name
8
+ } from "./chunk-44O2JGUY.mjs";
9
+
10
+ // src/lib/integrations/nextjs/app-router.ts
11
+ import { createYoga } from "graphql-yoga";
12
+ function copilotRuntimeNextJSAppRouterEndpoint(options) {
13
+ var _a;
14
+ const commonConfig = getCommonConfig(options);
15
+ telemetry_client_default.setGlobalProperties({
16
+ runtime: {
17
+ framework: "nextjs-app-router"
18
+ }
19
+ });
20
+ if ((_a = options.properties) == null ? void 0 : _a._copilotkit) {
21
+ telemetry_client_default.setGlobalProperties({
22
+ _copilotkit: options.properties._copilotkit
23
+ });
24
+ }
25
+ telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
26
+ const logger = commonConfig.logging;
27
+ logger.debug("Creating NextJS App Router endpoint");
28
+ const yoga = createYoga({
29
+ ...commonConfig,
30
+ graphqlEndpoint: options.endpoint,
31
+ fetchAPI: {
32
+ Response: globalThis.Response
33
+ }
34
+ });
35
+ return {
36
+ handleRequest: yoga,
37
+ GET: yoga,
38
+ POST: yoga,
39
+ OPTIONS: yoga
40
+ };
41
+ }
42
+ __name(copilotRuntimeNextJSAppRouterEndpoint, "copilotRuntimeNextJSAppRouterEndpoint");
43
+
44
+ // src/lib/integrations/nextjs/pages-router.ts
45
+ import { createYoga as createYoga2 } from "graphql-yoga";
46
+ var config = {
47
+ api: {
48
+ bodyParser: false
49
+ }
50
+ };
51
+ function copilotRuntimeNextJSPagesRouterEndpoint(options) {
52
+ var _a;
53
+ const commonConfig = getCommonConfig(options);
54
+ telemetry_client_default.setGlobalProperties({
55
+ runtime: {
56
+ framework: "nextjs-pages-router"
57
+ }
58
+ });
59
+ if ((_a = options.properties) == null ? void 0 : _a._copilotkit) {
60
+ telemetry_client_default.setGlobalProperties({
61
+ _copilotkit: options.properties._copilotkit
62
+ });
63
+ }
64
+ telemetry_client_default.capture("oss.runtime.instance_created", getRuntimeInstanceTelemetryInfo(options.runtime));
65
+ const logger = commonConfig.logging;
66
+ logger.debug("Creating NextJS Pages Router endpoint");
67
+ const yoga = createYoga2({
68
+ ...commonConfig,
69
+ graphqlEndpoint: options.endpoint
70
+ });
71
+ return yoga;
72
+ }
73
+ __name(copilotRuntimeNextJSPagesRouterEndpoint, "copilotRuntimeNextJSPagesRouterEndpoint");
74
+
75
+ export {
76
+ copilotRuntimeNextJSAppRouterEndpoint,
77
+ config,
78
+ copilotRuntimeNextJSPagesRouterEndpoint
79
+ };
80
+ //# sourceMappingURL=chunk-YTXDY7ZM.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/integrations/nextjs/app-router.ts","../src/lib/integrations/nextjs/pages-router.ts"],"sourcesContent":["import { createYoga } from \"graphql-yoga\";\nimport { CreateCopilotRuntimeServerOptions, getCommonConfig } from \"../shared\";\nimport telemetry, { getRuntimeInstanceTelemetryInfo } from \"../../telemetry-client\";\n\nexport function copilotRuntimeNextJSAppRouterEndpoint(options: CreateCopilotRuntimeServerOptions) {\n const commonConfig = getCommonConfig(options);\n\n telemetry.setGlobalProperties({\n runtime: {\n framework: \"nextjs-app-router\",\n },\n });\n\n if (options.properties?._copilotkit) {\n telemetry.setGlobalProperties({\n _copilotkit: options.properties._copilotkit,\n });\n }\n\n telemetry.capture(\n \"oss.runtime.instance_created\",\n getRuntimeInstanceTelemetryInfo(options.runtime),\n );\n\n const logger = commonConfig.logging;\n logger.debug(\"Creating NextJS App Router endpoint\");\n\n const yoga = createYoga({\n ...commonConfig,\n graphqlEndpoint: options.endpoint,\n fetchAPI: { Response: globalThis.Response },\n });\n\n return {\n handleRequest: yoga,\n GET: yoga as any,\n POST: yoga as any,\n OPTIONS: yoga as any,\n };\n}\n","import { YogaServerInstance, createYoga } from \"graphql-yoga\";\nimport { CreateCopilotRuntimeServerOptions, GraphQLContext, getCommonConfig } from \"../shared\";\nimport telemetry, { getRuntimeInstanceTelemetryInfo } from \"../../telemetry-client\";\n\nexport const config = {\n api: {\n bodyParser: false,\n },\n};\n\nexport type CopilotRuntimeServerInstance<T> = YogaServerInstance<T, Partial<GraphQLContext>>;\n\n// This import is needed to fix the type error\n// Fix is currently in TypeScript 5.5 beta, waiting for stable version\n// https://github.com/microsoft/TypeScript/issues/42873#issuecomment-2066874644\nexport type {} from \"@whatwg-node/server\";\n\nexport function copilotRuntimeNextJSPagesRouterEndpoint(\n options: CreateCopilotRuntimeServerOptions,\n): CopilotRuntimeServerInstance<GraphQLContext> {\n const commonConfig = getCommonConfig(options);\n\n telemetry.setGlobalProperties({\n runtime: {\n framework: \"nextjs-pages-router\",\n },\n });\n\n if (options.properties?._copilotkit) {\n telemetry.setGlobalProperties({\n _copilotkit: options.properties._copilotkit,\n });\n }\n\n telemetry.capture(\n \"oss.runtime.instance_created\",\n getRuntimeInstanceTelemetryInfo(options.runtime),\n );\n\n const logger = commonConfig.logging;\n logger.debug(\"Creating NextJS Pages Router endpoint\");\n\n const yoga = createYoga({\n ...commonConfig,\n graphqlEndpoint: options.endpoint,\n });\n\n return yoga;\n}\n"],"mappings":";;;;;;;;;;AAAA,SAASA,kBAAkB;AAIpB,SAASC,sCAAsCC,SAA0C;AAJhG;AAKE,QAAMC,eAAeC,gBAAgBF,OAAAA;AAErCG,2BAAUC,oBAAoB;IAC5BC,SAAS;MACPC,WAAW;IACb;EACF,CAAA;AAEA,OAAIN,aAAQO,eAARP,mBAAoBQ,aAAa;AACnCL,6BAAUC,oBAAoB;MAC5BI,aAAaR,QAAQO,WAAWC;IAClC,CAAA;EACF;AAEAL,2BAAUM,QACR,gCACAC,gCAAgCV,QAAQK,OAAO,CAAA;AAGjD,QAAMM,SAASV,aAAaW;AAC5BD,SAAOE,MAAM,qCAAA;AAEb,QAAMC,OAAOC,WAAW;IACtB,GAAGd;IACHe,iBAAiBhB,QAAQiB;IACzBC,UAAU;MAAEC,UAAUC,WAAWD;IAAS;EAC5C,CAAA;AAEA,SAAO;IACLE,eAAeP;IACfQ,KAAKR;IACLS,MAAMT;IACNU,SAASV;EACX;AACF;AAnCgBf;;;ACJhB,SAA6B0B,cAAAA,mBAAkB;AAIxC,IAAMC,SAAS;EACpBC,KAAK;IACHC,YAAY;EACd;AACF;AASO,SAASC,wCACdC,SAA0C;AAlB5C;AAoBE,QAAMC,eAAeC,gBAAgBF,OAAAA;AAErCG,2BAAUC,oBAAoB;IAC5BC,SAAS;MACPC,WAAW;IACb;EACF,CAAA;AAEA,OAAIN,aAAQO,eAARP,mBAAoBQ,aAAa;AACnCL,6BAAUC,oBAAoB;MAC5BI,aAAaR,QAAQO,WAAWC;IAClC,CAAA;EACF;AAEAL,2BAAUM,QACR,gCACAC,gCAAgCV,QAAQK,OAAO,CAAA;AAGjD,QAAMM,SAASV,aAAaW;AAC5BD,SAAOE,MAAM,uCAAA;AAEb,QAAMC,OAAOC,YAAW;IACtB,GAAGd;IACHe,iBAAiBhB,QAAQiB;EAC3B,CAAA;AAEA,SAAOH;AACT;AA/BgBf;","names":["createYoga","copilotRuntimeNextJSAppRouterEndpoint","options","commonConfig","getCommonConfig","telemetry","setGlobalProperties","runtime","framework","properties","_copilotkit","capture","getRuntimeInstanceTelemetryInfo","logger","logging","debug","yoga","createYoga","graphqlEndpoint","endpoint","fetchAPI","Response","globalThis","handleRequest","GET","POST","OPTIONS","createYoga","config","api","bodyParser","copilotRuntimeNextJSPagesRouterEndpoint","options","commonConfig","getCommonConfig","telemetry","setGlobalProperties","runtime","framework","properties","_copilotkit","capture","getRuntimeInstanceTelemetryInfo","logger","logging","debug","yoga","createYoga","graphqlEndpoint","endpoint"]}
@@ -0,0 +1,196 @@
1
+ import { Parameter, Action } from '@copilotkit/shared';
2
+ import { b as CopilotServiceAdapter, R as RemoteChainParameters, A as ActionInput, F as ForwardedParametersInput, d as RuntimeEventSource } from './langserve-9125a12e.js';
3
+ import { a as MessageInput, M as Message } from './index-cc2b17be.js';
4
+ import * as graphql from 'graphql';
5
+ import * as pino from 'pino';
6
+ import { YogaInitialContext, createYoga } from 'graphql-yoga';
7
+ import { CopilotCloudOptions } from './lib/cloud/index.js';
8
+
9
+ type LogLevel = "debug" | "info" | "warn" | "error";
10
+
11
+ declare const logger: pino.Logger<never>;
12
+ type AnyPrimitive = string | boolean | number | null;
13
+ type CopilotRequestContextProperties = Record<string, AnyPrimitive | Record<string, AnyPrimitive>>;
14
+ type GraphQLContext = YogaInitialContext & {
15
+ _copilotkit: CreateCopilotRuntimeServerOptions;
16
+ properties: CopilotRequestContextProperties;
17
+ logger: typeof logger;
18
+ };
19
+ interface CreateCopilotRuntimeServerOptions {
20
+ runtime: CopilotRuntime<any>;
21
+ serviceAdapter: CopilotServiceAdapter;
22
+ endpoint: string;
23
+ baseUrl?: string;
24
+ cloud?: CopilotCloudOptions;
25
+ properties?: CopilotRequestContextProperties;
26
+ logLevel?: LogLevel;
27
+ }
28
+ declare function createContext(initialContext: YogaInitialContext, copilotKitContext: CreateCopilotRuntimeServerOptions, contextLogger: typeof logger, properties?: CopilotRequestContextProperties): Promise<Partial<GraphQLContext>>;
29
+ declare function buildSchema(options?: {
30
+ emitSchemaFile?: string;
31
+ }): graphql.GraphQLSchema;
32
+ type CommonConfig = {
33
+ logging: typeof logger;
34
+ schema: ReturnType<typeof buildSchema>;
35
+ plugins: Parameters<typeof createYoga>[0]["plugins"];
36
+ context: (ctx: YogaInitialContext) => Promise<Partial<GraphQLContext>>;
37
+ };
38
+ declare function getCommonConfig(options: CreateCopilotRuntimeServerOptions): CommonConfig;
39
+
40
+ declare class AgentStateInput {
41
+ agentName: string;
42
+ state: string;
43
+ }
44
+
45
+ type EndpointDefinition = CopilotKitEndpoint | LangGraphPlatformEndpoint;
46
+ declare enum EndpointType {
47
+ CopilotKit = "copilotKit",
48
+ LangGraphPlatform = "langgraph-platform"
49
+ }
50
+ interface BaseEndpointDefinition<TActionType extends EndpointType> {
51
+ type?: TActionType;
52
+ }
53
+ interface CopilotKitEndpoint extends BaseEndpointDefinition<EndpointType.CopilotKit> {
54
+ url: string;
55
+ onBeforeRequest?: ({ ctx }: {
56
+ ctx: GraphQLContext;
57
+ }) => {
58
+ headers?: Record<string, string> | undefined;
59
+ };
60
+ }
61
+ interface LangGraphPlatformAgent {
62
+ name: string;
63
+ description: string;
64
+ assistantId?: string;
65
+ }
66
+ interface LangGraphPlatformEndpoint extends BaseEndpointDefinition<EndpointType.LangGraphPlatform> {
67
+ deploymentUrl: string;
68
+ langsmithApiKey: string;
69
+ agents: LangGraphPlatformAgent[];
70
+ }
71
+
72
+ declare class AgentSessionInput {
73
+ agentName: string;
74
+ threadId?: string;
75
+ nodeName?: string;
76
+ }
77
+
78
+ declare class Agent {
79
+ id: string;
80
+ name: string;
81
+ description?: string;
82
+ }
83
+
84
+ /**
85
+ * <Callout type="info">
86
+ * This is the reference for the `CopilotRuntime` class. For more information and example code snippets, please see [Concept: Copilot Runtime](/concepts/copilot-runtime).
87
+ * </Callout>
88
+ *
89
+ * ## Usage
90
+ *
91
+ * ```tsx
92
+ * import { CopilotRuntime } from "@copilotkit/runtime";
93
+ *
94
+ * const copilotKit = new CopilotRuntime();
95
+ * ```
96
+ */
97
+
98
+ interface CopilotRuntimeRequest {
99
+ serviceAdapter: CopilotServiceAdapter;
100
+ messages: MessageInput[];
101
+ actions: ActionInput[];
102
+ agentSession?: AgentSessionInput;
103
+ agentStates?: AgentStateInput[];
104
+ outputMessagesPromise: Promise<Message[]>;
105
+ threadId?: string;
106
+ runId?: string;
107
+ publicApiKey?: string;
108
+ graphqlContext: GraphQLContext;
109
+ forwardedParameters?: ForwardedParametersInput;
110
+ url?: string;
111
+ }
112
+ interface CopilotRuntimeResponse {
113
+ threadId: string;
114
+ runId?: string;
115
+ eventSource: RuntimeEventSource;
116
+ serverSideActions: Action<any>[];
117
+ actionInputsWithoutAgents: ActionInput[];
118
+ }
119
+ type ActionsConfiguration<T extends Parameter[] | [] = []> = Action<T>[] | ((ctx: {
120
+ properties: any;
121
+ url?: string;
122
+ }) => Action<T>[]);
123
+ interface OnBeforeRequestOptions {
124
+ threadId?: string;
125
+ runId?: string;
126
+ inputMessages: Message[];
127
+ properties: any;
128
+ url?: string;
129
+ }
130
+ type OnBeforeRequestHandler = (options: OnBeforeRequestOptions) => void | Promise<void>;
131
+ interface OnAfterRequestOptions {
132
+ threadId: string;
133
+ runId?: string;
134
+ inputMessages: Message[];
135
+ outputMessages: Message[];
136
+ properties: any;
137
+ url?: string;
138
+ }
139
+ type OnAfterRequestHandler = (options: OnAfterRequestOptions) => void | Promise<void>;
140
+ interface Middleware {
141
+ /**
142
+ * A function that is called before the request is processed.
143
+ */
144
+ onBeforeRequest?: OnBeforeRequestHandler;
145
+ /**
146
+ * A function that is called after the request is processed.
147
+ */
148
+ onAfterRequest?: OnAfterRequestHandler;
149
+ }
150
+ interface CopilotRuntimeConstructorParams<T extends Parameter[] | [] = []> {
151
+ /**
152
+ * Middleware to be used by the runtime.
153
+ *
154
+ * ```ts
155
+ * onBeforeRequest: (options: {
156
+ * threadId?: string;
157
+ * runId?: string;
158
+ * inputMessages: Message[];
159
+ * properties: any;
160
+ * }) => void | Promise<void>;
161
+ * ```
162
+ *
163
+ * ```ts
164
+ * onAfterRequest: (options: {
165
+ * threadId?: string;
166
+ * runId?: string;
167
+ * inputMessages: Message[];
168
+ * outputMessages: Message[];
169
+ * properties: any;
170
+ * }) => void | Promise<void>;
171
+ * ```
172
+ */
173
+ middleware?: Middleware;
174
+ actions?: ActionsConfiguration<T>;
175
+ remoteActions?: CopilotKitEndpoint[];
176
+ remoteEndpoints?: EndpointDefinition[];
177
+ langserve?: RemoteChainParameters[];
178
+ }
179
+ declare class CopilotRuntime<const T extends Parameter[] | [] = []> {
180
+ actions: ActionsConfiguration<T>;
181
+ remoteEndpointDefinitions: EndpointDefinition[];
182
+ private langserve;
183
+ private onBeforeRequest?;
184
+ private onAfterRequest?;
185
+ constructor(params?: CopilotRuntimeConstructorParams<T>);
186
+ processRuntimeRequest(request: CopilotRuntimeRequest): Promise<CopilotRuntimeResponse>;
187
+ discoverAgentsFromEndpoints(graphqlContext: GraphQLContext): Promise<Agent[]>;
188
+ private processAgentRequest;
189
+ private getServerSideActions;
190
+ }
191
+ declare function flattenToolCallsNoDuplicates(toolsByPriority: ActionInput[]): ActionInput[];
192
+ declare function copilotKitEndpoint(config: Omit<CopilotKitEndpoint, "type">): CopilotKitEndpoint;
193
+ declare function langGraphPlatformEndpoint(config: Omit<LangGraphPlatformEndpoint, "type">): LangGraphPlatformEndpoint;
194
+ declare function resolveEndpointType(endpoint: EndpointDefinition): EndpointType;
195
+
196
+ export { CopilotRuntimeConstructorParams as C, GraphQLContext as G, CopilotRuntime as a, CopilotRequestContextProperties as b, copilotKitEndpoint as c, CreateCopilotRuntimeServerOptions as d, createContext as e, flattenToolCallsNoDuplicates as f, buildSchema as g, CommonConfig as h, getCommonConfig as i, langGraphPlatformEndpoint as l, resolveEndpointType as r };
@@ -0,0 +1,6 @@
1
+ declare class BaseMessageInput {
2
+ id: string;
3
+ createdAt: Date;
4
+ }
5
+
6
+ export { BaseMessageInput };
@@ -0,0 +1,63 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
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/graphql/types/base/index.ts
21
+ var base_exports = {};
22
+ __export(base_exports, {
23
+ BaseMessageInput: () => BaseMessageInput
24
+ });
25
+ module.exports = __toCommonJS(base_exports);
26
+ var import_type_graphql = require("type-graphql");
27
+ function _ts_decorate(decorators, target, key, desc) {
28
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
29
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
30
+ r = Reflect.decorate(decorators, target, key, desc);
31
+ else
32
+ for (var i = decorators.length - 1; i >= 0; i--)
33
+ if (d = decorators[i])
34
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
35
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
36
+ }
37
+ __name(_ts_decorate, "_ts_decorate");
38
+ function _ts_metadata(k, v) {
39
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
40
+ return Reflect.metadata(k, v);
41
+ }
42
+ __name(_ts_metadata, "_ts_metadata");
43
+ var BaseMessageInput = class {
44
+ id;
45
+ createdAt;
46
+ };
47
+ __name(BaseMessageInput, "BaseMessageInput");
48
+ _ts_decorate([
49
+ (0, import_type_graphql.Field)(() => String),
50
+ _ts_metadata("design:type", String)
51
+ ], BaseMessageInput.prototype, "id", void 0);
52
+ _ts_decorate([
53
+ (0, import_type_graphql.Field)(() => Date),
54
+ _ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
55
+ ], BaseMessageInput.prototype, "createdAt", void 0);
56
+ BaseMessageInput = _ts_decorate([
57
+ (0, import_type_graphql.InputType)()
58
+ ], BaseMessageInput);
59
+ // Annotate the CommonJS export names for ESM import in node:
60
+ 0 && (module.exports = {
61
+ BaseMessageInput
62
+ });
63
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/graphql/types/base/index.ts"],"sourcesContent":["import { Field, InputType } from \"type-graphql\";\n\n@InputType()\nexport class BaseMessageInput {\n @Field(() => String)\n id: string;\n\n @Field(() => Date)\n createdAt: Date;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0BAAiC;;;;;;;;;;;;;;;;;AAG1B,IAAMA,mBAAN,MAAMA;EAEXC;EAGAC;AACF;AANaF;;MACVG,2BAAM,MAAMC,MAAAA;;GADFJ,iBAAAA,WAAAA,MAAAA,MAAAA;;MAIVG,2BAAM,MAAME,IAAAA;qCACF,SAAA,cAAA,SAAA,IAAA;GALAL,iBAAAA,WAAAA,aAAAA,MAAAA;AAAAA,mBAAAA,aAAAA;MADZM,+BAAAA;GACYN,gBAAAA;","names":["BaseMessageInput","id","createdAt","Field","String","Date","InputType"]}
@@ -0,0 +1,8 @@
1
+ import {
2
+ BaseMessageInput
3
+ } from "../../../chunk-D2WLFQS6.mjs";
4
+ import "../../../chunk-44O2JGUY.mjs";
5
+ export {
6
+ BaseMessageInput
7
+ };
8
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+ export { c as ActionExecutionMessage, d as AgentStateMessage, M as Message, b as MessageType, R as ResultMessage, T as TextMessage } from '../../../index-cc2b17be.js';
2
+ import '../base/index.js';
@@ -0,0 +1,124 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
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/graphql/types/converted/index.ts
21
+ var converted_exports = {};
22
+ __export(converted_exports, {
23
+ ActionExecutionMessage: () => ActionExecutionMessage,
24
+ AgentStateMessage: () => AgentStateMessage,
25
+ Message: () => Message,
26
+ ResultMessage: () => ResultMessage,
27
+ TextMessage: () => TextMessage
28
+ });
29
+ module.exports = __toCommonJS(converted_exports);
30
+
31
+ // src/graphql/types/base/index.ts
32
+ var import_type_graphql = require("type-graphql");
33
+ function _ts_decorate(decorators, target, key, desc) {
34
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
35
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
36
+ r = Reflect.decorate(decorators, target, key, desc);
37
+ else
38
+ for (var i = decorators.length - 1; i >= 0; i--)
39
+ if (d = decorators[i])
40
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
41
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
42
+ }
43
+ __name(_ts_decorate, "_ts_decorate");
44
+ function _ts_metadata(k, v) {
45
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
46
+ return Reflect.metadata(k, v);
47
+ }
48
+ __name(_ts_metadata, "_ts_metadata");
49
+ var BaseMessageInput = class {
50
+ id;
51
+ createdAt;
52
+ };
53
+ __name(BaseMessageInput, "BaseMessageInput");
54
+ _ts_decorate([
55
+ (0, import_type_graphql.Field)(() => String),
56
+ _ts_metadata("design:type", String)
57
+ ], BaseMessageInput.prototype, "id", void 0);
58
+ _ts_decorate([
59
+ (0, import_type_graphql.Field)(() => Date),
60
+ _ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
61
+ ], BaseMessageInput.prototype, "createdAt", void 0);
62
+ BaseMessageInput = _ts_decorate([
63
+ (0, import_type_graphql.InputType)()
64
+ ], BaseMessageInput);
65
+
66
+ // src/graphql/types/converted/index.ts
67
+ var Message = class extends BaseMessageInput {
68
+ type;
69
+ isTextMessage() {
70
+ return this.type === "TextMessage";
71
+ }
72
+ isActionExecutionMessage() {
73
+ return this.type === "ActionExecutionMessage";
74
+ }
75
+ isResultMessage() {
76
+ return this.type === "ResultMessage";
77
+ }
78
+ isAgentStateMessage() {
79
+ return this.type === "AgentStateMessage";
80
+ }
81
+ };
82
+ __name(Message, "Message");
83
+ var TextMessage = class extends Message {
84
+ type = "TextMessage";
85
+ content;
86
+ role;
87
+ parentMessageId;
88
+ };
89
+ __name(TextMessage, "TextMessage");
90
+ var ActionExecutionMessage = class extends Message {
91
+ type = "ActionExecutionMessage";
92
+ name;
93
+ arguments;
94
+ parentMessageId;
95
+ };
96
+ __name(ActionExecutionMessage, "ActionExecutionMessage");
97
+ var ResultMessage = class extends Message {
98
+ type = "ResultMessage";
99
+ actionExecutionId;
100
+ actionName;
101
+ result;
102
+ };
103
+ __name(ResultMessage, "ResultMessage");
104
+ var AgentStateMessage = class extends Message {
105
+ type = "AgentStateMessage";
106
+ threadId;
107
+ agentName;
108
+ nodeName;
109
+ runId;
110
+ active;
111
+ role;
112
+ state;
113
+ running;
114
+ };
115
+ __name(AgentStateMessage, "AgentStateMessage");
116
+ // Annotate the CommonJS export names for ESM import in node:
117
+ 0 && (module.exports = {
118
+ ActionExecutionMessage,
119
+ AgentStateMessage,
120
+ Message,
121
+ ResultMessage,
122
+ TextMessage
123
+ });
124
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/graphql/types/converted/index.ts","../../../../src/graphql/types/base/index.ts"],"sourcesContent":["import {\n ActionExecutionMessageInput,\n ResultMessageInput,\n TextMessageInput,\n AgentStateMessageInput,\n} from \"../../inputs/message.input\";\nimport { BaseMessageInput } from \"../base\";\nimport { MessageRole } from \"../enums\";\n\nexport type MessageType =\n | \"TextMessage\"\n | \"ActionExecutionMessage\"\n | \"ResultMessage\"\n | \"AgentStateMessage\";\n\nexport class Message extends BaseMessageInput {\n type: MessageType;\n\n isTextMessage(): this is TextMessage {\n return this.type === \"TextMessage\";\n }\n\n isActionExecutionMessage(): this is ActionExecutionMessage {\n return this.type === \"ActionExecutionMessage\";\n }\n\n isResultMessage(): this is ResultMessage {\n return this.type === \"ResultMessage\";\n }\n\n isAgentStateMessage(): this is AgentStateMessage {\n return this.type === \"AgentStateMessage\";\n }\n}\n\nexport class TextMessage extends Message implements TextMessageInput {\n type: MessageType = \"TextMessage\";\n content: string;\n role: MessageRole;\n parentMessageId?: string;\n}\n\nexport class ActionExecutionMessage\n extends Message\n implements Omit<ActionExecutionMessageInput, \"arguments\" | \"scope\">\n{\n type: MessageType = \"ActionExecutionMessage\";\n name: string;\n arguments: Record<string, any>;\n parentMessageId?: string;\n}\n\nexport class ResultMessage extends Message implements ResultMessageInput {\n type: MessageType = \"ResultMessage\";\n actionExecutionId: string;\n actionName: string;\n result: string;\n}\n\nexport class AgentStateMessage extends Message implements Omit<AgentStateMessageInput, \"state\"> {\n type: MessageType = \"AgentStateMessage\";\n threadId: string;\n agentName: string;\n nodeName: string;\n runId: string;\n active: boolean;\n role: MessageRole;\n state: any;\n running: boolean;\n}\n","import { Field, InputType } from \"type-graphql\";\n\n@InputType()\nexport class BaseMessageInput {\n @Field(() => String)\n id: string;\n\n @Field(() => Date)\n createdAt: Date;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAMA;;;;;;;;;;;ACNA,0BAAiC;;;;;;;;;;;;;;;;;AAG1B,IAAMA,mBAAN,MAAMA;EAEXC;EAGAC;AACF;AANaF;;MACVG,2BAAM,MAAMC,MAAAA;;GADFJ,iBAAAA,WAAAA,MAAAA,MAAAA;;MAIVG,2BAAM,MAAME,IAAAA;qCACF,SAAA,cAAA,SAAA,IAAA;GALAL,iBAAAA,WAAAA,aAAAA,MAAAA;AAAAA,mBAAAA,aAAAA;MADZM,+BAAAA;GACYN,gBAAAA;;;ADYN,IAAMO,UAAN,cAAsBC,iBAAAA;EAC3BC;EAEAC,gBAAqC;AACnC,WAAO,KAAKD,SAAS;EACvB;EAEAE,2BAA2D;AACzD,WAAO,KAAKF,SAAS;EACvB;EAEAG,kBAAyC;AACvC,WAAO,KAAKH,SAAS;EACvB;EAEAI,sBAAiD;AAC/C,WAAO,KAAKJ,SAAS;EACvB;AACF;AAlBaF;AAoBN,IAAMO,cAAN,cAA0BP,QAAAA;EAC/BE,OAAoB;EACpBM;EACAC;EACAC;AACF;AALaH;AAON,IAAMI,yBAAN,cACGX,QAAAA;EAGRE,OAAoB;EACpBU;EACAC;EACAH;AACF;AARaC;AAUN,IAAMG,gBAAN,cAA4Bd,QAAAA;EACjCE,OAAoB;EACpBa;EACAC;EACAC;AACF;AALaH;AAON,IAAMI,oBAAN,cAAgClB,QAAAA;EACrCE,OAAoB;EACpBiB;EACAC;EACAC;EACAC;EACAC;EACAd;EACAe;EACAC;AACF;AAVaP;","names":["BaseMessageInput","id","createdAt","Field","String","Date","InputType","Message","BaseMessageInput","type","isTextMessage","isActionExecutionMessage","isResultMessage","isAgentStateMessage","TextMessage","content","role","parentMessageId","ActionExecutionMessage","name","arguments","ResultMessage","actionExecutionId","actionName","result","AgentStateMessage","threadId","agentName","nodeName","runId","active","state","running"]}
@@ -0,0 +1,17 @@
1
+ import {
2
+ ActionExecutionMessage,
3
+ AgentStateMessage,
4
+ Message,
5
+ ResultMessage,
6
+ TextMessage
7
+ } from "../../../chunk-RFF5IIZJ.mjs";
8
+ import "../../../chunk-D2WLFQS6.mjs";
9
+ import "../../../chunk-44O2JGUY.mjs";
10
+ export {
11
+ ActionExecutionMessage,
12
+ AgentStateMessage,
13
+ Message,
14
+ ResultMessage,
15
+ TextMessage
16
+ };
17
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}