@agentsmarket/pipeline-runtime 0.1.1 → 0.1.2
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/stages.js +4 -2
- package/dist/types.d.ts +15 -0
- package/package.json +1 -1
package/dist/stages.js
CHANGED
|
@@ -198,7 +198,7 @@ function resolveStageProvider(deps, stage, model) {
|
|
|
198
198
|
}
|
|
199
199
|
return deps.registry.resolveWithSupports(stage.provider, model);
|
|
200
200
|
}
|
|
201
|
-
async function invokeSkill(skill, input, previousContext, skillLabel, provider, retry, retryCtx) {
|
|
201
|
+
async function invokeSkill(skill, input, previousContext, skillLabel, provider, retry, retryCtx, outputFormat) {
|
|
202
202
|
const t0 = Date.now();
|
|
203
203
|
const inputStr = JSON.stringify(input ?? {}, null, 2);
|
|
204
204
|
const fullMd = skill.full_md ?? '';
|
|
@@ -208,6 +208,7 @@ async function invokeSkill(skill, input, previousContext, skillLabel, provider,
|
|
|
208
208
|
system: `${skillLabel}\n${description}`,
|
|
209
209
|
complexity: 'complex',
|
|
210
210
|
maxTokens: 4096,
|
|
211
|
+
...(outputFormat ? { outputFormat } : {}),
|
|
211
212
|
}), retry, retryCtx);
|
|
212
213
|
return { result: ran.value, durationMs: Date.now() - t0, attempts: ran.attempts };
|
|
213
214
|
}
|
|
@@ -361,7 +362,7 @@ export async function executeStage(stage, pipeline, ctx, deps) {
|
|
|
361
362
|
const resolvedInput = typeof chainedInput === 'string'
|
|
362
363
|
? resolveStageOutputRefs(chainedInput, ctx.previousOutputs)
|
|
363
364
|
: chainedInput;
|
|
364
|
-
const { result, durationMs } = await invokeSkill(skill, resolvedInput, previousContext, label, stageProvider, stage.retry, retryCtx);
|
|
365
|
+
const { result, durationMs } = await invokeSkill(skill, resolvedInput, previousContext, label, stageProvider, stage.retry, retryCtx, stage.output_format);
|
|
365
366
|
lastResult = result;
|
|
366
367
|
chainedInput = { input_from_previous_skill: result.text };
|
|
367
368
|
nestedCalls.push({
|
|
@@ -403,6 +404,7 @@ export async function executeStage(stage, pipeline, ctx, deps) {
|
|
|
403
404
|
complexity: stage.model?.includes('M3') || stage.model?.includes('opus') ? 'complex' : 'simple',
|
|
404
405
|
maxTokens: 4096,
|
|
405
406
|
fields: stage.fields,
|
|
407
|
+
outputFormat: stage.output_format,
|
|
406
408
|
}), stage.retry, retryCtx);
|
|
407
409
|
const result = ran.value;
|
|
408
410
|
const costMicroUsdc = await deps.pricing.resolveCostMicroUsdc(model, result.usage);
|
package/dist/types.d.ts
CHANGED
|
@@ -38,6 +38,21 @@ export interface GenerateOptions {
|
|
|
38
38
|
* this — they emit JSON based on the real model's output.
|
|
39
39
|
*/
|
|
40
40
|
fields?: string[];
|
|
41
|
+
/**
|
|
42
|
+
* Stage-level output_format constraint. MockProvider branches on this to
|
|
43
|
+
* emit a realistic deterministic shape per format (text, markdown, code,
|
|
44
|
+
* structured_json). Other providers ignore this — they emit whatever
|
|
45
|
+
* the real model returns and downstream `validateOutputFormat` checks
|
|
46
|
+
* the result.
|
|
47
|
+
*
|
|
48
|
+
* Added in F13: previously MockProvider echoed the prompt back via
|
|
49
|
+
* `[mock] echo: <preview>` for every non-structured format, which made
|
|
50
|
+
* `pipeline call --local --mock` produce noisy unhelpful output. With
|
|
51
|
+
* `outputFormat` set, each format gets its own deterministic mock
|
|
52
|
+
* (markdown headers, fenced code, plain text summary) — useful for
|
|
53
|
+
* demo/QA without a real LLM.
|
|
54
|
+
*/
|
|
55
|
+
outputFormat?: OutputFormat;
|
|
41
56
|
}
|
|
42
57
|
export interface TokenUsage {
|
|
43
58
|
inputTokens: number;
|
package/package.json
CHANGED