@agentshouse/app-bridge 0.1.0-cfb240c3fb89d → 0.1.0-cfb893a1d2cd3

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 (124) hide show
  1. package/README.md +11 -11
  2. package/dist/index.d.ts +686 -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 +15 -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 +43 -14
  14. package/dist/mdmodel/indexed.d.ts +8 -0
  15. package/dist/mdmodel/kinds.d.ts +19 -0
  16. package/dist/mdmodel/markdown.d.ts +74 -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/project.d.ts +1 -0
  23. package/dist/mdmodel/query/language.d.ts +253 -0
  24. package/dist/mdmodel/query/match.d.ts +13 -0
  25. package/dist/mdmodel/query/rows.d.ts +31 -0
  26. package/dist/mdmodel/query/sql.d.ts +38 -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 +44 -15
  31. package/dist/mdmodel/validate.d.ts +34 -4
  32. package/dist/mdmodel/yaml.d.ts +4 -4
  33. package/dist/mdruntime/actions.d.ts +25 -0
  34. package/dist/mdruntime/adapter.d.ts +247 -117
  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 +0 -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 +50 -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 +149 -0
  47. package/dist/mdruntime/conversation-row.d.ts +39 -0
  48. package/dist/mdruntime/conversation.d.ts +85 -48
  49. package/dist/mdruntime/declaration.d.ts +9 -0
  50. package/dist/mdruntime/durability.d.ts +24 -1
  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 +20 -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 +24 -0
  60. package/dist/mdruntime/messages.d.ts +57 -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 +62 -9
  66. package/dist/mdruntime/overlay.d.ts +9 -6
  67. package/dist/mdruntime/preparation.d.ts +40 -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 +29 -7
  71. package/dist/mdruntime/readiness.d.ts +54 -0
  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 +38 -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 +5 -2
  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 +225 -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 -141
  100. package/dist/mdruntime/stored.d.ts +166 -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 +243 -36
  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 +50 -3
  113. package/docs/families.md +113 -36
  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/profile.d.ts +0 -5
  120. package/dist/mdruntime/connection.d.ts +0 -127
  121. package/dist/mdruntime/file.d.ts +0 -19
  122. package/dist/mdruntime/rows.d.ts +0 -36
  123. package/dist/mdruntime/shared.d.ts +0 -10
  124. package/dist/mdruntime/turn.d.ts +0 -6
