@agentsmarket/pipeline-runtime 0.1.2 → 0.1.3
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/index.d.ts +1 -0
- package/dist/stages.d.ts +8 -0
- package/dist/stages.js +2 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ export interface PipelineContext {
|
|
|
55
55
|
export interface PipelineHooks {
|
|
56
56
|
onStageStart?: (stageId: string) => void;
|
|
57
57
|
onStageComplete?: (stageId: string, ms: number, output: string) => void;
|
|
58
|
+
onLlmResponse?: (stageId: string, rawText: string, model: string) => void;
|
|
58
59
|
}
|
|
59
60
|
import type { LLMProvider } from './types.js';
|
|
60
61
|
export declare function runStage(stage: PipelineStageSpec, ctx: PipelineContext): Promise<string>;
|
package/dist/stages.d.ts
CHANGED
|
@@ -82,6 +82,14 @@ export interface StageExecutorDeps {
|
|
|
82
82
|
pricing: PricingResolver;
|
|
83
83
|
modelResolver: ModelResolver;
|
|
84
84
|
fetchSkill: (skillId: string) => Promise<SkillLike | null>;
|
|
85
|
+
/**
|
|
86
|
+
* F24 debug hook. Fires after `provider.generateText` returns but
|
|
87
|
+
* before `validateOutputFormat`. Lets the CLI capture the raw LLM
|
|
88
|
+
* text and surface it when validation fails (e.g. "Output format
|
|
89
|
+
* violations: takeaway_1: key missing" without `--debug` you never
|
|
90
|
+
* see what the model actually returned).
|
|
91
|
+
*/
|
|
92
|
+
onLlmResponse?: (stageId: string, rawText: string, model: string) => void;
|
|
85
93
|
/**
|
|
86
94
|
* Optional pipeline fetcher for composition refs (R10.7.b, ADR Q10).
|
|
87
95
|
* When supplied, runPipelineV2 walks the spec once before the loop and
|
package/dist/stages.js
CHANGED
|
@@ -363,6 +363,7 @@ export async function executeStage(stage, pipeline, ctx, deps) {
|
|
|
363
363
|
? resolveStageOutputRefs(chainedInput, ctx.previousOutputs)
|
|
364
364
|
: chainedInput;
|
|
365
365
|
const { result, durationMs } = await invokeSkill(skill, resolvedInput, previousContext, label, stageProvider, stage.retry, retryCtx, stage.output_format);
|
|
366
|
+
deps.onLlmResponse?.(`${stage.id}:${use.id}`, result.text, skillModel);
|
|
366
367
|
lastResult = result;
|
|
367
368
|
chainedInput = { input_from_previous_skill: result.text };
|
|
368
369
|
nestedCalls.push({
|
|
@@ -408,6 +409,7 @@ export async function executeStage(stage, pipeline, ctx, deps) {
|
|
|
408
409
|
}), stage.retry, retryCtx);
|
|
409
410
|
const result = ran.value;
|
|
410
411
|
const costMicroUsdc = await deps.pricing.resolveCostMicroUsdc(model, result.usage);
|
|
412
|
+
deps.onLlmResponse?.(stage.id, result.text, model);
|
|
411
413
|
validateOutputFormat(result.text, stage.output_format, stage.fields);
|
|
412
414
|
return {
|
|
413
415
|
output: result.text,
|
package/package.json
CHANGED