@skein-js/config 0.4.0 → 0.5.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/dist/index.d.ts +7 -0
- package/dist/index.js +7 -1
- package/package.json +2 -2
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
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skein-js/config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
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>",
|
|
@@ -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.
|
|
45
|
+
"@skein-js/core": "0.5.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@langchain/langgraph": "^1.4.0",
|