@agentshouse/app-bridge 0.1.0-ce42efd6bfc0c → 0.1.0-ce4a7fe8aa660

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 (127) hide show
  1. package/README.md +11 -11
  2. package/dist/index.d.ts +668 -13
  3. package/dist/mdmodel/body.d.ts +84 -0
  4. package/dist/mdmodel/built-in.d.ts +3 -0
  5. package/dist/mdmodel/definition.d.ts +40 -11
  6. package/dist/mdmodel/document.d.ts +16 -9
  7. package/dist/mdmodel/event.d.ts +76 -0
  8. package/dist/mdmodel/facts.d.ts +14 -0
  9. package/dist/mdmodel/fields.d.ts +1 -1
  10. package/dist/mdmodel/house-model.d.ts +869 -0
  11. package/dist/mdmodel/house-references/crockford.d.ts +3 -0
  12. package/dist/mdmodel/house-references/patterns.d.ts +8 -0
  13. package/dist/mdmodel/index.d.ts +45 -16
  14. package/dist/mdmodel/indexed.d.ts +8 -0
  15. package/dist/mdmodel/kinds.d.ts +20 -0
  16. package/dist/mdmodel/markdown.d.ts +70 -0
  17. package/dist/mdmodel/media-type.d.ts +71 -0
  18. package/dist/mdmodel/moment.d.ts +6 -0
  19. package/dist/mdmodel/not-ready.d.ts +1 -0
  20. package/dist/mdmodel/paths.d.ts +24 -2
  21. package/dist/mdmodel/pattern.d.ts +9 -0
  22. package/dist/mdmodel/query/language.d.ts +254 -0
  23. package/dist/mdmodel/query/match.d.ts +13 -0
  24. package/dist/mdmodel/query/rows.d.ts +31 -0
  25. package/dist/mdmodel/query/sql.d.ts +42 -0
  26. package/dist/mdmodel/query/walk.d.ts +62 -0
  27. package/dist/mdmodel/references.d.ts +2 -2
  28. package/dist/mdmodel/reserved.d.ts +5 -0
  29. package/dist/mdmodel/room-types.d.ts +6 -0
  30. package/dist/mdmodel/types.d.ts +42 -34
  31. package/dist/mdmodel/validate.d.ts +34 -4
  32. package/dist/mdmodel/yaml.d.ts +7 -5
  33. package/dist/mdruntime/actions.d.ts +25 -0
  34. package/dist/mdruntime/adapter.d.ts +261 -122
  35. package/dist/mdruntime/attached-model.d.ts +6 -0
  36. package/dist/mdruntime/authored.d.ts +87 -0
  37. package/dist/mdruntime/binary.d.ts +4 -5
  38. package/dist/mdruntime/bootstrap.d.ts +43 -0
  39. package/dist/mdruntime/cell.d.ts +5 -0
  40. package/dist/mdruntime/chain.d.ts +11 -0
  41. package/dist/mdruntime/change-set.d.ts +13 -16
  42. package/dist/mdruntime/change.d.ts +36 -1
  43. package/dist/mdruntime/client.d.ts +48 -25
  44. package/dist/mdruntime/collection.d.ts +33 -21
  45. package/dist/mdruntime/compile.d.ts +17 -0
  46. package/dist/mdruntime/conversation-live.d.ts +148 -0
  47. package/dist/mdruntime/conversation-row.d.ts +39 -0
  48. package/dist/mdruntime/conversation.d.ts +84 -49
  49. package/dist/mdruntime/declaration.d.ts +9 -0
  50. package/dist/mdruntime/durability.d.ts +21 -4
  51. package/dist/mdruntime/failure.d.ts +3 -0
  52. package/dist/mdruntime/figures.d.ts +48 -0
  53. package/dist/mdruntime/holdings.d.ts +28 -0
  54. package/dist/mdruntime/house-query.d.ts +14 -0
  55. package/dist/mdruntime/identity.d.ts +5 -0
  56. package/dist/mdruntime/install.d.ts +59 -0
  57. package/dist/mdruntime/listing.d.ts +59 -0
  58. package/dist/mdruntime/live.d.ts +24 -0
  59. package/dist/mdruntime/media.d.ts +23 -0
  60. package/dist/mdruntime/messages.d.ts +62 -0
  61. package/dist/mdruntime/modal.d.ts +1 -0
  62. package/dist/mdruntime/model.d.ts +14 -14
  63. package/dist/mdruntime/observation.d.ts +42 -10
  64. package/dist/mdruntime/opened.d.ts +21 -0
  65. package/dist/mdruntime/outcome.d.ts +70 -9
  66. package/dist/mdruntime/overlay.d.ts +9 -6
  67. package/dist/mdruntime/preparation.d.ts +45 -0
  68. package/dist/mdruntime/presence.d.ts +57 -0
  69. package/dist/mdruntime/query.d.ts +27 -186
  70. package/dist/mdruntime/reach.d.ts +30 -11
  71. package/dist/mdruntime/readiness.d.ts +33 -21
  72. package/dist/mdruntime/reads.d.ts +38 -0
  73. package/dist/mdruntime/recovery.d.ts +6 -2
  74. package/dist/mdruntime/refresh.d.ts +26 -0
  75. package/dist/mdruntime/replica.d.ts +50 -33
  76. package/dist/mdruntime/retried.d.ts +29 -0
  77. package/dist/mdruntime/room-draft.d.ts +66 -12
  78. package/dist/mdruntime/room-drafts.d.ts +23 -0
  79. package/dist/mdruntime/runtime.d.ts +34 -0
  80. package/dist/mdruntime/save.d.ts +43 -48
  81. package/dist/mdruntime/saves.d.ts +33 -0
  82. package/dist/mdruntime/search.d.ts +15 -77
  83. package/dist/mdruntime/seed.d.ts +24 -0
  84. package/dist/mdruntime/socket/admission.d.ts +6 -0
  85. package/dist/mdruntime/socket/answers.d.ts +5 -0
  86. package/dist/mdruntime/socket/lanes.d.ts +27 -0
  87. package/dist/mdruntime/socket/session.d.ts +40 -0
  88. package/dist/mdruntime/socket.d.ts +67 -0
  89. package/dist/mdruntime/source.d.ts +58 -0
  90. package/dist/mdruntime/status.d.ts +4 -5
  91. package/dist/mdruntime/store/installs.d.ts +29 -0
  92. package/dist/mdruntime/store/readiness.d.ts +10 -0
  93. package/dist/mdruntime/store/records.d.ts +226 -0
  94. package/dist/mdruntime/store/room-held.d.ts +7 -0
  95. package/dist/mdruntime/store/rooms-shown.d.ts +7 -0
  96. package/dist/mdruntime/store/space.d.ts +10 -0
  97. package/dist/mdruntime/store/watchers.d.ts +16 -0
  98. package/dist/mdruntime/store/writes.d.ts +23 -0
  99. package/dist/mdruntime/store.d.ts +115 -147
  100. package/dist/mdruntime/stored.d.ts +173 -0
  101. package/dist/mdruntime/surface.d.ts +93 -0
  102. package/dist/mdruntime/tables.d.ts +375 -0
  103. package/dist/mdruntime/tallies.d.ts +17 -0
  104. package/dist/mdruntime/transfer.d.ts +0 -5
  105. package/dist/mdruntime/wire.d.ts +242 -37
  106. package/dist/session-content/check.d.ts +17 -0
  107. package/dist/session-content/index.d.ts +6 -0
  108. package/dist/session-content/parts.d.ts +30 -0
  109. package/dist/session-content/state.d.ts +59 -0
  110. package/dist/session-content/turn.d.ts +137 -0
  111. package/dist/test-host.d.ts +14 -1
  112. package/dist/test-host.js +63 -3
  113. package/docs/families.md +119 -38
  114. package/package.json +8 -3
  115. package/dist/calls.d.ts +0 -117
  116. package/dist/calls.js +0 -1
  117. package/dist/mdmodel/blocks.d.ts +0 -10
  118. package/dist/mdmodel/condition.d.ts +0 -149
  119. package/dist/mdmodel/divide.d.ts +0 -2
  120. package/dist/mdmodel/profile.d.ts +0 -5
  121. package/dist/mdmodel/project.d.ts +0 -20
  122. package/dist/mdruntime/acquisition.d.ts +0 -13
  123. package/dist/mdruntime/connection.d.ts +0 -138
  124. package/dist/mdruntime/file.d.ts +0 -19
  125. package/dist/mdruntime/rows.d.ts +0 -36
  126. package/dist/mdruntime/shared.d.ts +0 -10
  127. package/dist/mdruntime/turn.d.ts +0 -6
