@coool/opencode-adaptive 0.0.0-stage → 1.0.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 +21 -0
- package/README.md +98 -2
- package/dist/adapters/codex-capacity/index.d.ts +5 -0
- package/dist/adapters/codex-capacity/index.d.ts.map +1 -0
- package/dist/adapters/codex-capacity/index.js +5 -0
- package/dist/adapters/codex-capacity/index.js.map +1 -0
- package/dist/adapters/codex-capacity/parse.d.ts +28 -0
- package/dist/adapters/codex-capacity/parse.d.ts.map +1 -0
- package/dist/adapters/codex-capacity/parse.js +130 -0
- package/dist/adapters/codex-capacity/parse.js.map +1 -0
- package/dist/adapters/codex-capacity/reading.d.ts +10 -0
- package/dist/adapters/codex-capacity/reading.d.ts.map +1 -0
- package/dist/adapters/codex-capacity/reading.js +45 -0
- package/dist/adapters/codex-capacity/reading.js.map +1 -0
- package/dist/adapters/codex-capacity/sensor.d.ts +24 -0
- package/dist/adapters/codex-capacity/sensor.d.ts.map +1 -0
- package/dist/adapters/codex-capacity/sensor.js +30 -0
- package/dist/adapters/codex-capacity/sensor.js.map +1 -0
- package/dist/adapters/codex-capacity/types.d.ts +35 -0
- package/dist/adapters/codex-capacity/types.d.ts.map +1 -0
- package/dist/adapters/codex-capacity/types.js +4 -0
- package/dist/adapters/codex-capacity/types.js.map +1 -0
- package/dist/adapters/opencode/escalation-tool.d.ts +52 -0
- package/dist/adapters/opencode/escalation-tool.d.ts.map +1 -0
- package/dist/adapters/opencode/escalation-tool.js +59 -0
- package/dist/adapters/opencode/escalation-tool.js.map +1 -0
- package/dist/adapters/opencode/events.d.ts +24 -0
- package/dist/adapters/opencode/events.d.ts.map +1 -0
- package/dist/adapters/opencode/events.js +68 -0
- package/dist/adapters/opencode/events.js.map +1 -0
- package/dist/adapters/opencode/hooks.d.ts +35 -0
- package/dist/adapters/opencode/hooks.d.ts.map +1 -0
- package/dist/adapters/opencode/hooks.js +12 -0
- package/dist/adapters/opencode/hooks.js.map +1 -0
- package/dist/adapters/opencode/index.d.ts +17 -0
- package/dist/adapters/opencode/index.d.ts.map +1 -0
- package/dist/adapters/opencode/index.js +9 -0
- package/dist/adapters/opencode/index.js.map +1 -0
- package/dist/adapters/opencode/inventory.d.ts +31 -0
- package/dist/adapters/opencode/inventory.d.ts.map +1 -0
- package/dist/adapters/opencode/inventory.js +53 -0
- package/dist/adapters/opencode/inventory.js.map +1 -0
- package/dist/adapters/opencode/report.d.ts +92 -0
- package/dist/adapters/opencode/report.d.ts.map +1 -0
- package/dist/adapters/opencode/report.js +145 -0
- package/dist/adapters/opencode/report.js.map +1 -0
- package/dist/adapters/opencode/session-ops.d.ts +40 -0
- package/dist/adapters/opencode/session-ops.d.ts.map +1 -0
- package/dist/adapters/opencode/session-ops.js +32 -0
- package/dist/adapters/opencode/session-ops.js.map +1 -0
- package/dist/adapters/opencode/storage.d.ts +16 -0
- package/dist/adapters/opencode/storage.d.ts.map +1 -0
- package/dist/adapters/opencode/storage.js +8 -0
- package/dist/adapters/opencode/storage.js.map +1 -0
- package/dist/adapters/opencode/tier-tool.d.ts +38 -0
- package/dist/adapters/opencode/tier-tool.d.ts.map +1 -0
- package/dist/adapters/opencode/tier-tool.js +72 -0
- package/dist/adapters/opencode/tier-tool.js.map +1 -0
- package/dist/adapters/opencode/types.d.ts +102 -0
- package/dist/adapters/opencode/types.d.ts.map +1 -0
- package/dist/adapters/opencode/types.js +2 -0
- package/dist/adapters/opencode/types.js.map +1 -0
- package/dist/core/compatibility/gate.d.ts +10 -0
- package/dist/core/compatibility/gate.d.ts.map +1 -0
- package/dist/core/compatibility/gate.js +55 -0
- package/dist/core/compatibility/gate.js.map +1 -0
- package/dist/core/compatibility/index.d.ts +3 -0
- package/dist/core/compatibility/index.d.ts.map +1 -0
- package/dist/core/compatibility/index.js +3 -0
- package/dist/core/compatibility/index.js.map +1 -0
- package/dist/core/compatibility/types.d.ts +54 -0
- package/dist/core/compatibility/types.d.ts.map +1 -0
- package/dist/core/compatibility/types.js +27 -0
- package/dist/core/compatibility/types.js.map +1 -0
- package/dist/core/scheduler/admit.d.ts +7 -0
- package/dist/core/scheduler/admit.d.ts.map +1 -0
- package/dist/core/scheduler/admit.js +153 -0
- package/dist/core/scheduler/admit.js.map +1 -0
- package/dist/core/scheduler/escalate.d.ts +7 -0
- package/dist/core/scheduler/escalate.d.ts.map +1 -0
- package/dist/core/scheduler/escalate.js +56 -0
- package/dist/core/scheduler/escalate.js.map +1 -0
- package/dist/core/scheduler/index.d.ts +5 -0
- package/dist/core/scheduler/index.d.ts.map +1 -0
- package/dist/core/scheduler/index.js +5 -0
- package/dist/core/scheduler/index.js.map +1 -0
- package/dist/core/scheduler/mode.d.ts +9 -0
- package/dist/core/scheduler/mode.d.ts.map +1 -0
- package/dist/core/scheduler/mode.js +10 -0
- package/dist/core/scheduler/mode.js.map +1 -0
- package/dist/core/scheduler/types.d.ts +143 -0
- package/dist/core/scheduler/types.d.ts.map +1 -0
- package/dist/core/scheduler/types.js +74 -0
- package/dist/core/scheduler/types.js.map +1 -0
- package/dist/core/tier-policy/index.d.ts +4 -0
- package/dist/core/tier-policy/index.d.ts.map +1 -0
- package/dist/core/tier-policy/index.js +4 -0
- package/dist/core/tier-policy/index.js.map +1 -0
- package/dist/core/tier-policy/resolve.d.ts +19 -0
- package/dist/core/tier-policy/resolve.d.ts.map +1 -0
- package/dist/core/tier-policy/resolve.js +52 -0
- package/dist/core/tier-policy/resolve.js.map +1 -0
- package/dist/core/tier-policy/tier-list.d.ts +11 -0
- package/dist/core/tier-policy/tier-list.d.ts.map +1 -0
- package/dist/core/tier-policy/tier-list.js +23 -0
- package/dist/core/tier-policy/tier-list.js.map +1 -0
- package/dist/core/tier-policy/types.d.ts +85 -0
- package/dist/core/tier-policy/types.d.ts.map +1 -0
- package/dist/core/tier-policy/types.js +45 -0
- package/dist/core/tier-policy/types.js.map +1 -0
- package/dist/core/work-unit/index.d.ts +4 -0
- package/dist/core/work-unit/index.d.ts.map +1 -0
- package/dist/core/work-unit/index.js +4 -0
- package/dist/core/work-unit/index.js.map +1 -0
- package/dist/core/work-unit/interruption.d.ts +8 -0
- package/dist/core/work-unit/interruption.d.ts.map +1 -0
- package/dist/core/work-unit/interruption.js +12 -0
- package/dist/core/work-unit/interruption.js.map +1 -0
- package/dist/core/work-unit/tracker.d.ts +46 -0
- package/dist/core/work-unit/tracker.d.ts.map +1 -0
- package/dist/core/work-unit/tracker.js +136 -0
- package/dist/core/work-unit/tracker.js.map +1 -0
- package/dist/core/work-unit/types.d.ts +146 -0
- package/dist/core/work-unit/types.d.ts.map +1 -0
- package/dist/core/work-unit/types.js +23 -0
- package/dist/core/work-unit/types.js.map +1 -0
- package/dist/execution/continuation/execute.d.ts +19 -0
- package/dist/execution/continuation/execute.d.ts.map +1 -0
- package/dist/execution/continuation/execute.js +31 -0
- package/dist/execution/continuation/execute.js.map +1 -0
- package/dist/execution/continuation/index.d.ts +6 -0
- package/dist/execution/continuation/index.d.ts.map +1 -0
- package/dist/execution/continuation/index.js +5 -0
- package/dist/execution/continuation/index.js.map +1 -0
- package/dist/execution/continuation/ledger.d.ts +20 -0
- package/dist/execution/continuation/ledger.d.ts.map +1 -0
- package/dist/execution/continuation/ledger.js +31 -0
- package/dist/execution/continuation/ledger.js.map +1 -0
- package/dist/execution/continuation/plan.d.ts +13 -0
- package/dist/execution/continuation/plan.d.ts.map +1 -0
- package/dist/execution/continuation/plan.js +20 -0
- package/dist/execution/continuation/plan.js.map +1 -0
- package/dist/execution/continuation/prompts.d.ts +8 -0
- package/dist/execution/continuation/prompts.d.ts.map +1 -0
- package/dist/execution/continuation/prompts.js +8 -0
- package/dist/execution/continuation/prompts.js.map +1 -0
- package/dist/execution/continuation/types.d.ts +70 -0
- package/dist/execution/continuation/types.d.ts.map +1 -0
- package/dist/execution/continuation/types.js +15 -0
- package/dist/execution/continuation/types.js.map +1 -0
- package/dist/execution/escalation/index.d.ts +2 -0
- package/dist/execution/escalation/index.d.ts.map +1 -0
- package/dist/execution/escalation/index.js +2 -0
- package/dist/execution/escalation/index.js.map +1 -0
- package/dist/execution/escalation/types.d.ts +31 -0
- package/dist/execution/escalation/types.d.ts.map +1 -0
- package/dist/execution/escalation/types.js +49 -0
- package/dist/execution/escalation/types.js.map +1 -0
- package/dist/execution/index.d.ts +5 -0
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +5 -0
- package/dist/execution/index.js.map +1 -0
- package/dist/execution/parking/index.d.ts +3 -0
- package/dist/execution/parking/index.d.ts.map +1 -0
- package/dist/execution/parking/index.js +2 -0
- package/dist/execution/parking/index.js.map +1 -0
- package/dist/execution/parking/plan.d.ts +40 -0
- package/dist/execution/parking/plan.d.ts.map +1 -0
- package/dist/execution/parking/plan.js +34 -0
- package/dist/execution/parking/plan.js.map +1 -0
- package/dist/execution/recovery/gate.d.ts +20 -0
- package/dist/execution/recovery/gate.d.ts.map +1 -0
- package/dist/execution/recovery/gate.js +23 -0
- package/dist/execution/recovery/gate.js.map +1 -0
- package/dist/execution/recovery/index.d.ts +3 -0
- package/dist/execution/recovery/index.d.ts.map +1 -0
- package/dist/execution/recovery/index.js +2 -0
- package/dist/execution/recovery/index.js.map +1 -0
- package/dist/execution/retry/decide.d.ts +30 -0
- package/dist/execution/retry/decide.d.ts.map +1 -0
- package/dist/execution/retry/decide.js +76 -0
- package/dist/execution/retry/decide.js.map +1 -0
- package/dist/execution/retry/index.d.ts +3 -0
- package/dist/execution/retry/index.d.ts.map +1 -0
- package/dist/execution/retry/index.js +3 -0
- package/dist/execution/retry/index.js.map +1 -0
- package/dist/execution/retry/types.d.ts +66 -0
- package/dist/execution/retry/types.d.ts.map +1 -0
- package/dist/execution/retry/types.js +9 -0
- package/dist/execution/retry/types.js.map +1 -0
- package/dist/gui-experimental.cjs +1 -0
- package/dist/gui.d.ts +17 -0
- package/dist/gui.d.ts.map +1 -0
- package/dist/gui.js +70 -0
- package/dist/gui.js.map +1 -0
- package/dist/health/capacity/index.d.ts +4 -0
- package/dist/health/capacity/index.d.ts.map +1 -0
- package/dist/health/capacity/index.js +4 -0
- package/dist/health/capacity/index.js.map +1 -0
- package/dist/health/capacity/merge.d.ts +58 -0
- package/dist/health/capacity/merge.d.ts.map +1 -0
- package/dist/health/capacity/merge.js +154 -0
- package/dist/health/capacity/merge.js.map +1 -0
- package/dist/health/capacity/registry.d.ts +41 -0
- package/dist/health/capacity/registry.d.ts.map +1 -0
- package/dist/health/capacity/registry.js +106 -0
- package/dist/health/capacity/registry.js.map +1 -0
- package/dist/health/capacity/types.d.ts +74 -0
- package/dist/health/capacity/types.d.ts.map +1 -0
- package/dist/health/capacity/types.js +6 -0
- package/dist/health/capacity/types.js.map +1 -0
- package/dist/health/circuit-breaker/breaker.d.ts +84 -0
- package/dist/health/circuit-breaker/breaker.d.ts.map +1 -0
- package/dist/health/circuit-breaker/breaker.js +132 -0
- package/dist/health/circuit-breaker/breaker.js.map +1 -0
- package/dist/health/circuit-breaker/index.d.ts +3 -0
- package/dist/health/circuit-breaker/index.d.ts.map +1 -0
- package/dist/health/circuit-breaker/index.js +3 -0
- package/dist/health/circuit-breaker/index.js.map +1 -0
- package/dist/health/circuit-breaker/types.d.ts +53 -0
- package/dist/health/circuit-breaker/types.d.ts.map +1 -0
- package/dist/health/circuit-breaker/types.js +13 -0
- package/dist/health/circuit-breaker/types.js.map +1 -0
- package/dist/health/classifier/classify.d.ts +9 -0
- package/dist/health/classifier/classify.d.ts.map +1 -0
- package/dist/health/classifier/classify.js +245 -0
- package/dist/health/classifier/classify.js.map +1 -0
- package/dist/health/classifier/index.d.ts +3 -0
- package/dist/health/classifier/index.d.ts.map +1 -0
- package/dist/health/classifier/index.js +3 -0
- package/dist/health/classifier/index.js.map +1 -0
- package/dist/health/classifier/types.d.ts +72 -0
- package/dist/health/classifier/types.d.ts.map +1 -0
- package/dist/health/classifier/types.js +27 -0
- package/dist/health/classifier/types.js.map +1 -0
- package/dist/health/index.d.ts +5 -0
- package/dist/health/index.d.ts.map +1 -0
- package/dist/health/index.js +5 -0
- package/dist/health/index.js.map +1 -0
- package/dist/health/resource-health/index.d.ts +5 -0
- package/dist/health/resource-health/index.d.ts.map +1 -0
- package/dist/health/resource-health/index.js +5 -0
- package/dist/health/resource-health/index.js.map +1 -0
- package/dist/health/resource-health/key.d.ts +19 -0
- package/dist/health/resource-health/key.d.ts.map +1 -0
- package/dist/health/resource-health/key.js +54 -0
- package/dist/health/resource-health/key.js.map +1 -0
- package/dist/health/resource-health/registry.d.ts +41 -0
- package/dist/health/resource-health/registry.d.ts.map +1 -0
- package/dist/health/resource-health/registry.js +258 -0
- package/dist/health/resource-health/registry.js.map +1 -0
- package/dist/health/resource-health/transitions.d.ts +11 -0
- package/dist/health/resource-health/transitions.d.ts.map +1 -0
- package/dist/health/resource-health/transitions.js +165 -0
- package/dist/health/resource-health/transitions.js.map +1 -0
- package/dist/health/resource-health/types.d.ts +116 -0
- package/dist/health/resource-health/types.d.ts.map +1 -0
- package/dist/health/resource-health/types.js +43 -0
- package/dist/health/resource-health/types.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +80 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin-id.d.ts +3 -0
- package/dist/plugin-id.d.ts.map +1 -0
- package/dist/plugin-id.js +3 -0
- package/dist/plugin-id.js.map +1 -0
- package/dist/rpc/definition.d.ts +100 -0
- package/dist/rpc/definition.d.ts.map +1 -0
- package/dist/rpc/definition.js +104 -0
- package/dist/rpc/definition.js.map +1 -0
- package/dist/rpc/handlers.d.ts +65 -0
- package/dist/rpc/handlers.d.ts.map +1 -0
- package/dist/rpc/handlers.js +111 -0
- package/dist/rpc/handlers.js.map +1 -0
- package/dist/rpc/status.d.ts +43 -0
- package/dist/rpc/status.d.ts.map +1 -0
- package/dist/rpc/status.js +45 -0
- package/dist/rpc/status.js.map +1 -0
- package/dist/rpc.d.ts +11 -0
- package/dist/rpc.d.ts.map +1 -0
- package/dist/rpc.js +8 -0
- package/dist/rpc.js.map +1 -0
- package/dist/state/capacity/index.d.ts +4 -0
- package/dist/state/capacity/index.d.ts.map +1 -0
- package/dist/state/capacity/index.js +4 -0
- package/dist/state/capacity/index.js.map +1 -0
- package/dist/state/capacity/parse.d.ts +3 -0
- package/dist/state/capacity/parse.d.ts.map +1 -0
- package/dist/state/capacity/parse.js +110 -0
- package/dist/state/capacity/parse.js.map +1 -0
- package/dist/state/capacity/store.d.ts +19 -0
- package/dist/state/capacity/store.d.ts.map +1 -0
- package/dist/state/capacity/store.js +64 -0
- package/dist/state/capacity/store.js.map +1 -0
- package/dist/state/capacity/types.d.ts +38 -0
- package/dist/state/capacity/types.d.ts.map +1 -0
- package/dist/state/capacity/types.js +11 -0
- package/dist/state/capacity/types.js.map +1 -0
- package/dist/state/health/index.d.ts +5 -0
- package/dist/state/health/index.d.ts.map +1 -0
- package/dist/state/health/index.js +4 -0
- package/dist/state/health/index.js.map +1 -0
- package/dist/state/health/parse.d.ts +3 -0
- package/dist/state/health/parse.d.ts.map +1 -0
- package/dist/state/health/parse.js +121 -0
- package/dist/state/health/parse.js.map +1 -0
- package/dist/state/health/store.d.ts +18 -0
- package/dist/state/health/store.d.ts.map +1 -0
- package/dist/state/health/store.js +55 -0
- package/dist/state/health/store.js.map +1 -0
- package/dist/state/health/types.d.ts +24 -0
- package/dist/state/health/types.d.ts.map +1 -0
- package/dist/state/health/types.js +5 -0
- package/dist/state/health/types.js.map +1 -0
- package/dist/state/parked-work/index.d.ts +5 -0
- package/dist/state/parked-work/index.d.ts.map +1 -0
- package/dist/state/parked-work/index.js +4 -0
- package/dist/state/parked-work/index.js.map +1 -0
- package/dist/state/parked-work/parse.d.ts +7 -0
- package/dist/state/parked-work/parse.d.ts.map +1 -0
- package/dist/state/parked-work/parse.js +83 -0
- package/dist/state/parked-work/parse.js.map +1 -0
- package/dist/state/parked-work/store.d.ts +18 -0
- package/dist/state/parked-work/store.d.ts.map +1 -0
- package/dist/state/parked-work/store.js +81 -0
- package/dist/state/parked-work/store.js.map +1 -0
- package/dist/state/parked-work/types.d.ts +42 -0
- package/dist/state/parked-work/types.d.ts.map +1 -0
- package/dist/state/parked-work/types.js +7 -0
- package/dist/state/parked-work/types.js.map +1 -0
- package/dist/state/receipts/bound.d.ts +15 -0
- package/dist/state/receipts/bound.d.ts.map +1 -0
- package/dist/state/receipts/bound.js +77 -0
- package/dist/state/receipts/bound.js.map +1 -0
- package/dist/state/receipts/index.d.ts +7 -0
- package/dist/state/receipts/index.d.ts.map +1 -0
- package/dist/state/receipts/index.js +5 -0
- package/dist/state/receipts/index.js.map +1 -0
- package/dist/state/receipts/parse.d.ts +7 -0
- package/dist/state/receipts/parse.d.ts.map +1 -0
- package/dist/state/receipts/parse.js +226 -0
- package/dist/state/receipts/parse.js.map +1 -0
- package/dist/state/receipts/store.d.ts +35 -0
- package/dist/state/receipts/store.d.ts.map +1 -0
- package/dist/state/receipts/store.js +128 -0
- package/dist/state/receipts/store.js.map +1 -0
- package/dist/state/receipts/types.d.ts +62 -0
- package/dist/state/receipts/types.d.ts.map +1 -0
- package/dist/state/receipts/types.js +12 -0
- package/dist/state/receipts/types.js.map +1 -0
- package/dist/state/session-modes/index.d.ts +5 -0
- package/dist/state/session-modes/index.d.ts.map +1 -0
- package/dist/state/session-modes/index.js +4 -0
- package/dist/state/session-modes/index.js.map +1 -0
- package/dist/state/session-modes/parse.d.ts +9 -0
- package/dist/state/session-modes/parse.d.ts.map +1 -0
- package/dist/state/session-modes/parse.js +62 -0
- package/dist/state/session-modes/parse.js.map +1 -0
- package/dist/state/session-modes/store.d.ts +21 -0
- package/dist/state/session-modes/store.d.ts.map +1 -0
- package/dist/state/session-modes/store.js +73 -0
- package/dist/state/session-modes/store.js.map +1 -0
- package/dist/state/session-modes/types.d.ts +42 -0
- package/dist/state/session-modes/types.d.ts.map +1 -0
- package/dist/state/session-modes/types.js +7 -0
- package/dist/state/session-modes/types.js.map +1 -0
- package/dist/state/settings/index.d.ts +5 -0
- package/dist/state/settings/index.d.ts.map +1 -0
- package/dist/state/settings/index.js +4 -0
- package/dist/state/settings/index.js.map +1 -0
- package/dist/state/settings/parse.d.ts +34 -0
- package/dist/state/settings/parse.d.ts.map +1 -0
- package/dist/state/settings/parse.js +261 -0
- package/dist/state/settings/parse.js.map +1 -0
- package/dist/state/settings/store.d.ts +22 -0
- package/dist/state/settings/store.d.ts.map +1 -0
- package/dist/state/settings/store.js +57 -0
- package/dist/state/settings/store.js.map +1 -0
- package/dist/state/settings/types.d.ts +63 -0
- package/dist/state/settings/types.d.ts.map +1 -0
- package/dist/state/settings/types.js +12 -0
- package/dist/state/settings/types.js.map +1 -0
- package/dist/supervisor/index.d.ts +5 -0
- package/dist/supervisor/index.d.ts.map +1 -0
- package/dist/supervisor/index.js +4 -0
- package/dist/supervisor/index.js.map +1 -0
- package/dist/supervisor/log.d.ts +11 -0
- package/dist/supervisor/log.d.ts.map +1 -0
- package/dist/supervisor/log.js +14 -0
- package/dist/supervisor/log.js.map +1 -0
- package/dist/supervisor/supervisor.d.ts +69 -0
- package/dist/supervisor/supervisor.d.ts.map +1 -0
- package/dist/supervisor/supervisor.js +1343 -0
- package/dist/supervisor/supervisor.js.map +1 -0
- package/dist/supervisor/types.d.ts +50 -0
- package/dist/supervisor/types.d.ts.map +1 -0
- package/dist/supervisor/types.js +3 -0
- package/dist/supervisor/types.js.map +1 -0
- package/dist/supervisor/view.d.ts +4 -0
- package/dist/supervisor/view.d.ts.map +1 -0
- package/dist/supervisor/view.js +4 -0
- package/dist/supervisor/view.js.map +1 -0
- package/dist/tui.d.ts +16 -0
- package/dist/tui.d.ts.map +1 -0
- package/dist/tui.js +252 -0
- package/dist/tui.js.map +1 -0
- package/dist/ui/gui/api.d.ts +18 -0
- package/dist/ui/gui/api.d.ts.map +1 -0
- package/dist/ui/gui/api.js +21 -0
- package/dist/ui/gui/api.js.map +1 -0
- package/dist/ui/gui/view.d.ts +27 -0
- package/dist/ui/gui/view.d.ts.map +1 -0
- package/dist/ui/gui/view.js +49 -0
- package/dist/ui/gui/view.js.map +1 -0
- package/dist/ui/tui/controller.d.ts +98 -0
- package/dist/ui/tui/controller.d.ts.map +1 -0
- package/dist/ui/tui/controller.js +399 -0
- package/dist/ui/tui/controller.js.map +1 -0
- package/dist/ui/tui/menu.d.ts +56 -0
- package/dist/ui/tui/menu.d.ts.map +1 -0
- package/dist/ui/tui/menu.js +176 -0
- package/dist/ui/tui/menu.js.map +1 -0
- package/dist/ui/tui/options.d.ts +20 -0
- package/dist/ui/tui/options.d.ts.map +1 -0
- package/dist/ui/tui/options.js +17 -0
- package/dist/ui/tui/options.js.map +1 -0
- package/dist/ui/tui/receipts.d.ts +22 -0
- package/dist/ui/tui/receipts.d.ts.map +1 -0
- package/dist/ui/tui/receipts.js +109 -0
- package/dist/ui/tui/receipts.js.map +1 -0
- package/dist/ui/tui/status.d.ts +23 -0
- package/dist/ui/tui/status.d.ts.map +1 -0
- package/dist/ui/tui/status.js +90 -0
- package/dist/ui/tui/status.js.map +1 -0
- package/dist/ui/tui/tiers.d.ts +52 -0
- package/dist/ui/tui/tiers.d.ts.map +1 -0
- package/dist/ui/tui/tiers.js +108 -0
- package/dist/ui/tui/tiers.js.map +1 -0
- package/package.json +85 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DeferDecision, EscalateDecision, EscalationInput } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Plan the next escalation step, or defer with the reason escalation cannot
|
|
4
|
+
* proceed. Total and deterministic.
|
|
5
|
+
*/
|
|
6
|
+
export declare function planEscalation(input: EscalationInput): EscalateDecision | DeferDecision;
|
|
7
|
+
//# sourceMappingURL=escalate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escalate.d.ts","sourceRoot":"","sources":["../../../src/core/scheduler/escalate.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAmBlF;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,GAAG,gBAAgB,GAAG,aAAa,CA4BvF"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capability escalation planner (ADP-015).
|
|
3
|
+
*
|
|
4
|
+
* Escalation is justified only by non-empty structured evidence, follows the
|
|
5
|
+
* ladder same model / current effort → same model / stronger effort → next
|
|
6
|
+
* tier, and is bounded by a finite per-unit budget. Every output either moves
|
|
7
|
+
* strictly up the ladder or refuses — the planner can never produce a loop,
|
|
8
|
+
* because each accepted step strictly increases a well-founded measure
|
|
9
|
+
* (variant index within the ladder, then tier index).
|
|
10
|
+
*/
|
|
11
|
+
import { nextTier } from "../tier-policy/types.js";
|
|
12
|
+
import { MAX_ESCALATION_EVIDENCE } from "./types.js";
|
|
13
|
+
function escalate(input, target, step, tier) {
|
|
14
|
+
return {
|
|
15
|
+
kind: "escalate",
|
|
16
|
+
target,
|
|
17
|
+
step,
|
|
18
|
+
tier,
|
|
19
|
+
evidence: input.evidence.slice(-MAX_ESCALATION_EVIDENCE),
|
|
20
|
+
budgetRemaining: input.budget.max - input.budget.used - 1,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Plan the next escalation step, or defer with the reason escalation cannot
|
|
25
|
+
* proceed. Total and deterministic.
|
|
26
|
+
*/
|
|
27
|
+
export function planEscalation(input) {
|
|
28
|
+
if (input.evidence.length === 0) {
|
|
29
|
+
return { kind: "defer", reason: "escalation-not-justified" };
|
|
30
|
+
}
|
|
31
|
+
if (input.budget.max <= 0 || input.budget.used >= input.budget.max) {
|
|
32
|
+
return { kind: "defer", reason: "escalation-budget-exhausted" };
|
|
33
|
+
}
|
|
34
|
+
const { currentModel, variantLadder } = input;
|
|
35
|
+
if (currentModel.variant !== undefined && variantLadder !== undefined) {
|
|
36
|
+
const index = variantLadder.indexOf(currentModel.variant);
|
|
37
|
+
if (index >= 0) {
|
|
38
|
+
// For a well-formed (non-holey) ladder, undefined here means the current
|
|
39
|
+
// variant is the strongest — the ladder is exhausted.
|
|
40
|
+
const stronger = variantLadder[index + 1];
|
|
41
|
+
if (stronger !== undefined) {
|
|
42
|
+
return escalate(input, { ...currentModel, variant: stronger }, "variant", input.currentTier);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const next = nextTier(input.currentTier);
|
|
47
|
+
if (next === undefined) {
|
|
48
|
+
return { kind: "defer", reason: "escalation-ceiling" };
|
|
49
|
+
}
|
|
50
|
+
const target = input.nextTierResources[0];
|
|
51
|
+
if (target === undefined) {
|
|
52
|
+
return { kind: "defer", reason: "escalation-no-candidate" };
|
|
53
|
+
}
|
|
54
|
+
return escalate(input, target, "tier", next);
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=escalate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escalate.js","sourceRoot":"","sources":["../../../src/core/scheduler/escalate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAGlD,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAEpD,SAAS,QAAQ,CACf,KAAsB,EACtB,MAAgB,EAChB,IAA8B,EAC9B,IAA8B;IAE9B,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,MAAM;QACN,IAAI;QACJ,IAAI;QACJ,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,uBAAuB,CAAC;QACxD,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC;KAC1D,CAAA;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,KAAsB;IACnD,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC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E,yBAAyB,EAAE,CAAA;IAC7D,CAAC;IACD,OAAO,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;AAC9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/scheduler/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/scheduler/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Operating-mode wrapper (GOAL operating modes). OBSERVE and CONTROL run the
|
|
3
|
+
* identical core; OBSERVE wraps the result without applying it. OFF never
|
|
4
|
+
* reaches the scheduler, but the total wrapper maps it to an explicit defer
|
|
5
|
+
* so the union stays closed.
|
|
6
|
+
*/
|
|
7
|
+
import type { Decision, OperatingMode } from "./types.js";
|
|
8
|
+
export declare function forMode(decision: Decision, mode: OperatingMode): Decision;
|
|
9
|
+
//# sourceMappingURL=mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mode.d.ts","sourceRoot":"","sources":["../../../src/core/scheduler/mode.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAEzD,wBAAgB,OAAO,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,GAAG,QAAQ,CAQzE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function forMode(decision, mode) {
|
|
2
|
+
if (mode === "observe") {
|
|
3
|
+
return { kind: "observe-only", would: decision };
|
|
4
|
+
}
|
|
5
|
+
if (mode === "active") {
|
|
6
|
+
return decision;
|
|
7
|
+
}
|
|
8
|
+
return { kind: "defer", reason: "adaptive-off" };
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=mode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mode.js","sourceRoot":"","sources":["../../../src/core/scheduler/mode.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,OAAO,CAAC,QAAkB,EAAE,IAAmB;IAC7D,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAA;IAClD,CAAC;IACD,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtB,OAAO,QAAQ,CAAA;IACjB,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA;AAClD,CAAC"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scheduler types (ADP-013/015/016/022): the pure decision core's vocabulary.
|
|
3
|
+
*
|
|
4
|
+
* The core is a total function over its inputs — routing outcome, demand,
|
|
5
|
+
* inventory, per-candidate health and capacity views — and never performs
|
|
6
|
+
* effects. Effects (switching, receipts, parking) belong to the execution
|
|
7
|
+
* layer. OBSERVE and CONTROL call the same core; mode handling is a pure
|
|
8
|
+
* wrapper (`forMode`).
|
|
9
|
+
*/
|
|
10
|
+
import type { ModelRef } from "../work-unit/types.js";
|
|
11
|
+
import type { RoutingDecision, TierName } from "../tier-policy/types.js";
|
|
12
|
+
import type { CandidateModel, Demand } from "../compatibility/types.js";
|
|
13
|
+
import type { Assessment } from "../../health/resource-health/types.js";
|
|
14
|
+
import type { CapacitySignals } from "../../health/capacity/types.js";
|
|
15
|
+
/** Operating modes (GOAL manual control). The plugin defaults to `observe`. */
|
|
16
|
+
export declare const OPERATING_MODES: readonly ["off", "observe", "active"];
|
|
17
|
+
export type OperatingMode = (typeof OPERATING_MODES)[number];
|
|
18
|
+
/** Why an `apply` decision chose its model (receipt provenance). */
|
|
19
|
+
export declare const APPLY_REASONS: readonly ["pin", "preferred", "fallback", "probe", "draining"];
|
|
20
|
+
export type ApplyReason = (typeof APPLY_REASONS)[number];
|
|
21
|
+
/**
|
|
22
|
+
* Why the core did not apply anything.
|
|
23
|
+
* - `routing-defer` — the tier ladder deferred; OpenCode's choice stands.
|
|
24
|
+
* - `pin-unverifiable` — the pinned model is not in the host inventory, so
|
|
25
|
+
* availability cannot be verified (inventory gate); deferring keeps the
|
|
26
|
+
* user's own model choice, which for a pin is typically the pinned model.
|
|
27
|
+
* - `pin-incompatible` — the pinned model cannot execute the work.
|
|
28
|
+
* - `escalation-*` — escalation evidence was absent, the budget was spent,
|
|
29
|
+
* the tier ladder is at its ceiling, or the next tier has no resources
|
|
30
|
+
* (no cross-tier borrowing).
|
|
31
|
+
* - `adaptive-off` — the plugin is off; only reachable through `forMode`.
|
|
32
|
+
*/
|
|
33
|
+
export declare const SCHEDULER_DEFER_REASONS: readonly ["routing-defer", "pin-unverifiable", "pin-incompatible", "escalation-not-justified", "escalation-budget-exhausted", "escalation-ceiling", "escalation-no-candidate", "adaptive-off"];
|
|
34
|
+
export type SchedulerDeferReason = (typeof SCHEDULER_DEFER_REASONS)[number];
|
|
35
|
+
/**
|
|
36
|
+
* Why work parks instead of applying: the required tier has no usable
|
|
37
|
+
* resource right now. Parking waits for recovery — it never borrows across
|
|
38
|
+
* tiers (ADP-022).
|
|
39
|
+
*/
|
|
40
|
+
export declare const PARK_REASONS: readonly ["pin-blocked", "no-candidates", "no-compatible-resource", "all-blocked"];
|
|
41
|
+
export type ParkReason = (typeof PARK_REASONS)[number];
|
|
42
|
+
/** Why a tier candidate was not usable. Superset of gate and health reasons. */
|
|
43
|
+
export declare const SKIP_REASONS: readonly ["not-in-inventory", "capacity-exhausted", "incompatible", "provider-unavailable", "model-unavailable", "variant-unavailable", "tool-use-unsupported", "input-modality-unsupported", "output-modality-unsupported", "context-capacity-insufficient", "context-capacity-unknown", "unavailable", "quota-exhausted", "rate-limited", "breaker-open", "probe-in-flight", "draining"];
|
|
44
|
+
export type SkipReason = (typeof SKIP_REASONS)[number];
|
|
45
|
+
/** A tier candidate that could not take the work, with the bounded reason. */
|
|
46
|
+
export interface SkippedCandidate {
|
|
47
|
+
readonly ref: ModelRef;
|
|
48
|
+
readonly why: SkipReason;
|
|
49
|
+
}
|
|
50
|
+
/** Bounded evidence attached to an `apply` decision. */
|
|
51
|
+
export interface ApplyEvidence {
|
|
52
|
+
/** Candidates considered before the applied one, in order (bounded). */
|
|
53
|
+
readonly skipped: readonly SkippedCandidate[];
|
|
54
|
+
/** Breaker probe id when the applied unit is the half-open probe. */
|
|
55
|
+
readonly probeId?: string | undefined;
|
|
56
|
+
}
|
|
57
|
+
export interface ApplyDecision {
|
|
58
|
+
readonly kind: "apply";
|
|
59
|
+
readonly model: ModelRef;
|
|
60
|
+
/** Required tier; `undefined` for pin routing (a pin is not a tier). */
|
|
61
|
+
readonly tier?: TierName | undefined;
|
|
62
|
+
readonly reason: ApplyReason;
|
|
63
|
+
readonly evidence: ApplyEvidence;
|
|
64
|
+
}
|
|
65
|
+
export interface DeferDecision {
|
|
66
|
+
readonly kind: "defer";
|
|
67
|
+
readonly reason: SchedulerDeferReason;
|
|
68
|
+
readonly detail?: string | undefined;
|
|
69
|
+
}
|
|
70
|
+
export interface ParkDecision {
|
|
71
|
+
readonly kind: "park";
|
|
72
|
+
readonly reason: ParkReason;
|
|
73
|
+
readonly detail?: string | undefined;
|
|
74
|
+
}
|
|
75
|
+
/** Structured capability evidence for escalation (ADP-015). Never prose mining. */
|
|
76
|
+
export declare const ESCALATION_EVIDENCE_KINDS: readonly ["agent-request", "reviewer-rejection", "verification-failure", "repeated-failure", "explicit-blocker"];
|
|
77
|
+
export type EscalationEvidenceKind = (typeof ESCALATION_EVIDENCE_KINDS)[number];
|
|
78
|
+
export interface EscalationEvidence {
|
|
79
|
+
readonly kind: EscalationEvidenceKind;
|
|
80
|
+
readonly detail?: string | undefined;
|
|
81
|
+
}
|
|
82
|
+
export declare const ESCALATION_STEPS: readonly ["variant", "tier"];
|
|
83
|
+
export type EscalationStep = (typeof ESCALATION_STEPS)[number];
|
|
84
|
+
/** Finite per-unit escalation budget (ADP-015). `used >= max` ends escalation. */
|
|
85
|
+
export interface EscalationBudget {
|
|
86
|
+
readonly used: number;
|
|
87
|
+
readonly max: number;
|
|
88
|
+
}
|
|
89
|
+
/** Bound on evidence carried by an `escalate` decision (latest wins). */
|
|
90
|
+
export declare const MAX_ESCALATION_EVIDENCE = 4;
|
|
91
|
+
export interface EscalationInput {
|
|
92
|
+
readonly currentModel: ModelRef;
|
|
93
|
+
readonly currentTier: TierName;
|
|
94
|
+
/**
|
|
95
|
+
* Ordered variant ids for the current model, weakest → strongest, when the
|
|
96
|
+
* host inventory exposes an order. Without a ladder the variant step is
|
|
97
|
+
* skipped — strength is never guessed from variant names (ADP-004).
|
|
98
|
+
*/
|
|
99
|
+
readonly variantLadder?: readonly string[] | undefined;
|
|
100
|
+
/** Configured resources of the next tier, user order, already gated. */
|
|
101
|
+
readonly nextTierResources: readonly ModelRef[];
|
|
102
|
+
/** Non-empty structured evidence justifies escalation. */
|
|
103
|
+
readonly evidence: readonly EscalationEvidence[];
|
|
104
|
+
readonly budget: EscalationBudget;
|
|
105
|
+
}
|
|
106
|
+
export interface EscalateDecision {
|
|
107
|
+
readonly kind: "escalate";
|
|
108
|
+
readonly target: ModelRef;
|
|
109
|
+
readonly step: EscalationStep;
|
|
110
|
+
/** Tier of the target: unchanged for the variant step, next tier otherwise. */
|
|
111
|
+
readonly tier: TierName;
|
|
112
|
+
readonly evidence: readonly EscalationEvidence[];
|
|
113
|
+
readonly budgetRemaining: number;
|
|
114
|
+
}
|
|
115
|
+
/** OBSERVE mode's wrapper: the identical decision, recorded but not applied. */
|
|
116
|
+
export interface ObserveOnlyDecision {
|
|
117
|
+
readonly kind: "observe-only";
|
|
118
|
+
readonly would: Decision;
|
|
119
|
+
}
|
|
120
|
+
export type Decision = ApplyDecision | DeferDecision | ParkDecision | EscalateDecision | ObserveOnlyDecision;
|
|
121
|
+
/** What admission can return — escalation never originates from admission. */
|
|
122
|
+
export type AdmissionDecision = ApplyDecision | DeferDecision | ParkDecision;
|
|
123
|
+
/**
|
|
124
|
+
* Everything admission looks at. `health` and `capacity` are keyed by
|
|
125
|
+
* `schedulerHealthKey(ref)`; an absent health entry means "no observed
|
|
126
|
+
* failure" (the registry's default), an absent capacity entry means "no
|
|
127
|
+
* estimate" — unknown is never treated as exhausted.
|
|
128
|
+
*/
|
|
129
|
+
export interface SchedulerInput {
|
|
130
|
+
readonly routing: RoutingDecision;
|
|
131
|
+
readonly demand: Demand;
|
|
132
|
+
/** Host inventory (adapter-normalized). Candidates absent here are unverifiable. */
|
|
133
|
+
readonly inventory: readonly CandidateModel[];
|
|
134
|
+
/** Configured resources of the required tier, in user order (ADP-005). */
|
|
135
|
+
readonly tierCandidates: readonly ModelRef[];
|
|
136
|
+
readonly health: Readonly<Record<string, Assessment>>;
|
|
137
|
+
readonly capacity: Readonly<Record<string, CapacitySignals>>;
|
|
138
|
+
}
|
|
139
|
+
/** Bound on the `skipped` evidence list of an `apply` decision. */
|
|
140
|
+
export declare const MAX_EVIDENCE_SKIPPED = 8;
|
|
141
|
+
/** Canonical health/capacity map key for a candidate model reference. */
|
|
142
|
+
export declare function schedulerHealthKey(ref: ModelRef): string;
|
|
143
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/scheduler/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AACr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,SAAS,EAAE,SAAS,cAAc,EAAE,CAAA;IAC7C,0EAA0E;IAC1E,QAAQ,CAAC,cAAc,EAAE,SAAS,QAAQ,EAAE,CAAA;IAC5C,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAA;IACrD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAA;CAC7D;AAED,mEAAmE;AACnE,eAAO,MAAM,oBAAoB,IAAI,CAAA;AAErC,yEAAyE;AACzE,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,QAAQ,GAAG,MAAM,CAMxD"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { INCOMPATIBILITY_REASONS } from "../compatibility/types.js";
|
|
2
|
+
import { BLOCKED_REASONS } from "../../health/resource-health/types.js";
|
|
3
|
+
import { resourceKeyID } from "../../health/resource-health/key.js";
|
|
4
|
+
/** Operating modes (GOAL manual control). The plugin defaults to `observe`. */
|
|
5
|
+
export const OPERATING_MODES = ["off", "observe", "active"];
|
|
6
|
+
/** Why an `apply` decision chose its model (receipt provenance). */
|
|
7
|
+
export const APPLY_REASONS = [
|
|
8
|
+
"pin",
|
|
9
|
+
"preferred",
|
|
10
|
+
"fallback",
|
|
11
|
+
"probe",
|
|
12
|
+
"draining",
|
|
13
|
+
];
|
|
14
|
+
/**
|
|
15
|
+
* Why the core did not apply anything.
|
|
16
|
+
* - `routing-defer` — the tier ladder deferred; OpenCode's choice stands.
|
|
17
|
+
* - `pin-unverifiable` — the pinned model is not in the host inventory, so
|
|
18
|
+
* availability cannot be verified (inventory gate); deferring keeps the
|
|
19
|
+
* user's own model choice, which for a pin is typically the pinned model.
|
|
20
|
+
* - `pin-incompatible` — the pinned model cannot execute the work.
|
|
21
|
+
* - `escalation-*` — escalation evidence was absent, the budget was spent,
|
|
22
|
+
* the tier ladder is at its ceiling, or the next tier has no resources
|
|
23
|
+
* (no cross-tier borrowing).
|
|
24
|
+
* - `adaptive-off` — the plugin is off; only reachable through `forMode`.
|
|
25
|
+
*/
|
|
26
|
+
export const SCHEDULER_DEFER_REASONS = [
|
|
27
|
+
"routing-defer",
|
|
28
|
+
"pin-unverifiable",
|
|
29
|
+
"pin-incompatible",
|
|
30
|
+
"escalation-not-justified",
|
|
31
|
+
"escalation-budget-exhausted",
|
|
32
|
+
"escalation-ceiling",
|
|
33
|
+
"escalation-no-candidate",
|
|
34
|
+
"adaptive-off",
|
|
35
|
+
];
|
|
36
|
+
/**
|
|
37
|
+
* Why work parks instead of applying: the required tier has no usable
|
|
38
|
+
* resource right now. Parking waits for recovery — it never borrows across
|
|
39
|
+
* tiers (ADP-022).
|
|
40
|
+
*/
|
|
41
|
+
export const PARK_REASONS = [
|
|
42
|
+
"pin-blocked",
|
|
43
|
+
"no-candidates",
|
|
44
|
+
"no-compatible-resource",
|
|
45
|
+
"all-blocked",
|
|
46
|
+
];
|
|
47
|
+
/** Why a tier candidate was not usable. Superset of gate and health reasons. */
|
|
48
|
+
export const SKIP_REASONS = [
|
|
49
|
+
"not-in-inventory",
|
|
50
|
+
"capacity-exhausted",
|
|
51
|
+
"incompatible",
|
|
52
|
+
...INCOMPATIBILITY_REASONS,
|
|
53
|
+
...BLOCKED_REASONS,
|
|
54
|
+
];
|
|
55
|
+
/** Structured capability evidence for escalation (ADP-015). Never prose mining. */
|
|
56
|
+
export const ESCALATION_EVIDENCE_KINDS = [
|
|
57
|
+
"agent-request",
|
|
58
|
+
"reviewer-rejection",
|
|
59
|
+
"verification-failure",
|
|
60
|
+
"repeated-failure",
|
|
61
|
+
"explicit-blocker",
|
|
62
|
+
];
|
|
63
|
+
export const ESCALATION_STEPS = ["variant", "tier"];
|
|
64
|
+
/** Bound on evidence carried by an `escalate` decision (latest wins). */
|
|
65
|
+
export const MAX_ESCALATION_EVIDENCE = 4;
|
|
66
|
+
/** Bound on the `skipped` evidence list of an `apply` decision. */
|
|
67
|
+
export const MAX_EVIDENCE_SKIPPED = 8;
|
|
68
|
+
/** Canonical health/capacity map key for a candidate model reference. */
|
|
69
|
+
export function schedulerHealthKey(ref) {
|
|
70
|
+
return resourceKeyID(ref.variant === undefined
|
|
71
|
+
? { providerID: ref.providerID, modelID: ref.id }
|
|
72
|
+
: { providerID: ref.providerID, modelID: ref.id, variantID: ref.variant });
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/scheduler/types.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AAEnE,+EAA+E;AAC/E,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAsC,CAAA;AAIhG,oEAAoE;AACpE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,KAAK;IACL,WAAW;IACX,UAAU;IACV,OAAO;IACP,UAAU;CAC0B,CAAA;AAItC;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,0BAA0B;IAC1B,6BAA6B;IAC7B,oBAAoB;IACpB,yBAAyB;IACzB,cAAc;CACsB,CAAA;AAItC;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,aAAa;IACb,eAAe;IACf,wBAAwB;IACxB,aAAa;CACuB,CAAA;AAItC,gFAAgF;AAChF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,kBAAkB;IAClB,oBAAoB;IACpB,cAAc;IACd,GAAG,uBAAuB;IAC1B,GAAG,eAAe;CACkB,CAAA;AAuCtC,mFAAmF;AACnF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,eAAe;IACf,oBAAoB;IACpB,sBAAsB;IACtB,kBAAkB;IAClB,kBAAkB;CACkB,CAAA;AAStC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAS,EAAE,MAAM,CAAsC,CAAA;AAUxF,yEAAyE;AACzE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAA;AAyDxC,mEAAmE;AACnE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAA;AAErC,yEAAyE;AACzE,MAAM,UAAU,kBAAkB,CAAC,GAAa;IAC9C,OAAO,aAAa,CAClB,GAAG,CAAC,OAAO,KAAK,SAAS;QACvB,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE;QACjD,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,CAAC,OAAO,EAAE,CAC5E,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/tier-policy/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/tier-policy/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Routing priority ladder (ADP-002):
|
|
3
|
+
*
|
|
4
|
+
* explicit user/model pin
|
|
5
|
+
* → explicit tier request
|
|
6
|
+
* → supported agent role hint
|
|
7
|
+
* → deterministic local request evidence (auxiliary kinds)
|
|
8
|
+
* → default `standard`
|
|
9
|
+
*
|
|
10
|
+
* Ambiguity within a level resolves to `standard`. An explicit signal whose
|
|
11
|
+
* tier has no configured resources is NOT silently downgraded to another
|
|
12
|
+
* tier (that would borrow across tiers — GOAL tenet 4): the router defers
|
|
13
|
+
* instead (ADP-003), keeping OpenCode's model choice. No LLM call and no
|
|
14
|
+
* keyword classifier participates (ADP-004) — every input is a structured
|
|
15
|
+
* field.
|
|
16
|
+
*/
|
|
17
|
+
import { type RoutingDecision, type RoutingInput } from "./types.js";
|
|
18
|
+
export declare function resolveRouting(input: RoutingInput): RoutingDecision;
|
|
19
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../src/core/tier-policy/resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,YAAY,EAGlB,MAAM,YAAY,CAAA;AAEnB,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,GAAG,eAAe,CAiCnE"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Routing priority ladder (ADP-002):
|
|
3
|
+
*
|
|
4
|
+
* explicit user/model pin
|
|
5
|
+
* → explicit tier request
|
|
6
|
+
* → supported agent role hint
|
|
7
|
+
* → deterministic local request evidence (auxiliary kinds)
|
|
8
|
+
* → default `standard`
|
|
9
|
+
*
|
|
10
|
+
* Ambiguity within a level resolves to `standard`. An explicit signal whose
|
|
11
|
+
* tier has no configured resources is NOT silently downgraded to another
|
|
12
|
+
* tier (that would borrow across tiers — GOAL tenet 4): the router defers
|
|
13
|
+
* instead (ADP-003), keeping OpenCode's model choice. No LLM call and no
|
|
14
|
+
* keyword classifier participates (ADP-004) — every input is a structured
|
|
15
|
+
* field.
|
|
16
|
+
*/
|
|
17
|
+
import { AUXILIARY_TIER, DEFAULT_TIER, isAuxiliary, } from "./types.js";
|
|
18
|
+
export function resolveRouting(input) {
|
|
19
|
+
if (input.pin !== undefined) {
|
|
20
|
+
return { kind: "pin", model: input.pin };
|
|
21
|
+
}
|
|
22
|
+
if (input.tierRequest !== undefined) {
|
|
23
|
+
return byConfiguration(input.tierRequest.tier, "tier-request", input.configuredTiers);
|
|
24
|
+
}
|
|
25
|
+
// Role level: an agent-name hint from user policy and deterministic
|
|
26
|
+
// auxiliary-request evidence. Conflict inside the level is ambiguity
|
|
27
|
+
// (ADP-002) and resolves to `standard`; agreement keeps the tier.
|
|
28
|
+
const agentTier = input.agent !== undefined &&
|
|
29
|
+
input.agent.length > 0 &&
|
|
30
|
+
input.agentTiers !== undefined &&
|
|
31
|
+
Object.hasOwn(input.agentTiers, input.agent)
|
|
32
|
+
? input.agentTiers[input.agent]
|
|
33
|
+
: undefined;
|
|
34
|
+
const auxiliaryTier = input.requestKind !== undefined && isAuxiliary(input.requestKind) ? AUXILIARY_TIER : undefined;
|
|
35
|
+
if (agentTier !== undefined && auxiliaryTier !== undefined && agentTier !== auxiliaryTier) {
|
|
36
|
+
return byConfiguration(DEFAULT_TIER, "ambiguity", input.configuredTiers);
|
|
37
|
+
}
|
|
38
|
+
if (agentTier !== undefined) {
|
|
39
|
+
return byConfiguration(agentTier, "agent-role", input.configuredTiers);
|
|
40
|
+
}
|
|
41
|
+
if (auxiliaryTier !== undefined) {
|
|
42
|
+
return byConfiguration(auxiliaryTier, "auxiliary-request", input.configuredTiers);
|
|
43
|
+
}
|
|
44
|
+
return byConfiguration(DEFAULT_TIER, "default", input.configuredTiers);
|
|
45
|
+
}
|
|
46
|
+
function byConfiguration(tier, source, configuredTiers) {
|
|
47
|
+
if (!configuredTiers.includes(tier)) {
|
|
48
|
+
return { kind: "defer", tier, reason: "tier-not-configured" };
|
|
49
|
+
}
|
|
50
|
+
return { kind: "tier", tier, source };
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL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AAC,eAAe,CAAC,CAAA;IAC1E,CAAC;IACD,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,eAAe,CAAC,SAAS,EAAE,YAAY,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;IACxE,CAAC;IACD,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,eAAe,CAAC,aAAa,EAAE,mBAAmB,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;IACnF,CAAC;IAED,OAAO,eAAe,CAAC,YAAY,EAAE,SAAS,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;AACxE,CAAC;AAED,SAAS,eAAe,CACtB,IAAc,EACd,MAAqB,EACrB,eAAoC;IAEpC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,qBAAqB,EAAE,CAAA;IAC/D,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;AACvC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User-configured tier lists (ADP-005): each tier is an ordered list of
|
|
3
|
+
* resources; list order is user policy and is never reordered by Adaptive.
|
|
4
|
+
* Normalization only removes unusable entries and exact duplicates — it
|
|
5
|
+
* never reorders and never merges look-alike names (ADP-006: similar model
|
|
6
|
+
* names across providers are never equivalent unless the user configures
|
|
7
|
+
* both, and full-reference equality below is deliberately provider-scoped).
|
|
8
|
+
*/
|
|
9
|
+
import { type ModelRef } from "../work-unit/types.js";
|
|
10
|
+
export declare function normalizeTierList(resources: readonly ModelRef[]): ModelRef[];
|
|
11
|
+
//# sourceMappingURL=tier-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tier-list.d.ts","sourceRoot":"","sources":["../../../src/core/tier-policy/tier-list.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEnE,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,QAAQ,EAAE,GAAG,QAAQ,EAAE,CAY5E"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User-configured tier lists (ADP-005): each tier is an ordered list of
|
|
3
|
+
* resources; list order is user policy and is never reordered by Adaptive.
|
|
4
|
+
* Normalization only removes unusable entries and exact duplicates — it
|
|
5
|
+
* never reorders and never merges look-alike names (ADP-006: similar model
|
|
6
|
+
* names across providers are never equivalent unless the user configures
|
|
7
|
+
* both, and full-reference equality below is deliberately provider-scoped).
|
|
8
|
+
*/
|
|
9
|
+
import { sameModelRef } from "../work-unit/types.js";
|
|
10
|
+
export function normalizeTierList(resources) {
|
|
11
|
+
const kept = [];
|
|
12
|
+
for (const resource of resources) {
|
|
13
|
+
if (resource.providerID.length === 0 || resource.id.length === 0) {
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
if (kept.some((existing) => sameModelRef(existing, resource))) {
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
kept.push(resource);
|
|
20
|
+
}
|
|
21
|
+
return kept;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=tier-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tier-list.js","sourceRoot":"","sources":["../../../src/core/tier-policy/tier-list.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,YAAY,EAAiB,MAAM,uBAAuB,CAAA;AAEnE,MAAM,UAAU,iBAAiB,CAAC,SAA8B;IAC9D,MAAM,IAAI,GAAe,EAAE,CAAA;IAC3B,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,IAAI,QAAQ,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjE,SAAQ;QACV,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC;YAC9D,SAAQ;QACV,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACrB,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tier-policy types (ADP-002..006). Tier names are an ecosystem proposal —
|
|
3
|
+
* OpenCode has no native capability-tier API — so every tier semantic lives
|
|
4
|
+
* in this module and nowhere else.
|
|
5
|
+
*/
|
|
6
|
+
import type { ModelRef } from "../work-unit/types.js";
|
|
7
|
+
export declare const TIERS: readonly ["quick", "standard", "advanced"];
|
|
8
|
+
export type TierName = (typeof TIERS)[number];
|
|
9
|
+
/**
|
|
10
|
+
* Request kinds the OpenCode `context` hook exposes for the executing
|
|
11
|
+
* request. Auxiliary kinds are trivial host-internal requests (title,
|
|
12
|
+
* compaction, generate) that must not consume an unnecessarily expensive
|
|
13
|
+
* tier — this is structured host evidence, not prompt keyword matching
|
|
14
|
+
* (ADP-004).
|
|
15
|
+
*/
|
|
16
|
+
export declare const AUXILIARY_KINDS: readonly ["compaction", "title", "generate"];
|
|
17
|
+
export type AuxiliaryKind = (typeof AUXILIARY_KINDS)[number];
|
|
18
|
+
export type RequestKind = "primary" | AuxiliaryKind;
|
|
19
|
+
/** Auxiliary requests route to `quick`. */
|
|
20
|
+
export declare const AUXILIARY_TIER: TierName;
|
|
21
|
+
/** Unambiguous fallback tier (ADP-002). */
|
|
22
|
+
export declare const DEFAULT_TIER: TierName;
|
|
23
|
+
/** How an explicit tier request reached the plugin (provenance for receipts). */
|
|
24
|
+
export declare const TIER_REQUEST_VIAS: readonly ["manual-command", "session-setting"];
|
|
25
|
+
export type TierRequestVia = (typeof TIER_REQUEST_VIAS)[number];
|
|
26
|
+
export interface TierRequest {
|
|
27
|
+
readonly tier: TierName;
|
|
28
|
+
readonly via: TierRequestVia;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Everything the ladder may look at, all optional except the configuration
|
|
32
|
+
* view. Every signal is a structured field supplied by the adapter — never
|
|
33
|
+
* text mined from a prompt.
|
|
34
|
+
*/
|
|
35
|
+
export interface RoutingInput {
|
|
36
|
+
/** Explicit user/model pin (manual control); always wins (ADP-002). */
|
|
37
|
+
readonly pin?: ModelRef | undefined;
|
|
38
|
+
/** Explicit tier request (manual command or session setting). */
|
|
39
|
+
readonly tierRequest?: TierRequest | undefined;
|
|
40
|
+
/** OpenCode agent name of the executing request, when the host supplies one. */
|
|
41
|
+
readonly agent?: string | undefined;
|
|
42
|
+
/** Request kind from the `context` hook, when known. */
|
|
43
|
+
readonly requestKind?: RequestKind | undefined;
|
|
44
|
+
/** User-configured agent-name → tier mapping (role hints are user policy). */
|
|
45
|
+
readonly agentTiers?: Readonly<Record<string, TierName>> | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Tiers that currently have at least one configured resource (ADP-005).
|
|
48
|
+
* A tier without resources can never be honored — Adaptive does not
|
|
49
|
+
* invent resources and never borrows across tiers (GOAL tenet 4).
|
|
50
|
+
*/
|
|
51
|
+
readonly configuredTiers: readonly TierName[];
|
|
52
|
+
}
|
|
53
|
+
/** Why the ladder produced a tier decision (receipt provenance). */
|
|
54
|
+
export declare const ROUTING_SOURCES: readonly ["pin", "tier-request", "agent-role", "auxiliary-request", "ambiguity", "default"];
|
|
55
|
+
export type RoutingSource = (typeof ROUTING_SOURCES)[number];
|
|
56
|
+
export declare const DEFER_REASONS: readonly ["tier-not-configured"];
|
|
57
|
+
export type DeferReason = (typeof DEFER_REASONS)[number];
|
|
58
|
+
/**
|
|
59
|
+
* Routing outcome (ADP-002/003):
|
|
60
|
+
* - `pin` — route to the pinned resource.
|
|
61
|
+
* - `tier` — route within the named tier.
|
|
62
|
+
* - `defer` — Adaptive has no reason to override ordinary OpenCode behavior;
|
|
63
|
+
* the unit keeps OpenCode's model choice. `tier` records which tier the
|
|
64
|
+
* ladder resolved to before the configuration gate blocked it.
|
|
65
|
+
*/
|
|
66
|
+
export type RoutingDecision = {
|
|
67
|
+
readonly kind: "pin";
|
|
68
|
+
readonly model: ModelRef;
|
|
69
|
+
} | {
|
|
70
|
+
readonly kind: "tier";
|
|
71
|
+
readonly tier: TierName;
|
|
72
|
+
readonly source: RoutingSource;
|
|
73
|
+
} | {
|
|
74
|
+
readonly kind: "defer";
|
|
75
|
+
readonly tier: TierName;
|
|
76
|
+
readonly reason: DeferReason;
|
|
77
|
+
};
|
|
78
|
+
/** True only for the trivial auxiliary request kinds. */
|
|
79
|
+
export declare function isAuxiliary(kind: RequestKind): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Escalation ladder order (GOAL capability escalation): `quick` → `standard`
|
|
82
|
+
* → `advanced`. `advanced` is the last tier — there is no next.
|
|
83
|
+
*/
|
|
84
|
+
export declare function nextTier(tier: TierName): TierName | undefined;
|
|
85
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/tier-policy/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAErD,eAAO,MAAM,KAAK,4CAAyE,CAAA;AAE3F,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,CAAA;AAE7C;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,8CAIU,CAAA;AAEtC,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAA;AAE5D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,aAAa,CAAA;A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