@agentshouse/kit-wire 0.0.0-stage → 0.1.0-c29e71be8eca8

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