@agentshouse/mdruntime 0.1.0-ce6bc9239a3ee → 0.1.0-ce80727f9590f
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 +21 -19
- package/dist/acceptance.d.ts +2 -25
- package/dist/acceptance.d.ts.map +1 -1
- package/dist/acceptance.js +119 -204
- package/dist/act-lanes.d.ts +30 -0
- package/dist/act-lanes.d.ts.map +1 -0
- package/dist/act-lanes.js +225 -0
- package/dist/actions.d.ts +26 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/actions.js +321 -0
- package/dist/adapter.d.ts +114 -57
- package/dist/adapter.d.ts.map +1 -1
- package/dist/attached-model.d.ts +0 -1
- package/dist/attached-model.d.ts.map +1 -1
- package/dist/attached-model.js +0 -5
- package/dist/authored.d.ts +88 -0
- package/dist/authored.d.ts.map +1 -0
- package/dist/authored.js +345 -0
- package/dist/bootstrap.d.ts +1 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +6 -18
- package/dist/cell.d.ts +6 -0
- package/dist/cell.d.ts.map +1 -0
- package/dist/cell.js +9 -0
- package/dist/change-set.d.ts +4 -0
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +6 -0
- package/dist/change.d.ts +4 -0
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +7 -2
- package/dist/chat-types.d.ts +2 -2
- package/dist/chat-types.d.ts.map +1 -1
- package/dist/chat-types.js +11 -2
- package/dist/client.d.ts +25 -22
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +45 -58
- package/dist/collection.d.ts +26 -4
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +28 -10
- package/dist/column.d.ts +5 -0
- package/dist/column.d.ts.map +1 -0
- package/dist/column.js +9 -0
- package/dist/compile.d.ts +2 -0
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +31 -25
- package/dist/connection.d.ts +4 -116
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +103 -2994
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +1 -1
- package/dist/conversation-live.d.ts +150 -0
- package/dist/conversation-live.d.ts.map +1 -0
- package/dist/conversation-live.js +259 -0
- package/dist/conversation-row.d.ts +8 -1
- package/dist/conversation-row.d.ts.map +1 -1
- package/dist/conversation-row.js +22 -3
- package/dist/conversation.d.ts +57 -45
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +974 -1031
- package/dist/declaration.d.ts +10 -0
- package/dist/declaration.d.ts.map +1 -0
- package/dist/declaration.js +24 -0
- package/dist/discovery.d.ts +12 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +175 -0
- package/dist/download.d.ts +6 -0
- package/dist/download.d.ts.map +1 -0
- package/dist/download.js +42 -0
- package/dist/durability.d.ts +14 -0
- package/dist/durability.d.ts.map +1 -1
- package/dist/durability.js +7 -0
- package/dist/entry.d.ts +5 -0
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +23 -12
- package/dist/expectation.d.ts +26 -13
- package/dist/expectation.d.ts.map +1 -1
- package/dist/expectation.js +72 -19
- package/dist/failure.d.ts +3 -0
- package/dist/failure.d.ts.map +1 -1
- package/dist/failure.js +8 -0
- package/dist/figures.d.ts +1 -0
- package/dist/figures.d.ts.map +1 -1
- package/dist/figures.js +6 -4
- package/dist/file.d.ts +1 -1
- package/dist/file.d.ts.map +1 -1
- package/dist/file.js +3 -2
- 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 +20 -2
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +83 -19
- package/dist/house-query.d.ts +21 -0
- package/dist/house-query.d.ts.map +1 -0
- package/dist/house-query.js +41 -0
- package/dist/index.d.ts +28 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -6
- package/dist/install.d.ts +22 -48
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +161 -161
- package/dist/lifecycle.d.ts +7 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle.js +290 -0
- package/dist/listing.d.ts +60 -0
- package/dist/listing.d.ts.map +1 -0
- package/dist/listing.js +168 -0
- package/dist/live.d.ts +5 -3
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +74 -33
- package/dist/loaded.d.ts +5 -0
- package/dist/loaded.d.ts.map +1 -0
- package/dist/loaded.js +40 -0
- package/dist/locks.d.ts +7 -0
- package/dist/locks.d.ts.map +1 -0
- package/dist/locks.js +34 -0
- package/dist/lost.d.ts +5 -0
- package/dist/lost.d.ts.map +1 -0
- package/dist/lost.js +49 -0
- package/dist/media.d.ts +19 -2
- package/dist/media.d.ts.map +1 -1
- package/dist/media.js +105 -27
- package/dist/memory.d.ts +9 -3
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +94 -32
- package/dist/messages.d.ts +12 -6
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +35 -39
- package/dist/modal.d.ts +2 -0
- package/dist/modal.d.ts.map +1 -0
- package/dist/modal.js +11 -0
- package/dist/model.d.ts +4 -3
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +6 -5
- package/dist/models.d.ts +10 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +153 -0
- package/dist/observation.d.ts +29 -12
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +217 -85
- package/dist/online.d.ts +7 -0
- package/dist/online.d.ts.map +1 -0
- package/dist/online.js +29 -0
- package/dist/opened.d.ts +1 -1
- package/dist/opened.d.ts.map +1 -1
- package/dist/opened.js +5 -5
- package/dist/opening.d.ts +4 -0
- package/dist/opening.d.ts.map +1 -0
- package/dist/opening.js +70 -0
- package/dist/outcome.d.ts +16 -2
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +32 -2
- package/dist/overlay.d.ts +6 -2
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +37 -24
- package/dist/page-metadata.d.ts +8 -0
- package/dist/page-metadata.d.ts.map +1 -0
- package/dist/page-metadata.js +19 -0
- package/dist/parts.d.ts +5 -58
- package/dist/parts.d.ts.map +1 -1
- package/dist/parts.js +28 -110
- package/dist/paths.d.ts +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +22 -0
- package/dist/preparation.d.ts +41 -0
- package/dist/preparation.d.ts.map +1 -0
- package/dist/preparation.js +326 -0
- package/dist/presence.d.ts +58 -0
- package/dist/presence.d.ts.map +1 -0
- package/dist/presence.js +231 -0
- package/dist/queries.d.ts +16 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +287 -0
- package/dist/query.d.ts +0 -1
- package/dist/query.d.ts.map +1 -1
- package/dist/questions.d.ts +3 -5
- package/dist/questions.d.ts.map +1 -1
- package/dist/questions.js +4 -6
- package/dist/queue.d.ts +40 -0
- package/dist/queue.d.ts.map +1 -0
- package/dist/queue.js +480 -0
- package/dist/reach.d.ts +15 -5
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +164 -33
- package/dist/react.d.ts +17 -2
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +33 -1
- package/dist/readiness.d.ts +9 -4
- package/dist/readiness.d.ts.map +1 -1
- package/dist/readiness.js +3 -5
- package/dist/reads.d.ts +5 -2
- package/dist/reads.d.ts.map +1 -1
- package/dist/reads.js +49 -7
- package/dist/recovery.d.ts +4 -1
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +31 -8
- package/dist/refresh.js +2 -2
- package/dist/refusal.d.ts +5 -0
- package/dist/refusal.d.ts.map +1 -0
- package/dist/refusal.js +55 -0
- package/dist/replica.d.ts +5 -10
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +17 -18
- package/dist/retried.d.ts +30 -0
- package/dist/retried.d.ts.map +1 -0
- package/dist/retried.js +72 -0
- package/dist/room-draft.d.ts +31 -8
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +273 -66
- package/dist/room-drafts.d.ts +7 -12
- package/dist/room-drafts.d.ts.map +1 -1
- package/dist/room-drafts.js +44 -40
- package/dist/room-list.d.ts +10 -0
- package/dist/room-list.d.ts.map +1 -0
- package/dist/room-list.js +45 -0
- package/dist/rows.d.ts +2 -1
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +9 -10
- package/dist/running.d.ts +5 -0
- package/dist/running.d.ts.map +1 -0
- package/dist/running.js +10 -0
- package/dist/runtime.d.ts +36 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +1 -0
- package/dist/save.d.ts +42 -86
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +326 -225
- package/dist/saves.d.ts +8 -70
- package/dist/saves.d.ts.map +1 -1
- package/dist/saves.js +199 -761
- package/dist/seed.d.ts +3 -8
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +21 -17
- package/dist/shared.d.ts +1 -6
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +13 -95
- package/dist/shown.d.ts +35 -0
- package/dist/shown.d.ts.map +1 -0
- package/dist/shown.js +326 -0
- package/dist/socket/lanes.d.ts +28 -0
- package/dist/socket/lanes.d.ts.map +1 -0
- package/dist/socket/lanes.js +103 -0
- package/dist/socket/session.d.ts +41 -0
- package/dist/socket/session.d.ts.map +1 -0
- package/dist/socket/session.js +26 -0
- package/dist/socket.d.ts +30 -5
- package/dist/socket.d.ts.map +1 -1
- package/dist/socket.js +75 -6
- package/dist/source.d.ts +5 -7
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +18 -6
- package/dist/store/installs.d.ts +2 -2
- package/dist/store/installs.d.ts.map +1 -1
- package/dist/store/installs.js +10 -4
- package/dist/store/readiness.d.ts +11 -0
- package/dist/store/readiness.d.ts.map +1 -0
- package/dist/store/readiness.js +68 -0
- package/dist/store/records.d.ts +22 -8
- package/dist/store/records.d.ts.map +1 -1
- package/dist/store/records.js +84 -24
- package/dist/store/rooms-shown.d.ts +8 -0
- package/dist/store/rooms-shown.d.ts.map +1 -0
- package/dist/store/rooms-shown.js +13 -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 +2 -0
- package/dist/store/watchers.d.ts.map +1 -1
- package/dist/store/watchers.js +23 -3
- package/dist/store.d.ts +50 -9
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +78 -17
- package/dist/stored.d.ts +25 -14
- package/dist/stored.d.ts.map +1 -1
- package/dist/stored.js +99 -36
- package/dist/surface.d.ts +94 -0
- package/dist/surface.d.ts.map +1 -0
- package/dist/surface.js +255 -0
- package/dist/sync.d.ts +21 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +557 -0
- package/dist/tables.d.ts +28 -59
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +106 -331
- package/dist/tallies.d.ts.map +1 -1
- package/dist/tallies.js +6 -7
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +4 -10
- package/dist/wire.d.ts +68 -8
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +26 -9
- package/package.json +3 -2
- package/dist/attempt.d.ts +0 -16
- package/dist/attempt.d.ts.map +0 -1
- package/dist/attempt.js +0 -70
- package/dist/job.d.ts +0 -33
- package/dist/job.d.ts.map +0 -1
- package/dist/job.js +0 -54
- package/dist/log.d.ts +0 -6
- package/dist/log.d.ts.map +0 -1
- package/dist/log.js +0 -14
- package/dist/store/fences.d.ts +0 -16
- package/dist/store/fences.d.ts.map +0 -1
- package/dist/store/fences.js +0 -26
package/README.md
CHANGED
|
@@ -12,14 +12,14 @@ npm install @agentshouse/mdruntime
|
|
|
12
12
|
|
|
13
13
|
## Entries
|
|
14
14
|
|
|
15
|
-
| Entry | For
|
|
16
|
-
| ------------------------------- |
|
|
17
|
-
| `@agentshouse/mdruntime/client` | The host's client: `connectMdRuntime(port)`
|
|
18
|
-
| `@agentshouse/mdruntime/host` | The host that serves a Runtime: `serveMdRuntime`
|
|
19
|
-
| `@agentshouse/mdruntime` | Shared types
|
|
20
|
-
| `@agentshouse/mdruntime/memory` | Tests: `createMemoryAdapter`, an in-memory Adapter
|
|
21
|
-
| `@agentshouse/mdruntime/tables` | The host's database: the Authored store's and
|
|
22
|
-
| `@agentshouse/mdruntime/react` | React over the client: `useObserve`, `useSave`
|
|
15
|
+
| Entry | For |
|
|
16
|
+
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
17
|
+
| `@agentshouse/mdruntime/client` | The host's client: `connectMdRuntime(port)` |
|
|
18
|
+
| `@agentshouse/mdruntime/host` | The host that serves a Runtime: `serveMdRuntime` |
|
|
19
|
+
| `@agentshouse/mdruntime` | Shared types |
|
|
20
|
+
| `@agentshouse/mdruntime/memory` | Tests: `createMemoryAdapter`, an in-memory Adapter |
|
|
21
|
+
| `@agentshouse/mdruntime/tables` | The host's database: `formatted` lays it out for a device format, keeping the Authored store's tables and creating any it lacks, and `answerRuntime` answers it |
|
|
22
|
+
| `@agentshouse/mdruntime/react` | React over the client: `useObserve`, `useSave`; `useExpected`, a reader of an expectation store; `useLane`, a reader of an act lane |
|
|
23
23
|
|
|
24
24
|
## Usage
|
|
25
25
|
|
|
@@ -33,24 +33,26 @@ const rooms = await runtime.rooms();
|
|
|
33
33
|
const notes = await runtime.query({ types: ['note'], select: 'all', limit: 20 });
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
`observe('storage-loss')` reports `null
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
`observe('storage-loss')` reports `null`, the stable code `storage-loss` when
|
|
37
|
+
unsynchronized Room Drafts and Pending Changes were lost, or `visit` while the host holds
|
|
38
|
+
the database in memory, which ends with the visit; the readiness `persistence` answer is then
|
|
39
|
+
`memory`. The host supplies the user-facing wording.
|
|
39
40
|
|
|
40
41
|
In House the bridge object the page holds as `window.houseBridge` places the Chat, which
|
|
41
|
-
House serves with the page: install and bundle nothing for it. Mount it in an element
|
|
42
|
-
|
|
42
|
+
House serves with the page: install and bundle nothing for it. Mount it in an element it
|
|
43
|
+
fills, where it lays out the User's chats by the element's width, themed by CSS custom
|
|
44
|
+
properties on that element, or as the Chat button, House's dot that opens it in a sheet:
|
|
43
45
|
|
|
44
46
|
```ts
|
|
45
|
-
const chat = await window.houseBridge.chat.mount(element, {
|
|
47
|
+
const chat = await window.houseBridge.chat.mount(element, { conversation });
|
|
46
48
|
element.style.setProperty('--chat-accent', '#2a6cf0');
|
|
47
|
-
chat.update({
|
|
48
|
-
chat.
|
|
49
|
+
chat.update({ conversation: null, agent });
|
|
50
|
+
const button = await window.houseBridge.chat.mountButton({});
|
|
51
|
+
button.open({ agent });
|
|
49
52
|
```
|
|
50
53
|
|
|
51
|
-
The rules an App's agent follows, including Local Query, search, Room
|
|
52
|
-
|
|
53
|
-
`guide/open` opens.
|
|
54
|
+
The rules an App's agent follows, including Local Query, search, Room Draft, Save and the
|
|
55
|
+
Chat, are the `apps/` pages of House's Guide, which House's `guide/open` opens.
|
|
54
56
|
|
|
55
57
|
## License
|
|
56
58
|
|
package/dist/acceptance.d.ts
CHANGED
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
import type { Recovery } from './recovery.js';
|
|
4
|
-
import { type Saver } from './saves.js';
|
|
5
|
-
import type { CycleProgress } from './status.js';
|
|
6
|
-
import type { RuntimeStore } from './store.js';
|
|
7
|
-
export type Accepting = Saver & {
|
|
8
|
-
readonly recovery: Recovery;
|
|
9
|
-
stopping(): boolean;
|
|
10
|
-
paused(): boolean;
|
|
11
|
-
continuing(): boolean;
|
|
12
|
-
discovered(locator: string): DiscoveredRoom | undefined;
|
|
13
|
-
readable(room: DiscoveredRoom): void;
|
|
14
|
-
unreadable(room: DiscoveredRoom): void;
|
|
15
|
-
advanced(room: DiscoveredRoom, local: RuntimeStore, authorized: Authorization): Promise<Withheld | null>;
|
|
16
|
-
withhold(withheld: Withheld, room: DiscoveredRoom, local: RuntimeStore, progress: CycleProgress): Promise<void>;
|
|
17
|
-
writesHeld(): boolean;
|
|
18
|
-
openSignals(): number;
|
|
19
|
-
haltedSince(opens: number): boolean;
|
|
20
|
-
rest(progress: CycleProgress): Promise<void>;
|
|
21
|
-
statusShown(): Promise<void>;
|
|
22
|
-
};
|
|
23
|
-
export declare function unpair(accepting: Accepting, local: RuntimeStore): Promise<void>;
|
|
24
|
-
export declare function submitLater(accepting: Accepting, locator: string): void;
|
|
25
|
-
export declare function submitAll(accepting: Accepting): Promise<void>;
|
|
1
|
+
import type { Runtime } from './runtime.js';
|
|
2
|
+
export declare function submitLater(runtime: Runtime, locator: string): void;
|
|
26
3
|
//# sourceMappingURL=acceptance.d.ts.map
|
package/dist/acceptance.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acceptance.d.ts","sourceRoot":"","sources":["../src/acceptance.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"acceptance.d.ts","sourceRoot":"","sources":["../src/acceptance.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA0V5C,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,QAK5D"}
|
package/dist/acceptance.js
CHANGED
|
@@ -1,135 +1,108 @@
|
|
|
1
|
+
import { refusalError } from './failure.js';
|
|
1
2
|
import { changeSet } from './change-set.js';
|
|
3
|
+
import { declared } from './declaration.js';
|
|
2
4
|
import { leaving as leavingIn, partnerOf } from './change.js';
|
|
3
|
-
import { runtimeError } from './failure.js';
|
|
4
5
|
import { olderThan, showing } from './install.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
6
|
+
import { scoped } from './models.js';
|
|
7
|
+
import { answered, settle } from './queue.js';
|
|
8
|
+
import { refuse } from './refusal.js';
|
|
9
|
+
import { returnedPaths, returning, slicing } from './replica.js';
|
|
10
|
+
import { batchFile } from './saves.js';
|
|
11
|
+
import { rest, roomUnreadable, statusShown } from './shown.js';
|
|
12
|
+
import { advanced, withhold } from './sync.js';
|
|
7
13
|
import { unconfirmed } from './transfer.js';
|
|
8
14
|
import { stepped } from './turn.js';
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
async function mark(accepting, local, locator, batch, submission, lost) {
|
|
13
|
-
const { store, continuing, publishChangeSet, statusShown } = accepting;
|
|
15
|
+
async function mark(runtime, local, locator, batch, submission, lost) {
|
|
16
|
+
const { store, socket, presence } = runtime;
|
|
14
17
|
const partner = partnerOf(batch, locator);
|
|
15
18
|
for (const held of partner === null ? [locator] : [locator, partner]) {
|
|
16
19
|
const { state, room } = await local.pending(held, batch.id);
|
|
17
|
-
if (!continuing() ||
|
|
20
|
+
if (!socket.continuing() ||
|
|
18
21
|
state === undefined ||
|
|
19
22
|
(JSON.stringify(state.submission) === JSON.stringify(submission) && state.lost === lost)) {
|
|
20
23
|
continue;
|
|
21
24
|
}
|
|
22
25
|
await local.submit(held, batch.id, submission, lost);
|
|
23
|
-
if (
|
|
26
|
+
if (presence.lost(held))
|
|
24
27
|
continue;
|
|
25
28
|
if (room)
|
|
26
|
-
|
|
29
|
+
store.changed(changeSet(held, { queue: true }));
|
|
27
30
|
}
|
|
28
|
-
statusShown();
|
|
31
|
+
statusShown(runtime);
|
|
29
32
|
}
|
|
30
|
-
async function keepUpload({
|
|
31
|
-
if (!continuing())
|
|
32
|
-
throw new Error(
|
|
33
|
+
async function keepUpload({ socket, presence }, local, locator, identifier, upload) {
|
|
34
|
+
if (!socket.continuing())
|
|
35
|
+
throw new Error();
|
|
33
36
|
await local.keepUpload(locator, identifier, upload);
|
|
34
|
-
if (
|
|
35
|
-
throw
|
|
36
|
-
if (!continuing())
|
|
37
|
-
throw new Error(
|
|
38
|
-
}
|
|
39
|
-
function leaving(batch, result) {
|
|
40
|
-
return {
|
|
41
|
-
batch,
|
|
42
|
-
returned: {
|
|
43
|
-
kind: result.kind,
|
|
44
|
-
code: result.code,
|
|
45
|
-
fields: result.fields,
|
|
46
|
-
retryable: result.retryable,
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
function logAccepted({ journal }, locator, submitted, accepted) {
|
|
51
|
-
journal.record(`outcome ${locator} ${submitted.id} accepted ${accepted.roomVersion}` +
|
|
52
|
-
(accepted.author === undefined ? '' : ` author ${accepted.author}`) +
|
|
53
|
-
(accepted.time === undefined ? '' : ` time ${accepted.time}`));
|
|
54
|
-
}
|
|
55
|
-
function settling(acceptance) {
|
|
56
|
-
return acceptance !== null && 'apply' in acceptance;
|
|
37
|
+
if (presence.lost(locator))
|
|
38
|
+
throw new Error();
|
|
39
|
+
if (!socket.continuing())
|
|
40
|
+
throw new Error();
|
|
57
41
|
}
|
|
58
|
-
function
|
|
59
|
-
return
|
|
42
|
+
function restands(adoptions) {
|
|
43
|
+
return adoptions.flatMap((one) => (one === null || !('record' in one) ? [] : [one]));
|
|
60
44
|
}
|
|
61
|
-
async function
|
|
62
|
-
const { store, socket } =
|
|
63
|
-
if (!
|
|
45
|
+
async function adoption(runtime, room, current, local, submitted, accepted) {
|
|
46
|
+
const { store, socket } = runtime;
|
|
47
|
+
if (!socket.continuing())
|
|
64
48
|
return unconfirmed;
|
|
65
|
-
const work = await store.work(room.locator);
|
|
66
|
-
const current = work.replica;
|
|
67
49
|
if (current === undefined || !current.queue.some((batch) => batch.id === submitted.id)) {
|
|
68
50
|
return null;
|
|
69
51
|
}
|
|
70
52
|
const held = current.record.roomVersion;
|
|
71
|
-
logAccepted(accepting, room.locator, submitted, accepted);
|
|
72
53
|
let record = current.record;
|
|
73
|
-
let
|
|
54
|
+
let adopted;
|
|
74
55
|
if (!socket.reads.reached(room.locator, held, accepted.roomVersion) &&
|
|
75
|
-
!olderThan(
|
|
56
|
+
!olderThan(runtime, room.locator, accepted.roomVersion, held)) {
|
|
76
57
|
const paths = [...returnedPaths(submitted, accepted)];
|
|
77
58
|
const confirmedLayer = await stepped(slicing(await local.entries(record.key, 'confirmed', paths), paths));
|
|
78
|
-
|
|
59
|
+
adopted = await stepped(returning(confirmedLayer, submitted, accepted, accepted.roomVersion, store.composed(record)));
|
|
79
60
|
record = {
|
|
80
61
|
...record,
|
|
81
62
|
roomVersion: socket.follows(room.locator, held, accepted.roomVersion)
|
|
82
63
|
? accepted.roomVersion
|
|
83
64
|
: held,
|
|
84
65
|
};
|
|
85
|
-
changes = back;
|
|
86
66
|
}
|
|
87
|
-
const settled = await settlement(accepting, local, room.locator, work, record, current.queue.filter((batch) => batch.id !== submitted.id), { room: true, ...(changes === undefined ? {} : { changes }) });
|
|
88
67
|
const reached = record.roomVersion;
|
|
89
68
|
return {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
69
|
+
locator: room.locator,
|
|
70
|
+
record,
|
|
71
|
+
accepted: submitted.id,
|
|
72
|
+
...(adopted === undefined ? {} : { adopted }),
|
|
73
|
+
after() {
|
|
74
|
+
showing(runtime, room.locator, accepted.roomVersion, reached);
|
|
75
|
+
runtime.presence.readable(room.locator);
|
|
96
76
|
},
|
|
97
77
|
};
|
|
98
78
|
}
|
|
99
|
-
async function
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
await unpair(accepting, local);
|
|
107
|
-
}
|
|
108
|
-
async function adopted(accepting, room, local, submitted, accepted) {
|
|
109
|
-
const failed = await accepting.store.exclusive(async () => {
|
|
110
|
-
const adopting = await acceptance(accepting, room, local, submitted, accepted);
|
|
111
|
-
await adoptedTogether(accepting, local, [adopting]);
|
|
112
|
-
return failureOf(adopting);
|
|
79
|
+
async function adopted(runtime, room, local, submitted, accepted) {
|
|
80
|
+
let kept = true;
|
|
81
|
+
await settle(runtime, [room.locator], async (held) => {
|
|
82
|
+
const adopting = await adoption(runtime, room, held.get(room.locator)?.replica, local, submitted, accepted);
|
|
83
|
+
kept = adopting !== unconfirmed;
|
|
84
|
+
return restands([adopting]);
|
|
113
85
|
});
|
|
114
|
-
return
|
|
86
|
+
return kept;
|
|
115
87
|
}
|
|
116
|
-
async function adoptedMove(
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
const left = await
|
|
121
|
-
const
|
|
88
|
+
async function adoptedMove(runtime, room, partner, local, submitted, accepted) {
|
|
89
|
+
const other = runtime.presence.room(partner);
|
|
90
|
+
let kept = true;
|
|
91
|
+
await settle(runtime, [room.locator, partner], async (held) => {
|
|
92
|
+
const left = await adoption(runtime, room, held.get(room.locator)?.replica, local, submitted, accepted);
|
|
93
|
+
const there = held.get(partner)?.replica;
|
|
94
|
+
const arriving = there?.queue.find((batch) => batch.id === submitted.id);
|
|
122
95
|
const arrived = other === undefined || arriving === undefined || accepted.destination === undefined
|
|
123
96
|
? null
|
|
124
|
-
: await
|
|
97
|
+
: await adoption(runtime, other, there, local, arriving, {
|
|
125
98
|
kind: 'accepted',
|
|
126
99
|
...accepted.destination,
|
|
127
100
|
});
|
|
128
|
-
|
|
129
|
-
return
|
|
101
|
+
kept = left !== unconfirmed;
|
|
102
|
+
return restands([left, arrived]);
|
|
130
103
|
});
|
|
131
|
-
submitLater(
|
|
132
|
-
return
|
|
104
|
+
submitLater(runtime, partner);
|
|
105
|
+
return kept;
|
|
133
106
|
}
|
|
134
107
|
async function behindIn({ store }, locator, batch) {
|
|
135
108
|
const local = await store.open();
|
|
@@ -139,36 +112,12 @@ async function behindIn({ store }, locator, batch) {
|
|
|
139
112
|
]);
|
|
140
113
|
return room ? order.indexOf(batch.id) > 0 : order.length > 0;
|
|
141
114
|
}
|
|
142
|
-
async function
|
|
143
|
-
const {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
if (queued.get(partner)?.includes(batch.id) === true)
|
|
149
|
-
continue;
|
|
150
|
-
if (!leavingIn(batch, locator) || withdrawable(new Map([[batch.id, state]]))(batch)) {
|
|
151
|
-
return { locator, batch };
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
return null;
|
|
155
|
-
}
|
|
156
|
-
export async function unpair(accepting, local) {
|
|
157
|
-
const { continuing, publishChangeSet } = accepting;
|
|
158
|
-
const handled = new Set();
|
|
159
|
-
for (let held = await unpaired(local, handled); held !== null && continuing(); held = await unpaired(local, handled)) {
|
|
160
|
-
const { locator, batch } = held;
|
|
161
|
-
handled.add(pendingKey(locator, batch.id));
|
|
162
|
-
publishChangeSet(await together(accepting, local, [await unpairing(accepting, local, locator, [batch])]));
|
|
163
|
-
}
|
|
164
|
-
if (handled.size === 0)
|
|
165
|
-
return;
|
|
166
|
-
accepting.statusShown();
|
|
167
|
-
}
|
|
168
|
-
async function submitRoom(accepting, room, local, authorized, progress, signal) {
|
|
169
|
-
const { store, socket, journal, continuing, writesHeld, advanced, withhold } = accepting;
|
|
170
|
-
while (continuing() && accepting.authorized() !== undefined && !signal.aborted) {
|
|
171
|
-
const headId = (await local.order(room.locator)).find((id) => store.landed.of(room.locator, id) === undefined);
|
|
115
|
+
async function submitRoom(runtime, room, local, authorized, progress, signal) {
|
|
116
|
+
const { store, socket, presence } = runtime;
|
|
117
|
+
while (socket.continuing() &&
|
|
118
|
+
socket.session.now().authorization !== undefined &&
|
|
119
|
+
!signal.aborted) {
|
|
120
|
+
const headId = (await local.order(room.locator)).find((id) => store.conflicted.of(room.locator, id) === undefined);
|
|
172
121
|
if (headId === undefined)
|
|
173
122
|
return 'done';
|
|
174
123
|
const [head, pending] = await Promise.all([
|
|
@@ -180,10 +129,10 @@ async function submitRoom(accepting, room, local, authorized, progress, signal)
|
|
|
180
129
|
const { state } = pending;
|
|
181
130
|
const partner = partnerOf(head, room.locator);
|
|
182
131
|
if (partner !== null && !leavingIn(head, room.locator)) {
|
|
183
|
-
submitLater(
|
|
132
|
+
submitLater(runtime, partner);
|
|
184
133
|
return 'done';
|
|
185
134
|
}
|
|
186
|
-
if (partner !== null && (await behindIn(
|
|
135
|
+
if (partner !== null && (await behindIn(runtime, partner, head))) {
|
|
187
136
|
progress.complete = false;
|
|
188
137
|
return 'done';
|
|
189
138
|
}
|
|
@@ -195,29 +144,26 @@ async function submitRoom(accepting, room, local, authorized, progress, signal)
|
|
|
195
144
|
progress.complete = false;
|
|
196
145
|
return { at: Date.parse(submission.reset) };
|
|
197
146
|
}
|
|
198
|
-
if (writesHeld()) {
|
|
147
|
+
if (socket.writesHeld()) {
|
|
199
148
|
progress.complete = false;
|
|
200
|
-
journal.record(`submission ${room.locator} ${head.id} held`);
|
|
201
149
|
return 'done';
|
|
202
150
|
}
|
|
203
151
|
const lost = earlier || submission.state === 'submitted';
|
|
204
152
|
let result;
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
if (accepting.paused() || store.fences.has(room.locator))
|
|
153
|
+
await store.exclusive(() => mark(runtime, local, room.locator, head, { state: 'submitted' }, lost));
|
|
154
|
+
if (socket.session.now().paused || presence.lost(room.locator))
|
|
208
155
|
return 'done';
|
|
209
|
-
if (signal.aborted || writesHeld()) {
|
|
210
|
-
await store.exclusive(() => mark(
|
|
156
|
+
if (signal.aborted || socket.writesHeld()) {
|
|
157
|
+
await store.exclusive(() => mark(runtime, local, room.locator, head, submission, earlier));
|
|
211
158
|
if (signal.aborted)
|
|
212
159
|
return 'done';
|
|
213
160
|
progress.complete = false;
|
|
214
|
-
journal.record(`submission ${room.locator} ${head.id} held`);
|
|
215
161
|
return 'done';
|
|
216
162
|
}
|
|
217
|
-
const opensBefore =
|
|
163
|
+
const opensBefore = socket.session.now().openSignals;
|
|
218
164
|
const answeredHere = socket.awaitingAnswer(room.locator);
|
|
219
165
|
const answeredThere = partner === null ? () => { } : socket.awaitingAnswer(partner);
|
|
220
|
-
const
|
|
166
|
+
const heard = () => {
|
|
221
167
|
answeredHere();
|
|
222
168
|
answeredThere();
|
|
223
169
|
};
|
|
@@ -227,116 +173,90 @@ async function submitRoom(accepting, room, local, authorized, progress, signal)
|
|
|
227
173
|
changeBatch: head,
|
|
228
174
|
file: batchFile(store, head),
|
|
229
175
|
...(state?.upload === undefined ? {} : { upload: state.upload }),
|
|
230
|
-
}, (upload) => store.exclusive(() => keepUpload(
|
|
176
|
+
}, (upload) => store.exclusive(() => keepUpload(runtime, local, room.locator, head.id, upload)));
|
|
231
177
|
}
|
|
232
|
-
catch {
|
|
233
|
-
|
|
178
|
+
catch (error) {
|
|
179
|
+
runtime.retries.failed('sending', submitting(room.locator), error);
|
|
180
|
+
heard();
|
|
234
181
|
progress.complete = false;
|
|
235
|
-
if (continuing())
|
|
182
|
+
if (socket.continuing())
|
|
236
183
|
progress.reachable = false;
|
|
237
184
|
return 'again';
|
|
238
185
|
}
|
|
239
186
|
if (signal.aborted) {
|
|
240
|
-
|
|
187
|
+
heard();
|
|
241
188
|
return 'done';
|
|
242
189
|
}
|
|
243
|
-
if (result.kind !== 'accepted' || !continuing())
|
|
244
|
-
|
|
245
|
-
if (!continuing())
|
|
190
|
+
if (result.kind !== 'accepted' || !socket.continuing())
|
|
191
|
+
heard();
|
|
192
|
+
if (!socket.continuing())
|
|
246
193
|
return 'done';
|
|
194
|
+
if (result.kind === 'accepted')
|
|
195
|
+
runtime.retries.succeeded('sending', submitting(room.locator));
|
|
247
196
|
if (result.kind === 'transport-uncertainty') {
|
|
197
|
+
runtime.retries.uncertain('sending', submitting(room.locator), result);
|
|
248
198
|
progress.complete = false;
|
|
249
199
|
progress.reachable = false;
|
|
250
200
|
return 'again';
|
|
251
201
|
}
|
|
252
202
|
if (result.kind === 'room-not-readable') {
|
|
253
203
|
progress.complete = false;
|
|
254
|
-
|
|
204
|
+
roomUnreadable(runtime, (presence.room(result.locator) ?? room).locator);
|
|
255
205
|
return 'done';
|
|
256
206
|
}
|
|
257
207
|
if (result.kind === 'revoked-authorization') {
|
|
258
|
-
await
|
|
208
|
+
await refuse(runtime, 'revoked-authorization');
|
|
259
209
|
return 'done';
|
|
260
210
|
}
|
|
261
211
|
if (result.kind === 'scoped-refusal') {
|
|
262
|
-
await
|
|
212
|
+
await scoped(runtime, result, room.locator, declared(room));
|
|
263
213
|
progress.complete = false;
|
|
264
214
|
return 'done';
|
|
265
215
|
}
|
|
266
216
|
if (result.kind === 'write-halted') {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
if (!accepting.haltedSince(opensBefore))
|
|
217
|
+
await store.exclusive(() => mark(runtime, local, room.locator, head, { state: 'waiting' }, lost));
|
|
218
|
+
if (!socket.haltedSince(opensBefore))
|
|
270
219
|
continue;
|
|
271
220
|
progress.complete = false;
|
|
272
221
|
return 'done';
|
|
273
222
|
}
|
|
274
|
-
const other = partner === null ? undefined :
|
|
275
|
-
if (result.kind === 'conflicted' ||
|
|
276
|
-
result.kind === 'rejected' ||
|
|
277
|
-
result.kind === 'retryable-refusal') {
|
|
278
|
-
journal.record(`outcome ${room.locator} ${head.id} ${result.kind}` +
|
|
279
|
-
(result.kind === 'conflicted' && result.roomVersion !== undefined
|
|
280
|
-
? ` ${result.roomVersion}`
|
|
281
|
-
: ''));
|
|
282
|
-
journal.record(`refusal ${result.kind} ${result.code}`);
|
|
283
|
-
}
|
|
223
|
+
const other = partner === null ? undefined : presence.room(partner);
|
|
284
224
|
if (result.kind === 'retryable-refusal') {
|
|
225
|
+
runtime.retries.failed('sending', submitting(room.locator), refusalError(result));
|
|
285
226
|
const reset = result.reset;
|
|
286
227
|
progress.complete = false;
|
|
287
|
-
await store.exclusive(() => mark(
|
|
228
|
+
await store.exclusive(() => mark(runtime, local, room.locator, head, reset === undefined ? { state: 'waiting' } : { state: 'reset', reset }, lost));
|
|
288
229
|
return reset === undefined ? 'again' : { at: Date.parse(reset) };
|
|
289
230
|
}
|
|
290
231
|
if (result.kind === 'conflicted' || result.kind === 'rejected') {
|
|
291
|
-
const left = leaving(head, result);
|
|
292
232
|
const refreshed = async () => ({
|
|
293
|
-
there: other === undefined ? null : await advanced(other, local, authorized),
|
|
294
|
-
here: await advanced(room, local, authorized),
|
|
233
|
+
there: other === undefined ? null : await advanced(runtime, other, local, authorized),
|
|
234
|
+
here: await advanced(runtime, room, local, authorized),
|
|
295
235
|
});
|
|
296
236
|
const judged = result.kind === 'conflicted' && other !== undefined ? await refreshed() : null;
|
|
297
237
|
if (judged !== null && (judged.there !== null || judged.here !== null)) {
|
|
298
|
-
await store.exclusive(() => mark(
|
|
238
|
+
await store.exclusive(() => mark(runtime, local, room.locator, head, { state: 'waiting' }, lost));
|
|
299
239
|
if (other !== undefined && judged.there !== null) {
|
|
300
|
-
await withhold(judged.there, other, local, progress);
|
|
240
|
+
await withhold(runtime, judged.there, other, local, progress);
|
|
301
241
|
}
|
|
302
242
|
if (judged.here !== null)
|
|
303
|
-
await withhold(judged.here, room, local, progress);
|
|
243
|
+
await withhold(runtime, judged.here, room, local, progress);
|
|
304
244
|
return 'done';
|
|
305
245
|
}
|
|
306
|
-
await
|
|
307
|
-
if (!continuing())
|
|
308
|
-
return;
|
|
309
|
-
const work = await store.work(room.locator);
|
|
310
|
-
const current = work.replica;
|
|
311
|
-
if (current === undefined || !current.queue.some((batch) => batch.id === head.id)) {
|
|
312
|
-
return;
|
|
313
|
-
}
|
|
314
|
-
const confirmedLayer = await sliceAt(store, current.record, 'confirmed', [head]);
|
|
315
|
-
const held = result.kind === 'conflicted' &&
|
|
316
|
-
(await landedWhole(store, room.locator, head, confirmedLayer, result.affected));
|
|
317
|
-
if (held &&
|
|
318
|
-
result.kind === 'conflicted' &&
|
|
319
|
-
partner === null &&
|
|
320
|
-
!landed(head, confirmedLayer)) {
|
|
321
|
-
store.landed.hold(room.locator, head.id, Object.fromEntries([...touchedBy([head])].map((path) => [path, confirmedLayer.revisions[path]])));
|
|
322
|
-
return;
|
|
323
|
-
}
|
|
324
|
-
accepting.publishChangeSet(await settle(accepting, local, room.locator, work, current.record, current.queue.filter((batch) => batch.id !== head.id), { leaving: [held ? { ...left, returned: null } : left] }));
|
|
325
|
-
await unpair(accepting, local);
|
|
326
|
-
accepting.statusShown();
|
|
327
|
-
});
|
|
246
|
+
await answered(runtime, room.locator, head, result);
|
|
328
247
|
const { there, here } = judged ?? (await refreshed());
|
|
329
|
-
if (other !== undefined && there !== null)
|
|
330
|
-
await withhold(there, other, local, progress);
|
|
248
|
+
if (other !== undefined && there !== null) {
|
|
249
|
+
await withhold(runtime, there, other, local, progress);
|
|
250
|
+
}
|
|
331
251
|
if (here !== null) {
|
|
332
|
-
await withhold(here, room, local, progress);
|
|
252
|
+
await withhold(runtime, here, room, local, progress);
|
|
333
253
|
return 'done';
|
|
334
254
|
}
|
|
335
255
|
continue;
|
|
336
256
|
}
|
|
337
257
|
const kept = await (partner === null
|
|
338
|
-
? adopted(
|
|
339
|
-
: adoptedMove(
|
|
258
|
+
? adopted(runtime, room, local, head, result)
|
|
259
|
+
: adoptedMove(runtime, room, partner, local, head, result)).finally(heard);
|
|
340
260
|
if (!kept) {
|
|
341
261
|
progress.complete = false;
|
|
342
262
|
return 'done';
|
|
@@ -344,41 +264,36 @@ async function submitRoom(accepting, room, local, authorized, progress, signal)
|
|
|
344
264
|
}
|
|
345
265
|
return 'done';
|
|
346
266
|
}
|
|
347
|
-
|
|
348
|
-
|
|
267
|
+
function submitting(locator) {
|
|
268
|
+
return `submit ${locator}`;
|
|
269
|
+
}
|
|
270
|
+
export function submitLater(runtime, locator) {
|
|
271
|
+
if (runtime.localSaves)
|
|
349
272
|
return;
|
|
350
|
-
void
|
|
273
|
+
void runtime.recovery.attempt(submitting(locator), (signal) => submitPass(runtime, locator, signal));
|
|
351
274
|
}
|
|
352
|
-
async function submitPass(
|
|
353
|
-
const { store, socket } =
|
|
354
|
-
const room =
|
|
355
|
-
if (
|
|
275
|
+
async function submitPass(runtime, locator, signal) {
|
|
276
|
+
const { store, socket, presence } = runtime;
|
|
277
|
+
const room = presence.room(locator);
|
|
278
|
+
if (!socket.continuing() || socket.stopping() || room === undefined) {
|
|
356
279
|
return 'done';
|
|
357
280
|
}
|
|
358
281
|
const progress = { complete: true, reachable: true };
|
|
359
282
|
let next;
|
|
360
283
|
try {
|
|
361
|
-
await
|
|
362
|
-
const authorization =
|
|
284
|
+
await socket.authorize();
|
|
285
|
+
const { authorization } = socket.session.now();
|
|
363
286
|
if (authorization === undefined)
|
|
364
287
|
return 'done';
|
|
365
|
-
next = await submitRoom(
|
|
288
|
+
next = await submitRoom(runtime, room, await store.open(), authorization, progress, signal);
|
|
366
289
|
}
|
|
367
|
-
catch {
|
|
290
|
+
catch (error) {
|
|
291
|
+
runtime.retries.failed('sending', submitting(locator), error);
|
|
368
292
|
progress.reachable = false;
|
|
369
293
|
next = 'again';
|
|
370
294
|
}
|
|
371
295
|
if (signal.aborted)
|
|
372
296
|
return 'done';
|
|
373
|
-
await
|
|
297
|
+
await rest(runtime, progress);
|
|
374
298
|
return next === 'again' && !socket.isOpen() ? 'done' : next;
|
|
375
299
|
}
|
|
376
|
-
export async function submitAll(accepting) {
|
|
377
|
-
const { store } = accepting;
|
|
378
|
-
if (accepting.localSaves)
|
|
379
|
-
return;
|
|
380
|
-
for (const locator of await (await store.open()).queued()) {
|
|
381
|
-
if (!store.fences.has(locator))
|
|
382
|
-
submitLater(accepting, locator);
|
|
383
|
-
}
|
|
384
|
-
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type Expected, type Expecting } from './expectation.js';
|
|
2
|
+
export type Ended = 'accepted' | 'refused' | 'unanswered' | 'unsent';
|
|
3
|
+
export type Send<O> = {
|
|
4
|
+
(name: string, input: unknown, sending: (operation: string) => Promise<O>): Promise<O>;
|
|
5
|
+
expect(expected: Expected): void;
|
|
6
|
+
};
|
|
7
|
+
export type LaneShown<O> = {
|
|
8
|
+
readonly busy: boolean;
|
|
9
|
+
readonly drawn: boolean;
|
|
10
|
+
readonly ended: O | null;
|
|
11
|
+
};
|
|
12
|
+
export type Lane<O> = {
|
|
13
|
+
run(steps: (send: Send<O>) => Promise<O>, expected?: Expected): Promise<O>;
|
|
14
|
+
shown(): LaneShown<O>;
|
|
15
|
+
subscribe(listener: () => void): () => void;
|
|
16
|
+
forget(): void;
|
|
17
|
+
};
|
|
18
|
+
export type Acting<O> = {
|
|
19
|
+
open(): Lane<O>;
|
|
20
|
+
};
|
|
21
|
+
export type ActingRules<O> = {
|
|
22
|
+
readonly store: Pick<Expecting, 'begin' | 'expect' | 'drop'>;
|
|
23
|
+
readonly uncertain: O;
|
|
24
|
+
ending(outcome: O): Ended;
|
|
25
|
+
acted?(): void;
|
|
26
|
+
mint?(): string;
|
|
27
|
+
settles?(operation: string): Promise<boolean>;
|
|
28
|
+
};
|
|
29
|
+
export declare function acting<O>(rules: ActingRules<O>): Acting<O>;
|
|
30
|
+
//# sourceMappingURL=act-lanes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"act-lanes.d.ts","sourceRoot":"","sources":["../src/act-lanes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG/E,MAAM,MAAM,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG,YAAY,GAAG,QAAQ,CAAC;AAErE,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI;IACpB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACvF,MAAM,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI;IACzB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI;IACpB,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3E,KAAK,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC;IACtB,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAC5C,MAAM,IAAI,IAAI,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI;IACtB,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAC3B,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC,CAAC;IAC7D,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC;IACtB,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC;IAC1B,KAAK,CAAC,IAAI,IAAI,CAAC;IACf,IAAI,CAAC,IAAI,MAAM,CAAC;IAChB,OAAO,CAAC,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC/C,CAAC;AAUF,wBAAgB,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CA6N1D"}
|