mthds 0.9.0 → 0.10.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 (110) hide show
  1. package/README.md +43 -21
  2. package/dist/agent/commands/api-commands.js +290 -93
  3. package/dist/agent/commands/api-commands.js.map +1 -1
  4. package/dist/agent/commands/config.js +2 -2
  5. package/dist/agent/commands/config.js.map +1 -1
  6. package/dist/agent/commands/validate.js +5 -13
  7. package/dist/agent/commands/validate.js.map +1 -1
  8. package/dist/agent-cli.js +5 -5
  9. package/dist/agent-cli.js.map +1 -1
  10. package/dist/cli/commands/config.js +2 -2
  11. package/dist/cli/commands/config.js.map +1 -1
  12. package/dist/cli/commands/install.js +19 -39
  13. package/dist/cli/commands/install.js.map +1 -1
  14. package/dist/cli/commands/run.js +82 -69
  15. package/dist/cli/commands/run.js.map +1 -1
  16. package/dist/cli/commands/setup.js +22 -23
  17. package/dist/cli/commands/setup.js.map +1 -1
  18. package/dist/cli/commands/utils.d.ts +1 -1
  19. package/dist/cli/commands/validate.js +10 -14
  20. package/dist/cli/commands/validate.js.map +1 -1
  21. package/dist/cli.js +2 -2
  22. package/dist/cli.js.map +1 -1
  23. package/dist/config/config.d.ts +14 -1
  24. package/dist/config/config.js +31 -6
  25. package/dist/config/config.js.map +1 -1
  26. package/dist/index.d.ts +27 -1
  27. package/dist/index.js +22 -1
  28. package/dist/index.js.map +1 -1
  29. package/dist/protocol/concept.d.ts +14 -0
  30. package/dist/protocol/concept.js +10 -0
  31. package/dist/protocol/concept.js.map +1 -0
  32. package/dist/protocol/exceptions.d.ts +10 -0
  33. package/dist/protocol/exceptions.js +12 -0
  34. package/dist/protocol/exceptions.js.map +1 -0
  35. package/dist/protocol/models.d.ts +95 -0
  36. package/dist/protocol/models.js +24 -0
  37. package/dist/protocol/models.js.map +1 -0
  38. package/dist/protocol/options.d.ts +60 -0
  39. package/dist/protocol/options.js +11 -0
  40. package/dist/protocol/options.js.map +1 -0
  41. package/dist/protocol/pipe_output.d.ts +11 -0
  42. package/dist/protocol/pipe_output.js +7 -0
  43. package/dist/protocol/pipe_output.js.map +1 -0
  44. package/dist/protocol/pipeline_inputs.d.ts +8 -0
  45. package/dist/protocol/pipeline_inputs.js +7 -0
  46. package/dist/protocol/pipeline_inputs.js.map +1 -0
  47. package/dist/protocol/protocol.d.ts +47 -0
  48. package/dist/{client → protocol}/protocol.js.map +1 -1
  49. package/dist/protocol/stuff.d.ts +16 -0
  50. package/dist/protocol/stuff.js +8 -0
  51. package/dist/{client/models → protocol}/stuff.js.map +1 -1
  52. package/dist/protocol/working_memory.d.ts +10 -0
  53. package/dist/protocol/working_memory.js +7 -0
  54. package/dist/protocol/working_memory.js.map +1 -0
  55. package/dist/runners/api/client.d.ts +170 -0
  56. package/dist/runners/api/client.js +653 -0
  57. package/dist/runners/api/client.js.map +1 -0
  58. package/dist/runners/api/exceptions.d.ts +106 -0
  59. package/dist/runners/api/exceptions.js +141 -0
  60. package/dist/runners/api/exceptions.js.map +1 -0
  61. package/dist/runners/api/models.d.ts +38 -0
  62. package/dist/runners/api/models.js +13 -0
  63. package/dist/runners/api/models.js.map +1 -0
  64. package/dist/runners/api/runs.d.ts +130 -0
  65. package/dist/runners/api/runs.js +93 -0
  66. package/dist/runners/api/runs.js.map +1 -0
  67. package/dist/runners/base-runner.d.ts +27 -0
  68. package/dist/runners/base-runner.js +25 -0
  69. package/dist/runners/base-runner.js.map +1 -0
  70. package/dist/runners/pipelex/runner.d.ts +38 -0
  71. package/dist/runners/{pipelex-runner.js → pipelex/runner.js} +168 -83
  72. package/dist/runners/pipelex/runner.js.map +1 -0
  73. package/dist/runners/registry.js +10 -4
  74. package/dist/runners/registry.js.map +1 -1
  75. package/dist/runners/types.d.ts +13 -71
  76. package/dist/runners/types.js.map +1 -1
  77. package/package.json +6 -3
  78. package/dist/client/client.d.ts +0 -15
  79. package/dist/client/client.js +0 -127
  80. package/dist/client/client.js.map +0 -1
  81. package/dist/client/exceptions.d.ts +0 -46
  82. package/dist/client/exceptions.js +0 -61
  83. package/dist/client/exceptions.js.map +0 -1
  84. package/dist/client/index.d.ts +0 -5
  85. package/dist/client/index.js +0 -3
  86. package/dist/client/index.js.map +0 -1
  87. package/dist/client/models/index.d.ts +0 -4
  88. package/dist/client/models/index.js +0 -2
  89. package/dist/client/models/index.js.map +0 -1
  90. package/dist/client/models/pipe_output.d.ts +0 -2
  91. package/dist/client/models/pipe_output.js +0 -2
  92. package/dist/client/models/pipe_output.js.map +0 -1
  93. package/dist/client/models/pipeline_inputs.d.ts +0 -3
  94. package/dist/client/models/pipeline_inputs.js +0 -2
  95. package/dist/client/models/pipeline_inputs.js.map +0 -1
  96. package/dist/client/models/stuff.d.ts +0 -1
  97. package/dist/client/models/stuff.js +0 -2
  98. package/dist/client/models/working_memory.d.ts +0 -1
  99. package/dist/client/models/working_memory.js +0 -2
  100. package/dist/client/models/working_memory.js.map +0 -1
  101. package/dist/client/pipeline.d.ts +0 -36
  102. package/dist/client/pipeline.js +0 -2
  103. package/dist/client/pipeline.js.map +0 -1
  104. package/dist/client/protocol.d.ts +0 -5
  105. package/dist/runners/api-runner.d.ts +0 -24
  106. package/dist/runners/api-runner.js +0 -91
  107. package/dist/runners/api-runner.js.map +0 -1
  108. package/dist/runners/pipelex-runner.d.ts +0 -30
  109. package/dist/runners/pipelex-runner.js.map +0 -1
  110. /package/dist/{client → protocol}/protocol.js +0 -0
