@agentshouse/app-bridge 0.1.0-ce61879ee484f → 0.1.0-ce66713a8142c

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 (77) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.ts +107 -10
  3. package/dist/mdmodel/definition.d.ts +5 -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 +50 -7
  7. package/dist/mdmodel/house-references/patterns.d.ts +8 -0
  8. package/dist/mdmodel/index.d.ts +18 -10
  9. package/dist/mdmodel/indexed.d.ts +8 -0
  10. package/dist/mdmodel/kinds.d.ts +3 -0
  11. package/dist/mdmodel/media-type.d.ts +71 -0
  12. package/dist/mdmodel/moment.d.ts +6 -0
  13. package/dist/mdmodel/not-ready.d.ts +1 -0
  14. package/dist/mdmodel/paths.d.ts +5 -0
  15. package/dist/mdmodel/query/language.d.ts +2 -1
  16. package/dist/mdmodel/query/match.d.ts +1 -1
  17. package/dist/mdmodel/query/rows.d.ts +1 -1
  18. package/dist/mdmodel/query/sql.d.ts +5 -1
  19. package/dist/mdmodel/query/walk.d.ts +62 -0
  20. package/dist/mdmodel/references.d.ts +2 -2
  21. package/dist/mdmodel/room-types.d.ts +1 -1
  22. package/dist/mdmodel/types.d.ts +1 -10
  23. package/dist/mdmodel/validate.d.ts +2 -0
  24. package/dist/mdmodel/yaml.d.ts +4 -4
  25. package/dist/mdruntime/adapter.d.ts +92 -8
  26. package/dist/mdruntime/authored.d.ts +87 -0
  27. package/dist/mdruntime/change.d.ts +4 -0
  28. package/dist/mdruntime/client.d.ts +11 -4
  29. package/dist/mdruntime/collection.d.ts +5 -1
  30. package/dist/mdruntime/conversation-live.d.ts +15 -6
  31. package/dist/mdruntime/conversation-row.d.ts +8 -1
  32. package/dist/mdruntime/conversation.d.ts +13 -7
  33. package/dist/mdruntime/durability.d.ts +1 -0
  34. package/dist/mdruntime/house-query.d.ts +14 -0
  35. package/dist/mdruntime/install.d.ts +59 -0
  36. package/dist/mdruntime/listing.d.ts +24 -12
  37. package/dist/mdruntime/live.d.ts +5 -3
  38. package/dist/mdruntime/media.d.ts +18 -1
  39. package/dist/mdruntime/messages.d.ts +3 -1
  40. package/dist/mdruntime/modal.d.ts +1 -0
  41. package/dist/mdruntime/model.d.ts +4 -2
  42. package/dist/mdruntime/observation.d.ts +26 -10
  43. package/dist/mdruntime/outcome.d.ts +10 -1
  44. package/dist/mdruntime/overlay.d.ts +1 -1
  45. package/dist/mdruntime/preparation.d.ts +33 -7
  46. package/dist/mdruntime/presence.d.ts +8 -2
  47. package/dist/mdruntime/reach.d.ts +15 -6
  48. package/dist/mdruntime/readiness.d.ts +19 -3
  49. package/dist/mdruntime/reads.d.ts +1 -1
  50. package/dist/mdruntime/recovery.d.ts +1 -0
  51. package/dist/mdruntime/room-draft.d.ts +28 -3
  52. package/dist/mdruntime/runtime.d.ts +3 -2
  53. package/dist/mdruntime/saves.d.ts +2 -0
  54. package/dist/mdruntime/socket/session.d.ts +4 -1
  55. package/dist/mdruntime/socket.d.ts +1 -0
  56. package/dist/mdruntime/source.d.ts +5 -0
  57. package/dist/mdruntime/store/installs.d.ts +2 -2
  58. package/dist/mdruntime/store/readiness.d.ts +5 -4
  59. package/dist/mdruntime/store/records.d.ts +14 -1
  60. package/dist/mdruntime/store/rooms-shown.d.ts +7 -0
  61. package/dist/mdruntime/store.d.ts +14 -9
  62. package/dist/mdruntime/stored.d.ts +31 -14
  63. package/dist/mdruntime/surface.d.ts +11 -5
  64. package/dist/mdruntime/tables.d.ts +10 -49
  65. package/dist/mdruntime/wire.d.ts +23 -8
  66. package/dist/session-content/check.d.ts +0 -1
  67. package/dist/session-content/index.d.ts +2 -3
  68. package/dist/session-content/parts.d.ts +10 -83
  69. package/dist/session-content/state.d.ts +4 -6
  70. package/dist/session-content/turn.d.ts +28 -219
  71. package/dist/test-host.d.ts +8 -1
  72. package/dist/test-host.js +31 -1
  73. package/docs/families.md +53 -24
  74. package/package.json +2 -2
  75. package/dist/mdmodel/house-references.d.ts +0 -3
  76. package/dist/session-content/bounds.d.ts +0 -7
  77. /package/dist/mdmodel/{crockford.d.ts → house-references/crockford.d.ts} +0 -0
