@senpi-ai/runtime 3.0.70 → 3.0.78
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/README.md +76 -2
- package/dist/cli/deploy-render.d.ts +93 -0
- package/dist/cli/deploy-render.d.ts.map +1 -0
- package/dist/cli/deploy-render.js +438 -0
- package/dist/cli/deploy-render.js.map +1 -0
- package/dist/cli/guide-commands.d.ts.map +1 -1
- package/dist/cli/guide-commands.js +94 -9
- package/dist/cli/guide-commands.js.map +1 -1
- package/dist/cli/senpi-commands.d.ts +6 -1
- package/dist/cli/senpi-commands.d.ts.map +1 -1
- package/dist/cli/senpi-commands.js +290 -41
- package/dist/cli/senpi-commands.js.map +1 -1
- package/dist/cli/validate-command.d.ts.map +1 -1
- package/dist/cli/validate-command.js +10 -1
- package/dist/cli/validate-command.js.map +1 -1
- package/dist/deploy/deadlines.d.ts +107 -0
- package/dist/deploy/deadlines.d.ts.map +1 -0
- package/dist/deploy/deadlines.js +139 -0
- package/dist/deploy/deadlines.js.map +1 -0
- package/dist/deploy/error-text.d.ts +25 -0
- package/dist/deploy/error-text.d.ts.map +1 -0
- package/dist/deploy/error-text.js +42 -0
- package/dist/deploy/error-text.js.map +1 -0
- package/dist/deploy/funding.d.ts +125 -0
- package/dist/deploy/funding.d.ts.map +1 -0
- package/dist/deploy/funding.js +268 -0
- package/dist/deploy/funding.js.map +1 -0
- package/dist/deploy/install-gate-runner.d.ts +12 -0
- package/dist/deploy/install-gate-runner.d.ts.map +1 -0
- package/dist/deploy/install-gate-runner.js +17 -0
- package/dist/deploy/install-gate-runner.js.map +1 -0
- package/dist/deploy/job.d.ts +215 -0
- package/dist/deploy/job.d.ts.map +1 -0
- package/dist/deploy/job.js +484 -0
- package/dist/deploy/job.js.map +1 -0
- package/dist/deploy/messages.d.ts +603 -0
- package/dist/deploy/messages.d.ts.map +1 -0
- package/dist/deploy/messages.js +1388 -0
- package/dist/deploy/messages.js.map +1 -0
- package/dist/deploy/min-budget.d.ts +68 -0
- package/dist/deploy/min-budget.d.ts.map +1 -0
- package/dist/deploy/min-budget.js +297 -0
- package/dist/deploy/min-budget.js.map +1 -0
- package/dist/deploy/orchestrator.d.ts +314 -0
- package/dist/deploy/orchestrator.d.ts.map +1 -0
- package/dist/deploy/orchestrator.js +2171 -0
- package/dist/deploy/orchestrator.js.map +1 -0
- package/dist/deploy/package.d.ts +228 -0
- package/dist/deploy/package.d.ts.map +1 -0
- package/dist/deploy/package.js +542 -0
- package/dist/deploy/package.js.map +1 -0
- package/dist/deploy/proof-gate.d.ts +86 -0
- package/dist/deploy/proof-gate.d.ts.map +1 -0
- package/dist/deploy/proof-gate.js +278 -0
- package/dist/deploy/proof-gate.js.map +1 -0
- package/dist/deploy/python-float.d.ts +34 -0
- package/dist/deploy/python-float.d.ts.map +1 -0
- package/dist/deploy/python-float.js +46 -0
- package/dist/deploy/python-float.js.map +1 -0
- package/dist/deploy/recheck-commands.d.ts +50 -0
- package/dist/deploy/recheck-commands.d.ts.map +1 -0
- package/dist/deploy/recheck-commands.js +77 -0
- package/dist/deploy/recheck-commands.js.map +1 -0
- package/dist/deploy/register.d.ts +101 -0
- package/dist/deploy/register.d.ts.map +1 -0
- package/dist/deploy/register.js +714 -0
- package/dist/deploy/register.js.map +1 -0
- package/dist/deploy/taxonomy.d.ts +43 -0
- package/dist/deploy/taxonomy.d.ts.map +1 -0
- package/dist/deploy/taxonomy.js +59 -0
- package/dist/deploy/taxonomy.js.map +1 -0
- package/dist/dsl/events/handlers.d.ts +6 -4
- package/dist/dsl/events/handlers.d.ts.map +1 -1
- package/dist/dsl/events/handlers.js +29 -17
- package/dist/dsl/events/handlers.js.map +1 -1
- package/dist/dsl/events/initial-state.d.ts +21 -11
- package/dist/dsl/events/initial-state.d.ts.map +1 -1
- package/dist/dsl/events/initial-state.js +6 -0
- package/dist/dsl/events/initial-state.js.map +1 -1
- package/dist/dsl/notifications/floor-store.d.ts.map +1 -1
- package/dist/dsl/notifications/floor-store.js +34 -5
- package/dist/dsl/notifications/floor-store.js.map +1 -1
- package/dist/dsl/notifications/formatter.d.ts.map +1 -1
- package/dist/dsl/notifications/formatter.js +13 -5
- package/dist/dsl/notifications/formatter.js.map +1 -1
- package/dist/dsl/notifications/index.d.ts +18 -1
- package/dist/dsl/notifications/index.d.ts.map +1 -1
- package/dist/dsl/notifications/index.js +78 -11
- package/dist/dsl/notifications/index.js.map +1 -1
- package/dist/dsl/notifications/stop-raise-debounce.d.ts +113 -0
- package/dist/dsl/notifications/stop-raise-debounce.d.ts.map +1 -0
- package/dist/dsl/notifications/stop-raise-debounce.js +223 -0
- package/dist/dsl/notifications/stop-raise-debounce.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +467 -222
- package/dist/index.js.map +1 -1
- package/dist/runtime/env-resolve.d.ts +13 -0
- package/dist/runtime/env-resolve.d.ts.map +1 -1
- package/dist/runtime/env-resolve.js +14 -1
- package/dist/runtime/env-resolve.js.map +1 -1
- package/dist/runtime/runtime-descriptor.d.ts +37 -0
- package/dist/runtime/runtime-descriptor.d.ts.map +1 -0
- package/dist/runtime/runtime-descriptor.js +163 -0
- package/dist/runtime/runtime-descriptor.js.map +1 -0
- package/dist/runtime/runtime-schema.d.ts +100 -100
- package/dist/runtime/strategy-registry.d.ts +8 -0
- package/dist/runtime/strategy-registry.d.ts.map +1 -1
- package/dist/runtime/strategy-registry.js +14 -1
- package/dist/runtime/strategy-registry.js.map +1 -1
- package/dist/runtime-api/intake/intake-mount.d.ts.map +1 -1
- package/dist/runtime-api/intake/intake-mount.js +7 -4
- package/dist/runtime-api/intake/intake-mount.js.map +1 -1
- package/dist/scanners/external/scaffold/preflight.py +39 -0
- package/dist/scanners/implementations/market-regime.d.ts +1 -1
- package/dist/senpi/client.d.ts +58 -4
- package/dist/senpi/client.d.ts.map +1 -1
- package/dist/senpi/client.js +262 -18
- package/dist/senpi/client.js.map +1 -1
- package/dist/senpi/strategy-status.d.ts +32 -0
- package/dist/senpi/strategy-status.d.ts.map +1 -0
- package/dist/senpi/strategy-status.js +70 -0
- package/dist/senpi/strategy-status.js.map +1 -0
- package/dist/senpi/types.d.ts +65 -3
- package/dist/senpi/types.d.ts.map +1 -1
- package/dist/skills-manager/manifest.js +3 -3
- package/dist/skills-manager/skills-manifest.json +3 -3
- package/dist/telemetry/metrics.d.ts +30 -0
- package/dist/telemetry/metrics.d.ts.map +1 -1
- package/dist/telemetry/metrics.js +72 -0
- package/dist/telemetry/metrics.js.map +1 -1
- package/dist/types/dsl/index.d.ts +14 -0
- package/dist/types/dsl/index.d.ts.map +1 -1
- package/dist/types/strategy.d.ts +9 -1
- package/dist/types/strategy.d.ts.map +1 -1
- package/dist/universe/package-universe.d.ts +97 -0
- package/dist/universe/package-universe.d.ts.map +1 -0
- package/dist/universe/package-universe.js +304 -0
- package/dist/universe/package-universe.js.map +1 -0
- package/dist/validate/codes.d.ts +30 -0
- package/dist/validate/codes.d.ts.map +1 -1
- package/dist/validate/codes.js +74 -1
- package/dist/validate/codes.js.map +1 -1
- package/dist/validate/index.d.ts +1 -1
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js.map +1 -1
- package/dist/validate/install-gate.d.ts.map +1 -1
- package/dist/validate/install-gate.js +10 -2
- package/dist/validate/install-gate.js.map +1 -1
- package/dist/validate/live-instruments.d.ts +44 -0
- package/dist/validate/live-instruments.d.ts.map +1 -0
- package/dist/validate/live-instruments.js +71 -0
- package/dist/validate/live-instruments.js.map +1 -0
- package/dist/validate/live-stage.d.ts +8 -0
- package/dist/validate/live-stage.d.ts.map +1 -1
- package/dist/validate/live-stage.js +87 -18
- package/dist/validate/live-stage.js.map +1 -1
- package/dist/validate/package-gates-stage.d.ts +61 -0
- package/dist/validate/package-gates-stage.d.ts.map +1 -0
- package/dist/validate/package-gates-stage.js +215 -0
- package/dist/validate/package-gates-stage.js.map +1 -0
- package/dist/validate/proof.d.ts +11 -1
- package/dist/validate/proof.d.ts.map +1 -1
- package/dist/validate/proof.js +10 -6
- package/dist/validate/proof.js.map +1 -1
- package/dist/validate/recipe-checks.d.ts.map +1 -1
- package/dist/validate/recipe-checks.js +6 -4
- package/dist/validate/recipe-checks.js.map +1 -1
- package/dist/validate/run.d.ts +29 -1
- package/dist/validate/run.d.ts.map +1 -1
- package/dist/validate/run.js +65 -6
- package/dist/validate/run.js.map +1 -1
- package/dist/validate/target.d.ts +41 -0
- package/dist/validate/target.d.ts.map +1 -1
- package/dist/validate/target.js +192 -16
- package/dist/validate/target.js.map +1 -1
- package/dist/validate/taxonomy-finding.d.ts +22 -0
- package/dist/validate/taxonomy-finding.d.ts.map +1 -0
- package/dist/validate/taxonomy-finding.js +25 -0
- package/dist/validate/taxonomy-finding.js.map +1 -0
- package/dist/validate/universe-stage.d.ts +71 -0
- package/dist/validate/universe-stage.d.ts.map +1 -0
- package/dist/validate/universe-stage.js +165 -0
- package/dist/validate/universe-stage.js.map +1 -0
- package/dist/validate/wallet-binding-stage.d.ts +44 -0
- package/dist/validate/wallet-binding-stage.d.ts.map +1 -0
- package/dist/validate/wallet-binding-stage.js +92 -0
- package/dist/validate/wallet-binding-stage.js.map +1 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import type { DeployEvent, DeployEventBody, DeployReport, JobPhase } from "./orchestrator.js";
|
|
2
|
+
export type JobState =
|
|
3
|
+
/** `stopRequested` = the deadline watchdog has asked the run to stop at its next step boundary. */
|
|
4
|
+
{
|
|
5
|
+
status: "running";
|
|
6
|
+
phase: JobPhase;
|
|
7
|
+
stopRequested: boolean;
|
|
8
|
+
} | {
|
|
9
|
+
status: "done";
|
|
10
|
+
overall: DeployReport["overall"];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Stamped by `scanOnBoot`, and SYNTHESIZED by {@link DeployJobController.readJournal} for any
|
|
14
|
+
* journal with no terminal line — which is the same thing in almost every case, and not in one:
|
|
15
|
+
* `append` swallows write failures (see its doc), so a deploy that ran to `live` on a full or
|
|
16
|
+
* read-only volume never got its terminal line written and reads `interrupted` forever after.
|
|
17
|
+
* A live process still never produces this state for its OWN job — `status` answers from memory
|
|
18
|
+
* while the job is running.
|
|
19
|
+
*/
|
|
20
|
+
| {
|
|
21
|
+
status: "interrupted";
|
|
22
|
+
};
|
|
23
|
+
export interface DeployJobMeta {
|
|
24
|
+
/** "dpl-" + 8 lowercase hex */
|
|
25
|
+
deployId: string;
|
|
26
|
+
packageId: string;
|
|
27
|
+
version: string;
|
|
28
|
+
packageDir: string;
|
|
29
|
+
budget?: number;
|
|
30
|
+
/** ISO */
|
|
31
|
+
startedAt: string;
|
|
32
|
+
}
|
|
33
|
+
export interface JobSnapshot {
|
|
34
|
+
meta: DeployJobMeta;
|
|
35
|
+
state: JobState;
|
|
36
|
+
/** tail, newest last (capped in memory; the journal holds the full history) */
|
|
37
|
+
events: DeployEvent[];
|
|
38
|
+
/** terminal jobs only */
|
|
39
|
+
report?: DeployReport;
|
|
40
|
+
/**
|
|
41
|
+
* ISO end stamp, quoted from the terminal journal line — `done` jobs only, and absent for a
|
|
42
|
+
* journal whose terminal line predates this field. It is what lets the renderer report the
|
|
43
|
+
* duration a finished job TOOK instead of re-deriving `now - startedAt` on every read, which made
|
|
44
|
+
* one refusal that took 5s report 48s, 83s and 100s on three successive reads.
|
|
45
|
+
*
|
|
46
|
+
* Deliberately NOT published for an `interrupted` job, whatever its journal holds. The only
|
|
47
|
+
* writer of an interrupted terminal line is {@link DeployJobController.scanOnBoot}, which stamps
|
|
48
|
+
* the moment it NOTICES the dead journal — start → next restart, not start → stop — and the same
|
|
49
|
+
* journal read before any boot scan carries no stamp at all. `deploy status` refuses to print a
|
|
50
|
+
* duration from that figure; publishing it on `--json` would hand a machine consumer the exact
|
|
51
|
+
* number the human surface calls unprovable, and `endedAt - startedAt` there is the box's
|
|
52
|
+
* downtime rather than any measurement of the job. The stamp stays in the journal for anyone
|
|
53
|
+
* debugging the boot scan itself.
|
|
54
|
+
*/
|
|
55
|
+
endedAt?: string;
|
|
56
|
+
}
|
|
57
|
+
/** What `run` is handed: its own id, narration in, the deadline stop out. Nothing else. */
|
|
58
|
+
export interface JobHandle {
|
|
59
|
+
/** This job's id — the `senpi.deploy.id` span attribute the run's own spans carry. */
|
|
60
|
+
deployId: string;
|
|
61
|
+
emit(event: DeployEventBody): void;
|
|
62
|
+
shouldAbandon(): boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface DeployJobControllerOptions {
|
|
65
|
+
deploysDir: string;
|
|
66
|
+
now(): number;
|
|
67
|
+
log(line: string): void;
|
|
68
|
+
/** journals retained by the boot scan; default 20 */
|
|
69
|
+
keep?: number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* H6: every MCP call a deploy makes is separately deadline-bounded. Owned here, beside the grace it
|
|
73
|
+
* determines, so the two can never be hand-synced apart; `register.ts` imports it for its own
|
|
74
|
+
* per-call signals.
|
|
75
|
+
*/
|
|
76
|
+
export declare const MCP_CALL_TIMEOUT_MS = 90000;
|
|
77
|
+
/**
|
|
78
|
+
* How long the soft stop gets to land at a step boundary before the slot is taken back by force.
|
|
79
|
+
*
|
|
80
|
+
* DERIVED, never a bare number: force-terminate releases the single-flight slot while the abandoned
|
|
81
|
+
* run may still be waiting on a call. Sized past the per-call deadline so that by the time the slot
|
|
82
|
+
* frees, every call the abandoned run could still be awaiting has already been abandoned by its own
|
|
83
|
+
* deadline — a NEW deploy never starts its preflight/create while the old job is still parked on a
|
|
84
|
+
* money-moving call against the same funding waterfall. The headroom covers the abort landing and
|
|
85
|
+
* the step-boundary check that follows it.
|
|
86
|
+
*
|
|
87
|
+
* What this does NOT buy: a deadline bounds the WAIT, not the backend's work (`boundAwait` in
|
|
88
|
+
* `senpi/client.ts` — the gateway-injected MCP transport accepts no abort option). A create or fund
|
|
89
|
+
* this job stopped waiting on may still complete server-side after the slot has been handed on.
|
|
90
|
+
* What the grace guarantees is that the job is no longer *waiting* on a money-moving call when the
|
|
91
|
+
* slot comes back; the residue is reconciled by the next deploy, not prevented here.
|
|
92
|
+
*
|
|
93
|
+
* (This supersedes the plan's locked 60s: 60 < the locked 90s call timeout, so the two locked
|
|
94
|
+
* defaults were mutually inconsistent.)
|
|
95
|
+
*/
|
|
96
|
+
export declare const GRACE_MS: number;
|
|
97
|
+
/**
|
|
98
|
+
* The single-flight slot is IN-MEMORY ONLY (`this.live`). It must never be persisted: an
|
|
99
|
+
* interrupted job belongs to a dead process and leaves the slot free by construction — persisting
|
|
100
|
+
* it would wedge every deploy on the box after one crash.
|
|
101
|
+
*/
|
|
102
|
+
export declare class DeployJobController {
|
|
103
|
+
private readonly deploysDir;
|
|
104
|
+
private readonly now;
|
|
105
|
+
private readonly log;
|
|
106
|
+
private readonly keep;
|
|
107
|
+
private live;
|
|
108
|
+
constructor(opts: DeployJobControllerOptions);
|
|
109
|
+
/** The running job's identity and progress, or null. The single-flight gate reads this. */
|
|
110
|
+
running(): (DeployJobMeta & {
|
|
111
|
+
phase: JobPhase;
|
|
112
|
+
stopRequested: boolean;
|
|
113
|
+
}) | null;
|
|
114
|
+
/**
|
|
115
|
+
* Claim the single job slot and fire `run` un-awaited.
|
|
116
|
+
*
|
|
117
|
+
* Single-flight is a money invariant, not a convenience: concurrent deploys
|
|
118
|
+
* share one funding waterfall, so two preflights can both pass while jointly
|
|
119
|
+
* overdrawing. Throws when a job is already running. The ordinary
|
|
120
|
+
* `E_DEPLOY_IN_PROGRESS` refusal comes from the gateway's own `running()`
|
|
121
|
+
* check BEFORE it gets here; this throw is the lost race between that check
|
|
122
|
+
* and this call, and the gateway catches it and renders the same refusal.
|
|
123
|
+
*
|
|
124
|
+
* `capMs` is the job's wall-clock cap (H6). Every MCP call the run makes is separately
|
|
125
|
+
* timeout-bounded, but a cap is what guarantees the slot comes back: one hung await used to hold
|
|
126
|
+
* it until the gateway restarted, and a boundary-honored stop flag never protected that case.
|
|
127
|
+
*/
|
|
128
|
+
start(meta: Omit<DeployJobMeta, "deployId" | "startedAt">, capMs: number, run: (job: JobHandle) => Promise<DeployReport>): DeployJobMeta;
|
|
129
|
+
/**
|
|
130
|
+
* The running job (from memory) when it is the one being asked about — by id or by omission —
|
|
131
|
+
* else the newest journal, or the named one. Unknown id → null.
|
|
132
|
+
*
|
|
133
|
+
* The live check MUST come first even for an explicit id: a
|
|
134
|
+
* running job's journal has no terminal line yet, so falling through to {@link readJournal}
|
|
135
|
+
* would render it `interrupted` — a state only the boot scan may ever assign, and a flat lie
|
|
136
|
+
* about a job that is actively moving money.
|
|
137
|
+
*/
|
|
138
|
+
status(deployId?: string): Promise<JobSnapshot | null>;
|
|
139
|
+
/**
|
|
140
|
+
* C2 carve-out: the ONE sanctioned journal read that feeds the orchestrator — and only as a
|
|
141
|
+
* LOOKUP KEY. Every id returned here is verified against the live backend (strategy_list
|
|
142
|
+
* strategyIds:[…]) before reconcile acts on it; the journal never decides anything.
|
|
143
|
+
*
|
|
144
|
+
* It exists because a create whose custom name the backend rejected lands under a
|
|
145
|
+
* backend-assigned name, which the reconcile name match can never find again: without the key,
|
|
146
|
+
* a re-run creates and funds a second wallet beside the first.
|
|
147
|
+
*
|
|
148
|
+
* Returns instance name → journaled created-strategy ids, newest journals first.
|
|
149
|
+
*
|
|
150
|
+
* `deployId` scopes the answer to ONE journal. Reconcile deliberately passes nothing: every
|
|
151
|
+
* journal of the package is a legitimate key source there, because any of them may hold the id
|
|
152
|
+
* of the wallet a re-run must adopt instead of funding a second one (D-9). The interrupted RENDER
|
|
153
|
+
* passes its own id, because it answers a narrower question — what did THIS job leave behind —
|
|
154
|
+
* and a still-live wallet from an earlier completed deploy is not that. Rendering it there would
|
|
155
|
+
* offer to close a strategy that is running exactly as intended.
|
|
156
|
+
*/
|
|
157
|
+
priorCreatedStrategyIds(packageId: string, deployId?: string): Map<string, string[]>;
|
|
158
|
+
/**
|
|
159
|
+
* The second D-9 lookup input off the SAME create-key event: strategyId → the amount that create
|
|
160
|
+
* call asked the backend to fund.
|
|
161
|
+
*
|
|
162
|
+
* Narrower than {@link priorCreatedStrategyIds} in what it may do, and deliberately so. It feeds
|
|
163
|
+
* exactly one thing — the report's funded-vs-requested comparison — and only the REQUESTED half
|
|
164
|
+
* of it; the funded half is always re-read live from `strategy_list` on the current run. No
|
|
165
|
+
* orchestration branch reads it, so a stale, missing or wrong entry costs a warn, never an action.
|
|
166
|
+
*
|
|
167
|
+
* It exists because the ask lives only in the memory of the run that funded. A deploy that funds
|
|
168
|
+
* $60 of a $500 ask and dies before assembling its report resumes as an adoption, and without
|
|
169
|
+
* this the shortfall is simply never mentioned again.
|
|
170
|
+
*
|
|
171
|
+
* Newest journal wins on a repeated strategyId — the ask that most recently produced that wallet.
|
|
172
|
+
*/
|
|
173
|
+
priorRequestedFunding(packageId: string): Map<string, number>;
|
|
174
|
+
/**
|
|
175
|
+
* Boot janitor: stamp every unterminated journal `interrupted`, then prune to
|
|
176
|
+
* the newest `keep`. Discovery is pull-based — the next `openclaw senpi deploy status`
|
|
177
|
+
* renders the interruption; nothing is resumed or notified here.
|
|
178
|
+
*/
|
|
179
|
+
scanOnBoot(): Promise<void>;
|
|
180
|
+
private recordEvent;
|
|
181
|
+
/**
|
|
182
|
+
* Close a job out. The slot is released in `finally`: a journal-write failure is narration lost,
|
|
183
|
+
* never a wedged single-flight slot that would refuse every future deploy with a stale
|
|
184
|
+
* `E_DEPLOY_IN_PROGRESS`.
|
|
185
|
+
*/
|
|
186
|
+
private terminate;
|
|
187
|
+
private journalPath;
|
|
188
|
+
/**
|
|
189
|
+
* Append one journal line. **Never throws**: the journal is narration, and the narration-only
|
|
190
|
+
* rule cuts both ways — a full or read-only state volume must not be able to change what a
|
|
191
|
+
* deploy does (or wedge its slot). A failed write is logged and the line is lost.
|
|
192
|
+
*/
|
|
193
|
+
private append;
|
|
194
|
+
private journalIds;
|
|
195
|
+
private readLines;
|
|
196
|
+
/** Journals newest-first by header `startedAt` — the only ordering the controller trusts. */
|
|
197
|
+
private journalIdsNewestFirst;
|
|
198
|
+
private newestJournalId;
|
|
199
|
+
/**
|
|
200
|
+
* Journal → snapshot. A journal with no terminal line IS an interrupted job.
|
|
201
|
+
*
|
|
202
|
+
* The FIRST terminal line wins. That ordering is load-bearing: when the deadline watchdog
|
|
203
|
+
* force-terminates a wedged job, the zombie `run` promise may settle later and append a second
|
|
204
|
+
* terminal line — the watchdog's verdict is the true one, and reading the first keeps it.
|
|
205
|
+
*/
|
|
206
|
+
private readJournal;
|
|
207
|
+
/** Retain the newest `keep` journals. Runs on every terminate and on boot, so a long-lived
|
|
208
|
+
* gateway does not grow `deploys/` without bound between restarts. Never throws.
|
|
209
|
+
*
|
|
210
|
+
* Unlocked by design: prune and every journal read are fully synchronous on one thread, so they
|
|
211
|
+
* cannot interleave in-process; a torn last line is already tolerated by `readLines`. Do not add
|
|
212
|
+
* locking without a cross-process caller. */
|
|
213
|
+
private prune;
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=job.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../../src/deploy/job.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAsB9F,MAAM,MAAM,QAAQ;AAClB,mGAAmG;AACjG;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAE,GAC9D;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,CAAA;CAAE;AACtD;;;;;;;GAOG;GACD;IAAE,MAAM,EAAE,aAAa,CAAA;CAAE,CAAC;AAE9B,MAAM,WAAW,aAAa;IAC5B,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAA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