instar 1.3.1259 → 1.3.1261
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/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +170 -1
- package/dist/commands/server.js.map +1 -1
- package/dist/core/PasskeyCellActions.d.ts +13 -3
- package/dist/core/PasskeyCellActions.d.ts.map +1 -1
- package/dist/core/PasskeyCellActions.js +23 -0
- package/dist/core/PasskeyCellActions.js.map +1 -1
- package/dist/core/PasskeyPoolState.d.ts +339 -0
- package/dist/core/PasskeyPoolState.d.ts.map +1 -0
- package/dist/core/PasskeyPoolState.js +506 -0
- package/dist/core/PasskeyPoolState.js.map +1 -0
- package/dist/core/PasskeyRevokeOutbox.d.ts +119 -0
- package/dist/core/PasskeyRevokeOutbox.d.ts.map +1 -0
- package/dist/core/PasskeyRevokeOutbox.js +299 -0
- package/dist/core/PasskeyRevokeOutbox.js.map +1 -0
- package/dist/core/WriteDomainRegistry.d.ts.map +1 -1
- package/dist/core/WriteDomainRegistry.js +48 -0
- package/dist/core/WriteDomainRegistry.js.map +1 -1
- package/dist/data/standards-guard-index.json +1 -1
- package/dist/data/standards-guard-index.meta.json +2 -2
- package/dist/data/standards-registry.meta.json +1 -1
- package/dist/messaging/TelegramAdapter.d.ts +9 -0
- package/dist/messaging/TelegramAdapter.d.ts.map +1 -1
- package/dist/messaging/TelegramAdapter.js +23 -0
- package/dist/messaging/TelegramAdapter.js.map +1 -1
- package/dist/server/AgentServer.d.ts +4 -0
- package/dist/server/AgentServer.d.ts.map +1 -1
- package/dist/server/AgentServer.js +3 -0
- package/dist/server/AgentServer.js.map +1 -1
- package/dist/server/CapabilityIndex.js +1 -1
- package/dist/server/CapabilityIndex.js.map +1 -1
- package/dist/server/routes.d.ts +8 -0
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +350 -6
- package/dist/server/routes.js.map +1 -1
- package/dist/testing/selfActionRegistry.d.ts.map +1 -1
- package/dist/testing/selfActionRegistry.js +62 -0
- package/dist/testing/selfActionRegistry.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +47 -47
- package/src/data/standards-guard-index.json +1 -1
- package/src/data/standards-guard-index.meta.json +2 -2
- package/src/data/standards-registry.meta.json +1 -1
- package/upgrades/1.3.1260.md +33 -0
- package/upgrades/1.3.1261.md +43 -0
- package/upgrades/side-effects/passkey-inc6-revoke-outbox.md +195 -0
- package/upgrades/side-effects/passkey-inc8-pool-read-path.md +258 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAsGA,OAAO,EAAE,cAAc,EAAwD,MAAM,2BAA2B,CAAC;AAUjH,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AA4BjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAmI7D,OAAO,KAAK,EAAW,oBAAoB,EAAe,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAkFtD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC1C,OAAO,CAUT;AA0ID,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAoDD,+EAA+E;AAC/E,wBAAgB,qCAAqC,CACnD,SAAS,EAAE,IAAI,CAAC,OAAO,2BAA2B,EAAE,cAAc,EAAE,QAAQ,CAAC,GAAG,IAAI,EACpF,OAAO,EAAE,MAAM,GACd,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,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
|
package/dist/commands/server.js
CHANGED
|
@@ -25777,10 +25777,175 @@ export async function startServer(options) {
|
|
|
25777
25777
|
userDirected: true, status: 'open', assignee: null, priority: 'medium',
|
|
25778
25778
|
})),
|
|
25779
25779
|
});
|
|
25780
|
+
// ── Agent-held Google passkeys: the durable revoke outbox (spec §3.2 / FD15) ─────────────
|
|
25781
|
+
// Dev-gated behind `passkeys.enabled` (dark on the fleet). Re-delivers this machine's SIGNED
|
|
25782
|
+
// peer revokes unchanged on 1h/6h/daily backoff, escalates at 30 days, one post-breaker attempt
|
|
25783
|
+
// when the peer is next online. Registered self-action controller `passkey-revoke-outbox`.
|
|
25784
|
+
let _passkeyRevokeOutbox = null;
|
|
25785
|
+
let _passkeyOutboxTimer = null;
|
|
25786
|
+
const _passkeyPeerOnline = (machineId) => (machinePoolRegistry?.getCapacities() ?? []).some((c) => c.machineId === machineId && c.online === true);
|
|
25787
|
+
try {
|
|
25788
|
+
const pkCfg = config.passkeys;
|
|
25789
|
+
if (resolveDevAgentGate(pkCfg?.enabled, config)) {
|
|
25790
|
+
const { PasskeyRevokeOutbox } = await import('../core/PasskeyRevokeOutbox.js');
|
|
25791
|
+
const { PasskeyGrantStore } = await import('../core/PasskeyGrantStore.js');
|
|
25792
|
+
const pkSelfId = _meshSelfId ?? coordinator?.identity?.machineId ?? machineHeartbeat.config.machineId;
|
|
25793
|
+
_passkeyRevokeOutbox = new PasskeyRevokeOutbox({
|
|
25794
|
+
stateDir: config.stateDir,
|
|
25795
|
+
deliver: async (targetMachineId, portable) => {
|
|
25796
|
+
const peer = (_resolvePeerUrls?.() ?? []).find((p) => p.machineId === targetMachineId);
|
|
25797
|
+
if (!peer)
|
|
25798
|
+
return { kind: 'unreachable', reason: 'no-peer-url' };
|
|
25799
|
+
try {
|
|
25800
|
+
const r = await fetch(`${peer.url.replace(/\/$/, '')}/passkeys/cell-action`, {
|
|
25801
|
+
method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${config.authToken ?? ''}` },
|
|
25802
|
+
body: JSON.stringify({ portable }), signal: AbortSignal.timeout(15_000),
|
|
25803
|
+
});
|
|
25804
|
+
const json = await r.json().catch(() => ({}));
|
|
25805
|
+
if (r.ok && json.applied === true)
|
|
25806
|
+
return { kind: 'applied', detail: json };
|
|
25807
|
+
const reason = typeof json.reason === 'string' ? json.reason : `status-${r.status}`;
|
|
25808
|
+
if (reason === 'dismissed-by-operator')
|
|
25809
|
+
return { kind: 'dismissed', reason };
|
|
25810
|
+
if (r.status >= 500)
|
|
25811
|
+
return { kind: 'unreachable', reason };
|
|
25812
|
+
return { kind: 'refused', reason };
|
|
25813
|
+
}
|
|
25814
|
+
catch (err) {
|
|
25815
|
+
return { kind: 'unreachable', reason: err instanceof Error ? err.message : String(err) };
|
|
25816
|
+
}
|
|
25817
|
+
},
|
|
25818
|
+
peerOnline: _passkeyPeerOnline,
|
|
25819
|
+
raiseIncompleteRevoke: (item) => telegram?.upsertAttentionItem({
|
|
25820
|
+
id: item.id, title: `Passkey revoke not acknowledged by ${item.machineId} for 30 days`,
|
|
25821
|
+
summary: item.body.slice(0, 160), description: item.body, category: 'passkeys', priority: 'HIGH', sourceContext: 'passkey-revoke-outbox',
|
|
25822
|
+
}),
|
|
25823
|
+
onApplied: (entry) => {
|
|
25824
|
+
try {
|
|
25825
|
+
new PasskeyGrantStore({ stateDir: config.stateDir, machineId: pkSelfId }).forgetIssuedPeerGrant(entry.canonicalEmail, entry.targetMachineId);
|
|
25826
|
+
}
|
|
25827
|
+
catch (err) {
|
|
25828
|
+
console.warn(`[passkeys] could not forget the issued peer-grant copy after an applied revoke: ${err instanceof Error ? err.message : String(err)}`);
|
|
25829
|
+
}
|
|
25830
|
+
},
|
|
25831
|
+
log: (line) => console.log(pc.dim(` ${line}`)),
|
|
25832
|
+
});
|
|
25833
|
+
const outbox = _passkeyRevokeOutbox;
|
|
25834
|
+
_passkeyOutboxTimer = setInterval(() => {
|
|
25835
|
+
void outbox.tick().catch((err) => console.warn(`[passkeys] revoke outbox tick failed: ${err instanceof Error ? err.message : String(err)}`));
|
|
25836
|
+
}, 10 * 60_000);
|
|
25837
|
+
_passkeyOutboxTimer.unref?.();
|
|
25838
|
+
}
|
|
25839
|
+
}
|
|
25840
|
+
catch (err) {
|
|
25841
|
+
// @silent-fallback-ok — an outbox init failure leaves it null: the routes fall back to a per-request
|
|
25842
|
+
// file-backed outbox (no timer), and the failure is logged here; boot is never blocked.
|
|
25843
|
+
console.warn(`[passkeys] revoke outbox not started: ${err instanceof Error ? err.message : String(err)}`);
|
|
25844
|
+
}
|
|
25845
|
+
// ── Agent-held Google passkeys: the pool read path (spec §5.1) ───────────────────────────
|
|
25846
|
+
// Same dev gate. One reader per server: every 5 minutes it queries each peer's
|
|
25847
|
+
// GET /passkeys/pool-state once (5 s per peer, 5 s overall), classifies peers with rope health,
|
|
25848
|
+
// keeps last-known rows durably, and serves ONE memo to every pool-wide check and to
|
|
25849
|
+
// GET /passkeys?scope=pool. Read-only observation; it restricts, never grants.
|
|
25850
|
+
let _passkeyPoolReader = null;
|
|
25851
|
+
let _passkeyPoolTimer = null;
|
|
25852
|
+
try {
|
|
25853
|
+
const pkCfg = config.passkeys;
|
|
25854
|
+
if (resolveDevAgentGate(pkCfg?.enabled, config)) {
|
|
25855
|
+
const { PasskeyPoolReader, PasskeyPeerExclusions, PasskeyAttemptLedger, buildLocalPasskeyMachineState, PASSKEY_POOL_STATE_MAX_BYTES } = await import('../core/PasskeyPoolState.js');
|
|
25856
|
+
const { PasskeyGrantStore } = await import('../core/PasskeyGrantStore.js');
|
|
25857
|
+
const { PasskeyCredentialStore, PASSKEY_DIR } = await import('../core/PasskeyCredentialStore.js');
|
|
25858
|
+
const { isPeerUrlAllowedForCredentials } = await import('../server/peerUrlGuard.js');
|
|
25859
|
+
const pkSelfId = _meshSelfId ?? coordinator?.identity?.machineId ?? machineHeartbeat.config.machineId;
|
|
25860
|
+
const outboxRef = _passkeyRevokeOutbox;
|
|
25861
|
+
_passkeyPoolReader = new PasskeyPoolReader({
|
|
25862
|
+
stateDir: config.stateDir, selfMachineId: pkSelfId,
|
|
25863
|
+
localState: () => {
|
|
25864
|
+
const grants = new PasskeyGrantStore({ stateDir: config.stateDir, machineId: pkSelfId });
|
|
25865
|
+
const list = grants.list();
|
|
25866
|
+
let custody = null;
|
|
25867
|
+
const pendingEmails = [];
|
|
25868
|
+
if (fs.existsSync(path.join(config.stateDir, PASSKEY_DIR, 'store.enc'))) {
|
|
25869
|
+
try {
|
|
25870
|
+
const store = new PasskeyCredentialStore({ stateDir: config.stateDir, machineId: pkSelfId, forceFileKey: config.secrets?.forceFileKey });
|
|
25871
|
+
const index = store.listIndex();
|
|
25872
|
+
custody = [];
|
|
25873
|
+
for (const email of new Set(list.map((g) => g.canonicalEmail))) {
|
|
25874
|
+
const entry = index.find((e) => e.emailKey === store.emailKey(email));
|
|
25875
|
+
if (entry)
|
|
25876
|
+
custody.push({ canonicalEmail: email, state: entry.custodyState });
|
|
25877
|
+
if (store.readPending(email))
|
|
25878
|
+
pendingEmails.push(email);
|
|
25879
|
+
}
|
|
25880
|
+
}
|
|
25881
|
+
catch (err) {
|
|
25882
|
+
// @silent-fallback-ok — NOT swallowed: custody reads `absent` (the restrictive direction) and the failure is logged.
|
|
25883
|
+
console.warn(`[passkeys] custody read failed while publishing pool state: ${err instanceof Error ? err.message : String(err)}`);
|
|
25884
|
+
custody = null;
|
|
25885
|
+
}
|
|
25886
|
+
}
|
|
25887
|
+
return buildLocalPasskeyMachineState({
|
|
25888
|
+
machineId: pkSelfId, grants: list, issuedPeerGrants: grants.listIssuedPeerGrants(), revokeHighWater: grants.revokeHighWater(),
|
|
25889
|
+
custody, pendingEmails, outbox: outboxRef?.list() ?? [], ledger: new PasskeyAttemptLedger({ stateDir: config.stateDir, machineId: pkSelfId }),
|
|
25890
|
+
pushEnabled: config.multiMachine?.secretSync?.pushEnabled === true,
|
|
25891
|
+
});
|
|
25892
|
+
},
|
|
25893
|
+
listPeers: () => (_listPoolMachines?.() ?? []).filter((m) => m.machineId !== pkSelfId).map((m) => ({
|
|
25894
|
+
machineId: m.machineId, nickname: m.nickname ?? null, url: m.lastKnownUrl ?? null,
|
|
25895
|
+
online: machinePoolRegistry?.getCapacity(m.machineId)?.online ?? null,
|
|
25896
|
+
})),
|
|
25897
|
+
fetchPeerState: async (peer, timeoutMs) => {
|
|
25898
|
+
if (!peer.url)
|
|
25899
|
+
return { ok: false, reason: 'no-known-url' };
|
|
25900
|
+
if (!isPeerUrlAllowedForCredentials(peer.url, config.multiMachine?.peerUrlAllowlist).ok)
|
|
25901
|
+
return { ok: false, reason: 'url-rejected' };
|
|
25902
|
+
try {
|
|
25903
|
+
const r = await fetch(`${peer.url.replace(/\/$/, '')}/passkeys/pool-state`, {
|
|
25904
|
+
headers: { Authorization: `Bearer ${config.authToken ?? ''}`, 'X-Instar-Machine-Id': pkSelfId }, signal: AbortSignal.timeout(timeoutMs),
|
|
25905
|
+
});
|
|
25906
|
+
if (r.status === 404 || r.status === 503)
|
|
25907
|
+
return { ok: false, reason: 'route-missing' };
|
|
25908
|
+
if (r.status === 401 || r.status === 403)
|
|
25909
|
+
return { ok: false, reason: 'unauthorized' };
|
|
25910
|
+
if (!r.ok)
|
|
25911
|
+
return { ok: false, reason: r.status >= 500 ? 'error' : 'refused' };
|
|
25912
|
+
// Bound the body BEFORE parsing — this fetch runs unattended every 5 minutes.
|
|
25913
|
+
const text = await r.text();
|
|
25914
|
+
if (text.length > PASSKEY_POOL_STATE_MAX_BYTES)
|
|
25915
|
+
return { ok: false, reason: 'malformed' };
|
|
25916
|
+
return { ok: true, body: JSON.parse(text) };
|
|
25917
|
+
}
|
|
25918
|
+
catch (err) {
|
|
25919
|
+
// @silent-fallback-ok — NOT swallowed: classified into the peer's pool row (timeout / malformed /
|
|
25920
|
+
// unreachable ⇒ partitioned, the restrictive direction) and surfaced in `degradedReasons`.
|
|
25921
|
+
const name = err instanceof Error ? err.name : '';
|
|
25922
|
+
return { ok: false, reason: name === 'TimeoutError' || name === 'AbortError' ? 'timeout' : name === 'SyntaxError' ? 'malformed' : 'unreachable' };
|
|
25923
|
+
}
|
|
25924
|
+
},
|
|
25925
|
+
ropeCondition: (id) => ropeHealthMonitor?.status().peers.find((p) => p.machineId === id)?.condition ?? null,
|
|
25926
|
+
ropeAvailable: () => !!ropeHealthMonitor,
|
|
25927
|
+
exclusions: new PasskeyPeerExclusions({ stateDir: config.stateDir }),
|
|
25928
|
+
// `?scope=pool` and every check are served from the memo for a whole tick interval (§5.1
|
|
25929
|
+
// "always served from the tick memo"): a dashboard polling every few seconds never re-fans.
|
|
25930
|
+
memoTtlMs: 5 * 60_000,
|
|
25931
|
+
log: (line) => console.log(pc.dim(` ${line}`)),
|
|
25932
|
+
});
|
|
25933
|
+
const reader = _passkeyPoolReader;
|
|
25934
|
+
_passkeyPoolTimer = setInterval(() => {
|
|
25935
|
+
void reader.tick().catch((err) => console.warn(`[passkeys] pool read tick failed: ${err instanceof Error ? err.message : String(err)}`));
|
|
25936
|
+
}, 5 * 60_000);
|
|
25937
|
+
_passkeyPoolTimer.unref?.();
|
|
25938
|
+
}
|
|
25939
|
+
}
|
|
25940
|
+
catch (err) {
|
|
25941
|
+
// @silent-fallback-ok — a reader init failure leaves it null: the routes fall back to a per-request
|
|
25942
|
+
// reader (no timer; last-known rows still on disk), and the failure is logged; boot is never blocked.
|
|
25943
|
+
console.warn(`[passkeys] pool reader not started: ${err instanceof Error ? err.message : String(err)}`);
|
|
25944
|
+
}
|
|
25780
25945
|
const server = new AgentServer({ config, singleInstanceLock, terminateSessionAuthority: terminateWithAuthority, subscriptionEmailBinding: credentialLocationLedger, subscriptionEmailBarrier, subscriptionIdentityOracle, sessionManager, llmQueue: sharedLlmQueue, state, scheduler, telegram, telegramOrigin: telegramOriginBoot?.runtime, relationships, feedback, feedbackAnomalyDetector, dispatches, updateChecker, autoUpdater, autoDispatcher, quotaTracker, quotaManager, publisher, viewer, tunnel, evolution, watchdog, topicMemory, triageNurse, projectMapper, cartographerRoots: cartographerRoots ?? undefined, coherenceGate: scopeVerifier, contextHierarchy, canonicalState, operationGate, sentinel, adaptiveTrust, memoryMonitor, orphanReaper, coherenceMonitor, commitmentTracker, subscriptionPool, accountFollowMePeerViews: async () => { const nickById = new Map((_listPoolMachines?.() ?? []).map((m) => [m.machineId, m.nickname ?? m.machineId])); let peers = (_resolvePeerUrls?.() ?? []).map((p) => ({ machineId: p.machineId, nickname: nickById.get(p.machineId) ?? p.machineId, url: p.url })); if (peers.length === 0) {
|
|
25781
25946
|
peers = (_listPoolMachines?.() ?? []).filter((m) => m.machineId !== _meshSelfId && !!m.lastKnownUrl).map((m) => ({ machineId: m.machineId, nickname: m.nickname ?? m.machineId, url: m.lastKnownUrl }));
|
|
25782
25947
|
} if (peers.length === 0)
|
|
25783
|
-
return []; const { fetchPeerSubscriptionViews } = await import('../core/fetchPeerSubscriptionViews.js'); return fetchPeerSubscriptionViews({ peers: () => peers, fetchImpl: fetch, authToken: config.authToken ?? '' }); }, quotaPoller, quotaAwareScheduler: _quotaAwareScheduler ?? undefined, proactiveSwapMonitor: _proactiveSwapMonitor ?? undefined, inUseAccountResolver, enrollmentWizard, accountFollowMeRevocation, credentialRepointing, semanticMemory, activitySentinel, rateLimitSentinel, releaseReadinessSentinel: releaseReadinessSentinel ?? undefined, greenPrAutoMerger: greenPrAutoMerger ?? undefined, guardLatchStore: guardLatchStore ?? undefined, messageRouter, summarySentinel, spawnManager, systemReviewer, capabilityMapper, selfKnowledgeTree, coverageAuditor, topicResumeMap: _topicResumeMap ?? undefined, topicProfile: _topicProfileCtx ?? undefined, sessionRefresh: _sessionRefresh ?? undefined, autonomyManager, trustElevationTracker, autonomousEvolution, coordinator: coordinator.enabled ? coordinator : undefined, meshBindActive: coordinator.managers.identityManager.hasIdentity() && config.multiMachine?.meshTransport?.enabled !== false, localSigningKeyPem, leaseTransport, peerEndpointRecorder, getSelfMeshEndpoints, onLeasePullRequest: () => leaseCoordinatorRef?.currentLease() ?? null, liveTailReceiver, handoffWireTransport, onHandoffBegin, onHandoffInitiate: handoffInitiate, handoffInProgress: handoffSentinelInProgress, messageLedger, currentInboundByTopic, replyMarkerTransport, onReplyMarker: messageLedger ? (marker) => { const m = marker; messageLedger.applyRemoteReplyMarker(m.dedupeKey, { platform: m.platform, replyIdempotencyKey: m.replyIdempotencyKey, epoch: m.epoch, topic: m.topic ?? null }); } : undefined, whatsapp: whatsappAdapter, slack: slackAdapter, imessage: imessageAdapter, conversationRegistry, conversationBindAuth, conversationFollowThrough, whatsappBusinessBackend, messageBridge, hookEventReceiver, worktreeMonitor, subagentTracker, instructionsVerifier, handshakeManager: threadlineHandshake, threadlineRouter, conversationStore, threadLog, threadMessageRecorder, warrantsReplyGate, collaborationSurfacer, threadResumeMap, topicLinkageHandler: topicLinkageHandler ?? undefined, threadlineRelayClient, getLastRelayEvent: threadlineGetLastRelayEvent, threadlineReplyWaiters, listenerManager: listenerManager ?? undefined, a2aDeliveryTracker: a2aDeliveryTracker ?? undefined, responseReviewGate, reviewCanaryBattery, messagingToneGate, outboundDedupGate, telemetryHeartbeat, pasteManager, featureRegistry, discoveryEvaluator, completionEvaluator, unifiedTrust, liveConfig, sharedStateLedger, ledgerSessionRegistry, worktreeManager, oidcEnrolledRepos: parallelDevConfig?.oidcEnrolledRepos, initiativeTracker, projectRoundRunner, projectDriftChecker, machineHeartbeat, machinePoolRegistry, ropeHealthMonitor, writeAdmission: writeAdmission ?? undefined, getInboundQueue: () => _inboundQueue, getMachineCoherence: () => _machineCoherenceSentinel, getSingleMachineFailoverGap: () => _singleMachineFailoverGap, getMissingLoginSession: () => _missingLoginSession, getSessionPoolFailoverRunner: () => _sessionPoolFailoverRunnerDriver?.status() ?? null, sessionPoolPromotionActivation: _sessionPoolPromotionActivation, meshRpcDispatcher, deliverA2aToMachine: _deliverA2aToMachine ?? undefined, workingSetPullCoordinator, workingSetArtifactManager, orchestratorPoller, commitmentReplicaStore, preferenceReplicaStore, replicatedRecordEmitter, conflictStore, rollbackUnmerge, droppedOriginRegistry, preferencesUnionReader, forwardCommitmentMutate, sessionOwnershipRegistry, sendDrain: _sendDrain ?? undefined, topicPinStore: _topicPinStore ?? undefined, topicPinSkewQuarantine: _topicPinSkewQuarantine ?? undefined, topicPinFoldView: _topicPinFoldView ?? undefined, ownershipReconciler: _ownershipReconciler ?? undefined, staleOwnerEngine: _staleOwnerEngine ?? undefined, duplicateReconciler: _duplicateReconciler ?? undefined, ownerDarkLadder: _ownerDarkLadder ?? undefined, spawnAdmission: _spawnAdmission ?? undefined, judgmentProvenance: _judgmentProvenance ?? undefined, leaseHandback: _leaseHandbackCtx ?? undefined, streamTicketStore: _streamTicketStore ?? undefined, poolStreamAllowRemoteInput: config.dashboard?.poolStream?.allowRemoteInput ?? false, poolStreamConnector: _poolStreamConnector ?? undefined, secretSync: _secretSyncHandle ?? undefined, meshSelfId: _meshSelfId ?? undefined, resolveRouterUrl: _resolveRouterUrl ?? undefined, resolvePeerUrls: _resolvePeerUrls ?? undefined, guardRegistry, listPoolMachines: _listPoolMachines ?? undefined, deliverMandateToMachine: _deliverMandateToMachine ?? undefined, poolLink: _poolLink ?? undefined, poolPollCache: _poolPollCache ?? undefined, sessionPoolE2EResultStore, proxyCoordinator, topicIntentStore, topicIntentArcCheck, usherSignalStore, intelligence: sharedIntelligence ?? undefined, telegramBridgeConfig, telegramBridge: telegramBridge ?? undefined, threadlineObservability, briefDeps, workingMemory, taskFlowRegistry, threadlineFlowBridge, sessionReaper, agentWorktreeReaper, externalHogSentinel, orphanedWorkSentinel, mcpProcessReaper, geminiLoopRunner, sleepController, agentActivityState, reapLog, resumeQueue, resumeDrainer, autonomousLivenessReconciler, enforcedTerminationStatus: () => enforcedTerminationWatchdog?.guardStatus() ?? null, prHandLease: prHandLease ?? undefined, standDownRegistry: _standDownRegistry ?? undefined, standDownAudit: _standDownAudit ?? undefined, operatorStopRecorder: recordOperatorStop, sleepWakeDetector, unjustifiedStopGate, stopGateDb, stopNotifier, liveTestGate, liveTestGateMode, liveTestRunnerCtx }); // Resolve the late-bound topic-operator getter (increment 2e): routing was
|
|
25948
|
+
return []; const { fetchPeerSubscriptionViews } = await import('../core/fetchPeerSubscriptionViews.js'); return fetchPeerSubscriptionViews({ peers: () => peers, fetchImpl: fetch, authToken: config.authToken ?? '' }); }, quotaPoller, quotaAwareScheduler: _quotaAwareScheduler ?? undefined, proactiveSwapMonitor: _proactiveSwapMonitor ?? undefined, inUseAccountResolver, enrollmentWizard, accountFollowMeRevocation, credentialRepointing, semanticMemory, activitySentinel, rateLimitSentinel, releaseReadinessSentinel: releaseReadinessSentinel ?? undefined, greenPrAutoMerger: greenPrAutoMerger ?? undefined, guardLatchStore: guardLatchStore ?? undefined, messageRouter, summarySentinel, spawnManager, systemReviewer, capabilityMapper, selfKnowledgeTree, coverageAuditor, topicResumeMap: _topicResumeMap ?? undefined, topicProfile: _topicProfileCtx ?? undefined, sessionRefresh: _sessionRefresh ?? undefined, autonomyManager, trustElevationTracker, autonomousEvolution, coordinator: coordinator.enabled ? coordinator : undefined, meshBindActive: coordinator.managers.identityManager.hasIdentity() && config.multiMachine?.meshTransport?.enabled !== false, localSigningKeyPem, leaseTransport, peerEndpointRecorder, getSelfMeshEndpoints, onLeasePullRequest: () => leaseCoordinatorRef?.currentLease() ?? null, liveTailReceiver, handoffWireTransport, onHandoffBegin, onHandoffInitiate: handoffInitiate, handoffInProgress: handoffSentinelInProgress, messageLedger, currentInboundByTopic, replyMarkerTransport, onReplyMarker: messageLedger ? (marker) => { const m = marker; messageLedger.applyRemoteReplyMarker(m.dedupeKey, { platform: m.platform, replyIdempotencyKey: m.replyIdempotencyKey, epoch: m.epoch, topic: m.topic ?? null }); } : undefined, whatsapp: whatsappAdapter, slack: slackAdapter, imessage: imessageAdapter, conversationRegistry, conversationBindAuth, conversationFollowThrough, whatsappBusinessBackend, messageBridge, hookEventReceiver, worktreeMonitor, subagentTracker, instructionsVerifier, handshakeManager: threadlineHandshake, threadlineRouter, conversationStore, threadLog, threadMessageRecorder, warrantsReplyGate, collaborationSurfacer, threadResumeMap, topicLinkageHandler: topicLinkageHandler ?? undefined, threadlineRelayClient, getLastRelayEvent: threadlineGetLastRelayEvent, threadlineReplyWaiters, listenerManager: listenerManager ?? undefined, a2aDeliveryTracker: a2aDeliveryTracker ?? undefined, responseReviewGate, reviewCanaryBattery, messagingToneGate, outboundDedupGate, telemetryHeartbeat, pasteManager, featureRegistry, discoveryEvaluator, completionEvaluator, unifiedTrust, liveConfig, sharedStateLedger, ledgerSessionRegistry, worktreeManager, oidcEnrolledRepos: parallelDevConfig?.oidcEnrolledRepos, initiativeTracker, projectRoundRunner, projectDriftChecker, machineHeartbeat, machinePoolRegistry, ropeHealthMonitor, writeAdmission: writeAdmission ?? undefined, getInboundQueue: () => _inboundQueue, getMachineCoherence: () => _machineCoherenceSentinel, getSingleMachineFailoverGap: () => _singleMachineFailoverGap, getMissingLoginSession: () => _missingLoginSession, getSessionPoolFailoverRunner: () => _sessionPoolFailoverRunnerDriver?.status() ?? null, sessionPoolPromotionActivation: _sessionPoolPromotionActivation, meshRpcDispatcher, deliverA2aToMachine: _deliverA2aToMachine ?? undefined, workingSetPullCoordinator, workingSetArtifactManager, orchestratorPoller, commitmentReplicaStore, preferenceReplicaStore, replicatedRecordEmitter, conflictStore, rollbackUnmerge, droppedOriginRegistry, preferencesUnionReader, forwardCommitmentMutate, sessionOwnershipRegistry, sendDrain: _sendDrain ?? undefined, topicPinStore: _topicPinStore ?? undefined, topicPinSkewQuarantine: _topicPinSkewQuarantine ?? undefined, topicPinFoldView: _topicPinFoldView ?? undefined, ownershipReconciler: _ownershipReconciler ?? undefined, staleOwnerEngine: _staleOwnerEngine ?? undefined, duplicateReconciler: _duplicateReconciler ?? undefined, ownerDarkLadder: _ownerDarkLadder ?? undefined, spawnAdmission: _spawnAdmission ?? undefined, judgmentProvenance: _judgmentProvenance ?? undefined, leaseHandback: _leaseHandbackCtx ?? undefined, streamTicketStore: _streamTicketStore ?? undefined, poolStreamAllowRemoteInput: config.dashboard?.poolStream?.allowRemoteInput ?? false, poolStreamConnector: _poolStreamConnector ?? undefined, secretSync: _secretSyncHandle ?? undefined, meshSelfId: _meshSelfId ?? undefined, resolveRouterUrl: _resolveRouterUrl ?? undefined, resolvePeerUrls: _resolvePeerUrls ?? undefined, guardRegistry, listPoolMachines: _listPoolMachines ?? undefined, deliverMandateToMachine: _deliverMandateToMachine ?? undefined, passkeyRevokeOutbox: _passkeyRevokeOutbox ? () => _passkeyRevokeOutbox : undefined, passkeyPeerOnline: _passkeyPeerOnline, passkeyPoolReader: _passkeyPoolReader ? () => _passkeyPoolReader : undefined, poolLink: _poolLink ?? undefined, poolPollCache: _poolPollCache ?? undefined, sessionPoolE2EResultStore, proxyCoordinator, topicIntentStore, topicIntentArcCheck, usherSignalStore, intelligence: sharedIntelligence ?? undefined, telegramBridgeConfig, telegramBridge: telegramBridge ?? undefined, threadlineObservability, briefDeps, workingMemory, taskFlowRegistry, threadlineFlowBridge, sessionReaper, agentWorktreeReaper, externalHogSentinel, orphanedWorkSentinel, mcpProcessReaper, geminiLoopRunner, sleepController, agentActivityState, reapLog, resumeQueue, resumeDrainer, autonomousLivenessReconciler, enforcedTerminationStatus: () => enforcedTerminationWatchdog?.guardStatus() ?? null, prHandLease: prHandLease ?? undefined, standDownRegistry: _standDownRegistry ?? undefined, standDownAudit: _standDownAudit ?? undefined, operatorStopRecorder: recordOperatorStop, sleepWakeDetector, unjustifiedStopGate, stopGateDb, stopNotifier, liveTestGate, liveTestGateMode, liveTestRunnerCtx }); // Resolve the late-bound topic-operator getter (increment 2e): routing was
|
|
25784
25949
|
const readIdentityProjectionPeerRows = async () => {
|
|
25785
25950
|
const peers = _resolvePeerUrls?.() ?? [];
|
|
25786
25951
|
const extra = config.multiMachine?.peerUrlAllowlist;
|
|
@@ -27167,6 +27332,10 @@ export async function startServer(options) {
|
|
|
27167
27332
|
releaseOriginLeaseRenewal();
|
|
27168
27333
|
coordinator.stop();
|
|
27169
27334
|
ropeHealthMonitor?.stop();
|
|
27335
|
+
if (_passkeyOutboxTimer)
|
|
27336
|
+
clearInterval(_passkeyOutboxTimer);
|
|
27337
|
+
if (_passkeyPoolTimer)
|
|
27338
|
+
clearInterval(_passkeyPoolTimer);
|
|
27170
27339
|
coherenceMonitor.stop();
|
|
27171
27340
|
commitmentTracker.stop();
|
|
27172
27341
|
commitmentSentinel?.stop();
|