@copilotkit/runtime 1.8.4-next.2 → 1.8.4-next.3
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 +7 -0
- package/dist/{chunk-E6VXSOGW.mjs → chunk-6SHV3BGA.mjs} +2 -2
- package/dist/{chunk-ZWY6JDFI.mjs → chunk-FEE2BWEL.mjs} +20 -10
- package/dist/chunk-FEE2BWEL.mjs.map +1 -0
- package/dist/{chunk-B45VFLS3.mjs → chunk-NN5RJK22.mjs} +2 -2
- package/dist/{chunk-FJ7VCD4V.mjs → chunk-VT4HR4Q5.mjs} +2 -2
- package/dist/index.js +19 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/lib/index.js +19 -9
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +4 -4
- package/dist/lib/integrations/index.js +1 -1
- package/dist/lib/integrations/index.js.map +1 -1
- package/dist/lib/integrations/index.mjs +4 -4
- package/dist/lib/integrations/nest/index.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- package/dist/lib/integrations/node-http/index.js.map +1 -1
- package/dist/lib/integrations/node-http/index.mjs +1 -1
- package/package.json +2 -2
- package/src/lib/runtime/remote-lg-action.ts +24 -11
- package/dist/chunk-ZWY6JDFI.mjs.map +0 -1
- /package/dist/{chunk-E6VXSOGW.mjs.map → chunk-6SHV3BGA.mjs.map} +0 -0
- /package/dist/{chunk-B45VFLS3.mjs.map → chunk-NN5RJK22.mjs.map} +0 -0
- /package/dist/{chunk-FJ7VCD4V.mjs.map → chunk-VT4HR4Q5.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-NN5RJK22.mjs";
|
|
7
7
|
import {
|
|
8
8
|
copilotRuntimeNestEndpoint
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-6SHV3BGA.mjs";
|
|
10
10
|
import {
|
|
11
11
|
copilotRuntimeNodeExpressEndpoint
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VT4HR4Q5.mjs";
|
|
13
13
|
import {
|
|
14
14
|
CopilotRuntime,
|
|
15
15
|
addCustomHeaderPlugin,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
getCommonConfig,
|
|
23
23
|
langGraphPlatformEndpoint,
|
|
24
24
|
resolveEndpointType
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-FEE2BWEL.mjs";
|
|
26
26
|
import {
|
|
27
27
|
AnthropicAdapter,
|
|
28
28
|
EmptyAdapter,
|
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.8.4-next.
|
|
47
|
+
version: "1.8.4-next.3",
|
|
48
48
|
sideEffects: false,
|
|
49
49
|
main: "./dist/index.js",
|
|
50
50
|
module: "./dist/index.mjs",
|
|
@@ -2284,18 +2284,19 @@ async function streamEvents(controller, args) {
|
|
|
2284
2284
|
throw new Error("No agent id found");
|
|
2285
2285
|
}
|
|
2286
2286
|
const assistantId = retrievedAssistant.assistant_id;
|
|
2287
|
+
const graphInfo = await client.assistants.getGraph(assistantId);
|
|
2288
|
+
const graphSchema = await client.assistants.getSchemas(assistantId);
|
|
2289
|
+
const schemaKeys = getSchemaKeys(graphSchema);
|
|
2287
2290
|
if (configurable) {
|
|
2291
|
+
const filteredConfigurable = (schemaKeys == null ? void 0 : schemaKeys.config) ? filterObjectBySchemaKeys(configurable, schemaKeys == null ? void 0 : schemaKeys.config) : configurable;
|
|
2288
2292
|
await client.assistants.update(assistantId, {
|
|
2289
2293
|
config: {
|
|
2290
|
-
configurable
|
|
2294
|
+
configurable: filteredConfigurable
|
|
2291
2295
|
}
|
|
2292
2296
|
});
|
|
2293
2297
|
}
|
|
2294
|
-
const graphInfo = await client.assistants.getGraph(assistantId);
|
|
2295
|
-
const graphSchema = await client.assistants.getSchemas(assistantId);
|
|
2296
|
-
const schemaKeys = getSchemaKeys(graphSchema);
|
|
2297
2298
|
if (payload.input && (schemaKeys == null ? void 0 : schemaKeys.input)) {
|
|
2298
|
-
payload.input =
|
|
2299
|
+
payload.input = filterObjectBySchemaKeys(payload.input, schemaKeys.input);
|
|
2299
2300
|
}
|
|
2300
2301
|
let streamingStateExtractor = new StreamingStateExtractor([]);
|
|
2301
2302
|
let prevNodeName = null;
|
|
@@ -2469,7 +2470,7 @@ function getStateSyncEvent({ threadId, runId, agentName, nodeName, state, runnin
|
|
|
2469
2470
|
};
|
|
2470
2471
|
}
|
|
2471
2472
|
if (schemaKeys == null ? void 0 : schemaKeys.output) {
|
|
2472
|
-
state =
|
|
2473
|
+
state = filterObjectBySchemaKeys(state, schemaKeys.output);
|
|
2473
2474
|
}
|
|
2474
2475
|
return JSON.stringify({
|
|
2475
2476
|
event: LangGraphEventTypes.OnCopilotKitStateSync,
|
|
@@ -2710,8 +2711,12 @@ function getSchemaKeys(graphSchema) {
|
|
|
2710
2711
|
"messages",
|
|
2711
2712
|
"copilotkit"
|
|
2712
2713
|
];
|
|
2714
|
+
let configSchema = null;
|
|
2715
|
+
if (graphSchema.config_schema.properties) {
|
|
2716
|
+
configSchema = Object.keys(graphSchema.config_schema.properties);
|
|
2717
|
+
}
|
|
2713
2718
|
if (!graphSchema.input_schema.properties || !graphSchema.output_schema.properties) {
|
|
2714
|
-
return
|
|
2719
|
+
return configSchema;
|
|
2715
2720
|
}
|
|
2716
2721
|
const inputSchema = Object.keys(graphSchema.input_schema.properties);
|
|
2717
2722
|
const outputSchema = Object.keys(graphSchema.output_schema.properties);
|
|
@@ -2723,10 +2728,15 @@ function getSchemaKeys(graphSchema) {
|
|
|
2723
2728
|
output: outputSchema && outputSchema.length ? [
|
|
2724
2729
|
...outputSchema,
|
|
2725
2730
|
...CONSTANT_KEYS
|
|
2726
|
-
] : null
|
|
2731
|
+
] : null,
|
|
2732
|
+
config: configSchema
|
|
2727
2733
|
};
|
|
2728
2734
|
}
|
|
2729
2735
|
__name(getSchemaKeys, "getSchemaKeys");
|
|
2736
|
+
function filterObjectBySchemaKeys(obj, schemaKeys) {
|
|
2737
|
+
return Object.fromEntries(Object.entries(obj).filter(([key]) => schemaKeys.includes(key)));
|
|
2738
|
+
}
|
|
2739
|
+
__name(filterObjectBySchemaKeys, "filterObjectBySchemaKeys");
|
|
2730
2740
|
|
|
2731
2741
|
// src/lib/runtime/remote-action-constructors.ts
|
|
2732
2742
|
var import_shared11 = require("@copilotkit/shared");
|