instar 1.3.650 → 1.3.652

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.
Files changed (55) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +142 -2
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/core/HttpLeaseTransport.d.ts +18 -0
  5. package/dist/core/HttpLeaseTransport.d.ts.map +1 -1
  6. package/dist/core/HttpLeaseTransport.js +16 -0
  7. package/dist/core/HttpLeaseTransport.js.map +1 -1
  8. package/dist/core/MeshEndpointValidator.d.ts +57 -0
  9. package/dist/core/MeshEndpointValidator.d.ts.map +1 -0
  10. package/dist/core/MeshEndpointValidator.js +110 -0
  11. package/dist/core/MeshEndpointValidator.js.map +1 -0
  12. package/dist/core/PeerEndpointRecorder.d.ts +49 -0
  13. package/dist/core/PeerEndpointRecorder.d.ts.map +1 -0
  14. package/dist/core/PeerEndpointRecorder.js +69 -0
  15. package/dist/core/PeerEndpointRecorder.js.map +1 -0
  16. package/dist/core/ReapGuard.d.ts +13 -1
  17. package/dist/core/ReapGuard.d.ts.map +1 -1
  18. package/dist/core/ReapGuard.js +86 -30
  19. package/dist/core/ReapGuard.js.map +1 -1
  20. package/dist/core/SessionManager.d.ts +11 -0
  21. package/dist/core/SessionManager.d.ts.map +1 -1
  22. package/dist/core/SessionManager.js +30 -4
  23. package/dist/core/SessionManager.js.map +1 -1
  24. package/dist/core/devGatedFeatures.d.ts.map +1 -1
  25. package/dist/core/devGatedFeatures.js +6 -0
  26. package/dist/core/devGatedFeatures.js.map +1 -1
  27. package/dist/core/gapBCommitmentEvidence.d.ts +9 -0
  28. package/dist/core/gapBCommitmentEvidence.d.ts.map +1 -1
  29. package/dist/core/gapBCommitmentEvidence.js +20 -0
  30. package/dist/core/gapBCommitmentEvidence.js.map +1 -1
  31. package/dist/core/types.d.ts +11 -0
  32. package/dist/core/types.d.ts.map +1 -1
  33. package/dist/core/types.js.map +1 -1
  34. package/dist/monitoring/SessionReaper.d.ts +118 -7
  35. package/dist/monitoring/SessionReaper.d.ts.map +1 -1
  36. package/dist/monitoring/SessionReaper.js +302 -101
  37. package/dist/monitoring/SessionReaper.js.map +1 -1
  38. package/dist/monitoring/closeoutLivenessSnapshot.d.ts +143 -0
  39. package/dist/monitoring/closeoutLivenessSnapshot.d.ts.map +1 -0
  40. package/dist/monitoring/closeoutLivenessSnapshot.js +207 -0
  41. package/dist/monitoring/closeoutLivenessSnapshot.js.map +1 -0
  42. package/dist/server/AgentServer.d.ts +11 -0
  43. package/dist/server/AgentServer.d.ts.map +1 -1
  44. package/dist/server/AgentServer.js +2 -0
  45. package/dist/server/AgentServer.js.map +1 -1
  46. package/dist/server/machineRoutes.d.ts +13 -0
  47. package/dist/server/machineRoutes.d.ts.map +1 -1
  48. package/dist/server/machineRoutes.js +18 -2
  49. package/dist/server/machineRoutes.js.map +1 -1
  50. package/package.json +1 -1
  51. package/src/data/builtin-manifest.json +5 -5
  52. package/upgrades/1.3.651.md +25 -0
  53. package/upgrades/1.3.652.md +18 -0
  54. package/upgrades/side-effects/mesh-endpoint-http-propagation.md +51 -0
  55. package/upgrades/side-effects/post-transfer-closeout-correctness.md +43 -0
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA0CH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAU3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AAwBjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAuH7D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AA+EtD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,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,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
@@ -32,7 +32,7 @@ import { paneIdleWithEmptyInput } from '../core/ModelSwapService.js';
32
32
  import { escalatedModelIds, normalizeTierEscalationConfig } from '../core/ModelTierEscalation.js';
33
33
  import { activeAutonomousJobs, autonomousRunRemainingForTopic, listAutonomousJobs } from '../core/AutonomousSessions.js';
34
34
  import { AGE_LIMIT_ACTIVE_RUN_REASON, COMMITMENT_ACTIVE_RUN_REASON } from '../core/WorkEvidence.js';
