toolroll 0.9.34 → 0.9.37
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/CHANGELOG.md +102 -0
- package/README.md +7 -0
- package/dist/assignment-adapters.d.ts +12 -48
- package/dist/assignment-adapters.js +33 -43
- package/dist/assignment.d.ts +1 -0
- package/dist/assignment.js +2 -2
- package/dist/browser-workspace.d.ts +3 -3
- package/dist/build-review.d.ts +1 -1
- package/dist/build-review.js +2 -1
- package/dist/builder.js +4 -7
- package/dist/chat-acceptance.d.ts +2 -2
- package/dist/chat-actions.d.ts +18 -12
- package/dist/chat-actions.js +15 -65
- package/dist/chat-ask.js +5 -5
- package/dist/chat-decide.d.ts +14 -1
- package/dist/chat-decide.js +12 -6
- package/dist/chat-delivery-state.d.ts +12 -70
- package/dist/chat-delivery-state.js +17 -135
- package/dist/chat-delivery.js +58 -30
- package/dist/chat-flow.js +8 -6
- package/dist/chat-inbox.js +1 -1
- package/dist/coding-context.d.ts +2 -39
- package/dist/coding-context.js +2 -1
- package/dist/coding-handoff.d.ts +6 -25
- package/dist/coding-handoff.js +11 -5
- package/dist/coding-types.d.ts +2 -26
- package/dist/coding-workspace.d.ts +2 -0
- package/dist/coding-workspace.js +50 -14
- package/dist/contracts/acceptance-terms.d.ts +14 -0
- package/dist/contracts/acceptance-terms.js +16 -0
- package/dist/contracts/chat-actions.d.ts +328 -0
- package/dist/contracts/chat-actions.js +133 -0
- package/dist/contracts/chat-callback-rows.d.ts +59 -0
- package/dist/contracts/chat-callback-rows.js +46 -0
- package/dist/contracts/chat-content.d.ts +276 -0
- package/dist/contracts/chat-content.js +127 -0
- package/dist/contracts/chat-tables.d.ts +6 -0
- package/dist/contracts/chat-tables.js +136 -0
- package/dist/contracts/coding-context.d.ts +97 -0
- package/dist/contracts/coding-context.js +60 -0
- package/dist/contracts/coding-handoff.d.ts +44 -0
- package/dist/contracts/coding-handoff.js +47 -0
- package/dist/contracts/coding-workspace.d.ts +165 -0
- package/dist/contracts/coding-workspace.js +71 -0
- package/dist/contracts/contract.d.ts +40 -7
- package/dist/contracts/contract.js +155 -19
- package/dist/contracts/decision.d.ts +45 -0
- package/dist/contracts/decision.js +45 -0
- package/dist/contracts/discord-callback.d.ts +45 -0
- package/dist/contracts/discord-callback.js +34 -0
- package/dist/contracts/flow-card.d.ts +50 -0
- package/dist/contracts/flow-card.js +46 -0
- package/dist/contracts/flow-propose.d.ts +325 -0
- package/dist/contracts/flow-propose.js +41 -0
- package/dist/contracts/flow-send.d.ts +119 -0
- package/dist/contracts/flow-send.js +112 -0
- package/dist/contracts/flow.d.ts +19405 -0
- package/dist/contracts/flow.js +364 -0
- package/dist/contracts/gateway-tools.d.ts +374 -0
- package/dist/contracts/gateway-tools.js +94 -0
- package/dist/contracts/handoff.d.ts +91 -0
- package/dist/contracts/handoff.js +82 -0
- package/dist/contracts/lead-context.d.ts +165 -0
- package/dist/contracts/lead-context.js +73 -0
- package/dist/contracts/lead-tools.d.ts +1905 -0
- package/dist/contracts/lead-tools.js +265 -0
- package/dist/contracts/memory-pass.d.ts +158 -0
- package/dist/contracts/memory-pass.js +102 -0
- package/dist/contracts/project-knowledge.d.ts +126 -0
- package/dist/contracts/project-knowledge.js +93 -0
- package/dist/contracts/project-memory.d.ts +117 -0
- package/dist/contracts/project-memory.js +51 -0
- package/dist/contracts/project-skills.d.ts +121 -0
- package/dist/contracts/project-skills.js +76 -0
- package/dist/contracts/proof.d.ts +136 -0
- package/dist/contracts/proof.js +110 -0
- package/dist/contracts/review-findings.d.ts +46 -0
- package/dist/contracts/review-findings.js +48 -0
- package/dist/contracts/route.d.ts +484 -0
- package/dist/contracts/route.js +128 -0
- package/dist/contracts/scope.d.ts +105 -0
- package/dist/contracts/scope.js +114 -0
- package/dist/contracts/scout-report.d.ts +234 -0
- package/dist/contracts/scout-report.js +141 -0
- package/dist/contracts/slack-callback.d.ts +43 -0
- package/dist/contracts/slack-callback.js +35 -0
- package/dist/contracts/sort-answer.d.ts +83 -0
- package/dist/contracts/sort-answer.js +77 -0
- package/dist/contracts/stage-output.d.ts +127 -0
- package/dist/contracts/stage-output.js +166 -0
- package/dist/contracts/task-sizing.d.ts +24 -0
- package/dist/contracts/task-sizing.js +28 -0
- package/dist/contracts/teammate-turn.d.ts +43 -0
- package/dist/contracts/teammate-turn.js +51 -0
- package/dist/contracts/teams-callback.d.ts +14 -0
- package/dist/contracts/teams-callback.js +14 -0
- package/dist/contracts/telegram-callback.d.ts +120 -0
- package/dist/contracts/telegram-callback.js +97 -0
- package/dist/contracts/verification-receipt.d.ts +148 -0
- package/dist/contracts/verification-receipt.js +87 -0
- package/dist/decision.d.ts +11 -20
- package/dist/decision.js +86 -167
- package/dist/demo.js +28 -11
- package/dist/discord-chat.js +31 -20
- package/dist/evidence.d.ts +3 -40
- package/dist/evidence.js +5 -1
- package/dist/flow-engine.js +14 -17
- package/dist/flow-gallery.d.ts +3 -2
- package/dist/flow-items.d.ts +4 -13
- package/dist/flow-items.js +1 -15
- package/dist/flow-send.d.ts +6 -37
- package/dist/flow-send.js +18 -14
- package/dist/flow-share.d.ts +10 -32
- package/dist/flow-share.js +72 -84
- package/dist/flow-sort.d.ts +7 -26
- package/dist/flow-sort.js +25 -20
- package/dist/flow-starters.d.ts +2 -1
- package/dist/flow-steps.js +3 -2
- package/dist/flow-triggers.d.ts +15 -72
- package/dist/flow-triggers.js +94 -83
- package/dist/flows.d.ts +37 -220
- package/dist/flows.js +356 -387
- package/dist/invoke.js +4 -4
- package/dist/lead-context.d.ts +4 -2
- package/dist/lead-context.js +24 -17
- package/dist/mate-tools.d.ts +4 -0
- package/dist/mate-tools.js +111 -308
- package/dist/mcp-connect.d.ts +27 -4
- package/dist/mcp-connect.js +92 -17
- package/dist/mcp.js +84 -216
- package/dist/memory-pass.d.ts +17 -42
- package/dist/memory-pass.js +54 -26
- package/dist/operate.js +31 -2
- package/dist/phase-routing.d.ts +19 -72
- package/dist/phase-routing.js +34 -164
- package/dist/plan.d.ts +5 -5
- package/dist/plan.js +5 -25
- package/dist/process-recovery-eligibility.d.ts +2 -2
- package/dist/process-recovery-eligibility.js +13 -8
- package/dist/project-knowledge.d.ts +16 -35
- package/dist/project-knowledge.js +42 -21
- package/dist/project-memory.d.ts +2 -28
- package/dist/project-memory.js +28 -13
- package/dist/project-skills.d.ts +16 -38
- package/dist/project-skills.js +41 -32
- package/dist/project-tools.d.ts +1 -0
- package/dist/project-tools.js +4 -4
- package/dist/proof.d.ts +15 -91
- package/dist/proof.js +90 -249
- package/dist/provider.d.ts +2 -0
- package/dist/provider.js +4 -16
- package/dist/result-evidence-readers.d.ts +42 -0
- package/dist/result-evidence-readers.js +91 -0
- package/dist/result-shots.d.ts +1 -1
- package/dist/result-shots.js +2 -1
- package/dist/review-switch.d.ts +3 -8
- package/dist/reviewer.d.ts +8 -12
- package/dist/reviewer.js +11 -35
- package/dist/scope.d.ts +21 -43
- package/dist/scope.js +42 -128
- package/dist/scout-report.d.ts +9 -194
- package/dist/scout-report.js +113 -264
- package/dist/scout.js +15 -11
- package/dist/serve.js +17 -101
- package/dist/slack-chat.js +26 -20
- package/dist/slack-state.js +2 -1
- package/dist/store.d.ts +9 -32
- package/dist/store.js +18 -15
- package/dist/structured-output.js +2 -1
- package/dist/subscription-chat.d.ts +4 -0
- package/dist/subscription-chat.js +4 -1
- package/dist/surface.js +8 -1
- package/dist/task-review-brief.d.ts +69 -0
- package/dist/task-review-brief.js +179 -0
- package/dist/task-sizing.d.ts +3 -27
- package/dist/task-sizing.js +11 -26
- package/dist/task-text.d.ts +0 -5
- package/dist/task-text.js +1 -3
- package/dist/teammate-question.js +7 -5
- package/dist/teammate-work.js +9 -5
- package/dist/teammates.d.ts +13 -64
- package/dist/teammates.js +32 -33
- package/dist/teams-chat.js +20 -11
- package/dist/telegram-flow.js +4 -3
- package/dist/telegram-mate.d.ts +4 -14
- package/dist/telegram-mate.js +8 -7
- package/dist/telegram-team.d.ts +2 -19
- package/dist/telegram.d.ts +1 -1
- package/dist/telegram.js +52 -42
- package/dist/text-limits.d.ts +212 -1
- package/dist/text-limits.js +214 -1
- package/dist/tools-ui.d.ts +2 -1
- package/dist/tools-ui.js +7 -4
- package/dist/verification-evidence.js +24 -12
- package/package.json +1 -1
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The builder's proof: one schema for the file a builder writes (the proof manifest), the `proof.json` the machine
|
|
3
|
+
* stores, and the reader that reads both back (`parseProof` in proof.ts). The rules JSON Schema cannot state — UTF-8
|
|
4
|
+
* byte limits, blank text, control characters, relative screenshot paths and duplicate ids or paths — run in plain
|
|
5
|
+
* code after parsing, each with a path-named error.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { TEXT_LIMITS } from "../text-limits.js";
|
|
9
|
+
import { EVIDENCE_KINDS } from "../scope.js";
|
|
10
|
+
import { limited, readVersioned, versioned } from "./contract.js";
|
|
11
|
+
/** How many entries each proof list may hold. Text limits live in TEXT_LIMITS. */
|
|
12
|
+
export const PROOF_COUNTS = { criteria: 12, evidencePerCriterion: 4, checks: 12, changed: 64, caveats: 8, screenshots: 8 };
|
|
13
|
+
/** Every proof limit by its long-standing name: the counts above and the byte limits from TEXT_LIMITS. */
|
|
14
|
+
export const PROOF_LIMITS = {
|
|
15
|
+
payload: TEXT_LIMITS.proofPayloadBytes,
|
|
16
|
+
...PROOF_COUNTS,
|
|
17
|
+
criterionId: TEXT_LIMITS.proofCriterionIdBytes,
|
|
18
|
+
criterionStatement: TEXT_LIMITS.proofLineBytes,
|
|
19
|
+
criterionHow: TEXT_LIMITS.proofHowBytes,
|
|
20
|
+
evidenceRef: TEXT_LIMITS.proofLineBytes,
|
|
21
|
+
checkCommand: TEXT_LIMITS.proofLineBytes,
|
|
22
|
+
checkSummary: TEXT_LIMITS.proofLineBytes,
|
|
23
|
+
changedPath: TEXT_LIMITS.proofLineBytes,
|
|
24
|
+
caveat: TEXT_LIMITS.proofLineBytes,
|
|
25
|
+
screenshotPath: TEXT_LIMITS.proofLineBytes,
|
|
26
|
+
screenshotCaption: TEXT_LIMITS.proofLineBytes,
|
|
27
|
+
};
|
|
28
|
+
export const CRITERION_VERDICTS = ["met", "not-met", "not-checked", "pending-verification"];
|
|
29
|
+
const line = (field) => limited(field, "proofLineBytes").min(1);
|
|
30
|
+
/** One typed reference a criterion cites: an existing check's command, screenshot's path, a path in `changed`, or
|
|
31
|
+
* (kind `manual-review`) free text pointing at nothing machine-checkable. */
|
|
32
|
+
export const criterionEvidenceSchema = z.strictObject({
|
|
33
|
+
kind: z.enum(EVIDENCE_KINDS),
|
|
34
|
+
ref: line("evidence ref"),
|
|
35
|
+
});
|
|
36
|
+
/** One criterion the proof answers. `pending-verification` asserts all agent-owned work is met and only the
|
|
37
|
+
* machine-owned final check remains. */
|
|
38
|
+
export const proofCriterionSchema = z.strictObject({
|
|
39
|
+
id: limited("criterion id", "proofCriterionIdBytes").min(1),
|
|
40
|
+
statement: line("criterion statement"),
|
|
41
|
+
how: limited("criterion how", "proofHowBytes").min(1),
|
|
42
|
+
verdict: z.enum(CRITERION_VERDICTS),
|
|
43
|
+
evidence: z.array(criterionEvidenceSchema).max(PROOF_COUNTS.evidencePerCriterion),
|
|
44
|
+
});
|
|
45
|
+
export const proofCheckSchema = z.strictObject({
|
|
46
|
+
command: line("check command"),
|
|
47
|
+
summary: line("check summary"),
|
|
48
|
+
exitCode: z.int().min(0).max(255),
|
|
49
|
+
});
|
|
50
|
+
/** A screenshot the proof claims; its path is where the file lived in the worktree, its bytes are checked by the
|
|
51
|
+
* caller. */
|
|
52
|
+
export const proofScreenshotSchema = z.strictObject({
|
|
53
|
+
path: line("screenshot path"),
|
|
54
|
+
caption: line("screenshot caption"),
|
|
55
|
+
});
|
|
56
|
+
export const PROOF_VERSION = 2;
|
|
57
|
+
/** The proof as stored and as every reader returns it: every list present, nothing unknown. */
|
|
58
|
+
export const proofSchema = versioned(PROOF_VERSION, {
|
|
59
|
+
criteria: z.array(proofCriterionSchema).max(PROOF_COUNTS.criteria),
|
|
60
|
+
checks: z.array(proofCheckSchema).max(PROOF_COUNTS.checks),
|
|
61
|
+
changed: z.array(line("changed path")).max(PROOF_COUNTS.changed),
|
|
62
|
+
caveats: z.array(line("caveat")).max(PROOF_COUNTS.caveats),
|
|
63
|
+
screenshots: z.array(proofScreenshotSchema).max(PROOF_COUNTS.screenshots),
|
|
64
|
+
});
|
|
65
|
+
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
66
|
+
/** The listed fields of `body`, a null or missing one left out (the old parser read null text as missing). */
|
|
67
|
+
function pick(body, fields) {
|
|
68
|
+
const out = {};
|
|
69
|
+
for (const field of fields) {
|
|
70
|
+
if (body[field] !== undefined && body[field] !== null)
|
|
71
|
+
out[field] = body[field];
|
|
72
|
+
}
|
|
73
|
+
return out;
|
|
74
|
+
}
|
|
75
|
+
const each = (value, fields) => (Array.isArray(value) ? value.map(one => (isRecord(one) ? pick(one, fields) : one)) : value);
|
|
76
|
+
/**
|
|
77
|
+
* A version 1 proof — what a builder writes (`{ "version": 1, "screenshots": [...] }`) and every proof stored through
|
|
78
|
+
* 0.9.34 — as version 2. Version 1 read only the fields it knew and ignored any others, and read a missing or null
|
|
79
|
+
* list (a criterion's `evidence` too) as empty; this keeps exactly that. Values themselves are never rewritten.
|
|
80
|
+
*/
|
|
81
|
+
export function upgradeProofV1(body) {
|
|
82
|
+
const list = (field) => (body[field] === undefined || body[field] === null ? [] : body[field]);
|
|
83
|
+
const criteria = list("criteria");
|
|
84
|
+
return {
|
|
85
|
+
version: PROOF_VERSION,
|
|
86
|
+
criteria: Array.isArray(criteria)
|
|
87
|
+
? criteria.map(one => {
|
|
88
|
+
if (!isRecord(one))
|
|
89
|
+
return one;
|
|
90
|
+
const evidence = one["evidence"] === undefined || one["evidence"] === null ? [] : one["evidence"];
|
|
91
|
+
return { ...pick(one, ["id", "statement", "how", "verdict"]), evidence: each(evidence, ["kind", "ref"]) };
|
|
92
|
+
})
|
|
93
|
+
: criteria,
|
|
94
|
+
checks: each(list("checks"), ["command", "summary", "exitCode"]),
|
|
95
|
+
changed: list("changed"),
|
|
96
|
+
caveats: list("caveats"),
|
|
97
|
+
screenshots: each(list("screenshots"), ["path", "caption"]),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
export const PROOF_UPGRADES = { 1: upgradeProofV1 };
|
|
101
|
+
/** The payload as version 2 (upgraded from version 1 when needed), for the plain-code rules; null for a non-object. */
|
|
102
|
+
export function proofPayloadBody(input) {
|
|
103
|
+
if (!isRecord(input))
|
|
104
|
+
return null;
|
|
105
|
+
return input["version"] === 1 ? upgradeProofV1(input) : input;
|
|
106
|
+
}
|
|
107
|
+
/** Read a proof payload: version 2 as itself, version 1 upgraded, a newer one refused plainly. */
|
|
108
|
+
export function readProofPayload(input) {
|
|
109
|
+
return readVersioned(proofSchema, input, PROOF_UPGRADES);
|
|
110
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The automatic build review's findings (build-review.ts): one schema for the reply a reviewer gives, the `findings`
|
|
3
|
+
* a Claude reviewer's `--json-schema` describes (provider.ts, inside the review channel it shares with evidence
|
|
4
|
+
* reviews), and what `build_review.findings_json` keeps. `parseBuildFindings` (reviewer.ts) reads a reply through it;
|
|
5
|
+
* a saved row is the same payload, written by `settle` after that read.
|
|
6
|
+
*
|
|
7
|
+
* As before, controls and runs of whitespace collapse to one space before text limits are checked. Unknown keys
|
|
8
|
+
* are ignored in both the review envelope and each finding.
|
|
9
|
+
*/
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
import { type ContractResult } from "./contract.js";
|
|
12
|
+
export declare const FINDING_SEVERITIES: readonly ["HIGH", "MEDIUM", "LOW"];
|
|
13
|
+
export type FindingSeverity = (typeof FINDING_SEVERITIES)[number];
|
|
14
|
+
/** How many findings one review may raise. */
|
|
15
|
+
export declare const FINDINGS_MAX = 40;
|
|
16
|
+
/** One finding: how bad, where (a path and the closest line), and how it fails, in one sentence. */
|
|
17
|
+
export declare const buildFindingSchema: z.ZodObject<{
|
|
18
|
+
severity: z.ZodEnum<{
|
|
19
|
+
HIGH: "HIGH";
|
|
20
|
+
LOW: "LOW";
|
|
21
|
+
MEDIUM: "MEDIUM";
|
|
22
|
+
}>;
|
|
23
|
+
file: z.ZodString;
|
|
24
|
+
line: z.ZodNumber;
|
|
25
|
+
scenario: z.ZodString;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type BuildFinding = z.infer<typeof buildFindingSchema>;
|
|
28
|
+
export declare const FINDINGS_VERSION = 1;
|
|
29
|
+
export declare const buildFindingsSchema: z.ZodObject<{
|
|
30
|
+
version: z.ZodLiteral<1>;
|
|
31
|
+
findings: z.ZodArray<z.ZodObject<{
|
|
32
|
+
severity: z.ZodEnum<{
|
|
33
|
+
HIGH: "HIGH";
|
|
34
|
+
LOW: "LOW";
|
|
35
|
+
MEDIUM: "MEDIUM";
|
|
36
|
+
}>;
|
|
37
|
+
file: z.ZodString;
|
|
38
|
+
line: z.ZodNumber;
|
|
39
|
+
scenario: z.ZodString;
|
|
40
|
+
}, z.core.$strip>>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
export type BuildFindings = z.infer<typeof buildFindingsSchema>;
|
|
43
|
+
/** The `findings` a reviewer's structured reply may carry (provider.ts's review channel), from the same schema. */
|
|
44
|
+
export declare const FINDINGS_MODEL_SCHEMA: Readonly<Record<string, unknown>>;
|
|
45
|
+
/** Read a findings payload: version 1 as itself, a newer one refused plainly, anything else by path. */
|
|
46
|
+
export declare function readBuildFindings(input: unknown): ContractResult<BuildFindings>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The automatic build review's findings (build-review.ts): one schema for the reply a reviewer gives, the `findings`
|
|
3
|
+
* a Claude reviewer's `--json-schema` describes (provider.ts, inside the review channel it shares with evidence
|
|
4
|
+
* reviews), and what `build_review.findings_json` keeps. `parseBuildFindings` (reviewer.ts) reads a reply through it;
|
|
5
|
+
* a saved row is the same payload, written by `settle` after that read.
|
|
6
|
+
*
|
|
7
|
+
* As before, controls and runs of whitespace collapse to one space before text limits are checked. Unknown keys
|
|
8
|
+
* are ignored in both the review envelope and each finding.
|
|
9
|
+
*/
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
import { TEXT_LIMITS } from "../text-limits.js";
|
|
12
|
+
import { limited, readVersioned, toModelSchema, versioned } from "./contract.js";
|
|
13
|
+
export const FINDING_SEVERITIES = ["HIGH", "MEDIUM", "LOW"];
|
|
14
|
+
/** How many findings one review may raise. */
|
|
15
|
+
export const FINDINGS_MAX = 40;
|
|
16
|
+
/** One finding: how bad, where (a path and the closest line), and how it fails, in one sentence. */
|
|
17
|
+
export const buildFindingSchema = z.object({
|
|
18
|
+
severity: z.enum(FINDING_SEVERITIES),
|
|
19
|
+
file: limited("file", "reviewPath").min(1).describe(`file: at most ${TEXT_LIMITS.reviewPath} characters, on one line.`),
|
|
20
|
+
line: z.number().min(1).multipleOf(1),
|
|
21
|
+
scenario: limited("scenario", "reviewNote").min(1).describe(`scenario: at most ${TEXT_LIMITS.reviewNote} characters, on one line.`),
|
|
22
|
+
});
|
|
23
|
+
export const FINDINGS_VERSION = 1;
|
|
24
|
+
export const buildFindingsSchema = versioned(FINDINGS_VERSION, {
|
|
25
|
+
findings: z.array(buildFindingSchema).max(FINDINGS_MAX),
|
|
26
|
+
}).strip();
|
|
27
|
+
/** The `findings` a reviewer's structured reply may carry (provider.ts's review channel), from the same schema. */
|
|
28
|
+
export const FINDINGS_MODEL_SCHEMA = toModelSchema(buildFindingsSchema.shape.findings);
|
|
29
|
+
/** Read a findings payload: version 1 as itself, a newer one refused plainly, anything else by path. */
|
|
30
|
+
export function readBuildFindings(input) {
|
|
31
|
+
if (typeof input === "object" && input !== null && !Array.isArray(input)) {
|
|
32
|
+
const body = input;
|
|
33
|
+
if (Array.isArray(body["findings"])) {
|
|
34
|
+
input = { ...body, findings: body["findings"].map(entry => {
|
|
35
|
+
if (typeof entry !== "object" || entry === null || Array.isArray(entry))
|
|
36
|
+
return entry;
|
|
37
|
+
const finding = { ...entry };
|
|
38
|
+
for (const key of ["file", "scenario"]) {
|
|
39
|
+
const text = finding[key];
|
|
40
|
+
if (typeof text === "string")
|
|
41
|
+
finding[key] = text.replace(/[\u0000-\u001f\u007f-\u009f\u061c\u200e\u200f\u2028\u2029\u202a-\u202e\u2066-\u2069]+/g, " ").replace(/\s+/g, " ").trim();
|
|
42
|
+
}
|
|
43
|
+
return finding;
|
|
44
|
+
}) };
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return readVersioned(buildFindingsSchema, input);
|
|
48
|
+
}
|
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A sealed route (phase-routing.ts): which exact agent plans, builds, repairs and reviews a task, as a scope's
|
|
3
|
+
* `proposed_route_json` / `approved_route_json` and a standing order's route keep it. One schema covering both versions
|
|
4
|
+
* a route has been saved in — version 1 (sealed before sizing: no `size`, routine and strong tiers) and version 2 —
|
|
5
|
+
* plus the override list and the task size it carries. The rules JSON Schema cannot state run in plain code after
|
|
6
|
+
* parsing, each with a path-named error: the legs run plan, build, repair, review in that order; the posture is what
|
|
7
|
+
* the legs actually run; one override per phase.
|
|
8
|
+
*
|
|
9
|
+
* Reading never rewrites: a version 1 route stays version 1 (its digest domain and bytes are its own), and reads with
|
|
10
|
+
* no size. phase-routing.ts `canonicalRouteJson` / `routeDigestOf` encode the parsed value, so a sealed route's digest
|
|
11
|
+
* is what it always was.
|
|
12
|
+
*/
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
import { type ContractResult } from "./contract.js";
|
|
15
|
+
/** The phases a route has a leg for, in the order its legs run. */
|
|
16
|
+
export declare const ROUTE_PHASES: readonly ["plan", "build", "repair", "review"];
|
|
17
|
+
/** provider.ts's provider ids, restated (provider.ts sits above phase-routing.ts in the module graph) and pinned to
|
|
18
|
+
* them by the test suite. */
|
|
19
|
+
export declare const ROUTE_PROVIDERS: readonly ["claude", "codex", "openrouter", "gemini"];
|
|
20
|
+
/** provider.ts's MODEL_ID, restated for the same reason: an exact model id is argv-safe — no leading dash, no
|
|
21
|
+
* whitespace or control bytes. */
|
|
22
|
+
export declare const MODEL_ID_SHAPE: RegExp;
|
|
23
|
+
export declare const RISKS: readonly ["routine", "elevated", "high"];
|
|
24
|
+
export declare const TASK_SIZE_WORDS: readonly ["small", "medium", "large"];
|
|
25
|
+
/** The route version this code seals; version 1 (before sizing) still reads. */
|
|
26
|
+
export declare const ROUTE_VERSION = 2;
|
|
27
|
+
/** How big a change the task is, as it was sized (by the classifier, the description, or a person). */
|
|
28
|
+
export declare const taskSizingSchema: z.ZodObject<{
|
|
29
|
+
size: z.ZodEnum<{
|
|
30
|
+
large: "large";
|
|
31
|
+
medium: "medium";
|
|
32
|
+
small: "small";
|
|
33
|
+
}>;
|
|
34
|
+
risky: z.ZodBoolean;
|
|
35
|
+
source: z.ZodEnum<{
|
|
36
|
+
classifier: "classifier";
|
|
37
|
+
heuristic: "heuristic";
|
|
38
|
+
person: "person";
|
|
39
|
+
}>;
|
|
40
|
+
reason: z.ZodString;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
/** An approver's explicit per-phase choice, recorded with attribution. */
|
|
43
|
+
export declare const routeOverrideSchema: z.ZodObject<{
|
|
44
|
+
phase: z.ZodEnum<{
|
|
45
|
+
build: "build";
|
|
46
|
+
plan: "plan";
|
|
47
|
+
repair: "repair";
|
|
48
|
+
review: "review";
|
|
49
|
+
}>;
|
|
50
|
+
provider: z.ZodEnum<{
|
|
51
|
+
claude: "claude";
|
|
52
|
+
codex: "codex";
|
|
53
|
+
gemini: "gemini";
|
|
54
|
+
openrouter: "openrouter";
|
|
55
|
+
}>;
|
|
56
|
+
model: z.ZodString;
|
|
57
|
+
by: z.ZodString;
|
|
58
|
+
at: z.ZodString;
|
|
59
|
+
}, z.core.$strict>;
|
|
60
|
+
/** One leg of a version 2 route: the light tier exists. */
|
|
61
|
+
export declare const routeLegSchema: z.ZodObject<{
|
|
62
|
+
phase: z.ZodEnum<{
|
|
63
|
+
build: "build";
|
|
64
|
+
plan: "plan";
|
|
65
|
+
repair: "repair";
|
|
66
|
+
review: "review";
|
|
67
|
+
}>;
|
|
68
|
+
provider: z.ZodEnum<{
|
|
69
|
+
claude: "claude";
|
|
70
|
+
codex: "codex";
|
|
71
|
+
gemini: "gemini";
|
|
72
|
+
openrouter: "openrouter";
|
|
73
|
+
}>;
|
|
74
|
+
model: z.ZodString;
|
|
75
|
+
tier: z.ZodEnum<{
|
|
76
|
+
light: "light";
|
|
77
|
+
routine: "routine";
|
|
78
|
+
strong: "strong";
|
|
79
|
+
}>;
|
|
80
|
+
chosen: z.ZodEnum<{
|
|
81
|
+
override: "override";
|
|
82
|
+
pinned: "pinned";
|
|
83
|
+
recommended: "recommended";
|
|
84
|
+
}>;
|
|
85
|
+
recommended: z.ZodObject<{
|
|
86
|
+
provider: z.ZodEnum<{
|
|
87
|
+
claude: "claude";
|
|
88
|
+
codex: "codex";
|
|
89
|
+
gemini: "gemini";
|
|
90
|
+
openrouter: "openrouter";
|
|
91
|
+
}>;
|
|
92
|
+
model: z.ZodString;
|
|
93
|
+
tier: z.ZodEnum<{
|
|
94
|
+
light: "light";
|
|
95
|
+
routine: "routine";
|
|
96
|
+
strong: "strong";
|
|
97
|
+
}>;
|
|
98
|
+
}, z.core.$strict>;
|
|
99
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
100
|
+
problem: z.ZodNullable<z.ZodString>;
|
|
101
|
+
}, z.core.$strict>;
|
|
102
|
+
export declare const sealedRouteV1Schema: z.ZodObject<{
|
|
103
|
+
version: z.ZodLiteral<1>;
|
|
104
|
+
risk: z.ZodEnum<{
|
|
105
|
+
elevated: "elevated";
|
|
106
|
+
high: "high";
|
|
107
|
+
routine: "routine";
|
|
108
|
+
}>;
|
|
109
|
+
qualityMode: z.ZodEnum<{
|
|
110
|
+
default: "default";
|
|
111
|
+
strict: "strict";
|
|
112
|
+
}>;
|
|
113
|
+
publication: z.ZodEnum<{
|
|
114
|
+
automerge: "automerge";
|
|
115
|
+
none: "none";
|
|
116
|
+
notify: "notify";
|
|
117
|
+
}>;
|
|
118
|
+
evidence: z.ZodArray<z.ZodEnum<{
|
|
119
|
+
"changed-path": "changed-path";
|
|
120
|
+
check: "check";
|
|
121
|
+
"manual-review": "manual-review";
|
|
122
|
+
screenshot: "screenshot";
|
|
123
|
+
}>>;
|
|
124
|
+
posture: z.ZodEnum<{
|
|
125
|
+
economy: "economy";
|
|
126
|
+
strong: "strong";
|
|
127
|
+
}>;
|
|
128
|
+
demands: z.ZodArray<z.ZodString>;
|
|
129
|
+
legs: z.ZodArray<z.ZodObject<{
|
|
130
|
+
phase: z.ZodEnum<{
|
|
131
|
+
build: "build";
|
|
132
|
+
plan: "plan";
|
|
133
|
+
repair: "repair";
|
|
134
|
+
review: "review";
|
|
135
|
+
}>;
|
|
136
|
+
provider: z.ZodEnum<{
|
|
137
|
+
claude: "claude";
|
|
138
|
+
codex: "codex";
|
|
139
|
+
gemini: "gemini";
|
|
140
|
+
openrouter: "openrouter";
|
|
141
|
+
}>;
|
|
142
|
+
model: z.ZodString;
|
|
143
|
+
tier: z.ZodEnum<{
|
|
144
|
+
routine: "routine";
|
|
145
|
+
strong: "strong";
|
|
146
|
+
}>;
|
|
147
|
+
chosen: z.ZodEnum<{
|
|
148
|
+
override: "override";
|
|
149
|
+
pinned: "pinned";
|
|
150
|
+
recommended: "recommended";
|
|
151
|
+
}>;
|
|
152
|
+
recommended: z.ZodObject<{
|
|
153
|
+
provider: z.ZodEnum<{
|
|
154
|
+
claude: "claude";
|
|
155
|
+
codex: "codex";
|
|
156
|
+
gemini: "gemini";
|
|
157
|
+
openrouter: "openrouter";
|
|
158
|
+
}>;
|
|
159
|
+
model: z.ZodString;
|
|
160
|
+
tier: z.ZodEnum<{
|
|
161
|
+
routine: "routine";
|
|
162
|
+
strong: "strong";
|
|
163
|
+
}>;
|
|
164
|
+
}, z.core.$strict>;
|
|
165
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
166
|
+
problem: z.ZodNullable<z.ZodString>;
|
|
167
|
+
}, z.core.$strict>>;
|
|
168
|
+
overrides: z.ZodArray<z.ZodObject<{
|
|
169
|
+
phase: z.ZodEnum<{
|
|
170
|
+
build: "build";
|
|
171
|
+
plan: "plan";
|
|
172
|
+
repair: "repair";
|
|
173
|
+
review: "review";
|
|
174
|
+
}>;
|
|
175
|
+
provider: z.ZodEnum<{
|
|
176
|
+
claude: "claude";
|
|
177
|
+
codex: "codex";
|
|
178
|
+
gemini: "gemini";
|
|
179
|
+
openrouter: "openrouter";
|
|
180
|
+
}>;
|
|
181
|
+
model: z.ZodString;
|
|
182
|
+
by: z.ZodString;
|
|
183
|
+
at: z.ZodString;
|
|
184
|
+
}, z.core.$strict>>;
|
|
185
|
+
}, z.core.$strict>;
|
|
186
|
+
export declare const sealedRouteV2Schema: z.ZodObject<{
|
|
187
|
+
version: z.ZodLiteral<2>;
|
|
188
|
+
risk: z.ZodEnum<{
|
|
189
|
+
elevated: "elevated";
|
|
190
|
+
high: "high";
|
|
191
|
+
routine: "routine";
|
|
192
|
+
}>;
|
|
193
|
+
qualityMode: z.ZodEnum<{
|
|
194
|
+
default: "default";
|
|
195
|
+
strict: "strict";
|
|
196
|
+
}>;
|
|
197
|
+
publication: z.ZodEnum<{
|
|
198
|
+
automerge: "automerge";
|
|
199
|
+
none: "none";
|
|
200
|
+
notify: "notify";
|
|
201
|
+
}>;
|
|
202
|
+
evidence: z.ZodArray<z.ZodEnum<{
|
|
203
|
+
"changed-path": "changed-path";
|
|
204
|
+
check: "check";
|
|
205
|
+
"manual-review": "manual-review";
|
|
206
|
+
screenshot: "screenshot";
|
|
207
|
+
}>>;
|
|
208
|
+
posture: z.ZodEnum<{
|
|
209
|
+
economy: "economy";
|
|
210
|
+
strong: "strong";
|
|
211
|
+
}>;
|
|
212
|
+
demands: z.ZodArray<z.ZodString>;
|
|
213
|
+
legs: z.ZodArray<z.ZodObject<{
|
|
214
|
+
phase: z.ZodEnum<{
|
|
215
|
+
build: "build";
|
|
216
|
+
plan: "plan";
|
|
217
|
+
repair: "repair";
|
|
218
|
+
review: "review";
|
|
219
|
+
}>;
|
|
220
|
+
provider: z.ZodEnum<{
|
|
221
|
+
claude: "claude";
|
|
222
|
+
codex: "codex";
|
|
223
|
+
gemini: "gemini";
|
|
224
|
+
openrouter: "openrouter";
|
|
225
|
+
}>;
|
|
226
|
+
model: z.ZodString;
|
|
227
|
+
tier: z.ZodEnum<{
|
|
228
|
+
light: "light";
|
|
229
|
+
routine: "routine";
|
|
230
|
+
strong: "strong";
|
|
231
|
+
}>;
|
|
232
|
+
chosen: z.ZodEnum<{
|
|
233
|
+
override: "override";
|
|
234
|
+
pinned: "pinned";
|
|
235
|
+
recommended: "recommended";
|
|
236
|
+
}>;
|
|
237
|
+
recommended: z.ZodObject<{
|
|
238
|
+
provider: z.ZodEnum<{
|
|
239
|
+
claude: "claude";
|
|
240
|
+
codex: "codex";
|
|
241
|
+
gemini: "gemini";
|
|
242
|
+
openrouter: "openrouter";
|
|
243
|
+
}>;
|
|
244
|
+
model: z.ZodString;
|
|
245
|
+
tier: z.ZodEnum<{
|
|
246
|
+
light: "light";
|
|
247
|
+
routine: "routine";
|
|
248
|
+
strong: "strong";
|
|
249
|
+
}>;
|
|
250
|
+
}, z.core.$strict>;
|
|
251
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
252
|
+
problem: z.ZodNullable<z.ZodString>;
|
|
253
|
+
}, z.core.$strict>>;
|
|
254
|
+
overrides: z.ZodArray<z.ZodObject<{
|
|
255
|
+
phase: z.ZodEnum<{
|
|
256
|
+
build: "build";
|
|
257
|
+
plan: "plan";
|
|
258
|
+
repair: "repair";
|
|
259
|
+
review: "review";
|
|
260
|
+
}>;
|
|
261
|
+
provider: z.ZodEnum<{
|
|
262
|
+
claude: "claude";
|
|
263
|
+
codex: "codex";
|
|
264
|
+
gemini: "gemini";
|
|
265
|
+
openrouter: "openrouter";
|
|
266
|
+
}>;
|
|
267
|
+
model: z.ZodString;
|
|
268
|
+
by: z.ZodString;
|
|
269
|
+
at: z.ZodString;
|
|
270
|
+
}, z.core.$strict>>;
|
|
271
|
+
size: z.ZodNullable<z.ZodObject<{
|
|
272
|
+
size: z.ZodEnum<{
|
|
273
|
+
large: "large";
|
|
274
|
+
medium: "medium";
|
|
275
|
+
small: "small";
|
|
276
|
+
}>;
|
|
277
|
+
risky: z.ZodBoolean;
|
|
278
|
+
source: z.ZodEnum<{
|
|
279
|
+
classifier: "classifier";
|
|
280
|
+
heuristic: "heuristic";
|
|
281
|
+
person: "person";
|
|
282
|
+
}>;
|
|
283
|
+
reason: z.ZodString;
|
|
284
|
+
}, z.core.$strict>>;
|
|
285
|
+
}, z.core.$strict>;
|
|
286
|
+
/** A sealed route as saved, in either version. */
|
|
287
|
+
export declare const sealedRouteSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
288
|
+
version: z.ZodLiteral<1>;
|
|
289
|
+
risk: z.ZodEnum<{
|
|
290
|
+
elevated: "elevated";
|
|
291
|
+
high: "high";
|
|
292
|
+
routine: "routine";
|
|
293
|
+
}>;
|
|
294
|
+
qualityMode: z.ZodEnum<{
|
|
295
|
+
default: "default";
|
|
296
|
+
strict: "strict";
|
|
297
|
+
}>;
|
|
298
|
+
publication: z.ZodEnum<{
|
|
299
|
+
automerge: "automerge";
|
|
300
|
+
none: "none";
|
|
301
|
+
notify: "notify";
|
|
302
|
+
}>;
|
|
303
|
+
evidence: z.ZodArray<z.ZodEnum<{
|
|
304
|
+
"changed-path": "changed-path";
|
|
305
|
+
check: "check";
|
|
306
|
+
"manual-review": "manual-review";
|
|
307
|
+
screenshot: "screenshot";
|
|
308
|
+
}>>;
|
|
309
|
+
posture: z.ZodEnum<{
|
|
310
|
+
economy: "economy";
|
|
311
|
+
strong: "strong";
|
|
312
|
+
}>;
|
|
313
|
+
demands: z.ZodArray<z.ZodString>;
|
|
314
|
+
legs: z.ZodArray<z.ZodObject<{
|
|
315
|
+
phase: z.ZodEnum<{
|
|
316
|
+
build: "build";
|
|
317
|
+
plan: "plan";
|
|
318
|
+
repair: "repair";
|
|
319
|
+
review: "review";
|
|
320
|
+
}>;
|
|
321
|
+
provider: z.ZodEnum<{
|
|
322
|
+
claude: "claude";
|
|
323
|
+
codex: "codex";
|
|
324
|
+
gemini: "gemini";
|
|
325
|
+
openrouter: "openrouter";
|
|
326
|
+
}>;
|
|
327
|
+
model: z.ZodString;
|
|
328
|
+
tier: z.ZodEnum<{
|
|
329
|
+
routine: "routine";
|
|
330
|
+
strong: "strong";
|
|
331
|
+
}>;
|
|
332
|
+
chosen: z.ZodEnum<{
|
|
333
|
+
override: "override";
|
|
334
|
+
pinned: "pinned";
|
|
335
|
+
recommended: "recommended";
|
|
336
|
+
}>;
|
|
337
|
+
recommended: z.ZodObject<{
|
|
338
|
+
provider: z.ZodEnum<{
|
|
339
|
+
claude: "claude";
|
|
340
|
+
codex: "codex";
|
|
341
|
+
gemini: "gemini";
|
|
342
|
+
openrouter: "openrouter";
|
|
343
|
+
}>;
|
|
344
|
+
model: z.ZodString;
|
|
345
|
+
tier: z.ZodEnum<{
|
|
346
|
+
routine: "routine";
|
|
347
|
+
strong: "strong";
|
|
348
|
+
}>;
|
|
349
|
+
}, z.core.$strict>;
|
|
350
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
351
|
+
problem: z.ZodNullable<z.ZodString>;
|
|
352
|
+
}, z.core.$strict>>;
|
|
353
|
+
overrides: z.ZodArray<z.ZodObject<{
|
|
354
|
+
phase: z.ZodEnum<{
|
|
355
|
+
build: "build";
|
|
356
|
+
plan: "plan";
|
|
357
|
+
repair: "repair";
|
|
358
|
+
review: "review";
|
|
359
|
+
}>;
|
|
360
|
+
provider: z.ZodEnum<{
|
|
361
|
+
claude: "claude";
|
|
362
|
+
codex: "codex";
|
|
363
|
+
gemini: "gemini";
|
|
364
|
+
openrouter: "openrouter";
|
|
365
|
+
}>;
|
|
366
|
+
model: z.ZodString;
|
|
367
|
+
by: z.ZodString;
|
|
368
|
+
at: z.ZodString;
|
|
369
|
+
}, z.core.$strict>>;
|
|
370
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
371
|
+
version: z.ZodLiteral<2>;
|
|
372
|
+
risk: z.ZodEnum<{
|
|
373
|
+
elevated: "elevated";
|
|
374
|
+
high: "high";
|
|
375
|
+
routine: "routine";
|
|
376
|
+
}>;
|
|
377
|
+
qualityMode: z.ZodEnum<{
|
|
378
|
+
default: "default";
|
|
379
|
+
strict: "strict";
|
|
380
|
+
}>;
|
|
381
|
+
publication: z.ZodEnum<{
|
|
382
|
+
automerge: "automerge";
|
|
383
|
+
none: "none";
|
|
384
|
+
notify: "notify";
|
|
385
|
+
}>;
|
|
386
|
+
evidence: z.ZodArray<z.ZodEnum<{
|
|
387
|
+
"changed-path": "changed-path";
|
|
388
|
+
check: "check";
|
|
389
|
+
"manual-review": "manual-review";
|
|
390
|
+
screenshot: "screenshot";
|
|
391
|
+
}>>;
|
|
392
|
+
posture: z.ZodEnum<{
|
|
393
|
+
economy: "economy";
|
|
394
|
+
strong: "strong";
|
|
395
|
+
}>;
|
|
396
|
+
demands: z.ZodArray<z.ZodString>;
|
|
397
|
+
legs: z.ZodArray<z.ZodObject<{
|
|
398
|
+
phase: z.ZodEnum<{
|
|
399
|
+
build: "build";
|
|
400
|
+
plan: "plan";
|
|
401
|
+
repair: "repair";
|
|
402
|
+
review: "review";
|
|
403
|
+
}>;
|
|
404
|
+
provider: z.ZodEnum<{
|
|
405
|
+
claude: "claude";
|
|
406
|
+
codex: "codex";
|
|
407
|
+
gemini: "gemini";
|
|
408
|
+
openrouter: "openrouter";
|
|
409
|
+
}>;
|
|
410
|
+
model: z.ZodString;
|
|
411
|
+
tier: z.ZodEnum<{
|
|
412
|
+
light: "light";
|
|
413
|
+
routine: "routine";
|
|
414
|
+
strong: "strong";
|
|
415
|
+
}>;
|
|
416
|
+
chosen: z.ZodEnum<{
|
|
417
|
+
override: "override";
|
|
418
|
+
pinned: "pinned";
|
|
419
|
+
recommended: "recommended";
|
|
420
|
+
}>;
|
|
421
|
+
recommended: z.ZodObject<{
|
|
422
|
+
provider: z.ZodEnum<{
|
|
423
|
+
claude: "claude";
|
|
424
|
+
codex: "codex";
|
|
425
|
+
gemini: "gemini";
|
|
426
|
+
openrouter: "openrouter";
|
|
427
|
+
}>;
|
|
428
|
+
model: z.ZodString;
|
|
429
|
+
tier: z.ZodEnum<{
|
|
430
|
+
light: "light";
|
|
431
|
+
routine: "routine";
|
|
432
|
+
strong: "strong";
|
|
433
|
+
}>;
|
|
434
|
+
}, z.core.$strict>;
|
|
435
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
436
|
+
problem: z.ZodNullable<z.ZodString>;
|
|
437
|
+
}, z.core.$strict>>;
|
|
438
|
+
overrides: z.ZodArray<z.ZodObject<{
|
|
439
|
+
phase: z.ZodEnum<{
|
|
440
|
+
build: "build";
|
|
441
|
+
plan: "plan";
|
|
442
|
+
repair: "repair";
|
|
443
|
+
review: "review";
|
|
444
|
+
}>;
|
|
445
|
+
provider: z.ZodEnum<{
|
|
446
|
+
claude: "claude";
|
|
447
|
+
codex: "codex";
|
|
448
|
+
gemini: "gemini";
|
|
449
|
+
openrouter: "openrouter";
|
|
450
|
+
}>;
|
|
451
|
+
model: z.ZodString;
|
|
452
|
+
by: z.ZodString;
|
|
453
|
+
at: z.ZodString;
|
|
454
|
+
}, z.core.$strict>>;
|
|
455
|
+
size: z.ZodNullable<z.ZodObject<{
|
|
456
|
+
size: z.ZodEnum<{
|
|
457
|
+
large: "large";
|
|
458
|
+
medium: "medium";
|
|
459
|
+
small: "small";
|
|
460
|
+
}>;
|
|
461
|
+
risky: z.ZodBoolean;
|
|
462
|
+
source: z.ZodEnum<{
|
|
463
|
+
classifier: "classifier";
|
|
464
|
+
heuristic: "heuristic";
|
|
465
|
+
person: "person";
|
|
466
|
+
}>;
|
|
467
|
+
reason: z.ZodString;
|
|
468
|
+
}, z.core.$strict>>;
|
|
469
|
+
}, z.core.$strict>], "version">;
|
|
470
|
+
export type SealedRoute = z.infer<typeof sealedRouteSchema>;
|
|
471
|
+
export type RouteVersion = SealedRoute["version"];
|
|
472
|
+
export type RouteLeg = z.infer<typeof routeLegSchema>;
|
|
473
|
+
export type RouteOverride = z.infer<typeof routeOverrideSchema>;
|
|
474
|
+
export type TaskSizing = z.infer<typeof taskSizingSchema>;
|
|
475
|
+
/** A route as every reader returns it: a version 1 route reads with no size. */
|
|
476
|
+
export type PhaseRoute = Omit<z.infer<typeof sealedRouteV2Schema>, "version"> & {
|
|
477
|
+
version: RouteVersion;
|
|
478
|
+
};
|
|
479
|
+
/** The posture legs actually run under: strong only when a leg runs a configured strong agent as recommended. */
|
|
480
|
+
export declare function postureOf(legs: readonly Pick<RouteLeg, "chosen" | "tier">[]): "economy" | "strong";
|
|
481
|
+
/** Read a task's recorded override list (a list on its own, as `route_overrides_json` keeps it). */
|
|
482
|
+
export declare function readRouteOverrides(input: unknown): ContractResult<RouteOverride[]>;
|
|
483
|
+
/** Read a sealed route: either version as itself, every leg, override and the size proved, nothing unknown. */
|
|
484
|
+
export declare function readSealedRoute(input: unknown): ContractResult<PhaseRoute>;
|