instar 1.3.384 → 1.3.386

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/README.md CHANGED
@@ -136,6 +136,7 @@ An agent that forgets what you discussed yesterday, doesn't recognize someone it
136
136
  | **Multi-Machine** | Ed25519/X25519 crypto identity, encrypted sync, automatic failover | [→](https://instar.sh/features/multi-machine/) |
137
137
  | **Serendipity Protocol** | Sub-agents capture out-of-scope discoveries without breaking focus. HMAC-signed, secret-scanned | [→](https://instar.sh/features/serendipity/) |
138
138
  | **Threadline Protocol** | Agent-to-agent conversations with canonical identity, three-layer trust model, authorization policy, Ed25519 invitations, Sybil protection, MoltBridge network discovery, rich agent profiles (auto-compiled from agent data with human review gate), discovery waterfall, message security, tamper-proof audit logging, framework-agnostic interop, persistent listener daemon (always-on relay connection, pipe-mode sessions, sub-30s cross-machine failover), eleven MCP tools (seven core + four registry-conditional). 80 modules, roughly 3,800 test cases across 74 dedicated test files plus 125 cross-cutting | [→](https://instar.sh/features/threadline/) |
139
+ | **A2A Delivery Health** | Durable agent-to-agent delivery tracking (`threadline/A2ADeliveryTracker`) so a message between agents never silently dies out — a reply on the thread is the acknowledgement, and `GET /threadline/peers/health` answers "is my channel to this peer alive?" as a lookup, not a guess. Recording-only; never gates a send | [→](https://instar.sh/features/a2a-delivery-health/) |
139
140
  | **Self-Healing** | LLM-powered stall detection, session recovery, promise tracking | [→](https://instar.sh/features/self-healing/) |
140
141
  | **AutoUpdater** | Built-in update engine. Checks npm, auto-applies, self-restarts | [→](https://instar.sh/features/autoupdater/) |
141
142
  | **Build Pipeline** | `/build` skill with worktree isolation, 6-phase pipeline, quality gates, stop-hook enforcement | |
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAaH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAQ3D,OAAO,EAAE,e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line?.relayEnabled
8058
8058
  ? new ListenerSessionManager(config.stateDir, config.authToken ?? '', config.threadline)
8059
8059
  : null;
8060
+ // A2A Delivery Tracker — durable per-peer delivery lifecycle + peer-health
8061
+ // ("communications never just die out", A2A-DURABLE-DELIVERY-SPEC.md / #939).
8062
+ // Recording-only: it never gates a send. Always constructed (cheap SQLite,
8063
+ // self-initializing schema) so the peer-health routes answer even when the
8064
+ // relay is off.
8065
+ let a2aDeliveryTracker = null;
8066
+ try {
8067
+ const { A2ADeliveryTracker } = await import('../threadline/A2ADeliveryTracker.js');
8068
+ a2aDeliveryTracker = A2ADeliveryTracker.open(config.projectName, config.stateDir);
8069
+ }
8070
+ catch (err) {
8071
+ // @silent-fallback-ok: cascade-isolation — a tracker open failure must never block
8072
+ // server boot; the peer-health routes 503 cleanly and delivery is unaffected. Logged.
8073
+ console.warn(pc.yellow(` A2A delivery tracker: unavailable — ${err instanceof Error ? err.message : String(err)}`));
8074
+ }
8060
8075
  // Wake Socket Server — receives signals from the standalone listener daemon (Phase 1)
8061
8076
  let wakeSocketServer;
8062
8077
  try {
@@ -8375,6 +8390,25 @@ export async function startServer(options) {
8375
8390
  console.warn(`[relay] Canonical inbox append failed (non-fatal): ${err instanceof Error ? err.message : err}`);
8376
8391
  }
8377
8392
  }
8393
+ // Durable A2A delivery (A2A-DURABLE-DELIVERY-SPEC.md): this is the
8394
+ // relay-ingest accept point for CROSS-MACHINE peers (the primary
8395
+ // Echo↔Dawn case) — here `senderFingerprint` is the peer's real
8396
+ // routing fingerprint, so liveness keys correctly and the implicit
8397
+ // ack (a reply on the thread = processed-ack of our prior send) fires.
8398
+ // Same-machine local delivery is recorded separately in the
8399
+ // /messages/relay-agent route. Recording-only — never gates routing.
8400
+ if (a2aDeliveryTracker) {
8401
+ try {
8402
+ a2aDeliveryTracker.recordInboundFrom(senderFingerprint, senderName ?? null);
8403
+ if (msg.threadId)
8404
+ a2aDeliveryTracker.recordAckByThread(msg.threadId);
8405
+ }
8406
+ catch (err) {
8407
+ // @silent-fallback-ok: recording-only — A2A delivery/liveness tracking must
8408
+ // never break inbound routing (the message was already accepted above). Logged.
8409
+ console.warn(`[relay] A2A inbound record failed (non-fatal): ${err instanceof Error ? err.message : err}`);
8410
+ }
8411
+ }
8378
8412
  // Threadline → Telegram bridge: mirror inbound message into a per-thread
8379
8413
  // Telegram topic so the user has visibility into agent-to-agent
8380
8414
  // conversations. Relay-only — TelegramBridgeConfig owns the gate
@@ -10707,11 +10741,17 @@ export async function startServer(options) {
10707
10741
  // parsed AWAY here — served by the peer, dropped by this
10708
10742
  // narrowing return — so driveCommitmentsSync never fired and
10709
10743
  // zero replicas ever landed. Pass it through.
10744
+ // A2 (live, v1.3.384): the SAME narrowing also dropped the
10745
+ // peer's quotaState (its getCapacity(self) includes it), so the
10746
+ // router only ever saw its OWN quota and quota-aware placement
10747
+ // (#804) could never avoid a rate-limited PEER — the original
10748
+ // EXO failure. Pass it through too. Absent = not blocked.
10710
10749
  return {
10711
10750
  selfReportedLastSeen: cap.selfReportedLastSeen,
10712
10751
  loadAvg: cap.loadAvg,
10713
10752
  journalAdvert,
10714
10753
  ...(cap.commitmentsAdvert ? { commitmentsAdvert: cap.commitmentsAdvert } : {}),
10754
+ ...(cap.quotaState ? { quotaState: cap.quotaState } : {}),
10715
10755
  };
10716
10756
  }
10717
10757
  return null;
@@ -10991,7 +11031,7 @@ export async function startServer(options) {
10991
11031
  catch (err) {
10992
11032
  console.log(pc.dim(` [session-pool] rollout gate not wired: ${err instanceof Error ? err.message : String(err)}`));
10993
11033
  }
10994
- 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, coherenceGate: scopeVerifier, contextHierarchy, canonicalState, operationGate, sentinel, adaptiveTrust, memoryMonitor, orphanReaper, coherenceMonitor, commitmentTracker, semanticMemory, activitySentinel, rateLimitSentinel, releaseReadinessSentinel: releaseReadinessSentinel ?? undefined, messageRouter, summarySentinel, spawnManager, systemReviewer, capabilityMapper, selfKnowledgeTree, coverageAuditor, topicResumeMap: _topicResumeMap ?? undefined, sessionRefresh: _sessionRefresh ?? undefined, autonomyManager, trustElevationTracker, autonomousEvolution, coordinator: coordinator.enabled ? coordinator : undefined, 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, warrantsReplyGate, collaborationSurfacer, threadResumeMap, topicLinkageHandler: topicLinkageHandler ?? undefined, threadlineRelayClient, threadlineReplyWaiters, listenerManager: listenerManager ?? undefined, responseReviewGate, messagingToneGate, outboundDedupGate, telemetryHeartbeat, pasteManager, featureRegistry, discoveryEvaluator, completionEvaluator, unifiedTrust, liveConfig, sharedStateLedger, ledgerSessionRegistry, worktreeManager, oidcEnrolledRepos: parallelDevConfig?.oidcEnrolledRepos, initiativeTracker, projectRoundRunner, projectDriftChecker, machineHeartbeat, machinePoolRegistry, meshRpcDispatcher, workingSetPullCoordinator, commitmentReplicaStore, forwardCommitmentMutate, sessionOwnershipRegistry, topicPinStore: _topicPinStore ?? undefined, secretSync: _secretSyncHandle ?? undefined, meshSelfId: _meshSelfId ?? undefined, resolveRouterUrl: _resolveRouterUrl ?? undefined, resolvePeerUrls: _resolvePeerUrls ?? undefined, sessionPoolE2EResultStore, proxyCoordinator, topicIntentStore, topicIntentArcCheck, usherSignalStore, intelligence: sharedIntelligence ?? undefined, telegramBridgeConfig, telegramBridge: telegramBridge ?? undefined, threadlineObservability, briefDeps, workingMemory, taskFlowRegistry, threadlineFlowBridge, sessionReaper, agentWorktreeReaper, mcpProcessReaper, geminiLoopRunner, sleepController, agentActivityState, reapLog, sleepWakeDetector, unjustifiedStopGate, stopGateDb, stopNotifier });
11034
+ 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, coherenceGate: scopeVerifier, contextHierarchy, canonicalState, operationGate, sentinel, adaptiveTrust, memoryMonitor, orphanReaper, coherenceMonitor, commitmentTracker, semanticMemory, activitySentinel, rateLimitSentinel, releaseReadinessSentinel: releaseReadinessSentinel ?? undefined, messageRouter, summarySentinel, spawnManager, systemReviewer, capabilityMapper, selfKnowledgeTree, coverageAuditor, topicResumeMap: _topicResumeMap ?? undefined, sessionRefresh: _sessionRefresh ?? undefined, autonomyManager, trustElevationTracker, autonomousEvolution, coordinator: coordinator.enabled ? coordinator : undefined, 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, 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, meshRpcDispatcher, workingSetPullCoordinator, commitmentReplicaStore, forwardCommitmentMutate, sessionOwnershipRegistry, topicPinStore: _topicPinStore ?? undefined, secretSync: _secretSyncHandle ?? undefined, meshSelfId: _meshSelfId ?? undefined, resolveRouterUrl: _resolveRouterUrl ?? undefined, resolvePeerUrls: _resolvePeerUrls ?? undefined, sessionPoolE2EResultStore, proxyCoordinator, topicIntentStore, topicIntentArcCheck, usherSignalStore, intelligence: sharedIntelligence ?? undefined, telegramBridgeConfig, telegramBridge: telegramBridge ?? undefined, threadlineObservability, briefDeps, workingMemory, taskFlowRegistry, threadlineFlowBridge, sessionReaper, agentWorktreeReaper, mcpProcessReaper, geminiLoopRunner, sleepController, agentActivityState, reapLog, sleepWakeDetector, unjustifiedStopGate, stopGateDb, stopNotifier });
10995
11035
  // Resolve the late-bound topic-operator getter (increment 2e): routing was
10996
11036
  // wired before the server existed; from here on inbound binds use the
10997
11037
  // server's own store instance.