package/README.md CHANGED
@@ -4,7 +4,7 @@ The types of the agents.house App bridge, an accessor and an in-page test host.
4
4
  House builds the bridge object in every App it serves and hands it to the page
5
5
  before the App's own scripts run; `houseBridge()` returns that object, so an App
6
6
  carries no bridge code of its own. It carries these families: navigation,
7
- ceremonies, installation, notifications, Telegram, status, App
7
+ ceremonies, notifications, Telegram, status, App
8
8
  release code, external calls, App messages, App and Site screenshot reads and the
9
9
  Chat. [docs/families.md](docs/families.md) describes each and the test host.
10
10
 
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;
@@ -590,6 +653,7 @@ export type HouseNavigationMode = 'push' | 'replace';
590
653
  export interface HouseTab {
591
654
  readonly title?: string;
592
655
  readonly icon?: string;
656
+ readonly scheme?: 'light' | 'dark' | null;
593
657
  }
594
658
  interface HouseRelease {
595
659
  readonly app_ref: string;
@@ -640,13 +704,26 @@ export interface HouseAppMessage {
640
704
  readonly from: string;
641
705
  readonly body: unknown;
642
706
  }
643
- 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,9 @@ 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
+ onTitleBar(listener: (area: HouseBox | null) => void): () => void;
791
+ setTitleBar(row: HouseTitleRow | null): void;
695
792
  notifications(on?: boolean): Promise<HouseNotifications>;
696
793
  telegram(link?: true): Promise<HouseTelegram>;
697
794
  setTab(tab: HouseTab): void;
@@ -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,11 +40,12 @@ 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[];
46
47
  readonly deleteRoles?: readonly string[];
48
+ readonly indexed?: readonly string[];
47
49
  readonly shape: Shape;
48
50
  };
