@agentshouse/app-bridge 0.1.0-c1996d56f778a → 0.1.0-c1a18470b77bf

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 (67) hide show
  1. package/dist/index.d.ts +108 -9
  2. package/dist/mdmodel/built-in.d.ts +3 -0
  3. package/dist/mdmodel/definition.d.ts +2 -2
  4. package/dist/mdmodel/document.d.ts +1 -2
  5. package/dist/mdmodel/fields.d.ts +1 -1
  6. package/dist/mdmodel/house-model.d.ts +869 -0
  7. package/dist/mdmodel/house-references/crockford.d.ts +3 -0
  8. package/dist/mdmodel/house-references/patterns.d.ts +8 -0
  9. package/dist/mdmodel/index.d.ts +18 -7
  10. package/dist/mdmodel/media-type.d.ts +71 -0
  11. package/dist/mdmodel/moment.d.ts +6 -0
  12. package/dist/mdmodel/not-ready.d.ts +1 -0
  13. package/dist/mdmodel/paths.d.ts +5 -0
  14. package/dist/mdmodel/query/match.d.ts +1 -1
  15. package/dist/mdmodel/query/rows.d.ts +1 -1
  16. package/dist/mdmodel/references.d.ts +2 -2
  17. package/dist/mdmodel/room-types.d.ts +6 -0
  18. package/dist/mdmodel/types.d.ts +1 -10
  19. package/dist/mdmodel/validate.d.ts +2 -0
  20. package/dist/mdmodel/yaml.d.ts +4 -4
  21. package/dist/mdruntime/adapter.d.ts +79 -11
  22. package/dist/mdruntime/attached-model.d.ts +0 -1
  23. package/dist/mdruntime/authored.d.ts +87 -0
  24. package/dist/mdruntime/change.d.ts +4 -0
  25. package/dist/mdruntime/client.d.ts +10 -3
  26. package/dist/mdruntime/collection.d.ts +5 -1
  27. package/dist/mdruntime/conversation-live.d.ts +16 -6
  28. package/dist/mdruntime/conversation-row.d.ts +8 -1
  29. package/dist/mdruntime/conversation.d.ts +14 -7
  30. package/dist/mdruntime/durability.d.ts +2 -0
  31. package/dist/mdruntime/house-query.d.ts +20 -0
  32. package/dist/mdruntime/install.d.ts +59 -0
  33. package/dist/mdruntime/listing.d.ts +24 -12
  34. package/dist/mdruntime/live.d.ts +5 -3
  35. package/dist/mdruntime/media.d.ts +18 -1
  36. package/dist/mdruntime/messages.d.ts +3 -1
  37. package/dist/mdruntime/modal.d.ts +1 -0
  38. package/dist/mdruntime/model.d.ts +4 -2
  39. package/dist/mdruntime/observation.d.ts +29 -12
  40. package/dist/mdruntime/outcome.d.ts +10 -1
  41. package/dist/mdruntime/overlay.d.ts +1 -1
  42. package/dist/mdruntime/preparation.d.ts +27 -6
  43. package/dist/mdruntime/presence.d.ts +8 -2
  44. package/dist/mdruntime/reach.d.ts +14 -5
  45. package/dist/mdruntime/readiness.d.ts +9 -3
  46. package/dist/mdruntime/reads.d.ts +1 -1
  47. package/dist/mdruntime/recovery.d.ts +1 -0
  48. package/dist/mdruntime/room-draft.d.ts +28 -3
  49. package/dist/mdruntime/runtime.d.ts +1 -0
  50. package/dist/mdruntime/saves.d.ts +2 -0
  51. package/dist/mdruntime/socket.d.ts +1 -0
  52. package/dist/mdruntime/source.d.ts +5 -0
  53. package/dist/mdruntime/store/installs.d.ts +2 -2
  54. package/dist/mdruntime/store/readiness.d.ts +5 -4
  55. package/dist/mdruntime/store/records.d.ts +11 -1
  56. package/dist/mdruntime/store/rooms-shown.d.ts +7 -0
  57. package/dist/mdruntime/store.d.ts +12 -8
  58. package/dist/mdruntime/stored.d.ts +23 -13
  59. package/dist/mdruntime/surface.d.ts +11 -5
  60. package/dist/mdruntime/tables.d.ts +10 -49
  61. package/dist/mdruntime/wire.d.ts +19 -8
  62. package/dist/session-content/state.d.ts +4 -6
  63. package/dist/session-content/turn.d.ts +4 -6
  64. package/dist/test-host.d.ts +8 -1
  65. package/dist/test-host.js +32 -0
  66. package/docs/families.md +62 -17
  67. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -271,11 +271,18 @@ export interface HouseMethods {
271
271
  readonly room_ref: string;
272
272
  };
