@isoplan/protocol 0.0.0-stage → 0.2.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.
- package/LICENSE +21 -0
- package/dist/facts.d.ts +383 -0
- package/dist/facts.js +129 -0
- package/dist/facts.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/messages.d.ts +975 -0
- package/dist/messages.js +263 -0
- package/dist/messages.js.map +1 -0
- package/dist/project-id.d.ts +12 -0
- package/dist/project-id.js +37 -0
- package/dist/project-id.js.map +1 -0
- package/package.json +31 -4
- package/README.md +0 -3
|
@@ -0,0 +1,975 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* The protocol version every message carries as `v`. Adding optional fields doesn't change it;
|
|
4
|
+
* changing what a field means, or removing one, does.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PROTOCOL_VERSION = 1;
|
|
7
|
+
export declare const ProjectSchema: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
/**
|
|
12
|
+
* One repo a handoff pushed: its path in the session's folder (`.` for the folder itself), remote,
|
|
13
|
+
* branch and commit. A handoff drives git on the receiver's machine, so the path stays inside the
|
|
14
|
+
* folder and the remote can't name a transport helper such as `ext::`, which runs a command.
|
|
15
|
+
*/
|
|
16
|
+
export declare const HandoffRepoSchema: z.ZodObject<{
|
|
17
|
+
path: z.ZodString;
|
|
18
|
+
remote: z.ZodString;
|
|
19
|
+
branch: z.ZodString;
|
|
20
|
+
commit: z.ZodString;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
/** What the receiver gets: the brief, and every repo pushed for it, each on the handoff's own branch. */
|
|
23
|
+
export declare const HandoffSchema: z.ZodObject<{
|
|
24
|
+
id: z.ZodString;
|
|
25
|
+
brief: z.ZodString;
|
|
26
|
+
repos: z.ZodArray<z.ZodObject<{
|
|
27
|
+
path: z.ZodString;
|
|
28
|
+
remote: z.ZodString;
|
|
29
|
+
branch: z.ZodString;
|
|
30
|
+
commit: z.ZodString;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
/** The first message on a connection: who is reporting, from where, about which session. */
|
|
34
|
+
export declare const HelloMessageSchema: z.ZodObject<{
|
|
35
|
+
type: z.ZodLiteral<"hello">;
|
|
36
|
+
v: z.ZodLiteral<1>;
|
|
37
|
+
source: z.ZodEnum<{
|
|
38
|
+
"claude-code": "claude-code";
|
|
39
|
+
}>;
|
|
40
|
+
account: z.ZodObject<{
|
|
41
|
+
id: z.ZodString;
|
|
42
|
+
name: z.ZodString;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
machine: z.ZodObject<{
|
|
45
|
+
name: z.ZodString;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
session: z.ZodString;
|
|
48
|
+
project: z.ZodObject<{
|
|
49
|
+
id: z.ZodString;
|
|
50
|
+
name: z.ZodString;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
/** The first message on a runner's link: the one link per machine that answers requests for its rooms. */
|
|
54
|
+
export declare const RunnerHelloMessageSchema: z.ZodObject<{
|
|
55
|
+
type: z.ZodLiteral<"runner">;
|
|
56
|
+
v: z.ZodLiteral<1>;
|
|
57
|
+
account: z.ZodObject<{
|
|
58
|
+
id: z.ZodString;
|
|
59
|
+
name: z.ZodString;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
machine: z.ZodObject<{
|
|
62
|
+
name: z.ZodString;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
/** All of the session's facts. Sent on connect and on repair. */
|
|
66
|
+
export declare const FullMessageSchema: z.ZodObject<{
|
|
67
|
+
type: z.ZodLiteral<"full">;
|
|
68
|
+
v: z.ZodLiteral<1>;
|
|
69
|
+
seq: z.ZodNumber;
|
|
70
|
+
facts: z.ZodObject<{
|
|
71
|
+
session: z.ZodObject<{
|
|
72
|
+
id: z.ZodString;
|
|
73
|
+
source: z.ZodEnum<{
|
|
74
|
+
"claude-code": "claude-code";
|
|
75
|
+
}>;
|
|
76
|
+
lead: z.ZodString;
|
|
77
|
+
title: z.ZodNullable<z.ZodString>;
|
|
78
|
+
titleFrom: z.ZodEnum<{
|
|
79
|
+
branch: "branch";
|
|
80
|
+
source: "source";
|
|
81
|
+
}>;
|
|
82
|
+
branch: z.ZodNullable<z.ZodString>;
|
|
83
|
+
checkout: z.ZodOptional<z.ZodString>;
|
|
84
|
+
lastActive: z.ZodISODateTime;
|
|
85
|
+
status: z.ZodEnum<{
|
|
86
|
+
active: "active";
|
|
87
|
+
idle: "idle";
|
|
88
|
+
}>;
|
|
89
|
+
lights: z.ZodEnum<{
|
|
90
|
+
off: "off";
|
|
91
|
+
on: "on";
|
|
92
|
+
}>;
|
|
93
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
94
|
+
}, z.core.$strip>;
|
|
95
|
+
agents: z.ZodArray<z.ZodObject<{
|
|
96
|
+
id: z.ZodString;
|
|
97
|
+
source: z.ZodEnum<{
|
|
98
|
+
"claude-code": "claude-code";
|
|
99
|
+
}>;
|
|
100
|
+
session: z.ZodString;
|
|
101
|
+
startedBy: z.ZodNullable<z.ZodString>;
|
|
102
|
+
agentType: z.ZodNullable<z.ZodString>;
|
|
103
|
+
task: z.ZodNullable<z.ZodString>;
|
|
104
|
+
status: z.ZodEnum<{
|
|
105
|
+
done: "done";
|
|
106
|
+
failed: "failed";
|
|
107
|
+
idle: "idle";
|
|
108
|
+
stalled: "stalled";
|
|
109
|
+
stopped: "stopped";
|
|
110
|
+
working: "working";
|
|
111
|
+
}>;
|
|
112
|
+
statusSince: z.ZodISODateTime;
|
|
113
|
+
lastActive: z.ZodISODateTime;
|
|
114
|
+
doing: z.ZodNullable<z.ZodObject<{
|
|
115
|
+
kind: z.ZodEnum<{
|
|
116
|
+
read: "read";
|
|
117
|
+
run: "run";
|
|
118
|
+
search: "search";
|
|
119
|
+
talk: "talk";
|
|
120
|
+
write: "write";
|
|
121
|
+
}>;
|
|
122
|
+
file: z.ZodOptional<z.ZodString>;
|
|
123
|
+
since: z.ZodISODateTime;
|
|
124
|
+
}, z.core.$strip>>;
|
|
125
|
+
usage: z.ZodNullable<z.ZodObject<{
|
|
126
|
+
input: z.ZodNumber;
|
|
127
|
+
cacheWrite: z.ZodNumber;
|
|
128
|
+
cacheWrite1h: z.ZodNumber;
|
|
129
|
+
cacheRead: z.ZodNumber;
|
|
130
|
+
output: z.ZodNumber;
|
|
131
|
+
model: z.ZodString;
|
|
132
|
+
context: z.ZodNumber;
|
|
133
|
+
over100k: z.ZodObject<{
|
|
134
|
+
input: z.ZodNumber;
|
|
135
|
+
cacheWrite: z.ZodNumber;
|
|
136
|
+
cacheWrite1h: z.ZodNumber;
|
|
137
|
+
cacheRead: z.ZodNumber;
|
|
138
|
+
output: z.ZodNumber;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
at: z.ZodISODateTime;
|
|
141
|
+
}, z.core.$strip>>;
|
|
142
|
+
checkout: z.ZodOptional<z.ZodString>;
|
|
143
|
+
branch: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
144
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
145
|
+
}, z.core.$strip>>;
|
|
146
|
+
edits: z.ZodArray<z.ZodObject<{
|
|
147
|
+
agent: z.ZodString;
|
|
148
|
+
file: z.ZodString;
|
|
149
|
+
at: z.ZodISODateTime;
|
|
150
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
151
|
+
}, z.core.$strip>>;
|
|
152
|
+
reads: z.ZodArray<z.ZodObject<{
|
|
153
|
+
agent: z.ZodString;
|
|
154
|
+
file: z.ZodString;
|
|
155
|
+
at: z.ZodISODateTime;
|
|
156
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
157
|
+
}, z.core.$strip>>;
|
|
158
|
+
waits: z.ZodArray<z.ZodObject<{
|
|
159
|
+
waiter: z.ZodString;
|
|
160
|
+
on: z.ZodString;
|
|
161
|
+
since: z.ZodISODateTime;
|
|
162
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
163
|
+
}, z.core.$strip>>;
|
|
164
|
+
reports: z.ZodArray<z.ZodObject<{
|
|
165
|
+
agent: z.ZodString;
|
|
166
|
+
at: z.ZodISODateTime;
|
|
167
|
+
text: z.ZodString;
|
|
168
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
169
|
+
}, z.core.$strip>>;
|
|
170
|
+
questions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
171
|
+
id: z.ZodString;
|
|
172
|
+
agent: z.ZodString;
|
|
173
|
+
at: z.ZodISODateTime;
|
|
174
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
175
|
+
question: z.ZodString;
|
|
176
|
+
header: z.ZodString;
|
|
177
|
+
options: z.ZodArray<z.ZodObject<{
|
|
178
|
+
label: z.ZodString;
|
|
179
|
+
description: z.ZodString;
|
|
180
|
+
}, z.core.$strip>>;
|
|
181
|
+
multiSelect: z.ZodBoolean;
|
|
182
|
+
}, z.core.$strip>>;
|
|
183
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
184
|
+
}, z.core.$strip>>>;
|
|
185
|
+
}, z.core.$strip>;
|
|
186
|
+
}, z.core.$strip>;
|
|
187
|
+
/** What changed since the last message. `seq` goes up by one per message, so a gap shows. */
|
|
188
|
+
export declare const ChangesMessageSchema: z.ZodObject<{
|
|
189
|
+
type: z.ZodLiteral<"changes">;
|
|
190
|
+
v: z.ZodLiteral<1>;
|
|
191
|
+
seq: z.ZodNumber;
|
|
192
|
+
upsert: z.ZodObject<{
|
|
193
|
+
session: z.ZodOptional<z.ZodObject<{
|
|
194
|
+
id: z.ZodString;
|
|
195
|
+
source: z.ZodEnum<{
|
|
196
|
+
"claude-code": "claude-code";
|
|
197
|
+
}>;
|
|
198
|
+
lead: z.ZodString;
|
|
199
|
+
title: z.ZodNullable<z.ZodString>;
|
|
200
|
+
titleFrom: z.ZodEnum<{
|
|
201
|
+
branch: "branch";
|
|
202
|
+
source: "source";
|
|
203
|
+
}>;
|
|
204
|
+
branch: z.ZodNullable<z.ZodString>;
|
|
205
|
+
checkout: z.ZodOptional<z.ZodString>;
|
|
206
|
+
lastActive: z.ZodISODateTime;
|
|
207
|
+
status: z.ZodEnum<{
|
|
208
|
+
active: "active";
|
|
209
|
+
idle: "idle";
|
|
210
|
+
}>;
|
|
211
|
+
lights: z.ZodEnum<{
|
|
212
|
+
off: "off";
|
|
213
|
+
on: "on";
|
|
214
|
+
}>;
|
|
215
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
216
|
+
}, z.core.$strip>>;
|
|
217
|
+
agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
218
|
+
id: z.ZodString;
|
|
219
|
+
source: z.ZodEnum<{
|
|
220
|
+
"claude-code": "claude-code";
|
|
221
|
+
}>;
|
|
222
|
+
session: z.ZodString;
|
|
223
|
+
startedBy: z.ZodNullable<z.ZodString>;
|
|
224
|
+
agentType: z.ZodNullable<z.ZodString>;
|
|
225
|
+
task: z.ZodNullable<z.ZodString>;
|
|
226
|
+
status: z.ZodEnum<{
|
|
227
|
+
done: "done";
|
|
228
|
+
failed: "failed";
|
|
229
|
+
idle: "idle";
|
|
230
|
+
stalled: "stalled";
|
|
231
|
+
stopped: "stopped";
|
|
232
|
+
working: "working";
|
|
233
|
+
}>;
|
|
234
|
+
statusSince: z.ZodISODateTime;
|
|
235
|
+
lastActive: z.ZodISODateTime;
|
|
236
|
+
doing: z.ZodNullable<z.ZodObject<{
|
|
237
|
+
kind: z.ZodEnum<{
|
|
238
|
+
read: "read";
|
|
239
|
+
run: "run";
|
|
240
|
+
search: "search";
|
|
241
|
+
talk: "talk";
|
|
242
|
+
write: "write";
|
|
243
|
+
}>;
|
|
244
|
+
file: z.ZodOptional<z.ZodString>;
|
|
245
|
+
since: z.ZodISODateTime;
|
|
246
|
+
}, z.core.$strip>>;
|
|
247
|
+
usage: z.ZodNullable<z.ZodObject<{
|
|
248
|
+
input: z.ZodNumber;
|
|
249
|
+
cacheWrite: z.ZodNumber;
|
|
250
|
+
cacheWrite1h: z.ZodNumber;
|
|
251
|
+
cacheRead: z.ZodNumber;
|
|
252
|
+
output: z.ZodNumber;
|
|
253
|
+
model: z.ZodString;
|
|
254
|
+
context: z.ZodNumber;
|
|
255
|
+
over100k: z.ZodObject<{
|
|
256
|
+
input: z.ZodNumber;
|
|
257
|
+
cacheWrite: z.ZodNumber;
|
|
258
|
+
cacheWrite1h: z.ZodNumber;
|
|
259
|
+
cacheRead: z.ZodNumber;
|
|
260
|
+
output: z.ZodNumber;
|
|
261
|
+
}, z.core.$strip>;
|
|
262
|
+
at: z.ZodISODateTime;
|
|
263
|
+
}, z.core.$strip>>;
|
|
264
|
+
checkout: z.ZodOptional<z.ZodString>;
|
|
265
|
+
branch: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
266
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
267
|
+
}, z.core.$strip>>>;
|
|
268
|
+
edits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
269
|
+
agent: z.ZodString;
|
|
270
|
+
file: z.ZodString;
|
|
271
|
+
at: z.ZodISODateTime;
|
|
272
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
273
|
+
}, z.core.$strip>>>;
|
|
274
|
+
reads: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
275
|
+
agent: z.ZodString;
|
|
276
|
+
file: z.ZodString;
|
|
277
|
+
at: z.ZodISODateTime;
|
|
278
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
279
|
+
}, z.core.$strip>>>;
|
|
280
|
+
waits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
281
|
+
waiter: z.ZodString;
|
|
282
|
+
on: z.ZodString;
|
|
283
|
+
since: z.ZodISODateTime;
|
|
284
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
285
|
+
}, z.core.$strip>>>;
|
|
286
|
+
reports: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
287
|
+
agent: z.ZodString;
|
|
288
|
+
at: z.ZodISODateTime;
|
|
289
|
+
text: z.ZodString;
|
|
290
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
291
|
+
}, z.core.$strip>>>;
|
|
292
|
+
questions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
293
|
+
id: z.ZodString;
|
|
294
|
+
agent: z.ZodString;
|
|
295
|
+
at: z.ZodISODateTime;
|
|
296
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
297
|
+
question: z.ZodString;
|
|
298
|
+
header: z.ZodString;
|
|
299
|
+
options: z.ZodArray<z.ZodObject<{
|
|
300
|
+
label: z.ZodString;
|
|
301
|
+
description: z.ZodString;
|
|
302
|
+
}, z.core.$strip>>;
|
|
303
|
+
multiSelect: z.ZodBoolean;
|
|
304
|
+
}, z.core.$strip>>;
|
|
305
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
306
|
+
}, z.core.$strip>>>;
|
|
307
|
+
}, z.core.$strip>;
|
|
308
|
+
remove: z.ZodObject<{
|
|
309
|
+
agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
310
|
+
edits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
311
|
+
agent: z.ZodString;
|
|
312
|
+
file: z.ZodString;
|
|
313
|
+
}, z.core.$strip>>>;
|
|
314
|
+
reads: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
315
|
+
agent: z.ZodString;
|
|
316
|
+
file: z.ZodString;
|
|
317
|
+
}, z.core.$strip>>>;
|
|
318
|
+
waits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
319
|
+
waiter: z.ZodString;
|
|
320
|
+
on: z.ZodString;
|
|
321
|
+
}, z.core.$strip>>>;
|
|
322
|
+
reports: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
323
|
+
questions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
324
|
+
}, z.core.$strip>;
|
|
325
|
+
}, z.core.$strip>;
|
|
326
|
+
/** The answer to a request, carrying the request's id and kind. */
|
|
327
|
+
export declare const ReplyMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
328
|
+
type: z.ZodLiteral<"reply">;
|
|
329
|
+
v: z.ZodLiteral<1>;
|
|
330
|
+
id: z.ZodString;
|
|
331
|
+
kind: z.ZodLiteral<"answer-question">;
|
|
332
|
+
answer: z.ZodString;
|
|
333
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
334
|
+
type: z.ZodLiteral<"reply">;
|
|
335
|
+
v: z.ZodLiteral<1>;
|
|
336
|
+
id: z.ZodString;
|
|
337
|
+
kind: z.ZodLiteral<"write-brief">;
|
|
338
|
+
handoff: z.ZodObject<{
|
|
339
|
+
id: z.ZodString;
|
|
340
|
+
brief: z.ZodString;
|
|
341
|
+
repos: z.ZodArray<z.ZodObject<{
|
|
342
|
+
path: z.ZodString;
|
|
343
|
+
remote: z.ZodString;
|
|
344
|
+
branch: z.ZodString;
|
|
345
|
+
commit: z.ZodString;
|
|
346
|
+
}, z.core.$strip>>;
|
|
347
|
+
}, z.core.$strip>;
|
|
348
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
349
|
+
type: z.ZodLiteral<"reply">;
|
|
350
|
+
v: z.ZodLiteral<1>;
|
|
351
|
+
id: z.ZodString;
|
|
352
|
+
kind: z.ZodLiteral<"owner-answer">;
|
|
353
|
+
}, z.core.$strip>], "kind">;
|
|
354
|
+
/**
|
|
355
|
+
* A request the machine won't answer, sent in place of its reply. `over-cap` names the cap it would
|
|
356
|
+
* go over. `withheld` means the secret scan matched; the reply follows if the owner releases it.
|
|
357
|
+
* `unavailable` is anything else that stops the room answering now, such as its checkout being gone,
|
|
358
|
+
* its lead being mid-turn or a push being rejected.
|
|
359
|
+
*/
|
|
360
|
+
export declare const RefusalMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
361
|
+
type: z.ZodLiteral<"refusal">;
|
|
362
|
+
v: z.ZodLiteral<1>;
|
|
363
|
+
id: z.ZodString;
|
|
364
|
+
reason: z.ZodLiteral<"over-cap">;
|
|
365
|
+
cap: z.ZodEnum<{
|
|
366
|
+
"owner-day": "owner-day";
|
|
367
|
+
"owner-tokens": "owner-tokens";
|
|
368
|
+
"room-hour": "room-hour";
|
|
369
|
+
}>;
|
|
370
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
371
|
+
type: z.ZodLiteral<"refusal">;
|
|
372
|
+
v: z.ZodLiteral<1>;
|
|
373
|
+
id: z.ZodString;
|
|
374
|
+
reason: z.ZodLiteral<"withheld">;
|
|
375
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
376
|
+
type: z.ZodLiteral<"refusal">;
|
|
377
|
+
v: z.ZodLiteral<1>;
|
|
378
|
+
id: z.ZodString;
|
|
379
|
+
reason: z.ZodLiteral<"unavailable">;
|
|
380
|
+
detail: z.ZodString;
|
|
381
|
+
}, z.core.$strip>], "reason">;
|
|
382
|
+
/**
|
|
383
|
+
* The sender's session handed its room over with the command: its agent wrote the brief and pushed.
|
|
384
|
+
* `to` is the receiver as the sender named them, for the server to find in the office.
|
|
385
|
+
*/
|
|
386
|
+
export declare const HandOverMessageSchema: z.ZodObject<{
|
|
387
|
+
type: z.ZodLiteral<"hand-over">;
|
|
388
|
+
v: z.ZodLiteral<1>;
|
|
389
|
+
to: z.ZodString;
|
|
390
|
+
handoff: z.ZodObject<{
|
|
391
|
+
id: z.ZodString;
|
|
392
|
+
brief: z.ZodString;
|
|
393
|
+
repos: z.ZodArray<z.ZodObject<{
|
|
394
|
+
path: z.ZodString;
|
|
395
|
+
remote: z.ZodString;
|
|
396
|
+
branch: z.ZodString;
|
|
397
|
+
commit: z.ZodString;
|
|
398
|
+
}, z.core.$strip>>;
|
|
399
|
+
}, z.core.$strip>;
|
|
400
|
+
}, z.core.$strip>;
|
|
401
|
+
/** The receiver's session asks for the handoff a take code stands for. */
|
|
402
|
+
export declare const TakeMessageSchema: z.ZodObject<{
|
|
403
|
+
type: z.ZodLiteral<"take">;
|
|
404
|
+
v: z.ZodLiteral<1>;
|
|
405
|
+
code: z.ZodString;
|
|
406
|
+
}, z.core.$strip>;
|
|
407
|
+
/**
|
|
408
|
+
* The receiver took the handoff and joins its room. Each step that failed is listed with the repo it
|
|
409
|
+
* was for and the end of its output; the session opens anyway.
|
|
410
|
+
*/
|
|
411
|
+
export declare const TakenMessageSchema: z.ZodObject<{
|
|
412
|
+
type: z.ZodLiteral<"taken">;
|
|
413
|
+
v: z.ZodLiteral<1>;
|
|
414
|
+
handoff: z.ZodString;
|
|
415
|
+
failures: z.ZodArray<z.ZodObject<{
|
|
416
|
+
step: z.ZodEnum<{
|
|
417
|
+
checkout: "checkout";
|
|
418
|
+
open: "open";
|
|
419
|
+
setup: "setup";
|
|
420
|
+
worktree: "worktree";
|
|
421
|
+
}>;
|
|
422
|
+
repo: z.ZodOptional<z.ZodString>;
|
|
423
|
+
output: z.ZodString;
|
|
424
|
+
}, z.core.$strip>>;
|
|
425
|
+
}, z.core.$strip>;
|
|
426
|
+
export declare const DataLayerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
427
|
+
type: z.ZodLiteral<"hello">;
|
|
428
|
+
v: z.ZodLiteral<1>;
|
|
429
|
+
source: z.ZodEnum<{
|
|
430
|
+
"claude-code": "claude-code";
|
|
431
|
+
}>;
|
|
432
|
+
account: z.ZodObject<{
|
|
433
|
+
id: z.ZodString;
|
|
434
|
+
name: z.ZodString;
|
|
435
|
+
}, z.core.$strip>;
|
|
436
|
+
machine: z.ZodObject<{
|
|
437
|
+
name: z.ZodString;
|
|
438
|
+
}, z.core.$strip>;
|
|
439
|
+
session: z.ZodString;
|
|
440
|
+
project: z.ZodObject<{
|
|
441
|
+
id: z.ZodString;
|
|
442
|
+
name: z.ZodString;
|
|
443
|
+
}, z.core.$strip>;
|
|
444
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
445
|
+
type: z.ZodLiteral<"runner">;
|
|
446
|
+
v: z.ZodLiteral<1>;
|
|
447
|
+
account: z.ZodObject<{
|
|
448
|
+
id: z.ZodString;
|
|
449
|
+
name: z.ZodString;
|
|
450
|
+
}, z.core.$strip>;
|
|
451
|
+
machine: z.ZodObject<{
|
|
452
|
+
name: z.ZodString;
|
|
453
|
+
}, z.core.$strip>;
|
|
454
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
455
|
+
type: z.ZodLiteral<"full">;
|
|
456
|
+
v: z.ZodLiteral<1>;
|
|
457
|
+
seq: z.ZodNumber;
|
|
458
|
+
facts: z.ZodObject<{
|
|
459
|
+
session: z.ZodObject<{
|
|
460
|
+
id: z.ZodString;
|
|
461
|
+
source: z.ZodEnum<{
|
|
462
|
+
"claude-code": "claude-code";
|
|
463
|
+
}>;
|
|
464
|
+
lead: z.ZodString;
|
|
465
|
+
title: z.ZodNullable<z.ZodString>;
|
|
466
|
+
titleFrom: z.ZodEnum<{
|
|
467
|
+
branch: "branch";
|
|
468
|
+
source: "source";
|
|
469
|
+
}>;
|
|
470
|
+
branch: z.ZodNullable<z.ZodString>;
|
|
471
|
+
checkout: z.ZodOptional<z.ZodString>;
|
|
472
|
+
lastActive: z.ZodISODateTime;
|
|
473
|
+
status: z.ZodEnum<{
|
|
474
|
+
active: "active";
|
|
475
|
+
idle: "idle";
|
|
476
|
+
}>;
|
|
477
|
+
lights: z.ZodEnum<{
|
|
478
|
+
off: "off";
|
|
479
|
+
on: "on";
|
|
480
|
+
}>;
|
|
481
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
482
|
+
}, z.core.$strip>;
|
|
483
|
+
agents: z.ZodArray<z.ZodObject<{
|
|
484
|
+
id: z.ZodString;
|
|
485
|
+
source: z.ZodEnum<{
|
|
486
|
+
"claude-code": "claude-code";
|
|
487
|
+
}>;
|
|
488
|
+
session: z.ZodString;
|
|
489
|
+
startedBy: z.ZodNullable<z.ZodString>;
|
|
490
|
+
agentType: z.ZodNullable<z.ZodString>;
|
|
491
|
+
task: z.ZodNullable<z.ZodString>;
|
|
492
|
+
status: z.ZodEnum<{
|
|
493
|
+
done: "done";
|
|
494
|
+
failed: "failed";
|
|
495
|
+
idle: "idle";
|
|
496
|
+
stalled: "stalled";
|
|
497
|
+
stopped: "stopped";
|
|
498
|
+
working: "working";
|
|
499
|
+
}>;
|
|
500
|
+
statusSince: z.ZodISODateTime;
|
|
501
|
+
lastActive: z.ZodISODateTime;
|
|
502
|
+
doing: z.ZodNullable<z.ZodObject<{
|
|
503
|
+
kind: z.ZodEnum<{
|
|
504
|
+
read: "read";
|
|
505
|
+
run: "run";
|
|
506
|
+
search: "search";
|
|
507
|
+
talk: "talk";
|
|
508
|
+
write: "write";
|
|
509
|
+
}>;
|
|
510
|
+
file: z.ZodOptional<z.ZodString>;
|
|
511
|
+
since: z.ZodISODateTime;
|
|
512
|
+
}, z.core.$strip>>;
|
|
513
|
+
usage: z.ZodNullable<z.ZodObject<{
|
|
514
|
+
input: z.ZodNumber;
|
|
515
|
+
cacheWrite: z.ZodNumber;
|
|
516
|
+
cacheWrite1h: z.ZodNumber;
|
|
517
|
+
cacheRead: z.ZodNumber;
|
|
518
|
+
output: z.ZodNumber;
|
|
519
|
+
model: z.ZodString;
|
|
520
|
+
context: z.ZodNumber;
|
|
521
|
+
over100k: z.ZodObject<{
|
|
522
|
+
input: z.ZodNumber;
|
|
523
|
+
cacheWrite: z.ZodNumber;
|
|
524
|
+
cacheWrite1h: z.ZodNumber;
|
|
525
|
+
cacheRead: z.ZodNumber;
|
|
526
|
+
output: z.ZodNumber;
|
|
527
|
+
}, z.core.$strip>;
|
|
528
|
+
at: z.ZodISODateTime;
|
|
529
|
+
}, z.core.$strip>>;
|
|
530
|
+
checkout: z.ZodOptional<z.ZodString>;
|
|
531
|
+
branch: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
532
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
533
|
+
}, z.core.$strip>>;
|
|
534
|
+
edits: z.ZodArray<z.ZodObject<{
|
|
535
|
+
agent: z.ZodString;
|
|
536
|
+
file: z.ZodString;
|
|
537
|
+
at: z.ZodISODateTime;
|
|
538
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
539
|
+
}, z.core.$strip>>;
|
|
540
|
+
reads: z.ZodArray<z.ZodObject<{
|
|
541
|
+
agent: z.ZodString;
|
|
542
|
+
file: z.ZodString;
|
|
543
|
+
at: z.ZodISODateTime;
|
|
544
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
545
|
+
}, z.core.$strip>>;
|
|
546
|
+
waits: z.ZodArray<z.ZodObject<{
|
|
547
|
+
waiter: z.ZodString;
|
|
548
|
+
on: z.ZodString;
|
|
549
|
+
since: z.ZodISODateTime;
|
|
550
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
551
|
+
}, z.core.$strip>>;
|
|
552
|
+
reports: z.ZodArray<z.ZodObject<{
|
|
553
|
+
agent: z.ZodString;
|
|
554
|
+
at: z.ZodISODateTime;
|
|
555
|
+
text: z.ZodString;
|
|
556
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
557
|
+
}, z.core.$strip>>;
|
|
558
|
+
questions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
559
|
+
id: z.ZodString;
|
|
560
|
+
agent: z.ZodString;
|
|
561
|
+
at: z.ZodISODateTime;
|
|
562
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
563
|
+
question: z.ZodString;
|
|
564
|
+
header: z.ZodString;
|
|
565
|
+
options: z.ZodArray<z.ZodObject<{
|
|
566
|
+
label: z.ZodString;
|
|
567
|
+
description: z.ZodString;
|
|
568
|
+
}, z.core.$strip>>;
|
|
569
|
+
multiSelect: z.ZodBoolean;
|
|
570
|
+
}, z.core.$strip>>;
|
|
571
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
572
|
+
}, z.core.$strip>>>;
|
|
573
|
+
}, z.core.$strip>;
|
|
574
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
575
|
+
type: z.ZodLiteral<"changes">;
|
|
576
|
+
v: z.ZodLiteral<1>;
|
|
577
|
+
seq: z.ZodNumber;
|
|
578
|
+
upsert: z.ZodObject<{
|
|
579
|
+
session: z.ZodOptional<z.ZodObject<{
|
|
580
|
+
id: z.ZodString;
|
|
581
|
+
source: z.ZodEnum<{
|
|
582
|
+
"claude-code": "claude-code";
|
|
583
|
+
}>;
|
|
584
|
+
lead: z.ZodString;
|
|
585
|
+
title: z.ZodNullable<z.ZodString>;
|
|
586
|
+
titleFrom: z.ZodEnum<{
|
|
587
|
+
branch: "branch";
|
|
588
|
+
source: "source";
|
|
589
|
+
}>;
|
|
590
|
+
branch: z.ZodNullable<z.ZodString>;
|
|
591
|
+
checkout: z.ZodOptional<z.ZodString>;
|
|
592
|
+
lastActive: z.ZodISODateTime;
|
|
593
|
+
status: z.ZodEnum<{
|
|
594
|
+
active: "active";
|
|
595
|
+
idle: "idle";
|
|
596
|
+
}>;
|
|
597
|
+
lights: z.ZodEnum<{
|
|
598
|
+
off: "off";
|
|
599
|
+
on: "on";
|
|
600
|
+
}>;
|
|
601
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
602
|
+
}, z.core.$strip>>;
|
|
603
|
+
agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
604
|
+
id: z.ZodString;
|
|
605
|
+
source: z.ZodEnum<{
|
|
606
|
+
"claude-code": "claude-code";
|
|
607
|
+
}>;
|
|
608
|
+
session: z.ZodString;
|
|
609
|
+
startedBy: z.ZodNullable<z.ZodString>;
|
|
610
|
+
agentType: z.ZodNullable<z.ZodString>;
|
|
611
|
+
task: z.ZodNullable<z.ZodString>;
|
|
612
|
+
status: z.ZodEnum<{
|
|
613
|
+
done: "done";
|
|
614
|
+
failed: "failed";
|
|
615
|
+
idle: "idle";
|
|
616
|
+
stalled: "stalled";
|
|
617
|
+
stopped: "stopped";
|
|
618
|
+
working: "working";
|
|
619
|
+
}>;
|
|
620
|
+
statusSince: z.ZodISODateTime;
|
|
621
|
+
lastActive: z.ZodISODateTime;
|
|
622
|
+
doing: z.ZodNullable<z.ZodObject<{
|
|
623
|
+
kind: z.ZodEnum<{
|
|
624
|
+
read: "read";
|
|
625
|
+
run: "run";
|
|
626
|
+
search: "search";
|
|
627
|
+
talk: "talk";
|
|
628
|
+
write: "write";
|
|
629
|
+
}>;
|
|
630
|
+
file: z.ZodOptional<z.ZodString>;
|
|
631
|
+
since: z.ZodISODateTime;
|
|
632
|
+
}, z.core.$strip>>;
|
|
633
|
+
usage: z.ZodNullable<z.ZodObject<{
|
|
634
|
+
input: z.ZodNumber;
|
|
635
|
+
cacheWrite: z.ZodNumber;
|
|
636
|
+
cacheWrite1h: z.ZodNumber;
|
|
637
|
+
cacheRead: z.ZodNumber;
|
|
638
|
+
output: z.ZodNumber;
|
|
639
|
+
model: z.ZodString;
|
|
640
|
+
context: z.ZodNumber;
|
|
641
|
+
over100k: z.ZodObject<{
|
|
642
|
+
input: z.ZodNumber;
|
|
643
|
+
cacheWrite: z.ZodNumber;
|
|
644
|
+
cacheWrite1h: z.ZodNumber;
|
|
645
|
+
cacheRead: z.ZodNumber;
|
|
646
|
+
output: z.ZodNumber;
|
|
647
|
+
}, z.core.$strip>;
|
|
648
|
+
at: z.ZodISODateTime;
|
|
649
|
+
}, z.core.$strip>>;
|
|
650
|
+
checkout: z.ZodOptional<z.ZodString>;
|
|
651
|
+
branch: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
652
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
653
|
+
}, z.core.$strip>>>;
|
|
654
|
+
edits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
655
|
+
agent: z.ZodString;
|
|
656
|
+
file: z.ZodString;
|
|
657
|
+
at: z.ZodISODateTime;
|
|
658
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
659
|
+
}, z.core.$strip>>>;
|
|
660
|
+
reads: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
661
|
+
agent: z.ZodString;
|
|
662
|
+
file: z.ZodString;
|
|
663
|
+
at: z.ZodISODateTime;
|
|
664
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
665
|
+
}, z.core.$strip>>>;
|
|
666
|
+
waits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
667
|
+
waiter: z.ZodString;
|
|
668
|
+
on: z.ZodString;
|
|
669
|
+
since: z.ZodISODateTime;
|
|
670
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
671
|
+
}, z.core.$strip>>>;
|
|
672
|
+
reports: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
673
|
+
agent: z.ZodString;
|
|
674
|
+
at: z.ZodISODateTime;
|
|
675
|
+
text: z.ZodString;
|
|
676
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
677
|
+
}, z.core.$strip>>>;
|
|
678
|
+
questions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
679
|
+
id: z.ZodString;
|
|
680
|
+
agent: z.ZodString;
|
|
681
|
+
at: z.ZodISODateTime;
|
|
682
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
683
|
+
question: z.ZodString;
|
|
684
|
+
header: z.ZodString;
|
|
685
|
+
options: z.ZodArray<z.ZodObject<{
|
|
686
|
+
label: z.ZodString;
|
|
687
|
+
description: z.ZodString;
|
|
688
|
+
}, z.core.$strip>>;
|
|
689
|
+
multiSelect: z.ZodBoolean;
|
|
690
|
+
}, z.core.$strip>>;
|
|
691
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
692
|
+
}, z.core.$strip>>>;
|
|
693
|
+
}, z.core.$strip>;
|
|
694
|
+
remove: z.ZodObject<{
|
|
695
|
+
agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
696
|
+
edits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
697
|
+
agent: z.ZodString;
|
|
698
|
+
file: z.ZodString;
|
|
699
|
+
}, z.core.$strip>>>;
|
|
700
|
+
reads: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
701
|
+
agent: z.ZodString;
|
|
702
|
+
file: z.ZodString;
|
|
703
|
+
}, z.core.$strip>>>;
|
|
704
|
+
waits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
705
|
+
waiter: z.ZodString;
|
|
706
|
+
on: z.ZodString;
|
|
707
|
+
}, z.core.$strip>>>;
|
|
708
|
+
reports: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
709
|
+
questions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
710
|
+
}, z.core.$strip>;
|
|
711
|
+
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
712
|
+
type: z.ZodLiteral<"reply">;
|
|
713
|
+
v: z.ZodLiteral<1>;
|
|
714
|
+
id: z.ZodString;
|
|
715
|
+
kind: z.ZodLiteral<"answer-question">;
|
|
716
|
+
answer: z.ZodString;
|
|
717
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
718
|
+
type: z.ZodLiteral<"reply">;
|
|
719
|
+
v: z.ZodLiteral<1>;
|
|
720
|
+
id: z.ZodString;
|
|
721
|
+
kind: z.ZodLiteral<"write-brief">;
|
|
722
|
+
handoff: z.ZodObject<{
|
|
723
|
+
id: z.ZodString;
|
|
724
|
+
brief: z.ZodString;
|
|
725
|
+
repos: z.ZodArray<z.ZodObject<{
|
|
726
|
+
path: z.ZodString;
|
|
727
|
+
remote: z.ZodString;
|
|
728
|
+
branch: z.ZodString;
|
|
729
|
+
commit: z.ZodString;
|
|
730
|
+
}, z.core.$strip>>;
|
|
731
|
+
}, z.core.$strip>;
|
|
732
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
733
|
+
type: z.ZodLiteral<"reply">;
|
|
734
|
+
v: z.ZodLiteral<1>;
|
|
735
|
+
id: z.ZodString;
|
|
736
|
+
kind: z.ZodLiteral<"owner-answer">;
|
|
737
|
+
}, z.core.$strip>], "kind">, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
738
|
+
type: z.ZodLiteral<"refusal">;
|
|
739
|
+
v: z.ZodLiteral<1>;
|
|
740
|
+
id: z.ZodString;
|
|
741
|
+
reason: z.ZodLiteral<"over-cap">;
|
|
742
|
+
cap: z.ZodEnum<{
|
|
743
|
+
"owner-day": "owner-day";
|
|
744
|
+
"owner-tokens": "owner-tokens";
|
|
745
|
+
"room-hour": "room-hour";
|
|
746
|
+
}>;
|
|
747
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
748
|
+
type: z.ZodLiteral<"refusal">;
|
|
749
|
+
v: z.ZodLiteral<1>;
|
|
750
|
+
id: z.ZodString;
|
|
751
|
+
reason: z.ZodLiteral<"withheld">;
|
|
752
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
753
|
+
type: z.ZodLiteral<"refusal">;
|
|
754
|
+
v: z.ZodLiteral<1>;
|
|
755
|
+
id: z.ZodString;
|
|
756
|
+
reason: z.ZodLiteral<"unavailable">;
|
|
757
|
+
detail: z.ZodString;
|
|
758
|
+
}, z.core.$strip>], "reason">, z.ZodObject<{
|
|
759
|
+
type: z.ZodLiteral<"hand-over">;
|
|
760
|
+
v: z.ZodLiteral<1>;
|
|
761
|
+
to: z.ZodString;
|
|
762
|
+
handoff: z.ZodObject<{
|
|
763
|
+
id: z.ZodString;
|
|
764
|
+
brief: z.ZodString;
|
|
765
|
+
repos: z.ZodArray<z.ZodObject<{
|
|
766
|
+
path: z.ZodString;
|
|
767
|
+
remote: z.ZodString;
|
|
768
|
+
branch: z.ZodString;
|
|
769
|
+
commit: z.ZodString;
|
|
770
|
+
}, z.core.$strip>>;
|
|
771
|
+
}, z.core.$strip>;
|
|
772
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
773
|
+
type: z.ZodLiteral<"take">;
|
|
774
|
+
v: z.ZodLiteral<1>;
|
|
775
|
+
code: z.ZodString;
|
|
776
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
777
|
+
type: z.ZodLiteral<"taken">;
|
|
778
|
+
v: z.ZodLiteral<1>;
|
|
779
|
+
handoff: z.ZodString;
|
|
780
|
+
failures: z.ZodArray<z.ZodObject<{
|
|
781
|
+
step: z.ZodEnum<{
|
|
782
|
+
checkout: "checkout";
|
|
783
|
+
open: "open";
|
|
784
|
+
setup: "setup";
|
|
785
|
+
worktree: "worktree";
|
|
786
|
+
}>;
|
|
787
|
+
repo: z.ZodOptional<z.ZodString>;
|
|
788
|
+
output: z.ZodString;
|
|
789
|
+
}, z.core.$strip>>;
|
|
790
|
+
}, z.core.$strip>], "type">;
|
|
791
|
+
/** Asks the data layer to send its facts in full. */
|
|
792
|
+
export declare const RepairMessageSchema: z.ZodObject<{
|
|
793
|
+
type: z.ZodLiteral<"repair">;
|
|
794
|
+
v: z.ZodLiteral<1>;
|
|
795
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
796
|
+
}, z.core.$strip>;
|
|
797
|
+
/** A note for the later editor of `file`, which the data layer adds to `agent`'s next tool result. */
|
|
798
|
+
export declare const ConflictMessageSchema: z.ZodObject<{
|
|
799
|
+
type: z.ZodLiteral<"conflict">;
|
|
800
|
+
v: z.ZodLiteral<1>;
|
|
801
|
+
agent: z.ZodString;
|
|
802
|
+
file: z.ZodString;
|
|
803
|
+
text: z.ZodString;
|
|
804
|
+
}, z.core.$strip>;
|
|
805
|
+
/** Something the data layer should show. */
|
|
806
|
+
export declare const ErrorMessageSchema: z.ZodObject<{
|
|
807
|
+
type: z.ZodLiteral<"error">;
|
|
808
|
+
v: z.ZodLiteral<1>;
|
|
809
|
+
code: z.ZodString;
|
|
810
|
+
message: z.ZodString;
|
|
811
|
+
}, z.core.$strip>;
|
|
812
|
+
/**
|
|
813
|
+
* Something for the machine to answer, with a reply or a refusal carrying the same id. `session` is
|
|
814
|
+
* the session it concerns: the lead whose fork answers or writes the brief, or the session whose
|
|
815
|
+
* agent asked its owner. `room` is the room the caps count against.
|
|
816
|
+
*/
|
|
817
|
+
export declare const RequestMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
818
|
+
type: z.ZodLiteral<"request">;
|
|
819
|
+
v: z.ZodLiteral<1>;
|
|
820
|
+
id: z.ZodString;
|
|
821
|
+
kind: z.ZodLiteral<"answer-question">;
|
|
822
|
+
session: z.ZodString;
|
|
823
|
+
room: z.ZodString;
|
|
824
|
+
from: z.ZodObject<{
|
|
825
|
+
id: z.ZodString;
|
|
826
|
+
name: z.ZodString;
|
|
827
|
+
}, z.core.$strip>;
|
|
828
|
+
question: z.ZodString;
|
|
829
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
830
|
+
type: z.ZodLiteral<"request">;
|
|
831
|
+
v: z.ZodLiteral<1>;
|
|
832
|
+
id: z.ZodString;
|
|
833
|
+
kind: z.ZodLiteral<"write-brief">;
|
|
834
|
+
session: z.ZodString;
|
|
835
|
+
room: z.ZodString;
|
|
836
|
+
handoff: z.ZodString;
|
|
837
|
+
to: z.ZodObject<{
|
|
838
|
+
id: z.ZodString;
|
|
839
|
+
name: z.ZodString;
|
|
840
|
+
}, z.core.$strip>;
|
|
841
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
842
|
+
type: z.ZodLiteral<"request">;
|
|
843
|
+
v: z.ZodLiteral<1>;
|
|
844
|
+
id: z.ZodString;
|
|
845
|
+
kind: z.ZodLiteral<"owner-answer">;
|
|
846
|
+
session: z.ZodString;
|
|
847
|
+
question: z.ZodString;
|
|
848
|
+
answers: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
849
|
+
}, z.core.$strip>], "kind">;
|
|
850
|
+
/** The owner released a reply the secret scan withheld, so the machine sends it now. */
|
|
851
|
+
export declare const ReleaseMessageSchema: z.ZodObject<{
|
|
852
|
+
type: z.ZodLiteral<"release">;
|
|
853
|
+
v: z.ZodLiteral<1>;
|
|
854
|
+
id: z.ZodString;
|
|
855
|
+
}, z.core.$strip>;
|
|
856
|
+
/**
|
|
857
|
+
* A handoff for the receiver to take: sent to their runner when they take it from the floor, or to
|
|
858
|
+
* their session in answer to a take code.
|
|
859
|
+
*/
|
|
860
|
+
export declare const HandoffMessageSchema: z.ZodObject<{
|
|
861
|
+
type: z.ZodLiteral<"handoff">;
|
|
862
|
+
v: z.ZodLiteral<1>;
|
|
863
|
+
handoff: z.ZodObject<{
|
|
864
|
+
id: z.ZodString;
|
|
865
|
+
brief: z.ZodString;
|
|
866
|
+
repos: z.ZodArray<z.ZodObject<{
|
|
867
|
+
path: z.ZodString;
|
|
868
|
+
remote: z.ZodString;
|
|
869
|
+
branch: z.ZodString;
|
|
870
|
+
commit: z.ZodString;
|
|
871
|
+
}, z.core.$strip>>;
|
|
872
|
+
}, z.core.$strip>;
|
|
873
|
+
}, z.core.$strip>;
|
|
874
|
+
export declare const OfficeServerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
875
|
+
type: z.ZodLiteral<"repair">;
|
|
876
|
+
v: z.ZodLiteral<1>;
|
|
877
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
878
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
879
|
+
type: z.ZodLiteral<"conflict">;
|
|
880
|
+
v: z.ZodLiteral<1>;
|
|
881
|
+
agent: z.ZodString;
|
|
882
|
+
file: z.ZodString;
|
|
883
|
+
text: z.ZodString;
|
|
884
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
885
|
+
type: z.ZodLiteral<"error">;
|
|
886
|
+
v: z.ZodLiteral<1>;
|
|
887
|
+
code: z.ZodString;
|
|
888
|
+
message: z.ZodString;
|
|
889
|
+
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
890
|
+
type: z.ZodLiteral<"request">;
|
|
891
|
+
v: z.ZodLiteral<1>;
|
|
892
|
+
id: z.ZodString;
|
|
893
|
+
kind: z.ZodLiteral<"answer-question">;
|
|
894
|
+
session: z.ZodString;
|
|
895
|
+
room: z.ZodString;
|
|
896
|
+
from: z.ZodObject<{
|
|
897
|
+
id: z.ZodString;
|
|
898
|
+
name: z.ZodString;
|
|
899
|
+
}, z.core.$strip>;
|
|
900
|
+
question: z.ZodString;
|
|
901
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
902
|
+
type: z.ZodLiteral<"request">;
|
|
903
|
+
v: z.ZodLiteral<1>;
|
|
904
|
+
id: z.ZodString;
|
|
905
|
+
kind: z.ZodLiteral<"write-brief">;
|
|
906
|
+
session: z.ZodString;
|
|
907
|
+
room: z.ZodString;
|
|
908
|
+
handoff: z.ZodString;
|
|
909
|
+
to: z.ZodObject<{
|
|
910
|
+
id: z.ZodString;
|
|
911
|
+
name: z.ZodString;
|
|
912
|
+
}, z.core.$strip>;
|
|
913
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
914
|
+
type: z.ZodLiteral<"request">;
|
|
915
|
+
v: z.ZodLiteral<1>;
|
|
916
|
+
id: z.ZodString;
|
|
917
|
+
kind: z.ZodLiteral<"owner-answer">;
|
|
918
|
+
session: z.ZodString;
|
|
919
|
+
question: z.ZodString;
|
|
920
|
+
answers: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
921
|
+
}, z.core.$strip>], "kind">, z.ZodObject<{
|
|
922
|
+
type: z.ZodLiteral<"release">;
|
|
923
|
+
v: z.ZodLiteral<1>;
|
|
924
|
+
id: z.ZodString;
|
|
925
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
926
|
+
type: z.ZodLiteral<"handoff">;
|
|
927
|
+
v: z.ZodLiteral<1>;
|
|
928
|
+
handoff: z.ZodObject<{
|
|
929
|
+
id: z.ZodString;
|
|
930
|
+
brief: z.ZodString;
|
|
931
|
+
repos: z.ZodArray<z.ZodObject<{
|
|
932
|
+
path: z.ZodString;
|
|
933
|
+
remote: z.ZodString;
|
|
934
|
+
branch: z.ZodString;
|
|
935
|
+
commit: z.ZodString;
|
|
936
|
+
}, z.core.$strip>>;
|
|
937
|
+
}, z.core.$strip>;
|
|
938
|
+
}, z.core.$strip>], "type">;
|
|
939
|
+
export type Project = z.infer<typeof ProjectSchema>;
|
|
940
|
+
export type HandoffRepo = z.infer<typeof HandoffRepoSchema>;
|
|
941
|
+
export type Handoff = z.infer<typeof HandoffSchema>;
|
|
942
|
+
export type HelloMessage = z.infer<typeof HelloMessageSchema>;
|
|
943
|
+
export type RunnerHelloMessage = z.infer<typeof RunnerHelloMessageSchema>;
|
|
944
|
+
export type FullMessage = z.infer<typeof FullMessageSchema>;
|
|
945
|
+
export type ChangesMessage = z.infer<typeof ChangesMessageSchema>;
|
|
946
|
+
export type ReplyMessage = z.infer<typeof ReplyMessageSchema>;
|
|
947
|
+
export type RefusalMessage = z.infer<typeof RefusalMessageSchema>;
|
|
948
|
+
export type HandOverMessage = z.infer<typeof HandOverMessageSchema>;
|
|
949
|
+
export type TakeMessage = z.infer<typeof TakeMessageSchema>;
|
|
950
|
+
export type TakenMessage = z.infer<typeof TakenMessageSchema>;
|
|
951
|
+
export type DataLayerMessage = z.infer<typeof DataLayerMessageSchema>;
|
|
952
|
+
export type RepairMessage = z.infer<typeof RepairMessageSchema>;
|
|
953
|
+
export type ConflictMessage = z.infer<typeof ConflictMessageSchema>;
|
|
954
|
+
export type ErrorMessage = z.infer<typeof ErrorMessageSchema>;
|
|
955
|
+
export type RequestMessage = z.infer<typeof RequestMessageSchema>;
|
|
956
|
+
export type RequestKind = RequestMessage["kind"];
|
|
957
|
+
export type ReleaseMessage = z.infer<typeof ReleaseMessageSchema>;
|
|
958
|
+
export type HandoffMessage = z.infer<typeof HandoffMessageSchema>;
|
|
959
|
+
export type OfficeServerMessage = z.infer<typeof OfficeServerMessageSchema>;
|
|
960
|
+
/**
|
|
961
|
+
* A parsed message, or why it was refused: `unsupported-version` when it carries a protocol
|
|
962
|
+
* version this side doesn't speak, `invalid` for anything else wrong with it.
|
|
963
|
+
*/
|
|
964
|
+
export type ParseResult<T> = {
|
|
965
|
+
ok: true;
|
|
966
|
+
message: T;
|
|
967
|
+
} | {
|
|
968
|
+
ok: false;
|
|
969
|
+
kind: "invalid" | "unsupported-version";
|
|
970
|
+
error: string;
|
|
971
|
+
};
|
|
972
|
+
/** Validates a message an office server received from a data layer. */
|
|
973
|
+
export declare function parseDataLayerMessage(value: unknown): ParseResult<DataLayerMessage>;
|
|
974
|
+
/** Validates a message a data layer received from an office server. */
|
|
975
|
+
export declare function parseOfficeServerMessage(value: unknown): ParseResult<OfficeServerMessage>;
|