@copilotkit/runtime 1.9.2-next.23 → 1.9.2-next.25
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 +16 -0
- package/dist/{chunk-ZQUGWRVU.mjs → chunk-3JXN25PL.mjs} +2 -2
- package/dist/{chunk-LYXJJDV3.mjs → chunk-BNLL5CH2.mjs} +2 -2
- package/dist/{chunk-C6PCDSTD.mjs → chunk-DOXGUQKL.mjs} +2 -2
- package/dist/{chunk-HZW6X63M.mjs → chunk-GJWXNXSA.mjs} +2 -2
- package/dist/{chunk-FIA5HRU2.mjs → chunk-YKYBGYYL.mjs} +81 -35
- package/dist/chunk-YKYBGYYL.mjs.map +1 -0
- package/dist/{groq-adapter-098f97f6.d.ts → groq-adapter-742818f2.d.ts} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +80 -34
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/{langserve-fc5cac89.d.ts → langserve-3e8d0e06.d.ts} +6 -0
- package/dist/lib/index.d.ts +155 -5
- package/dist/lib/index.js +80 -34
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +5 -5
- package/dist/lib/integrations/index.d.ts +3 -3
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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/service-adapters/index.d.ts +4 -4
- package/dist/{shared-6b6dbf8b.d.ts → shared-96b46379.d.ts} +1 -1
- package/package.json +11 -11
- package/src/lib/runtime/copilot-runtime.ts +32 -19
- package/src/service-adapters/events.ts +40 -1
- package/dist/chunk-FIA5HRU2.mjs.map +0 -1
- /package/dist/{chunk-ZQUGWRVU.mjs.map → chunk-3JXN25PL.mjs.map} +0 -0
- /package/dist/{chunk-LYXJJDV3.mjs.map → chunk-BNLL5CH2.mjs.map} +0 -0
- /package/dist/{chunk-C6PCDSTD.mjs.map → chunk-DOXGUQKL.mjs.map} +0 -0
- /package/dist/{chunk-HZW6X63M.mjs.map → chunk-GJWXNXSA.mjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @copilotkit/runtime
|
|
2
2
|
|
|
3
|
+
## 1.9.2-next.25
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f3f0181: - fix: connect streaming errors to runtime onError handler
|
|
8
|
+
- remove request logging
|
|
9
|
+
- f3f0181: - fix: connect streaming errors to runtime onError handler
|
|
10
|
+
- @copilotkit/shared@1.9.2-next.25
|
|
11
|
+
|
|
12
|
+
## 1.9.2-next.24
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 8ef8199: - fix: use latest agui dependencies to include required fixes
|
|
17
|
+
- @copilotkit/shared@1.9.2-next.24
|
|
18
|
+
|
|
3
19
|
## 1.9.2-next.23
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
copilotRuntimeNodeHttpEndpoint,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YKYBGYYL.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-FHD4JECV.mjs";
|
|
@@ -22,4 +22,4 @@ __name(copilotRuntimeNodeExpressEndpoint, "copilotRuntimeNodeExpressEndpoint");
|
|
|
22
22
|
export {
|
|
23
23
|
copilotRuntimeNodeExpressEndpoint
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-3JXN25PL.mjs.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
copilotRuntimeNodeHttpEndpoint,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YKYBGYYL.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-FHD4JECV.mjs";
|
|
@@ -22,4 +22,4 @@ __name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");
|
|
|
22
22
|
export {
|
|
23
23
|
copilotRuntimeNestEndpoint
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-BNLL5CH2.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LangGraphEventTypes
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YKYBGYYL.mjs";
|
|
4
4
|
import {
|
|
5
5
|
__name
|
|
6
6
|
} from "./chunk-FHD4JECV.mjs";
|
|
@@ -155,4 +155,4 @@ export {
|
|
|
155
155
|
CustomEventNames,
|
|
156
156
|
LangGraphAgent
|
|
157
157
|
};
|
|
158
|
-
//# sourceMappingURL=chunk-
|
|
158
|
+
//# sourceMappingURL=chunk-DOXGUQKL.mjs.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
getCommonConfig,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YKYBGYYL.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-FHD4JECV.mjs";
|
|
@@ -77,4 +77,4 @@ export {
|
|
|
77
77
|
config,
|
|
78
78
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-GJWXNXSA.mjs.map
|
|
@@ -40,7 +40,7 @@ var require_package = __commonJS({
|
|
|
40
40
|
publishConfig: {
|
|
41
41
|
access: "public"
|
|
42
42
|
},
|
|
43
|
-
version: "1.9.2-next.
|
|
43
|
+
version: "1.9.2-next.25",
|
|
44
44
|
sideEffects: false,
|
|
45
45
|
main: "./dist/index.js",
|
|
46
46
|
module: "./dist/index.mjs",
|
|
@@ -78,11 +78,11 @@ var require_package = __commonJS({
|
|
|
78
78
|
"zod-to-json-schema": "^3.23.5"
|
|
79
79
|
},
|
|
80
80
|
dependencies: {
|
|
81
|
-
"@ag-ui/client": "0.0.
|
|
82
|
-
"@ag-ui/core": "0.0.
|
|
83
|
-
"@ag-ui/encoder": "0.0.
|
|
84
|
-
"@ag-ui/langgraph": "0.0.
|
|
85
|
-
"@ag-ui/proto": "0.0.
|
|
81
|
+
"@ag-ui/client": "0.0.34",
|
|
82
|
+
"@ag-ui/core": "0.0.34",
|
|
83
|
+
"@ag-ui/encoder": "0.0.34",
|
|
84
|
+
"@ag-ui/langgraph": "0.0.6",
|
|
85
|
+
"@ag-ui/proto": "0.0.34",
|
|
86
86
|
"@anthropic-ai/sdk": "^0.27.3",
|
|
87
87
|
"@copilotkit/shared": "workspace:*",
|
|
88
88
|
"@graphql-yoga/plugin-defer-stream": "^3.3.1",
|
|
@@ -110,10 +110,10 @@ var require_package = __commonJS({
|
|
|
110
110
|
zod: "^3.23.3"
|
|
111
111
|
},
|
|
112
112
|
peerDependencies: {
|
|
113
|
-
"@ag-ui/client": ">=0.0.
|
|
114
|
-
"@ag-ui/core": ">=0.0.
|
|
115
|
-
"@ag-ui/encoder": ">=0.0.
|
|
116
|
-
"@ag-ui/proto": ">=0.0.
|
|
113
|
+
"@ag-ui/client": ">=0.0.34",
|
|
114
|
+
"@ag-ui/core": ">=0.0.34",
|
|
115
|
+
"@ag-ui/encoder": ">=0.0.34",
|
|
116
|
+
"@ag-ui/proto": ">=0.0.34"
|
|
117
117
|
},
|
|
118
118
|
keywords: [
|
|
119
119
|
"copilotkit",
|
|
@@ -2877,30 +2877,30 @@ var CopilotRuntime = class {
|
|
|
2877
2877
|
async processRuntimeRequest(request) {
|
|
2878
2878
|
var _a, _b, _c, _d, _e;
|
|
2879
2879
|
const { serviceAdapter, messages: rawMessages, actions: clientSideActionsInput, threadId, runId, outputMessagesPromise, graphqlContext, forwardedParameters, url, extensions, agentSession, agentStates, publicApiKey } = request;
|
|
2880
|
-
const eventSource = new RuntimeEventSource(
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
await this.error("request", {
|
|
2884
|
-
threadId,
|
|
2885
|
-
runId,
|
|
2886
|
-
source: "runtime",
|
|
2887
|
-
request: {
|
|
2888
|
-
operation: "processRuntimeRequest",
|
|
2889
|
-
method: "POST",
|
|
2890
|
-
url,
|
|
2891
|
-
startTime: requestStartTime
|
|
2892
|
-
},
|
|
2893
|
-
agent: agentSession ? {
|
|
2894
|
-
name: agentSession.agentName
|
|
2895
|
-
} : void 0,
|
|
2896
|
-
messages: {
|
|
2897
|
-
input: rawMessages,
|
|
2898
|
-
messageCount: rawMessages.length
|
|
2880
|
+
const eventSource = new RuntimeEventSource({
|
|
2881
|
+
errorHandler: async (error, context) => {
|
|
2882
|
+
await this.error("error", context, error, publicApiKey);
|
|
2899
2883
|
},
|
|
2900
|
-
|
|
2901
|
-
|
|
2884
|
+
errorContext: {
|
|
2885
|
+
threadId,
|
|
2886
|
+
runId,
|
|
2887
|
+
source: "runtime",
|
|
2888
|
+
request: {
|
|
2889
|
+
operation: "processRuntimeRequest",
|
|
2890
|
+
method: "POST",
|
|
2891
|
+
url,
|
|
2892
|
+
startTime: Date.now()
|
|
2893
|
+
},
|
|
2894
|
+
agent: agentSession ? {
|
|
2895
|
+
name: agentSession.agentName
|
|
2896
|
+
} : void 0,
|
|
2897
|
+
technical: {
|
|
2898
|
+
environment: process.env.NODE_ENV
|
|
2899
|
+
}
|
|
2902
2900
|
}
|
|
2903
|
-
}
|
|
2901
|
+
});
|
|
2902
|
+
const requestStartTime = Date.now();
|
|
2903
|
+
const streamedChunks = [];
|
|
2904
2904
|
try {
|
|
2905
2905
|
if (Object.keys(this.agents).length && (agentSession == null ? void 0 : agentSession.agentName) && !this.delegateAgentProcessingToServiceAdapter) {
|
|
2906
2906
|
this.agents = {
|
|
@@ -3392,7 +3392,27 @@ please use an LLM adapter instead.`
|
|
|
3392
3392
|
properties: graphqlContext.properties
|
|
3393
3393
|
}));
|
|
3394
3394
|
try {
|
|
3395
|
-
const eventSource = new RuntimeEventSource(
|
|
3395
|
+
const eventSource = new RuntimeEventSource({
|
|
3396
|
+
errorHandler: async (error, context) => {
|
|
3397
|
+
await this.error("error", context, error, publicApiKey);
|
|
3398
|
+
},
|
|
3399
|
+
errorContext: {
|
|
3400
|
+
threadId,
|
|
3401
|
+
source: "agent",
|
|
3402
|
+
request: {
|
|
3403
|
+
operation: "processAgentRequest",
|
|
3404
|
+
method: "POST",
|
|
3405
|
+
startTime: requestStartTime
|
|
3406
|
+
},
|
|
3407
|
+
agent: {
|
|
3408
|
+
name: agentName,
|
|
3409
|
+
nodeName
|
|
3410
|
+
},
|
|
3411
|
+
technical: {
|
|
3412
|
+
environment: process.env.NODE_ENV
|
|
3413
|
+
}
|
|
3414
|
+
}
|
|
3415
|
+
});
|
|
3396
3416
|
const stream = await currentAgent.remoteAgentHandler({
|
|
3397
3417
|
name: agentName,
|
|
3398
3418
|
threadId,
|
|
@@ -4693,6 +4713,12 @@ __name(RuntimeEventSubject, "RuntimeEventSubject");
|
|
|
4693
4713
|
var RuntimeEventSource = class {
|
|
4694
4714
|
eventStream$ = new RuntimeEventSubject();
|
|
4695
4715
|
callback;
|
|
4716
|
+
errorHandler;
|
|
4717
|
+
errorContext;
|
|
4718
|
+
constructor(params) {
|
|
4719
|
+
this.errorHandler = params == null ? void 0 : params.errorHandler;
|
|
4720
|
+
this.errorContext = params == null ? void 0 : params.errorContext;
|
|
4721
|
+
}
|
|
4696
4722
|
async stream(callback) {
|
|
4697
4723
|
this.callback = callback;
|
|
4698
4724
|
}
|
|
@@ -4707,8 +4733,15 @@ var RuntimeEventSource = class {
|
|
|
4707
4733
|
}
|
|
4708
4734
|
}
|
|
4709
4735
|
processRuntimeEvents({ serverSideActions, guardrailsResult$, actionInputsWithoutAgents, threadId }) {
|
|
4710
|
-
this.callback(this.eventStream$).catch((error) => {
|
|
4736
|
+
this.callback(this.eventStream$).catch(async (error) => {
|
|
4711
4737
|
const structuredError = ensureStructuredError3(error, convertStreamingErrorToStructured2);
|
|
4738
|
+
if (this.errorHandler && this.errorContext) {
|
|
4739
|
+
try {
|
|
4740
|
+
await this.errorHandler(structuredError, this.errorContext);
|
|
4741
|
+
} catch (errorHandlerError) {
|
|
4742
|
+
console.error("Error in streaming error handler:", errorHandlerError);
|
|
4743
|
+
}
|
|
4744
|
+
}
|
|
4712
4745
|
this.eventStream$.error(structuredError);
|
|
4713
4746
|
this.eventStream$.complete();
|
|
4714
4747
|
});
|
|
@@ -4747,6 +4780,19 @@ var RuntimeEventSource = class {
|
|
|
4747
4780
|
telemetry_client_default.capture("oss.runtime.server_action_executed", {});
|
|
4748
4781
|
return concat(of(eventWithState.event), toolCallEventStream$).pipe(catchError2((error) => {
|
|
4749
4782
|
const structuredError = ensureStructuredError3(error, convertStreamingErrorToStructured2);
|
|
4783
|
+
if (this.errorHandler && this.errorContext) {
|
|
4784
|
+
from2(this.errorHandler(structuredError, {
|
|
4785
|
+
...this.errorContext,
|
|
4786
|
+
action: {
|
|
4787
|
+
name: eventWithState.action.name,
|
|
4788
|
+
executionId: eventWithState.actionExecutionId
|
|
4789
|
+
}
|
|
4790
|
+
})).subscribe({
|
|
4791
|
+
error: (errorHandlerError) => {
|
|
4792
|
+
console.error("Error in action execution error handler:", errorHandlerError);
|
|
4793
|
+
}
|
|
4794
|
+
});
|
|
4795
|
+
}
|
|
4750
4796
|
toolCallEventStream$.sendActionExecutionResult({
|
|
4751
4797
|
actionExecutionId: eventWithState.actionExecutionId,
|
|
4752
4798
|
actionName: eventWithState.action.name,
|
|
@@ -5863,4 +5909,4 @@ export {
|
|
|
5863
5909
|
getCommonConfig,
|
|
5864
5910
|
copilotRuntimeNodeHttpEndpoint
|
|
5865
5911
|
};
|
|
5866
|
-
//# sourceMappingURL=chunk-
|
|
5912
|
+
//# sourceMappingURL=chunk-YKYBGYYL.mjs.map
|