49
51
  export type Failure = {
@@ -58,7 +60,7 @@ export declare const JSON_TYPES: readonly JsonType[];
58
60
  export declare const BUILT_IN_TYPE = "any";
59
61
  export declare const ATTACHMENT = "attachment";
60
62
  export declare const OPENING: readonly string[];
61
- export declare const LONG_TEXT = "text/markdown";
63
+ export declare const UNIONS: readonly string[];
62
64
  export declare const ARRAY_INDEX: RegExp;
63
65
  export declare const JSON_POINTER: RegExp;
64
66
  export declare function refuse(rule: string, location: string): Failure;
@@ -76,6 +78,7 @@ export declare function conjoined(declared: readonly {
76
78
  readonly ancestry: ReadonlySet<unknown>;
77
79
  };
78
80
  export declare function variantsOf({ node, at }: Placed): Placed[];
81
+ export declare function admitted(nodes: readonly unknown[], defs: Readonly<Record<string, unknown>>, ancestry: ReadonlySet<unknown>): Set<string> | null;
79
82
  export declare function valueFacts(node: unknown, defs: Readonly<Record<string, unknown>>): ValueFacts;
80
83
  export declare function itemFacts(facts: ValueFacts, index: number): ValueFacts | undefined;
81
84
  export declare function memberFacts(facts: ValueFacts, key: string): ValueFacts | undefined;
@@ -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[];
@@ -43,7 +43,7 @@ export declare const HOUSE_MODEL_DECLARATION: {
43
43
  readonly kind: {
44
44
  readonly title: 'Kind';
45
45
  readonly type: 'string';
46
- readonly enum: readonly ['share-offer', 'join-request', 'join-request-approved', 'room-ownership-offer', 'managed-environment-retention-opened', 'storage-full', 'sandbox-budget-spent', 'trigger-failed', 'room-telegram-chat-paused', 'break-glass-owner-disclosure', 'export-ready', 'export-failed', 'custom', 'agent-function-request-finished'];
46
+ readonly enum: readonly ['share-offer', 'join-request', 'join-request-approved', 'room-ownership-offer', 'managed-environment-retention-opened', 'storage-full', 'sandbox-budget-spent', 'trigger-failed', 'room-telegram-chat-paused', 'break-glass-owner-disclosure', 'export-ready', 'export-failed', 'custom', 'agent-function-request-finished', 'storage-past-included'];
47
47
  };
48
48
  readonly created: {
49
49
  readonly title: 'Created';
@@ -103,7 +103,7 @@ export declare const HOUSE_MODEL_DECLARATION: {
103
103
  readonly format: 'email';
104
104
  };
105
105
  };
106
- readonly required: readonly ['name', 'email'];
106
+ readonly required: readonly ['name'];
107
107
  };
108
108
  readonly rooms: {
109
109
  readonly title: 'Rooms';
@@ -246,7 +246,7 @@ export declare const HOUSE_MODEL_DECLARATION: {
246
246
  readonly format: 'email';
247
247
  };
248
248
  };
249
- readonly required: readonly ['name', 'email'];
249
+ readonly required: readonly ['name'];
250
250
  };
251
251
  readonly environment: {
252
252
  readonly title: 'Environment';
@@ -411,7 +411,7 @@ export declare const HOUSE_MODEL_DECLARATION: {
411
411
  readonly code: {
412
412
  readonly title: 'Code';
413
413
  readonly type: 'string';
414
- readonly enum: readonly ['failed', 'function_failed', 'function_not_started', 'agent_function_request_not_started'];
414
+ readonly enum: readonly ['failed', 'internal_error', 'agent_function_unreadable', 'function_failed', 'function_not_started', 'agent_function_request_not_started', 'post_not_confirmed'];
415
415
  };
416
416
  readonly action: {
417
417
  readonly title: 'Action';
@@ -427,6 +427,10 @@ export declare const HOUSE_MODEL_DECLARATION: {
427
427
  readonly title: 'Error';
428
428
  readonly type: 'string';
429
429
  };
430
+ readonly document_path: {
431
+ readonly title: 'Document path';
432
+ readonly type: 'string';
433
+ };
430
434
  readonly agent_function: {
431
435
  readonly title: 'Agent function';
432
436
  readonly type: 'object';
@@ -461,6 +465,36 @@ export declare const HOUSE_MODEL_DECLARATION: {
461
465
  readonly type: 'integer';
462
466
  readonly minimum: 1;
463
467
  };
468
+ readonly meter: {
469
+ readonly title: 'Meter';
470
+ readonly type: 'string';
471
+ readonly enum: readonly ['indexed_text', 'blob'];
472
+ };
473
+ readonly average_bytes: {
474
+ readonly title: 'Average in bytes';
475
+ readonly type: 'integer';
476
+ readonly minimum: 0;
477
+ };
478
+ readonly included_bytes: {
479
+ readonly title: 'Included in bytes';
480
+ readonly type: 'integer';
481
+ readonly minimum: 1;
482
+ };
483
+ readonly block_bytes: {
484
+ readonly title: 'Block in bytes';
485
+ readonly type: 'integer';
486
+ readonly minimum: 1;
487
+ };
488
+ readonly block_usd: {
489
+ readonly title: 'Block price in USD';
490
+ readonly type: 'number';
491
+ readonly exclusiveMinimum: 0;
492
+ };
493
+ readonly amount_usd: {
494
+ readonly title: 'Amount in USD';
495
+ readonly type: 'number';
496
+ readonly exclusiveMinimum: 0;
497
+ };
464
498
  };
465
499
  readonly required: readonly ['notification', 'kind', 'created', 'way_in', 'subject'];
466
500
  };
@@ -469,7 +503,7 @@ export declare const HOUSE_MODEL_DECLARATION: {
469
503
  readonly properties: {};
470
504
  };
471
505
  readonly 'house-agent-function': {
472
- readonly description: "One Agent function that serves this Room, which House alone writes from its owner's document in their Private Room: the `agent_function` by identifier, its `description`, the `input` a caller sends, empty when it takes nothing, and the `agent` it starts, by `agent` and the `name` that Agent had when this card was last written. The Agent function's instruction is never written here.";
506
+ readonly description: "One Agent function that serves this Room, which House alone writes from its owner's document in their Private Room and their Standing answer for it: the `agent_function` by identifier, its `description`, the `input` a caller sends, empty when it takes nothing, the `agent` it starts, by `agent` and the `name` that Agent had when this card was last written, and its `answer`, how a request from anyone but its owner starts: `at_once`, `ask_me`, which waits for its owner's approval, or `off`, which refuses it. The Agent function's instruction is never written here.";
473
507
  readonly properties: {
474
508
  readonly reflected: {
475
509
  readonly title: 'Reflected';
@@ -504,8 +538,13 @@ export declare const HOUSE_MODEL_DECLARATION: {
504
538
  };
505
539
  readonly required: readonly ['agent', 'name'];
506
540
  };
541
+ readonly answer: {
542
+ readonly title: 'Answer';
543
+ readonly type: 'string';
544
+ readonly enum: readonly ['at_once', 'ask_me', 'off'];
545
+ };
507
546
  };
508
- readonly required: readonly ['reflected', 'agent_function', 'description', 'input', 'agent'];
547
+ readonly required: readonly ['reflected', 'agent_function', 'description', 'input', 'agent', 'answer'];
509
548
  };
510
549
  readonly 'house-agent-function-document': {
511
550
  readonly description: 'One Agent function as its owner writes it in their Private Room at rooms/<room-handle>/agent-functions/<name>.md, a path that binds this type and a document that names no type: what it does as `description`, what a caller sends as `input`, empty when it takes nothing, the `agent` it starts, by identifier, and `afk`, true for a run nobody watches, off when absent. Its body is the instruction that Agent follows.';
@@ -532,7 +571,7 @@ export declare const HOUSE_MODEL_DECLARATION: {
532
571
  readonly required: readonly ['description', 'input', 'agent'];
533
572
  };
534
573
  readonly 'house-trigger': {
535
- readonly description: "One Trigger of this Room as its acts wrote it, which House alone writes: its `description`, the `condition` it fires on, its `actions` in order, whether each action and the Trigger are `enabled`, `paused_by` `types` while a change of the Room's types paused it, its `creator` by `user` and the `name` they had then, and when it was `created`. A `notify` action reaches the `users` its `to` names, the members its `fields` name in the matched document and the holders of its `roles`; an `agent_function` action sends its `payload` to the Agent function whose card under this Room's `house/agent-functions/` its `card` names, absent while this Room holds no card of that Agent function; a `message` action puts its `text` into the active conversation that Agent function started for what the Event is about, or starts that Agent function when none is active; a `done` action marks Done every active conversation an Agent function request of this Room started for the Event's document; a `function` action runs the `function` its `app`'s latest release declares, on House's servers, or, naming no `app`, the Room owner's Environment function of that name on its Environment, which only a Trigger of their Private Room holds. Whether an action's target holds is not written: it follows from the Room's members, the Agent function's card, the App's latest release and the owner's functions.";
574
+ readonly description: "One Trigger of this Room as its acts wrote it, which House alone writes: its `description`, the `condition` it fires on, its `actions` in order, whether each action and the Trigger are `enabled`, `paused_by` `types` while a change of the Room's types paused it, its `creator` by `user` and the `name` they had then, and when it was `created`. A `notify` action reaches the `users` its `to` names, the members its `fields` name in the matched document and the holders of its `roles`, or, `in_group`, posts once in this Room's Telegram group in their place, mentioning each; an `agent_function` action sends its `payload` to the Agent function whose card under this Room's `house/agent-functions/` its `card` names, absent while this Room holds no card of that Agent function; a `message` action puts its `text` into the active conversation that Agent function started for what the Event is about, or starts that Agent function when none is active; a `done` action marks Done every active conversation an Agent function request of this Room started for the Event's document; a `function` action runs the `function` its `app`'s latest release declares, on House's servers, or, naming no `app`, the Room owner's Environment function of that name on its Environment, which only a Trigger of their Private Room holds. Whether an action's target holds is not written: it follows from the Room's members, the Agent function's card, the App's latest release and the owner's functions.";
536
575
  readonly properties: {
537
576
  readonly reflected: {
538
577
  readonly title: 'Reflected';
@@ -614,6 +653,10 @@ export declare const HOUSE_MODEL_DECLARATION: {
614
653
  };
615
654
  readonly required: readonly ['users', 'fields', 'roles'];
616
655
  };
656
+ readonly in_group: {
657
+ readonly title: 'In group';
658
+ readonly const: true;
659
+ };
617
660
  };
618
661
  readonly required: readonly ['kind', 'enabled', 'title', 'text', 'to'];
619
662
  }, {
@@ -0,0 +1,8 @@
1
+ export declare const ROOM_REFERENCE_PREFIX = "r_";
2
+ export declare const APP_REFERENCE_PREFIX = "a_";
3
+ export declare const SPACE_REFERENCE_PREFIX = "sp_";
4
+ export declare const REVISION_REFERENCE_PREFIX = "fr_";
5
+ export declare const ROOM_REFERENCE_PATTERN: RegExp;
6
+ export declare const APP_REFERENCE_PATTERN: RegExp;
7
+ export declare const SPACE_REFERENCE_PATTERN: RegExp;
8
+ export declare const REVISION_REFERENCE_PATTERN: RegExp;
@@ -1,9 +1,13 @@
1
1
  export { candidateOf, datePointers, facts, memberPointers, members, pointed, prosePaths, TEXT_FIELD, valuedChange, WRITE_DOORS, } from './event.js';
2
2
  export type { Actor, DocumentEvent, DocumentFacts, Fact, ItemFacts, MessageFacts, Resolved, WriteDoor, } from './event.js';
3
- export { byCodePoint, compared, dated, fitsKind, instant, instantKey, kindOf, kindWords, } from './kinds.js';
3
+ export { byCodePoint, compared, dated, fitsKind, indexKey, instant, instantKey, kindOf, kindWords, } from './kinds.js';
4
4
  export type { Kind, Ordering } from './kinds.js';
5
5
  export { bodied, cursorOf, decodedCursor, identityOf, invalid, known, placeText, planOf, QueryError, queryKey, } from './query/language.js';
6
6
  export type { Clause, Continuation, Direction, DocumentQuery, DocumentShape, Filter, GroupKey, GroupOrder, GroupQuery, GroupSelect, GroupShape, HeldRooms, Key, KeyPlan, LocalQuery, OrderOptions, Place, Predicate, QueryErrorCode, QueryPlan, Related, RoomFacts, Scope, Select, Test, Value, Where, } from './query/language.js';
7
+ export { countOf, countShape, pageOrder, walkedValue, walkOf } from './query/walk.js';
8
+ export type { Count, KeyBound, KeyRange, PageOrder, Walk, WalkRun } from './query/walk.js';
9
+ export { verifyIndexBounds } from './indexed.js';
10
+ export type { IndexBounds } from './indexed.js';
7
11
  export { heldAt, matches } from './query/match.js';
8
12
  export type { Candidate } from './query/match.js';
9
13
  export { heldKind, indexed } from './query/rows.js';
@@ -11,21 +15,25 @@ export type { HeldKind, HeldLink, HeldValue, Indexed, Reach } from './query/rows
11
15
  export * as sql from './query/sql.js';
12
16
  export { headingLines } from './markdown.js';
13
17
  export type { HeadingLine } from './markdown.js';
18
+ export { acceptsType, dataUrl, dataUrlPattern, declaresUtf8, FILE_MEDIA_TYPES, fileExtension, formDataType, gitMediaType, isAudioType, isImageType, isVideoType, MEDIA_TYPES, mediaTypeEssence, SCRIPT_MEDIA_TYPES, servedMediaType, UTF8_TEXT, withCharset, } from './media-type.js';
19
+ export { shownDay, shownMoment } from './moment.js';
20
+ export type { MomentReader } from './moment.js';
14
21
  export { labelAt, NAME_FIELD } from './body.js';
15
22
  export type { Naming } from './body.js';
16
23
  export { divide } from './divide.js';
17
- export { apply, bodyLinks, create, links, parse, parseFrontmatter, relabel, relabels, relativize, relativizeBody, relinkBody, serialize, textSpans, unlinkBody, } from './document.js';
24
+ export { apply, bodyLinks, create, links, parse, relabel, relabels, relativize, relativizeBody, relinkBody, serialize, textSpans, unlinkBody, } from './document.js';
18
25
  export { documentFacts, referenceTarget, referenceTargets } from './facts.js';
26
+ export { notReadyWaitMs } from './not-ready.js';
19
27
  export type { ReferenceTarget, SavedFacts } from './facts.js';
20
- export { CROCKFORD_ALPHABET, CROCKFORD_CHARACTER, CROCKFORD_LEADING_CHARACTER, } from './crockford.js';
21
- export { HOUSE_FIELDS, MEMBER_FIELD, RECEIVED_FIELD, SITE_FIELD, TYPE_FIELD } from './fields.js';
28
+ export { CROCKFORD_ALPHABET, CROCKFORD_CHARACTER, CROCKFORD_LEADING_CHARACTER, } from './house-references/crockford.js';
29
+ export { HOUSE_FIELDS, MEMBER_FIELD, SITE_FIELD, SUBMITTED_FIELD, TYPE_FIELD } from './fields.js';
22
30
  export { HOUSE_MODEL, HOUSE_ROOM_TYPES } from './built-in.js';
23
31
  export { APP_PREFERENCES_HOME, HOUSE_MODEL_DECLARATION, HOUSE_TYPED_PATHS } from './house-model.js';
24
- export { APP_REFERENCE_PATTERN, ROOM_REFERENCE_PATTERN, SPACE_REFERENCE_PATTERN, } from './house-references.js';
32
+ export { APP_REFERENCE_PATTERN, APP_REFERENCE_PREFIX, ROOM_REFERENCE_PATTERN, REVISION_REFERENCE_PATTERN, REVISION_REFERENCE_PREFIX, ROOM_REFERENCE_PREFIX, SPACE_REFERENCE_PATTERN, SPACE_REFERENCE_PREFIX, } from './house-references/patterns.js';
25
33
  export type { HouseDocumentFields, HouseModelType } from './house-model.js';
26
34
  export { CHAT_MESSAGE_TYPE, CHAT_TYPE, INBOX_CHANNEL_KINDS, INBOX_TYPES } from './room-types.js';
27
35
  export type { InboxChannelKind } from './room-types.js';
28
- export { linkedPath, relative, retarget, roomPath, roomTarget, target } from './paths.js';
36
+ export { keyedDestination, keyedLink, linkedPath, relative, retarget, roomPath, roomTarget, target, } from './paths.js';
29
37
  export { openPatternBudget } from './pattern.js';
30
38
  export type { LinkedPath, RoomTarget } from './paths.js';
31
39
  export { project } from './project.js';
@@ -33,9 +41,9 @@ export { references } from './references.js';
33
41
  export { CAPTURE_HOME, isDocumentPath, isReservedName, RESERVED_NAMES, ROOM_DESCRIPTION, } from './reserved.js';
34
42
  export { ARRAY_INDEX, ATTACHMENT, crossedFacts, escapePointer, itemFacts, JSON_POINTER, memberFacts, pointerFacts, pointerSegments, untitled, } from './definition.js';
35
43
  export type { Definition, FieldRules, JsonType, PatternFacts, PointerFacts, RuleValue, Shape, Transition, ValueFacts, } from './definition.js';
36
- export type { ApplyResult, BodyResult, Change, DefinitionOf, Division, DivisionContext, Document, DocumentCheck, Extent, Frontmatter, FrontmatterResult, Library, ModelVerification, Link, ParseResult, Projection, ProjectionContext, Reached, Reference, Refusal, RoomReference, Span, TypedPath, UnlinkedBody, Validation, ValidationContext, ValidationStep, VerifiedModel, } from './types.js';
37
- export { assess, assessReferences, bodyRoomLinks, checkDocument, definitionAt, readTypes, resolves, roomReferences, validate, validateParsed, validating, verdicts, verify, } from './validate.js';
44
+ export type { ApplyResult, BodyResult, Change, DefinitionOf, Division, DivisionContext, Document, DocumentCheck, Extent, Library, ModelVerification, Link, ParseResult, Projection, ProjectionContext, Reached, Reference, Refusal, RoomReference, Span, TypedPath, UnlinkedBody, Validation, ValidationContext, ValidationStep, VerifiedModel, } from './types.js';
45
+ export { assess, assessReferences, bodyKeyedLinks, bodyRoomLinks, checkDocument, definitionAt, readTypes, resolves, roomReferences, validate, validateParsed, validating, verdicts, verify, } from './validate.js';
38
46
  export type { Assessment, Verdicts } from './validate.js';
39
47
  export { VERSION } from './version.js';
40
- export { bodyAfterFrontmatter, equalValue, frontmatterValue, plain } from './yaml.js';
41
- export type { FrontmatterValue } from './yaml.js';
48
+ export { bodyAfterFrontmatter, documentValue, equalValue, plain } from './yaml.js';
49
+ export type { DocumentValue } from './yaml.js';
@@ -0,0 +1,8 @@
1
+ import { type Failure } from './definition.js';
2
+ import type { ModelVerification, VerifiedModel } from './types.js';
3
+ export type IndexBounds = {
4
+ readonly perType: number;
5
+ readonly longestText: number;
6
+ };
7
+ export declare function indexedFailure(model: VerifiedModel): Failure | undefined;
8
+ export declare function verifyIndexBounds(model: VerifiedModel, bounds: IndexBounds): ModelVerification;
@@ -13,5 +13,8 @@ export declare function kindWords(facts: ValueFacts | undefined): readonly strin
13
13
  export declare function dated(value: unknown): value is string;
14
14
  export declare function instant(value: unknown): bigint | undefined;
15
15
  export declare function instantKey(value: unknown): string | null;
16
+ export declare function instantOf(facts: ValueFacts | undefined, value: unknown): string | null;
17
+ export declare function indexKey(facts: ValueFacts, value: unknown): Uint8Array;
18
+ export declare function sortedKey(value: unknown): Uint8Array | null;
16
19
  export declare function byCodePoint(left: string, right: string): number;
17
20
  export declare function compared(left: unknown, right: unknown, ordering: Ordering): number;
@@ -0,0 +1,71 @@
1
+ export declare const MEDIA_TYPES: {
2
+ readonly html: 'text/html';
3
+ readonly css: 'text/css';
4
+ readonly javascript: 'text/javascript';
5
+ readonly plainText: 'text/plain';
6
+ readonly markdown: 'text/markdown';
7
+ readonly csv: 'text/csv';
8
+ readonly json: 'application/json';
9
+ readonly xml: 'application/xml';
10
+ readonly yaml: 'application/yaml';
11
+ readonly ndjson: 'application/x-ndjson';
12
+ readonly webManifest: 'application/manifest+json';
13
+ readonly reports: 'application/reports+json';
14
+ readonly githubJson: 'application/vnd.github+json';
15
+ readonly form: 'application/x-www-form-urlencoded';
16
+ readonly octetStream: 'application/octet-stream';
17
+ readonly gzip: 'application/gzip';
18
+ readonly tar: 'application/x-tar';
19
+ readonly zip: 'application/zip';
20
+ readonly gitBundle: 'application/x-git-bundle';
21
+ readonly wasm: 'application/wasm';
22
+ readonly pdf: 'application/pdf';
23
+ readonly docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
24
+ readonly pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
25
+ readonly xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
26
+ readonly avif: 'image/avif';
27
+ readonly gif: 'image/gif';
28
+ readonly heic: 'image/heic';
29
+ readonly icon: 'image/vnd.microsoft.icon';
30
+ readonly jpeg: 'image/jpeg';
31
+ readonly png: 'image/png';
32
+ readonly svg: 'image/svg+xml';
33
+ readonly webp: 'image/webp';
34
+ readonly aac: 'audio/aac';
35
+ readonly amr: 'audio/amr';
36
+ readonly m4a: 'audio/mp4';
37
+ readonly mp3: 'audio/mpeg';
38
+ readonly ogg: 'audio/ogg';
39
+ readonly wav: 'audio/wav';
40
+ readonly threeGpp: 'video/3gpp';
41
+ readonly mp4: 'video/mp4';
42
+ readonly quickTime: 'video/quicktime';
43
+ readonly webm: 'video/webm';
44
+ readonly otf: 'font/otf';
45
+ readonly ttf: 'font/ttf';
46
+ readonly woff: 'font/woff';
47
+ readonly woff2: 'font/woff2';
48
+ };
49
+ export declare function withCharset(type: string, charset: string): string;
50
+ export declare const UTF8_TEXT: {
51
+ readonly html: string;
52
+ readonly css: string;
53
+ readonly javascript: string;
54
+ readonly plainText: string;
55
+ readonly markdown: string;
56
+ readonly xml: string;
57
+ };
58
+ export declare const SCRIPT_MEDIA_TYPES: readonly string[];
59
+ export declare const FILE_MEDIA_TYPES: Readonly<Record<string, string>>;
60
+ export declare function servedMediaType(path: string): string;
61
+ export declare function fileExtension(type: string): string | null;
62
+ export declare function dataUrl(type: string, base64: string): string;
63
+ export declare function dataUrlPattern(types: readonly string[]): RegExp;
64
+ export declare function formDataType(boundary: string): string;
65
+ export declare function gitMediaType(service: string, part: 'advertisement' | 'request' | 'result'): string;
66
+ export declare function mediaTypeEssence(value: string): string;
67
+ export declare function declaresUtf8(value: string): boolean;
68
+ export declare function acceptsType(accept: string | undefined, type: string): boolean;
69
+ export declare function isImageType(value: string): boolean;
70
+ export declare function isVideoType(value: string): boolean;
71
+ export declare function isAudioType(value: string): boolean;
@@ -0,0 +1,6 @@
1
+ export interface MomentReader {
2
+ readonly language: string;
3
+ readonly zone: string | null;
4
+ }
5
+ export declare function shownMoment(at: Date, reader: MomentReader): string;
6
+ export declare function shownDay(at: Date, reader: MomentReader): string;
@@ -0,0 +1 @@
1
+ export declare function notReadyWaitMs(asked: number): number;
@@ -26,6 +26,11 @@ export interface LinkedPath {
26
26
  readonly fragment: string | null;
27
27
  }
28
28
  export declare function linkedPath(from: string, href: string): LinkedPath | null;
29
+ export interface KeyedLink extends RoomTarget {
30
+ readonly key: string;
31
+ }
32
+ export declare function keyedLink(href: string): KeyedLink | null;
33
+ export declare function keyedDestination(path: string, key: string): string;
29
34
  export declare function retarget(href: string, to: string): string;
30
35
  export declare function relative(from: string, target: string): string;
31
36
  export declare const SHELL_ROOMS = "/rooms/";
@@ -1,4 +1,4 @@
1
- import { type Definition } from '../definition.js';
1
+ import { type Definition, type ValueFacts } from '../definition.js';
2
2
  export type Value = string | number | boolean | null;
3
3
  export type Predicate = Value | {
4
4
  $eq: Value;
@@ -245,6 +245,7 @@ export declare function bodied(shape: DocumentShape): boolean;
245
245
  export declare function invalid(at: At, problem: string, accepts?: readonly string[]): never;
246
246
  export declare function placeText(at: Place): string;
247
247
  export declare function known(value: Entries, allowed: readonly string[], at: At): void;
248
+ export declare function textless(facts: ValueFacts): boolean;
248
249
  export declare function planOf(input: unknown, facts: HeldRooms): QueryPlan;
249
250
  export declare function cursorOf(values: readonly unknown[]): string;
250
251
  export declare function decodedCursor(text: string): readonly unknown[] | null;
@@ -6,7 +6,7 @@ export type Candidate = {
6
6
  readonly type: string | null;
7
7
  readonly fileId: string | null;
8
8
  readonly fields: Readonly<Record<string, unknown>>;
9
- readonly definition?: Pick<Definition, 'frontmatter'>;
9
+ readonly definition?: Pick<Definition, 'root'>;
10
10
  readonly text: string | null;
11
11
  };
12
12
  export declare function heldAt(candidate: Candidate, field: string): readonly HeldValue[];
@@ -28,4 +28,4 @@ export type Placed = {
28
28
  };
29
29
  export declare function placedOf(pointer: string, reach: Reach): Placed;
30
30
  export declare function heldKind(value: unknown): HeldKind;
31
- export declare function indexed(path: string, fields: Readonly<Record<string, unknown>>, definition: Pick<Definition, 'frontmatter'> | undefined): Indexed;
31
+ export declare function indexed(path: string, fields: Readonly<Record<string, unknown>>, definition: Pick<Definition, 'root'> | undefined): Indexed;