@agentshouse/kit-wire 0.0.0-placeholder → 0.1.0-c0f6ddeaad2f1

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/dist/wire.d.ts ADDED
@@ -0,0 +1,521 @@
1
+ import { z } from 'zod';
2
+ export declare const KIT_WIRE_HEADER = "x-house-kit-wire";
3
+ export declare const KIT_COMMANDS: z.ZodObject<{
4
+ linux: z.ZodString;
5
+ windows: z.ZodString;
6
+ }, z.core.$strict>;
7
+ export type KitCommands = z.infer<typeof KIT_COMMANDS>;
8
+ export declare const BUILDING_KIT: z.ZodObject<{
9
+ release: z.ZodString;
10
+ commands: z.ZodObject<{
11
+ linux: z.ZodString;
12
+ windows: z.ZodString;
13
+ }, z.core.$strict>;
14
+ }, z.core.$strict>;
15
+ export type BuildingKit = z.infer<typeof BUILDING_KIT>;
16
+ export declare const KIT_DECLARATION: {
17
+ header: string;
18
+ connection: {
19
+ path: string;
20
+ protocol: string;
21
+ calls: {
22
+ open: z.ZodObject<{
23
+ type: z.ZodLiteral<"input">;
24
+ input_id: z.ZodUUID;
25
+ conversation_id: z.ZodUUID;
26
+ agent_id: z.ZodUUID;
27
+ provider_session_id: z.ZodNullable<z.ZodString>;
28
+ kind: z.ZodLiteral<"open">;
29
+ model: z.ZodOptional<z.ZodString>;
30
+ effort: z.ZodOptional<z.ZodString>;
31
+ afk: z.ZodOptional<z.ZodLiteral<true>>;
32
+ }, z.core.$strict>;
33
+ kill: z.ZodObject<{
34
+ type: z.ZodLiteral<"input">;
35
+ input_id: z.ZodUUID;
36
+ conversation_id: z.ZodUUID;
37
+ agent_id: z.ZodUUID;
38
+ provider_session_id: z.ZodNullable<z.ZodString>;
39
+ kind: z.ZodLiteral<"kill">;
40
+ }, z.core.$strict>;
41
+ done: z.ZodObject<{
42
+ type: z.ZodLiteral<"input">;
43
+ input_id: z.ZodUUID;
44
+ conversation_id: z.ZodUUID;
45
+ agent_id: z.ZodUUID;
46
+ provider_session_id: z.ZodNullable<z.ZodString>;
47
+ kind: z.ZodLiteral<"done">;
48
+ }, z.core.$strict>;
49
+ message: z.ZodObject<{
50
+ type: z.ZodLiteral<"input">;
51
+ input_id: z.ZodUUID;
52
+ conversation_id: z.ZodUUID;
53
+ agent_id: z.ZodUUID;
54
+ provider_session_id: z.ZodNullable<z.ZodString>;
55
+ kind: z.ZodLiteral<"message">;
56
+ model: z.ZodOptional<z.ZodString>;
57
+ effort: z.ZodOptional<z.ZodString>;
58
+ message_id: z.ZodUUID;
59
+ text: z.ZodString;
60
+ first: z.ZodBoolean;
61
+ at_once: z.ZodOptional<z.ZodLiteral<true>>;
62
+ recent: z.ZodOptional<z.ZodString>;
63
+ afk: z.ZodOptional<z.ZodLiteral<true>>;
64
+ }, z.core.$strict>;
65
+ take_out: z.ZodObject<{
66
+ type: z.ZodLiteral<"input">;
67
+ input_id: z.ZodUUID;
68
+ conversation_id: z.ZodUUID;
69
+ agent_id: z.ZodUUID;
70
+ provider_session_id: z.ZodNullable<z.ZodString>;
71
+ kind: z.ZodLiteral<"take_out">;
72
+ message_id: z.ZodUUID;
73
+ }, z.core.$strict>;
74
+ interrupt: z.ZodObject<{
75
+ type: z.ZodLiteral<"input">;
76
+ input_id: z.ZodUUID;
77
+ conversation_id: z.ZodUUID;
78
+ agent_id: z.ZodUUID;
79
+ provider_session_id: z.ZodNullable<z.ZodString>;
80
+ kind: z.ZodLiteral<"interrupt">;
81
+ turn_id: z.ZodUUID;
82
+ }, z.core.$strict>;
83
+ answer: z.ZodObject<{
84
+ type: z.ZodLiteral<"input">;
85
+ input_id: z.ZodUUID;
86
+ conversation_id: z.ZodUUID;
87
+ agent_id: z.ZodUUID;
88
+ provider_session_id: z.ZodNullable<z.ZodString>;
89
+ kind: z.ZodLiteral<"answer">;
90
+ model: z.ZodOptional<z.ZodString>;
91
+ effort: z.ZodOptional<z.ZodString>;
92
+ interaction_id: z.ZodUUID;
93
+ response: z.ZodUnknown;
94
+ request: z.ZodUnknown;
95
+ }, z.core.$strict>;
96
+ option: z.ZodObject<{
97
+ type: z.ZodLiteral<"input">;
98
+ input_id: z.ZodUUID;
99
+ conversation_id: z.ZodUUID;
100
+ agent_id: z.ZodUUID;
101
+ provider_session_id: z.ZodNullable<z.ZodString>;
102
+ kind: z.ZodLiteral<"option">;
103
+ model: z.ZodOptional<z.ZodString>;
104
+ effort: z.ZodOptional<z.ZodString>;
105
+ }, z.core.$strict>;
106
+ sign_in: z.ZodObject<{
107
+ type: z.ZodLiteral<"input">;
108
+ input_id: z.ZodUUID;
109
+ conversation_id: z.ZodNull;
110
+ agent_id: z.ZodNull;
111
+ provider_session_id: z.ZodNull;
112
+ kind: z.ZodLiteral<"sign_in">;
113
+ cli: z.ZodString;
114
+ ends_in: z.ZodInt;
115
+ api_key: z.ZodOptional<z.ZodLiteral<true>>;
116
+ }, z.core.$strict>;
117
+ update: z.ZodObject<{
118
+ type: z.ZodLiteral<"input">;
119
+ input_id: z.ZodUUID;
120
+ conversation_id: z.ZodNull;
121
+ agent_id: z.ZodNull;
122
+ provider_session_id: z.ZodNull;
123
+ kind: z.ZodLiteral<"update">;
124
+ release: z.ZodString;
125
+ }, z.core.$strict>;
126
+ settings: z.ZodObject<{
127
+ type: z.ZodLiteral<"input">;
128
+ input_id: z.ZodUUID;
129
+ conversation_id: z.ZodNull;
130
+ agent_id: z.ZodNull;
131
+ provider_session_id: z.ZodNull;
132
+ kind: z.ZodLiteral<"settings">;
133
+ skills: z.ZodOptional<z.ZodBoolean>;
134
+ workspace: z.ZodOptional<z.ZodString>;
135
+ }, z.core.$strict>;
136
+ run_wizard: z.ZodObject<{
137
+ type: z.ZodLiteral<"input">;
138
+ input_id: z.ZodUUID;
139
+ conversation_id: z.ZodNull;
140
+ agent_id: z.ZodNull;
141
+ provider_session_id: z.ZodNull;
142
+ kind: z.ZodLiteral<"run_wizard">;
143
+ script: z.ZodString;
144
+ }, z.core.$strict>;
145
+ run_function: z.ZodObject<{
146
+ type: z.ZodLiteral<"input">;
147
+ input_id: z.ZodUUID;
148
+ conversation_id: z.ZodNull;
149
+ agent_id: z.ZodNull;
150
+ provider_session_id: z.ZodNull;
151
+ kind: z.ZodLiteral<"run_function">;
152
+ script: z.ZodString;
153
+ input: z.ZodUnknown;
154
+ terminal: z.ZodBoolean;
155
+ time_cap: z.ZodInt;
156
+ output_cap: z.ZodInt;
157
+ }, z.core.$strict>;
158
+ };
159
+ results: z.ZodUnion<readonly [z.ZodObject<{
160
+ provider_session_id: z.ZodString;
161
+ }, z.core.$strict>, z.ZodObject<{
162
+ refused: z.ZodString;
163
+ resume_refused: z.ZodOptional<z.ZodLiteral<true>>;
164
+ }, z.core.$strict>, z.ZodObject<{
165
+ exit_code: z.ZodInt;
166
+ }, z.core.$strict>, z.ZodObject<{
167
+ output: z.ZodString;
168
+ cut: z.ZodBoolean;
169
+ exit_code: z.ZodInt;
170
+ }, z.core.$strict>, z.ZodObject<{
171
+ output: z.ZodString;
172
+ cut: z.ZodBoolean;
173
+ timed_out: z.ZodLiteral<true>;
174
+ }, z.core.$strict>, z.ZodObject<{
175
+ started: z.ZodLiteral<true>;
176
+ }, z.core.$strict>, z.ZodObject<{
177
+ settings: z.ZodObject<{
178
+ skills: z.ZodBoolean;
179
+ workspace: z.ZodString;
180
+ }, z.core.$strict>;
181
+ }, z.core.$strict>, z.ZodObject<{}, z.core.$strict>]>;
182
+ house: {
183
+ beat: z.ZodObject<{
184
+ type: z.ZodLiteral<"beat">;
185
+ }, z.core.$strict>;
186
+ watching: z.ZodObject<{
187
+ type: z.ZodLiteral<"watching">;
188
+ watching: z.ZodBoolean;
189
+ }, z.core.$strict>;
190
+ work_available: z.ZodObject<{
191
+ type: z.ZodLiteral<"work_available">;
192
+ subject: z.ZodLiteral<"agents">;
193
+ }, z.core.$strict>;
194
+ wizard_input: z.ZodObject<{
195
+ type: z.ZodLiteral<"wizard_input">;
196
+ wizard: z.ZodUUID;
197
+ data: z.ZodString;
198
+ }, z.core.$strict>;
199
+ wizard_size: z.ZodObject<{
200
+ type: z.ZodLiteral<"wizard_size">;
201
+ wizard: z.ZodUUID;
202
+ cols: z.ZodInt;
203
+ rows: z.ZodInt;
204
+ }, z.core.$strict>;
205
+ wizard_end: z.ZodObject<{
206
+ type: z.ZodLiteral<"wizard_end">;
207
+ wizard: z.ZodUUID;
208
+ }, z.core.$strict>;
209
+ refused: z.ZodObject<{
210
+ type: z.ZodLiteral<"refused">;
211
+ code: z.ZodLiteral<"invalid_message">;
212
+ }, z.core.$strict>;
213
+ };
214
+ kit: {
215
+ turn: z.ZodObject<{
216
+ conversation_id: z.ZodUUID;
217
+ type: z.ZodLiteral<"turn">;
218
+ turn_id: z.ZodUUID;
219
+ operation: z.ZodUnknown;
220
+ }, z.core.$strict>;
221
+ process: z.ZodObject<{
222
+ conversation_id: z.ZodUUID;
223
+ type: z.ZodLiteral<"process">;
224
+ running: z.ZodBoolean;
225
+ }, z.core.$strict>;
226
+ commands: z.ZodObject<{
227
+ conversation_id: z.ZodUUID;
228
+ type: z.ZodLiteral<"commands">;
229
+ commands: z.ZodArray<z.ZodObject<{
230
+ name: z.ZodString;
231
+ description: z.ZodString;
232
+ input: z.ZodOptional<z.ZodNullable<z.ZodObject<{
233
+ hint: z.ZodString;
234
+ }, z.core.$loose>>>;
235
+ }, z.core.$loose>>;
236
+ }, z.core.$strict>;
237
+ options: z.ZodObject<{
238
+ conversation_id: z.ZodUUID;
239
+ type: z.ZodLiteral<"options">;
240
+ options: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
241
+ id: z.ZodString;
242
+ name: z.ZodString;
243
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
244
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
245
+ type: z.ZodLiteral<"select">;
246
+ currentValue: z.ZodString;
247
+ options: z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
248
+ value: z.ZodString;
249
+ name: z.ZodString;
250
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
251
+ }, z.core.$loose>>, z.ZodArray<z.ZodObject<{
252
+ group: z.ZodString;
253
+ name: z.ZodString;
254
+ options: z.ZodArray<z.ZodObject<{
255
+ value: z.ZodString;
256
+ name: z.ZodString;
257
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
258
+ }, z.core.$loose>>;
259
+ }, z.core.$loose>>]>;
260
+ }, z.core.$loose>, z.ZodObject<{
261
+ id: z.ZodString;
262
+ name: z.ZodString;
263
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
264
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
265
+ type: z.ZodLiteral<"boolean">;
266
+ currentValue: z.ZodBoolean;
267
+ }, z.core.$loose>], "type">>;
268
+ }, z.core.$strict>;
269
+ starting: z.ZodObject<{
270
+ conversation_id: z.ZodUUID;
271
+ type: z.ZodLiteral<"starting">;
272
+ step: z.ZodNullable<z.ZodEnum<{
273
+ session: "session";
274
+ transcription: "transcription";
275
+ }>>;
276
+ }, z.core.$strict>;
277
+ state: z.ZodObject<{
278
+ conversation_id: z.ZodUUID;
279
+ type: z.ZodLiteral<"state">;
280
+ state: z.ZodUnknown;
281
+ }, z.core.$strict>;
282
+ wizard_output: z.ZodObject<{
283
+ type: z.ZodLiteral<"wizard_output">;
284
+ wizard: z.ZodUUID;
285
+ data: z.ZodString;
286
+ }, z.core.$strict>;
287
+ };
288
+ };
289
+ acts: {
290
+ 'secret-inputs/await': import("./acts.ts").KitActDeclaration<"subject", z.ZodObject<{
291
+ steps: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
292
+ kind: z.ZodLiteral<"visit">;
293
+ label: z.ZodString;
294
+ url: z.ZodString;
295
+ }, z.core.$strict>, z.ZodObject<{
296
+ kind: z.ZodLiteral<"show">;
297
+ label: z.ZodString;
298
+ text: z.ZodString;
299
+ }, z.core.$strict>, z.ZodObject<{
300
+ kind: z.ZodLiteral<"collect">;
301
+ label: z.ZodString;
302
+ name: z.ZodString;
303
+ description: z.ZodOptional<z.ZodString>;
304
+ optional: z.ZodOptional<z.ZodLiteral<true>>;
305
+ }, z.core.$strict>], "kind">>;
306
+ }, z.core.$strict>, z.ZodDiscriminatedUnion<[z.ZodObject<{
307
+ outcome: z.ZodLiteral<"collected">;
308
+ content: z.ZodRecord<z.ZodString, z.ZodString>;
309
+ }, z.core.$strict>, z.ZodObject<{
310
+ outcome: z.ZodLiteral<"released">;
311
+ release: z.ZodEnum<{
312
+ held: "held";
313
+ superseded: "superseded";
314
+ withdrawn: "withdrawn";
315
+ }>;
316
+ }, z.core.$strict>], "outcome">>;
317
+ 'agents/report': import("./acts.ts").KitActDeclaration<never, z.ZodObject<{
318
+ os: z.ZodString;
319
+ kit_release: z.ZodString;
320
+ wire: z.ZodString;
321
+ form: z.ZodOptional<z.ZodEnum<{
322
+ desktop: "desktop";
323
+ laptop: "laptop";
324
+ server: "server";
325
+ }>>;
326
+ ssh_host_key: z.ZodOptional<z.ZodString>;
327
+ agent_base: z.ZodOptional<z.ZodString>;
328
+ reinstall: z.ZodOptional<z.ZodEnum<{
329
+ linux: "linux";
330
+ windows: "windows";
331
+ }>>;
332
+ settings: z.ZodOptional<z.ZodObject<{
333
+ skills: z.ZodBoolean;
334
+ workspace: z.ZodString;
335
+ }, z.core.$strict>>;
336
+ agents: z.ZodArray<z.ZodObject<{
337
+ kind: z.ZodString;
338
+ release: z.ZodNullable<z.ZodString>;
339
+ minimum: z.ZodOptional<z.ZodString>;
340
+ update: z.ZodOptional<z.ZodString>;
341
+ failure: z.ZodNullable<z.ZodString>;
342
+ installing: z.ZodOptional<z.ZodLiteral<true>>;
343
+ signed_in: z.ZodBoolean;
344
+ api_key: z.ZodOptional<z.ZodLiteral<true>>;
345
+ provider: z.ZodOptional<z.ZodString>;
346
+ models: z.ZodArray<z.ZodObject<{
347
+ model: z.ZodString;
348
+ name: z.ZodString;
349
+ efforts: z.ZodArray<z.ZodString>;
350
+ }, z.core.$strict>>;
351
+ default_model: z.ZodOptional<z.ZodString>;
352
+ default_effort: z.ZodOptional<z.ZodString>;
353
+ modes: z.ZodArray<z.ZodObject<{
354
+ mode: z.ZodString;
355
+ name: z.ZodString;
356
+ }, z.core.$strict>>;
357
+ full_access: z.ZodNullable<z.ZodString>;
358
+ }, z.core.$strict>>;
359
+ transcription: z.ZodOptional<z.ZodObject<{
360
+ installed: z.ZodBoolean;
361
+ failure: z.ZodNullable<z.ZodString>;
362
+ no_engine: z.ZodOptional<z.ZodLiteral<true>>;
363
+ }, z.core.$strict>>;
364
+ }, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
365
+ 'agents/desired/list': import("./acts.ts").KitActDeclaration<never, z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
366
+ agents: z.ZodArray<z.ZodString>;
367
+ routes: z.ZodArray<z.ZodObject<{
368
+ agent_id: z.ZodUUID;
369
+ kind: z.ZodString;
370
+ base_instructions: z.ZodString;
371
+ working_directory: z.ZodString;
372
+ model: z.ZodNullable<z.ZodString>;
373
+ effort: z.ZodNullable<z.ZodString>;
374
+ mode: z.ZodNullable<z.ZodString>;
375
+ }, z.core.$strict>>;
376
+ transcribe: z.ZodBoolean;
377
+ }, z.core.$strict>>;
378
+ 'kit-calls/results/return': import("./acts.ts").KitActDeclaration<"call", z.ZodUnion<readonly [z.ZodObject<{
379
+ provider_session_id: z.ZodString;
380
+ }, z.core.$strict>, z.ZodObject<{
381
+ refused: z.ZodString;
382
+ resume_refused: z.ZodOptional<z.ZodLiteral<true>>;
383
+ }, z.core.$strict>, z.ZodObject<{
384
+ exit_code: z.ZodInt;
385
+ }, z.core.$strict>, z.ZodObject<{
386
+ output: z.ZodString;
387
+ cut: z.ZodBoolean;
388
+ exit_code: z.ZodInt;
389
+ }, z.core.$strict>, z.ZodObject<{
390
+ output: z.ZodString;
391
+ cut: z.ZodBoolean;
392
+ timed_out: z.ZodLiteral<true>;
393
+ }, z.core.$strict>, z.ZodObject<{
394
+ started: z.ZodLiteral<true>;
395
+ }, z.core.$strict>, z.ZodObject<{
396
+ settings: z.ZodObject<{
397
+ skills: z.ZodBoolean;
398
+ workspace: z.ZodString;
399
+ }, z.core.$strict>;
400
+ }, z.core.$strict>, z.ZodObject<{}, z.core.$strict>]>, z.ZodObject<{}, z.core.$strict>>;
401
+ 'turns/start': import("./acts.ts").KitActDeclaration<"conversation" | "turn", z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
402
+ run: z.ZodOptional<z.ZodLiteral<true>>;
403
+ }, z.core.$strict>>;
404
+ 'turns/activity/report': import("./acts.ts").KitActDeclaration<"conversation" | "turn", z.ZodObject<{}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
405
+ 'turns/end': import("./acts.ts").KitActDeclaration<"conversation" | "turn", z.ZodObject<{
406
+ content: z.ZodUnknown;
407
+ failed: z.ZodOptional<z.ZodString>;
408
+ }, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
409
+ 'turns/images/declare': import("./acts.ts").KitActDeclaration<"conversation" | "turn", z.ZodObject<{
410
+ bytes: z.ZodInt;
411
+ sha256: z.ZodString;
412
+ name: z.ZodString;
413
+ media_type: z.ZodString;
414
+ }, z.core.$strict>, {
415
+ door: string;
416
+ }>;
417
+ 'transcripts/keep': import("./acts.ts").KitActDeclaration<"conversation" | "message", z.ZodObject<{
418
+ path: z.ZodString;
419
+ text: z.ZodString;
420
+ }, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
421
+ 'uploads/finish': import("./acts.ts").KitActDeclaration<never, z.ZodObject<{
422
+ upload: z.ZodUUID;
423
+ part_sha256: z.ZodArray<z.ZodString>;
424
+ }, z.core.$strict>, {
425
+ door: string;
426
+ }>;
427
+ 'conversations/interaction/ask': import("./acts.ts").KitActDeclaration<"conversation" | "turn", z.ZodObject<{
428
+ interaction_id: z.ZodUUID;
429
+ request: z.ZodJSONSchema;
430
+ secret: z.ZodBoolean;
431
+ }, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
432
+ 'kits/report-idle': import("./acts.ts").KitActDeclaration<never, z.ZodObject<{}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
433
+ 'kits/report-restart': import("./acts.ts").KitActDeclaration<never, z.ZodObject<{
434
+ planned: z.ZodOptional<z.ZodLiteral<true>>;
435
+ }, z.core.$strict>, z.ZodObject<{}, z.core.$strict>>;
436
+ 'conversations/credentials/issue': import("./acts.ts").KitActDeclaration<"conversation", z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
437
+ credential: z.ZodString;
438
+ }, z.core.$strict>>;
439
+ 'kits/log-out': import("./acts.ts").KitActDeclaration<never, z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
440
+ environment: z.ZodUUID;
441
+ revoked: z.ZodLiteral<true>;
442
+ }, z.core.$strict>>;
443
+ 'local-copies/selection/read': import("./acts.ts").KitActDeclaration<never, z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
444
+ local_copy: z.ZodObject<{
445
+ rooms: z.ZodArray<z.ZodObject<{
446
+ room_ref: z.ZodString;
447
+ room_handle: z.ZodString;
448
+ }, z.core.$strict>>;
449
+ }, z.core.$strict>;
450
+ }, z.core.$strict>>;
451
+ 'function-runs/credentials/issue': import("./acts.ts").KitActDeclaration<"run", z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
452
+ credential: z.ZodString;
453
+ }, z.core.$strict>>;
454
+ };
455
+ door: readonly ["rooms/discover", "room-chunks/list", "changes/enumerate", "files/revisions/list", "update"];
456
+ changes: {
457
+ binary: z.ZodObject<{
458
+ path: z.ZodString;
459
+ revision: z.ZodString;
460
+ bytes: z.ZodInt;
461
+ sha256: z.ZodString;
462
+ }, z.core.$strip>;
463
+ };
464
+ meta: {
465
+ run: string;
466
+ };
467
+ login: {
468
+ paths: {
469
+ readonly start: '/kit';
470
+ readonly poll: '/kit/token';
471
+ };
472
+ start: {
473
+ request: z.ZodObject<{
474
+ act: z.ZodEnum<{
475
+ existing_environment: "existing_environment";
476
+ new_environment: "new_environment";
477
+ }>;
478
+ environment_id: z.ZodOptional<z.ZodUUID>;
479
+ headless: z.ZodOptional<z.ZodLiteral<true>>;
480
+ rooms: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
481
+ reach: z.ZodLiteral<"all">;
482
+ }, z.core.$strict>, z.ZodObject<{
483
+ reach: z.ZodLiteral<"all_but_private">;
484
+ }, z.core.$strict>, z.ZodObject<{
485
+ reach: z.ZodLiteral<"selected">;
486
+ refs: z.ZodArray<z.ZodString>;
487
+ }, z.core.$strict>], "reach">>;
488
+ code_challenge: z.ZodString;
489
+ }, z.core.$strict>;
490
+ answer: z.ZodObject<{
491
+ start_url: z.ZodURL;
492
+ login: z.ZodUUID;
493
+ }, z.core.$strict>;
494
+ };
495
+ poll: {
496
+ request: z.ZodUnion<readonly [z.ZodObject<{
497
+ login: z.ZodUUID;
498
+ code_verifier: z.ZodString;
499
+ }, z.core.$strict>, z.ZodObject<{
500
+ code: z.ZodString;
501
+ }, z.core.$strict>]>;
502
+ answer: z.ZodObject<{
503
+ credential: z.ZodString;
504
+ environment: z.ZodUUID;
505
+ user: z.ZodUUID;
506
+ headless_credential: z.ZodOptional<z.ZodString>;
507
+ }, z.core.$strict>;
508
+ };
509
+ };
510
+ refusal: z.ZodObject<{
511
+ release: z.ZodString;
512
+ commands: z.ZodObject<{
513
+ linux: z.ZodString;
514
+ windows: z.ZodString;
515
+ }, z.core.$strict>;
516
+ }, z.core.$strict>;
517
+ };
518
+ export declare function kitWire(declaration: object): string;
519
+ export declare const KIT_WIRE: string;
520
+ export type KitWireRefusal = 'kit_declaration_invalid' | 'kit_update_required';
521
+ export declare function kitWireRefusal(named: string | readonly string[] | undefined): KitWireRefusal | null;
package/dist/wire.js ADDED
@@ -0,0 +1,57 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { z } from 'zod';
3
+ import { FUNCTION_RUN_META_KEY, KIT_ACTS, KIT_BINARY_CHANGE, KIT_DOOR_ACTS } from './acts.js';
4
+ import { HOUSE_ONE_WAY_CALLS, KIT_CALL_RESULT, KIT_CALLS, KIT_CONNECTION_PATH, KIT_CONNECTION_PROTOCOL_PREFIX, KIT_ONE_WAY_CALLS, } from './connection.js';
5
+ import { KIT_LOGIN_ISSUED, KIT_LOGIN_PATHS, KIT_LOGIN_POLL, KIT_LOGIN_START, KIT_LOGIN_STARTED, } from './enrollment.js';
6
+ const WIRE_HEX_LENGTH = 16;
7
+ export const KIT_WIRE_HEADER = 'x-house-kit-wire';
8
+ export const KIT_COMMANDS = z.strictObject({
9
+ linux: z.string(),
10
+ windows: z.string(),
11
+ });
12
+ export const BUILDING_KIT = z.strictObject({ release: z.string(), commands: KIT_COMMANDS });
13
+ export const KIT_DECLARATION = {
14
+ header: KIT_WIRE_HEADER,
15
+ connection: {
16
+ path: KIT_CONNECTION_PATH,
17
+ protocol: KIT_CONNECTION_PROTOCOL_PREFIX,
18
+ calls: KIT_CALLS,
19
+ results: KIT_CALL_RESULT,
20
+ house: HOUSE_ONE_WAY_CALLS,
21
+ kit: KIT_ONE_WAY_CALLS,
22
+ },
23
+ acts: KIT_ACTS,
24
+ door: KIT_DOOR_ACTS,
25
+ changes: { binary: KIT_BINARY_CHANGE },
26
+ meta: { run: FUNCTION_RUN_META_KEY },
27
+ login: {
28
+ paths: KIT_LOGIN_PATHS,
29
+ start: { request: KIT_LOGIN_START, answer: KIT_LOGIN_STARTED },
30
+ poll: { request: KIT_LOGIN_POLL, answer: KIT_LOGIN_ISSUED },
31
+ },
32
+ refusal: BUILDING_KIT,
33
+ };
34
+ function isSchema(value) {
35
+ return '_zod' in value;
36
+ }
37
+ function described(value) {
38
+ if (typeof value !== 'object' || value === null)
39
+ return value;
40
+ if (Array.isArray(value))
41
+ return value.map(described);
42
+ if (isSchema(value))
43
+ return z.toJSONSchema(value, { unrepresentable: 'any' });
44
+ return Object.fromEntries(Object.entries(value).map(([name, held]) => [name, described(held)]));
45
+ }
46
+ export function kitWire(declaration) {
47
+ return createHash('sha256')
48
+ .update(JSON.stringify(described(declaration)))
49
+ .digest('hex')
50
+ .slice(0, WIRE_HEX_LENGTH);
51
+ }
52
+ export const KIT_WIRE = 'd3d9efae0f268730';
53
+ export function kitWireRefusal(named) {
54
+ if (typeof named !== 'string')
55
+ return 'kit_declaration_invalid';
56
+ return named === KIT_WIRE ? null : 'kit_update_required';
57
+ }
package/package.json CHANGED
@@ -1 +1,38 @@
1
- {"name":"@agentshouse/kit-wire","version":"0.0.0-placeholder","license":"MIT","description":"Reserves the name."}
1
+ {
2
+ "name": "@agentshouse/kit-wire",
3
+ "description": "The Kit wire: every shape House and the Kit exchange, the Kit connection's frames and every /kit/ request and answer, and the wire computed from them",
4
+ "license": "MIT",
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
10
+ "engines": {
11
+ "node": ">=24.22.1"
12
+ },
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "default": "./dist/index.js"
17
+ },
18
+ "./arguments": {
19
+ "types": "./dist/arguments.d.ts",
20
+ "default": "./dist/arguments.js"
21
+ },
22
+ "./package.json": "./package.json"
23
+ },
24
+ "files": [
25
+ "dist",
26
+ "README.md",
27
+ "LICENSE"
28
+ ],
29
+ "dependencies": {
30
+ "zod": "4.6.7"
31
+ },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/agentshouse/core.git",
35
+ "directory": "kit-wire"
36
+ },
37
+ "version": "0.1.0-c0f6ddeaad2f1"
38
+ }