@phren/cli 0.3.79 → 0.3.81

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.
Files changed (37) hide show
  1. package/dist/bridge/dispatch.js +17 -3
  2. package/dist/bridge/housekeeping/command.d.ts +5 -0
  3. package/dist/bridge/housekeeping/command.js +106 -0
  4. package/dist/bridge/housekeeping/housekeeper.d.ts +123 -0
  5. package/dist/bridge/housekeeping/housekeeper.js +459 -0
  6. package/dist/bridge/housekeeping/inventory.d.ts +145 -0
  7. package/dist/bridge/housekeeping/inventory.js +276 -0
  8. package/dist/bridge/housekeeping/report.d.ts +672 -0
  9. package/dist/bridge/housekeeping/report.js +168 -0
  10. package/dist/bridge/housekeeping/safety.d.ts +177 -0
  11. package/dist/bridge/housekeeping/safety.js +466 -0
  12. package/dist/bridge/owner-proof.js +1 -0
  13. package/dist/bridge/push.js +3 -1
  14. package/dist/bridge/resources.d.ts +8 -0
  15. package/dist/bridge/resources.js +18 -5
  16. package/dist/bridge/server-pane-routes.d.ts +6 -0
  17. package/dist/bridge/server-pane-routes.js +1 -1
  18. package/dist/bridge/server-routes.d.ts +5 -0
  19. package/dist/bridge/server-routes.js +44 -3
  20. package/dist/bridge/server.js +44 -8
  21. package/dist/bridge-hook.mjs +2982 -1226
  22. package/dist/cli-registry.js +18 -1
  23. package/dist/fanout/command.js +42 -15
  24. package/dist/heavy/budget-status.d.ts +26 -0
  25. package/dist/heavy/budget-status.js +26 -0
  26. package/dist/heavy/budget.d.ts +39 -0
  27. package/dist/heavy/budget.js +57 -0
  28. package/dist/heavy/command.d.ts +15 -0
  29. package/dist/heavy/command.js +119 -0
  30. package/dist/heavy/reap.d.ts +70 -0
  31. package/dist/heavy/reap.js +211 -0
  32. package/dist/heavy/slots.d.ts +58 -0
  33. package/dist/heavy/slots.js +142 -0
  34. package/dist/modules/registry.js +5 -4
  35. package/package.json +1 -1
  36. package/starter/global/skills/conductor/SKILL.md +10 -0
  37. package/starter/global/skills/fanout/SKILL.md +30 -0
