@copilotkit/runtime 1.8.9 → 1.8.10-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 +8 -0
- package/__snapshots__/schema/schema.graphql +1 -1
- package/dist/{chunk-4KLOSPKW.mjs → chunk-2ICQTCH3.mjs} +34 -17
- package/dist/chunk-2ICQTCH3.mjs.map +1 -0
- package/dist/{chunk-W7BXDLO4.mjs → chunk-F2DLMRBK.mjs} +2 -2
- package/dist/{chunk-JXLF6SJU.mjs → chunk-MSBLW6TU.mjs} +2 -2
- package/dist/{chunk-75TKODO4.mjs → chunk-PRF2YJTA.mjs} +2 -2
- package/dist/{groq-adapter-53d3fa48.d.ts → groq-adapter-4848f8e8.d.ts} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +33 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/{langserve-c9a20fe9.d.ts → langserve-4a5c9217.d.ts} +1 -1
- package/dist/lib/index.d.ts +3 -3
- package/dist/lib/index.js +33 -16
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +4 -4
- package/dist/lib/integrations/index.d.ts +3 -3
- package/dist/lib/integrations/index.js +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- package/dist/{shared-df478d34.d.ts → shared-a7b30781.d.ts} +1 -1
- package/package.json +2 -2
- package/src/graphql/inputs/agent-state.input.ts +1 -1
- package/src/lib/runtime/remote-action-constructors.ts +6 -6
- package/src/lib/runtime/remote-lg-action.ts +39 -7
- package/dist/chunk-4KLOSPKW.mjs.map +0 -1
- /package/dist/{chunk-W7BXDLO4.mjs.map → chunk-F2DLMRBK.mjs.map} +0 -0
- /package/dist/{chunk-JXLF6SJU.mjs.map → chunk-MSBLW6TU.mjs.map} +0 -0
- /package/dist/{chunk-75TKODO4.mjs.map → chunk-PRF2YJTA.mjs.map} +0 -0
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
copilotRuntimeNodeHttpEndpoint,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2ICQTCH3.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-F2DLMRBK.mjs.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
getCommonConfig,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2ICQTCH3.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-MSBLW6TU.mjs.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
copilotRuntimeNodeHttpEndpoint,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2ICQTCH3.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-PRF2YJTA.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import OpenAI from 'openai';
|
|
2
|
-
import { b as CopilotServiceAdapter, C as CopilotRuntimeChatCompletionRequest, a as CopilotRuntimeChatCompletionResponse } from './langserve-
|
|
2
|
+
import { b as CopilotServiceAdapter, C as CopilotRuntimeChatCompletionRequest, a as CopilotRuntimeChatCompletionResponse } from './langserve-4a5c9217.js';
|
|
3
3
|
import { BaseMessageChunk, AIMessage, AIMessageChunk, BaseMessage } from '@langchain/core/messages';
|
|
4
4
|
import { DynamicStructuredTool } from '@langchain/core/tools';
|
|
5
5
|
import { IterableReadableStream, IterableReadableStreamInterface } from '@langchain/core/utils/stream';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
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-
|
|
2
|
-
export { e as CommonConfig, C as CopilotRequestContextProperties, k as CopilotRuntime, j as CopilotRuntimeConstructorParams, f as CopilotRuntimeLogger, i as CopilotRuntimeRequest, b as CreateCopilotRuntimeServerOptions, G as GraphQLContext, L as LogLevel, o as MCPClient, p as MCPEndpointConfig, M as MCPTool, a as addCustomHeaderPlugin, d as buildSchema, s as convertMCPToolsToActions, m as copilotKitEndpoint, c as createContext, h as createLogger, q as extractParametersFromSchema, l as flattenToolCallsNoDuplicates, t as generateMcpToolInstructions, g as getCommonConfig, n as langGraphPlatformEndpoint, r as resolveEndpointType } from './shared-
|
|
1
|
+
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-4848f8e8.js';
|
|
2
|
+
export { e as CommonConfig, C as CopilotRequestContextProperties, k as CopilotRuntime, j as CopilotRuntimeConstructorParams, f as CopilotRuntimeLogger, i as CopilotRuntimeRequest, b as CreateCopilotRuntimeServerOptions, G as GraphQLContext, L as LogLevel, o as MCPClient, p as MCPEndpointConfig, M as MCPTool, a as addCustomHeaderPlugin, d as buildSchema, s as convertMCPToolsToActions, m as copilotKitEndpoint, c as createContext, h as createLogger, q as extractParametersFromSchema, l as flattenToolCallsNoDuplicates, t as generateMcpToolInstructions, g as getCommonConfig, n as langGraphPlatformEndpoint, r as resolveEndpointType } from './shared-a7b30781.js';
|
|
3
3
|
export { CopilotRuntimeServerInstance, config, copilotRuntimeNextJSAppRouterEndpoint, copilotRuntimeNextJSPagesRouterEndpoint } from './lib/integrations/index.js';
|
|
4
4
|
export { copilotRuntimeNodeHttpEndpoint } from './lib/integrations/node-http/index.js';
|
|
5
5
|
export { copilotRuntimeNodeExpressEndpoint } from './lib/integrations/node-express/index.js';
|
|
6
6
|
export { copilotRuntimeNestEndpoint } from './lib/integrations/nest/index.js';
|
|
7
7
|
export { GuardrailsValidationFailureResponse, MessageStreamInterruptedResponse, UnknownErrorResponse } from './utils/index.js';
|
|
8
|
-
export { C as CopilotRuntimeChatCompletionRequest, a as CopilotRuntimeChatCompletionResponse, b as CopilotServiceAdapter, c as RemoteChain, R as RemoteChainParameters } from './langserve-
|
|
8
|
+
export { C as CopilotRuntimeChatCompletionRequest, a as CopilotRuntimeChatCompletionResponse, b as CopilotServiceAdapter, c as RemoteChain, R as RemoteChainParameters } from './langserve-4a5c9217.js';
|
|
9
9
|
export { AnthropicAdapter, AnthropicAdapterParams, EmptyAdapter, ExperimentalEmptyAdapter, ExperimentalOllamaAdapter } from './service-adapters/index.js';
|
|
10
10
|
import 'openai';
|
|
11
11
|
import '@langchain/core/messages';
|
package/dist/index.js
CHANGED
|
@@ -44,7 +44,7 @@ var require_package = __commonJS({
|
|
|
44
44
|
publishConfig: {
|
|
45
45
|
access: "public"
|
|
46
46
|
},
|
|
47
|
-
version: "1.8.
|
|
47
|
+
version: "1.8.10-next.0",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -1817,7 +1817,7 @@ __name(_ts_metadata9, "_ts_metadata");
|
|
|
1817
1817
|
var AgentStateInput = class {
|
|
1818
1818
|
agentName;
|
|
1819
1819
|
state;
|
|
1820
|
-
|
|
1820
|
+
config;
|
|
1821
1821
|
};
|
|
1822
1822
|
__name(AgentStateInput, "AgentStateInput");
|
|
1823
1823
|
_ts_decorate9([
|
|
@@ -1833,7 +1833,7 @@ _ts_decorate9([
|
|
|
1833
1833
|
nullable: true
|
|
1834
1834
|
}),
|
|
1835
1835
|
_ts_metadata9("design:type", String)
|
|
1836
|
-
], AgentStateInput.prototype, "
|
|
1836
|
+
], AgentStateInput.prototype, "config", void 0);
|
|
1837
1837
|
AgentStateInput = _ts_decorate9([
|
|
1838
1838
|
(0, import_type_graphql10.InputType)()
|
|
1839
1839
|
], AgentStateInput);
|
|
@@ -3011,7 +3011,7 @@ async function execute(args) {
|
|
|
3011
3011
|
__name(execute, "execute");
|
|
3012
3012
|
async function streamEvents(controller, args) {
|
|
3013
3013
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
3014
|
-
const { deploymentUrl, langsmithApiKey, threadId: argsInitialThreadId, agent, nodeName: initialNodeName, state: initialState,
|
|
3014
|
+
const { deploymentUrl, langsmithApiKey, threadId: argsInitialThreadId, agent, nodeName: initialNodeName, state: initialState, config: explicitConfig, messages, actions, logger: logger2, properties, metaEvents } = args;
|
|
3015
3015
|
let nodeName = initialNodeName;
|
|
3016
3016
|
let state = initialState;
|
|
3017
3017
|
const { name, assistantId: initialAssistantId } = agent;
|
|
@@ -3108,13 +3108,30 @@ async function streamEvents(controller, args) {
|
|
|
3108
3108
|
const graphInfo = await client.assistants.getGraph(assistantId);
|
|
3109
3109
|
const graphSchema = await client.assistants.getSchemas(assistantId);
|
|
3110
3110
|
const schemaKeys = getSchemaKeys(graphSchema);
|
|
3111
|
-
if (
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
config:
|
|
3115
|
-
|
|
3116
|
-
|
|
3111
|
+
if (explicitConfig) {
|
|
3112
|
+
let filteredConfigurable = retrievedAssistant.config.configurable;
|
|
3113
|
+
if (explicitConfig.configurable) {
|
|
3114
|
+
filteredConfigurable = (schemaKeys == null ? void 0 : schemaKeys.config) ? filterObjectBySchemaKeys(explicitConfig == null ? void 0 : explicitConfig.configurable, schemaKeys == null ? void 0 : schemaKeys.config) : explicitConfig == null ? void 0 : explicitConfig.configurable;
|
|
3115
|
+
}
|
|
3116
|
+
const newConfig = {
|
|
3117
|
+
...retrievedAssistant.config,
|
|
3118
|
+
...explicitConfig,
|
|
3119
|
+
configurable: filteredConfigurable
|
|
3120
|
+
};
|
|
3121
|
+
const isRecursionLimitSetToDefault = retrievedAssistant.config.recursion_limit == null && explicitConfig.recursion_limit === 25;
|
|
3122
|
+
const configsAreDifferent = JSON.stringify(newConfig) !== JSON.stringify(retrievedAssistant.config);
|
|
3123
|
+
const isOnlyRecursionLimitDifferent = isRecursionLimitSetToDefault && JSON.stringify({
|
|
3124
|
+
...newConfig,
|
|
3125
|
+
recursion_limit: null
|
|
3126
|
+
}) === JSON.stringify({
|
|
3127
|
+
...retrievedAssistant.config,
|
|
3128
|
+
recursion_limit: null
|
|
3117
3129
|
});
|
|
3130
|
+
if (configsAreDifferent && !isOnlyRecursionLimitDifferent) {
|
|
3131
|
+
await client.assistants.update(assistantId, {
|
|
3132
|
+
config: newConfig
|
|
3133
|
+
});
|
|
3134
|
+
}
|
|
3118
3135
|
}
|
|
3119
3136
|
if (payload.input && (schemaKeys == null ? void 0 : schemaKeys.input)) {
|
|
3120
3137
|
payload.input = filterObjectBySchemaKeys(payload.input, schemaKeys.input);
|
|
@@ -3655,12 +3672,12 @@ function constructLGCRemoteAction({ endpoint, graphqlContext, logger: logger2, m
|
|
|
3655
3672
|
hashedLgcKey: (0, import_node_crypto2.createHash)("sha256").update(endpoint.langsmithApiKey).digest("hex")
|
|
3656
3673
|
});
|
|
3657
3674
|
let state = {};
|
|
3658
|
-
let
|
|
3675
|
+
let config2 = {};
|
|
3659
3676
|
if (agentStates) {
|
|
3660
3677
|
const jsonState = agentStates.find((state2) => state2.agentName === name);
|
|
3661
3678
|
if (jsonState) {
|
|
3662
3679
|
state = (0, import_shared12.parseJson)(jsonState.state, {});
|
|
3663
|
-
|
|
3680
|
+
config2 = (0, import_shared12.parseJson)(jsonState.config, {});
|
|
3664
3681
|
}
|
|
3665
3682
|
}
|
|
3666
3683
|
try {
|
|
@@ -3678,7 +3695,7 @@ function constructLGCRemoteAction({ endpoint, graphqlContext, logger: logger2, m
|
|
|
3678
3695
|
...additionalMessages
|
|
3679
3696
|
],
|
|
3680
3697
|
state,
|
|
3681
|
-
|
|
3698
|
+
config: config2,
|
|
3682
3699
|
properties: graphqlContext.properties,
|
|
3683
3700
|
actions: (0, import_shared12.tryMap)(actionInputsWithoutAgents, (action) => ({
|
|
3684
3701
|
name: action.name,
|
|
@@ -3790,12 +3807,12 @@ function constructRemoteActions({ json, url, onBeforeRequest, graphqlContext, lo
|
|
|
3790
3807
|
agentsAmount: json["agents"].length
|
|
3791
3808
|
});
|
|
3792
3809
|
let state = {};
|
|
3793
|
-
let
|
|
3810
|
+
let config2 = {};
|
|
3794
3811
|
if (agentStates) {
|
|
3795
3812
|
const jsonState = agentStates.find((state2) => state2.agentName === name);
|
|
3796
3813
|
if (jsonState) {
|
|
3797
3814
|
state = (0, import_shared12.parseJson)(jsonState.state, {});
|
|
3798
|
-
|
|
3815
|
+
config2 = (0, import_shared12.parseJson)(jsonState.config, {});
|
|
3799
3816
|
}
|
|
3800
3817
|
}
|
|
3801
3818
|
const fetchUrl = `${url}/agents/execute`;
|
|
@@ -3812,7 +3829,7 @@ function constructRemoteActions({ json, url, onBeforeRequest, graphqlContext, lo
|
|
|
3812
3829
|
...additionalMessages
|
|
3813
3830
|
],
|
|
3814
3831
|
state,
|
|
3815
|
-
|
|
3832
|
+
config: config2,
|
|
3816
3833
|
properties: graphqlContext.properties,
|
|
3817
3834
|
actions: (0, import_shared12.tryMap)(actionInputsWithoutAgents, (action) => ({
|
|
3818
3835
|
name: action.name,
|