@felan-ai/daemon 0.3.1 → 0.4.0
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/NOTICE +0 -2
- package/dist/daemon/admission.d.ts +1 -1
- package/dist/daemon/admission.d.ts.map +1 -1
- package/dist/daemon/admission.js +2 -3
- package/dist/daemon/admission.js.map +1 -1
- package/dist/daemon/control-state.d.ts +10 -0
- package/dist/daemon/control-state.d.ts.map +1 -1
- package/dist/daemon/control-state.js +3 -0
- package/dist/daemon/control-state.js.map +1 -1
- package/dist/daemon/control-store.d.ts +2 -2
- package/dist/daemon/control-store.d.ts.map +1 -1
- package/dist/daemon/control-store.js +34 -6
- package/dist/daemon/control-store.js.map +1 -1
- package/dist/daemon/legacy-sessions.d.ts +3 -2
- package/dist/daemon/legacy-sessions.d.ts.map +1 -1
- package/dist/daemon/legacy-sessions.js +26 -7
- package/dist/daemon/legacy-sessions.js.map +1 -1
- package/dist/daemon/legacy-summary-cache.d.ts +20 -0
- package/dist/daemon/legacy-summary-cache.d.ts.map +1 -0
- package/dist/daemon/legacy-summary-cache.js +150 -0
- package/dist/daemon/legacy-summary-cache.js.map +1 -0
- package/dist/daemon/message-bounds.d.ts +3 -0
- package/dist/daemon/message-bounds.d.ts.map +1 -0
- package/dist/daemon/message-bounds.js +61 -0
- package/dist/daemon/message-bounds.js.map +1 -0
- package/dist/daemon/operational-log.d.ts +5 -0
- package/dist/daemon/operational-log.d.ts.map +1 -1
- package/dist/daemon/operational-log.js +7 -2
- package/dist/daemon/operational-log.js.map +1 -1
- package/dist/daemon/processes.d.ts.map +1 -1
- package/dist/daemon/processes.js +40 -23
- package/dist/daemon/processes.js.map +1 -1
- package/dist/daemon/projection.d.ts.map +1 -1
- package/dist/daemon/projection.js +4 -3
- package/dist/daemon/projection.js.map +1 -1
- package/dist/daemon/registry.d.ts +8 -0
- package/dist/daemon/registry.d.ts.map +1 -1
- package/dist/daemon/registry.js +133 -23
- package/dist/daemon/registry.js.map +1 -1
- package/dist/daemon/server.d.ts +1 -0
- package/dist/daemon/server.d.ts.map +1 -1
- package/dist/daemon/server.js +23 -6
- package/dist/daemon/server.js.map +1 -1
- package/dist/daemon/service.d.ts.map +1 -1
- package/dist/daemon/service.js +1 -0
- package/dist/daemon/service.js.map +1 -1
- package/package.json +3 -3
|
@@ -45,6 +45,11 @@ export interface RegistryOptions {
|
|
|
45
45
|
elementId: string;
|
|
46
46
|
reason: 'failed' | 'timeout' | 'limit';
|
|
47
47
|
}): void;
|
|
48
|
+
onDiagnostic?(event: {
|
|
49
|
+
scope: 'projection' | 'registry';
|
|
50
|
+
session?: string;
|
|
51
|
+
error: unknown;
|
|
52
|
+
}): void;
|
|
48
53
|
}
|
|
49
54
|
export interface RegistryMutationContext {
|
|
50
55
|
readonly session: AgentSession;
|
|
@@ -203,6 +208,9 @@ export declare class SessionRegistry {
|
|
|
203
208
|
private require;
|
|
204
209
|
/** Reload keeps the root's PTYs running (its next runtime reattaches them by ID) and keeps the root's executions running. */
|
|
205
210
|
private disposeEntry;
|
|
211
|
+
private projectionFailed;
|
|
212
|
+
private projectionIntegrityIntact;
|
|
213
|
+
private diagnostic;
|
|
206
214
|
private fence;
|
|
207
215
|
settleWriters(): Promise<void>;
|
|
208
216
|
private settleAfterLoss;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/daemon/registry.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAA0D,KAAK,WAAW,EAAE,KAAK,iBAAiB,EAAE,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAE,KAAK,MAAM,EAAe,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7O,OAAO,EAAsB,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAA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AQP,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;YAUtB,eAAe;IAmB7B,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,iBAAiB;YAIX,IAAI;CAKnB"}
|
package/dist/daemon/registry.js
CHANGED
|
@@ -5,7 +5,8 @@ import { randomUUID } from 'node:crypto';
|
|
|
5
5
|
import { setTimeout as delay } from 'node:timers/promises';
|
|
6
6
|
import { canonicalRequestPayload, parseInteraction, parseSchema } from '@felan-ai/session-protocol';
|
|
7
7
|
import { RegistryExecutions, ExecutionHost } from './executions.js';
|
|
8
|
-
import { SessionProfileSchema } from './control-state.js';
|
|
8
|
+
import { ControlStoreError, SessionProfileSchema } from './control-state.js';
|
|
9
|
+
import { DaemonSecurityError } from './native-ownership.js';
|
|
9
10
|
import { LegacySessionIndex, readTranscriptPreview, transcriptHasConversation, transcriptPreview } from './legacy-sessions.js';
|
|
10
11
|
import { profilePolicy, SessionProjection } from './projection.js';
|
|
11
12
|
import { RegistryProcesses } from './processes.js';
|
|
@@ -92,6 +93,8 @@ export class SessionRegistry {
|
|
|
92
93
|
const session = this.options.store.sessionMetadata(id);
|
|
93
94
|
if (session.deletedAt !== undefined)
|
|
94
95
|
throw registryError('not_found', 'Session was deleted.');
|
|
96
|
+
if (this.entries.get(id)?.projectionFailed)
|
|
97
|
+
throw registryError('unavailable', 'Session projection failed; further work is disabled.');
|
|
95
98
|
if (this.reservations.has(session.piPath) && !activatingBinding)
|
|
96
99
|
throw registryError('busy', 'Session has a lifecycle operation in progress.');
|
|
97
100
|
if (session.state !== 'open' || this.entries.get(id)?.disposing || this.entries.get(id)?.cancelling || this.closing.has(id) || this.closing.has(session.root) || this.copyClaims.has(session.piPath))
|
|
@@ -129,6 +132,7 @@ export class SessionRegistry {
|
|
|
129
132
|
for (const entry of this.entries.values()) {
|
|
130
133
|
await entry.host?.settle();
|
|
131
134
|
await entry.cancelling;
|
|
135
|
+
await entry.projectionCancellation;
|
|
132
136
|
if (!entry.binding.runtime.session.isIdle)
|
|
133
137
|
await entry.binding.runtime.session.waitForIdle();
|
|
134
138
|
await this.join([...entry.writers]);
|
|
@@ -212,7 +216,8 @@ export class SessionRegistry {
|
|
|
212
216
|
}
|
|
213
217
|
finally {
|
|
214
218
|
entry.writers.delete(settled);
|
|
215
|
-
entry.
|
|
219
|
+
if (!entry.projectionFailed)
|
|
220
|
+
entry.projection.refresh();
|
|
216
221
|
}
|
|
217
222
|
}
|
|
218
223
|
async validateConfiguration(request, resources) {
|
|
@@ -377,6 +382,8 @@ export class SessionRegistry {
|
|
|
377
382
|
this.assertAdmission();
|
|
378
383
|
const entry = this.require(id);
|
|
379
384
|
const attachment = randomUUID();
|
|
385
|
+
if (entry.projectionFailed)
|
|
386
|
+
throw registryError('unavailable', 'Session projection failed; close and reopen the session before attaching.');
|
|
380
387
|
const snapshot = entry.projection.snapshot();
|
|
381
388
|
entry.attachments.set(attachment, { ...metadata });
|
|
382
389
|
return { attachment, snapshot };
|
|
@@ -489,14 +496,14 @@ export class SessionRegistry {
|
|
|
489
496
|
entry.dispatches.delete(requestId);
|
|
490
497
|
if (entry.command?.runId === run.id)
|
|
491
498
|
delete entry.command;
|
|
492
|
-
if (!this.failure) {
|
|
499
|
+
if (!this.failure && !entry.projectionFailed) {
|
|
493
500
|
if (!entry.cancelling)
|
|
494
501
|
entry.projection.settleRun(run.id);
|
|
495
502
|
entry.projection.refresh();
|
|
496
503
|
}
|
|
497
504
|
}
|
|
498
505
|
catch (error) {
|
|
499
|
-
this.
|
|
506
|
+
this.projectionFailed(id, error);
|
|
500
507
|
throw error;
|
|
501
508
|
}
|
|
502
509
|
finally {
|
|
@@ -535,14 +542,14 @@ export class SessionRegistry {
|
|
|
535
542
|
finally {
|
|
536
543
|
try {
|
|
537
544
|
entry.dispatches.delete(continuationId);
|
|
538
|
-
if (!this.failure) {
|
|
545
|
+
if (!this.failure && !entry.projectionFailed) {
|
|
539
546
|
if (!entry.cancelling)
|
|
540
547
|
entry.projection.settleRun(run.id);
|
|
541
548
|
entry.projection.refresh();
|
|
542
549
|
}
|
|
543
550
|
}
|
|
544
551
|
catch (error) {
|
|
545
|
-
this.
|
|
552
|
+
this.projectionFailed(id, error);
|
|
546
553
|
throw error;
|
|
547
554
|
}
|
|
548
555
|
finally {
|
|
@@ -601,14 +608,14 @@ export class SessionRegistry {
|
|
|
601
608
|
active = false;
|
|
602
609
|
entry.dispatches.delete(requestId);
|
|
603
610
|
try {
|
|
604
|
-
if (!this.failure) {
|
|
611
|
+
if (!this.failure && !entry.projectionFailed) {
|
|
605
612
|
if (!entry.cancelling)
|
|
606
613
|
entry.projection.settleRun(this.options.store.sessionMetadata(id).run.id);
|
|
607
614
|
entry.projection.refresh();
|
|
608
615
|
}
|
|
609
616
|
}
|
|
610
617
|
catch (error) {
|
|
611
|
-
this.
|
|
618
|
+
this.projectionFailed(id, error);
|
|
612
619
|
throw error;
|
|
613
620
|
}
|
|
614
621
|
finally {
|
|
@@ -869,13 +876,16 @@ export class SessionRegistry {
|
|
|
869
876
|
const stored = this.options.store.sessionMetadata(id);
|
|
870
877
|
if (runId && stored.run.id !== runId)
|
|
871
878
|
throw registryError('not_found', 'Run not found.');
|
|
879
|
+
if (entry.projectionFailed)
|
|
880
|
+
return entry.projectionCancellation;
|
|
872
881
|
if (entry.cancelling)
|
|
873
882
|
return entry.cancelling;
|
|
874
883
|
if (['idle', 'interrupted'].includes(stored.run.state) && entry.binding.runtime.session.isIdle)
|
|
875
884
|
return;
|
|
876
885
|
entry.runAbort?.abort();
|
|
877
886
|
const operation = Promise.resolve().then(async () => {
|
|
878
|
-
entry.
|
|
887
|
+
if (!entry.projectionFailed)
|
|
888
|
+
entry.projection.transitionForSafety('cancelling', stored.run.id);
|
|
879
889
|
this.settleInteractions(id, 'cancel');
|
|
880
890
|
await this.cancelViews(id);
|
|
881
891
|
await entry.binding.runtime.session.abort();
|
|
@@ -884,8 +894,10 @@ export class SessionRegistry {
|
|
|
884
894
|
this.options.owner.assertCurrent();
|
|
885
895
|
if (!entry.binding.runtime.session.isIdle)
|
|
886
896
|
throw new Error('Cancelled session has not settled.');
|
|
887
|
-
entry.
|
|
888
|
-
|
|
897
|
+
if (!entry.projectionFailed) {
|
|
898
|
+
entry.projection.transitionForSafety('idle', stored.run.id);
|
|
899
|
+
entry.projection.refresh();
|
|
900
|
+
}
|
|
889
901
|
});
|
|
890
902
|
entry.cancelling = operation;
|
|
891
903
|
try {
|
|
@@ -900,7 +912,7 @@ export class SessionRegistry {
|
|
|
900
912
|
if (!this.draining && !this.stopping && !this.closing.has(id))
|
|
901
913
|
delete entry.viewCancellation;
|
|
902
914
|
}
|
|
903
|
-
if (!this.stopping && !this.failure && !this.closing.has(id) && !this.closing.has(stored.root))
|
|
915
|
+
if (!this.stopping && !this.failure && !entry.projectionFailed && !this.entries.get(stored.root)?.projectionFailed && !this.closing.has(id) && !this.closing.has(stored.root))
|
|
904
916
|
this.entries.get(stored.root)?.host?.resumeQueued();
|
|
905
917
|
}
|
|
906
918
|
/** Applies ACP approval policy to the open session tree; running tool calls keep the approvals they already had. */
|
|
@@ -1023,10 +1035,12 @@ export class SessionRegistry {
|
|
|
1023
1035
|
if (entry) {
|
|
1024
1036
|
entry.runAbort?.abort();
|
|
1025
1037
|
await entry.cancelling;
|
|
1038
|
+
await entry.projectionCancellation;
|
|
1026
1039
|
await entry.binding.runtime.session.abort();
|
|
1027
1040
|
await this.processes.cancelForeground(id);
|
|
1028
1041
|
await Promise.all(entry.writers);
|
|
1029
|
-
entry.
|
|
1042
|
+
if (!entry.projectionFailed)
|
|
1043
|
+
entry.projection.settleRun(this.options.store.sessionMetadata(id).run.id);
|
|
1030
1044
|
await this.processes.settle(stored.root, false, id === stored.root ? undefined : new Set([id]));
|
|
1031
1045
|
for (const service of entry.services)
|
|
1032
1046
|
await this.processes.withCleanup(id, () => service.settle());
|
|
@@ -1073,6 +1087,7 @@ export class SessionRegistry {
|
|
|
1073
1087
|
}
|
|
1074
1088
|
for (const [id, entry] of this.entries) {
|
|
1075
1089
|
this.closing.add(id);
|
|
1090
|
+
await entry.projectionCancellation;
|
|
1076
1091
|
await shutdownStep('session-interactions', () => this.settleInteractions(id, 'shutdown'), id);
|
|
1077
1092
|
if (!options.interrupt) {
|
|
1078
1093
|
entry.runAbort?.abort();
|
|
@@ -1096,7 +1111,8 @@ export class SessionRegistry {
|
|
|
1096
1111
|
}
|
|
1097
1112
|
await shutdownStep('session-writers', async () => { await entry.cancelling; await this.join([...entry.writers]); }, id);
|
|
1098
1113
|
}
|
|
1099
|
-
|
|
1114
|
+
if (!entry.projectionFailed)
|
|
1115
|
+
await shutdownStep('session-run', () => entry.projection.settleRun(this.options.store.sessionMetadata(id).run.id), id);
|
|
1100
1116
|
await shutdownStep('session-dispose', () => this.disposeEntry(id, false), id);
|
|
1101
1117
|
}
|
|
1102
1118
|
// A failed reload leaves its kept PTYs without a resident root.
|
|
@@ -1171,7 +1187,15 @@ export class SessionRegistry {
|
|
|
1171
1187
|
const bindings = await externalServices.extensions.bind(context, port);
|
|
1172
1188
|
return { ...bindings, inlineExtensions: [...(bindings.inlineExtensions ?? []), ...(request.systemPromptAppend ? [{
|
|
1173
1189
|
name: '@felan-ai/daemon/child-instructions',
|
|
1174
|
-
factory: (pi) => {
|
|
1190
|
+
factory: (pi) => {
|
|
1191
|
+
pi.on('before_agent_start', event => {
|
|
1192
|
+
if (event.systemPromptOptions?.sections) {
|
|
1193
|
+
event.systemPromptOptions.sections.child_instructions = request.systemPromptAppend;
|
|
1194
|
+
return;
|
|
1195
|
+
}
|
|
1196
|
+
return { systemPrompt: `${event.systemPrompt}\n\n${request.systemPromptAppend}` };
|
|
1197
|
+
});
|
|
1198
|
+
},
|
|
1175
1199
|
}] : [])] };
|
|
1176
1200
|
},
|
|
1177
1201
|
} };
|
|
@@ -1279,10 +1303,10 @@ export class SessionRegistry {
|
|
|
1279
1303
|
});
|
|
1280
1304
|
else
|
|
1281
1305
|
this.options.store.updateSession(binding.sessionId, { residency: 'warm' });
|
|
1282
|
-
const projection = new SessionProjection({ binding, store: this.options.store, extras: () => this.extras(binding.sessionId), publish: event => this.publish(event), onError: error => { this.
|
|
1306
|
+
const projection = new SessionProjection({ binding, store: this.options.store, extras: () => this.extras(binding.sessionId), publish: event => this.publish(event), onError: error => { this.projectionFailed(binding.sessionId, error); },
|
|
1283
1307
|
commandAvailable: name => this.options.commandAvailable?.(binding.sessionId, name) === false ? false
|
|
1284
1308
|
: this.commandDispatcher?.(binding.sessionId, name) ?? this.options.commandAvailable?.(binding.sessionId, name) ?? false,
|
|
1285
|
-
canSettle: () => { const current = this.entries.get(binding.sessionId); return !current?.dispatches.size && !current?.cancelling; },
|
|
1309
|
+
canSettle: () => { const current = this.entries.get(binding.sessionId); return !current?.dispatches.size && !current?.cancelling && !current?.projectionFailed; },
|
|
1286
1310
|
onRefresh: () => {
|
|
1287
1311
|
const current = this.entries.get(binding.sessionId);
|
|
1288
1312
|
if (current)
|
|
@@ -1376,6 +1400,8 @@ export class SessionRegistry {
|
|
|
1376
1400
|
}
|
|
1377
1401
|
cancelViews(id) {
|
|
1378
1402
|
const entry = this.require(id);
|
|
1403
|
+
if (entry.projectionFailed)
|
|
1404
|
+
return Promise.resolve();
|
|
1379
1405
|
if (entry.cancellingViews)
|
|
1380
1406
|
return entry.cancellingViews;
|
|
1381
1407
|
for (const controller of entry.viewActions ?? [])
|
|
@@ -1439,7 +1465,7 @@ export class SessionRegistry {
|
|
|
1439
1465
|
catch { /* Diagnostics cannot block best-effort cancellation. */ }
|
|
1440
1466
|
}
|
|
1441
1467
|
updateCommandState(entry) {
|
|
1442
|
-
if (!entry.command)
|
|
1468
|
+
if (entry.projectionFailed || !entry.command)
|
|
1443
1469
|
return;
|
|
1444
1470
|
const run = this.options.store.sessionMetadata(entry.binding.sessionId).run;
|
|
1445
1471
|
if (run.id !== entry.command.runId || run.state !== 'running' && run.state !== 'waiting')
|
|
@@ -1520,7 +1546,10 @@ export class SessionRegistry {
|
|
|
1520
1546
|
if (entry.disposing)
|
|
1521
1547
|
return entry.disposing;
|
|
1522
1548
|
entry.disposing = (async () => {
|
|
1523
|
-
entry.
|
|
1549
|
+
if (entry.projectionCancellation)
|
|
1550
|
+
await entry.projectionCancellation;
|
|
1551
|
+
if (!entry.projectionFailed)
|
|
1552
|
+
entry.projection.refresh();
|
|
1524
1553
|
if (close)
|
|
1525
1554
|
this.processes.seal(id);
|
|
1526
1555
|
for (const service of [...entry.services])
|
|
@@ -1542,7 +1571,10 @@ export class SessionRegistry {
|
|
|
1542
1571
|
this.options.owner.assertCurrent();
|
|
1543
1572
|
const stored = this.options.store.sessionMetadata(id);
|
|
1544
1573
|
const closed = close || this.closes.has(id);
|
|
1545
|
-
entry.
|
|
1574
|
+
if (entry.projectionFailed)
|
|
1575
|
+
this.options.store.transitionSessionForSafety(id, closed ? 'closed' : 'evicted');
|
|
1576
|
+
else
|
|
1577
|
+
entry.projection.transitionForSafety(closed ? 'closed' : 'evicted');
|
|
1546
1578
|
entry.projection.dispose();
|
|
1547
1579
|
this.entries.delete(id);
|
|
1548
1580
|
if (!preserveView)
|
|
@@ -1560,7 +1592,85 @@ export class SessionRegistry {
|
|
|
1560
1592
|
throw error;
|
|
1561
1593
|
}
|
|
1562
1594
|
}
|
|
1595
|
+
projectionFailed(session, error) {
|
|
1596
|
+
this.diagnostic({ scope: 'projection', session, error });
|
|
1597
|
+
if (!this.projectionIntegrityIntact(error))
|
|
1598
|
+
return;
|
|
1599
|
+
const entry = this.entries.get(session);
|
|
1600
|
+
if (!entry || entry.projectionFailed)
|
|
1601
|
+
return;
|
|
1602
|
+
entry.projectionFailed = true;
|
|
1603
|
+
this.processes.seal(session);
|
|
1604
|
+
const attempt = async (operation) => {
|
|
1605
|
+
try {
|
|
1606
|
+
await operation();
|
|
1607
|
+
}
|
|
1608
|
+
catch (cleanup) {
|
|
1609
|
+
this.diagnostic({ scope: 'registry', session, error: cleanup });
|
|
1610
|
+
this.cancellationFailures.add(cleanup);
|
|
1611
|
+
this.projectionIntegrityIntact(cleanup);
|
|
1612
|
+
}
|
|
1613
|
+
};
|
|
1614
|
+
entry.projectionCancellation = Promise.resolve().then(async () => {
|
|
1615
|
+
await attempt(() => entry.projection.dispose());
|
|
1616
|
+
await attempt(() => entry.runAbort?.abort());
|
|
1617
|
+
for (const controller of entry.viewActions ?? [])
|
|
1618
|
+
await attempt(() => controller.abort());
|
|
1619
|
+
await attempt(() => entry.binding.runtime.session.clearQueue());
|
|
1620
|
+
const transitionRun = (state) => {
|
|
1621
|
+
const commit = this.options.store.transitionSessionForSafety(session, state);
|
|
1622
|
+
if (commit.revisions[session] !== undefined)
|
|
1623
|
+
this.publish({ v: 1, session, rev: commit.value.revision, change: { type: 'run.updated', run: commit.value.run } });
|
|
1624
|
+
};
|
|
1625
|
+
await attempt(() => {
|
|
1626
|
+
const run = this.options.store.sessionMetadata(session).run;
|
|
1627
|
+
if (['running', 'waiting', 'cancelling'].includes(run.state))
|
|
1628
|
+
transitionRun('cancelling');
|
|
1629
|
+
});
|
|
1630
|
+
await attempt(() => this.settleInteractions(session, 'cancel'));
|
|
1631
|
+
// Abort and foreground termination must run together: a tool may be waiting for its process to exit.
|
|
1632
|
+
await Promise.all([
|
|
1633
|
+
attempt(() => entry.binding.runtime.session.abort()),
|
|
1634
|
+
attempt(() => this.processes.cancelForeground(session)),
|
|
1635
|
+
]);
|
|
1636
|
+
await attempt(() => this.join([...entry.writers]));
|
|
1637
|
+
await attempt(() => {
|
|
1638
|
+
if (this.failure)
|
|
1639
|
+
return;
|
|
1640
|
+
if (!entry.binding.runtime.session.isIdle)
|
|
1641
|
+
throw new Error('Projection-failed session has not settled.');
|
|
1642
|
+
transitionRun('idle');
|
|
1643
|
+
});
|
|
1644
|
+
}).finally(() => { delete entry.projectionCancellation; });
|
|
1645
|
+
}
|
|
1646
|
+
projectionIntegrityIntact(error) {
|
|
1647
|
+
if (error instanceof AggregateError) {
|
|
1648
|
+
for (const nested of error.errors)
|
|
1649
|
+
if (!this.projectionIntegrityIntact(nested))
|
|
1650
|
+
return false;
|
|
1651
|
+
}
|
|
1652
|
+
if (error instanceof DaemonSecurityError || error instanceof ControlStoreError && ['storage_failure', 'ownership_lost'].includes(error.code)) {
|
|
1653
|
+
this.fence(error);
|
|
1654
|
+
return false;
|
|
1655
|
+
}
|
|
1656
|
+
try {
|
|
1657
|
+
this.options.owner.assertCurrent();
|
|
1658
|
+
this.options.store.assertCurrent();
|
|
1659
|
+
}
|
|
1660
|
+
catch (integrityError) {
|
|
1661
|
+
this.fence(integrityError);
|
|
1662
|
+
return false;
|
|
1663
|
+
}
|
|
1664
|
+
return true;
|
|
1665
|
+
}
|
|
1666
|
+
diagnostic(event) {
|
|
1667
|
+
try {
|
|
1668
|
+
this.options.onDiagnostic?.(event);
|
|
1669
|
+
}
|
|
1670
|
+
catch { }
|
|
1671
|
+
}
|
|
1563
1672
|
fence(error) {
|
|
1673
|
+
this.diagnostic({ scope: 'registry', error });
|
|
1564
1674
|
this.failure = error;
|
|
1565
1675
|
this.processes.sealAll();
|
|
1566
1676
|
for (const entry of this.entries.values()) {
|
|
@@ -1590,7 +1700,7 @@ export class SessionRegistry {
|
|
|
1590
1700
|
const roots = new Set([...this.entries.values()].map(entry => entry.binding.rootSessionId).concat([...this.processes.liveRoots()]));
|
|
1591
1701
|
const pending = [...this.opening.values(), ...this.closes.values(), ...[...roots].map(root => this.processes.settle(root, true))];
|
|
1592
1702
|
for (const entry of this.entries.values()) {
|
|
1593
|
-
pending.push(entry.binding.runtime.session.abort(), ...(entry.disposing ? [entry.disposing] : []), ...(entry.cancelling ? [entry.cancelling] : []));
|
|
1703
|
+
pending.push(entry.binding.runtime.session.abort(), ...(entry.disposing ? [entry.disposing] : []), ...(entry.cancelling ? [entry.cancelling] : []), ...(entry.projectionCancellation ? [entry.projectionCancellation] : []));
|
|
1594
1704
|
if (entry.host)
|
|
1595
1705
|
pending.push((async () => {
|
|
1596
1706
|
try {
|
|
@@ -1617,10 +1727,10 @@ export class SessionRegistry {
|
|
|
1617
1727
|
throw new AggregateError(failures, 'Registry writers did not settle cleanly; ownership must remain held.');
|
|
1618
1728
|
}
|
|
1619
1729
|
pendingWriters() {
|
|
1620
|
-
return [...this.opening.values(), ...this.lifecycleWriters, ...[...this.entries.values()].flatMap(entry => [...entry.writers, ...(entry.cancelling ? [entry.cancelling] : [])])];
|
|
1730
|
+
return [...this.opening.values(), ...this.lifecycleWriters, ...[...this.entries.values()].flatMap(entry => [...entry.writers, ...(entry.cancelling ? [entry.cancelling] : []), ...(entry.projectionCancellation ? [entry.projectionCancellation] : [])])];
|
|
1621
1731
|
}
|
|
1622
1732
|
hasPendingWriters() {
|
|
1623
|
-
return this.opening.size > 0 || this.lifecycleWriters.size > 0 || [...this.entries.values()].some(entry => entry.writers.size > 0 || entry.cancelling !== undefined);
|
|
1733
|
+
return this.opening.size > 0 || this.lifecycleWriters.size > 0 || [...this.entries.values()].some(entry => entry.writers.size > 0 || entry.cancelling !== undefined || entry.projectionCancellation !== undefined);
|
|
1624
1734
|
}
|
|
1625
1735
|
async join(operations, failures, allowCancelled = false) {
|
|
1626
1736
|
const errors = failures ?? [];
|