@@ -0,0 +1,672 @@
1
+ import { z } from "zod";
2
+ import type { ComputerResources } from "../resources.js";
3
+ import type { Blocker } from "./safety.js";
4
+ /**
5
+ * The housekeeping report. A pass produces a stored report (every item it
6
+ * found, with its section); `GET /v1/housekeeping` serves a view of it shaped
7
+ * for the phone (warnings, suggestions, kept, cleaned), minus dismissed items.
8
+ * The view's schema below is the contract: docs/housekeeping.md documents it,
9
+ * fixtures/conformance/housekeeping-*.json exercise it, and the apps decode
10
+ * those fixtures. Add fields freely; change or remove one only with `schema` + 1.
11
+ */
12
+ export declare const SCHEMA = 1;
13
+ export declare const AREAS: readonly ["memory", "disk", "sessions", "worktrees", "simulators", "docker"];
14
+ export type Area = typeof AREAS[number];
15
+ export type ItemKind = "cache" | "worktree" | "tmp" | "pane" | "job" | "simulator" | "docker" | "health";
16
+ export type Severity = "info" | "warn" | "high";
17
+ export type Trigger = "tick" | "low-disk" | "high-load" | "manual" | "approve";
18
+ export type ActionKind = "delete-path" | "remove-worktree" | "close-pane" | "end-job" | "shutdown-simulator" | "delete-simulator" | "prune-docker-builder";
19
+ /** warning: an observation; suggestion: needs the owner; kept: a safety rule holds it; auto: the Hook does it itself. */
20
+ export type Section = "warning" | "suggestion" | "kept" | "auto";
21
+ declare const paneSchema: z.ZodObject<{
22
+ target: z.ZodObject<{
23
+ server: z.ZodString;
24
+ workspace: z.ZodOptional<z.ZodString>;
25
+ tab: z.ZodOptional<z.ZodString>;
26
+ pane: z.ZodString;
27
+ }, z.core.$loose>;
28
+ label: z.ZodOptional<z.ZodString>;
29
+ }, z.core.$strip>;
30
+ declare const targetSchema: z.ZodObject<{
31
+ path: z.ZodOptional<z.ZodString>;
32
+ repo: z.ZodOptional<z.ZodString>;
33
+ branch: z.ZodOptional<z.ZodString>;
34
+ pid: z.ZodOptional<z.ZodNumber>;
35
+ udid: z.ZodOptional<z.ZodString>;
36
+ name: z.ZodOptional<z.ZodString>;
37
+ }, z.core.$strip>;
38
+ export declare const warningSchema: z.ZodObject<{
39
+ id: z.ZodString;
40
+ area: z.ZodEnum<{
41
+ disk: "disk";
42
+ docker: "docker";
43
+ memory: "memory";
44
+ sessions: "sessions";
45
+ simulators: "simulators";
46
+ worktrees: "worktrees";
47
+ }>;
48
+ severity: z.ZodEnum<{
49
+ high: "high";
50
+ info: "info";
51
+ warn: "warn";
52
+ }>;
53
+ title: z.ZodString;
54
+ detail: z.ZodString;
55
+ since: z.ZodString;
56
+ fix: z.ZodOptional<z.ZodString>;
57
+ pane: z.ZodOptional<z.ZodObject<{
58
+ target: z.ZodObject<{
59
+ server: z.ZodString;
60
+ workspace: z.ZodOptional<z.ZodString>;
61
+ tab: z.ZodOptional<z.ZodString>;
62
+ pane: z.ZodString;
63
+ }, z.core.$loose>;
64
+ label: z.ZodOptional<z.ZodString>;
65
+ }, z.core.$strip>>;
66
+ session: z.ZodOptional<z.ZodString>;
67
+ dispatch: z.ZodOptional<z.ZodString>;
68
+ notify: z.ZodOptional<z.ZodBoolean>;
69
+ }, z.core.$strip>;
70
+ export declare const suggestionSchema: z.ZodObject<{
71
+ id: z.ZodString;
72
+ area: z.ZodEnum<{
73
+ disk: "disk";
74
+ docker: "docker";
75
+ memory: "memory";
76
+ sessions: "sessions";
77
+ simulators: "simulators";
78
+ worktrees: "worktrees";
79
+ }>;
80
+ kind: z.ZodString;
81
+ title: z.ZodString;
82
+ target: z.ZodObject<{
83
+ path: z.ZodOptional<z.ZodString>;
84
+ repo: z.ZodOptional<z.ZodString>;
85
+ branch: z.ZodOptional<z.ZodString>;
86
+ pid: z.ZodOptional<z.ZodNumber>;
87
+ udid: z.ZodOptional<z.ZodString>;
88
+ name: z.ZodOptional<z.ZodString>;
89
+ }, z.core.$strip>;
90
+ reason: z.ZodString;
91
+ evidence: z.ZodArray<z.ZodString>;
92
+ sizeBytes: z.ZodOptional<z.ZodNumber>;
93
+ actionLabel: z.ZodString;
94
+ since: z.ZodString;
95
+ pane: z.ZodOptional<z.ZodObject<{
96
+ target: z.ZodObject<{
97
+ server: z.ZodString;
98
+ workspace: z.ZodOptional<z.ZodString>;
99
+ tab: z.ZodOptional<z.ZodString>;
100
+ pane: z.ZodString;
101
+ }, z.core.$loose>;
102
+ label: z.ZodOptional<z.ZodString>;
103
+ }, z.core.$strip>>;
104
+ session: z.ZodOptional<z.ZodString>;
105
+ dispatch: z.ZodOptional<z.ZodString>;
106
+ }, z.core.$strip>;
107
+ export declare const keptSchema: z.ZodObject<{
108
+ id: z.ZodString;
109
+ area: z.ZodEnum<{
110
+ disk: "disk";
111
+ docker: "docker";
112
+ memory: "memory";
113
+ sessions: "sessions";
114
+ simulators: "simulators";
115
+ worktrees: "worktrees";
116
+ }>;
117
+ title: z.ZodString;
118
+ target: z.ZodObject<{
119
+ path: z.ZodOptional<z.ZodString>;
120
+ repo: z.ZodOptional<z.ZodString>;
121
+ branch: z.ZodOptional<z.ZodString>;
122
+ pid: z.ZodOptional<z.ZodNumber>;
123
+ udid: z.ZodOptional<z.ZodString>;
124
+ name: z.ZodOptional<z.ZodString>;
125
+ }, z.core.$strip>;
126
+ reason: z.ZodString;
127
+ }, z.core.$strip>;
128
+ export declare const cleanedSchema: z.ZodObject<{
129
+ id: z.ZodString;
130
+ at: z.ZodString;
131
+ area: z.ZodEnum<{
132
+ disk: "disk";
133
+ docker: "docker";
134
+ memory: "memory";
135
+ sessions: "sessions";
136
+ simulators: "simulators";
137
+ worktrees: "worktrees";
138
+ }>;
139
+ kind: z.ZodString;
140
+ title: z.ZodString;
141
+ target: z.ZodObject<{
142
+ path: z.ZodOptional<z.ZodString>;
143
+ repo: z.ZodOptional<z.ZodString>;
144
+ branch: z.ZodOptional<z.ZodString>;
145
+ pid: z.ZodOptional<z.ZodNumber>;
146
+ udid: z.ZodOptional<z.ZodString>;
147
+ name: z.ZodOptional<z.ZodString>;
148
+ }, z.core.$strip>;
149
+ freedBytes: z.ZodNumber;
150
+ reportedBytes: z.ZodOptional<z.ZodNumber>;
151
+ by: z.ZodEnum<{
152
+ auto: "auto";
153
+ cli: "cli";
154
+ conductor: "conductor";
155
+ phone: "phone";
156
+ }>;
157
+ }, z.core.$strip>;
158
+ export declare const dismissedSchema: z.ZodObject<{
159
+ id: z.ZodString;
160
+ section: z.ZodEnum<{
161
+ kept: "kept";
162
+ suggestions: "suggestions";
163
+ warnings: "warnings";
164
+ }>;
165
+ area: z.ZodEnum<{
166
+ disk: "disk";
167
+ docker: "docker";
168
+ memory: "memory";
169
+ sessions: "sessions";
170
+ simulators: "simulators";
171
+ worktrees: "worktrees";
172
+ }>;
173
+ title: z.ZodString;
174
+ dismissedAt: z.ZodString;
175
+ }, z.core.$strip>;
176
+ /** Everything on the computer the owner may handle, with `?inventory=1` (inventory.ts). */
177
+ export declare const inventorySchema: z.ZodObject<{
178
+ collectedAt: z.ZodString;
179
+ durationMs: z.ZodNumber;
180
+ scanning: z.ZodOptional<z.ZodBoolean>;
181
+ stale: z.ZodOptional<z.ZodBoolean>;
182
+ worktrees: z.ZodArray<z.ZodObject<{
183
+ id: z.ZodString;
184
+ repo: z.ZodString;
185
+ branch: z.ZodOptional<z.ZodString>;
186
+ path: z.ZodString;
187
+ main: z.ZodBoolean;
188
+ sizeBytes: z.ZodOptional<z.ZodNumber>;
189
+ lastCommitAt: z.ZodOptional<z.ZodString>;
190
+ dirty: z.ZodNumber;
191
+ untracked: z.ZodNumber;
192
+ unpushed: z.ZodNumber;
193
+ stashes: z.ZodNumber;
194
+ inProgress: z.ZodOptional<z.ZodString>;
195
+ locked: z.ZodOptional<z.ZodLiteral<true>>;
196
+ sessions: z.ZodArray<z.ZodObject<{
197
+ pane: z.ZodObject<{
198
+ target: z.ZodObject<{
199
+ server: z.ZodString;
200
+ workspace: z.ZodOptional<z.ZodString>;
201
+ tab: z.ZodOptional<z.ZodString>;
202
+ pane: z.ZodString;
203
+ }, z.core.$loose>;
204
+ label: z.ZodOptional<z.ZodString>;
205
+ }, z.core.$strip>;
206
+ agent: z.ZodOptional<z.ZodString>;
207
+ title: z.ZodOptional<z.ZodString>;
208
+ }, z.core.$strip>>;
209
+ processes: z.ZodArray<z.ZodObject<{
210
+ pid: z.ZodNumber;
211
+ command: z.ZodOptional<z.ZodString>;
212
+ }, z.core.$strip>>;
213
+ action: z.ZodObject<{
214
+ id: z.ZodString;
215
+ kind: z.ZodString;
216
+ label: z.ZodString;
217
+ allowed: z.ZodBoolean;
218
+ reason: z.ZodOptional<z.ZodString>;
219
+ confirm: z.ZodOptional<z.ZodString>;
220
+ }, z.core.$strip>;
221
+ }, z.core.$strip>>;
222
+ space: z.ZodArray<z.ZodObject<{
223
+ id: z.ZodString;
224
+ area: z.ZodEnum<{
225
+ disk: "disk";
226
+ docker: "docker";
227
+ memory: "memory";
228
+ sessions: "sessions";
229
+ simulators: "simulators";
230
+ worktrees: "worktrees";
231
+ }>;
232
+ kind: z.ZodString;
233
+ title: z.ZodString;
234
+ path: z.ZodOptional<z.ZodString>;
235
+ udid: z.ZodOptional<z.ZodString>;
236
+ sizeBytes: z.ZodNumber;
237
+ lastUsedAt: z.ZodOptional<z.ZodString>;
238
+ inUse: z.ZodOptional<z.ZodString>;
239
+ note: z.ZodOptional<z.ZodString>;
240
+ action: z.ZodOptional<z.ZodObject<{
241
+ id: z.ZodString;
242
+ kind: z.ZodString;
243
+ label: z.ZodString;
244
+ allowed: z.ZodBoolean;
245
+ reason: z.ZodOptional<z.ZodString>;
246
+ confirm: z.ZodOptional<z.ZodString>;
247
+ }, z.core.$strip>>;
248
+ }, z.core.$strip>>;
249
+ sessions: z.ZodArray<z.ZodObject<{
250
+ id: z.ZodString;
251
+ pane: z.ZodObject<{
252
+ target: z.ZodObject<{
253
+ server: z.ZodString;
254
+ workspace: z.ZodOptional<z.ZodString>;
255
+ tab: z.ZodOptional<z.ZodString>;
256
+ pane: z.ZodString;
257
+ }, z.core.$loose>;
258
+ label: z.ZodOptional<z.ZodString>;
259
+ }, z.core.$strip>;
260
+ agent: z.ZodOptional<z.ZodString>;
261
+ title: z.ZodOptional<z.ZodString>;
262
+ project: z.ZodOptional<z.ZodString>;
263
+ status: z.ZodOptional<z.ZodString>;
264
+ idleSeconds: z.ZodOptional<z.ZodNumber>;
265
+ cwd: z.ZodOptional<z.ZodString>;
266
+ dispatch: z.ZodOptional<z.ZodString>;
267
+ role: z.ZodOptional<z.ZodString>;
268
+ receipt: z.ZodOptional<z.ZodObject<{
269
+ id: z.ZodString;
270
+ returnRead: z.ZodBoolean;
271
+ }, z.core.$strip>>;
272
+ action: z.ZodObject<{
273
+ id: z.ZodString;
274
+ kind: z.ZodString;
275
+ label: z.ZodString;
276
+ allowed: z.ZodBoolean;
277
+ reason: z.ZodOptional<z.ZodString>;
278
+ confirm: z.ZodOptional<z.ZodString>;
279
+ }, z.core.$strip>;
280
+ }, z.core.$strip>>;
281
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
282
+ check: z.ZodString;
283
+ message: z.ZodString;
284
+ }, z.core.$strip>>>;
285
+ }, z.core.$strip>;
286
+ export declare const viewSchema: z.ZodObject<{
287
+ computer: z.ZodOptional<z.ZodObject<{
288
+ id: z.ZodString;
289
+ name: z.ZodString;
290
+ aliases: z.ZodArray<z.ZodString>;
291
+ }, z.core.$strip>>;
292
+ schema: z.ZodLiteral<1>;
293
+ revision: z.ZodString;
294
+ generatedAt: z.ZodString;
295
+ nextCheckAt: z.ZodOptional<z.ZodString>;
296
+ health: z.ZodObject<{
297
+ load1: z.ZodNumber;
298
+ cores: z.ZodNumber;
299
+ memoryUsedBytes: z.ZodNumber;
300
+ memoryTotalBytes: z.ZodNumber;
301
+ memoryPressure: z.ZodEnum<{
302
+ critical: "critical";
303
+ normal: "normal";
304
+ warn: "warn";
305
+ }>;
306
+ diskFreeBytes: z.ZodNumber;
307
+ diskTotalBytes: z.ZodNumber;
308
+ tmpBytes: z.ZodOptional<z.ZodNumber>;
309
+ }, z.core.$strip>;
310
+ warnings: z.ZodArray<z.ZodObject<{
311
+ id: z.ZodString;
312
+ area: z.ZodEnum<{
313
+ disk: "disk";
314
+ docker: "docker";
315
+ memory: "memory";
316
+ sessions: "sessions";
317
+ simulators: "simulators";
318
+ worktrees: "worktrees";
319
+ }>;
320
+ severity: z.ZodEnum<{
321
+ high: "high";
322
+ info: "info";
323
+ warn: "warn";
324
+ }>;
325
+ title: z.ZodString;
326
+ detail: z.ZodString;
327
+ since: z.ZodString;
328
+ fix: z.ZodOptional<z.ZodString>;
329
+ pane: z.ZodOptional<z.ZodObject<{
330
+ target: z.ZodObject<{
331
+ server: z.ZodString;
332
+ workspace: z.ZodOptional<z.ZodString>;
333
+ tab: z.ZodOptional<z.ZodString>;
334
+ pane: z.ZodString;
335
+ }, z.core.$loose>;
336
+ label: z.ZodOptional<z.ZodString>;
337
+ }, z.core.$strip>>;
338
+ session: z.ZodOptional<z.ZodString>;
339
+ dispatch: z.ZodOptional<z.ZodString>;
340
+ notify: z.ZodOptional<z.ZodBoolean>;
341
+ }, z.core.$strip>>;
342
+ suggestions: z.ZodArray<z.ZodObject<{
343
+ id: z.ZodString;
344
+ area: z.ZodEnum<{
345
+ disk: "disk";
346
+ docker: "docker";
347
+ memory: "memory";
348
+ sessions: "sessions";
349
+ simulators: "simulators";
350
+ worktrees: "worktrees";
351
+ }>;
352
+ kind: z.ZodString;
353
+ title: z.ZodString;
354
+ target: z.ZodObject<{
355
+ path: z.ZodOptional<z.ZodString>;
356
+ repo: z.ZodOptional<z.ZodString>;
357
+ branch: z.ZodOptional<z.ZodString>;
358
+ pid: z.ZodOptional<z.ZodNumber>;
359
+ udid: z.ZodOptional<z.ZodString>;
360
+ name: z.ZodOptional<z.ZodString>;
361
+ }, z.core.$strip>;
362
+ reason: z.ZodString;
363
+ evidence: z.ZodArray<z.ZodString>;
364
+ sizeBytes: z.ZodOptional<z.ZodNumber>;
365
+ actionLabel: z.ZodString;
366
+ since: z.ZodString;
367
+ pane: z.ZodOptional<z.ZodObject<{
368
+ target: z.ZodObject<{
369
+ server: z.ZodString;
370
+ workspace: z.ZodOptional<z.ZodString>;
371
+ tab: z.ZodOptional<z.ZodString>;
372
+ pane: z.ZodString;
373
+ }, z.core.$loose>;
374
+ label: z.ZodOptional<z.ZodString>;
375
+ }, z.core.$strip>>;
376
+ session: z.ZodOptional<z.ZodString>;
377
+ dispatch: z.ZodOptional<z.ZodString>;
378
+ }, z.core.$strip>>;
379
+ kept: z.ZodArray<z.ZodObject<{
380
+ id: z.ZodString;
381
+ area: z.ZodEnum<{
382
+ disk: "disk";
383
+ docker: "docker";
384
+ memory: "memory";
385
+ sessions: "sessions";
386
+ simulators: "simulators";
387
+ worktrees: "worktrees";
388
+ }>;
389
+ title: z.ZodString;
390
+ target: z.ZodObject<{
391
+ path: z.ZodOptional<z.ZodString>;
392
+ repo: z.ZodOptional<z.ZodString>;
393
+ branch: z.ZodOptional<z.ZodString>;
394
+ pid: z.ZodOptional<z.ZodNumber>;
395
+ udid: z.ZodOptional<z.ZodString>;
396
+ name: z.ZodOptional<z.ZodString>;
397
+ }, z.core.$strip>;
398
+ reason: z.ZodString;
399
+ }, z.core.$strip>>;
400
+ cleaned: z.ZodArray<z.ZodObject<{
401
+ id: z.ZodString;
402
+ at: z.ZodString;
403
+ area: z.ZodEnum<{
404
+ disk: "disk";
405
+ docker: "docker";
406
+ memory: "memory";
407
+ sessions: "sessions";
408
+ simulators: "simulators";
409
+ worktrees: "worktrees";
410
+ }>;
411
+ kind: z.ZodString;
412
+ title: z.ZodString;
413
+ target: z.ZodObject<{
414
+ path: z.ZodOptional<z.ZodString>;
415
+ repo: z.ZodOptional<z.ZodString>;
416
+ branch: z.ZodOptional<z.ZodString>;
417
+ pid: z.ZodOptional<z.ZodNumber>;
418
+ udid: z.ZodOptional<z.ZodString>;
419
+ name: z.ZodOptional<z.ZodString>;
420
+ }, z.core.$strip>;
421
+ freedBytes: z.ZodNumber;
422
+ reportedBytes: z.ZodOptional<z.ZodNumber>;
423
+ by: z.ZodEnum<{
424
+ auto: "auto";
425
+ cli: "cli";
426
+ conductor: "conductor";
427
+ phone: "phone";
428
+ }>;
429
+ }, z.core.$strip>>;
430
+ dismissed: z.ZodOptional<z.ZodArray<z.ZodObject<{
431
+ id: z.ZodString;
432
+ section: z.ZodEnum<{
433
+ kept: "kept";
434
+ suggestions: "suggestions";
435
+ warnings: "warnings";
436
+ }>;
437
+ area: z.ZodEnum<{
438
+ disk: "disk";
439
+ docker: "docker";
440
+ memory: "memory";
441
+ sessions: "sessions";
442
+ simulators: "simulators";
443
+ worktrees: "worktrees";
444
+ }>;
445
+ title: z.ZodString;
446
+ dismissedAt: z.ZodString;
447
+ }, z.core.$strip>>>;
448
+ inventory: z.ZodOptional<z.ZodObject<{
449
+ collectedAt: z.ZodString;
450
+ durationMs: z.ZodNumber;
451
+ scanning: z.ZodOptional<z.ZodBoolean>;
452
+ stale: z.ZodOptional<z.ZodBoolean>;
453
+ worktrees: z.ZodArray<z.ZodObject<{
454
+ id: z.ZodString;
455
+ repo: z.ZodString;
456
+ branch: z.ZodOptional<z.ZodString>;
457
+ path: z.ZodString;
458
+ main: z.ZodBoolean;
459
+ sizeBytes: z.ZodOptional<z.ZodNumber>;
460
+ lastCommitAt: z.ZodOptional<z.ZodString>;
461
+ dirty: z.ZodNumber;
462
+ untracked: z.ZodNumber;
463
+ unpushed: z.ZodNumber;
464
+ stashes: z.ZodNumber;
465
+ inProgress: z.ZodOptional<z.ZodString>;
466
+ locked: z.ZodOptional<z.ZodLiteral<true>>;
467
+ sessions: z.ZodArray<z.ZodObject<{
468
+ pane: z.ZodObject<{
469
+ target: z.ZodObject<{
470
+ server: z.ZodString;
471
+ workspace: z.ZodOptional<z.ZodString>;
472
+ tab: z.ZodOptional<z.ZodString>;
473
+ pane: z.ZodString;
474
+ }, z.core.$loose>;
475
+ label: z.ZodOptional<z.ZodString>;
476
+ }, z.core.$strip>;
477
+ agent: z.ZodOptional<z.ZodString>;
478
+ title: z.ZodOptional<z.ZodString>;
479
+ }, z.core.$strip>>;
480
+ processes: z.ZodArray<z.ZodObject<{
481
+ pid: z.ZodNumber;
482
+ command: z.ZodOptional<z.ZodString>;
483
+ }, z.core.$strip>>;
484
+ action: z.ZodObject<{
485
+ id: z.ZodString;
486
+ kind: z.ZodString;
487
+ label: z.ZodString;
488
+ allowed: z.ZodBoolean;
489
+ reason: z.ZodOptional<z.ZodString>;
490
+ confirm: z.ZodOptional<z.ZodString>;
491
+ }, z.core.$strip>;
492
+ }, z.core.$strip>>;
493
+ space: z.ZodArray<z.ZodObject<{
494
+ id: z.ZodString;
495
+ area: z.ZodEnum<{
496
+ disk: "disk";
497
+ docker: "docker";
498
+ memory: "memory";
499
+ sessions: "sessions";
500
+ simulators: "simulators";
501
+ worktrees: "worktrees";
502
+ }>;
503
+ kind: z.ZodString;
504
+ title: z.ZodString;
505
+ path: z.ZodOptional<z.ZodString>;
506
+ udid: z.ZodOptional<z.ZodString>;
507
+ sizeBytes: z.ZodNumber;
508
+ lastUsedAt: z.ZodOptional<z.ZodString>;
509
+ inUse: z.ZodOptional<z.ZodString>;
510
+ note: z.ZodOptional<z.ZodString>;
511
+ action: z.ZodOptional<z.ZodObject<{
512
+ id: z.ZodString;
513
+ kind: z.ZodString;
514
+ label: z.ZodString;
515
+ allowed: z.ZodBoolean;
516
+ reason: z.ZodOptional<z.ZodString>;
517
+ confirm: z.ZodOptional<z.ZodString>;
518
+ }, z.core.$strip>>;
519
+ }, z.core.$strip>>;
520
+ sessions: z.ZodArray<z.ZodObject<{
521
+ id: z.ZodString;
522
+ pane: z.ZodObject<{
523
+ target: z.ZodObject<{
524
+ server: z.ZodString;
525
+ workspace: z.ZodOptional<z.ZodString>;
526
+ tab: z.ZodOptional<z.ZodString>;
527
+ pane: z.ZodString;
528
+ }, z.core.$loose>;
529
+ label: z.ZodOptional<z.ZodString>;
530
+ }, z.core.$strip>;
531
+ agent: z.ZodOptional<z.ZodString>;
532
+ title: z.ZodOptional<z.ZodString>;
533
+ project: z.ZodOptional<z.ZodString>;
534
+ status: z.ZodOptional<z.ZodString>;
535
+ idleSeconds: z.ZodOptional<z.ZodNumber>;
536
+ cwd: z.ZodOptional<z.ZodString>;
537
+ dispatch: z.ZodOptional<z.ZodString>;
538
+ role: z.ZodOptional<z.ZodString>;
539
+ receipt: z.ZodOptional<z.ZodObject<{
540
+ id: z.ZodString;
541
+ returnRead: z.ZodBoolean;
542
+ }, z.core.$strip>>;
543
+ action: z.ZodObject<{
544
+ id: z.ZodString;
545
+ kind: z.ZodString;
546
+ label: z.ZodString;
547
+ allowed: z.ZodBoolean;
548
+ reason: z.ZodOptional<z.ZodString>;
549
+ confirm: z.ZodOptional<z.ZodString>;
550
+ }, z.core.$strip>;
551
+ }, z.core.$strip>>;
552
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
553
+ check: z.ZodString;
554
+ message: z.ZodString;
555
+ }, z.core.$strip>>>;
556
+ }, z.core.$strip>>;
557
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
558
+ check: z.ZodString;
559
+ message: z.ZodString;
560
+ }, z.core.$strip>>>;
561
+ }, z.core.$strip>;
562
+ export declare const approveResultSchema: z.ZodObject<{
563
+ results: z.ZodArray<z.ZodObject<{
564
+ id: z.ZodString;
565
+ status: z.ZodEnum<{
566
+ done: "done";
567
+ failed: "failed";
568
+ gone: "gone";
569
+ refused: "refused";
570
+ started: "started";
571
+ }>;
572
+ reason: z.ZodOptional<z.ZodString>;
573
+ freedBytes: z.ZodOptional<z.ZodNumber>;
574
+ }, z.core.$strip>>;
575
+ revision: z.ZodString;
576
+ }, z.core.$strip>;
577
+ export declare const badgeSchema: z.ZodObject<{
578
+ revision: z.ZodString;
579
+ warnings: z.ZodNumber;
580
+ suggestions: z.ZodNumber;
581
+ worst: z.ZodNullable<z.ZodEnum<{
582
+ high: "high";
583
+ info: "info";
584
+ warn: "warn";
585
+ }>>;
586
+ freedTodayBytes: z.ZodNumber;
587
+ }, z.core.$strip>;
588
+ export type HousekeepingView = z.infer<typeof viewSchema>;
589
+ export type Warning = z.infer<typeof warningSchema>;
590
+ export type Suggestion = z.infer<typeof suggestionSchema>;
591
+ export type Kept = z.infer<typeof keptSchema>;
592
+ export type Cleaned = z.infer<typeof cleanedSchema>;
593
+ export type ApproveResult = z.infer<typeof approveResultSchema>;
594
+ export type Badge = z.infer<typeof badgeSchema>;
595
+ export type InventoryView = z.infer<typeof inventorySchema>;
596
+ export type ItemTarget = z.infer<typeof targetSchema>;
597
+ export type PaneLink = z.infer<typeof paneSchema>;
598
+ /** What a check proposes. */
599
+ export interface ItemDraft {
600
+ section: Section;
601
+ area: Area;
602
+ kind: ItemKind;
603
+ title: string;
604
+ /** Plain sentence: why (a suggestion's or kept item's reason, a warning's detail). */
605
+ reason: string;
606
+ target: ItemTarget;
607
+ /** The state that, when it changes, makes this a new item (new id, dismissal lapses). */
608
+ fingerprint: string;
609
+ /** A fixed id (machine-health findings keep theirs); otherwise derived from kind, target and fingerprint. */
610
+ id?: string;
611
+ severity?: Severity;
612
+ fix?: string;
613
+ evidence?: string[];
614
+ sizeBytes?: number;
615
+ action?: ActionKind;
616
+ actionLabel?: string;
617
+ blockers?: Blocker[];
618
+ notify?: boolean;
619
+ pane?: PaneLink;
620
+ session?: string;
621
+ dispatch?: string;
622
+ }
623
+ export interface StoredItem extends ItemDraft {
624
+ id: string;
625
+ since: string;
626
+ }
627
+ export interface StoredReport {
628
+ version: 1;
629
+ id: string;
630
+ computer: string;
631
+ generatedAt: string;
632
+ trigger: Trigger;
633
+ durationMs: number;
634
+ health: HousekeepingView["health"];
635
+ items: StoredItem[];
636
+ errors?: Array<{
637
+ check: string;
638
+ message: string;
639
+ }>;
640
+ }
641
+ export declare function itemId(kind: ItemKind, target: ItemTarget, fingerprint: string): string;
642
+ /** Only a cache may be cleaned without the owner; anything else proposing `auto` becomes a suggestion. */
643
+ export declare function clampSection(kind: ItemKind, section: Section): Section;
644
+ export declare function healthOf(resources: ComputerResources): HousekeepingView["health"];
645
+ export declare function buildReport(input: {
646
+ computer: string;
647
+ trigger: Trigger;
648
+ startedAt: number;
649
+ finishedAt: number;
650
+ drafts: ItemDraft[];
651
+ previous?: StoredReport;
652
+ health: HousekeepingView["health"];
653
+ errors?: StoredReport["errors"];
654
+ }): StoredReport;
655
+ /** The phone's view: dismissed items left out (listed when asked), cleaned from the log, a revision over all of it. */
656
+ export declare function viewOf(report: StoredReport, options: {
657
+ cleaned: Cleaned[];
658
+ dismissed: Map<string, {
659
+ fingerprint: string;
660
+ at: string;
661
+ }>;
662
+ includeDismissed?: boolean;
663
+ nextCheckAt?: string;
664
+ inventory?: {
665
+ collectedAt: string;
666
+ scanning?: boolean;
667
+ ids: string[];
668
+ };
669
+ include?: InventoryView;
670
+ }): HousekeepingView;
671
+ export declare function badgeOf(view: HousekeepingView, now: number): Badge;
672
+ export {};