@copilotkit/runtime 1.10.5-next.1 → 1.10.5-next.10
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 +61 -0
- package/dist/{chunk-C56AVUZI.mjs → chunk-COGFQ4V4.mjs} +2 -2
- package/dist/{chunk-T4NLPBCY.mjs → chunk-M65Z27MR.mjs} +2 -2
- package/dist/{chunk-FOXQPOXW.mjs → chunk-NFB4H6NT.mjs} +30 -11
- package/dist/chunk-NFB4H6NT.mjs.map +1 -0
- package/dist/{chunk-CX4GADTM.mjs → chunk-NNBTOZO3.mjs} +2 -2
- package/dist/{chunk-H6QUY5ZQ.mjs → chunk-Y5BKTUH2.mjs} +6 -2
- package/dist/{chunk-H6QUY5ZQ.mjs.map → chunk-Y5BKTUH2.mjs.map} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +33 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +33 -10
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +5 -5
- package/dist/lib/integrations/index.d.ts +2 -2
- package/dist/lib/integrations/index.js +10 -10
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +4 -4
- package/dist/lib/integrations/nest/index.d.ts +1 -1
- package/dist/lib/integrations/nest/index.js +10 -10
- package/dist/lib/integrations/nest/index.js.map +1 -1
- package/dist/lib/integrations/nest/index.mjs +2 -2
- package/dist/lib/integrations/node-express/index.d.ts +1 -1
- package/dist/lib/integrations/node-express/index.js +10 -10
- package/dist/lib/integrations/node-express/index.js.map +1 -1
- package/dist/lib/integrations/node-express/index.mjs +2 -2
- package/dist/lib/integrations/node-http/index.d.ts +1 -1
- package/dist/lib/integrations/node-http/index.js +10 -10
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +1 -1
- package/dist/{shared-35015e40.d.ts → shared-0a7346ce.d.ts} +10 -0
- package/package.json +11 -11
- package/src/lib/runtime/agui-action.ts +7 -0
- package/src/lib/runtime/copilot-runtime.ts +25 -0
- package/src/lib/runtime/langgraph/langgraph-agent.ts +1 -0
- package/dist/chunk-FOXQPOXW.mjs.map +0 -1
- /package/dist/{chunk-C56AVUZI.mjs.map → chunk-COGFQ4V4.mjs.map} +0 -0
- /package/dist/{chunk-T4NLPBCY.mjs.map → chunk-M65Z27MR.mjs.map} +0 -0
- /package/dist/{chunk-CX4GADTM.mjs.map → chunk-NNBTOZO3.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -2,18 +2,18 @@ import {
|
|
|
2
2
|
CustomEventNames,
|
|
3
3
|
LangGraphAgent,
|
|
4
4
|
LangGraphHttpAgent
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Y5BKTUH2.mjs";
|
|
6
6
|
import {
|
|
7
7
|
config,
|
|
8
8
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
9
9
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NNBTOZO3.mjs";
|
|
11
11
|
import {
|
|
12
12
|
copilotRuntimeNestEndpoint
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-M65Z27MR.mjs";
|
|
14
14
|
import {
|
|
15
15
|
copilotRuntimeNodeExpressEndpoint
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-COGFQ4V4.mjs";
|
|
17
17
|
import {
|
|
18
18
|
CopilotRuntime,
|
|
19
19
|
addCustomHeaderPlugin,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
getCommonConfig,
|
|
30
30
|
langGraphPlatformEndpoint,
|
|
31
31
|
resolveEndpointType
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-NFB4H6NT.mjs";
|
|
33
33
|
import "./chunk-SHBDMA63.mjs";
|
|
34
34
|
import {
|
|
35
35
|
AnthropicAdapter,
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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-c8aec5c5.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-
|
|
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-0a7346ce.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';
|
package/dist/lib/index.js
CHANGED
|
@@ -44,7 +44,7 @@ var require_package = __commonJS({
|
|
|
44
44
|
publishConfig: {
|
|
45
45
|
access: "public"
|
|
46
46
|
},
|
|
47
|
-
version: "1.10.5-next.
|
|
47
|
+
version: "1.10.5-next.10",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -82,11 +82,11 @@ var require_package = __commonJS({
|
|
|
82
82
|
"zod-to-json-schema": "^3.23.5"
|
|
83
83
|
},
|
|
84
84
|
dependencies: {
|
|
85
|
-
"@ag-ui/client": "^0.0.
|
|
86
|
-
"@ag-ui/core": "^0.0.
|
|
87
|
-
"@ag-ui/encoder": "^0.0.
|
|
88
|
-
"@ag-ui/langgraph": "^0.0.
|
|
89
|
-
"@ag-ui/proto": "^0.0.
|
|
85
|
+
"@ag-ui/client": "^0.0.39",
|
|
86
|
+
"@ag-ui/core": "^0.0.39",
|
|
87
|
+
"@ag-ui/encoder": "^0.0.39",
|
|
88
|
+
"@ag-ui/langgraph": "^0.0.17",
|
|
89
|
+
"@ag-ui/proto": "^0.0.39",
|
|
90
90
|
"@anthropic-ai/sdk": "^0.57.0",
|
|
91
91
|
"@copilotkit/shared": "workspace:*",
|
|
92
92
|
"@graphql-yoga/plugin-defer-stream": "^3.3.1",
|
|
@@ -115,10 +115,10 @@ var require_package = __commonJS({
|
|
|
115
115
|
zod: "^3.23.3"
|
|
116
116
|
},
|
|
117
117
|
peerDependencies: {
|
|
118
|
-
"@ag-ui/client": ">=0.0.
|
|
119
|
-
"@ag-ui/core": ">=0.0.
|
|
120
|
-
"@ag-ui/encoder": ">=0.0.
|
|
121
|
-
"@ag-ui/proto": ">=0.0.
|
|
118
|
+
"@ag-ui/client": ">=0.0.39",
|
|
119
|
+
"@ag-ui/core": ">=0.0.39",
|
|
120
|
+
"@ag-ui/encoder": ">=0.0.39",
|
|
121
|
+
"@ag-ui/proto": ">=0.0.39"
|
|
122
122
|
},
|
|
123
123
|
keywords: [
|
|
124
124
|
"copilotkit",
|
|
@@ -4339,6 +4339,7 @@ var CopilotRuntime = class {
|
|
|
4339
4339
|
langserve = [];
|
|
4340
4340
|
onBeforeRequest;
|
|
4341
4341
|
onAfterRequest;
|
|
4342
|
+
onStopGeneration;
|
|
4342
4343
|
delegateAgentProcessingToServiceAdapter;
|
|
4343
4344
|
observability;
|
|
4344
4345
|
availableAgents;
|
|
@@ -4366,6 +4367,7 @@ var CopilotRuntime = class {
|
|
|
4366
4367
|
this.remoteEndpointDefinitions = (params == null ? void 0 : params.remoteEndpoints) ?? (params == null ? void 0 : params.remoteActions) ?? [];
|
|
4367
4368
|
this.onBeforeRequest = (_a = params == null ? void 0 : params.middleware) == null ? void 0 : _a.onBeforeRequest;
|
|
4368
4369
|
this.onAfterRequest = (_b = params == null ? void 0 : params.middleware) == null ? void 0 : _b.onAfterRequest;
|
|
4370
|
+
this.onStopGeneration = params == null ? void 0 : params.onStopGeneration;
|
|
4369
4371
|
this.delegateAgentProcessingToServiceAdapter = (params == null ? void 0 : params.delegateAgentProcessingToServiceAdapter) || false;
|
|
4370
4372
|
this.observability = params == null ? void 0 : params.observability_c;
|
|
4371
4373
|
this.agents = (params == null ? void 0 : params.agents) ?? {};
|
|
@@ -4445,6 +4447,18 @@ var CopilotRuntime = class {
|
|
|
4445
4447
|
async processRuntimeRequest(request) {
|
|
4446
4448
|
var _a, _b, _c, _d, _e;
|
|
4447
4449
|
const { serviceAdapter, messages: rawMessages, actions: clientSideActionsInput, threadId, runId, outputMessagesPromise, graphqlContext, forwardedParameters, url, extensions, agentSession, agentStates, publicApiKey, context } = request;
|
|
4450
|
+
graphqlContext.request.signal.addEventListener("abort", () => {
|
|
4451
|
+
var _a2;
|
|
4452
|
+
return (_a2 = this.onStopGeneration) == null ? void 0 : _a2.call(this, {
|
|
4453
|
+
threadId,
|
|
4454
|
+
runId,
|
|
4455
|
+
url,
|
|
4456
|
+
agentName: agentSession == null ? void 0 : agentSession.agentName,
|
|
4457
|
+
lastMessage: rawMessages[rawMessages.length - 1]
|
|
4458
|
+
});
|
|
4459
|
+
}, {
|
|
4460
|
+
once: true
|
|
4461
|
+
});
|
|
4448
4462
|
const eventSource = new RuntimeEventSource({
|
|
4449
4463
|
errorHandler: async (error, context2) => {
|
|
4450
4464
|
await this.error("error", context2, error, publicApiKey);
|
|
@@ -5947,6 +5961,11 @@ function constructAGUIRemoteAction({ logger: logger2, messages, agentStates, age
|
|
|
5947
5961
|
},
|
|
5948
5962
|
remoteAgentHandler: async ({ actionInputsWithoutAgents, threadId }) => {
|
|
5949
5963
|
var _a;
|
|
5964
|
+
graphqlContext.request.signal.addEventListener("abort", () => {
|
|
5965
|
+
agent.abortRun();
|
|
5966
|
+
}, {
|
|
5967
|
+
once: true
|
|
5968
|
+
});
|
|
5950
5969
|
logger2.debug({
|
|
5951
5970
|
actionName: agent.agentId
|
|
5952
5971
|
}, "Executing remote agent");
|
|
@@ -7772,6 +7791,10 @@ var LangGraphAgent = class extends import_langgraph.LangGraphAgent {
|
|
|
7772
7791
|
output: schemaKeys.output ? [
|
|
7773
7792
|
...schemaKeys.output,
|
|
7774
7793
|
...CONSTANT_KEYS
|
|
7794
|
+
] : null,
|
|
7795
|
+
context: schemaKeys.context ? [
|
|
7796
|
+
...schemaKeys.context,
|
|
7797
|
+
...CONSTANT_KEYS
|
|
7775
7798
|
] : null
|
|
7776
7799
|
};
|
|
7777
7800
|
}
|