opencode-model-router 2.8.0 → 2.9.1
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 +372 -0
- package/README.md +22 -2
- package/package.json +5 -1
- package/src/commands/output.ts +23 -1
- package/src/compat/background.ts +2439 -0
- package/src/compat/child-session.ts +6 -0
- package/src/compat/turn-state.ts +215 -0
- package/src/compat/v2-client.ts +136 -17
- package/src/compat/v2-hooks.ts +2656 -114
- package/src/compat/v2-observations.ts +328 -0
- package/src/executor/capacity.ts +362 -0
- package/src/executor/child-guards.ts +40 -0
- package/src/executor/command.ts +265 -0
- package/src/executor/compile/edges.ts +809 -0
- package/src/executor/compile/estimate.ts +158 -0
- package/src/executor/compile/footprint.ts +829 -0
- package/src/executor/compile/index.ts +1080 -0
- package/src/executor/compile/parse.ts +1492 -0
- package/src/executor/compile/residue.ts +706 -0
- package/src/executor/compile/validate.ts +280 -0
- package/src/executor/create.ts +672 -0
- package/src/executor/expand.ts +551 -0
- package/src/executor/git.ts +1214 -0
- package/src/executor/host-preamble.ts +17 -0
- package/src/executor/instructions.ts +35 -0
- package/src/executor/integrate/bisect.ts +73 -0
- package/src/executor/integrate/checks.ts +1086 -0
- package/src/executor/integrate/land.ts +177 -0
- package/src/executor/integrate/phase-suite.ts +407 -0
- package/src/executor/integrate/queue.ts +3083 -0
- package/src/executor/integrate/run-resolver.ts +19 -0
- package/src/executor/launch.ts +652 -0
- package/src/executor/ledger.ts +2208 -0
- package/src/executor/observations.ts +212 -0
- package/src/executor/paths.ts +159 -0
- package/src/executor/platform.ts +39 -0
- package/src/executor/process-identity.ts +19 -0
- package/src/executor/qa-loop.ts +470 -0
- package/src/executor/recovery.ts +403 -0
- package/src/executor/runtime.ts +6233 -0
- package/src/executor/schedule.ts +246 -0
- package/src/executor/slots/env.ts +145 -0
- package/src/executor/slots/pool.ts +1564 -0
- package/src/executor/slots/provision.ts +853 -0
- package/src/executor/tool.ts +534 -0
- package/src/executor/types.ts +2064 -0
- package/src/executor/unattended.ts +488 -0
- package/src/guard/store.ts +3 -1
- package/src/index.ts +1498 -288
- package/src/router/config.ts +776 -25
- package/src/router/git-tools.ts +106 -15
- package/src/router/leases.ts +1469 -0
- package/src/router/logger.ts +44 -32
- package/src/router/protocol.ts +40 -10
- package/src/router/role-agents.ts +224 -17
- package/src/router/roles-config.ts +10 -1
- package/src/router/roles.ts +1 -1
- package/src/router/run-tools.ts +56 -4
- package/src/router/tool-paths.ts +308 -0
- package/src/router/work-roots.ts +86 -0
- package/src/routing/advisor/findings.ts +25 -5
- package/src/routing/classify/index.ts +7 -1
- package/src/routing/classify/rules.ts +11 -0
- package/src/routing/commands/stats.ts +2 -2
- package/src/routing/outcomes/durations.ts +225 -0
- package/src/routing/outcomes/index.ts +59 -2
- package/src/routing/outcomes/persist.ts +409 -0
- package/src/routing/outcomes/stats.ts +170 -11
- package/src/routing/outcomes/timings.ts +836 -0
- package/src/routing/outcomes/types.ts +98 -0
- package/src/routing/roles/approvals.ts +86 -5
- package/src/routing/roles/binding.ts +99 -9
- package/src/routing/roles/orphans.ts +68 -0
- package/src/routing/roles/policy.ts +21 -3
- package/src/routing/roles/work-root.ts +3 -1
- package/src/routing/wire/dispatch.ts +86 -12
- package/src/routing/wire/hint.ts +56 -8
- package/src/v2.ts +94 -49
- package/src/verify/branch.ts +8 -2
- package/src/verify/canonical-path.ts +35 -0
- package/src/verify/deterministic.ts +38 -9
- package/src/verify/dispatch.ts +64 -28
- package/src/verify/exec.ts +52 -9
- package/src/verify/pending.ts +1691 -10
- package/src/verify/perimeter.ts +12 -6
- package/src/verify/plan-task.ts +729 -0
- package/src/verify/reference.ts +216 -3
- package/src/verify/tree.ts +30 -13
- package/src/verify/types.ts +9 -2
- package/src/verify/wiring.ts +290 -31
- package/tiers.json +5 -5
package/src/verify/perimeter.ts
CHANGED
|
@@ -1030,6 +1030,9 @@ export interface PlannedPerimeter extends DispatchPerimeter {
|
|
|
1030
1030
|
readonly unadmittedMore?: number;
|
|
1031
1031
|
}
|
|
1032
1032
|
|
|
1033
|
+
/** A-5.1-12: a plan-task verification id, `plan:<orchestratorSessionID>:<planId>/<taskId>#<n>`; group 1 is the orchestrator. */
|
|
1034
|
+
export const PLAN_TASK_PERIMETER_ID = /^plan:([^:/]+):[^/]+\/.+#[1-9][0-9]*$/;
|
|
1035
|
+
|
|
1033
1036
|
/**
|
|
1034
1037
|
* The perimeter beyond W of the dispatch `dispatchID` (a native `task` dispatch, `task:<orchestrator>:<callID>`) verified at
|
|
1035
1038
|
* `cwd`, or undefined when it has none (I9): not a routed role dispatch, or neither a grant location nor another working-set
|
|
@@ -1042,14 +1045,17 @@ export function planPerimeter(
|
|
|
1042
1045
|
admission: () => PerimeterAdmission,
|
|
1043
1046
|
io: DependencyIO = defaultDependencyIO,
|
|
1044
1047
|
): PlannedPerimeter | undefined {
|
|
1045
|
-
|
|
1048
|
+
// A-5.1-12 (Phase 5.1, additive): a plan-task attempt `plan:<orchestrator>:<planId>/<taskId>#<n>` is planned too, with W its
|
|
1049
|
+
// slot (`cwd`, no grant location), the orchestrator's working set and W's link targets.
|
|
1050
|
+
const planTask = PLAN_TASK_PERIMETER_ID.exec(dispatchID);
|
|
1051
|
+
if (!dispatchID.startsWith("task:") && planTask === null) return undefined;
|
|
1046
1052
|
const rest = dispatchID.slice("task:".length);
|
|
1047
1053
|
const separator = rest.indexOf(":");
|
|
1048
|
-
if (separator <= 0) return undefined;
|
|
1049
|
-
const orchestrator = rest.slice(0, separator);
|
|
1050
|
-
const routed = routedRoleOf(rest.slice(separator + 1));
|
|
1051
|
-
if (routed === undefined || routed.parentSessionID !== orchestrator) return undefined;
|
|
1052
|
-
const location = routed
|
|
1054
|
+
if (planTask === null && separator <= 0) return undefined;
|
|
1055
|
+
const orchestrator = planTask?.[1] ?? rest.slice(0, separator);
|
|
1056
|
+
const routed = planTask === null ? routedRoleOf(rest.slice(separator + 1)) : undefined;
|
|
1057
|
+
if (planTask === null && (routed === undefined || routed.parentSessionID !== orchestrator)) return undefined;
|
|
1058
|
+
const location = routed?.grant?.location;
|
|
1053
1059
|
const w = location?.worktree ?? cwd;
|
|
1054
1060
|
const workingSet = workingSetOf(orchestrator);
|
|
1055
1061
|
const others = workingSet.filter((entry) => !insideOrEqual(w, entry.worktree) && !insideOrEqual(entry.worktree, w));
|