@agentshouse/mdruntime 0.1.0-alpha.12 → 0.1.0-alpha.14
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/dist/adapter.d.ts +1 -1
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +2 -1
- package/dist/adapter.js.map +1 -1
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +21 -10
- package/dist/connection.js.map +1 -1
- package/dist/replica.d.ts +2 -1
- package/dist/replica.d.ts.map +1 -1
- package/dist/replica.js +23 -2
- package/dist/replica.js.map +1 -1
- package/dist/save.d.ts +3 -0
- package/dist/save.d.ts.map +1 -1
- package/dist/save.js +26 -5
- package/dist/save.js.map +1 -1
- package/dist/store.d.ts +2 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +8 -1
- package/dist/store.js.map +1 -1
- package/package.json +3 -3
package/dist/adapter.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ModelIdentity, ModelResult } from './model.js';
|
|
|
2
2
|
import type { ChangeBatch } from './change.js';
|
|
3
3
|
export type Authorization = object;
|
|
4
4
|
export declare const ROOM_CONTRACT_VERSION = 1;
|
|
5
|
-
export declare const VERSION_1_CAPABILITIES: readonly ['stable-file-ids', 'ranked-provider-search', 'room-version-notifications', 'room-history', 'provider-actions'];
|
|
5
|
+
export declare const VERSION_1_CAPABILITIES: readonly ['stable-file-ids', 'ranked-provider-search', 'room-version-notifications', 'room-history', 'provider-actions', 'move-reference-rewrites'];
|
|
6
6
|
export type MdModelIdentity = {
|
|
7
7
|
identity: string;
|
|
8
8
|
version: string;
|
package/dist/adapter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW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E,aAAa,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACvF,MAAM,CAAC,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACxF,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACvF,MAAM,CAAC,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACpF,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,aAAa,CAAC,EAAE,mBAAmB,CAAC;CACrC,CAAC"}
|
package/dist/adapter.js
CHANGED
package/dist/adapter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/workspace/packages/mdruntime/src/adapter.ts"],"sourcesContent":["import type { ModelIdentity, ModelResult } from './model.js';\nimport type { ChangeBatch } from './change.js';\n\nexport type Authorization = object;\n\nexport const ROOM_CONTRACT_VERSION = 1;\n\nexport const VERSION_1_CAPABILITIES = [\n 'stable-file-ids',\n 'ranked-provider-search',\n 'room-version-notifications',\n 'room-history',\n 'provider-actions',\n] as const;\n\nexport type MdModelIdentity = {\n identity: string;\n version: string;\n};\n\nexport type TypedSelection = {\n roots: readonly string[];\n attachedModel: ModelIdentity | null;\n};\n\nexport type OperationScopes = {\n read: readonly string[];\n sync: readonly string[];\n write: readonly string[];\n delete: readonly string[];\n};\nexport type ReplicaAdmission = { selection: string; admission: 'admitted' | 'unavailable' };\n\nexport type DiscoveredRoom = {\n collectionRoot: string;\n name: string;\n locator: string;\n roomVersion: string;\n operations: OperationScopes;\n replica: ReplicaAdmission;\n attachedModel: ModelIdentity | null;\n typedSelection?: TypedSelection;\n providerOwnedPaths: readonly string[];\n};\n\nexport type Capability = {\n name: string;\n limits?: readonly ProviderLimit[];\n actions?: readonly ActionDeclaration[];\n conversationCards?: ConversationCards;\n};\n\nexport type ConversationCards = {\n locator: string;\n type: string;\n identity: string;\n agent: string;\n};\n\nexport type ConversationAction =\n | 'conversation.create'\n | 'conversation.send'\n | 'conversation.answer'\n | 'conversation.interrupt'\n | 'conversation.kill'\n | 'conversation.cancel'\n | 'conversation.delete'\n | 'conversation.history';\n\nexport type ConversationMessage = {\n turn: string;\n message: unknown;\n};\n\nexport type ConversationEvent =\n | { kind: 'growing-text'; conversation: string; turn: string; text: string }\n | { kind: 'accepted-message'; conversation: string; message: ConversationMessage }\n | { kind: 'session-summary'; conversation: string; summary: unknown };\n\nexport type ViewedConversations = {\n view(conversations: readonly string[]): void;\n observe(notify: (event: ConversationEvent) => void): () => void;\n};\n\nexport type ActionDeclaration = {\n name: string;\n inputShape: unknown;\n resultKind: unknown;\n};\n\nexport type ProviderLimit = {\n name: string;\n value?: number | string;\n};\n\nexport type HistoryRetention =\n | { kind: 'duration'; seconds: number }\n | { kind: 'no-declared-time-bound' };\n\nexport type Retention = {\n history: HistoryRetention;\n outcome: number;\n refreshHorizon: number;\n};\n\nexport type Discovery = {\n kind: 'discovery';\n supportedVersions: readonly number[];\n mdModel: MdModelIdentity;\n rooms: readonly DiscoveredRoom[];\n capabilities: readonly Capability[];\n providerLimits: readonly ProviderLimit[];\n retention: Retention;\n};\n\nexport type TransportUncertainty = { kind: 'transport-uncertainty' };\nexport type RoomNotReadable = { kind: 'room-not-readable'; locator: string };\nexport type RevokedAuthorization = { kind: 'revoked-authorization' };\n\nexport type ProviderRefusal = {\n code: string;\n fields: Readonly<Record<string, unknown>>;\n};\n\nexport type ScopedRefusal = ProviderRefusal & {\n kind: 'scoped-refusal';\n locator: string;\n scope: 'content' | 'sync' | 'model' | 'operation' | 'undisclosed';\n};\nexport type AdapterFailure =\n | TransportUncertainty\n | RoomNotReadable\n | RevokedAuthorization\n | ScopedRefusal;\n\nexport type ContractUnavailable = ProviderRefusal & { kind: 'contract-unavailable' };\n\nexport type DiscoverResult =\n | Discovery\n | TransportUncertainty\n | RevokedAuthorization\n | ContractUnavailable;\n\nexport type PageToken = string;\n\nexport type BootstrapRequest = {\n locator: string;\n selection: string;\n pageToken?: PageToken;\n};\n\nexport type BootstrapPage = {\n kind: 'bootstrap';\n roomVersion: string;\n documents: Readonly<Record<string, string>>;\n revisions: Readonly<Record<string, string>>;\n binaryTargets: readonly string[];\n pageToken?: PageToken;\n};\n\nexport type BootstrapResult = BootstrapPage | AdapterFailure;\n\nexport type RefreshRequest = {\n locator: string;\n selection: string;\n fromRoomVersion: string;\n pageToken?: PageToken;\n};\n\nexport type RefreshPage = {\n kind: 'net-advancement';\n roomVersion: string;\n documents: Readonly<Record<string, string>>;\n revisions: Readonly<Record<string, string>>;\n binaryTargets: readonly string[];\n removals: readonly string[];\n pageToken?: PageToken;\n};\n\nexport type RefreshResult =\n | { kind: 'still-current' }\n | RefreshPage\n | { kind: 'beyond-horizon' }\n | AdapterFailure;\n\nexport type MutationRequest = {\n locator: string;\n changeBatch: ChangeBatch;\n};\n\nexport type RetryableRefusal = ProviderRefusal & {\n kind: 'retryable-refusal';\n reset?: string;\n};\n\nexport type MutationResult =\n | {\n kind: 'accepted';\n roomVersion: string;\n documents: Readonly<Record<string, string>>;\n revisions: Readonly<Record<string, string>>;\n removals: readonly string[];\n author?: string;\n time?: string;\n }\n | (ProviderRefusal & {\n kind: 'conflicted';\n roomVersion?: string;\n affected: Readonly<Record<string, string>>;\n })\n | (ProviderRefusal & {\n kind: 'rejected';\n affected: Readonly<Record<string, string>>;\n })\n | RetryableRefusal\n | { kind: 'expired' }\n | AdapterFailure;\n\nexport type HistoryRevision = {\n revision: string;\n author: string;\n time: string;\n};\n\nexport type HistoryRequest = {\n locator: string;\n path: string;\n revision?: string;\n pageToken?: PageToken;\n};\n\nexport type HistoryResult =\n | {\n kind: 'history';\n revisions: readonly HistoryRevision[];\n pageToken?: PageToken;\n }\n | {\n kind: 'revision';\n content: string;\n }\n | { kind: 'no-history' }\n | AdapterFailure;\n\nexport type ActionRequest = {\n name: string;\n input: unknown;\n};\n\nexport type ActionResult =\n | { kind: 'action'; result: unknown }\n | (ProviderRefusal & { kind: 'rejected' })\n | AdapterFailure;\n\nexport type ModelRequest =\n | { locator: string; attached: 'collection'; collectionRoot: string; model: ModelIdentity | null }\n | {\n locator: string;\n attached: 'typed-selection';\n roots: readonly string[];\n model: ModelIdentity | null;\n };\n\nexport type RoomVersionNotification = {\n locator: string;\n roomVersion: string;\n};\n\nexport type SelectedRooms = {\n select(locators: readonly string[]): void;\n observe(notify: (notification: RoomVersionNotification) => void): () => void;\n};\n\nexport type Adapter = {\n model(authorization: Authorization, request: ModelRequest): Promise<ModelResult>;\n authorize(): Promise<Authorization>;\n discover(authorization: Authorization): Promise<DiscoverResult>;\n bootstrap(authorization: Authorization, request: BootstrapRequest): Promise<BootstrapResult>;\n refresh(authorization: Authorization, request: RefreshRequest): Promise<RefreshResult>;\n mutate(authorization: Authorization, request: MutationRequest): Promise<MutationResult>;\n history(authorization: Authorization, request: HistoryRequest): Promise<HistoryResult>;\n action(authorization: Authorization, request: ActionRequest): Promise<ActionResult>;\n roomVersions?: SelectedRooms;\n conversations?: ViewedConversations;\n};\n"],"names":["ROOM_CONTRACT_VERSION","VERSION_1_CAPABILITIES"],"mappings":"AAKA,OAAO,MAAMA,wBAAwB,EAAE;AAEvC,OAAO,MAAMC,yBAAyB;IACpC;IACA;IACA;IACA;IACA;CACD,CAAU"}
|
|
1
|
+
{"version":3,"sources":["/workspace/packages/mdruntime/src/adapter.ts"],"sourcesContent":["import type { ModelIdentity, ModelResult } from './model.js';\nimport type { ChangeBatch } from './change.js';\n\nexport type Authorization = object;\n\nexport const ROOM_CONTRACT_VERSION = 1;\n\nexport const VERSION_1_CAPABILITIES = [\n 'stable-file-ids',\n 'ranked-provider-search',\n 'room-version-notifications',\n 'room-history',\n 'provider-actions',\n 'move-reference-rewrites',\n] as const;\n\nexport type MdModelIdentity = {\n identity: string;\n version: string;\n};\n\nexport type TypedSelection = {\n roots: readonly string[];\n attachedModel: ModelIdentity | null;\n};\n\nexport type OperationScopes = {\n read: readonly string[];\n sync: readonly string[];\n write: readonly string[];\n delete: readonly string[];\n};\nexport type ReplicaAdmission = { selection: string; admission: 'admitted' | 'unavailable' };\n\nexport type DiscoveredRoom = {\n collectionRoot: string;\n name: string;\n locator: string;\n roomVersion: string;\n operations: OperationScopes;\n replica: ReplicaAdmission;\n attachedModel: ModelIdentity | null;\n typedSelection?: TypedSelection;\n providerOwnedPaths: readonly string[];\n};\n\nexport type Capability = {\n name: string;\n limits?: readonly ProviderLimit[];\n actions?: readonly ActionDeclaration[];\n conversationCards?: ConversationCards;\n};\n\nexport type ConversationCards = {\n locator: string;\n type: string;\n identity: string;\n agent: string;\n};\n\nexport type ConversationAction =\n | 'conversation.create'\n | 'conversation.send'\n | 'conversation.answer'\n | 'conversation.interrupt'\n | 'conversation.kill'\n | 'conversation.cancel'\n | 'conversation.delete'\n | 'conversation.history';\n\nexport type ConversationMessage = {\n turn: string;\n message: unknown;\n};\n\nexport type ConversationEvent =\n | { kind: 'growing-text'; conversation: string; turn: string; text: string }\n | { kind: 'accepted-message'; conversation: string; message: ConversationMessage }\n | { kind: 'session-summary'; conversation: string; summary: unknown };\n\nexport type ViewedConversations = {\n view(conversations: readonly string[]): void;\n observe(notify: (event: ConversationEvent) => void): () => void;\n};\n\nexport type ActionDeclaration = {\n name: string;\n inputShape: unknown;\n resultKind: unknown;\n};\n\nexport type ProviderLimit = {\n name: string;\n value?: number | string;\n};\n\nexport type HistoryRetention =\n | { kind: 'duration'; seconds: number }\n | { kind: 'no-declared-time-bound' };\n\nexport type Retention = {\n history: HistoryRetention;\n outcome: number;\n refreshHorizon: number;\n};\n\nexport type Discovery = {\n kind: 'discovery';\n supportedVersions: readonly number[];\n mdModel: MdModelIdentity;\n rooms: readonly DiscoveredRoom[];\n capabilities: readonly Capability[];\n providerLimits: readonly ProviderLimit[];\n retention: Retention;\n};\n\nexport type TransportUncertainty = { kind: 'transport-uncertainty' };\nexport type RoomNotReadable = { kind: 'room-not-readable'; locator: string };\nexport type RevokedAuthorization = { kind: 'revoked-authorization' };\n\nexport type ProviderRefusal = {\n code: string;\n fields: Readonly<Record<string, unknown>>;\n};\n\nexport type ScopedRefusal = ProviderRefusal & {\n kind: 'scoped-refusal';\n locator: string;\n scope: 'content' | 'sync' | 'model' | 'operation' | 'undisclosed';\n};\nexport type AdapterFailure =\n | TransportUncertainty\n | RoomNotReadable\n | RevokedAuthorization\n | ScopedRefusal;\n\nexport type ContractUnavailable = ProviderRefusal & { kind: 'contract-unavailable' };\n\nexport type DiscoverResult =\n | Discovery\n | TransportUncertainty\n | RevokedAuthorization\n | ContractUnavailable;\n\nexport type PageToken = string;\n\nexport type BootstrapRequest = {\n locator: string;\n selection: string;\n pageToken?: PageToken;\n};\n\nexport type BootstrapPage = {\n kind: 'bootstrap';\n roomVersion: string;\n documents: Readonly<Record<string, string>>;\n revisions: Readonly<Record<string, string>>;\n binaryTargets: readonly string[];\n pageToken?: PageToken;\n};\n\nexport type BootstrapResult = BootstrapPage | AdapterFailure;\n\nexport type RefreshRequest = {\n locator: string;\n selection: string;\n fromRoomVersion: string;\n pageToken?: PageToken;\n};\n\nexport type RefreshPage = {\n kind: 'net-advancement';\n roomVersion: string;\n documents: Readonly<Record<string, string>>;\n revisions: Readonly<Record<string, string>>;\n binaryTargets: readonly string[];\n removals: readonly string[];\n pageToken?: PageToken;\n};\n\nexport type RefreshResult =\n | { kind: 'still-current' }\n | RefreshPage\n | { kind: 'beyond-horizon' }\n | AdapterFailure;\n\nexport type MutationRequest = {\n locator: string;\n changeBatch: ChangeBatch;\n};\n\nexport type RetryableRefusal = ProviderRefusal & {\n kind: 'retryable-refusal';\n reset?: string;\n};\n\nexport type MutationResult =\n | {\n kind: 'accepted';\n roomVersion: string;\n documents: Readonly<Record<string, string>>;\n revisions: Readonly<Record<string, string>>;\n removals: readonly string[];\n author?: string;\n time?: string;\n }\n | (ProviderRefusal & {\n kind: 'conflicted';\n roomVersion?: string;\n affected: Readonly<Record<string, string>>;\n })\n | (ProviderRefusal & {\n kind: 'rejected';\n affected: Readonly<Record<string, string>>;\n })\n | RetryableRefusal\n | { kind: 'expired' }\n | AdapterFailure;\n\nexport type HistoryRevision = {\n revision: string;\n author: string;\n time: string;\n};\n\nexport type HistoryRequest = {\n locator: string;\n path: string;\n revision?: string;\n pageToken?: PageToken;\n};\n\nexport type HistoryResult =\n | {\n kind: 'history';\n revisions: readonly HistoryRevision[];\n pageToken?: PageToken;\n }\n | {\n kind: 'revision';\n content: string;\n }\n | { kind: 'no-history' }\n | AdapterFailure;\n\nexport type ActionRequest = {\n name: string;\n input: unknown;\n};\n\nexport type ActionResult =\n | { kind: 'action'; result: unknown }\n | (ProviderRefusal & { kind: 'rejected' })\n | AdapterFailure;\n\nexport type ModelRequest =\n | { locator: string; attached: 'collection'; collectionRoot: string; model: ModelIdentity | null }\n | {\n locator: string;\n attached: 'typed-selection';\n roots: readonly string[];\n model: ModelIdentity | null;\n };\n\nexport type RoomVersionNotification = {\n locator: string;\n roomVersion: string;\n};\n\nexport type SelectedRooms = {\n select(locators: readonly string[]): void;\n observe(notify: (notification: RoomVersionNotification) => void): () => void;\n};\n\nexport type Adapter = {\n model(authorization: Authorization, request: ModelRequest): Promise<ModelResult>;\n authorize(): Promise<Authorization>;\n discover(authorization: Authorization): Promise<DiscoverResult>;\n bootstrap(authorization: Authorization, request: BootstrapRequest): Promise<BootstrapResult>;\n refresh(authorization: Authorization, request: RefreshRequest): Promise<RefreshResult>;\n mutate(authorization: Authorization, request: MutationRequest): Promise<MutationResult>;\n history(authorization: Authorization, request: HistoryRequest): Promise<HistoryResult>;\n action(authorization: Authorization, request: ActionRequest): Promise<ActionResult>;\n roomVersions?: SelectedRooms;\n conversations?: ViewedConversations;\n};\n"],"names":["ROOM_CONTRACT_VERSION","VERSION_1_CAPABILITIES"],"mappings":"AAKA,OAAO,MAAMA,wBAAwB,EAAE;AAEvC,OAAO,MAAMC,yBAAyB;IACpC;IACA;IACA;IACA;IACA;IACA;CACD,CAAU"}
|
package/dist/connection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,YAAY,EAAmB,MAAM,YAAY,CAAC;AAC1E,OAAO,EAKL,KAAK,oBAAoB,EAEzB,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,WAAW,EAEjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAIL,KAAK,OAAO,EAEZ,KAAK,aAAa,EAGlB,KAAK,aAAa,EAKlB,KAAK,eAAe,EAErB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,MAAM,EAAe,MAAM,aAAa,CAAC;AAGvD,OAAO,EAKL,KAAK,UAAU,EACf,KAAK,UAAU,EAEf,KAAK,iBAAiB,EACvB,MAAM,cAAc,CAAC;AAEtB,OAAO,
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,YAAY,EAAmB,MAAM,YAAY,CAAC;AAC1E,OAAO,EAKL,KAAK,oBAAoB,EAEzB,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,WAAW,EAEjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAIL,KAAK,OAAO,EAEZ,KAAK,aAAa,EAGlB,KAAK,aAAa,EAKlB,KAAK,eAAe,EAErB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EA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,EAAE,gBAAgB,KAAK,IAAI,GACzC,MAAM,IAAI,CAAC;KACf,CAAC;IACF,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,CAAC;AAyBF,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS,CA8vDpE"}
|
package/dist/connection.js
CHANGED
|
@@ -42,6 +42,10 @@ export function createMdRuntime(options) {
|
|
|
42
42
|
const outcomes = new Map();
|
|
43
43
|
let limits = [];
|
|
44
44
|
let capabilities = [];
|
|
45
|
+
let capabilityNames = [];
|
|
46
|
+
function rewriting() {
|
|
47
|
+
return capabilityNames.includes('move-reference-rewrites') ? 'provider' : 'runtime';
|
|
48
|
+
}
|
|
45
49
|
const rooms = new Map();
|
|
46
50
|
const unreadable = new Set();
|
|
47
51
|
const models = new Map();
|
|
@@ -409,7 +413,7 @@ export function createMdRuntime(options) {
|
|
|
409
413
|
return model;
|
|
410
414
|
}
|
|
411
415
|
async function hydrate(opened) {
|
|
412
|
-
const [records, queues, kept, presented, cached, unsent, lastCompleted, declared] = await Promise.all([
|
|
416
|
+
const [records, queues, kept, presented, cached, unsent, lastCompleted, declared, named] = await Promise.all([
|
|
413
417
|
opened.all(),
|
|
414
418
|
opened.queues(),
|
|
415
419
|
opened.drafts(),
|
|
@@ -417,9 +421,11 @@ export function createMdRuntime(options) {
|
|
|
417
421
|
opened.conversations(),
|
|
418
422
|
opened.instructions(),
|
|
419
423
|
opened.lastCompleted(),
|
|
420
|
-
opened.providerLimits()
|
|
424
|
+
opened.providerLimits(),
|
|
425
|
+
opened.capabilities()
|
|
421
426
|
]);
|
|
422
427
|
limits = declared;
|
|
428
|
+
capabilityNames = named;
|
|
423
429
|
drafts.clear();
|
|
424
430
|
for (const draft of kept)rememberDraft(draft.locator, draft.path, draft.content);
|
|
425
431
|
presentations.clear();
|
|
@@ -444,7 +450,7 @@ export function createMdRuntime(options) {
|
|
|
444
450
|
selectionModel
|
|
445
451
|
});
|
|
446
452
|
if (confirmed === null) continue;
|
|
447
|
-
replicas.set(record.locator, replicaOf(confirmed, queuedBatches.get(record.locator) ?? []));
|
|
453
|
+
replicas.set(record.locator, replicaOf(confirmed, queuedBatches.get(record.locator) ?? [], rewriting()));
|
|
448
454
|
const existing = rooms.get(record.locator);
|
|
449
455
|
if (existing === undefined) list(record, false);
|
|
450
456
|
else {
|
|
@@ -532,7 +538,7 @@ export function createMdRuntime(options) {
|
|
|
532
538
|
if (retained !== null) {
|
|
533
539
|
await local.publish(retained.record);
|
|
534
540
|
unreadable.delete(room.locator);
|
|
535
|
-
replicas.set(room.locator, replicaOf(retained, replicas.get(room.locator)?.queue ?? []));
|
|
541
|
+
replicas.set(room.locator, replicaOf(retained, replicas.get(room.locator)?.queue ?? [], rewriting()));
|
|
536
542
|
}
|
|
537
543
|
list(room, true);
|
|
538
544
|
emitRooms();
|
|
@@ -558,6 +564,7 @@ export function createMdRuntime(options) {
|
|
|
558
564
|
binding: options.modelBinding,
|
|
559
565
|
providerOwnedPaths: room.providerOwnedPaths,
|
|
560
566
|
providerLimits: limits,
|
|
567
|
+
rewriting: rewriting(),
|
|
561
568
|
visible: replica.visible,
|
|
562
569
|
changes
|
|
563
570
|
});
|
|
@@ -598,7 +605,7 @@ export function createMdRuntime(options) {
|
|
|
598
605
|
}
|
|
599
606
|
if (replacing !== undefined) outcomes.delete(replacing);
|
|
600
607
|
for (const path of consumed)forgetDraft(locator, path);
|
|
601
|
-
replicas.set(locator, replicaOf(replica.confirmed, batches));
|
|
608
|
+
replicas.set(locator, replicaOf(replica.confirmed, batches, rewriting()));
|
|
602
609
|
emitQueue(locator);
|
|
603
610
|
emitVisible();
|
|
604
611
|
emitDrafts();
|
|
@@ -623,7 +630,7 @@ export function createMdRuntime(options) {
|
|
|
623
630
|
const batches = replica.queue.slice(1);
|
|
624
631
|
outcomes.delete(identifier);
|
|
625
632
|
await persistQueue(local, locator, batches);
|
|
626
|
-
replicas.set(locator, replicaOf(replica.confirmed, batches));
|
|
633
|
+
replicas.set(locator, replicaOf(replica.confirmed, batches, rewriting()));
|
|
627
634
|
emitQueue(locator);
|
|
628
635
|
emitVisible();
|
|
629
636
|
moveTo({
|
|
@@ -847,7 +854,7 @@ export function createMdRuntime(options) {
|
|
|
847
854
|
}
|
|
848
855
|
});
|
|
849
856
|
unreadable.delete(room.locator);
|
|
850
|
-
replicas.set(room.locator, replicaOf(applied, remaining));
|
|
857
|
+
replicas.set(room.locator, replicaOf(applied, remaining, rewriting()));
|
|
851
858
|
list(room, true);
|
|
852
859
|
emitRooms();
|
|
853
860
|
emitQueue(room.locator);
|
|
@@ -1036,7 +1043,7 @@ export function createMdRuntime(options) {
|
|
|
1036
1043
|
};
|
|
1037
1044
|
await local.publish(record);
|
|
1038
1045
|
const confirmed = readConfirmed(record);
|
|
1039
|
-
if (confirmed !== null) replicas.set(room.locator, replicaOf(confirmed, held.queue));
|
|
1046
|
+
if (confirmed !== null) replicas.set(room.locator, replicaOf(confirmed, held.queue, rewriting()));
|
|
1040
1047
|
}
|
|
1041
1048
|
models.set(key, next);
|
|
1042
1049
|
if (next.status === 'current') {
|
|
@@ -1317,9 +1324,13 @@ export function createMdRuntime(options) {
|
|
|
1317
1324
|
notifyReady();
|
|
1318
1325
|
if (declared.has('room-version-notifications')) observeRoomVersions();
|
|
1319
1326
|
if (declared.has('provider-actions')) observeConversations();
|
|
1320
|
-
|
|
1327
|
+
const names = [
|
|
1328
|
+
...declared
|
|
1329
|
+
].sort();
|
|
1330
|
+
if (JSON.stringify(result.providerLimits) !== JSON.stringify(limits) || JSON.stringify(names) !== JSON.stringify(capabilityNames)) {
|
|
1321
1331
|
limits = result.providerLimits;
|
|
1322
|
-
|
|
1332
|
+
capabilityNames = names;
|
|
1333
|
+
await local.declare(limits, capabilityNames);
|
|
1323
1334
|
}
|
|
1324
1335
|
const listedLocators = applyDiscovery(result.rooms);
|
|
1325
1336
|
handSelected(result.rooms.filter((room)=>room.replica.admission === 'admitted').map((room)=>room.locator).sort());
|