@skein-js/local 0.21.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 +2 -1
- package/dist/index.js +24 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -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.
|
|
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.
|
|
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>",
|
|
@@ -41,15 +41,15 @@
|
|
|
41
41
|
"node": "^22.0.0 || ^24.0.0 || ^26.0.0"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@skein-js/core": "0.
|
|
45
|
-
"@skein-js/
|
|
46
|
-
"@skein-js/storage-
|
|
47
|
-
"@skein-js/
|
|
48
|
-
"@skein-js/
|
|
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.
|
|
52
|
+
"@skein-js/test-support": "0.23.0"
|
|
53
53
|
},
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|