@agentshouse/app-bridge 0.1.0-cedebf3bb1f58 → 0.1.0-cefd2eeb54a01

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 (64) hide show
  1. package/README.md +11 -11
  2. package/dist/index.d.ts +881 -19
  3. package/dist/mdmodel/definition.d.ts +17 -1
  4. package/dist/mdmodel/document.d.ts +5 -5
  5. package/dist/mdmodel/event.d.ts +77 -0
  6. package/dist/mdmodel/facts.d.ts +14 -0
  7. package/dist/mdmodel/index.d.ts +24 -9
  8. package/dist/mdmodel/kinds.d.ts +18 -0
  9. package/dist/mdmodel/links.d.ts +28 -0
  10. package/dist/mdmodel/paths.d.ts +9 -1
  11. package/dist/mdmodel/pattern.d.ts +9 -0
  12. package/dist/mdmodel/project.d.ts +1 -0
  13. package/dist/mdmodel/query/language.d.ts +222 -0
  14. package/dist/mdmodel/query/match.d.ts +13 -0
  15. package/dist/mdmodel/query/rows.d.ts +31 -0
  16. package/dist/mdmodel/query/sql.d.ts +38 -0
  17. package/dist/mdmodel/reserved.d.ts +4 -0
  18. package/dist/mdmodel/types.d.ts +35 -4
  19. package/dist/mdmodel/validate.d.ts +30 -4
  20. package/dist/mdruntime/adapter.d.ts +144 -79
  21. package/dist/mdruntime/binary.d.ts +0 -5
  22. package/dist/mdruntime/chain.d.ts +11 -0
  23. package/dist/mdruntime/change-set.d.ts +9 -16
  24. package/dist/mdruntime/change.d.ts +32 -1
  25. package/dist/mdruntime/client.d.ts +22 -10
  26. package/dist/mdruntime/collection.d.ts +11 -21
  27. package/dist/mdruntime/compile.d.ts +10 -0
  28. package/dist/mdruntime/connection.d.ts +32 -19
  29. package/dist/mdruntime/conversation.d.ts +34 -17
  30. package/dist/mdruntime/durability.d.ts +7 -4
  31. package/dist/mdruntime/identity.d.ts +5 -0
  32. package/dist/mdruntime/media.d.ts +7 -0
  33. package/dist/mdruntime/messages.d.ts +27 -0
  34. package/dist/mdruntime/model.d.ts +8 -10
  35. package/dist/mdruntime/observation.d.ts +17 -2
  36. package/dist/mdruntime/opened.d.ts +21 -0
  37. package/dist/mdruntime/outcome.d.ts +45 -7
  38. package/dist/mdruntime/overlay.d.ts +3 -5
  39. package/dist/mdruntime/query.d.ts +15 -190
  40. package/dist/mdruntime/reach.d.ts +18 -9
  41. package/dist/mdruntime/readiness.d.ts +14 -17
  42. package/dist/mdruntime/recovery.d.ts +3 -2
  43. package/dist/mdruntime/replica.d.ts +58 -33
  44. package/dist/mdruntime/room-draft.d.ts +25 -6
  45. package/dist/mdruntime/save.d.ts +53 -14
  46. package/dist/mdruntime/search.d.ts +12 -82
  47. package/dist/mdruntime/status.d.ts +4 -5
  48. package/dist/mdruntime/store.d.ts +156 -108
  49. package/dist/mdruntime/stored.d.ts +155 -0
  50. package/dist/mdruntime/tables.d.ts +380 -0
  51. package/dist/mdruntime/wire.d.ts +42 -5
  52. package/dist/test-host.d.ts +7 -4
  53. package/dist/test-host.js +19 -29
  54. package/docs/families.md +69 -53
  55. package/package.json +8 -3
  56. package/dist/calls.d.ts +0 -117
  57. package/dist/calls.js +0 -1
  58. package/dist/mdmodel/condition.d.ts +0 -149
  59. package/dist/mdruntime/acquisition.d.ts +0 -13
  60. package/dist/mdruntime/file.d.ts +0 -19
  61. package/dist/mdruntime/rows.d.ts +0 -37
  62. package/dist/mdruntime/shared.d.ts +0 -10
  63. package/dist/mdruntime/transfer.d.ts +0 -9
  64. package/dist/mdruntime/turn.d.ts +0 -6
package/dist/index.d.ts CHANGED
@@ -1,9 +1,854 @@
1
1
  import type { MdRuntimeClient, Open } from './mdruntime/client.js';
