@skein-js/agent-protocol 0.2.1 → 0.3.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/dist/index.js +18 -2
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1312,8 +1312,21 @@ function createAuthorizingHandlers(context, engine) {
|
|
|
1312
1312
|
}
|
|
1313
1313
|
|
|
1314
1314
|
// src/runs/run-worker.ts
|
|
1315
|
-
import {
|
|
1315
|
+
import {
|
|
1316
|
+
isTerminalRunStatus as isTerminalRunStatus6
|
|
1317
|
+
} from "@skein-js/core";
|
|
1316
1318
|
var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
1319
|
+
function logRunLifecycle(logger, run, status, startedAt, endedAt) {
|
|
1320
|
+
logger.info(status === "success" ? "Background run succeeded" : `Background run ${status}`, {
|
|
1321
|
+
run_id: run.run_id,
|
|
1322
|
+
run_attempt: 1,
|
|
1323
|
+
run_created_at: run.created_at,
|
|
1324
|
+
run_started_at: new Date(startedAt).toISOString(),
|
|
1325
|
+
run_ended_at: new Date(endedAt).toISOString(),
|
|
1326
|
+
run_exec_ms: endedAt - startedAt,
|
|
1327
|
+
run_queue_ms: startedAt - Date.parse(run.created_at)
|
|
1328
|
+
});
|
|
1329
|
+
}
|
|
1317
1330
|
function createRunWorker(ctx, options = {}) {
|
|
1318
1331
|
const { deps, control } = ctx;
|
|
1319
1332
|
const maxConcurrency = options.maxConcurrency ?? 1;
|
|
@@ -1325,9 +1338,12 @@ function createRunWorker(ctx, options = {}) {
|
|
|
1325
1338
|
const kwargs = await deps.store.runs.getKwargs(queued.run_id) ?? {};
|
|
1326
1339
|
const runControl = control.register(queued.run_id);
|
|
1327
1340
|
inFlight.add(queued.run_id);
|
|
1341
|
+
const startedAt = Date.now();
|
|
1342
|
+
let status = "error";
|
|
1328
1343
|
try {
|
|
1329
|
-
await executeRun(deps, { run, kwargs, control: runControl });
|
|
1344
|
+
status = (await executeRun(deps, { run, kwargs, control: runControl })).status;
|
|
1330
1345
|
} finally {
|
|
1346
|
+
logRunLifecycle(deps.logger, run, status, startedAt, Date.now());
|
|
1331
1347
|
control.clear(queued.run_id);
|
|
1332
1348
|
inFlight.delete(queued.run_id);
|
|
1333
1349
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skein-js/agent-protocol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Framework-agnostic Agent Protocol engine for LangGraph.js — run engine, handlers, and SSE, driven entirely by injected dependencies.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Maina Wycliffe <wmmaina7@gmail.com>",
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"zod": "^3.25.76",
|
|
47
|
-
"@skein-js/core": "0.
|
|
47
|
+
"@skein-js/core": "0.3.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@langchain/langgraph": "^1.4.0",
|
|
51
51
|
"@langchain/langgraph-sdk": "^1.9.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@skein-js/storage-memory": "0.
|
|
54
|
+
"@skein-js/storage-memory": "0.3.0"
|
|
55
55
|
},
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|