@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
package/dist/lib/index.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CustomEventNames,
|
|
3
3
|
LangGraphAgent
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-YV3YXRMR.mjs";
|
|
5
5
|
import {
|
|
6
6
|
config,
|
|
7
7
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
8
8
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-RIPQZJB5.mjs";
|
|
10
10
|
import {
|
|
11
11
|
copilotRuntimeNestEndpoint
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-C3SWOFLO.mjs";
|
|
13
13
|
import {
|
|
14
14
|
copilotRuntimeNodeExpressEndpoint
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-KPFOAXRX.mjs";
|
|
16
16
|
import {
|
|
17
17
|
CopilotRuntime,
|
|
18
18
|
addCustomHeaderPlugin,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
getCommonConfig,
|
|
29
29
|
langGraphPlatformEndpoint,
|
|
30
30
|
resolveEndpointType
|
|
31
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-XGBY45FP.mjs";
|
|
32
32
|
import {
|
|
33
33
|
GoogleGenerativeAIAdapter,
|
|
34
34
|
GroqAdapter,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as CreateCopilotRuntimeServerOptions, G as GraphQLContext } from '../../shared-
|
|
2
|
-
export { e as CommonConfig, C as CopilotRequestContextProperties, a as addCustomHeaderPlugin, d as buildSchema, c as createContext, g as getCommonConfig } from '../../shared-
|
|
1
|
+
import { b as CreateCopilotRuntimeServerOptions, G as GraphQLContext } from '../../shared-e272b15a.js';
|
|
2
|
+
export { e as CommonConfig, C as CopilotRequestContextProperties, a as addCustomHeaderPlugin, d as buildSchema, c as createContext, g as getCommonConfig } from '../../shared-e272b15a.js';
|
|
3
3
|
import * as graphql_yoga from 'graphql-yoga';
|
|
4
4
|
import { YogaServerInstance } from 'graphql-yoga';
|
|
5
5
|
export { copilotRuntimeNodeHttpEndpoint } from './node-http/index.js';
|
|
@@ -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",
|
|
@@ -2003,6 +2003,7 @@ AgentsResponse = _ts_decorate18([
|
|
|
2003
2003
|
], AgentsResponse);
|
|
2004
2004
|
|
|
2005
2005
|
// src/graphql/resolvers/copilot.resolver.ts
|
|
2006
|
+
var import_shared7 = require("@copilotkit/shared");
|
|
2006
2007
|
function _ts_decorate19(decorators, target, key, desc) {
|
|
2007
2008
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2008
2009
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -2494,6 +2495,12 @@ var CopilotResolver = class {
|
|
|
2494
2495
|
logger2.error({
|
|
2495
2496
|
err
|
|
2496
2497
|
}, "Error in event stream");
|
|
2498
|
+
if (err instanceof import_shared7.CopilotKitError || err instanceof Error && err.name && err.name.includes("CopilotKit")) {
|
|
2499
|
+
eventStreamSubscription == null ? void 0 : eventStreamSubscription.unsubscribe();
|
|
2500
|
+
rejectOutputMessagesPromise(err);
|
|
2501
|
+
stopStreamingMessages(err);
|
|
2502
|
+
return;
|
|
2503
|
+
}
|
|
2497
2504
|
responseStatus$.next(new UnknownErrorResponse({
|
|
2498
2505
|
description: `An unknown error has occurred in the event stream`
|
|
2499
2506
|
}));
|
|
@@ -2671,6 +2678,7 @@ LoadAgentStateInput = _ts_decorate21([
|
|
|
2671
2678
|
], LoadAgentStateInput);
|
|
2672
2679
|
|
|
2673
2680
|
// src/graphql/resolvers/state.resolver.ts
|
|
2681
|
+
var import_shared8 = require("@copilotkit/shared");
|
|
2674
2682
|
function _ts_decorate22(decorators, target, key, desc) {
|
|
2675
2683
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2676
2684
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -2698,12 +2706,13 @@ var StateResolver = class {
|
|
|
2698
2706
|
const agents = await ctx._copilotkit.runtime.discoverAgentsFromEndpoints(ctx);
|
|
2699
2707
|
const agent = agents.find((agent2) => agent2.name === data.agentName);
|
|
2700
2708
|
if (!agent) {
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2709
|
+
throw new import_shared8.CopilotKitAgentDiscoveryError({
|
|
2710
|
+
agentName: data.agentName,
|
|
2711
|
+
availableAgents: agents.map((a) => ({
|
|
2712
|
+
name: a.name,
|
|
2713
|
+
id: a.name
|
|
2714
|
+
}))
|
|
2715
|
+
});
|
|
2707
2716
|
}
|
|
2708
2717
|
const state = await ctx._copilotkit.runtime.loadAgentState(ctx, data.threadId, data.agentName);
|
|
2709
2718
|
return state;
|