@copilotkit/runtime 1.9.1 → 1.9.2-next.1
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-2CND6WGV.mjs → chunk-C3SWOFLO.mjs} +2 -2
- package/dist/{chunk-EVF3MXEK.mjs → chunk-KPFOAXRX.mjs} +2 -2
- package/dist/{chunk-RVLXQ2V5.mjs → chunk-RIPQZJB5.mjs} +2 -2
- package/dist/{chunk-GOPTDPPB.mjs → chunk-XGBY45FP.mjs} +265 -61
- package/dist/chunk-XGBY45FP.mjs.map +1 -0
- package/dist/{chunk-BHNTR222.mjs → chunk-YV3YXRMR.mjs} +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +310 -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 +303 -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 +70 -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-GOPTDPPB.mjs.map +0 -1
- /package/dist/{chunk-2CND6WGV.mjs.map → chunk-C3SWOFLO.mjs.map} +0 -0
- /package/dist/{chunk-EVF3MXEK.mjs.map → chunk-KPFOAXRX.mjs.map} +0 -0
- /package/dist/{chunk-RVLXQ2V5.mjs.map → chunk-RIPQZJB5.mjs.map} +0 -0
- /package/dist/{chunk-BHNTR222.mjs.map → chunk-YV3YXRMR.mjs.map} +0 -0
|
@@ -2,20 +2,20 @@ import {
|
|
|
2
2
|
config,
|
|
3
3
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
4
4
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-RIPQZJB5.mjs";
|
|
6
6
|
import {
|
|
7
7
|
copilotRuntimeNestEndpoint
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-C3SWOFLO.mjs";
|
|
9
9
|
import {
|
|
10
10
|
copilotRuntimeNodeExpressEndpoint
|
|
11
|
-
} from "../../chunk-
|
|
11
|
+
} from "../../chunk-KPFOAXRX.mjs";
|
|
12
12
|
import {
|
|
13
13
|
addCustomHeaderPlugin,
|
|
14
14
|
buildSchema,
|
|
15
15
|
copilotRuntimeNodeHttpEndpoint,
|
|
16
16
|
createContext,
|
|
17
17
|
getCommonConfig
|
|
18
|
-
} from "../../chunk-
|
|
18
|
+
} from "../../chunk-XGBY45FP.mjs";
|
|
19
19
|
import "../../chunk-IIXJVVTV.mjs";
|
|
20
20
|
import "../../chunk-5BIEM2UU.mjs";
|
|
21
21
|
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.1",
|
|
47
|
+
version: "1.9.2-next.1",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -1997,6 +1997,7 @@ AgentsResponse = _ts_decorate18([
|
|
|
1997
1997
|
], AgentsResponse);
|
|
1998
1998
|
|
|
1999
1999
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
2000
|
+
var import_shared7 = require("@copilotkit/shared");
|
|
2000
2001
|
function _ts_decorate19(decorators, target, key, desc) {
|
|
2001
2002
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2002
2003
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -2488,6 +2489,12 @@ var CopilotResolver = class {
|
|
|
2488
2489
|
logger2.error({
|
|
2489
2490
|
err
|
|
2490
2491
|
}, "Error in event stream");
|
|
2492
|
+
if (err instanceof import_shared7.CopilotKitError || err instanceof Error && err.name && err.name.includes("CopilotKit")) {
|
|
2493
|
+
eventStreamSubscription == null ? void 0 : eventStreamSubscription.unsubscribe();
|
|
2494
|
+
rejectOutputMessagesPromise(err);
|
|
2495
|
+
stopStreamingMessages(err);
|
|
2496
|
+
return;
|
|
2497
|
+
}
|
|
2491
2498
|
responseStatus$.next(new UnknownErrorResponse({
|
|
2492
2499
|
description: `An unknown error has occurred in the event stream`
|
|
2493
2500
|
}));
|
|
@@ -2665,6 +2672,7 @@ LoadAgentStateInput = _ts_decorate21([
|
|
|
2665
2672
|
], LoadAgentStateInput);
|
|
2666
2673
|
|
|
2667
2674
|
// src/graphql/resolvers/state.resolver.ts
|
|
2675
|
+
var import_shared8 = require("@copilotkit/shared");
|
|
2668
2676
|
function _ts_decorate22(decorators, target, key, desc) {
|
|
2669
2677
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2670
2678
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -2692,12 +2700,13 @@ var StateResolver = class {
|
|
|
2692
2700
|
const agents = await ctx._copilotkit.runtime.discoverAgentsFromEndpoints(ctx);
|
|
2693
2701
|
const agent = agents.find((agent2) => agent2.name === data.agentName);
|
|
2694
2702
|
if (!agent) {
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2703
|
+
throw new import_shared8.CopilotKitAgentDiscoveryError({
|
|
2704
|
+
agentName: data.agentName,
|
|
2705
|
+
availableAgents: agents.map((a) => ({
|
|
2706
|
+
name: a.name,
|
|
2707
|
+
id: a.name
|
|
2708
|
+
}))
|
|
2709
|
+
});
|
|
2701
2710
|
}
|
|
2702
2711
|
const state = await ctx._copilotkit.runtime.loadAgentState(ctx, data.threadId, data.agentName);
|
|
2703
2712
|
return state;
|