mthds 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/agent/commands/build.d.ts +0 -3
  2. package/dist/agent/commands/build.js +3 -46
  3. package/dist/agent/commands/build.js.map +1 -1
  4. package/dist/agent/commands/runner-commands.d.ts +20 -0
  5. package/dist/agent/commands/runner-commands.js +800 -0
  6. package/dist/agent/commands/runner-commands.js.map +1 -0
  7. package/dist/agent/commands/validate.js +1 -1
  8. package/dist/agent/commands/validate.js.map +1 -1
  9. package/dist/agent-cli.js +6 -107
  10. package/dist/agent-cli.js.map +1 -1
  11. package/dist/cli/commands/build.d.ts +0 -3
  12. package/dist/cli/commands/build.js +3 -50
  13. package/dist/cli/commands/build.js.map +1 -1
  14. package/dist/cli/commands/index.js +0 -1
  15. package/dist/cli/commands/index.js.map +1 -1
  16. package/dist/cli/commands/run.js +1 -1
  17. package/dist/cli/commands/run.js.map +1 -1
  18. package/dist/cli/commands/validate.js +1 -1
  19. package/dist/cli/commands/validate.js.map +1 -1
  20. package/dist/cli.js +2 -13
  21. package/dist/cli.js.map +1 -1
  22. package/dist/client/client.js +6 -6
  23. package/dist/client/client.js.map +1 -1
  24. package/dist/client/pipeline.d.ts +2 -2
  25. package/dist/runners/api-runner.d.ts +5 -2
  26. package/dist/runners/api-runner.js +20 -3
  27. package/dist/runners/api-runner.js.map +1 -1
  28. package/dist/runners/pipelex-runner.d.ts +5 -2
  29. package/dist/runners/pipelex-runner.js +108 -57
  30. package/dist/runners/pipelex-runner.js.map +1 -1
  31. package/dist/runners/types.d.ts +56 -18
  32. package/package.json +1 -1
  33. package/dist/agent/commands/pipelex.d.ts +0 -16
  34. package/dist/agent/commands/pipelex.js +0 -118
  35. package/dist/agent/commands/pipelex.js.map +0 -1
@@ -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
- mthds_content: string;
11
+ mthds_contents: string[];
12
12
  pipe_code: string;
13
13
  }
14
14
  export interface BuildOutputRequest {
15
- mthds_content: string;
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
- mthds_content: string;
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
- mthds_content?: string;
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,23 @@ 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 (legacy, used by API runner). */
39
- mthds_content?: string;
34
+ /** Raw .mthds file content(s). */
35
+ mthds_contents?: string[];
40
36
  }
