@stitchmux/client 0.0.0-stage → 0.96.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.
Files changed (103) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +45 -2
  3. package/dist/chunk-szdg2ww3.js +714 -0
  4. package/dist/index.js +4070 -0
  5. package/dist/monitoring.js +279 -0
  6. package/native-stream.json +8 -0
  7. package/package.json +36 -4
  8. package/types/src/agent/claude/native/commandSchema.d.ts +14 -0
  9. package/types/src/agent/custom/config.d.ts +159 -0
  10. package/types/src/agent/custom/endpoint.d.ts +26 -0
  11. package/types/src/agent/transcript/messageSchema.d.ts +153 -0
  12. package/types/src/attachments/reference.d.ts +56 -0
  13. package/types/src/attachments/schema.d.ts +512 -0
  14. package/types/src/chat/communicationAuthorizationSchema.d.ts +77 -0
  15. package/types/src/chat/communicationReceiptSchema.d.ts +82 -0
  16. package/types/src/chat/feedSchema.d.ts +641 -0
  17. package/types/src/chat/holdKind.d.ts +26 -0
  18. package/types/src/chat/identity.d.ts +55 -0
  19. package/types/src/chat/identitySchema.d.ts +121 -0
  20. package/types/src/chat/letterRequestSchema.d.ts +35 -0
  21. package/types/src/chat/messageOperationSchema.d.ts +277 -0
  22. package/types/src/chat/messageSchema.d.ts +284 -0
  23. package/types/src/chat/originSchema.d.ts +67 -0
  24. package/types/src/chat/sentLetterSchema.d.ts +79 -0
  25. package/types/src/client.d.ts +16 -0
  26. package/types/src/config/claudeProfileSchema.d.ts +22 -0
  27. package/types/src/config/launchSchema.d.ts +136 -0
  28. package/types/src/config/location.d.ts +6 -0
  29. package/types/src/config/machineSchema.d.ts +320 -0
  30. package/types/src/config/modelSelectionFlags.d.ts +4 -0
  31. package/types/src/config/paths.d.ts +87 -0
  32. package/types/src/config/remoteTransport.d.ts +12 -0
  33. package/types/src/content/schema.d.ts +312 -0
  34. package/types/src/content/toolSchema.d.ts +36 -0
  35. package/types/src/context/corpusSearchSchema.d.ts +578 -0
  36. package/types/src/context/exactMessageSchema.d.ts +54 -0
  37. package/types/src/context/messageSenderSchema.d.ts +14 -0
  38. package/types/src/context/schema.d.ts +176 -0
  39. package/types/src/context/searchFrames.d.ts +225 -0
  40. package/types/src/context/searchRequestSchema.d.ts +47 -0
  41. package/types/src/context/transcriptJsonSchema.d.ts +210 -0
  42. package/types/src/control/schema/context.d.ts +188 -0
  43. package/types/src/control/schema/contract.d.ts +7142 -0
  44. package/types/src/control/schema/core.d.ts +722 -0
  45. package/types/src/control/schema/directory.d.ts +34 -0
  46. package/types/src/control/schema/eventsContract.d.ts +1423 -0
  47. package/types/src/control/schema/externalList.d.ts +96 -0
  48. package/types/src/control/schema/message.d.ts +280 -0
  49. package/types/src/control/schema/model.d.ts +128 -0
  50. package/types/src/control/schema/native.d.ts +664 -0
  51. package/types/src/control/schema/nativeStreamContract.d.ts +155 -0
  52. package/types/src/control/schema/performance.d.ts +85 -0
  53. package/types/src/control/schema/public.d.ts +48 -0
  54. package/types/src/control/schema/reading.d.ts +24 -0
  55. package/types/src/control/schema/refusals.d.ts +433 -0
  56. package/types/src/control/schema/runtimeOps.d.ts +724 -0
  57. package/types/src/control/schema/searchContract.d.ts +258 -0
  58. package/types/src/control/schema/selection.d.ts +124 -0
  59. package/types/src/control/schema/session.d.ts +272 -0
  60. package/types/src/control/schema/terminalPrompt.d.ts +102 -0
  61. package/types/src/control/transport/boundary.d.ts +7137 -0
  62. package/types/src/control/transport/client.d.ts +10838 -0
  63. package/types/src/control/transport/connection.d.ts +13 -0
  64. package/types/src/control/transport/socketPath.d.ts +3 -0
  65. package/types/src/control-client.d.ts +9 -0
  66. package/types/src/delegation/applicationSchema.d.ts +132 -0
  67. package/types/src/delegation/schema.d.ts +267 -0
  68. package/types/src/events/schema.d.ts +155 -0
  69. package/types/src/external/contentSchema.d.ts +145 -0
  70. package/types/src/external/messageSchema.d.ts +131 -0
  71. package/types/src/external/residentFrames.d.ts +130 -0
  72. package/types/src/external/residentSchema.d.ts +144 -0
  73. package/types/src/external/sessionSchema.d.ts +427 -0
  74. package/types/src/external/turnSchema.d.ts +55 -0
  75. package/types/src/fleet/fleetSchema.d.ts +937 -0
  76. package/types/src/inventory/listSchema.d.ts +442 -0
  77. package/types/src/monitoring/nativeFile.d.ts +7 -0
  78. package/types/src/monitoring/nativeRead.d.ts +14 -0
  79. package/types/src/monitoring/performanceSchema.d.ts +28 -0
  80. package/types/src/monitoring/schema.d.ts +410 -0
  81. package/types/src/monitoring/validate.d.ts +5 -0
  82. package/types/src/monitoring-reader.d.ts +4 -0
  83. package/types/src/policy/reference.d.ts +93 -0
  84. package/types/src/policy/runtimeProfile.d.ts +24 -0
  85. package/types/src/policy/schema.d.ts +177 -0
  86. package/types/src/runtime/capabilities.d.ts +124 -0
  87. package/types/src/runtime/modes.d.ts +47 -0
  88. package/types/src/runtime/permissionScope.d.ts +22 -0
  89. package/types/src/runtime/planLimitsSchema.d.ts +55 -0
  90. package/types/src/runtime/projectionSchema.d.ts +539 -0
  91. package/types/src/runtime/rewindSchema.d.ts +16 -0
  92. package/types/src/runtime/selectionSchema.d.ts +158 -0
  93. package/types/src/runtime/workloadContract.d.ts +55 -0
  94. package/types/src/session/boundary.d.ts +43 -0
  95. package/types/src/session/identitySchema.d.ts +353 -0
  96. package/types/src/session/schema.d.ts +341 -0
  97. package/types/src/session/sleep/schema.d.ts +283 -0
  98. package/types/src/steering/schema.d.ts +197 -0
  99. package/types/src/types.d.ts +48 -0
  100. package/types/src/usage/schema.d.ts +978 -0
  101. package/types/src/util/home.d.ts +9 -0
  102. package/types/src/util/preview.d.ts +13 -0
  103. package/types/src/util/version.d.ts +3 -0
