@agentshouse/app-bridge 0.1.0-ca1c87443dc9f → 0.1.0-ca1d8de05973d

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
@@ -349,6 +349,23 @@ export interface HouseMethods {
349
349
  readonly matched: boolean;
350
350
  };
351
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
+ };
352
369
  readonly "sites/submissions/create": {
353
370
  readonly params: {
354
371
  readonly content: string;
@@ -508,13 +525,13 @@ export interface HouseMethods {
508
525
  readonly value: string;
509
526
  } | {
510
527
  readonly code: "limit_reached";
511
- readonly limit: "custom_domains" | "external_calls" | "publish_data" | "sites";
528
+ readonly limit: "custom_domains" | "external_calls" | "publish_data" | "site_function_calls" | "sites";
512
529
  readonly outcome: "refused";
513
530
  readonly position: number;
514
531
  readonly retry_at: string;
515
532
  } | {
516
533
  readonly code: "limit_reached";
517
- readonly limit: "custom_domains" | "external_calls" | "publish_data" | "sites";
534
+ readonly limit: "custom_domains" | "external_calls" | "publish_data" | "site_function_calls" | "sites";
518
535
  readonly outcome: "refused";
519
536
  readonly position: number;
520
537
  } | {
@@ -4,6 +4,7 @@ import type { ModelResult } from './model.js';
4
4
  export type { SavedFacts, TypedPath };
5
5
  import type { Open } from './open.js';
6
6
  import type { ChangeBatch } from './change.js';
7
+ import type { QueryDocument } from './query.js';
7
8
  export type Authorization = object;
8
9
  export type MdModelIdentity = {
9
10
  identity: string;
@@ -516,6 +517,17 @@ export type SearchAnswer = {
516
517
  } | (ProviderRefusal & {
517
518
  kind: 'rejected';
518
519
  }) | AdapterFailure;
520
+ export type HouseQueryAsk = {
521
+ room: string;
522
+ query: Readonly<Record<string, unknown>>;
523
+ };
524
+ export type HouseQueryAnswer = {
525
+ kind: 'rows';
526
+ documents: readonly QueryDocument[];
527
+ next?: string;
528
+ } | (ProviderRefusal & {
529
+ kind: 'rejected';
530
+ }) | AdapterFailure;
519
531
  export type HeldRoom = {
520
532
  locator: string;
521
533
  roomVersion: string | null;
@@ -576,6 +588,7 @@ export type Adapter = {
576
588
  attach(authorization: Authorization, request: AttachRequest): Promise<AttachResult>;
577
589
  action(authorization: Authorization, request: ActionRequest): Promise<ActionResult>;
578
590
  search?(authorization: Authorization, request: SearchAsk): Promise<SearchAnswer>;
591
+ queryHouse?(authorization: Authorization, request: HouseQueryAsk): Promise<HouseQueryAnswer>;
579
592
  reached(locator: string, roomVersion: string, target: string): boolean;
580
593
  follows(locator: string, roomVersion: string, next: string): boolean;
581
594
  roomStream?: RoomStream;
@@ -14,6 +14,7 @@ import type { Holdings } from './holdings.js';
14
14
  import type { DocumentResult, GroupResult, PendingResult } from './query.js';
15
15
  import type { RoomDraft, RoomDraftParts, RoomDraftWrite } from './room-draft.js';
16
16
  import type { SearchRequest, SearchResult } from './search.js';
17
+ import type { HouseQuery, HouseQueryResult } from './house-query.js';
17
18
  import type { Readiness } from './readiness.js';
18
19
  import type { ObservedRead } from './reads.js';
19
20
  import type { SyncStatus } from './status.js';
@@ -27,6 +28,7 @@ export type MdRuntimeClient = {
27
28
  (query: GroupQuery): Promise<GroupResult | PendingResult>;
28
29
  };
29
30
  search(request: SearchRequest): Promise<SearchResult>;
31
+ queryHouse(query: HouseQuery): Promise<HouseQueryResult>;
30
32
  types(locator: string): Promise<RoomSchemas>;
31
33
  roomDraft: {
32
34
  list(): Promise<readonly RoomDraft[]>;
@@ -0,0 +1,20 @@
1
+ import { type DocumentQuery } from '../mdmodel/index.js';
2
+ import type { ProviderRefusal } from './adapter.js';
3
+ import { type Failure, type Offline } from './outcome.js';
4
+ import type { QueryDocument } from './query.js';
5
+ import { type PortReach } from './reach.js';
6
+ import type { Runtime } from './runtime.js';
7
+ export type HouseQuery = DocumentQuery & {
8
+ rooms: readonly [string];
9
+ };
10
+ export type HouseQueryRows = {
11
+ kind: 'rows';
12
+ documents: readonly QueryDocument[];
13
+ next?: string;
14
+ };
15
+ export type HouseQueryResult = HouseQueryRows | Offline | (ProviderRefusal & {
16
+ kind: 'rejected';
17
+ }) | (ProviderRefusal & {
18
+ kind: 'undeclared';
19
+ }) | Failure;
20
+ export declare function queriedHouse(runtime: Runtime, input: unknown, reach: PortReach | null): Promise<HouseQueryResult>;
@@ -26,6 +26,7 @@ type Shown<Model> = {
26
26
  synchronizationAvailable: boolean;
27
27
  refusal: ProviderRefusal | null;
28
28
  locked: boolean;
29
+ queriesOnly?: true;
29
30
  };
30
31
  export type AppTypedSelection = Selection<TypesResult>;
31
32
  export type AppRoom = Shown<TypesResult>;
@@ -3,6 +3,7 @@ import type { ReadinessMessage, ReadinessPort } from './preparation.js';
3
3
  import type { MdRuntime, RuntimeTopic } from './surface.js';
4
4
  import type { Plan, PlanReach, QueryResult } from './query.js';
5
5
  import type { SearchResult } from './search.js';
6
+ import type { HouseQueryResult } from './house-query.js';
6
7
  export type ReachedDocument = {
7
8
  readonly room: string;
8
9
  readonly path: string;
@@ -12,10 +13,16 @@ export type ReachedArea = {
12
13
  readonly path: string;
13
14
  readonly open: readonly string[];
14
15
  };
16
+ export type QueriedRoom = {
17
+ readonly locator: string;
18
+ readonly handle: string;
19
+ readonly name: string;
20
+ };
15
21
  export type PortReach = {
16
22
  readonly rooms: readonly string[];
17
23
  readonly documents: readonly ReachedDocument[];
18
24
  readonly areas?: readonly ReachedArea[];
25
+ readonly queriesOnly?: readonly QueriedRoom[];
19
26
  readonly conversations: boolean;
20
27
  };
21
28
  export type Deliver = (message: unknown) => void;
@@ -33,6 +40,7 @@ export type Reachable = RuntimeView & {
33
40
  query(plan: Plan): Promise<QueryResult>;
34
41
  watchPlan(plan: Plan, deliver: Deliver, fail: Fail): () => void;
35
42
  search(input: unknown, reach: PortReach | null): Promise<SearchResult>;
43
+ queryHouse(input: unknown, reach: PortReach | null): Promise<HouseQueryResult>;
36
44
  watchReadiness(port: ReadinessPort, reach: PortReach | null, deliver: (readiness: ReadinessMessage) => void): () => void;
37
45
  locked(room: string): Promise<boolean>;
38
46
  lockedRooms(): Promise<readonly string[]>;
@@ -40,6 +48,8 @@ export type Reachable = RuntimeView & {
40
48
  located(room: string, path: string, destination: string): Promise<ReachedDocument | null>;
41
49
  room(locator: string): Promise<ListedRoom | undefined>;
42
50
  };
51
+ export declare function queriedOf(reach: PortReach | null): readonly QueriedRoom[];
52
+ export declare function queriedOnly(reach: PortReach | null, room: string): boolean;
43
53
  export declare function holds(reach: PortReach | null, room: string): boolean;
44
54
  export declare function governs(reach: PortReach | null, room: {
45
55
  readonly locator: string;
@@ -31,6 +31,7 @@ export type RuntimeSocket = Admission & Answers & {
31
31
  readonly firstDiscovery: Promise<void>;
32
32
  conversations(): Adapter['conversations'];
33
33
  search(): Adapter['search'];
34
+ queryHouse(): Adapter['queryHouse'];
34
35
  discover(authorized: Authorization): ReturnType<NonNullable<Adapter['discover']>> | undefined;
35
36
  follows: Adapter['follows'];
36
37
  mutate: Adapter['mutate'];
@@ -20,6 +20,7 @@ import { type PresentationSurface, type RoomDraftSurface } from './room-drafts.j
20
20
  import type { Runtime } from './runtime.js';
21
21
  import { type BinaryFileSurface, type SavedParts, type SavedRoomDraft, type SaveResult } from './saves.js';
22
22
  import type { SearchRequest, SearchResult } from './search.js';
23
+ import { type HouseQuery, type HouseQueryResult } from './house-query.js';
23
24
  import { type EntrySeed } from './seed.js';
24
25
  import type { ConnectionRefusal } from './socket.js';
25
26
  import type { SyncStatus } from './status.js';
@@ -35,6 +36,7 @@ export type MdRuntime = {
35
36
  (query: GroupQuery): Promise<GroupResult | PendingResult>;
36
37
  };
37
38
  search(request: SearchRequest): Promise<SearchResult>;
39
+ queryHouse(query: HouseQuery): Promise<HouseQueryResult>;
38
40
  types(locator: string): Promise<RoomSchemas>;
39
41
  roomDraft: RoomDraftSurface;
40
42
  conversation: ConversationSurface;
@@ -26,6 +26,10 @@ declare const MEMBERS: {
26
26
  readonly reach: 'within';
27
27
  readonly effect: 'read';
28
28
  };
29
+ readonly queryHouse: {
30
+ readonly reach: 'within';
31
+ readonly effect: 'read';
32
+ };
29
33
  readonly types: {
30
34
  readonly reach: 'within';
31
35
  readonly effect: 'read';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentshouse/app-bridge",
3
- "version": "0.1.0-ca1c87443dc9f",
3
+ "version": "0.1.0-ca1d8de05973d",
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",