35
- import { gapBEligibleForTopic, recentUserMessageFromHistory, resolveGapBInjectionGate, decideGapBInjection } from '../core/gapBCommitmentEvidence.js';
35
+ import { gapBEligibleForTopic, recentUserMessageFromHistory, recentUserMessageAtFromHistory, resolveGapBInjectionGate, decideGapBInjection } from '../core/gapBCommitmentEvidence.js';
36
36
  import { TopicProfileTransferCarrier, createTopicProfilePullHandler } from '../core/TopicProfileTransferCarrier.js';
37
37
  import { closeAllSqlite } from '../core/SqliteRegistry.js';
38
38
  import { SessionManager } from '../core/SessionManager.js';
@@ -112,6 +112,7 @@ import { isPeerPresumedDead } from '../core/leaseLiveness.js';
112
112
  import { readPollActive, pidAlive as pollPidAlive } from '../core/pollIntent.js';
113
113
  import { checkMultiMachineConfigCoherence } from '../core/configCoherence.js';
114
114
  import { HttpLeaseTransport } from '../core/HttpLeaseTransport.js';
115
+ import { PeerEndpointRecorder } from '../core/PeerEndpointRecorder.js';
115
116
  import { HttpLiveTailTransport } from '../core/HttpLiveTailTransport.js';
116
117
  import { LiveTailBuffer } from '../core/LiveTailBuffer.js';
117
118
  import { LiveTailSource } from '../core/LiveTailSource.js';
@@ -3874,6 +3875,11 @@ export async function startServer(options) {
3874
3875
  let gitSync;
3875
3876
  let registrySyncDebouncer;
3876
3877
  let leaseTransport;
3878
+ // mesh-endpoint-http-propagation — the peer-endpoint recorder (receiver + pull-response
3879
+ // chokepoint) and this machine's self-endpoints getter, hoisted so the AgentServer
3880
+ // construction (far below) can wire the /api/lease[/pull] receivers to real registry fns.
3881
+ let peerEndpointRecorder;
3882
+ let getSelfMeshEndpoints;
3877
3883
  let leaseCoordinatorRef;
3878
3884
  let liveTailBuffer;
3879
3885
  let liveTailSendTransport;
@@ -4028,6 +4034,17 @@ export async function startServer(options) {
4028
4034
  ownCidrs: () => ownIpv4Cidrs(),
4029
4035
  logger: (m) => console.log(pc.dim(m)),
4030
4036
  });
