@agentshouse/app-bridge 0.1.0-cd2d3edbf9805 → 0.1.0-cd3bc6240e9ba

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.
@@ -80,7 +80,11 @@ export type NotificationCondition = {
80
80
  readonly on: 'notifications';
81
81
  readonly match?: ConditionTest;
82
82
  };
83
- export type Condition = DocumentCondition | ItemCondition | CronCondition | DateCondition | NotificationCondition;
83
+ export type MessageCondition = {
84
+ readonly on: 'messages';
85
+ readonly match?: ConditionTest;
86
+ };
87
+ export type Condition = DocumentCondition | ItemCondition | CronCondition | DateCondition | NotificationCondition | MessageCondition;
84
88
  export type FactKind = 'string' | 'number' | 'boolean' | 'date' | 'time' | 'enum' | 'reference';
85
89
  type Scalar = string | number | boolean;
86
90
  export type Fact = {
@@ -134,6 +138,11 @@ export type ItemFacts = {
134
138
  readonly value: unknown;
135
139
  } | null;
136
140
  };
141
+ export type MessageFacts = {
142
+ readonly sender: string;
143
+ readonly routine: string | null;
144
+ readonly path: string | null;
145
+ };
137
146
  export type Resolved = {
138
147
  readonly id: string;
139
148
  readonly member?: string;
@@ -152,9 +161,11 @@ export declare function memberPointers(definition: Definition, memberType: strin
152
161
  export declare const DOCUMENT_PATHS: readonly string[];
153
162
  export declare const ACTOR_PATHS: readonly string[];
154
163
  export declare const ITEM_PATHS: readonly string[];
164
+ export declare const MESSAGE_PATHS: readonly string[];
155
165
  export declare function testOperators(definitions: readonly Definition[], path: string, memberType: string | null): readonly ConditionOperator[];
156
166
  export declare function actorOperators(path: string): readonly ConditionOperator[];
157
167
  export declare function itemOperators(path: string): readonly ConditionOperator[];
168
+ export declare function messageOperators(path: string): readonly ConditionOperator[];
158
169
  export declare function itemKind(path: string): FactKind | null;
159
170
  export declare function dated(value: unknown): value is string;
160
171
  export declare function instant(value: unknown): bigint | undefined;
@@ -164,4 +175,5 @@ export declare function holds(test: ConditionTest, document: DocumentFacts): Tru
164
175
  export declare function fires(condition: DocumentCondition, event: DocumentEvent): boolean;
165
176
  export declare function itemFires(condition: ItemCondition, item: ItemFacts): boolean;
166
177
  export declare function notificationFires(condition: NotificationCondition, notification: DocumentFacts): boolean;
178
+ export declare function messageFires(condition: MessageCondition, message: MessageFacts): boolean;
167
179
  export {};
@@ -1,5 +1,5 @@
1
- export { ACTOR_PATHS, actorOperators, changeFields, CONDITION_OPERATORS, dated, datePointers, DOCUMENT_PATHS, factKind, facts, fires, holds, instant, ITEM_PATHS, itemFires, itemKind, itemOperators, memberPointers, members, notificationFires, pointed, prosePaths, testOperators, TEXT_FIELD, valuedChange, WRITE_DOORS, } from './condition.js';
2
- export type { Actor, Condition, ConditionOperator, ConditionScope, ConditionTest, ConditionValue, CronCondition, DateCondition, DocumentCondition, DocumentEvent, DocumentFacts, Fact, FactKind, ItemCondition, ItemFacts, NotificationCondition, Resolved, WriteDoor, } from './condition.js';
1
+ export { ACTOR_PATHS, actorOperators, changeFields, CONDITION_OPERATORS, dated, datePointers, DOCUMENT_PATHS, factKind, facts, fires, holds, instant, ITEM_PATHS, itemFires, itemKind, itemOperators, memberPointers, members, MESSAGE_PATHS, messageFires, messageOperators, notificationFires, pointed, prosePaths, testOperators, TEXT_FIELD, valuedChange, WRITE_DOORS, } from './condition.js';
2
+ export type { Actor, Condition, ConditionOperator, ConditionScope, ConditionTest, ConditionValue, CronCondition, DateCondition, DocumentCondition, DocumentEvent, DocumentFacts, Fact, FactKind, ItemCondition, ItemFacts, MessageCondition, MessageFacts, NotificationCondition, Resolved, WriteDoor, } from './condition.js';
3
3
  export { headingLines } from './blocks.js';
4
4
  export type { HeadingLine } from './blocks.js';
5
5
  export { divide } from './divide.js';
@@ -45,7 +45,7 @@ export type ListedConversation = {
45
45
  waiting: boolean;
46
46
  newest: string | null;
47
47
  };
48
- export type ConversationAction = 'conversation.create' | 'conversation.send' | 'conversation.answer' | 'conversation.interrupt' | 'conversation.kill' | 'conversation.cancel' | 'conversation.delete' | 'conversation.history';
48
+ export type ConversationAction = 'conversations/create' | 'conversations/send' | 'conversations/interaction/answer' | 'conversations/interrupt' | 'conversations/kill' | 'conversations/delete';
49
49
  export type ConversationMessage = {
50
50
  identity: string;
51
51
  turn: string;
@@ -136,6 +136,10 @@ export type SessionOption = (SessionOptionNaming & {
136
136
  type: 'boolean';
137
137
  currentValue: boolean;
138
138
  });
139
+ export type RunningSubagent = {
140
+ description: string;
141
+ activity: string | null;
142
+ };
139
143
  export type ConversationEvent = {
140
144
  kind: 'turn';
141
145
  conversation: string;
@@ -161,6 +165,10 @@ export type ConversationEvent = {
161
165
  kind: 'starting';
162
166
  conversation: string;
163
167
  step: string | null;
168
+ } | {
169
+ kind: 'subagents';
170
+ conversation: string;
171
+ subagents: readonly RunningSubagent[];
164
172
  } | {
165
173
  kind: 'link';
166
174
  conversation: string;
@@ -179,6 +187,9 @@ export type ConversationEvent = {
179
187
  } | {
180
188
  kind: 'list';
181
189
  entries: readonly ListedConversation[];
190
+ whole: boolean;
191
+ more: boolean;
192
+ cursor: string | null;
182
193
  } | {
183
194
  kind: 'listed';
184
195
  entry: ListedConversation;
@@ -193,8 +204,10 @@ export type ListedAgent = {
193
204
  };
194
205
  export type ConversationStream = {
195
206
  replicate(conversations: readonly string[]): void;
207
+ hold(cursor: string | null): void;
196
208
  observe(notify: (event: ConversationEvent) => void): () => void;
197
209
  agents?(): Promise<readonly ListedAgent[] | null>;
210
+ history?(request: ConversationHistoryRequest): Promise<ActionResult>;
198
211
  };
199
212
  export type ActionDeclaration = {
200
213
  name: string;
@@ -1,6 +1,6 @@
1
1
  import type { AppRoom, ConnectionRefusal, HistoryQuery, RoomSchemas, SavedParts, SavedRoomDraft, SaveResult } from './connection.js';
2
2
  import type { Member, ServiceMode } from './adapter.js';
3
- import type { ChatDraft, ConversationAgent, ConversationEntry, ConversationOptions, ConversationView } from './conversation.js';
3
+ import type { ChatDraft, ConversationAgent, ConversationAnswer, ConversationEntry, ConversationOptions, ConversationView } from './conversation.js';
4
4
  import { type Observation } from './observation.js';
5
5
  import type { AttachAnswer, BinaryAnswer, CallResult, DownloadAnswer, HistoryAnswer, Offline, QueueEntry, Resolution } from './outcome.js';
6
6
  import type { DocumentQuery, DocumentResult, GroupQuery, GroupResult, PendingResult } from './query.js';
@@ -35,10 +35,9 @@ export type MdRuntimeClient = {
35
35
  read(conversation: string, options?: ConversationOptions): Promise<ConversationView>;
36
36
  create(input: unknown): Promise<CallResult>;
37
37
  send(conversation: string, operation?: string, draft?: ChatDraft): Promise<CallResult | Offline>;
38
- answer(conversation: string, answer: unknown): Promise<CallResult>;
38
+ answer(conversation: string, answer: ConversationAnswer): Promise<CallResult>;
39
39
  interrupt(conversation: string): Promise<CallResult>;
40
40
  kill(conversation: string): Promise<CallResult>;
41
- cancel(conversation: string, turn: string): Promise<CallResult>;
42
41
  delete(conversation: string): Promise<CallResult>;
43
42
  };
44
43
  chatDraft: {
@@ -1,4 +1,4 @@
1
- import type { ConversationAction, ConversationEvent, ConversationMessage, ConversationStream, ListedConversation, ProcessCommand, SessionOption, TurnContext } from './adapter.js';
1
+ import type { ConversationAction, ConversationEvent, ConversationHistoryRequest, ConversationMessage, ConversationStream, ListedConversation, ProcessCommand, RunningSubagent, SessionOption, TurnContext } from './adapter.js';
2
2
  import { type ChangeSet } from './change-set.js';
3
3
  import type { Open } from './open.js';
4
4
  import { type CallResult, type Offline } from './outcome.js';
@@ -50,6 +50,7 @@ export type ConversationView = {
50
50
  commands: readonly ProcessCommand[];
51
51
  options: readonly SessionOption[];
52
52
  starting: string | null;
53
+ subagents: readonly RunningSubagent[];
53
54
  link: {
54
55
  connected: boolean;
55
56
  } | null;
@@ -63,12 +64,15 @@ export type ConversationSurface = {
63
64
  read(conversation: string, options?: ConversationOptions): Promise<ConversationView>;
64
65
  create(input: unknown): Promise<CallResult>;
65
66
  send(conversation: string, operation?: string, draft?: ChatDraft): Promise<CallResult | Offline>;
66
- answer(conversation: string, answer: unknown): Promise<CallResult>;
67
+ answer(conversation: string, answer: ConversationAnswer): Promise<CallResult>;
67
68
  interrupt(conversation: string): Promise<CallResult>;
68
69
  kill(conversation: string): Promise<CallResult>;
69
- cancel(conversation: string, turn: string): Promise<CallResult>;
70
70
  delete(conversation: string): Promise<CallResult>;
71
71
  };
72
+ export type ConversationAnswer = {
73
+ interaction_id: string;
74
+ response: unknown;
75
+ };
72
76
  export type ChatDraftSurface = {
73
77
  write(conversation: string, draft: ChatDraft, revision?: string): Promise<void>;
74
78
  prepend(conversation: string, draft: ChatDraft): Promise<void>;
@@ -76,6 +80,7 @@ export type ChatDraftSurface = {
76
80
  };
77
81
  export type ConversationDependencies = {
78
82
  call(name: ConversationAction, input: unknown): Promise<CallResult>;
83
+ history(request: ConversationHistoryRequest): Promise<CallResult>;
79
84
  durably<T>(work: (local: RuntimeStore) => Promise<T>): Promise<T>;
80
85
  stream(): ConversationStream | undefined;
81
86
  publish(set: ChangeSet): void;
@@ -88,7 +93,7 @@ export type ConversationDependencies = {
88
93
  export type ConversationStore = {
89
94
  surface: ConversationSurface;
90
95
  chatDraft: ChatDraftSurface;
91
- hydrate(held: readonly HeldConversation[], drafts: readonly ChatDraftRecord[], list: readonly ListedConversation[] | null): void;
96
+ hydrate(held: readonly HeldConversation[], drafts: readonly ChatDraftRecord[], list: readonly ListedConversation[] | null, cursor: string | null): void;
92
97
  reconcile(): Promise<void>;
93
98
  catchUp(progress: CycleProgress): Promise<void>;
94
99
  resend(progress: CycleProgress): Promise<void>;
@@ -90,6 +90,7 @@ export type Opened = {
90
90
  readonly targets: Readonly<Record<string, TargetRecord>>;
91
91
  readonly presentation: readonly PresentationRecord[];
92
92
  readonly conversationList: readonly ListedConversation[] | null;
93
+ readonly conversationCursor: string | null;
93
94
  };
94
95
  export type Commit = {
95
96
  readonly rooms: readonly RoomCommit[];
@@ -150,10 +150,6 @@ declare const MEMBERS: {
150
150
  readonly reach: 'within';
151
151
  readonly effect: 'action';
152
152
  };
153
- readonly 'conversation.cancel': {
154
- readonly reach: 'within';
155
- readonly effect: 'action';
156
- };
157
153
  readonly 'conversation.delete': {
158
154
  readonly reach: 'within';
159
155
  readonly effect: 'action';
package/docs/families.md CHANGED
@@ -85,7 +85,7 @@
85
85
  another holder of this App sends to this User's running copies, as `from`,
86
86
  the sender's User id, and `body`, the JSON value they sent, until the
87
87
  function it returns is called. App code sends one through the Runtime's
88
- `call('message.send', { to, body })` with the recipient's User id and
88
+ `call('apps/messages/send', { to, body })` with the recipient's User id and
89
89
  a body of at most 32 kB of JSON; House fills in the App and relays it only
90
90
  to copies running now, storing nothing. The panel sends none.
91
91
  - **App screenshot read** - given an App reference, `readScreenshot(app)`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentshouse/app-bridge",
3
- "version": "0.1.0-cd2d3edbf9805",
3
+ "version": "0.1.0-cd3bc6240e9ba",
4
4
  "description": "Types of the agents.house App bridge House hands every App: navigation, the tab title and icon, ceremonies, installation, notifications and the icon badge, status, Site image reads, 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",