273
273
  readonly result: {
274
- readonly history?: readonly {
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
+ } | {
275
282
  readonly at: string;
276
283
  readonly kind: "granted" | "revoked";
277
284
  readonly user: string;
278
- }[];
285
+ })[];
279
286
  readonly members: readonly {
280
287
  readonly access?: "manage" | "owner" | "read" | "write";
281
288
  readonly copies?: "online_only" | "search_only";
@@ -284,6 +291,12 @@ export interface HouseMethods {
284
291
  readonly member_document: null | string;
285
292
  readonly owner: boolean;
286
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
+ }[];
287
300
  readonly since: null | string;
288
301
  readonly through_space?: true;
289
302
  readonly user: string;
@@ -318,12 +331,41 @@ export interface HouseMethods {
318
331
  readonly policy: {
319
332
  readonly from: null | string;
320
333
  readonly origin: "default" | "explicit" | "inherited";
321
- readonly reason: null | "room_too_large" | "unfunded";
334
+ readonly reason: null | "full_house_required" | "room_too_large";
322
335
  readonly value: "Off" | "On";
323
336
  };
324
337
  readonly writable: boolean;
325
338
  };
326
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
+ };
327
369
  readonly "sites/submissions/create": {
328
370
  readonly params: {
329
371
  readonly content: string;
@@ -416,6 +458,17 @@ export interface HouseMethods {
416
458
  readonly code: "cap_reached";
417
459
  readonly outcome: "refused";
418
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;
419
472
  } | {
420
473
  readonly code: "agent_unavailable";
421
474
  readonly outcome: "withdrawn";
@@ -443,6 +496,11 @@ export interface HouseMethods {
443
496
  readonly outcome: "failed";
444
497
  readonly position: number;
445
498
  readonly tries: number;
499
+ } | {
500
+ readonly code: "internal_error";
501
+ readonly final: true;
502
+ readonly outcome: "failed";
503
+ readonly position: number;
446
504
  } | {
447
505
  readonly code: "limit_reached";
448
506
  readonly limit: "reads";
@@ -467,21 +525,22 @@ export interface HouseMethods {
467
525
  readonly value: string;
468
526
  } | {
469
527
  readonly code: "limit_reached";
470
- readonly limit: "custom_domains" | "external_calls" | "publish_data" | "sites";
528
+ readonly limit: "custom_domains" | "external_calls" | "publish_data" | "site_function_calls" | "sites";
471
529
  readonly outcome: "refused";
472
530
  readonly position: number;
473
531
  readonly retry_at: string;
474
532
  } | {
475
533
  readonly code: "limit_reached";
476
- readonly limit: "custom_domains" | "external_calls" | "publish_data" | "sites";
534
+ readonly limit: "custom_domains" | "external_calls" | "publish_data" | "site_function_calls" | "sites";
477
535
  readonly outcome: "refused";
478
536
  readonly position: number;
479
537
  } | {
480
- readonly code: "agent_function_request_not_started" | "internal_error";
538
+ readonly code: "post_not_confirmed";
539
+ readonly final: true;
481
540
  readonly outcome: "failed";
482
541
  readonly position: number;
483
542
  } | {
484
- readonly code: "agent_function_retired" | "environment_offline" | "no_recipient" | "not_found" | "target_agent_unavailable";
543
+ readonly code: "agent_function_retired" | "environment_offline" | "no_group" | "no_recipient" | "not_found" | "target_agent_unavailable";
485
544
  readonly outcome: "no_target";
486
545
  readonly position: number;
487
546
  } | {
@@ -499,6 +558,10 @@ export interface HouseMethods {
499
558
  readonly output?: string;
500
559
  readonly position: number;
501
560
  readonly run: string;
561
+ } | {
562
+ readonly mentioned: number;
563
+ readonly outcome: "posted";
564
+ readonly position: number;
502
565
  } | {
503
566
  readonly outcome: "continued";
504
567
  readonly position: number;
@@ -641,12 +704,26 @@ export interface HouseAppMessage {
641
704
  readonly body: unknown;
642
705
  }
643
706
  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
+ }
644
717
  export type HouseNotifications = Open<'on' | 'off' | 'blocked' | 'unavailable'>;
645
718
  export interface HouseTelegram {
646
719
  readonly state: Open<'available' | 'linked' | 'unavailable'>;
647
720
  readonly name: string | null;
648
721
  readonly username: string | null;
649
722
  }
723
+ export interface HouseCeremonyEnded {
724
+ readonly said: string | null;
725
+ readonly done: boolean;
726
+ }
650
727
  export interface HouseCeremonyRefused extends Error {
651
728
  readonly name: 'HouseCeremonyRefused';
652
729
  readonly code: Open<'house_ceremony_refused'>;
@@ -680,8 +757,27 @@ export interface HouseMountedChat {
680
757
  update(options: HouseChatOptions): void;
681
758
  unmount(): void;
682
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
+ }
683
778
  export interface HouseChat {
684
779
  mount(element: object, options?: HouseChatOptions): Promise<HouseMountedChat>;
780
+ mountButton(options?: HouseChatButtonMount): Promise<HouseChatButton>;
685
781
  }
686
782
  export interface HouseBridge {
687
783
  readonly runtime: Promise<HouseRuntime>;
@@ -690,8 +786,11 @@ export interface HouseBridge {
690
786
  onAddress(listener: (address: string) => void): () => void;
691
787
  push(address: string): Promise<string>;
692
788
  replace(address: string): Promise<string>;
693
- ceremony(path: string): Promise<never>;
694
- install(): Promise<HouseInstallation>;
789
+ ceremony(path: string): Promise<HouseCeremonyEnded>;
790
+ install(app?: string): Promise<HouseInstallation>;
791
+ installed(): Promise<boolean>;
792
+ onTitleBar(listener: (area: HouseBox | null) => void): () => void;
793
+ setTitleBar(row: HouseTitleRow | null): void;
695
794
  notifications(on?: boolean): Promise<HouseNotifications>;
696
795
  telegram(link?: true): Promise<HouseTelegram>;
697
796
  setTab(tab: HouseTab): void;
@@ -0,0 +1,3 @@
1
+ import type { VerifiedModel } from './types.js';
2
+ export declare const HOUSE_MODEL: VerifiedModel;
3
+ export declare const HOUSE_ROOM_TYPES: VerifiedModel;
@@ -14,6 +14,7 @@ export type ValueFacts = {
14
14
  readonly prefix?: readonly ValueFacts[];
15
15
  readonly items?: ValueFacts;
16
16
  readonly properties?: Readonly<Record<string, ValueFacts>>;
17
+ readonly required?: readonly string[];
17
18
  readonly patterns?: readonly PatternFacts[];
18
19
  readonly additional?: ValueFacts;
19
20
  };
@@ -39,7 +40,7 @@ export type FieldRules = {
39
40
  export type Definition = {
40
41
  readonly name: string;
41
42
  readonly memberDocument: boolean;
42
- readonly frontmatter: ValueFacts;
43
+ readonly root: ValueFacts;
43
44
  readonly fields: Readonly<Record<string, ValueFacts>>;
44
45
  readonly rules: Readonly<Record<string, FieldRules>>;
45
46
  readonly createRoles?: readonly string[];
@@ -58,7 +59,6 @@ export declare const JSON_TYPES: readonly JsonType[];
58
59
  export declare const BUILT_IN_TYPE = "any";
59
60
  export declare const ATTACHMENT = "attachment";
60
61
  export declare const OPENING: readonly string[];
61
- export declare const LONG_TEXT = "text/markdown";
62
62
  export declare const ARRAY_INDEX: RegExp;
63
63
  export declare const JSON_POINTER: RegExp;
64
64
  export declare function refuse(rule: string, location: string): Failure;
@@ -1,12 +1,11 @@
1
1
  import { type Body, type Naming } from './body.js';
2
2
  import { type Definition } from './definition.js';
3
3
  import { type HrefOccurrence, type Reading } from './markdown.js';
4
- import type { ApplyResult, BodyResult, FrontmatterResult, Change, DefinitionOf, Document, Link, ParseResult, Refusal, Span, UnlinkedBody } from './types.js';
4
+ import type { ApplyResult, BodyResult, Change, DefinitionOf, Document, Link, ParseResult, Refusal, Span, UnlinkedBody } from './types.js';
5
5
  export declare function readingOf(document: Document): Reading;
6
6
  export declare function bodyOf(document: Document): Body | null;
7
7
  export declare function linkDestinations(document: Document): readonly HrefOccurrence[];
8
8
  export declare function textSpans(document: Document): readonly Span[];
9
- export declare function parseFrontmatter(content: string, file?: string): FrontmatterResult;
10
9
  export declare function parse(content: string, file?: string, definition?: Definition | DefinitionOf): ParseResult;
11
10
  export declare function create(type: string | undefined, definition?: Definition): Document;
12
11
  export declare function relativize(document: Document, file: string, handle: string, definition?: Definition, kept?: ReadonlySet<string>): ApplyResult;
@@ -1,5 +1,5 @@
1
1
  export declare const TYPE_FIELD = "type";
2
2
  export declare const MEMBER_FIELD = "member";
3
3
  export declare const SITE_FIELD = "site";
4
- export declare const RECEIVED_FIELD = "submitted";
4
+ export declare const SUBMITTED_FIELD = "submitted";
5
5
  export declare const HOUSE_FIELDS: readonly string[];