@@ -0,0 +1,38 @@
1
+ import type { Runner, RunnerType, BuildInputsRequest, BuildOutputRequest, BuildRunnerRequest, BuildRunnerResponse, ConceptRequest, ConceptResponse, PipeSpecRequest, PipeSpecResponse, CheckModelRequest, CheckModelResponse } from "../types.js";
2
+ import type { RunOptions, StartOptions } from "../../protocol/options.js";
3
+ import type { ModelCategory, ModelDeck, ValidationReport, VersionInfo } from "../../protocol/models.js";
4
+ import type { DictRunResultExecute } from "../api/models.js";
5
+ import type { RunRead, RunResults, RunResultState, WaitForResultOptions } from "../api/runs.js";
6
+ import { BaseRunner } from "../base-runner.js";
7
+ export declare class PipelexRunner extends BaseRunner implements Runner {
8
+ readonly type: RunnerType;
9
+ private readonly libraryDirs;
10
+ constructor(libraryDirs?: string[]);
11
+ private libraryArgs;
12
+ private exec;
13
+ /**
14
+ * Run pipelex with stdout and stderr inherited (streamed to the terminal).
15
+ * Use this for long-running or interactive commands.
16
+ */
17
+ private execStreaming;
18
+ buildPassthrough(subcommand: string, rawArgs: string[]): Promise<void>;
19
+ runPassthrough(rawArgs: string[]): Promise<void>;
20
+ validatePassthrough(rawArgs: string[]): Promise<void>;
21
+ health(): Promise<Record<string, unknown>>;
22
+ version(): Promise<VersionInfo>;
23
+ buildInputs(request: BuildInputsRequest): Promise<unknown>;
24
+ buildOutput(request: BuildOutputRequest): Promise<unknown>;
25
+ buildRunner(request: BuildRunnerRequest): Promise<BuildRunnerResponse>;
26
+ concept(request: ConceptRequest): Promise<ConceptResponse>;
27
+ pipeSpec(request: PipeSpecRequest): Promise<PipeSpecResponse>;
28
+ checkModel(request: CheckModelRequest): Promise<CheckModelResponse>;
29
+ models(category?: ModelCategory): Promise<ModelDeck>;
30
+ execute(options: RunOptions): Promise<DictRunResultExecute>;
31
+ validate(mthdsContents: string[], allowSignatures?: boolean): Promise<ValidationReport>;
32
+ startAndWaitForResult(options: StartOptions, _pollOptions?: WaitForResultOptions): Promise<RunResults>;
33
+ start(_options: StartOptions): Promise<never>;
34
+ getRunStatus(_runId: string): Promise<RunRead>;
35
+ getRunResult(_runId: string, _options?: {
36
+ signal?: AbortSignal;
37
+ }): Promise<RunResultState>;
38
+ }
@@ -3,7 +3,10 @@ import { promisify } from "node:util";
3
3
  import { existsSync, writeFileSync, readFileSync, mkdtempSync, rmSync, } from "node:fs";
