@skein-js/config 0.6.3 → 0.8.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +22 -0
  2. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -491,6 +491,7 @@ interface GraphRegistry {
491
491
  /** Extract the graph's JSON schemas via langgraph-api (for assistant introspection). */
492
492
  schemas(graphId: string): Promise<GraphSchemas>;
493
493
  }
494
+ /** The result of {@link loadConfig}: the validated config plus its declared, on-demand graphs. */
494
495
  interface SkeinConfig {
495
496
  /** The validated `langgraph.json` contents. */
496
497
  config: LanggraphJson;
@@ -501,6 +502,7 @@ interface SkeinConfig {
501
502
  /** The declared graphs. */
502
503
  graphs: GraphRegistry;
503
504
  }
505
+ /** Options for {@link loadConfig} — where to find `langgraph.json` and how to import its graphs. */
504
506
  interface LoadConfigOptions {
505
507
  /** Directory to resolve `configPath` (and default discovery) against. Defaults to `process.cwd()`. */
506
508
  cwd?: string;
@@ -521,6 +523,26 @@ interface LoadConfigOptions {
521
523
  */
522
524
  staticSchemas?: Record<string, GraphSchemas>;
523
525
  }
526
+ /**
527
+ * Find, read, and validate a `langgraph.json`, resolve each declared graph to an absolute
528
+ * `path:export` spec, and return a {@link SkeinConfig} whose {@link GraphRegistry} loads a resolved
529
+ * graph (and its JSON schemas) on demand. This is the entry point every downstream consumer
530
+ * (`buildRuntime`, the adapters, the CLI) builds on.
531
+ *
532
+ * Loading is lazy and cached: pointing at a config whose graph needs a key (e.g. an LLM) doesn't
533
+ * import that graph until something asks for it, and a *failed* load is not memoized — a transient
534
+ * error (missing env, a syntax slip) can be retried without a restart.
535
+ *
536
+ * @throws {SkeinConfigError} when the file is missing, is not valid JSON, or fails schema validation.
537
+ *
538
+ * @example
539
+ * ```ts
540
+ * import { loadConfig } from "@skein-js/config";
541
+ *
542
+ * const { graphs } = await loadConfig(); // finds ./langgraph.json
543
+ * const agent = await graphs.load("agent");
544
+ * ```
545
+ */
524
546
  declare function loadConfig(options?: LoadConfigOptions): Promise<SkeinConfig>;
525
547
 
526
548
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skein-js/config",
3
- "version": "0.6.3",
3
+ "version": "0.8.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.6.3"
45
+ "@skein-js/core": "0.8.0"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "@langchain/langgraph": "^1.4.0",