@agentsmarket/pipeline-runtime 0.5.3 → 0.5.5

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 agentsmarket.world contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -58,6 +58,27 @@ export interface PipelineStageLike {
58
58
  * returns no text at all. Raise it per stage rather than globally.
59
59
  */
60
60
  maxTokens?: number;
61
+ /**
62
+ * Provider-facing sampling parameters.
63
+ *
64
+ * The CLI validates this block (`cli/src/lib/pipeline-spec.ts:284`) but until
65
+ * now nothing in the runtime read it, so `model_params.temperature: 0` was
66
+ * accepted by a spec, passed every check, and then discarded — the adapter
67
+ * default of 0.7 was used instead, with no warning anywhere. `maxTokens` above
68
+ * is read at both `generateText` call sites in `stages.ts`; these were not.
69
+ *
70
+ * `response_format` and `provider_params` are validated but still ignored:
71
+ * the first duplicates the stage's own `output_format`, and the second has no
72
+ * destination in `GenerateOptions`.
73
+ */
74
+ model_params?: {
75
+ temperature?: number;
76
+ max_tokens?: number;
77
+ top_p?: number;
78
+ seed?: number;
79
+ stop?: string[];
80
+ reasoning_effort?: 'low' | 'medium' | 'high';
81
+ };
61
82
  /**
62
83
  * MCP server names available to this stage. v0.2 NEW (forward-compat).
63
84
  * Validated against executor's MCP registry, not yet executed.
package/dist/stages.js CHANGED
@@ -415,6 +415,32 @@ async function runWithRetry(op, retry, retryCtx) {
415
415
  }
416
416
  // Fallback constant (kept local — retry.ts owns the canonical list).
417
417
  const DEFAULT_RETRYABLE_STATUSES_FALLBACK = [429, 503];
418
+ /**
419
+ * `model_params` (snake_case in a spec) → `GenerateOptions` (camelCase).
420
+ *
421
+ * Returns an empty object when the stage sets nothing, so spreading it at a call
422
+ * site adds no keys and every adapter keeps its own default. `max_tokens` is
423
+ * mapped too even though `stage.maxTokens` wins at the call sites: a spec that
424
+ * sets only `model_params.max_tokens` should not silently get 4096.
425
+ */
426
+ function stageModelParams(stage) {
427
+ const mp = stage.model_params;
428
+ if (!mp)
429
+ return {};
430
+ return {
431
+ temperature: mp.temperature,
432
+ topP: mp.top_p,
433
+ seed: mp.seed,
434
+ stopSequences: mp.stop,
435
+ reasoningEffort: mp.reasoning_effort,
436
+ };
437
+ }
438
+ function resolveMaxTokens(stage) {
439
+ if (Number.isFinite(stage.maxTokens))
440
+ return stage.maxTokens;
441
+ const fromParams = stage.model_params?.max_tokens;
442
+ return Number.isFinite(fromParams) ? fromParams : 4096;
443
+ }
418
444
  export async function executeStage(stage, pipeline, ctx, deps,
419
445
  /**
420
446
  * Appended to the prompt on a validation retry. `output_retry` used to
@@ -660,7 +686,8 @@ correctionHint) {
660
686
  model,
661
687
  system: resolvedSystem,
662
688
  complexity: stage.model?.includes('M3') || stage.model?.includes('opus') ? 'complex' : 'simple',
663
- maxTokens: Number.isFinite(stage.maxTokens) ? stage.maxTokens : 4096,
689
+ maxTokens: resolveMaxTokens(stage),
690
+ ...stageModelParams(stage),
664
691
  fields: stage.fields,
665
692
  outputFormat: stage.output_format,
666
693
  messages: correctionHint
@@ -684,7 +711,8 @@ correctionHint) {
684
711
  model,
685
712
  system: resolvedSystem,
686
713
  complexity: stage.model?.includes('M3') || stage.model?.includes('opus') ? 'complex' : 'simple',
687
- maxTokens: Number.isFinite(stage.maxTokens) ? stage.maxTokens : 4096,
714
+ maxTokens: resolveMaxTokens(stage),
715
+ ...stageModelParams(stage),
688
716
  fields: stage.fields,
689
717
  outputFormat: stage.output_format,
690
718
  });
package/dist/webhook.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentsmarket/pipeline-runtime",
3
- "version": "0.5.3",
3
+ "version": "0.5.5",
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",
@@ -9,28 +9,21 @@
9
9
  "dist",
10
10
  "README.md"
11
11
  ],
12
- "scripts": {
13
- "build": "tsc",
14
- "test": "vitest run",
15
- "test:coverage": "vitest run --coverage",
16
- "dev": "tsx src/index.ts",
17
- "lint": "tsc --noEmit"
18
- },
19
12
  "dependencies": {
20
- "@anthropic-ai/sdk": "^0.125.0",
13
+ "@anthropic-ai/sdk": "^0.135.0",
21
14
  "@hono/node-server": "^1.13.0",
22
15
  "ethers": "^6.17.0",
23
- "hono": "^4.6.0",
16
+ "hono": "^4.13.13",
24
17
  "js-yaml": "^4.1.0",
25
- "openai": "^7.15.0",
18
+ "openai": "^7.37.0",
26
19
  "zod": "^3.25"
27
20
  },
28
21
  "devDependencies": {
29
22
  "@types/js-yaml": "^4.0.9",
30
- "@types/node": "^22.0.0",
31
- "@vitest/coverage-v8": "^4.1.11",
23
+ "@types/node": "^22.20.5",
24
+ "@vitest/coverage-v8": "^4.1.12",
32
25
  "typescript": "^5.6.0",
33
- "vitest": "^4.1.11"
26
+ "vitest": "^4.1.12"
34
27
  },
35
28
  "engines": {
36
29
  "node": ">=20"
@@ -41,5 +34,13 @@
41
34
  "publishConfig": {
42
35
  "access": "public"
43
36
  },
44
- "types": "./dist/index.d.ts"
45
- }
37
+ "types": "./dist/index.d.ts",
38
+ "scripts": {
39
+ "build": "tsc",
40
+ "test": "vitest run",
41
+ "test:coverage": "vitest run --coverage",
42
+ "dev": "tsx src/index.ts",
43
+ "lint": "tsc --noEmit",
44
+ "typecheck": "tsc --noEmit -p tsconfig.json"
45
+ }
46
+ }