4037
+ // mesh-endpoint-http-propagation — the single recorder chokepoint, wired to REAL
4038
+ // registry fns (getMachineEndpoints / updateMachineEndpoints from MachineIdentity)
4039
+ // and the LIVE meshTransport gate. Shared by the receiver routes (sender/puller
4040
+ // direction) and the transport's pull-RESPONSE path (holder direction).
4041
+ getSelfMeshEndpoints = () => idMgr.getMachineEndpoints(selfMachineId);
4042
+ peerEndpointRecorder = new PeerEndpointRecorder({
4043
+ getPeerEndpoints: (id) => idMgr.getMachineEndpoints(id),
4044
+ updateMachineEndpoints: (id, eps) => idMgr.updateMachineEndpoints(id, eps),
4045
+ meshTransportEnabled: meshEnabled,
4046
+ logger: (m) => console.log(pc.dim(m)),
4047
+ });
4031
4048
  leaseTransport = new HttpLeaseTransport({
4032
4049
  selfMachineId,
4033
4050
  signingKeyPem: idMgr.loadSigningKey(),
@@ -4057,6 +4074,10 @@ export async function startServer(options) {
4057
4074
  resolver: meshResolver,
4058
4075
  meshTransportEnabled: meshEnabled,
4059
4076
  hedgeDelayMs: meshCfg?.hedgeDelayMs ?? 1500,
4077
+ // mesh-endpoint-http-propagation — carry self-endpoints in the signed body
4078
+ // (sender), and record the holder's endpoints out of a verified pull RESPONSE.
4079
+ getSelfEndpoints: getSelfMeshEndpoints,
4080
+ peerEndpointRecorder,
4060
4081
  logger: (m) => console.log(pc.dim(m)),
4061
4082
  });
4062
4083
  const leaseCoordinator = new LeaseCoordinator({
@@ -14066,6 +14087,96 @@ export async function startServer(options) {
14066
14087
  config: { residueDenylist: ysCfg.residueDenylist, cacheTtlMs: ysCfg.dirtyCheckCacheTtlMs },
14067
14088
  });
14068
14089
  }
14090
+ // ── Post-transfer closeout correctness (F1) ───────────────────────────────
14091
+ // closeoutLivenessGate: when on, the post-transfer closeout no longer
14092
+ // terminates the live local session on a stale/unverified ownership record —
14093
+ // it verifies the owning machine ACTUALLY has a live session for the topic via
14094
+ // a machine-local liveness snapshot before shedding the leftover. Ships dark
14095
+ // fleet-wide, LIVE on a dev agent via resolveDevAgentGate. When OFF the snapshot
14096
+ // is never built and the new deps are left absent (closeout byte-identical).
14097
+ // Spec: docs/specs/post-transfer-closeout-correctness.md.
14098
+ const _closeoutLivenessGate = resolveDevAgentGate(config.monitoring?.sessionReaper?.closeoutLivenessGate, config);
14099
+ let _closeoutSnapshot;
14100
+ // The combined ATOMIC owner read the gated closeout consumes — ONE registry
14101
+ // read returning the STABLE machineId (liveness key) AND the display label
14102
+ // (audit text), guaranteeing they describe the same owner from one instant.
14103
+ const _topicOwnerElsewhereInfo = (topicId) => {
14104
+ try {
14105
+ const reg = sessionOwnershipRegistry;
14106
+ const self = _meshSelfId;
14107
+ if (!reg || !self)
14108
+ return null;
14109
+ const machineId = reg.ownerOf(String(topicId));
14110
+ if (!machineId || machineId === self)
14111
+ return null;
14112
+ const displayName = machinePoolRegistry?.getCapacity(machineId)?.nickname ?? machineId;
14113
+ return { machineId, displayName };
14114
+ }
14115
+ catch {
14116
+ return null; /* @silent-fallback-ok — pool not wired yet → rule inert (withhold) */
14117
+ }
14118
+ };
14119
+ if (_closeoutLivenessGate) {
14120
+ const { CloseoutLivenessSnapshot } = await import('../monitoring/closeoutLivenessSnapshot.js');
14121
+ const _reaperTick = config.monitoring?.sessionReaper?.tickIntervalSec ?? 120;
14122
+ _closeoutSnapshot = new CloseoutLivenessSnapshot({
14123
+ resolvePeerUrls: () => _resolvePeerUrls?.() ?? [],
14124
+ // Reuse the proven per-peer GET /sessions fetch primitive (5s timeout,
14125
+ // same shape as the pool route's fan-out). Rejects on any failure so the
14126
+ // entry ages to stale → 'unknown' (fail-closed).
14127
+ fetchPeerSessions: async (peer) => {
14128
+ const r = await fetch(`${peer.url}/sessions`, {
14129
+ headers: { Authorization: `Bearer ${config.authToken}` },
14130
+ signal: AbortSignal.timeout(5000),
14131
+ });
14132
+ if (!r.ok)
14133
+ throw new Error(`HTTP ${r.status}`);
14134
+ return (await r.json());
14135
+ },
14136
+ // Owner set = distinct machineId of every owned-elsewhere topic that has
14137
+ // a live LOCAL leftover here (the exact set the closeout could act on).
14138
+ ownerSet: () => {
14139
+ const owners = new Set();
14140
+ try {
14141
+ for (const s of sessionManager.listRunningSessions()) {
14142
+ const t = _resolveTopic(s.tmuxSession);
14143
+ if (t == null)
14144
+ continue;
14145
+ const info = _topicOwnerElsewhereInfo(t);
14146
+ if (info)
14147
+ owners.add(info.machineId);
14148
+ }
14149
+ }
14150
+ catch { /* @silent-fallback-ok — degrade to whatever was already pending */ }
14151
+ return [...owners];
14152
+ },
14153
+ now: () => Date.now(),
14154
+ raiseAttention: (item) => {
14155
+ try {
14156
+ if (!telegram)
14157
+ return;
14158
+ void telegram.createAttentionItem({
14159
+ id: item.id, title: item.title, summary: item.summary, description: item.description,
14160
+ category: 'sessions', priority: 'NORMAL',
14161
+ sourceContext: 'session-reaper:closeout-snapshot-breaker',
14162
+ }).catch(() => { });
14163
+ }
14164
+ catch { /* @silent-fallback-ok — telegram not wired (TDZ) → audit-only */ }
14165
+ },
14166
+ audit: reaperAuditSink(config.stateDir),
14167
+ }, { tickIntervalSec: _reaperTick });
14168
+ // Level-triggered on the reaper cadence with ±10% jitter (anti-herd). Async
14169
+ // refresh; the closeout always reads the PREVIOUS snapshot, never a fetch it
14170
+ // triggers this tick. A thrown pass is swallowed (previous snapshot ages to
14171
+ // stale → 'unknown'); the loop is never wedged.
14172
+ const _jitter = 1 + (Math.random() * 0.2 - 0.1);
14173
+ const _snapshotTimer = setInterval(() => {
14174
+ void _closeoutSnapshot.refresh().catch(() => { });
14175
+ }, Math.round(_reaperTick * 1000 * _jitter));
14176
+ if (typeof _snapshotTimer.unref === 'function')
14177
+ _snapshotTimer.unref();
14178
+ console.log(pc.green(' SessionReaper closeoutLivenessGate ON (post-transfer closeout liveness-gated — live)'));
14179
+ }
14069
14180
  const sessionReaper = new SessionReaper({
14070
14181
  ...reapGuardDeps,
14071
14182
  dirtyCheck: _yieldSafetyDirtyCheck,
@@ -14112,6 +14223,8 @@ export async function startServer(options) {
14112
14223
  },
14113
14224
  terminate: (id, reason, opts) => sessionManager.terminateSession(id, reason, {
14114
14225
  bypassActiveProcessKeep: opts?.bypassActiveProcessKeep,
14226
+ bypassRecentUserMessageForConfirmedMove: opts?.bypassRecentUserMessageForConfirmedMove,
14227
+ workEvidence: opts?.workEvidence,
14115
14228
  }),
14116
14229
  markReaping: (id) => sessionManager.markReaping(id),
14117
14230
  clearReaping: (id) => sessionManager.clearReaping(id),
@@ -14140,6 +14253,28 @@ export async function startServer(options) {
14140
14253
  return null; /* @silent-fallback-ok — pool not wired yet → rule inert */
14141
14254
  }
14142
14255
  },
14256
+ // Post-transfer closeout correctness (F1): the ATOMIC combined owner read
14257
+ // the gated closeout uses (stable machineId + display label from ONE
14258
+ // registry read). Always constructed (a pure read helper); the closeout
14259
+ // only consults it on the gated path. Returns null when the pool is dark.
14260
+ topicOwnerElsewhereInfo: _topicOwnerElsewhereInfo,
14261
+ // Post-transfer closeout correctness (F1): the liveness verdict, read from
14262
+ // the machine-local snapshot (NOT a live per-tick fetch). Injected ONLY
14263
+ // when the gate resolved on (the snapshot exists); absent ⇒ gate inert.
14264
+ remoteOwnerHasLiveSession: _closeoutSnapshot?.remoteOwnerHasLiveSession,
14265
+ // Post-transfer closeout correctness (F1, Part E): the LOCAL-receipt ts of
14266
+ // the bound topic's newest user message — same history source the
14267
+ // recent-user-message KEEP-guard reads. Backs the freshest-interaction veto.
14268
+ recentUserMessageAt: (topicId) => {
14269
+ try {
14270
+ if (!telegram)
14271
+ return null;
14272
+ return recentUserMessageAtFromHistory(telegram.getTopicHistory(topicId, 50));
14273
+ }
14274
+ catch {
14275
+ return null; /* @silent-fallback-ok — no history → withhold the bypass (safe) */
14276
+ }
14277
+ },
14143
14278
  // WS1.3: pin-conflict do-not-act — a pin naming THIS machine while the
14144
14279
  // owner is elsewhere means the reconciler is bringing the topic back;
14145
14280
  // the closeout holds instead of attacking the session the pin wants here.
@@ -14189,6 +14324,11 @@ export async function startServer(options) {
14189
14324
  // Observe-only busy-orphan detection rides the same dev-gate (dark fleet,
14190
14325
  // live on dev agents). Zero risk — it never changes a keep/kill verdict.
14191
14326
  busyOrphanDetection: resolveDevAgentGate(rcfg.busyOrphanDetection, config),
14327
+ // Post-transfer closeout correctness (F1): the liveness gate rides the
14328
+ // SAME dev-gate (dark fleet, live on dev agents). Resolved once here so
14329
+ // the reaper's gated/legacy branch matches the snapshot construction
14330
+ // above (both read resolveDevAgentGate(...closeoutLivenessGate)).
14331
+ closeoutLivenessGate: _closeoutLivenessGate,
14192
14332
  };
14193
14333
  })());
