@farmslot/protocol 0.21.0 → 0.26.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/CHANGELOG.md +115 -0
- package/dist/contracts/agents.d.ts +33 -0
- package/dist/contracts/agents.d.ts.map +1 -1
- package/dist/contracts/backlog.d.ts +8 -0
- package/dist/contracts/backlog.d.ts.map +1 -1
- package/dist/contracts/backlog.js.map +1 -1
- package/dist/contracts/device-inventory.d.ts +118 -0
- package/dist/contracts/device-inventory.d.ts.map +1 -0
- package/dist/contracts/device-inventory.js +51 -0
- package/dist/contracts/device-inventory.js.map +1 -0
- package/dist/contracts/dispatch.d.ts +4 -0
- package/dist/contracts/dispatch.d.ts.map +1 -1
- package/dist/contracts/execution-templates.d.ts +16 -0
- package/dist/contracts/execution-templates.d.ts.map +1 -1
- package/dist/contracts/execution-templates.js +6 -0
- package/dist/contracts/execution-templates.js.map +1 -1
- package/dist/contracts/gate-park.d.ts +284 -0
- package/dist/contracts/gate-park.d.ts.map +1 -0
- package/dist/contracts/gate-park.js +415 -0
- package/dist/contracts/gate-park.js.map +1 -0
- package/dist/contracts/index.d.ts +8 -0
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js +8 -0
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/pr-monitoring.d.ts +167 -0
- package/dist/contracts/pr-monitoring.d.ts.map +1 -0
- package/dist/contracts/pr-monitoring.js +2 -0
- package/dist/contracts/pr-monitoring.js.map +1 -0
- package/dist/contracts/pr-rules.d.ts +350 -0
- package/dist/contracts/pr-rules.d.ts.map +1 -0
- package/dist/contracts/pr-rules.js +6 -0
- package/dist/contracts/pr-rules.js.map +1 -0
- package/dist/contracts/pressure-admission.d.ts +175 -0
- package/dist/contracts/pressure-admission.d.ts.map +1 -0
- package/dist/contracts/pressure-admission.js +26 -0
- package/dist/contracts/pressure-admission.js.map +1 -0
- package/dist/contracts/readiness.d.ts +37 -0
- package/dist/contracts/readiness.d.ts.map +1 -0
- package/dist/contracts/readiness.js +8 -0
- package/dist/contracts/readiness.js.map +1 -0
- package/dist/contracts/resource-posture.d.ts +379 -0
- package/dist/contracts/resource-posture.d.ts.map +1 -0
- package/dist/contracts/resource-posture.js +293 -0
- package/dist/contracts/resource-posture.js.map +1 -0
- package/dist/contracts/resources.d.ts +27 -1
- package/dist/contracts/resources.d.ts.map +1 -1
- package/dist/contracts/resources.js +1 -1
- package/dist/contracts/resources.js.map +1 -1
- package/dist/contracts/reviews.d.ts +3 -0
- package/dist/contracts/reviews.d.ts.map +1 -1
- package/dist/contracts/reviews.js.map +1 -1
- package/dist/contracts/runs.d.ts +501 -12
- package/dist/contracts/runs.d.ts.map +1 -1
- package/dist/contracts/runs.js +148 -5
- package/dist/contracts/runs.js.map +1 -1
- package/dist/contracts/runtime-capabilities.d.ts +255 -3
- package/dist/contracts/runtime-capabilities.d.ts.map +1 -1
- package/dist/contracts/runtime-capabilities.js +113 -1
- package/dist/contracts/runtime-capabilities.js.map +1 -1
- package/dist/contracts/slots.d.ts +53 -1
- package/dist/contracts/slots.d.ts.map +1 -1
- package/dist/contracts/template-placeholders.d.ts +16 -0
- package/dist/contracts/template-placeholders.d.ts.map +1 -0
- package/dist/contracts/template-placeholders.js +39 -0
- package/dist/contracts/template-placeholders.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/integrations/pr-monitoring.d.ts +13 -0
- package/dist/integrations/pr-monitoring.d.ts.map +1 -0
- package/dist/integrations/pr-monitoring.js +160 -0
- package/dist/integrations/pr-monitoring.js.map +1 -0
- package/dist/integrations/pr-project-import.d.ts +12 -0
- package/dist/integrations/pr-project-import.d.ts.map +1 -0
- package/dist/integrations/pr-project-import.js +279 -0
- package/dist/integrations/pr-project-import.js.map +1 -0
- package/dist/integrations/pr-review-requirements.d.ts +4 -0
- package/dist/integrations/pr-review-requirements.d.ts.map +1 -0
- package/dist/integrations/pr-review-requirements.js +21 -0
- package/dist/integrations/pr-review-requirements.js.map +1 -0
- package/dist/integrations/pr-rule-config.d.ts +6 -0
- package/dist/integrations/pr-rule-config.d.ts.map +1 -0
- package/dist/integrations/pr-rule-config.js +217 -0
- package/dist/integrations/pr-rule-config.js.map +1 -0
- package/dist/integrations/pr-rule-predicates.d.ts +9 -0
- package/dist/integrations/pr-rule-predicates.d.ts.map +1 -0
- package/dist/integrations/pr-rule-predicates.js +223 -0
- package/dist/integrations/pr-rule-predicates.js.map +1 -0
- package/dist/recipes/step-io.d.ts +10 -1
- package/dist/recipes/step-io.d.ts.map +1 -1
- package/dist/rpc/backlog.d.ts +2 -2
- package/dist/rpc/backlog.d.ts.map +1 -1
- package/dist/rpc/backlog.js +2 -1
- package/dist/rpc/backlog.js.map +1 -1
- package/dist/rpc/config.d.ts +22 -2
- package/dist/rpc/config.d.ts.map +1 -1
- package/dist/rpc/config.js +1 -0
- package/dist/rpc/config.js.map +1 -1
- package/dist/rpc/copilot-runtime.d.ts +17 -0
- package/dist/rpc/copilot-runtime.d.ts.map +1 -1
- package/dist/rpc/copilot-runtime.js +5 -0
- package/dist/rpc/copilot-runtime.js.map +1 -1
- package/dist/rpc/dispatch.d.ts +39 -1
- package/dist/rpc/dispatch.d.ts.map +1 -1
- package/dist/rpc/dispatch.js +2 -0
- package/dist/rpc/dispatch.js.map +1 -1
- package/dist/rpc/git.d.ts +35 -0
- package/dist/rpc/git.d.ts.map +1 -1
- package/dist/rpc/index.d.ts +7 -0
- package/dist/rpc/index.d.ts.map +1 -1
- package/dist/rpc/index.js +7 -0
- package/dist/rpc/index.js.map +1 -1
- package/dist/rpc/machine-pause.d.ts +158 -0
- package/dist/rpc/machine-pause.d.ts.map +1 -0
- package/dist/rpc/machine-pause.js +8 -0
- package/dist/rpc/machine-pause.js.map +1 -0
- package/dist/rpc/native-session.d.ts +193 -0
- package/dist/rpc/native-session.d.ts.map +1 -0
- package/dist/rpc/native-session.js +2 -0
- package/dist/rpc/native-session.js.map +1 -0
- package/dist/rpc/pr-push.d.ts +56 -0
- package/dist/rpc/pr-push.d.ts.map +1 -0
- package/dist/rpc/pr-push.js +2 -0
- package/dist/rpc/pr-push.js.map +1 -0
- package/dist/rpc/pr-rules.d.ts +72 -0
- package/dist/rpc/pr-rules.d.ts.map +1 -0
- package/dist/rpc/pr-rules.js +2 -0
- package/dist/rpc/pr-rules.js.map +1 -0
- package/dist/rpc/pr-watch.d.ts +43 -0
- package/dist/rpc/pr-watch.d.ts.map +1 -0
- package/dist/rpc/pr-watch.js +2 -0
- package/dist/rpc/pr-watch.js.map +1 -0
- package/dist/rpc/registry.d.ts +56 -0
- package/dist/rpc/registry.d.ts.map +1 -1
- package/dist/rpc/registry.js +57 -0
- package/dist/rpc/registry.js.map +1 -1
- package/dist/rpc/resource-posture.d.ts +36 -0
- package/dist/rpc/resource-posture.d.ts.map +1 -0
- package/dist/rpc/resource-posture.js +7 -0
- package/dist/rpc/resource-posture.js.map +1 -0
- package/dist/rpc/resource-pressure-selection.d.ts +4 -0
- package/dist/rpc/resource-pressure-selection.d.ts.map +1 -0
- package/dist/rpc/resource-pressure-selection.js +21 -0
- package/dist/rpc/resource-pressure-selection.js.map +1 -0
- package/dist/rpc/resources.d.ts +176 -1
- package/dist/rpc/resources.d.ts.map +1 -1
- package/dist/rpc/resources.js +6 -0
- package/dist/rpc/resources.js.map +1 -1
- package/dist/rpc/roadmap.d.ts +1 -1
- package/dist/rpc/roadmap.d.ts.map +1 -1
- package/dist/rpc/roadmap.js +2 -1
- package/dist/rpc/roadmap.js.map +1 -1
- package/dist/rpc/run.d.ts +122 -5
- package/dist/rpc/run.d.ts.map +1 -1
- package/dist/rpc/run.js +1 -0
- package/dist/rpc/run.js.map +1 -1
- package/dist/rpc/runtime-capabilities.d.ts +73 -3
- package/dist/rpc/runtime-capabilities.d.ts.map +1 -1
- package/dist/rpc/runtime-capabilities.js +11 -0
- package/dist/rpc/runtime-capabilities.js.map +1 -1
- package/dist/rpc/slot.d.ts +9 -1
- package/dist/rpc/slot.d.ts.map +1 -1
- package/dist/rpc/slot.js.map +1 -1
- package/dist/rpc/tmux.d.ts +4 -0
- package/dist/rpc/tmux.d.ts.map +1 -1
- package/dist/rpc/worker-session-history.d.ts +1 -1
- package/dist/rpc/worker-session-history.d.ts.map +1 -1
- package/dist/runs/decision-resolution.d.ts +7 -0
- package/dist/runs/decision-resolution.d.ts.map +1 -1
- package/dist/runs/decision-resolution.js +1 -0
- package/dist/runs/decision-resolution.js.map +1 -1
- package/dist/runs/interactive-handoff.d.ts +14 -0
- package/dist/runs/interactive-handoff.d.ts.map +1 -0
- package/dist/runs/interactive-handoff.js +69 -0
- package/dist/runs/interactive-handoff.js.map +1 -0
- package/dist/runs/portable-bundle.d.ts +2 -0
- package/dist/runs/portable-bundle.d.ts.map +1 -1
- package/dist/runs/portable-bundle.js +14 -1
- package/dist/runs/portable-bundle.js.map +1 -1
- package/dist/runs/review-chain.d.ts +3 -2
- package/dist/runs/review-chain.d.ts.map +1 -1
- package/dist/runs/review-chain.js +4 -2
- package/dist/runs/review-chain.js.map +1 -1
- package/dist/slots/tracking-branch.d.ts +12 -0
- package/dist/slots/tracking-branch.d.ts.map +1 -1
- package/dist/slots/tracking-branch.js +12 -0
- package/dist/slots/tracking-branch.js.map +1 -1
- package/dist/transport/events.d.ts +19 -2
- package/dist/transport/events.d.ts.map +1 -1
- package/dist/transport/events.js +6 -0
- package/dist/transport/events.js.map +1 -1
- package/dist/transport/signal.d.ts +11 -0
- package/dist/transport/signal.d.ts.map +1 -1
- package/dist/transport/signal.js +19 -1
- package/dist/transport/signal.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -1
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gate-park state for clients (ADR-054 `free-slot` at an operator wait).
|
|
3
|
+
*
|
|
4
|
+
* A run parked with `free-slot` keeps its gate answerable while its slot goes
|
|
5
|
+
* back to dispatch. Three facts then live in three different places — the park
|
|
6
|
+
* record's slot disposition, the restore stages the record owes, and the
|
|
7
|
+
* Gateway's verdict on whether the original slot can take the run back — and a
|
|
8
|
+
* surface that reads any one of them alone gets the run's state wrong:
|
|
9
|
+
*
|
|
10
|
+
* - occupancy alone reports a restore that re-bound the slot and then failed
|
|
11
|
+
* as "back", so the gate looks answerable against a worker nothing proved;
|
|
12
|
+
* - the phase alone reports a `partial` that never reached the slot the same
|
|
13
|
+
* way as one that freed it;
|
|
14
|
+
* - a client that decides slot availability itself picks a slot the Gateway
|
|
15
|
+
* did not, which is the one thing ADR-054 forbids.
|
|
16
|
+
*
|
|
17
|
+
* So this module owns the single reading, and Command Center, Companion, and
|
|
18
|
+
* the CLI all render it. Availability is never derived here: it is carried in
|
|
19
|
+
* from a Gateway verdict, or reported as not known.
|
|
20
|
+
*
|
|
21
|
+
* The predicates below moved out of the Gateway so clients share the exact
|
|
22
|
+
* definitions the Gateway acts on rather than approximations of them.
|
|
23
|
+
*/
|
|
24
|
+
import { type MachineParkPhase, type MachineParkRestoreRefusal, type MachineParkRestoreStage, type MachineParkSlotDisposition, type MachineParkWorkspace, type Run } from './runs.js';
|
|
25
|
+
/**
|
|
26
|
+
* Whether this run's machine-park record released its slot (ADR-054
|
|
27
|
+
* `free-slot` at an operator wait, amending ADR-038's gate-held slot hold).
|
|
28
|
+
*
|
|
29
|
+
* `slotFreedAt` records the fact, not the intent: it is written only after the
|
|
30
|
+
* park stopped the runner and every manifest resource AND the ownership
|
|
31
|
+
* release landed, so a partial park never reads as freed. While it is set, the
|
|
32
|
+
* park record — not the slot row — is the authority for the run's slot
|
|
33
|
+
* binding: the run keeps `slotId` (the recovery handle and the workspace
|
|
34
|
+
* branch key off it) but stops counting as an occupant of that slot.
|
|
35
|
+
*
|
|
36
|
+
* This is the OCCUPANCY predicate. It must never claim a slot is free before
|
|
37
|
+
* the release actually landed, so dispatch cannot hand out a slot whose worker
|
|
38
|
+
* is still running. Use `isGateParkInFlightOrFreed` for the safety fences,
|
|
39
|
+
* which have the opposite bias.
|
|
40
|
+
*/
|
|
41
|
+
export declare function isSlotFreedByPark(run: Pick<Run, 'park'>): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Whether a gate park still owes a restore before its gate may be answered.
|
|
44
|
+
*
|
|
45
|
+
* The question consumption asks, and it is NOT "does the run occupy its slot".
|
|
46
|
+
* A restore that re-bound the slot, booted its resources, and then failed to
|
|
47
|
+
* get a structured acknowledgement out of the worker leaves an occupied slot
|
|
48
|
+
* and a running process — and answering the gate there drives the engine
|
|
49
|
+
* against a worker that never confirmed it came back. So this keys on the
|
|
50
|
+
* restore's own stage record, which is the only thing that says what landed.
|
|
51
|
+
*/
|
|
52
|
+
export declare function needsGateParkRestore(run: Pick<Run, 'park'>): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Whether a slot-freeing park is either done or still in flight for this run.
|
|
55
|
+
*
|
|
56
|
+
* The opposite bias to `isSlotFreedByPark`: it goes true the moment the
|
|
57
|
+
* write-ahead record declares a freeing park and stays true through the window
|
|
58
|
+
* where the runner and resources are being stopped but `slotFreedAt` has not
|
|
59
|
+
* been written yet.
|
|
60
|
+
*
|
|
61
|
+
* Every guard that must not act on a run whose slot is disappearing uses this:
|
|
62
|
+
* resolving a gate, applying a posture, driving a resolved gate onward, or
|
|
63
|
+
* tearing the slot down after a failure. Answering a gate mid-park would
|
|
64
|
+
* publish against a worker that is being stopped underneath it.
|
|
65
|
+
*
|
|
66
|
+
* It is keyed on intent-or-fact HONESTLY, which matters as much as the fence
|
|
67
|
+
* itself. A fence that never lifts is not a fence, it is a strand: the run can
|
|
68
|
+
* neither answer its gate nor be restored, and cancelling it is the only exit.
|
|
69
|
+
* So:
|
|
70
|
+
*
|
|
71
|
+
* - the record owes a restore — it freed the slot, or a restore re-bound it
|
|
72
|
+
* and has not settled `restored`. Fenced, until that restore or a cancel.
|
|
73
|
+
* - a park that never reached the slot and settled `partial` — it will not
|
|
74
|
+
* finish. It is still fenced
|
|
75
|
+
* while ANY of its effects is outstanding: a detach not yet rolled back, or
|
|
76
|
+
* a runner that is not PROVABLY still running. A stopped worker cannot act
|
|
77
|
+
* on a gate answer, and letting the operator answer anyway would be the
|
|
78
|
+
* silent version of the strand. `machine.pause.restore` is the exit: it
|
|
79
|
+
* reloads the worker and settles the record, which lifts the fence. Only a
|
|
80
|
+
* park that detached nothing and left an observably live worker leaves the
|
|
81
|
+
* run answerable where it stands.
|
|
82
|
+
* - otherwise, while the intent is live — fenced.
|
|
83
|
+
*/
|
|
84
|
+
export declare function isGateParkInFlightOrFreed(run: Pick<Run, 'park'>): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Whether machine parking still holds this run.
|
|
87
|
+
*
|
|
88
|
+
* The park RECORD is the authority for "is this run parked", not the run's
|
|
89
|
+
* persisted posture. A restore or a cancel settles the record while the posture
|
|
90
|
+
* it was applied under stays on the run, so a reader that trusts the posture
|
|
91
|
+
* decides an already-restored run is still parked — and then refuses to park it
|
|
92
|
+
* again, forever, as a no-op.
|
|
93
|
+
*/
|
|
94
|
+
export declare function hasLiveParkRecord(run: Pick<Run, 'park'>): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Where the run's slot stands under its park record.
|
|
97
|
+
*
|
|
98
|
+
* `freeing` and `freed` are deliberately different words: the first is a park
|
|
99
|
+
* whose release has not landed, and calling it freed would advertise a slot
|
|
100
|
+
* whose worker is still being stopped. `restoring` is likewise not `freed`:
|
|
101
|
+
* the slot is back under the run, but the restore still owes stages.
|
|
102
|
+
*
|
|
103
|
+
* The two `partial` states are split for the same reason, and it is the split
|
|
104
|
+
* that matters most to an operator. A `partial` park has SETTLED — it will not
|
|
105
|
+
* finish — so calling it "still landing" promises a completion that is never
|
|
106
|
+
* coming, and telling the operator to wait is advice that cannot work. Which of
|
|
107
|
+
* the two it is comes from the Gateway's own fence, never from a second reading
|
|
108
|
+
* of the record: a partial that detached nothing and left an observably live
|
|
109
|
+
* worker is answerable where it stands, and every other partial owes an
|
|
110
|
+
* explicit restore before its gate may be answered.
|
|
111
|
+
*/
|
|
112
|
+
export type GateParkSlotState =
|
|
113
|
+
/** A park that holds the run's slot — the machine-wide pause of ADR-053. */
|
|
114
|
+
'retained'
|
|
115
|
+
/** A freeing park still in flight; its slot release has not landed yet. */
|
|
116
|
+
| 'freeing'
|
|
117
|
+
/**
|
|
118
|
+
* A freeing park that failed before it reached the slot and left nothing
|
|
119
|
+
* outstanding. The worker is observably running and the gate is answerable.
|
|
120
|
+
*/
|
|
121
|
+
| 'partial-answerable'
|
|
122
|
+
/**
|
|
123
|
+
* A freeing park that failed with an effect outstanding — a detach not rolled
|
|
124
|
+
* back, or a worker that is not provably alive. Only a restore clears it.
|
|
125
|
+
*/
|
|
126
|
+
| 'partial-needs-restore'
|
|
127
|
+
/** The slot is released; dispatch may select it while the run stays parked. */
|
|
128
|
+
| 'freed'
|
|
129
|
+
/** A restore re-bound the slot but still owes stages before the gate is answerable. */
|
|
130
|
+
| 'restoring'
|
|
131
|
+
/**
|
|
132
|
+
* A restore re-bound a DIFFERENT slot than the park freed, because a
|
|
133
|
+
* successor took the original, and still owes stages. Split from `restoring`
|
|
134
|
+
* because the operator's attach target moved: telling them the run is coming
|
|
135
|
+
* back into the slot they parked it from would send them to a pane that
|
|
136
|
+
* belongs to someone else.
|
|
137
|
+
*/
|
|
138
|
+
| 'rehoming'
|
|
139
|
+
/** The record is `restored` or `cancelled`; nothing is outstanding. */
|
|
140
|
+
| 'settled';
|
|
141
|
+
/** How far the current freed-slot restore attempt got. */
|
|
142
|
+
export interface GateParkRestoreStageView {
|
|
143
|
+
state: 'not-started' | 'in-progress' | 'complete';
|
|
144
|
+
/** The stage being attempted right now, written before it runs. */
|
|
145
|
+
attempting: MachineParkRestoreStage | null;
|
|
146
|
+
completed: readonly MachineParkRestoreStage[];
|
|
147
|
+
/** Stages still owed, in the order the restore owes them. */
|
|
148
|
+
remaining: readonly MachineParkRestoreStage[];
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* The slot a restore would put the run back into.
|
|
152
|
+
*
|
|
153
|
+
* `available` is `null` when nothing has told this client whether that slot can
|
|
154
|
+
* take the run back. Only the Gateway answers that question — through
|
|
155
|
+
* `machine.pause.restore` — so a surface without one reports "not known" rather
|
|
156
|
+
* than guessing from the record.
|
|
157
|
+
*
|
|
158
|
+
* `slotId` is the target the Gateway picked and may differ from
|
|
159
|
+
* `originalSlotId`: when a successor took the slot the park freed, the Gateway
|
|
160
|
+
* re-homes the run to another free slot on the same machine. A client renders
|
|
161
|
+
* what it is given and never picks a slot itself.
|
|
162
|
+
*/
|
|
163
|
+
export interface GateParkRestoreTargetView {
|
|
164
|
+
slotId: string;
|
|
165
|
+
/** The slot the park record names. Equal to `slotId` unless the restore re-homes. */
|
|
166
|
+
originalSlotId: string;
|
|
167
|
+
disposition: MachineParkSlotDisposition;
|
|
168
|
+
available: boolean | null;
|
|
169
|
+
/** The Gateway's verdict code for that availability, when one was supplied. */
|
|
170
|
+
code?: string;
|
|
171
|
+
reason?: string;
|
|
172
|
+
}
|
|
173
|
+
/** How a restore proved the worker came back. */
|
|
174
|
+
export interface GateParkWorkerProofView {
|
|
175
|
+
/** `structured` delivered a turn the runner acknowledged; `adopted` inherited a live session. */
|
|
176
|
+
kind: 'structured' | 'adopted';
|
|
177
|
+
reason: string;
|
|
178
|
+
acceptedAt: string;
|
|
179
|
+
}
|
|
180
|
+
/** One reading of a run's gate park, shared by every client surface. */
|
|
181
|
+
export interface GateParkView {
|
|
182
|
+
runId: string;
|
|
183
|
+
machine: string;
|
|
184
|
+
/** The park record's slot — the run's slot binding while the record is live. */
|
|
185
|
+
slotId: string;
|
|
186
|
+
phase: MachineParkPhase;
|
|
187
|
+
slotState: GateParkSlotState;
|
|
188
|
+
/** Absent on records written before slot freeing existed; read as `retained`. */
|
|
189
|
+
slotDisposition: MachineParkSlotDisposition;
|
|
190
|
+
/** The slot dispatch may hand to another run right now, or `null`. */
|
|
191
|
+
freedSlotId: string | null;
|
|
192
|
+
slotFreedAt?: string;
|
|
193
|
+
slotReboundAt?: string;
|
|
194
|
+
/** The branch and tip a freeing park took out of the slot's working tree. */
|
|
195
|
+
preservedWorkspace?: MachineParkWorkspace;
|
|
196
|
+
/**
|
|
197
|
+
* Whether answering this run's gate must restore the run first. The same
|
|
198
|
+
* question `run.resolveDecision` asks before it consumes the decision.
|
|
199
|
+
*/
|
|
200
|
+
restoreBeforeGateAnswer: boolean;
|
|
201
|
+
restoreStage: GateParkRestoreStageView;
|
|
202
|
+
restoreTarget: GateParkRestoreTargetView;
|
|
203
|
+
/** Why the last restore attempt refused, when it refused without changing anything. */
|
|
204
|
+
refusal?: MachineParkRestoreRefusal;
|
|
205
|
+
/** How the last restore proved the worker back, once one did. */
|
|
206
|
+
workerProof?: GateParkWorkerProofView;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* A Gateway-resolved restore target. Structural so this module keeps no
|
|
210
|
+
* value-level dependency on the RPC layer, which imports these contracts.
|
|
211
|
+
* `MachinePauseRestoreTarget` and `MachinePauseEligibility` satisfy it.
|
|
212
|
+
*/
|
|
213
|
+
export interface GateParkRestoreVerdict {
|
|
214
|
+
target: {
|
|
215
|
+
slotId: string;
|
|
216
|
+
originalSlotId?: string;
|
|
217
|
+
disposition: MachineParkSlotDisposition;
|
|
218
|
+
available: boolean;
|
|
219
|
+
};
|
|
220
|
+
eligibility?: {
|
|
221
|
+
code: string;
|
|
222
|
+
reason: string;
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* The one reading of a run's gate park, or `null` when the run has no park
|
|
227
|
+
* record at all.
|
|
228
|
+
*
|
|
229
|
+
* `verdict` carries a Gateway-resolved restore target when the caller has read
|
|
230
|
+
* one (`machine.pause.restore`). Without it the target's `available` stays
|
|
231
|
+
* `null`: the record says which slot a restore would use, never whether that
|
|
232
|
+
* slot is free right now.
|
|
233
|
+
*/
|
|
234
|
+
export declare function gateParkView(run: Pick<Run, 'id' | 'park'>, verdict?: GateParkRestoreVerdict): GateParkView | null;
|
|
235
|
+
/**
|
|
236
|
+
* The gate park a client should render beside a run's gate, or `null` when
|
|
237
|
+
* there is nothing outstanding to say.
|
|
238
|
+
*
|
|
239
|
+
* A settled record is deliberately excluded: it describes a park the operator
|
|
240
|
+
* already resolved, and showing it beside a live gate reads as "this run is
|
|
241
|
+
* parked" when it is not.
|
|
242
|
+
*/
|
|
243
|
+
export declare function liveGateParkView(run: Pick<Run, 'id' | 'park'>, verdict?: GateParkRestoreVerdict): GateParkView | null;
|
|
244
|
+
/**
|
|
245
|
+
* Operator wording for the run's slot under its park.
|
|
246
|
+
*
|
|
247
|
+
* The sentences live here rather than in each client because the same claim has
|
|
248
|
+
* to read the same way in Command Center, Companion, and the CLI. A per-client
|
|
249
|
+
* copy is how "parked" came to mean the slot was gone on one surface and still
|
|
250
|
+
* held on another.
|
|
251
|
+
*/
|
|
252
|
+
export declare function gateParkStateLabel(view: GateParkView): string;
|
|
253
|
+
/** One compact line: what the park did with the slot, the branch it preserved, what it still owes. */
|
|
254
|
+
export declare function gateParkSummaryLine(view: GateParkView): string;
|
|
255
|
+
/**
|
|
256
|
+
* What the operator must know before answering this run's gate, or `null` when
|
|
257
|
+
* the park has nothing to say about it.
|
|
258
|
+
*
|
|
259
|
+
* A refused restore is reported as a block on the answer, never as a failed
|
|
260
|
+
* run: the record stays parked, the decision stays pending, and the operator
|
|
261
|
+
* can answer again once the refusal clears — or cancel.
|
|
262
|
+
*
|
|
263
|
+
* `blocking` is carried rather than left to each client to infer from `kind`.
|
|
264
|
+
* A client that re-derives it gets the one case that matters backwards: a
|
|
265
|
+
* `partial` park that stopped short of the slot is a warning worth showing and
|
|
266
|
+
* is NOT a block, so styling every non-`restore-first` notice as a block puts
|
|
267
|
+
* a stop sign on a gate the Gateway will accept.
|
|
268
|
+
*/
|
|
269
|
+
export interface GateParkGateNotice {
|
|
270
|
+
kind: 'restore-first' | 'restore-blocked' | 'park-in-flight' | 'park-needs-restore' | 'park-answerable';
|
|
271
|
+
/** Whether this notice stands between the operator and answering the gate. */
|
|
272
|
+
blocking: boolean;
|
|
273
|
+
message: string;
|
|
274
|
+
/** The typed refusal the last restore attempt recorded. */
|
|
275
|
+
refusal?: MachineParkRestoreRefusal;
|
|
276
|
+
/**
|
|
277
|
+
* A Gateway verdict says the target IS available now, so the refusal above
|
|
278
|
+
* describes a previous attempt rather than the current answer. Without this
|
|
279
|
+
* a refusal that has since been overtaken keeps reading as a standing block.
|
|
280
|
+
*/
|
|
281
|
+
refusalSuperseded?: boolean;
|
|
282
|
+
}
|
|
283
|
+
export declare function gateParkGateNotice(view: GateParkView | null): GateParkGateNotice | null;
|
|
284
|
+
//# sourceMappingURL=gate-park.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gate-park.d.ts","sourceRoot":"","sources":["../../src/contracts/gate-park.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAEL,KAAK,gBAAgB,EAErB,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,GAAG,EACT,MAAM,WAAW,CAAC;AAEnB;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,OAAO,CAQjE;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,OAAO,CAwBpE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,OAAO,CA4BzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,I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