toolroll 0.9.41 → 0.9.43
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 +37 -0
- package/dist/chat-actions.js +1 -1
- package/dist/chat-approval.d.ts +45 -0
- package/dist/chat-approval.js +81 -0
- package/dist/chat-channel.js +5 -0
- package/dist/chat-decide.d.ts +18 -6
- package/dist/chat-decide.js +54 -20
- package/dist/chat-flow.js +2 -2
- package/dist/cli.js +4 -2
- package/dist/coding-types.d.ts +2 -24
- package/dist/coding-workspace.js +12 -11
- package/dist/contracts/cli.d.ts +736 -0
- package/dist/contracts/cli.js +223 -0
- package/dist/contracts/coding-activity.d.ts +64 -0
- package/dist/contracts/coding-activity.js +58 -0
- package/dist/contracts/console-api.d.ts +484 -0
- package/dist/contracts/console-api.js +274 -0
- package/dist/contracts/diff-stat.d.ts +58 -0
- package/dist/contracts/diff-stat.js +59 -0
- package/dist/contracts/integration-metadata.d.ts +99 -0
- package/dist/contracts/integration-metadata.js +101 -0
- package/dist/contracts/lead-tools.d.ts +11 -0
- package/dist/contracts/lead-tools.js +2 -0
- package/dist/contracts/model-catalog.d.ts +21 -0
- package/dist/contracts/model-catalog.js +14 -0
- package/dist/contracts/native-census.d.ts +42 -0
- package/dist/contracts/native-census.js +36 -0
- package/dist/contracts/observation-request.d.ts +37 -0
- package/dist/contracts/observation-request.js +25 -0
- package/dist/contracts/provider.d.ts +30 -0
- package/dist/contracts/provider.js +15 -0
- package/dist/contracts/recipes.d.ts +166 -0
- package/dist/contracts/recipes.js +52 -0
- package/dist/contracts/retention.d.ts +42 -0
- package/dist/contracts/retention.js +24 -0
- package/dist/contracts/storage.d.ts +23 -0
- package/dist/contracts/storage.js +10 -0
- package/dist/contracts/store-json.d.ts +315 -0
- package/dist/contracts/store-json.js +196 -0
- package/dist/contracts/trigger-payloads.d.ts +369 -0
- package/dist/contracts/trigger-payloads.js +144 -0
- package/dist/contracts/update-journal.d.ts +254 -0
- package/dist/contracts/update-journal.js +155 -0
- package/dist/contracts/verification-view.d.ts +93 -0
- package/dist/contracts/verification-view.js +43 -0
- package/dist/control-setup.d.ts +1 -1
- package/dist/desktop-update.d.ts +7 -40
- package/dist/desktop-update.js +36 -8
- package/dist/evidence.d.ts +3 -19
- package/dist/flow-engine.d.ts +2 -0
- package/dist/flow-engine.js +10 -2
- package/dist/flow-triggers.js +61 -60
- package/dist/flows-cli.d.ts +28 -0
- package/dist/flows-cli.js +43 -1
- package/dist/guides.js +2 -0
- package/dist/mate-contract.js +1 -1
- package/dist/mate-tools.js +43 -1
- package/dist/mcp-connect.js +37 -22
- package/dist/model-catalog.js +8 -6
- package/dist/observations.d.ts +2 -6
- package/dist/observations.js +13 -9
- package/dist/operate.js +55 -4
- package/dist/process-recovery-eligibility.d.ts +1 -1
- package/dist/process-recovery-native.d.ts +2 -13
- package/dist/process-recovery-native.js +8 -5
- package/dist/project-tools.d.ts +6 -24
- package/dist/project-tools.js +22 -18
- package/dist/provider.d.ts +3 -8
- package/dist/provider.js +15 -11
- package/dist/recipes.d.ts +3 -28
- package/dist/recipes.js +79 -52
- package/dist/retention.d.ts +4 -5
- package/dist/retention.js +5 -4
- package/dist/scope.d.ts +4 -2
- package/dist/serve.js +193 -30
- package/dist/storage.d.ts +2 -1
- package/dist/storage.js +12 -9
- package/dist/store.d.ts +11 -16
- package/dist/store.js +122 -160
- package/dist/surface.d.ts +6 -54
- package/dist/surface.js +10 -2
- package/dist/teammate-work.js +1 -1
- package/dist/telegram-flow.d.ts +41 -1
- package/dist/telegram-flow.js +96 -12
- package/dist/telegram.js +27 -3
- package/dist/toolroll-update.d.ts +8 -99
- package/dist/toolroll-update.js +28 -18
- package/dist/verification-evidence.js +27 -12
- package/package.json +1 -1
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The update journals and their small control records (docs/plans/zod-revamp.md, item 19): the desktop app's update
|
|
3
|
+
* (`desktop-update.json` and the retained `receipt.json`) and `toolroll update`'s (`toolroll-update.json`,
|
|
4
|
+
* `.last.json` and the stage's `update.json`), plus the request, stop, cancel and starting marks beside them.
|
|
5
|
+
*
|
|
6
|
+
* Every journal is Toolroll's own and carries `version: 1`, but the reader ignores keys it does not know: a rollback
|
|
7
|
+
* runs an older Toolroll against a journal a newer one wrote, and every field added since 0.8.0 was added under the
|
|
8
|
+
* same version. A newer version is refused plainly. Readers return the saved object itself once it parses, so a
|
|
9
|
+
* journal saved again keeps its keys, their order and anything a newer release added. Paths, ownership, identities
|
|
10
|
+
* and hashes are checked in plain code by the update modules after parsing, with their existing words.
|
|
11
|
+
*/
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
import { type ContractIssue } from "./contract.js";
|
|
14
|
+
/** What a reader made of a saved journal: the saved object itself, or path-named issues. */
|
|
15
|
+
export type JournalRead<T> = {
|
|
16
|
+
ok: true;
|
|
17
|
+
value: T;
|
|
18
|
+
} | {
|
|
19
|
+
ok: false;
|
|
20
|
+
issues: ContractIssue[];
|
|
21
|
+
};
|
|
22
|
+
export declare const DESKTOP_UPDATE_PHASES: readonly ["prepared", "draining", "backing-up", "stopping", "installing", "verifying", "rolling-back", "releasing", "complete", "restored", "cancelled", "needs-attention"];
|
|
23
|
+
/** An app bundle as the journal records it (`readDesktopBundle`'s identity). */
|
|
24
|
+
export declare const desktopBundleSchema: z.ZodObject<{
|
|
25
|
+
path: z.ZodString;
|
|
26
|
+
hash: z.ZodString;
|
|
27
|
+
buildId: z.ZodString;
|
|
28
|
+
version: z.ZodString;
|
|
29
|
+
bundleId: z.ZodString;
|
|
30
|
+
schemaVersion: z.ZodNumber;
|
|
31
|
+
development: z.ZodCatch<z.ZodBoolean>;
|
|
32
|
+
providerBin: z.ZodString;
|
|
33
|
+
recoveryProtocol: z.ZodExactOptional<z.ZodNumber>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
/** The keys in the order the old reader checked them, so the first issue picks the same refusal it gave. */
|
|
36
|
+
export declare const desktopUpdateJournalSchema: z.ZodObject<{
|
|
37
|
+
version: z.ZodLiteral<1>;
|
|
38
|
+
id: z.ZodString;
|
|
39
|
+
stateDir: z.ZodString;
|
|
40
|
+
workDir: z.ZodString;
|
|
41
|
+
label: z.ZodString;
|
|
42
|
+
intended: z.ZodEnum<{
|
|
43
|
+
install: "install";
|
|
44
|
+
restore: "restore";
|
|
45
|
+
}>;
|
|
46
|
+
phase: z.ZodEnum<{
|
|
47
|
+
"backing-up": "backing-up";
|
|
48
|
+
cancelled: "cancelled";
|
|
49
|
+
complete: "complete";
|
|
50
|
+
draining: "draining";
|
|
51
|
+
installing: "installing";
|
|
52
|
+
"needs-attention": "needs-attention";
|
|
53
|
+
prepared: "prepared";
|
|
54
|
+
releasing: "releasing";
|
|
55
|
+
restored: "restored";
|
|
56
|
+
"rolling-back": "rolling-back";
|
|
57
|
+
stopping: "stopping";
|
|
58
|
+
verifying: "verifying";
|
|
59
|
+
}>;
|
|
60
|
+
old: z.ZodObject<{
|
|
61
|
+
path: z.ZodString;
|
|
62
|
+
hash: z.ZodString;
|
|
63
|
+
buildId: z.ZodString;
|
|
64
|
+
version: z.ZodString;
|
|
65
|
+
bundleId: z.ZodString;
|
|
66
|
+
schemaVersion: z.ZodNumber;
|
|
67
|
+
development: z.ZodCatch<z.ZodBoolean>;
|
|
68
|
+
providerBin: z.ZodString;
|
|
69
|
+
recoveryProtocol: z.ZodExactOptional<z.ZodNumber>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
next: z.ZodObject<{
|
|
72
|
+
path: z.ZodString;
|
|
73
|
+
hash: z.ZodString;
|
|
74
|
+
buildId: z.ZodString;
|
|
75
|
+
version: z.ZodString;
|
|
76
|
+
bundleId: z.ZodString;
|
|
77
|
+
schemaVersion: z.ZodNumber;
|
|
78
|
+
development: z.ZodCatch<z.ZodBoolean>;
|
|
79
|
+
providerBin: z.ZodString;
|
|
80
|
+
recoveryProtocol: z.ZodExactOptional<z.ZodNumber>;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
databaseFile: z.ZodString;
|
|
83
|
+
configHash: z.ZodString;
|
|
84
|
+
wasRunning: z.ZodBoolean;
|
|
85
|
+
backupHash: z.ZodExactOptional<z.ZodString>;
|
|
86
|
+
backupPath: z.ZodExactOptional<z.ZodString>;
|
|
87
|
+
replacementOccurred: z.ZodExactOptional<z.ZodBoolean>;
|
|
88
|
+
codingCatalogExpected: z.ZodExactOptional<z.ZodBoolean>;
|
|
89
|
+
stoppedPids: z.ZodExactOptional<z.ZodArray<z.ZodNumber>>;
|
|
90
|
+
codingBackupPath: z.ZodExactOptional<z.ZodString>;
|
|
91
|
+
codingBackupHash: z.ZodExactOptional<z.ZodString>;
|
|
92
|
+
startedAt: z.ZodString;
|
|
93
|
+
updatedAt: z.ZodString;
|
|
94
|
+
detail: z.ZodCatch<z.ZodString>;
|
|
95
|
+
error: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
96
|
+
checkedAt: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
97
|
+
serviceInterrupted: z.ZodExactOptional<z.ZodBoolean>;
|
|
98
|
+
retryableRecovery: z.ZodExactOptional<z.ZodBoolean>;
|
|
99
|
+
waiting: z.ZodExactOptional<z.ZodObject<{
|
|
100
|
+
run: z.ZodNumber;
|
|
101
|
+
on: z.ZodString;
|
|
102
|
+
action: z.ZodNullable<z.ZodString>;
|
|
103
|
+
since: z.ZodString;
|
|
104
|
+
}, z.core.$strip>>;
|
|
105
|
+
codingOwnerReleased: z.ZodExactOptional<z.ZodObject<{
|
|
106
|
+
pid: z.ZodNumber;
|
|
107
|
+
nativePid: z.ZodNullable<z.ZodNumber>;
|
|
108
|
+
}, z.core.$strip>>;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
export type DesktopUpdateJournal = z.infer<typeof desktopUpdateJournalSchema>;
|
|
111
|
+
export type DesktopUpdatePhase = DesktopUpdateJournal["phase"];
|
|
112
|
+
export declare function readDesktopUpdateJournal(input: unknown): JournalRead<DesktopUpdateJournal>;
|
|
113
|
+
/** The automatic-recovery guardian's record (`recovery.json`) as Update status reads it: each field is used only when
|
|
114
|
+
* it has its type, as before; the guardian itself owns the full record. */
|
|
115
|
+
export declare const desktopRecoveryViewSchema: z.ZodObject<{
|
|
116
|
+
id: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
117
|
+
state: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
118
|
+
detail: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
119
|
+
attempts: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
|
|
120
|
+
repairs: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
|
|
121
|
+
updatedAt: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
export type DesktopRecoveryView = z.infer<typeof desktopRecoveryViewSchema>;
|
|
124
|
+
/** Update status's view of `recovery.json`; anything that is not an object reads as no guardian, as before. */
|
|
125
|
+
export declare function readDesktopRecoveryView(input: unknown): DesktopRecoveryView | null;
|
|
126
|
+
/** `request.json` (a restore) and `stop-request.json`, as `requestUpdateRestore` and `requestUpdateStop` write them. */
|
|
127
|
+
export declare const updateRequestSchema: z.ZodObject<{
|
|
128
|
+
id: z.ZodExactOptional<z.ZodUnknown>;
|
|
129
|
+
action: z.ZodExactOptional<z.ZodUnknown>;
|
|
130
|
+
}, z.core.$strip>;
|
|
131
|
+
/** Whether a saved request is `{ id, action }` for this update; anything else is not that request. */
|
|
132
|
+
export declare function updateRequestIs(input: unknown, id: string, action: string): boolean;
|
|
133
|
+
/** The service supervisor's status file, read for the service's process ids before a stop. */
|
|
134
|
+
export declare const supervisorPidsSchema: z.ZodObject<{
|
|
135
|
+
supervisorPid: z.ZodExactOptional<z.ZodUnknown>;
|
|
136
|
+
controllerPid: z.ZodExactOptional<z.ZodUnknown>;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
export declare function supervisorPidsOf(input: unknown): number[];
|
|
139
|
+
export declare const RUNTIME_UPDATE_STEPS: readonly ["verifying", "draining", "backing-up", "rehearsing", "switching", "restarting", "health"];
|
|
140
|
+
export declare const RUNTIME_PHASES: readonly ["scheduled", "verifying", "draining", "backing-up", "rehearsing", "switching", "restarting", "health", "complete", "rolling-back", "restored", "refused", "cancelled", "needs-attention"];
|
|
141
|
+
export declare const runtimeUpdateJournalSchema: z.ZodObject<{
|
|
142
|
+
version: z.ZodLiteral<1>;
|
|
143
|
+
id: z.ZodString;
|
|
144
|
+
stateDir: z.ZodString;
|
|
145
|
+
stageDir: z.ZodString;
|
|
146
|
+
kind: z.ZodString;
|
|
147
|
+
databaseFile: z.ZodString;
|
|
148
|
+
from: z.ZodObject<{
|
|
149
|
+
version: z.ZodString;
|
|
150
|
+
dist: z.ZodString;
|
|
151
|
+
}, z.core.$strip>;
|
|
152
|
+
to: z.ZodObject<{
|
|
153
|
+
version: z.ZodString;
|
|
154
|
+
dist: z.ZodString;
|
|
155
|
+
}, z.core.$strip>;
|
|
156
|
+
when: z.ZodString;
|
|
157
|
+
at: z.ZodNullable<z.ZodString>;
|
|
158
|
+
actor: z.ZodCatch<z.ZodString>;
|
|
159
|
+
phase: z.ZodString;
|
|
160
|
+
detail: z.ZodCatch<z.ZodString>;
|
|
161
|
+
error: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
162
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
163
|
+
phase: z.ZodString;
|
|
164
|
+
at: z.ZodString;
|
|
165
|
+
}, z.core.$strip>>;
|
|
166
|
+
startedAt: z.ZodString;
|
|
167
|
+
updatedAt: z.ZodString;
|
|
168
|
+
finishedAt: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
169
|
+
package: z.ZodExactOptional<z.ZodObject<{
|
|
170
|
+
sha512: z.ZodString;
|
|
171
|
+
repository: z.ZodString;
|
|
172
|
+
workflow: z.ZodString;
|
|
173
|
+
}, z.core.$strip>>;
|
|
174
|
+
notes: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
175
|
+
backupPath: z.ZodExactOptional<z.ZodString>;
|
|
176
|
+
backupHash: z.ZodExactOptional<z.ZodString>;
|
|
177
|
+
codingBackupPath: z.ZodExactOptional<z.ZodString>;
|
|
178
|
+
codingBackupHash: z.ZodExactOptional<z.ZodString>;
|
|
179
|
+
restoreFrom: z.ZodExactOptional<z.ZodObject<{
|
|
180
|
+
path: z.ZodString;
|
|
181
|
+
hash: z.ZodString;
|
|
182
|
+
updateId: z.ZodString;
|
|
183
|
+
codingPath: z.ZodExactOptional<z.ZodString>;
|
|
184
|
+
codingHash: z.ZodExactOptional<z.ZodString>;
|
|
185
|
+
}, z.core.$strip>>;
|
|
186
|
+
rehearsal: z.ZodExactOptional<z.ZodObject<{
|
|
187
|
+
tables: z.ZodNumber;
|
|
188
|
+
rows: z.ZodNumber;
|
|
189
|
+
}, z.core.$strip>>;
|
|
190
|
+
service: z.ZodExactOptional<z.ZodObject<{
|
|
191
|
+
unit: z.ZodString;
|
|
192
|
+
pids: z.ZodArray<z.ZodNumber>;
|
|
193
|
+
}, z.core.$strip>>;
|
|
194
|
+
watches: z.ZodExactOptional<z.ZodArray<z.ZodObject<{
|
|
195
|
+
unit: z.ZodString;
|
|
196
|
+
pids: z.ZodArray<z.ZodNumber>;
|
|
197
|
+
loaded: z.ZodExactOptional<z.ZodBoolean>;
|
|
198
|
+
}, z.core.$strip>>>;
|
|
199
|
+
switched: z.ZodExactOptional<z.ZodObject<{
|
|
200
|
+
links: z.ZodArray<z.ZodObject<{
|
|
201
|
+
path: z.ZodString;
|
|
202
|
+
previous: z.ZodString;
|
|
203
|
+
}, z.core.$strip>>;
|
|
204
|
+
unit: z.ZodNullable<z.ZodObject<{
|
|
205
|
+
path: z.ZodString;
|
|
206
|
+
saved: z.ZodString;
|
|
207
|
+
}, z.core.$strip>>;
|
|
208
|
+
watches: z.ZodExactOptional<z.ZodArray<z.ZodObject<{
|
|
209
|
+
path: z.ZodString;
|
|
210
|
+
saved: z.ZodString;
|
|
211
|
+
}, z.core.$strip>>>;
|
|
212
|
+
databaseRestored: z.ZodExactOptional<z.ZodBoolean>;
|
|
213
|
+
}, z.core.$strip>>;
|
|
214
|
+
keptAside: z.ZodExactOptional<z.ZodString>;
|
|
215
|
+
keptAsideUnreadable: z.ZodExactOptional<z.ZodBoolean>;
|
|
216
|
+
kept: z.ZodExactOptional<z.ZodArray<z.ZodObject<{
|
|
217
|
+
path: z.ZodString;
|
|
218
|
+
unreadable: z.ZodBoolean;
|
|
219
|
+
}, z.core.$strip>>>;
|
|
220
|
+
restoredDatabase: z.ZodExactOptional<z.ZodBoolean>;
|
|
221
|
+
codingOwnerReleased: z.ZodExactOptional<z.ZodObject<{
|
|
222
|
+
pid: z.ZodNumber;
|
|
223
|
+
nativePid: z.ZodNullable<z.ZodNumber>;
|
|
224
|
+
}, z.core.$strip>>;
|
|
225
|
+
seen: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
226
|
+
waiting: z.ZodExactOptional<z.ZodObject<{
|
|
227
|
+
run: z.ZodNumber;
|
|
228
|
+
on: z.ZodString;
|
|
229
|
+
action: z.ZodNullable<z.ZodString>;
|
|
230
|
+
since: z.ZodString;
|
|
231
|
+
}, z.core.$strip>>;
|
|
232
|
+
}, z.core.$strip>;
|
|
233
|
+
export type RuntimeUpdateJournalRecord = z.infer<typeof runtimeUpdateJournalSchema>;
|
|
234
|
+
export declare function readRuntimeUpdateJournal(input: unknown): JournalRead<RuntimeUpdateJournalRecord>;
|
|
235
|
+
/** `updater-starting.json`: a launched or resuming updater on its way to `id`. Only `id` and `at` are read. */
|
|
236
|
+
export declare const updaterStartingSchema: z.ZodObject<{
|
|
237
|
+
id: z.ZodExactOptional<z.ZodUnknown>;
|
|
238
|
+
state: z.ZodExactOptional<z.ZodUnknown>;
|
|
239
|
+
at: z.ZodExactOptional<z.ZodUnknown>;
|
|
240
|
+
}, z.core.$strip>;
|
|
241
|
+
/** The mark's update id and start time when it has them; a mark without them is no updater starting, as before. */
|
|
242
|
+
export declare function updaterStartingOf(input: unknown): {
|
|
243
|
+
id: unknown;
|
|
244
|
+
at: number;
|
|
245
|
+
} | null;
|
|
246
|
+
/** A staged release's `update.json` as pruning reads it: only `startedAt`, from a partial or older file alike. */
|
|
247
|
+
export declare const stagedReleaseStartSchema: z.ZodObject<{
|
|
248
|
+
startedAt: z.ZodExactOptional<z.ZodUnknown>;
|
|
249
|
+
}, z.core.$strip>;
|
|
250
|
+
/**
|
|
251
|
+
* When a staged release started, for pruning: `startedAt` as text (`""` when absent or when the file holds some other
|
|
252
|
+
* JSON value). `null` for JSON `null`, and the folder's mtime stands in, as it does for a file that is not JSON.
|
|
253
|
+
*/
|
|
254
|
+
export declare function stagedStartedAt(input: unknown): string | null;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The update journals and their small control records (docs/plans/zod-revamp.md, item 19): the desktop app's update
|
|
3
|
+
* (`desktop-update.json` and the retained `receipt.json`) and `toolroll update`'s (`toolroll-update.json`,
|
|
4
|
+
* `.last.json` and the stage's `update.json`), plus the request, stop, cancel and starting marks beside them.
|
|
5
|
+
*
|
|
6
|
+
* Every journal is Toolroll's own and carries `version: 1`, but the reader ignores keys it does not know: a rollback
|
|
7
|
+
* runs an older Toolroll against a journal a newer one wrote, and every field added since 0.8.0 was added under the
|
|
8
|
+
* same version. A newer version is refused plainly. Readers return the saved object itself once it parses, so a
|
|
9
|
+
* journal saved again keeps its keys, their order and anything a newer release added. Paths, ownership, identities
|
|
10
|
+
* and hashes are checked in plain code by the update modules after parsing, with their existing words.
|
|
11
|
+
*/
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
import { readVersioned } from "./contract.js";
|
|
14
|
+
function journalOf(schema, input) {
|
|
15
|
+
const read = readVersioned(schema, input);
|
|
16
|
+
// Catch values only let legacy-unchecked information pass validation; never apply them to the saved object.
|
|
17
|
+
// Keep its original values, key order and keys a newer release added.
|
|
18
|
+
return read.ok ? { ok: true, value: input } : read;
|
|
19
|
+
}
|
|
20
|
+
/** A finished run an update waits on (or stopped waiting on). */
|
|
21
|
+
const waitingSchema = z.object({ run: z.number(), on: z.string(), action: z.string().nullable(), since: z.string() });
|
|
22
|
+
const releasedCodingOwnerSchema = z.object({ pid: z.number(), nativePid: z.number().nullable() });
|
|
23
|
+
// ---- the desktop app's update ------------------------------------------------------------------------------------
|
|
24
|
+
export const DESKTOP_UPDATE_PHASES = ["prepared", "draining", "backing-up", "stopping", "installing", "verifying", "rolling-back", "releasing", "complete", "restored", "cancelled", "needs-attention"];
|
|
25
|
+
/** An app bundle as the journal records it (`readDesktopBundle`'s identity). */
|
|
26
|
+
export const desktopBundleSchema = z.object({
|
|
27
|
+
path: z.string(), hash: z.string(), buildId: z.string(), version: z.string(), bundleId: z.string(),
|
|
28
|
+
schemaVersion: z.number(), development: z.boolean().catch(false), providerBin: z.string(), recoveryProtocol: z.number().exactOptional(),
|
|
29
|
+
});
|
|
30
|
+
/** The keys in the order the old reader checked them, so the first issue picks the same refusal it gave. */
|
|
31
|
+
export const desktopUpdateJournalSchema = z.object({
|
|
32
|
+
version: z.literal(1),
|
|
33
|
+
id: z.string(), stateDir: z.string(), workDir: z.string(), label: z.string(),
|
|
34
|
+
intended: z.enum(["install", "restore"]), phase: z.enum(DESKTOP_UPDATE_PHASES),
|
|
35
|
+
old: desktopBundleSchema, next: desktopBundleSchema,
|
|
36
|
+
databaseFile: z.string(), configHash: z.string(), wasRunning: z.boolean(),
|
|
37
|
+
backupHash: z.string().exactOptional(), backupPath: z.string().exactOptional(),
|
|
38
|
+
replacementOccurred: z.boolean().exactOptional(),
|
|
39
|
+
codingCatalogExpected: z.boolean().exactOptional(),
|
|
40
|
+
stoppedPids: z.array(z.number()).exactOptional(),
|
|
41
|
+
codingBackupPath: z.string().exactOptional(), codingBackupHash: z.string().exactOptional(),
|
|
42
|
+
startedAt: z.string(), updatedAt: z.string(), detail: z.string().catch(""),
|
|
43
|
+
error: z.string().optional().catch(undefined), checkedAt: z.string().optional().catch(undefined),
|
|
44
|
+
serviceInterrupted: z.boolean().exactOptional(),
|
|
45
|
+
retryableRecovery: z.boolean().exactOptional(),
|
|
46
|
+
/** The finished run the update is waiting on (or stopped waiting on). Absent while it waits on ordinary work. */
|
|
47
|
+
waiting: waitingSchema.exactOptional(),
|
|
48
|
+
/** A stale coding owner record this update released after proving those processes gone. */
|
|
49
|
+
codingOwnerReleased: releasedCodingOwnerSchema.exactOptional(),
|
|
50
|
+
});
|
|
51
|
+
export function readDesktopUpdateJournal(input) {
|
|
52
|
+
return journalOf(desktopUpdateJournalSchema, input);
|
|
53
|
+
}
|
|
54
|
+
/** The automatic-recovery guardian's record (`recovery.json`) as Update status reads it: each field is used only when
|
|
55
|
+
* it has its type, as before; the guardian itself owns the full record. */
|
|
56
|
+
export const desktopRecoveryViewSchema = z.object({
|
|
57
|
+
id: z.string().optional().catch(undefined), state: z.string().optional().catch(undefined), detail: z.string().optional().catch(undefined),
|
|
58
|
+
attempts: z.number().optional().catch(undefined), repairs: z.number().optional().catch(undefined), updatedAt: z.string().optional().catch(undefined),
|
|
59
|
+
});
|
|
60
|
+
/** Update status's view of `recovery.json`; anything that is not an object reads as no guardian, as before. */
|
|
61
|
+
export function readDesktopRecoveryView(input) {
|
|
62
|
+
const read = desktopRecoveryViewSchema.safeParse(input);
|
|
63
|
+
return read.success ? read.data : null;
|
|
64
|
+
}
|
|
65
|
+
/** `request.json` (a restore) and `stop-request.json`, as `requestUpdateRestore` and `requestUpdateStop` write them. */
|
|
66
|
+
export const updateRequestSchema = z.object({ id: z.unknown().exactOptional(), action: z.unknown().exactOptional() });
|
|
67
|
+
/** Whether a saved request is `{ id, action }` for this update; anything else is not that request. */
|
|
68
|
+
export function updateRequestIs(input, id, action) {
|
|
69
|
+
const read = updateRequestSchema.safeParse(input);
|
|
70
|
+
return read.success && read.data.id === id && read.data.action === action;
|
|
71
|
+
}
|
|
72
|
+
/** The service supervisor's status file, read for the service's process ids before a stop. */
|
|
73
|
+
export const supervisorPidsSchema = z.object({ supervisorPid: z.unknown().exactOptional(), controllerPid: z.unknown().exactOptional() });
|
|
74
|
+
export function supervisorPidsOf(input) {
|
|
75
|
+
const read = supervisorPidsSchema.safeParse(input);
|
|
76
|
+
if (!read.success)
|
|
77
|
+
return [];
|
|
78
|
+
return [read.data.supervisorPid, read.data.controllerPid].filter((pid) => Number.isSafeInteger(pid) && Number(pid) > 1);
|
|
79
|
+
}
|
|
80
|
+
// ---- toolroll update ---------------------------------------------------------------------------------------------
|
|
81
|
+
export const RUNTIME_UPDATE_STEPS = ["verifying", "draining", "backing-up", "rehearsing", "switching", "restarting", "health"];
|
|
82
|
+
export const RUNTIME_PHASES = ["scheduled", ...RUNTIME_UPDATE_STEPS, "complete", "rolling-back", "restored", "refused", "cancelled", "needs-attention"];
|
|
83
|
+
const runtimeRefSchema = z.object({ version: z.string(), dist: z.string() });
|
|
84
|
+
const unitSchema = z.object({ unit: z.string(), pids: z.array(z.number()) });
|
|
85
|
+
const savedFileSchema = z.object({ path: z.string(), saved: z.string() });
|
|
86
|
+
export const runtimeUpdateJournalSchema = z.object({
|
|
87
|
+
version: z.literal(1),
|
|
88
|
+
id: z.string(), stateDir: z.string(), stageDir: z.string(),
|
|
89
|
+
kind: z.string(),
|
|
90
|
+
databaseFile: z.string(),
|
|
91
|
+
from: runtimeRefSchema, to: runtimeRefSchema,
|
|
92
|
+
when: z.string(), at: z.string().nullable(), actor: z.string().catch(""),
|
|
93
|
+
phase: z.string(), detail: z.string().catch(""), error: z.string().optional().catch(undefined),
|
|
94
|
+
steps: z.array(z.object({ phase: z.string(), at: z.string() })),
|
|
95
|
+
startedAt: z.string(), updatedAt: z.string(), finishedAt: z.string().optional().catch(undefined),
|
|
96
|
+
package: z.object({ sha512: z.string(), repository: z.string(), workflow: z.string() }).exactOptional(),
|
|
97
|
+
notes: z.array(z.string()).optional().catch(undefined),
|
|
98
|
+
/** This run's own verified copies of the live database and coding catalog: what a failure restores. */
|
|
99
|
+
backupPath: z.string().exactOptional(), backupHash: z.string().exactOptional(),
|
|
100
|
+
codingBackupPath: z.string().exactOptional(), codingBackupHash: z.string().exactOptional(),
|
|
101
|
+
/** A rollback installs the update's earlier backups (checked against their recorded hashes). */
|
|
102
|
+
restoreFrom: z.object({ path: z.string(), hash: z.string(), updateId: z.string(), codingPath: z.string().exactOptional(), codingHash: z.string().exactOptional() }).exactOptional(),
|
|
103
|
+
rehearsal: z.object({ tables: z.number(), rows: z.number() }).exactOptional(),
|
|
104
|
+
/** The background service, recorded before it is stopped: its definition and the processes that must be gone. */
|
|
105
|
+
service: unitSchema.exactOptional(),
|
|
106
|
+
/** Each repo's watch daemon that runs this version, recorded the same way: switched with the service, and stopped and
|
|
107
|
+
* restarted with it only when launchd had it loaded before the update (`loaded` absent: 0.8.1 stopped every one). */
|
|
108
|
+
watches: z.array(unitSchema.extend({ loaded: z.boolean().exactOptional() })).exactOptional(),
|
|
109
|
+
/** Recorded before each change so a resumed or failed run knows what to put back. */
|
|
110
|
+
switched: z.object({
|
|
111
|
+
links: z.array(z.object({ path: z.string(), previous: z.string() })),
|
|
112
|
+
unit: savedFileSchema.nullable(),
|
|
113
|
+
watches: z.array(savedFileSchema).exactOptional(),
|
|
114
|
+
databaseRestored: z.boolean().exactOptional(),
|
|
115
|
+
}).exactOptional(),
|
|
116
|
+
/** What the live database held when a failed run restored its backup: nothing written is lost. The newest of `kept`. */
|
|
117
|
+
keptAside: z.string().exactOptional(),
|
|
118
|
+
/** The live database could not be read, so it was moved aside whole rather than copied. */
|
|
119
|
+
keptAsideUnreadable: z.boolean().exactOptional(),
|
|
120
|
+
/** Every copy kept aside, oldest first: a retried restore adds one and never drops the pointer to an earlier one. */
|
|
121
|
+
kept: z.array(z.object({ path: z.string(), unreadable: z.boolean() })).exactOptional(),
|
|
122
|
+
/** The restore put the backup back: a retried restore never puts it back again (what was written since belongs to
|
|
123
|
+
* the restored version and would be lost), and it keeps a fresh copy aside before every attempt until then. */
|
|
124
|
+
restoredDatabase: z.boolean().exactOptional(),
|
|
125
|
+
/** A stale coding owner record this run released after proving its processes gone. */
|
|
126
|
+
codingOwnerReleased: releasedCodingOwnerSchema.exactOptional(),
|
|
127
|
+
seen: z.boolean().optional().catch(undefined),
|
|
128
|
+
/** The finished run the update is waiting on (or stopped waiting on): what is in the way and the command that
|
|
129
|
+
* clears it. Absent while it waits on ordinary running work. */
|
|
130
|
+
waiting: waitingSchema.exactOptional(),
|
|
131
|
+
});
|
|
132
|
+
export function readRuntimeUpdateJournal(input) {
|
|
133
|
+
return journalOf(runtimeUpdateJournalSchema, input);
|
|
134
|
+
}
|
|
135
|
+
/** `updater-starting.json`: a launched or resuming updater on its way to `id`. Only `id` and `at` are read. */
|
|
136
|
+
export const updaterStartingSchema = z.object({ id: z.unknown().exactOptional(), state: z.unknown().exactOptional(), at: z.unknown().exactOptional() });
|
|
137
|
+
/** The mark's update id and start time when it has them; a mark without them is no updater starting, as before. */
|
|
138
|
+
export function updaterStartingOf(input) {
|
|
139
|
+
const read = updaterStartingSchema.safeParse(input);
|
|
140
|
+
if (!read.success)
|
|
141
|
+
return null;
|
|
142
|
+
return { id: read.data.id, at: Date.parse(typeof read.data.at === "string" ? read.data.at : String(read.data.at ?? "")) };
|
|
143
|
+
}
|
|
144
|
+
/** A staged release's `update.json` as pruning reads it: only `startedAt`, from a partial or older file alike. */
|
|
145
|
+
export const stagedReleaseStartSchema = z.object({ startedAt: z.unknown().exactOptional() });
|
|
146
|
+
/**
|
|
147
|
+
* When a staged release started, for pruning: `startedAt` as text (`""` when absent or when the file holds some other
|
|
148
|
+
* JSON value). `null` for JSON `null`, and the folder's mtime stands in, as it does for a file that is not JSON.
|
|
149
|
+
*/
|
|
150
|
+
export function stagedStartedAt(input) {
|
|
151
|
+
const read = stagedReleaseStartSchema.safeParse(input);
|
|
152
|
+
if (read.success)
|
|
153
|
+
return String(read.data.startedAt ?? "");
|
|
154
|
+
return input === null || input === undefined ? null : "";
|
|
155
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The gate view `verificationEvidence` returns as `bytes`: a sealed receipt exactly as sealed (either version), or,
|
|
3
|
+
* for a run from before receipts, the view of its legacy machine log header. Reused gates, failed-check repair and
|
|
4
|
+
* saved assessments read a view back through `readVerificationView`.
|
|
5
|
+
*
|
|
6
|
+
* A legacy view is built by Toolroll from the run's single-attempt log header (the "check log metadata"), its
|
|
7
|
+
* approved command and its candidate inventory; it is never saved, so its schema is strict. A sealed receipt is read
|
|
8
|
+
* by the receipt's own contract.
|
|
9
|
+
*/
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
import { type ContractResult } from "./contract.js";
|
|
12
|
+
import { type VerificationReceipt } from "./verification-receipt.js";
|
|
13
|
+
export declare const LEGACY_GATE_SOURCE = "legacy machine log header";
|
|
14
|
+
export declare const legacyGateViewSchema: z.ZodObject<{
|
|
15
|
+
version: z.ZodLiteral<1>;
|
|
16
|
+
source: z.ZodLiteral<"legacy machine log header">;
|
|
17
|
+
run: z.ZodInt;
|
|
18
|
+
head: z.ZodString;
|
|
19
|
+
base: z.ZodNullable<z.ZodString>;
|
|
20
|
+
scopeDigest: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
|
+
command: z.ZodObject<{
|
|
22
|
+
id: z.ZodInt;
|
|
23
|
+
repo: z.ZodString;
|
|
24
|
+
command: z.ZodString;
|
|
25
|
+
timeoutMs: z.ZodInt;
|
|
26
|
+
digest: z.ZodString;
|
|
27
|
+
recoverySetupDigest: z.ZodNullable<z.ZodString>;
|
|
28
|
+
approvedBy: z.ZodString;
|
|
29
|
+
approvedAt: z.ZodString;
|
|
30
|
+
revokedAt: z.ZodNullable<z.ZodString>;
|
|
31
|
+
revokedBy: z.ZodNullable<z.ZodString>;
|
|
32
|
+
}, z.core.$strict>;
|
|
33
|
+
result: z.ZodUnion<readonly [z.ZodObject<{
|
|
34
|
+
configured: z.ZodLiteral<false>;
|
|
35
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
36
|
+
configured: z.ZodLiteral<true>;
|
|
37
|
+
ran: z.ZodLiteral<false>;
|
|
38
|
+
attemptFailed: z.ZodLiteral<true>;
|
|
39
|
+
failure: z.ZodOptional<z.ZodEnum<{
|
|
40
|
+
"checkout-moved": "checkout-moved";
|
|
41
|
+
"cleanliness-unavailable": "cleanliness-unavailable";
|
|
42
|
+
"custody-lost": "custody-lost";
|
|
43
|
+
"dependency-missing": "dependency-missing";
|
|
44
|
+
"dependency-still-missing": "dependency-still-missing";
|
|
45
|
+
"own-install-failed": "own-install-failed";
|
|
46
|
+
"retry-spawn-failed": "retry-spawn-failed";
|
|
47
|
+
"retry-timed-out": "retry-timed-out";
|
|
48
|
+
"setup-changed-files": "setup-changed-files";
|
|
49
|
+
"setup-failed": "setup-failed";
|
|
50
|
+
"setup-stale": "setup-stale";
|
|
51
|
+
"spawn-failed": "spawn-failed";
|
|
52
|
+
"timed-out": "timed-out";
|
|
53
|
+
"tracked-files-changed": "tracked-files-changed";
|
|
54
|
+
}>>;
|
|
55
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
56
|
+
configured: z.ZodLiteral<true>;
|
|
57
|
+
ran: z.ZodLiteral<true>;
|
|
58
|
+
exitCode: z.ZodInt;
|
|
59
|
+
setupReplayed: z.ZodOptional<z.ZodLiteral<true>>;
|
|
60
|
+
}, z.core.$strict>]>;
|
|
61
|
+
log: z.ZodObject<{
|
|
62
|
+
artifactId: z.ZodInt;
|
|
63
|
+
sha256: z.ZodString;
|
|
64
|
+
bytesStored: z.ZodInt;
|
|
65
|
+
bytesOriginal: z.ZodInt;
|
|
66
|
+
truncated: z.ZodBoolean;
|
|
67
|
+
redacted: z.ZodBoolean;
|
|
68
|
+
captureStatus: z.ZodNullable<z.ZodEnum<{
|
|
69
|
+
failed: "failed";
|
|
70
|
+
ok: "ok";
|
|
71
|
+
}>>;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
candidate: z.ZodObject<{
|
|
74
|
+
artifactId: z.ZodInt;
|
|
75
|
+
sha256: z.ZodString;
|
|
76
|
+
bytesStored: z.ZodInt;
|
|
77
|
+
bytesOriginal: z.ZodInt;
|
|
78
|
+
truncated: z.ZodBoolean;
|
|
79
|
+
redacted: z.ZodBoolean;
|
|
80
|
+
captureStatus: z.ZodNullable<z.ZodEnum<{
|
|
81
|
+
failed: "failed";
|
|
82
|
+
ok: "ok";
|
|
83
|
+
}>>;
|
|
84
|
+
}, z.core.$strict>;
|
|
85
|
+
}, z.core.$strict>;
|
|
86
|
+
export type LegacyGateView = z.infer<typeof legacyGateViewSchema>;
|
|
87
|
+
/** What every view carries. */
|
|
88
|
+
export type VerificationView = Pick<VerificationReceipt, "run" | "head" | "base" | "scopeDigest" | "command" | "result" | "log">;
|
|
89
|
+
/**
|
|
90
|
+
* Read a view's bytes. The value is the object as written, once its shape is checked: its key order is part of what a
|
|
91
|
+
* reused gate compares and seals again.
|
|
92
|
+
*/
|
|
93
|
+
export declare function readVerificationView(bytes: string): ContractResult<VerificationView>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The gate view `verificationEvidence` returns as `bytes`: a sealed receipt exactly as sealed (either version), or,
|
|
3
|
+
* for a run from before receipts, the view of its legacy machine log header. Reused gates, failed-check repair and
|
|
4
|
+
* saved assessments read a view back through `readVerificationView`.
|
|
5
|
+
*
|
|
6
|
+
* A legacy view is built by Toolroll from the run's single-attempt log header (the "check log metadata"), its
|
|
7
|
+
* approved command and its candidate inventory; it is never saved, so its schema is strict. A sealed receipt is read
|
|
8
|
+
* by the receipt's own contract.
|
|
9
|
+
*/
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
import { parseContract } from "./contract.js";
|
|
12
|
+
import { readVerificationReceipt, receiptCommandSchema, receiptLogSchema, verifyCommandFactsSchema } from "./verification-receipt.js";
|
|
13
|
+
export const LEGACY_GATE_SOURCE = "legacy machine log header";
|
|
14
|
+
export const legacyGateViewSchema = z.strictObject({
|
|
15
|
+
version: z.literal(1),
|
|
16
|
+
source: z.literal(LEGACY_GATE_SOURCE),
|
|
17
|
+
run: z.int(),
|
|
18
|
+
head: z.string(),
|
|
19
|
+
base: z.string().nullable(),
|
|
20
|
+
/** Left out of the bytes when the run never recorded one. */
|
|
21
|
+
scopeDigest: z.string().nullable().optional(),
|
|
22
|
+
command: receiptCommandSchema,
|
|
23
|
+
result: verifyCommandFactsSchema,
|
|
24
|
+
log: receiptLogSchema,
|
|
25
|
+
/** The diff-stat artifact whose endpoints bound the candidate. */
|
|
26
|
+
candidate: receiptLogSchema,
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Read a view's bytes. The value is the object as written, once its shape is checked: its key order is part of what a
|
|
30
|
+
* reused gate compares and seals again.
|
|
31
|
+
*/
|
|
32
|
+
export function readVerificationView(bytes) {
|
|
33
|
+
let input;
|
|
34
|
+
try {
|
|
35
|
+
input = JSON.parse(bytes);
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return { ok: false, issues: [{ path: "payload", kind: "wrong-type", line: "payload: is not JSON" }] };
|
|
39
|
+
}
|
|
40
|
+
const legacy = typeof input === "object" && input !== null && input.source !== undefined;
|
|
41
|
+
const read = legacy ? parseContract(legacyGateViewSchema, input) : readVerificationReceipt(input);
|
|
42
|
+
return read.ok ? { ok: true, value: input } : read;
|
|
43
|
+
}
|
package/dist/control-setup.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare function previewSetup(store: Store, repo: string, inputs: SetupIn
|
|
|
19
19
|
fingerprint: string;
|
|
20
20
|
command: string;
|
|
21
21
|
seconds: number;
|
|
22
|
-
provider:
|
|
22
|
+
provider: "claude" | "codex" | "gemini" | "openrouter";
|
|
23
23
|
model: string;
|
|
24
24
|
};
|
|
25
25
|
export declare function approveSetup(store: Store, repo: string, inputs: SetupInputs, fingerprint: string, by: string, token: string, now: Date): {
|
package/dist/desktop-update.d.ts
CHANGED
|
@@ -1,42 +1,9 @@
|
|
|
1
1
|
import type { DatabaseSync } from "node:sqlite";
|
|
2
2
|
import { type DesktopBundle } from "./desktop-bundle.js";
|
|
3
|
-
import { type
|
|
4
|
-
type Phase =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
id: string;
|
|
8
|
-
stateDir: string;
|
|
9
|
-
workDir: string;
|
|
10
|
-
label: string;
|
|
11
|
-
databaseFile: string;
|
|
12
|
-
configHash: string;
|
|
13
|
-
old: DesktopBundle;
|
|
14
|
-
next: DesktopBundle;
|
|
15
|
-
phase: Phase;
|
|
16
|
-
intended: "install" | "restore";
|
|
17
|
-
startedAt: string;
|
|
18
|
-
updatedAt: string;
|
|
19
|
-
wasRunning: boolean;
|
|
20
|
-
backupHash?: string;
|
|
21
|
-
backupPath?: string;
|
|
22
|
-
codingBackupPath?: string;
|
|
23
|
-
codingBackupHash?: string;
|
|
24
|
-
codingCatalogExpected?: boolean;
|
|
25
|
-
detail: string;
|
|
26
|
-
error?: string;
|
|
27
|
-
checkedAt?: string;
|
|
28
|
-
serviceInterrupted?: boolean;
|
|
29
|
-
replacementOccurred?: boolean;
|
|
30
|
-
retryableRecovery?: boolean;
|
|
31
|
-
/** The finished run the update is waiting on (or stopped waiting on). Absent while it waits on ordinary work. */
|
|
32
|
-
waiting?: LingeringRun & {
|
|
33
|
-
since: string;
|
|
34
|
-
};
|
|
35
|
-
/** The service's supervisor and controller, recorded before it is stopped: the processes proved gone afterwards. */
|
|
36
|
-
stoppedPids?: number[];
|
|
37
|
-
/** A stale coding owner record this update released after proving those processes gone. */
|
|
38
|
-
codingOwnerReleased?: ReleasedCodingOwner;
|
|
39
|
-
};
|
|
3
|
+
import { type DesktopUpdateJournal, type DesktopUpdatePhase } from "./contracts/update-journal.js";
|
|
4
|
+
type Phase = DesktopUpdatePhase;
|
|
5
|
+
/** The update's journal (`desktop-update.json`, and `receipt.json` in its folder): src/contracts/update-journal.ts. */
|
|
6
|
+
export type UpdateJournal = DesktopUpdateJournal;
|
|
40
7
|
type ServiceState = {
|
|
41
8
|
state: string;
|
|
42
9
|
stale?: boolean;
|
|
@@ -125,25 +92,25 @@ export declare function prepareDesktopUpdate(stateDir: string, installed: string
|
|
|
125
92
|
export declare function sqliteLock(file: string, busyTimeoutMs?: number): DatabaseSync | null;
|
|
126
93
|
export declare const installationLock: (j: UpdateJournal) => DatabaseSync | null;
|
|
127
94
|
export declare function desktopUpdateStatus(stateDir: string): {
|
|
128
|
-
|
|
95
|
+
error?: never;
|
|
129
96
|
active: boolean;
|
|
130
97
|
phase: string;
|
|
131
98
|
detail: string;
|
|
132
99
|
running: boolean;
|
|
133
100
|
canResume: boolean;
|
|
134
101
|
canCancel: boolean;
|
|
135
|
-
error?: never;
|
|
136
102
|
automaticRecovery?: never;
|
|
137
103
|
recoveryAttempts?: never;
|
|
138
104
|
recoveryRepairs?: never;
|
|
139
105
|
wasRunning?: never;
|
|
140
106
|
backupPath?: never;
|
|
141
107
|
updateId?: never;
|
|
108
|
+
version?: never;
|
|
142
109
|
buildId?: never;
|
|
143
110
|
workDir?: never;
|
|
144
111
|
} | {
|
|
145
112
|
active: boolean;
|
|
146
|
-
phase:
|
|
113
|
+
phase: "backing-up" | "cancelled" | "complete" | "draining" | "installing" | "needs-attention" | "prepared" | "releasing" | "restored" | "rolling-back" | "stopping" | "verifying";
|
|
147
114
|
detail: string;
|
|
148
115
|
error: string | null;
|
|
149
116
|
running: boolean;
|