@agentshouse/mdruntime 0.1.0-ca4dc698bd0c4 → 0.1.0-ca68e8b4bbebc
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 +114 -115
- package/dist/adapter.d.ts +8 -6
- package/dist/adapter.d.ts.map +1 -1
- package/dist/bootstrap.d.ts +2 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +4 -0
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +2 -1
- package/dist/chat/kit.d.ts +2 -1
- package/dist/chat/kit.d.ts.map +1 -1
- package/dist/chat/kit.js +3 -3
- package/dist/chat/list.d.ts +2 -1
- package/dist/chat/list.d.ts.map +1 -1
- package/dist/chat/list.js +4 -3
- package/dist/chat/messages.d.ts +1 -0
- package/dist/chat/messages.d.ts.map +1 -1
- package/dist/chat/messages.js +4 -0
- package/dist/chat/provider.d.ts +1 -1
- package/dist/chat/provider.d.ts.map +1 -1
- package/dist/chat/provider.js +26 -17
- package/dist/chat/ready.d.ts +1 -0
- package/dist/chat/ready.d.ts.map +1 -1
- package/dist/chat/ready.js +2 -2
- package/dist/client.d.ts +2 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +10 -2
- package/dist/connection.d.ts +4 -1
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +239 -55
- package/dist/conversation.d.ts +2 -0
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +112 -17
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +1 -1
- package/dist/host.d.ts +8 -3
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +53 -9
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/memory.d.ts +5 -1
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +13 -5
- package/dist/model.d.ts +3 -2
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +1 -1
- package/dist/overlay.d.ts +1 -0
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +27 -3
- package/dist/query.d.ts +8 -1
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +8 -2
- package/dist/reach.d.ts +1 -2
- package/dist/reach.d.ts.map +1 -1
- package/dist/reach.js +4 -4
- package/dist/react.d.ts +2 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +6 -4
- package/dist/read-side.d.ts.map +1 -1
- package/dist/read-side.js +3 -0
- package/dist/reads.d.ts +11 -0
- package/dist/reads.d.ts.map +1 -0
- package/dist/reads.js +98 -0
- package/dist/refresh.d.ts +4 -4
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +6 -0
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +11 -2
- package/dist/room-draft.d.ts +13 -1
- package/dist/room-draft.d.ts.map +1 -1
- package/dist/room-draft.js +2 -2
- package/dist/rows.d.ts +2 -1
- package/dist/rows.d.ts.map +1 -1
- package/dist/rows.js +3 -1
- package/dist/search.d.ts +14 -6
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +29 -6
- package/dist/seed.d.ts +16 -0
- package/dist/seed.d.ts.map +1 -0
- package/dist/seed.js +61 -0
- package/dist/store.d.ts +13 -4
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +27 -5
- package/dist/wire.d.ts +135 -33
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +47 -32
- package/package.json +2 -2
package/dist/connection.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { attachedModel } from './attached-model.js';
|
|
2
2
|
import { cached, modelTypes, NO_MODEL, sameModel, } from './model.js';
|
|
3
|
-
import { observing } from './observation.js';
|
|
4
|
-
import { filterOf, identityOf, planOf, } from './query.js';
|
|
3
|
+
import { observing, whole } from './observation.js';
|
|
4
|
+
import { filterOf, identityOf, planOf, queryKey, } from './query.js';
|
|
5
5
|
import { createReadSide } from './read-side.js';
|
|
6
|
+
import { seededResult } from './seed.js';
|
|
6
7
|
import { markdownPath, roomOfKey } from './rows.js';
|
|
7
8
|
import { createSearchIndex, searchPlanOf, } from './search.js';
|
|
8
9
|
import { bootstrapRoom } from './bootstrap.js';
|
|
@@ -15,6 +16,7 @@ import { createLog } from './log.js';
|
|
|
15
16
|
import { binaryRecord } from './binary.js';
|
|
16
17
|
import { absentBinary, binaryAnswer, calledResult, failure, historyAnswer, undeclared, UNCERTAIN, } from './outcome.js';
|
|
17
18
|
import { createRecovery } from './recovery.js';
|
|
19
|
+
import { doorReads } from './reads.js';
|
|
18
20
|
import { refreshRoom } from './refresh.js';
|
|
19
21
|
import { buildBatch, joined, limitedIn, requeued } from './save.js';
|
|
20
22
|
import { applyReturned, compositionOf, confirmedOf, landed, readReclassified, replicaOf, sameMembership, withdrawals, } from './replica.js';
|
|
@@ -31,6 +33,14 @@ import { beneath, normalize } from './paths.js';
|
|
|
31
33
|
import { openRuntimeStore, } from './store.js';
|
|
32
34
|
import { unconfirmed } from './transfer.js';
|
|
33
35
|
import { governs, holds, narrowed, planReach, } from './reach.js';
|
|
36
|
+
function roomsAlone(plan) {
|
|
37
|
+
return (plan.reach === null &&
|
|
38
|
+
plan.root.types === null &&
|
|
39
|
+
plan.root.where === null &&
|
|
40
|
+
plan.root.pathPrefix === null &&
|
|
41
|
+
plan.hop === null &&
|
|
42
|
+
plan.backlinks === null);
|
|
43
|
+
}
|
|
34
44
|
function within(root, path) {
|
|
35
45
|
return root === '' || beneath(root, path);
|
|
36
46
|
}
|
|
@@ -48,6 +58,10 @@ const OPENING_LANE = 'opening';
|
|
|
48
58
|
const CONVERSATION_LANE = 'conversations';
|
|
49
59
|
const ROOM_READS = 256;
|
|
50
60
|
const ROOM_ATTEMPTS = 16;
|
|
61
|
+
function operationOf(input) {
|
|
62
|
+
const operation = input?.operation_id;
|
|
63
|
+
return typeof operation === 'string' ? operation : null;
|
|
64
|
+
}
|
|
51
65
|
const outside = new Map();
|
|
52
66
|
function outsideOf(roots) {
|
|
53
67
|
const key = JSON.stringify(roots);
|
|
@@ -87,6 +101,8 @@ export function composeRuntime(options) {
|
|
|
87
101
|
const replicas = new FencedMap(isFenced);
|
|
88
102
|
const queuesWithoutReplica = new FencedMap(isFenced);
|
|
89
103
|
const pendings = new Map();
|
|
104
|
+
const seeds = new Map();
|
|
105
|
+
const seedWatchers = new Map();
|
|
90
106
|
const roomDrafts = new FencedMap(isFenced);
|
|
91
107
|
const presentations = new Map();
|
|
92
108
|
let limits = [];
|
|
@@ -99,6 +115,7 @@ export function composeRuntime(options) {
|
|
|
99
115
|
const liveModels = new FencedMap(isModelFenced);
|
|
100
116
|
const invalidModels = new Set();
|
|
101
117
|
const discovered = new Map();
|
|
118
|
+
const reads = doorReads(options.adapter, (locator) => discovered.get(locator), () => generation);
|
|
102
119
|
let roomsListed = false;
|
|
103
120
|
const scopedRefusals = new Map();
|
|
104
121
|
const sourceRefusals = new Map();
|
|
@@ -135,6 +152,7 @@ export function composeRuntime(options) {
|
|
|
135
152
|
let handed = false;
|
|
136
153
|
const recovery = (options.recovery ?? createRecovery()).scope(ROOM_ATTEMPTS);
|
|
137
154
|
const repairing = new Set();
|
|
155
|
+
const calling = new Set();
|
|
138
156
|
const repairable = new Map();
|
|
139
157
|
let outcomeRetention = null;
|
|
140
158
|
const answering = new Map();
|
|
@@ -484,7 +502,8 @@ export function composeRuntime(options) {
|
|
|
484
502
|
return [...new Set(named)].filter((locator) => reached === null || reached.has(locator)).sort();
|
|
485
503
|
}
|
|
486
504
|
function awaited(locator) {
|
|
487
|
-
return
|
|
505
|
+
return (!roomsListed ||
|
|
506
|
+
(rooms.has(locator) && discovered.get(locator)?.replica.admission === 'admitted'));
|
|
488
507
|
}
|
|
489
508
|
function covered(plan) {
|
|
490
509
|
const locators = reachedRooms(plan);
|
|
@@ -643,8 +662,7 @@ export function composeRuntime(options) {
|
|
|
643
662
|
}
|
|
644
663
|
function readinessFor(port, reach) {
|
|
645
664
|
const required = requiredRooms(reach);
|
|
646
|
-
const
|
|
647
|
-
const search = target?.search === true;
|
|
665
|
+
const search = port.search === 'required';
|
|
648
666
|
const coverage = required.rooms.map((room) => ({ room, state: roomState(room, search) }));
|
|
649
667
|
const building = (state) => coverage
|
|
650
668
|
.filter((room) => room.state === state && !unindexable.has(room.room))
|
|
@@ -672,15 +690,11 @@ export function composeRuntime(options) {
|
|
|
672
690
|
: port.capacity,
|
|
673
691
|
refused: refusedIn(required.rooms),
|
|
674
692
|
lost: storageLoss !== null,
|
|
675
|
-
established: target?.established === true,
|
|
693
|
+
established: targets[port.target]?.established === true,
|
|
676
694
|
});
|
|
677
695
|
}
|
|
678
|
-
function
|
|
679
|
-
|
|
680
|
-
const next = { ...held, ...change };
|
|
681
|
-
if (next.established === held.established && next.search === held.search)
|
|
682
|
-
return;
|
|
683
|
-
targets = { ...targets, [name]: next };
|
|
696
|
+
function establish(name) {
|
|
697
|
+
targets = { ...targets, [name]: { established: true } };
|
|
684
698
|
queueReadiness();
|
|
685
699
|
void durably((local) => local.keepTargets(targets)).catch(() => {
|
|
686
700
|
journal.record(`target record failed ${name}`);
|
|
@@ -691,7 +705,7 @@ export function composeRuntime(options) {
|
|
|
691
705
|
return;
|
|
692
706
|
const readiness = readinessFor(watch.port, watch.reach);
|
|
693
707
|
if (readiness.ready && targets[watch.port.target]?.established !== true) {
|
|
694
|
-
|
|
708
|
+
establish(watch.port.target);
|
|
695
709
|
}
|
|
696
710
|
const shown = JSON.stringify(readiness);
|
|
697
711
|
if (shown === watch.last)
|
|
@@ -719,10 +733,6 @@ export function composeRuntime(options) {
|
|
|
719
733
|
readinessWatches.delete(watch);
|
|
720
734
|
};
|
|
721
735
|
}
|
|
722
|
-
function searching(target) {
|
|
723
|
-
if (targets[target]?.search !== true)
|
|
724
|
-
keepTarget(target, { search: true });
|
|
725
|
-
}
|
|
726
736
|
function layerBytes(layer) {
|
|
727
737
|
let bytes = 0;
|
|
728
738
|
for (const [path, text] of Object.entries(layer.documents))
|
|
@@ -810,9 +820,47 @@ export function composeRuntime(options) {
|
|
|
810
820
|
const available = await estimated().catch(() => null);
|
|
811
821
|
pause(locator, { cause: 'quota-exceeded', needed: bytes, available });
|
|
812
822
|
}
|
|
823
|
+
function seedRoomHeld(room, version) {
|
|
824
|
+
return prepared.has(room) && reachedBy(room, version);
|
|
825
|
+
}
|
|
826
|
+
function seedHeld(at) {
|
|
827
|
+
return Object.entries(at).every(([room, version]) => (roomsListed && !rooms.has(room)) || seedRoomHeld(room, version));
|
|
828
|
+
}
|
|
829
|
+
function seedApplies(plan) {
|
|
830
|
+
const seed = seeds.get(plan.key);
|
|
831
|
+
if (seed === undefined)
|
|
832
|
+
return null;
|
|
833
|
+
if (!seedHeld(seed.at))
|
|
834
|
+
return seed;
|
|
835
|
+
seeds.delete(plan.key);
|
|
836
|
+
return null;
|
|
837
|
+
}
|
|
838
|
+
function seedBehind(plan, cover) {
|
|
839
|
+
const seed = seedApplies(plan);
|
|
840
|
+
if (seed === null || 'pending' in cover)
|
|
841
|
+
return cover;
|
|
842
|
+
return {
|
|
843
|
+
pending: Object.entries(seed.at)
|
|
844
|
+
.filter(([room, version]) => !seedRoomHeld(room, version))
|
|
845
|
+
.map(([room]) => ({ room, awaits: 'acquisition' })),
|
|
846
|
+
};
|
|
847
|
+
}
|
|
848
|
+
function seed(entry) {
|
|
849
|
+
if (seedHeld(entry.at))
|
|
850
|
+
return;
|
|
851
|
+
for (const { query, rows } of entry.queries) {
|
|
852
|
+
const key = queryKey(query);
|
|
853
|
+
seeds.set(key, { rows, at: entry.at });
|
|
854
|
+
for (const shown of seedWatchers.get(key) ?? [])
|
|
855
|
+
shown();
|
|
856
|
+
}
|
|
857
|
+
}
|
|
813
858
|
async function rowsQuery(plan) {
|
|
814
859
|
const before = covered(plan);
|
|
815
860
|
awaitPreparation(before);
|
|
861
|
+
const seeded = seedApplies(plan);
|
|
862
|
+
if (seeded !== null)
|
|
863
|
+
return seededResult(seeded).result;
|
|
816
864
|
if ('pending' in before)
|
|
817
865
|
return before;
|
|
818
866
|
const { rows, at: cover } = await readSide.query(plan, () => covered(plan));
|
|
@@ -971,6 +1019,9 @@ export function composeRuntime(options) {
|
|
|
971
1019
|
if (fence !== undefined && fence.erased && fence.at < started)
|
|
972
1020
|
fences.delete(room.locator);
|
|
973
1021
|
}
|
|
1022
|
+
await loseRooms(found
|
|
1023
|
+
.filter((room) => room.replica.admission !== 'admitted' && heldLocally(room.locator))
|
|
1024
|
+
.map((room) => room.locator));
|
|
974
1025
|
const listed = found.filter((room) => !fences.has(room.locator));
|
|
975
1026
|
const listedLocators = new Set(listed.map((room) => room.locator));
|
|
976
1027
|
for (const locator of listedLocators)
|
|
@@ -995,6 +1046,12 @@ export function composeRuntime(options) {
|
|
|
995
1046
|
emitRooms();
|
|
996
1047
|
return listed;
|
|
997
1048
|
}
|
|
1049
|
+
function heldLocally(locator) {
|
|
1050
|
+
return (replicas.has(locator) ||
|
|
1051
|
+
roomDrafts.has(locator) ||
|
|
1052
|
+
transfers.has(locator) ||
|
|
1053
|
+
queuesWithoutReplica.has(locator));
|
|
1054
|
+
}
|
|
998
1055
|
function unlistedHeld(listed) {
|
|
999
1056
|
return [
|
|
1000
1057
|
...new Set([
|
|
@@ -1711,7 +1768,7 @@ export function composeRuntime(options) {
|
|
|
1711
1768
|
}
|
|
1712
1769
|
return undefined;
|
|
1713
1770
|
}
|
|
1714
|
-
async function invokeAction(name, input) {
|
|
1771
|
+
async function invokeAction(name, input, dispatching) {
|
|
1715
1772
|
await ready;
|
|
1716
1773
|
if (closed || refusal !== null)
|
|
1717
1774
|
return UNCERTAIN;
|
|
@@ -1725,6 +1782,7 @@ export function composeRuntime(options) {
|
|
|
1725
1782
|
}
|
|
1726
1783
|
if (closed || authorization === undefined || refusal !== null)
|
|
1727
1784
|
return UNCERTAIN;
|
|
1785
|
+
await dispatching?.();
|
|
1728
1786
|
journal.record(`transfer action ${name}`);
|
|
1729
1787
|
try {
|
|
1730
1788
|
const result = await options.adapter.action(authorization, { name, input });
|
|
@@ -1745,6 +1803,60 @@ export function composeRuntime(options) {
|
|
|
1745
1803
|
return UNCERTAIN;
|
|
1746
1804
|
}
|
|
1747
1805
|
}
|
|
1806
|
+
function unsettled(result) {
|
|
1807
|
+
return result.kind !== 'action' && result.retryable;
|
|
1808
|
+
}
|
|
1809
|
+
async function recoveredAction(name, input) {
|
|
1810
|
+
const operation = operationOf(input);
|
|
1811
|
+
if (operation === null)
|
|
1812
|
+
return invokeAction(name, input);
|
|
1813
|
+
const kept = async () => (await openLocal()).keepCall({ operation, name, input });
|
|
1814
|
+
calling.add(operation);
|
|
1815
|
+
try {
|
|
1816
|
+
let result = await invokeAction(name, input, kept);
|
|
1817
|
+
if (unsettled(result)) {
|
|
1818
|
+
await recovery.attempt(`action ${operation}`, async () => {
|
|
1819
|
+
if (closed || refusal !== null)
|
|
1820
|
+
return 'done';
|
|
1821
|
+
if (!socketOpen)
|
|
1822
|
+
return 'again';
|
|
1823
|
+
result = await invokeAction(name, input, kept);
|
|
1824
|
+
return unsettled(result) ? 'again' : 'done';
|
|
1825
|
+
}, { again: true });
|
|
1826
|
+
}
|
|
1827
|
+
if (!unsettled(result))
|
|
1828
|
+
await (await openLocal()).dropCall(operation);
|
|
1829
|
+
return result;
|
|
1830
|
+
}
|
|
1831
|
+
finally {
|
|
1832
|
+
calling.delete(operation);
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
async function resendCalls(signal) {
|
|
1836
|
+
if (!socketOpen || closed || stopping)
|
|
1837
|
+
return 'done';
|
|
1838
|
+
const local = await openLocal();
|
|
1839
|
+
for (const held of await local.calls()) {
|
|
1840
|
+
if (calling.has(held.operation))
|
|
1841
|
+
continue;
|
|
1842
|
+
if (closed || signal.aborted)
|
|
1843
|
+
return 'done';
|
|
1844
|
+
if (pastHorizon(held.operation)) {
|
|
1845
|
+
await local.dropCall(held.operation);
|
|
1846
|
+
continue;
|
|
1847
|
+
}
|
|
1848
|
+
calling.add(held.operation);
|
|
1849
|
+
try {
|
|
1850
|
+
if (unsettled(await invokeAction(held.name, held.input)))
|
|
1851
|
+
return 'again';
|
|
1852
|
+
await local.dropCall(held.operation);
|
|
1853
|
+
}
|
|
1854
|
+
finally {
|
|
1855
|
+
calling.delete(held.operation);
|
|
1856
|
+
}
|
|
1857
|
+
}
|
|
1858
|
+
return 'done';
|
|
1859
|
+
}
|
|
1748
1860
|
function continuing() {
|
|
1749
1861
|
return !closed && !discoveryPaused;
|
|
1750
1862
|
}
|
|
@@ -1762,8 +1874,9 @@ export function composeRuntime(options) {
|
|
|
1762
1874
|
async function pullRefresh(authorized, confirmed, live) {
|
|
1763
1875
|
if (!live())
|
|
1764
1876
|
return unconfirmed;
|
|
1877
|
+
const turn = generation;
|
|
1765
1878
|
try {
|
|
1766
|
-
const result = await refreshRoom(
|
|
1879
|
+
const result = await refreshRoom(reads, authorized, confirmed, (models, held) => (live() ? remodel(confirmed.record.locator, models, held) : held), live);
|
|
1767
1880
|
const detail = result.kind === 'advanced' ? result.confirmed.record.roomVersion : result.kind;
|
|
1768
1881
|
journal.record(`transfer refresh ${confirmed.record.locator} ${detail}`);
|
|
1769
1882
|
return result;
|
|
@@ -1772,6 +1885,9 @@ export function composeRuntime(options) {
|
|
|
1772
1885
|
journal.record(`transfer refresh ${confirmed.record.locator} transport-uncertainty`);
|
|
1773
1886
|
throw error;
|
|
1774
1887
|
}
|
|
1888
|
+
finally {
|
|
1889
|
+
reads.finished(confirmed.record.locator, turn);
|
|
1890
|
+
}
|
|
1775
1891
|
}
|
|
1776
1892
|
function staging(local, live) {
|
|
1777
1893
|
return {
|
|
@@ -1814,12 +1930,13 @@ export function composeRuntime(options) {
|
|
|
1814
1930
|
async function pullBootstrap(authorized, room, local, live) {
|
|
1815
1931
|
if (!live())
|
|
1816
1932
|
return unconfirmed;
|
|
1933
|
+
const turn = generation;
|
|
1817
1934
|
if (replicas.has(room.locator)) {
|
|
1818
1935
|
catching.add(room.locator);
|
|
1819
1936
|
readSide.recover();
|
|
1820
1937
|
}
|
|
1821
1938
|
try {
|
|
1822
|
-
const result = await bootstrapRoom(
|
|
1939
|
+
const result = await bootstrapRoom(reads, authorized, room, {
|
|
1823
1940
|
collection: modelOf(room.locator),
|
|
1824
1941
|
selection: modelOf(room.locator, 'typed-selection'),
|
|
1825
1942
|
}, (models, held) => (live() ? remodel(room.locator, models, held) : held), live, staging(local, live), reusable(room));
|
|
@@ -1834,12 +1951,28 @@ export function composeRuntime(options) {
|
|
|
1834
1951
|
caughtUpTo(room.locator);
|
|
1835
1952
|
throw error;
|
|
1836
1953
|
}
|
|
1954
|
+
finally {
|
|
1955
|
+
reads.finished(room.locator, turn);
|
|
1956
|
+
}
|
|
1837
1957
|
}
|
|
1838
1958
|
function caughtUpTo(locator) {
|
|
1839
1959
|
if (catching.delete(locator))
|
|
1840
1960
|
readSide.recover();
|
|
1841
1961
|
}
|
|
1962
|
+
function behind(room) {
|
|
1963
|
+
const held = replicas.get(room.locator)?.confirmed.record.roomVersion;
|
|
1964
|
+
return (held !== undefined &&
|
|
1965
|
+
[announced.get(room.locator), room.roomVersion].some((later) => later !== undefined && !options.adapter.reached(room.locator, held, later)));
|
|
1966
|
+
}
|
|
1842
1967
|
async function advance(room, local, authorized, live) {
|
|
1968
|
+
const carried = reads.carried(room.locator);
|
|
1969
|
+
const withheld = await advanceOnce(room, local, authorized, live);
|
|
1970
|
+
if (withheld !== null || reads.carried(room.locator) === carried || !behind(room)) {
|
|
1971
|
+
return withheld;
|
|
1972
|
+
}
|
|
1973
|
+
return advanceOnce(room, local, authorized, live);
|
|
1974
|
+
}
|
|
1975
|
+
async function advanceOnce(room, local, authorized, live) {
|
|
1843
1976
|
await referenced(room.locator);
|
|
1844
1977
|
if (!live() || paused.has(room.locator))
|
|
1845
1978
|
return unconfirmed;
|
|
@@ -2276,6 +2409,11 @@ export function composeRuntime(options) {
|
|
|
2276
2409
|
});
|
|
2277
2410
|
}
|
|
2278
2411
|
async function scoped(result, room, local) {
|
|
2412
|
+
if ((result.scope === 'content' || result.scope === 'sync') && !result.retryable) {
|
|
2413
|
+
journal.record(`scoped refusal ${room.locator} ${result.scope} ${result.code}`);
|
|
2414
|
+
await loseRooms([room.locator]);
|
|
2415
|
+
return;
|
|
2416
|
+
}
|
|
2279
2417
|
scopedRefusals.set(room.locator, {
|
|
2280
2418
|
code: result.code,
|
|
2281
2419
|
fields: result.fields,
|
|
@@ -2359,19 +2497,10 @@ export function composeRuntime(options) {
|
|
|
2359
2497
|
await retainModel(local, room, 'collection', modelOf(room.locator));
|
|
2360
2498
|
if (discoveryPaused || authorization === undefined)
|
|
2361
2499
|
return false;
|
|
2362
|
-
|
|
2363
|
-
if (replicas.has(room.locator))
|
|
2364
|
-
progress.complete = false;
|
|
2365
|
-
return false;
|
|
2366
|
-
}
|
|
2367
|
-
return true;
|
|
2500
|
+
return room.replica.admission === 'admitted';
|
|
2368
2501
|
}
|
|
2369
2502
|
async function caughtUp(room, local, progress, live) {
|
|
2370
|
-
|
|
2371
|
-
if (held === undefined || authorization === undefined || !live())
|
|
2372
|
-
return;
|
|
2373
|
-
const behind = [announced.get(room.locator), room.roomVersion].some((later) => later !== undefined && !options.adapter.reached(room.locator, held, later));
|
|
2374
|
-
if (!behind)
|
|
2503
|
+
if (authorization === undefined || !live() || !behind(room))
|
|
2375
2504
|
return;
|
|
2376
2505
|
const withheld = await advance(room, local, authorization, live);
|
|
2377
2506
|
if (withheld !== null)
|
|
@@ -2599,9 +2728,13 @@ export function composeRuntime(options) {
|
|
|
2599
2728
|
options.adapter.roomStream?.reopen();
|
|
2600
2729
|
});
|
|
2601
2730
|
}
|
|
2602
|
-
function closedSocket(revoked) {
|
|
2731
|
+
function closedSocket(revoked, lost) {
|
|
2603
2732
|
const opened = socketOpen;
|
|
2604
2733
|
socketOpen = false;
|
|
2734
|
+
if (lost) {
|
|
2735
|
+
reads.lost();
|
|
2736
|
+
conversations.lost();
|
|
2737
|
+
}
|
|
2605
2738
|
if (revoked) {
|
|
2606
2739
|
void refuse('revoked-authorization');
|
|
2607
2740
|
return;
|
|
@@ -2788,6 +2921,7 @@ export function composeRuntime(options) {
|
|
|
2788
2921
|
progress.complete = false;
|
|
2789
2922
|
return;
|
|
2790
2923
|
}
|
|
2924
|
+
reads.applied();
|
|
2791
2925
|
submitAll();
|
|
2792
2926
|
for (const locator of stale)
|
|
2793
2927
|
if (repairable.has(locator))
|
|
@@ -2800,6 +2934,8 @@ export function composeRuntime(options) {
|
|
|
2800
2934
|
await conversations.catchUp(reading);
|
|
2801
2935
|
if (progress.reachable && reading.reachable)
|
|
2802
2936
|
await conversations.resend(reading);
|
|
2937
|
+
if (progress.reachable)
|
|
2938
|
+
void recovery.attempt('calls', resendCalls);
|
|
2803
2939
|
if (!reading.reachable) {
|
|
2804
2940
|
progress.reachable = false;
|
|
2805
2941
|
resendLater();
|
|
@@ -2912,12 +3048,13 @@ export function composeRuntime(options) {
|
|
|
2912
3048
|
if (event.kind === 'opened') {
|
|
2913
3049
|
socketOpen = true;
|
|
2914
3050
|
generation += 1;
|
|
3051
|
+
reads.opened();
|
|
2915
3052
|
conversations.reopened();
|
|
2916
3053
|
recovery.resume();
|
|
2917
3054
|
void sync('opened');
|
|
2918
3055
|
}
|
|
2919
3056
|
else if (event.kind === 'closed')
|
|
2920
|
-
closedSocket(event.revoked);
|
|
3057
|
+
closedSocket(event.revoked, event.lost);
|
|
2921
3058
|
else if (event.kind === 'opening')
|
|
2922
3059
|
void applyOpening(event.expired);
|
|
2923
3060
|
else
|
|
@@ -3044,11 +3181,38 @@ export function composeRuntime(options) {
|
|
|
3044
3181
|
return planOf(input, roomFacts(reach), planReach(reach));
|
|
3045
3182
|
}
|
|
3046
3183
|
function watchPlan(plan, deliver) {
|
|
3047
|
-
|
|
3184
|
+
let seeded = false;
|
|
3185
|
+
let pending = true;
|
|
3186
|
+
const shown = () => {
|
|
3187
|
+
const seed = seeds.get(plan.key);
|
|
3188
|
+
if (seed === undefined || seeded || !pending)
|
|
3189
|
+
return;
|
|
3190
|
+
seeded = true;
|
|
3191
|
+
deliver(seededResult(seed));
|
|
3192
|
+
};
|
|
3193
|
+
const watchers = seedWatchers.get(plan.key) ?? new Set();
|
|
3194
|
+
seedWatchers.set(plan.key, watchers);
|
|
3195
|
+
watchers.add(shown);
|
|
3196
|
+
const stop = readSide.watch(plan, identityOf(plan), () => {
|
|
3048
3197
|
const cover = covered(plan);
|
|
3049
3198
|
awaitPreparation(cover);
|
|
3050
|
-
return cover;
|
|
3051
|
-
},
|
|
3199
|
+
return seedBehind(plan, cover);
|
|
3200
|
+
}, (message) => {
|
|
3201
|
+
const answered = message;
|
|
3202
|
+
pending = whole(answered) && 'pending' in answered.result;
|
|
3203
|
+
if (pending && seeds.has(plan.key)) {
|
|
3204
|
+
shown();
|
|
3205
|
+
return;
|
|
3206
|
+
}
|
|
3207
|
+
seeded = false;
|
|
3208
|
+
deliver(message);
|
|
3209
|
+
});
|
|
3210
|
+
return () => {
|
|
3211
|
+
watchers.delete(shown);
|
|
3212
|
+
if (watchers.size === 0)
|
|
3213
|
+
seedWatchers.delete(plan.key);
|
|
3214
|
+
stop();
|
|
3215
|
+
};
|
|
3052
3216
|
}
|
|
3053
3217
|
async function searched(input, reach) {
|
|
3054
3218
|
const plan = searchPlanOf(input);
|
|
@@ -3057,40 +3221,60 @@ export function composeRuntime(options) {
|
|
|
3057
3221
|
const cover = covered(filter);
|
|
3058
3222
|
awaitPreparation(cover);
|
|
3059
3223
|
const pending = 'pending' in cover ? [...cover.pending] : [];
|
|
3060
|
-
const
|
|
3224
|
+
const awaited = new Set('pending' in cover ? cover.pending.map(({ room }) => room) : []);
|
|
3225
|
+
const held = covered({
|
|
3226
|
+
...filter,
|
|
3227
|
+
rooms: reachedRooms(filter).filter((room) => !awaited.has(room)),
|
|
3228
|
+
});
|
|
3229
|
+
const covering = 'pending' in held ? [] : held.coverage.rooms;
|
|
3061
3230
|
const unindexed = covering
|
|
3062
3231
|
.filter(({ room }) => !searchIndex.rooms().has(room))
|
|
3063
3232
|
.map(({ room }) => room);
|
|
3064
3233
|
for (const room of unindexed)
|
|
3065
3234
|
pending.push({ room, awaits: 'index' });
|
|
3066
|
-
const
|
|
3235
|
+
const listed = conversations.searchable();
|
|
3067
3236
|
const named = reach !== null && !reach.conversations
|
|
3068
3237
|
? []
|
|
3069
|
-
: (plan.conversations ??
|
|
3238
|
+
: (plan.conversations ?? listed).filter((one) => listed.includes(one) && conversations.acquired(one));
|
|
3070
3239
|
const waiting = named.filter((one) => !searchIndex.conversations().has(one));
|
|
3071
3240
|
for (const conversation of waiting)
|
|
3072
3241
|
pending.push({ conversation, awaits: 'index' });
|
|
3073
3242
|
if (unindexed.length > 0 || waiting.length > 0)
|
|
3074
3243
|
index(unindexed, waiting);
|
|
3075
|
-
|
|
3076
|
-
|
|
3244
|
+
const complete = pending.length === 0 && !('pending' in cover);
|
|
3245
|
+
const answering = complete
|
|
3246
|
+
? filter
|
|
3247
|
+
: {
|
|
3248
|
+
...filter,
|
|
3249
|
+
rooms: covering
|
|
3250
|
+
.filter(({ room }) => searchIndex.rooms().has(room))
|
|
3251
|
+
.map(({ room }) => room),
|
|
3252
|
+
};
|
|
3253
|
+
const answered = covered(answering);
|
|
3254
|
+
if ('pending' in answered)
|
|
3255
|
+
continue;
|
|
3256
|
+
const searchedConversations = named.filter((one) => searchIndex.conversations().has(one));
|
|
3077
3257
|
const seen = searchIndex.changes();
|
|
3078
3258
|
await searchIndex.caughtUp();
|
|
3079
|
-
const selected =
|
|
3259
|
+
const selected = roomsAlone(answering) ? null : await rowsQuery(answering);
|
|
3080
3260
|
if (selected !== null && 'pending' in selected)
|
|
3081
|
-
|
|
3261
|
+
continue;
|
|
3082
3262
|
if (searchIndex.changes() !== seen ||
|
|
3083
|
-
JSON.stringify(covered(
|
|
3263
|
+
JSON.stringify(covered(answering)) !== JSON.stringify(answered))
|
|
3084
3264
|
continue;
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3265
|
+
const hits = searchIndex.search(plan, selected === null ? null : selected.documents, searchedConversations, answering.rooms === null ? null : new Set(answering.rooms), plan.collection
|
|
3266
|
+
? new Map(answered.coverage.rooms.map(({ room }) => [
|
|
3267
|
+
room,
|
|
3268
|
+
replicas.get(room)?.confirmed.record.typedSelection?.roots ?? [],
|
|
3269
|
+
]))
|
|
3270
|
+
: null);
|
|
3271
|
+
const coverage = {
|
|
3272
|
+
rooms: answered.coverage.rooms,
|
|
3273
|
+
conversations: searchedConversations,
|
|
3274
|
+
index: searchIndex.generation(),
|
|
3275
|
+
overlay: answered.coverage.overlay,
|
|
3093
3276
|
};
|
|
3277
|
+
return complete ? { ...hits, coverage } : { pending, ...hits, coverage };
|
|
3094
3278
|
}
|
|
3095
3279
|
}
|
|
3096
3280
|
const watch = (topic, input, deliver) => {
|
|
@@ -3138,7 +3322,7 @@ export function composeRuntime(options) {
|
|
|
3138
3322
|
};
|
|
3139
3323
|
}
|
|
3140
3324
|
if (topic === 'readiness') {
|
|
3141
|
-
return watchReadiness({ target: '', code: 'stored', capacity: null }, null, deliver);
|
|
3325
|
+
return watchReadiness({ target: '', code: 'stored', capacity: null, search: 'unused' }, null, deliver);
|
|
3142
3326
|
}
|
|
3143
3327
|
if (topic === 'rooms') {
|
|
3144
3328
|
roomListeners.add(deliver);
|
|
@@ -3295,7 +3479,7 @@ export function composeRuntime(options) {
|
|
|
3295
3479
|
readReference: readBinaryReference,
|
|
3296
3480
|
},
|
|
3297
3481
|
call(name, input) {
|
|
3298
|
-
return
|
|
3482
|
+
return recoveredAction(name, input);
|
|
3299
3483
|
},
|
|
3300
3484
|
reached(locator, roomVersion, path) {
|
|
3301
3485
|
return path === undefined
|
|
@@ -3339,11 +3523,11 @@ export function composeRuntime(options) {
|
|
|
3339
3523
|
query: (plan) => rowsQuery(plan),
|
|
3340
3524
|
watchPlan,
|
|
3341
3525
|
search: searched,
|
|
3342
|
-
searching,
|
|
3343
3526
|
watchReadiness,
|
|
3344
3527
|
};
|
|
3345
3528
|
return {
|
|
3346
3529
|
md,
|
|
3530
|
+
seed,
|
|
3347
3531
|
stop,
|
|
3348
3532
|
lose: loseRooms,
|
|
3349
3533
|
watch,
|
package/dist/conversation.d.ts
CHANGED
|
@@ -89,6 +89,7 @@ export type ConversationStore = {
|
|
|
89
89
|
known(): boolean;
|
|
90
90
|
reconnected(): void;
|
|
91
91
|
reopened(): void;
|
|
92
|
+
lost(): void;
|
|
92
93
|
watch(conversation: string, options: ConversationOptions, deliver: (view: ConversationView) => void): () => void;
|
|
93
94
|
watchList(deliver: (entries: readonly ConversationEntry[]) => void): () => void;
|
|
94
95
|
watchAgents(deliver: (agents: readonly ConversationAgent[]) => void): () => void;
|
|
@@ -100,5 +101,6 @@ export type ConversationStore = {
|
|
|
100
101
|
};
|
|
101
102
|
export declare function unheldView(conversation: string): ConversationView;
|
|
102
103
|
export declare const SESSION_STARTED = "Session started";
|
|
104
|
+
export declare function newChat(agent: string): string;
|
|
103
105
|
export declare function createConversationStore(deps: ConversationDependencies): ConversationStore;
|
|
104
106
|
//# sourceMappingURL=conversation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../src/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EAEjB,mBAAmB,EACnB,kBAAkB,EAElB,cAAc,EACd,aAAa,EACb,WAAW,EAEZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAyB,KAAK,SAAS,EAAsB,MAAM,iBAAiB,CAAC;AAE5F,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AAE7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAW,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAA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