@copilotkit/runtime 1.9.2-next.1 → 1.9.2-next.11
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 +73 -0
- package/dist/chunk-AMUJQ6IR.mjs +50 -0
- package/dist/chunk-AMUJQ6IR.mjs.map +1 -0
- package/dist/{chunk-C3SWOFLO.mjs → chunk-B2BL6HPT.mjs} +2 -2
- package/dist/{chunk-RIPQZJB5.mjs → chunk-CBVVBPVJ.mjs} +2 -2
- package/dist/{chunk-IIXJVVTV.mjs → chunk-GS7DO47Q.mjs} +155 -78
- package/dist/chunk-GS7DO47Q.mjs.map +1 -0
- package/dist/{chunk-XGBY45FP.mjs → chunk-NI7RVCMB.mjs} +2343 -1857
- package/dist/chunk-NI7RVCMB.mjs.map +1 -0
- package/dist/{chunk-YV3YXRMR.mjs → chunk-VVXCPFVN.mjs} +19 -2
- package/dist/chunk-VVXCPFVN.mjs.map +1 -0
- package/dist/{chunk-5BIEM2UU.mjs → chunk-XWBDEXDA.mjs} +4 -3
- package/dist/{chunk-5BIEM2UU.mjs.map → chunk-XWBDEXDA.mjs.map} +1 -1
- package/dist/{chunk-KPFOAXRX.mjs → chunk-ZIEDTGZF.mjs} +2 -2
- package/dist/{groq-adapter-25a2bd35.d.ts → groq-adapter-172a2ca4.d.ts} +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js +3487 -2863
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -8
- package/dist/index.mjs.map +1 -1
- package/dist/lib/index.d.ts +7 -133
- package/dist/lib/index.js +3329 -2748
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +9 -8
- package/dist/lib/integrations/index.d.ts +3 -3
- package/dist/lib/integrations/index.js +162 -98
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +7 -6
- package/dist/lib/integrations/nest/index.d.ts +2 -2
- package/dist/lib/integrations/nest/index.js +162 -98
- package/dist/lib/integrations/nest/index.js.map +1 -1
- package/dist/lib/integrations/nest/index.mjs +5 -4
- package/dist/lib/integrations/node-express/index.d.ts +2 -2
- package/dist/lib/integrations/node-express/index.js +162 -98
- package/dist/lib/integrations/node-express/index.js.map +1 -1
- package/dist/lib/integrations/node-express/index.mjs +5 -4
- package/dist/lib/integrations/node-http/index.d.ts +2 -2
- package/dist/lib/integrations/node-http/index.js +162 -98
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +4 -3
- package/dist/service-adapters/index.d.ts +6 -4
- package/dist/service-adapters/index.js +225 -107
- package/dist/service-adapters/index.js.map +1 -1
- package/dist/service-adapters/index.mjs +6 -2
- package/dist/service-adapters/shared/index.d.ts +9 -0
- package/dist/service-adapters/shared/index.js +72 -0
- package/dist/service-adapters/shared/index.js.map +1 -0
- package/dist/service-adapters/shared/index.mjs +8 -0
- package/dist/service-adapters/shared/index.mjs.map +1 -0
- package/dist/{shared-e272b15a.d.ts → shared-4164c674.d.ts} +45 -5
- package/dist/utils/index.d.ts +17 -1
- package/dist/utils/index.js +3 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +1 -1
- package/package.json +4 -4
- package/src/agents/langgraph/event-source.ts +36 -38
- package/src/agents/langgraph/events.ts +19 -1
- package/src/graphql/resolvers/copilot.resolver.ts +108 -45
- package/src/graphql/resolvers/state.resolver.ts +3 -3
- package/src/lib/error-messages.ts +200 -0
- package/src/lib/integrations/shared.ts +43 -0
- package/src/lib/runtime/__tests__/copilot-runtime-trace.test.ts +169 -0
- package/src/lib/runtime/copilot-runtime.ts +383 -83
- package/src/lib/runtime/langgraph/langgraph-agent.ts +12 -0
- package/src/lib/runtime/remote-action-constructors.ts +28 -3
- package/src/lib/runtime/remote-lg-action.ts +130 -40
- package/src/lib/streaming.ts +125 -36
- package/src/service-adapters/anthropic/anthropic-adapter.ts +67 -8
- package/src/service-adapters/anthropic/utils.ts +3 -8
- package/src/service-adapters/events.ts +37 -81
- package/src/service-adapters/groq/groq-adapter.ts +66 -56
- package/src/service-adapters/index.ts +1 -0
- package/src/service-adapters/openai/openai-adapter.ts +18 -3
- package/src/service-adapters/shared/error-utils.ts +61 -0
- package/src/service-adapters/shared/index.ts +1 -0
- package/src/utils/failed-response-status-reasons.ts +23 -1
- package/tests/service-adapters/anthropic/anthropic-adapter.test.ts +172 -387
- package/dist/chunk-IIXJVVTV.mjs.map +0 -1
- package/dist/chunk-XGBY45FP.mjs.map +0 -1
- package/dist/chunk-YV3YXRMR.mjs.map +0 -1
- package/dist/{chunk-C3SWOFLO.mjs.map → chunk-B2BL6HPT.mjs.map} +0 -0
- package/dist/{chunk-RIPQZJB5.mjs.map → chunk-CBVVBPVJ.mjs.map} +0 -0
- package/dist/{chunk-KPFOAXRX.mjs.map → chunk-ZIEDTGZF.mjs.map} +0 -0
- package/dist/{langserve-4a5c9217.d.ts → langserve-fc5cac89.d.ts} +7 -7
package/dist/index.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CustomEventNames,
|
|
3
3
|
LangGraphAgent
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VVXCPFVN.mjs";
|
|
5
5
|
import {
|
|
6
6
|
config,
|
|
7
7
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
8
8
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CBVVBPVJ.mjs";
|
|
10
10
|
import {
|
|
11
11
|
copilotRuntimeNestEndpoint
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-B2BL6HPT.mjs";
|
|
13
13
|
import {
|
|
14
14
|
copilotRuntimeNodeExpressEndpoint
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ZIEDTGZF.mjs";
|
|
16
16
|
import {
|
|
17
17
|
CopilotRuntime,
|
|
18
18
|
addCustomHeaderPlugin,
|
|
@@ -28,7 +28,8 @@ import {
|
|
|
28
28
|
getCommonConfig,
|
|
29
29
|
langGraphPlatformEndpoint,
|
|
30
30
|
resolveEndpointType
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-NI7RVCMB.mjs";
|
|
32
|
+
import "./chunk-SHBDMA63.mjs";
|
|
32
33
|
import {
|
|
33
34
|
AnthropicAdapter,
|
|
34
35
|
BedrockAdapter,
|
|
@@ -42,13 +43,15 @@ import {
|
|
|
42
43
|
OpenAIAssistantAdapter,
|
|
43
44
|
RemoteChain,
|
|
44
45
|
UnifyAdapter
|
|
45
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-GS7DO47Q.mjs";
|
|
46
47
|
import {
|
|
47
48
|
GuardrailsValidationFailureResponse,
|
|
48
49
|
MessageStreamInterruptedResponse,
|
|
49
50
|
UnknownErrorResponse
|
|
50
|
-
} from "./chunk-
|
|
51
|
-
import
|
|
51
|
+
} from "./chunk-XWBDEXDA.mjs";
|
|
52
|
+
import {
|
|
53
|
+
convertServiceAdapterError
|
|
54
|
+
} from "./chunk-AMUJQ6IR.mjs";
|
|
52
55
|
import "./chunk-2OZAGFV3.mjs";
|
|
53
56
|
import "./chunk-FHD4JECV.mjs";
|
|
54
57
|
|
|
@@ -77,6 +80,7 @@ export {
|
|
|
77
80
|
buildSchema,
|
|
78
81
|
config,
|
|
79
82
|
convertMCPToolsToActions,
|
|
83
|
+
convertServiceAdapterError,
|
|
80
84
|
copilotKitEndpoint,
|
|
81
85
|
copilotRuntimeNestEndpoint,
|
|
82
86
|
copilotRuntimeNextJSAppRouterEndpoint,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import \"reflect-metadata\";\nexport * from \"./lib\";\nexport * from \"./utils\";\nexport * from \"./service-adapters\";\n"],"mappings":"
|
|
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":[]}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
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-
|
|
2
|
-
export { e as CommonConfig, C as CopilotRequestContextProperties, k as CopilotRuntime, j as CopilotRuntimeConstructorParams, f as CopilotRuntimeLogger, i as CopilotRuntimeRequest, b as CreateCopilotRuntimeServerOptions, G as GraphQLContext, L as LogLevel, o as MCPClient, p as MCPEndpointConfig, M as MCPTool, a as addCustomHeaderPlugin, d as buildSchema, s as convertMCPToolsToActions, m as copilotKitEndpoint, c as createContext, h as createLogger, q as extractParametersFromSchema, l as flattenToolCallsNoDuplicates, t as generateMcpToolInstructions, g as getCommonConfig, n as langGraphPlatformEndpoint, r as resolveEndpointType } from '../shared-
|
|
1
|
+
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-172a2ca4.js';
|
|
2
|
+
export { e as CommonConfig, C as CopilotRequestContextProperties, k as CopilotRuntime, j as CopilotRuntimeConstructorParams, f as CopilotRuntimeLogger, i as CopilotRuntimeRequest, b as CreateCopilotRuntimeServerOptions, G as GraphQLContext, L as LogLevel, o as MCPClient, p as MCPEndpointConfig, M as MCPTool, a as addCustomHeaderPlugin, d as buildSchema, s as convertMCPToolsToActions, m as copilotKitEndpoint, c as createContext, h as createLogger, q as extractParametersFromSchema, l as flattenToolCallsNoDuplicates, t as generateMcpToolInstructions, g as getCommonConfig, n as langGraphPlatformEndpoint, r as resolveEndpointType } from '../shared-4164c674.js';
|
|
3
3
|
export { CopilotRuntimeServerInstance, config, copilotRuntimeNextJSAppRouterEndpoint, copilotRuntimeNextJSPagesRouterEndpoint } from './integrations/index.js';
|
|
4
4
|
export { copilotRuntimeNodeHttpEndpoint } from './integrations/node-http/index.js';
|
|
5
5
|
export { copilotRuntimeNodeExpressEndpoint } from './integrations/node-express/index.js';
|
|
6
6
|
export { copilotRuntimeNestEndpoint } from './integrations/nest/index.js';
|
|
7
7
|
import * as rxjs from 'rxjs';
|
|
8
|
-
import { TextMessageStartEvent, TextMessageContentEvent, TextMessageEndEvent, ToolCallStartEvent, ToolCallArgsEvent, ToolCallEndEvent, RunAgentInput
|
|
9
|
-
import { LangGraphAgent as LangGraphAgent$1, LangGraphAgentConfig, ProcessedEvents } from '@ag-ui/langgraph';
|
|
8
|
+
import { TextMessageStartEvent, TextMessageContentEvent, TextMessageEndEvent, ToolCallStartEvent, ToolCallArgsEvent, ToolCallEndEvent, RunAgentInput } from '@ag-ui/client';
|
|
9
|
+
import { LangGraphAgent as LangGraphAgent$1, LangGraphAgentConfig, ProcessedEvents, SchemaKeys } from '@ag-ui/langgraph';
|
|
10
10
|
import { Message } from '@langchain/langgraph-sdk/dist/types.messages';
|
|
11
11
|
import 'openai';
|
|
12
|
-
import '../langserve-
|
|
12
|
+
import '../langserve-fc5cac89.js';
|
|
13
13
|
import '../index-d4614f9b.js';
|
|
14
14
|
import '../graphql/types/base/index.js';
|
|
15
15
|
import '@copilotkit/shared';
|
|
@@ -39,135 +39,9 @@ declare enum CustomEventNames {
|
|
|
39
39
|
declare class LangGraphAgent extends LangGraphAgent$1 {
|
|
40
40
|
constructor(config: LangGraphAgentConfig);
|
|
41
41
|
dispatchEvent(event: ProcessedEvents): boolean;
|
|
42
|
-
run(input: RunAgentInput): rxjs.Observable<
|
|
43
|
-
type: EventType.TEXT_MESSAGE_START;
|
|
44
|
-
role: "assistant";
|
|
45
|
-
messageId: string;
|
|
46
|
-
timestamp?: number | undefined;
|
|
47
|
-
rawEvent?: any;
|
|
48
|
-
} | {
|
|
49
|
-
type: EventType.TEXT_MESSAGE_CONTENT;
|
|
50
|
-
messageId: string;
|
|
51
|
-
delta: string;
|
|
52
|
-
timestamp?: number | undefined;
|
|
53
|
-
rawEvent?: any;
|
|
54
|
-
} | {
|
|
55
|
-
type: EventType.TEXT_MESSAGE_END;
|
|
56
|
-
messageId: string;
|
|
57
|
-
timestamp?: number | undefined;
|
|
58
|
-
rawEvent?: any;
|
|
59
|
-
} | {
|
|
60
|
-
type: EventType.TOOL_CALL_START;
|
|
61
|
-
toolCallId: string;
|
|
62
|
-
toolCallName: string;
|
|
63
|
-
timestamp?: number | undefined;
|
|
64
|
-
rawEvent?: any;
|
|
65
|
-
parentMessageId?: string | undefined;
|
|
66
|
-
} | {
|
|
67
|
-
type: EventType.TOOL_CALL_ARGS;
|
|
68
|
-
toolCallId: string;
|
|
69
|
-
delta: string;
|
|
70
|
-
timestamp?: number | undefined;
|
|
71
|
-
rawEvent?: any;
|
|
72
|
-
} | {
|
|
73
|
-
type: EventType.TOOL_CALL_END;
|
|
74
|
-
toolCallId: string;
|
|
75
|
-
timestamp?: number | undefined;
|
|
76
|
-
rawEvent?: any;
|
|
77
|
-
} | {
|
|
78
|
-
type: EventType.STATE_SNAPSHOT;
|
|
79
|
-
timestamp?: number | undefined;
|
|
80
|
-
rawEvent?: any;
|
|
81
|
-
snapshot?: any;
|
|
82
|
-
} | {
|
|
83
|
-
type: EventType.STATE_DELTA;
|
|
84
|
-
delta: any[];
|
|
85
|
-
timestamp?: number | undefined;
|
|
86
|
-
rawEvent?: any;
|
|
87
|
-
} | {
|
|
88
|
-
type: EventType.MESSAGES_SNAPSHOT;
|
|
89
|
-
messages: ({
|
|
90
|
-
id: string;
|
|
91
|
-
role: "developer";
|
|
92
|
-
content: string;
|
|
93
|
-
name?: string | undefined;
|
|
94
|
-
} | {
|
|
95
|
-
id: string;
|
|
96
|
-
role: "system";
|
|
97
|
-
content: string;
|
|
98
|
-
name?: string | undefined;
|
|
99
|
-
} | {
|
|
100
|
-
id: string;
|
|
101
|
-
role: "assistant";
|
|
102
|
-
name?: string | undefined;
|
|
103
|
-
content?: string | undefined;
|
|
104
|
-
toolCalls?: {
|
|
105
|
-
function: {
|
|
106
|
-
name: string;
|
|
107
|
-
arguments: string;
|
|
108
|
-
};
|
|
109
|
-
type: "function";
|
|
110
|
-
id: string;
|
|
111
|
-
}[] | undefined;
|
|
112
|
-
} | {
|
|
113
|
-
id: string;
|
|
114
|
-
role: "user";
|
|
115
|
-
content: string;
|
|
116
|
-
name?: string | undefined;
|
|
117
|
-
} | {
|
|
118
|
-
id: string;
|
|
119
|
-
role: "tool";
|
|
120
|
-
content: string;
|
|
121
|
-
toolCallId: string;
|
|
122
|
-
})[];
|
|
123
|
-
timestamp?: number | undefined;
|
|
124
|
-
rawEvent?: any;
|
|
125
|
-
} | {
|
|
126
|
-
type: EventType.RAW;
|
|
127
|
-
timestamp?: number | undefined;
|
|
128
|
-
rawEvent?: any;
|
|
129
|
-
event?: any;
|
|
130
|
-
source?: string | undefined;
|
|
131
|
-
} | {
|
|
132
|
-
name: string;
|
|
133
|
-
type: EventType.CUSTOM;
|
|
134
|
-
value?: any;
|
|
135
|
-
timestamp?: number | undefined;
|
|
136
|
-
rawEvent?: any;
|
|
137
|
-
} | {
|
|
138
|
-
type: EventType.RUN_STARTED;
|
|
139
|
-
threadId: string;
|
|
140
|
-
runId: string;
|
|
141
|
-
timestamp?: number | undefined;
|
|
142
|
-
rawEvent?: any;
|
|
143
|
-
} | {
|
|
144
|
-
type: EventType.RUN_FINISHED;
|
|
145
|
-
threadId: string;
|
|
146
|
-
runId: string;
|
|
147
|
-
timestamp?: number | undefined;
|
|
148
|
-
rawEvent?: any;
|
|
149
|
-
} | {
|
|
150
|
-
message: string;
|
|
151
|
-
type: EventType.RUN_ERROR;
|
|
152
|
-
code?: string | undefined;
|
|
153
|
-
timestamp?: number | undefined;
|
|
154
|
-
rawEvent?: any;
|
|
155
|
-
} | {
|
|
156
|
-
type: EventType.STEP_STARTED;
|
|
157
|
-
stepName: string;
|
|
158
|
-
timestamp?: number | undefined;
|
|
159
|
-
rawEvent?: any;
|
|
160
|
-
} | {
|
|
161
|
-
type: EventType.STEP_FINISHED;
|
|
162
|
-
stepName: string;
|
|
163
|
-
timestamp?: number | undefined;
|
|
164
|
-
rawEvent?: any;
|
|
165
|
-
} | {
|
|
166
|
-
type: EventType;
|
|
167
|
-
name: string;
|
|
168
|
-
value: any;
|
|
169
|
-
}>;
|
|
42
|
+
run(input: RunAgentInput): rxjs.Observable<any>;
|
|
170
43
|
langGraphDefaultMergeState(state: State, messages: Message[], tools: any): State;
|
|
44
|
+
getSchemaKeys(): Promise<SchemaKeys>;
|
|
171
45
|
}
|
|
172
46
|
|
|
173
47
|
export { CustomEventNames, LangGraphAgent, PredictStateTool, State, TextMessageEvents, ToolCallEvents };
|