@agentshouse/mdruntime 0.1.0-cff8ba8fa2542 → 0.1.0-cffcba9cd9c2f
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/README.md +24 -11
- package/dist/acceptance.d.ts +3 -0
- package/dist/acceptance.d.ts.map +1 -0
- package/dist/acceptance.js +309 -0
- package/dist/actions.d.ts +20 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/actions.js +251 -0
- package/dist/adapter.d.ts +195 -88
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +7 -10
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +40 -28
- package/dist/attempt.d.ts +16 -0
- package/dist/attempt.d.ts.map +1 -0
- package/dist/attempt.js +70 -0
- package/dist/binary.d.ts +18 -0
- package/dist/binary.d.ts.map +1 -0
- package/dist/binary.js +8 -0
- package/dist/bootstrap.d.ts +37 -5
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +324 -51
- package/dist/cell.d.ts +6 -0
- package/dist/cell.d.ts.map +1 -0
- package/dist/cell.js +9 -0
- package/dist/chain.d.ts +12 -0
- package/dist/chain.d.ts.map +1 -0
- package/dist/chain.js +64 -0
- package/dist/change-set.d.ts +13 -14
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +17 -56
- package/dist/change.d.ts +46 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +36 -0
- package/dist/chat-types.d.ts +5 -0
- package/dist/chat-types.d.ts.map +1 -0
- package/dist/chat-types.js +13 -0
- package/dist/client.d.ts +56 -18
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +164 -23
- package/dist/collection.d.ts +31 -14
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +61 -55
- package/dist/compile.d.ts +16 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +711 -0
- package/dist/connection.d.ts +8 -103
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +103 -2076
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +7 -0
- package/dist/conversation-live.d.ts +135 -0
- package/dist/conversation-live.d.ts.map +1 -0
- package/dist/conversation-live.js +247 -0
- package/dist/conversation-row.d.ts +33 -0
- package/dist/conversation-row.d.ts.map +1 -0
- package/dist/conversation-row.js +53 -0
- package/dist/conversation.d.ts +67 -44
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +1010 -549
- package/dist/declaration.d.ts +10 -0
- package/dist/declaration.d.ts.map +1 -0
- package/dist/declaration.js +24 -0
- package/dist/digest.d.ts +7 -0
- package/dist/digest.d.ts.map +1 -0
- package/dist/digest.js +113 -0
- package/dist/discovery.d.ts +10 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +177 -0
- package/dist/durability.d.ts +19 -1
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +5 -0
- package/dist/entry.d.ts +20 -0
- package/dist/entry.d.ts.map +1 -0
- package/dist/entry.js +161 -0
- package/dist/expectation.d.ts +23 -0
- package/dist/expectation.d.ts.map +1 -0
- package/dist/expectation.js +92 -0
- package/dist/failure.d.ts +14 -0
- package/dist/failure.d.ts.map +1 -0
- package/dist/failure.js +22 -0
- package/dist/figures.d.ts +49 -0
- package/dist/figures.d.ts.map +1 -0
- package/dist/figures.js +197 -0
- package/dist/file.d.ts +2 -19
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +7 -122
- package/dist/holdings.d.ts +29 -0
- package/dist/holdings.d.ts.map +1 -0
- package/dist/holdings.js +95 -0
- package/dist/host.d.ts +28 -3
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +149 -26
- package/dist/identity.d.ts +3 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +13 -1
- package/dist/index.d.ts +39 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -0
- package/dist/install.d.ts +55 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +543 -0
- package/dist/job.d.ts +5 -0
- package/dist/job.d.ts.map +1 -0
- package/dist/job.js +7 -0
- package/dist/lifecycle.d.ts +7 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle.js +271 -0
- package/dist/listing.d.ts +52 -0
- package/dist/listing.d.ts.map +1 -0
- package/dist/listing.js +168 -0
- package/dist/live.d.ts +23 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/live.js +165 -0
- package/dist/locks.d.ts +9 -0
- package/dist/locks.d.ts.map +1 -0
- package/dist/locks.js +62 -0
- package/dist/log.d.ts +1 -0
- package/dist/log.d.ts.map +1 -1
- package/dist/lost.d.ts +5 -0
- package/dist/lost.d.ts.map +1 -0
- package/dist/lost.js +61 -0
- package/dist/media.d.ts +8 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +218 -0
- package/dist/memory.d.ts +25 -8
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +296 -93
- package/dist/messages.d.ts +49 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/messages.js +148 -0
- package/dist/model.d.ts +16 -9
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +9 -15
- package/dist/models.d.ts +10 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +170 -0
- package/dist/name.d.ts +4 -0
- package/dist/name.d.ts.map +1 -0
- package/dist/name.js +122 -0
- package/dist/observation.d.ts +22 -4
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +127 -26
- package/dist/open.d.ts +2 -0
- package/dist/open.d.ts.map +1 -0
- package/dist/open.js +1 -0
- package/dist/opened.d.ts +22 -0
- package/dist/opened.d.ts.map +1 -0
- package/dist/opened.js +107 -0
- package/dist/opening.d.ts +4 -0
- package/dist/opening.d.ts.map +1 -0
- package/dist/opening.js +59 -0
- package/dist/outcome.d.ts +75 -5
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +84 -1
- package/dist/overlay.d.ts +17 -5
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +168 -190
- package/dist/parts.d.ts +11 -0
- package/dist/parts.d.ts.map +1 -0
- package/dist/parts.js +21 -0
- package/dist/paths.d.ts +2 -1
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +26 -16
- package/dist/preparation.d.ts +20 -0
- package/dist/preparation.d.ts.map +1 -0
- package/dist/preparation.js +233 -0
- package/dist/queries.d.ts +16 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +272 -0
- package/dist/query.d.ts +51 -181
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +3 -431
- package/dist/questions.d.ts +34 -0
- package/dist/questions.d.ts.map +1 -0
- package/dist/questions.js +122 -0
- package/dist/queue.d.ts +32 -0
- package/dist/queue.d.ts.map +1 -0
- package/dist/queue.js +402 -0
- package/dist/reach.d.ts +21 -5
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +306 -96
- package/dist/react.d.ts +43 -19
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +22 -21
- package/dist/read.d.ts +7 -0
- package/dist/read.d.ts.map +1 -0
- package/dist/read.js +17 -0
- package/dist/readiness.d.ts +49 -0
- package/dist/readiness.d.ts.map +1 -0
- package/dist/readiness.js +27 -0
- package/dist/reads.d.ts +37 -0
- package/dist/reads.d.ts.map +1 -0
- package/dist/reads.js +174 -0
- package/dist/recovery.d.ts +26 -0
- package/dist/recovery.d.ts.map +1 -0
- package/dist/recovery.js +232 -0
- package/dist/refresh.d.ts +20 -7
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +155 -59
- package/dist/refusal.d.ts +5 -0
- package/dist/refusal.d.ts.map +1 -0
- package/dist/refusal.js +57 -0
- package/dist/replica.d.ts +53 -33
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +361 -164
- package/dist/room-draft.d.ts +59 -12
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +299 -90
- package/dist/room-drafts.d.ts +24 -0
- package/dist/room-drafts.d.ts.map +1 -0
- package/dist/room-drafts.js +217 -0
- package/dist/rows.d.ts +32 -34
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +67 -87
- package/dist/runtime.d.ts +32 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +1 -0
- package/dist/save.d.ts +74 -5
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +914 -188
- package/dist/saves.d.ts +32 -0
- package/dist/saves.d.ts.map +1 -0
- package/dist/saves.js +679 -0
- package/dist/search.d.ts +15 -54
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +10 -121
- package/dist/seed.d.ts +25 -0
- package/dist/seed.d.ts.map +1 -0
- package/dist/seed.js +145 -0
- package/dist/shared.d.ts +10 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +339 -0
- package/dist/shown.d.ts +32 -0
- package/dist/shown.d.ts.map +1 -0
- package/dist/shown.js +299 -0
- package/dist/socket/admission.d.ts +7 -0
- package/dist/socket/admission.d.ts.map +1 -0
- package/dist/socket/admission.js +39 -0
- package/dist/socket/answers.d.ts +6 -0
- package/dist/socket/answers.d.ts.map +1 -0
- package/dist/socket/answers.js +20 -0
- package/dist/socket/lanes.d.ts +20 -0
- package/dist/socket/lanes.d.ts.map +1 -0
- package/dist/socket/lanes.js +77 -0
- package/dist/socket/reads.d.ts +10 -0
- package/dist/socket/reads.d.ts.map +1 -0
- package/dist/socket/reads.js +31 -0
- package/dist/socket/rooms.d.ts +41 -0
- package/dist/socket/rooms.d.ts.map +1 -0
- package/dist/socket/rooms.js +90 -0
- package/dist/socket/session.d.ts +38 -0
- package/dist/socket/session.d.ts.map +1 -0
- package/dist/socket/session.js +23 -0
- package/dist/socket.d.ts +69 -0
- package/dist/socket.d.ts.map +1 -0
- package/dist/socket.js +175 -0
- package/dist/source.d.ts +61 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +82 -0
- package/dist/status.d.ts +7 -4
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +3 -15
- package/dist/store/fences.d.ts +16 -0
- package/dist/store/fences.d.ts.map +1 -0
- package/dist/store/fences.js +26 -0
- package/dist/store/installs.d.ts +30 -0
- package/dist/store/installs.d.ts.map +1 -0
- package/dist/store/installs.js +34 -0
- package/dist/store/readiness.d.ts +10 -0
- package/dist/store/readiness.d.ts.map +1 -0
- package/dist/store/readiness.js +52 -0
- package/dist/store/records.d.ts +210 -0
- package/dist/store/records.d.ts.map +1 -0
- package/dist/store/records.js +428 -0
- package/dist/store/room-held.d.ts +8 -0
- package/dist/store/room-held.d.ts.map +1 -0
- package/dist/store/room-held.js +17 -0
- package/dist/store/space.d.ts +11 -0
- package/dist/store/space.d.ts.map +1 -0
- package/dist/store/space.js +41 -0
- package/dist/store/watchers.d.ts +17 -0
- package/dist/store/watchers.d.ts.map +1 -0
- package/dist/store/watchers.js +56 -0
- package/dist/store/writes.d.ts +24 -0
- package/dist/store/writes.d.ts.map +1 -0
- package/dist/store/writes.js +125 -0
- package/dist/store.d.ts +106 -92
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +142 -385
- package/dist/stored.d.ts +156 -0
- package/dist/stored.d.ts.map +1 -0
- package/dist/stored.js +649 -0
- package/dist/surface.d.ts +88 -0
- package/dist/surface.d.ts.map +1 -0
- package/dist/surface.js +224 -0
- package/dist/sync.d.ts +19 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +530 -0
- package/dist/tables.d.ts +412 -0
- package/dist/tables.d.ts.map +1 -0
- package/dist/tables.js +737 -0
- package/dist/tallies.d.ts +18 -0
- package/dist/tallies.d.ts.map +1 -0
- package/dist/tallies.js +129 -0
- package/dist/transfer.d.ts +0 -5
- package/dist/transfer.d.ts.map +1 -1
- package/dist/turn.d.ts +9 -0
- package/dist/turn.d.ts.map +1 -0
- package/dist/turn.js +75 -0
- package/dist/validation.d.ts +29 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +104 -0
- package/dist/windows.d.ts +11 -0
- package/dist/windows.d.ts.map +1 -0
- package/dist/windows.js +16 -0
- package/dist/wire.d.ts +189 -37
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +77 -33
- package/package.json +27 -15
- package/AGENTS.md +0 -231
- package/dist/attachment.d.ts +0 -3
- package/dist/attachment.d.ts.map +0 -1
- package/dist/attachment.js +0 -8
- package/dist/read-side.d.ts +0 -18
- package/dist/read-side.d.ts.map +0 -1
- package/dist/read-side.js +0 -377
package/dist/host.d.ts
CHANGED
|
@@ -1,19 +1,44 @@
|
|
|
1
1
|
import { type MdRuntimeOptions } from './connection.js';
|
|
2
2
|
import type { PortReach } from './reach.js';
|
|
3
|
+
import type { CodeAvailability, Persistence, Readiness } from './readiness.js';
|
|
4
|
+
import type { EntrySeed } from './seed.js';
|
|
5
|
+
import { type CallResult } from './outcome.js';
|
|
3
6
|
import { type RuntimePort } from './wire.js';
|
|
4
7
|
export type MdRuntimeHostOptions = MdRuntimeOptions & {
|
|
5
8
|
deploymentFacts?: unknown;
|
|
6
9
|
};
|
|
10
|
+
export type Admitted = {
|
|
11
|
+
readonly admitted: unknown;
|
|
12
|
+
} | {
|
|
13
|
+
readonly refused: CallResult;
|
|
14
|
+
};
|
|
15
|
+
export type ActionAdmission = (name: string, input: unknown) => Promise<Admitted>;
|
|
16
|
+
export type AttachOptions = {
|
|
17
|
+
readonly app: string;
|
|
18
|
+
readonly release?: string;
|
|
19
|
+
readonly reach?: PortReach;
|
|
20
|
+
readonly admission?: ActionAdmission;
|
|
21
|
+
readonly code?: CodeAvailability;
|
|
22
|
+
};
|
|
7
23
|
export type AttachedPort = {
|
|
8
24
|
detach(): void;
|
|
9
25
|
narrow(reach: PortReach): void;
|
|
26
|
+
readiness(deliver: (readiness: Readiness) => void): () => void;
|
|
27
|
+
answered(queries: readonly unknown[], done: () => void): void;
|
|
10
28
|
};
|
|
11
29
|
export type MdRuntimeHost = {
|
|
12
|
-
attach(port: RuntimePort,
|
|
13
|
-
|
|
30
|
+
attach(port: RuntimePort, options: AttachOptions): AttachedPort;
|
|
31
|
+
present(app: string, members: Readonly<Record<string, unknown>>): Promise<void>;
|
|
32
|
+
seed(entry: EntrySeed): void;
|
|
33
|
+
persisted(answer: Persistence): void;
|
|
34
|
+
endAuthorization(holder?: string): Promise<void>;
|
|
14
35
|
stop(): Promise<void>;
|
|
15
36
|
};
|
|
16
37
|
export declare function serveMdRuntime(options: MdRuntimeHostOptions): MdRuntimeHost;
|
|
38
|
+
export { entrySeedOf, type EntrySeed } from './seed.js';
|
|
17
39
|
export type { PortReach, ReachedDocument } from './reach.js';
|
|
18
|
-
export type {
|
|
40
|
+
export type { CodeAvailability, Persistence, Space } from './readiness.js';
|
|
41
|
+
export { createRecovery, retryDelay, type Attempt, type Attempted, type AttemptOptions, type Recovery, type RecoveryOptions, } from './recovery.js';
|
|
42
|
+
export { undeclared } from './outcome.js';
|
|
43
|
+
export { wireAnswer, wireRequest, type RuntimePort, type WireAnswer, type WireRequest, } from './wire.js';
|
|
19
44
|
//# sourceMappingURL=host.d.ts.map
|
package/dist/host.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAEL,KAAK,WAAW,EAQjB,MAAM,WAAW,CAAC;AAInB,MAAM,MAAM,oBAAoB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,IAAI,CAAC;IAC7B,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IACrC,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB,CAAC;AAsIF,wBAAgB,cAAc,CAAC,OAAO,EAAE,oBAAoB,GAAG,aAAa,CA4L3E;AAED,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACxD,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7D,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EACL,cAAc,EACd,UAAU,EACV,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,UAAU,EACV,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,WAAW,CAAC"}
|
package/dist/host.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { queryKey } from '@agentshouse/mdmodel';
|
|
2
|
+
import { composeRuntime } from './connection.js';
|
|
3
|
+
import { untilAnswered } from './recovery.js';
|
|
4
|
+
import { described } from './failure.js';
|
|
5
|
+
import { answeredResult } from './outcome.js';
|
|
6
|
+
import { AUTHORIZATION_ENDED, WIRE, wireRequest, } from './wire.js';
|
|
4
7
|
const NARROWED = new Set(['within', 'whole']);
|
|
5
8
|
function answered(md, app, writtenBy, member, input) {
|
|
6
9
|
switch (member) {
|
|
@@ -14,16 +17,40 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
14
17
|
return md.types(input[0]);
|
|
15
18
|
case 'save':
|
|
16
19
|
return md.save(input[0], input[1], writtenBy);
|
|
20
|
+
case 'saveParts':
|
|
21
|
+
return md.saveParts(input[0], input[1], writtenBy);
|
|
17
22
|
case 'history':
|
|
18
23
|
return md.history(input[0], input[1], input[2]);
|
|
24
|
+
case 'resolve':
|
|
25
|
+
return md.resolve(input[0], input[1], input[2]);
|
|
26
|
+
case 'binaryFile.read':
|
|
27
|
+
return md.binaryFile.read(input[0], input[1], input[2]);
|
|
28
|
+
case 'binaryFile.link':
|
|
29
|
+
return md.binaryFile.link(input[0], input[1], input[2]);
|
|
30
|
+
case 'binaryFile.show':
|
|
31
|
+
return md.binaryFile.show(input[0], input[1], input[2]);
|
|
32
|
+
case 'binaryFile.attach':
|
|
33
|
+
return md.binaryFile.attach(input[0], input[1]);
|
|
34
|
+
case 'binaryFile.part':
|
|
35
|
+
return md.binaryFile.part(input[0], input[1]);
|
|
19
36
|
case 'call':
|
|
20
37
|
return md.call(input[0], input[1]);
|
|
21
38
|
case 'reached':
|
|
22
39
|
return md.reached(input[0], input[1], input[2]);
|
|
23
40
|
case 'log':
|
|
24
41
|
return md.log();
|
|
42
|
+
case 'cleanUp':
|
|
43
|
+
return md.cleanUp();
|
|
44
|
+
case 'unsent':
|
|
45
|
+
return md.unsent();
|
|
46
|
+
case 'reset':
|
|
47
|
+
return md.reset();
|
|
48
|
+
case 'readAgain':
|
|
49
|
+
return md.readAgain();
|
|
25
50
|
case 'persistence':
|
|
26
51
|
return md.persistence();
|
|
52
|
+
case 'retry':
|
|
53
|
+
return md.retry();
|
|
27
54
|
case 'reauthorize':
|
|
28
55
|
return md.reauthorize();
|
|
29
56
|
case 'roomDraft.list':
|
|
@@ -31,13 +58,15 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
31
58
|
case 'roomDraft.read':
|
|
32
59
|
return md.roomDraft.read(input[0], input[1]);
|
|
33
60
|
case 'roomDraft.write':
|
|
34
|
-
return md.roomDraft.write(input[0], input[1], input[2], input[3]);
|
|
61
|
+
return md.roomDraft.write(input[0], input[1], input[2], input[3], input[4]);
|
|
35
62
|
case 'roomDraft.discard':
|
|
36
63
|
return md.roomDraft.discard(input[0], input[1], input[2]);
|
|
37
64
|
case 'presentation.read':
|
|
38
65
|
return md.presentation.read(app);
|
|
39
66
|
case 'presentation.write':
|
|
40
67
|
return md.presentation.write(app, input[0]);
|
|
68
|
+
case 'presentation.edit':
|
|
69
|
+
return md.presentation.edit(app, input[0]);
|
|
41
70
|
case 'conversation.list':
|
|
42
71
|
return md.conversation.list();
|
|
43
72
|
case 'conversation.read':
|
|
@@ -45,23 +74,36 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
45
74
|
case 'conversation.create':
|
|
46
75
|
return md.conversation.create(input[0]);
|
|
47
76
|
case 'conversation.send':
|
|
48
|
-
return md.conversation.send(input[0]);
|
|
77
|
+
return md.conversation.send(input[0], input[1], input[2]);
|
|
49
78
|
case 'conversation.answer':
|
|
50
79
|
return md.conversation.answer(input[0], input[1]);
|
|
51
80
|
case 'conversation.interrupt':
|
|
52
81
|
return md.conversation.interrupt(input[0]);
|
|
53
82
|
case 'conversation.kill':
|
|
54
83
|
return md.conversation.kill(input[0]);
|
|
55
|
-
case 'conversation.cancel':
|
|
56
|
-
return md.conversation.cancel(input[0], input[1]);
|
|
57
84
|
case 'conversation.delete':
|
|
58
85
|
return md.conversation.delete(input[0]);
|
|
59
86
|
case 'chatDraft.write':
|
|
60
|
-
return md.chatDraft.write(input[0], input[1]);
|
|
87
|
+
return md.chatDraft.write(input[0], input[1], input[2]);
|
|
88
|
+
case 'chatDraft.prepend':
|
|
89
|
+
return md.chatDraft.prepend(input[0], input[1]);
|
|
61
90
|
case 'chatDraft.discard':
|
|
62
91
|
return md.chatDraft.discard(input[0]);
|
|
63
92
|
}
|
|
64
93
|
}
|
|
94
|
+
function attempted(work) {
|
|
95
|
+
try {
|
|
96
|
+
return Promise.resolve(work());
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
return Promise.reject(error);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function answeredMessage(value) {
|
|
103
|
+
if (typeof value !== 'object' || value === null)
|
|
104
|
+
return false;
|
|
105
|
+
return !('result' in value) || answeredResult(value.result);
|
|
106
|
+
}
|
|
65
107
|
export function serveMdRuntime(options) {
|
|
66
108
|
const deploymentFacts = structuredClone(options.deploymentFacts);
|
|
67
109
|
const closing = new AbortController();
|
|
@@ -75,17 +117,31 @@ export function serveMdRuntime(options) {
|
|
|
75
117
|
const { md } = runtime;
|
|
76
118
|
const attachments = new Map();
|
|
77
119
|
let authorized = true;
|
|
120
|
+
let opening = null;
|
|
121
|
+
const opened = () => (opening ??= untilAnswered(() => md.loaded(), closing.signal));
|
|
78
122
|
const watchFacts = (deliver) => {
|
|
79
123
|
deliver(structuredClone(deploymentFacts));
|
|
80
124
|
return () => { };
|
|
81
125
|
};
|
|
82
|
-
function attach(port,
|
|
126
|
+
function attach(port, options) {
|
|
83
127
|
if (!authorized)
|
|
84
128
|
throw new Error(AUTHORIZATION_ENDED);
|
|
129
|
+
const { app, release, reach, admission, code = 'stored' } = options;
|
|
85
130
|
const writtenBy = release === undefined ? undefined : { app, release };
|
|
86
|
-
const view = runtime.within(reach ?? null);
|
|
131
|
+
const view = runtime.within(reach ?? null, { target: app, code });
|
|
87
132
|
const observations = new Map();
|
|
133
|
+
const followed = new Set();
|
|
134
|
+
const answeredKeys = new Set();
|
|
135
|
+
let awaited = null;
|
|
88
136
|
let serving = true;
|
|
137
|
+
const answeredQuery = (query) => {
|
|
138
|
+
answeredKeys.add(queryKey(query));
|
|
139
|
+
if (awaited === null || !awaited.keys.every((key) => answeredKeys.has(key)))
|
|
140
|
+
return;
|
|
141
|
+
const { done } = awaited;
|
|
142
|
+
awaited = null;
|
|
143
|
+
done();
|
|
144
|
+
};
|
|
89
145
|
const send = (message) => {
|
|
90
146
|
port.postMessage(message);
|
|
91
147
|
};
|
|
@@ -96,6 +152,8 @@ export function serveMdRuntime(options) {
|
|
|
96
152
|
for (const end of observations.values())
|
|
97
153
|
end();
|
|
98
154
|
observations.clear();
|
|
155
|
+
for (const end of [...followed])
|
|
156
|
+
end();
|
|
99
157
|
attachments.delete(detach);
|
|
100
158
|
};
|
|
101
159
|
const observe = (id, topic, input) => {
|
|
@@ -105,11 +163,43 @@ export function serveMdRuntime(options) {
|
|
|
105
163
|
return;
|
|
106
164
|
send(resolved ? { kind: 'event', id, value } : { kind: 'result', id, value });
|
|
107
165
|
resolved = true;
|
|
166
|
+
if (topic === 'query' && answeredMessage(value))
|
|
167
|
+
answeredQuery(input[0]);
|
|
168
|
+
};
|
|
169
|
+
const fail = (error) => {
|
|
170
|
+
if (!serving || resolved)
|
|
171
|
+
return;
|
|
172
|
+
observations.get(id)?.();
|
|
173
|
+
observations.delete(id);
|
|
174
|
+
send({ kind: 'failure', id, ...described(error) });
|
|
108
175
|
};
|
|
109
176
|
observations.set(id, topic === 'deployment-facts'
|
|
110
177
|
? watchFacts(deliver)
|
|
111
|
-
: (NARROWED.has(
|
|
178
|
+
: (NARROWED.has(WIRE.topics[topic]) ? view : runtime).watch(topic, topic === 'presentation' ? [app] : input, deliver, fail));
|
|
179
|
+
};
|
|
180
|
+
const reply = async (id, query, pending) => {
|
|
181
|
+
try {
|
|
182
|
+
const value = await pending;
|
|
183
|
+
if (!serving)
|
|
184
|
+
return;
|
|
185
|
+
send({ kind: 'result', id, value });
|
|
186
|
+
if (query !== undefined && answeredResult(value))
|
|
187
|
+
answeredQuery(query);
|
|
188
|
+
}
|
|
189
|
+
catch (error) {
|
|
190
|
+
if (serving)
|
|
191
|
+
send({ kind: 'failure', id, ...described(error) });
|
|
192
|
+
}
|
|
112
193
|
};
|
|
194
|
+
const admitted = admission === undefined
|
|
195
|
+
? view.md
|
|
196
|
+
: {
|
|
197
|
+
...view.md,
|
|
198
|
+
async call(name, input) {
|
|
199
|
+
const decided = await admission(name, input);
|
|
200
|
+
return 'refused' in decided ? decided.refused : view.md.call(name, decided.admitted);
|
|
201
|
+
},
|
|
202
|
+
};
|
|
113
203
|
const serve = async (message) => {
|
|
114
204
|
if (message.kind === 'hello')
|
|
115
205
|
return;
|
|
@@ -119,31 +209,29 @@ export function serveMdRuntime(options) {
|
|
|
119
209
|
return;
|
|
120
210
|
}
|
|
121
211
|
try {
|
|
122
|
-
if (message.kind !== 'observe'
|
|
212
|
+
if (message.kind !== 'observe')
|
|
123
213
|
await md.loaded();
|
|
214
|
+
else if (message.topic !== 'room-drafts')
|
|
215
|
+
await opened();
|
|
124
216
|
if (message.kind === 'observe') {
|
|
125
217
|
if (serving)
|
|
126
218
|
observe(message.id, message.topic, message.input);
|
|
127
219
|
return;
|
|
128
220
|
}
|
|
129
|
-
const value = await answered(NARROWED.has(WIRE_REACH.members[message.member]) ? view.md : md, app, writtenBy, message.member, message.input);
|
|
130
|
-
if (serving)
|
|
131
|
-
send({ kind: 'result', id: message.id, value });
|
|
132
221
|
}
|
|
133
222
|
catch (error) {
|
|
134
|
-
if (serving)
|
|
135
|
-
send({
|
|
136
|
-
|
|
137
|
-
id: message.id,
|
|
138
|
-
message: error instanceof Error ? error.message : String(error),
|
|
139
|
-
});
|
|
140
|
-
}
|
|
223
|
+
if (serving)
|
|
224
|
+
send({ kind: 'failure', id: message.id, ...described(error) });
|
|
225
|
+
return;
|
|
141
226
|
}
|
|
227
|
+
const { id, member, input } = message;
|
|
228
|
+
const pending = attempted(() => answered(NARROWED.has(WIRE.members[member].reach) ? admitted : md, app, writtenBy, member, input));
|
|
229
|
+
return reply(id, member === 'query' ? input[0] : undefined, pending);
|
|
142
230
|
};
|
|
143
231
|
port.addEventListener('message', (event) => {
|
|
144
232
|
if (!serving)
|
|
145
233
|
return;
|
|
146
|
-
const message =
|
|
234
|
+
const message = wireRequest(event.data);
|
|
147
235
|
if (message === null)
|
|
148
236
|
return;
|
|
149
237
|
void serve(message);
|
|
@@ -157,22 +245,57 @@ export function serveMdRuntime(options) {
|
|
|
157
245
|
if (serving)
|
|
158
246
|
view.narrow(next);
|
|
159
247
|
},
|
|
248
|
+
answered(queries, done) {
|
|
249
|
+
const keys = queries.map(queryKey);
|
|
250
|
+
if (keys.every((key) => answeredKeys.has(key)))
|
|
251
|
+
done();
|
|
252
|
+
else
|
|
253
|
+
awaited = { keys, done };
|
|
254
|
+
},
|
|
255
|
+
readiness(deliver) {
|
|
256
|
+
if (!serving)
|
|
257
|
+
return () => { };
|
|
258
|
+
const stop = view.watch('readiness', [], (value) => {
|
|
259
|
+
if (serving)
|
|
260
|
+
deliver(value);
|
|
261
|
+
}, () => { });
|
|
262
|
+
const end = () => {
|
|
263
|
+
followed.delete(end);
|
|
264
|
+
stop();
|
|
265
|
+
};
|
|
266
|
+
followed.add(end);
|
|
267
|
+
return end;
|
|
268
|
+
},
|
|
160
269
|
};
|
|
161
270
|
}
|
|
162
271
|
return {
|
|
163
272
|
attach,
|
|
164
|
-
|
|
273
|
+
present(app, members) {
|
|
274
|
+
return md.presentation.edit(app, members);
|
|
275
|
+
},
|
|
276
|
+
seed(entry) {
|
|
277
|
+
runtime.seed(entry);
|
|
278
|
+
},
|
|
279
|
+
persisted(answer) {
|
|
280
|
+
runtime.persisted(answer);
|
|
281
|
+
},
|
|
282
|
+
async endAuthorization(holder) {
|
|
165
283
|
authorized = false;
|
|
166
284
|
for (const [detach, send] of [...attachments]) {
|
|
167
285
|
send({ kind: 'ended' });
|
|
168
286
|
detach();
|
|
169
287
|
}
|
|
170
288
|
close();
|
|
171
|
-
await
|
|
172
|
-
|
|
289
|
+
if (!(await options.database.ask({ kind: 'authored.end', holder: holder ?? null }))) {
|
|
290
|
+
await options.shell.dropGeneration();
|
|
291
|
+
}
|
|
173
292
|
},
|
|
174
293
|
stop() {
|
|
175
294
|
return runtime.stop();
|
|
176
295
|
},
|
|
177
296
|
};
|
|
178
297
|
}
|
|
298
|
+
export { entrySeedOf } from './seed.js';
|
|
299
|
+
export { createRecovery, retryDelay, } from './recovery.js';
|
|
300
|
+
export { undeclared } from './outcome.js';
|
|
301
|
+
export { wireAnswer, wireRequest, } from './wire.js';
|
package/dist/identity.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export declare function changeBatchIdentity(at?: number): string;
|
|
2
2
|
export declare function roomDraftRevision(): string;
|
|
3
|
+
export declare function chatDraftRevision(): string;
|
|
4
|
+
export declare function transferIdentity(): string;
|
|
5
|
+
export declare function binaryLocalId(): string;
|
|
3
6
|
//# sourceMappingURL=identity.d.ts.map
|
package/dist/identity.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,EAAE,GAAE,MAAmB,GAAG,MAAM,CAWnE;AAED,wBAAgB,iBAAiB,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,EAAE,GAAE,MAAmB,GAAG,MAAM,CAWnE;AAQD,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
|
package/dist/identity.js
CHANGED
|
@@ -10,8 +10,20 @@ export function changeBatchIdentity(at = Date.now()) {
|
|
|
10
10
|
const hex = [...bytes].map((byte) => byte.toString(16).padStart(2, '0')).join('');
|
|
11
11
|
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
function randomIdentity() {
|
|
14
14
|
const bytes = new Uint8Array(16);
|
|
15
15
|
crypto.getRandomValues(bytes);
|
|
16
16
|
return [...bytes].map((byte) => byte.toString(16).padStart(2, '0')).join('');
|
|
17
17
|
}
|
|
18
|
+
export function roomDraftRevision() {
|
|
19
|
+
return randomIdentity();
|
|
20
|
+
}
|
|
21
|
+
export function chatDraftRevision() {
|
|
22
|
+
return randomIdentity();
|
|
23
|
+
}
|
|
24
|
+
export function transferIdentity() {
|
|
25
|
+
return randomIdentity();
|
|
26
|
+
}
|
|
27
|
+
export function binaryLocalId() {
|
|
28
|
+
return randomIdentity();
|
|
29
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,46 @@
|
|
|
1
|
-
export type { AcceptedMessage, ActionDeclaration, ActionRequest, ActionResult, Adapter, AdapterFailure, Authorization, BootstrapPage, BootstrapRequest, BootstrapResult, Capability, ChangeAuthor, ContractUnavailable, ConversationAction,
|
|
2
|
-
export type { Change, ChangeBatch, Precondition, WrittenBy } from './change.js';
|
|
3
|
-
export
|
|
4
|
-
export type {
|
|
5
|
-
export type {
|
|
1
|
+
export type { AcceptedMessage, AcceptedRoom, ActionDeclaration, ActionRequest, ActionResult, Adapter, AdapterFailure, AttachRequest, AttachResult, AuthorityChange, Authorization, BinaryFile, BinaryLinkResult, BinaryRequest, BinaryResult, BootstrapPage, BootstrapRequest, BootstrapResult, Capability, ChangeAuthor, ContractUnavailable, ConversationAction, ConversationEvent, ConversationHistories, ConversationHistoryPage, ConversationHistoryRequest, ConversationMessage, ConversationStream, DiscoverResult, DiscoveredRoom, Discovery, SavedFacts, HistoryAuthor, HistoryRequest, HistoryResult, HistoryRetention, HistoryRevision, BootstrapPart, NotReady, HeldRoom, ListedAgent, ListedConversation, MdModelIdentity, Member, MutationRequest, MutationResult, PageToken, ProviderLimit, ProviderRefusal, RefreshPage, RefreshRequest, RefreshResult, Retention, RetryableRefusal, RevokedAuthorization, RoomChange, RoomModels, RoomNotReadable, RoomStream, RoomStreamEvent, RoomVersionAt, SearchAnswer, SearchAsk, ServiceMode, ServiceModeSignal, TransportUncertainty, TurnOperation, TypedPath, TypedSelection, } from './adapter.js';
|
|
2
|
+
export type { Change, ChangeBatch, Precondition, RoomMove, WrittenBy } from './change.js';
|
|
3
|
+
export { heldFacts } from './conversation-row.js';
|
|
4
|
+
export type { ConversationAsk, ConversationHeld, ConversationLast, ConversationStart, } from './conversation-row.js';
|
|
5
|
+
export type { ChatDraft, ChatDraftSurface, ConversationAgent, ConversationAnswer, ConversationEntry, ConversationOptions, ConversationRead, ConversationState, ConversationSurface, ConversationView, RunningTurn, } from './conversation.js';
|
|
6
|
+
export type { MdRuntimeOptions } from './connection.js';
|
|
7
|
+
export type { HistoryQuery } from './actions.js';
|
|
8
|
+
export type { AppRoom, AppTypedSelection } from './listing.js';
|
|
9
|
+
export type { ConnectionRefusal, ConnectionRefusalCode } from './socket.js';
|
|
10
|
+
export type { MdRuntime, RoomSchemas } from './surface.js';
|
|
11
|
+
export type { BinaryFileSurface, SavedParts, SavedRoomDraft, SaveResult } from './saves.js';
|
|
6
12
|
export type { Observation } from './observation.js';
|
|
7
|
-
export type {
|
|
8
|
-
export type {
|
|
13
|
+
export type { DayFigures, Figures, FiguresResult, RoomFigures } from './figures.js';
|
|
14
|
+
export type { HeldApp, Holdings, RoomDocuments } from './holdings.js';
|
|
15
|
+
export type { PresentationSurface, RoomDraftSurface } from './room-drafts.js';
|
|
16
|
+
export type { AttachAnswer, BinaryAnswer, BinaryLinkAnswer, CallResult, DownloadAnswer, Failure, HistoryAnswer, Offline, QueueEntry, Resolution, Submission, } from './outcome.js';
|
|
17
|
+
export type { BinaryFileRecord } from './binary.js';
|
|
18
|
+
export type { RuntimeError } from './failure.js';
|
|
19
|
+
export type { ChangedPart, FieldValue, ReturnReason, RoomDraft, RoomDraftCreation, RoomDraftParts, RoomDraftWrite, TextParts, } from './room-draft.js';
|
|
9
20
|
export type { SaveRefusal } from './save.js';
|
|
10
|
-
export type {
|
|
21
|
+
export type { SearchFound, SearchHit, SearchRequest, SearchResult } from './search.js';
|
|
22
|
+
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, keptFile, keptLines } from './chat-types.js';
|
|
23
|
+
export { FIGURES_DAY_MS } from './figures.js';
|
|
24
|
+
export { departure } from './change.js';
|
|
25
|
+
export { definitionsIn, selected } from './collection.js';
|
|
26
|
+
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
27
|
+
export { cutName, nameFrom, transliterated } from './name.js';
|
|
28
|
+
export { HISTORY_CONVERSATIONS, SESSION_STARTED } from './conversation.js';
|
|
29
|
+
export { contextFigure } from './context.js';
|
|
30
|
+
export { sessionEnded, type RunningJob } from './job.js';
|
|
11
31
|
export { changeBatchIdentity } from './identity.js';
|
|
12
|
-
export
|
|
32
|
+
export { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
33
|
+
export { authoredAt } from './paths.js';
|
|
34
|
+
export { untilAnswered } from './recovery.js';
|
|
35
|
+
export { entriesIn, patching, sortedKeys } from './shared.js';
|
|
36
|
+
export { attempts, identities, intentOf, type Answered, type Attempt, type Attempts, type Identities, } from './attempt.js';
|
|
37
|
+
export { expectedList, expecting, type ExpectedOf, type Expecting } from './expectation.js';
|
|
38
|
+
export type { AppCode, HeldCode, RuntimeShell, UnsentKind, UnsentWork } from './durability.js';
|
|
39
|
+
export type { CodeAvailability, ConnectionAvailability, ConversationCoverage, Durability, HouseOutcome, Installation, InstallationAmount, InstallationStep, Persistence, Readiness, ReadinessStatus, RoomCoverage, RoomPreparation, Space, TargetCoverage, } from './readiness.js';
|
|
40
|
+
export type { ObservedRead } from './reads.js';
|
|
13
41
|
export type { AttentionEntry, SyncStatus } from './status.js';
|
|
14
|
-
export type {
|
|
42
|
+
export type { Direction, DocumentQuery, Filter, GroupKey, GroupOrder, GroupQuery, GroupSelect, Key, LocalQuery, OrderOptions, Predicate, Related, Select, Value, Where, } from '@agentshouse/mdmodel';
|
|
43
|
+
export type { Awaits, Backlink, CoveredRoom, DocumentResult, GroupResult, GroupTotal, PendingResult, PendingRoom, QueryCoverage, QueryDocument, QueryGroup, QueryResult, QueryRows, } from './query.js';
|
|
15
44
|
export type { MdType, ModelIdentity, ModelSnapshot, ModelState, ModelResult, TypesResult, ValidationReceipt, } from './model.js';
|
|
16
45
|
export type { OperationScopes, ReplicaAdmission, ScopedRefusal } from './adapter.js';
|
|
17
46
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,cAAc,EACd,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,cAAc,EACd,aAAa,EACb,YAAY,EACZ,eAAe,EACf,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,SAAS,EACT,UAAU,EACV,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,MAAM,EACN,eAAe,EACf,cAAc,EACd,SAAS,EACT,aAAa,EACb,eAAe,EACf,WAAW,EACX,cAAc,EACd,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,oB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AAW,EACX,SAAS,GACV,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,MAAM,EACN,aAAa,EACb,aAAa,EACb,UAAU,EACV,WAAW,EACX,WAAW,EACX,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1,17 @@
|
|
|
1
|
+
export { heldFacts } from './conversation-row.js';
|
|
2
|
+
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, keptFile, keptLines } from './chat-types.js';
|
|
3
|
+
export { FIGURES_DAY_MS } from './figures.js';
|
|
4
|
+
export { departure } from './change.js';
|
|
5
|
+
export { definitionsIn, selected } from './collection.js';
|
|
6
|
+
export { lineEnded, partsAfter, partsChanges } from './room-draft.js';
|
|
7
|
+
export { cutName, nameFrom, transliterated } from './name.js';
|
|
8
|
+
export { HISTORY_CONVERSATIONS, SESSION_STARTED } from './conversation.js';
|
|
9
|
+
export { contextFigure } from './context.js';
|
|
10
|
+
export { sessionEnded } from './job.js';
|
|
1
11
|
export { changeBatchIdentity } from './identity.js';
|
|
12
|
+
export { paced, ROW_WEIGHT, stepped } from './turn.js';
|
|
13
|
+
export { authoredAt } from './paths.js';
|
|
14
|
+
export { untilAnswered } from './recovery.js';
|
|
15
|
+
export { entriesIn, patching, sortedKeys } from './shared.js';
|
|
16
|
+
export { attempts, identities, intentOf, } from './attempt.js';
|
|
17
|
+
export { expectedList, expecting } from './expectation.js';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { AdapterFailure, Authorization, DiscoveredRoom, NotReady, RetryableRefusal } from './adapter.js';
|
|
2
|
+
import { type Reads } from './bootstrap.js';
|
|
3
|
+
import type { Installation, RoomCoverage } from './readiness.js';
|
|
4
|
+
import { advancement, type Refresher } from './refresh.js';
|
|
5
|
+
import type { ReplicaRecord } from './replica.js';
|
|
6
|
+
import type { Runtime } from './runtime.js';
|
|
7
|
+
import type { Live } from './socket.js';
|
|
8
|
+
import { type CoveredRoom, type InstallHold, type RuntimeStore, type Store } from './store.js';
|
|
9
|
+
import { type Unconfirmed } from './transfer.js';
|
|
10
|
+
type Standing = {
|
|
11
|
+
readonly key: number | null;
|
|
12
|
+
readonly confirmed: number;
|
|
13
|
+
};
|
|
14
|
+
export type Unheld = {
|
|
15
|
+
readonly staged: boolean;
|
|
16
|
+
};
|
|
17
|
+
export type Withheld = AdapterFailure | RetryableRefusal | NotReady | Unconfirmed;
|
|
18
|
+
type Landing = {
|
|
19
|
+
readonly kind: 'refreshed';
|
|
20
|
+
readonly from: Standing;
|
|
21
|
+
readonly remodelled: boolean;
|
|
22
|
+
} | {
|
|
23
|
+
readonly kind: 'bootstrapped';
|
|
24
|
+
readonly refreshed: boolean;
|
|
25
|
+
readonly from: Standing;
|
|
26
|
+
};
|
|
27
|
+
type Refreshed = {
|
|
28
|
+
kind: 'advanced';
|
|
29
|
+
record: ReplicaRecord;
|
|
30
|
+
from: Standing;
|
|
31
|
+
remodelled: boolean;
|
|
32
|
+
} | Exclude<Awaited<ReturnType<typeof advancement>>, {
|
|
33
|
+
kind: 'advanced';
|
|
34
|
+
}>;
|
|
35
|
+
export declare const ERASE_BATCH = 512;
|
|
36
|
+
export declare function installationOf(store: Store, coverage: readonly RoomCoverage[], held: ReadonlyMap<string, CoveredRoom>): Installation;
|
|
37
|
+
export declare function roomInFlight(store: Store, locator: string): boolean;
|
|
38
|
+
export declare function sweep({ store, socket, journal }: Runtime): void;
|
|
39
|
+
export declare function forgetInstall(store: Store, locator: string): void;
|
|
40
|
+
export declare function caughtUpTo(runtime: Runtime, locator: string): void;
|
|
41
|
+
export declare function catching(store: Store, locator: string): void;
|
|
42
|
+
export declare function standingAt(store: Store, locator: string, held: Pick<ReplicaRecord, 'key'> | undefined): Standing;
|
|
43
|
+
export declare function showing(system: Runtime, locator: string, roomVersion: string, held: string | undefined): void;
|
|
44
|
+
export declare function olderThan(system: Runtime, locator: string, roomVersion: string, held: string | undefined): boolean;
|
|
45
|
+
export declare function replaced(store: Store, locators: readonly string[]): void;
|
|
46
|
+
export declare function reachedBy({ store, socket }: Runtime, locator: string, roomVersion: string): Promise<boolean>;
|
|
47
|
+
export declare function behind({ store, socket }: Runtime, room: DiscoveredRoom): Promise<boolean>;
|
|
48
|
+
export declare function writtenAfter({ store, socket }: Runtime, locator: string, roomVersion: string, path: string): Promise<boolean>;
|
|
49
|
+
export declare function pullRefresh(runtime: Runtime, authorized: Authorization, record: ReplicaRecord, liveness: Live, hold: InstallHold, refresh: Refresher): Promise<Refreshed>;
|
|
50
|
+
export declare function pullBootstrap(runtime: Runtime, authorized: Authorization, room: DiscoveredRoom, local: RuntimeStore, liveness: Live, prior: ReplicaRecord | undefined, from?: Reads, unheld?: Unheld): Promise<import("./bootstrap.js").Bootstrapped | NotReady | import("./adapter.js").RevokedAuthorization | import("./adapter.js").RoomNotReadable | Unconfirmed | {
|
|
51
|
+
readonly kind: 'transport-uncertainty';
|
|
52
|
+
} | RetryableRefusal | import("./adapter.js").ScopedRefusal>;
|
|
53
|
+
export declare function publish(runtime: Runtime, local: RuntimeStore, room: DiscoveredRoom, reached: ReplicaRecord, landing: Landing, live: Live): Promise<boolean>;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,cAAc,EACd,QAAQ,EACR,gBAAgB,EAEjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAkC,KAAK,KAAK,EAAgB,MAAM,gBAAgB,CAAC;AAO1F,OAAO,KAAK,EACV,YAAY,EAGZ,YAAY,EACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAmB,MAAM,cAAc,CAAC;AAC5E,OA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