@yycholla/pi-dynamic-workflows 3.3.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.
- package/LICENSE +22 -0
- package/README.md +325 -0
- package/assets/readme/hero.png +0 -0
- package/assets/readme/hero.svg +70 -0
- package/assets/readme/package-cover.png +0 -0
- package/assets/readme/package-cover.svg +66 -0
- package/assets/readme/workflow.png +0 -0
- package/assets/readme/workflow.svg +77 -0
- package/dist/accept-workflow-guidance.d.ts +14 -0
- package/dist/accept-workflow-guidance.js +53 -0
- package/dist/adversarial-review.d.ts +30 -0
- package/dist/adversarial-review.js +107 -0
- package/dist/agent-history.d.ts +20 -0
- package/dist/agent-history.js +122 -0
- package/dist/agent-registry.d.ts +83 -0
- package/dist/agent-registry.js +190 -0
- package/dist/agent.d.ts +364 -0
- package/dist/agent.js +714 -0
- package/dist/builtin-commands.d.ts +19 -0
- package/dist/builtin-commands.js +251 -0
- package/dist/builtin-workflows.d.ts +45 -0
- package/dist/builtin-workflows.js +121 -0
- package/dist/code-review.d.ts +26 -0
- package/dist/code-review.js +181 -0
- package/dist/config.d.ts +37 -0
- package/dist/config.js +44 -0
- package/dist/deep-research.d.ts +30 -0
- package/dist/deep-research.js +124 -0
- package/dist/display.d.ts +134 -0
- package/dist/display.js +248 -0
- package/dist/effort-command.d.ts +28 -0
- package/dist/effort-command.js +68 -0
- package/dist/enums.d.ts +69 -0
- package/dist/enums.js +78 -0
- package/dist/errors.d.ts +113 -0
- package/dist/errors.js +140 -0
- package/dist/extension-reload.d.ts +37 -0
- package/dist/extension-reload.js +78 -0
- package/dist/fs-persistence.d.ts +63 -0
- package/dist/fs-persistence.js +102 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.js +35 -0
- package/dist/logger.d.ts +21 -0
- package/dist/logger.js +66 -0
- package/dist/model-routing.d.ts +30 -0
- package/dist/model-routing.js +50 -0
- package/dist/model-spec.d.ts +29 -0
- package/dist/model-spec.js +252 -0
- package/dist/model-tier-config.d.ts +133 -0
- package/dist/model-tier-config.js +249 -0
- package/dist/run-persistence.d.ts +180 -0
- package/dist/run-persistence.js +294 -0
- package/dist/saved-commands.d.ts +28 -0
- package/dist/saved-commands.js +100 -0
- package/dist/shared-store.d.ts +98 -0
- package/dist/shared-store.js +212 -0
- package/dist/structured-output.d.ts +19 -0
- package/dist/structured-output.js +30 -0
- package/dist/task-panel.d.ts +61 -0
- package/dist/task-panel.js +422 -0
- package/dist/usage-limit-scheduler.d.ts +145 -0
- package/dist/usage-limit-scheduler.js +368 -0
- package/dist/web-tools.d.ts +20 -0
- package/dist/web-tools.js +120 -0
- package/dist/workflow-authoring-coverage.d.ts +70 -0
- package/dist/workflow-authoring-coverage.js +421 -0
- package/dist/workflow-authoring-reference.d.ts +20 -0
- package/dist/workflow-authoring-reference.js +156 -0
- package/dist/workflow-capability-contract.d.ts +131 -0
- package/dist/workflow-capability-contract.js +604 -0
- package/dist/workflow-commands.d.ts +18 -0
- package/dist/workflow-commands.js +260 -0
- package/dist/workflow-comprehension.d.ts +133 -0
- package/dist/workflow-comprehension.js +1321 -0
- package/dist/workflow-context-measurement.d.ts +72 -0
- package/dist/workflow-context-measurement.js +213 -0
- package/dist/workflow-control-tool.d.ts +30 -0
- package/dist/workflow-control-tool.js +176 -0
- package/dist/workflow-delivery-choice.d.ts +20 -0
- package/dist/workflow-delivery-choice.js +48 -0
- package/dist/workflow-editor.d.ts +93 -0
- package/dist/workflow-editor.js +363 -0
- package/dist/workflow-manager.d.ts +492 -0
- package/dist/workflow-manager.js +1124 -0
- package/dist/workflow-paths.d.ts +22 -0
- package/dist/workflow-paths.js +46 -0
- package/dist/workflow-release-gate.d.ts +39 -0
- package/dist/workflow-release-gate.js +309 -0
- package/dist/workflow-saved.d.ts +38 -0
- package/dist/workflow-saved.js +126 -0
- package/dist/workflow-settings.d.ts +70 -0
- package/dist/workflow-settings.js +131 -0
- package/dist/workflow-tool.d.ts +71 -0
- package/dist/workflow-tool.js +367 -0
- package/dist/workflow-ui.d.ts +182 -0
- package/dist/workflow-ui.js +1587 -0
- package/dist/workflow.d.ts +333 -0
- package/dist/workflow.js +1151 -0
- package/dist/workflows-models-command.d.ts +31 -0
- package/dist/workflows-models-command.js +156 -0
- package/dist/worktree.d.ts +25 -0
- package/dist/worktree.js +61 -0
- package/extensions/workflow.ts +151 -0
- package/package.json +104 -0
- package/skills/workflow-authoring/SKILL.md +30 -0
- package/skills/workflow-authoring/examples/adversarial-verification.js +63 -0
- package/skills/workflow-authoring/examples/bounded-semantic-retry.js +56 -0
- package/skills/workflow-authoring/examples/classify-and-act.js +67 -0
- package/skills/workflow-authoring/examples/fan-out-and-synthesize.js +47 -0
- package/skills/workflow-authoring/examples/generate-and-filter.js +68 -0
- package/skills/workflow-authoring/examples/loop-until-done.js +68 -0
- package/skills/workflow-authoring/examples/phased-budgets.js +75 -0
- package/skills/workflow-authoring/examples/saved-nested-workflows.js +44 -0
- package/skills/workflow-authoring/examples/structured-output.js +37 -0
- package/skills/workflow-authoring/examples/tournament.js +81 -0
- package/skills/workflow-authoring/examples/validated-gate.js +63 -0
- package/skills/workflow-authoring/references/capabilities.md +41 -0
- package/skills/workflow-authoring/references/capability-details.md +357 -0
- package/skills/workflow-authoring/references/common-helpers.md +4 -0
- package/skills/workflow-authoring/references/debugging.md +27 -0
- package/skills/workflow-authoring/references/focused-recipes.md +11 -0
- package/skills/workflow-authoring/references/helpers.md +9 -0
- package/skills/workflow-authoring/references/lifecycle.md +33 -0
- package/skills/workflow-authoring/references/pattern-selection.md +15 -0
- package/skills/workflow-authoring/references/quality-helpers.md +8 -0
- package/skills/workflow-authoring/references/registry-ownership.md +15 -0
- package/skills/workflow-authoring/references/retry-helper.md +5 -0
- package/skills/workflow-authoring/references/review.md +43 -0
- package/skills/workflow-authoring/references/runtime.md +27 -0
- package/skills/workflow-authoring/references/specialized-helpers.md +19 -0
- package/skills/workflow-authoring/references/versions.md +13 -0
- package/skills/workflow-patterns/SKILL.md +51 -0
- package/src/accept-workflow-guidance.ts +71 -0
- package/src/adversarial-review.ts +120 -0
- package/src/agent-history.ts +157 -0
- package/src/agent-registry.ts +221 -0
- package/src/agent.ts +929 -0
- package/src/builtin-commands.ts +286 -0
- package/src/builtin-workflows.ts +155 -0
- package/src/code-review.ts +183 -0
- package/src/config.ts +55 -0
- package/src/deep-research.ts +135 -0
- package/src/display.ts +367 -0
- package/src/effort-command.ts +87 -0
- package/src/enums.ts +77 -0
- package/src/errors.ts +199 -0
- package/src/extension-reload.ts +100 -0
- package/src/fs-persistence.ts +124 -0
- package/src/index.ts +176 -0
- package/src/logger.ts +88 -0
- package/src/model-routing.ts +73 -0
- package/src/model-spec.ts +309 -0
- package/src/model-tier-config.ts +296 -0
- package/src/run-persistence.ts +484 -0
- package/src/saved-commands.ts +115 -0
- package/src/shared-store.ts +228 -0
- package/src/structured-output.ts +47 -0
- package/src/task-panel.ts +490 -0
- package/src/usage-limit-scheduler.ts +432 -0
- package/src/web-tools.ts +124 -0
- package/src/workflow-authoring-coverage.ts +486 -0
- package/src/workflow-authoring-reference.ts +186 -0
- package/src/workflow-capability-contract.ts +806 -0
- package/src/workflow-commands.ts +287 -0
- package/src/workflow-comprehension.ts +1673 -0
- package/src/workflow-context-measurement.ts +262 -0
- package/src/workflow-control-tool.ts +238 -0
- package/src/workflow-delivery-choice.ts +69 -0
- package/src/workflow-editor.ts +444 -0
- package/src/workflow-manager.ts +1405 -0
- package/src/workflow-paths.ts +63 -0
- package/src/workflow-release-gate.ts +529 -0
- package/src/workflow-saved.ts +180 -0
- package/src/workflow-settings.ts +194 -0
- package/src/workflow-tool.ts +464 -0
- package/src/workflow-ui.ts +1789 -0
- package/src/workflow.ts +1615 -0
- package/src/workflows-models-command.ts +211 -0
- package/src/worktree.ts +76 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export const meta = {
|
|
2
|
+
name: "bounded_semantic_retry",
|
|
3
|
+
description: "Separate recoverable transport retries from a visible bounded semantic attempt ledger",
|
|
4
|
+
phases: [{ title: "Attempt" }],
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// ADAPT: define task-owned acceptance, prompts, bounds, and structured result fields.
|
|
8
|
+
const maxSemanticAttempts =
|
|
9
|
+
args && Number.isInteger(args.maxSemanticAttempts) ? Math.max(1, Math.min(args.maxSemanticAttempts, 5)) : 3;
|
|
10
|
+
const transportRetries =
|
|
11
|
+
args && Number.isInteger(args.transportRetries) ? Math.max(0, Math.min(args.transportRetries, 3)) : 0;
|
|
12
|
+
const resultSchema = {
|
|
13
|
+
type: "object",
|
|
14
|
+
properties: {
|
|
15
|
+
accepted: { type: "boolean" },
|
|
16
|
+
answer: { type: "string" },
|
|
17
|
+
feedback: { type: "string" },
|
|
18
|
+
},
|
|
19
|
+
required: ["accepted", "answer", "feedback"],
|
|
20
|
+
};
|
|
21
|
+
const attempts = [];
|
|
22
|
+
let feedback = "";
|
|
23
|
+
let acceptedResult = null;
|
|
24
|
+
|
|
25
|
+
phase("Attempt");
|
|
26
|
+
for (let attempt = 1; attempt <= maxSemanticAttempts; attempt++) {
|
|
27
|
+
const result = await agent(
|
|
28
|
+
`Produce an acceptable answer.${feedback ? ` Address this prior feedback: ${feedback}` : ""}`,
|
|
29
|
+
{
|
|
30
|
+
label: `semantic-attempt:${attempt}`,
|
|
31
|
+
schema: resultSchema,
|
|
32
|
+
// Runtime retries repeat this same logical call after recoverable execution failures.
|
|
33
|
+
retries: transportRetries,
|
|
34
|
+
},
|
|
35
|
+
);
|
|
36
|
+
if (result === null) {
|
|
37
|
+
attempts.push({ attempt, status: "missing", result: null });
|
|
38
|
+
feedback = "The previous logical attempt produced no usable coverage.";
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
const status = result.accepted ? "accepted" : "rejected";
|
|
42
|
+
attempts.push({ attempt, status, result });
|
|
43
|
+
if (result.accepted) {
|
|
44
|
+
acceptedResult = result;
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
feedback = result.feedback;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// INVARIANT: semantic exhaustion is returned visibly; it is not presented as success or thrown away.
|
|
51
|
+
return {
|
|
52
|
+
ok: acceptedResult !== null,
|
|
53
|
+
exhausted: acceptedResult === null && attempts.length === maxSemanticAttempts,
|
|
54
|
+
result: acceptedResult,
|
|
55
|
+
attempts,
|
|
56
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export const meta = {
|
|
2
|
+
name: "classify_and_act",
|
|
3
|
+
description: "Classify bounded work before routing each item to an appropriate actor",
|
|
4
|
+
phases: [{ title: "Classify" }, { title: "Act" }],
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// ADAPT: validate and bound items, categories, prompts, and schemas for the task.
|
|
8
|
+
const items =
|
|
9
|
+
args && Array.isArray(args.items) ? args.items : [{ id: "sample", task: "Classify one sample item" }];
|
|
10
|
+
const categories = ["direct", "parallel", "iterative"];
|
|
11
|
+
const instructionsByCategory = {
|
|
12
|
+
direct: "Handle directly in one focused pass.",
|
|
13
|
+
parallel: "Divide independent parts, account for each part, then combine them.",
|
|
14
|
+
iterative: "Work in bounded rounds and stop when the task-specific condition is met.",
|
|
15
|
+
};
|
|
16
|
+
const classificationSchema = {
|
|
17
|
+
type: "object",
|
|
18
|
+
properties: {
|
|
19
|
+
category: { type: "string", enum: categories },
|
|
20
|
+
reason: { type: "string" },
|
|
21
|
+
},
|
|
22
|
+
required: ["category", "reason"],
|
|
23
|
+
};
|
|
24
|
+
const actionSchema = {
|
|
25
|
+
type: "object",
|
|
26
|
+
properties: { outcome: { type: "string" } },
|
|
27
|
+
required: ["outcome"],
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
phase("Classify");
|
|
31
|
+
const classifications = await parallel(
|
|
32
|
+
items.map((item, index) => () =>
|
|
33
|
+
agent(`Classify this item as ${categories.join(", ")}.\n\n${JSON.stringify(item)}`, {
|
|
34
|
+
label: `classify:${index}:${String(item.id)}`,
|
|
35
|
+
schema: classificationSchema,
|
|
36
|
+
}),
|
|
37
|
+
),
|
|
38
|
+
);
|
|
39
|
+
const failedClassification = items.flatMap((item, index) =>
|
|
40
|
+
classifications[index] === null ? [String(item.id)] : [],
|
|
41
|
+
);
|
|
42
|
+
const routed = items.flatMap((item, index) =>
|
|
43
|
+
classifications[index] === null ? [] : [{ item, classification: classifications[index] }],
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
// INVARIANT: no routed action starts until the complete classification set exists.
|
|
47
|
+
phase("Act");
|
|
48
|
+
const actions = await parallel(
|
|
49
|
+
routed.map(({ item, classification }, index) => () =>
|
|
50
|
+
agent(
|
|
51
|
+
`${instructionsByCategory[classification.category]}\n\n${JSON.stringify(item)}`,
|
|
52
|
+
{ label: `act:${index}:${String(item.id)}`, schema: actionSchema },
|
|
53
|
+
),
|
|
54
|
+
),
|
|
55
|
+
);
|
|
56
|
+
const failedAction = routed.flatMap(({ item }, index) => (actions[index] === null ? [String(item.id)] : []));
|
|
57
|
+
|
|
58
|
+
// INVARIANT: retain identities for failures in either stage.
|
|
59
|
+
return {
|
|
60
|
+
handled: routed.flatMap(({ item, classification }, index) =>
|
|
61
|
+
actions[index] === null
|
|
62
|
+
? []
|
|
63
|
+
: [{ id: String(item.id), category: classification.category, result: actions[index] }],
|
|
64
|
+
),
|
|
65
|
+
failed: { classification: failedClassification, action: failedAction },
|
|
66
|
+
complete: failedClassification.length === 0 && failedAction.length === 0,
|
|
67
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export const meta = {
|
|
2
|
+
name: "fan_out_and_synthesize",
|
|
3
|
+
description: "Run bounded independent work, retain a complete coverage ledger, then synthesize",
|
|
4
|
+
phases: [{ title: "Fan out" }, { title: "Synthesize" }],
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// ADAPT: validate and bound args.work for the task before invoking this workflow.
|
|
8
|
+
const work = args && Array.isArray(args.work) ? args.work : [];
|
|
9
|
+
|
|
10
|
+
phase("Fan out");
|
|
11
|
+
const fanOutResults = await parallel(
|
|
12
|
+
work.map((unit, index) => () =>
|
|
13
|
+
agent(
|
|
14
|
+
`Complete this independent work unit. Return only evidence relevant to it.\n\n${JSON.stringify(unit)}`,
|
|
15
|
+
// INVARIANT: index plus a stable task-owned id keeps labels unique.
|
|
16
|
+
{ label: `fanout:${index}:${String(unit.id)}` },
|
|
17
|
+
),
|
|
18
|
+
),
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
// INVARIANT: preserve every intended identity before filtering or synthesis.
|
|
22
|
+
const ledger = work.map((unit, index) => ({
|
|
23
|
+
id: String(unit.id),
|
|
24
|
+
status: fanOutResults[index] === null ? "failed" : "complete",
|
|
25
|
+
result: fanOutResults[index],
|
|
26
|
+
}));
|
|
27
|
+
|
|
28
|
+
phase("Synthesize");
|
|
29
|
+
const synthesis = await agent(
|
|
30
|
+
`Synthesize the complete fan-out ledger below. Distinguish covered work from failed/missing coverage; do not invent results.\n\n${JSON.stringify(ledger)}`,
|
|
31
|
+
{
|
|
32
|
+
label: "synthesize-complete-set",
|
|
33
|
+
// ADAPT: keep the schema small and aligned with downstream field access.
|
|
34
|
+
schema: {
|
|
35
|
+
type: "object",
|
|
36
|
+
properties: {
|
|
37
|
+
summary: { type: "string" },
|
|
38
|
+
coveredIds: { type: "array", items: { type: "string" } },
|
|
39
|
+
failedIds: { type: "array", items: { type: "string" } },
|
|
40
|
+
},
|
|
41
|
+
required: ["summary", "coveredIds", "failedIds"],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
// INVARIANT: return plain serializable data, including missing-coverage identities.
|
|
47
|
+
return { ledger, synthesis };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export const meta = {
|
|
2
|
+
name: "generate_and_filter",
|
|
3
|
+
description: "Generate divergent candidates, deterministically deduplicate, then apply a rubric",
|
|
4
|
+
phases: [{ title: "Generate" }, { title: "Filter" }],
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// ADAPT: choose the topic, rubric, candidate schema, and a task-appropriate batch bound.
|
|
8
|
+
const topic = args && typeof args.topic === "string" ? args.topic : "candidate ideas";
|
|
9
|
+
const rubric = args && typeof args.rubric === "string" ? args.rubric : "Distinct and fit for purpose";
|
|
10
|
+
const batchCount = args && Number.isInteger(args.batches) ? Math.max(1, Math.min(args.batches, 8)) : 3;
|
|
11
|
+
const maxCandidates =
|
|
12
|
+
args && Number.isInteger(args.maxCandidates) ? Math.max(1, Math.min(args.maxCandidates, 64)) : 24;
|
|
13
|
+
const generationSchema = {
|
|
14
|
+
type: "object",
|
|
15
|
+
properties: { candidates: { type: "array", items: { type: "string" } } },
|
|
16
|
+
required: ["candidates"],
|
|
17
|
+
};
|
|
18
|
+
const filterSchema = {
|
|
19
|
+
type: "object",
|
|
20
|
+
properties: { keep: { type: "boolean" }, reason: { type: "string" } },
|
|
21
|
+
required: ["keep", "reason"],
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
phase("Generate");
|
|
25
|
+
const batches = await parallel(
|
|
26
|
+
Array.from({ length: batchCount }, (_, index) => () =>
|
|
27
|
+
agent(`Generate divergent candidates for ${topic}. Seek a distinct angle for batch ${index + 1}.`, {
|
|
28
|
+
label: `generate:${index + 1}`,
|
|
29
|
+
schema: generationSchema,
|
|
30
|
+
}),
|
|
31
|
+
),
|
|
32
|
+
);
|
|
33
|
+
const failedBatches = batches.flatMap((batch, index) => (batch === null ? [index + 1] : []));
|
|
34
|
+
|
|
35
|
+
// INVARIANT: JavaScript performs stable, normalized first-wins deduplication before filter calls.
|
|
36
|
+
const seen = new Set();
|
|
37
|
+
const deduplicated = [];
|
|
38
|
+
for (const batch of batches) {
|
|
39
|
+
for (const candidate of batch?.candidates ?? []) {
|
|
40
|
+
const key = candidate.trim().toLowerCase();
|
|
41
|
+
if (key && !seen.has(key)) {
|
|
42
|
+
seen.add(key);
|
|
43
|
+
deduplicated.push(candidate);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const candidates = deduplicated.slice(0, maxCandidates);
|
|
48
|
+
const omitted = deduplicated.slice(maxCandidates);
|
|
49
|
+
|
|
50
|
+
phase("Filter");
|
|
51
|
+
const verdicts = await parallel(
|
|
52
|
+
candidates.map((candidate, index) => () =>
|
|
53
|
+
agent(`Apply this rubric: ${rubric}\nCandidate: ${candidate}`, {
|
|
54
|
+
label: `filter:${index + 1}`,
|
|
55
|
+
schema: filterSchema,
|
|
56
|
+
}),
|
|
57
|
+
),
|
|
58
|
+
);
|
|
59
|
+
const failedFilters = candidates.flatMap((candidate, index) => (verdicts[index] === null ? [candidate] : []));
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
candidates,
|
|
63
|
+
omitted,
|
|
64
|
+
survivors: candidates.filter((_, index) => verdicts[index]?.keep),
|
|
65
|
+
rejected: candidates.filter((_, index) => verdicts[index] !== null && !verdicts[index].keep),
|
|
66
|
+
failed: { batches: failedBatches, filters: failedFilters },
|
|
67
|
+
complete: failedBatches.length === 0 && failedFilters.length === 0,
|
|
68
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export const meta = {
|
|
2
|
+
name: "loop_until_done",
|
|
3
|
+
description: "Discover unknown-cardinality findings until repeated successful rounds are dry",
|
|
4
|
+
phases: [{ title: "Discover" }],
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// ADAPT: choose the target, stable identity field, schema, dry-round rule, and maximum bound.
|
|
8
|
+
const target = args && typeof args.target === "string" ? args.target : "new findings";
|
|
9
|
+
const maxRounds = args && Number.isInteger(args.maxRounds) ? Math.max(1, Math.min(args.maxRounds, 20)) : 6;
|
|
10
|
+
const consecutiveDry = 2;
|
|
11
|
+
const roundSchema = {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: {
|
|
14
|
+
findings: {
|
|
15
|
+
type: "array",
|
|
16
|
+
items: {
|
|
17
|
+
type: "object",
|
|
18
|
+
properties: { id: { type: "string" }, detail: { type: "string" } },
|
|
19
|
+
required: ["id", "detail"],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
required: ["findings"],
|
|
24
|
+
};
|
|
25
|
+
const failedRounds = [];
|
|
26
|
+
const knownIds = new Set();
|
|
27
|
+
const findings = [];
|
|
28
|
+
let dryRounds = 0;
|
|
29
|
+
let roundsRun = 0;
|
|
30
|
+
|
|
31
|
+
phase("Discover");
|
|
32
|
+
while (roundsRun < maxRounds && dryRounds < consecutiveDry) {
|
|
33
|
+
const roundNumber = roundsRun + 1;
|
|
34
|
+
const response = await agent(
|
|
35
|
+
`Find ${target}. Return only findings not represented by these stable IDs: ${JSON.stringify([...knownIds])}`,
|
|
36
|
+
{ label: `discover:${roundNumber}`, schema: roundSchema },
|
|
37
|
+
);
|
|
38
|
+
roundsRun++;
|
|
39
|
+
if (response === null) {
|
|
40
|
+
// INVARIANT: missing coverage is not evidence that a round was dry or part of a dry streak.
|
|
41
|
+
failedRounds.push(roundNumber);
|
|
42
|
+
dryRounds = 0;
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const fresh = [];
|
|
47
|
+
for (const finding of response.findings) {
|
|
48
|
+
if (!knownIds.has(finding.id)) {
|
|
49
|
+
knownIds.add(finding.id);
|
|
50
|
+
fresh.push(finding);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (fresh.length === 0) dryRounds++;
|
|
54
|
+
else {
|
|
55
|
+
dryRounds = 0;
|
|
56
|
+
findings.push(...fresh);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// INVARIANT: stable IDs, consecutive successful dry rounds, and maxRounds bound exploration.
|
|
61
|
+
const termination = dryRounds >= consecutiveDry ? "dry" : "max-rounds";
|
|
62
|
+
return {
|
|
63
|
+
findings,
|
|
64
|
+
failedRounds,
|
|
65
|
+
roundsRun,
|
|
66
|
+
termination,
|
|
67
|
+
complete: failedRounds.length === 0 && termination === "dry",
|
|
68
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export const meta = {
|
|
2
|
+
name: "phased_budgets",
|
|
3
|
+
description: "Bound noisy work with named phase budgets and report shared token spending truthfully",
|
|
4
|
+
phases: [{ title: "Explore" }, { title: "Deliver" }],
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// ADAPT: validate the work, choose phase budgets, prompts, schemas, and invocation-level tokenBudget.
|
|
8
|
+
const work = args && Array.isArray(args.work) ? args.work.slice(0, 8) : [{ id: "sample" }];
|
|
9
|
+
const phaseBudget =
|
|
10
|
+
args && Number.isFinite(args.phaseBudget) ? Math.max(1, Math.min(args.phaseBudget, 100000)) : 2000;
|
|
11
|
+
const resultSchema = {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: { summary: { type: "string" } },
|
|
14
|
+
required: ["summary"],
|
|
15
|
+
};
|
|
16
|
+
const phases = [];
|
|
17
|
+
|
|
18
|
+
phase("Explore", { budget: phaseBudget });
|
|
19
|
+
const exploreStart = budget.spent();
|
|
20
|
+
const explored = [];
|
|
21
|
+
const exploreMissing = [];
|
|
22
|
+
const exploreAttempted = work.map((item) => String(item.id));
|
|
23
|
+
for (let index = 0; index < work.length; index++) {
|
|
24
|
+
const item = work[index];
|
|
25
|
+
const id = String(item.id);
|
|
26
|
+
try {
|
|
27
|
+
const result = await agent(`Explore this bounded work item: ${JSON.stringify(item)}`, {
|
|
28
|
+
label: `explore:${index}:${id}`,
|
|
29
|
+
schema: resultSchema,
|
|
30
|
+
});
|
|
31
|
+
if (result === null) exploreMissing.push(id);
|
|
32
|
+
else explored.push({ id, index, result });
|
|
33
|
+
} catch (error) {
|
|
34
|
+
if (!error || error.code !== "TOKEN_BUDGET_EXHAUSTED") throw error;
|
|
35
|
+
// INVARIANT: the soft gate blocks this and later calls; retain every intended identity as missing coverage.
|
|
36
|
+
exploreMissing.push(...work.slice(index).map((remaining) => String(remaining.id)));
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
phases.push({
|
|
41
|
+
title: "Explore",
|
|
42
|
+
startSpent: exploreStart,
|
|
43
|
+
endSpent: budget.spent(),
|
|
44
|
+
attempted: exploreAttempted,
|
|
45
|
+
missing: exploreMissing,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
phase("Deliver");
|
|
49
|
+
const deliverStart = budget.spent();
|
|
50
|
+
const delivered = [];
|
|
51
|
+
const deliverMissing = [];
|
|
52
|
+
for (const item of explored) {
|
|
53
|
+
const result = await agent(`Turn this exploration into a deliverable: ${JSON.stringify(item.result)}`, {
|
|
54
|
+
label: `deliver:${item.index}:${item.id}`,
|
|
55
|
+
schema: resultSchema,
|
|
56
|
+
});
|
|
57
|
+
if (result === null) deliverMissing.push(item.id);
|
|
58
|
+
else delivered.push({ id: item.id, result });
|
|
59
|
+
}
|
|
60
|
+
phases.push({
|
|
61
|
+
title: "Deliver",
|
|
62
|
+
startSpent: deliverStart,
|
|
63
|
+
endSpent: budget.spent(),
|
|
64
|
+
attempted: explored.map((item) => item.id),
|
|
65
|
+
missing: deliverMissing,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// INVARIANT: phase and total budgets are soft pre-call gates; completed in-flight work may overshoot a limit.
|
|
69
|
+
return {
|
|
70
|
+
phases,
|
|
71
|
+
delivered,
|
|
72
|
+
totalSpent: budget.spent(),
|
|
73
|
+
remaining: budget.remaining(),
|
|
74
|
+
complete: exploreMissing.length === 0 && deliverMissing.length === 0,
|
|
75
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export const meta = {
|
|
2
|
+
name: "saved_nested_workflows",
|
|
3
|
+
description: "Run bounded jobs sequentially through one context-supplied installed workflow",
|
|
4
|
+
phases: [{ title: "Prepare" }, { title: "Run saved workflow" }],
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// ADAPT: accept only a saved workflow name supplied in context; never guess an installed name.
|
|
8
|
+
const savedWorkflowName = args && typeof args.savedWorkflowName === "string" ? args.savedWorkflowName : null;
|
|
9
|
+
if (!savedWorkflowName) throw new Error("args.savedWorkflowName must be supplied by context");
|
|
10
|
+
const jobs = args && Array.isArray(args.jobs) ? args.jobs.slice(0, 8) : [{ id: "sample" }];
|
|
11
|
+
const preparationSchema = {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: { ready: { type: "boolean" } },
|
|
14
|
+
required: ["ready"],
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
phase("Prepare");
|
|
18
|
+
const preparation = await agent(`Check ${jobs.length} bounded nested jobs for readiness.`, {
|
|
19
|
+
label: "prepare-nested-jobs",
|
|
20
|
+
schema: preparationSchema,
|
|
21
|
+
});
|
|
22
|
+
const preparationMissing = preparation === null;
|
|
23
|
+
|
|
24
|
+
phase("Run saved workflow");
|
|
25
|
+
const nested = [];
|
|
26
|
+
if (preparationMissing || !preparation.ready) {
|
|
27
|
+
for (const job of jobs) nested.push({ id: String(job.id), status: "missing", result: null });
|
|
28
|
+
}
|
|
29
|
+
for (const job of preparationMissing || !preparation.ready ? [] : jobs) {
|
|
30
|
+
const id = String(job.id);
|
|
31
|
+
// INVARIANT: await each nested run before starting the next; workflow() permits only one nested level.
|
|
32
|
+
const result = await workflow(savedWorkflowName, job);
|
|
33
|
+
const missing = result === null || (typeof result === "object" && result !== null && result.result === null);
|
|
34
|
+
nested.push({ id, status: missing ? "missing" : "complete", result });
|
|
35
|
+
}
|
|
36
|
+
const missing = nested.filter((entry) => entry.status === "missing").map((entry) => entry.id);
|
|
37
|
+
|
|
38
|
+
// INVARIANT: nested runs share parent agent/concurrency/token limits, accounting, and store state.
|
|
39
|
+
return {
|
|
40
|
+
preparation: { status: preparationMissing ? "missing" : "complete", result: preparation },
|
|
41
|
+
nested,
|
|
42
|
+
missing,
|
|
43
|
+
complete: !preparationMissing && missing.length === 0,
|
|
44
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export const meta = {
|
|
2
|
+
name: "structured_output",
|
|
3
|
+
description: "Validate agent output with a plain JSON Schema before JavaScript consumes fields",
|
|
4
|
+
phases: [{ title: "Extract" }],
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// ADAPT: validate and bound work, then keep the schema as small as downstream JavaScript needs.
|
|
8
|
+
const work = args && Array.isArray(args.work) ? args.work.slice(0, 8) : [{ id: "sample" }];
|
|
9
|
+
const outputSchema = {
|
|
10
|
+
type: "object",
|
|
11
|
+
properties: {
|
|
12
|
+
summary: { type: "string" },
|
|
13
|
+
confidence: { type: "number", minimum: 0, maximum: 1 },
|
|
14
|
+
},
|
|
15
|
+
required: ["summary", "confidence"],
|
|
16
|
+
};
|
|
17
|
+
const outputs = [];
|
|
18
|
+
const missing = [];
|
|
19
|
+
|
|
20
|
+
phase("Extract");
|
|
21
|
+
for (let index = 0; index < work.length; index++) {
|
|
22
|
+
const item = work[index];
|
|
23
|
+
const id = String(item.id);
|
|
24
|
+
const result = await agent(`Summarize this item: ${JSON.stringify(item)}`, {
|
|
25
|
+
label: `structured:${index}:${id}`,
|
|
26
|
+
schema: outputSchema,
|
|
27
|
+
});
|
|
28
|
+
if (result === null) {
|
|
29
|
+
missing.push(id);
|
|
30
|
+
outputs.push({ id, status: "missing", summary: null });
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
// INVARIANT: field access happens only after schema validation guarantees this shape.
|
|
34
|
+
outputs.push({ id, status: "complete", summary: result.summary.toUpperCase(), confidence: result.confidence });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return { outputs, missing, complete: missing.length === 0 };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export const meta = {
|
|
2
|
+
name: "pairwise_tournament",
|
|
3
|
+
description: "Create bounded contenders and choose among them through pairwise judgments",
|
|
4
|
+
phases: [{ title: "Compete" }, { title: "Judge" }],
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// ADAPT: choose the task, pairwise rubric, schemas, and a suitable contender bound.
|
|
8
|
+
const task = args && typeof args.task === "string" ? args.task : "Propose a candidate";
|
|
9
|
+
const rubric = args && typeof args.rubric === "string" ? args.rubric : "Prefer the better task fit";
|
|
10
|
+
const contenderCount = args && Number.isInteger(args.contenders)
|
|
11
|
+
? Math.max(2, Math.min(args.contenders, 8))
|
|
12
|
+
: 4;
|
|
13
|
+
const contenderSchema = {
|
|
14
|
+
type: "object",
|
|
15
|
+
properties: { candidate: { type: "string" }, rationale: { type: "string" } },
|
|
16
|
+
required: ["candidate", "rationale"],
|
|
17
|
+
};
|
|
18
|
+
const judgeSchema = {
|
|
19
|
+
type: "object",
|
|
20
|
+
properties: { winnerIndex: { type: "integer", enum: [0, 1] }, reason: { type: "string" } },
|
|
21
|
+
required: ["winnerIndex", "reason"],
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
phase("Compete");
|
|
25
|
+
const attempts = await parallel(
|
|
26
|
+
Array.from({ length: contenderCount }, (_, index) => () =>
|
|
27
|
+
agent(`${task}\nAttempt a distinct approach as contender ${index + 1}.`, {
|
|
28
|
+
label: `contender:${index + 1}`,
|
|
29
|
+
schema: contenderSchema,
|
|
30
|
+
}),
|
|
31
|
+
),
|
|
32
|
+
);
|
|
33
|
+
const failedContenders = attempts.flatMap((attempt, index) => (attempt === null ? [index + 1] : []));
|
|
34
|
+
let round = attempts.flatMap((attempt, index) =>
|
|
35
|
+
attempt === null ? [] : [{ id: `contender-${index + 1}`, attempt }],
|
|
36
|
+
);
|
|
37
|
+
const failedMatches = [];
|
|
38
|
+
const bracket = [];
|
|
39
|
+
|
|
40
|
+
phase("Judge");
|
|
41
|
+
// INVARIANT: JavaScript owns the bounded bracket; agents only judge one pair at a time.
|
|
42
|
+
let roundNumber = 1;
|
|
43
|
+
while (round.length > 1) {
|
|
44
|
+
const matches = [];
|
|
45
|
+
for (let index = 0; index < round.length; index += 2) {
|
|
46
|
+
const match = { left: round[index], right: round[index + 1] ?? null, match: index / 2 + 1 };
|
|
47
|
+
matches.push(match);
|
|
48
|
+
bracket.push({
|
|
49
|
+
round: roundNumber,
|
|
50
|
+
match: match.match,
|
|
51
|
+
leftId: match.left.id,
|
|
52
|
+
rightId: match.right?.id ?? null,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
const judgments = await parallel(
|
|
56
|
+
matches.map(({ left, right, match }) => () =>
|
|
57
|
+
right === null
|
|
58
|
+
? Promise.resolve({ winnerIndex: 0, reason: "bye" })
|
|
59
|
+
: agent(
|
|
60
|
+
`Choose index 0 or 1 under this rubric: ${rubric}\nCandidate 0: ${JSON.stringify(left.attempt)}\nCandidate 1: ${JSON.stringify(right.attempt)}`,
|
|
61
|
+
{ label: `judge:${roundNumber}:${match}`, schema: judgeSchema },
|
|
62
|
+
),
|
|
63
|
+
),
|
|
64
|
+
);
|
|
65
|
+
round = matches.flatMap(({ left, right, match }, index) => {
|
|
66
|
+
const judgment = judgments[index];
|
|
67
|
+
if (judgment === null) {
|
|
68
|
+
failedMatches.push(`round-${roundNumber}-match-${match}`);
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
return [judgment.winnerIndex === 1 && right !== null ? right : left];
|
|
72
|
+
});
|
|
73
|
+
roundNumber++;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
winner: failedMatches.length === 0 ? (round[0] ?? null) : null,
|
|
78
|
+
bracket,
|
|
79
|
+
failed: { contenders: failedContenders, matches: failedMatches },
|
|
80
|
+
complete: failedContenders.length === 0 && failedMatches.length === 0 && round.length === 1,
|
|
81
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export const meta = {
|
|
2
|
+
name: "validated_gate",
|
|
3
|
+
description: "Use validator feedback to steer bounded structured attempts through gate()",
|
|
4
|
+
phases: [{ title: "Validate" }],
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// ADAPT: replace the task, structured fields, and task-owned acceptance policy.
|
|
8
|
+
const task = args && typeof args.task === "string" ? args.task : "Produce an acceptable answer.";
|
|
9
|
+
const maxAttempts =
|
|
10
|
+
args && Number.isInteger(args.maxAttempts) ? Math.max(1, Math.min(args.maxAttempts, 5)) : 3;
|
|
11
|
+
const resultSchema = {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: {
|
|
14
|
+
acceptable: { type: "boolean" },
|
|
15
|
+
answer: { type: "string" },
|
|
16
|
+
feedback: { type: "string" },
|
|
17
|
+
},
|
|
18
|
+
required: ["acceptable", "answer", "feedback"],
|
|
19
|
+
};
|
|
20
|
+
const ledger = [];
|
|
21
|
+
|
|
22
|
+
phase("Validate");
|
|
23
|
+
const outcome = await gate(
|
|
24
|
+
async (feedback, attempt) => {
|
|
25
|
+
// gate() supplies undefined feedback initially and a zero-based attempt index.
|
|
26
|
+
const value = await agent(
|
|
27
|
+
`${task}${feedback ? ` Address this validator feedback: ${feedback}` : ""}`,
|
|
28
|
+
{
|
|
29
|
+
label: `gate-attempt:${attempt + 1}`,
|
|
30
|
+
schema: resultSchema,
|
|
31
|
+
},
|
|
32
|
+
);
|
|
33
|
+
ledger.push({
|
|
34
|
+
attempt: attempt + 1,
|
|
35
|
+
feedbackReceived: feedback ?? null,
|
|
36
|
+
accepted: false,
|
|
37
|
+
validatorFeedback: null,
|
|
38
|
+
value,
|
|
39
|
+
});
|
|
40
|
+
return value;
|
|
41
|
+
},
|
|
42
|
+
(value) => {
|
|
43
|
+
// The validator must return an object. A bare boolean is never an accepting verdict.
|
|
44
|
+
const ok = value !== null && value.acceptable === true && value.answer.trim().length > 0;
|
|
45
|
+
const feedback =
|
|
46
|
+
value === null
|
|
47
|
+
? "The previous attempt returned no usable result."
|
|
48
|
+
: value.feedback.trim() || "The answer did not satisfy the acceptance policy.";
|
|
49
|
+
const entry = ledger[ledger.length - 1];
|
|
50
|
+
entry.accepted = ok;
|
|
51
|
+
entry.validatorFeedback = ok ? null : feedback;
|
|
52
|
+
return ok ? { ok: true } : { ok: false, feedback };
|
|
53
|
+
},
|
|
54
|
+
{ attempts: maxAttempts },
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
// INVARIANT: return gate exhaustion explicitly together with every attempt and feedback handoff.
|
|
58
|
+
return {
|
|
59
|
+
ok: outcome.ok,
|
|
60
|
+
value: outcome.value,
|
|
61
|
+
attempts: outcome.attempts,
|
|
62
|
+
ledger,
|
|
63
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<!-- GENERATED from WORKFLOW_CAPABILITY_CONTRACT; do not edit by hand. -->
|
|
2
|
+
# Workflow capability index
|
|
3
|
+
|
|
4
|
+
Contract format: `1.0.0`<br>
|
|
5
|
+
Contract content / skill / extension: `3.3.0`
|
|
6
|
+
|
|
7
|
+
This compact generated index covers supported runtime globals and workflow-tool inputs. For constraints, compatibility behavior, internal boundaries, and dynamic-reference ownership, follow the [exhaustive generated facts](capability-details.md).
|
|
8
|
+
|
|
9
|
+
## Supported capability index
|
|
10
|
+
|
|
11
|
+
<!-- BEGIN GENERATED SUPPORTED WORKFLOW CAPABILITIES -->
|
|
12
|
+
| Name | Classification | Signature | Options and defaults |
|
|
13
|
+
| --- | --- | --- | --- |
|
|
14
|
+
| agent | runtime-global | `agent(prompt, options?) => Promise<string \| structured value \| null>` | `label`: string (optional; default: derived from phase and call count)<br>`phase`: string (optional; default: current phase)<br>`schema`: plain JSON Schema (optional)<br>`model`: string (optional)<br>`tier`: string (optional)<br>`isolation`: "worktree" (optional)<br>`agentType`: string (optional)<br>`timeoutMs`: number \| null (optional; default: run timeout; null disables)<br>`retries`: number (optional; default: run retry count) |
|
|
15
|
+
| parallel | runtime-global | `parallel(thunks) => Promise<Array<unknown \| null>>` | — |
|
|
16
|
+
| pipeline | runtime-global | `pipeline(items, ...stages) => Promise<Array<unknown \| null>>` | — |
|
|
17
|
+
| workflow | runtime-global | `workflow(savedName, childArgs?) => Promise<unknown>` | — |
|
|
18
|
+
| verify | runtime-global | `verify(item: unknown, options?: { reviewers?: number; threshold?: number; lens?: string \| string[] }) => Promise<{ real: boolean; realCount: number; total: number; votes: Array<{ real: boolean; reason?: string }> }>` | `reviewers`: number (optional; default: 2)<br>`threshold`: number (optional; default: 0.5)<br>`lens`: string \| string[] (optional) |
|
|
19
|
+
| judgePanel | runtime-global | `judgePanel(attempts: unknown[], options?: { judges?: number; rubric?: string }) => Promise<{ index: number; attempt: unknown; score: number; judgments: Array<{ score: number; reason?: string }> } \| undefined>` | `judges`: number (optional; default: 3)<br>`rubric`: string (optional; default: "overall quality and correctness") |
|
|
20
|
+
| loopUntilDry | runtime-global | `loopUntilDry(options: { round: (roundIndex: number) => unknown[] \| Promise<unknown[]>; key?: (item: unknown) => string; consecutiveEmpty?: number; maxRounds?: number }) => Promise<unknown[]>` | `round`: (roundIndex: number) => unknown[] \| Promise<unknown[]> (required)<br>`key`: (item: unknown) => string (optional; default: JSON.stringify)<br>`consecutiveEmpty`: number (optional; default: 2)<br>`maxRounds`: number (optional; default: 50) |
|
|
21
|
+
| completenessCheck | runtime-global | `completenessCheck(taskArgs: unknown, results: unknown) => Promise<{ complete: boolean; missing?: string[] } \| null>` | — |
|
|
22
|
+
| retry | runtime-global | `retry(thunk: (attempt: number) => unknown \| Promise<unknown>, options?: { attempts?: number; until?: (result: unknown) => boolean }) => Promise<unknown>` | `attempts`: number (optional; default: 3)<br>`until`: (result: unknown) => boolean (optional; default: accept first result when omitted) |
|
|
23
|
+
| gate | runtime-global | `gate(thunk: (feedback: string \| undefined, attempt: number) => unknown \| Promise<unknown>, validator: (value: unknown) => { ok: boolean; feedback?: string } \| Promise<{ ok: boolean; feedback?: string }>, options?: { attempts?: number }) => Promise<{ ok: boolean; value: unknown; attempts: number }>` | `attempts`: number (optional; default: 3) |
|
|
24
|
+
| checkpoint | runtime-global | `checkpoint(prompt, options?) => Promise<unknown>` | `default`: unknown (optional; default: true when no UI and omitted)<br>`headless`: "default" \| "abort" (optional; default: "default")<br>`kind`: "confirm" \| "input" \| "select" (optional; default: "confirm")<br>`choices`: string[] (optional)<br>`timeoutMs`: number (optional) |
|
|
25
|
+
| log | runtime-global | `log(message) => void` | — |
|
|
26
|
+
| phase | runtime-global | `phase(title, options?) => void` | `budget`: number (optional) |
|
|
27
|
+
| args | runtime-global | `args: unknown` | — |
|
|
28
|
+
| cwd | runtime-global | `cwd: string` | — |
|
|
29
|
+
| process | runtime-global | `process: { cwd(): string }` | — |
|
|
30
|
+
| budget | runtime-global | `budget: { total, spent(), remaining() }` | — |
|
|
31
|
+
| script | workflow-tool-input | `script?: string` | — |
|
|
32
|
+
| name | workflow-tool-input | `name?: string` | — |
|
|
33
|
+
| args | workflow-tool-input | `args?: unknown` | — |
|
|
34
|
+
| background | workflow-tool-input | `background?: boolean = true` | — |
|
|
35
|
+
| maxAgents | workflow-tool-input | `maxAgents?: number = 1000` | — |
|
|
36
|
+
| concurrency | workflow-tool-input | `concurrency?: number` | — |
|
|
37
|
+
| agentRetries | workflow-tool-input | `agentRetries?: number = configured value or 0` | — |
|
|
38
|
+
| agentTimeoutMs | workflow-tool-input | `agentTimeoutMs?: number = configured default or unbounded` | — |
|
|
39
|
+
| tokenBudget | workflow-tool-input | `tokenBudget?: number = configured default or unlimited` | — |
|
|
40
|
+
| resumeFromRunId | workflow-tool-input | `resumeFromRunId?: string` | — |
|
|
41
|
+
<!-- END GENERATED SUPPORTED WORKFLOW CAPABILITIES -->
|