@skein-js/local 0.20.0 → 0.23.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @skein-js/local
2
2
 
3
- Embed LangGraph.js agents with durable SQLite resources, checkpoints and queued work on Node 22/24.
3
+ Embed LangGraph.js agents with durable SQLite resources, checkpoints and queued work on Node 22/24/26.
4
4
 
5
5
  📖 **Docs:** [Local deployment](https://skein-js.github.io/skein-js/local-deployment#embed-agents)
6
6
 
@@ -21,7 +21,8 @@ const local = await embedSqliteGraphs(
21
21
  const runtime = createProtocolRuntime(local.deps);
22
22
  await runtime.service.assistants.registerGraphAssistants();
23
23
  runtime.worker.start();
24
- // Use runtime.service or pass local.deps to an existing HTTP adapter.
24
+ // Use runtime.createNativeClient({sourceId, allowedAssistants}) for receipt-based native work.
25
+ // The existing runtime.service and HTTP adapters remain available.
25
26
  await runtime.worker.stop();
26
27
  await local.dispose();
27
28
  ```
package/dist/index.js CHANGED
@@ -7,8 +7,29 @@ import {
7
7
  normalizeEmbeddableGraphs,
8
8
  SkeinBaseStore
9
9
  } from "@skein-js/langgraph";
10
- import { MemoryRunEventBus } from "@skein-js/storage-memory";
10
+ import { MemoryRunEventBus, MemoryThreadEventBus } from "@skein-js/storage-memory";
11
11
  import { openSqliteStorage } from "@skein-js/storage-sqlite";
12
+
13
+ // src/thread-storage.ts
14
+ function inspectSqliteThreadStorage(database, threadId) {
15
+ const count = (table, expression) => database.prepare(
16
+ `SELECT count(*) AS count, coalesce(sum(${expression}),0) AS bytes FROM ${table} WHERE thread_id=?`
17
+ ).get(threadId);
18
+ const checkpoints = count(
19
+ "checkpoints",
20
+ "coalesce(length(checkpoint),0)+coalesce(length(metadata),0)"
21
+ );
22
+ const pending_writes = count("writes", "coalesce(length(value),0)");
23
+ return {
24
+ thread_id: threadId,
25
+ total_bytes: checkpoints.bytes + pending_writes.bytes,
26
+ checkpoints,
27
+ channel_values: { count: 0, bytes: 0, by_channel: {} },
28
+ pending_writes
29
+ };
30
+ }
31
+
32
+ // src/index.ts
12
33
  async function embedSqliteGraphs(graphs, options) {
13
34
  const threadTtl = options.threadTtl ?? options.overrides?.threadTtl;
14
35
  const storage = await openSqliteStorage({
@@ -26,7 +47,9 @@ async function embedSqliteGraphs(graphs, options) {
26
47
  store,
27
48
  queue: storage.queue,
28
49
  bus: new MemoryRunEventBus(),
50
+ threadBus: new MemoryThreadEventBus(),
29
51
  checkpointer,
52
+ inspectThreadStorage: (threadId) => inspectSqliteThreadStorage(storage.database, threadId),
30
53
  graphs: normalizeEmbeddableGraphs(graphs),
31
54
  storeBridge: (items) => new SkeinBaseStore(items),
32
55
  cloneCheckpoint: cloneLangGraphCheckpoint,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skein-js/local",
3
- "version": "0.20.0",
3
+ "version": "0.23.0",
4
4
  "description": "Embed LangGraph agents with durable local SQLite storage.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Maina Wycliffe <wmmaina7@gmail.com>",
@@ -38,18 +38,18 @@
38
38
  ],
39
39
  "sideEffects": false,
40
40
  "engines": {
41
- "node": "^22.0.0 || ^24.0.0"
41
+ "node": "^22.0.0 || ^24.0.0 || ^26.0.0"
42
42
  },
43
43
  "dependencies": {
44
- "@skein-js/agent-protocol": "0.20.0",
45
- "@skein-js/langgraph": "0.20.0",
46
- "@skein-js/core": "0.20.0",
47
- "@skein-js/storage-memory": "0.20.0",
48
- "@skein-js/storage-sqlite": "0.20.0"
44
+ "@skein-js/core": "0.23.0",
45
+ "@skein-js/langgraph": "0.23.0",
46
+ "@skein-js/storage-sqlite": "0.23.0",
47
+ "@skein-js/storage-memory": "0.23.0",
48
+ "@skein-js/agent-protocol": "0.23.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@types/better-sqlite3": "^7.6.13",
52
- "@skein-js/test-support": "0.20.0"
52
+ "@skein-js/test-support": "0.23.0"
53
53
  },
54
54
  "publishConfig": {
55
55
  "access": "public"