mthds 0.0.2 → 0.0.4
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 +80 -3
- package/dist/cli.js +106 -4
- package/dist/cli.js.map +1 -1
- package/dist/client/client.d.ts +15 -0
- package/dist/client/client.js +64 -0
- package/dist/client/client.js.map +1 -0
- package/dist/client/exceptions.d.ts +6 -0
- package/dist/client/exceptions.js +13 -0
- package/dist/client/exceptions.js.map +1 -0
- package/dist/client/index.d.ts +5 -0
- package/dist/client/index.js +3 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/models/index.d.ts +4 -0
- package/dist/client/models/index.js +2 -0
- package/dist/client/models/index.js.map +1 -0
- package/dist/client/models/pipe_output.d.ts +2 -0
- package/dist/client/models/pipe_output.js +2 -0
- package/dist/client/models/pipe_output.js.map +1 -0
- package/dist/client/models/pipeline_inputs.d.ts +3 -0
- package/dist/client/models/pipeline_inputs.js +2 -0
- package/dist/client/models/pipeline_inputs.js.map +1 -0
- package/dist/client/models/stuff.d.ts +1 -0
- package/dist/client/models/stuff.js +2 -0
- package/dist/client/models/stuff.js.map +1 -0
- package/dist/client/models/working_memory.d.ts +1 -0
- package/dist/client/models/working_memory.js +2 -0
- package/dist/client/models/working_memory.js.map +1 -0
- package/dist/client/pipeline.d.ts +36 -0
- package/dist/client/pipeline.js +2 -0
- package/dist/client/pipeline.js.map +1 -0
- package/dist/client/protocol.d.ts +5 -0
- package/dist/client/protocol.js +2 -0
- package/dist/client/protocol.js.map +1 -0
- package/dist/commands/build.d.ts +19 -0
- package/dist/commands/build.js +128 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/index.js +21 -10
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/run.d.ts +11 -0
- package/dist/commands/run.js +44 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/runner.d.ts +2 -0
- package/dist/commands/runner.js +59 -0
- package/dist/commands/runner.js.map +1 -0
- package/dist/commands/setup.js +27 -8
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/validate.d.ts +6 -0
- package/dist/commands/validate.js +41 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/runners/api-runner.d.ts +18 -0
- package/dist/runners/api-runner.js +66 -0
- package/dist/runners/api-runner.js.map +1 -0
- package/dist/runners/pipelex-runner.d.ts +13 -0
- package/dist/runners/pipelex-runner.js +159 -0
- package/dist/runners/pipelex-runner.js.map +1 -0
- package/dist/runners/registry.d.ts +2 -0
- package/dist/runners/registry.js +15 -0
- package/dist/runners/registry.js.map +1 -0
- package/dist/runners/types.d.ts +81 -5
- package/dist/telemetry/posthog.js +0 -1
- package/dist/telemetry/posthog.js.map +1 -1
- package/package.json +13 -3
package/README.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# mthds
|
|
2
2
|
|
|
3
|
-
CLI
|
|
3
|
+
CLI and SDK for **methods** — reusable workflows for AI coding agents.
|
|
4
4
|
|
|
5
5
|
## What is a method?
|
|
6
6
|
|
|
7
7
|
A method is a packaged workflow that an AI agent (like Claude Code) can use. Methods are stored in a registry and installed locally via their unique slug.
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## CLI Usage
|
|
10
|
+
|
|
11
|
+
### Install a method
|
|
10
12
|
|
|
11
13
|
```bash
|
|
12
14
|
npx mthds install <slug>
|
|
@@ -27,7 +29,7 @@ The CLI will:
|
|
|
27
29
|
| Local | `<cwd>/.claude/methods/<slug>/` |
|
|
28
30
|
| Global | `~/.claude/methods/<slug>/` |
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
### Install software runtime
|
|
31
33
|
|
|
32
34
|
```bash
|
|
33
35
|
npx mthds setup software pipelex
|
|
@@ -35,6 +37,81 @@ npx mthds setup software pipelex
|
|
|
35
37
|
|
|
36
38
|
Installs [uv](https://docs.astral.sh/uv/) and [pipelex](https://pipelex.dev) so methods that depend on them can run.
|
|
37
39
|
|
|
40
|
+
## SDK Usage
|
|
41
|
+
|
|
42
|
+
Install the package:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm install mthds
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Basic example
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
import { MthdsApiClient } from "mthds";
|
|
52
|
+
|
|
53
|
+
const client = new MthdsApiClient({
|
|
54
|
+
apiBaseUrl: "https://api.pipelex.com",
|
|
55
|
+
apiToken: "your-api-key",
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const result = await client.executePipeline({
|
|
59
|
+
pipe_code: "my-pipeline",
|
|
60
|
+
inputs: {
|
|
61
|
+
topic: "quantum computing",
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
console.log(result.pipe_output);
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The hosted API at `https://api.pipelex.com` is coming soon. In the meantime, you can run the API yourself.
|
|
69
|
+
|
|
70
|
+
### Self-hosted API
|
|
71
|
+
|
|
72
|
+
Point the client to your own server:
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
const client = new MthdsApiClient({
|
|
76
|
+
apiBaseUrl: "http://localhost:8081",
|
|
77
|
+
apiToken: "your-api-key",
|
|
78
|
+
});
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Environment variables
|
|
82
|
+
|
|
83
|
+
Instead of passing options to the constructor, you can set environment variables:
|
|
84
|
+
|
|
85
|
+
| Variable | Description |
|
|
86
|
+
|----------|-------------|
|
|
87
|
+
| `MTHDS_API_BASE_URL` | Base URL of the API |
|
|
88
|
+
| `MTHDS_API_KEY` | API authentication token |
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
// Reads MTHDS_API_BASE_URL and MTHDS_API_KEY from the environment
|
|
92
|
+
const client = new MthdsApiClient();
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Methods
|
|
96
|
+
|
|
97
|
+
| Method | Description |
|
|
98
|
+
|--------|-------------|
|
|
99
|
+
| `executePipeline(options)` | Execute a pipeline and wait for the result |
|
|
100
|
+
| `startPipeline(options)` | Start a pipeline asynchronously |
|
|
101
|
+
|
|
102
|
+
### Pipeline options
|
|
103
|
+
|
|
104
|
+
| Option | Type | Description |
|
|
105
|
+
|--------|------|-------------|
|
|
106
|
+
| `pipe_code` | `string` | Pipeline code to execute |
|
|
107
|
+
| `mthds_content` | `string` | Raw method content (alternative to `pipe_code`) |
|
|
108
|
+
| `inputs` | `Record<string, string \| string[] \| object>` | Pipeline input variables |
|
|
109
|
+
| `output_name` | `string` | Name of the output to return |
|
|
110
|
+
| `output_multiplicity` | `boolean \| number` | Expected output multiplicity |
|
|
111
|
+
| `dynamic_output_concept_code` | `string` | Dynamic output concept code |
|
|
112
|
+
|
|
113
|
+
Either `pipe_code` or `mthds_content` must be provided.
|
|
114
|
+
|
|
38
115
|
## Telemetry
|
|
39
116
|
|
|
40
117
|
Anonymous usage data (method slug + timestamp) is collected to help rank methods on the leaderboard. No personal or device information is collected.
|
package/dist/cli.js
CHANGED
|
@@ -7,6 +7,13 @@ import { printLogo } from "./commands/index.js";
|
|
|
7
7
|
import { installRunner } from "./commands/setup.js";
|
|
8
8
|
import { installMethod } from "./commands/install.js";
|
|
9
9
|
import { configSet, configGet, configList } from "./commands/config.js";
|
|
10
|
+
import { runPipeline } from "./commands/run.js";
|
|
11
|
+
import { buildPipe, buildRunner, buildInputs, buildOutput, } from "./commands/build.js";
|
|
12
|
+
import { validatePlx } from "./commands/validate.js";
|
|
13
|
+
import { runnerSetDefault, runnerList } from "./commands/runner.js";
|
|
14
|
+
function getRunner(cmd) {
|
|
15
|
+
return cmd.optsWithGlobals().runner;
|
|
16
|
+
}
|
|
10
17
|
const require = createRequire(import.meta.url);
|
|
11
18
|
const pkg = require("../package.json");
|
|
12
19
|
const program = new Command();
|
|
@@ -14,12 +21,81 @@ program
|
|
|
14
21
|
.name("mthds")
|
|
15
22
|
.version(pkg.version)
|
|
16
23
|
.description("CLI bridge to the Pipelex runtime")
|
|
24
|
+
.option("--runner <type>", "Runner to use (api, pipelex)")
|
|
17
25
|
.exitOverride()
|
|
18
26
|
.configureOutput({
|
|
19
27
|
writeOut: () => { },
|
|
20
28
|
writeErr: () => { },
|
|
21
29
|
});
|
|
22
|
-
// mthds
|
|
30
|
+
// ── mthds run <target> ─────────────────────────────────────────────
|
|
31
|
+
program
|
|
32
|
+
.command("run")
|
|
33
|
+
.argument("<target>", "Pipe code or .plx bundle file")
|
|
34
|
+
.option("--pipe <code>", "Pipe code (when target is a bundle)")
|
|
35
|
+
.option("-i, --inputs <file>", "Path to JSON inputs file")
|
|
36
|
+
.option("-o, --output <file>", "Path to save output JSON")
|
|
37
|
+
.option("--no-output", "Skip saving output to file")
|
|
38
|
+
.option("--no-pretty-print", "Skip pretty printing the output")
|
|
39
|
+
.description("Execute a pipeline")
|
|
40
|
+
.exitOverride()
|
|
41
|
+
.action(async (target, options, cmd) => {
|
|
42
|
+
await runPipeline(target, { ...options, runner: getRunner(cmd) });
|
|
43
|
+
});
|
|
44
|
+
// ── mthds build <subcommand> ────────────────────────────────────────
|
|
45
|
+
const build = program
|
|
46
|
+
.command("build")
|
|
47
|
+
.description("Generate pipelines, runner code, inputs, and output schemas")
|
|
48
|
+
.exitOverride();
|
|
49
|
+
build
|
|
50
|
+
.command("pipe")
|
|
51
|
+
.argument("<brief>", "Natural-language description of the pipeline")
|
|
52
|
+
.option("-o, --output <file>", "Path to save the generated .plx file")
|
|
53
|
+
.description("Build a pipeline from a prompt")
|
|
54
|
+
.exitOverride()
|
|
55
|
+
.action(async (brief, options, cmd) => {
|
|
56
|
+
await buildPipe(brief, { ...options, runner: getRunner(cmd) });
|
|
57
|
+
});
|
|
58
|
+
build
|
|
59
|
+
.command("runner")
|
|
60
|
+
.argument("<target>", ".plx bundle file")
|
|
61
|
+
.option("--pipe <code>", "Pipe code to generate runner for")
|
|
62
|
+
.option("-o, --output <file>", "Path to save the generated Python file")
|
|
63
|
+
.description("Generate Python runner code for a pipe")
|
|
64
|
+
.exitOverride()
|
|
65
|
+
.action(async (target, options, cmd) => {
|
|
66
|
+
await buildRunner(target, { ...options, runner: getRunner(cmd) });
|
|
67
|
+
});
|
|
68
|
+
build
|
|
69
|
+
.command("inputs")
|
|
70
|
+
.argument("<target>", ".plx bundle file")
|
|
71
|
+
.requiredOption("--pipe <code>", "Pipe code to generate inputs for")
|
|
72
|
+
.description("Generate example input JSON for a pipe")
|
|
73
|
+
.exitOverride()
|
|
74
|
+
.action(async (target, options, cmd) => {
|
|
75
|
+
await buildInputs(target, { ...options, runner: getRunner(cmd) });
|
|
76
|
+
});
|
|
77
|
+
build
|
|
78
|
+
.command("output")
|
|
79
|
+
.argument("<target>", ".plx bundle file")
|
|
80
|
+
.requiredOption("--pipe <code>", "Pipe code to generate output for")
|
|
81
|
+
.option("--format <format>", "Output format (json, python, schema)", "schema")
|
|
82
|
+
.description("Generate output representation for a pipe")
|
|
83
|
+
.exitOverride()
|
|
84
|
+
.action(async (target, options, cmd) => {
|
|
85
|
+
await buildOutput(target, { ...options, runner: getRunner(cmd) });
|
|
86
|
+
});
|
|
87
|
+
// ── mthds validate <target> ────────────────────────────────────────
|
|
88
|
+
program
|
|
89
|
+
.command("validate")
|
|
90
|
+
.argument("<target>", ".plx bundle file or pipe code")
|
|
91
|
+
.option("--pipe <code>", "Pipe code that must exist in the bundle")
|
|
92
|
+
.option("--bundle <file>", "Bundle file path (alternative to positional)")
|
|
93
|
+
.description("Validate PLX content")
|
|
94
|
+
.exitOverride()
|
|
95
|
+
.action(async (target, options, cmd) => {
|
|
96
|
+
await validatePlx(target, { ...options, runner: getRunner(cmd) });
|
|
97
|
+
});
|
|
98
|
+
// ── mthds install <slug> ───────────────────────────────────────────
|
|
23
99
|
program
|
|
24
100
|
.command("install")
|
|
25
101
|
.argument("<slug>", "Method slug to install")
|
|
@@ -28,7 +104,7 @@ program
|
|
|
28
104
|
.action(async (slug) => {
|
|
29
105
|
await installMethod(slug);
|
|
30
106
|
});
|
|
31
|
-
// mthds setup runner <name>
|
|
107
|
+
// ── mthds setup runner <name> ──────────────────────────────────────
|
|
32
108
|
const setup = program.command("setup").exitOverride();
|
|
33
109
|
setup
|
|
34
110
|
.command("runner <name>")
|
|
@@ -37,7 +113,27 @@ setup
|
|
|
37
113
|
.action(async (name) => {
|
|
38
114
|
await installRunner(name);
|
|
39
115
|
});
|
|
40
|
-
// mthds
|
|
116
|
+
// ── mthds runner set-default|list ───────────────────────────────────
|
|
117
|
+
const runnerCmd = program
|
|
118
|
+
.command("runner")
|
|
119
|
+
.description("Manage runners")
|
|
120
|
+
.exitOverride();
|
|
121
|
+
runnerCmd
|
|
122
|
+
.command("set-default")
|
|
123
|
+
.argument("<name>", "Runner name (api, pipelex)")
|
|
124
|
+
.description("Set the default runner")
|
|
125
|
+
.exitOverride()
|
|
126
|
+
.action(async (name) => {
|
|
127
|
+
await runnerSetDefault(name);
|
|
128
|
+
});
|
|
129
|
+
runnerCmd
|
|
130
|
+
.command("list")
|
|
131
|
+
.description("List available runners")
|
|
132
|
+
.exitOverride()
|
|
133
|
+
.action(async () => {
|
|
134
|
+
await runnerList();
|
|
135
|
+
});
|
|
136
|
+
// ── mthds config set|get|list ──────────────────────────────────────
|
|
41
137
|
const config = program.command("config").description("Manage configuration").exitOverride();
|
|
42
138
|
config
|
|
43
139
|
.command("set")
|
|
@@ -80,7 +176,13 @@ program.parseAsync(process.argv).catch((err) => {
|
|
|
80
176
|
.replace(/^Error: /, "");
|
|
81
177
|
p.log.error(message);
|
|
82
178
|
if (err.code === "commander.missingArgument") {
|
|
83
|
-
|
|
179
|
+
const args = process.argv.slice(2);
|
|
180
|
+
if (args.includes("runner") && args.includes("set-default")) {
|
|
181
|
+
p.log.info("Run mthds runner list to see available runners.");
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
p.log.info("Run mthds --help to see usage.");
|
|
185
|
+
}
|
|
84
186
|
}
|
|
85
187
|
p.outro("");
|
|
86
188
|
process.exit(1);
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,SAAS,EACT,WAAW,EACX,WAAW,EACX,WAAW,GACZ,MAAM,qBAAqB,CAA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UAAU,EAAE,EAAE,CAAC,CAAC;QAE3B,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAErB,IAAI,GAAG,CAAC,IAAI,KAAK,2BAA2B,EAAE,CAAC;YAC7C,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACnC,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;gBAC5D,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;YAChE,CAAC;iBAAM,CAAC;gBACN,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;YAC/C,CAAC;QACH,CAAC;QAED,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACZ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,SAAS,EAAE,CAAC;IACZ,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC,CAAC,GAAG,CAAC,KAAK,CAAE,GAAa,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACZ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ClientAuthenticationError, PipelineRequestError, } from "./exceptions.js";
|
|
2
|
+
export class MthdsApiClient {
|
|
3
|
+
apiToken;
|
|
4
|
+
apiBaseUrl;
|
|
5
|
+
constructor(options = {}) {
|
|
6
|
+
this.apiToken = options.apiToken ?? process.env.MTHDS_API_KEY;
|
|
7
|
+
const resolvedBaseUrl = options.apiBaseUrl ?? process.env.MTHDS_API_BASE_URL;
|
|
8
|
+
if (!resolvedBaseUrl) {
|
|
9
|
+
throw new ClientAuthenticationError("API base URL is required for API execution");
|
|
10
|
+
}
|
|
11
|
+
this.apiBaseUrl = resolvedBaseUrl.replace(/\/+$/, "");
|
|
12
|
+
}
|
|
13
|
+
async makeApiCall(endpoint, pipelineRequest) {
|
|
14
|
+
const url = `${this.apiBaseUrl}/${endpoint}`;
|
|
15
|
+
const headers = {
|
|
16
|
+
"Content-Type": "application/json",
|
|
17
|
+
};
|
|
18
|
+
if (this.apiToken) {
|
|
19
|
+
headers["Authorization"] = `Bearer ${this.apiToken}`;
|
|
20
|
+
}
|
|
21
|
+
const response = await fetch(url, {
|
|
22
|
+
method: "POST",
|
|
23
|
+
headers,
|
|
24
|
+
body: JSON.stringify(pipelineRequest),
|
|
25
|
+
signal: AbortSignal.timeout(1_200_000),
|
|
26
|
+
});
|
|
27
|
+
if (!response.ok) {
|
|
28
|
+
const text = await response.text().catch(() => "");
|
|
29
|
+
throw new PipelineRequestError(`API POST /${endpoint} failed (${response.status}): ${text || response.statusText}`);
|
|
30
|
+
}
|
|
31
|
+
return response.json();
|
|
32
|
+
}
|
|
33
|
+
async executePipeline(options) {
|
|
34
|
+
if (!options.pipe_code && !options.mthds_content) {
|
|
35
|
+
throw new PipelineRequestError("Either pipe_code or mthds_content must be provided to executePipeline.");
|
|
36
|
+
}
|
|
37
|
+
const request = {
|
|
38
|
+
pipe_code: options.pipe_code,
|
|
39
|
+
mthds_content: options.mthds_content,
|
|
40
|
+
inputs: options.inputs,
|
|
41
|
+
output_name: options.output_name,
|
|
42
|
+
output_multiplicity: options.output_multiplicity,
|
|
43
|
+
dynamic_output_concept_code: options.dynamic_output_concept_code,
|
|
44
|
+
};
|
|
45
|
+
const data = await this.makeApiCall("api/v1/pipeline/execute", request);
|
|
46
|
+
return data;
|
|
47
|
+
}
|
|
48
|
+
async startPipeline(options) {
|
|
49
|
+
if (!options.pipe_code && !options.mthds_content) {
|
|
50
|
+
throw new PipelineRequestError("Either pipe_code or mthds_content must be provided to startPipeline.");
|
|
51
|
+
}
|
|
52
|
+
const request = {
|
|
53
|
+
pipe_code: options.pipe_code,
|
|
54
|
+
mthds_content: options.mthds_content,
|
|
55
|
+
inputs: options.inputs,
|
|
56
|
+
output_name: options.output_name,
|
|
57
|
+
output_multiplicity: options.output_multiplicity,
|
|
58
|
+
dynamic_output_concept_code: options.dynamic_output_concept_code,
|
|
59
|
+
};
|
|
60
|
+
const data = await this.makeApiCall("api/v1/pipeline/start", request);
|
|
61
|
+
return data;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AAOzB,MAAM,OAAO,cAAc;IACR,QAAQ,CAAqB;IAC7B,UAAU,CAAS;IAEpC,YAAY,UAAiC,EAAE;QAC7C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;QAE9D,MAAM,eAAe,GAC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,OAAO,CAAC,aAAa,EAAE,CAAC;YACjD,MAAM,IAAI,oBAAoB,CAC5B,wEAAwE,CACzE,CAAC;QACJ,CAAC;QAED,MAAM,OAAO,GAAoB;YAC/B,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,aAAa,EAAE,OAAO,CAAC,aAAa;YACpC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;YAChD,2BAA2B,EAAE,OAAO,CAAC,2BAA2B;SACjE,CAAC;QAEF,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;QACxE,OAAO,IAA+B,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,aAAa,CACjB,OAA+B;QAE/B,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;YACjD,MAAM,IAAI,oBAAoB,CAC5B,sEAAsE,CACvE,CAAC;QACJ,CAAC;QAED,MAAM,OAAO,GAAoB;YAC/B,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,aAAa,EAAE,OAAO,CAAC,aAAa;YACpC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;YAChD,2BAA2B,EAAE,OAAO,CAAC,2BAA2B;SACjE,CAAC;QAEF,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;QACtE,OAAO,IAA6B,CAAC;IACvC,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class ClientAuthenticationError extends Error {
|
|
2
|
+
constructor(message) {
|
|
3
|
+
super(message);
|
|
4
|
+
this.name = "ClientAuthenticationError";
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export class PipelineRequestError extends Error {
|
|
8
|
+
constructor(message) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.name = "PipelineRequestError";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=exceptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../../src/client/exceptions.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAClD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC1C,CAAC;CACF;AAED,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { MthdsApiClient } from "./client.js";
|
|
2
|
+
export type { RunnerProtocol } from "./protocol.js";
|
|
3
|
+
export { ClientAuthenticationError, PipelineRequestError, } from "./exceptions.js";
|
|
4
|
+
export type { PipelineState, PipelineRequest, PipelineExecuteResponse, PipelineStartResponse, ExecutePipelineOptions, } from "./pipeline.js";
|
|
5
|
+
export type { DictStuff, DictWorkingMemory, DictPipeOutput, VariableMultiplicity, StuffContentOrData, PipelineInputs, } from "./models/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EACL,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/models/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipe_output.js","sourceRoot":"","sources":["../../../src/client/models/pipe_output.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline_inputs.js","sourceRoot":"","sources":["../../../src/client/models/pipeline_inputs.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { DictStuff } from "../../runners/types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stuff.js","sourceRoot":"","sources":["../../../src/client/models/stuff.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { DictWorkingMemory } from "../../runners/types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"working_memory.js","sourceRoot":"","sources":["../../../src/client/models/working_memory.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { DictPipeOutput } from "./models/pipe_output.js";
|
|
2
|
+
import type { VariableMultiplicity } from "./models/pipe_output.js";
|
|
3
|
+
import type { PipelineInputs } from "./models/pipeline_inputs.js";
|
|
4
|
+
export type { PipelineState } from "../runners/types.js";
|
|
5
|
+
export interface PipelineRequest {
|
|
6
|
+
pipe_code?: string | null;
|
|
7
|
+
mthds_content?: string | null;
|
|
8
|
+
inputs?: PipelineInputs | null;
|
|
9
|
+
output_name?: string | null;
|
|
10
|
+
output_multiplicity?: VariableMultiplicity | null;
|
|
11
|
+
dynamic_output_concept_code?: string | null;
|
|
12
|
+
}
|
|
13
|
+
export interface PipelineExecuteResponse {
|
|
14
|
+
pipeline_run_id: string;
|
|
15
|
+
created_at: string;
|
|
16
|
+
pipeline_state: string;
|
|
17
|
+
finished_at?: string | null;
|
|
18
|
+
main_stuff_name?: string | null;
|
|
19
|
+
pipe_output: DictPipeOutput;
|
|
20
|
+
}
|
|
21
|
+
export interface PipelineStartResponse {
|
|
22
|
+
pipeline_run_id: string;
|
|
23
|
+
created_at: string;
|
|
24
|
+
pipeline_state: string;
|
|
25
|
+
finished_at?: string | null;
|
|
26
|
+
main_stuff_name?: string | null;
|
|
27
|
+
pipe_output?: DictPipeOutput | null;
|
|
28
|
+
}
|
|
29
|
+
export interface ExecutePipelineOptions {
|
|
30
|
+
pipe_code?: string | null;
|
|
31
|
+
mthds_content?: string | null;
|
|
32
|
+
inputs?: PipelineInputs | null;
|
|
33
|
+
output_name?: string | null;
|
|
34
|
+
output_multiplicity?: VariableMultiplicity | null;
|
|
35
|
+
dynamic_output_concept_code?: string | null;
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/client/pipeline.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ExecutePipelineOptions, PipelineExecuteResponse, PipelineStartResponse } from "./pipeline.js";
|
|
2
|
+
export interface RunnerProtocol {
|
|
3
|
+
executePipeline(options: ExecutePipelineOptions): Promise<PipelineExecuteResponse>;
|
|
4
|
+
startPipeline(options: ExecutePipelineOptions): Promise<PipelineStartResponse>;
|
|
5
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/client/protocol.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { RunnerType } from "../runners/types.js";
|
|
2
|
+
interface WithRunner {
|
|
3
|
+
runner?: RunnerType;
|
|
4
|
+
}
|
|
5
|
+
export declare function buildPipe(brief: string, options: {
|
|
6
|
+
output?: string;
|
|
7
|
+
} & WithRunner): Promise<void>;
|
|
8
|
+
export declare function buildRunner(target: string, options: {
|
|
9
|
+
pipe?: string;
|
|
10
|
+
output?: string;
|
|
11
|
+
} & WithRunner): Promise<void>;
|
|
12
|
+
export declare function buildInputs(target: string, options: {
|
|
13
|
+
pipe: string;
|
|
14
|
+
} & WithRunner): Promise<void>;
|
|
15
|
+
export declare function buildOutput(target: string, options: {
|
|
16
|
+
pipe: string;
|
|
17
|
+
format?: string;
|
|
18
|
+
} & WithRunner): Promise<void>;
|
|
19
|
+
export {};
|