@agentshouse/mdruntime 0.1.0-alpha.42 → 0.1.0-alpha.44
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/AGENTS.md +22 -11
- package/dist/adapter.d.ts +23 -1
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js.map +1 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +6 -1
- package/dist/bootstrap.js.map +1 -1
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +3 -2
- package/dist/change-set.js.map +1 -1
- package/dist/client.d.ts +1 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +4 -0
- package/dist/client.js.map +1 -1
- package/dist/connection.d.ts +1 -0
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +86 -31
- package/dist/connection.js.map +1 -1
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +2 -0
- package/dist/host.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/memory.d.ts +2 -1
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +53 -10
- package/dist/memory.js.map +1 -1
- package/dist/overlay.d.ts +7 -2
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +48 -15
- package/dist/overlay.js.map +1 -1
- package/dist/query.d.ts +4 -0
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +4 -1
- package/dist/query.js.map +1 -1
- package/dist/read-side.d.ts.map +1 -1
- package/dist/read-side.js +6 -0
- package/dist/read-side.js.map +1 -1
- package/dist/refresh.d.ts +3 -3
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +20 -4
- package/dist/refresh.js.map +1 -1
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +9 -0
- package/dist/replica.js.map +1 -1
- package/dist/rows.d.ts +3 -1
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +5 -3
- package/dist/rows.js.map +1 -1
- package/dist/store.d.ts +2 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +20 -12
- package/dist/store.js.map +1 -1
- package/dist/wire.d.ts +1 -1
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +1 -0
- package/dist/wire.js.map +1 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -7,7 +7,7 @@ enforcement.
|
|
|
7
7
|
## The MD Runtime API
|
|
8
8
|
|
|
9
9
|
App code reaches the MD Runtime through the remote client. The surfaces are
|
|
10
|
-
Rooms, Slots, Query, Search, Observe, Types, Room Draft, Save, History, Call, Log,
|
|
10
|
+
Rooms, Slots, Query, Search, Observe, Types, Room Draft, Save, History, Call, Reached, Log,
|
|
11
11
|
storage loss, the reported persistence answer, deployment facts, Sync Status, the Service Mode,
|
|
12
12
|
reauthorization, conversation, the chat draft, and Presentation State.
|
|
13
13
|
|
|
@@ -33,9 +33,12 @@ queued.
|
|
|
33
33
|
Slots answers each Slot the Provider declares, in its order, with its entries
|
|
34
34
|
in order, each a Room and its segment; a Room two Slots list is the same Room.
|
|
35
35
|
|
|
36
|
-
Rooms, Slots, Query, Search, Observe, Types, Room Draft, and
|
|
37
|
-
network.
|
|
38
|
-
History and Call go to the Provider through the Adapter.
|
|
36
|
+
Rooms, Slots, Query, Search, Observe, Types, Room Draft, Save, and Reached never
|
|
37
|
+
touch the network.
|
|
38
|
+
History and Call go to the Provider through the Adapter. A Call result whose
|
|
39
|
+
effect the Provider places in a Room carries `at`, that Room and Room Version;
|
|
40
|
+
`reached(room, roomVersion)` answers whether the Room's confirmed state has
|
|
41
|
+
reached it, and the MD Runtime keeps refreshing that Room until it has. Each History revision
|
|
39
42
|
names its author, `{ kind: 'user', id }` or `{ kind: 'site', id, name }`. Every
|
|
40
43
|
member of the
|
|
41
44
|
client is asynchronous. Results are detached snapshots. Nothing in this
|
|
@@ -73,11 +76,18 @@ data:
|
|
|
73
76
|
`backlinks: { field, types, where, pathPrefix }` keeps Documents that a
|
|
74
77
|
matching Document of the same Room references. Each keeps a Document once.
|
|
75
78
|
- **Parts.** A Document query must `select`: `'all'`, or `fields`, `sections`,
|
|
76
|
-
`preamble`, `markdown` and `
|
|
77
|
-
`'all'` or a list of names. Room and Path always return; a Markdown
|
|
78
|
-
also returns its MD Type. A non-Markdown Document or binary link
|
|
79
|
-
only Room and Path. An unselected part is absent. Select only
|
|
80
|
-
shows: a list that selects the Markdown hears every edit of it.
|
|
79
|
+
`preamble`, `markdown`, `backlinks` and `change`, where `fields` and `sections`
|
|
80
|
+
are `'all'` or a list of names. Room and Path always return; a Markdown
|
|
81
|
+
Document also returns its MD Type. A non-Markdown Document or binary link
|
|
82
|
+
target returns only Room and Path. An unselected part is absent. Select only
|
|
83
|
+
what a screen shows: a list that selects the Markdown hears every edit of it.
|
|
84
|
+
- **Change.** `change` is `{ author, time }` of the Document's head revision as
|
|
85
|
+
the Provider last delivered it: `author` is `{ kind: 'user' | 'site', id, name }`
|
|
86
|
+
or `null` for a write the Provider made itself, and `time` is the Provider's
|
|
87
|
+
ISO 8601 change time. It is `null` where the Provider delivered no time, as at
|
|
88
|
+
a Site. An unsent edit or move keeps it, an unsent creation has none, and a
|
|
89
|
+
saved write takes the Provider's own once it is Accepted and refreshed. A
|
|
90
|
+
Room's last change is its Document with the latest `time`.
|
|
81
91
|
- **Order and groups.** `orderBy` sorts by `room`, `path`, `type` or `{ field }`
|
|
82
92
|
with TanStack DB's own options, and ties end with Room, then Path. `groupBy` by
|
|
83
93
|
`room`, `type` or `{ field }` answers `{ groups: [{ key, count }] }`, counted
|
|
@@ -130,8 +140,9 @@ state, or by a local validation rule, and then creates nothing and leaves every
|
|
|
130
140
|
Room Draft in place. A directory move or removal is a move or removal part on
|
|
131
141
|
each Document and binary link target beneath it, saved together.
|
|
132
142
|
|
|
133
|
-
Outcomes follow the Provider's answer. Accepted
|
|
134
|
-
|
|
143
|
+
Outcomes follow the Provider's answer. An Accepted Change Batch stays in the
|
|
144
|
+
queue, drawn over the confirmed layer, until the confirmed layer reaches the
|
|
145
|
+
Room Version it was accepted at, and then leaves it. Conflicted and Rejected, an expired outcome record, and a change that no
|
|
135
146
|
longer applies over the Room each leave the queue and return as Room Drafts on
|
|
136
147
|
the Documents they changed, marked with why: the Provider's structured refusal
|
|
137
148
|
code and fields as returned, not known to have applied, or withdrawn locally.
|
package/dist/adapter.d.ts
CHANGED
|
@@ -169,6 +169,19 @@ export type ContractUnavailable = ProviderRefusal & {
|
|
|
169
169
|
};
|
|
170
170
|
export type DiscoverResult = Discovery | TransportUncertainty | RevokedAuthorization | ContractUnavailable;
|
|
171
171
|
export type PageToken = string;
|
|
172
|
+
export type ChangeAuthor = {
|
|
173
|
+
kind: 'user';
|
|
174
|
+
id: string;
|
|
175
|
+
name: string;
|
|
176
|
+
} | {
|
|
177
|
+
kind: 'site';
|
|
178
|
+
id: string;
|
|
179
|
+
name: string;
|
|
180
|
+
};
|
|
181
|
+
export type HeadChange = {
|
|
182
|
+
author: ChangeAuthor | null;
|
|
183
|
+
time: string;
|
|
184
|
+
};
|
|
172
185
|
export type BootstrapRequest = {
|
|
173
186
|
locator: string;
|
|
174
187
|
selection: string;
|
|
@@ -179,6 +192,7 @@ export type BootstrapPage = {
|
|
|
179
192
|
roomVersion: string;
|
|
180
193
|
documents: Readonly<Record<string, string>>;
|
|
181
194
|
revisions: Readonly<Record<string, string>>;
|
|
195
|
+
changes: Readonly<Record<string, HeadChange>>;
|
|
182
196
|
binaryTargets: readonly string[];
|
|
183
197
|
pageToken?: PageToken;
|
|
184
198
|
};
|
|
@@ -187,6 +201,7 @@ export type RefreshRequest = {
|
|
|
187
201
|
locator: string;
|
|
188
202
|
selection: string;
|
|
189
203
|
fromRoomVersion: string;
|
|
204
|
+
reach?: string;
|
|
190
205
|
pageToken?: PageToken;
|
|
191
206
|
};
|
|
192
207
|
export type RefreshPage = {
|
|
@@ -194,6 +209,7 @@ export type RefreshPage = {
|
|
|
194
209
|
roomVersion: string;
|
|
195
210
|
documents: Readonly<Record<string, string>>;
|
|
196
211
|
revisions: Readonly<Record<string, string>>;
|
|
212
|
+
changes: Readonly<Record<string, HeadChange>>;
|
|
197
213
|
binaryTargets: readonly string[];
|
|
198
214
|
removals: readonly string[];
|
|
199
215
|
pageToken?: PageToken;
|
|
@@ -202,7 +218,7 @@ export type RefreshResult = {
|
|
|
202
218
|
kind: 'still-current';
|
|
203
219
|
} | RefreshPage | {
|
|
204
220
|
kind: 'beyond-horizon';
|
|
205
|
-
} | AdapterFailure;
|
|
221
|
+
} | RetryableRefusal | AdapterFailure;
|
|
206
222
|
export type MutationRequest = {
|
|
207
223
|
locator: string;
|
|
208
224
|
changeBatch: ChangeBatch;
|
|
@@ -269,9 +285,14 @@ export type ActionRequest = {
|
|
|
269
285
|
name: string;
|
|
270
286
|
input: unknown;
|
|
271
287
|
};
|
|
288
|
+
export type RoomVersionAt = {
|
|
289
|
+
locator: string;
|
|
290
|
+
roomVersion: string;
|
|
291
|
+
};
|
|
272
292
|
export type ActionResult = {
|
|
273
293
|
kind: 'action';
|
|
274
294
|
result: unknown;
|
|
295
|
+
at?: RoomVersionAt;
|
|
275
296
|
} | (ProviderRefusal & {
|
|
276
297
|
kind: 'rejected';
|
|
277
298
|
}) | AdapterFailure;
|
|
@@ -304,6 +325,7 @@ export type Adapter = {
|
|
|
304
325
|
mutate(authorization: Authorization, request: MutationRequest, keep: (upload: unknown) => Promise<void>): Promise<MutationResult>;
|
|
305
326
|
history(authorization: Authorization, request: HistoryRequest): Promise<HistoryResult>;
|
|
306
327
|
action(authorization: Authorization, request: ActionRequest): Promise<ActionResult>;
|
|
328
|
+
reached(locator: string, roomVersion: string, target: string): boolean;
|
|
307
329
|
roomVersions?: SelectedRooms;
|
|
308
330
|
conversations?: ConversationStream;
|
|
309
331
|
serviceMode?: ServiceModeSignal;
|
package/dist/adapter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sour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G;IACpB,KAAK,CAAC,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACjF,SAAS,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;IACpC,QAAQ,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAChE,SAAS,CAAC,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC7F,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACvF,MAAM,CACJ,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,GACvC,OAAO,CAAC,cAAc,CAAC,CAAC;IAC3B,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACvF,MAAM,CAAC,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACpF,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IACvE,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,WAAW,CAAC,EAAE,iBAAiB,CAAC;CACjC,CAAC"}
|
package/dist/adapter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/workspace/packages/mdruntime/src/adapter.ts"],"sourcesContent":["import type { ModelIdentity, ModelResult } from './model.js';\nimport type { ChangeBatch } from './change.js';\n\nexport type Authorization = object;\n\nexport const ROOM_CONTRACT_VERSION = 1;\n\nexport const VERSION_1_CAPABILITIES = [\n 'stable-file-ids',\n 'ranked-provider-search',\n 'room-version-notifications',\n 'room-history',\n 'provider-actions',\n 'move-reference-rewrites',\n] as const;\n\nexport type MdModelIdentity = {\n identity: string;\n version: string;\n};\n\nexport type TypedSelection = {\n roots: readonly string[];\n attachedModel: ModelIdentity | null;\n};\n\nexport type OperationScopes = {\n read: readonly string[];\n sync: readonly string[];\n write: readonly string[];\n delete: readonly string[];\n};\nexport type ReplicaAdmission = { selection: string; admission: 'admitted' | 'unavailable' };\n\nexport type DiscoveredRoom = {\n collectionRoot: string;\n name: string;\n locator: string;\n roomVersion: string;\n operations: OperationScopes;\n replica: ReplicaAdmission;\n attachedModel: ModelIdentity | null;\n typedSelection?: TypedSelection;\n providerOwnedPaths: readonly string[];\n};\n\nexport type Capability = {\n name: string;\n limits?: readonly ProviderLimit[];\n actions?: readonly ActionDeclaration[];\n conversationCards?: ConversationCards;\n};\n\nexport type ConversationCards = {\n locator: string;\n type: string;\n identity: string;\n agent: string;\n};\n\nexport type ConversationAction =\n | 'conversation.create'\n | 'conversation.send'\n | 'conversation.answer'\n | 'conversation.interrupt'\n | 'conversation.kill'\n | 'conversation.cancel'\n | 'conversation.delete'\n | 'conversation.history';\n\nexport type ConversationMessage = {\n identity: string;\n turn: string;\n text: string;\n message: unknown;\n};\n\nexport type AcceptedMessage = ConversationMessage & { position: string };\n\nexport type ConversationHistoryRequest = {\n conversation: string;\n after?: string;\n};\n\nexport type ConversationHistoryPage = {\n messages: readonly AcceptedMessage[];\n next?: string;\n};\n\nexport type WorkingNote = { noteId: string; text: string };\n\nexport type ConversationEvent =\n | { kind: 'growing-text'; conversation: string; turn: string; text: string }\n | { kind: 'plan'; conversation: string; turn: string; plan: unknown }\n | { kind: 'working-note'; conversation: string; note: WorkingNote | null }\n | { kind: 'questions'; conversation: string; questions: readonly unknown[] }\n | { kind: 'process'; conversation: string; running: boolean }\n | { kind: 'commands'; conversation: string; commands: readonly unknown[] }\n | { kind: 'options'; conversation: string; options: readonly unknown[] }\n | { kind: 'accepted-message'; conversation: string; message: AcceptedMessage }\n | { kind: 'gap'; conversation: string };\n\nexport type ConversationStream = {\n replicate(conversations: readonly string[]): void;\n observe(notify: (event: ConversationEvent) => void): () => void;\n};\n\nexport type ActionDeclaration = {\n name: string;\n inputShape: unknown;\n resultKind: unknown;\n};\n\nexport type ProviderLimit = {\n name: string;\n value?: number | string;\n};\n\nexport type HistoryRetention =\n | { kind: 'duration'; seconds: number }\n | { kind: 'no-declared-time-bound' };\n\nexport type Retention = {\n history: HistoryRetention;\n outcome: number;\n refreshHorizon: number;\n};\n\nexport type Discovery = {\n kind: 'discovery';\n supportedVersions: readonly number[];\n mdModel: MdModelIdentity;\n rooms: readonly DiscoveredRoom[];\n slots?: readonly {\n slot: string;\n entries: readonly { locator: string; segment: string | null }[];\n }[];\n capabilities: readonly Capability[];\n providerLimits: readonly ProviderLimit[];\n retention: Retention;\n};\n\nexport type TransportUncertainty = { kind: 'transport-uncertainty' };\nexport type RoomNotReadable = { kind: 'room-not-readable'; locator: string };\nexport type RevokedAuthorization = { kind: 'revoked-authorization' };\n\nexport type ProviderRefusal = {\n code: string;\n fields: Readonly<Record<string, unknown>>;\n};\n\nexport type ScopedRefusal = ProviderRefusal & {\n kind: 'scoped-refusal';\n locator: string;\n scope: 'content' | 'sync' | 'model' | 'operation' | 'undisclosed';\n};\nexport type AdapterFailure =\n | TransportUncertainty\n | RoomNotReadable\n | RevokedAuthorization\n | ScopedRefusal;\n\nexport type ContractUnavailable = ProviderRefusal & { kind: 'contract-unavailable' };\n\nexport type DiscoverResult =\n | Discovery\n | TransportUncertainty\n | RevokedAuthorization\n | ContractUnavailable;\n\nexport type PageToken = string;\n\nexport type BootstrapRequest = {\n locator: string;\n selection: string;\n pageToken?: PageToken;\n};\n\nexport type BootstrapPage = {\n kind: 'bootstrap';\n roomVersion: string;\n documents: Readonly<Record<string, string>>;\n revisions: Readonly<Record<string, string>>;\n binaryTargets: readonly string[];\n pageToken?: PageToken;\n};\n\nexport type BootstrapResult = BootstrapPage | AdapterFailure;\n\nexport type RefreshRequest = {\n locator: string;\n selection: string;\n fromRoomVersion: string;\n pageToken?: PageToken;\n};\n\nexport type RefreshPage = {\n kind: 'net-advancement';\n roomVersion: string;\n documents: Readonly<Record<string, string>>;\n revisions: Readonly<Record<string, string>>;\n binaryTargets: readonly string[];\n removals: readonly string[];\n pageToken?: PageToken;\n};\n\nexport type RefreshResult =\n | { kind: 'still-current' }\n | RefreshPage\n | { kind: 'beyond-horizon' }\n | AdapterFailure;\n\nexport type MutationRequest = {\n locator: string;\n changeBatch: ChangeBatch;\n upload?: unknown;\n};\n\nexport type RetryableRefusal = ProviderRefusal & {\n kind: 'retryable-refusal';\n reset?: string;\n};\n\nexport type ServiceMode = 'open' | 'write-halted';\n\nexport type ServiceModeSignal = {\n observe(notify: (mode: ServiceMode) => void): () => void;\n};\n\nexport type MutationResult =\n | {\n kind: 'accepted';\n roomVersion: string;\n documents: Readonly<Record<string, string>>;\n revisions: Readonly<Record<string, string>>;\n removals: readonly string[];\n author?: string;\n time?: string;\n }\n | (ProviderRefusal & {\n kind: 'conflicted';\n roomVersion?: string;\n affected: Readonly<Record<string, string>>;\n })\n | (ProviderRefusal & {\n kind: 'rejected';\n affected: Readonly<Record<string, string>>;\n })\n | RetryableRefusal\n | { kind: 'write-halted' }\n | { kind: 'expired' }\n | AdapterFailure;\n\nexport type HistoryAuthor =\n | { kind: 'user'; id: string }\n | { kind: 'site'; id: string; name: string };\n\nexport type HistoryRevision = {\n revision: string;\n author: HistoryAuthor;\n time: string;\n};\n\nexport type HistoryRequest = {\n locator: string;\n path: string;\n revision?: string;\n pageToken?: PageToken;\n};\n\nexport type HistoryResult =\n | {\n kind: 'history';\n revisions: readonly HistoryRevision[];\n pageToken?: PageToken;\n }\n | {\n kind: 'revision';\n content: string;\n }\n | { kind: 'no-history' }\n | AdapterFailure;\n\nexport type ActionRequest = {\n name: string;\n input: unknown;\n};\n\nexport type ActionResult =\n | { kind: 'action'; result: unknown }\n | (ProviderRefusal & { kind: 'rejected' })\n | AdapterFailure;\n\nexport type ModelRequest =\n | { locator: string; attached: 'collection'; collectionRoot: string; model: ModelIdentity | null }\n | {\n locator: string;\n attached: 'typed-selection';\n roots: readonly string[];\n model: ModelIdentity | null;\n };\n\nexport type RoomVersionNotification = {\n locator: string;\n roomVersion: string;\n modelChanged?: true;\n};\n\nexport type SelectedRooms = {\n select(locators: readonly string[]): void;\n observe(notify: (notification: RoomVersionNotification) => void): () => void;\n};\n\nexport type Adapter = {\n model(authorization: Authorization, request: ModelRequest): Promise<ModelResult>;\n authorize(): Promise<Authorization>;\n discover(authorization: Authorization): Promise<DiscoverResult>;\n bootstrap(authorization: Authorization, request: BootstrapRequest): Promise<BootstrapResult>;\n refresh(authorization: Authorization, request: RefreshRequest): Promise<RefreshResult>;\n mutate(\n authorization: Authorization,\n request: MutationRequest,\n keep: (upload: unknown) => Promise<void>,\n ): Promise<MutationResult>;\n history(authorization: Authorization, request: HistoryRequest): Promise<HistoryResult>;\n action(authorization: Authorization, request: ActionRequest): Promise<ActionResult>;\n roomVersions?: SelectedRooms;\n conversations?: ConversationStream;\n serviceMode?: ServiceModeSignal;\n};\n"],"names":["ROOM_CONTRACT_VERSION","VERSION_1_CAPABILITIES"],"mappings":"AAKA,OAAO,MAAMA,wBAAwB,EAAE;AAEvC,OAAO,MAAMC,yBAAyB;IACpC;IACA;IACA;IACA;IACA;IACA;CACD,CAAU"}
|
|
1
|
+
{"version":3,"sources":["/workspace/packages/mdruntime/src/adapter.ts"],"sourcesContent":["import type { ModelIdentity, ModelResult } from './model.js';\nimport type { ChangeBatch } from './change.js';\n\nexport type Authorization = object;\n\nexport const ROOM_CONTRACT_VERSION = 1;\n\nexport const VERSION_1_CAPABILITIES = [\n 'stable-file-ids',\n 'ranked-provider-search',\n 'room-version-notifications',\n 'room-history',\n 'provider-actions',\n 'move-reference-rewrites',\n] as const;\n\nexport type MdModelIdentity = {\n identity: string;\n version: string;\n};\n\nexport type TypedSelection = {\n roots: readonly string[];\n attachedModel: ModelIdentity | null;\n};\n\nexport type OperationScopes = {\n read: readonly string[];\n sync: readonly string[];\n write: readonly string[];\n delete: readonly string[];\n};\nexport type ReplicaAdmission = { selection: string; admission: 'admitted' | 'unavailable' };\n\nexport type DiscoveredRoom = {\n collectionRoot: string;\n name: string;\n locator: string;\n roomVersion: string;\n operations: OperationScopes;\n replica: ReplicaAdmission;\n attachedModel: ModelIdentity | null;\n typedSelection?: TypedSelection;\n providerOwnedPaths: readonly string[];\n};\n\nexport type Capability = {\n name: string;\n limits?: readonly ProviderLimit[];\n actions?: readonly ActionDeclaration[];\n conversationCards?: ConversationCards;\n};\n\nexport type ConversationCards = {\n locator: string;\n type: string;\n identity: string;\n agent: string;\n};\n\nexport type ConversationAction =\n | 'conversation.create'\n | 'conversation.send'\n | 'conversation.answer'\n | 'conversation.interrupt'\n | 'conversation.kill'\n | 'conversation.cancel'\n | 'conversation.delete'\n | 'conversation.history';\n\nexport type ConversationMessage = {\n identity: string;\n turn: string;\n text: string;\n message: unknown;\n};\n\nexport type AcceptedMessage = ConversationMessage & { position: string };\n\nexport type ConversationHistoryRequest = {\n conversation: string;\n after?: string;\n};\n\nexport type ConversationHistoryPage = {\n messages: readonly AcceptedMessage[];\n next?: string;\n};\n\nexport type WorkingNote = { noteId: string; text: string };\n\nexport type ConversationEvent =\n | { kind: 'growing-text'; conversation: string; turn: string; text: string }\n | { kind: 'plan'; conversation: string; turn: string; plan: unknown }\n | { kind: 'working-note'; conversation: string; note: WorkingNote | null }\n | { kind: 'questions'; conversation: string; questions: readonly unknown[] }\n | { kind: 'process'; conversation: string; running: boolean }\n | { kind: 'commands'; conversation: string; commands: readonly unknown[] }\n | { kind: 'options'; conversation: string; options: readonly unknown[] }\n | { kind: 'accepted-message'; conversation: string; message: AcceptedMessage }\n | { kind: 'gap'; conversation: string };\n\nexport type ConversationStream = {\n replicate(conversations: readonly string[]): void;\n observe(notify: (event: ConversationEvent) => void): () => void;\n};\n\nexport type ActionDeclaration = {\n name: string;\n inputShape: unknown;\n resultKind: unknown;\n};\n\nexport type ProviderLimit = {\n name: string;\n value?: number | string;\n};\n\nexport type HistoryRetention =\n | { kind: 'duration'; seconds: number }\n | { kind: 'no-declared-time-bound' };\n\nexport type Retention = {\n history: HistoryRetention;\n outcome: number;\n refreshHorizon: number;\n};\n\nexport type Discovery = {\n kind: 'discovery';\n supportedVersions: readonly number[];\n mdModel: MdModelIdentity;\n rooms: readonly DiscoveredRoom[];\n slots?: readonly {\n slot: string;\n entries: readonly { locator: string; segment: string | null }[];\n }[];\n capabilities: readonly Capability[];\n providerLimits: readonly ProviderLimit[];\n retention: Retention;\n};\n\nexport type TransportUncertainty = { kind: 'transport-uncertainty' };\nexport type RoomNotReadable = { kind: 'room-not-readable'; locator: string };\nexport type RevokedAuthorization = { kind: 'revoked-authorization' };\n\nexport type ProviderRefusal = {\n code: string;\n fields: Readonly<Record<string, unknown>>;\n};\n\nexport type ScopedRefusal = ProviderRefusal & {\n kind: 'scoped-refusal';\n locator: string;\n scope: 'content' | 'sync' | 'model' | 'operation' | 'undisclosed';\n};\nexport type AdapterFailure =\n | TransportUncertainty\n | RoomNotReadable\n | RevokedAuthorization\n | ScopedRefusal;\n\nexport type ContractUnavailable = ProviderRefusal & { kind: 'contract-unavailable' };\n\nexport type DiscoverResult =\n | Discovery\n | TransportUncertainty\n | RevokedAuthorization\n | ContractUnavailable;\n\nexport type PageToken = string;\n\nexport type ChangeAuthor =\n | { kind: 'user'; id: string; name: string }\n | { kind: 'site'; id: string; name: string };\n\nexport type HeadChange = { author: ChangeAuthor | null; time: string };\n\nexport type BootstrapRequest = {\n locator: string;\n selection: string;\n pageToken?: PageToken;\n};\n\nexport type BootstrapPage = {\n kind: 'bootstrap';\n roomVersion: string;\n documents: Readonly<Record<string, string>>;\n revisions: Readonly<Record<string, string>>;\n changes: Readonly<Record<string, HeadChange>>;\n binaryTargets: readonly string[];\n pageToken?: PageToken;\n};\n\nexport type BootstrapResult = BootstrapPage | AdapterFailure;\n\nexport type RefreshRequest = {\n locator: string;\n selection: string;\n fromRoomVersion: string;\n reach?: string;\n pageToken?: PageToken;\n};\n\nexport type RefreshPage = {\n kind: 'net-advancement';\n roomVersion: string;\n documents: Readonly<Record<string, string>>;\n revisions: Readonly<Record<string, string>>;\n changes: Readonly<Record<string, HeadChange>>;\n binaryTargets: readonly string[];\n removals: readonly string[];\n pageToken?: PageToken;\n};\n\nexport type RefreshResult =\n | { kind: 'still-current' }\n | RefreshPage\n | { kind: 'beyond-horizon' }\n | RetryableRefusal\n | AdapterFailure;\n\nexport type MutationRequest = {\n locator: string;\n changeBatch: ChangeBatch;\n upload?: unknown;\n};\n\nexport type RetryableRefusal = ProviderRefusal & {\n kind: 'retryable-refusal';\n reset?: string;\n};\n\nexport type ServiceMode = 'open' | 'write-halted';\n\nexport type ServiceModeSignal = {\n observe(notify: (mode: ServiceMode) => void): () => void;\n};\n\nexport type MutationResult =\n | {\n kind: 'accepted';\n roomVersion: string;\n documents: Readonly<Record<string, string>>;\n revisions: Readonly<Record<string, string>>;\n removals: readonly string[];\n author?: string;\n time?: string;\n }\n | (ProviderRefusal & {\n kind: 'conflicted';\n roomVersion?: string;\n affected: Readonly<Record<string, string>>;\n })\n | (ProviderRefusal & {\n kind: 'rejected';\n affected: Readonly<Record<string, string>>;\n })\n | RetryableRefusal\n | { kind: 'write-halted' }\n | { kind: 'expired' }\n | AdapterFailure;\n\nexport type HistoryAuthor =\n | { kind: 'user'; id: string }\n | { kind: 'site'; id: string; name: string };\n\nexport type HistoryRevision = {\n revision: string;\n author: HistoryAuthor;\n time: string;\n};\n\nexport type HistoryRequest = {\n locator: string;\n path: string;\n revision?: string;\n pageToken?: PageToken;\n};\n\nexport type HistoryResult =\n | {\n kind: 'history';\n revisions: readonly HistoryRevision[];\n pageToken?: PageToken;\n }\n | {\n kind: 'revision';\n content: string;\n }\n | { kind: 'no-history' }\n | AdapterFailure;\n\nexport type ActionRequest = {\n name: string;\n input: unknown;\n};\n\nexport type RoomVersionAt = {\n locator: string;\n roomVersion: string;\n};\n\nexport type ActionResult =\n | { kind: 'action'; result: unknown; at?: RoomVersionAt }\n | (ProviderRefusal & { kind: 'rejected' })\n | AdapterFailure;\n\nexport type ModelRequest =\n | { locator: string; attached: 'collection'; collectionRoot: string; model: ModelIdentity | null }\n | {\n locator: string;\n attached: 'typed-selection';\n roots: readonly string[];\n model: ModelIdentity | null;\n };\n\nexport type RoomVersionNotification = {\n locator: string;\n roomVersion: string;\n modelChanged?: true;\n};\n\nexport type SelectedRooms = {\n select(locators: readonly string[]): void;\n observe(notify: (notification: RoomVersionNotification) => void): () => void;\n};\n\nexport type Adapter = {\n model(authorization: Authorization, request: ModelRequest): Promise<ModelResult>;\n authorize(): Promise<Authorization>;\n discover(authorization: Authorization): Promise<DiscoverResult>;\n bootstrap(authorization: Authorization, request: BootstrapRequest): Promise<BootstrapResult>;\n refresh(authorization: Authorization, request: RefreshRequest): Promise<RefreshResult>;\n mutate(\n authorization: Authorization,\n request: MutationRequest,\n keep: (upload: unknown) => Promise<void>,\n ): Promise<MutationResult>;\n history(authorization: Authorization, request: HistoryRequest): Promise<HistoryResult>;\n action(authorization: Authorization, request: ActionRequest): Promise<ActionResult>;\n reached(locator: string, roomVersion: string, target: string): boolean;\n roomVersions?: SelectedRooms;\n conversations?: ConversationStream;\n serviceMode?: ServiceModeSignal;\n};\n"],"names":["ROOM_CONTRACT_VERSION","VERSION_1_CAPABILITIES"],"mappings":"AAKA,OAAO,MAAMA,wBAAwB,EAAE;AAEvC,OAAO,MAAMC,yBAAyB;IACpC;IACA;IACA;IACA;IACA;IACA;CACD,CAAU"}
|
package/dist/bootstrap.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,aAAa,EACb,cAAc,EAEf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAc,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAGvD,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,cAAc,CAAC;AAEvD,wBAAsB,aAAa,CACjC,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,aAAa,EAC5B,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,UAAU,CAAA;CAAE,EACzD,UAAU,EAAE,MAAM,OAAO,GACxB,OAAO,CAAC,gBAAgB,CAAC,CA4C3B"}
|
package/dist/bootstrap.js
CHANGED
|
@@ -13,6 +13,9 @@ export async function bootstrapRoom(adapter, authorization, room, models, contin
|
|
|
13
13
|
const revisions = {
|
|
14
14
|
...first.revisions
|
|
15
15
|
};
|
|
16
|
+
const changes = {
|
|
17
|
+
...first.changes
|
|
18
|
+
};
|
|
16
19
|
const binaryTargets = new Set(first.binaryTargets);
|
|
17
20
|
let pageToken = first.pageToken;
|
|
18
21
|
while(pageToken !== undefined){
|
|
@@ -26,6 +29,7 @@ export async function bootstrapRoom(adapter, authorization, room, models, contin
|
|
|
26
29
|
if (page.roomVersion !== roomVersion) return unconfirmed;
|
|
27
30
|
Object.assign(documents, page.documents);
|
|
28
31
|
Object.assign(revisions, page.revisions);
|
|
32
|
+
Object.assign(changes, page.changes);
|
|
29
33
|
for (const target of page.binaryTargets)binaryTargets.add(target);
|
|
30
34
|
pageToken = page.pageToken;
|
|
31
35
|
}
|
|
@@ -45,7 +49,8 @@ export async function bootstrapRoom(adapter, authorization, room, models, contin
|
|
|
45
49
|
binaryTargets: [
|
|
46
50
|
...binaryTargets
|
|
47
51
|
].sort(),
|
|
48
|
-
revisions
|
|
52
|
+
revisions,
|
|
53
|
+
changes
|
|
49
54
|
});
|
|
50
55
|
}
|
|
51
56
|
|
package/dist/bootstrap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/workspace/packages/mdruntime/src/bootstrap.ts"],"sourcesContent":["import type { ModelState } from './model.js';\nimport type {
|
|
1
|
+
{"version":3,"sources":["/workspace/packages/mdruntime/src/bootstrap.ts"],"sourcesContent":["import type { ModelState } from './model.js';\nimport type {\n Adapter,\n AdapterFailure,\n Authorization,\n DiscoveredRoom,\n HeadChange,\n} from './adapter.js';\nimport { readStaged, type Staged } from './replica.js';\nimport { unconfirmed } from './transfer.js';\n\nexport type BootstrapOutcome = Staged | AdapterFailure;\n\nexport async function bootstrapRoom(\n adapter: Adapter,\n authorization: Authorization,\n room: DiscoveredRoom,\n models: { collection: ModelState; selection: ModelState },\n continuing: () => boolean,\n): Promise<BootstrapOutcome> {\n const first = await adapter.bootstrap(authorization, {\n locator: room.locator,\n selection: room.replica.selection,\n });\n if (first.kind !== 'bootstrap') return first;\n const roomVersion = first.roomVersion;\n const documents: Record<string, string> = { ...first.documents };\n const revisions: Record<string, string> = { ...first.revisions };\n const changes: Record<string, HeadChange> = { ...first.changes };\n const binaryTargets = new Set(first.binaryTargets);\n let pageToken = first.pageToken;\n while (pageToken !== undefined) {\n if (!continuing()) return unconfirmed;\n const page = await adapter.bootstrap(authorization, {\n locator: room.locator,\n selection: room.replica.selection,\n pageToken,\n });\n if (page.kind !== 'bootstrap') return page;\n if (page.roomVersion !== roomVersion) return unconfirmed;\n Object.assign(documents, page.documents);\n Object.assign(revisions, page.revisions);\n Object.assign(changes, page.changes);\n for (const target of page.binaryTargets) binaryTargets.add(target);\n pageToken = page.pageToken;\n }\n return readStaged({\n locator: room.locator,\n collectionRoot: room.collectionRoot,\n name: room.name,\n operations: room.operations,\n replica: room.replica,\n attachedModel: room.attachedModel,\n model: models.collection,\n typedSelection: room.typedSelection ?? null,\n selectionModel: models.selection,\n providerOwnedPaths: room.providerOwnedPaths,\n roomVersion,\n documents,\n binaryTargets: [...binaryTargets].sort(),\n revisions,\n changes,\n });\n}\n"],"names":["readStaged","unconfirmed","bootstrapRoom","adapter","authorization","room","models","continuing","first","bootstrap","locator","selection","replica","kind","roomVersion","documents","revisions","changes","binaryTargets","Set","pageToken","undefined","page","Object","assign","target","add","collectionRoot","name","operations","attachedModel","model","collection","typedSelection","selectionModel","providerOwnedPaths","sort"],"mappings":"AAQA,SAASA,UAAU,QAAqB,eAAe;AACvD,SAASC,WAAW,QAAQ,gBAAgB;AAI5C,OAAO,eAAeC,cACpBC,OAAgB,EAChBC,aAA4B,EAC5BC,IAAoB,EACpBC,MAAyD,EACzDC,UAAyB;IAEzB,MAAMC,QAAQ,MAAML,QAAQM,SAAS,CAACL,eAAe;QACnDM,SAASL,KAAKK,OAAO;QACrBC,WAAWN,KAAKO,OAAO,CAACD,SAAS;IACnC;IACA,IAAIH,MAAMK,IAAI,KAAK,aAAa,OAAOL;IACvC,MAAMM,cAAcN,MAAMM,WAAW;IACrC,MAAMC,YAAoC;QAAE,GAAGP,MAAMO,SAAS;IAAC;IAC/D,MAAMC,YAAoC;QAAE,GAAGR,MAAMQ,SAAS;IAAC;IAC/D,MAAMC,UAAsC;QAAE,GAAGT,MAAMS,OAAO;IAAC;IAC/D,MAAMC,gBAAgB,IAAIC,IAAIX,MAAMU,aAAa;IACjD,IAAIE,YAAYZ,MAAMY,SAAS;IAC/B,MAAOA,cAAcC,UAAW;QAC9B,IAAI,CAACd,cAAc,OAAON;QAC1B,MAAMqB,OAAO,MAAMnB,QAAQM,SAAS,CAACL,eAAe;YAClDM,SAASL,KAAKK,OAAO;YACrBC,WAAWN,KAAKO,OAAO,CAACD,SAAS;YACjCS;QACF;QACA,IAAIE,KAAKT,IAAI,KAAK,aAAa,OAAOS;QACtC,IAAIA,KAAKR,WAAW,KAAKA,aAAa,OAAOb;QAC7CsB,OAAOC,MAAM,CAACT,WAAWO,KAAKP,SAAS;QACvCQ,OAAOC,MAAM,CAACR,WAAWM,KAAKN,SAAS;QACvCO,OAAOC,MAAM,CAACP,SAASK,KAAKL,OAAO;QACnC,KAAK,MAAMQ,UAAUH,KAAKJ,aAAa,CAAEA,cAAcQ,GAAG,CAACD;QAC3DL,YAAYE,KAAKF,SAAS;IAC5B;IACA,OAAOpB,WAAW;QAChBU,SAASL,KAAKK,OAAO;QACrBiB,gBAAgBtB,KAAKsB,cAAc;QACnCC,MAAMvB,KAAKuB,IAAI;QACfC,YAAYxB,KAAKwB,UAAU;QAC3BjB,SAASP,KAAKO,OAAO;QACrBkB,eAAezB,KAAKyB,aAAa;QACjCC,OAAOzB,OAAO0B,UAAU;QACxBC,gBAAgB5B,KAAK4B,cAAc,IAAI;QACvCC,gBAAgB5B,OAAOK,SAAS;QAChCwB,oBAAoB9B,KAAK8B,kBAAkB;QAC3CrB;QACAC;QACAG,eAAe;eAAIA;SAAc,CAACkB,IAAI;QACtCpB;QACAC;IACF;AACF"}
|
package/dist/change-set.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-set.d.ts","sourceRoot":"","sources":["../src/change-set.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"change-set.d.ts","sourceRoot":"","sources":["../src/change-set.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAU,KAAK,GAAG,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,EAAE,CAAC;IACvB,KAAK,EAAE,SAAS,GAAG,EAAE,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvE,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;IACrC,MAAM,EAAE,SAAS;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACrD,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;IACnC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC,CAAC;AAmBF,wBAAgB,SAAS,CACvB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,OAAO,GAAG,IAAI,EACtB,KAAK,EAAE,OAAO,GAAG,IAAI,EACrB,OAAO,GAAE;IACP,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;CAClB,GACL,SAAS,CAiDX;AAED,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,SAAS,aAAa,EAAE,EAClC,aAAa,EAAE,SAAS,MAAM,EAAE,GAC/B,SAAS,CAUX;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE,GAAG,SAAS,CAUrE"}
|
package/dist/change-set.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sameChange } from './overlay.js';
|
|
1
2
|
import { beneath } from './paths.js';
|
|
2
3
|
import { compositionOf } from './replica.js';
|
|
3
4
|
import { rowsOf } from './rows.js';
|
|
@@ -5,7 +6,7 @@ function rowsAt(locator, replica, path) {
|
|
|
5
6
|
const document = replica?.visible.collection.documents[path];
|
|
6
7
|
if (replica === null) return [];
|
|
7
8
|
if (document === undefined && !replica.visible.binaryTargets.includes(path)) return [];
|
|
8
|
-
return rowsOf(locator, path, document ?? null, compositionOf(replica.confirmed.record));
|
|
9
|
+
return rowsOf(locator, path, document ?? null, compositionOf(replica.confirmed.record), replica.visible.changes[path] ?? null);
|
|
9
10
|
}
|
|
10
11
|
function modelShape(model) {
|
|
11
12
|
return model.status === 'unavailable' ? 'unavailable' : JSON.stringify(model.types);
|
|
@@ -26,7 +27,7 @@ export function changeSet(locator, before, after, changed = {}) {
|
|
|
26
27
|
const selected = newRoom?.typedSelection?.roots.some((root)=>beneath(root, path)) ?? false;
|
|
27
28
|
const inCollection = newRoom !== undefined && (newRoom.collectionRoot === '' || beneath(newRoom.collectionRoot, path));
|
|
28
29
|
const retyped = selected ? selectionChanged : inCollection && collectionChanged;
|
|
29
|
-
if (before?.visible.documents[path] === after?.visible.documents[path] && before?.visible.binaryTargets.includes(path) === after?.visible.binaryTargets.includes(path) && before?.visible.revisions[path] === after?.visible.revisions[path] && !retyped) continue;
|
|
30
|
+
if (before?.visible.documents[path] === after?.visible.documents[path] && before?.visible.binaryTargets.includes(path) === after?.visible.binaryTargets.includes(path) && before?.visible.revisions[path] === after?.visible.revisions[path] && sameChange(before?.visible.changes[path], after?.visible.changes[path]) && !retyped) continue;
|
|
30
31
|
documents.push({
|
|
31
32
|
locator,
|
|
32
33
|
path,
|
package/dist/change-set.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/workspace/packages/mdruntime/src/change-set.ts"],"sourcesContent":["import { beneath } from './paths.js';\nimport { compositionOf, type Replica } from './replica.js';\nimport { rowsOf, type Row } from './rows.js';\n\nexport type DocumentChange = {\n locator: string;\n path: string;\n before: readonly Row[];\n after: readonly Row[];\n};\n\nexport type MessageChange = { conversation: string; identity: string };\n\nexport type ChangeSet = {\n documents: readonly DocumentChange[];\n drafts: readonly { locator: string; path: string }[];\n rooms: readonly string[];\n queues: readonly string[];\n presentations: readonly string[];\n messages: readonly MessageChange[];\n conversations: readonly string[];\n};\n\nfunction rowsAt(locator: string, replica: Replica | null, path: string): readonly Row[] {\n const document = replica?.visible.collection.documents[path];\n if (replica === null) return [];\n if (document === undefined && !replica.visible.binaryTargets.includes(path)) return [];\n return rowsOf(locator
|
|
1
|
+
{"version":3,"sources":["/workspace/packages/mdruntime/src/change-set.ts"],"sourcesContent":["import { sameChange } from './overlay.js';\nimport { beneath } from './paths.js';\nimport { compositionOf, type Replica } from './replica.js';\nimport { rowsOf, type Row } from './rows.js';\n\nexport type DocumentChange = {\n locator: string;\n path: string;\n before: readonly Row[];\n after: readonly Row[];\n};\n\nexport type MessageChange = { conversation: string; identity: string };\n\nexport type ChangeSet = {\n documents: readonly DocumentChange[];\n drafts: readonly { locator: string; path: string }[];\n rooms: readonly string[];\n queues: readonly string[];\n presentations: readonly string[];\n messages: readonly MessageChange[];\n conversations: readonly string[];\n};\n\nfunction rowsAt(locator: string, replica: Replica | null, path: string): readonly Row[] {\n const document = replica?.visible.collection.documents[path];\n if (replica === null) return [];\n if (document === undefined && !replica.visible.binaryTargets.includes(path)) return [];\n return rowsOf(\n locator,\n path,\n document ?? null,\n compositionOf(replica.confirmed.record),\n replica.visible.changes[path] ?? null,\n );\n}\n\nfunction modelShape(model: Replica['confirmed']['record']['model']): string {\n return model.status === 'unavailable' ? 'unavailable' : JSON.stringify(model.types);\n}\n\nexport function changeSet(\n locator: string,\n before: Replica | null,\n after: Replica | null,\n changed: {\n drafts?: readonly string[];\n room?: boolean;\n queue?: boolean;\n presentation?: string;\n } = {},\n): ChangeSet {\n const paths = new Set([\n ...Object.keys(before?.visible.documents ?? {}),\n ...Object.keys(after?.visible.documents ?? {}),\n ...(before?.visible.binaryTargets ?? []),\n ...(after?.visible.binaryTargets ?? []),\n ]);\n const documents: DocumentChange[] = [];\n const oldRoom = before?.confirmed.record;\n const newRoom = after?.confirmed.record;\n const collectionChanged =\n oldRoom !== undefined &&\n newRoom !== undefined &&\n modelShape(oldRoom.model) !== modelShape(newRoom.model);\n const selectionChanged =\n oldRoom !== undefined &&\n newRoom !== undefined &&\n modelShape(oldRoom.selectionModel) !== modelShape(newRoom.selectionModel);\n for (const path of paths) {\n const selected = newRoom?.typedSelection?.roots.some((root) => beneath(root, path)) ?? false;\n const inCollection =\n newRoom !== undefined &&\n (newRoom.collectionRoot === '' || beneath(newRoom.collectionRoot, path));\n const retyped = selected ? selectionChanged : inCollection && collectionChanged;\n if (\n before?.visible.documents[path] === after?.visible.documents[path] &&\n before?.visible.binaryTargets.includes(path) ===\n after?.visible.binaryTargets.includes(path) &&\n before?.visible.revisions[path] === after?.visible.revisions[path] &&\n sameChange(before?.visible.changes[path], after?.visible.changes[path]) &&\n !retyped\n )\n continue;\n documents.push({\n locator,\n path,\n before: rowsAt(locator, before, path),\n after: rowsAt(locator, after, path),\n });\n }\n return {\n documents,\n drafts: (changed.drafts ?? []).map((path) => ({ locator, path })),\n rooms: changed.room ? [locator] : [],\n queues: changed.queue ? [locator] : [],\n presentations: changed.presentation === undefined ? [] : [changed.presentation],\n messages: [],\n conversations: [],\n };\n}\n\nexport function conversationChangeSet(\n messages: readonly MessageChange[],\n conversations: readonly string[],\n): ChangeSet {\n return {\n documents: [],\n drafts: [],\n rooms: [],\n queues: [],\n presentations: [],\n messages,\n conversations: [...new Set(conversations)],\n };\n}\n\nexport function mergeChangeSets(sets: readonly ChangeSet[]): ChangeSet {\n return {\n documents: sets.flatMap((set) => set.documents),\n drafts: sets.flatMap((set) => set.drafts),\n rooms: [...new Set(sets.flatMap((set) => set.rooms))],\n queues: [...new Set(sets.flatMap((set) => set.queues))],\n presentations: [...new Set(sets.flatMap((set) => set.presentations))],\n messages: sets.flatMap((set) => set.messages),\n conversations: [...new Set(sets.flatMap((set) => set.conversations))],\n };\n}\n"],"names":["sameChange","beneath","compositionOf","rowsOf","rowsAt","locator","replica","path","document","visible","collection","documents","undefined","binaryTargets","includes","confirmed","record","changes","modelShape","model","status","JSON","stringify","types","changeSet","before","after","changed","paths","Set","Object","keys","oldRoom","newRoom","collectionChanged","selectionChanged","selectionModel","selected","typedSelection","roots","some","root","inCollection","collectionRoot","retyped","revisions","push","drafts","map","rooms","room","queues","queue","presentations","presentation","messages","conversations","conversationChangeSet","mergeChangeSets","sets","flatMap","set"],"mappings":"AAAA,SAASA,UAAU,QAAQ,eAAe;AAC1C,SAASC,OAAO,QAAQ,aAAa;AACrC,SAASC,aAAa,QAAsB,eAAe;AAC3D,SAASC,MAAM,QAAkB,YAAY;AAqB7C,SAASC,OAAOC,OAAe,EAAEC,OAAuB,EAAEC,IAAY;IACpE,MAAMC,WAAWF,SAASG,QAAQC,WAAWC,SAAS,CAACJ,KAAK;IAC5D,IAAID,YAAY,MAAM,OAAO,EAAE;IAC/B,IAAIE,aAAaI,aAAa,CAACN,QAAQG,OAAO,CAACI,aAAa,CAACC,QAAQ,CAACP,OAAO,OAAO,EAAE;IACtF,OAAOJ,OACLE,SACAE,MACAC,YAAY,MACZN,cAAcI,QAAQS,SAAS,CAACC,MAAM,GACtCV,QAAQG,OAAO,CAACQ,OAAO,CAACV,KAAK,IAAI;AAErC;AAEA,SAASW,WAAWC,KAA8C;IAChE,OAAOA,MAAMC,MAAM,KAAK,gBAAgB,gBAAgBC,KAAKC,SAAS,CAACH,MAAMI,KAAK;AACpF;AAEA,OAAO,SAASC,UACdnB,OAAe,EACfoB,MAAsB,EACtBC,KAAqB,EACrBC,UAKI,CAAC,CAAC;IAEN,MAAMC,QAAQ,IAAIC,IAAI;WACjBC,OAAOC,IAAI,CAACN,QAAQhB,QAAQE,aAAa,CAAC;WAC1CmB,OAAOC,IAAI,CAACL,OAAOjB,QAAQE,aAAa,CAAC;WACxCc,QAAQhB,QAAQI,iBAAiB,EAAE;WACnCa,OAAOjB,QAAQI,iBAAiB,EAAE;KACvC;IACD,MAAMF,YAA8B,EAAE;IACtC,MAAMqB,UAAUP,QAAQV,UAAUC;IAClC,MAA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QyB,KAAK,GAAG;YAAC/C;SAAQ,GAAG,EAAE;QACtCgD,eAAe1B,QAAQ2B,YAAY,KAAK1C,YAAY,EAAE,GAAG;YAACe,QAAQ2B,YAAY;SAAC;QAC/EC,UAAU,EAAE;QACZC,eAAe,EAAE;IACnB;AACF;AAEA,OAAO,SAASC,sBACdF,QAAkC,EAClCC,aAAgC;IAEhC,OAAO;QACL7C,WAAW,EAAE;QACboC,QAAQ,EAAE;QACVE,OAAO,EAAE;QACTE,QAAQ,EAAE;QACVE,eAAe,EAAE;QACjBE;QACAC,eAAe;eAAI,IAAI3B,IAAI2B;SAAe;IAC5C;AACF;AAEA,OAAO,SAASE,gBAAgBC,IAA0B;IACxD,OAAO;QACLhD,WAAWgD,KAAKC,OAAO,CAAC,CAACC,MAAQA,IAAIlD,SAAS;QAC9CoC,QAAQY,KAAKC,OAAO,CAAC,CAACC,MAAQA,IAAId,MAAM;QACxCE,OAAO;eAAI,IAAIpB,IAAI8B,KAAKC,OAAO,CAAC,CAACC,MAAQA,IAAIZ,KAAK;SAAG;QACrDE,QAAQ;eAAI,IAAItB,IAAI8B,KAAKC,OAAO,CAAC,CAACC,MAAQA,IAAIV,MAAM;SAAG;QACvDE,eAAe;eAAI,IAAIxB,IAAI8B,KAAKC,OAAO,CAAC,CAACC,MAAQA,IAAIR,aAAa;SAAG;QACrEE,UAAUI,KAAKC,OAAO,CAAC,CAACC,MAAQA,IAAIN,QAAQ;QAC5CC,eAAe;eAAI,IAAI3B,IAAI8B,KAAKC,OAAO,CAAC,CAACC,MAAQA,IAAIL,aAAa;SAAG;IACvE;AACF"}
|
package/dist/client.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export type MdRuntimeClient = {
|
|
|
48
48
|
};
|
|
49
49
|
history(locator: string, path: string, query?: HistoryQuery): Promise<HistoryResult>;
|
|
50
50
|
call(name: string, input: unknown): Promise<CallResult>;
|
|
51
|
+
reached(locator: string, roomVersion: string): Promise<boolean>;
|
|
51
52
|
log(): Promise<string>;
|
|
52
53
|
storageLoss(): Promise<string | null>;
|
|
53
54
|
persistence(): Promise<boolean>;
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,cAAc,EACd,UAAU,EACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EACV,SAAS,EACT,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAY,KAAK,WAAW,EAAiB,MAAM,kBAAkB,CAAC;AAC7E,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzF,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAOL,KAAK,WAAW,EAIjB,MAAM,WAAW,CAAC;AAEnB,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,IAAI,OAAO,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC;IACrC,KAAK,IAAI,OAAO,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC;IACrC,KAAK,EAAE;QACL,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;QAChD,CAAC,KAAK,EAAE,UAAU,GA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C,OAAO,CAAC,CAAC,CAAC;QACvD,CACE,KAAK,EAAE,cAAc,EACrB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC;KAC3C,CAAC;IACF,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,GAAG,eAAe,CAwLnE;AAED,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/client.js
CHANGED
|
@@ -220,6 +220,10 @@ export function connectMdRuntime(port) {
|
|
|
220
220
|
name,
|
|
221
221
|
input
|
|
222
222
|
]),
|
|
223
|
+
reached: (locator, roomVersion)=>ask('reached', [
|
|
224
|
+
locator,
|
|
225
|
+
roomVersion
|
|
226
|
+
]),
|
|
223
227
|
log: ()=>ask('log', []),
|
|
224
228
|
storageLoss: ()=>ask('storageLoss', []),
|
|
225
229
|
persistence: ()=>ask('persistence', []),
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/workspace/packages/mdruntime/src/client.ts"],"sourcesContent":["import type {\n AppRoom,\n AppSlot,\n ConnectionRefusal,\n HistoryQuery,\n RoomTypes,\n SavedRoomDraft,\n SaveResult,\n} from './connection.js';\nimport type { HistoryResult, ServiceMode } from './adapter.js';\nimport type {\n ChatDraft,\n ConversationEntry,\n ConversationOptions,\n ConversationView,\n} from './conversation.js';\nimport { observed, type Observation, type Observed } from './observation.js';\nimport type { CallResult, QueueEntry, SubmissionOutcome } from './outcome.js';\nimport type { DocumentQuery, DocumentResult, GroupQuery, GroupResult } from './query.js';\nimport type { RoomDraft, RoomDraftParts, RoomDraftWrite } from './room-draft.js';\nimport type { SearchRequest, SearchResult } from './search.js';\nimport type { SyncStatus } from './status.js';\nimport {\n answer,\n AUTHORIZATION_ENDED,\n carried,\n envelope,\n PORT_CLOSED,\n PROTOCOL_MISMATCH,\n type RuntimePort,\n type WireMember,\n type WireRequest,\n type WireTopic,\n} from './wire.js';\n\nexport type MdRuntimeClient = {\n rooms(): Promise<readonly AppRoom[]>;\n slots(): Promise<readonly AppSlot[]>;\n query: {\n (query: DocumentQuery): Promise<DocumentResult>;\n (query: GroupQuery): Promise<GroupResult>;\n };\n search(request: SearchRequest): Promise<SearchResult>;\n types(locator: string): Promise<RoomTypes>;\n syncStatus(): Promise<SyncStatus>;\n serviceMode(): Promise<ServiceMode>;\n roomDraft: {\n list(): Promise<readonly RoomDraft[]>;\n read(room: string, path: string): Promise<RoomDraft | null>;\n write(\n room: string,\n path: string,\n revision: string | null,\n parts: RoomDraftParts,\n ): Promise<RoomDraftWrite>;\n discard(room: string, path: string, revision: string): Promise<RoomDraftWrite>;\n };\n save(room: string, roomDrafts: readonly SavedRoomDraft[]): Promise<SaveResult>;\n outcome(identifier: string): Promise<SubmissionOutcome | null>;\n presentation: {\n read(): Promise<unknown>;\n write(value: unknown): Promise<void>;\n };\n conversation: {\n list(): Promise<readonly ConversationEntry[]>;\n read(conversation: string, options?: ConversationOptions): Promise<ConversationView>;\n create(input: unknown): Promise<CallResult>;\n send(conversation: string): Promise<CallResult>;\n answer(conversation: string, answer: unknown): Promise<CallResult>;\n interrupt(conversation: string): Promise<CallResult>;\n kill(conversation: string): Promise<CallResult>;\n cancel(conversation: string, turn: string): Promise<CallResult>;\n delete(conversation: string): Promise<CallResult>;\n };\n chatDraft: {\n write(conversation: string, draft: ChatDraft): Promise<void>;\n discard(conversation: string): Promise<void>;\n };\n history(locator: string, path: string, query?: HistoryQuery): Promise<HistoryResult>;\n call(name: string, input: unknown): Promise<CallResult>;\n log(): Promise<string>;\n storageLoss(): Promise<string | null>;\n persistence(): Promise<boolean>;\n deploymentFacts(): Promise<unknown>;\n observe: {\n (topic: 'deployment-facts'): Promise<Observation<unknown>>;\n (topic: 'rooms'): Promise<Observation<readonly AppRoom[]>>;\n (topic: 'connection-refusal'): Promise<Observation<ConnectionRefusal | null>>;\n (topic: 'storage-loss'): Promise<Observation<string | null>>;\n (topic: 'sync-status'): Promise<Observation<SyncStatus>>;\n (topic: 'service-mode'): Promise<Observation<ServiceMode>>;\n (topic: 'query', query: DocumentQuery): Promise<Observation<DocumentResult>>;\n (topic: 'query', query: GroupQuery): Promise<Observation<GroupResult>>;\n (topic: 'queue', locator: string): Promise<Observation<readonly QueueEntry[]>>;\n (topic: 'room-drafts'): Promise<Observation<readonly RoomDraft[]>>;\n (topic: 'presentation'): Promise<Observation<unknown>>;\n (\n topic: 'conversation',\n conversation: string,\n options: ConversationOptions,\n ): Promise<Observation<ConversationView>>;\n };\n reauthorize(): Promise<void>;\n};\n\nexport function connectMdRuntime(port: RuntimePort): MdRuntimeClient {\n let sequence = 0;\n let refusal: ConnectionRefusal | null = null;\n let ended: string | null = null;\n const calls = new Map<\n number,\n { settle: (value: unknown) => void; fail: (error: Error) => void }\n >();\n const opening = new Map<\n number,\n {\n topic: WireTopic;\n settle: (observation: Observation<unknown>) => void;\n fail: (error: Error) => void;\n }\n >();\n const observations = new Map<number, { topic: WireTopic; handle: Observed }>();\n\n const send = (message: WireRequest) => {\n port.postMessage(envelope(message));\n };\n\n function begin(id: number, topic: WireTopic, first: unknown): Observation<unknown> {\n const handle = observed(\n first,\n () => {\n observations.delete(id);\n if (refusal === null) send({ kind: 'stop', id });\n },\n topic === 'query',\n );\n observations.set(id, { topic, handle });\n return handle.observation;\n }\n\n function refuse(reported: ConnectionRefusal) {\n refusal = reported;\n for (const { topic, handle } of observations.values()) {\n if (topic === 'connection-refusal') handle.receive(reported);\n }\n const failure = new Error(reported.reason);\n for (const [id, waiting] of opening) {\n if (waiting.topic === 'connection-refusal')\n waiting.settle(begin(id, waiting.topic, reported));\n else waiting.fail(failure);\n }\n opening.clear();\n for (const waiting of calls.values()) waiting.fail(failure);\n calls.clear();\n }\n\n function end(reason: string) {\n if (ended !== null) return;\n ended = reason;\n const failure = new Error(reason);\n for (const waiting of opening.values()) waiting.fail(failure);\n opening.clear();\n for (const waiting of calls.values()) waiting.fail(failure);\n calls.clear();\n for (const { handle } of observations.values()) handle.end();\n observations.clear();\n }\n\n port.addEventListener('message', (event) => {\n const wire = carried(event.data);\n if (wire === null) return;\n if (!wire.matching) {\n refuse(PROTOCOL_MISMATCH);\n return;\n }\n const message = answer(wire.message);\n if (message === null) return;\n if (message.kind === 'refusal') {\n refuse(message.refusal);\n return;\n }\n if (message.kind === 'ended') {\n end(AUTHORIZATION_ENDED);\n return;\n }\n if (message.kind === 'event') {\n observations.get(message.id)?.handle.receive(message.value);\n return;\n }\n const waiting = opening.get(message.id);\n if (waiting !== undefined) {\n opening.delete(message.id);\n if (message.kind === 'failure') waiting.fail(new Error(message.message));\n else waiting.settle(begin(message.id, waiting.topic, message.value));\n return;\n }\n const called = calls.get(message.id);\n if (called === undefined) return;\n calls.delete(message.id);\n if (message.kind === 'failure') called.fail(new Error(message.message));\n else called.settle(message.value);\n });\n port.addEventListener('close', () => {\n end(PORT_CLOSED);\n });\n port.start();\n send({ kind: 'hello' });\n\n function ask<T>(member: WireMember, input: readonly unknown[]): Promise<T> {\n if (ended !== null) return Promise.reject(new Error(ended));\n if (refusal !== null) return Promise.reject(new Error(refusal.reason));\n const id = (sequence += 1);\n return new Promise<T>((settle, fail) => {\n calls.set(id, { settle: settle as (value: unknown) => void, fail });\n send({ kind: 'call', id, member, input });\n });\n }\n\n function watch(topic: WireTopic, input: readonly unknown[]): Promise<Observation<unknown>> {\n if (ended !== null) return Promise.reject(new Error(ended));\n const id = (sequence += 1);\n if (refusal !== null) {\n return topic === 'connection-refusal'\n ? Promise.resolve(begin(id, topic, refusal))\n : Promise.reject(new Error(refusal.reason));\n }\n return new Promise((settle, fail) => {\n opening.set(id, { topic, settle, fail });\n send({ kind: 'observe', id, topic, input });\n });\n }\n\n return {\n rooms: () => ask<readonly AppRoom[]>('rooms', []),\n slots: () => ask<readonly AppSlot[]>('slots', []),\n query: ((query: DocumentQuery | GroupQuery) =>\n ask('query', [query])) as MdRuntimeClient['query'],\n search: (request: SearchRequest) => ask<SearchResult>('search', [request]),\n types: (locator: string) => ask<RoomTypes>('types', [locator]),\n syncStatus: () => ask<SyncStatus>('syncStatus', []),\n serviceMode: () => ask<ServiceMode>('serviceMode', []),\n roomDraft: {\n list: () => ask<readonly RoomDraft[]>('roomDraft.list', []),\n read: (room: string, path: string) => ask<RoomDraft | null>('roomDraft.read', [room, path]),\n write: (room: string, path: string, revision: string | null, parts: RoomDraftParts) =>\n ask<RoomDraftWrite>('roomDraft.write', [room, path, revision, parts]),\n discard: (room: string, path: string, revision: string) =>\n ask<RoomDraftWrite>('roomDraft.discard', [room, path, revision]),\n },\n save: (room: string, roomDrafts: readonly SavedRoomDraft[]) =>\n ask<SaveResult>('save', [room, roomDrafts]),\n outcome: (identifier: string) => ask<SubmissionOutcome | null>('outcome', [identifier]),\n presentation: {\n read: () => ask<unknown>('presentation.read', []),\n write: (value: unknown) => ask<void>('presentation.write', [value]),\n },\n conversation: {\n list: () => ask<readonly ConversationEntry[]>('conversation.list', []),\n read: (conversation: string, options?: ConversationOptions) =>\n ask<ConversationView>('conversation.read', [conversation, options]),\n create: (input: unknown) => ask<CallResult>('conversation.create', [input]),\n send: (conversation: string) => ask<CallResult>('conversation.send', [conversation]),\n answer: (conversation: string, answer: unknown) =>\n ask<CallResult>('conversation.answer', [conversation, answer]),\n interrupt: (conversation: string) =>\n ask<CallResult>('conversation.interrupt', [conversation]),\n kill: (conversation: string) => ask<CallResult>('conversation.kill', [conversation]),\n cancel: (conversation: string, turn: string) =>\n ask<CallResult>('conversation.cancel', [conversation, turn]),\n delete: (conversation: string) => ask<CallResult>('conversation.delete', [conversation]),\n },\n chatDraft: {\n write: (conversation: string, draft: ChatDraft) =>\n ask<void>('chatDraft.write', [conversation, draft]),\n discard: (conversation: string) => ask<void>('chatDraft.discard', [conversation]),\n },\n history: (locator: string, path: string, query?: HistoryQuery) =>\n ask<HistoryResult>('history', [locator, path, query]),\n call: (name: string, input: unknown) => ask<CallResult>('call', [name, input]),\n log: () => ask<string>('log', []),\n storageLoss: () => ask<string | null>('storageLoss', []),\n persistence: () => ask<boolean>('persistence', []),\n deploymentFacts: () => ask<unknown>('deploymentFacts', []),\n observe: ((topic: WireTopic, ...input: unknown[]) =>\n watch(topic, input)) as MdRuntimeClient['observe'],\n reauthorize: () => ask<void>('reauthorize', []),\n };\n}\n\nexport type { Observation } from './observation.js';\nexport type { RuntimePort } from './wire.js';\n"],"names":["observed","answer","AUTHORIZATION_ENDED","carried","envelope","PORT_CLOSED","PROTOCOL_MISMATCH","connectMdRuntime","port","sequence","refusal","ended","calls","Map","opening","observations","send","message","postMessage","begin","id","topic","first","handle","delete","kind","set","observation","refuse","reported","values","receive","failure","Error","reason","waiting","settle","fail","clear","end","addEventListener","event","wire","data","matching","get","value","undefined","called","start","ask","member","input","Promise","reject","watch","resolve","rooms","slots","query","search","request","types","locator","syncStatus","serviceMode","roomDraft","list","read","room","path","write","revision","parts","discard","save","roomDrafts","outcome","identifier","presentation","conversation","options","create","interrupt","kill","cancel","turn","chatDraft","draft","history","call","name","log","storageLoss","persistence","deploymentFacts","observe","reauthorize"],"mappings":"AAgBA,SAASA,QAAQ,QAAyC,mBAAmB;AAM7E,SACEC,MAAM,EACNC,mBAAmB,EACnBC,OAAO,EACPC,QAAQ,EACRC,WAAW,EACXC,iBAAiB,QAKZ,YAAY;AAwEnB,OAAO,SAASC,iBAAiBC,IAAiB;IAChD,IAAIC,WAAW;IACf,IAAIC,UAAoC;IACxC,IAAIC,QAAuB;IAC3B,MAAMC,QAAQ,IAAIC;IAIlB,MAAMC,UAAU,IAAID;IAQpB,MAAME,eAAe,IAAIF;IAEzB,MAAMG,OAAO,CAACC;QACZT,KAAKU,WAAW,CAACd,SAASa;IAC5B;IAEA,SAASE,MAAMC,EAAU,EAAEC,KAAgB,EAAEC,KAAc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;iBAAa;QAClF;QACAS,SAAS,CAAC1B,SAAiBO,MAAcX,QACvCT,IAAmB,WAAW;gBAACa;gBAASO;gBAAMX;aAAM;QACtD+B,MAAM,CAACC,MAAcvC,QAAmBF,IAAgB,QAAQ;gBAACyC;gBAAMvC;aAAM;QAC7EwC,KAAK,IAAM1C,IAAY,OAAO,EAAE;QAChC2C,aAAa,IAAM3C,IAAmB,eAAe,EAAE;QACvD4C,aAAa,IAAM5C,IAAa,eAAe,EAAE;QACjD6C,iBAAiB,IAAM7C,IAAa,mBAAmB,EAAE;QACzD8C,SAAU,CAAC3E,OAAkB,GAAG+B,QAC9BG,MAAMlC,OAAO+B;QACf6C,aAAa,IAAM/C,IAAU,eAAe,EAAE;IAChD;AACF"}
|
|
1
|
+
{"version":3,"sources":["/workspace/packages/mdruntime/src/client.ts"],"sourcesContent":["import type {\n AppRoom,\n AppSlot,\n ConnectionRefusal,\n HistoryQuery,\n RoomTypes,\n SavedRoomDraft,\n SaveResult,\n} from './connection.js';\nimport type { HistoryResult, ServiceMode } from './adapter.js';\nimport type {\n ChatDraft,\n ConversationEntry,\n ConversationOptions,\n ConversationView,\n} from './conversation.js';\nimport { observed, type Observation, type Observed } from './observation.js';\nimport type { CallResult, QueueEntry, SubmissionOutcome } from './outcome.js';\nimport type { DocumentQuery, DocumentResult, GroupQuery, GroupResult } from './query.js';\nimport type { RoomDraft, RoomDraftParts, RoomDraftWrite } from './room-draft.js';\nimport type { SearchRequest, SearchResult } from './search.js';\nimport type { SyncStatus } from './status.js';\nimport {\n answer,\n AUTHORIZATION_ENDED,\n carried,\n envelope,\n PORT_CLOSED,\n PROTOCOL_MISMATCH,\n type RuntimePort,\n type WireMember,\n type WireRequest,\n type WireTopic,\n} from './wire.js';\n\nexport type MdRuntimeClient = {\n rooms(): Promise<readonly AppRoom[]>;\n slots(): Promise<readonly AppSlot[]>;\n query: {\n (query: DocumentQuery): Promise<DocumentResult>;\n (query: GroupQuery): Promise<GroupResult>;\n };\n search(request: SearchRequest): Promise<SearchResult>;\n types(locator: string): Promise<RoomTypes>;\n syncStatus(): Promise<SyncStatus>;\n serviceMode(): Promise<ServiceMode>;\n roomDraft: {\n list(): Promise<readonly RoomDraft[]>;\n read(room: string, path: string): Promise<RoomDraft | null>;\n write(\n room: string,\n path: string,\n revision: string | null,\n parts: RoomDraftParts,\n ): Promise<RoomDraftWrite>;\n discard(room: string, path: string, revision: string): Promise<RoomDraftWrite>;\n };\n save(room: string, roomDrafts: readonly SavedRoomDraft[]): Promise<SaveResult>;\n outcome(identifier: string): Promise<SubmissionOutcome | null>;\n presentation: {\n read(): Promise<unknown>;\n write(value: unknown): Promise<void>;\n };\n conversation: {\n list(): Promise<readonly ConversationEntry[]>;\n read(conversation: string, options?: ConversationOptions): Promise<ConversationView>;\n create(input: unknown): Promise<CallResult>;\n send(conversation: string): Promise<CallResult>;\n answer(conversation: string, answer: unknown): Promise<CallResult>;\n interrupt(conversation: string): Promise<CallResult>;\n kill(conversation: string): Promise<CallResult>;\n cancel(conversation: string, turn: string): Promise<CallResult>;\n delete(conversation: string): Promise<CallResult>;\n };\n chatDraft: {\n write(conversation: string, draft: ChatDraft): Promise<void>;\n discard(conversation: string): Promise<void>;\n };\n history(locator: string, path: string, query?: HistoryQuery): Promise<HistoryResult>;\n call(name: string, input: unknown): Promise<CallResult>;\n reached(locator: string, roomVersion: string): Promise<boolean>;\n log(): Promise<string>;\n storageLoss(): Promise<string | null>;\n persistence(): Promise<boolean>;\n deploymentFacts(): Promise<unknown>;\n observe: {\n (topic: 'deployment-facts'): Promise<Observation<unknown>>;\n (topic: 'rooms'): Promise<Observation<readonly AppRoom[]>>;\n (topic: 'connection-refusal'): Promise<Observation<ConnectionRefusal | null>>;\n (topic: 'storage-loss'): Promise<Observation<string | null>>;\n (topic: 'sync-status'): Promise<Observation<SyncStatus>>;\n (topic: 'service-mode'): Promise<Observation<ServiceMode>>;\n (topic: 'query', query: DocumentQuery): Promise<Observation<DocumentResult>>;\n (topic: 'query', query: GroupQuery): Promise<Observation<GroupResult>>;\n (topic: 'queue', locator: string): Promise<Observation<readonly QueueEntry[]>>;\n (topic: 'room-drafts'): Promise<Observation<readonly RoomDraft[]>>;\n (topic: 'presentation'): Promise<Observation<unknown>>;\n (\n topic: 'conversation',\n conversation: string,\n options: ConversationOptions,\n ): Promise<Observation<ConversationView>>;\n };\n reauthorize(): Promise<void>;\n};\n\nexport function connectMdRuntime(port: RuntimePort): MdRuntimeClient {\n let sequence = 0;\n let refusal: ConnectionRefusal | null = null;\n let ended: string | null = null;\n const calls = new Map<\n number,\n { settle: (value: unknown) => void; fail: (error: Error) => void }\n >();\n const opening = new Map<\n number,\n {\n topic: WireTopic;\n settle: (observation: Observation<unknown>) => void;\n fail: (error: Error) => void;\n }\n >();\n const observations = new Map<number, { topic: WireTopic; handle: Observed }>();\n\n const send = (message: WireRequest) => {\n port.postMessage(envelope(message));\n };\n\n function begin(id: number, topic: WireTopic, first: unknown): Observation<unknown> {\n const handle = observed(\n first,\n () => {\n observations.delete(id);\n if (refusal === null) send({ kind: 'stop', id });\n },\n topic === 'query',\n );\n observations.set(id, { topic, handle });\n return handle.observation;\n }\n\n function refuse(reported: ConnectionRefusal) {\n refusal = reported;\n for (const { topic, handle } of observations.values()) {\n if (topic === 'connection-refusal') handle.receive(reported);\n }\n const failure = new Error(reported.reason);\n for (const [id, waiting] of opening) {\n if (waiting.topic === 'connection-refusal')\n waiting.settle(begin(id, waiting.topic, reported));\n else waiting.fail(failure);\n }\n opening.clear();\n for (const waiting of calls.values()) waiting.fail(failure);\n calls.clear();\n }\n\n function end(reason: string) {\n if (ended !== null) return;\n ended = reason;\n const failure = new Error(reason);\n for (const waiting of opening.values()) waiting.fail(failure);\n opening.clear();\n for (const waiting of calls.values()) waiting.fail(failure);\n calls.clear();\n for (const { handle } of observations.values()) handle.end();\n observations.clear();\n }\n\n port.addEventListener('message', (event) => {\n const wire = carried(event.data);\n if (wire === null) return;\n if (!wire.matching) {\n refuse(PROTOCOL_MISMATCH);\n return;\n }\n const message = answer(wire.message);\n if (message === null) return;\n if (message.kind === 'refusal') {\n refuse(message.refusal);\n return;\n }\n if (message.kind === 'ended') {\n end(AUTHORIZATION_ENDED);\n return;\n }\n if (message.kind === 'event') {\n observations.get(message.id)?.handle.receive(message.value);\n return;\n }\n const waiting = opening.get(message.id);\n if (waiting !== undefined) {\n opening.delete(message.id);\n if (message.kind === 'failure') waiting.fail(new Error(message.message));\n else waiting.settle(begin(message.id, waiting.topic, message.value));\n return;\n }\n const called = calls.get(message.id);\n if (called === undefined) return;\n calls.delete(message.id);\n if (message.kind === 'failure') called.fail(new Error(message.message));\n else called.settle(message.value);\n });\n port.addEventListener('close', () => {\n end(PORT_CLOSED);\n });\n port.start();\n send({ kind: 'hello' });\n\n function ask<T>(member: WireMember, input: readonly unknown[]): Promise<T> {\n if (ended !== null) return Promise.reject(new Error(ended));\n if (refusal !== null) return Promise.reject(new Error(refusal.reason));\n const id = (sequence += 1);\n return new Promise<T>((settle, fail) => {\n calls.set(id, { settle: settle as (value: unknown) => void, fail });\n send({ kind: 'call', id, member, input });\n });\n }\n\n function watch(topic: WireTopic, input: readonly unknown[]): Promise<Observation<unknown>> {\n if (ended !== null) return Promise.reject(new Error(ended));\n const id = (sequence += 1);\n if (refusal !== null) {\n return topic === 'connection-refusal'\n ? Promise.resolve(begin(id, topic, refusal))\n : Promise.reject(new Error(refusal.reason));\n }\n return new Promise((settle, fail) => {\n opening.set(id, { topic, settle, fail });\n send({ kind: 'observe', id, topic, input });\n });\n }\n\n return {\n rooms: () => ask<readonly AppRoom[]>('rooms', []),\n slots: () => ask<readonly AppSlot[]>('slots', []),\n query: ((query: DocumentQuery | GroupQuery) =>\n ask('query', [query])) as MdRuntimeClient['query'],\n search: (request: SearchRequest) => ask<SearchResult>('search', [request]),\n types: (locator: string) => ask<RoomTypes>('types', [locator]),\n syncStatus: () => ask<SyncStatus>('syncStatus', []),\n serviceMode: () => ask<ServiceMode>('serviceMode', []),\n roomDraft: {\n list: () => ask<readonly RoomDraft[]>('roomDraft.list', []),\n read: (room: string, path: string) => ask<RoomDraft | null>('roomDraft.read', [room, path]),\n write: (room: string, path: string, revision: string | null, parts: RoomDraftParts) =>\n ask<RoomDraftWrite>('roomDraft.write', [room, path, revision, parts]),\n discard: (room: string, path: string, revision: string) =>\n ask<RoomDraftWrite>('roomDraft.discard', [room, path, revision]),\n },\n save: (room: string, roomDrafts: readonly SavedRoomDraft[]) =>\n ask<SaveResult>('save', [room, roomDrafts]),\n outcome: (identifier: string) => ask<SubmissionOutcome | null>('outcome', [identifier]),\n presentation: {\n read: () => ask<unknown>('presentation.read', []),\n write: (value: unknown) => ask<void>('presentation.write', [value]),\n },\n conversation: {\n list: () => ask<readonly ConversationEntry[]>('conversation.list', []),\n read: (conversation: string, options?: ConversationOptions) =>\n ask<ConversationView>('conversation.read', [conversation, options]),\n create: (input: unknown) => ask<CallResult>('conversation.create', [input]),\n send: (conversation: string) => ask<CallResult>('conversation.send', [conversation]),\n answer: (conversation: string, answer: unknown) =>\n ask<CallResult>('conversation.answer', [conversation, answer]),\n interrupt: (conversation: string) =>\n ask<CallResult>('conversation.interrupt', [conversation]),\n kill: (conversation: string) => ask<CallResult>('conversation.kill', [conversation]),\n cancel: (conversation: string, turn: string) =>\n ask<CallResult>('conversation.cancel', [conversation, turn]),\n delete: (conversation: string) => ask<CallResult>('conversation.delete', [conversation]),\n },\n chatDraft: {\n write: (conversation: string, draft: ChatDraft) =>\n ask<void>('chatDraft.write', [conversation, draft]),\n discard: (conversation: string) => ask<void>('chatDraft.discard', [conversation]),\n },\n history: (locator: string, path: string, query?: HistoryQuery) =>\n ask<HistoryResult>('history', [locator, path, query]),\n call: (name: string, input: unknown) => ask<CallResult>('call', [name, input]),\n reached: (locator: string, roomVersion: string) =>\n ask<boolean>('reached', [locator, roomVersion]),\n log: () => ask<string>('log', []),\n storageLoss: () => ask<string | null>('storageLoss', []),\n persistence: () => ask<boolean>('persistence', []),\n deploymentFacts: () => ask<unknown>('deploymentFacts', []),\n observe: ((topic: WireTopic, ...input: unknown[]) =>\n watch(topic, input)) as MdRuntimeClient['observe'],\n reauthorize: () => ask<void>('reauthorize', []),\n };\n}\n\nexport type { Observation } from './observation.js';\nexport type { RuntimePort } from './wire.js';\n"],"names":["observed","answer","AUTHORIZATION_ENDED","carried","envelope","PORT_CLOSED","PROTOCOL_MISMATCH","connectMdRuntime","port","sequence","refusal","ended","calls","Map","opening","observations","send","message","postMessage","begin","id","topic","first","handle","delete","kind","set","observation","refuse","reported","values","receive","failure","Error","reason","waiting","settle","fail","clear","end","addEventListener","event","wire","data","matching","get","value","undefined","called","start","ask","member","input","Promise","reject","watch","resolve","rooms","slots","query","search","request","types","locator","syncStatus","serviceMode","roomDraft","list","read","room","path","write","revision","parts","discard","save","roomDrafts","outcome","identifier","presentation","conversation","options","create","interrupt","kill","cancel","turn","chatDraft","draft","history","call","name","reached","roomVersion","log","storageLoss","persistence","deploymentFacts","observe","reauthorize"],"mappings":"AAgBA,SAASA,QAAQ,QAAyC,mBAAmB;AAM7E,SACEC,MAAM,EACNC,mBAAmB,EACnBC,OAAO,EACPC,QAAQ,EACRC,WAAW,EACXC,iBAAiB,QAKZ,YAAY;AAyEnB,OAAO,SAASC,iBAAiBC,IAAiB;IAChD,IAAIC,WAAW;IACf,IAAIC,UAAoC;IACxC,IAAIC,QAAuB;IAC3B,MAAMC,QAAQ,IAAIC;IAIlB,MAAMC,UAAU,IAAID;IAQpB,MAAME,eAAe,IAAIF;IAEzB,MAAMG,OAAO,CAACC;QACZT,KAAKU,WAAW,CAACd,SAASa;IAC5B;IAEA,SAASE,MAAMC,EAAU,EAAEC,KAAgB,EAAEC,KAAc;QACzD,MAAMC,SAASvB,SACbsB,OACA;YACEP,aAAaS,MAAM,CAACJ;YACpB,IAAIV,YAAY,MAAMM,KAAK;gBAAES,MAAM;gBAAQL;YAAG;QAChD,GACAC,UAAU;QAEZN,aAAaW,GAAG,CAACN,IAAI;YAAEC;YAAOE;Q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AAS,CAAC7B,SAAiB8B,cACzB3C,IAAa,WAAW;gBAACa;gBAAS8B;aAAY;QAChDC,KAAK,IAAM5C,IAAY,OAAO,EAAE;QAChC6C,aAAa,IAAM7C,IAAmB,eAAe,EAAE;QACvD8C,aAAa,IAAM9C,IAAa,eAAe,EAAE;QACjD+C,iBAAiB,IAAM/C,IAAa,mBAAmB,EAAE;QACzDgD,SAAU,CAAC7E,OAAkB,GAAG+B,QAC9BG,MAAMlC,OAAO+B;QACf+C,aAAa,IAAMjD,IAAU,eAAe,EAAE;IAChD;AACF"}
|
package/dist/connection.d.ts
CHANGED
|
@@ -99,6 +99,7 @@ export type MdRuntime = {
|
|
|
99
99
|
outcome(identifier: string): SubmissionOutcome | null;
|
|
100
100
|
history(locator: string, path: string, query?: HistoryQuery): Promise<HistoryResult>;
|
|
101
101
|
call(name: string, input: unknown): Promise<CallResult>;
|
|
102
|
+
reached(locator: string, roomVersion: string): boolean;
|
|
102
103
|
log(): string;
|
|
103
104
|
storageLoss(): string | null;
|
|
104
105
|
persistence(): boolean;
|
package/dist/connection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,WAAW,EAEjB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAIL,KAAK,OAAO,EAEZ,KAAK,aAAa,EAIlB,KAAK,aAAa,
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK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