2
- import type { HouseCalls } from './calls.js';
3
- export type { HouseCalls } from './calls.js';
4
- export type HouseCallInput<Name extends string> = Name extends keyof HouseCalls ? HouseCalls[Name] : unknown;
2
+ export interface HouseMethods {
3
+ readonly "agent-functions/requests/list": {
4
+ readonly params: {
5
+ readonly room_ref: string;
6
+ };
7
+ readonly result: {
8
+ readonly current: readonly {
9
+ readonly document: string;
10
+ readonly name: string;
11
+ }[];
12
+ readonly history: readonly {
13
+ readonly document: string;
14
+ readonly name: string;
15
+ }[];
16
+ };
17
+ };
18
+ readonly "apps/features/list": {
19
+ readonly params: {};
20
+ readonly result: {
21
+ readonly features: readonly {
22
+ readonly allowed: boolean;
23
+ readonly feature: string;
24
+ }[];
25
+ };
26
+ };
27
+ readonly "apps/holders/list": {
28
+ readonly params: {};
29
+ readonly result: {
30
+ readonly holders: readonly {
31
+ readonly name: string;
32
+ readonly user: string;
33
+ }[];
34
+ };
35
+ };
36
+ readonly "apps/messages/send": {
37
+ readonly params: {
38
+ readonly body: unknown;
39
+ readonly to: string;
40
+ };
41
+ readonly result: {
42
+ readonly [key: string]: never;
43
+ };
44
+ };
45
+ readonly "apps/relay/read": {
46
+ readonly params: {
47
+ readonly [key: string]: never;
48
+ };
49
+ readonly result: {
50
+ readonly expires_at: string;
51
+ readonly ice_servers: readonly {
52
+ readonly credential: string;
53
+ readonly urls: readonly string[];
54
+ readonly username: string;
55
+ }[];
56
+ };
57
+ };
58
+ readonly "apps/ring": {
59
+ readonly params: {
60
+ readonly to: string;
61
+ };
62
+ readonly result: {
63
+ readonly authority: string;
64
+ readonly log_epoch: string;
65
+ readonly position: string;
66
+ };
67
+ };
68
+ readonly "chats/assign": {
69
+ readonly params: {
70
+ readonly assignee: null | {
71
+ readonly agent: string;
72
+ } | {
73
+ readonly user: string;
74
+ };
75
+ readonly operation_id: string;
76
+ readonly path: string;
77
+ readonly room_ref: string;
78
+ };
79
+ readonly result: {
80
+ readonly assignee: null | {
81
+ readonly agent: string;
82
+ readonly name: string;
83
+ } | {
84
+ readonly name: string;
85
+ readonly user: string;
86
+ };
87
+ readonly authority: string;
88
+ readonly log_epoch: string;
89
+ readonly path: string;
90
+ readonly position: string;
91
+ readonly return_to: null | {
92
+ readonly agent: string;
93
+ readonly name: string;
94
+ };
95
+ readonly room_ref: string;
96
+ readonly url: string;
97
+ };
98
+ };
99
+ readonly "chats/reply": {
100
+ readonly params: {
101
+ readonly operation_id: string;
102
+ readonly path: string;
103
+ readonly room_ref: string;
104
+ readonly template?: {
105
+ readonly language: string;
106
+ readonly name: string;
107
+ };
108
+ readonly text?: string;
109
+ readonly values?: {
110
+ readonly [key: string]: string;
111
+ };
112
+ };
113
+ readonly result: {
114
+ readonly authority: string;
115
+ readonly log_epoch: string;
116
+ readonly path: string;
117
+ readonly position: string;
118
+ readonly room_ref: string;
119
+ readonly url: string;
120
+ };
121
+ };
122
+ readonly "chats/return": {
123
+ readonly params: {
124
+ readonly path: string;
125
+ readonly room_ref: string;
126
+ };
127
+ readonly result: {
128
+ readonly assignee: null | {
129
+ readonly agent: string;
130
+ readonly name: string;
131
+ } | {
132
+ readonly name: string;
133
+ readonly user: string;
134
+ };
135
+ readonly authority: string;
136
+ readonly log_epoch: string;
137
+ readonly path: string;
138
+ readonly position: string;
139
+ readonly return_to: null | {
140
+ readonly agent: string;
141
+ readonly name: string;
142
+ };
143
+ readonly room_ref: string;
144
+ readonly url: string;
145
+ };
146
+ };
147
+ readonly "chats/take-control": {
148
+ readonly params: {
149
+ readonly operation_id: string;
150
+ readonly path: string;
151
+ readonly room_ref: string;
152
+ };
153
+ readonly result: {
154
+ readonly assignee: null | {
155
+ readonly agent: string;
156
+ readonly name: string;
157
+ } | {
158
+ readonly name: string;
159
+ readonly user: string;
160
+ };
161
+ readonly authority: string;
162
+ readonly log_epoch: string;
163
+ readonly path: string;
164
+ readonly position: string;
165
+ readonly return_to: null | {
166
+ readonly agent: string;
167
+ readonly name: string;
168
+ };
169
+ readonly room_ref: string;
170
+ readonly url: string;
171
+ };
172
+ };
173
+ readonly "conversations/create": {
174
+ readonly params: {
175
+ readonly agent_id: string;
176
+ readonly operation_id: string;
177
+ };
178
+ readonly result: {
179
+ readonly agent_id: string;
180
+ readonly authority: string;
181
+ readonly conversation_id: string;
182
+ readonly log_epoch: string;
183
+ readonly position: string;
184
+ readonly url: string;
185
+ };
186
+ };
187
+ readonly "conversations/delete": {
188
+ readonly params: {
189
+ readonly conversation_id: string;
190
+ readonly operation_id: string;
191
+ };
192
+ readonly result: {
193
+ readonly authority: string;
194
+ readonly conversation_id: string;
195
+ readonly log_epoch: string;
196
+ readonly outcome: "deleted";
197
+ readonly position: string;
198
+ };
199
+ };
200
+ readonly "conversations/end": {
201
+ readonly params: {
202
+ readonly conversation_id: string;
203
+ readonly operation_id: string;
204
+ };
205
+ readonly result: {
206
+ readonly agent_id: string;
207
+ readonly authority: string;
208
+ readonly conversation_id: string;
209
+ readonly jobs: readonly {
210
+ readonly name: string;
211
+ readonly running_since: string;
212
+ }[];
213
+ readonly log_epoch: string;
214
+ readonly position: string;
215
+ readonly url: string;
216
+ };
217
+ };
218
+ readonly "conversations/history/list": {
219
+ readonly params: {
220
+ readonly conversations: readonly {
221
+ readonly after?: {
222
+ readonly accepted_at: string;
223
+ readonly message_id: string;
224
+ };
225
+ readonly conversation_id: string;
226
+ }[];
227
+ readonly limit?: number;
228
+ };
229
+ readonly result: {
230
+ readonly histories: readonly {
231
+ readonly agent_id: string;
232
+ readonly conversation_id: string;
233
+ readonly messages: readonly {
234
+ readonly accepted_at: string;
235
+ readonly context: null | {
236
+ readonly used: number;
237
+ readonly window: number;
238
+ };
239
+ readonly conversation_id: string;
240
+ readonly failure: null | string;
241
+ readonly message_id: string;
242
+ readonly parts: readonly ({
243
+ readonly command: string;
244
+ readonly target: null | string;
245
+ readonly type: "message";
246
+ } | {
247
+ readonly count: number;
248
+ readonly type: "commands";
249
+ } | {
250
+ readonly description: string;
251
+ readonly result: null | string;
252
+ readonly status: "done" | "running";
253
+ readonly type: "subagent";
254
+ } | {
255
+ readonly entries: readonly {
256
+ readonly content: string;
257
+ readonly status: string;
258
+ }[];
259
+ readonly type: "plan";
260
+ } | {
261
+ readonly file: string;
262
+ readonly media_type: string;
263
+ readonly name: string;
264
+ readonly type: "image";
265
+ } | {
266
+ readonly marker: "compaction" | "job" | "mode" | "model" | "retry";
267
+ readonly text: string;
268
+ readonly type: "marker";
269
+ } | {
270
+ readonly text: string;
271
+ readonly type: "reasoning";
272
+ } | {
273
+ readonly text: string;
274
+ readonly type: "text";
275
+ })[];
276
+ readonly role: "assistant" | "house" | "user";
277
+ readonly sender?: "conversation" | "customer" | "owner" | "replier" | "report" | "requester" | "trigger";
278
+ readonly source?: {
279
+ readonly agent: {
280
+ readonly id: string;
281
+ readonly name: string;
282
+ readonly url: string;
283
+ };
284
+ readonly approved_at?: string;
285
+ readonly declined_at?: string;
286
+ readonly kind: "mail";
287
+ readonly owner: {
288
+ readonly name: string;
289
+ readonly user: string;
290
+ };
291
+ readonly request: string;
292
+ readonly room: string;
293
+ } | {
294
+ readonly agent: {
295
+ readonly id: string;
296
+ readonly name: string;
297
+ readonly url: string;
298
+ };
299
+ readonly conversation: {
300
+ readonly id: string;
301
+ readonly name: string;
302
+ readonly url: string;
303
+ };
304
+ readonly kind: "conversation";
305
+ } | {
306
+ readonly agent: {
307
+ readonly id: string;
308
+ readonly name: string;
309
+ readonly url: string;
310
+ };
311
+ readonly kind: "declined";
312
+ readonly owner: {
313
+ readonly name: string;
314
+ readonly user: string;
315
+ };
316
+ readonly request: string;
317
+ } | {
318
+ readonly agent_function: null | {
319
+ readonly id: string;
320
+ readonly name: string;
321
+ readonly version: number;
322
+ };
323
+ readonly approved_at: null | string;
324
+ readonly kind: "request";
325
+ readonly request: string;
326
+ readonly requester: {
327
+ readonly name: string;
328
+ readonly room: string;
329
+ readonly url: string;
330
+ } | {
331
+ readonly name: string;
332
+ readonly user: string;
333
+ };
334
+ readonly room: {
335
+ readonly handle: string;
336
+ readonly name: string;
337
+ readonly ref: string;
338
+ readonly url: string;
339
+ };
340
+ } | {
341
+ readonly kind: "reply";
342
+ readonly name: string;
343
+ } | {
344
+ readonly kind: "trigger";
345
+ readonly path: null | string;
346
+ readonly room: {
347
+ readonly handle: string;
348
+ readonly name: string;
349
+ readonly ref: string;
350
+ readonly url: string;
351
+ };
352
+ readonly trigger: {
353
+ readonly description: string;
354
+ readonly id: string;
355
+ };
356
+ };
357
+ readonly telegram_undelivered?: true;
358
+ readonly text: string;
359
+ readonly tokens?: {
360
+ readonly cache_read: number;
361
+ readonly cache_write: number;
362
+ readonly input: number;
363
+ readonly output: number;
364
+ };
365
+ readonly transcripts?: readonly {
366
+ readonly path: string;
367
+ readonly text: string;
368
+ }[];
369
+ readonly turn_id: null | string;
370
+ readonly url?: string;
371
+ readonly waiting?: true;
372
+ }[];
373
+ readonly next: null | {
374
+ readonly accepted_at: string;
375
+ readonly message_id: string;
376
+ };
377
+ readonly url: string;
378
+ }[];
379
+ };
380
+ };
381
+ readonly "conversations/interaction/answer": {
382
+ readonly params: {
383
+ readonly conversation_id: string;
384
+ readonly interaction_id: string;
385
+ readonly operation_id: string;
386
+ readonly response: readonly unknown[] | boolean | null | number | {
387
+ readonly [key: string]: unknown;
388
+ } | string;
389
+ };
390
+ readonly result: {
391
+ readonly agent_id: string;
392
+ readonly authority: string;
393
+ readonly conversation_id: string;
394
+ readonly interaction_id: string;
395
+ readonly log_epoch: string;
396
+ readonly position: string;
397
+ readonly url: string;
398
+ };
399
+ };
400
+ readonly "conversations/interrupt": {
401
+ readonly params: {
402
+ readonly conversation_id: string;
403
+ readonly operation_id: string;
404
+ };
405
+ readonly result: {
406
+ readonly agent_id: string;
407
+ readonly authority: string;
408
+ readonly conversation_id: string;
409
+ readonly log_epoch: string;
410
+ readonly position: string;
411
+ readonly url: string;
412
+ };
413
+ };
414
+ readonly "conversations/kill": {
415
+ readonly params: {
416
+ readonly conversation_id: string;
417
+ readonly operation_id: string;
418
+ };
419
+ readonly result: {
420
+ readonly agent_id: string;
421
+ readonly authority: string;
422
+ readonly conversation_id: string;
423
+ readonly log_epoch: string;
424
+ readonly position: string;
425
+ readonly url: string;
426
+ };
427
+ };
428
+ readonly "conversations/option/set": {
429
+ readonly params: {
430
+ readonly conversation_id: string;
431
+ readonly operation_id: string;
432
+ readonly option: string;
433
+ readonly value: boolean | string;
434
+ };
435
+ readonly result: {
436
+ readonly agent_id: string;
437
+ readonly authority: string;
438
+ readonly conversation_id: string;
439
+ readonly log_epoch: string;
440
+ readonly position: string;
441
+ readonly url: string;
442
+ };
443
+ };
444
+ readonly "conversations/rename": {
445
+ readonly params: {
446
+ readonly conversation_id: string;
447
+ readonly name: string;
448
+ readonly operation_id: string;
449
+ };
450
+ readonly result: {
451
+ readonly agent_id: string;
452
+ readonly authority: string;
453
+ readonly conversation_id: string;
454
+ readonly log_epoch: string;
455
+ readonly name: string;
456
+ readonly position: string;
457
+ readonly url: string;
458
+ };
459
+ };
460
+ readonly "conversations/retry": {
461
+ readonly params: {
462
+ readonly conversation_id: string;
463
+ readonly message_id: string;
464
+ readonly operation_id: string;
465
+ };
466
+ readonly result: {
467
+ readonly agent_id: string;
468
+ readonly authority: string;
469
+ readonly conversation_id: string;
470
+ readonly log_epoch: string;
471
+ readonly message_id: string;
472
+ readonly position: string;
473
+ readonly url: string;
474
+ };
475
+ };
476
+ readonly "conversations/send": {
477
+ readonly params: {
478
+ readonly conversation_id: string;
479
+ readonly operation_id: string;
480
+ readonly text: string;
481
+ };
482
+ readonly result: {
483
+ readonly agent_id: string;
484
+ readonly authority: string;
485
+ readonly conversation_id: string;
486
+ readonly log_epoch: string;
487
+ readonly message_id: string;
488
+ readonly position: string;
489
+ readonly url: string;
490
+ };
491
+ };
492
+ readonly "records/list": {
493
+ readonly params: {
494
+ readonly order?: "asc" | "desc";
495
+ readonly room_ref: string;
496
+ };
497
+ readonly result: {
498
+ readonly records: readonly {
499
+ readonly body: null | string;
500
+ readonly claimed: unknown;
501
+ readonly created_at: string;
502
+ readonly record: string;
503
+ readonly ref: string;
504
+ }[];
505
+ };
506
+ };
507
+ readonly "rooms/access/list": {
508
+ readonly params: {
509
+ readonly room_ref: string;
510
+ };
511
+ readonly result: {
512
+ readonly authority: "administrator" | "member" | "owner";
513
+ readonly members: readonly {
514
+ readonly admitted_at: null | string;
515
+ readonly direct: readonly {
516
+ readonly level: null | "keep" | "open" | "search";
517
+ readonly namespace: string;
518
+ readonly operations: readonly ("erase" | "export" | "manageAccess" | "write")[];
519
+ }[];
520
+ readonly entries: readonly {
521
+ readonly level: null | "keep" | "open" | "search";
522
+ readonly namespace: string;
523
+ readonly operations: readonly ("erase" | "export" | "manageAccess" | "write")[];
524
+ readonly sources: readonly {
525
+ readonly kind: "direct" | "inherited";
526
+ readonly level: null | "keep" | "open" | "search";
527
+ readonly namespace: string;
528
+ readonly operations: readonly ("erase" | "export" | "manageAccess" | "write")[];
529
+ }[];
530
+ }[];
531
+ readonly key: null | string;
532
+ readonly schema_roles: readonly string[];
533
+ readonly user: string;
534
+ readonly user_name: string;
535
+ }[];
536
+ readonly namespaces: readonly string[];
537
+ readonly owner: string;
538
+ readonly room_ref: string;
539
+ readonly url: string;
540
+ readonly viewer: string;
541
+ };
542
+ };
543
+ readonly "rooms/members/list": {
544
+ readonly params: {
545
+ readonly history?: boolean;
546
+ readonly room_ref: string;
547
+ };
548
+ readonly result: {
549
+ readonly history?: readonly {
550
+ readonly at: string;
551
+ readonly kind: "granted" | "revoked";
552
+ readonly user: string;
553
+ }[];
554
+ readonly members: readonly {
555
+ readonly access?: "manage" | "owner" | "read" | "write";
556
+ readonly copies?: "online_only" | "search_only";
557
+ readonly display_name: string;
558
+ readonly email?: string;
559
+ readonly member_document: null | string;
560
+ readonly owner: boolean;
561
+ readonly schema_roles?: readonly string[];
562
+ readonly since: null | string;
563
+ readonly user: string;
564
+ }[];
565
+ };
566
+ };
567
+ readonly "rooms/settings/processing/read": {
568
+ readonly params: {
569
+ readonly path: string;
570
+ readonly room_ref: string;
571
+ };
572
+ readonly result: {
573
+ readonly embedding: {
574
+ readonly condition: null | {
575
+ readonly kind: "demand_failed" | "embed_again_failed";
576
+ readonly path: string;
577
+ };
578
+ readonly embedding_estimate: null | {
579
+ readonly documents: number;
580
+ readonly measured_tokens: number;
581
+ readonly unmeasured_documents: number;
582
+ };
583
+ readonly finished: boolean;
584
+ readonly indexed_chunks: number;
585
+ };
586
+ readonly explicit: readonly {
587
+ readonly path: string;
588
+ readonly policy: "Off" | "On";
589
+ }[];
590
+ readonly path: string;
591
+ readonly policy: {
592
+ readonly from: null | string;
593
+ readonly origin: "default" | "explicit" | "inherited";
594
+ readonly reason: null | "room_too_large" | "unfunded";
595
+ readonly value: "Off" | "On";
596
+ };
597
+ readonly writable: boolean;
598
+ };
599
+ };
600
+ readonly "sites/submissions/create": {
601
+ readonly params: {
602
+ readonly content: string;
603
+ };
604
+ readonly result: {
605
+ readonly submitted: true;
606
+ };
607
+ };
608
+ readonly "storage/inventory/read": {
609
+ readonly params: {
610
+ readonly room_ref?: string;
611
+ };
612
+ readonly result: {
613
+ readonly blob: {
614
+ readonly bytes: string;
615
+ readonly gigabytes: string;
616
+ };
617
+ readonly freshness: {
618
+ readonly state: "settled";
619
+ };
620
+ readonly indexed_text: {
621
+ readonly approximate_pages: null | string;
622
+ readonly bytes: string;
623
+ readonly gigabytes: string;
624
+ };
625
+ readonly measurement: {
626
+ readonly page_reference: null | {
627
+ readonly bytes_per_page: string;
628
+ readonly encoding: string;
629
+ readonly font: string;
630
+ readonly font_size_pt: string;
631
+ readonly layout: string;
632
+ };
633
+ };
634
+ readonly room_ref: string;
635
+ readonly total: {
636
+ readonly bytes: string;
637
+ readonly gigabytes: string;
638
+ };
639
+ readonly url: string;
640
+ } | {
641
+ readonly blob: {
642
+ readonly bytes: string;
643
+ readonly gigabytes: string;
644
+ };
645
+ readonly freshness: {
646
+ readonly state: "settled";
647
+ };
648
+ readonly indexed_text: {
649
+ readonly approximate_pages: null | string;
650
+ readonly bytes: string;
651
+ readonly gigabytes: string;
652
+ };
653
+ readonly measurement: {
654
+ readonly page_reference: null | {
655
+ readonly bytes_per_page: string;
656
+ readonly encoding: string;
657
+ readonly font: string;
658
+ readonly font_size_pt: string;
659
+ readonly layout: string;
660
+ };
661
+ };
662
+ readonly site_images: {
663
+ readonly bound: string;
664
+ readonly bytes: string;
665
+ readonly payloads: string;
666
+ };
667
+ readonly total: {
668
+ readonly bytes: string;
669
+ readonly gigabytes: string;
670
+ };
671
+ } | {
672
+ readonly blob: {
673
+ readonly bytes: string;
674
+ readonly gigabytes: string;
675
+ };
676
+ readonly freshness: {
677
+ readonly state: "settled";
678
+ };
679
+ readonly indexed_text: {
680
+ readonly approximate_pages: null | string;
681
+ readonly bytes: string;
682
+ readonly gigabytes: string;
683
+ };
684
+ readonly measurement: {
685
+ readonly page_reference: null | {
686
+ readonly bytes_per_page: string;
687
+ readonly encoding: string;
688
+ readonly font: string;
689
+ readonly font_size_pt: string;
690
+ readonly layout: string;
691
+ };
692
+ };
693
+ readonly total: {
694
+ readonly bytes: string;
695
+ readonly gigabytes: string;
696
+ };
697
+ };
698
+ };
699
+ readonly "triggers/fired/list": {
700
+ readonly params: {
701
+ readonly room_ref: string;
702
+ };
703
+ readonly result: {
704
+ readonly events: readonly {
705
+ readonly actions: readonly ({
706
+ readonly cap: "address_submissions" | "app_sockets" | "environment_functions" | "export_starts" | "kit_connections" | "live_shares" | "open_uploads" | "ownership_offers" | "push_addresses" | "push_deliveries" | "room_triggers" | "service_keys" | "share_creations" | "share_room_creations" | "site_published_bytes" | "site_rooms" | "slot_rooms" | "spaces" | "waiting_web_wizards" | "writes";
707
+ readonly code: "cap_reached";
708
+ readonly outcome: "refused";
709
+ readonly position: number;
710
+ readonly retry_at: string;
711
+ } | {
712
+ readonly cap: "address_submissions" | "app_sockets" | "environment_functions" | "export_starts" | "kit_connections" | "live_shares" | "open_uploads" | "ownership_offers" | "push_addresses" | "push_deliveries" | "room_triggers" | "service_keys" | "share_creations" | "share_room_creations" | "site_published_bytes" | "site_rooms" | "slot_rooms" | "spaces" | "waiting_web_wizards" | "writes";
713
+ readonly code: "cap_reached";
714
+ readonly outcome: "refused";
715
+ readonly position: number;
716
+ } | {
717
+ readonly code: "agent_unavailable";
718
+ readonly outcome: "withdrawn";
719
+ readonly position: number;
720
+ } | {
721
+ readonly code: "function_failed";
722
+ readonly cut?: boolean;
723
+ readonly error: string;
724
+ readonly exit_code?: number;
725
+ readonly final: true;
726
+ readonly outcome: "failed";
727
+ readonly output?: string;
728
+ readonly position: number;
729
+ readonly run: string;
730
+ } | {
731
+ readonly code: "function_failed";
732
+ readonly error: string;
733
+ readonly final: true;
734
+ readonly outcome: "failed";
735
+ readonly position: number;
736
+ readonly release: string;
737
+ } | {
738
+ readonly code: "function_not_started";
739
+ readonly final?: true;
740
+ readonly outcome: "failed";
741
+ readonly position: number;
742
+ readonly tries: number;
743
+ } | {
744
+ readonly code: "limit_reached";
745
+ readonly limit: "reads";
746
+ readonly outcome: "refused";
747
+ readonly period: "day" | "minute";
748
+ readonly position: number;
749
+ readonly retry_at: string;
750
+ readonly value: string;
751
+ } | {
752
+ readonly code: "limit_reached";
753
+ readonly limit: "writes";
754
+ readonly outcome: "refused";
755
+ readonly period: "day" | "minute";
756
+ readonly position: number;
757
+ readonly retry_at: string;
758
+ } | {
759
+ readonly code: "limit_reached";
760
+ readonly limit: "blob" | "indexed_text";
761
+ readonly outcome: "refused";
762
+ readonly position: number;
763
+ readonly used: string;
764
+ readonly value: string;
765
+ } | {
766
+ readonly code: "limit_reached";
767
+ readonly limit: "custom_domains" | "external_calls" | "publish_data" | "sites";
768
+ readonly outcome: "refused";
769
+ readonly position: number;
770
+ readonly retry_at: string;
771
+ } | {
772
+ readonly code: "limit_reached";
773
+ readonly limit: "custom_domains" | "external_calls" | "publish_data" | "sites";
774
+ readonly outcome: "refused";
775
+ readonly position: number;
776
+ } | {
777
+ readonly code: "agent_function_not_found" | "agent_function_retired" | "app_function_not_found" | "app_not_found" | "environment_function_not_found" | "environment_offline" | "no_recipient" | "target_agent_unavailable";
778
+ readonly outcome: "no_target";
779
+ readonly position: number;
780
+ } | {
781
+ readonly code: "agent_function_request_not_started" | "internal_error";
782
+ readonly outcome: "failed";
783
+ readonly position: number;
784
+ } | {
785
+ readonly code: string;
786
+ readonly outcome: "refused";
787
+ readonly position: number;
788
+ } | {
789
+ readonly conversations: number;
790
+ readonly outcome: "marked";
791
+ readonly position: number;
792
+ } | {
793
+ readonly cut?: boolean;
794
+ readonly exit_code?: number;
795
+ readonly outcome: "ran";
796
+ readonly output?: string;
797
+ readonly position: number;
798
+ readonly run: string;
799
+ } | {
800
+ readonly outcome: "continued";
801
+ readonly position: number;
802
+ readonly request: string;
803
+ } | {
804
+ readonly outcome: "notified";
805
+ readonly position: number;
806
+ readonly reached: number;
807
+ } | {
808
+ readonly outcome: "paused";
809
+ readonly position: number;
810
+ } | {
811
+ readonly outcome: "ran";
812
+ readonly position: number;
813
+ readonly release: string;
814
+ } | {
815
+ readonly outcome: "requested";
816
+ readonly position: number;
817
+ readonly request: string;
818
+ } | {
819
+ readonly outcome: "running";
820
+ readonly position: number;
821
+ readonly release: string;
822
+ } | {
823
+ readonly outcome: "running";
824
+ readonly position: number;
825
+ readonly run: string;
826
+ } | {
827
+ readonly outcome: "waiting";
828
+ readonly position: number;
829
+ })[];
830
+ readonly code?: "cap_reached";
831
+ readonly created_at: string;
832
+ readonly missed?: "failed" | "skipped";
833
+ readonly moment?: string;
834
+ readonly path?: string;
835
+ readonly trigger: string;
836
+ readonly url?: string;
837
+ }[];
838
+ };
839
+ };
840
+ }
841
+ export type HouseParams<Name extends string> = Name extends keyof HouseMethods ? HouseMethods[Name]['params'] : unknown;
842
+ type CallResult = Awaited<ReturnType<MdRuntimeClient['call']>>;
843
+ export type HouseResult<Name extends string> = Exclude<CallResult, {
844
+ readonly kind: 'action';
845
+ }> | (Extract<CallResult, {
846
+ readonly kind: 'action';
847
+ }> & {
848
+ readonly result: Name extends keyof HouseMethods ? HouseMethods[Name]['result'] : unknown;
849
+ });
5
850
  export interface HouseRuntime extends Omit<MdRuntimeClient, 'call'> {
6
- call<Name extends Open<keyof HouseCalls>>(name: Name, input: HouseCallInput<Name>): ReturnType<MdRuntimeClient['call']>;
851
+ call<Name extends Open<keyof HouseMethods>>(method: Name, params: HouseParams<Name>): Promise<HouseResult<Name>>;
7
852
  }