14194
14334
  sessionReaper.start();
@@ -17495,7 +17635,7 @@ export async function startServer(options) {
17495
17635
  const server = new AgentServer({ config, sessionManager, state, scheduler, telegram, relationships, feedback, feedbackAnomalyDetector, dispatches, updateChecker, autoUpdater, autoDispatcher, quotaTracker, quotaManager, publisher, viewer, tunnel, evolution, watchdog, topicMemory, triageNurse, projectMapper, cartographer: cartographer ?? 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) {
17496
17636
  peers = (_listPoolMachines?.() ?? []).filter((m) => m.machineId !== _meshSelfId && !!m.lastKnownUrl).map((m) => ({ machineId: m.machineId, nickname: m.nickname ?? m.machineId, url: m.lastKnownUrl }));
17497
17637
  } if (peers.length === 0)
17498
- 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, 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, whatsappBusinessBackend, messageBridge, hookEventReceiver, worktreeMonitor, subagentTracker, instructionsVerifier, handshakeManager: threadlineHandshake, threadlineRouter, conversationStore, threadLog, threadMessageRecorder, warrantsReplyGate, collaborationSurfacer, threadResumeMap, topicLinkageHandler: topicLinkageHandler ?? undefined, threadlineRelayClient, threadlineReplyWaiters, listenerManager: listenerManager ?? undefined, a2aDeliveryTracker: a2aDeliveryTracker ?? undefined, responseReviewGate, messagingToneGate, outboundDedupGate, telemetryHeartbeat, pasteManager, featureRegistry, discoveryEvaluator, completionEvaluator, unifiedTrust, liveConfig, sharedStateLedger, ledgerSessionRegistry, worktreeManager, oidcEnrolledRepos: parallelDevConfig?.oidcEnrolledRepos, initiativeTracker, projectRoundRunner, projectDriftChecker, machineHeartbeat, machinePoolRegistry, getInboundQueue: () => _inboundQueue, meshRpcDispatcher, workingSetPullCoordinator, commitmentReplicaStore, preferenceReplicaStore, replicatedRecordEmitter, conflictStore, rollbackUnmerge, droppedOriginRegistry, preferencesUnionReader, forwardCommitmentMutate, sessionOwnershipRegistry, topicPinStore: _topicPinStore ?? 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, orphanedWorkSentinel, mcpProcessReaper, geminiLoopRunner, sleepController, agentActivityState, reapLog, resumeQueue, resumeDrainer, autonomousLivenessReconciler, prHandLease: prHandLease ?? undefined, operatorStopRecorder: recordOperatorStop, sleepWakeDetector, unjustifiedStopGate, stopGateDb, stopNotifier, liveTestGate, liveTestGateMode, liveTestRunnerCtx }); // Resolve the late-bound topic-operator getter (increment 2e): routing was
17638
+ 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, whatsappBusinessBackend, messageBridge, hookEventReceiver, worktreeMonitor, subagentTracker, instructionsVerifier, handshakeManager: threadlineHandshake, threadlineRouter, conversationStore, threadLog, threadMessageRecorder, warrantsReplyGate, collaborationSurfacer, threadResumeMap, topicLinkageHandler: topicLinkageHandler ?? undefined, threadlineRelayClient, threadlineReplyWaiters, listenerManager: listenerManager ?? undefined, a2aDeliveryTracker: a2aDeliveryTracker ?? undefined, responseReviewGate, messagingToneGate, outboundDedupGate, telemetryHeartbeat, pasteManager, featureRegistry, discoveryEvaluator, completionEvaluator, unifiedTrust, liveConfig, sharedStateLedger, ledgerSessionRegistry, worktreeManager, oidcEnrolledRepos: parallelDevConfig?.oidcEnrolledRepos, initiativeTracker, projectRoundRunner, projectDriftChecker, machineHeartbeat, machinePoolRegistry, getInboundQueue: () => _inboundQueue, meshRpcDispatcher, workingSetPullCoordinator, commitmentReplicaStore, preferenceReplicaStore, replicatedRecordEmitter, conflictStore, rollbackUnmerge, droppedOriginRegistry, preferencesUnionReader, forwardCommitmentMutate, sessionOwnershipRegistry, topicPinStore: _topicPinStore ?? 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, orphanedWorkSentinel, mcpProcessReaper, geminiLoopRunner, sleepController, agentActivityState, reapLog, resumeQueue, resumeDrainer, autonomousLivenessReconciler, prHandLease: prHandLease ?? undefined, operatorStopRecorder: recordOperatorStop, sleepWakeDetector, unjustifiedStopGate, stopGateDb, stopNotifier, liveTestGate, liveTestGateMode, liveTestRunnerCtx }); // Resolve the late-bound topic-operator getter (increment 2e): routing was
17499
17639
  // wired before the server existed; from here on inbound binds use the
17500
17640
  // server's own store instance.
17501
17641
  _agentServerRef = server;