@agentshouse/app-bridge 0.1.0-c5b5f2cb99970 → 0.1.0-c60b4afa448e1

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.
package/dist/index.d.ts CHANGED
@@ -659,6 +659,10 @@ export interface HouseTelegram {
659
659
  readonly name: string | null;
660
660
  readonly username: string | null;
661
661
  }
662
+ export interface HouseCeremonyEnded {
663
+ readonly said: string | null;
664
+ readonly done: boolean;
665
+ }
662
666
  export interface HouseCeremonyRefused extends Error {
663
667
  readonly name: 'HouseCeremonyRefused';
664
668
  readonly code: Open<'house_ceremony_refused'>;
@@ -718,7 +722,7 @@ export interface HouseBridge {
718
722
  onAddress(listener: (address: string) => void): () => void;
719
723
  push(address: string): Promise<string>;
720
724
  replace(address: string): Promise<string>;
721
- ceremony(path: string): Promise<never>;
725
+ ceremony(path: string): Promise<HouseCeremonyEnded>;
722
726
  install(): Promise<HouseInstallation>;
723
727
  notifications(on?: boolean): Promise<HouseNotifications>;
724
728
  telegram(link?: true): Promise<HouseTelegram>;
@@ -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';
@@ -465,6 +465,36 @@ export declare const HOUSE_MODEL_DECLARATION: {
465
465
  readonly type: 'integer';
466
466
  readonly minimum: 1;
467
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
+ };
468
498
  };
469
499
  readonly required: readonly ['notification', 'kind', 'created', 'way_in', 'subject'];
470
500
  };
@@ -473,7 +503,7 @@ export declare const HOUSE_MODEL_DECLARATION: {
473
503
  readonly properties: {};
474
504
  };
475
505
  readonly 'house-agent-function': {
476
- 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.";
477
507
  readonly properties: {
478
508
  readonly reflected: {
479
509
  readonly title: 'Reflected';
@@ -508,8 +538,13 @@ export declare const HOUSE_MODEL_DECLARATION: {
508
538
  };
509
539
  readonly required: readonly ['agent', 'name'];
510
540
  };
541
+ readonly answer: {
542
+ readonly title: 'Answer';
543
+ readonly type: 'string';
544
+ readonly enum: readonly ['at_once', 'ask_me', 'off'];
545
+ };
511
546
  };
512
- readonly required: readonly ['reflected', 'agent_function', 'description', 'input', 'agent'];
547
+ readonly required: readonly ['reflected', 'agent_function', 'description', 'input', 'agent', 'answer'];
513
548
  };
