@copilotkit/runtime 1.5.20 → 1.6.0-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 +10 -0
- package/__snapshots__/schema/schema.graphql +1 -0
- package/dist/{chunk-BLOO7P5D.mjs → chunk-A4P5YLJQ.mjs} +2 -2
- package/dist/{chunk-YAEZPJTK.mjs → chunk-AMKPW7KT.mjs} +32 -14
- package/dist/chunk-AMKPW7KT.mjs.map +1 -0
- package/dist/{chunk-U4EZU7AQ.mjs → chunk-EYEJ5L3X.mjs} +2 -2
- package/dist/{chunk-HEILVP57.mjs → chunk-RGSZK24X.mjs} +2 -2
- package/dist/{copilot-runtime-084fb9c7.d.ts → copilot-runtime-67033bfa.d.ts} +1 -1
- package/dist/{groq-adapter-3b894689.d.ts → groq-adapter-9d15c927.d.ts} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +26 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -9
- package/dist/{langserve-3a591089.d.ts → langserve-7cc5be48.d.ts} +1 -0
- package/dist/lib/index.d.ts +3 -3
- package/dist/lib/index.js +26 -8
- 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 +8 -1
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +5 -5
- package/dist/lib/integrations/nest/index.d.ts +2 -2
- package/dist/lib/integrations/nest/index.js +8 -1
- package/dist/lib/integrations/nest/index.js.map +1 -1
- package/dist/lib/integrations/nest/index.mjs +3 -3
- package/dist/lib/integrations/node-express/index.d.ts +2 -2
- package/dist/lib/integrations/node-express/index.js +8 -1
- package/dist/lib/integrations/node-express/index.js.map +1 -1
- package/dist/lib/integrations/node-express/index.mjs +3 -3
- package/dist/lib/integrations/node-http/index.d.ts +2 -2
- package/dist/lib/integrations/node-http/index.js +8 -1
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +2 -2
- package/dist/service-adapters/index.d.ts +3 -3
- package/package.json +2 -2
- package/src/graphql/inputs/agent-state.input.ts +3 -0
- package/src/lib/runtime/remote-action-constructors.ts +10 -4
- package/src/lib/runtime/remote-lg-action.ts +5 -0
- package/dist/chunk-YAEZPJTK.mjs.map +0 -1
- /package/dist/{chunk-BLOO7P5D.mjs.map → chunk-A4P5YLJQ.mjs.map} +0 -0
- /package/dist/{chunk-U4EZU7AQ.mjs.map → chunk-EYEJ5L3X.mjs.map} +0 -0
- /package/dist/{chunk-HEILVP57.mjs.map → chunk-RGSZK24X.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
config,
|
|
4
4
|
copilotRuntimeNextJSAppRouterEndpoint,
|
|
5
5
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RGSZK24X.mjs";
|
|
7
7
|
import {
|
|
8
8
|
copilotRuntimeNestEndpoint
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-EYEJ5L3X.mjs";
|
|
10
10
|
import {
|
|
11
11
|
copilotRuntimeNodeExpressEndpoint
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-A4P5YLJQ.mjs";
|
|
13
13
|
import {
|
|
14
14
|
CopilotRuntime,
|
|
15
15
|
addCustomHeaderPlugin,
|
|
@@ -21,7 +21,12 @@ import {
|
|
|
21
21
|
getCommonConfig,
|
|
22
22
|
langGraphPlatformEndpoint,
|
|
23
23
|
resolveEndpointType
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-AMKPW7KT.mjs";
|
|
25
|
+
import {
|
|
26
|
+
GuardrailsValidationFailureResponse,
|
|
27
|
+
MessageStreamInterruptedResponse,
|
|
28
|
+
UnknownErrorResponse
|
|
29
|
+
} from "./chunk-5BIEM2UU.mjs";
|
|
25
30
|
import {
|
|
26
31
|
AnthropicAdapter,
|
|
27
32
|
EmptyAdapter,
|
|
@@ -35,11 +40,6 @@ import {
|
|
|
35
40
|
RemoteChain,
|
|
36
41
|
UnifyAdapter
|
|
37
42
|
} from "./chunk-OS5YD32G.mjs";
|
|
38
|
-
import {
|
|
39
|
-
GuardrailsValidationFailureResponse,
|
|
40
|
-
MessageStreamInterruptedResponse,
|
|
41
|
-
UnknownErrorResponse
|
|
42
|
-
} from "./chunk-5BIEM2UU.mjs";
|
|
43
43
|
import "./chunk-RTFJTJMA.mjs";
|
|
44
44
|
import "./chunk-2OZAGFV3.mjs";
|
|
45
45
|
import "./chunk-FHD4JECV.mjs";
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { i as CommonConfig, d as CopilotRequestContextProperties, a as CopilotRuntime, C as CopilotRuntimeConstructorParams, e as CreateCopilotRuntimeServerOptions, G as GraphQLContext, b as addCustomHeaderPlugin, h as buildSchema, c as copilotKitEndpoint, g as createContext, f as flattenToolCallsNoDuplicates, j as getCommonConfig, l as langGraphPlatformEndpoint, r as resolveEndpointType } from '../copilot-runtime-
|
|
2
|
-
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-
|
|
1
|
+
export { i as CommonConfig, d as CopilotRequestContextProperties, a as CopilotRuntime, C as CopilotRuntimeConstructorParams, e as CreateCopilotRuntimeServerOptions, G as GraphQLContext, b as addCustomHeaderPlugin, h as buildSchema, c as copilotKitEndpoint, g as createContext, f as flattenToolCallsNoDuplicates, j as getCommonConfig, l as langGraphPlatformEndpoint, r as resolveEndpointType } from '../copilot-runtime-67033bfa.js';
|
|
2
|
+
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-9d15c927.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';
|
|
6
6
|
export { copilotRuntimeNestEndpoint } from './integrations/nest/index.js';
|
|
7
7
|
import '@copilotkit/shared';
|
|
8
|
-
import '../langserve-
|
|
8
|
+
import '../langserve-7cc5be48.js';
|
|
9
9
|
import '../index-f6d1f30b.js';
|
|
10
10
|
import '../graphql/types/base/index.js';
|
|
11
11
|
import 'rxjs';
|
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.
|
|
47
|
+
version: "1.6.0-next.0",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -2145,7 +2145,7 @@ async function execute(args) {
|
|
|
2145
2145
|
__name(execute, "execute");
|
|
2146
2146
|
async function streamEvents(controller, args) {
|
|
2147
2147
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
2148
|
-
const { deploymentUrl, langsmithApiKey, threadId: argsInitialThreadId, agent, nodeName: initialNodeName, state: initialState, messages, actions, logger: logger2, properties, metaEvents } = args;
|
|
2148
|
+
const { deploymentUrl, langsmithApiKey, threadId: argsInitialThreadId, agent, nodeName: initialNodeName, state: initialState, configurable, messages, actions, logger: logger2, properties, metaEvents } = args;
|
|
2149
2149
|
let nodeName = initialNodeName;
|
|
2150
2150
|
let state = initialState;
|
|
2151
2151
|
const { name, assistantId: initialAssistantId } = agent;
|
|
@@ -2245,6 +2245,13 @@ async function streamEvents(controller, args) {
|
|
|
2245
2245
|
throw new Error("No agent id found");
|
|
2246
2246
|
}
|
|
2247
2247
|
const assistantId = retrievedAssistant.assistant_id;
|
|
2248
|
+
if (configurable) {
|
|
2249
|
+
await client.assistants.update(assistantId, {
|
|
2250
|
+
config: {
|
|
2251
|
+
configurable
|
|
2252
|
+
}
|
|
2253
|
+
});
|
|
2254
|
+
}
|
|
2248
2255
|
const graphInfo = await client.assistants.getGraph(assistantId);
|
|
2249
2256
|
let streamingStateExtractor = new StreamingStateExtractor([]);
|
|
2250
2257
|
let prevNodeName = null;
|
|
@@ -2660,7 +2667,6 @@ function constructLGCRemoteAction({ endpoint, graphqlContext, logger: logger2, m
|
|
|
2660
2667
|
handler: async (_args) => {
|
|
2661
2668
|
},
|
|
2662
2669
|
langGraphAgentHandler: async ({ name, actionInputsWithoutAgents, threadId, nodeName, additionalMessages = [], metaEvents }) => {
|
|
2663
|
-
var _a;
|
|
2664
2670
|
logger2.debug({
|
|
2665
2671
|
actionName: agent.name
|
|
2666
2672
|
}, "Executing LangGraph Platform agent");
|
|
@@ -2671,10 +2677,12 @@ function constructLGCRemoteAction({ endpoint, graphqlContext, logger: logger2, m
|
|
|
2671
2677
|
hashedLgcKey: (0, import_node_crypto2.createHash)("sha256").update(endpoint.langsmithApiKey).digest("hex")
|
|
2672
2678
|
});
|
|
2673
2679
|
let state = {};
|
|
2680
|
+
let configurable = {};
|
|
2674
2681
|
if (agentStates) {
|
|
2675
|
-
const jsonState =
|
|
2682
|
+
const jsonState = agentStates.find((state2) => state2.agentName === name);
|
|
2676
2683
|
if (jsonState) {
|
|
2677
|
-
state = JSON.parse(jsonState);
|
|
2684
|
+
state = JSON.parse(jsonState.state);
|
|
2685
|
+
configurable = JSON.parse(jsonState.configurable);
|
|
2678
2686
|
}
|
|
2679
2687
|
}
|
|
2680
2688
|
try {
|
|
@@ -2692,6 +2700,7 @@ function constructLGCRemoteAction({ endpoint, graphqlContext, logger: logger2, m
|
|
|
2692
2700
|
...additionalMessages
|
|
2693
2701
|
],
|
|
2694
2702
|
state,
|
|
2703
|
+
configurable,
|
|
2695
2704
|
properties: graphqlContext.properties,
|
|
2696
2705
|
actions: actionInputsWithoutAgents.map((action) => ({
|
|
2697
2706
|
name: action.name,
|
|
@@ -2788,7 +2797,6 @@ function constructRemoteActions({ json, url, onBeforeRequest, graphqlContext, lo
|
|
|
2788
2797
|
handler: async (_args) => {
|
|
2789
2798
|
},
|
|
2790
2799
|
langGraphAgentHandler: async ({ name, actionInputsWithoutAgents, threadId, nodeName, additionalMessages = [], metaEvents }) => {
|
|
2791
|
-
var _a;
|
|
2792
2800
|
logger2.debug({
|
|
2793
2801
|
actionName: agent.name
|
|
2794
2802
|
}, "Executing remote agent");
|
|
@@ -2799,10 +2807,12 @@ function constructRemoteActions({ json, url, onBeforeRequest, graphqlContext, lo
|
|
|
2799
2807
|
agentsAmount: json["agents"].length
|
|
2800
2808
|
});
|
|
2801
2809
|
let state = {};
|
|
2810
|
+
let configurable = {};
|
|
2802
2811
|
if (agentStates) {
|
|
2803
|
-
const jsonState =
|
|
2812
|
+
const jsonState = agentStates.find((state2) => state2.agentName === name);
|
|
2804
2813
|
if (jsonState) {
|
|
2805
|
-
state = JSON.parse(jsonState);
|
|
2814
|
+
state = JSON.parse(jsonState.state);
|
|
2815
|
+
configurable = JSON.parse(jsonState.configurable);
|
|
2806
2816
|
}
|
|
2807
2817
|
}
|
|
2808
2818
|
const fetchUrl = `${url}/agents/execute`;
|
|
@@ -2819,6 +2829,7 @@ function constructRemoteActions({ json, url, onBeforeRequest, graphqlContext, lo
|
|
|
2819
2829
|
...additionalMessages
|
|
2820
2830
|
],
|
|
2821
2831
|
state,
|
|
2832
|
+
configurable,
|
|
2822
2833
|
properties: graphqlContext.properties,
|
|
2823
2834
|
actions: actionInputsWithoutAgents.map((action) => ({
|
|
2824
2835
|
name: action.name,
|
|
@@ -4478,6 +4489,7 @@ __name(_ts_metadata14, "_ts_metadata");
|
|
|
4478
4489
|
var AgentStateInput = class {
|
|
4479
4490
|
agentName;
|
|
4480
4491
|
state;
|
|
4492
|
+
configurable;
|
|
4481
4493
|
};
|
|
4482
4494
|
__name(AgentStateInput, "AgentStateInput");
|
|
4483
4495
|
_ts_decorate14([
|
|
@@ -4488,6 +4500,12 @@ _ts_decorate14([
|
|
|
4488
4500
|
(0, import_type_graphql15.Field)(() => String),
|
|
4489
4501
|
_ts_metadata14("design:type", String)
|
|
4490
4502
|
], AgentStateInput.prototype, "state", void 0);
|
|
4503
|
+
_ts_decorate14([
|
|
4504
|
+
(0, import_type_graphql15.Field)(() => String, {
|
|
4505
|
+
nullable: true
|
|
4506
|
+
}),
|
|
4507
|
+
_ts_metadata14("design:type", String)
|
|
4508
|
+
], AgentStateInput.prototype, "configurable", void 0);
|
|
4491
4509
|
AgentStateInput = _ts_decorate14([
|
|
4492
4510
|
(0, import_type_graphql15.InputType)()
|
|
4493
4511
|
], AgentStateInput);
|