@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/conversation.js
CHANGED
|
@@ -23,6 +23,16 @@ export function unheldView(conversation) {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
export const SESSION_STARTED = 'Session started';
|
|
26
|
+
const NEW_CHAT = 'new:';
|
|
27
|
+
export function newChat(agent) {
|
|
28
|
+
return `${NEW_CHAT}${agent}`;
|
|
29
|
+
}
|
|
30
|
+
function creationOf(input) {
|
|
31
|
+
if (typeof input !== 'object' || input === null)
|
|
32
|
+
return null;
|
|
33
|
+
const { agent_id: agent, operation_id: operation } = input;
|
|
34
|
+
return typeof agent === 'string' && typeof operation === 'string' ? { agent, operation } : null;
|
|
35
|
+
}
|
|
26
36
|
function startedTurn(turn, operation) {
|
|
27
37
|
if (operation.op === 'begin')
|
|
28
38
|
return { turn, started: operation.at, parts: [], context: null };
|
|
@@ -146,14 +156,14 @@ function historyPages(result) {
|
|
|
146
156
|
}
|
|
147
157
|
return pages;
|
|
148
158
|
}
|
|
149
|
-
function
|
|
159
|
+
function answered(result, field) {
|
|
150
160
|
if (result.kind !== 'action')
|
|
151
161
|
return null;
|
|
152
162
|
const answer = result.result;
|
|
153
163
|
if (typeof answer !== 'object' || answer === null)
|
|
154
164
|
return null;
|
|
155
|
-
const
|
|
156
|
-
return typeof
|
|
165
|
+
const value = answer[field];
|
|
166
|
+
return typeof value === 'string' ? value : null;
|
|
157
167
|
}
|
|
158
168
|
function limitOf(options) {
|
|
159
169
|
const { limit } = options;
|
|
@@ -169,7 +179,13 @@ function unwritten(draft) {
|
|
|
169
179
|
return draft.text === '' && draft.files.length === 0;
|
|
170
180
|
}
|
|
171
181
|
function pending(draft) {
|
|
172
|
-
return
|
|
182
|
+
return {
|
|
183
|
+
...(draft.submitted === undefined ? {} : { submitted: draft.submitted }),
|
|
184
|
+
...(draft.moves === undefined ? {} : { moves: draft.moves }),
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
function empty(draft) {
|
|
188
|
+
return unwritten(draft) && draft.submitted === undefined && draft.moves === undefined;
|
|
173
189
|
}
|
|
174
190
|
function withSubmitted(draft, submitted) {
|
|
175
191
|
const { submitted: _held, ...unsent } = draft;
|
|
@@ -190,10 +206,12 @@ export function createConversationStore(deps) {
|
|
|
190
206
|
const drafts = new Map();
|
|
191
207
|
const sending = new Map();
|
|
192
208
|
const behind = new Set();
|
|
209
|
+
const catching = new Map();
|
|
193
210
|
const gaps = new Map();
|
|
194
211
|
const lives = new Map();
|
|
195
212
|
const views = new Map();
|
|
196
213
|
const listing = new Map();
|
|
214
|
+
const creations = new Set();
|
|
197
215
|
const listWatchers = new Set();
|
|
198
216
|
let listKnown = false;
|
|
199
217
|
const agentWatchers = new Set();
|
|
@@ -332,6 +350,12 @@ export function createConversationStore(deps) {
|
|
|
332
350
|
if (named)
|
|
333
351
|
emitList();
|
|
334
352
|
emitAgents();
|
|
353
|
+
const ended = [...drafts.keys()].filter(retiredChat);
|
|
354
|
+
if (ended.length > 0)
|
|
355
|
+
await remove(ended);
|
|
356
|
+
}
|
|
357
|
+
function retiredChat(conversation) {
|
|
358
|
+
return (conversation.startsWith(NEW_CHAT) && retiredAgents.has(conversation.slice(NEW_CHAT.length)));
|
|
335
359
|
}
|
|
336
360
|
function agentsReady() {
|
|
337
361
|
agentsRead ??= readAgents().catch(() => {
|
|
@@ -419,7 +443,7 @@ export function createConversationStore(deps) {
|
|
|
419
443
|
deps.publish(conversationChangeSet(changesOf(conversation, [message]), [conversation]));
|
|
420
444
|
});
|
|
421
445
|
}
|
|
422
|
-
async function readHistories(conversations) {
|
|
446
|
+
async function readHistories(conversations, ended) {
|
|
423
447
|
const generations = new Map(conversations.map((one) => [one, gaps.get(one) ?? 0]));
|
|
424
448
|
let asking = conversations.map((conversation) => ({
|
|
425
449
|
conversation,
|
|
@@ -445,10 +469,33 @@ export function createConversationStore(deps) {
|
|
|
445
469
|
following.push({ conversation: page.conversation, after: page.next });
|
|
446
470
|
}
|
|
447
471
|
}
|
|
472
|
+
for (const { conversation } of asking) {
|
|
473
|
+
if (!following.some((next) => next.conversation === conversation))
|
|
474
|
+
ended(conversation);
|
|
475
|
+
}
|
|
448
476
|
asking = following;
|
|
449
477
|
}
|
|
450
478
|
return null;
|
|
451
479
|
}
|
|
480
|
+
function caughtUp(conversations) {
|
|
481
|
+
const ends = new Map();
|
|
482
|
+
for (const conversation of conversations) {
|
|
483
|
+
const held = new Promise((end) => ends.set(conversation, end));
|
|
484
|
+
catching.set(conversation, held);
|
|
485
|
+
void held.then(() => {
|
|
486
|
+
if (catching.get(conversation) === held)
|
|
487
|
+
catching.delete(conversation);
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
const ended = (conversation) => ends.get(conversation)?.();
|
|
491
|
+
const read = readHistories(conversations, ended);
|
|
492
|
+
const endAll = () => {
|
|
493
|
+
for (const conversation of conversations)
|
|
494
|
+
ended(conversation);
|
|
495
|
+
};
|
|
496
|
+
read.then(endAll, endAll);
|
|
497
|
+
return read;
|
|
498
|
+
}
|
|
452
499
|
function keepPage(conversation, arriving, from, next, generation) {
|
|
453
500
|
return deps.durably(async (local) => {
|
|
454
501
|
if (!replicated.has(conversation))
|
|
@@ -516,12 +563,12 @@ export function createConversationStore(deps) {
|
|
|
516
563
|
emit(conversation);
|
|
517
564
|
}
|
|
518
565
|
async function kept(local, conversation, following) {
|
|
519
|
-
if (following === null || (
|
|
566
|
+
if (following === null || empty(following)) {
|
|
520
567
|
await local.dropChatDraft(conversation);
|
|
521
568
|
drafts.delete(conversation);
|
|
522
569
|
}
|
|
523
570
|
else {
|
|
524
|
-
await local.
|
|
571
|
+
await local.keepChatDrafts([following]);
|
|
525
572
|
drafts.set(conversation, following);
|
|
526
573
|
}
|
|
527
574
|
}
|
|
@@ -534,6 +581,29 @@ export function createConversationStore(deps) {
|
|
|
534
581
|
await kept(local, conversation, withSubmitted(held, left));
|
|
535
582
|
return true;
|
|
536
583
|
}
|
|
584
|
+
function moved(agent, operation, to) {
|
|
585
|
+
const from = newChat(agent);
|
|
586
|
+
return deps.durably(async (local) => {
|
|
587
|
+
const held = drafts.get(from);
|
|
588
|
+
const earlier = (held?.moves ?? []).filter((one) => !deps.expired(one));
|
|
589
|
+
if (earlier.includes(operation))
|
|
590
|
+
return;
|
|
591
|
+
const blank = {
|
|
592
|
+
conversation: from,
|
|
593
|
+
text: '',
|
|
594
|
+
files: [],
|
|
595
|
+
revision: chatDraftRevision(),
|
|
596
|
+
};
|
|
597
|
+
const { moves: _answered, ...unsent } = held ?? blank;
|
|
598
|
+
const taken = drafts.has(to) || empty(unsent) ? [] : [{ ...unsent, conversation: to }];
|
|
599
|
+
const left = { ...(taken.length === 0 ? unsent : blank), moves: [...earlier, operation] };
|
|
600
|
+
await local.keepChatDrafts([left, ...taken]);
|
|
601
|
+
drafts.set(from, left);
|
|
602
|
+
for (const one of taken)
|
|
603
|
+
drafts.set(to, one);
|
|
604
|
+
deps.publish(conversationChangeSet([], [from, to]));
|
|
605
|
+
});
|
|
606
|
+
}
|
|
537
607
|
function withDraft(conversation, next) {
|
|
538
608
|
return deps.durably(async (local) => {
|
|
539
609
|
const following = await next(drafts.get(conversation), local);
|
|
@@ -592,7 +662,7 @@ export function createConversationStore(deps) {
|
|
|
592
662
|
deps.unanswered();
|
|
593
663
|
return result;
|
|
594
664
|
}
|
|
595
|
-
const turn =
|
|
665
|
+
const turn = answered(result, 'turn');
|
|
596
666
|
await withDraft(conversation, async (current, local) => {
|
|
597
667
|
const held = current?.submitted?.find((one) => one.operation === submission.operation);
|
|
598
668
|
if (current === undefined || held === undefined || held.turn !== null)
|
|
@@ -624,8 +694,17 @@ export function createConversationStore(deps) {
|
|
|
624
694
|
const limit = limitOf(options);
|
|
625
695
|
return deps.durably(async (local) => structuredClone(viewOf(conversation, await local.messageWindow(conversation, limit))));
|
|
626
696
|
},
|
|
627
|
-
create(input) {
|
|
628
|
-
|
|
697
|
+
async create(input) {
|
|
698
|
+
const result = await deps.call('conversation.create', input);
|
|
699
|
+
const conversation = answered(result, 'conversation');
|
|
700
|
+
if (conversation === null)
|
|
701
|
+
return result;
|
|
702
|
+
if (!listing.has(conversation))
|
|
703
|
+
creations.add(conversation);
|
|
704
|
+
const creation = creationOf(input);
|
|
705
|
+
if (creation !== null)
|
|
706
|
+
await moved(creation.agent, creation.operation, conversation);
|
|
707
|
+
return result;
|
|
629
708
|
},
|
|
630
709
|
async send(conversation, operation = changeBatchIdentity(), draft) {
|
|
631
710
|
if (deps.online()) {
|
|
@@ -674,7 +753,7 @@ export function createConversationStore(deps) {
|
|
|
674
753
|
text: draft.text,
|
|
675
754
|
files: [...draft.files],
|
|
676
755
|
revision,
|
|
677
|
-
...(current
|
|
756
|
+
...(current === undefined ? {} : pending(current)),
|
|
678
757
|
}));
|
|
679
758
|
},
|
|
680
759
|
discard(conversation) {
|
|
@@ -713,7 +792,9 @@ export function createConversationStore(deps) {
|
|
|
713
792
|
const named = new Set(listing.keys());
|
|
714
793
|
const leaving = [
|
|
715
794
|
...new Set([...replicated, ...stored, ...reads.keys(), ...drafts.keys()]),
|
|
716
|
-
].filter((conversation) => !named.has(conversation)
|
|
795
|
+
].filter((conversation) => !named.has(conversation) &&
|
|
796
|
+
!creations.has(conversation) &&
|
|
797
|
+
(!conversation.startsWith(NEW_CHAT) || retiredChat(conversation)));
|
|
717
798
|
for (const conversation of named) {
|
|
718
799
|
if (!replicated.has(conversation))
|
|
719
800
|
behind.add(conversation);
|
|
@@ -724,12 +805,20 @@ export function createConversationStore(deps) {
|
|
|
724
805
|
await remove(leaving);
|
|
725
806
|
},
|
|
726
807
|
async catchUp(progress) {
|
|
727
|
-
const
|
|
728
|
-
|
|
729
|
-
|
|
808
|
+
const owed = (conversation) => behind.has(conversation) && replicated.has(conversation);
|
|
809
|
+
const read = async (conversations) => {
|
|
810
|
+
if (conversations.length === 0 || deps.closed())
|
|
811
|
+
return;
|
|
812
|
+
const failed = await caughtUp(conversations);
|
|
730
813
|
if (failed?.kind === 'transport-uncertainty')
|
|
731
814
|
progress.reachable = false;
|
|
732
|
-
}
|
|
815
|
+
};
|
|
816
|
+
const asking = [...behind].filter(owed).sort();
|
|
817
|
+
const awaited = asking.filter((conversation) => catching.has(conversation));
|
|
818
|
+
await Promise.all([
|
|
819
|
+
read(asking.filter((conversation) => !catching.has(conversation))),
|
|
820
|
+
Promise.all(awaited.map((conversation) => catching.get(conversation))).then(() => read(awaited.filter((conversation) => owed(conversation) && !catching.has(conversation)))),
|
|
821
|
+
]);
|
|
733
822
|
if (behind.size > 0)
|
|
734
823
|
progress.complete = false;
|
|
735
824
|
},
|
|
@@ -771,6 +860,9 @@ export function createConversationStore(deps) {
|
|
|
771
860
|
reopened() {
|
|
772
861
|
sending.clear();
|
|
773
862
|
},
|
|
863
|
+
lost() {
|
|
864
|
+
catching.clear();
|
|
865
|
+
},
|
|
774
866
|
watch(conversation, options, deliver) {
|
|
775
867
|
const limit = limitOf(options);
|
|
776
868
|
const key = JSON.stringify([conversation, limit ?? null]);
|
|
@@ -838,12 +930,15 @@ export function createConversationStore(deps) {
|
|
|
838
930
|
if (event.kind === 'list' || event.kind === 'listed' || event.kind === 'unlisted') {
|
|
839
931
|
if (event.kind === 'list') {
|
|
840
932
|
listing.clear();
|
|
841
|
-
for (const entry of event.entries)
|
|
933
|
+
for (const entry of event.entries) {
|
|
842
934
|
listing.set(entry.conversation, { ...entry });
|
|
935
|
+
creations.delete(entry.conversation);
|
|
936
|
+
}
|
|
843
937
|
listKnown = true;
|
|
844
938
|
}
|
|
845
939
|
else if (event.kind === 'listed') {
|
|
846
940
|
listing.set(event.entry.conversation, { ...event.entry });
|
|
941
|
+
creations.delete(event.entry.conversation);
|
|
847
942
|
}
|
|
848
943
|
else {
|
|
849
944
|
listing.delete(event.conversation);
|
package/dist/entry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../src/entry.ts"],"names":[],"mappings":"AAGA,OAAO,EAML,KAAK,SAAS,EAEf,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA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O,CAE3E;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,MAAM,EAAE,CAMpE;AAkCD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAQ7D;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;CACzF,CAAC;AAEF,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,GAAG,UAAU,CAsDlE"}
|
package/dist/entry.js
CHANGED
|
@@ -131,7 +131,7 @@ export function entryScope(rooms) {
|
|
|
131
131
|
locator: room.locator,
|
|
132
132
|
path,
|
|
133
133
|
before: [],
|
|
134
|
-
after: rowsOf(room.locator, path, passingFrontmatter(collection, path) ?? null, composition, null, null),
|
|
134
|
+
after: rowsOf(room.locator, path, passingFrontmatter(collection, path) ?? null, composition, null, null, null),
|
|
135
135
|
}));
|
|
136
136
|
});
|
|
137
137
|
readSide.apply({
|
package/dist/host.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type MdRuntimeOptions } from './connection.js';
|
|
2
2
|
import type { RuntimeDemand } from './acquisition.js';
|
|
3
3
|
import type { PortReach } from './reach.js';
|
|
4
|
-
import type { CapacityCause, CodeAvailability, Persistence, Readiness } from './readiness.js';
|
|
4
|
+
import type { CapacityCause, CodeAvailability, Persistence, Readiness, SearchObligation } from './readiness.js';
|
|
5
|
+
import type { EntrySeed } from './seed.js';
|
|
5
6
|
import { type RuntimePort } from './wire.js';
|
|
6
7
|
export type MdRuntimeHostOptions = MdRuntimeOptions & {
|
|
7
8
|
deploymentFacts?: unknown;
|
|
@@ -10,11 +11,14 @@ export type AttachedPort = {
|
|
|
10
11
|
detach(): void;
|
|
11
12
|
narrow(reach: PortReach): void;
|
|
12
13
|
readiness(deliver: (readiness: Readiness) => void): () => void;
|
|
14
|
+
answered(queries: readonly unknown[], done: () => void): void;
|
|
13
15
|
code(code: CodeAvailability, capacity: CapacityCause | null): void;
|
|
16
|
+
search(search: SearchObligation): void;
|
|
14
17
|
};
|
|
15
18
|
export type MdRuntimeHost = {
|
|
16
|
-
attach(port: RuntimePort, app: string, release?: string, reach?: PortReach, code?: CodeAvailability): AttachedPort;
|
|
19
|
+
attach(port: RuntimePort, app: string, release?: string, reach?: PortReach, code?: CodeAvailability, search?: SearchObligation): AttachedPort;
|
|
17
20
|
acquire(demand: RuntimeDemand): void;
|
|
21
|
+
seed(entry: EntrySeed): void;
|
|
18
22
|
persisted(answer: Persistence): void;
|
|
19
23
|
endAuthorization(holder?: string): Promise<void>;
|
|
20
24
|
lose(locators: readonly string[]): Promise<void>;
|
|
@@ -22,8 +26,9 @@ export type MdRuntimeHost = {
|
|
|
22
26
|
};
|
|
23
27
|
export declare function serveMdRuntime(options: MdRuntimeHostOptions): MdRuntimeHost;
|
|
24
28
|
export type { RuntimeDemand } from './acquisition.js';
|
|
29
|
+
export { entrySeedOf, type EntrySeed } from './seed.js';
|
|
25
30
|
export type { PortReach, ReachedDocument } from './reach.js';
|
|
26
|
-
export type { CapacityCause, CodeAvailability, Persistence } from './readiness.js';
|
|
31
|
+
export type { CapacityCause, CodeAvailability, Persistence, SearchObligation, } from './readiness.js';
|
|
27
32
|
export { createRecovery, retryDelay, type Attempt, type Attempted, type AttemptOptions, type Recovery, type RecoveryOptions, } from './recovery.js';
|
|
28
33
|
export { AUTHORED_SCHEMA, authoredBinding, authoredBy, authoredHolder, bindAuthored, openDatabase, STORE_SCHEMA, } from './store.js';
|
|
29
34
|
export type { RuntimePort } from './wire.js';
|
package/dist/host.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAEA,OAAO,E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,MAAM,CAAC,EAAE,gBAAgB,GACxB,YAAY,CAAC;IAChB,OAAO,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;IACrC,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,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,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB,CAAC;AAqGF,wBAAgB,cAAc,CAAC,OAAO,EAAE,oBAAoB,GAAG,aAAa,CAyK3E;AAED,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACxD,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7D,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,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,EACL,eAAe,EACf,eAAe,EACf,UAAU,EACV,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/host.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { composeRuntime, } from './connection.js';
|
|
2
|
+
import { queryKey } from './query.js';
|
|
2
3
|
import { described } from './failure.js';
|
|
3
4
|
import { removeRuntimeStore } from './store.js';
|
|
4
|
-
import { AUTHORIZATION_ENDED, request,
|
|
5
|
+
import { AUTHORIZATION_ENDED, request, WIRE, } from './wire.js';
|
|
5
6
|
const NARROWED = new Set(['within', 'whole']);
|
|
6
7
|
function answered(md, app, writtenBy, member, input) {
|
|
7
8
|
switch (member) {
|
|
@@ -69,6 +70,14 @@ function answered(md, app, writtenBy, member, input) {
|
|
|
69
70
|
return md.chatDraft.discard(input[0]);
|
|
70
71
|
}
|
|
71
72
|
}
|
|
73
|
+
function answeredResult(value) {
|
|
74
|
+
return typeof value === 'object' && value !== null && !('pending' in value);
|
|
75
|
+
}
|
|
76
|
+
function answeredMessage(value) {
|
|
77
|
+
if (typeof value !== 'object' || value === null)
|
|
78
|
+
return false;
|
|
79
|
+
return !('result' in value) || answeredResult(value.result);
|
|
80
|
+
}
|
|
72
81
|
export function serveMdRuntime(options) {
|
|
73
82
|
const deploymentFacts = structuredClone(options.deploymentFacts);
|
|
74
83
|
const closing = new AbortController();
|
|
@@ -86,14 +95,25 @@ export function serveMdRuntime(options) {
|
|
|
86
95
|
deliver(structuredClone(deploymentFacts));
|
|
87
96
|
return () => { };
|
|
88
97
|
};
|
|
89
|
-
function attach(port, app, release, reach, code = 'stored') {
|
|
98
|
+
function attach(port, app, release, reach, code = 'stored', search = 'unused') {
|
|
90
99
|
if (!authorized)
|
|
91
100
|
throw new Error(AUTHORIZATION_ENDED);
|
|
92
101
|
const writtenBy = release === undefined ? undefined : { app, release };
|
|
93
|
-
|
|
102
|
+
let facts = { target: app, code, capacity: null, search };
|
|
103
|
+
const view = runtime.within(reach ?? null, facts);
|
|
94
104
|
const observations = new Map();
|
|
95
105
|
const followed = new Set();
|
|
106
|
+
const answeredKeys = new Set();
|
|
107
|
+
let awaited = null;
|
|
96
108
|
let serving = true;
|
|
109
|
+
const answeredQuery = (query) => {
|
|
110
|
+
answeredKeys.add(queryKey(query));
|
|
111
|
+
if (awaited === null || !awaited.keys.every((key) => answeredKeys.has(key)))
|
|
112
|
+
return;
|
|
113
|
+
const { done } = awaited;
|
|
114
|
+
awaited = null;
|
|
115
|
+
done();
|
|
116
|
+
};
|
|
97
117
|
const send = (message) => {
|
|
98
118
|
port.postMessage(message);
|
|
99
119
|
};
|
|
@@ -115,10 +135,12 @@ export function serveMdRuntime(options) {
|
|
|
115
135
|
return;
|
|
116
136
|
send(resolved ? { kind: 'event', id, value } : { kind: 'result', id, value });
|
|
117
137
|
resolved = true;
|
|
138
|
+
if (topic === 'query' && answeredMessage(value))
|
|
139
|
+
answeredQuery(input[0]);
|
|
118
140
|
};
|
|
119
141
|
observations.set(id, topic === 'deployment-facts'
|
|
120
142
|
? watchFacts(deliver)
|
|
121
|
-
: (NARROWED.has(
|
|
143
|
+
: (NARROWED.has(WIRE.topics[topic]) ? view : runtime).watch(topic, topic === 'presentation' ? [app] : input, deliver));
|
|
122
144
|
};
|
|
123
145
|
const serve = async (message) => {
|
|
124
146
|
if (message.kind === 'hello')
|
|
@@ -136,9 +158,12 @@ export function serveMdRuntime(options) {
|
|
|
136
158
|
observe(message.id, message.topic, message.input);
|
|
137
159
|
return;
|
|
138
160
|
}
|
|
139
|
-
const value = await answered(NARROWED.has(
|
|
140
|
-
if (serving)
|
|
141
|
-
|
|
161
|
+
const value = await answered(NARROWED.has(WIRE.members[message.member].reach) ? view.md : md, app, writtenBy, message.member, message.input);
|
|
162
|
+
if (!serving)
|
|
163
|
+
return;
|
|
164
|
+
send({ kind: 'result', id: message.id, value });
|
|
165
|
+
if (message.member === 'query' && answeredResult(value))
|
|
166
|
+
answeredQuery(message.input[0]);
|
|
142
167
|
}
|
|
143
168
|
catch (error) {
|
|
144
169
|
if (serving)
|
|
@@ -163,8 +188,23 @@ export function serveMdRuntime(options) {
|
|
|
163
188
|
view.narrow(next);
|
|
164
189
|
},
|
|
165
190
|
code(next, capacity) {
|
|
166
|
-
if (serving)
|
|
167
|
-
|
|
191
|
+
if (!serving)
|
|
192
|
+
return;
|
|
193
|
+
facts = { ...facts, code: next, capacity };
|
|
194
|
+
view.facts(facts);
|
|
195
|
+
},
|
|
196
|
+
search(next) {
|
|
197
|
+
if (!serving)
|
|
198
|
+
return;
|
|
199
|
+
facts = { ...facts, search: next };
|
|
200
|
+
view.facts(facts);
|
|
201
|
+
},
|
|
202
|
+
answered(queries, done) {
|
|
203
|
+
const keys = queries.map(queryKey);
|
|
204
|
+
if (keys.every((key) => answeredKeys.has(key)))
|
|
205
|
+
done();
|
|
206
|
+
else
|
|
207
|
+
awaited = { keys, done };
|
|
168
208
|
},
|
|
169
209
|
readiness(deliver) {
|
|
170
210
|
if (!serving)
|
|
@@ -187,6 +227,9 @@ export function serveMdRuntime(options) {
|
|
|
187
227
|
acquire(demand) {
|
|
188
228
|
runtime.acquire(demand);
|
|
189
229
|
},
|
|
230
|
+
seed(entry) {
|
|
231
|
+
runtime.seed(entry);
|
|
232
|
+
},
|
|
190
233
|
persisted(answer) {
|
|
191
234
|
runtime.persisted(answer);
|
|
192
235
|
},
|
|
@@ -208,5 +251,6 @@ export function serveMdRuntime(options) {
|
|
|
208
251
|
},
|
|
209
252
|
};
|
|
210
253
|
}
|
|
254
|
+
export { entrySeedOf } from './seed.js';
|
|
211
255
|
export { createRecovery, retryDelay, } from './recovery.js';
|
|
212
256
|
export { AUTHORED_SCHEMA, authoredBinding, authoredBy, authoredHolder, bindAuthored, openDatabase, STORE_SCHEMA, } from './store.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -7,10 +7,11 @@ export type { Observation } from './observation.js';
|
|
|
7
7
|
export type { BinaryAnswer, CallResult, Failure, HistoryAnswer, Offline, QueueEntry, Submission, } from './outcome.js';
|
|
8
8
|
export type { BinaryFileRecord, BinaryReference } from './binary.js';
|
|
9
9
|
export type { RuntimeError } from './failure.js';
|
|
10
|
-
export type { ChangedPart, FieldValue, ReturnReason, RoomDraft, RoomDraftCreation, RoomDraftParts, RoomDraftWrite, } from './room-draft.js';
|
|
10
|
+
export type { ChangedPart, FieldValue, ReturnReason, RoomDraft, RoomDraftCreation, RoomDraftParts, RoomDraftWrite, TextParts, } from './room-draft.js';
|
|
11
11
|
export type { SaveRefusal } from './save.js';
|
|
12
|
-
export type { DocumentHit, DocumentPart, MessageHit, PendingConversation, SearchCoverage, SearchHits, SearchPending, SearchRequest, SearchResult, } from './search.js';
|
|
12
|
+
export type { DocumentHit, DocumentPart, MessageHit, PendingConversation, SearchCoverage, SearchHits, SearchPending, SearchRequest, SearchResult, SearchUndeclared, } from './search.js';
|
|
13
13
|
export { departure } from './change.js';
|
|
14
|
+
export { partsAfter } from './room-draft.js';
|
|
14
15
|
export { SESSION_STARTED } from './conversation.js';
|
|
15
16
|
export { changeBatchIdentity } from './identity.js';
|
|
16
17
|
export { attempts, identities, intentOf, type Answered, type Attempt, type Attempts, type Identities, } from './attempt.js';
|
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,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,cAAc,EACd,aAAa,EACb,UAAU,EACV,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,SAAS,EACT,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,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,oBAAoB,EACpB,UAAU,EACV,eAAe,EACf,UAAU,EACV,eAAe,EACf,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,WAAW,EACX,aAAa,EACb,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAChF,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAChE,YAAY,EACV,OAAO,EACP,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,UAAU,GACX,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EACV,YAAY,EACZ,UAAU,EACV,OAAO,EACP,aAAa,EACb,OAAO,EACP,UAAU,EACV,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACrE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,YAAY,EACV,WAAW,EACX,UAAU,EACV,YAAY,EACZ,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,cAAc,EACd,aAAa,EACb,UAAU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B,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9D,YAAY,EACV,MAAM,EACN,QAAQ,EACR,WAAW,EACX,SAAS,EACT,aAAa,EACb,cAAc,EACd,MAAM,EACN,UAAU,EACV,WAAW,EACX,GAAG,EACH,UAAU,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,SAAS,EACT,aAAa,EACb,aAAa,EACb,UAAU,EACV,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,KAAK,EACL,KAAK,GACN,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
package/dist/memory.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export type MemoryRoom = DiscoveredRoom & {
|
|
|
5
5
|
selectionModel?: ModelResult;
|
|
6
6
|
documents?: Readonly<Record<string, string>>;
|
|
7
7
|
revisions?: Readonly<Record<string, string>>;
|
|
8
|
+
fileIds?: Readonly<Record<string, string>>;
|
|
8
9
|
changes?: Readonly<Record<string, HeadChange>>;
|
|
9
10
|
binaryFiles?: Readonly<Record<string, BinaryFile>>;
|
|
10
11
|
blobs?: Readonly<Record<string, Blob>>;
|
|
@@ -32,7 +33,10 @@ export type MemoryAdapter = Adapter & {
|
|
|
32
33
|
setConversations(conversations: readonly MemoryConversation[]): void;
|
|
33
34
|
script(operation: keyof Adapter, answer: unknown): void;
|
|
34
35
|
open(): void;
|
|
35
|
-
close(
|
|
36
|
+
close(closing?: {
|
|
37
|
+
revoked?: boolean;
|
|
38
|
+
lost?: boolean;
|
|
39
|
+
}): void;
|
|
36
40
|
expire(locators: readonly string[]): void;
|
|
37
41
|
notifyRoomVersion(notification: {
|
|
38
42
|
locator: string;
|
package/dist/memory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,YAAY,EACjB,KAAK,OAAO,EAEZ,KAAK,UAAU,EAKf,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EAItB,KAAK,cAAc,EACnB,KAAK,UAAU,EAGf,KAAK,kBAAkB,EACvB,KAAK,MAAM,EAGX,KAAK,aAAa,EAIlB,KAAK,SAAS,EAGd,KAAK,cAAc,EACnB,KAAK,WAAW,EACjB,MAAM,cAAc,CAAC;AAkBtB,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG;IACxC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,cAAc,CAAC,EAAE,WAAW,CAAC;IAC7B,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7C,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7C,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;IAC/C,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;IACnD,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAAC;IAClD,Q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BAAmB,CAAC,OAAO,GAAE,oBAAyB,GAAG,aAAa,CAgfrF"}
|
package/dist/memory.js
CHANGED
|
@@ -123,6 +123,9 @@ export function createMemoryAdapter(options = {}) {
|
|
|
123
123
|
...(opening ? { models: modelsOf(room) } : {}),
|
|
124
124
|
documents: named(room.documents ?? {}, taken),
|
|
125
125
|
revisions: named(room.revisions ?? {}, [...taken, ...targets]),
|
|
126
|
+
...(room.fileIds === undefined
|
|
127
|
+
? {}
|
|
128
|
+
: { fileIds: named(room.fileIds, [...taken, ...targets]) }),
|
|
126
129
|
changes: named(room.changes ?? {}, [...taken, ...targets]),
|
|
127
130
|
binaryFiles: named(room.binaryFiles ?? {}, targets),
|
|
128
131
|
...(next < paths.length ? { pageToken: taken.at(-1) } : {}),
|
|
@@ -134,6 +137,7 @@ export function createMemoryAdapter(options = {}) {
|
|
|
134
137
|
const currentTargets = new Set(Object.keys(room.binaryFiles ?? {}));
|
|
135
138
|
const previousTargets = new Set(Object.keys(from.binaryFiles ?? {}));
|
|
136
139
|
const headMoved = (path) => room.revisions?.[path] !== from.revisions?.[path] ||
|
|
140
|
+
room.fileIds?.[path] !== from.fileIds?.[path] ||
|
|
137
141
|
!sameChange(room.changes?.[path], from.changes?.[path]);
|
|
138
142
|
const changed = Object.keys(current)
|
|
139
143
|
.filter((path) => current[path] !== previous[path] || headMoved(path))
|
|
@@ -155,6 +159,9 @@ export function createMemoryAdapter(options = {}) {
|
|
|
155
159
|
...(models === undefined ? {} : { models }),
|
|
156
160
|
documents: named(current, taken),
|
|
157
161
|
revisions: named(room.revisions ?? {}, [...taken, ...targets]),
|
|
162
|
+
...(room.fileIds === undefined
|
|
163
|
+
? {}
|
|
164
|
+
: { fileIds: named(room.fileIds, [...taken, ...targets]) }),
|
|
158
165
|
changes: named(room.changes ?? {}, [...taken, ...targets]),
|
|
159
166
|
binaryFiles: named(room.binaryFiles ?? {}, targets),
|
|
160
167
|
removals: opening
|
|
@@ -274,9 +281,9 @@ export function createMemoryAdapter(options = {}) {
|
|
|
274
281
|
for (const observer of observers)
|
|
275
282
|
observer({ kind: 'opened' });
|
|
276
283
|
},
|
|
277
|
-
close(revoked = false) {
|
|
284
|
+
close({ revoked = false, lost = !revoked } = {}) {
|
|
278
285
|
for (const observer of observers)
|
|
279
|
-
observer({ kind: 'closed', revoked });
|
|
286
|
+
observer({ kind: 'closed', revoked, lost });
|
|
280
287
|
},
|
|
281
288
|
expire(locators) {
|
|
282
289
|
expiring = [...locators];
|
|
@@ -349,8 +356,9 @@ export function createMemoryAdapter(options = {}) {
|
|
|
349
356
|
},
|
|
350
357
|
reopen() {
|
|
351
358
|
queueMicrotask(() => {
|
|
352
|
-
for (const observer of observers)
|
|
353
|
-
observer({ kind: 'closed', revoked: false });
|
|
359
|
+
for (const observer of observers) {
|
|
360
|
+
observer({ kind: 'closed', revoked: false, lost: false });
|
|
361
|
+
}
|
|
354
362
|
});
|
|
355
363
|
},
|
|
356
364
|
published() { },
|
|
@@ -360,7 +368,7 @@ export function createMemoryAdapter(options = {}) {
|
|
|
360
368
|
if (!observers.has(notify))
|
|
361
369
|
return;
|
|
362
370
|
if (options.unopened === true) {
|
|
363
|
-
notify({ kind: 'closed', revoked: false });
|
|
371
|
+
notify({ kind: 'closed', revoked: false, lost: true });
|
|
364
372
|
return;
|
|
365
373
|
}
|
|
366
374
|
announceList();
|
package/dist/model.d.ts
CHANGED
|
@@ -29,12 +29,13 @@ export type ModelState = {
|
|
|
29
29
|
types: VerifiedModel['types'];
|
|
30
30
|
};
|
|
31
31
|
export type TypesResult = {
|
|
32
|
-
status: 'unavailable'
|
|
32
|
+
status: Open<'unavailable'>;
|
|
33
33
|
reason: ModelUnavailableReason;
|
|
34
|
+
types: null;
|
|
34
35
|
schema?: string | null;
|
|
35
36
|
revision?: string | null;
|
|
36
37
|
} | {
|
|
37
|
-
status: 'current' | 'cached'
|
|
38
|
+
status: Open<'current' | 'cached'>;
|
|
38
39
|
identity: string;
|
|
39
40
|
version: string;
|
|
40
41
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ED
|
@@ -2,6 +2,7 @@ import type { BinaryFile, HeadChange } from './adapter.js';
|
|
|
2
2
|
import type { ChangeBatch } from './change.js';
|
|
3
3
|
export type Heads = {
|
|
4
4
|
revisions: Readonly<Record<string, string>>;
|
|
5
|
+
fileIds: Readonly<Record<string, string>>;
|
|
5
6
|
changes: Readonly<Record<string, HeadChange>>;
|
|
6
7
|
};
|
|
7
8
|
export type HeldBinary = ({
|
package/dist/overlay.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../src/overlay.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAU,WAAW,EAAgB,MAAM,aAAa,CAAC;AAGrE,MAAM,MAAM,KAAK,GAAG;IAClB,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5C,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,UAAU,GAClB,CAAC;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GAAG,UAAU,CAAC,GAC7C;IACE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEN,MAAM,MAAM,KAAK,GAAG,KAAK,GAAG;IAC1B,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5C,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EA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