@@ -0,0 +1,410 @@
1
+ import { z } from 'zod';
2
+ export declare const STATUS_MAX_ITEMS = 256;
3
+ export declare const STATUS_MAX_BYTES: number;
4
+ export declare const STATUS_MAX_AGE_MS = 10000;
5
+ export declare const STATUS_INTERVAL_MS = 2000;
6
+ export declare const MonitoringStepSchema: z.ZodObject<{
7
+ kind: z.ZodString;
8
+ role: z.ZodString;
9
+ toolName: z.ZodNullable<z.ZodString>;
10
+ at: z.ZodNullable<z.ZodString>;
11
+ }, z.core.$strip>;
12
+ export type MonitoringStep = z.infer<typeof MonitoringStepSchema>;
13
+ /**
14
+ * One managed session row in protocol-1 `monitoring-status.json`, as the daemon writes it.
15
+ *
16
+ * The snapshot is data two versions read on a live node: the installed daemon writes it, and a
17
+ * consumer reads it with the reader it bundled at its own release (ADR
18
+ * `docs/decisions/2026-11-27-monitoring-snapshot-read-tolerance.md`). So there are two schemas. This
19
+ * one is the producer's: every field it always writes is required, and the producer checks its own
20
+ * rows against it. `MonitoringRowReadSchema` below is the consumer's, tolerant where a newer or
21
+ * older producer may differ and strict everywhere else.
22
+ */
23
+ export declare const MonitoringRowSchema: z.ZodObject<{
24
+ plane: z.ZodLiteral<"managed">;
25
+ name: z.ZodString;
26
+ agent: z.ZodEnum<{
27
+ antigravity: "antigravity";
28
+ claude: "claude";
29
+ codex: "codex";
30
+ custom: "custom";
31
+ opencode: "opencode";
32
+ }>;
33
+ uuid: z.ZodUUID;
34
+ rc: z.ZodString;
35
+ address: z.ZodString;
36
+ dir: z.ZodString;
37
+ archived: z.ZodBoolean;
38
+ running: z.ZodBoolean;
39
+ state: z.ZodEnum<{
40
+ blocked: "blocked";
41
+ idle: "idle";
42
+ prompt: "prompt";
43
+ stopped: "stopped";
44
+ unknown: "unknown";
45
+ working: "working";
46
+ }>;
47
+ model: z.ZodNullable<z.ZodString>;
48
+ contextPercent: z.ZodNullable<z.ZodNumber>;
49
+ statusLineRendersPerMinute: z.ZodNullable<z.ZodNumber>;
50
+ uptimeSeconds: z.ZodNullable<z.ZodNumber>;
51
+ startedAt: z.ZodNullable<z.ZodISODateTime>;
52
+ lastActivityAt: z.ZodNullable<z.ZodISODateTime>;
53
+ turnStartedAt: z.ZodNullable<z.ZodISODateTime>;
54
+ step: z.ZodNullable<z.ZodObject<{
55
+ kind: z.ZodString;
56
+ role: z.ZodString;
57
+ toolName: z.ZodNullable<z.ZodString>;
58
+ at: z.ZodNullable<z.ZodString>;
59
+ }, z.core.$strip>>;
60
+ atPrompt: z.ZodNullable<z.ZodString>;
61
+ waitingFor: z.ZodNullable<z.ZodString>;
62
+ sleeping: z.ZodBoolean;
63
+ pinned: z.ZodBoolean;
64
+ memoryBytes: z.ZodNullable<z.ZodNumber>;
65
+ registrationGeneration: z.ZodNullable<z.ZodUUID>;
66
+ boundary: z.ZodNullable<z.ZodObject<{
67
+ unit: z.ZodNullable<z.ZodString>;
68
+ roots: z.ZodArray<z.ZodObject<{
69
+ pid: z.ZodNumber;
70
+ instance: z.ZodNullable<z.ZodObject<{
71
+ platform: z.ZodEnum<{
72
+ darwin: "darwin";
73
+ linux: "linux";
74
+ }>;
75
+ bootId: z.ZodString;
76
+ namespace: z.ZodString;
77
+ startId: z.ZodString;
78
+ }, z.core.$strict>>;
79
+ }, z.core.$strip>>;
80
+ }, z.core.$strict>>;
81
+ observedAt: z.ZodISODateTime;
82
+ }, z.core.$strip>;
83
+ export type MonitoringRow = z.infer<typeof MonitoringRowSchema>;
84
+ /**
85
+ * A row as a consumer reads it from a producer of any protocol-1 version. A `state` or `agent` the
86
+ * reader does not know reads as `unknown`; a field the reader does not know is dropped; a field a
87
+ * producer added after protocol 1 may be absent. Identities, timestamps and bounds stay strict: a
88
+ * row that breaks them is not a newer row, it is a broken one.
89
+ */
90
+ export declare const MonitoringRowReadSchema: z.ZodObject<{
91
+ plane: z.ZodLiteral<"managed">;
92
+ name: z.ZodString;
93
+ uuid: z.ZodUUID;
94
+ rc: z.ZodString;
95
+ address: z.ZodString;
96
+ dir: z.ZodString;
97
+ archived: z.ZodBoolean;
98
+ running: z.ZodBoolean;
99
+ model: z.ZodNullable<z.ZodString>;
100
+ contextPercent: z.ZodNullable<z.ZodNumber>;
101
+ statusLineRendersPerMinute: z.ZodNullable<z.ZodNumber>;
102
+ uptimeSeconds: z.ZodNullable<z.ZodNumber>;
103
+ lastActivityAt: z.ZodNullable<z.ZodISODateTime>;
104
+ turnStartedAt: z.ZodNullable<z.ZodISODateTime>;
105
+ observedAt: z.ZodISODateTime;
106
+ agent: z.ZodCatch<z.ZodUnion<readonly [z.ZodEnum<{
107
+ antigravity: "antigravity";
108
+ claude: "claude";
109
+ codex: "codex";
110
+ custom: "custom";
111
+ opencode: "opencode";
112
+ }>, z.ZodLiteral<"unknown">]>>;
113
+ state: z.ZodCatch<z.ZodEnum<{
114
+ blocked: "blocked";
115
+ idle: "idle";
116
+ prompt: "prompt";
117
+ stopped: "stopped";
118
+ unknown: "unknown";
119
+ working: "working";
120
+ }>>;
121
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
122
+ step: z.ZodOptional<z.ZodNullable<z.ZodObject<{
123
+ kind: z.ZodString;
124
+ role: z.ZodString;
125
+ toolName: z.ZodNullable<z.ZodString>;
126
+ at: z.ZodNullable<z.ZodString>;
127
+ }, z.core.$strip>>>;
128
+ atPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
129
+ waitingFor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
130
+ sleeping: z.ZodOptional<z.ZodBoolean>;
131
+ pinned: z.ZodOptional<z.ZodBoolean>;
132
+ memoryBytes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
133
+ registrationGeneration: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
134
+ boundary: z.ZodOptional<z.ZodNullable<z.ZodObject<{
135
+ unit: z.ZodNullable<z.ZodString>;
136
+ roots: z.ZodArray<z.ZodObject<{
137
+ pid: z.ZodNumber;
138
+ instance: z.ZodNullable<z.ZodObject<{
139
+ platform: z.ZodEnum<{
140
+ darwin: "darwin";
141
+ linux: "linux";
142
+ }>;
143
+ bootId: z.ZodString;
144
+ namespace: z.ZodString;
145
+ startId: z.ZodString;
146
+ }, z.core.$strict>>;
147
+ }, z.core.$strip>>;
148
+ }, z.core.$strict>>>;
149
+ }, z.core.$strip>;
150
+ export type MonitoringRowRead = z.infer<typeof MonitoringRowReadSchema>;
151
+ export declare const MonitoringSnapshotSchema: z.ZodObject<{
152
+ protocol: z.ZodLiteral<1>;
153
+ version: z.ZodString;
154
+ generation: z.ZodUUID;
155
+ sequence: z.ZodNumber;
156
+ pid: z.ZodNumber;
157
+ rcPrefix: z.ZodString;
158
+ scope: z.ZodLiteral<"managed">;
159
+ observedAt: z.ZodISODateTime;
160
+ generatedAt: z.ZodISODateTime;
161
+ refreshDurationMs: z.ZodNumber;
162
+ maxAgeMs: z.ZodLiteral<10000>;
163
+ limits: z.ZodObject<{
164
+ items: z.ZodLiteral<256>;
165
+ bytes: z.ZodLiteral<number>;
166
+ }, z.core.$strict>;
167
+ omitted: z.ZodNumber;
168
+ sessions: z.ZodArray<z.ZodObject<{
169
+ plane: z.ZodLiteral<"managed">;
170
+ name: z.ZodString;
171
+ agent: z.ZodEnum<{
172
+ antigravity: "antigravity";
173
+ claude: "claude";
174
+ codex: "codex";
175
+ custom: "custom";
176
+ opencode: "opencode";
177
+ }>;
178
+ uuid: z.ZodUUID;
179
+ rc: z.ZodString;
180
+ address: z.ZodString;
181
+ dir: z.ZodString;
182
+ archived: z.ZodBoolean;
183
+ running: z.ZodBoolean;
184
+ state: z.ZodEnum<{
185
+ blocked: "blocked";
186
+ idle: "idle";
187
+ prompt: "prompt";
188
+ stopped: "stopped";
189
+ unknown: "unknown";
190
+ working: "working";
191
+ }>;
192
+ model: z.ZodNullable<z.ZodString>;
193
+ contextPercent: z.ZodNullable<z.ZodNumber>;
194
+ statusLineRendersPerMinute: z.ZodNullable<z.ZodNumber>;
195
+ uptimeSeconds: z.ZodNullable<z.ZodNumber>;
196
+ startedAt: z.ZodNullable<z.ZodISODateTime>;
197
+ lastActivityAt: z.ZodNullable<z.ZodISODateTime>;
198
+ turnStartedAt: z.ZodNullable<z.ZodISODateTime>;
199
+ step: z.ZodNullable<z.ZodObject<{
200
+ kind: z.ZodString;
201
+ role: z.ZodString;
202
+ toolName: z.ZodNullable<z.ZodString>;
203
+ at: z.ZodNullable<z.ZodString>;
204
+ }, z.core.$strip>>;
205
+ atPrompt: z.ZodNullable<z.ZodString>;
206
+ waitingFor: z.ZodNullable<z.ZodString>;
207
+ sleeping: z.ZodBoolean;
208
+ pinned: z.ZodBoolean;
209
+ memoryBytes: z.ZodNullable<z.ZodNumber>;
210
+ registrationGeneration: z.ZodNullable<z.ZodUUID>;
211
+ boundary: z.ZodNullable<z.ZodObject<{
212
+ unit: z.ZodNullable<z.ZodString>;
213
+ roots: z.ZodArray<z.ZodObject<{
214
+ pid: z.ZodNumber;
215
+ instance: z.ZodNullable<z.ZodObject<{
216
+ platform: z.ZodEnum<{
217
+ darwin: "darwin";
218
+ linux: "linux";
219
+ }>;
220
+ bootId: z.ZodString;
221
+ namespace: z.ZodString;
222
+ startId: z.ZodString;
223
+ }, z.core.$strict>>;
224
+ }, z.core.$strip>>;
225
+ }, z.core.$strict>>;
226
+ observedAt: z.ZodISODateTime;
227
+ }, z.core.$strip>>;
228
+ }, z.core.$strip>;
229
+ export type MonitoringSnapshot = z.infer<typeof MonitoringSnapshotSchema>;
230
+ /** The snapshot as a consumer reads it: the producer's envelope with tolerant rows. */
231
+ export declare const MonitoringSnapshotReadSchema: z.ZodObject<{
232
+ protocol: z.ZodLiteral<1>;
233
+ version: z.ZodString;
234
+ generation: z.ZodUUID;
235
+ sequence: z.ZodNumber;
236
+ pid: z.ZodNumber;
237
+ rcPrefix: z.ZodString;
238
+ scope: z.ZodLiteral<"managed">;
239
+ observedAt: z.ZodISODateTime;
240
+ generatedAt: z.ZodISODateTime;
241
+ refreshDurationMs: z.ZodNumber;
242
+ maxAgeMs: z.ZodLiteral<10000>;
243
+ limits: z.ZodObject<{
244
+ items: z.ZodLiteral<256>;
245
+ bytes: z.ZodLiteral<number>;
246
+ }, z.core.$strict>;
247
+ omitted: z.ZodNumber;
248
+ sessions: z.ZodArray<z.ZodObject<{
249
+ plane: z.ZodLiteral<"managed">;
250
+ name: z.ZodString;
251
+ uuid: z.ZodUUID;
252
+ rc: z.ZodString;
253
+ address: z.ZodString;
254
+ dir: z.ZodString;
255
+ archived: z.ZodBoolean;
256
+ running: z.ZodBoolean;
257
+ model: z.ZodNullable<z.ZodString>;
258
+ contextPercent: z.ZodNullable<z.ZodNumber>;
259
+ statusLineRendersPerMinute: z.ZodNullable<z.ZodNumber>;
260
+ uptimeSeconds: z.ZodNullable<z.ZodNumber>;
261
+ lastActivityAt: z.ZodNullable<z.ZodISODateTime>;
262
+ turnStartedAt: z.ZodNullable<z.ZodISODateTime>;
263
+ observedAt: z.ZodISODateTime;
264
+ agent: z.ZodCatch<z.ZodUnion<readonly [z.ZodEnum<{
265
+ antigravity: "antigravity";
266
+ claude: "claude";
267
+ codex: "codex";
268
+ custom: "custom";
269
+ opencode: "opencode";
270
+ }>, z.ZodLiteral<"unknown">]>>;
271
+ state: z.ZodCatch<z.ZodEnum<{
272
+ blocked: "blocked";
273
+ idle: "idle";
274
+ prompt: "prompt";
275
+ stopped: "stopped";
276
+ unknown: "unknown";
277
+ working: "working";
278
+ }>>;
279
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
280
+ step: z.ZodOptional<z.ZodNullable<z.ZodObject<{
281
+ kind: z.ZodString;
282
+ role: z.ZodString;
283
+ toolName: z.ZodNullable<z.ZodString>;
284
+ at: z.ZodNullable<z.ZodString>;
285
+ }, z.core.$strip>>>;
286
+ atPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
287
+ waitingFor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
288
+ sleeping: z.ZodOptional<z.ZodBoolean>;
289
+ pinned: z.ZodOptional<z.ZodBoolean>;
290
+ memoryBytes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
291
+ registrationGeneration: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
292
+ boundary: z.ZodOptional<z.ZodNullable<z.ZodObject<{
293
+ unit: z.ZodNullable<z.ZodString>;
294
+ roots: z.ZodArray<z.ZodObject<{
295
+ pid: z.ZodNumber;
296
+ instance: z.ZodNullable<z.ZodObject<{
297
+ platform: z.ZodEnum<{
298
+ darwin: "darwin";
299
+ linux: "linux";
300
+ }>;
301
+ bootId: z.ZodString;
302
+ namespace: z.ZodString;
303
+ startId: z.ZodString;
304
+ }, z.core.$strict>>;
305
+ }, z.core.$strip>>;
306
+ }, z.core.$strict>>>;
307
+ }, z.core.$strip>>;
308
+ }, z.core.$strip>;
309
+ export type MonitoringSnapshotRead = z.infer<typeof MonitoringSnapshotReadSchema>;
310
+ export declare const MonitoringReadSchema: z.ZodObject<{
311
+ protocol: z.ZodLiteral<1>;
312
+ status: z.ZodEnum<{
313
+ live: "live";
314
+ stale: "stale";
315
+ unavailable: "unavailable";
316
+ }>;
317
+ reason: z.ZodNullable<z.ZodEnum<{
318
+ busy: "busy";
319
+ cancelled: "cancelled";
320
+ "clock-skew": "clock-skew";
321
+ "config-changed": "config-changed";
322
+ deadline: "deadline";
323
+ expired: "expired";
324
+ invalid: "invalid";
325
+ missing: "missing";
326
+ oversized: "oversized";
327
+ "producer-stopped": "producer-stopped";
328
+ "read-failed": "read-failed";
329
+ unauthorized: "unauthorized";
330
+ }>>;
331
+ snapshot: z.ZodNullable<z.ZodObject<{
332
+ protocol: z.ZodLiteral<1>;
333
+ version: z.ZodString;
334
+ generation: z.ZodUUID;
335
+ sequence: z.ZodNumber;
336
+ pid: z.ZodNumber;
337
+ rcPrefix: z.ZodString;
338
+ scope: z.ZodLiteral<"managed">;
339
+ observedAt: z.ZodISODateTime;
340
+ generatedAt: z.ZodISODateTime;
341
+ refreshDurationMs: z.ZodNumber;
342
+ maxAgeMs: z.ZodLiteral<10000>;
343
+ limits: z.ZodObject<{
344
+ items: z.ZodLiteral<256>;
345
+ bytes: z.ZodLiteral<number>;
346
+ }, z.core.$strict>;
347
+ omitted: z.ZodNumber;
348
+ sessions: z.ZodArray<z.ZodObject<{
349
+ plane: z.ZodLiteral<"managed">;
350
+ name: z.ZodString;
351
+ uuid: z.ZodUUID;
352
+ rc: z.ZodString;
353
+ address: z.ZodString;
354
+ dir: z.ZodString;
355
+ archived: z.ZodBoolean;
356
+ running: z.ZodBoolean;
357
+ model: z.ZodNullable<z.ZodString>;
358
+ contextPercent: z.ZodNullable<z.ZodNumber>;
359
+ statusLineRendersPerMinute: z.ZodNullable<z.ZodNumber>;
360
+ uptimeSeconds: z.ZodNullable<z.ZodNumber>;
361
+ lastActivityAt: z.ZodNullable<z.ZodISODateTime>;
362
+ turnStartedAt: z.ZodNullable<z.ZodISODateTime>;
363
+ observedAt: z.ZodISODateTime;
364
+ agent: z.ZodCatch<z.ZodUnion<readonly [z.ZodEnum<{
365
+ antigravity: "antigravity";
366
+ claude: "claude";
367
+ codex: "codex";
368
+ custom: "custom";
369
+ opencode: "opencode";
370
+ }>, z.ZodLiteral<"unknown">]>>;
371
+ state: z.ZodCatch<z.ZodEnum<{
372
+ blocked: "blocked";
373
+ idle: "idle";
374
+ prompt: "prompt";
375
+ stopped: "stopped";
376
+ unknown: "unknown";
377
+ working: "working";
378
+ }>>;
379
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
380
+ step: z.ZodOptional<z.ZodNullable<z.ZodObject<{
381
+ kind: z.ZodString;
382
+ role: z.ZodString;
383
+ toolName: z.ZodNullable<z.ZodString>;
384
+ at: z.ZodNullable<z.ZodString>;
385
+ }, z.core.$strip>>>;
386
+ atPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
387
+ waitingFor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
388
+ sleeping: z.ZodOptional<z.ZodBoolean>;
389
+ pinned: z.ZodOptional<z.ZodBoolean>;
390
+ memoryBytes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
391
+ registrationGeneration: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
392
+ boundary: z.ZodOptional<z.ZodNullable<z.ZodObject<{
393
+ unit: z.ZodNullable<z.ZodString>;
394
+ roots: z.ZodArray<z.ZodObject<{
395
+ pid: z.ZodNumber;
396
+ instance: z.ZodNullable<z.ZodObject<{
397
+ platform: z.ZodEnum<{
398
+ darwin: "darwin";
399
+ linux: "linux";
400
+ }>;
401
+ bootId: z.ZodString;
402
+ namespace: z.ZodString;
403
+ startId: z.ZodString;
404
+ }, z.core.$strict>>;
405
+ }, z.core.$strip>>;
406
+ }, z.core.$strict>>>;
407
+ }, z.core.$strip>>;
408
+ }, z.core.$strip>>;
409
+ }, z.core.$strict>;
410
+ export type MonitoringRead = z.infer<typeof MonitoringReadSchema>;
@@ -0,0 +1,5 @@
1
+ import { type MonitoringRead, type MonitoringSnapshotRead } from "./schema.js";
2
+ export declare function unavailable(reason: MonitoringRead['reason']): MonitoringRead;
3
+ /** Rechecked at delivery too: a shared read is never a lease on producer liveness. */
4
+ export declare function validateLiveness(snapshot: MonitoringSnapshotRead, now?: number): MonitoringRead;
5
+ export declare function validateSnapshot(bytes: string, rcPrefix: string, now?: number): MonitoringRead;
@@ -0,0 +1,4 @@
1
+ /** Public resident monitoring API. Importing this module never starts a CLI or observer. */
2
+ export { MONITORING_CONFIG_MAX_BYTES, MONITORING_DEFAULT_TIMEOUT_MS, MONITORING_MAX_READERS, MONITORING_MAX_TIMEOUT_MS, type MonitoringReadOptions, readMonitoringStatus, } from "./monitoring/nativeRead.js";
3
+ export { type MonitoringRead, MonitoringReadSchema, type MonitoringRow, type MonitoringRowRead, MonitoringRowReadSchema, MonitoringRowSchema, type MonitoringSnapshot, type MonitoringSnapshotRead, MonitoringSnapshotReadSchema, MonitoringSnapshotSchema, type MonitoringStep, MonitoringStepSchema, STATUS_MAX_AGE_MS, STATUS_MAX_BYTES, STATUS_MAX_ITEMS, } from "./monitoring/schema.js";
4
+ export { VERSION as MONITORING_READER_VERSION } from "./util/version.js";
@@ -0,0 +1,93 @@
1
+ import { z } from 'zod';
2
+ export declare const PolicyIdSchema: z.ZodString;
3
+ export declare const PolicyDigestSchema: z.ZodString;
4
+ export declare const ApplicationPolicyReferenceSchema: z.ZodObject<{
5
+ id: z.ZodString;
6
+ revision: z.ZodString;
7
+ }, z.core.$strict>;
8
+ export type ApplicationPolicyReference = z.infer<typeof ApplicationPolicyReferenceSchema>;
9
+ export declare const PolicyCapabilitySchema: z.ZodEnum<{
10
+ "developer-instructions": "developer-instructions";
11
+ "native-agent": "native-agent";
12
+ "native-skills": "native-skills";
13
+ "tool-denials": "tool-denials";
14
+ }>;
15
+ export declare const ApplicationPolicyMetadataSchema: z.ZodObject<{
16
+ id: z.ZodString;
17
+ revision: z.ZodString;
18
+ digest: z.ZodString;
19
+ runtime: z.ZodEnum<{
20
+ codex: "codex";
21
+ opencode: "opencode";
22
+ }>;
23
+ sources: z.ZodArray<z.ZodObject<{
24
+ id: z.ZodString;
25
+ digest: z.ZodString;
26
+ kind: z.ZodEnum<{
27
+ agent: "agent";
28
+ instructions: "instructions";
29
+ skill: "skill";
30
+ }>;
31
+ }, z.core.$strict>>;
32
+ capabilities: z.ZodArray<z.ZodEnum<{
33
+ "developer-instructions": "developer-instructions";
34
+ "native-agent": "native-agent";
35
+ "native-skills": "native-skills";
36
+ "tool-denials": "tool-denials";
37
+ }>>;
38
+ }, z.core.$strict>;
39
+ export type ApplicationPolicyMetadata = z.infer<typeof ApplicationPolicyMetadataSchema>;
40
+ /**
41
+ * Why a policy is not applied, as a code — never a message, a path or a native error.
42
+ *
43
+ * `unavailable` alone is a state with no action in it. The reason was known at the moment of the
44
+ * refusal and named precisely — `native-agent-selection-unavailable`, `source-digest-mismatch` —
45
+ * and stopped at the process boundary, so a consumer read "the policy is unavailable" and went
46
+ * looking through this project's sources for which of a dozen conditions it was. That cost an hour
47
+ * for a directory named `agents/` where the runtime reads `agent/`.
48
+ *
49
+ * Required of every producer in this version and not by the schema, deliberately: a snapshot the
50
+ * previous version left on disk carries `unavailable` with no reason, and a schema that refused it
51
+ * would drop that whole snapshot on the floor at read time — turning a missing sentence into a lost
52
+ * projection, which is a worse version of the same defect. What the schema does forbid is a reason
53
+ * on a state that is not a failure.
54
+ *
55
+ * A pattern rather than an enum: the codes come from three vocabularies that grow independently —
56
+ * policy verification, the runtime's own availability, and the connection — and an enum here would
57
+ * either go stale silently or drop a reason it had never heard of, which is the failure this field
58
+ * exists to end. The charset is what keeps it a code.
59
+ */
60
+ export declare const PolicyUnavailableReasonSchema: z.ZodString;
61
+ export declare const ApplicationPolicyEvidenceSchema: z.ZodObject<{
62
+ policy: z.ZodObject<{
63
+ id: z.ZodString;
64
+ revision: z.ZodString;
65
+ digest: z.ZodString;
66
+ runtime: z.ZodEnum<{
67
+ codex: "codex";
68
+ opencode: "opencode";
69
+ }>;
70
+ sources: z.ZodArray<z.ZodObject<{
71
+ id: z.ZodString;
72
+ digest: z.ZodString;
73
+ kind: z.ZodEnum<{
74
+ agent: "agent";
75
+ instructions: "instructions";
76
+ skill: "skill";
77
+ }>;
78
+ }, z.core.$strict>>;
79
+ capabilities: z.ZodArray<z.ZodEnum<{
80
+ "developer-instructions": "developer-instructions";
81
+ "native-agent": "native-agent";
82
+ "native-skills": "native-skills";
83
+ "tool-denials": "tool-denials";
84
+ }>>;
85
+ }, z.core.$strict>;
86
+ state: z.ZodEnum<{
87
+ applied: "applied";
88
+ desired: "desired";
89
+ unavailable: "unavailable";
90
+ }>;
91
+ reason: z.ZodOptional<z.ZodString>;
92
+ }, z.core.$strict>;
93
+ export type ApplicationPolicyEvidence = z.infer<typeof ApplicationPolicyEvidenceSchema>;
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ /** Observed execution evidence, not a second caller-selectable policy or credential mechanism. */
3
+ export declare const RuntimeAppliedProfileSchema: z.ZodObject<{
4
+ runtime: z.ZodLiteral<"custom">;
5
+ turnId: z.ZodString;
6
+ observedAt: z.ZodISODateTime;
7
+ recipeDigest: z.ZodString;
8
+ model: z.ZodObject<{
9
+ provider: z.ZodString;
10
+ model: z.ZodString;
11
+ }, z.core.$strict>;
12
+ providerLabel: z.ZodDefault<z.ZodNullable<z.ZodString>>;
13
+ tools: z.ZodArray<z.ZodString>;
14
+ resources: z.ZodArray<z.ZodObject<{
15
+ id: z.ZodString;
16
+ digest: z.ZodString;
17
+ kind: z.ZodEnum<{
18
+ instruction: "instruction";
19
+ resource: "resource";
20
+ skill: "skill";
21
+ }>;
22
+ }, z.core.$strict>>;
23
+ }, z.core.$strict>;
24
+ export type RuntimeAppliedProfile = z.infer<typeof RuntimeAppliedProfileSchema>;