8
853
  export interface HouseSyncState {
9
854
  readonly state: string;
@@ -13,6 +858,7 @@ export interface HouseCredentialState {
13
858
  readonly state: Open<'none' | 'held' | 'rejected'>;
14
859
  readonly expiresAt: number | null;
15
860
  }
861
+ export type HouseDatabaseFailure = 'unsupported' | 'damaged';
16
862
  export type HouseAnalyticsChoice = 'accept' | 'decline';
17
863
  export interface HouseAnalytics {
18
864
  readonly measures: boolean;
@@ -32,6 +878,7 @@ export interface HouseStatus {
32
878
  readonly retryable: boolean;
33
879
  } | null;
34
880
  readonly loss: string | null;
881
+ readonly database: Open<HouseDatabaseFailure> | null;
35
882
  readonly analytics: HouseAnalytics;
36
883
  readonly serviceMode: Open<'open' | 'write-halted'> | null;
37
884
  readonly offline: boolean;
@@ -70,8 +917,7 @@ export interface HouseExternalRequest {
70
917
  readonly headers?: Readonly<Record<string, string>>;
71
918
  readonly body?: string;
72
919
  readonly body_base64?: string;
73
- readonly account?: string;
74
- readonly slot?: string;
920
+ readonly room_ref?: string;
75
921
  }
76
922
  export type HouseExternalAnswer = {
77
923
  readonly status: number;
@@ -93,6 +939,11 @@ export interface HouseAppMessage {
93
939
  }
94
940
  export type HouseInstallation = Open<'accepted' | 'dismissed' | 'manual'>;
95
941
  export type HouseNotifications = Open<'on' | 'off' | 'blocked' | 'unavailable'>;
942
+ export interface HouseTelegram {
943
+ readonly state: Open<'available' | 'linked' | 'unavailable'>;
944
+ readonly name: string | null;
945
+ readonly username: string | null;
946
+ }
96
947
  export interface HouseCeremonyRefused extends Error {
97
948
  readonly name: 'HouseCeremonyRefused';
98
949
  readonly code: Open<'house_ceremony_refused'>;
@@ -109,22 +960,32 @@ export interface HouseBrowserRefused extends Error {
109
960
  readonly code: string;
110
961
  readonly retryable: boolean;
111
962
  }
112
- export interface HouseTrialWithheld {
113
- readonly code: Open<'house_trial_withheld'>;
114
- readonly retryable: true;
115
- }
116
- export type HouseTask = unknown;
117
- export type HouseActivation = Open<'committed' | 'abandoned'>;
118
963
  export interface HouseCooperation {
119
- checkpoint(): Promise<void> | void;
120
- persist(): Promise<void> | void;
121
- capture(): Promise<HouseTask> | HouseTask;
122
- restore(task: HouseTask | null): Promise<void> | void;
123
- ready(): Promise<boolean> | boolean;
124
- settle(activation: HouseActivation): void;
964
+ placed(): Promise<void> | void;
965
+ }
966
+ export type HouseChatWidth = 'full' | '3/4' | '1/2' | '1/3';
967
+ export interface HouseChatOpened {
968
+ readonly conversation: string | null;
969
+ readonly agent: string | null;
970
+ }
971
+ export interface HouseChatOptions {
972
+ readonly conversation?: string | null;
973
+ readonly agent?: string | null;
974
+ readonly showChats?: boolean;
975
+ readonly width?: HouseChatWidth;
976
+ readonly onOpen?: (opened: HouseChatOpened) => void;
977
+ readonly onLink?: (href: string) => void;
978
+ }
979
+ export interface HouseMountedChat {
980
+ update(options: HouseChatOptions): void;
981
+ unmount(): void;
982
+ }
983
+ export interface HouseChat {
984
+ mount(element: object, options?: HouseChatOptions): Promise<HouseMountedChat>;
125
985
  }
126
986
  export interface HouseBridge {
127
987
  readonly runtime: Promise<HouseRuntime>;
988
+ readonly chat: HouseChat;
128
989
  address(): string | null;
129
990
  onAddress(listener: (address: string) => void): () => void;
130
991
  push(address: string): Promise<string>;
@@ -132,7 +993,7 @@ export interface HouseBridge {
132
993
  ceremony(path: string): Promise<never>;
133
994
  install(): Promise<HouseInstallation>;
134
995
  notifications(on?: boolean): Promise<HouseNotifications>;
135
- setBadge(unread: readonly string[]): Promise<void>;
996
+ telegram(link?: true): Promise<HouseTelegram>;
136
997
  setTab(tab: HouseTab): void;
137
998
  sourceTop(app: string, release?: string): Promise<HouseSourceTop | HouseRefusal | null>;
138
999
  sourceDownload(app: string, release?: string): Promise<HouseSourceDownload | HouseRefusal | null>;
@@ -149,3 +1010,4 @@ export interface HouseHeld {
149
1010
  readonly houseBridge: HouseBridge;
150
1011
  }
151
1012
  export declare const houseBridge: () => HouseBridge;
1013
+ export {};