mthds 0.2.0 → 0.3.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/README.md +1 -1
- package/dist/agent/binaries.d.ts +14 -1
- package/dist/agent/binaries.js +21 -6
- package/dist/agent/binaries.js.map +1 -1
- 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/doctor.js +25 -17
- package/dist/agent/commands/doctor.js.map +1 -1
- package/dist/agent/commands/install.js +2 -2
- package/dist/agent/commands/install.js.map +1 -1
- 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/commands/update-check.d.ts +16 -0
- package/dist/agent/commands/update-check.js +169 -0
- package/dist/agent/commands/update-check.js.map +1 -0
- package/dist/agent/commands/upgrade.d.ts +17 -0
- package/dist/agent/commands/upgrade.js +155 -0
- package/dist/agent/commands/upgrade.js.map +1 -0
- package/dist/agent/passthrough.d.ts +1 -0
- package/dist/agent/passthrough.js +93 -32
- package/dist/agent/passthrough.js.map +1 -1
- package/dist/agent/snooze.d.ts +32 -0
- package/dist/agent/snooze.js +108 -0
- package/dist/agent/snooze.js.map +1 -0
- package/dist/agent/update-cache.d.ts +43 -0
- package/dist/agent/update-cache.js +125 -0
- package/dist/agent/update-cache.js.map +1 -0
- package/dist/agent-cli.d.ts +8 -2
- package/dist/agent-cli.js +132 -124
- package/dist/agent-cli.js.map +1 -1
- package/dist/cli/commands/install.js +3 -3
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/config/credentials.d.ts +2 -0
- package/dist/config/credentials.js +64 -33
- package/dist/config/credentials.js.map +1 -1
- package/dist/installer/runtime/installer.d.ts +12 -6
- package/dist/installer/runtime/installer.js +49 -25
- package/dist/installer/runtime/installer.js.map +1 -1
- package/dist/installer/runtime/version-check.d.ts +31 -0
- package/dist/installer/runtime/version-check.js +78 -0
- package/dist/installer/runtime/version-check.js.map +1 -0
- 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
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
CLI and SDK for **methods** — reusable workflows for AI coding agents.
|
|
4
4
|
|
|
5
|
-
The MTHDS open standard is defined at [mthds.ai](https://mthds.ai). Browse and discover public methods on the hub at [mthds.sh](https://mthds.sh).
|
|
5
|
+
The MTHDS open standard is defined at [mthds.ai](https://mthds.ai/latest/). Browse and discover public methods on the hub at [mthds.sh](https://mthds.sh).
|
|
6
6
|
|
|
7
7
|
## What is a method?
|
|
8
8
|
|
package/dist/agent/binaries.d.ts
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared binary metadata for passthrough, auto-install, and doctor commands.
|
|
3
|
+
*
|
|
4
|
+
* version_constraint is a semver range (e.g. ">=0.22.0") checked against the
|
|
5
|
+
* output of `<binary> --version`. Use buildInstallCommand() to get the
|
|
6
|
+
* canonical install command — single source of truth.
|
|
3
7
|
*/
|
|
4
8
|
export interface BinaryRecoveryInfo {
|
|
5
9
|
binary: string;
|
|
6
10
|
package: string;
|
|
7
|
-
|
|
11
|
+
/** PyPI package name for `uv tool install` (may differ from `package`). */
|
|
12
|
+
uv_package: string;
|
|
13
|
+
/** Semver range constraint, e.g. ">=0.22.0". */
|
|
14
|
+
version_constraint: string;
|
|
15
|
+
/** RegExp with one capture group that extracts the semver from `--version` output. */
|
|
16
|
+
version_extract: RegExp;
|
|
8
17
|
install_url: string;
|
|
9
18
|
auto_installable: boolean;
|
|
10
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Build the canonical install/upgrade command string for a binary.
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildInstallCommand(recovery: BinaryRecoveryInfo): string;
|
|
11
24
|
export declare const BINARY_RECOVERY: Record<string, BinaryRecoveryInfo>;
|
package/dist/agent/binaries.js
CHANGED
|
@@ -1,28 +1,43 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared binary metadata for passthrough, auto-install, and doctor commands.
|
|
3
|
+
*
|
|
4
|
+
* version_constraint is a semver range (e.g. ">=0.22.0") checked against the
|
|
5
|
+
* output of `<binary> --version`. Use buildInstallCommand() to get the
|
|
6
|
+
* canonical install command — single source of truth.
|
|
3
7
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Build the canonical install/upgrade command string for a binary.
|
|
10
|
+
*/
|
|
11
|
+
export function buildInstallCommand(recovery) {
|
|
12
|
+
return `uv tool install --upgrade "${recovery.uv_package}${recovery.version_constraint}"`;
|
|
13
|
+
}
|
|
14
|
+
/** Shared version-extract regex: `<name> <semver>` */
|
|
15
|
+
const VERSION_RE = /^[\w-]+\s+(\d+\.\d+\.\d+)/;
|
|
7
16
|
export const BINARY_RECOVERY = {
|
|
8
17
|
pipelex: {
|
|
9
18
|
binary: "pipelex",
|
|
10
19
|
package: "pipelex",
|
|
11
|
-
|
|
20
|
+
uv_package: "pipelex",
|
|
21
|
+
version_constraint: ">=0.22.0",
|
|
22
|
+
version_extract: VERSION_RE,
|
|
12
23
|
install_url: "https://pipelex.com",
|
|
13
24
|
auto_installable: true,
|
|
14
25
|
},
|
|
15
26
|
"pipelex-agent": {
|
|
16
27
|
binary: "pipelex-agent",
|
|
17
28
|
package: "pipelex",
|
|
18
|
-
|
|
29
|
+
uv_package: "pipelex",
|
|
30
|
+
version_constraint: ">=0.22.0",
|
|
31
|
+
version_extract: VERSION_RE,
|
|
19
32
|
install_url: "https://pipelex.com",
|
|
20
33
|
auto_installable: true,
|
|
21
34
|
},
|
|
22
35
|
plxt: {
|
|
23
36
|
binary: "plxt",
|
|
24
37
|
package: "pipelex-tools",
|
|
25
|
-
|
|
38
|
+
uv_package: "pipelex-tools",
|
|
39
|
+
version_constraint: ">=0.3.2",
|
|
40
|
+
version_extract: VERSION_RE,
|
|
26
41
|
install_url: "https://pypi.org/project/pipelex-tools/",
|
|
27
42
|
auto_installable: true,
|
|
28
43
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binaries.js","sourceRoot":"","sources":["../../src/agent/binaries.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"binaries.js","sourceRoot":"","sources":["../../src/agent/binaries.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAeH;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAA4B;IAC9D,OAAO,8BAA8B,QAAQ,CAAC,UAAU,GAAG,QAAQ,CAAC,kBAAkB,GAAG,CAAC;AAC5F,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,GAAG,2BAA2B,CAAC;AAE/C,MAAM,CAAC,MAAM,eAAe,GAAuC;IACjE,OAAO,EAAE;QACP,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,SAAS;QAClB,UAAU,EAAE,SAAS;QACrB,kBAAkB,EAAE,UAAU;QAC9B,eAAe,EAAE,UAAU;QAC3B,WAAW,EAAE,qBAAqB;QAClC,gBAAgB,EAAE,IAAI;KACvB;IACD,eAAe,EAAE;QACf,MAAM,EAAE,eAAe;QACvB,OAAO,EAAE,SAAS;QAClB,UAAU,EAAE,SAAS;QACrB,kBAAkB,EAAE,UAAU;QAC9B,eAAe,EAAE,UAAU;QAC3B,WAAW,EAAE,qBAAqB;QAClC,gBAAgB,EAAE,IAAI;KACvB;IACD,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,eAAe;QACxB,UAAU,EAAE,eAAe;QAC3B,kBAAkB,EAAE,SAAS;QAC7B,eAAe,EAAE,UAAU;QAC3B,WAAW,EAAE,yCAAyC;QACtD,gBAAgB,EAAE,IAAI;KACvB;CACF,CAAC"}
|
|
@@ -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,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