@copilotkit/runtime 1.4.2 → 1.4.3-pre.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 +9 -0
- package/dist/{chunk-P2G5TCZA.mjs → chunk-5EGHJ5PO.mjs} +2 -2
- package/dist/{chunk-P37XVLVE.mjs → chunk-BS3MYV4N.mjs} +2 -2
- package/dist/{chunk-NGIMUY3P.mjs → chunk-C4CRNTIN.mjs} +2 -2
- package/dist/{chunk-5OSRXQBR.mjs → chunk-D6CE7W37.mjs} +18 -10
- package/dist/chunk-D6CE7W37.mjs.map +1 -0
- package/dist/index.js +17 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/lib/index.js +17 -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 +4 -4
- package/src/lib/runtime/remote-lg-action.ts +25 -14
- package/dist/chunk-5OSRXQBR.mjs.map +0 -1
- /package/dist/{chunk-P2G5TCZA.mjs.map → chunk-5EGHJ5PO.mjs.map} +0 -0
- /package/dist/{chunk-P37XVLVE.mjs.map → chunk-BS3MYV4N.mjs.map} +0 -0
- /package/dist/{chunk-NGIMUY3P.mjs.map → chunk-C4CRNTIN.mjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @copilotkit/runtime
|
|
2
2
|
|
|
3
|
+
## 1.4.3-pre.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- - Better error surfacing when using LangGraph Platform streaming
|
|
8
|
+
- Ensure state is immediately set without using flushSync
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
- @copilotkit/shared@1.4.3-pre.0
|
|
11
|
+
|
|
3
12
|
## 1.4.2
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
getCommonConfig,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-D6CE7W37.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-44O2JGUY.mjs";
|
|
@@ -77,4 +77,4 @@ export {
|
|
|
77
77
|
config,
|
|
78
78
|
copilotRuntimeNextJSPagesRouterEndpoint
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-5EGHJ5PO.mjs.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
copilotRuntimeNodeHttpEndpoint,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-D6CE7W37.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-44O2JGUY.mjs";
|
|
@@ -22,4 +22,4 @@ __name(copilotRuntimeNodeExpressEndpoint, "copilotRuntimeNodeExpressEndpoint");
|
|
|
22
22
|
export {
|
|
23
23
|
copilotRuntimeNodeExpressEndpoint
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-BS3MYV4N.mjs.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
copilotRuntimeNodeHttpEndpoint,
|
|
3
3
|
getRuntimeInstanceTelemetryInfo,
|
|
4
4
|
telemetry_client_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-D6CE7W37.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-44O2JGUY.mjs";
|
|
@@ -22,4 +22,4 @@ __name(copilotRuntimeNestEndpoint, "copilotRuntimeNestEndpoint");
|
|
|
22
22
|
export {
|
|
23
23
|
copilotRuntimeNestEndpoint
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-C4CRNTIN.mjs.map
|
|
@@ -37,7 +37,7 @@ var require_package = __commonJS({
|
|
|
37
37
|
publishConfig: {
|
|
38
38
|
access: "public"
|
|
39
39
|
},
|
|
40
|
-
version: "1.4.
|
|
40
|
+
version: "1.4.3-pre.0",
|
|
41
41
|
sideEffects: false,
|
|
42
42
|
main: "./dist/index.js",
|
|
43
43
|
module: "./dist/index.mjs",
|
|
@@ -1313,8 +1313,6 @@ async function streamEvents(controller, args) {
|
|
|
1313
1313
|
if (initialThreadId && initialThreadId.startsWith("ck-")) {
|
|
1314
1314
|
initialThreadId = initialThreadId.substring(3);
|
|
1315
1315
|
}
|
|
1316
|
-
const assistants = await client.assistants.search();
|
|
1317
|
-
const retrievedAssistant = assistants.find((a) => a.name === name);
|
|
1318
1316
|
const threadId = initialThreadId ?? randomUUID();
|
|
1319
1317
|
if (initialThreadId === threadId) {
|
|
1320
1318
|
await client.threads.get(threadId);
|
|
@@ -1345,8 +1343,16 @@ async function streamEvents(controller, args) {
|
|
|
1345
1343
|
asNode: nodeName
|
|
1346
1344
|
});
|
|
1347
1345
|
}
|
|
1348
|
-
|
|
1349
|
-
|
|
1346
|
+
let streamInfo = {
|
|
1347
|
+
hashedLgcKey: createHash("sha256").update(langsmithApiKey).digest("hex")
|
|
1348
|
+
};
|
|
1349
|
+
const assistants = await client.assistants.search();
|
|
1350
|
+
const retrievedAssistant = assistants.find((a) => a.name === name || a.assistant_id === initialAssistantId);
|
|
1351
|
+
if (!retrievedAssistant) {
|
|
1352
|
+
telemetry_client_default.capture("oss.runtime.agent_execution_stream_errored", {
|
|
1353
|
+
...streamInfo,
|
|
1354
|
+
error: `Found no assistants for given information, while ${assistants.length} assistants exists`
|
|
1355
|
+
});
|
|
1350
1356
|
console.error(`
|
|
1351
1357
|
No agent found for the agent name specified in CopilotKit provider
|
|
1352
1358
|
Please check your available agents or provide an agent ID in the LangGraph Platform endpoint definition.
|
|
@@ -1356,6 +1362,7 @@ async function streamEvents(controller, args) {
|
|
|
1356
1362
|
`);
|
|
1357
1363
|
throw new Error("No agent id found");
|
|
1358
1364
|
}
|
|
1365
|
+
const assistantId = retrievedAssistant.assistant_id;
|
|
1359
1366
|
const graphInfo = await client.assistants.getGraph(assistantId);
|
|
1360
1367
|
const streamInput = mode === "start" ? state : null;
|
|
1361
1368
|
let streamingStateExtractor = new StreamingStateExtractor([]);
|
|
@@ -1374,9 +1381,6 @@ async function streamEvents(controller, args) {
|
|
|
1374
1381
|
let latestStateValues = {};
|
|
1375
1382
|
let updatedState = state;
|
|
1376
1383
|
let manuallyEmittedState = null;
|
|
1377
|
-
let streamInfo = {
|
|
1378
|
-
hashedLgcKey: createHash("sha256").update(langsmithApiKey).digest("hex")
|
|
1379
|
-
};
|
|
1380
1384
|
try {
|
|
1381
1385
|
telemetry_client_default.capture("oss.runtime.agent_execution_stream_started", {
|
|
1382
1386
|
hashedLgcKey: streamInfo.hashedLgcKey
|
|
@@ -1389,7 +1393,6 @@ async function streamEvents(controller, args) {
|
|
|
1389
1393
|
].includes(chunk.event))
|
|
1390
1394
|
continue;
|
|
1391
1395
|
if (chunk.event === "error") {
|
|
1392
|
-
logger2.error(chunk, `Error event thrown: ${chunk.data.message}`);
|
|
1393
1396
|
throw new Error(`Error event thrown: ${chunk.data.message}`);
|
|
1394
1397
|
}
|
|
1395
1398
|
if (chunk.event === "values") {
|
|
@@ -1486,6 +1489,11 @@ async function streamEvents(controller, args) {
|
|
|
1486
1489
|
}));
|
|
1487
1490
|
return Promise.resolve();
|
|
1488
1491
|
} catch (e) {
|
|
1492
|
+
logger2.error(e);
|
|
1493
|
+
telemetry_client_default.capture("oss.runtime.agent_execution_stream_errored", {
|
|
1494
|
+
...streamInfo,
|
|
1495
|
+
error: e.message
|
|
1496
|
+
});
|
|
1489
1497
|
return Promise.resolve();
|
|
1490
1498
|
}
|
|
1491
1499
|
}
|
|
@@ -3144,4 +3152,4 @@ export {
|
|
|
3144
3152
|
getCommonConfig,
|
|
3145
3153
|
copilotRuntimeNodeHttpEndpoint
|
|
3146
3154
|
};
|
|
3147
|
-
//# sourceMappingURL=chunk-
|
|
3155
|
+
//# sourceMappingURL=chunk-D6CE7W37.mjs.map
|