mthds 0.2.0 → 0.2.1
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/agent/commands/api-commands.d.ts +13 -0
- package/dist/agent/commands/api-commands.js +494 -0
- package/dist/agent/commands/api-commands.js.map +1 -0
- package/dist/agent/commands/pipelex-commands.d.ts +13 -0
- package/dist/agent/commands/pipelex-commands.js +63 -0
- package/dist/agent/commands/pipelex-commands.js.map +1 -0
- package/dist/agent/commands/pipelex-passthrough.d.ts +15 -0
- package/dist/agent/commands/pipelex-passthrough.js +43 -0
- package/dist/agent/commands/pipelex-passthrough.js.map +1 -0
- package/dist/agent-cli.d.ts +8 -2
- package/dist/agent-cli.js +85 -113
- package/dist/agent-cli.js.map +1 -1
- package/dist/runners/api-runner.d.ts +2 -2
- package/dist/runners/api-runner.js +2 -2
- package/dist/runners/api-runner.js.map +1 -1
- package/dist/runners/pipelex-runner.d.ts +2 -2
- package/dist/runners/pipelex-runner.js +11 -37
- package/dist/runners/pipelex-runner.js.map +1 -1
- package/dist/runners/types.d.ts +10 -12
- package/package.json +1 -1
- package/dist/agent/commands/build.d.ts +0 -32
- package/dist/agent/commands/build.js +0 -291
- package/dist/agent/commands/build.js.map +0 -1
- package/dist/agent/commands/runner-commands.d.ts +0 -20
- package/dist/agent/commands/runner-commands.js +0 -800
- package/dist/agent/commands/runner-commands.js.map +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API runner commands — registered only when --runner=api.
|
|
3
|
+
*
|
|
4
|
+
* Each command parses CLI args, builds request objects, calls the Runner
|
|
5
|
+
* interface, and wraps results with agentSuccess(). No passthrough logic.
|
|
6
|
+
*/
|
|
7
|
+
import { Command } from "commander";
|
|
8
|
+
import type { Runner } from "../../runners/types.js";
|
|
9
|
+
/**
|
|
10
|
+
* Register all API-runner commands on the program.
|
|
11
|
+
* Only called when --runner=api.
|
|
12
|
+
*/
|
|
13
|
+
export declare function registerApiRunnerCommands(program: Command, makeRunner: () => Runner): void;
|
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API runner commands — registered only when --runner=api.
|
|
3
|
+
*
|
|
4
|
+
* Each command parses CLI args, builds request objects, calls the Runner
|
|
5
|
+
* interface, and wraps results with agentSuccess(). No passthrough logic.
|
|
6
|
+
*/
|
|
7
|
+
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
8
|
+
import { join } from "node:path";
|
|
9
|
+
import { agentError, agentSuccess, AGENT_ERROR_DOMAINS } from "../output.js";
|
|
10
|
+
function collect(val, prev) {
|
|
11
|
+
return [...prev, val];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Register all API-runner commands on the program.
|
|
15
|
+
* Only called when --runner=api.
|
|
16
|
+
*/
|
|
17
|
+
export function registerApiRunnerCommands(program, makeRunner) {
|
|
18
|
+
// ── concept ──
|
|
19
|
+
program
|
|
20
|
+
.command("concept")
|
|
21
|
+
.description("Structure a concept from JSON spec and output TOML")
|
|
22
|
+
.option("--spec <json>", "JSON string with concept specification")
|
|
23
|
+
.option("--spec-file <path>", "Path to JSON file with concept specification")
|
|
24
|
+
.allowUnknownOption()
|
|
25
|
+
.allowExcessArguments(true)
|
|
26
|
+
.exitOverride()
|
|
27
|
+
.action(async (options) => {
|
|
28
|
+
const runner = safeCreateRunner(makeRunner);
|
|
29
|
+
let specStr = options.spec;
|
|
30
|
+
if (!specStr && options.specFile) {
|
|
31
|
+
try {
|
|
32
|
+
specStr = readFileSync(options.specFile, "utf-8");
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
agentError(`Cannot read spec file: ${err.message}`, "IOError", {
|
|
36
|
+
error_domain: AGENT_ERROR_DOMAINS.IO,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (!specStr) {
|
|
41
|
+
agentError("--spec or --spec-file is required.", "ArgumentError", {
|
|
42
|
+
error_domain: AGENT_ERROR_DOMAINS.ARGUMENT,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
const spec = parseJsonOrError(specStr, "--spec");
|
|
46
|
+
try {
|
|
47
|
+
const result = await runner.concept({ spec });
|
|
48
|
+
agentSuccess({ ...result });
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
agentError(err.message, "RunnerError", {
|
|
52
|
+
error_domain: AGENT_ERROR_DOMAINS.RUNNER,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
// ── pipe ──
|
|
57
|
+
program
|
|
58
|
+
.command("pipe")
|
|
59
|
+
.description("Structure a pipe from JSON spec and output TOML")
|
|
60
|
+
.option("--type <type>", "Pipe type (PipeLLM, PipeSequence, etc.)")
|
|
61
|
+
.option("--spec <json>", "JSON string with pipe specification")
|
|
62
|
+
.option("--spec-file <path>", "Path to JSON file with pipe specification")
|
|
63
|
+
.allowUnknownOption()
|
|
64
|
+
.allowExcessArguments(true)
|
|
65
|
+
.exitOverride()
|
|
66
|
+
.action(async (options) => {
|
|
67
|
+
const runner = safeCreateRunner(makeRunner);
|
|
68
|
+
let specStr = options.spec;
|
|
69
|
+
if (!specStr && options.specFile) {
|
|
70
|
+
try {
|
|
71
|
+
specStr = readFileSync(options.specFile, "utf-8");
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
agentError(`Cannot read spec file: ${err.message}`, "IOError", {
|
|
75
|
+
error_domain: AGENT_ERROR_DOMAINS.IO,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (!specStr) {
|
|
80
|
+
agentError("--spec or --spec-file is required.", "ArgumentError", {
|
|
81
|
+
error_domain: AGENT_ERROR_DOMAINS.ARGUMENT,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
const spec = parseJsonOrError(specStr, "--spec");
|
|
85
|
+
const specObj = spec;
|
|
86
|
+
// Accept "pipe_type" as alias for "type" in spec JSON (matches Python tolerance)
|
|
87
|
+
if (specObj.pipe_type && !specObj.type) {
|
|
88
|
+
specObj.type = specObj.pipe_type;
|
|
89
|
+
}
|
|
90
|
+
delete specObj.pipe_type;
|
|
91
|
+
// Resolve: CLI --type takes precedence, then spec.type
|
|
92
|
+
const pipeType = options.type ?? specObj.type;
|
|
93
|
+
if (!pipeType) {
|
|
94
|
+
agentError("Pipe type must be provided either via --type or as 'type' in the spec JSON.", "ArgumentError", { error_domain: AGENT_ERROR_DOMAINS.ARGUMENT });
|
|
95
|
+
}
|
|
96
|
+
// Clean type fields from spec — API expects pipe_type as a separate field
|
|
97
|
+
delete specObj.type;
|
|
98
|
+
try {
|
|
99
|
+
const result = await runner.pipeSpec({ pipe_type: pipeType, spec });
|
|
100
|
+
agentSuccess({ ...result });
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
agentError(err.message, "RunnerError", {
|
|
104
|
+
error_domain: AGENT_ERROR_DOMAINS.RUNNER,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
// ── validate ──
|
|
109
|
+
const validateGroup = program
|
|
110
|
+
.command("validate")
|
|
111
|
+
.description("Validate a method, pipe, or bundle")
|
|
112
|
+
.passThroughOptions()
|
|
113
|
+
.allowUnknownOption();
|
|
114
|
+
validateGroup
|
|
115
|
+
.command("bundle")
|
|
116
|
+
.argument("[target]", "Bundle file (.mthds) or directory")
|
|
117
|
+
.option("--pipe <code>", "Pipe code to validate within the bundle")
|
|
118
|
+
.option("--content <mthds>", "Bundle content as a string")
|
|
119
|
+
.description("Validate a bundle file or content")
|
|
120
|
+
.allowUnknownOption()
|
|
121
|
+
.allowExcessArguments(true)
|
|
122
|
+
.exitOverride()
|
|
123
|
+
.action(async (target, options) => {
|
|
124
|
+
const runner = safeCreateRunner(makeRunner);
|
|
125
|
+
const mthdsContent = resolveContent(target, options.content);
|
|
126
|
+
try {
|
|
127
|
+
const result = await runner.validate({
|
|
128
|
+
mthds_contents: [mthdsContent],
|
|
129
|
+
pipe_code: options.pipe,
|
|
130
|
+
});
|
|
131
|
+
if (result.success) {
|
|
132
|
+
agentSuccess({ ...result });
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
agentError(result.message, "ValidationError", {
|
|
136
|
+
error_domain: AGENT_ERROR_DOMAINS.VALIDATION,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
catch (err) {
|
|
141
|
+
agentError(err.message, "RunnerError", {
|
|
142
|
+
error_domain: AGENT_ERROR_DOMAINS.RUNNER,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
validateGroup
|
|
147
|
+
.command("pipe")
|
|
148
|
+
.argument("<target>", "Pipe code or .mthds bundle file")
|
|
149
|
+
.option("--pipe <code>", "Pipe code to validate")
|
|
150
|
+
.description("Validate a pipe by code or bundle file")
|
|
151
|
+
.allowUnknownOption()
|
|
152
|
+
.allowExcessArguments(true)
|
|
153
|
+
.exitOverride()
|
|
154
|
+
.action(async (target, options) => {
|
|
155
|
+
const runner = safeCreateRunner(makeRunner);
|
|
156
|
+
if (target.endsWith(".mthds")) {
|
|
157
|
+
const mthdsContent = readFileOrError(target);
|
|
158
|
+
try {
|
|
159
|
+
const result = await runner.validate({
|
|
160
|
+
mthds_contents: [mthdsContent],
|
|
161
|
+
pipe_code: options.pipe,
|
|
162
|
+
});
|
|
163
|
+
handleValidateResult(result);
|
|
164
|
+
}
|
|
165
|
+
catch (err) {
|
|
166
|
+
agentError(err.message, "RunnerError", {
|
|
167
|
+
error_domain: AGENT_ERROR_DOMAINS.RUNNER,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
try {
|
|
173
|
+
const result = await runner.validate({ pipe_code: target });
|
|
174
|
+
handleValidateResult(result);
|
|
175
|
+
}
|
|
176
|
+
catch (err) {
|
|
177
|
+
agentError(err.message, "RunnerError", {
|
|
178
|
+
error_domain: AGENT_ERROR_DOMAINS.RUNNER,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
validateGroup
|
|
184
|
+
.command("method")
|
|
185
|
+
.argument("<target>", "Method name, GitHub URL, or local path")
|
|
186
|
+
.option("--pipe <code>", "Pipe code to validate")
|
|
187
|
+
.description("Validate a method")
|
|
188
|
+
.allowUnknownOption()
|
|
189
|
+
.allowExcessArguments(true)
|
|
190
|
+
.exitOverride()
|
|
191
|
+
.action(async (target, options) => {
|
|
192
|
+
const runner = safeCreateRunner(makeRunner);
|
|
193
|
+
try {
|
|
194
|
+
const result = await runner.validate({
|
|
195
|
+
method_url: target,
|
|
196
|
+
pipe_code: options.pipe,
|
|
197
|
+
});
|
|
198
|
+
handleValidateResult(result);
|
|
199
|
+
}
|
|
200
|
+
catch (err) {
|
|
201
|
+
agentError(err.message, "RunnerError", {
|
|
202
|
+
error_domain: AGENT_ERROR_DOMAINS.RUNNER,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
// ── inputs ──
|
|
207
|
+
const inputsGroup = program
|
|
208
|
+
.command("inputs")
|
|
209
|
+
.description("Generate example input JSON for a pipe")
|
|
210
|
+
.passThroughOptions()
|
|
211
|
+
.allowUnknownOption();
|
|
212
|
+
inputsGroup
|
|
213
|
+
.command("bundle")
|
|
214
|
+
.argument("[target]", "Bundle file (.mthds) or directory")
|
|
215
|
+
.option("--pipe <code>", "Pipe code to generate inputs for")
|
|
216
|
+
.option("--content <mthds>", "Bundle content as a string")
|
|
217
|
+
.description("Generate inputs from a bundle file or content")
|
|
218
|
+
.allowUnknownOption()
|
|
219
|
+
.allowExcessArguments(true)
|
|
220
|
+
.exitOverride()
|
|
221
|
+
.action(async (target, options) => {
|
|
222
|
+
const runner = safeCreateRunner(makeRunner);
|
|
223
|
+
const mthdsContent = resolveContent(target, options.content);
|
|
224
|
+
const pipeCode = resolvePipeCode(mthdsContent, options.pipe);
|
|
225
|
+
try {
|
|
226
|
+
const result = await runner.buildInputs({
|
|
227
|
+
mthds_contents: [mthdsContent],
|
|
228
|
+
pipe_code: pipeCode,
|
|
229
|
+
});
|
|
230
|
+
agentSuccess({ success: true, pipe_code: pipeCode, inputs: result });
|
|
231
|
+
}
|
|
232
|
+
catch (err) {
|
|
233
|
+
agentError(err.message, "RunnerError", {
|
|
234
|
+
error_domain: AGENT_ERROR_DOMAINS.RUNNER,
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
inputsGroup
|
|
239
|
+
.command("pipe")
|
|
240
|
+
.argument("<target>", "Bundle file (.mthds) or pipe code")
|
|
241
|
+
.option("--pipe <code>", "Pipe code to generate inputs for")
|
|
242
|
+
.description("Generate inputs for a pipe")
|
|
243
|
+
.allowUnknownOption()
|
|
244
|
+
.allowExcessArguments(true)
|
|
245
|
+
.exitOverride()
|
|
246
|
+
.action(async (target, options) => {
|
|
247
|
+
const runner = safeCreateRunner(makeRunner);
|
|
248
|
+
if (target.endsWith(".mthds")) {
|
|
249
|
+
const mthdsContent = readFileOrError(target);
|
|
250
|
+
const pipeCode = resolvePipeCode(mthdsContent, options.pipe);
|
|
251
|
+
try {
|
|
252
|
+
const result = await runner.buildInputs({
|
|
253
|
+
mthds_contents: [mthdsContent],
|
|
254
|
+
pipe_code: pipeCode,
|
|
255
|
+
});
|
|
256
|
+
agentSuccess({ success: true, pipe_code: pipeCode, inputs: result });
|
|
257
|
+
}
|
|
258
|
+
catch (err) {
|
|
259
|
+
agentError(err.message, "RunnerError", {
|
|
260
|
+
error_domain: AGENT_ERROR_DOMAINS.RUNNER,
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
agentError("Pipe code without a bundle file is not supported yet. Provide a .mthds file.", "ArgumentError", { error_domain: AGENT_ERROR_DOMAINS.ARGUMENT });
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
inputsGroup
|
|
269
|
+
.command("method")
|
|
270
|
+
.argument("<name>", "Method name")
|
|
271
|
+
.option("--pipe <code>", "Pipe code to generate inputs for")
|
|
272
|
+
.description("Generate inputs for an installed method")
|
|
273
|
+
.allowUnknownOption()
|
|
274
|
+
.allowExcessArguments(true)
|
|
275
|
+
.exitOverride()
|
|
276
|
+
.action(async () => {
|
|
277
|
+
agentError("'inputs method' is not yet supported via the API runner.", "UnsupportedError", { error_domain: AGENT_ERROR_DOMAINS.RUNNER });
|
|
278
|
+
});
|
|
279
|
+
// ── run ──
|
|
280
|
+
const runGroup = program
|
|
281
|
+
.command("run")
|
|
282
|
+
.description("Execute a pipeline")
|
|
283
|
+
.passThroughOptions()
|
|
284
|
+
.allowUnknownOption();
|
|
285
|
+
runGroup
|
|
286
|
+
.command("method")
|
|
287
|
+
.argument("<name>", "Name of the installed method")
|
|
288
|
+
.option("--pipe <code>", "Pipe code (overrides method's main_pipe)")
|
|
289
|
+
.option("-i, --inputs <file>", "Path to JSON inputs file")
|
|
290
|
+
.description("Run an installed method by name")
|
|
291
|
+
.allowUnknownOption()
|
|
292
|
+
.allowExcessArguments(true)
|
|
293
|
+
.exitOverride()
|
|
294
|
+
.action(async () => {
|
|
295
|
+
agentError("'run method' is not yet supported via the API runner.", "UnsupportedError", { error_domain: AGENT_ERROR_DOMAINS.RUNNER });
|
|
296
|
+
});
|
|
297
|
+
const runAction = async (target, options) => {
|
|
298
|
+
if (options.dryRun || options.mockInputs) {
|
|
299
|
+
agentError("--dry-run and --mock-inputs are not yet supported via the API runner.", "UnsupportedError", { error_domain: AGENT_ERROR_DOMAINS.RUNNER });
|
|
300
|
+
}
|
|
301
|
+
const runner = safeCreateRunner(makeRunner);
|
|
302
|
+
const mthdsContent = resolveContentForRun(target, options);
|
|
303
|
+
const pipeCode = resolvePipeCode(mthdsContent, options.pipe);
|
|
304
|
+
let inputs;
|
|
305
|
+
if (options.inputsJson) {
|
|
306
|
+
inputs = parseJsonOrError(options.inputsJson, "--inputs-json");
|
|
307
|
+
}
|
|
308
|
+
else if (options.inputs) {
|
|
309
|
+
const raw = readFileOrError(options.inputs);
|
|
310
|
+
inputs = parseJsonOrError(raw, "inputs file");
|
|
311
|
+
}
|
|
312
|
+
try {
|
|
313
|
+
const result = await runner.execute({
|
|
314
|
+
mthds_contents: [mthdsContent],
|
|
315
|
+
pipe_code: pipeCode,
|
|
316
|
+
inputs,
|
|
317
|
+
});
|
|
318
|
+
agentSuccess({ ...result });
|
|
319
|
+
}
|
|
320
|
+
catch (err) {
|
|
321
|
+
agentError(err.message, "RunnerError", {
|
|
322
|
+
error_domain: AGENT_ERROR_DOMAINS.RUNNER,
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
runGroup
|
|
327
|
+
.command("pipe")
|
|
328
|
+
.argument("[target]", "Bundle file (.mthds) or directory")
|
|
329
|
+
.option("--pipe <code>", "Pipe code to run")
|
|
330
|
+
.option("-i, --inputs <file>", "Path to JSON inputs file")
|
|
331
|
+
.option("--content <mthds>", "Bundle content as a string")
|
|
332
|
+
.option("--inputs-json <json>", "Inputs as a JSON string")
|
|
333
|
+
.option("--dry-run", "Validate without executing")
|
|
334
|
+
.option("--mock-inputs", "Use mock inputs for dry run")
|
|
335
|
+
.description("Run a pipe from a bundle file, directory, or content")
|
|
336
|
+
.allowUnknownOption()
|
|
337
|
+
.allowExcessArguments(true)
|
|
338
|
+
.exitOverride()
|
|
339
|
+
.action(runAction);
|
|
340
|
+
runGroup
|
|
341
|
+
.command("bundle")
|
|
342
|
+
.argument("[target]", "Bundle file (.mthds) or directory")
|
|
343
|
+
.option("--pipe <code>", "Pipe code to run")
|
|
344
|
+
.option("-i, --inputs <file>", "Path to JSON inputs file")
|
|
345
|
+
.option("--content <mthds>", "Bundle content as a string")
|
|
346
|
+
.option("--inputs-json <json>", "Inputs as a JSON string")
|
|
347
|
+
.description("Run a bundle file or content")
|
|
348
|
+
.allowUnknownOption()
|
|
349
|
+
.allowExcessArguments(true)
|
|
350
|
+
.exitOverride()
|
|
351
|
+
.action(runAction);
|
|
352
|
+
// ── models ──
|
|
353
|
+
program
|
|
354
|
+
.command("models")
|
|
355
|
+
.description("List available model presets, aliases, and waterfalls")
|
|
356
|
+
.option("--type <type>", "Filter by model category (repeatable)", collect, [])
|
|
357
|
+
.allowUnknownOption()
|
|
358
|
+
.allowExcessArguments(true)
|
|
359
|
+
.exitOverride()
|
|
360
|
+
.action(async (options) => {
|
|
361
|
+
const runner = safeCreateRunner(makeRunner);
|
|
362
|
+
try {
|
|
363
|
+
const request = options.type?.length ? { type: options.type } : undefined;
|
|
364
|
+
const result = await runner.models(request);
|
|
365
|
+
agentSuccess({ ...result });
|
|
366
|
+
}
|
|
367
|
+
catch (err) {
|
|
368
|
+
agentError(err.message, "RunnerError", {
|
|
369
|
+
error_domain: AGENT_ERROR_DOMAINS.RUNNER,
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
// ── check-model ──
|
|
374
|
+
program
|
|
375
|
+
.command("check-model")
|
|
376
|
+
.description("Validate a model reference with fuzzy suggestions")
|
|
377
|
+
.argument("<reference>", "Model reference to check")
|
|
378
|
+
.option("--type <type>", "Model category (llm, extract, img_gen, search)")
|
|
379
|
+
.option("--format <format>", "Output format (markdown, json)")
|
|
380
|
+
.allowUnknownOption()
|
|
381
|
+
.allowExcessArguments(true)
|
|
382
|
+
.exitOverride()
|
|
383
|
+
.action(async (reference, options) => {
|
|
384
|
+
const runner = safeCreateRunner(makeRunner);
|
|
385
|
+
try {
|
|
386
|
+
const result = await runner.checkModel({ reference, type: options.type, format: options.format });
|
|
387
|
+
agentSuccess({ ...result });
|
|
388
|
+
}
|
|
389
|
+
catch (err) {
|
|
390
|
+
agentError(err.message, "RunnerError", {
|
|
391
|
+
error_domain: AGENT_ERROR_DOMAINS.RUNNER,
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
// ── Helpers ──
|
|
397
|
+
function safeCreateRunner(makeRunner) {
|
|
398
|
+
try {
|
|
399
|
+
return makeRunner();
|
|
400
|
+
}
|
|
401
|
+
catch (err) {
|
|
402
|
+
agentError(err.message, "RunnerError", {
|
|
403
|
+
error_domain: AGENT_ERROR_DOMAINS.RUNNER,
|
|
404
|
+
});
|
|
405
|
+
throw err; // unreachable, agentError exits
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
function parseJsonOrError(raw, label) {
|
|
409
|
+
try {
|
|
410
|
+
return JSON.parse(raw);
|
|
411
|
+
}
|
|
412
|
+
catch {
|
|
413
|
+
agentError(`${label} must be valid JSON.`, "ArgumentError", {
|
|
414
|
+
error_domain: AGENT_ERROR_DOMAINS.ARGUMENT,
|
|
415
|
+
});
|
|
416
|
+
throw new Error("unreachable");
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
function readFileOrError(path) {
|
|
420
|
+
try {
|
|
421
|
+
return readFileSync(path, "utf-8");
|
|
422
|
+
}
|
|
423
|
+
catch (err) {
|
|
424
|
+
agentError(`Cannot read file: ${err.message}`, "IOError", {
|
|
425
|
+
error_domain: AGENT_ERROR_DOMAINS.IO,
|
|
426
|
+
});
|
|
427
|
+
throw err;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
// TODO: resolveContent() doesn't handle directory targets (unlike resolveContentForRun()).
|
|
431
|
+
// validate bundle and inputs bundle use this function and will fail when passed a directory.
|
|
432
|
+
function resolveContent(target, content) {
|
|
433
|
+
if (content)
|
|
434
|
+
return content;
|
|
435
|
+
if (target)
|
|
436
|
+
return readFileOrError(target);
|
|
437
|
+
agentError("Either <target> or --content is required.", "ArgumentError", {
|
|
438
|
+
error_domain: AGENT_ERROR_DOMAINS.ARGUMENT,
|
|
439
|
+
});
|
|
440
|
+
throw new Error("unreachable");
|
|
441
|
+
}
|
|
442
|
+
function resolveContentForRun(target, options) {
|
|
443
|
+
if (options.content)
|
|
444
|
+
return options.content;
|
|
445
|
+
if (!target) {
|
|
446
|
+
agentError("Either <target> or --content is required.", "ArgumentError", {
|
|
447
|
+
error_domain: AGENT_ERROR_DOMAINS.ARGUMENT,
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
let bundlePath = target;
|
|
451
|
+
if (existsSync(target) && statSync(target).isDirectory()) {
|
|
452
|
+
const candidate = join(target, "bundle.mthds");
|
|
453
|
+
if (existsSync(candidate)) {
|
|
454
|
+
bundlePath = candidate;
|
|
455
|
+
}
|
|
456
|
+
else {
|
|
457
|
+
agentError(`No bundle.mthds found in directory: ${target}`, "IOError", {
|
|
458
|
+
error_domain: AGENT_ERROR_DOMAINS.IO,
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
// TODO: refactor to return { bundleContent, resolvedInputsPath } instead of mutating
|
|
462
|
+
// the caller's options object. This side-effect coupling is fragile — if the call
|
|
463
|
+
// order in runAction changes, auto-discovery silently breaks with no compile-time signal.
|
|
464
|
+
if (!options.inputs && !options.inputsJson) {
|
|
465
|
+
const inputsCandidate = join(target, "inputs.json");
|
|
466
|
+
if (existsSync(inputsCandidate)) {
|
|
467
|
+
options.inputs = inputsCandidate;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
return readFileOrError(bundlePath);
|
|
472
|
+
}
|
|
473
|
+
function resolvePipeCode(mthdsContent, pipeCodeOption) {
|
|
474
|
+
if (pipeCodeOption)
|
|
475
|
+
return pipeCodeOption;
|
|
476
|
+
const match = mthdsContent.match(/^main_pipe\s*=\s*"([^"]+)"/m);
|
|
477
|
+
if (match?.[1])
|
|
478
|
+
return match[1];
|
|
479
|
+
agentError("Could not determine pipe code. Use --pipe to specify it.", "ArgumentError", {
|
|
480
|
+
error_domain: AGENT_ERROR_DOMAINS.ARGUMENT,
|
|
481
|
+
});
|
|
482
|
+
throw new Error("unreachable");
|
|
483
|
+
}
|
|
484
|
+
function handleValidateResult(result) {
|
|
485
|
+
if (result.success) {
|
|
486
|
+
agentSuccess({ ...result });
|
|
487
|
+
}
|
|
488
|
+
else {
|
|
489
|
+
agentError(result.message, "ValidationError", {
|
|
490
|
+
error_domain: AGENT_ERROR_DOMAINS.VALIDATION,
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
//# sourceMappingURL=api-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-commands.js","sourceRoot":"","sources":["../../../src/agent/commands/api-commands.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAG7E,SAAS,OAAO,CAAC,GAAW,EAAE,IAAc;IAC1C,OAAO,CAAC,GAAG,IAAI,EAAE,GAAG,CAAC,CAAC;AACxB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CACvC,OAAgB,EAChB,UAAwB;IAGxB,gBAAgB;IAEhB,OAAO;SACJ,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,oDAAoD,CAAC;SACjE,MAAM,CAAC,eAAe,EAAE,wCAAwC,CAAC;SACjE,MAAM,CAAC,oBAAoB,EAAE,8CAA8C,CAAC;SAC5E,kBAAkB,EAAE;SACpB,oBAAoB,CAAC,IAAI,CAAC;SAC1B,YAAY,EAAE;SACd,MAAM,CAAC,KAAK,EAAE,OAA6C,EAAE,EAAE;QAC9D,MAAM,MAAM,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAE5C,IAAI,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;QAC3B,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YACjC,IAAI,CAAC;gBACH,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,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0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pipelex runner stub commands — registered only when --runner=pipelex (default).
|
|
3
|
+
*
|
|
4
|
+
* Each command is a thin stub that makes the command visible in --help,
|
|
5
|
+
* then delegates to passthroughToPipelexAgent() which forwards the full
|
|
6
|
+
* argv to pipelex-agent.
|
|
7
|
+
*/
|
|
8
|
+
import type { Command } from "commander";
|
|
9
|
+
/**
|
|
10
|
+
* Register all runner-aware commands as passthrough stubs.
|
|
11
|
+
* Only called when --runner=pipelex (default).
|
|
12
|
+
*/
|
|
13
|
+
export declare function registerPipelexRunnerCommands(program: Command, getAutoInstall: () => boolean): void;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pipelex runner stub commands — registered only when --runner=pipelex (default).
|
|
3
|
+
*
|
|
4
|
+
* Each command is a thin stub that makes the command visible in --help,
|
|
5
|
+
* then delegates to passthroughToPipelexAgent() which forwards the full
|
|
6
|
+
* argv to pipelex-agent.
|
|
7
|
+
*/
|
|
8
|
+
import { passthroughToPipelexAgent } from "./pipelex-passthrough.js";
|
|
9
|
+
/**
|
|
10
|
+
* Register all runner-aware commands as passthrough stubs.
|
|
11
|
+
* Only called when --runner=pipelex (default).
|
|
12
|
+
*/
|
|
13
|
+
export function registerPipelexRunnerCommands(program, getAutoInstall) {
|
|
14
|
+
const action = () => {
|
|
15
|
+
passthroughToPipelexAgent(getAutoInstall());
|
|
16
|
+
};
|
|
17
|
+
const stub = (cmd) => cmd.allowUnknownOption().allowExcessArguments(true).exitOverride().action(action);
|
|
18
|
+
// ── concept ──
|
|
19
|
+
stub(program
|
|
20
|
+
.command("concept")
|
|
21
|
+
.description("Structure a concept from JSON spec and output TOML"));
|
|
22
|
+
// ── pipe ──
|
|
23
|
+
stub(program
|
|
24
|
+
.command("pipe")
|
|
25
|
+
.description("Structure a pipe from JSON spec and output TOML"));
|
|
26
|
+
// ── validate ──
|
|
27
|
+
const validateGroup = program
|
|
28
|
+
.command("validate")
|
|
29
|
+
.description("Validate a method, pipe, or bundle")
|
|
30
|
+
.passThroughOptions()
|
|
31
|
+
.allowUnknownOption();
|
|
32
|
+
stub(validateGroup.command("bundle").argument("[target]", "Bundle file (.mthds) or directory").description("Validate a bundle file or content"));
|
|
33
|
+
stub(validateGroup.command("pipe").argument("<target>", "Pipe code or .mthds bundle file").description("Validate a pipe by code or bundle file"));
|
|
34
|
+
stub(validateGroup.command("method").argument("<target>", "Method name, GitHub URL, or local path").description("Validate a method"));
|
|
35
|
+
// ── run ──
|
|
36
|
+
const runGroup = program
|
|
37
|
+
.command("run")
|
|
38
|
+
.description("Execute a pipeline")
|
|
39
|
+
.passThroughOptions()
|
|
40
|
+
.allowUnknownOption();
|
|
41
|
+
stub(runGroup.command("method").argument("<name>", "Name of the installed method").description("Run an installed method by name"));
|
|
42
|
+
stub(runGroup.command("pipe").argument("[target]", "Bundle file (.mthds) or directory").description("Run a pipe from a bundle file, directory, or content"));
|
|
43
|
+
stub(runGroup.command("bundle").argument("[target]", "Bundle file (.mthds) or directory").description("Run a bundle file or content"));
|
|
44
|
+
// ── models ──
|
|
45
|
+
stub(program
|
|
46
|
+
.command("models")
|
|
47
|
+
.description("List available model presets, aliases, and waterfalls"));
|
|
48
|
+
// ── check-model ──
|
|
49
|
+
stub(program
|
|
50
|
+
.command("check-model")
|
|
51
|
+
.argument("<reference>", "Model reference to check")
|
|
52
|
+
.description("Validate a model reference with fuzzy suggestions"));
|
|
53
|
+
// ── inputs ──
|
|
54
|
+
const inputsGroup = program
|
|
55
|
+
.command("inputs")
|
|
56
|
+
.description("Generate example input JSON for a pipe")
|
|
57
|
+
.passThroughOptions()
|
|
58
|
+
.allowUnknownOption();
|
|
59
|
+
stub(inputsGroup.command("bundle").argument("[target]", "Bundle file (.mthds) or directory").description("Generate inputs from a bundle file or content"));
|
|
60
|
+
stub(inputsGroup.command("pipe").argument("<target>", "Bundle file (.mthds) or pipe code").description("Generate inputs for a pipe"));
|
|
61
|
+
stub(inputsGroup.command("method").argument("<name>", "Method name").description("Generate inputs for an installed method"));
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=pipelex-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipelex-commands.js","sourceRoot":"","sources":["../../../src/agent/commands/pipelex-commands.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE;;;GAGG;AACH,MAAM,UAAU,6BAA6B,CAC3C,OAAgB,EAChB,cAA6B;IAE7B,MAAM,MAAM,GAAG,GAAG,EAAE;QAClB,yBAAyB,CAAC,cAAc,EAAE,CAAC,CAAC;IAC9C,CAAC,CAAC;IAEF,MAAM,IAAI,GAAG,CAAC,GAAY,EAAE,EAAE,CAC5B,GAAG,CAAC,kBAAkB,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAEpF,gBAAgB;IAEhB,IAAI,CACF,OAAO;SACJ,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,oDAAoD,CAAC,CACrE,CAAC;IAEF,aAAa;IAEb,IAAI,CACF,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,iDAAiD,CAAC,CAClE,CAAC;IAEF,iBAAiB;IAEjB,MAAM,aAAa,GAAG,OAAO;SAC1B,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,oCAAoC,CAAC;SACjD,kBAAkB,EAAE;SACpB,kBAAkB,EAAE,CAAC;IAExB,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,UAAU,EAAE,mCAAmC,CAAC,CAAC,WAAW,CAAC,mCAAmC,CAAC,CAAC,CAAC;IACjJ,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,UAAU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IAExB,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,UAAU,EAAE,mCAAmC,CAAC,CAAC,WAAW,CAAC,+CAA+C,CAAC,CAAC,CAAC;IAC3J,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,UAAU,EAAE,mCAAmC,CAAC,CAAC,WAAW,CAAC,4BAA4B,CAAC,CAAC,CAAC;IACtI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,WAAW,CAAC,yCAAyC,CAAC,CAAC,CAAC;AAC/H,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catch-all passthrough to pipelex-agent.
|
|
3
|
+
*
|
|
4
|
+
* Strips mthds-agent-only flags (--runner, --auto-install) from argv
|
|
5
|
+
* and forwards everything else verbatim to pipelex-agent.
|
|
6
|
+
* Flags understood by pipelex-agent (--log-level, -L) are kept.
|
|
7
|
+
*/
|
|
8
|
+
/** Extract args for pipelex-agent by stripping mthds-agent-only flags. */
|
|
9
|
+
export declare function extractArgsForPipelexAgent(): string[];
|
|
10
|
+
/**
|
|
11
|
+
* Forward all remaining args to pipelex-agent as passthrough.
|
|
12
|
+
* This is the only code path for the pipelex runner.
|
|
13
|
+
* passthrough() calls process.exit(), so this never returns.
|
|
14
|
+
*/
|
|
15
|
+
export declare function passthroughToPipelexAgent(autoInstall: boolean): void;
|