@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,56 @@
1
+ import { z } from 'zod';
2
+ export declare const ATTACHMENT_LIMITS: {
3
+ imageBytes: number;
4
+ messageBytes: number;
5
+ imagesPerMessage: number;
6
+ chunkBytes: number;
7
+ dimension: number;
8
+ pixels: number;
9
+ uploadTtlMs: number;
10
+ unretainedTtlMs: number;
11
+ hostBytes: number;
12
+ hostUploads: number;
13
+ targetUploads: number;
14
+ records: number;
15
+ pins: number;
16
+ /**
17
+ * The bound exists to stop a decoder that never returns, not to make one fast — so it is set
18
+ * where a hang is unmistakable rather than where a busy machine looks like one.
19
+ *
20
+ * Nearly all of this is process startup, not decoding. Measured on a loaded host: 1.3s to 3.2s
21
+ * for a one-pixel PNG, against the previous five-second bound — a margin of about one and a half,
22
+ * and a machine can be busier than that. Past it a perfectly good image is refused as
23
+ * unavailable, and the caller is told nothing that would let them tell "too busy" from "not an
24
+ * image". Thirty seconds is nowhere near a legitimate decode and still ends a hang.
25
+ */
26
+ decodeDeadlineMs: number;
27
+ };
28
+ export declare const AttachmentMediaTypeSchema: z.ZodEnum<{
29
+ "image/jpeg": "image/jpeg";
30
+ "image/png": "image/png";
31
+ }>;
32
+ export declare const AttachmentDigestSchema: z.ZodString;
33
+ export declare const AttachmentReferenceSchema: z.ZodObject<{
34
+ id: z.ZodUUID;
35
+ digest: z.ZodString;
36
+ mediaType: z.ZodEnum<{
37
+ "image/jpeg": "image/jpeg";
38
+ "image/png": "image/png";
39
+ }>;
40
+ bytes: z.ZodNumber;
41
+ width: z.ZodNumber;
42
+ height: z.ZodNumber;
43
+ }, z.core.$strict>;
44
+ export declare const AttachmentReferencesSchema: z.ZodArray<z.ZodObject<{
45
+ id: z.ZodUUID;
46
+ digest: z.ZodString;
47
+ mediaType: z.ZodEnum<{
48
+ "image/jpeg": "image/jpeg";
49
+ "image/png": "image/png";
50
+ }>;
51
+ bytes: z.ZodNumber;
52
+ width: z.ZodNumber;
53
+ height: z.ZodNumber;
54
+ }, z.core.$strict>>;
55
+ export type AttachmentReference = z.infer<typeof AttachmentReferenceSchema>;
56
+ export type AttachmentMediaType = z.infer<typeof AttachmentMediaTypeSchema>;
@@ -0,0 +1,512 @@
1
+ import { z } from 'zod';
2
+ export declare const AttachmentUploadSelectorSchema: z.ZodObject<{
3
+ target: z.ZodObject<{
4
+ kind: z.ZodLiteral<"managed">;
5
+ source: z.ZodLiteral<"stitchmux">;
6
+ machine: z.ZodString;
7
+ agent: z.ZodEnum<{
8
+ antigravity: "antigravity";
9
+ claude: "claude";
10
+ codex: "codex";
11
+ custom: "custom";
12
+ opencode: "opencode";
13
+ }>;
14
+ session: z.ZodString;
15
+ threadId: z.ZodUUID;
16
+ }, z.core.$strict>;
17
+ uploadId: z.ZodUUID;
18
+ }, z.core.$strict>;
19
+ export declare const AttachmentBeginSchema: z.ZodObject<{
20
+ target: z.ZodObject<{
21
+ kind: z.ZodLiteral<"managed">;
22
+ source: z.ZodLiteral<"stitchmux">;
23
+ machine: z.ZodString;
24
+ agent: z.ZodEnum<{
25
+ antigravity: "antigravity";
26
+ claude: "claude";
27
+ codex: "codex";
28
+ custom: "custom";
29
+ opencode: "opencode";
30
+ }>;
31
+ session: z.ZodString;
32
+ threadId: z.ZodUUID;
33
+ }, z.core.$strict>;
34
+ uploadId: z.ZodUUID;
35
+ mediaType: z.ZodEnum<{
36
+ "image/jpeg": "image/jpeg";
37
+ "image/png": "image/png";
38
+ }>;
39
+ totalBytes: z.ZodNumber;
40
+ digest: z.ZodString;
41
+ }, z.core.$strict>;
42
+ export declare const AttachmentChunkSchema: z.ZodObject<{
43
+ target: z.ZodObject<{
44
+ kind: z.ZodLiteral<"managed">;
45
+ source: z.ZodLiteral<"stitchmux">;
46
+ machine: z.ZodString;
47
+ agent: z.ZodEnum<{
48
+ antigravity: "antigravity";
49
+ claude: "claude";
50
+ codex: "codex";
51
+ custom: "custom";
52
+ opencode: "opencode";
53
+ }>;
54
+ session: z.ZodString;
55
+ threadId: z.ZodUUID;
56
+ }, z.core.$strict>;
57
+ uploadId: z.ZodUUID;
58
+ offset: z.ZodNumber;
59
+ data: z.ZodString;
60
+ }, z.core.$strict>;
61
+ export declare const AttachmentReadSchema: z.ZodObject<{
62
+ target: z.ZodObject<{
63
+ kind: z.ZodLiteral<"managed">;
64
+ source: z.ZodLiteral<"stitchmux">;
65
+ machine: z.ZodString;
66
+ agent: z.ZodEnum<{
67
+ antigravity: "antigravity";
68
+ claude: "claude";
69
+ codex: "codex";
70
+ custom: "custom";
71
+ opencode: "opencode";
72
+ }>;
73
+ session: z.ZodString;
74
+ threadId: z.ZodUUID;
75
+ }, z.core.$strict>;
76
+ reference: z.ZodObject<{
77
+ id: z.ZodUUID;
78
+ digest: z.ZodString;
79
+ mediaType: z.ZodEnum<{
80
+ "image/jpeg": "image/jpeg";
81
+ "image/png": "image/png";
82
+ }>;
83
+ bytes: z.ZodNumber;
84
+ width: z.ZodNumber;
85
+ height: z.ZodNumber;
86
+ }, z.core.$strict>;
87
+ offset: z.ZodNumber;
88
+ }, z.core.$strict>;
89
+ export declare const AttachmentUploadReceiptSchema: z.ZodObject<{
90
+ uploadId: z.ZodUUID;
91
+ receivedBytes: z.ZodNumber;
92
+ totalBytes: z.ZodNumber;
93
+ expiresAt: z.ZodISODateTime;
94
+ phase: z.ZodEnum<{
95
+ retained: "retained";
96
+ uploading: "uploading";
97
+ verified: "verified";
98
+ }>;
99
+ }, z.core.$strict>;
100
+ export declare const AttachmentReadReceiptSchema: z.ZodObject<{
101
+ reference: z.ZodObject<{
102
+ id: z.ZodUUID;
103
+ digest: z.ZodString;
104
+ mediaType: z.ZodEnum<{
105
+ "image/jpeg": "image/jpeg";
106
+ "image/png": "image/png";
107
+ }>;
108
+ bytes: z.ZodNumber;
109
+ width: z.ZodNumber;
110
+ height: z.ZodNumber;
111
+ }, z.core.$strict>;
112
+ offset: z.ZodNumber;
113
+ data: z.ZodString;
114
+ nextOffset: z.ZodNumber;
115
+ complete: z.ZodBoolean;
116
+ }, z.core.$strict>;
117
+ export declare const AttachmentCancelReceiptSchema: z.ZodObject<{
118
+ uploadId: z.ZodUUID;
119
+ cancelled: z.ZodLiteral<true>;
120
+ }, z.core.$strict>;
121
+ export declare const AttachmentRecordSchema: z.ZodObject<{
122
+ id: z.ZodUUID;
123
+ target: z.ZodObject<{
124
+ kind: z.ZodLiteral<"managed">;
125
+ source: z.ZodLiteral<"stitchmux">;
126
+ machine: z.ZodString;
127
+ agent: z.ZodEnum<{
128
+ antigravity: "antigravity";
129
+ claude: "claude";
130
+ codex: "codex";
131
+ custom: "custom";
132
+ opencode: "opencode";
133
+ }>;
134
+ session: z.ZodString;
135
+ threadId: z.ZodUUID;
136
+ }, z.core.$strict>;
137
+ principal: z.ZodUnion<readonly [z.ZodObject<{
138
+ kind: z.ZodLiteral<"managed">;
139
+ source: z.ZodLiteral<"stitchmux">;
140
+ machine: z.ZodString;
141
+ agent: z.ZodEnum<{
142
+ antigravity: "antigravity";
143
+ claude: "claude";
144
+ codex: "codex";
145
+ custom: "custom";
146
+ opencode: "opencode";
147
+ }>;
148
+ session: z.ZodString;
149
+ threadId: z.ZodUUID;
150
+ }, z.core.$strict>, z.ZodObject<{
151
+ kind: z.ZodLiteral<"codex-app">;
152
+ source: z.ZodLiteral<"codex-app">;
153
+ machine: z.ZodString;
154
+ agent: z.ZodLiteral<"codex">;
155
+ threadId: z.ZodUUID;
156
+ name: z.ZodNullable<z.ZodString>;
157
+ }, z.core.$strict>, z.ZodObject<{
158
+ kind: z.ZodLiteral<"cli">;
159
+ source: z.ZodLiteral<"stitchmux">;
160
+ machine: z.ZodString;
161
+ }, z.core.$strict>, z.ZodObject<{
162
+ kind: z.ZodLiteral<"service">;
163
+ source: z.ZodLiteral<"stitchmux">;
164
+ machine: z.ZodString;
165
+ transport: z.ZodEnum<{
166
+ "declared-service": "declared-service";
167
+ local: "local";
168
+ }>;
169
+ }, z.core.$strict>]>;
170
+ registration: z.ZodUUID;
171
+ mediaType: z.ZodEnum<{
172
+ "image/jpeg": "image/jpeg";
173
+ "image/png": "image/png";
174
+ }>;
175
+ bytes: z.ZodNumber;
176
+ digest: z.ZodString;
177
+ received: z.ZodNumber;
178
+ phase: z.ZodEnum<{
179
+ retained: "retained";
180
+ uploading: "uploading";
181
+ verified: "verified";
182
+ }>;
183
+ createdAt: z.ZodNumber;
184
+ expiresAt: z.ZodNumber;
185
+ reference: z.ZodNullable<z.ZodObject<{
186
+ id: z.ZodUUID;
187
+ digest: z.ZodString;
188
+ mediaType: z.ZodEnum<{
189
+ "image/jpeg": "image/jpeg";
190
+ "image/png": "image/png";
191
+ }>;
192
+ bytes: z.ZodNumber;
193
+ width: z.ZodNumber;
194
+ height: z.ZodNumber;
195
+ }, z.core.$strict>>;
196
+ }, z.core.$strict>;
197
+ export declare const AttachmentPinSchema: z.ZodObject<{
198
+ messageId: z.ZodUUID;
199
+ target: z.ZodObject<{
200
+ kind: z.ZodLiteral<"managed">;
201
+ source: z.ZodLiteral<"stitchmux">;
202
+ machine: z.ZodString;
203
+ agent: z.ZodEnum<{
204
+ antigravity: "antigravity";
205
+ claude: "claude";
206
+ codex: "codex";
207
+ custom: "custom";
208
+ opencode: "opencode";
209
+ }>;
210
+ session: z.ZodString;
211
+ threadId: z.ZodUUID;
212
+ }, z.core.$strict>;
213
+ registration: z.ZodUUID;
214
+ principal: z.ZodUnion<readonly [z.ZodObject<{
215
+ kind: z.ZodLiteral<"managed">;
216
+ source: z.ZodLiteral<"stitchmux">;
217
+ machine: z.ZodString;
218
+ agent: z.ZodEnum<{
219
+ antigravity: "antigravity";
220
+ claude: "claude";
221
+ codex: "codex";
222
+ custom: "custom";
223
+ opencode: "opencode";
224
+ }>;
225
+ session: z.ZodString;
226
+ threadId: z.ZodUUID;
227
+ }, z.core.$strict>, z.ZodObject<{
228
+ kind: z.ZodLiteral<"codex-app">;
229
+ source: z.ZodLiteral<"codex-app">;
230
+ machine: z.ZodString;
231
+ agent: z.ZodLiteral<"codex">;
232
+ threadId: z.ZodUUID;
233
+ name: z.ZodNullable<z.ZodString>;
234
+ }, z.core.$strict>, z.ZodObject<{
235
+ kind: z.ZodLiteral<"cli">;
236
+ source: z.ZodLiteral<"stitchmux">;
237
+ machine: z.ZodString;
238
+ }, z.core.$strict>, z.ZodObject<{
239
+ kind: z.ZodLiteral<"service">;
240
+ source: z.ZodLiteral<"stitchmux">;
241
+ machine: z.ZodString;
242
+ transport: z.ZodEnum<{
243
+ "declared-service": "declared-service";
244
+ local: "local";
245
+ }>;
246
+ }, z.core.$strict>]>;
247
+ references: z.ZodArray<z.ZodObject<{
248
+ id: z.ZodUUID;
249
+ digest: z.ZodString;
250
+ mediaType: z.ZodEnum<{
251
+ "image/jpeg": "image/jpeg";
252
+ "image/png": "image/png";
253
+ }>;
254
+ bytes: z.ZodNumber;
255
+ width: z.ZodNumber;
256
+ height: z.ZodNumber;
257
+ }, z.core.$strict>>;
258
+ }, z.core.$strict>;
259
+ export declare const AttachmentCancellationSchema: z.ZodObject<{
260
+ id: z.ZodUUID;
261
+ target: z.ZodObject<{
262
+ kind: z.ZodLiteral<"managed">;
263
+ source: z.ZodLiteral<"stitchmux">;
264
+ machine: z.ZodString;
265
+ agent: z.ZodEnum<{
266
+ antigravity: "antigravity";
267
+ claude: "claude";
268
+ codex: "codex";
269
+ custom: "custom";
270
+ opencode: "opencode";
271
+ }>;
272
+ session: z.ZodString;
273
+ threadId: z.ZodUUID;
274
+ }, z.core.$strict>;
275
+ registration: z.ZodUUID;
276
+ principal: z.ZodUnion<readonly [z.ZodObject<{
277
+ kind: z.ZodLiteral<"managed">;
278
+ source: z.ZodLiteral<"stitchmux">;
279
+ machine: z.ZodString;
280
+ agent: z.ZodEnum<{
281
+ antigravity: "antigravity";
282
+ claude: "claude";
283
+ codex: "codex";
284
+ custom: "custom";
285
+ opencode: "opencode";
286
+ }>;
287
+ session: z.ZodString;
288
+ threadId: z.ZodUUID;
289
+ }, z.core.$strict>, z.ZodObject<{
290
+ kind: z.ZodLiteral<"codex-app">;
291
+ source: z.ZodLiteral<"codex-app">;
292
+ machine: z.ZodString;
293
+ agent: z.ZodLiteral<"codex">;
294
+ threadId: z.ZodUUID;
295
+ name: z.ZodNullable<z.ZodString>;
296
+ }, z.core.$strict>, z.ZodObject<{
297
+ kind: z.ZodLiteral<"cli">;
298
+ source: z.ZodLiteral<"stitchmux">;
299
+ machine: z.ZodString;
300
+ }, z.core.$strict>, z.ZodObject<{
301
+ kind: z.ZodLiteral<"service">;
302
+ source: z.ZodLiteral<"stitchmux">;
303
+ machine: z.ZodString;
304
+ transport: z.ZodEnum<{
305
+ "declared-service": "declared-service";
306
+ local: "local";
307
+ }>;
308
+ }, z.core.$strict>]>;
309
+ expiresAt: z.ZodNumber;
310
+ }, z.core.$strict>;
311
+ export declare const AttachmentStoreSchema: z.ZodObject<{
312
+ version: z.ZodLiteral<1>;
313
+ records: z.ZodArray<z.ZodObject<{
314
+ id: z.ZodUUID;
315
+ target: z.ZodObject<{
316
+ kind: z.ZodLiteral<"managed">;
317
+ source: z.ZodLiteral<"stitchmux">;
318
+ machine: z.ZodString;
319
+ agent: z.ZodEnum<{
320
+ antigravity: "antigravity";
321
+ claude: "claude";
322
+ codex: "codex";
323
+ custom: "custom";
324
+ opencode: "opencode";
325
+ }>;
326
+ session: z.ZodString;
327
+ threadId: z.ZodUUID;
328
+ }, z.core.$strict>;
329
+ principal: z.ZodUnion<readonly [z.ZodObject<{
330
+ kind: z.ZodLiteral<"managed">;
331
+ source: z.ZodLiteral<"stitchmux">;
332
+ machine: z.ZodString;
333
+ agent: z.ZodEnum<{
334
+ antigravity: "antigravity";
335
+ claude: "claude";
336
+ codex: "codex";
337
+ custom: "custom";
338
+ opencode: "opencode";
339
+ }>;
340
+ session: z.ZodString;
341
+ threadId: z.ZodUUID;
342
+ }, z.core.$strict>, z.ZodObject<{
343
+ kind: z.ZodLiteral<"codex-app">;
344
+ source: z.ZodLiteral<"codex-app">;
345
+ machine: z.ZodString;
346
+ agent: z.ZodLiteral<"codex">;
347
+ threadId: z.ZodUUID;
348
+ name: z.ZodNullable<z.ZodString>;
349
+ }, z.core.$strict>, z.ZodObject<{
350
+ kind: z.ZodLiteral<"cli">;
351
+ source: z.ZodLiteral<"stitchmux">;
352
+ machine: z.ZodString;
353
+ }, z.core.$strict>, z.ZodObject<{
354
+ kind: z.ZodLiteral<"service">;
355
+ source: z.ZodLiteral<"stitchmux">;
356
+ machine: z.ZodString;
357
+ transport: z.ZodEnum<{
358
+ "declared-service": "declared-service";
359
+ local: "local";
360
+ }>;
361
+ }, z.core.$strict>]>;
362
+ registration: z.ZodUUID;
363
+ mediaType: z.ZodEnum<{
364
+ "image/jpeg": "image/jpeg";
365
+ "image/png": "image/png";
366
+ }>;
367
+ bytes: z.ZodNumber;
368
+ digest: z.ZodString;
369
+ received: z.ZodNumber;
370
+ phase: z.ZodEnum<{
371
+ retained: "retained";
372
+ uploading: "uploading";
373
+ verified: "verified";
374
+ }>;
375
+ createdAt: z.ZodNumber;
376
+ expiresAt: z.ZodNumber;
377
+ reference: z.ZodNullable<z.ZodObject<{
378
+ id: z.ZodUUID;
379
+ digest: z.ZodString;
380
+ mediaType: z.ZodEnum<{
381
+ "image/jpeg": "image/jpeg";
382
+ "image/png": "image/png";
383
+ }>;
384
+ bytes: z.ZodNumber;
385
+ width: z.ZodNumber;
386
+ height: z.ZodNumber;
387
+ }, z.core.$strict>>;
388
+ }, z.core.$strict>>;
389
+ pins: z.ZodArray<z.ZodObject<{
390
+ messageId: z.ZodUUID;
391
+ target: z.ZodObject<{
392
+ kind: z.ZodLiteral<"managed">;
393
+ source: z.ZodLiteral<"stitchmux">;
394
+ machine: z.ZodString;
395
+ agent: z.ZodEnum<{
396
+ antigravity: "antigravity";
397
+ claude: "claude";
398
+ codex: "codex";
399
+ custom: "custom";
400
+ opencode: "opencode";
401
+ }>;
402
+ session: z.ZodString;
403
+ threadId: z.ZodUUID;
404
+ }, z.core.$strict>;
405
+ registration: z.ZodUUID;
406
+ principal: z.ZodUnion<readonly [z.ZodObject<{
407
+ kind: z.ZodLiteral<"managed">;
408
+ source: z.ZodLiteral<"stitchmux">;
409
+ machine: z.ZodString;
410
+ agent: z.ZodEnum<{
411
+ antigravity: "antigravity";
412
+ claude: "claude";
413
+ codex: "codex";
414
+ custom: "custom";
415
+ opencode: "opencode";
416
+ }>;
417
+ session: z.ZodString;
418
+ threadId: z.ZodUUID;
419
+ }, z.core.$strict>, z.ZodObject<{
420
+ kind: z.ZodLiteral<"codex-app">;
421
+ source: z.ZodLiteral<"codex-app">;
422
+ machine: z.ZodString;
423
+ agent: z.ZodLiteral<"codex">;
424
+ threadId: z.ZodUUID;
425
+ name: z.ZodNullable<z.ZodString>;
426
+ }, z.core.$strict>, z.ZodObject<{
427
+ kind: z.ZodLiteral<"cli">;
428
+ source: z.ZodLiteral<"stitchmux">;
429
+ machine: z.ZodString;
430
+ }, z.core.$strict>, z.ZodObject<{
431
+ kind: z.ZodLiteral<"service">;
432
+ source: z.ZodLiteral<"stitchmux">;
433
+ machine: z.ZodString;
434
+ transport: z.ZodEnum<{
435
+ "declared-service": "declared-service";
436
+ local: "local";
437
+ }>;
438
+ }, z.core.$strict>]>;
439
+ references: z.ZodArray<z.ZodObject<{
440
+ id: z.ZodUUID;
441
+ digest: z.ZodString;
442
+ mediaType: z.ZodEnum<{
443
+ "image/jpeg": "image/jpeg";
444
+ "image/png": "image/png";
445
+ }>;
446
+ bytes: z.ZodNumber;
447
+ width: z.ZodNumber;
448
+ height: z.ZodNumber;
449
+ }, z.core.$strict>>;
450
+ }, z.core.$strict>>;
451
+ cancelled: z.ZodArray<z.ZodObject<{
452
+ id: z.ZodUUID;
453
+ target: z.ZodObject<{
454
+ kind: z.ZodLiteral<"managed">;
455
+ source: z.ZodLiteral<"stitchmux">;
456
+ machine: z.ZodString;
457
+ agent: z.ZodEnum<{
458
+ antigravity: "antigravity";
459
+ claude: "claude";
460
+ codex: "codex";
461
+ custom: "custom";
462
+ opencode: "opencode";
463
+ }>;
464
+ session: z.ZodString;
465
+ threadId: z.ZodUUID;
466
+ }, z.core.$strict>;
467
+ registration: z.ZodUUID;
468
+ principal: z.ZodUnion<readonly [z.ZodObject<{
469
+ kind: z.ZodLiteral<"managed">;
470
+ source: z.ZodLiteral<"stitchmux">;
471
+ machine: z.ZodString;
472
+ agent: z.ZodEnum<{
473
+ antigravity: "antigravity";
474
+ claude: "claude";
475
+ codex: "codex";
476
+ custom: "custom";
477
+ opencode: "opencode";
478
+ }>;
479
+ session: z.ZodString;
480
+ threadId: z.ZodUUID;
481
+ }, z.core.$strict>, z.ZodObject<{
482
+ kind: z.ZodLiteral<"codex-app">;
483
+ source: z.ZodLiteral<"codex-app">;
484
+ machine: z.ZodString;
485
+ agent: z.ZodLiteral<"codex">;
486
+ threadId: z.ZodUUID;
487
+ name: z.ZodNullable<z.ZodString>;
488
+ }, z.core.$strict>, z.ZodObject<{
489
+ kind: z.ZodLiteral<"cli">;
490
+ source: z.ZodLiteral<"stitchmux">;
491
+ machine: z.ZodString;
492
+ }, z.core.$strict>, z.ZodObject<{
493
+ kind: z.ZodLiteral<"service">;
494
+ source: z.ZodLiteral<"stitchmux">;
495
+ machine: z.ZodString;
496
+ transport: z.ZodEnum<{
497
+ "declared-service": "declared-service";
498
+ local: "local";
499
+ }>;
500
+ }, z.core.$strict>]>;
501
+ expiresAt: z.ZodNumber;
502
+ }, z.core.$strict>>;
503
+ }, z.core.$strict>;
504
+ export type AttachmentBegin = z.infer<typeof AttachmentBeginSchema>;
505
+ export type AttachmentChunk = z.infer<typeof AttachmentChunkSchema>;
506
+ export type AttachmentRead = z.infer<typeof AttachmentReadSchema>;
507
+ export type AttachmentUploadSelector = z.infer<typeof AttachmentUploadSelectorSchema>;
508
+ export type AttachmentUploadReceipt = z.infer<typeof AttachmentUploadReceiptSchema>;
509
+ export type AttachmentReadReceipt = z.infer<typeof AttachmentReadReceiptSchema>;
510
+ export type AttachmentCancelReceipt = z.infer<typeof AttachmentCancelReceiptSchema>;
511
+ export type AttachmentRecord = z.infer<typeof AttachmentRecordSchema>;
512
+ export type AttachmentStore = z.infer<typeof AttachmentStoreSchema>;
@@ -0,0 +1,77 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * WHICH fact the sender is standing on. The three differ in what can be checked, which is the whole
4
+ * reason they are named rather than left to prose.
5
+ *
6
+ * `user-instruction` is the sender quoting its own user; nothing about it is verifiable here, and the
7
+ * trust boundary says so. `peer-letter` is the case a permission actually arrives in: the user gives
8
+ * a pair leave to correspond and says it to ONE of them, so the other has no such line in its own
9
+ * conversation and can only quote a neighbour — which is unfalsifiable prose. Referenced as a
10
+ * stitchmux record instead, it becomes the one basis this transport can genuinely check: both ends hold
11
+ * the letter, and the recipient's own ledger says who wrote it and to whom. `thread-continuation`
12
+ * carries no rationale at all, on purpose — a permission belongs to the correspondence, and a field
13
+ * that must be re-typed for every letter is filled ritually within a month and then means nothing.
14
+ */
15
+ export declare const CommunicationBasisSchema: z.ZodEnum<{
16
+ "peer-letter": "peer-letter";
17
+ "thread-continuation": "thread-continuation";
18
+ "user-instruction": "user-instruction";
19
+ }>;
20
+ export type CommunicationBasis = z.infer<typeof CommunicationBasisSchema>;
21
+ /**
22
+ * `<peer thread uuid>#<message uuid>` — both ids are already printed on every delivered chat line
23
+ * (`[chat from stitchmux/<agent>@<machine>:<session>#<thread> · id: <message>]`), so the sender copies
24
+ * a reference rather than composing one. The thread is always the PEER's: the neighbour who wrote
25
+ * the letter, or the recipient whose correspondence is being continued.
26
+ */
27
+ export declare function parseLedgerMessageRef(ref: string): {
28
+ threadId: string;
29
+ messageId: string;
30
+ } | null;
31
+ /**
32
+ * The same reference, WRITTEN — one value, not two fields a caller joins by hand.
33
+ *
34
+ * It lives beside the parser so the two forms cannot drift, and it is what a successful send prints.
35
+ * The contract asked for a reference whose only source was the recipient's copy of the letter: an
36
+ * incoming line carries both ids, an outgoing one carried neither, so a sender continuing its own
37
+ * correspondence had nothing to paste. The two ways out of that were a prose reference (refused,
38
+ * honestly, as unreadable) and a slide down to `user-instruction` — which is worse, because it
39
+ * PASSES: the records then name a basis the correspondence never stood on.
40
+ */
41
+ export declare function formatLedgerMessageRef(threadId: string, messageId: string): string;
42
+ /**
43
+ * The reference a continuation of this correspondence must carry, or `null` for a recipient with no
44
+ * thread — the owner and an owner outside the fleet need no basis at all, so there is nothing to
45
+ * continue and no reference to offer.
46
+ */
47
+ export declare function continuationRef(message: {
48
+ id: string;
49
+ to: {
50
+ kind: string;
51
+ threadId?: string;
52
+ };
53
+ }): string | null;
54
+ /** Caller-supplied evidence, never a credential or a verified grant. */
55
+ export declare const CommunicationAuthorizationSchema: z.ZodObject<{
56
+ basis: z.ZodOptional<z.ZodEnum<{
57
+ "peer-letter": "peer-letter";
58
+ "thread-continuation": "thread-continuation";
59
+ "user-instruction": "user-instruction";
60
+ }>>;
61
+ whyThisCommunicationIsNecessaryAndWithinTheUserAuthorizedScope: z.ZodOptional<z.ZodString>;
62
+ userAuthorizationQuote: z.ZodOptional<z.ZodString>;
63
+ sourceMessageRef: z.ZodString;
64
+ }, z.core.$strict>;
65
+ export type CommunicationAuthorization = z.infer<typeof CommunicationAuthorizationSchema>;
66
+ /** New requests must name their basis; stored observations without that fact stay unchanged. */
67
+ export declare const CommunicationAuthorizationInputSchema: z.ZodObject<{
68
+ whyThisCommunicationIsNecessaryAndWithinTheUserAuthorizedScope: z.ZodOptional<z.ZodString>;
69
+ userAuthorizationQuote: z.ZodOptional<z.ZodString>;
70
+ sourceMessageRef: z.ZodString;
71
+ basis: z.ZodEnum<{
72
+ "peer-letter": "peer-letter";
73
+ "thread-continuation": "thread-continuation";
74
+ "user-instruction": "user-instruction";
75
+ }>;
76
+ }, z.core.$strict>;
77
+ export type CommunicationAuthorizationInput = z.infer<typeof CommunicationAuthorizationInputSchema>;