skein-js 0.3.0 → 0.4.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 +18 -6
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -67,8 +67,8 @@ All commands take `-c, --config <path>` (default `langgraph.json`).
|
|
|
67
67
|
| ------------------ | -------------------- | ----------- | -------------------------------------------------------------- |
|
|
68
68
|
| `-p, --port` | number | `2024` | Port to listen on. |
|
|
69
69
|
| `--host` | host | `127.0.0.1` | Interface to bind. |
|
|
70
|
-
| `--store <driver>` | `memory`, `postgres` | `memory` | `postgres` reads `
|
|
71
|
-
| `--queue <driver>` | `memory`, `redis` | `memory` | `redis` reads `
|
|
70
|
+
| `--store <driver>` | `memory`, `postgres` | `memory` | `postgres` reads `POSTGRES_URI`; also selects `PostgresSaver`. |
|
|
71
|
+
| `--queue <driver>` | `memory`, `redis` | `memory` | `redis` reads `REDIS_URI` (BullMQ queue + Redis Streams bus). |
|
|
72
72
|
| `--no-persist` | — | persists | Don't snapshot dev state to `.skein/` across restarts. |
|
|
73
73
|
| `--no-reload` | — | reloads | Disable hot reload on source change. |
|
|
74
74
|
| `-v, --verbose` | — | off | Log per-run activity (tool calls, interrupts, timing). |
|
package/dist/index.js
CHANGED
|
@@ -137,7 +137,11 @@ async function applyProjectEnv(config, configDir) {
|
|
|
137
137
|
|
|
138
138
|
// src/vite-graph-loader.ts
|
|
139
139
|
import { createServer as createNetServer } from "net";
|
|
140
|
-
import {
|
|
140
|
+
import {
|
|
141
|
+
createServer,
|
|
142
|
+
createServerModuleRunner,
|
|
143
|
+
searchForWorkspaceRoot
|
|
144
|
+
} from "vite";
|
|
141
145
|
function findFreePort() {
|
|
142
146
|
return new Promise((resolve, reject) => {
|
|
143
147
|
const probe = createNetServer();
|
|
@@ -150,9 +154,14 @@ function findFreePort() {
|
|
|
150
154
|
});
|
|
151
155
|
}
|
|
152
156
|
async function createViteGraphLoader(root, ignored = []) {
|
|
157
|
+
const workspaceRoot = searchForWorkspaceRoot(root);
|
|
153
158
|
const server = await createServer({
|
|
154
159
|
root,
|
|
155
160
|
configFile: false,
|
|
161
|
+
// Resolve tsconfig `paths` natively (vite 8+): vite reads the project's tsconfig, follows
|
|
162
|
+
// `extends` to a base tsconfig (e.g. `tsconfig.base.json`), and honors `baseUrl` + wildcard
|
|
163
|
+
// aliases — so graphs that import workspace packages through path aliases resolve.
|
|
164
|
+
resolve: { tsconfigPaths: true },
|
|
156
165
|
appType: "custom",
|
|
157
166
|
logLevel: "warn",
|
|
158
167
|
server: {
|
|
@@ -162,7 +171,10 @@ async function createViteGraphLoader(root, ignored = []) {
|
|
|
162
171
|
// "port 24678 already in use" error — when two `skein dev`s run at once. Give it an ephemeral
|
|
163
172
|
// port so instances never clash.
|
|
164
173
|
hmr: { port: await findFreePort() },
|
|
165
|
-
watch: { ignored: ["**/node_modules/**", "**/.git/**", "**/dist/**", ...ignored] }
|
|
174
|
+
watch: { ignored: ["**/node_modules/**", "**/.git/**", "**/dist/**", ...ignored] },
|
|
175
|
+
// Aliased lib sources resolve outside the app `root` (e.g. `../../libs/**`). Widen vite's
|
|
176
|
+
// file-serving allowlist to the workspace root so the module runner can transform them.
|
|
177
|
+
fs: { allow: [workspaceRoot] }
|
|
166
178
|
},
|
|
167
179
|
optimizeDeps: { noDiscovery: true }
|
|
168
180
|
});
|
|
@@ -370,8 +382,8 @@ services:
|
|
|
370
382
|
# The container CMD passes no --port; it binds $PORT (as a hosting platform would inject).
|
|
371
383
|
# Set it here so the app listens on the port the mapping above publishes.
|
|
372
384
|
PORT: "${options.containerPort}"
|
|
373
|
-
|
|
374
|
-
|
|
385
|
+
POSTGRES_URI: postgresql://postgres:postgres@postgres:5432/skein
|
|
386
|
+
REDIS_URI: redis://redis:6379
|
|
375
387
|
depends_on:
|
|
376
388
|
postgres:
|
|
377
389
|
condition: service_healthy
|
|
@@ -486,7 +498,7 @@ function generateDockerfile(options) {
|
|
|
486
498
|
`USER node`,
|
|
487
499
|
...dockerfileLines,
|
|
488
500
|
``,
|
|
489
|
-
`# Serve the Agent Protocol against Postgres + Redis (
|
|
501
|
+
`# Serve the Agent Protocol against Postgres + Redis (POSTGRES_URI / REDIS_URI from the environment).`,
|
|
490
502
|
`# No --port: the server binds $PORT when the platform injects one (Railway/Fly/Render), else its`,
|
|
491
503
|
`# default. Exec form keeps node as PID 1 so SIGTERM reaches skein's graceful-shutdown handler.`,
|
|
492
504
|
`CMD ["npx", "skein", "dev", "--no-reload", "--no-persist", "--store", "postgres", "--queue", "redis", "--host", "0.0.0.0"]`
|
|
@@ -712,7 +724,7 @@ program.command("build").description("Build a deployable Docker image from the c
|
|
|
712
724
|
program.command("dockerfile").description("Emit a standalone Dockerfile from the config.").option("-c, --config <path>", "Path to langgraph.json", "langgraph.json").option("-o, --output <path>", "Write the Dockerfile here instead of stdout").action((options) => runDockerfile(options));
|
|
713
725
|
program.command("import-langgraph").description("Import an existing LangGraph in-memory dev state (.langgraph_api/) into skein.").option("-c, --config <path>", "Path to langgraph.json", "langgraph.json").option(
|
|
714
726
|
"--store <driver>",
|
|
715
|
-
"Import target: memory (.skein/dev-state.json) | postgres (
|
|
727
|
+
"Import target: memory (.skein/dev-state.json) | postgres (POSTGRES_URI)",
|
|
716
728
|
parseStore,
|
|
717
729
|
"memory"
|
|
718
730
|
).option("--from <dir>", "Source .langgraph_api directory (defaults to alongside langgraph.json)").option("--force", "Overwrite an existing .skein/dev-state.json (memory target)", false).action((options) => runImportLanggraph(options));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skein-js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "The skein-js CLI — a drop-in replacement for the LangGraph CLI (dev/up/build/dockerfile).",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Maina Wycliffe <wmmaina7@gmail.com>",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"@langchain/langgraph-checkpoint-postgres": "^1.0.4",
|
|
49
49
|
"commander": "~13.1.0",
|
|
50
50
|
"vite": "^8.1.0",
|
|
51
|
-
"@skein-js/core": "0.
|
|
52
|
-
"@skein-js/
|
|
53
|
-
"@skein-js/
|
|
54
|
-
"@skein-js/runtime": "0.
|
|
51
|
+
"@skein-js/core": "0.4.0",
|
|
52
|
+
"@skein-js/express": "0.4.0",
|
|
53
|
+
"@skein-js/config": "0.4.0",
|
|
54
|
+
"@skein-js/runtime": "0.4.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@langchain/langgraph": "^1.4.0"
|