514
549
  readonly 'house-agent-function-document': {
515
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.';
@@ -183,6 +183,35 @@ export type AgentEnvironment = {
183
183
  name: string;
184
184
  state: 'online' | 'offline';
185
185
  };
186
+ export type ListedOwner = {
187
+ readonly user: string;
188
+ readonly name: string;
189
+ };
190
+ export type ListedSpaceRef = {
191
+ readonly space_ref: string;
192
+ readonly name: string;
193
+ };
194
+ export type RoomListEntry = {
195
+ readonly room_ref: string;
196
+ readonly room_handle: string;
197
+ readonly name: string;
198
+ readonly level: 'search' | 'open' | 'keep';
199
+ readonly access: 'owner' | 'manage' | 'write' | 'read' | 'public';
200
+ readonly owner: ListedOwner;
201
+ readonly created: string;
202
+ readonly archived?: string;
203
+ readonly exportable?: true;
204
+ readonly space?: ListedSpaceRef;
205
+ };
206
+ export type SpaceListEntry = ListedSpaceRef & {
207
+ readonly owner: ListedOwner;
208
+ readonly created: string;
209
+ readonly manages?: true;
210
+ };
211
+ export type RoomList = {
212
+ readonly rooms: readonly RoomListEntry[];
213
+ readonly spaces: readonly SpaceListEntry[];
214
+ };
186
215
  export type ListedAgent = {
187
216
  id: string;
188
217
  name: string;
@@ -233,6 +262,7 @@ export type Discovery = {
233
262
  providerLimits: readonly ProviderLimit[];
234
263
  retention: Retention;
235
264
  member?: Member;
265
+ roomList?: RoomList;
236
266
  };
237
267
  export type TransportUncertainty = {
238
268
  kind: 'transport-uncertainty';
@@ -494,6 +524,9 @@ export type AuthorityChange = {
494
524
  rooms: readonly DiscoveredRoom[];
495
525
  left: readonly string[];
496
526
  member?: Member;
527
+ roomList?: RoomList & {
528
+ readonly left: readonly string[];
529
+ };
497
530
  };
498
531
  export type RoomStreamEvent = {
499
532
  kind: 'opened';
@@ -508,6 +541,8 @@ export type RoomStreamEvent = {
508
541
  } | {
509
542
  kind: 'caught-up';
510
543
  expired: readonly string[];
544
+ } | {
545
+ kind: 'reported';
511
546
  } | AuthorityChange | RoomChange;
512
547
  export type RoomStream = {
513
548
  hold(rooms: readonly HeldRoom[]): void;
@@ -4,7 +4,7 @@ import type { AppRoom } from './listing.js';
4
4
  import type { ConnectionRefusal } from './socket.js';
5
5
  import type { RoomSchemas } from './surface.js';
6
6
  import type { SavedParts, SavedRoomDraft, SaveResult } from './saves.js';
7
- import type { ListedAgent, Member, ServiceMode } from './adapter.js';
7
+ import type { ListedAgent, Member, RoomList, ServiceMode } from './adapter.js';
8
8
  import type { UnsentWork } from './durability.js';
9
9
  import type { ChatDraftSurface, ConversationAgent, ConversationEntry, ConversationOptions, ConversationSurface, ConversationView } from './conversation.js';
10
10
  import { type Observation } from './observation.js';
@@ -80,6 +80,7 @@ export type MdRuntimeClient = {
80
80
  (topic: 'conversations'): Promise<Observation<readonly ConversationEntry[]>>;
81
81
  (topic: 'agents'): Promise<Observation<readonly ConversationAgent[]>>;
82
82
  (topic: 'listed-agents'): Promise<Observation<readonly ListedAgent[]>>;
83
+ (topic: 'room-list'): Promise<Observation<RoomList | null>>;
83
84
  (topic: 'figures'): Promise<Observation<FiguresResult>>;
84
85
  (topic: 'holdings'): Promise<Observation<Holdings>>;
85
86
  (topic: 'read', name: string, input: unknown): Promise<Observation<ObservedRead>>;
@@ -1,5 +1,5 @@
1
1
  import type { HeldRow } from './messages.js';
2
- import { type HouseSource } from './source.js';
2
+ import { type HouseSource, type RequestAnswer } from './source.js';
3
3
  export type ConversationLast = {
4
4
  readonly text: string;
5
5
  readonly by: 'owner' | 'agent' | 'house';
@@ -10,12 +10,17 @@ export type ConversationStart = Extract<HouseSource, {
10
10
  }>;
11
11
  export type ConversationAsk = {
12
12
  readonly who: string;
13
+ readonly fromRoom: boolean;
13
14
  readonly agent: string | null;
14
15
  readonly room: {
15
16
  readonly ref: string;
17
+ readonly handle: string;
16
18
  readonly name: string;
17
19
  };
18
20
  readonly prompt: string;
21
+ readonly agentFunction: string | null;
22
+ readonly answer: RequestAnswer | null;
23
+ readonly instruction: string | null;
19
24
  readonly at: string;
20
25
  readonly request: string;
21
26
  readonly message?: string;
@@ -15,7 +15,7 @@ export type ObservedRead = {
15
15
  };
16
16
  export type ReadAnswers = {
17
17
  watch(name: string, input: unknown, deliver: (read: ObservedRead) => void): () => void;
18
- again(): void;
18
+ again(led?: Promise<unknown>): void;
19
19
  reopened(): void;
20
20
  };
21
21
  export type ReadAnswersOptions = {
@@ -1,3 +1,4 @@
1
+ export type RequestAnswer = 'at_once' | 'ask_me' | 'off';
1
2
  export type HouseSource = {
2
3
  readonly kind: 'request';
3
4
  readonly request: string;
@@ -8,8 +9,12 @@ export type HouseSource = {
8
9
  };
9
10
  readonly room: {
10
11
  readonly ref: string;
12
+ readonly handle: string;
11
13
  readonly name: string;
12
14
  };
15
+ readonly sent: string;
16
+ readonly instruction: string | null;
17
+ readonly answer: RequestAnswer | null;
13
18
  readonly approved: string | null;
14
19
  } | {
15
20
  readonly kind: 'mail';
@@ -1,4 +1,4 @@
1
- import type { BootstrapInventory, Capability, ListedAgent, ListedConversation, Member, ProviderLimit } from '../adapter.js';
1
+ import type { BootstrapInventory, Capability, ListedAgent, ListedConversation, Member, ProviderLimit, RoomList } from '../adapter.js';
2
2
  import type { ChangeBatch } from '../change.js';
3
3
  import { type Composition } from '../collection.js';
4
4
  import type { Plan } from '../query.js';
@@ -128,6 +128,7 @@ export type Facts = {
128
128
  readonly agentList: readonly ListedAgent[] | null;
129
129
  readonly conversationCursor: string | null;
130
130
  readonly chatPins: readonly string[];
131
+ readonly roomList: RoomList | null;
131
132
  };
132
133
  export type Commit = {
133
134
  readonly rooms: readonly RoomCommit[];
@@ -1,6 +1,6 @@
1
1
  import type { DocumentQuery, GroupQuery } from '../mdmodel/index.js';
2
2
  import { type HistoryQuery } from './actions.js';
3
- import type { ListedAgent, Member, ServiceMode } from './adapter.js';
3
+ import type { ListedAgent, Member, RoomList, ServiceMode } from './adapter.js';
4
4
  import type { WrittenBy } from './change.js';
5
5
  import { type ChatDraftSurface, type ConversationEntry, type ConversationAgent, type ConversationOptions, type ConversationSurface, type ConversationView } from './conversation.js';
6
6
  import type { UnsentWork } from './durability.js';
@@ -72,13 +72,14 @@ export type MdRuntime = {
72
72
  (topic: 'conversations'): Promise<Observation<readonly ConversationEntry[]>>;
73
73
  (topic: 'agents'): Promise<Observation<readonly ConversationAgent[]>>;
74
74
  (topic: 'listed-agents'): Promise<Observation<readonly ListedAgent[]>>;
75
+ (topic: 'room-list'): Promise<Observation<RoomList | null>>;
75
76
  (topic: 'figures'): Promise<Observation<FiguresResult>>;
76
77
  (topic: 'holdings'): Promise<Observation<Holdings>>;
77
78
  (topic: 'read', name: string, input: unknown): Promise<Observation<ObservedRead>>;
78
79
  };
79
80
  reauthorize(): Promise<void>;
80
81
  };
81
- export type RuntimeTopic = 'rooms' | 'readiness' | 'connection-refusal' | 'storage-loss' | 'sync-status' | 'service-mode' | 'member' | 'authority-changes' | 'query' | 'queue' | 'room-drafts' | 'presentation' | 'conversation' | 'conversations' | 'agents' | 'listed-agents' | 'figures' | 'holdings' | 'read';
82
+ export type RuntimeTopic = 'rooms' | 'readiness' | 'connection-refusal' | 'storage-loss' | 'sync-status' | 'service-mode' | 'member' | 'authority-changes' | 'query' | 'queue' | 'room-drafts' | 'presentation' | 'conversation' | 'conversations' | 'agents' | 'listed-agents' | 'room-list' | 'figures' | 'holdings' | 'read';
82
83
  export type ComposedRuntime = RuntimeView & {
83
84
  seed(entry: EntrySeed): void;
84
85
  stop(): Promise<void>;
@@ -233,6 +233,7 @@ declare const TOPICS: {
233
233
  readonly conversations: 'within';
234
234
  readonly agents: 'within';
235
235
  readonly 'listed-agents': 'whole';
236
+ readonly 'room-list': 'whole';
236
237
  readonly figures: 'whole';
237
238
  readonly holdings: 'whole';
238
239
  readonly read: 'whole';
package/docs/families.md CHANGED
@@ -14,7 +14,13 @@
14
14
  returns there when it completes. An App names an address House gave it in a
15
15
  reading and composes one only for `/bind/<app_ref>`, where the User binds
16
16
  its Rooms, with `?slot=<name>` to open at one slot, and `/sign-out`, which
17
- signs the User out and opens sign-in.
17
+ signs the User out and opens sign-in. A decision House asks over the App, a
18
+ prepared act's approval at `/approve/<ref>` and a secret or a CLI's sign-in
19
+ at `/secret-input/<id>`, stays in the App: the shell draws House's page as
20
+ its own dialog over the App, which the App cannot reach, and `ceremony()`
21
+ resolves once it closes, with `said`, what the page said it ended with, or
22
+ `null` when it closed with nothing said, and `done`, whether the decision was
23
+ carried out.
18
24
  - **Installation** - `install()` offers the page as a Home-screen app. Where the
19
25
  browser has an install prompt ready the shell shows it and the call resolves
20
26
  `'accepted'` or `'dismissed'` with the User's choice, spending that prompt;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentshouse/app-bridge",
3
- "version": "0.1.0-c5b5f2cb99970",
3
+ "version": "0.1.0-c60b4afa448e1",
4
4
  "description": "Types of the agents.house App bridge House hands every App: navigation, the tab title and icon, ceremonies, installation, notifications, status, App release code, App and Site screenshot reads, App messages and the Chat, with an accessor and an in-page test host.",
5
5
  "license": "MIT",
6
6
  "type": "module",