@copilotkit/runtime 1.9.1-next.0 → 1.9.2-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 +19 -0
- package/dist/{chunk-MKAQQQ7D.mjs → chunk-44FYLJJJ.mjs} +2 -2
- package/dist/{chunk-T3HIFVU2.mjs → chunk-ESXPDYNT.mjs} +2 -2
- package/dist/{chunk-32OC2CBT.mjs → chunk-O6KXX5R5.mjs} +2 -2
- package/dist/{chunk-YVZCIKZM.mjs → chunk-YMIOUUPV.mjs} +260 -61
- package/dist/chunk-YMIOUUPV.mjs.map +1 -0
- package/dist/{chunk-5CY2MEHT.mjs → chunk-YXL4PSJM.mjs} +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +305 -106
- 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 +298 -99
- 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 +16 -7
- 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 +16 -7
- 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 +16 -7
- 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 +16 -7
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +1 -1
- package/dist/{shared-0c31d7c5.d.ts → shared-e272b15a.d.ts} +1 -0
- package/package.json +2 -2
- package/src/agents/langgraph/event-source.ts +10 -1
- package/src/graphql/resolvers/copilot.resolver.ts +13 -0
- package/src/graphql/resolvers/state.resolver.ts +5 -7
- package/src/lib/runtime/copilot-runtime.ts +62 -6
- package/src/lib/runtime/remote-action-constructors.ts +37 -28
- package/src/lib/runtime/remote-lg-action.ts +45 -24
- package/src/lib/runtime/retry-utils.ts +96 -0
- package/src/lib/streaming.ts +54 -1
- package/src/service-adapters/events.ts +101 -6
- package/dist/chunk-YVZCIKZM.mjs.map +0 -1
- /package/dist/{chunk-MKAQQQ7D.mjs.map → chunk-44FYLJJJ.mjs.map} +0 -0
- /package/dist/{chunk-T3HIFVU2.mjs.map → chunk-ESXPDYNT.mjs.map} +0 -0
- /package/dist/{chunk-32OC2CBT.mjs.map → chunk-O6KXX5R5.mjs.map} +0 -0
- /package/dist/{chunk-5CY2MEHT.mjs.map → chunk-YXL4PSJM.mjs.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
copilotRuntimeNodeExpressEndpoint
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import "../../../chunk-
|
|
3
|
+
} from "../../../chunk-YXL4PSJM.mjs";
|
|
4
|
+
import "../../../chunk-YMIOUUPV.mjs";
|
|
5
5
|
import "../../../chunk-IIXJVVTV.mjs";
|
|
6
6
|
import "../../../chunk-5BIEM2UU.mjs";
|
|
7
7
|
import "../../../chunk-SHBDMA63.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as graphql_yoga from 'graphql-yoga';
|
|
2
|
-
import { b as CreateCopilotRuntimeServerOptions, G as GraphQLContext } from '../../../shared-
|
|
2
|
+
import { b as CreateCopilotRuntimeServerOptions, G as GraphQLContext } from '../../../shared-e272b15a.js';
|
|
3
3
|
import 'graphql';
|
|
4
4
|
import 'pino';
|
|
5
5
|
import '@copilotkit/shared';
|
|
@@ -44,7 +44,7 @@ var require_package = __commonJS({
|
|
|
44
44
|
publishConfig: {
|
|
45
45
|
access: "public"
|
|
46
46
|
},
|
|
47
|
-
version: "1.9.
|
|
47
|
+
version: "1.9.2-next.0",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -1995,6 +1995,7 @@ AgentsResponse = _ts_decorate18([
|
|
|
1995
1995
|
], AgentsResponse);
|
|
1996
1996
|
|
|
1997
1997
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
1998
|
+
var import_shared7 = require("@copilotkit/shared");
|
|
1998
1999
|
function _ts_decorate19(decorators, target, key, desc) {
|
|
1999
2000
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2000
2001
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -2486,6 +2487,12 @@ var CopilotResolver = class {
|
|
|
2486
2487
|
logger2.error({
|
|
2487
2488
|
err
|
|
2488
2489
|
}, "Error in event stream");
|
|
2490
|
+
if (err instanceof import_shared7.CopilotKitError || err instanceof Error && err.name && err.name.includes("CopilotKit")) {
|
|
2491
|
+
eventStreamSubscription == null ? void 0 : eventStreamSubscription.unsubscribe();
|
|
2492
|
+
rejectOutputMessagesPromise(err);
|
|
2493
|
+
stopStreamingMessages(err);
|
|
2494
|
+
return;
|
|
2495
|
+
}
|
|
2489
2496
|
responseStatus$.next(new UnknownErrorResponse({
|
|
2490
2497
|
description: `An unknown error has occurred in the event stream`
|
|
2491
2498
|
}));
|
|
@@ -2663,6 +2670,7 @@ LoadAgentStateInput = _ts_decorate21([
|
|
|
2663
2670
|
], LoadAgentStateInput);
|
|
2664
2671
|
|
|
2665
2672
|
// src/graphql/resolvers/state.resolver.ts
|
|
2673
|
+
var import_shared8 = require("@copilotkit/shared");
|
|
2666
2674
|
function _ts_decorate22(decorators, target, key, desc) {
|
|
2667
2675
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2668
2676
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -2690,12 +2698,13 @@ var StateResolver = class {
|
|
|
2690
2698
|
const agents = await ctx._copilotkit.runtime.discoverAgentsFromEndpoints(ctx);
|
|
2691
2699
|
const agent = agents.find((agent2) => agent2.name === data.agentName);
|
|
2692
2700
|
if (!agent) {
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2701
|
+
throw new import_shared8.CopilotKitAgentDiscoveryError({
|
|
2702
|
+
agentName: data.agentName,
|
|
2703
|
+
availableAgents: agents.map((a) => ({
|
|
2704
|
+
name: a.name,
|
|
2705
|
+
id: a.name
|
|
2706
|
+
}))
|
|
2707
|
+
});
|
|
2699
2708
|
}
|
|
2700
2709
|
const state = await ctx._copilotkit.runtime.loadAgentState(ctx, data.threadId, data.agentName);
|
|
2701
2710
|
return state;
|