package/dist/index.d.ts CHANGED
@@ -1,10 +1,602 @@
1
- import type { MdRuntimeClient } from './mdruntime/client.js';
2
- import type { HouseCalls } from './calls.js';
3
- export type { HouseCalls } from './calls.js';
4
- type Open<Value extends string> = Value | (string & {});
5
- export type HouseCallInput<Name extends string> = Name extends keyof HouseCalls ? HouseCalls[Name] : unknown;
1
+ import type { MdRuntimeClient, Open } from './mdruntime/client.js';
2
+ export interface HouseMethods {
3
+ readonly "agent-functions/decide": {
4
+ readonly params: never;
5
+ readonly result: never;
6
+ };
7
+ readonly "agent-functions/requests/list": {
8
+ readonly params: {
9
+ readonly operation_id?: string;
10
+ readonly room_ref: string;
11
+ };
12
+ readonly result: {
13
+ readonly current: readonly {
14
+ readonly document: string;
15
+ readonly name: string;
16
+ }[];
17
+ readonly history: readonly {
18
+ readonly document: string;
19
+ readonly name: string;
20
+ }[];
21
+ };
22
+ };
23
+ readonly "apps/features/list": {
24
+ readonly params: {
25
+ readonly operation_id?: string;
26
+ };
27
+ readonly result: {
28
+ readonly features: readonly {
29
+ readonly allowed: boolean;
30
+ readonly feature: string;
31
+ }[];
32
+ };
33
+ };
34
+ readonly "apps/holders/list": {
35
+ readonly params: {
36
+ readonly operation_id?: string;
37
+ };
38
+ readonly result: {
39
+ readonly holders: readonly {
40
+ readonly name: string;
41
+ readonly user: string;
42
+ }[];
43
+ };
44
+ };
45
+ readonly "apps/messages/send": {
46
+ readonly params: {
47
+ readonly body: unknown;
48
+ readonly operation_id?: string;
49
+ readonly to: string;
50
+ };
51
+ readonly result: {
52
+ readonly [key: string]: never;
53
+ };
54
+ };
55
+ readonly "apps/relay/read": {
56
+ readonly params: {
57
+ readonly operation_id?: string;
58
+ };
59
+ readonly result: {
60
+ readonly expires_at: string;
61
+ readonly ice_servers: readonly {
62
+ readonly credential: string;
63
+ readonly urls: readonly string[];
64
+ readonly username: string;
65
+ }[];
66
+ };
67
+ };
68
+ readonly "apps/ring": {
69
+ readonly params: {
70
+ readonly operation_id?: string;
71
+ readonly to: string;
72
+ };
73
+ readonly result: {
74
+ readonly authority: string;
75
+ readonly log_epoch: string;
76
+ readonly position: string;
77
+ };
78
+ };
79
+ readonly "chats/assign": {
80
+ readonly params: {
81
+ readonly assignee: null | {
82
+ readonly agent: string;
83
+ } | {
84
+ readonly user: string;
85
+ };
86
+ readonly operation_id?: string;
87
+ readonly path: string;
88
+ readonly room_ref: string;
89
+ };
90
+ readonly result: {
91
+ readonly assignee: null | {
92
+ readonly agent: string;
93
+ readonly name: string;
94
+ } | {
95
+ readonly name: string;
96
+ readonly user: string;
97
+ };
98
+ readonly authority: string;
99
+ readonly log_epoch: string;
100
+ readonly path: string;
101
+ readonly position: string;
102
+ readonly return_to: null | {
103
+ readonly agent: string;
104
+ readonly name: string;
105
+ };
106
+ readonly room_ref: string;
107
+ readonly url: string;
108
+ };
109
+ };
110
+ readonly "chats/reply": {
111
+ readonly params: {
112
+ readonly operation_id?: string;
113
+ readonly path: string;
114
+ readonly room_ref: string;
115
+ readonly template?: {
116
+ readonly language: string;
117
+ readonly name: string;
118
+ };
119
+ readonly text?: string;
120
+ readonly values?: {
121
+ readonly [key: string]: string;
122
+ };
123
+ };
124
+ readonly result: {
125
+ readonly authority: string;
126
+ readonly log_epoch: string;
127
+ readonly path: string;
128
+ readonly position: string;
129
+ readonly room_ref: string;
130
+ readonly url: string;
131
+ };
132
+ };
133
+ readonly "chats/return": {
134
+ readonly params: {
135
+ readonly operation_id?: string;
136
+ readonly path: string;
137
+ readonly room_ref: string;
138
+ };
139
+ readonly result: {
140
+ readonly assignee: null | {
141
+ readonly agent: string;
142
+ readonly name: string;
143
+ } | {
144
+ readonly name: string;
145
+ readonly user: string;
146
+ };
147
+ readonly authority: string;
148
+ readonly log_epoch: string;
149
+ readonly path: string;
150
+ readonly position: string;
151
+ readonly return_to: null | {
152
+ readonly agent: string;
153
+ readonly name: string;
154
+ };
155
+ readonly room_ref: string;
156
+ readonly url: string;
157
+ };
158
+ };
159
+ readonly "chats/take-control": {
160
+ readonly params: {
161
+ readonly operation_id?: string;
162
+ readonly path: string;
163
+ readonly room_ref: string;
164
+ };
165
+ readonly result: {
166
+ readonly assignee: null | {
167
+ readonly agent: string;
168
+ readonly name: string;
169
+ } | {
170
+ readonly name: string;
171
+ readonly user: string;
172
+ };
173
+ readonly authority: string;
174
+ readonly log_epoch: string;
175
+ readonly path: string;
176
+ readonly position: string;
177
+ readonly return_to: null | {
178
+ readonly agent: string;
179
+ readonly name: string;
180
+ };
181
+ readonly room_ref: string;
182
+ readonly url: string;
183
+ };
184
+ };
185
+ readonly "conversations/create": {
186
+ readonly params: never;
187
+ readonly result: never;
188
+ };
189
+ readonly "conversations/delete": {
190
+ readonly params: never;
191
+ readonly result: never;
192
+ };
193
+ readonly "conversations/history/list": {
194
+ readonly params: never;
195
+ readonly result: never;
196
+ };
197
+ readonly "conversations/interaction/answer": {
198
+ readonly params: never;
199
+ readonly result: never;
200
+ };
201
+ readonly "conversations/interrupt": {
202
+ readonly params: never;
203
+ readonly result: never;
204
+ };
205
+ readonly "conversations/kill": {
206
+ readonly params: never;
207
+ readonly result: never;
208
+ };
209
+ readonly "conversations/option/set": {
210
+ readonly params: never;
211
+ readonly result: never;
212
+ };
213
+ readonly "conversations/rename": {
214
+ readonly params: never;
215
+ readonly result: never;
216
+ };
217
+ readonly "conversations/retry": {
218
+ readonly params: never;
219
+ readonly result: never;
220
+ };
221
+ readonly "conversations/send": {
222
+ readonly params: never;
223
+ readonly result: never;
224
+ };
225
+ readonly "conversations/take-out": {
226
+ readonly params: never;
227
+ readonly result: never;
228
+ };
229
+ readonly "rooms/access/list": {
230
+ readonly params: {
231
+ readonly operation_id?: string;
232
+ readonly room_ref: string;
233
+ };
234
+ readonly result: {
235
+ readonly authority: "administrator" | "member" | "owner";
236
+ readonly members: readonly {
237
+ readonly admitted_at: null | string;
238
+ readonly direct: readonly {
239
+ readonly level: null | "keep" | "open" | "search";
240
+ readonly namespace: string;
241
+ readonly operations: readonly ("erase" | "export" | "manageAccess" | "write")[];
242
+ }[];
243
+ readonly entries: readonly {
244
+ readonly level: null | "keep" | "open" | "search";
245
+ readonly namespace: string;
246
+ readonly operations: readonly ("erase" | "export" | "manageAccess" | "write")[];
247
+ readonly sources: readonly {
248
+ readonly kind: "direct" | "inherited";
249
+ readonly level: null | "keep" | "open" | "search";
250
+ readonly namespace: string;
251
+ readonly operations: readonly ("erase" | "export" | "manageAccess" | "write")[];
252
+ }[];
253
+ }[];
254
+ readonly key: null | string;
255
+ readonly schema_roles: readonly string[];
256
+ readonly through_space?: true;
257
+ readonly user: string;
258
+ readonly user_name: string;
259
+ }[];
260
+ readonly namespaces: readonly string[];
261
+ readonly owner: string;
262
+ readonly room_ref: string;
263
+ readonly url: string;
264
+ readonly viewer: string;
265
+ };
266
+ };
267
+ readonly "rooms/members/list": {
268
+ readonly params: {
269
+ readonly history?: boolean;
270
+ readonly operation_id?: string;
271
+ readonly room_ref: string;
272
+ };
273
+ readonly result: {
274
+ readonly history?: readonly ({
275
+ readonly access?: "manage" | "owner" | "read" | "write";
276
+ readonly agent_name?: string;
277
+ readonly approved_by?: string;
278
+ readonly at: string;
279
+ readonly by?: string;
280
+ readonly copies?: "online_only" | "search_only";
281
+ readonly kind: "granted";
282
+ readonly share?: string;
283
+ readonly through_space?: true;
284
+ readonly user: string;
285
+ } | {
286
+ readonly agent_name?: string;
287
+ readonly at: string;
288
+ readonly by?: string;
289
+ readonly kind: "revoked";
290
+ readonly through_space?: true;
291
+ readonly user: string;
292
+ } | {
293
+ readonly agent_name?: string;
294
+ readonly at: string;
295
+ readonly by?: string;
296
+ readonly kind: "role_given" | "role_taken";
297
+ readonly role: string;
298
+ readonly through_space?: true;
299
+ readonly user: string;
300
+ })[];
301
+ readonly members: readonly {
302
+ readonly access?: "manage" | "owner" | "read" | "write";
303
+ readonly copies?: "online_only" | "search_only";
304
+ readonly display_name: string;
305
+ readonly email?: string;
306
+ readonly member_document: null | string;
307
+ readonly owner: boolean;
308
+ readonly schema_roles?: readonly string[];
309
+ readonly schema_roles_given?: readonly {
310
+ readonly agent_name?: string;
311
+ readonly at: string;
312
+ readonly by?: string;
313
+ readonly role: string;
314
+ }[];
315
+ readonly since: null | string;
316
+ readonly through_space?: true;
317
+ readonly user: string;
318
+ }[];
319
+ };
320
+ };
321
+ readonly "service-keys/signatures/check": {
322
+ readonly params: {
323
+ readonly operation_id?: string;
324
+ readonly origin: string;
325
+ readonly room_ref: string;
326
+ readonly signature: string;
327
+ readonly text: string;
328
+ };
329
+ readonly result: {
330
+ readonly matched: boolean;
331
+ };
332
+ };
333
+ readonly "sites/functions/call": {
334
+ readonly params: {
335
+ readonly function: string;
336
+ readonly input?: readonly (readonly unknown[] | boolean | null | number | {
337
+ readonly [key: string]: unknown;
338
+ } | string)[] | boolean | null | number | {
339
+ readonly [key: string]: readonly unknown[] | boolean | null | number | {
340
+ readonly [key: string]: unknown;
341
+ } | string;
342
+ } | string;
343
+ };
344
+ readonly result: {
345
+ readonly answer: readonly unknown[] | boolean | null | number | {
346
+ readonly [key: string]: unknown;
347
+ } | string;
348
+ };
349
+ };
350
+ readonly "sites/submissions/create": {
351
+ readonly params: {
352
+ readonly content: string;
353
+ };
354
+ readonly result: {
355
+ readonly submitted: true;
356
+ };
357
+ };
358
+ readonly "storage/inventory/read": {
359
+ readonly params: {
360
+ readonly operation_id?: string;
361
+ readonly room_ref?: string;
362
+ readonly rooms?: "owned";
363
+ };
364
+ readonly result: {
365
+ readonly blob: {
366
+ readonly bytes: string;
367
+ readonly gigabytes: string;
368
+ };
369
+ readonly freshness: {
370
+ readonly state: "settled";
371
+ };
372
+ readonly indexed_text: {
373
+ readonly bytes: string;
374
+ readonly gigabytes: string;
375
+ };
376
+ readonly room_ref: string;
377
+ readonly total: {
378
+ readonly bytes: string;
379
+ readonly gigabytes: string;
380
+ };
381
+ readonly url: string;
382
+ } | {
383
+ readonly blob: {
384
+ readonly bytes: string;
385
+ readonly gigabytes: string;
386
+ };
387
+ readonly freshness: {
388
+ readonly state: "settled";
389
+ };
390
+ readonly indexed_text: {
391
+ readonly bytes: string;
392
+ readonly gigabytes: string;
393
+ };
394
+ readonly rooms?: readonly {
395
+ readonly blob: {
396
+ readonly bytes: string;
397
+ readonly gigabytes: string;
398
+ };
399
+ readonly freshness: {
400
+ readonly state: "settled";
401
+ };
402
+ readonly indexed_text: {
403
+ readonly bytes: string;
404
+ readonly gigabytes: string;
405
+ };
406
+ readonly room_ref: string;
407
+ readonly total: {
408
+ readonly bytes: string;
409
+ readonly gigabytes: string;
410
+ };
411
+ readonly url: string;
412
+ }[];
413
+ readonly site_images: {
414
+ readonly bound: string;
415
+ readonly bytes: string;
416
+ readonly payloads: string;
417
+ };
418
+ readonly total: {
419
+ readonly bytes: string;
420
+ readonly gigabytes: string;
421
+ };
422
+ };
423
+ };
424
+ readonly "triggers/fired/list": {
425
+ readonly params: {
426
+ readonly operation_id?: string;
427
+ readonly room_ref?: string;
428
+ };
429
+ readonly result: {
430
+ readonly events: readonly {
431
+ readonly actions: readonly ({
432
+ 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";
433
+ readonly code: "cap_reached";
434
+ readonly outcome: "refused";
435
+ readonly position: number;
436
+ readonly retry_at: string;
437
+ } | {
438
+ 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";
439
+ readonly code: "cap_reached";
440
+ readonly outcome: "refused";
441
+ readonly position: number;
442
+ } | {
443
+ readonly code: "agent_function_request_not_started";
444
+ readonly final?: true;
445
+ readonly outcome: "failed";
446
+ readonly position: number;
447
+ } | {
448
+ readonly code: "agent_function_unreadable";
449
+ readonly document_path: string;
450
+ readonly final: true;
451
+ readonly outcome: "failed";
452
+ readonly position: number;
453
+ } | {
454
+ readonly code: "agent_unavailable";
455
+ readonly outcome: "withdrawn";
456
+ readonly position: number;
457
+ } | {
458
+ readonly code: "function_failed";
459
+ readonly cut?: boolean;
460
+ readonly error: string;
461
+ readonly exit_code?: number;
462
+ readonly final: true;
463
+ readonly outcome: "failed";
464
+ readonly output?: string;
465
+ readonly position: number;
466
+ readonly run: string;
467
+ } | {
468
+ readonly code: "function_failed";
469
+ readonly error: string;
470
+ readonly final: true;
471
+ readonly outcome: "failed";
472
+ readonly position: number;
473
+ readonly release: string;
474
+ } | {
475
+ readonly code: "function_not_started";
476
+ readonly final?: true;
477
+ readonly outcome: "failed";
478
+ readonly position: number;
479
+ readonly tries: number;
480
+ } | {
481
+ readonly code: "internal_error";
482
+ readonly final: true;
483
+ readonly outcome: "failed";
484
+ readonly position: number;
485
+ } | {
486
+ readonly code: "limit_reached";
487
+ readonly limit: "reads";
488
+ readonly outcome: "refused";
489
+ readonly period: "day" | "minute";
490
+ readonly position: number;
491
+ readonly retry_at: string;
492
+ readonly value: string;
493
+ } | {
494
+ readonly code: "limit_reached";
495
+ readonly limit: "writes";
496
+ readonly outcome: "refused";
497
+ readonly period: "day" | "minute";
498
+ readonly position: number;
499
+ readonly retry_at: string;
500
+ } | {
501
+ readonly code: "limit_reached";
502
+ readonly limit: "blob" | "indexed_text";
503
+ readonly outcome: "refused";
504
+ readonly position: number;
505
+ readonly used: string;
506
+ readonly value: string;
507
+ } | {
508
+ readonly code: "limit_reached";
509
+ readonly limit: "custom_domains" | "external_calls" | "publish_data" | "site_function_calls" | "sites";
510
+ readonly outcome: "refused";
511
+ readonly position: number;
512
+ readonly retry_at: string;
513
+ } | {
514
+ readonly code: "limit_reached";
515
+ readonly limit: "custom_domains" | "external_calls" | "publish_data" | "site_function_calls" | "sites";
516
+ readonly outcome: "refused";
517
+ readonly position: number;
518
+ } | {
519
+ readonly code: "post_not_confirmed";
520
+ readonly final: true;
521
+ readonly outcome: "failed";
522
+ readonly position: number;
523
+ } | {
524
+ readonly code: "agent_function_retired" | "environment_offline" | "no_group" | "no_recipient" | "not_found" | "target_agent_unavailable";
525
+ readonly outcome: "no_target";
526
+ readonly position: number;
527
+ } | {
528
+ readonly code: string;
529
+ readonly outcome: "refused";
530
+ readonly position: number;
531
+ } | {
532
+ readonly conversations: number;
533
+ readonly outcome: "marked";
534
+ readonly position: number;
535
+ } | {
536
+ readonly cut?: boolean;
537
+ readonly exit_code?: number;
538
+ readonly outcome: "ran";
539
+ readonly output?: string;
540
+ readonly position: number;
541
+ readonly run: string;
542
+ } | {
543
+ readonly mentioned: number;
544
+ readonly outcome: "posted";
545
+ readonly position: number;
546
+ } | {
547
+ readonly outcome: "continued";
548
+ readonly position: number;
549
+ readonly request: string;
550
+ } | {
551
+ readonly outcome: "notified";
552
+ readonly position: number;
553
+ readonly reached: number;
554
+ } | {
555
+ readonly outcome: "paused";
556
+ readonly position: number;
557
+ } | {
558
+ readonly outcome: "ran";
559
+ readonly position: number;
560
+ readonly release: string;
561
+ } | {
562
+ readonly outcome: "requested";
563
+ readonly position: number;
564
+ readonly request: string;
565
+ } | {
566
+ readonly outcome: "running";
567
+ readonly position: number;
568
+ readonly release: string;
569
+ } | {
570
+ readonly outcome: "running";
571
+ readonly position: number;
572
+ readonly run: string;
573
+ } | {
574
+ readonly outcome: "waiting";
575
+ readonly position: number;
576
+ })[];
577
+ readonly code?: "cap_reached";
578
+ readonly created_at: string;
579
+ readonly missed?: "failed" | "skipped";
580
+ readonly moment?: string;
581
+ readonly path?: string;
582
+ readonly room_ref?: string;
583
+ readonly trigger: string;
584
+ readonly url?: string;
585
+ }[];
586
+ };
587
+ };
588
+ }
589
+ export type HouseParams<Name extends string> = Name extends keyof HouseMethods ? HouseMethods[Name]['params'] : unknown;
590
+ type CallResult = Awaited<ReturnType<MdRuntimeClient['call']>>;
591
+ export type HouseResult<Name extends string> = Exclude<CallResult, {
592
+ readonly kind: 'action';
593
+ }> | (Extract<CallResult, {
594
+ readonly kind: 'action';
595
+ }> & {
596
+ readonly result: Name extends keyof HouseMethods ? HouseMethods[Name]['result'] : unknown;
597
+ });
6
598
  export interface HouseRuntime extends Omit<MdRuntimeClient, 'call'> {
7
- call<Name extends Open<keyof HouseCalls>>(name: Name, input: HouseCallInput<Name>): ReturnType<MdRuntimeClient['call']>;
599
+ call<Name extends Open<keyof HouseMethods>>(method: Name, params: HouseParams<Name>): Promise<HouseResult<Name>>;
8
600
  }
