@agentshouse/mdruntime 0.1.0-alpha.23 → 0.1.0-alpha.24
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 +34 -18
- package/dist/change.d.ts +4 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js.map +1 -1
- package/dist/client.d.ts +9 -12
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +15 -20
- package/dist/client.js.map +1 -1
- package/dist/connection.d.ts +14 -18
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +390 -291
- package/dist/connection.js.map +1 -1
- package/dist/durability.js +1 -1
- package/dist/durability.js.map +1 -1
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +12 -14
- package/dist/host.js.map +1 -1
- package/dist/identity.d.ts +1 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +7 -0
- package/dist/identity.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/outcome.d.ts +17 -20
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +1 -21
- package/dist/outcome.js.map +1 -1
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +1 -1
- package/dist/overlay.js.map +1 -1
- package/dist/replica.d.ts +1 -0
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +54 -0
- package/dist/replica.js.map +1 -1
- package/dist/room-draft.d.ts +124 -0
- package/dist/room-draft.d.ts.map +1 -0
- package/dist/room-draft.js +403 -0
- package/dist/room-draft.js.map +1 -0
- package/dist/save.d.ts +4 -1
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +34 -100
- package/dist/save.js.map +1 -1
- package/dist/status.d.ts +4 -6
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js.map +1 -1
- package/dist/store.d.ts +18 -12
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +43 -34
- package/dist/store.js.map +1 -1
- package/dist/wire.d.ts +3 -3
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +6 -7
- 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, Observe, Types, Draft, Save,
|
|
10
|
+
Rooms, Slots, Query, Observe, Types, Room Draft, Save, History, Call, Log,
|
|
11
11
|
storage loss, the reported persistence answer, deployment facts, Sync Status, reauthorization,
|
|
12
12
|
conversation, the chat draft, and Presentation State.
|
|
13
13
|
|
|
@@ -22,7 +22,7 @@ queued.
|
|
|
22
22
|
Slots answers each Slot the Provider declares, in its order, with its entries
|
|
23
23
|
in order, each a Room and its segment; a Room two Slots list is the same Room.
|
|
24
24
|
|
|
25
|
-
Rooms, Slots, Query, Observe, Types, Draft, and Save never touch the network.
|
|
25
|
+
Rooms, Slots, Query, Observe, Types, Room Draft, and Save never touch the network.
|
|
26
26
|
History and Call go to the Provider through the Adapter. Every member of the
|
|
27
27
|
client is asynchronous. Results are detached snapshots. Nothing in this
|
|
28
28
|
surface returns the authorization, performs a request the App's code
|
|
@@ -36,24 +36,40 @@ owns their boundary.
|
|
|
36
36
|
The in-memory Adapter at `@agentshouse/mdruntime/memory` is for tests and
|
|
37
37
|
ships in no bundle.
|
|
38
38
|
|
|
39
|
-
## Draft, Save, and outcome rules
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
## Room Draft, Save, and outcome rules
|
|
40
|
+
|
|
41
|
+
The MD Runtime owns one Room Draft per Room and Path, shared by every App and
|
|
42
|
+
tab. It is durable: it survives reload and navigation. A Room that Discovery
|
|
43
|
+
stops listing takes its Room Drafts, its queue and their outcomes with it.
|
|
44
|
+
Write a Room Draft with `roomDraft.write(room, path, revision, parts)`, naming
|
|
45
|
+
the revision you read, or `null` when there was none, and every part it should
|
|
46
|
+
now change: fields, sections and the preamble, or the whole Markdown, a
|
|
47
|
+
creation, a move, or a removal. A part new to the Room Draft names its base,
|
|
48
|
+
the value you showed when it was opened; the MD Runtime keeps a part's first
|
|
49
|
+
base. A write or a discard from an older revision is refused as `stale` with
|
|
50
|
+
the current Room Draft; read it and write again.
|
|
51
|
+
|
|
52
|
+
Save takes one Room and the Room Drafts of it to save, each with its revision,
|
|
53
|
+
validates locally, and on success appends one Change Batch to that Room's
|
|
54
|
+
queue and removes those Room Drafts. It is refused as `stale`, as
|
|
55
|
+
`changed-underneath` naming each part whose base no longer matches the visible
|
|
56
|
+
state, or by a local validation rule, and then creates nothing and leaves every
|
|
57
|
+
Room Draft in place. A directory move is a move part on each Document beneath
|
|
58
|
+
it, saved together.
|
|
46
59
|
|
|
47
60
|
Outcomes follow the Provider's answer. Accepted advances the confirmed
|
|
48
|
-
layer. Conflicted and Rejected
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
61
|
+
layer. Conflicted and Rejected, an expired outcome record, and a change that no
|
|
62
|
+
longer applies over the Room each leave the queue and return as Room Drafts on
|
|
63
|
+
the Documents they changed, marked with why: the Provider's structured refusal
|
|
64
|
+
code and fields as returned, not known to have applied, or withdrawn locally.
|
|
65
|
+
The rest of the queue keeps synchronizing, and Sync Status requires attention
|
|
66
|
+
until each returned Room Draft is saved again or discarded. `outcome` answers
|
|
67
|
+
the saved Change Batch's outcome, and `null` while it is Pending. Transport
|
|
68
|
+
failure and Provider unavailability keep work Pending and do not infer a
|
|
69
|
+
rejection. A refusal the Provider marks retryable stays Pending until the reset
|
|
70
|
+
it names; the MD Runtime retries the same Change Batch identity and payload and
|
|
71
|
+
never infers an outcome from transport uncertainty. The MD Runtime never
|
|
72
|
+
combines, reorders, or rebases.
|
|
57
73
|
|
|
58
74
|
## The neutrality rule
|
|
59
75
|
|
package/dist/change.d.ts
CHANGED
|
@@ -17,6 +17,10 @@ export type Change = {
|
|
|
17
17
|
readonly path: string;
|
|
18
18
|
readonly fields: Readonly<Record<string, unknown>>;
|
|
19
19
|
readonly sections: Readonly<Record<string, string>>;
|
|
20
|
+
} | {
|
|
21
|
+
readonly kind: 'create';
|
|
22
|
+
readonly path: string;
|
|
23
|
+
readonly content: string;
|
|
20
24
|
} | {
|
|
21
25
|
readonly kind: 'replace';
|
|
22
26
|
readonly path: string;
|
package/dist/change.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change.d.ts","sourceRoot":"","sources":["../src/change.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GACd;IACE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC5E;IACE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACnD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE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E,UAAU,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC5E;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC/E;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvD,MAAM,MAAM,SAAS,GAAG;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3E,MAAM,MAAM,WAAW,GAAG;IACxB,UAAU,CAAC,EAAE,OAAO,YAAY,EAAE,iBAAiB,CAAC;IACpD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,aAAa,EAAE,SAAS,YAAY,EAAE,CAAC;IAChD,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;CAChC,CAAC;AAUF,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,CAEzD"}
|
package/dist/change.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/workspace/packages/mdruntime/src/change.ts"],"sourcesContent":["export type Change =\n | {\n readonly kind: 'field';\n readonly path: string;\n readonly name: string;\n readonly value: unknown;\n }\n | {\n readonly kind: 'section';\n readonly path: string;\n readonly name: string;\n readonly value: string;\n }\n | { readonly kind: 'preamble'; readonly path: string; readonly value: string }\n | {\n readonly kind: 'create';\n readonly path: string;\n readonly fields: Readonly<Record<string, unknown>>;\n readonly sections: Readonly<Record<string, string>>;\n }\n | { readonly kind: 'replace'; readonly path: string; readonly content: string }\n | { readonly kind: 'move'; readonly path: string; readonly to: string }\n | { readonly kind: 'remove'; readonly path: string };\n\nexport type Precondition =\n | {\n readonly kind: 'field';\n readonly path: string;\n readonly name: string;\n readonly value: unknown;\n }\n | {\n readonly kind: 'section';\n readonly path: string;\n readonly name: string;\n readonly value: string;\n }\n | { readonly kind: 'preamble'; readonly path: string; readonly value: string }\n | { readonly kind: 'revision'; readonly path: string; readonly revision: string }\n | { readonly kind: 'present'; readonly path: string }\n | { readonly kind: 'absent'; readonly path: string };\n\nexport type WrittenBy = { readonly app: string; readonly release: string };\n\nexport type ChangeBatch = {\n validation?: import('./model.js').ValidationReceipt;\n readonly id: string;\n readonly baseRoomVersion: string;\n readonly changes: readonly Change[];\n readonly preconditions: readonly Precondition[];\n readonly writtenBy?: WrittenBy;\n};\n\nfunction frozen<T>(value: T): T {\n if (Array.isArray(value)) return Object.freeze(value.map((item) => frozen(item))) as T;\n if (value === null || typeof value !== 'object') return value;\n const copy: Record<string, unknown> = {};\n for (const [name, item] of Object.entries(value)) copy[name] = frozen(item);\n return Object.freeze(copy) as T;\n}\n\nexport function immutable(batch: ChangeBatch): ChangeBatch {\n return frozen(batch);\n}\n"],"names":["frozen","value","Array","isArray","Object","freeze","map","item","copy","name","entries","immutable","batch"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["/workspace/packages/mdruntime/src/change.ts"],"sourcesContent":["export type Change =\n | {\n readonly kind: 'field';\n readonly path: string;\n readonly name: string;\n readonly value: unknown;\n }\n | {\n readonly kind: 'section';\n readonly path: string;\n readonly name: string;\n readonly value: string;\n }\n | { readonly kind: 'preamble'; readonly path: string; readonly value: string }\n | {\n readonly kind: 'create';\n readonly path: string;\n readonly fields: Readonly<Record<string, unknown>>;\n readonly sections: Readonly<Record<string, string>>;\n }\n | { readonly kind: 'create'; readonly path: string; readonly content: string }\n | { readonly kind: 'replace'; readonly path: string; readonly content: string }\n | { readonly kind: 'move'; readonly path: string; readonly to: string }\n | { readonly kind: 'remove'; readonly path: string };\n\nexport type Precondition =\n | {\n readonly kind: 'field';\n readonly path: string;\n readonly name: string;\n readonly value: unknown;\n }\n | {\n readonly kind: 'section';\n readonly path: string;\n readonly name: string;\n readonly value: string;\n }\n | { readonly kind: 'preamble'; readonly path: string; readonly value: string }\n | { readonly kind: 'revision'; readonly path: string; readonly revision: string }\n | { readonly kind: 'present'; readonly path: string }\n | { readonly kind: 'absent'; readonly path: string };\n\nexport type WrittenBy = { readonly app: string; readonly release: string };\n\nexport type ChangeBatch = {\n validation?: import('./model.js').ValidationReceipt;\n readonly id: string;\n readonly baseRoomVersion: string;\n readonly changes: readonly Change[];\n readonly preconditions: readonly Precondition[];\n readonly writtenBy?: WrittenBy;\n};\n\nfunction frozen<T>(value: T): T {\n if (Array.isArray(value)) return Object.freeze(value.map((item) => frozen(item))) as T;\n if (value === null || typeof value !== 'object') return value;\n const copy: Record<string, unknown> = {};\n for (const [name, item] of Object.entries(value)) copy[name] = frozen(item);\n return Object.freeze(copy) as T;\n}\n\nexport function immutable(batch: ChangeBatch): ChangeBatch {\n return frozen(batch);\n}\n"],"names":["frozen","value","Array","isArray","Object","freeze","map","item","copy","name","entries","immutable","batch"],"mappings":"AAsDA,SAASA,OAAUC,KAAQ;IACzB,IAAIC,MAAMC,OAAO,CAACF,QAAQ,OAAOG,OAAOC,MAAM,CAACJ,MAAMK,GAAG,CAAC,CAACC,OAASP,OAAOO;IAC1E,IAAIN,UAAU,QAAQ,OAAOA,UAAU,UAAU,OAAOA;IACxD,MAAMO,OAAgC,CAAC;IACvC,KAAK,MAAM,CAACC,MAAMF,KAAK,IAAIH,OAAOM,OAAO,CAACT,OAAQO,IAAI,CAACC,KAAK,GAAGT,OAAOO;IACtE,OAAOH,OAAOC,MAAM,CAACG;AACvB;AAEA,OAAO,SAASG,UAAUC,KAAkB;IAC1C,OAAOZ,OAAOY;AAChB"}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { QueryOptions, QueryResult } from '@agentshouse/query';
|
|
2
|
-
import type {
|
|
3
|
-
import type { AppRoom, AppSlot, ConnectionRefusal, DraftEntry, HistoryQuery, RoomTypes, SaveResult } from './connection.js';
|
|
2
|
+
import type { AppRoom, AppSlot, ConnectionRefusal, HistoryQuery, RoomTypes, SavedRoomDraft, SaveResult } from './connection.js';
|
|
4
3
|
import type { HistoryResult } from './adapter.js';
|
|
5
4
|
import type { ChatDraft, ConversationEntry, ConversationOptions, ConversationView } from './conversation.js';
|
|
6
5
|
import type { CallResult, QueueEntry, SubmissionOutcome } from './outcome.js';
|
|
6
|
+
import type { RoomDraft, RoomDraftParts, RoomDraftWrite } from './room-draft.js';
|
|
7
7
|
import type { SyncStatus } from './status.js';
|
|
8
8
|
import { type RuntimePort } from './wire.js';
|
|
9
9
|
export type MdRuntimeClient = {
|
|
@@ -12,17 +12,14 @@ export type MdRuntimeClient = {
|
|
|
12
12
|
query(options?: QueryOptions): Promise<QueryResult>;
|
|
13
13
|
types(locator: string): Promise<RoomTypes>;
|
|
14
14
|
syncStatus(): Promise<SyncStatus>;
|
|
15
|
-
|
|
16
|
-
list(): Promise<readonly
|
|
17
|
-
read(
|
|
18
|
-
|
|
19
|
-
discard(
|
|
15
|
+
roomDraft: {
|
|
16
|
+
list(): Promise<readonly RoomDraft[]>;
|
|
17
|
+
read(room: string, path: string): Promise<RoomDraft | null>;
|
|
18
|
+
write(room: string, path: string, revision: string | null, parts: RoomDraftParts): Promise<RoomDraftWrite>;
|
|
19
|
+
discard(room: string, path: string, revision: string): Promise<RoomDraftWrite>;
|
|
20
20
|
};
|
|
21
|
-
save(
|
|
21
|
+
save(room: string, roomDrafts: readonly SavedRoomDraft[]): Promise<SaveResult>;
|
|
22
22
|
outcome(identifier: string): Promise<SubmissionOutcome | null>;
|
|
23
|
-
queue: {
|
|
24
|
-
discard(locator: string, identifier: string): Promise<void>;
|
|
25
|
-
};
|
|
26
23
|
presentation: {
|
|
27
24
|
read(): Promise<unknown>;
|
|
28
25
|
write(value: unknown): Promise<void>;
|
|
@@ -56,7 +53,7 @@ export type MdRuntimeClient = {
|
|
|
56
53
|
(topic: 'sync-status', listener: (status: SyncStatus) => void): Promise<() => void>;
|
|
57
54
|
(topic: 'query', query: QueryOptions, listener: (result: QueryResult) => void): Promise<() => void>;
|
|
58
55
|
(topic: 'queue', locator: string, listener: (entries: readonly QueueEntry[]) => void): Promise<() => void>;
|
|
59
|
-
(topic: 'drafts', listener: (
|
|
56
|
+
(topic: 'room-drafts', listener: (roomDrafts: readonly RoomDraft[]) => void): Promise<() => void>;
|
|
60
57
|
(topic: 'presentation', listener: (value: unknown) => void): Promise<() => void>;
|
|
61
58
|
(topic: 'conversation', conversation: string, options: ConversationOptions, listener: (view: ConversationView) => void): Promise<() => void>;
|
|
62
59
|
};
|
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,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACpE,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,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EACV,SAAS,EACT,iBAAiB,EACjB,mBAAmB,EACnB,gB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,CAAC,CAAC;QACvB,CACE,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,KAAK,IAAI,GACjD,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;QACvB,CACE,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,KAAK,IAAI,GACnD,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;QACvB,CAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;QACjF,CACE,KAAK,EAAE,cAAc,EACrB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,GACzC,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;KACxB,CAAC;IACF,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,GAAG,eAAe,CA2KnE;AAED,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/client.js
CHANGED
|
@@ -127,36 +127,31 @@ export function connectMdRuntime(port) {
|
|
|
127
127
|
locator
|
|
128
128
|
]),
|
|
129
129
|
syncStatus: ()=>ask('syncStatus', []),
|
|
130
|
-
|
|
131
|
-
list: ()=>ask('
|
|
132
|
-
read: (
|
|
133
|
-
|
|
130
|
+
roomDraft: {
|
|
131
|
+
list: ()=>ask('roomDraft.list', []),
|
|
132
|
+
read: (room, path)=>ask('roomDraft.read', [
|
|
133
|
+
room,
|
|
134
134
|
path
|
|
135
135
|
]),
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
write: (room, path, revision, parts)=>ask('roomDraft.write', [
|
|
137
|
+
room,
|
|
138
138
|
path,
|
|
139
|
-
|
|
139
|
+
revision,
|
|
140
|
+
parts
|
|
140
141
|
]),
|
|
141
|
-
discard: (
|
|
142
|
-
|
|
143
|
-
path
|
|
142
|
+
discard: (room, path, revision)=>ask('roomDraft.discard', [
|
|
143
|
+
room,
|
|
144
|
+
path,
|
|
145
|
+
revision
|
|
144
146
|
])
|
|
145
147
|
},
|
|
146
|
-
save: (
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
replacing
|
|
148
|
+
save: (room, roomDrafts)=>ask('save', [
|
|
149
|
+
room,
|
|
150
|
+
roomDrafts
|
|
150
151
|
]),
|
|
151
152
|
outcome: (identifier)=>ask('outcome', [
|
|
152
153
|
identifier
|
|
153
154
|
]),
|
|
154
|
-
queue: {
|
|
155
|
-
discard: (locator, identifier)=>ask('queue.discard', [
|
|
156
|
-
locator,
|
|
157
|
-
identifier
|
|
158
|
-
])
|
|
159
|
-
},
|
|
160
155
|
presentation: {
|
|
161
156
|
read: ()=>ask('presentation.read', []),
|
|
162
157
|
write: (value)=>ask('presentation.write', [
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/workspace/packages/mdruntime/src/client.ts"],"sourcesContent":["import type { QueryOptions, QueryResult } from '@agentshouse/query';\nimport type { Change } from './change.js';\nimport type {\n AppRoom,\n AppSlot,\n ConnectionRefusal,\n DraftEntry,\n HistoryQuery,\n RoomTypes,\n SaveResult,\n} from './connection.js';\nimport type { HistoryResult } from './adapter.js';\nimport type {\n ChatDraft,\n ConversationEntry,\n ConversationOptions,\n ConversationView,\n} from './conversation.js';\nimport type { CallResult, QueueEntry, SubmissionOutcome } from './outcome.js';\nimport type { SyncStatus } from './status.js';\nimport {\n answer,\n AUTHORIZATION_ENDED,\n carried,\n envelope,\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(options?: QueryOptions): Promise<QueryResult>;\n types(locator: string): Promise<RoomTypes>;\n syncStatus(): Promise<SyncStatus>;\n draft: {\n list(): Promise<readonly DraftEntry[]>;\n read(locator: string, path: string): Promise<unknown>;\n replace(locator: string, path: string, content: unknown): Promise<void>;\n discard(locator: string, path: string): Promise<void>;\n };\n save(locator: string, changes: readonly Change[], replacing?: string): Promise<SaveResult>;\n outcome(identifier: string): Promise<SubmissionOutcome | null>;\n queue: { discard(locator: string, identifier: string): Promise<void> };\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', listener: (value: unknown) => void): Promise<() => void>;\n (topic: 'rooms', listener: (rooms: readonly AppRoom[]) => void): Promise<() => void>;\n (\n topic: 'connection-refusal',\n listener: (refusal: ConnectionRefusal | null) => void,\n ): Promise<() => void>;\n (topic: 'storage-loss', listener: (statement: string | null) => void): Promise<() => void>;\n (topic: 'sync-status', listener: (status: SyncStatus) => void): Promise<() => void>;\n (\n topic: 'query',\n query: QueryOptions,\n listener: (result: QueryResult) => void,\n ): Promise<() => void>;\n (\n topic: 'queue',\n locator: string,\n listener: (entries: readonly QueueEntry[]) => void,\n ): Promise<() => void>;\n (topic: 'drafts', listener: (drafts: readonly DraftEntry[]) => void): Promise<() => void>;\n (topic: 'presentation', listener: (value: unknown) => void): Promise<() => void>;\n (\n topic: 'conversation',\n conversation: string,\n options: ConversationOptions,\n listener: (view: ConversationView) => void,\n ): Promise<() => void>;\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 = false;\n const calls = new Map<\n number,\n { settle: (value: unknown) => void; fail: (error: Error) => void }\n >();\n const acks = new Map<number, { settle: () => void; fail: (error: Error) => void }>();\n const listeners = new Map<number, { topic: WireTopic; notify: (value: unknown) => void }>();\n\n const send = (message: WireRequest) => {\n port.postMessage(envelope(message));\n };\n\n function refuse(reported: ConnectionRefusal) {\n refusal = reported;\n for (const waiting of acks.values()) waiting.settle();\n acks.clear();\n const failure = new Error(reported.reason);\n for (const waiting of calls.values()) waiting.fail(failure);\n calls.clear();\n for (const listener of listeners.values()) {\n if (listener.topic === 'connection-refusal') listener.notify(reported);\n }\n }\n\n function end() {\n ended = true;\n const failure = new Error(AUTHORIZATION_ENDED);\n for (const waiting of acks.values()) waiting.fail(failure);\n acks.clear();\n for (const waiting of calls.values()) waiting.fail(failure);\n calls.clear();\n listeners.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();\n return;\n }\n if (message.kind === 'event') {\n listeners.get(message.id)?.notify(message.value);\n return;\n }\n const subscribing = acks.get(message.id);\n if (subscribing !== undefined) {\n acks.delete(message.id);\n if (message.kind === 'failure') {\n listeners.delete(message.id);\n subscribing.fail(new Error(message.message));\n } else subscribing.settle();\n return;\n }\n const waiting = calls.get(message.id);\n if (waiting === undefined) return;\n calls.delete(message.id);\n if (message.kind === 'failure') waiting.fail(new Error(message.message));\n else waiting.settle(message.value);\n });\n port.start();\n send({ kind: 'hello' });\n\n function ask<T>(member: WireMember, input: readonly unknown[]): Promise<T> {\n if (ended) return Promise.reject(new Error(AUTHORIZATION_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(\n topic: WireTopic,\n input: readonly unknown[],\n notify: (value: unknown) => void,\n ): Promise<() => void> {\n if (ended) return Promise.reject(new Error(AUTHORIZATION_ENDED));\n const id = (sequence += 1);\n listeners.set(id, { topic, notify });\n const end = () => {\n if (!listeners.delete(id)) return;\n if (refusal === null) send({ kind: 'stop', id });\n };\n if (refusal !== null) {\n if (topic === 'connection-refusal') notify(refusal);\n return Promise.resolve(end);\n }\n return new Promise<() => void>((settle, fail) => {\n acks.set(id, { settle: () => settle(end), 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: (options?: QueryOptions) => ask<QueryResult>('query', [options]),\n types: (locator: string) => ask<RoomTypes>('types', [locator]),\n syncStatus: () => ask<SyncStatus>('syncStatus', []),\n draft: {\n list: () => ask<readonly DraftEntry[]>('draft.list', []),\n read: (locator: string, path: string) => ask<unknown>('draft.read', [locator, path]),\n replace: (locator: string, path: string, content: unknown) =>\n ask<void>('draft.replace', [locator, path, content]),\n discard: (locator: string, path: string) => ask<void>('draft.discard', [locator, path]),\n },\n save: (locator: string, changes: readonly Change[], replacing?: string) =>\n ask<SaveResult>('save', [locator, changes, replacing]),\n outcome: (identifier: string) => ask<SubmissionOutcome | null>('outcome', [identifier]),\n queue: {\n discard: (locator: string, identifier: string) =>\n ask<void>('queue.discard', [locator, identifier]),\n },\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(\n topic: WireTopic,\n second: QueryOptions | string | ((value: never) => void),\n third?: ConversationOptions | ((value: never) => void),\n fourth?: (value: never) => void,\n ) {\n if (topic === 'conversation') {\n return watch(topic, [second, third], fourth as (value: unknown) => void);\n }\n const positional = topic === 'query' || topic === 'queue';\n const notify = (positional ? third : second) as (value: unknown) => void;\n return watch(topic, positional ? [second] : [], notify);\n },\n reauthorize: () => ask<void>('reauthorize', []),\n };\n}\n\nexport type { RuntimePort } from './wire.js';\n"],"names":["answer","AUTHORIZATION_ENDED","carried","envelope","PROTOCOL_MISMATCH","connectMdRuntime","port","sequence","refusal","ended","calls","Map","acks","listeners","send","message","postMessage","refuse","reported","waiting","values","settle","clear","failure","Error","reason","fail","listener","topic","notify","end","addEventListener","event","wire","data","matching","kind","get","id","value","subscribing","undefined","delete","start","ask","member","input","Promise","reject","set","watch","resolve","rooms","slots","query","options","types","locator","syncStatus","draft","list","read","path","replace","content","discard","save","changes","replacing","outcome","identifier","queue","presentation","write","conversation","create","interrupt","kill","cancel","turn","chatDraft","history","call","name","log","storageLoss","persistence","deploymentFacts","observe","second","third","fourth","positional","reauthorize"],"mappings":"AAoBA,SACEA,MAAM,EACNC,mBAAmB,EACnBC,OAAO,EACPC,QAAQ,EACRC,iBAAiB,QAKZ,YAAY;AAyEnB,OAAO,SAASC,iBAAiBC,IAAiB;IAChD,IAAIC,WAAW;IACf,IAAIC,UAAoC;IACxC,IAAIC,QAAQ;IACZ,MAAMC,QAAQ,IAAIC;IAIlB,MAAMC,OAAO,IAAID;IACjB,MAAME,YAAY,IAAIF;IAEtB,MAAMG,OAAO,CAACC;QACZT,KAAKU,WAAW,CAACb,SAASY;IAC5B;IAEA,SAASE,OAAOC,QAA2B;QACzCV,UAAUU;QACV,KAAK,MAAMC,WAAWP,KAAKQ,MAAM,GAAID,QAAQE,MAAM;QACnDT,KAAKU,KAAK;QACV,MAAMC,UAAU,IAAIC,MAAMN,SAASO,MAAM;QACzC,KAAK,MAAMN,WAAWT,MAAMU,MAAM,GAAID,QAAQO,IAAI,CAACH;QACnDb,MAAMY,KAAK;QACX,KAAK,MAAMK,YAAYd,UAAUO,MAAM,GAAI;YACzC,IAAIO,SAASC,KAAK,KAAK,sBAAsBD,SAASE,MAAM,CAACX;QAC/D;IACF;IAEA,SAASY;QACPrB,QAAQ;QACR,MAAMc,UAAU,IAAIC,MAAMvB;QAC1B,KAAK,MAAMkB,WAAWP,KAAKQ,MAAM,GAAID,QAAQO,IAAI,CAACH;QAClDX,KAAKU,KAAK;QACV,KAAK,MAAMH,WAAWT,MAAMU,MAAM,GAAID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AcK;iBAAK;YAC7DrC,QAAQ,CAACgC,eAAyB9B,IAAgB,uBAAuB;oBAAC8B;iBAAa;QACzF;QACAM,WAAW;YACTP,OAAO,CAACC,cAAsBf,QAC5Bf,IAAU,mBAAmB;oBAAC8B;oBAAcf;iBAAM;YACpDM,SAAS,CAACS,eAAyB9B,IAAU,qBAAqB;oBAAC8B;iBAAa;QAClF;QACAO,SAAS,CAACxB,SAAiBK,MAAcR,QACvCV,IAAmB,WAAW;gBAACa;gBAASK;gBAAMR;aAAM;QACtD4B,MAAM,CAACC,MAAcrC,QAAmBF,IAAgB,QAAQ;gBAACuC;gBAAMrC;aAAM;QAC7EsC,KAAK,IAAMxC,IAAY,OAAO,EAAE;QAChCyC,aAAa,IAAMzC,IAAmB,eAAe,EAAE;QACvD0C,aAAa,IAAM1C,IAAa,eAAe,EAAE;QACjD2C,iBAAiB,IAAM3C,IAAa,mBAAmB,EAAE;QACzD4C,SACE5D,KAAgB,EAChB6D,MAAwD,EACxDC,KAAsD,EACtDC,MAA+B;YAE/B,IAAI/D,UAAU,gBAAgB;gBAC5B,OAAOsB,MAAMtB,OAAO;oBAAC6D;oBAAQC;iBAAM,EAAEC;YACvC;YACA,MAAMC,aAAahE,UAAU,WAAWA,UAAU;YAClD,MAAMC,SAAU+D,aAAaF,QAAQD;YACrC,OAAOvC,MAAMtB,OAAOgE,aAAa;gBAACH;aAAO,GAAG,EAAE,EAAE5D;QAClD;QACAgE,aAAa,IAAMjD,IAAU,eAAe,EAAE;IAChD;AACF"}
|
|
1
|
+
{"version":3,"sources":["/workspace/packages/mdruntime/src/client.ts"],"sourcesContent":["import type { QueryOptions, QueryResult } from '@agentshouse/query';\nimport type {\n AppRoom,\n AppSlot,\n ConnectionRefusal,\n HistoryQuery,\n RoomTypes,\n SavedRoomDraft,\n SaveResult,\n} from './connection.js';\nimport type { HistoryResult } from './adapter.js';\nimport type {\n ChatDraft,\n ConversationEntry,\n ConversationOptions,\n ConversationView,\n} from './conversation.js';\nimport type { CallResult, QueueEntry, SubmissionOutcome } from './outcome.js';\nimport type { RoomDraft, RoomDraftParts, RoomDraftWrite } from './room-draft.js';\nimport type { SyncStatus } from './status.js';\nimport {\n answer,\n AUTHORIZATION_ENDED,\n carried,\n envelope,\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(options?: QueryOptions): Promise<QueryResult>;\n types(locator: string): Promise<RoomTypes>;\n syncStatus(): Promise<SyncStatus>;\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', listener: (value: unknown) => void): Promise<() => void>;\n (topic: 'rooms', listener: (rooms: readonly AppRoom[]) => void): Promise<() => void>;\n (\n topic: 'connection-refusal',\n listener: (refusal: ConnectionRefusal | null) => void,\n ): Promise<() => void>;\n (topic: 'storage-loss', listener: (statement: string | null) => void): Promise<() => void>;\n (topic: 'sync-status', listener: (status: SyncStatus) => void): Promise<() => void>;\n (\n topic: 'query',\n query: QueryOptions,\n listener: (result: QueryResult) => void,\n ): Promise<() => void>;\n (\n topic: 'queue',\n locator: string,\n listener: (entries: readonly QueueEntry[]) => void,\n ): Promise<() => void>;\n (\n topic: 'room-drafts',\n listener: (roomDrafts: readonly RoomDraft[]) => void,\n ): Promise<() => void>;\n (topic: 'presentation', listener: (value: unknown) => void): Promise<() => void>;\n (\n topic: 'conversation',\n conversation: string,\n options: ConversationOptions,\n listener: (view: ConversationView) => void,\n ): Promise<() => void>;\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 = false;\n const calls = new Map<\n number,\n { settle: (value: unknown) => void; fail: (error: Error) => void }\n >();\n const acks = new Map<number, { settle: () => void; fail: (error: Error) => void }>();\n const listeners = new Map<number, { topic: WireTopic; notify: (value: unknown) => void }>();\n\n const send = (message: WireRequest) => {\n port.postMessage(envelope(message));\n };\n\n function refuse(reported: ConnectionRefusal) {\n refusal = reported;\n for (const waiting of acks.values()) waiting.settle();\n acks.clear();\n const failure = new Error(reported.reason);\n for (const waiting of calls.values()) waiting.fail(failure);\n calls.clear();\n for (const listener of listeners.values()) {\n if (listener.topic === 'connection-refusal') listener.notify(reported);\n }\n }\n\n function end() {\n ended = true;\n const failure = new Error(AUTHORIZATION_ENDED);\n for (const waiting of acks.values()) waiting.fail(failure);\n acks.clear();\n for (const waiting of calls.values()) waiting.fail(failure);\n calls.clear();\n listeners.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();\n return;\n }\n if (message.kind === 'event') {\n listeners.get(message.id)?.notify(message.value);\n return;\n }\n const subscribing = acks.get(message.id);\n if (subscribing !== undefined) {\n acks.delete(message.id);\n if (message.kind === 'failure') {\n listeners.delete(message.id);\n subscribing.fail(new Error(message.message));\n } else subscribing.settle();\n return;\n }\n const waiting = calls.get(message.id);\n if (waiting === undefined) return;\n calls.delete(message.id);\n if (message.kind === 'failure') waiting.fail(new Error(message.message));\n else waiting.settle(message.value);\n });\n port.start();\n send({ kind: 'hello' });\n\n function ask<T>(member: WireMember, input: readonly unknown[]): Promise<T> {\n if (ended) return Promise.reject(new Error(AUTHORIZATION_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(\n topic: WireTopic,\n input: readonly unknown[],\n notify: (value: unknown) => void,\n ): Promise<() => void> {\n if (ended) return Promise.reject(new Error(AUTHORIZATION_ENDED));\n const id = (sequence += 1);\n listeners.set(id, { topic, notify });\n const end = () => {\n if (!listeners.delete(id)) return;\n if (refusal === null) send({ kind: 'stop', id });\n };\n if (refusal !== null) {\n if (topic === 'connection-refusal') notify(refusal);\n return Promise.resolve(end);\n }\n return new Promise<() => void>((settle, fail) => {\n acks.set(id, { settle: () => settle(end), 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: (options?: QueryOptions) => ask<QueryResult>('query', [options]),\n types: (locator: string) => ask<RoomTypes>('types', [locator]),\n syncStatus: () => ask<SyncStatus>('syncStatus', []),\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(\n topic: WireTopic,\n second: QueryOptions | string | ((value: never) => void),\n third?: ConversationOptions | ((value: never) => void),\n fourth?: (value: never) => void,\n ) {\n if (topic === 'conversation') {\n return watch(topic, [second, third], fourth as (value: unknown) => void);\n }\n const positional = topic === 'query' || topic === 'queue';\n const notify = (positional ? third : second) as (value: unknown) => void;\n return watch(topic, positional ? [second] : [], notify);\n },\n reauthorize: () => ask<void>('reauthorize', []),\n };\n}\n\nexport type { RuntimePort } from './wire.js';\n"],"names":["answer","AUTHORIZATION_ENDED","carried","envelope","PROTOCOL_MISMATCH","connectMdRuntime","port","sequence","refusal","ended","calls","Map","acks","listeners","send","message","postMessage","refuse","reported","waiting","values","settle","clear","failure","Error","reason","fail","listener","topic","notify","end","addEventListener","event","wire","data","matching","kind","get","id","value","subscribing","undefined","delete","start","ask","member","input","Promise","reject","set","watch","resolve","rooms","slots","query","options","types","locator","syncStatus","roomDraft","list","read","room","path","write","revision","parts","discard","save","roomDrafts","outcome","identifier","presentation","conversation","create","interrupt","kill","cancel","turn","chatDraft","draft","history","call","name","log","storageLoss","persistence","deploymentFacts","observe","second","third","fourth","positional","reauthorize"],"mappings":"AAoBA,SACEA,MAAM,EACNC,mBAAmB,EACnBC,OAAO,EACPC,QAAQ,EACRC,iBAAiB,QAKZ,YAAY;AAgFnB,OAAO,SAASC,iBAAiBC,IAAiB;IAChD,IAAIC,WAAW;IACf,IAAIC,UAAoC;IACxC,IAAIC,QAAQ;IACZ,MAAMC,QAAQ,IAAIC;IAIlB,MAAMC,OAAO,IAAID;IACjB,MAAME,YAAY,IAAIF;IAEtB,MAAMG,OAAO,CAACC;QACZT,KAAKU,WAAW,CAACb,SAASY;IAC5B;IAEA,SAASE,OAAOC,QAA2B;QACzCV,UAAUU;QACV,KAAK,MAAMC,WAAWP,KAAKQ,MAAM,GAAID,QAAQE,MAAM;QACnDT,KAAKU,KAAK;QACV,MAAMC,UAAU,IAAIC,MAAMN,SAASO,MAAM;QACzC,KAAK,MAAMN,WAAWT,MAAMU,MAAM,GAAID,QAAQO,IAAI,C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CHANGED
|
@@ -3,9 +3,10 @@ import { type TypesResult } from './model.js';
|
|
|
3
3
|
import { type QueryOptions, type QueryResult } from '@agentshouse/query';
|
|
4
4
|
import { type Adapter, type Authorization, type HistoryResult, type ProviderRefusal } from './adapter.js';
|
|
5
5
|
import { type ChatDraftSurface, type ConversationOptions, type ConversationSurface, type ConversationView } from './conversation.js';
|
|
6
|
-
import type {
|
|
7
|
-
import {
|
|
6
|
+
import type { WrittenBy } from './change.js';
|
|
7
|
+
import type { CallResult, QueueEntry, SubmissionOutcome } from './outcome.js';
|
|
8
8
|
import { type SaveRefusal } from './save.js';
|
|
9
|
+
import { type RoomDraft, type RoomDraftWrite } from './room-draft.js';
|
|
9
10
|
import { type SyncStatus } from './status.js';
|
|
10
11
|
import { type RuntimeShell } from './durability.js';
|
|
11
12
|
export type AppTypedSelection = {
|
|
@@ -56,23 +57,19 @@ export type MdRuntimeOptions = {
|
|
|
56
57
|
};
|
|
57
58
|
export type SaveResult = {
|
|
58
59
|
outcome: 'saved';
|
|
59
|
-
|
|
60
|
+
identifier: string;
|
|
60
61
|
} | ({
|
|
61
62
|
outcome: 'refused';
|
|
62
63
|
} & SaveRefusal);
|
|
63
|
-
export type
|
|
64
|
-
readonly locator: string;
|
|
64
|
+
export type SavedRoomDraft = {
|
|
65
65
|
readonly path: string;
|
|
66
|
-
readonly
|
|
66
|
+
readonly revision: string;
|
|
67
67
|
};
|
|
68
|
-
export type
|
|
69
|
-
list(): Promise<readonly
|
|
70
|
-
read(
|
|
71
|
-
|
|
72
|
-
discard(
|
|
73
|
-
};
|
|
74
|
-
export type QueueSurface = {
|
|
75
|
-
discard(locator: string, identifier: string): Promise<void>;
|
|
68
|
+
export type RoomDraftSurface = {
|
|
69
|
+
list(): Promise<readonly RoomDraft[]>;
|
|
70
|
+
read(room: string, path: string): RoomDraft | null;
|
|
71
|
+
write(room: string, path: string, revision: string | null, parts: unknown): Promise<RoomDraftWrite>;
|
|
72
|
+
discard(room: string, path: string, revision: string): Promise<RoomDraftWrite>;
|
|
76
73
|
};
|
|
77
74
|
export type PresentationSurface = {
|
|
78
75
|
read(app: string): Promise<unknown>;
|
|
@@ -89,13 +86,12 @@ export type MdRuntime = {
|
|
|
89
86
|
query(options?: QueryOptions): QueryResult;
|
|
90
87
|
types(locator: string): RoomTypes;
|
|
91
88
|
syncStatus(): SyncStatus;
|
|
92
|
-
|
|
89
|
+
roomDraft: RoomDraftSurface;
|
|
93
90
|
conversation: ConversationSurface;
|
|
94
91
|
chatDraft: ChatDraftSurface;
|
|
95
92
|
presentation: PresentationSurface;
|
|
96
|
-
save(
|
|
93
|
+
save(room: string, roomDrafts: readonly SavedRoomDraft[], writtenBy?: WrittenBy): Promise<SaveResult>;
|
|
97
94
|
outcome(identifier: string): SubmissionOutcome | null;
|
|
98
|
-
queue: QueueSurface;
|
|
99
95
|
history(locator: string, path: string, query?: HistoryQuery): Promise<HistoryResult>;
|
|
100
96
|
call(name: string, input: unknown): Promise<CallResult>;
|
|
101
97
|
log(): string;
|
|
@@ -108,7 +104,7 @@ export type MdRuntime = {
|
|
|
108
104
|
(topic: 'sync-status', listener: (status: SyncStatus) => void): () => void;
|
|
109
105
|
(topic: 'query', query: QueryOptions, listener: (result: QueryResult) => void): () => void;
|
|
110
106
|
(topic: 'queue', locator: string, listener: (entries: readonly QueueEntry[]) => void): () => void;
|
|
111
|
-
(topic: 'drafts', listener: (
|
|
107
|
+
(topic: 'room-drafts', listener: (roomDrafts: readonly RoomDraft[]) => void): () => void;
|
|
112
108
|
(topic: 'presentation', app: string, listener: (value: unknown) => void): () => void;
|
|
113
109
|
(topic: 'conversation', conversation: string, options: ConversationOptions, listener: (view: ConversationView) => void): () => void;
|
|
114
110
|
};
|
package/dist/connection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,YAAY,EAAmB,MAAM,YAAY,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