package/dist/index.d.ts CHANGED
@@ -1,10 +1,621 @@
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 agent_name?: string;
276
+ readonly at: string;
277
+ readonly by?: string;
278
+ readonly kind: "role_given" | "role_taken";
279
+ readonly role: string;
280
+ readonly user: string;
281
+ } | {
282
+ readonly at: string;
283
+ readonly kind: "granted" | "revoked";
284
+ readonly user: string;
285
+ })[];
286
+ readonly members: readonly {
287
+ readonly access?: "manage" | "owner" | "read" | "write";
288
+ readonly copies?: "online_only" | "search_only";
289
+ readonly display_name: string;
290
+ readonly email?: string;
291
+ readonly member_document: null | string;
292
+ readonly owner: boolean;
293
+ readonly schema_roles?: readonly string[];
294
+ readonly schema_roles_given?: readonly {
295
+ readonly agent_name?: string;
296
+ readonly at: string;
297
+ readonly by?: string;
298
+ readonly role: string;
299
+ }[];
300
+ readonly since: null | string;
301
+ readonly through_space?: true;
302
+ readonly user: string;
303
+ }[];
304
+ };
305
+ };
306
+ readonly "rooms/settings/processing/read": {
307
+ readonly params: {
308
+ readonly operation_id?: string;
309
+ readonly path: string;
310
+ readonly room_ref: string;
311
+ };
312
+ readonly result: {
313
+ readonly embedding: {
314
+ readonly condition: null | {
315
+ readonly kind: "demand_failed" | "embed_again_failed";
316
+ readonly path: string;
317
+ };
318
+ readonly embedding_estimate: null | {
319
+ readonly documents: number;
320
+ readonly measured_tokens: number;
321
+ readonly unmeasured_documents: number;
322
+ };
323
+ readonly finished: boolean;
324
+ readonly indexed_chunks: number;
325
+ };
326
+ readonly explicit: readonly {
327
+ readonly path: string;
328
+ readonly policy: "Off" | "On";
329
+ }[];
330
+ readonly path: string;
331
+ readonly policy: {
332
+ readonly from: null | string;
333
+ readonly origin: "default" | "explicit" | "inherited";
334
+ readonly reason: null | "full_house_required" | "room_too_large";
335
+ readonly value: "Off" | "On";
336
+ };
337
+ readonly writable: boolean;
338
+ };
339
+ };
340
+ readonly "service-keys/signatures/check": {
341
+ readonly params: {
342
+ readonly operation_id?: string;
343
+ readonly origin: string;
344
+ readonly room_ref: string;
345
+ readonly signature: string;
346
+ readonly text: string;
347
+ };
348
+ readonly result: {
349
+ readonly matched: boolean;
350
+ };
351
+ };
352
+ readonly "sites/functions/call": {
353
+ readonly params: {
354
+ readonly function: string;
355
+ readonly input?: readonly (readonly unknown[] | boolean | null | number | {
356
+ readonly [key: string]: unknown;
357
+ } | string)[] | boolean | null | number | {
358
+ readonly [key: string]: readonly unknown[] | boolean | null | number | {
359
+ readonly [key: string]: unknown;
360
+ } | string;
361
+ } | string;
362
+ };
363
+ readonly result: {
364
+ readonly answer: readonly unknown[] | boolean | null | number | {
365
+ readonly [key: string]: unknown;
366
+ } | string;
367
+ };
368
+ };
369
+ readonly "sites/submissions/create": {
370
+ readonly params: {
371
+ readonly content: string;
372
+ };
373
+ readonly result: {
374
+ readonly submitted: true;
375
+ };
376
+ };
377
+ readonly "storage/inventory/read": {
378
+ readonly params: {
379
+ readonly operation_id?: string;
380
+ readonly room_ref?: string;
381
+ readonly rooms?: "owned";
382
+ };
383
+ readonly result: {
384
+ readonly blob: {
385
+ readonly bytes: string;
386
+ readonly gigabytes: string;
387
+ };
388
+ readonly freshness: {
389
+ readonly state: "settled";
390
+ };
391
+ readonly indexed_text: {
392
+ readonly bytes: string;
393
+ readonly gigabytes: string;
394
+ };
395
+ readonly room_ref: string;
396
+ readonly total: {
397
+ readonly bytes: string;
398
+ readonly gigabytes: string;
399
+ };
400
+ readonly url: string;
401
+ } | {
402
+ readonly blob: {
403
+ readonly bytes: string;
404
+ readonly gigabytes: string;
405
+ };
406
+ readonly freshness: {
407
+ readonly state: "settled";
408
+ };
409
+ readonly indexed_text: {
410
+ readonly bytes: string;
411
+ readonly gigabytes: string;
412
+ };
413
+ readonly rooms?: readonly {
414
+ readonly blob: {
415
+ readonly bytes: string;
416
+ readonly gigabytes: string;
417
+ };
418
+ readonly freshness: {
419
+ readonly state: "settled";
420
+ };
421
+ readonly indexed_text: {
422
+ readonly bytes: string;
423
+ readonly gigabytes: string;
424
+ };
425
+ readonly room_ref: string;
426
+ readonly total: {
427
+ readonly bytes: string;
428
+ readonly gigabytes: string;
429
+ };
430
+ readonly url: string;
431
+ }[];
432
+ readonly site_images: {
433
+ readonly bound: string;
434
+ readonly bytes: string;
435
+ readonly payloads: string;
436
+ };
437
+ readonly total: {
438
+ readonly bytes: string;
439
+ readonly gigabytes: string;
440
+ };
441
+ };
442
+ };
443
+ readonly "triggers/fired/list": {
444
+ readonly params: {
445
+ readonly operation_id?: string;
446
+ readonly room_ref?: string;
447
+ };
448
+ readonly result: {
449
+ readonly events: readonly {
450
+ readonly actions: readonly ({
451
+ 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";
452
+ readonly code: "cap_reached";
453
+ readonly outcome: "refused";
454
+ readonly position: number;
455
+ readonly retry_at: string;
456
+ } | {
457
+ 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";
458
+ readonly code: "cap_reached";
459
+ readonly outcome: "refused";
460
+ readonly position: number;
461
+ } | {
462
+ readonly code: "agent_function_request_not_started";
463
+ readonly final?: true;
464
+ readonly outcome: "failed";
465
+ readonly position: number;
466
+ } | {
467
+ readonly code: "agent_function_unreadable";
468
+ readonly document_path: string;
469
+ readonly final: true;
470
+ readonly outcome: "failed";
471
+ readonly position: number;
472
+ } | {
473
+ readonly code: "agent_unavailable";
474
+ readonly outcome: "withdrawn";
475
+ readonly position: number;
476
+ } | {
477
+ readonly code: "function_failed";
478
+ readonly cut?: boolean;
479
+ readonly error: string;
480
+ readonly exit_code?: number;
481
+ readonly final: true;
482
+ readonly outcome: "failed";
483
+ readonly output?: string;
484
+ readonly position: number;
485
+ readonly run: string;
486
+ } | {
487
+ readonly code: "function_failed";
488
+ readonly error: string;
489
+ readonly final: true;
490
+ readonly outcome: "failed";
491
+ readonly position: number;
492
+ readonly release: string;
493
+ } | {
494
+ readonly code: "function_not_started";
495
+ readonly final?: true;
496
+ readonly outcome: "failed";
497
+ readonly position: number;
498
+ readonly tries: number;
499
+ } | {
500
+ readonly code: "internal_error";
501
+ readonly final: true;
502
+ readonly outcome: "failed";
503
+ readonly position: number;
504
+ } | {
505
+ readonly code: "limit_reached";
506
+ readonly limit: "reads";
507
+ readonly outcome: "refused";
508
+ readonly period: "day" | "minute";
509
+ readonly position: number;
510
+ readonly retry_at: string;
511
+ readonly value: string;
512
+ } | {
513
+ readonly code: "limit_reached";
514
+ readonly limit: "writes";
515
+ readonly outcome: "refused";
516
+ readonly period: "day" | "minute";
517
+ readonly position: number;
518
+ readonly retry_at: string;
519
+ } | {
520
+ readonly code: "limit_reached";
521
+ readonly limit: "blob" | "indexed_text";
522
+ readonly outcome: "refused";
523
+ readonly position: number;
524
+ readonly used: string;
525
+ readonly value: string;
526
+ } | {
527
+ readonly code: "limit_reached";
528
+ readonly limit: "custom_domains" | "external_calls" | "publish_data" | "site_function_calls" | "sites";
529
+ readonly outcome: "refused";
530
+ readonly position: number;
531
+ readonly retry_at: string;
532
+ } | {
533
+ readonly code: "limit_reached";
534
+ readonly limit: "custom_domains" | "external_calls" | "publish_data" | "site_function_calls" | "sites";
535
+ readonly outcome: "refused";
536
+ readonly position: number;
537
+ } | {
538
+ readonly code: "post_not_confirmed";
539
+ readonly final: true;
540
+ readonly outcome: "failed";
541
+ readonly position: number;
542
+ } | {
543
+ readonly code: "agent_function_retired" | "environment_offline" | "no_group" | "no_recipient" | "not_found" | "target_agent_unavailable";
544
+ readonly outcome: "no_target";
545
+ readonly position: number;
546
+ } | {
547
+ readonly code: string;
548
+ readonly outcome: "refused";
549
+ readonly position: number;
550
+ } | {
551
+ readonly conversations: number;
552
+ readonly outcome: "marked";
553
+ readonly position: number;
554
+ } | {
555
+ readonly cut?: boolean;
556
+ readonly exit_code?: number;
557
+ readonly outcome: "ran";
558
+ readonly output?: string;
559
+ readonly position: number;
560
+ readonly run: string;
561
+ } | {
562
+ readonly mentioned: number;
563
+ readonly outcome: "posted";
564
+ readonly position: number;
565
+ } | {
566
+ readonly outcome: "continued";
567
+ readonly position: number;
568
+ readonly request: string;
569
+ } | {
570
+ readonly outcome: "notified";
571
+ readonly position: number;
572
+ readonly reached: number;
573
+ } | {
574
+ readonly outcome: "paused";
575
+ readonly position: number;
576
+ } | {
577
+ readonly outcome: "ran";
578
+ readonly position: number;
579
+ readonly release: string;
580
+ } | {
581
+ readonly outcome: "requested";
582
+ readonly position: number;
583
+ readonly request: string;
584
+ } | {
585
+ readonly outcome: "running";
586
+ readonly position: number;
587
+ readonly release: string;
588
+ } | {
589
+ readonly outcome: "running";
590
+ readonly position: number;
591
+ readonly run: string;
592
+ } | {
593
+ readonly outcome: "waiting";
594
+ readonly position: number;
595
+ })[];
596
+ readonly code?: "cap_reached";
597
+ readonly created_at: string;
598
+ readonly missed?: "failed" | "skipped";
599
+ readonly moment?: string;
600
+ readonly path?: string;
601
+ readonly room_ref?: string;
602
+ readonly trigger: string;
603
+ readonly url?: string;
604
+ }[];
605
+ };
606
+ };
607
+ }
608
+ export type HouseParams<Name extends string> = Name extends keyof HouseMethods ? HouseMethods[Name]['params'] : unknown;
609
+ type CallResult = Awaited<ReturnType<MdRuntimeClient['call']>>;
610
+ export type HouseResult<Name extends string> = Exclude<CallResult, {
611
+ readonly kind: 'action';
612
+ }> | (Extract<CallResult, {
613
+ readonly kind: 'action';
614
+ }> & {
615
+ readonly result: Name extends keyof HouseMethods ? HouseMethods[Name]['result'] : unknown;
616
+ });
6
617
  export interface HouseRuntime extends Omit<MdRuntimeClient, 'call'> {
7
- call<Name extends Open<keyof HouseCalls>>(name: Name, input: HouseCallInput<Name>): ReturnType<MdRuntimeClient['call']>;
618
+ call<Name extends Open<keyof HouseMethods>>(method: Name, params: HouseParams<Name>): Promise<HouseResult<Name>>;
8
619
  }
