@agentshouse/mdruntime-families 0.1.0-c4c523b146f57 → 0.1.0-c4dbafcb08099

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.
@@ -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;
@@ -224,10 +237,6 @@ export type Discovery = {
224
237
  providerLimits: readonly ProviderLimit[];
225
238
  retention: Retention;
226
239
  member?: Member;
227
- covered?: readonly string[];
228
- };
229
- export type DiscoveryScope = {
230
- readonly authorities: readonly string[];
231
240
  };
232
241
  export type TransportUncertainty = {
233
242
  kind: 'transport-uncertainty';
@@ -475,31 +484,35 @@ export type RoomChange = {
475
484
  roomVersion: string;
476
485
  read(): Promise<RefreshPage>;
477
486
  };
487
+ export type AuthorityChange = {
488
+ kind: 'authority-changed';
489
+ rooms: readonly DiscoveredRoom[];
490
+ left: readonly string[];
491
+ member?: Member;
492
+ };
478
493
  export type RoomStreamEvent = {
479
494
  kind: 'opened';
495
+ } | {
496
+ kind: 'discovered';
497
+ discovery: Discovery;
480
498
  } | {
481
499
  kind: 'closed';
482
500
  revoked: boolean;
483
501
  lost: boolean;
484
502
  } | {
485
- kind: 'opening';
503
+ kind: 'caught-up';
486
504
  expired: readonly string[];
487
- } | {
488
- kind: 'authority-changed';
489
- scope?: DiscoveryScope;
490
- } | RoomChange;
505
+ } | AuthorityChange | RoomChange;
491
506
  export type RoomStream = {
492
507
  hold(rooms: readonly HeldRoom[]): void;
493
- reopen(): void;
494
508
  observe(notify: (event: RoomStreamEvent) => void): () => void;
495
509
  };
496
510
  export type Adapter = {
497
511
  readonly localSaves?: true;
498
- readonly exhaustiveDiscovery?: true;
499
512
  readonly roomTypes?: string;
500
513
  readonly nameableRoomTypes?: readonly string[];
501
514
  authorize(): Promise<Authorization>;
502
- discover(authorization: Authorization, scope?: DiscoveryScope): Promise<DiscoverResult>;
515
+ discover?(authorization: Authorization): Promise<DiscoverResult>;
503
516
  bootstrap(authorization: Authorization, request: BootstrapRequest): Promise<BootstrapResult>;
504
517
  refresh?(authorization: Authorization, request: RefreshRequest): Promise<RefreshResult>;
505
518
  mutate(authorization: Authorization, request: MutationRequest, keep: (upload: unknown) => Promise<void>): Promise<MutationResult>;
@@ -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: {
@@ -145,7 +145,6 @@ export type ReadinessPort = {
145
145
  export type ComposedRuntime = RuntimeView & {
146
146
  seed(entry: EntrySeed): void;
147
147
  stop(): Promise<void>;
148
- lose(locators: readonly string[]): Promise<void>;
149
148
  persisted(answer: Persistence): void;
150
149
  within(reach: PortReach | null, port: ReadinessPort): NarrowedView;
151
150
  };
@@ -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>;
@@ -235,7 +235,7 @@ export type GroupShape = {
235
235
  export type PlanArea = {
236
236
  room: string;
237
237
  path: string;
238
- types: readonly string[];
238
+ open: readonly string[];
239
239
  };
240
240
  export type PlanReach = {
241
241
  rooms: readonly string[];
@@ -9,7 +9,7 @@ export type ReachedDocument = {
9
9
  export type ReachedArea = {
10
10
  readonly room: string;
11
11
  readonly path: string;
12
- readonly types: readonly string[];
12
+ readonly open: readonly string[];
13
13
  };
14
14
  export type PortReach = {
15
15
  readonly rooms: readonly string[];
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentshouse/mdruntime-families",
3
- "version": "0.1.0-c4c523b146f57",
3
+ "version": "0.1.0-c4dbafcb08099",
4
4
  "description": "react-admin and Refine data providers over the MD Runtime client",
5
5
  "license": "MIT",
6
6
  "type": "module",