41
- export interface BuildPipeResponse {
42
- mthds_content: string;
43
- pipelex_bundle_blueprint: Record<string, unknown>;
44
- success: boolean;
45
- message: string;
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 AssembleRequest {
45
+ domain: string;
46
+ main_pipe: string;
47
+ description?: string;
48
+ system_prompt?: string;
49
+ concepts?: string[];
50
+ pipes?: string[];
46
51
  }
47
52
  export interface BuildRunnerResponse {
48
53
  python_code: string;
@@ -81,19 +86,52 @@ export interface PipelexBundleBlueprint {
81
86
  pipe?: Record<string, unknown> | null;
82
87
  }
83
88
  export interface ValidateResponse {
84
- mthds_content: string;
89
+ mthds_contents: string[];
85
90
  pipelex_bundle_blueprint: PipelexBundleBlueprint;
86
91
  success: boolean;
87
92
  message: string;
88
93
  }
94
+ export interface ConceptResponse {
95
+ success: boolean;
96
+ concept_code: string;
97
+ toml: string;
98
+ }
99
+ export interface PipeSpecResponse {
100
+ success: boolean;
101
+ pipe_code: string;
102
+ pipe_type: string;
103
+ toml: string;
104
+ }
105
+ export interface AssembleResponse {
106
+ success: boolean;
107
+ toml: string;
108
+ domain: string;
109
+ main_pipe: string;
110
+ }
111
+ export interface ModelsRequest {
112
+ type?: string[];
113
+ }
114
+ export interface ModelsResponse {
115
+ success: boolean;
116
+ presets: Record<string, Array<{
117
+ name: string;
118
+ description?: string;
119
+ }>>;
120
+ aliases: Record<string, Record<string, string>>;
121
+ waterfalls: Record<string, Record<string, string[]>>;
122
+ talent_mappings: Record<string, Record<string, string>>;
123
+ }
89
124
  export interface Runner extends RunnerProtocol {
90
125
  readonly type: RunnerType;
91
126
  health(): Promise<Record<string, unknown>>;
92
127
  version(): Promise<Record<string, string>>;
93
128
  buildInputs(request: BuildInputsRequest): Promise<unknown>;
94
129
  buildOutput(request: BuildOutputRequest): Promise<unknown>;
95
- buildPipe(request: BuildPipeRequest): Promise<BuildPipeResponse>;
96
130
  buildRunner(request: BuildRunnerRequest): Promise<BuildRunnerResponse>;
97
131
  execute(request: ExecuteRequest): Promise<PipelineResponse>;
98
132
  validate(request: ValidateRequest): Promise<ValidateResponse>;
133
+ concept(request: ConceptRequest): Promise<ConceptResponse>;
134
+ pipeSpec(request: PipeSpecRequest): Promise<PipeSpecResponse>;
135
+ assemble(request: AssembleRequest): Promise<AssembleResponse>;
136
+ models(request?: ModelsRequest): Promise<ModelsResponse>;
99
137
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mthds",
3
- "version": "0.1.3",
3
+ "version": "0.2.0",
4
4
  "description": "CLI and SDK for MTHDS — the open standard for reusable AI agent methods. Install, execute, and manage methods.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,16 +0,0 @@
1
- /**
2
- * Passthrough command group that forwards to pipelex-agent.
3
- *
4
- * mthds-agent pipelex <cmd> [args...] -> pipelex-agent <cmd> [args...]
5
- */
6
- import { Command } from "commander";
7
- /**
8
- * Extract top-level options from remaining args so they can be prepended
9
- * before the subcommand. Commander.js's passThroughOptions prevents the
10
- * parent program from consuming these when they appear after subcommand args.
11
- */
12
- export declare function extractTopLevelOptions(args: string[]): {
13
- topLevel: string[];
14
- rest: string[];
15
- };
16
- export declare function registerPipelexCommands(program: Command, logLevelArgs: () => string[], autoInstall: () => boolean): void;
@@ -1,118 +0,0 @@
1
- /**
2
- * Passthrough command group that forwards to pipelex-agent.
3
- *
4
- * mthds-agent pipelex <cmd> [args...] -> pipelex-agent <cmd> [args...]
5
- */
6
- import { passthrough } from "../passthrough.js";
7
- /** Options that pipelex-agent accepts only at the top level (before the subcommand). */
8
- const TOP_LEVEL_OPTIONS = ["--log-level"];
9
- /**
10
- * Extract top-level options from remaining args so they can be prepended
11
- * before the subcommand. Commander.js's passThroughOptions prevents the
12
- * parent program from consuming these when they appear after subcommand args.
13
- */
14
- export function extractTopLevelOptions(args) {
15
- const topLevel = [];
16
- const rest = [];
17
- let i = 0;
18
- while (i < args.length) {
19
- const arg = args[i];
20
- if (arg === "--") {
21
- rest.push(...args.slice(i));
22
- break;
23
- }
24
- if (TOP_LEVEL_OPTIONS.includes(arg)) {
25
- if (i + 1 < args.length) {
26
- topLevel.push(arg, args[i + 1]);
27
- i += 2;
28
- }
29
- else {
30
- // No value follows — leave the bare flag in rest as-is.
31
- rest.push(arg);
32
- i += 1;
33
- }
34
- }
35
- else if (TOP_LEVEL_OPTIONS.some((opt) => arg.startsWith(`${opt}=`))) {
36
- topLevel.push(arg);
37
- i += 1;
38
- }
39
- else {
40
- rest.push(arg);
41
- i++;
42
- }
43
- }
44
- return { topLevel, rest };
45
- }
46
- const PIPELEX_COMMANDS = [
47
- "init",
48
- "validate",
49
- "inputs",
50
- "concept",
51
- "pipe",
52
- "assemble",
53
- "models",
54
- "doctor",
55
- ];
56
- /** Commands forwarded to `pipelex` (interactive CLI) instead of `pipelex-agent`. */
57
- const PIPELEX_INTERACTIVE_COMMANDS = ["login"];
58
- const PIPELEX_RUN_SUBCOMMANDS = ["pipe", "bundle", "method"];
59
- export function registerPipelexCommands(program, logLevelArgs, autoInstall) {
60
- const pipelexGroup = program
61
- .command("pipelex")
62
- .description("Forward commands to pipelex-agent")
63
- .passThroughOptions()
64
- .allowUnknownOption();
65
- // Interactive commands go to `pipelex` (not pipelex-agent) because they
66
- // require browser interaction (e.g. login opens the browser for OAuth).
67
- for (const subcmd of PIPELEX_INTERACTIVE_COMMANDS) {
68
- pipelexGroup
69
- .command(subcmd)
70
- .description(`Forward to pipelex ${subcmd}`)
71
- .allowUnknownOption()
72
- .allowExcessArguments(true)
73
- .passThroughOptions()
74
- .action((_options, cmd) => {
75
- const remaining = cmd.args;
76
- passthrough("pipelex", [subcmd, "--no-logo", ...remaining], {
77
- autoInstall: autoInstall(),
78
- });
79
- });
80
- }
81
- for (const subcmd of PIPELEX_COMMANDS) {
82
- pipelexGroup
83
- .command(subcmd)
84
- .description(`Forward to pipelex-agent ${subcmd}`)
85
- .allowUnknownOption()
86
- .allowExcessArguments(true)
87
- .passThroughOptions()
88
- .action((_options, cmd) => {
89
- const { topLevel, rest } = extractTopLevelOptions(cmd.args);
90
- passthrough("pipelex-agent", [...logLevelArgs(), ...topLevel, subcmd, ...rest], {
91
- autoInstall: autoInstall(),
92
- });
93
- });
94
- }
95
- // Register `run` as a sub-group with `pipe` and `method` subcommands:
96
- // mthds-agent pipelex run pipe <args> -> pipelex-agent run pipe <args>
97
- // mthds-agent pipelex run method <args> -> pipelex-agent run method <args>
98
- const runGroup = pipelexGroup
99
- .command("run")
100
- .description("Forward to pipelex-agent run (pipe, bundle, or method)")
101
- .passThroughOptions()
102
- .allowUnknownOption();
103
- for (const runSub of PIPELEX_RUN_SUBCOMMANDS) {
104
- runGroup
105
- .command(runSub)
106
- .description(`Forward to pipelex-agent run ${runSub}`)
107
- .allowUnknownOption()
108
- .allowExcessArguments(true)
109
- .passThroughOptions()
110
- .action((_options, cmd) => {
111
- const { topLevel, rest } = extractTopLevelOptions(cmd.args);
112
- passthrough("pipelex-agent", [...logLevelArgs(), ...topLevel, "run", runSub, ...rest], {
113
- autoInstall: autoInstall(),
114
- });
115
- });
116
- }
117
- }
118
- //# sourceMappingURL=pipelex.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pipelex.js","sourceRoot":"","sources":["../../../src/agent/commands/pipelex.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,wFAAwF;AACxF,MAAM,iBAAiB,GAAG,CAAC,aAAa,CAAU,CAAC;AAEnD;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAc;IAInD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QACvB,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAE,CAAC;QACrB,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YACjB,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5B,MAAM;QACR,CAAC;QACD,IAAK,iBAAuC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC3D,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;gBACxB,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,CAAE,CAAC,CAAC;gBACjC,CAA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