9
601
  export interface HouseSyncState {
10
602
  readonly state: string;
@@ -14,6 +606,7 @@ export interface HouseCredentialState {
14
606
  readonly state: Open<'none' | 'held' | 'rejected'>;
15
607
  readonly expiresAt: number | null;
16
608
  }
609
+ export type HouseDatabaseFailure = 'damaged';
17
610
  export type HouseAnalyticsChoice = 'accept' | 'decline';
18
611
  export interface HouseAnalytics {
19
612
  readonly measures: boolean;
@@ -30,9 +623,9 @@ export interface HouseStatus {
30
623
  readonly sync: HouseSyncState | null;
31
624
  readonly refusal: {
32
625
  readonly code: string;
33
- readonly retryable: boolean;
34
626
  } | null;
35
627
  readonly loss: string | null;
628
+ readonly database: Open<HouseDatabaseFailure> | null;
36
629
  readonly analytics: HouseAnalytics;
37
630
  readonly serviceMode: Open<'open' | 'write-halted'> | null;
38
631
  readonly offline: boolean;
@@ -41,6 +634,7 @@ export type HouseNavigationMode = 'push' | 'replace';
41
634
  export interface HouseTab {
42
635
  readonly title?: string;
43
636
  readonly icon?: string;
637
+ readonly scheme?: 'light' | 'dark' | null;
44
638
  }
45
639
  interface HouseRelease {
46
640
  readonly app_ref: string;
@@ -71,8 +665,7 @@ export interface HouseExternalRequest {
71
665
  readonly headers?: Readonly<Record<string, string>>;
72
666
  readonly body?: string;
73
667
  readonly body_base64?: string;
74
- readonly account?: string;
75
- readonly slot?: string;
668
+ readonly room_ref?: string;
76
669
  }
77
670
  export type HouseExternalAnswer = {
78
671
  readonly status: number;
@@ -92,8 +685,26 @@ export interface HouseAppMessage {
92
685
  readonly from: string;
93
686
  readonly body: unknown;
94
687
  }
95
- export type HouseInstallation = Open<'accepted' | 'dismissed' | 'manual'>;
688
+ export interface HouseBox {
689
+ readonly x: number;
690
+ readonly y: number;
691
+ readonly width: number;
692
+ readonly height: number;
693
+ }
694
+ export interface HouseTitleRow {
695
+ readonly height: number;
696
+ readonly controls: readonly HouseBox[];
697
+ }
96
698
  export type HouseNotifications = Open<'on' | 'off' | 'blocked' | 'unavailable'>;
699
+ export interface HouseTelegram {
700
+ readonly state: Open<'available' | 'linked' | 'unavailable'>;
701
+ readonly name: string | null;
702
+ readonly username: string | null;
703
+ }
704
+ export interface HouseCeremonyEnded {
705
+ readonly said: string | null;
706
+ readonly done: boolean;
707
+ }
97
708
  export interface HouseCeremonyRefused extends Error {
98
709
  readonly name: 'HouseCeremonyRefused';
99
710
  readonly code: Open<'house_ceremony_refused'>;
@@ -110,16 +721,58 @@ export interface HouseBrowserRefused extends Error {
110
721
  readonly code: string;
111
722
  readonly retryable: boolean;
112
723
  }
724
+ export interface HouseCooperation {
725
+ placed(): Promise<void> | void;
726
+ }
727
+ export interface HouseChatOpened {
728
+ readonly conversation: string | null;
729
+ readonly agent: string | null;
730
+ }
731
+ export interface HouseChatOptions {
732
+ readonly conversation?: string | null;
733
+ readonly agent?: string | null;
734
+ readonly onOpen?: (opened: HouseChatOpened) => void;
735
+ readonly onLink?: (href: string) => void;
736
+ }
737
+ export interface HouseMountedChat {
738
+ update(options: HouseChatOptions): void;
739
+ unmount(): void;
740
+ }
741
+ export interface HouseChatButtonOptions {
742
+ readonly onOpen?: (opened: HouseChatOpened) => void;
743
+ readonly onLink?: (href: string) => void;
744
+ }
745
+ export interface HouseChatButtonMount extends HouseChatButtonOptions {
746
+ readonly agent?: string | null;
747
+ }
748
+ export interface HouseChatTarget {
749
+ readonly conversation?: string | null;
750
+ readonly agent?: string | null;
751
+ readonly docked?: boolean;
752
+ }
753
+ export interface HouseChatButton {
754
+ open(target?: HouseChatTarget): void;
755
+ hide(): void;
756
+ update(options: HouseChatButtonOptions): void;
757
+ unmount(): void;
758
+ }
759
+ export interface HouseChat {
760
+ mount(element: object, options?: HouseChatOptions): Promise<HouseMountedChat>;
761
+ mountButton(options?: HouseChatButtonMount): Promise<HouseChatButton>;
762
+ }
113
763
  export interface HouseBridge {
114
764
  readonly runtime: Promise<HouseRuntime>;
765
+ readonly chat: HouseChat;
115
766
  address(): string | null;
116
767
  onAddress(listener: (address: string) => void): () => void;
768
+ cameFrom(): string | null;
117
769
  push(address: string): Promise<string>;
118
770
  replace(address: string): Promise<string>;
119
- ceremony(path: string): Promise<never>;
120
- install(): Promise<HouseInstallation>;
771
+ ceremony(path: string): Promise<HouseCeremonyEnded>;
772
+ onTitleBar(listener: (area: HouseBox | null) => void): () => void;
773
+ setTitleBar(row: HouseTitleRow | null): void;
121
774
  notifications(on?: boolean): Promise<HouseNotifications>;
122
- setBadge(unread: readonly string[]): Promise<void>;
775
+ telegram(link?: true): Promise<HouseTelegram>;
123
776
  setTab(tab: HouseTab): void;
124
777
  sourceTop(app: string, release?: string): Promise<HouseSourceTop | HouseRefusal | null>;
125
778
  sourceDownload(app: string, release?: string): Promise<HouseSourceDownload | HouseRefusal | null>;
@@ -130,8 +783,10 @@ export interface HouseBridge {
130
783
  onStatus(listener: (status: HouseStatus) => void): () => void;
131
784
  messages(listener: (message: HouseAppMessage) => void): () => void;
132
785
  analyticsConsent(choice: HouseAnalyticsChoice): void;
786
+ cooperate(cooperation: HouseCooperation): () => void;
133
787
  }
134
788
  export interface HouseHeld {
135
789
  readonly houseBridge: HouseBridge;
136
790
  }
137
791
  export declare const houseBridge: () => HouseBridge;
792
+ export {};