@copilotkit/runtime 1.8.2-next.1 → 1.8.2
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 +15 -0
- package/dist/{chunk-CKEC4T6B.mjs → chunk-I55HAZ46.mjs} +2 -2
- package/dist/{chunk-HLUPHHYT.mjs → chunk-KGB2S3FC.mjs} +7 -4
- package/dist/chunk-KGB2S3FC.mjs.map +1 -0
- package/dist/{chunk-C6HNX5KB.mjs → chunk-X3ER3Y2P.mjs} +2 -2
- package/dist/{chunk-KHL2SKIB.mjs → chunk-XUQOUA5C.mjs} +2 -2
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/lib/index.js +6 -3
- 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 +9 -5
- package/dist/chunk-HLUPHHYT.mjs.map +0 -1
- /package/dist/{chunk-CKEC4T6B.mjs.map → chunk-I55HAZ46.mjs.map} +0 -0
- /package/dist/{chunk-C6HNX5KB.mjs.map → chunk-X3ER3Y2P.mjs.map} +0 -0
- /package/dist/{chunk-KHL2SKIB.mjs.map → chunk-XUQOUA5C.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
|
-
"version": "1.8.2
|
|
12
|
+
"version": "1.8.2",
|
|
13
13
|
"sideEffects": false,
|
|
14
14
|
"main": "./dist/index.js",
|
|
15
15
|
"module": "./dist/index.mjs",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"rxjs": "^7.8.1",
|
|
60
60
|
"type-graphql": "2.0.0-rc.1",
|
|
61
61
|
"zod": "^3.23.3",
|
|
62
|
-
"@copilotkit/shared": "1.8.2
|
|
62
|
+
"@copilotkit/shared": "1.8.2"
|
|
63
63
|
},
|
|
64
64
|
"keywords": [
|
|
65
65
|
"copilotkit",
|
|
@@ -68,6 +68,8 @@ type LangGraphPlatformMessage =
|
|
|
68
68
|
| LangGraphPlatformResultMessage
|
|
69
69
|
| BaseLangGraphPlatformMessage;
|
|
70
70
|
|
|
71
|
+
type SchemaKeys = { input: string[] | null; output: string[] | null } | null;
|
|
72
|
+
|
|
71
73
|
let activeInterruptEvent = false;
|
|
72
74
|
|
|
73
75
|
export async function execute(args: ExecutionArgs): Promise<ReadableStream<Uint8Array>> {
|
|
@@ -206,9 +208,8 @@ async function streamEvents(controller: ReadableStreamDefaultController, args: E
|
|
|
206
208
|
const graphInfo = await client.assistants.getGraph(assistantId);
|
|
207
209
|
const graphSchema = await client.assistants.getSchemas(assistantId);
|
|
208
210
|
const schemaKeys = getSchemaKeys(graphSchema);
|
|
209
|
-
|
|
210
211
|
// Do not input keys that are not part of the input schema
|
|
211
|
-
if (payload.input && schemaKeys
|
|
212
|
+
if (payload.input && schemaKeys?.input) {
|
|
212
213
|
payload.input = Object.fromEntries(
|
|
213
214
|
Object.entries(payload.input).filter(([key]) => schemaKeys.input.includes(key)),
|
|
214
215
|
);
|
|
@@ -449,7 +450,7 @@ function getStateSyncEvent({
|
|
|
449
450
|
running: boolean;
|
|
450
451
|
active: boolean;
|
|
451
452
|
includeMessages?: boolean;
|
|
452
|
-
schemaKeys:
|
|
453
|
+
schemaKeys: SchemaKeys;
|
|
453
454
|
}): string {
|
|
454
455
|
if (!includeMessages) {
|
|
455
456
|
state = Object.keys(state).reduce((acc, key) => {
|
|
@@ -466,7 +467,7 @@ function getStateSyncEvent({
|
|
|
466
467
|
}
|
|
467
468
|
|
|
468
469
|
// Do not emit state keys that are not part of the output schema
|
|
469
|
-
if (schemaKeys
|
|
470
|
+
if (schemaKeys?.output) {
|
|
470
471
|
state = Object.fromEntries(
|
|
471
472
|
Object.entries(state).filter(([key]) => schemaKeys.output.includes(key)),
|
|
472
473
|
);
|
|
@@ -761,8 +762,11 @@ function copilotkitMessagesToLangChain(messages: Message[]): LangGraphPlatformMe
|
|
|
761
762
|
return result;
|
|
762
763
|
}
|
|
763
764
|
|
|
764
|
-
function getSchemaKeys(graphSchema: GraphSchema) {
|
|
765
|
+
function getSchemaKeys(graphSchema: GraphSchema): SchemaKeys {
|
|
765
766
|
const CONSTANT_KEYS = ["messages", "copilotkit"];
|
|
767
|
+
if (!graphSchema.input_schema.properties || !graphSchema.output_schema.properties) {
|
|
768
|
+
return null;
|
|
769
|
+
}
|
|
766
770
|
const inputSchema = Object.keys(graphSchema.input_schema.properties);
|
|
767
771
|
const outputSchema = Object.keys(graphSchema.output_schema.properties);
|
|
768
772
|
|