@agentsmarket/pipeline-runtime 0.5.4 → 0.5.6
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/capabilities.d.ts +9 -1
- package/dist/capabilities.js +11 -1
- package/dist/shell-stage.d.ts +6 -4
- package/dist/shell-stage.js +6 -4
- package/dist/stages.js +11 -3
- package/package.json +7 -7
package/dist/capabilities.d.ts
CHANGED
|
@@ -33,11 +33,19 @@ export interface PipelineCapabilities {
|
|
|
33
33
|
has_composition: boolean;
|
|
34
34
|
has_when: boolean;
|
|
35
35
|
has_retry: boolean;
|
|
36
|
-
|
|
36
|
+
/**
|
|
37
|
+
* The pipeline runs commands on the machine that executes it. A buyer must
|
|
38
|
+
* see this BEFORE buying: on their own machine those commands touch their
|
|
39
|
+
* tokens, their secrets and their network.
|
|
40
|
+
*/
|
|
41
|
+
has_shell: boolean;
|
|
42
|
+
capabilities_schema_version: 2;
|
|
37
43
|
}
|
|
38
44
|
export interface PipelineStageLikeForCaps {
|
|
39
45
|
id?: string;
|
|
40
46
|
provider?: string;
|
|
47
|
+
/** A shell stage runs a command on the machine that executes the pipeline. */
|
|
48
|
+
shell?: unknown;
|
|
41
49
|
uses?: unknown;
|
|
42
50
|
working_dir?: string;
|
|
43
51
|
output_format?: string;
|
package/dist/capabilities.js
CHANGED
|
@@ -36,9 +36,19 @@ export function analyzeCapabilities(spec) {
|
|
|
36
36
|
has_composition: deriveHasComposition(stages),
|
|
37
37
|
has_when: deriveHasWhen(stages),
|
|
38
38
|
has_retry: deriveHasRetry(stages),
|
|
39
|
-
|
|
39
|
+
has_shell: deriveHasShell(stages),
|
|
40
|
+
capabilities_schema_version: 2,
|
|
40
41
|
};
|
|
41
42
|
}
|
|
43
|
+
/** A stage with a `shell:` runs a command — where it runs is the host's problem. */
|
|
44
|
+
function deriveHasShell(stages) {
|
|
45
|
+
return stages.some((s) => {
|
|
46
|
+
const shell = s.shell;
|
|
47
|
+
if (typeof shell === 'string')
|
|
48
|
+
return shell.trim().length > 0;
|
|
49
|
+
return shell !== undefined && shell !== null;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
42
52
|
function deriveNetwork(stages) {
|
|
43
53
|
let hasLLM = false;
|
|
44
54
|
let hasSkill = false;
|
package/dist/shell-stage.d.ts
CHANGED
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
* Useful for: running tests, linting, formatting, refactoring tools that
|
|
6
6
|
* live on the local machine.
|
|
7
7
|
*
|
|
8
|
-
* **
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* **Hosts that cannot spawn are REJECTED by their executor.** Cloudflare
|
|
9
|
+
* Workers have no child processes, so the server supplies a
|
|
10
|
+
* `ThrowingShellExecutor` whose reason says so. The runtime only asks
|
|
11
|
+
* whether an executor exists — whether it can actually run the command is the
|
|
12
|
+
* executor's own answer, which is what lets a sandboxed server work without a
|
|
13
|
+
* change here.
|
|
12
14
|
*
|
|
13
15
|
* **Execution model:**
|
|
14
16
|
* - `spawn(cmd, args, { shell: false })` — no shell interpretation, args
|
package/dist/shell-stage.js
CHANGED
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
* Useful for: running tests, linting, formatting, refactoring tools that
|
|
6
6
|
* live on the local machine.
|
|
7
7
|
*
|
|
8
|
-
* **
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* **Hosts that cannot spawn are REJECTED by their executor.** Cloudflare
|
|
9
|
+
* Workers have no child processes, so the server supplies a
|
|
10
|
+
* `ThrowingShellExecutor` whose reason says so. The runtime only asks
|
|
11
|
+
* whether an executor exists — whether it can actually run the command is the
|
|
12
|
+
* executor's own answer, which is what lets a sandboxed server work without a
|
|
13
|
+
* change here.
|
|
12
14
|
*
|
|
13
15
|
* **Execution model:**
|
|
14
16
|
* - `spawn(cmd, args, { shell: false })` — no shell interpretation, args
|
package/dist/stages.js
CHANGED
|
@@ -472,12 +472,13 @@ correctionHint) {
|
|
|
472
472
|
throw new StageBadConfigError(`Stage '${stage.id}' requires one of: 'shell' (shell stage, CLI --local only), 'uses' (skill stage), 'model'+'prompt' (LLM stage), 'loop' (M6.2 iterative executor), or just 'prompt' with default model`);
|
|
473
473
|
}
|
|
474
474
|
if (hasShell) {
|
|
475
|
+
// Whether this environment can spawn processes is the executor's call, not
|
|
476
|
+
// the runtime's: only the executor knows if it lives behind a sandbox. A
|
|
477
|
+
// host with no shell capability supplies `ThrowingShellExecutor` and gets
|
|
478
|
+
// the same clear error with its own reason.
|
|
475
479
|
if (!deps.shellExecutor) {
|
|
476
480
|
throw new ShellStageUnsupportedError(stage.id, 'no shell executor is configured for this run');
|
|
477
481
|
}
|
|
478
|
-
if (!deps.isLocal) {
|
|
479
|
-
throw new ShellStageUnsupportedError(stage.id, 'shell stages require CLI invocation with --local; the server cannot spawn child processes');
|
|
480
|
-
}
|
|
481
482
|
const spec = normalizeShellStage(stage.shell);
|
|
482
483
|
if (!spec) {
|
|
483
484
|
throw new StageBadConfigError(`Stage '${stage.id}' has a malformed 'shell' spec (expected string or { cmd, args?, cwd?, timeout_ms? })`);
|
|
@@ -513,6 +514,13 @@ correctionHint) {
|
|
|
513
514
|
if (e instanceof ShellStageTimeoutError) {
|
|
514
515
|
throw new StageBadConfigError(`Stage '${stage.id}' ${e.message}`);
|
|
515
516
|
}
|
|
517
|
+
// The executor may not know which stage it was called for — it is handed
|
|
518
|
+
// a command, not a stage. The runtime does know, so the stage id is
|
|
519
|
+
// filled in here: an error that says "<unknown>" tells the reader
|
|
520
|
+
// nothing about which stage to look at.
|
|
521
|
+
if (e instanceof ShellStageUnsupportedError && e.stageId === '<unknown>') {
|
|
522
|
+
throw new ShellStageUnsupportedError(stage.id, e.reason);
|
|
523
|
+
}
|
|
516
524
|
throw e;
|
|
517
525
|
}
|
|
518
526
|
finally {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentsmarket/pipeline-runtime",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"description": "Runtime for executing PIPELINE.md workflows (multi-skill orchestration). Provider-agnostic (MiniMax, Claude, OpenAI).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -10,20 +10,20 @@
|
|
|
10
10
|
"README.md"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@anthropic-ai/sdk": "^0.
|
|
13
|
+
"@anthropic-ai/sdk": "^0.135.0",
|
|
14
14
|
"@hono/node-server": "^1.13.0",
|
|
15
15
|
"ethers": "^6.17.0",
|
|
16
|
-
"hono": "^4.
|
|
16
|
+
"hono": "^4.13.13",
|
|
17
17
|
"js-yaml": "^4.1.0",
|
|
18
|
-
"openai": "^7.
|
|
18
|
+
"openai": "^7.37.0",
|
|
19
19
|
"zod": "^3.25"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/js-yaml": "^4.0.9",
|
|
23
|
-
"@types/node": "^22.
|
|
24
|
-
"@vitest/coverage-v8": "^4.1.
|
|
23
|
+
"@types/node": "^22.20.5",
|
|
24
|
+
"@vitest/coverage-v8": "^4.1.12",
|
|
25
25
|
"typescript": "^5.6.0",
|
|
26
|
-
"vitest": "^4.1.
|
|
26
|
+
"vitest": "^4.1.12"
|
|
27
27
|
},
|
|
28
28
|
"engines": {
|
|
29
29
|
"node": ">=20"
|