@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.
- package/CHANGELOG.md +11 -0
- package/__snapshots__/schema/schema.graphql +273 -0
- package/dist/chunk-44O2JGUY.mjs +12 -0
- package/dist/chunk-44O2JGUY.mjs.map +1 -0
- package/dist/chunk-5SDH2PVU.mjs +3395 -0
- package/dist/chunk-5SDH2PVU.mjs.map +1 -0
- package/dist/chunk-CLGKEUOA.mjs +1408 -0
- package/dist/chunk-CLGKEUOA.mjs.map +1 -0
- package/dist/chunk-D2WLFQS6.mjs +43 -0
- package/dist/chunk-D2WLFQS6.mjs.map +1 -0
- package/dist/chunk-DFOKBSIS.mjs +1 -0
- package/dist/chunk-DFOKBSIS.mjs.map +1 -0
- package/dist/chunk-OZLXON7T.mjs +25 -0
- package/dist/chunk-OZLXON7T.mjs.map +1 -0
- package/dist/chunk-RFF5IIZJ.mjs +66 -0
- package/dist/chunk-RFF5IIZJ.mjs.map +1 -0
- package/dist/chunk-T4EYPND5.mjs +25 -0
- package/dist/chunk-T4EYPND5.mjs.map +1 -0
- package/dist/chunk-U3V2BCGI.mjs +152 -0
- package/dist/chunk-U3V2BCGI.mjs.map +1 -0
- package/dist/chunk-YTXDY7ZM.mjs +80 -0
- package/dist/chunk-YTXDY7ZM.mjs.map +1 -0
- package/dist/copilot-runtime-36700e00.d.ts +196 -0
- package/dist/graphql/types/base/index.d.ts +6 -0
- package/dist/graphql/types/base/index.js +63 -0
- package/dist/graphql/types/base/index.js.map +1 -0
- package/dist/graphql/types/base/index.mjs +8 -0
- package/dist/graphql/types/base/index.mjs.map +1 -0
- package/dist/graphql/types/converted/index.d.ts +2 -0
- package/dist/graphql/types/converted/index.js +124 -0
- package/dist/graphql/types/converted/index.js.map +1 -0
- package/dist/graphql/types/converted/index.mjs +17 -0
- package/dist/graphql/types/converted/index.mjs.map +1 -0
- package/dist/groq-adapter-696b5d29.d.ts +281 -0
- package/dist/index-cc2b17be.d.ts +87 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +5153 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +76 -0
- package/dist/index.mjs.map +1 -0
- package/dist/langserve-9125a12e.d.ts +176 -0
- package/dist/lib/cloud/index.d.ts +6 -0
- package/dist/lib/cloud/index.js +18 -0
- package/dist/lib/cloud/index.js.map +1 -0
- package/dist/lib/cloud/index.mjs +1 -0
- package/dist/lib/cloud/index.mjs.map +1 -0
- package/dist/lib/index.d.ts +20 -0
- package/dist/lib/index.js +4801 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/index.mjs +58 -0
- package/dist/lib/index.mjs.map +1 -0
- package/dist/lib/integrations/index.d.ts +33 -0
- package/dist/lib/integrations/index.js +2166 -0
- package/dist/lib/integrations/index.js.map +1 -0
- package/dist/lib/integrations/index.mjs +34 -0
- package/dist/lib/integrations/index.mjs.map +1 -0
- package/dist/lib/integrations/nest/index.d.ts +14 -0
- package/dist/lib/integrations/nest/index.js +2075 -0
- package/dist/lib/integrations/nest/index.js.map +1 -0
- package/dist/lib/integrations/nest/index.mjs +13 -0
- package/dist/lib/integrations/nest/index.mjs.map +1 -0
- package/dist/lib/integrations/node-express/index.d.ts +14 -0
- package/dist/lib/integrations/node-express/index.js +2075 -0
- package/dist/lib/integrations/node-express/index.js.map +1 -0
- package/dist/lib/integrations/node-express/index.mjs +13 -0
- package/dist/lib/integrations/node-express/index.mjs.map +1 -0
- package/dist/lib/integrations/node-http/index.d.ts +14 -0
- package/dist/lib/integrations/node-http/index.js +2061 -0
- package/dist/lib/integrations/node-http/index.js.map +1 -0
- package/dist/lib/integrations/node-http/index.mjs +12 -0
- package/dist/lib/integrations/node-http/index.mjs.map +1 -0
- package/dist/service-adapters/index.d.ts +84 -0
- package/dist/service-adapters/index.js +1448 -0
- package/dist/service-adapters/index.js.map +1 -0
- package/dist/service-adapters/index.mjs +26 -0
- package/dist/service-adapters/index.mjs.map +1 -0
- package/dist/utils/index.d.ts +49 -0
- package/dist/utils/index.js +174 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +12 -0
- package/dist/utils/index.mjs.map +1 -0
- package/package.json +2 -2
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import "./chunk-DFOKBSIS.mjs";
|
|
2
|
+
import {
|
|
3
|
+
config,
|
|
4
|
+
copilotRuntimeNextJSAppRouterEndpoint,
|
|
5
|
+
copilotRuntimeNextJSPagesRouterEndpoint
|
|
6
|
+
} from "./chunk-YTXDY7ZM.mjs";
|
|
7
|
+
import {
|
|
8
|
+
copilotRuntimeNestEndpoint
|
|
9
|
+
} from "./chunk-T4EYPND5.mjs";
|
|
10
|
+
import {
|
|
11
|
+
copilotRuntimeNodeExpressEndpoint
|
|
12
|
+
} from "./chunk-OZLXON7T.mjs";
|
|
13
|
+
import {
|
|
14
|
+
CopilotRuntime,
|
|
15
|
+
buildSchema,
|
|
16
|
+
copilotKitEndpoint,
|
|
17
|
+
copilotRuntimeNodeHttpEndpoint,
|
|
18
|
+
createContext,
|
|
19
|
+
flattenToolCallsNoDuplicates,
|
|
20
|
+
getCommonConfig,
|
|
21
|
+
langGraphPlatformEndpoint,
|
|
22
|
+
resolveEndpointType
|
|
23
|
+
} from "./chunk-5SDH2PVU.mjs";
|
|
24
|
+
import {
|
|
25
|
+
AnthropicAdapter,
|
|
26
|
+
ExperimentalEmptyAdapter,
|
|
27
|
+
ExperimentalOllamaAdapter,
|
|
28
|
+
GoogleGenerativeAIAdapter,
|
|
29
|
+
GroqAdapter,
|
|
30
|
+
LangChainAdapter,
|
|
31
|
+
OpenAIAdapter,
|
|
32
|
+
OpenAIAssistantAdapter,
|
|
33
|
+
RemoteChain,
|
|
34
|
+
UnifyAdapter
|
|
35
|
+
} from "./chunk-CLGKEUOA.mjs";
|
|
36
|
+
import {
|
|
37
|
+
GuardrailsValidationFailureResponse,
|
|
38
|
+
MessageStreamInterruptedResponse,
|
|
39
|
+
UnknownErrorResponse
|
|
40
|
+
} from "./chunk-U3V2BCGI.mjs";
|
|
41
|
+
import "./chunk-RFF5IIZJ.mjs";
|
|
42
|
+
import "./chunk-D2WLFQS6.mjs";
|
|
43
|
+
import "./chunk-44O2JGUY.mjs";
|
|
44
|
+
|
|
45
|
+
// src/index.ts
|
|
46
|
+
import "reflect-metadata";
|
|
47
|
+
export {
|
|
48
|
+
AnthropicAdapter,
|
|
49
|
+
CopilotRuntime,
|
|
50
|
+
ExperimentalEmptyAdapter,
|
|
51
|
+
ExperimentalOllamaAdapter,
|
|
52
|
+
GoogleGenerativeAIAdapter,
|
|
53
|
+
GroqAdapter,
|
|
54
|
+
GuardrailsValidationFailureResponse,
|
|
55
|
+
LangChainAdapter,
|
|
56
|
+
MessageStreamInterruptedResponse,
|
|
57
|
+
OpenAIAdapter,
|
|
58
|
+
OpenAIAssistantAdapter,
|
|
59
|
+
RemoteChain,
|
|
60
|
+
UnifyAdapter,
|
|
61
|
+
UnknownErrorResponse,
|
|
62
|
+
buildSchema,
|
|
63
|
+
config,
|
|
64
|
+
copilotKitEndpoint,
|
|
65
|
+
copilotRuntimeNestEndpoint,
|
|
66
|
+
copilotRuntimeNextJSAppRouterEndpoint,
|
|
67
|
+
copilotRuntimeNextJSPagesRouterEndpoint,
|
|
68
|
+
copilotRuntimeNodeExpressEndpoint,
|
|
69
|
+
copilotRuntimeNodeHttpEndpoint,
|
|
70
|
+
createContext,
|
|
71
|
+
flattenToolCallsNoDuplicates,
|
|
72
|
+
getCommonConfig,
|
|
73
|
+
langGraphPlatformEndpoint,
|
|
74
|
+
resolveEndpointType
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import \"reflect-metadata\";\nexport * from \"./lib\";\nexport * from \"./utils\";\nexport * from \"./service-adapters\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO;","names":[]}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { A as ActionInputAvailability, M as Message } from './index-cc2b17be.js';
|
|
2
|
+
import * as rxjs from 'rxjs';
|
|
3
|
+
import { Subject, ReplaySubject } from 'rxjs';
|
|
4
|
+
import { Action, Parameter } from '@copilotkit/shared';
|
|
5
|
+
|
|
6
|
+
declare enum GuardrailsResultStatus {
|
|
7
|
+
ALLOWED = "allowed",
|
|
8
|
+
DENIED = "denied"
|
|
9
|
+
}
|
|
10
|
+
declare class GuardrailsResult {
|
|
11
|
+
status: GuardrailsResultStatus;
|
|
12
|
+
reason?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare class ActionInput {
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
jsonSchema: string;
|
|
19
|
+
available?: ActionInputAvailability;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare enum RuntimeEventTypes {
|
|
23
|
+
TextMessageStart = "TextMessageStart",
|
|
24
|
+
TextMessageContent = "TextMessageContent",
|
|
25
|
+
TextMessageEnd = "TextMessageEnd",
|
|
26
|
+
ActionExecutionStart = "ActionExecutionStart",
|
|
27
|
+
ActionExecutionArgs = "ActionExecutionArgs",
|
|
28
|
+
ActionExecutionEnd = "ActionExecutionEnd",
|
|
29
|
+
ActionExecutionResult = "ActionExecutionResult",
|
|
30
|
+
AgentStateMessage = "AgentStateMessage"
|
|
31
|
+
}
|
|
32
|
+
type RuntimeEvent = {
|
|
33
|
+
type: RuntimeEventTypes.TextMessageStart;
|
|
34
|
+
messageId: string;
|
|
35
|
+
parentMessageId?: string;
|
|
36
|
+
} | {
|
|
37
|
+
type: RuntimeEventTypes.TextMessageContent;
|
|
38
|
+
messageId: string;
|
|
39
|
+
content: string;
|
|
40
|
+
} | {
|
|
41
|
+
type: RuntimeEventTypes.TextMessageEnd;
|
|
42
|
+
messageId: string;
|
|
43
|
+
} | {
|
|
44
|
+
type: RuntimeEventTypes.ActionExecutionStart;
|
|
45
|
+
actionExecutionId: string;
|
|
46
|
+
actionName: string;
|
|
47
|
+
parentMessageId?: string;
|
|
48
|
+
} | {
|
|
49
|
+
type: RuntimeEventTypes.ActionExecutionArgs;
|
|
50
|
+
actionExecutionId: string;
|
|
51
|
+
args: string;
|
|
52
|
+
} | {
|
|
53
|
+
type: RuntimeEventTypes.ActionExecutionEnd;
|
|
54
|
+
actionExecutionId: string;
|
|
55
|
+
} | {
|
|
56
|
+
type: RuntimeEventTypes.ActionExecutionResult;
|
|
57
|
+
actionName: string;
|
|
58
|
+
actionExecutionId: string;
|
|
59
|
+
result: string;
|
|
60
|
+
} | {
|
|
61
|
+
type: RuntimeEventTypes.AgentStateMessage;
|
|
62
|
+
threadId: string;
|
|
63
|
+
agentName: string;
|
|
64
|
+
nodeName: string;
|
|
65
|
+
runId: string;
|
|
66
|
+
active: boolean;
|
|
67
|
+
role: string;
|
|
68
|
+
state: string;
|
|
69
|
+
running: boolean;
|
|
70
|
+
};
|
|
71
|
+
type EventSourceCallback = (eventStream$: RuntimeEventSubject) => Promise<void>;
|
|
72
|
+
declare class RuntimeEventSubject extends ReplaySubject<RuntimeEvent> {
|
|
73
|
+
constructor();
|
|
74
|
+
sendTextMessageStart({ messageId, parentMessageId, }: {
|
|
75
|
+
messageId: string;
|
|
76
|
+
parentMessageId?: string;
|
|
77
|
+
}): void;
|
|
78
|
+
sendTextMessageContent({ messageId, content }: {
|
|
79
|
+
messageId: string;
|
|
80
|
+
content: string;
|
|
81
|
+
}): void;
|
|
82
|
+
sendTextMessageEnd({ messageId }: {
|
|
83
|
+
messageId: string;
|
|
84
|
+
}): void;
|
|
85
|
+
sendTextMessage(messageId: string, content: string): void;
|
|
86
|
+
sendActionExecutionStart({ actionExecutionId, actionName, parentMessageId, }: {
|
|
87
|
+
actionExecutionId: string;
|
|
88
|
+
actionName: string;
|
|
89
|
+
parentMessageId?: string;
|
|
90
|
+
}): void;
|
|
91
|
+
sendActionExecutionArgs({ actionExecutionId, args, }: {
|
|
92
|
+
actionExecutionId: string;
|
|
93
|
+
args: string;
|
|
94
|
+
}): void;
|
|
95
|
+
sendActionExecutionEnd({ actionExecutionId }: {
|
|
96
|
+
actionExecutionId: string;
|
|
97
|
+
}): void;
|
|
98
|
+
sendActionExecution({ actionExecutionId, actionName, args, parentMessageId, }: {
|
|
99
|
+
actionExecutionId: string;
|
|
100
|
+
actionName: string;
|
|
101
|
+
args: string;
|
|
102
|
+
parentMessageId?: string;
|
|
103
|
+
}): void;
|
|
104
|
+
sendActionExecutionResult({ actionExecutionId, actionName, result, }: {
|
|
105
|
+
actionExecutionId: string;
|
|
106
|
+
actionName: string;
|
|
107
|
+
result: string;
|
|
108
|
+
}): void;
|
|
109
|
+
sendAgentStateMessage({ threadId, agentName, nodeName, runId, active, role, state, running, }: {
|
|
110
|
+
threadId: string;
|
|
111
|
+
agentName: string;
|
|
112
|
+
nodeName: string;
|
|
113
|
+
runId: string;
|
|
114
|
+
active: boolean;
|
|
115
|
+
role: string;
|
|
116
|
+
state: string;
|
|
117
|
+
running: boolean;
|
|
118
|
+
}): void;
|
|
119
|
+
}
|
|
120
|
+
declare class RuntimeEventSource {
|
|
121
|
+
private eventStream$;
|
|
122
|
+
private callback;
|
|
123
|
+
stream(callback: EventSourceCallback): Promise<void>;
|
|
124
|
+
sendErrorMessageToChat(message?: string): void;
|
|
125
|
+
processRuntimeEvents({ serverSideActions, guardrailsResult$, actionInputsWithoutAgents, }: {
|
|
126
|
+
serverSideActions: Action<any>[];
|
|
127
|
+
guardrailsResult$?: Subject<GuardrailsResult>;
|
|
128
|
+
actionInputsWithoutAgents: ActionInput[];
|
|
129
|
+
}): rxjs.Observable<RuntimeEvent>;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
declare class ForwardedParametersInput {
|
|
133
|
+
model?: string;
|
|
134
|
+
maxTokens?: number;
|
|
135
|
+
stop?: string[];
|
|
136
|
+
toolChoice?: String;
|
|
137
|
+
toolChoiceFunctionName?: string;
|
|
138
|
+
temperature?: number;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
interface CopilotRuntimeChatCompletionRequest {
|
|
142
|
+
eventSource: RuntimeEventSource;
|
|
143
|
+
messages: Message[];
|
|
144
|
+
actions: ActionInput[];
|
|
145
|
+
model?: string;
|
|
146
|
+
threadId?: string;
|
|
147
|
+
runId?: string;
|
|
148
|
+
forwardedParameters?: ForwardedParametersInput;
|
|
149
|
+
}
|
|
150
|
+
interface CopilotRuntimeChatCompletionResponse {
|
|
151
|
+
threadId: string;
|
|
152
|
+
runId?: string;
|
|
153
|
+
}
|
|
154
|
+
interface CopilotServiceAdapter {
|
|
155
|
+
process(request: CopilotRuntimeChatCompletionRequest): Promise<CopilotRuntimeChatCompletionResponse>;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
interface RemoteChainParameters {
|
|
159
|
+
name: string;
|
|
160
|
+
description: string;
|
|
161
|
+
chainUrl: string;
|
|
162
|
+
parameters?: Parameter[];
|
|
163
|
+
parameterType?: "single" | "multi";
|
|
164
|
+
}
|
|
165
|
+
declare class RemoteChain {
|
|
166
|
+
name: string;
|
|
167
|
+
description: string;
|
|
168
|
+
chainUrl: string;
|
|
169
|
+
parameters?: Parameter[];
|
|
170
|
+
parameterType: "single" | "multi";
|
|
171
|
+
constructor(options: RemoteChainParameters);
|
|
172
|
+
toAction(): Promise<Action<any>>;
|
|
173
|
+
inferLangServeParameters(): Promise<void>;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export { ActionInput as A, CopilotRuntimeChatCompletionRequest as C, ForwardedParametersInput as F, RemoteChainParameters as R, CopilotRuntimeChatCompletionResponse as a, CopilotServiceAdapter as b, RemoteChain as c, RuntimeEventSource as d };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/lib/cloud/index.ts
|
|
16
|
+
var cloud_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(cloud_exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/cloud/index.ts"],"sourcesContent":["export interface CopilotCloudOptions {\n baseUrl?: string;\n publicApiKey?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { h as CommonConfig, b as CopilotRequestContextProperties, a as CopilotRuntime, C as CopilotRuntimeConstructorParams, d as CreateCopilotRuntimeServerOptions, G as GraphQLContext, g as buildSchema, c as copilotKitEndpoint, e as createContext, f as flattenToolCallsNoDuplicates, i as getCommonConfig, l as langGraphPlatformEndpoint, r as resolveEndpointType } from '../copilot-runtime-36700e00.js';
|
|
2
|
+
export { G as GoogleGenerativeAIAdapter, f as GroqAdapter, e as GroqAdapterParams, L as LangChainAdapter, a as OpenAIAdapter, O as OpenAIAdapterParams, c as OpenAIAssistantAdapter, b as OpenAIAssistantAdapterParams, d as UnifyAdapter, U as UnifyAdapterParams } from '../groq-adapter-696b5d29.js';
|
|
3
|
+
export { CopilotRuntimeServerInstance, config, copilotRuntimeNextJSAppRouterEndpoint, copilotRuntimeNextJSPagesRouterEndpoint } from './integrations/index.js';
|
|
4
|
+
export { copilotRuntimeNodeHttpEndpoint } from './integrations/node-http/index.js';
|
|
5
|
+
export { copilotRuntimeNodeExpressEndpoint } from './integrations/node-express/index.js';
|
|
6
|
+
export { copilotRuntimeNestEndpoint } from './integrations/nest/index.js';
|
|
7
|
+
import '@copilotkit/shared';
|
|
8
|
+
import '../langserve-9125a12e.js';
|
|
9
|
+
import '../index-cc2b17be.js';
|
|
10
|
+
import '../graphql/types/base/index.js';
|
|
11
|
+
import 'rxjs';
|
|
12
|
+
import 'graphql';
|
|
13
|
+
import 'pino';
|
|
14
|
+
import 'graphql-yoga';
|
|
15
|
+
import './cloud/index.js';
|
|
16
|
+
import 'openai';
|
|
17
|
+
import '@langchain/core/messages';
|
|
18
|
+
import '@langchain/core/tools';
|
|
19
|
+
import '@langchain/core/utils/stream';
|
|
20
|
+
import 'groq-sdk';
|