4
4
  import { join } from "node:path";
5
5
  import { tmpdir } from "node:os";
6
- import { Runners } from "./types.js";
6
+ import { Runners } from "../types.js";
7
+ import { MTHDS_PROTOCOL_VERSION } from "../../protocol/models.js";
8
+ import { conceptRef } from "../../protocol/concept.js";
9
+ import { BaseRunner } from "../base-runner.js";
7
10
  const execFileAsync = promisify(execFile);
8
11
  function makeTmpDir() {
9
12
  return mkdtempSync(join(tmpdir(), "mthds-"));
@@ -31,10 +34,11 @@ function writeMthdsContents(tmp, contents) {
31
34
  }
32
35
  return bundlePath;
33
36
  }
34
- export class PipelexRunner {
37
+ export class PipelexRunner extends BaseRunner {
35
38
  type = Runners.PIPELEX;
36
39
  libraryDirs;
37
40
  constructor(libraryDirs) {
41
+ super();
38
42
  this.libraryDirs = libraryDirs ?? [];
39
43
  }
40
44
  libraryArgs() {
@@ -88,10 +92,17 @@ export class PipelexRunner {
88
92
  }
89
93
  async version() {
90
94
  const { stdout } = await this.exec(["--version"]);
91
- return { pipelex: stdout.trim() };
95
+ const pipelexVersion = stdout.trim();
96
+ return {
97
+ protocol_version: MTHDS_PROTOCOL_VERSION,
98
+ runner_version: pipelexVersion,
99
+ // Implementation identity rides the protocol's extension-open VersionInfo.
100
+ implementation: "pipelex",
101
+ implementation_version: pipelexVersion,
102
+ runtime_version: pipelexVersion,
103
+ };
92
104
  }
93
105
  // ── Build ───────────────────────────────────────────────────────
94
- // buildInputs and buildOutput have no CLI equivalent.
95
106
  // pipelex-agent inputs bundle <bundle.mthds> --pipe <pipe_code>
96
107
  async buildInputs(request) {
97
108
  const tmp = makeTmpDir();
@@ -210,11 +221,13 @@ export class PipelexRunner {
210
221
  };
211
222
  }
212
223
  // pipelex-agent check-model <reference> --type <type> --format json
213
- // The local runner always forces --format json: pipelex-agent's markdown output is plain
214
- // text (via print()), which can't satisfy the CheckModelResponse contract. The request's
215
- // `format` field is intentionally ignored here.
216
- // pipelex-agent declares --type as a required typer option (no default), so we guard
217
- // here for SDK consumers that bypass the agent CLI's parser.
224
+ // check-model is a LOCAL CLI capability of this runner only the MTHDS API
225
+ // has no check-model route, so this method is NOT on the shared `Runner`
226
+ // interface. The local runner always forces --format json: pipelex-agent's
227
+ // markdown output is plain text (via print()), which can't satisfy the
228
+ // CheckModelResponse contract. The request's `format` field is intentionally
229
+ // ignored here. pipelex-agent declares --type as a required typer option (no
230
+ // default), so we guard here for SDK consumers that bypass the agent CLI's parser.
218
231
  async checkModel(request) {
219
232
  if (!request.type) {
220
233
  throw new Error("checkModel requires `type` (one of: llm, extract, img_gen, search)");
@@ -225,58 +238,87 @@ export class PipelexRunner {
225
238
  });
226
239
  return JSON.parse(stdout);
227
240
  }
228
- // pipelex-agent models [--type <type>...] --format json
229
- async models(request) {
241
+ // pipelex-agent models [--type <type>] --format json
242
+ async models(category) {
230
243
  const args = ["models"];
231
- if (request?.type) {
232
- for (const t of request.type) {
233
- args.push("--type", t);
234
- }
244
+ if (category) {
245
+ args.push("--type", category);
235
246
  }
236
247
  args.push("--format", "json");
237
248
  const { stdout } = await execFileAsync("pipelex-agent", args, {
238
249
  encoding: "utf-8",
239
250
  });
240
- return JSON.parse(stdout);
251
+ return toModelDeck(JSON.parse(stdout));
241
252
  }
242
- // ── Pipeline execution ──────────────────────────────────────────
253
+ // ── Method execution ────────────────────────────────────────────
243
254
  // pipelex run <target> [--pipe code] [--inputs file] [--output-dir dir]
244
- async execute(request) {
255
+ // Local, blocking, in-process — there is no durable run to poll by id, so
256
+ // `execute` / `startAndWaitForResult` run through here and the async
257
+ // primitives (start / getRunStatus / getRunResult / waitForResult) are
258
+ // unsupported.
259
+ async execute(options) {
245
260
  const tmp = makeTmpDir();
246
261
  try {
262
+ // The pipelex CLI dispatches through `run bundle <path>` / `run pipe <code>`.
247
263
  const args = ["run"];
248
- if (request.mthds_contents?.length) {
249
- const bundlePath = writeMthdsContents(tmp, request.mthds_contents);
250
- args.push(bundlePath);
264
+ if (options.mthds_contents?.length) {
265
+ const bundlePath = writeMthdsContents(tmp, options.mthds_contents);
266
+ args.push("bundle", bundlePath);
251
267
  args.push("-L", tmp);
252
- if (request.pipe_code) {
253
- args.push("--pipe", request.pipe_code);
268
+ if (options.pipe_code) {
269
+ args.push("--pipe", options.pipe_code);
254
270
  }
255
271
  }
256
- else if (request.pipe_code) {
257
- args.push(request.pipe_code);
272
+ else if (options.pipe_code) {
273
+ args.push("pipe", options.pipe_code);
258
274
  }
259
- if (request.inputs) {
275
+ if (options.inputs) {
260
276
  const inputsPath = join(tmp, "inputs.json");
261
- writeFileSync(inputsPath, JSON.stringify(request.inputs), "utf-8");
277
+ writeFileSync(inputsPath, JSON.stringify(options.inputs), "utf-8");
262
278
  args.push("--inputs", inputsPath);
263
279
  }
264
- args.push("--output-dir", tmp);
265
- await this.execStreaming(args);
280
+ // Pin the working-memory artifact to a known path; other outputs go to
281
+ // an incremental directory under --output-dir which we don't need.
266
282
  const wmPath = join(tmp, "working_memory.json");
283
+ args.push("--working-memory-path", wmPath);
284
+ args.push("--output-dir", join(tmp, "results"));
285
+ args.push("--no-pretty-print");
286
+ await this.execStreaming(args);
267
287
  const raw = existsSync(wmPath)
268
288
  ? JSON.parse(readFileSync(wmPath, "utf-8"))
269
289
  : {};
270
- // The CLI output is working memory JSON. Wrap it in PipelineResponse shape.
290
+ // The CLI writes the runtime's FULL working memory
291
+ // (`{root: {name: {stuff_code, stuff_name, concept: {...}, content}}, aliases}`).
292
+ // Reduce each stuff to the SDK wire shape `{concept: <ref string>, content}` —
293
+ // the same reduction the API runner performs server-side. The runtime-internal
294
+ // id keeps its `pipeline_run_id` name (D1: internals are out of the rename scope).
295
+ const rawRoot = (raw["root"] ?? {});
296
+ const aliases = (raw["aliases"] ?? {});
297
+ const reducedRoot = {};
298
+ for (const [stuffName, stuff] of Object.entries(rawRoot)) {
299
+ const conceptRaw = stuff["concept"];
300
+ let conceptRefStr;
301
+ if (conceptRaw && typeof conceptRaw === "object") {
302
+ const conceptObj = conceptRaw;
303
+ const code = typeof conceptObj["code"] === "string" ? conceptObj["code"] : "";
304
+ const domainCode = typeof conceptObj["domain_code"] === "string" ? conceptObj["domain_code"] : "";
305
+ // A missing domain_code falls back to the bare code (no leading dot).
306
+ conceptRefStr = domainCode ? conceptRef({ domain_code: domainCode, code }) : code;
307
+ }
308
+ else {
309
+ conceptRefStr = String(conceptRaw ?? "");
310
+ }
311
+ reducedRoot[stuffName] = { concept: conceptRefStr, content: stuff["content"] };
312
+ }
313
+ // `main_stuff_name` is a pipelex extension field riding the protocol's
314
+ // extension-open response — not a protocol field.
271
315
  return {
272
- pipeline_run_id: raw["pipeline_run_id"] ?? "local",
273
- created_at: new Date().toISOString(),
274
- pipeline_state: "COMPLETED",
275
- finished_at: new Date().toISOString(),
276
- pipe_output: raw["pipe_output"]
277
- ? raw["pipe_output"]
278
- : null,
279
- main_stuff_name: raw["main_stuff_name"] ?? null,
316
+ pipeline_run_id: "",
317
+ pipe_output: {
318
+ working_memory: { root: reducedRoot, aliases },
319
+ pipeline_run_id: "",
320
+ },
321
+ main_stuff_name: aliases["main_stuff"] ?? "main_stuff",
280
322
  };
281
323
  }
282
324
  finally {
@@ -284,61 +326,104 @@ export class PipelexRunner {
284
326
  }
285
327
  }
286
328
  // ── Validation ──────────────────────────────────────────────────
287
- // pipelex validate method <github-url-or-local-path>
288
- async validate(request) {
289
- const url = request.method_url;
290
- if (!url) {
291
- return {
292
- mthds_contents: request.mthds_contents ?? [],
293
- pipelex_bundle_blueprint: { domain: "local" },
294
- success: false,
295
- message: "method_url is required for pipelex validation",
296
- };
297
- }
329
+ // pipelex validate bundle <bundle.mthds> [--allow-signatures]
330
+ async validate(mthdsContents, allowSignatures = false) {
331
+ const tmp = makeTmpDir();
298
332
  try {
299
- const args = ["validate", "method", url];
300
- if (request.pipe_code) {
301
- args.push("--pipe", request.pipe_code);
333
+ const bundlePath = writeMthdsContents(tmp, mthdsContents);
334
+ const args = ["validate", "bundle", bundlePath, "-L", tmp];
335
+ if (allowSignatures) {
336
+ args.push("--allow-signatures");
302
337
  }
303
- await this.execStreaming(args);
304
- return {
305
- mthds_contents: request.mthds_contents ?? [],
306
- pipelex_bundle_blueprint: { domain: "local" },
307
- success: true,
308
- message: "Method validated via local CLI",
309
- };
338
+ try {
339
+ await this.exec(args);
340
+ }
341
+ catch (err) {
342
+ const execError = err;
343
+ const detail = execError.stderr?.trim() || execError.stdout?.trim() || execError.message;
344
+ throw new Error(`Bundle validation failed:\n${detail}`);
345
+ }
346
+ // The local CLI validates but emits human-readable output, not the
347
+ // structural artifacts — a valid bundle yields an empty report.
348
+ return {};
310
349
  }
311
- catch (err) {
312
- const message = err instanceof Error ? err.message : "Validation failed";
313
- return {
314
- mthds_contents: request.mthds_contents ?? [],
315
- pipelex_bundle_blueprint: { domain: "local" },
316
- success: false,
317
- message,
318
- };
350
+ finally {
351
+ rmSync(tmp, { recursive: true, force: true });
319
352
  }
320
353
  }
321
- // ── RunnerProtocol implementation ─────────────────────────────────
322
- async executePipeline(options) {
323
- const request = {
354
+ // ── Run lifecycle ──────────────────────────────────────────────────
355
+ // The local pipelex CLI runs methods in-process; there is no durable run
356
+ // to poll by id, so the async primitives belong to the hosted API (use
357
+ // --runner api). `startAndWaitForResult` is supported — it runs the CLI
358
+ // blocking and returns the result directly.
359
+ async startAndWaitForResult(options, _pollOptions) {
360
+ const response = await this.execute({
324
361
  mthds_contents: options.mthds_contents ?? undefined,
325
362
  pipe_code: options.pipe_code ?? undefined,
326
- inputs: options.inputs
327
- ? Object.fromEntries(Object.entries(options.inputs).map(([k, v]) => [k, v]))
328
- : undefined,
329
- };
330
- const response = await this.execute(request);
363
+ inputs: options.inputs ?? undefined,
364
+ output_name: options.output_name ?? undefined,
365
+ output_multiplicity: options.output_multiplicity ?? undefined,
366
+ dynamic_output_concept_ref: options.dynamic_output_concept_ref ?? undefined,
367
+ });
368
+ const pipeOutput = response.pipe_output;
331
369
  return {
332
370
  pipeline_run_id: response.pipeline_run_id,
333
- created_at: response.created_at,
334
- pipeline_state: response.pipeline_state,
335
- finished_at: response.finished_at,
336
- main_stuff_name: response.main_stuff_name,
337
- pipe_output: response.pipe_output,
371
+ main_stuff: null,
372
+ // The local CLI blocking `pipe_output` carries no graph artifact.
373
+ graph_spec: null,
374
+ pipe_output: pipeOutput ?? null,
338
375
  };
339
376
  }
340
- async startPipeline(_options) {
341
- throw new Error("startPipeline is not supported by the pipelex CLI runner. Use the API runner instead.");
377
+ async start(_options) {
378
+ throw new Error(RUN_LIFECYCLE_UNSUPPORTED);
379
+ }
380
+ async getRunStatus(_runId) {
381
+ throw new Error(RUN_LIFECYCLE_UNSUPPORTED);
382
+ }
383
+ async getRunResult(_runId, _options) {
384
+ throw new Error(RUN_LIFECYCLE_UNSUPPORTED);
385
+ }
386
+ }
387
+ const RUN_LIFECYCLE_UNSUPPORTED = "Run lifecycle (start/status/result/poll) is not supported by the pipelex CLI runner. Use the API runner instead (--runner api).";
388
+ /**
389
+ * Normalize the local CLI's models output into the protocol `ModelDeck`.
390
+ *
391
+ * Accepts the deck shape verbatim (`{ models, aliases, waterfalls }`) and maps
392
+ * the legacy `pipelex-agent models` shape (`presets` / nested `aliases` /
393
+ * nested `waterfalls`, keyed by category) by flattening it.
394
+ */
395
+ function toModelDeck(parsed) {
396
+ const root = (parsed && typeof parsed === "object" ? parsed : {});
397
+ if (Array.isArray(root.models)) {
398
+ return {
399
+ models: root.models,
400
+ aliases: root.aliases ?? {},
401
+ waterfalls: root.waterfalls ?? {},
402
+ };
403
+ }
404
+ const models = [];
405
+ const presets = (root.presets ?? {});
406
+ for (const [category, entries] of Object.entries(presets)) {
407
+ if (!Array.isArray(entries))
408
+ continue;
409
+ for (const entry of entries) {
410
+ if (entry && typeof entry.name === "string") {
411
+ models.push({ name: entry.name, type: category });
412
+ }
413
+ }
414
+ }
415
+ const aliases = {};
416
+ const rawAliases = (root.aliases ?? {});
417
+ for (const group of Object.values(rawAliases)) {
418
+ if (group && typeof group === "object")
419
+ Object.assign(aliases, group);
420
+ }
421
+ const waterfalls = {};
422
+ const rawWaterfalls = (root.waterfalls ?? {});
423
+ for (const group of Object.values(rawWaterfalls)) {
424
+ if (group && typeof group === "object")
425
+ Object.assign(waterfalls, group);
342
426
  }
427
+ return { models, aliases, waterfalls };
343
428
  }
344
- //# sourceMappingURL=pipelex-runner.js.map
429
+ //# sourceMappingURL=runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.js","sourceRoot":"","sources":["../../../src/runners/pipelex/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EACL,UAAU,EACV,aAAa,EACb,YAAY,EACZ,WAAW,EACX,MAAM,GACP,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAwBtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAQvD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAE1C,SAAS,UAAU;IACjB,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED,yFAAyF;AACzF,yFAAyF;AACzF,sFAAsF;AACtF,wBAAwB;AACxB,SAAS,iBAAiB,CAAC,IAAY,EAAE,IAAwB;IAC/D,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,IAAI,oBAAoB,CAAC,CAAC,CAAC;IACjE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC;AAED;;;GAGG;AACH,SAAS,kBAAkB,CAAC,GAAW,EAAE,QAAkB;IACzD,IAAI,QAAQ,CAAC,MA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IAC1F,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;QACjD,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AACzC,CAAC"}
@@ -1,12 +1,18 @@
1
1
  import { loadConfig } from "../config/config.js";
2
2
  import { Runners } from "./types.js";
3
- import { ApiRunner } from "./api-runner.js";
4
- import { PipelexRunner } from "./pipelex-runner.js";
3
+ import { MthdsApiClient } from "./api/client.js";
4
+ import { PipelexRunner } from "./pipelex/runner.js";
5
5
  export function createRunner(type, libraryDirs) {
6
- const runnerType = type ?? loadConfig().runner;
6
+ const config = loadConfig();
7
+ const runnerType = type ?? config.runner;
7
8
  switch (runnerType) {
8
9
  case Runners.API:
9
- return new ApiRunner();
10
+ // The API client IS the API runner (parity D8). Defaults flow from the
11
+ // resolved config (file + env), so the CLI honors `~/.mthds/config`.
12
+ return new MthdsApiClient({
13
+ baseUrl: config.baseUrl,
14
+ apiToken: config.apiKey || undefined,
15
+ });
10
16
  case Runners.PIPELEX:
11
17
  return new PipelexRunner(libraryDirs);
12
18
  default:
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/runners/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,UAAU,YAAY,CAC1B,IAAiB,EACjB,WAAsB;IAEtB,MAAM,UAAU,GAAG,IAAI,IAAI,UAAU,EAAE,CAAC,MAAM,CAAC;IAE/C,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,OAAO,CAAC,GAAG;YACd,OAAO,IAAI,SAAS,EAAE,CAAC;QACzB,KAAK,OAAO,CAAC,OAAO;YAClB,OAAO,IAAI,aAAa,CAAC,WAAW,CAAC,CAAC;QACxC;YACE,MAAM,IAAI,KAAK,CAAC,wBAAwB,UAAoB,EAAE,CAAC,CAAC;IACpE,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/runners/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,UAAU,YAAY,CAC1B,IAAiB,EACjB,WAAsB;IAEtB,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;IAC5B,MAAM,UAAU,GAAG,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC;IAEzC,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,OAAO,CAAC,GAAG;YACd,uEAAuE;YACvE,qEAAqE;YACrE,OAAO,IAAI,cAAc,CAAC;gBACxB,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,IAAI,SAAS;aACrC,CAAC,CAAC;QACL,KAAK,OAAO,CAAC,OAAO;YAClB,OAAO,IAAI,aAAa,CAAC,WAAW,CAAC,CAAC;QACxC;YACE,MAAM,IAAI,KAAK,CAAC,wBAAwB,UAAoB,EAAE,CAAC,CAAC;IACpE,CAAC;AACH,CAAC"}
@@ -1,11 +1,13 @@
1
- import type { RunnerProtocol } from "../client/protocol.js";
1
+ import type { MTHDSProtocol } from "../protocol/protocol.js";
2
+ import type { StartOptions } from "../protocol/options.js";
3
+ import type { RunRead, RunResultState, RunResults, WaitForResultOptions } from "./api/runs.js";
4
+ import type { DictPipeOutput } from "./api/models.js";
2
5
  export declare const Runners: {
3
6
  readonly API: "api";
4
7
  readonly PIPELEX: "pipelex";
5
8
  };
6
9
  export type RunnerType = (typeof Runners)[keyof typeof Runners];
7
10
  export declare const RUNNER_NAMES: RunnerType[];
8
- export type PipelineState = "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ERROR" | "STARTED";
9
11
  export type ConceptRepresentationFormat = "json" | "python" | "schema";
10
12
  export interface BuildInputsRequest {
11
13
  mthds_contents: string[];
@@ -20,20 +22,6 @@ export interface BuildRunnerRequest {
20
22
  mthds_contents: string[];
21
23
  pipe_code: string;
22
24
  }
23
- export interface ExecuteRequest {
24
- /** MTHDS bundle content(s) to validate, load, and execute. Omit to run an already-loaded pipe. */
25
- mthds_contents?: string[];
26
- pipe_code?: string;
27
- inputs?: Record<string, unknown>;
28
- }
29
- export interface ValidateRequest {
30
- /** GitHub URL or local path to the method directory (preferred). */
31
- method_url?: string;
32
- /** Pipe code to validate (optional — validates a specific pipe). */
33
- pipe_code?: string;
34
- /** Raw .mthds file content(s). */
35
- mthds_contents?: string[];
36
- }
37
25
  export interface ConceptRequest {
38
26
  spec: Record<string, unknown>;
39
27
  }
@@ -41,6 +29,7 @@ export interface PipeSpecRequest {
41
29
  pipe_type: string;
42
30
  spec: Record<string, unknown>;
43
31
  }
32
+ /** Request for `PipelexRunner.checkModel` — a LOCAL CLI capability only (no API route). */
44
33
  export interface CheckModelRequest {
45
34
  reference: string;
46
35
  type: string;
@@ -52,42 +41,6 @@ export interface BuildRunnerResponse {
52
41
  success: boolean;
53
42
  message: string;
54
43
  }
55
- export interface DictStuff {
56
- concept: string;
57
- content: unknown;
58
- }
59
- export interface DictWorkingMemory {
60
- root: Record<string, DictStuff>;
61
- aliases: Record<string, string>;
62
- }
63
- export interface DictPipeOutput {
64
- working_memory: DictWorkingMemory;
65
- graph_spec?: unknown;
66
- pipeline_run_id: string;
67
- }
68
- export interface PipelineResponse {
69
- pipeline_run_id: string;
70
- created_at: string;
71
- pipeline_state: PipelineState;
72
- finished_at?: string | null;
73
- pipe_output?: DictPipeOutput | null;
74
- main_stuff_name?: string | null;
75
- }
76
- export interface PipelexBundleBlueprint {
77
- source?: string | null;
78
- domain: string;
79
- description?: string | null;
80
- system_prompt?: string | null;
81
- main_pipe?: string | null;
82
- concept?: Record<string, unknown> | null;
83
- pipe?: Record<string, unknown> | null;
84
- }
85
- export interface ValidateResponse {
86
- mthds_contents: string[];
87
- pipelex_bundle_blueprint: PipelexBundleBlueprint;
88
- success: boolean;
89
- message: string;
90
- }
91
44
  export interface ConceptResponse {
92
45
  success: boolean;
93
46
  concept_code: string;
@@ -99,6 +52,7 @@ export interface PipeSpecResponse {
99
52
  pipe_type: string;
100
53
  toml: string;
101
54
  }
55
+ /** Response of `PipelexRunner.checkModel` — a LOCAL CLI capability only (no API route). */
102
56
  export interface CheckModelResponse {
103
57
  success: boolean;
104
58
  valid: boolean;
@@ -106,30 +60,18 @@ export interface CheckModelResponse {
106
60
  suggestions?: string[];
107
61
  [key: string]: unknown;
108
62
  }
109
- export interface ModelsRequest {
110
- type?: string[];
111
- }
112
- export interface ModelsResponse {
113
- success: boolean;
114
- presets: Record<string, Array<{
115
- name: string;
116
- description?: string;
117
- }>>;
118
- aliases: Record<string, Record<string, string>>;
119
- waterfalls: Record<string, Record<string, string[]>>;
120
- talent_mappings: Record<string, Record<string, string>>;
121
- }
122
- export interface Runner extends RunnerProtocol {
63
+ export interface Runner extends MTHDSProtocol<DictPipeOutput> {
123
64
  readonly type: RunnerType;
124
65
  health(): Promise<Record<string, unknown>>;
125
- version(): Promise<Record<string, string>>;
126
66
  buildInputs(request: BuildInputsRequest): Promise<unknown>;
127
67
  buildOutput(request: BuildOutputRequest): Promise<unknown>;
128
68
  buildRunner(request: BuildRunnerRequest): Promise<BuildRunnerResponse>;
129
- execute(request: ExecuteRequest): Promise<PipelineResponse>;
130
- validate(request: ValidateRequest): Promise<ValidateResponse>;
131
69
  concept(request: ConceptRequest): Promise<ConceptResponse>;
132
70
  pipeSpec(request: PipeSpecRequest): Promise<PipeSpecResponse>;
133
- models(request?: ModelsRequest): Promise<ModelsResponse>;
134
- checkModel(request: CheckModelRequest): Promise<CheckModelResponse>;
71
+ getRunStatus(runId: string): Promise<RunRead>;
72
+ getRunResult(runId: string, options?: {
73
+ signal?: AbortSignal;
74
+ }): Promise<RunResultState>;
75
+ waitForResult(runId: string, options?: WaitForResultOptions): Promise<RunResults>;
76
+ startAndWaitForResult(options: StartOptions, pollOptions?: WaitForResultOptions): Promise<RunResults>;
135
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/runners/types.ts"],"names":[],"mappings":"AAEA,uEAAuE;AAEvE,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;CACV,CAAC;AAIX,MAAM,CAAC,MAAM,YAAY,GAAiB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/runners/types.ts"],"names":[],"mappings":"AAUA,uEAAuE;AAEvE,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;CACV,CAAC;AAIX,MAAM,CAAC,MAAM,YAAY,GAAiB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mthds",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "CLI and SDK for MTHDS — the open standard for executable AI methods. Install, execute, and manage methods.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -23,7 +23,9 @@
23
23
  "scripts": {
24
24
  "build": "tsc",
25
25
  "test": "vitest run",
26
- "example": "npx tsx examples/call_api.ts"
26
+ "depcruise": "depcruise --config .dependency-cruiser.cjs src",
27
+ "example": "npx tsx examples/call_api.ts",
28
+ "prepare": "tsc"
27
29
  },
28
30
  "files": [
29
31
  "dist/"
@@ -44,8 +46,9 @@
44
46
  "devDependencies": {
45
47
  "@types/node": "^22.12.0",
46
48
  "@types/semver": "^7.7.1",
49
+ "dependency-cruiser": "^17.4.3",
47
50
  "tsx": "^4.19.0",
48
51
  "typescript": "^5.7.3",
49
52
  "vitest": "^4.0.18"
50
53
  }
51
- }
54
+ }
@@ -1,15 +0,0 @@
1
- import type { RunnerProtocol } from "./protocol.js";
2
- import type { ExecutePipelineOptions, PipelineExecuteResponse, PipelineStartResponse } from "./pipeline.js";
3
- interface MthdsApiClientOptions {
4
- apiToken?: string;
5
- apiBaseUrl?: string;
6
- }
7
- export declare class MthdsApiClient implements RunnerProtocol {
8
- private readonly apiToken;
9
- private readonly apiBaseUrl;
10
- constructor(options?: MthdsApiClientOptions);
11
- private makeApiCall;
12
- executePipeline(options: ExecutePipelineOptions): Promise<PipelineExecuteResponse>;
13
- startPipeline(options: ExecutePipelineOptions): Promise<PipelineStartResponse>;
14
- }
15
- export {};