@skein-js/runtime 0.2.0 → 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/README.md +2 -2
- package/dist/index.js +24 -3
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Assembles a production `ProtocolDeps` (memory / Postgres / Redis) from a `langgraph.json`.
|
|
4
4
|
|
|
5
|
-
Part of **[skein-js](
|
|
5
|
+
Part of **[skein-js](../../README.md)** — a TypeScript [Agent Protocol](https://github.com/langchain-ai/agent-protocol) server for [LangGraph.js](https://github.com/langchain-ai/langgraphjs), and a drop-in replacement for the LangGraph CLI.
|
|
6
6
|
|
|
7
7
|
**Status:** 🚧 Pre-alpha — implemented; the assembler behind `skein dev` and `skein up`.
|
|
8
8
|
|
|
@@ -91,7 +91,7 @@ back to naive text matching (identical to the memory driver).
|
|
|
91
91
|
## Learn more
|
|
92
92
|
|
|
93
93
|
- [Storage](../../docs/storage.md) · [Runs & Redis](../../docs/runs-and-redis.md) · [LangGraph CLI compatibility](../../docs/langgraph-cli-compat.md)
|
|
94
|
-
- [skein-js overview](../../docs/index.md) · [Reuse-first architecture](../../docs/reuse.md)
|
|
94
|
+
- [skein-js overview](../../docs/index.md) · [Reuse-first architecture](../../docs/reuse.md) · [Root README](../../README.md)
|
|
95
95
|
|
|
96
96
|
## License
|
|
97
97
|
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,10 @@ import {
|
|
|
11
11
|
} from "@skein-js/express";
|
|
12
12
|
import { RedisRunEventBus, RedisRunQueue } from "@skein-js/redis";
|
|
13
13
|
import { MemoryRunEventBus, MemoryRunQueue, MemorySkeinStore } from "@skein-js/storage-memory";
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
createPostgresPool,
|
|
16
|
+
PostgresSkeinStore
|
|
17
|
+
} from "@skein-js/storage-postgres";
|
|
15
18
|
|
|
16
19
|
// src/errors.ts
|
|
17
20
|
var RuntimeConfigError = class extends Error {
|
|
@@ -104,6 +107,20 @@ function requireEnv(name, driver) {
|
|
|
104
107
|
}
|
|
105
108
|
return value;
|
|
106
109
|
}
|
|
110
|
+
function postgresConnectionOptions() {
|
|
111
|
+
const options = {};
|
|
112
|
+
const rawMax = process.env["PG_POOL_MAX"];
|
|
113
|
+
if (rawMax !== void 0 && rawMax.trim() !== "") {
|
|
114
|
+
const max = Number(rawMax);
|
|
115
|
+
if (!Number.isInteger(max) || max <= 0) {
|
|
116
|
+
throw new RuntimeConfigError(`PG_POOL_MAX must be a positive integer (got "${rawMax}").`);
|
|
117
|
+
}
|
|
118
|
+
options.poolMax = max;
|
|
119
|
+
}
|
|
120
|
+
const noVerify = process.env["DATABASE_SSL_NO_VERIFY"];
|
|
121
|
+
if (noVerify === "1" || noVerify?.toLowerCase() === "true") options.sslNoVerify = true;
|
|
122
|
+
return options;
|
|
123
|
+
}
|
|
107
124
|
function reroutableGraphResolver(initial) {
|
|
108
125
|
let current = initial;
|
|
109
126
|
return {
|
|
@@ -155,10 +172,14 @@ async function buildRuntime(options) {
|
|
|
155
172
|
configDir: first.configDir,
|
|
156
173
|
importModule
|
|
157
174
|
});
|
|
158
|
-
const
|
|
175
|
+
const connectionOptions = postgresConnectionOptions();
|
|
176
|
+
const pgStore = await PostgresSkeinStore.connect(databaseUrl, {
|
|
177
|
+
...index ? { index } : {},
|
|
178
|
+
...connectionOptions
|
|
179
|
+
});
|
|
159
180
|
disposers.push(() => pgStore.close());
|
|
160
181
|
await pgStore.migrate();
|
|
161
|
-
const saver = PostgresSaver
|
|
182
|
+
const saver = new PostgresSaver(createPostgresPool(databaseUrl, connectionOptions));
|
|
162
183
|
disposers.push(() => saver.end());
|
|
163
184
|
await saver.setup();
|
|
164
185
|
return { skeinStore: pgStore, checkpointer: saver };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skein-js/runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Assembles skein-js ProtocolDeps from langgraph.json + selected drivers (memory/Postgres/Redis).",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Maina Wycliffe <wmmaina7@gmail.com>",
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"cors": "^2.8.5",
|
|
45
|
-
"@skein-js/agent-protocol": "0.
|
|
46
|
-
"@skein-js/
|
|
47
|
-
"@skein-js/
|
|
48
|
-
"@skein-js/
|
|
49
|
-
"@skein-js/storage-
|
|
50
|
-
"@skein-js/
|
|
45
|
+
"@skein-js/agent-protocol": "0.3.0",
|
|
46
|
+
"@skein-js/express": "0.3.0",
|
|
47
|
+
"@skein-js/config": "0.3.0",
|
|
48
|
+
"@skein-js/storage-memory": "0.3.0",
|
|
49
|
+
"@skein-js/storage-postgres": "0.3.0",
|
|
50
|
+
"@skein-js/redis": "0.3.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@langchain/langgraph": "^1.4.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@langchain/langgraph": "^1.4.0",
|
|
59
59
|
"@langchain/langgraph-checkpoint-postgres": "^1.0.4",
|
|
60
60
|
"@types/cors": "^2.8.17",
|
|
61
|
-
"@skein-js/test-support": "0.
|
|
61
|
+
"@skein-js/test-support": "0.3.0"
|
|
62
62
|
},
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|