@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
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
getCommonConfig,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FEE2BWEL.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-NN5RJK22.mjs.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
copilotRuntimeNodeHttpEndpoint,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FEE2BWEL.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-VT4HR4Q5.mjs.map
|
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.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",
|
|
@@ -2620,18 +2620,19 @@ async function streamEvents(controller, args) {
|
|
|
2620
2620
|
throw new Error("No agent id found");
|
|
2621
2621
|
}
|
|
2622
2622
|
const assistantId = retrievedAssistant.assistant_id;
|
|
2623
|
+
const graphInfo = await client.assistants.getGraph(assistantId);
|
|
2624
|
+
const graphSchema = await client.assistants.getSchemas(assistantId);
|
|
2625
|
+
const schemaKeys = getSchemaKeys(graphSchema);
|
|
2623
2626
|
if (configurable) {
|
|
2627
|
+
const filteredConfigurable = (schemaKeys == null ? void 0 : schemaKeys.config) ? filterObjectBySchemaKeys(configurable, schemaKeys == null ? void 0 : schemaKeys.config) : configurable;
|
|
2624
2628
|
await client.assistants.update(assistantId, {
|
|
2625
2629
|
config: {
|
|
2626
|
-
configurable
|
|
2630
|
+
configurable: filteredConfigurable
|
|
2627
2631
|
}
|
|
2628
2632
|
});
|
|
2629
2633
|
}
|
|
2630
|
-
const graphInfo = await client.assistants.getGraph(assistantId);
|
|
2631
|
-
const graphSchema = await client.assistants.getSchemas(assistantId);
|
|
2632
|
-
const schemaKeys = getSchemaKeys(graphSchema);
|
|
2633
2634
|
if (payload.input && (schemaKeys == null ? void 0 : schemaKeys.input)) {
|
|
2634
|
-
payload.input =
|
|
2635
|
+
payload.input = filterObjectBySchemaKeys(payload.input, schemaKeys.input);
|
|
2635
2636
|
}
|
|
2636
2637
|
let streamingStateExtractor = new StreamingStateExtractor([]);
|
|
2637
2638
|
let prevNodeName = null;
|
|
@@ -2805,7 +2806,7 @@ function getStateSyncEvent({ threadId, runId, agentName, nodeName, state, runnin
|
|
|
2805
2806
|
};
|
|
2806
2807
|
}
|
|
2807
2808
|
if (schemaKeys == null ? void 0 : schemaKeys.output) {
|
|
2808
|
-
state =
|
|
2809
|
+
state = filterObjectBySchemaKeys(state, schemaKeys.output);
|
|
2809
2810
|
}
|
|
2810
2811
|
return JSON.stringify({
|
|
2811
2812
|
event: LangGraphEventTypes.OnCopilotKitStateSync,
|
|
@@ -3046,8 +3047,12 @@ function getSchemaKeys(graphSchema) {
|
|
|
3046
3047
|
"messages",
|
|
3047
3048
|
"copilotkit"
|
|
3048
3049
|
];
|
|
3050
|
+
let configSchema = null;
|
|
3051
|
+
if (graphSchema.config_schema.properties) {
|
|
3052
|
+
configSchema = Object.keys(graphSchema.config_schema.properties);
|
|
3053
|
+
}
|
|
3049
3054
|
if (!graphSchema.input_schema.properties || !graphSchema.output_schema.properties) {
|
|
3050
|
-
return
|
|
3055
|
+
return configSchema;
|
|
3051
3056
|
}
|
|
3052
3057
|
const inputSchema = Object.keys(graphSchema.input_schema.properties);
|
|
3053
3058
|
const outputSchema = Object.keys(graphSchema.output_schema.properties);
|
|
@@ -3059,10 +3064,15 @@ function getSchemaKeys(graphSchema) {
|
|
|
3059
3064
|
output: outputSchema && outputSchema.length ? [
|
|
3060
3065
|
...outputSchema,
|
|
3061
3066
|
...CONSTANT_KEYS
|
|
3062
|
-
] : null
|
|
3067
|
+
] : null,
|
|
3068
|
+
config: configSchema
|
|
3063
3069
|
};
|
|
3064
3070
|
}
|
|
3065
3071
|
__name(getSchemaKeys, "getSchemaKeys");
|
|
3072
|
+
function filterObjectBySchemaKeys(obj, schemaKeys) {
|
|
3073
|
+
return Object.fromEntries(Object.entries(obj).filter(([key]) => schemaKeys.includes(key)));
|
|
3074
|
+
}
|
|
3075
|
+
__name(filterObjectBySchemaKeys, "filterObjectBySchemaKeys");
|
|
3066
3076
|
|
|
3067
3077
|
// src/lib/runtime/remote-action-constructors.ts
|
|
3068
3078
|
var import_shared13 = require("@copilotkit/shared");
|