9
620
  export interface HouseSyncState {
10
621
  readonly state: string;
@@ -14,6 +625,7 @@ export interface HouseCredentialState {
14
625
  readonly state: Open<'none' | 'held' | 'rejected'>;
15
626
  readonly expiresAt: number | null;
16
627
  }
628
+ export type HouseDatabaseFailure = 'damaged';
17
629
  export type HouseAnalyticsChoice = 'accept' | 'decline';
18
630
  export interface HouseAnalytics {
19
631
  readonly measures: boolean;
@@ -30,9 +642,9 @@ export interface HouseStatus {
30
642
  readonly sync: HouseSyncState | null;
31
643
  readonly refusal: {
32
644
  readonly code: string;
33
- readonly retryable: boolean;
34
645
  } | null;
35
646
  readonly loss: string | null;
647
+ readonly database: Open<HouseDatabaseFailure> | null;
36
648
  readonly analytics: HouseAnalytics;
37
649
  readonly serviceMode: Open<'open' | 'write-halted'> | null;
38
650
  readonly offline: boolean;
@@ -41,6 +653,7 @@ export type HouseNavigationMode = 'push' | 'replace';
41
653
  export interface HouseTab {
42
654
  readonly title?: string;
43
655
  readonly icon?: string;
656
+ readonly scheme?: 'light' | 'dark' | null;
44
657
  }
45
658
  interface HouseRelease {
46
659
  readonly app_ref: string;
@@ -71,8 +684,7 @@ export interface HouseExternalRequest {
71
684
  readonly headers?: Readonly<Record<string, string>>;
72
685
  readonly body?: string;
73
686
  readonly body_base64?: string;
74
- readonly account?: string;
75
- readonly slot?: string;
687
+ readonly room_ref?: string;
76
688
  }
77
689
  export type HouseExternalAnswer = {
78
690
  readonly status: number;
@@ -92,8 +704,26 @@ export interface HouseAppMessage {
92
704
  readonly from: string;
93
705
  readonly body: unknown;
94
706
  }
95
- export type HouseInstallation = Open<'accepted' | 'dismissed' | 'manual'>;
707
+ export interface HouseBox {
708
+ readonly x: number;
709
+ readonly y: number;
710
+ readonly width: number;
711
+ readonly height: number;
712
+ }
713
+ export interface HouseTitleRow {
714
+ readonly height: number;
715
+ readonly controls: readonly HouseBox[];
716
+ }
96
717
  export type HouseNotifications = Open<'on' | 'off' | 'blocked' | 'unavailable'>;
718
+ export interface HouseTelegram {
719
+ readonly state: Open<'available' | 'linked' | 'unavailable'>;
720
+ readonly name: string | null;
721
+ readonly username: string | null;
722
+ }
723
+ export interface HouseCeremonyEnded {
724
+ readonly said: string | null;
725
+ readonly done: boolean;
726
+ }
97
727
  export interface HouseCeremonyRefused extends Error {
98
728
  readonly name: 'HouseCeremonyRefused';
99
729
  readonly code: Open<'house_ceremony_refused'>;
@@ -110,16 +740,57 @@ export interface HouseBrowserRefused extends Error {
110
740
  readonly code: string;
111
741
  readonly retryable: boolean;
112
742
  }
743
+ export interface HouseCooperation {
744
+ placed(): Promise<void> | void;
745
+ }
746
+ export interface HouseChatOpened {
747
+ readonly conversation: string | null;
748
+ readonly agent: string | null;
749
+ }
750
+ export interface HouseChatOptions {
751
+ readonly conversation?: string | null;
752
+ readonly agent?: string | null;
753
+ readonly onOpen?: (opened: HouseChatOpened) => void;
754
+ readonly onLink?: (href: string) => void;
755
+ }
756
+ export interface HouseMountedChat {
757
+ update(options: HouseChatOptions): void;
758
+ unmount(): void;
759
+ }
760
+ export interface HouseChatButtonOptions {
761
+ readonly onOpen?: (opened: HouseChatOpened) => void;
762
+ readonly onLink?: (href: string) => void;
763
+ }
764
+ export interface HouseChatButtonMount extends HouseChatButtonOptions {
765
+ readonly agent?: string | null;
766
+ }
767
+ export interface HouseChatTarget {
768
+ readonly conversation?: string | null;
769
+ readonly agent?: string | null;
770
+ readonly docked?: boolean;
771
+ }
772
+ export interface HouseChatButton {
773
+ open(target?: HouseChatTarget): void;
774
+ hide(): void;
775
+ update(options: HouseChatButtonOptions): void;
776
+ unmount(): void;
777
+ }
778
+ export interface HouseChat {
779
+ mount(element: object, options?: HouseChatOptions): Promise<HouseMountedChat>;
780
+ mountButton(options?: HouseChatButtonMount): Promise<HouseChatButton>;
781
+ }
113
782
  export interface HouseBridge {
114
783
  readonly runtime: Promise<HouseRuntime>;
784
+ readonly chat: HouseChat;
115
785
  address(): string | null;
116
786
  onAddress(listener: (address: string) => void): () => void;
117
787
  push(address: string): Promise<string>;
118
788
  replace(address: string): Promise<string>;
119
- ceremony(path: string): Promise<never>;
120
- install(): Promise<HouseInstallation>;
789
+ ceremony(path: string): Promise<HouseCeremonyEnded>;
790
+ onTitleBar(listener: (area: HouseBox | null) => void): () => void;
791
+ setTitleBar(row: HouseTitleRow | null): void;
121
792
  notifications(on?: boolean): Promise<HouseNotifications>;
122
- setBadge(unread: readonly string[]): Promise<void>;
793
+ telegram(link?: true): Promise<HouseTelegram>;
123
794
  setTab(tab: HouseTab): void;
124
795
  sourceTop(app: string, release?: string): Promise<HouseSourceTop | HouseRefusal | null>;
125
796
  sourceDownload(app: string, release?: string): Promise<HouseSourceDownload | HouseRefusal | null>;
@@ -130,8 +801,10 @@ export interface HouseBridge {
130
801
  onStatus(listener: (status: HouseStatus) => void): () => void;
131
802
  messages(listener: (message: HouseAppMessage) => void): () => void;
132
803
  analyticsConsent(choice: HouseAnalyticsChoice): void;
804
+ cooperate(cooperation: HouseCooperation): () => void;
133
805
  }
134
806
  export interface HouseHeld {
135
807
  readonly houseBridge: HouseBridge;
136
808
  }
137
809
  export declare const houseBridge: () => HouseBridge;
810
+ export {};