mthds 0.1.3 → 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/commands/validate.js +1 -1
- package/dist/agent/commands/validate.js.map +1 -1
- package/dist/agent-cli.d.ts +8 -2
- package/dist/agent-cli.js +86 -215
- package/dist/agent-cli.js.map +1 -1
- package/dist/cli/commands/build.d.ts +0 -3
- package/dist/cli/commands/build.js +3 -50
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/index.js +0 -1
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/run.js +1 -1
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/validate.js +1 -1
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli.js +2 -13
- package/dist/cli.js.map +1 -1
- package/dist/client/client.js +6 -6
- package/dist/client/client.js.map +1 -1
- package/dist/client/pipeline.d.ts +2 -2
- package/dist/runners/api-runner.d.ts +5 -2
- package/dist/runners/api-runner.js +20 -3
- package/dist/runners/api-runner.js.map +1 -1
- package/dist/runners/pipelex-runner.d.ts +5 -2
- package/dist/runners/pipelex-runner.js +82 -57
- package/dist/runners/pipelex-runner.js.map +1 -1
- package/dist/runners/types.d.ts +54 -18
- package/package.json +1 -1
- package/dist/agent/commands/build.d.ts +0 -35
- package/dist/agent/commands/build.js +0 -334
- package/dist/agent/commands/build.js.map +0 -1
- package/dist/agent/commands/pipelex.d.ts +0 -16
- package/dist/agent/commands/pipelex.js +0 -118
- package/dist/agent/commands/pipelex.js.map +0 -1
|
@@ -1,30 +1,27 @@
|
|
|
1
1
|
import { execFile, spawn } from "node:child_process";
|
|
2
2
|
import { promisify } from "node:util";
|
|
3
|
-
import { existsSync,
|
|
3
|
+
import { existsSync, writeFileSync, readFileSync, mkdtempSync, rmSync, } from "node:fs";
|
|
4
4
|
import { join } from "node:path";
|
|
5
|
-
import {
|
|
5
|
+
import { tmpdir } from "node:os";
|
|
6
6
|
import { Runners } from "./types.js";
|
|
7
7
|
const execFileAsync = promisify(execFile);
|
|
8
8
|
function makeTmpDir() {
|
|
9
9
|
return mkdtempSync(join(tmpdir(), "mthds-"));
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Write an array of .mthds file contents to a temp directory.
|
|
13
|
+
* Returns the path to the first file (the main bundle).
|
|
13
14
|
*/
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function resolveOutputBase(output) {
|
|
23
|
-
const dir = output ?? getMethodsDir();
|
|
24
|
-
if (!existsSync(dir)) {
|
|
25
|
-
mkdirSync(dir, { recursive: true });
|
|
15
|
+
function writeMthdsContents(tmp, contents) {
|
|
16
|
+
if (contents.length === 0) {
|
|
17
|
+
throw new Error("mthds_contents must contain at least one element");
|
|
18
|
+
}
|
|
19
|
+
const bundlePath = join(tmp, "bundle.mthds");
|
|
20
|
+
writeFileSync(bundlePath, contents[0], "utf-8");
|
|
21
|
+
for (let i = 1; i < contents.length; i++) {
|
|
22
|
+
writeFileSync(join(tmp, `extra_${i}.mthds`), contents[i], "utf-8");
|
|
26
23
|
}
|
|
27
|
-
return
|
|
24
|
+
return bundlePath;
|
|
28
25
|
}
|
|
29
26
|
export class PipelexRunner {
|
|
30
27
|
type = Runners.PIPELEX;
|
|
@@ -87,80 +84,64 @@ export class PipelexRunner {
|
|
|
87
84
|
}
|
|
88
85
|
// ── Build ───────────────────────────────────────────────────────
|
|
89
86
|
// buildInputs and buildOutput have no CLI equivalent.
|
|
90
|
-
// pipelex
|
|
87
|
+
// pipelex-agent inputs bundle <bundle.mthds> --pipe <pipe_code>
|
|
91
88
|
async buildInputs(request) {
|
|
92
89
|
const tmp = makeTmpDir();
|
|
93
90
|
try {
|
|
94
|
-
const bundlePath =
|
|
95
|
-
|
|
96
|
-
const { stdout } = await this.exec([
|
|
97
|
-
"build",
|
|
98
|
-
"inputs",
|
|
99
|
-
bundlePath,
|
|
100
|
-
"--pipe",
|
|
101
|
-
request.pipe_code,
|
|
102
|
-
]);
|
|
91
|
+
const bundlePath = writeMthdsContents(tmp, request.mthds_contents);
|
|
92
|
+
const { stdout } = await execFileAsync("pipelex-agent", ["inputs", "bundle", bundlePath, "--pipe", request.pipe_code, "-L", tmp, ...this.libraryArgs()], { encoding: "utf-8" });
|
|
103
93
|
return JSON.parse(stdout);
|
|
104
94
|
}
|
|
105
95
|
finally {
|
|
106
96
|
rmSync(tmp, { recursive: true, force: true });
|
|
107
97
|
}
|
|
108
98
|
}
|
|
109
|
-
// pipelex build output <bundle.mthds> --pipe <pipe_code> [--format <fmt>]
|
|
99
|
+
// pipelex build output bundle <bundle.mthds> --pipe <pipe_code> [--format <fmt>]
|
|
110
100
|
async buildOutput(request) {
|
|
111
101
|
const tmp = makeTmpDir();
|
|
112
102
|
try {
|
|
113
|
-
const bundlePath =
|
|
114
|
-
writeFileSync(bundlePath, request.mthds_content, "utf-8");
|
|
103
|
+
const bundlePath = writeMthdsContents(tmp, request.mthds_contents);
|
|
115
104
|
const args = [
|
|
116
105
|
"build",
|
|
117
106
|
"output",
|
|
107
|
+
"bundle",
|
|
118
108
|
bundlePath,
|
|
119
109
|
"--pipe",
|
|
120
110
|
request.pipe_code,
|
|
111
|
+
"-L",
|
|
112
|
+
tmp,
|
|
121
113
|
];
|
|
122
114
|
if (request.format) {
|
|
123
115
|
args.push("--format", request.format);
|
|
124
116
|
}
|
|
125
|
-
|
|
117
|
+
args.push(...this.libraryArgs());
|
|
118
|
+
const { stdout } = await execFileAsync("pipelex", args, {
|
|
119
|
+
encoding: "utf-8",
|
|
120
|
+
});
|
|
126
121
|
return JSON.parse(stdout);
|
|
127
122
|
}
|
|
128
123
|
finally {
|
|
129
124
|
rmSync(tmp, { recursive: true, force: true });
|
|
130
125
|
}
|
|
131
126
|
}
|
|
132
|
-
// pipelex build pipe
|
|
133
|
-
async buildPipe(request) {
|
|
134
|
-
const outputDir = resolveOutputBase(request.output);
|
|
135
|
-
await this.execStreaming([
|
|
136
|
-
"build",
|
|
137
|
-
"pipe",
|
|
138
|
-
request.brief,
|
|
139
|
-
"-o",
|
|
140
|
-
outputDir,
|
|
141
|
-
]);
|
|
142
|
-
return {
|
|
143
|
-
mthds_content: "",
|
|
144
|
-
pipelex_bundle_blueprint: {},
|
|
145
|
-
success: true,
|
|
146
|
-
message: `Pipeline built successfully — saved to ${outputDir}`,
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
// pipelex build runner <bundle.mthds> --pipe <pipe_code> -o <file>
|
|
127
|
+
// pipelex build runner bundle <bundle.mthds> --pipe <pipe_code> -o <file>
|
|
150
128
|
async buildRunner(request) {
|
|
151
129
|
const tmp = makeTmpDir();
|
|
152
130
|
try {
|
|
153
|
-
const bundlePath =
|
|
154
|
-
writeFileSync(bundlePath, request.mthds_content, "utf-8");
|
|
131
|
+
const bundlePath = writeMthdsContents(tmp, request.mthds_contents);
|
|
155
132
|
const outPath = join(tmp, "runner.py");
|
|
156
133
|
await this.execStreaming([
|
|
157
134
|
"build",
|
|
158
135
|
"runner",
|
|
136
|
+
"bundle",
|
|
159
137
|
bundlePath,
|
|
160
138
|
"--pipe",
|
|
161
139
|
request.pipe_code,
|
|
162
140
|
"-o",
|
|
163
141
|
outPath,
|
|
142
|
+
"-L",
|
|
143
|
+
tmp,
|
|
144
|
+
...this.libraryArgs(),
|
|
164
145
|
]);
|
|
165
146
|
const pythonCode = readFileSync(outPath, "utf-8");
|
|
166
147
|
return {
|
|
@@ -174,16 +155,60 @@ export class PipelexRunner {
|
|
|
174
155
|
rmSync(tmp, { recursive: true, force: true });
|
|
175
156
|
}
|
|
176
157
|
}
|
|
158
|
+
// ── Spec-to-TOML ────────────────────────────────────────────────
|
|
159
|
+
// pipelex-agent concept --spec <json>
|
|
160
|
+
async concept(request) {
|
|
161
|
+
const { stdout } = await execFileAsync("pipelex-agent", ["concept", "--spec", JSON.stringify(request.spec)], { encoding: "utf-8" });
|
|
162
|
+
return JSON.parse(stdout);
|
|
163
|
+
}
|
|
164
|
+
// pipelex-agent pipe --type <type> --spec <json>
|
|
165
|
+
async pipeSpec(request) {
|
|
166
|
+
const { stdout } = await execFileAsync("pipelex-agent", [
|
|
167
|
+
"pipe",
|
|
168
|
+
"--type",
|
|
169
|
+
request.pipe_type,
|
|
170
|
+
"--spec",
|
|
171
|
+
JSON.stringify(request.spec),
|
|
172
|
+
], { encoding: "utf-8" });
|
|
173
|
+
return JSON.parse(stdout);
|
|
174
|
+
}
|
|
175
|
+
// pipelex-agent check-model <reference> [--type <type>] [--format <format>]
|
|
176
|
+
async checkModel(request) {
|
|
177
|
+
const args = ["check-model", request.reference];
|
|
178
|
+
if (request.type) {
|
|
179
|
+
args.push("--type", request.type);
|
|
180
|
+
}
|
|
181
|
+
if (request.format) {
|
|
182
|
+
args.push("--format", request.format);
|
|
183
|
+
}
|
|
184
|
+
const { stdout } = await execFileAsync("pipelex-agent", args, {
|
|
185
|
+
encoding: "utf-8",
|
|
186
|
+
});
|
|
187
|
+
return JSON.parse(stdout);
|
|
188
|
+
}
|
|
189
|
+
// pipelex-agent models [--type <type>...]
|
|
190
|
+
async models(request) {
|
|
191
|
+
const args = ["models"];
|
|
192
|
+
if (request?.type) {
|
|
193
|
+
for (const t of request.type) {
|
|
194
|
+
args.push("--type", t);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
const { stdout } = await execFileAsync("pipelex-agent", args, {
|
|
198
|
+
encoding: "utf-8",
|
|
199
|
+
});
|
|
200
|
+
return JSON.parse(stdout);
|
|
201
|
+
}
|
|
177
202
|
// ── Pipeline execution ──────────────────────────────────────────
|
|
178
203
|
// pipelex run <target> [--pipe code] [--inputs file] [--output-dir dir]
|
|
179
204
|
async execute(request) {
|
|
180
205
|
const tmp = makeTmpDir();
|
|
181
206
|
try {
|
|
182
207
|
const args = ["run"];
|
|
183
|
-
if (request.
|
|
184
|
-
const bundlePath =
|
|
185
|
-
writeFileSync(bundlePath, request.mthds_content, "utf-8");
|
|
208
|
+
if (request.mthds_contents?.length) {
|
|
209
|
+
const bundlePath = writeMthdsContents(tmp, request.mthds_contents);
|
|
186
210
|
args.push(bundlePath);
|
|
211
|
+
args.push("-L", tmp);
|
|
187
212
|
if (request.pipe_code) {
|
|
188
213
|
args.push("--pipe", request.pipe_code);
|
|
189
214
|
}
|
|
@@ -224,7 +249,7 @@ export class PipelexRunner {
|
|
|
224
249
|
const url = request.method_url;
|
|
225
250
|
if (!url) {
|
|
226
251
|
return {
|
|
227
|
-
|
|
252
|
+
mthds_contents: request.mthds_contents ?? [],
|
|
228
253
|
pipelex_bundle_blueprint: { domain: "local" },
|
|
229
254
|
success: false,
|
|
230
255
|
message: "method_url is required for pipelex validation",
|
|
@@ -237,7 +262,7 @@ export class PipelexRunner {
|
|
|
237
262
|
}
|
|
238
263
|
await this.execStreaming(args);
|
|
239
264
|
return {
|
|
240
|
-
|
|
265
|
+
mthds_contents: request.mthds_contents ?? [],
|
|
241
266
|
pipelex_bundle_blueprint: { domain: "local" },
|
|
242
267
|
success: true,
|
|
243
268
|
message: "Method validated via local CLI",
|
|
@@ -246,7 +271,7 @@ export class PipelexRunner {
|
|
|
246
271
|
catch (err) {
|
|
247
272
|
const message = err instanceof Error ? err.message : "Validation failed";
|
|
248
273
|
return {
|
|
249
|
-
|
|
274
|
+
mthds_contents: request.mthds_contents ?? [],
|
|
250
275
|
pipelex_bundle_blueprint: { domain: "local" },
|
|
251
276
|
success: false,
|
|
252
277
|
message,
|
|
@@ -256,7 +281,7 @@ export class PipelexRunner {
|
|
|
256
281
|
// ── RunnerProtocol implementation ─────────────────────────────────
|
|
257
282
|
async executePipeline(options) {
|
|
258
283
|
const request = {
|
|
259
|
-
|
|
284
|
+
mthds_contents: options.mthds_contents ?? undefined,
|
|
260
285
|
pipe_code: options.pipe_code ?? undefined,
|
|
261
286
|
inputs: options.inputs
|
|
262
287
|
? Object.fromEntries(Object.entries(options.inputs).map(([k, v]) => [k, v]))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipelex-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,
|
|
1
|
+
{"version":3,"file":"pipelex-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,EAEV,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,YAAY,CAAC;AA4BrC,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;;;GAGG;AACH,SAAS,kBAAkB,CAAC,GA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
package/dist/runners/types.d.ts
CHANGED
|
@@ -8,25 +8,21 @@ export declare const RUNNER_NAMES: RunnerType[];
|
|
|
8
8
|
export type PipelineState = "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED" | "ERROR" | "STARTED";
|
|
9
9
|
export type ConceptRepresentationFormat = "json" | "python" | "schema";
|
|
10
10
|
export interface BuildInputsRequest {
|
|
11
|
-
|
|
11
|
+
mthds_contents: string[];
|
|
12
12
|
pipe_code: string;
|
|
13
13
|
}
|
|
14
14
|
export interface BuildOutputRequest {
|
|
15
|
-
|
|
15
|
+
mthds_contents: string[];
|
|
16
16
|
pipe_code: string;
|
|
17
17
|
format?: ConceptRepresentationFormat;
|
|
18
18
|
}
|
|
19
|
-
export interface BuildPipeRequest {
|
|
20
|
-
brief: string;
|
|
21
|
-
output?: string;
|
|
22
|
-
}
|
|
23
19
|
export interface BuildRunnerRequest {
|
|
24
|
-
|
|
20
|
+
mthds_contents: string[];
|
|
25
21
|
pipe_code: string;
|
|
26
22
|
}
|
|
27
23
|
export interface ExecuteRequest {
|
|
28
|
-
/** MTHDS bundle content to validate, load, and execute. Omit to run an already-loaded pipe. */
|
|
29
|
-
|
|
24
|
+
/** MTHDS bundle content(s) to validate, load, and execute. Omit to run an already-loaded pipe. */
|
|
25
|
+
mthds_contents?: string[];
|
|
30
26
|
pipe_code?: string;
|
|
31
27
|
inputs?: Record<string, unknown>;
|
|
32
28
|
}
|
|
@@ -35,14 +31,20 @@ export interface ValidateRequest {
|
|
|
35
31
|
method_url?: string;
|
|
36
32
|
/** Pipe code to validate (optional — validates a specific pipe). */
|
|
37
33
|
pipe_code?: string;
|
|
38
|
-
/** Raw .mthds file content
|
|
39
|
-
|
|
34
|
+
/** Raw .mthds file content(s). */
|
|
35
|
+
mthds_contents?: string[];
|
|
40
36
|
}
|
|
41
|
-
export interface
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
export interface ConceptRequest {
|
|
38
|
+
spec: Record<string, unknown>;
|
|
39
|
+
}
|
|
40
|
+
export interface PipeSpecRequest {
|
|
41
|
+
pipe_type: string;
|
|
42
|
+
spec: Record<string, unknown>;
|
|
43
|
+
}
|
|
44
|
+
export interface CheckModelRequest {
|
|
45
|
+
reference: string;
|
|
46
|
+
type?: string;
|
|
47
|
+
format?: string;
|
|
46
48
|
}
|
|
47
49
|
export interface BuildRunnerResponse {
|
|
48
50
|
python_code: string;
|
|
@@ -81,19 +83,53 @@ export interface PipelexBundleBlueprint {
|
|
|
81
83
|
pipe?: Record<string, unknown> | null;
|
|
82
84
|
}
|
|
83
85
|
export interface ValidateResponse {
|
|
84
|
-
|
|
86
|
+
mthds_contents: string[];
|
|
85
87
|
pipelex_bundle_blueprint: PipelexBundleBlueprint;
|
|
86
88
|
success: boolean;
|
|
87
89
|
message: string;
|
|
88
90
|
}
|
|
91
|
+
export interface ConceptResponse {
|
|
92
|
+
success: boolean;
|
|
93
|
+
concept_code: string;
|
|
94
|
+
toml: string;
|
|
95
|
+
}
|
|
96
|
+
export interface PipeSpecResponse {
|
|
97
|
+
success: boolean;
|
|
98
|
+
pipe_code: string;
|
|
99
|
+
pipe_type: string;
|
|
100
|
+
toml: string;
|
|
101
|
+
}
|
|
102
|
+
export interface CheckModelResponse {
|
|
103
|
+
success: boolean;
|
|
104
|
+
valid: boolean;
|
|
105
|
+
reference: string;
|
|
106
|
+
suggestions?: string[];
|
|
107
|
+
[key: string]: unknown;
|
|
108
|
+
}
|
|
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
|
+
}
|
|
89
122
|
export interface Runner extends RunnerProtocol {
|
|
90
123
|
readonly type: RunnerType;
|
|
91
124
|
health(): Promise<Record<string, unknown>>;
|
|
92
125
|
version(): Promise<Record<string, string>>;
|
|
93
126
|
buildInputs(request: BuildInputsRequest): Promise<unknown>;
|
|
94
127
|
buildOutput(request: BuildOutputRequest): Promise<unknown>;
|
|
95
|
-
buildPipe(request: BuildPipeRequest): Promise<BuildPipeResponse>;
|
|
96
128
|
buildRunner(request: BuildRunnerRequest): Promise<BuildRunnerResponse>;
|
|
97
129
|
execute(request: ExecuteRequest): Promise<PipelineResponse>;
|
|
98
130
|
validate(request: ValidateRequest): Promise<ValidateResponse>;
|
|
131
|
+
concept(request: ConceptRequest): Promise<ConceptResponse>;
|
|
132
|
+
pipeSpec(request: PipeSpecRequest): Promise<PipeSpecResponse>;
|
|
133
|
+
models(request?: ModelsRequest): Promise<ModelsResponse>;
|
|
134
|
+
checkModel(request: CheckModelRequest): Promise<CheckModelResponse>;
|
|
99
135
|
}
|
package/package.json
CHANGED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent build subcommands — generate pipelines, runner code, inputs, and output schemas.
|
|
3
|
-
* Outputs JSON only.
|
|
4
|
-
*/
|
|
5
|
-
import type { RunnerType } from "../../runners/types.js";
|
|
6
|
-
interface WithRunner {
|
|
7
|
-
runner?: RunnerType;
|
|
8
|
-
libraryDir?: string[];
|
|
9
|
-
}
|
|
10
|
-
export declare function agentBuildPipe(brief: string, options: {
|
|
11
|
-
output?: string;
|
|
12
|
-
} & WithRunner): Promise<void>;
|
|
13
|
-
export declare function agentBuildRunnerMethod(name: string, options: {
|
|
14
|
-
pipe?: string;
|
|
15
|
-
output?: string;
|
|
16
|
-
} & WithRunner): Promise<void>;
|
|
17
|
-
export declare function agentBuildRunnerPipe(target: string, options: {
|
|
18
|
-
pipe?: string;
|
|
19
|
-
output?: string;
|
|
20
|
-
} & WithRunner): Promise<void>;
|
|
21
|
-
export declare function agentBuildInputsMethod(name: string, options: {
|
|
22
|
-
pipe?: string;
|
|
23
|
-
} & WithRunner): Promise<void>;
|
|
24
|
-
export declare function agentBuildInputsPipe(target: string, options: {
|
|
25
|
-
pipe?: string;
|
|
26
|
-
} & WithRunner): Promise<void>;
|
|
27
|
-
export declare function agentBuildOutputMethod(name: string, options: {
|
|
28
|
-
pipe?: string;
|
|
29
|
-
format?: string;
|
|
30
|
-
} & WithRunner): Promise<void>;
|
|
31
|
-
export declare function agentBuildOutputPipe(target: string, options: {
|
|
32
|
-
pipe?: string;
|
|
33
|
-
format?: string;
|
|
34
|
-
} & WithRunner): Promise<void>;
|
|
35
|
-
export {};
|