@skein-js/config 0.4.0 → 0.6.3

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.d.ts CHANGED
@@ -513,6 +513,13 @@ interface LoadConfigOptions {
513
513
  * analyses the TypeScript source and never executes the module.
514
514
  */
515
515
  importModule?: ModuleImporter;
516
+ /**
517
+ * Precomputed graph schemas, keyed by graph id — supplied by `skein build`/`skein start` for a
518
+ * pre-compiled production image. When present, `schemas(id)` returns these instead of statically
519
+ * analysing TypeScript source: the image ships bundled JS with no `.ts` to introspect, and this
520
+ * also keeps `getStaticGraphSchema` (and its `worker_threads` parser) out of the runtime entirely.
521
+ */
522
+ staticSchemas?: Record<string, GraphSchemas>;
516
523
  }
517
524
  declare function loadConfig(options?: LoadConfigOptions): Promise<SkeinConfig>;
518
525
 
package/dist/index.js CHANGED
@@ -134,7 +134,7 @@ async function loadConfig(options = {}) {
134
134
  const cwd = options.cwd ?? process.cwd();
135
135
  const configPath = path2.resolve(cwd, options.configPath ?? "langgraph.json");
136
136
  const configDir = path2.dirname(configPath);
137
- const { importModule } = options;
137
+ const { importModule, staticSchemas } = options;
138
138
  const config = parseLanggraphJson(await readJsonFile(configPath));
139
139
  const specs = /* @__PURE__ */ new Map();
140
140
  for (const [graphId, spec] of Object.entries(config.graphs)) {
@@ -167,6 +167,12 @@ async function loadConfig(options = {}) {
167
167
  return memoize(graphCache, graphId, () => loadGraph(spec, importModule));
168
168
  },
169
169
  async schemas(graphId) {
170
+ if (staticSchemas) {
171
+ specFor(graphId);
172
+ const baked = staticSchemas[graphId];
173
+ if (!baked) throw new SkeinConfigError(`No precomputed schema for graph "${graphId}".`);
174
+ return baked;
175
+ }
170
176
  const spec = specFor(graphId);
171
177
  return memoize(schemaCache, graphId, () => getStaticGraphSchema(spec));
172
178
  }
@@ -310,7 +316,9 @@ async function loadAuthEngine(auth, options) {
310
316
  }
311
317
  const exported = module[spec.exportSymbol];
312
318
  if (exported == null) {
313
- throw new SkeinConfigError(`Auth module "${spec.sourceFile}" has no export "${spec.exportSymbol}".`);
319
+ throw new SkeinConfigError(
320
+ `Auth module "${spec.sourceFile}" has no export "${spec.exportSymbol}".`
321
+ );
314
322
  }
315
323
  if (!isAuthInstance(exported)) {
316
324
  throw new SkeinConfigError(
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@skein-js/config",
3
- "version": "0.4.0",
3
+ "version": "0.6.3",
4
4
  "description": "langgraph.json parser and graph loader (path:export) for skein-js.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Maina Wycliffe <wmmaina7@gmail.com>",
7
- "homepage": "https://github.com/mainawycliffe/skein-js/tree/main/packages/config#readme",
7
+ "homepage": "https://github.com/skein-js/skein-js/tree/main/packages/config#readme",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "git+https://github.com/mainawycliffe/skein-js.git",
10
+ "url": "git+https://github.com/skein-js/skein-js.git",
11
11
  "directory": "packages/config"
12
12
  },
13
13
  "bugs": {
14
- "url": "https://github.com/mainawycliffe/skein-js/issues"
14
+ "url": "https://github.com/skein-js/skein-js/issues"
15
15
  },
16
16
  "keywords": [
17
17
  "typescript",
@@ -42,7 +42,7 @@
42
42
  "dependencies": {
43
43
  "@langchain/langgraph-api": "^1.4.0",
44
44
  "zod": "^3.25.76",
45
- "@skein-js/core": "0.4.0"
45
+ "@skein-js/core": "0.6.3"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "@langchain/langgraph": "^1.4.0",