@adhdev/daemon-standalone 0.9.77-rc.46 → 0.9.77-rc.48

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-standalone",
3
- "version": "0.9.77-rc.46",
3
+ "version": "0.9.77-rc.48",
4
4
  "description": "ADHDev standalone daemon — embedded HTTP/WS server for local dashboard",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -26198,6 +26198,15 @@ function getMeshQueueStats(meshId) {
26198
26198
  completed,
26199
26199
  failed,
26200
26200
  cancelled,
26201
+ activeCounts: {
26202
+ pending,
26203
+ assigned
26204
+ },
26205
+ historicalCounts: {
26206
+ completed,
26207
+ failed,
26208
+ cancelled
26209
+ },
26201
26210
  activeAssignments: queue.filter((q) => q.status === "assigned").map((q) => ({
26202
26211
  id: q.id,
26203
26212
  nodeId: q.assignedNodeId,
@@ -29169,26 +29178,8 @@ async function syncMeshes(transport) {
29169
29178
  }
29170
29179
  }
29171
29180
  }
29172
- if (transport.syncMeshLedger) {
29173
- for (const local of localMeshes) {
29174
- try {
29175
- await syncMeshLedger(local.id, transport);
29176
- } catch (e) {
29177
- result.errors.push(`Ledger sync failed for "${local.name}": ${e.message}`);
29178
- }
29179
- }
29180
- }
29181
29181
  return result;
29182
29182
  }
29183
- async function syncMeshLedger(meshId, transport) {
29184
- if (!transport.syncMeshLedger) return;
29185
- const { readLedgerEntries: readLedgerEntries2, appendRemoteLedgerEntries: appendRemoteLedgerEntries2 } = await Promise.resolve().then(() => (init_mesh_ledger(), mesh_ledger_exports));
29186
- const localEntries = readLedgerEntries2(meshId);
29187
- const res = await transport.syncMeshLedger(meshId, { newEntries: localEntries });
29188
- if (res.missingEntries && res.missingEntries.length > 0) {
29189
- appendRemoteLedgerEntries2(meshId, res.missingEntries);
29190
- }
29191
- }
29192
29183
  function messageFromError(error48) {
29193
29184
  if (error48 instanceof Error) return error48.message;
29194
29185
  if (typeof error48 === "string") return error48;
@@ -41693,7 +41684,7 @@ async function shutdownDaemonComponents(components) {
41693
41684
  }
41694
41685
  cdpManagers.clear();
41695
41686
  }
41696
- var path4, import_promises4, import_fs3, import_child_process, import_util3, import_os2, import_path, import_fs4, import_crypto2, import_fs5, import_path2, import_crypto3, import_fs6, import_path3, import_crypto4, import_events2, import_fs7, import_path4, import_crypto5, import_child_process2, os22, path8, import_fs8, fs2, path9, os32, os8, os9, path14, import_child_process3, os10, path15, os11, import_child_process4, import_fs9, import_promises5, path, import_util4, import_promises6, path22, path32, fs, os4, path5, import_crypto6, path6, path7, import_fs10, import_path5, import_child_process5, import_fs11, import_os3, path10, os42, import_child_process6, http, crypto2, fs3, path11, os5, fs4, os6, path12, import_crypto7, fs5, path13, os7, os13, path18, crypto4, import_fs12, import_child_process7, os12, path16, crypto3, fs6, import_module, path17, import_stream2, import_child_process8, import_child_process9, net2, os15, path20, fs7, path19, os14, fs8, path21, os16, import_child_process10, import_crypto8, import_fs13, import_module2, os17, import_path6, os18, import_child_process11, import_child_process12, fs9, os19, path222, import_os4, import_path7, fs10, fs11, path23, os20, import_child_process13, import_os5, http2, fs15, path27, fs12, path24, fs13, path25, fs14, path26, os21, import_child_process14, __defProp2, __getOwnPropDesc2, __getOwnPropNames2, __hasOwnProp2, __require2, __esm2, __export2, __copyProps2, __toCommonJS2, DEFAULT_MESH_POLICY, init_repo_mesh_types, git_worktree_exports, execFileAsync2, WORKTREE_DIR_NAME, GIT_TIMEOUT_MS, GIT_MAX_BUFFER, SUBMODULE_WORKTREE_REMOVE_RE, init_git_worktree, config_exports, DEFAULT_CONFIG, MACHINE_ID_PREFIX, init_config, mesh_config_exports, SESSION_CLEANUP_MODES, SPAWNED_SESSION_VISIBILITY_MODES, init_mesh_config, coordinator_prompt_exports, TOOLS_SECTION, TOOL_EXPOSURE_PREFLIGHT_SECTION, WORKFLOW_SECTION, init_coordinator_prompt, mesh_ledger_exports, LEDGER_DIR_NAME, MAX_FILE_SIZE_BYTES, RECENT_FAILURE_WINDOW_MS, meshLedgerEvents, init_mesh_ledger, mesh_work_queue_exports, init_mesh_work_queue, init_cli_detector, LEVEL_NUM, LEVEL_LABEL, currentLevel, LOG_DIR, MAX_LOG_SIZE, MAX_LOG_DAYS, currentDate, currentLogFile, writeCount, RING_BUFFER_SIZE, ringBuffer, origConsoleLog, origConsoleError, origConsoleWarn, LOG, interceptorInstalled, LOG_PATH, init_logger, mesh_events_exports, remoteIdleSessions, MAX_PENDING_EVENTS, pendingMeshCoordinatorEvents, MESH_COORDINATOR_EVENTS, EVENT_TO_LEDGER_KIND, autoLaunchInProgress, autoLaunchCooldownUntil, AUTO_LAUNCH_COOLDOWN_MS, init_mesh_events, NORMAL_TRACE_BUFFER_SIZE, DEV_TRACE_BUFFER_SIZE, DEFAULT_CONFIG2, currentConfig, init_debug_config, DEFAULT_BINDING_CANDIDATES, cachedBinding, cachedBindingError, GhosttyVtTerminalBackend, init_ghostty_vt_backend, TerminalCtor, XtermTerminalBackend, init_xterm_backend, DEFAULT_SCROLLBACK, loggedTerminalBackends, TerminalScreen, init_terminal_screen, init_spawn_env, cachedPty, NodePtyRuntimeTransport, NodePtyTransportFactory, init_pty_transport, TerminalTranscriptAccumulator, buildCliSpawnEnv, init_provider_cli_shared, init_provider_cli_parse, init_provider_cli_config, init_provider_cli_runtime, provider_cli_adapter_exports, ProviderCliAdapter, init_provider_cli_adapter, execFileAsync, DEFAULT_TIMEOUT_MS, DEFAULT_MAX_BUFFER, GitCommandError, DEFAULT_MAX_FILES, DEFAULT_MAX_BYTES, summarizeGitStatus, InMemoryGitSnapshotStore, DEFAULT_GIT_WORKSPACE_POLL_INTERVAL_MS, MIN_GIT_WORKSPACE_POLL_INTERVAL_MS, GitWorkspaceMonitor, GIT_COMMAND_NAMES, SNAPSHOT_REASONS, FAILURE_REASONS, defaultSnapshotStore, defaultGitCommandServices, BUSY_STATUSES, TERMINAL_STATUSES, TurnSnapshotTracker, MAX_WORKSPACES, MAX_ACTIVITY, MAX_SAVED_SESSIONS, NO_FALLBACK_REASON, P2P_NEXT_ACTION, NON_P2P_NEXT_ACTION, P2pRelayFailureError, DEFAULT_STATE, BUILTIN_IDE_DEFINITIONS, registeredIDEs, LIVE_LIFECYCLES, DEFAULT_ACTIVE_CHAT_POLL_STATUSES, DEFAULT_CHAT_TAIL_RECENT_MESSAGE_GRACE_MS, LIVE_RUNTIME_LIFECYCLES, DaemonCdpManager, CdpDomHandlers, DEFAULT_MONITOR_CONFIG, StatusMonitor, BUILTIN_CHAT_MESSAGE_KINDS, CHAT_MESSAGE_VISIBILITIES, CHAT_MESSAGE_TRANSCRIPT_VISIBILITIES, CHAT_MESSAGE_AUDIENCES, CHAT_MESSAGE_SOURCES, CHAT_MESSAGE_ACTIVITY_SOURCES, CHAT_MESSAGE_INTERNAL_SOURCES, KNOWN_CHAT_MESSAGE_KINDS, CHAT_MESSAGE_KIND_ALIASES, EXPLICIT_HIDDEN_VISIBILITIES, EXPLICIT_VISIBLE_VISIBILITIES, HIDDEN_AUDIENCES, ACTIVITY_SOURCE_SET, INTERNAL_SOURCE_SET, HISTORY_DIR, RETAIN_DAYS, SAVED_HISTORY_INDEX_VERSION, SAVED_HISTORY_INDEX_FILE, SAVED_HISTORY_INDEX_LOCK_SUFFIX, SAVED_HISTORY_INDEX_LOCK_WAIT_MS, SAVED_HISTORY_INDEX_LOCK_STALE_MS, SAVED_HISTORY_INDEX_LOCK_POLL_MS, SAVED_HISTORY_ROLLUP_THRESHOLD_BYTES, savedHistorySessionCache, savedHistoryFileSummaryCache, savedHistoryBackgroundRefresh, savedHistoryRollupInFlight, ChatHistoryWriter, IDE_PROVIDER_SESSION_CAPABILITIES_BASE, EXTENSION_PROVIDER_SESSION_CAPABILITIES_BASE, ExtensionProviderInstance, VALID_STATUSES, VALID_ROLES, VALID_BUBBLE_STATES, VALID_TURN_STATUSES, DEFAULT_APPROVAL_POSITIVE_HINTS, IdeProviderInstance, DEFAULT_CDP_SCAN_INTERVAL_MS, DEFAULT_CDP_DISCOVERY_INTERVAL_MS, DEFAULT_STATUS_INITIAL_REPORT_DELAY_MS, DEFAULT_STATUS_SERVER_REPORT_INTERVAL_MS, DEFAULT_STATUS_P2P_REPORT_INTERVAL_MS, MIN_MACHINE_RUNTIME_SUBSCRIPTION_INTERVAL_MS, DEFAULT_MACHINE_RUNTIME_SUBSCRIPTION_INTERVAL_MS, MIN_SESSION_HOST_DIAGNOSTICS_SUBSCRIPTION_INTERVAL_MS, DEFAULT_SESSION_HOST_DIAGNOSTICS_SUBSCRIPTION_INTERVAL_MS, DEFAULT_SESSION_HOST_READY_TIMEOUT_MS, STANDALONE_CDP_SCAN_INTERVAL_MS, DaemonCdpScanner, DaemonCdpInitializer, WORKING_STATUSES, FULL_STATUS_ACTIVE_CHAT_OPTIONS, LIVE_STATUS_ACTIVE_CHAT_OPTIONS, STATUS_MODAL_MESSAGE_LIMIT, STATUS_MODAL_BUTTON_LIMIT, VALID_INPUT_MEDIA_TYPES, VALID_INPUT_STRATEGIES, TEXT_ONLY_MESSAGE_INPUT_SUPPORT, IDE_SESSION_CAPABILITIES, EXTENSION_SESSION_CAPABILITIES, PTY_SESSION_CAPABILITIES, CLI_CHAT_SESSION_CAPABILITIES, ACP_SESSION_CAPABILITIES, globalStore, RECENT_SEND_WINDOW_MS, READ_CHAT_PROVIDER_EVAL_TIMEOUT_MS, HERMES_CLI_STARTING_SEND_SETTLE_MS, recentSendByTarget, DEFAULT_DEBUG_SANITIZE_OPTIONS, SECRET_KEY_PATTERN, KEY_TO_VK, COMMAND_DEBUG_LEVELS, DaemonCommandHandler, COMPLETED_FINALIZATION_RETRY_MS, COMPLETED_FINALIZATION_MAX_WAIT_MS, IMAGE_MIME_EXTENSIONS, MATERIALIZED_IMAGE_MAX_AGE_MS, MATERIALIZED_IMAGE_CLEANUP_INTERVAL_MS, lastMaterializedImageCleanupAt, CachedDatabaseSync, CliProviderInstance, AcpProviderInstance, chalkModule, chalkApi, COORDINATOR_DELEGATED_ENV_UNSETS, DaemonCliManager, VALID_CAPABILITY_MEDIA_TYPES, VALID_INPUT_STRATEGIES2, KNOWN_PROVIDER_FIELDS, VALUE_CONTROL_TYPES, ProviderLoader, _providerLoader, LOG_DIR2, MAX_FILE_SIZE, MAX_DAYS, SENSITIVE_KEYS, currentDate2, currentFile, writeCount2, SKIP_COMMANDS, DEFAULT_SERVER_NAME, DEFAULT_ADHDEV_MCP_COMMAND, HERMES_CLI_TYPE, HERMES_MCP_CONFIG_PATH, READ_DEBUG_ENABLED, recentReadDebugSignatureBySession, UPGRADE_HELPER_ENV, CHANNEL_NPM_TAG, CHANNEL_SERVER_URL, REFINE_VALIDATION_CATEGORIES, REFINE_VALIDATION_TIMEOUT_MS, REFINE_VALIDATION_OUTPUT_LIMIT_BYTES, REFINE_VALIDATION_SUMMARY_CHARS, REFINE_VALIDATION_MAX_COMMANDS, CHAT_COMMANDS, READ_DEBUG_ENABLED2, DaemonCommandRouter, DaemonStatusReporter, DEFAULT_DAEMON_PORT, DAEMON_WS_PATH, ProviderStreamAdapter, DaemonAgentStreamManager, AgentStreamPoller, ProviderInstanceManager, ARCHIVE_PATH, MAX_ENTRIES_PER_PROVIDER, VersionArchive, DEV_SERVER_PORT, DevServer, SessionHostRuntimeTransport, SessionHostPtyTransportFactory, DEFAULT_SESSION_HOST_APP_NAME, DEFAULT_STANDALONE_SESSION_HOST_APP_NAME, STARTUP_TIMEOUT_MS, STARTUP_POLL_MS, SessionHostCompatibilityError, EXTENSION_CATALOG, SessionRegistry;
41687
+ var path4, import_promises4, import_fs3, import_child_process, import_util3, import_os2, import_path, import_fs4, import_crypto2, import_fs5, import_path2, import_crypto3, import_fs6, import_path3, import_crypto4, import_events2, import_fs7, import_path4, import_crypto5, import_child_process2, os22, path8, import_fs8, fs2, path9, os32, os8, os9, path14, import_child_process3, os10, path15, os11, import_child_process4, import_fs9, import_promises5, path, import_util4, import_promises6, path22, path32, fs, os4, path5, import_crypto6, path6, path7, import_fs10, import_path5, import_child_process5, import_fs11, import_os3, path10, os42, import_child_process6, http, crypto2, fs3, path11, os5, fs4, os6, path12, import_crypto7, fs5, path13, os7, os13, path18, crypto4, import_fs12, import_child_process7, os12, path16, crypto3, fs6, import_module, path17, import_stream2, import_child_process8, import_child_process9, net2, os15, path20, fs7, path19, os14, fs8, path21, os16, import_child_process10, import_crypto8, import_fs13, import_module2, os17, import_path6, os18, import_child_process11, import_child_process12, fs9, os19, path222, import_os4, import_path7, fs10, fs11, path23, os20, import_child_process13, import_os5, http2, fs15, path27, fs12, path24, fs13, path25, fs14, path26, os21, import_child_process14, __defProp2, __getOwnPropDesc2, __getOwnPropNames2, __hasOwnProp2, __require2, __esm2, __export2, __copyProps2, __toCommonJS2, DEFAULT_MESH_POLICY, init_repo_mesh_types, git_worktree_exports, execFileAsync2, WORKTREE_DIR_NAME, GIT_TIMEOUT_MS, GIT_MAX_BUFFER, SUBMODULE_WORKTREE_REMOVE_RE, init_git_worktree, config_exports, DEFAULT_CONFIG, MACHINE_ID_PREFIX, init_config, mesh_config_exports, SESSION_CLEANUP_MODES, SPAWNED_SESSION_VISIBILITY_MODES, init_mesh_config, coordinator_prompt_exports, TOOLS_SECTION, TOOL_EXPOSURE_PREFLIGHT_SECTION, WORKFLOW_SECTION, init_coordinator_prompt, mesh_ledger_exports, LEDGER_DIR_NAME, MAX_FILE_SIZE_BYTES, RECENT_FAILURE_WINDOW_MS, meshLedgerEvents, init_mesh_ledger, mesh_work_queue_exports, ACTIVE_MESH_QUEUE_STATUSES, HISTORICAL_MESH_QUEUE_STATUSES, init_mesh_work_queue, init_cli_detector, LEVEL_NUM, LEVEL_LABEL, currentLevel, LOG_DIR, MAX_LOG_SIZE, MAX_LOG_DAYS, currentDate, currentLogFile, writeCount, RING_BUFFER_SIZE, ringBuffer, origConsoleLog, origConsoleError, origConsoleWarn, LOG, interceptorInstalled, LOG_PATH, init_logger, mesh_events_exports, remoteIdleSessions, MAX_PENDING_EVENTS, pendingMeshCoordinatorEvents, MESH_COORDINATOR_EVENTS, EVENT_TO_LEDGER_KIND, autoLaunchInProgress, autoLaunchCooldownUntil, AUTO_LAUNCH_COOLDOWN_MS, init_mesh_events, NORMAL_TRACE_BUFFER_SIZE, DEV_TRACE_BUFFER_SIZE, DEFAULT_CONFIG2, currentConfig, init_debug_config, DEFAULT_BINDING_CANDIDATES, cachedBinding, cachedBindingError, GhosttyVtTerminalBackend, init_ghostty_vt_backend, TerminalCtor, XtermTerminalBackend, init_xterm_backend, DEFAULT_SCROLLBACK, loggedTerminalBackends, TerminalScreen, init_terminal_screen, init_spawn_env, cachedPty, NodePtyRuntimeTransport, NodePtyTransportFactory, init_pty_transport, TerminalTranscriptAccumulator, buildCliSpawnEnv, init_provider_cli_shared, init_provider_cli_parse, init_provider_cli_config, init_provider_cli_runtime, provider_cli_adapter_exports, ProviderCliAdapter, init_provider_cli_adapter, execFileAsync, DEFAULT_TIMEOUT_MS, DEFAULT_MAX_BUFFER, GitCommandError, DEFAULT_MAX_FILES, DEFAULT_MAX_BYTES, summarizeGitStatus, InMemoryGitSnapshotStore, DEFAULT_GIT_WORKSPACE_POLL_INTERVAL_MS, MIN_GIT_WORKSPACE_POLL_INTERVAL_MS, GitWorkspaceMonitor, GIT_COMMAND_NAMES, SNAPSHOT_REASONS, FAILURE_REASONS, defaultSnapshotStore, defaultGitCommandServices, BUSY_STATUSES, TERMINAL_STATUSES, TurnSnapshotTracker, MAX_WORKSPACES, MAX_ACTIVITY, MAX_SAVED_SESSIONS, NO_FALLBACK_REASON, P2P_NEXT_ACTION, NON_P2P_NEXT_ACTION, P2pRelayFailureError, DEFAULT_STATE, BUILTIN_IDE_DEFINITIONS, registeredIDEs, LIVE_LIFECYCLES, DEFAULT_ACTIVE_CHAT_POLL_STATUSES, DEFAULT_CHAT_TAIL_RECENT_MESSAGE_GRACE_MS, LIVE_RUNTIME_LIFECYCLES, DaemonCdpManager, CdpDomHandlers, DEFAULT_MONITOR_CONFIG, StatusMonitor, BUILTIN_CHAT_MESSAGE_KINDS, CHAT_MESSAGE_VISIBILITIES, CHAT_MESSAGE_TRANSCRIPT_VISIBILITIES, CHAT_MESSAGE_AUDIENCES, CHAT_MESSAGE_SOURCES, CHAT_MESSAGE_ACTIVITY_SOURCES, CHAT_MESSAGE_INTERNAL_SOURCES, KNOWN_CHAT_MESSAGE_KINDS, CHAT_MESSAGE_KIND_ALIASES, EXPLICIT_HIDDEN_VISIBILITIES, EXPLICIT_VISIBLE_VISIBILITIES, HIDDEN_AUDIENCES, ACTIVITY_SOURCE_SET, INTERNAL_SOURCE_SET, HISTORY_DIR, RETAIN_DAYS, SAVED_HISTORY_INDEX_VERSION, SAVED_HISTORY_INDEX_FILE, SAVED_HISTORY_INDEX_LOCK_SUFFIX, SAVED_HISTORY_INDEX_LOCK_WAIT_MS, SAVED_HISTORY_INDEX_LOCK_STALE_MS, SAVED_HISTORY_INDEX_LOCK_POLL_MS, SAVED_HISTORY_ROLLUP_THRESHOLD_BYTES, savedHistorySessionCache, savedHistoryFileSummaryCache, savedHistoryBackgroundRefresh, savedHistoryRollupInFlight, ChatHistoryWriter, IDE_PROVIDER_SESSION_CAPABILITIES_BASE, EXTENSION_PROVIDER_SESSION_CAPABILITIES_BASE, ExtensionProviderInstance, VALID_STATUSES, VALID_ROLES, VALID_BUBBLE_STATES, VALID_TURN_STATUSES, DEFAULT_APPROVAL_POSITIVE_HINTS, IdeProviderInstance, DEFAULT_CDP_SCAN_INTERVAL_MS, DEFAULT_CDP_DISCOVERY_INTERVAL_MS, DEFAULT_STATUS_INITIAL_REPORT_DELAY_MS, DEFAULT_STATUS_SERVER_REPORT_INTERVAL_MS, DEFAULT_STATUS_P2P_REPORT_INTERVAL_MS, MIN_MACHINE_RUNTIME_SUBSCRIPTION_INTERVAL_MS, DEFAULT_MACHINE_RUNTIME_SUBSCRIPTION_INTERVAL_MS, MIN_SESSION_HOST_DIAGNOSTICS_SUBSCRIPTION_INTERVAL_MS, DEFAULT_SESSION_HOST_DIAGNOSTICS_SUBSCRIPTION_INTERVAL_MS, DEFAULT_SESSION_HOST_READY_TIMEOUT_MS, STANDALONE_CDP_SCAN_INTERVAL_MS, DaemonCdpScanner, DaemonCdpInitializer, WORKING_STATUSES, FULL_STATUS_ACTIVE_CHAT_OPTIONS, LIVE_STATUS_ACTIVE_CHAT_OPTIONS, STATUS_MODAL_MESSAGE_LIMIT, STATUS_MODAL_BUTTON_LIMIT, VALID_INPUT_MEDIA_TYPES, VALID_INPUT_STRATEGIES, TEXT_ONLY_MESSAGE_INPUT_SUPPORT, IDE_SESSION_CAPABILITIES, EXTENSION_SESSION_CAPABILITIES, PTY_SESSION_CAPABILITIES, CLI_CHAT_SESSION_CAPABILITIES, ACP_SESSION_CAPABILITIES, globalStore, RECENT_SEND_WINDOW_MS, READ_CHAT_PROVIDER_EVAL_TIMEOUT_MS, HERMES_CLI_STARTING_SEND_SETTLE_MS, recentSendByTarget, DEFAULT_DEBUG_SANITIZE_OPTIONS, SECRET_KEY_PATTERN, KEY_TO_VK, COMMAND_DEBUG_LEVELS, DaemonCommandHandler, COMPLETED_FINALIZATION_RETRY_MS, COMPLETED_FINALIZATION_MAX_WAIT_MS, IMAGE_MIME_EXTENSIONS, MATERIALIZED_IMAGE_MAX_AGE_MS, MATERIALIZED_IMAGE_CLEANUP_INTERVAL_MS, lastMaterializedImageCleanupAt, CachedDatabaseSync, CliProviderInstance, AcpProviderInstance, chalkModule, chalkApi, COORDINATOR_DELEGATED_ENV_UNSETS, DaemonCliManager, VALID_CAPABILITY_MEDIA_TYPES, VALID_INPUT_STRATEGIES2, KNOWN_PROVIDER_FIELDS, VALUE_CONTROL_TYPES, ProviderLoader, _providerLoader, LOG_DIR2, MAX_FILE_SIZE, MAX_DAYS, SENSITIVE_KEYS, currentDate2, currentFile, writeCount2, SKIP_COMMANDS, DEFAULT_SERVER_NAME, DEFAULT_ADHDEV_MCP_COMMAND, HERMES_CLI_TYPE, HERMES_MCP_CONFIG_PATH, READ_DEBUG_ENABLED, recentReadDebugSignatureBySession, UPGRADE_HELPER_ENV, CHANNEL_NPM_TAG, CHANNEL_SERVER_URL, REFINE_VALIDATION_CATEGORIES, REFINE_VALIDATION_TIMEOUT_MS, REFINE_VALIDATION_OUTPUT_LIMIT_BYTES, REFINE_VALIDATION_SUMMARY_CHARS, REFINE_VALIDATION_MAX_COMMANDS, CHAT_COMMANDS, READ_DEBUG_ENABLED2, DaemonCommandRouter, DaemonStatusReporter, DEFAULT_DAEMON_PORT, DAEMON_WS_PATH, ProviderStreamAdapter, DaemonAgentStreamManager, AgentStreamPoller, ProviderInstanceManager, ARCHIVE_PATH, MAX_ENTRIES_PER_PROVIDER, VersionArchive, DEV_SERVER_PORT, DevServer, SessionHostRuntimeTransport, SessionHostPtyTransportFactory, DEFAULT_SESSION_HOST_APP_NAME, DEFAULT_STANDALONE_SESSION_HOST_APP_NAME, STARTUP_TIMEOUT_MS, STARTUP_POLL_MS, SessionHostCompatibilityError, EXTENSION_CATALOG, SessionRegistry;
41697
41688
  var init_dist2 = __esm({
41698
41689
  "../daemon-core/dist/index.mjs"() {
41699
41690
  "use strict";
@@ -42038,6 +42029,8 @@ Follow these recovery rules:
42038
42029
  });
42039
42030
  mesh_work_queue_exports = {};
42040
42031
  __export2(mesh_work_queue_exports, {
42032
+ ACTIVE_MESH_QUEUE_STATUSES: () => ACTIVE_MESH_QUEUE_STATUSES,
42033
+ HISTORICAL_MESH_QUEUE_STATUSES: () => HISTORICAL_MESH_QUEUE_STATUSES,
42041
42034
  cancelTask: () => cancelTask,
42042
42035
  claimNextTask: () => claimNextTask,
42043
42036
  enqueueTask: () => enqueueTask,
@@ -42052,6 +42045,8 @@ Follow these recovery rules:
42052
42045
  "src/mesh/mesh-work-queue.ts"() {
42053
42046
  "use strict";
42054
42047
  init_mesh_ledger();
42048
+ ACTIVE_MESH_QUEUE_STATUSES = ["pending", "assigned"];
42049
+ HISTORICAL_MESH_QUEUE_STATUSES = ["completed", "failed", "cancelled"];
42055
42050
  }
42056
42051
  });
42057
42052
  init_cli_detector = __esm2({
@@ -54134,10 +54129,21 @@ Run 'adhdev doctor' for detailed diagnostics.`
54134
54129
  const meshId = typeof args?.meshId === "string" ? args.meshId.trim() : "";
54135
54130
  if (!meshId) return { success: false, error: "meshId required" };
54136
54131
  try {
54137
- const { getQueue: getQueue2 } = await Promise.resolve().then(() => (init_mesh_work_queue(), mesh_work_queue_exports));
54132
+ const { getMeshQueueStats: getMeshQueueStats2, getQueue: getQueue2 } = await Promise.resolve().then(() => (init_mesh_work_queue(), mesh_work_queue_exports));
54138
54133
  const status = Array.isArray(args?.status) ? args.status.map((s) => typeof s === "string" ? s.trim() : "").filter(Boolean) : void 0;
54139
54134
  const queue = getQueue2(meshId, { status });
54140
- return { success: true, queue };
54135
+ const summary = getMeshQueueStats2(meshId);
54136
+ return {
54137
+ success: true,
54138
+ queue,
54139
+ summary,
54140
+ sourceOfTruth: {
54141
+ kind: "mesh_work_queue_file",
54142
+ activeStatuses: ["pending", "assigned"],
54143
+ historicalStatuses: ["completed", "failed", "cancelled"],
54144
+ notes: "pending/assigned are active work; completed/failed/cancelled are historical records."
54145
+ }
54146
+ };
54141
54147
  } catch (e) {
54142
54148
  return { success: false, error: e.message };
54143
54149
  }
@@ -58579,6 +58585,7 @@ function readString(value) {
58579
58585
  }
58580
58586
  var DUPLICATE_DISPATCH_WINDOW_MS = 6e4;
58581
58587
  var STALE_ASSIGNED_QUEUE_MS = 30 * 6e4;
58588
+ var OLD_HISTORICAL_QUEUE_RECORD_MS = 7 * 24 * 60 * 6e4;
58582
58589
  var ACTIVE_QUEUE_STATUSES = /* @__PURE__ */ new Set(["pending", "assigned"]);
58583
58590
  var HISTORICAL_QUEUE_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
58584
58591
  async function refreshMeshFromDaemon(ctx) {
@@ -58799,6 +58806,74 @@ function buildQueueStatusSummary(queue) {
58799
58806
  }
58800
58807
  };
58801
58808
  }
58809
+ function normalizeQueueViewMode(value) {
58810
+ return value === "active" || value === "historical" || value === "all" ? value : "all";
58811
+ }
58812
+ function sanitizeQueueStatusFilter(value) {
58813
+ if (!Array.isArray(value)) return void 0;
58814
+ const statuses = value.map((item) => typeof item === "string" ? item.trim() : "").filter((status) => ACTIVE_QUEUE_STATUSES.has(status) || HISTORICAL_QUEUE_STATUSES.has(status));
58815
+ return statuses.length ? Array.from(new Set(statuses)) : void 0;
58816
+ }
58817
+ function filterQueueForView(queue, view, statuses) {
58818
+ if (statuses?.length) {
58819
+ const allowed = new Set(statuses);
58820
+ return queue.filter((task) => allowed.has(String(task?.status || "")));
58821
+ }
58822
+ if (view === "active") return queue.filter((task) => ACTIVE_QUEUE_STATUSES.has(String(task?.status || "")));
58823
+ if (view === "historical") return queue.filter((task) => HISTORICAL_QUEUE_STATUSES.has(String(task?.status || "")));
58824
+ return queue;
58825
+ }
58826
+ function slimQueueTask(task) {
58827
+ return {
58828
+ id: task?.id,
58829
+ status: task?.status,
58830
+ assignedNodeId: task?.assignedNodeId,
58831
+ assignedSessionId: task?.assignedSessionId,
58832
+ targetNodeId: task?.targetNodeId,
58833
+ targetSessionId: task?.targetSessionId,
58834
+ updatedAt: task?.updatedAt,
58835
+ staleAssigned: task?.staleAssigned === true,
58836
+ staleReason: task?.staleReason
58837
+ };
58838
+ }
58839
+ function buildQueueMaintenanceReport(queue) {
58840
+ const now = Date.now();
58841
+ const staleAssignedTasks = queue.filter((task) => task?.status === "assigned" && task?.staleAssigned === true).map(slimQueueTask);
58842
+ const historicalTasks = queue.filter((task) => HISTORICAL_QUEUE_STATUSES.has(String(task?.status || "")));
58843
+ const oldHistoricalTasks = historicalTasks.filter((task) => {
58844
+ const updatedAt = new Date(task?.updatedAt).getTime();
58845
+ return Number.isFinite(updatedAt) && now - updatedAt >= OLD_HISTORICAL_QUEUE_RECORD_MS;
58846
+ }).map((task) => ({
58847
+ ...slimQueueTask(task),
58848
+ cleanupClass: "old_historical_record",
58849
+ reason: "terminal queue record is older than the read-only maintenance threshold"
58850
+ }));
58851
+ const cleanupCandidates = [
58852
+ ...staleAssignedTasks.map((task) => ({
58853
+ ...task,
58854
+ cleanupClass: "stale_assigned",
58855
+ reason: typeof task.staleReason === "string" ? task.staleReason : "active assigned task does not match current live mesh node/session state",
58856
+ suggestedOperation: "operator_review_then_requeue_or_cancel"
58857
+ })),
58858
+ ...oldHistoricalTasks.map((task) => ({
58859
+ ...task,
58860
+ suggestedOperation: "operator_review_then_archive_or_keep"
58861
+ }))
58862
+ ];
58863
+ return {
58864
+ readOnly: true,
58865
+ mutationPerformed: false,
58866
+ sourceOfTruth: "mesh_work_queue_file",
58867
+ staleAssignedDefinition: "Only active assigned queue rows are stale candidates, and only when the assigned node/session is absent from the current live mesh snapshot.",
58868
+ historicalDefinition: "completed/failed/cancelled rows are historical ledger records and never active assignments.",
58869
+ staleAssignedTasks,
58870
+ staleAssignedCount: staleAssignedTasks.length,
58871
+ historicalRecordCount: historicalTasks.length,
58872
+ oldHistoricalRecordCount: oldHistoricalTasks.length,
58873
+ cleanupCandidates,
58874
+ cleanupCandidateCount: cleanupCandidates.length
58875
+ };
58876
+ }
58802
58877
  function annotateQueueStaleness(queue, mesh) {
58803
58878
  const liveness = buildQueueLivenessIndex(mesh);
58804
58879
  const now = Date.now();
@@ -59352,14 +59427,19 @@ var MESH_ENQUEUE_TASK_TOOL = {
59352
59427
  };
59353
59428
  var MESH_VIEW_QUEUE_TOOL = {
59354
59429
  name: "mesh_view_queue",
59355
- description: "View the current status of the mesh work queue (pending, assigned, completed, failed, cancelled tasks).",
59430
+ description: "View the mesh work queue with source-of-truth active counts separated from historical completed/failed/cancelled records.",
59356
59431
  inputSchema: {
59357
59432
  type: "object",
59358
59433
  properties: {
59359
59434
  status: {
59360
59435
  type: "array",
59361
59436
  items: { type: "string" },
59362
- description: "Filter by task status: pending, assigned, completed, failed, cancelled. Returns all if omitted."
59437
+ description: "Explicit row filter by task status: pending, assigned, completed, failed, cancelled. Source-of-truth counts remain unfiltered; visible* counts describe returned rows."
59438
+ },
59439
+ view: {
59440
+ type: "string",
59441
+ enum: ["all", "active", "historical"],
59442
+ description: "Optional row view. active returns pending/assigned rows, historical returns completed/failed/cancelled rows, all returns every persisted queue row. Defaults to all for compatibility."
59363
59443
  }
59364
59444
  }
59365
59445
  }
@@ -59613,8 +59693,22 @@ async function meshStatus(ctx) {
59613
59693
  entry.note = "No daemonId available for cloud status probe";
59614
59694
  }
59615
59695
  } catch (e) {
59696
+ const failure2 = buildCoordinatorP2pRelayFailure(e, {
59697
+ command: "git_status",
59698
+ targetDaemonId: node.daemonId,
59699
+ nodeId: node.id
59700
+ });
59616
59701
  entry.health = "degraded";
59617
- entry.error = e.message;
59702
+ entry.error = failure2.error;
59703
+ entry.degradedReason = failure2.recoverable ? "p2p_relay_failure" : "git_status_unavailable";
59704
+ Object.assign(entry, {
59705
+ code: failure2.code,
59706
+ transport: failure2.transport,
59707
+ recoverable: failure2.recoverable,
59708
+ retryRecommended: failure2.retryRecommended,
59709
+ nextAction: failure2.nextAction,
59710
+ noFallbackReason: failure2.noFallbackReason
59711
+ });
59618
59712
  }
59619
59713
  const recoveryContext = getSessionRecoveryContext(mesh.id, { nodeId: node.id });
59620
59714
  if (recoveryContext.consecutiveNodeFailures > 0) {
@@ -59756,19 +59850,50 @@ async function meshEnqueueTask(ctx, args) {
59756
59850
  }
59757
59851
  async function meshViewQueue(ctx, args) {
59758
59852
  try {
59759
- const queue = annotateQueueStaleness(getQueue(ctx.mesh.id, { status: args.status }), ctx.mesh);
59760
- const staleAssignedTasks = queue.filter((task) => task?.status === "assigned" && task?.staleAssigned);
59761
- const summary = buildQueueStatusSummary(queue);
59853
+ const statusFilter = sanitizeQueueStatusFilter(args.status);
59854
+ const view = normalizeQueueViewMode(args.view);
59855
+ const fullQueue = annotateQueueStaleness(getQueue(ctx.mesh.id), ctx.mesh);
59856
+ const queue = filterQueueForView(fullQueue, view, statusFilter);
59857
+ const summary = buildQueueStatusSummary(fullQueue);
59858
+ const visibleSummary = buildQueueStatusSummary(queue);
59859
+ const maintenance = buildQueueMaintenanceReport(fullQueue);
59860
+ const staleAssignedTasks = maintenance.staleAssignedTasks || [];
59861
+ const requestedHistoricalRows = queue.some((task) => HISTORICAL_QUEUE_STATUSES.has(String(task?.status || "")));
59762
59862
  return JSON.stringify({
59763
59863
  success: true,
59864
+ sourceOfTruth: {
59865
+ kind: "mesh_work_queue_file",
59866
+ activeStatuses: ["pending", "assigned"],
59867
+ historicalStatuses: ["completed", "failed", "cancelled"],
59868
+ notes: "pending/assigned are active work; completed/failed/cancelled are historical ledger records and never stale assignments."
59869
+ },
59870
+ filter: {
59871
+ view,
59872
+ statuses: statusFilter,
59873
+ filtered: Boolean(statusFilter?.length) || view !== "all"
59874
+ },
59764
59875
  queue,
59876
+ visibleQueue: queue,
59877
+ visibleSummary,
59765
59878
  summary,
59766
59879
  activeCounts: summary.activeCounts,
59767
59880
  historicalCounts: summary.historicalCounts,
59768
59881
  activeCount: summary.activeCount,
59769
59882
  historicalCount: summary.historicalCount,
59883
+ visibleActiveCounts: visibleSummary.activeCounts,
59884
+ visibleHistoricalCounts: visibleSummary.historicalCounts,
59885
+ visibleActiveCount: visibleSummary.activeCount,
59886
+ visibleHistoricalCount: visibleSummary.historicalCount,
59770
59887
  staleAssignedTasks,
59771
- staleAssignedCount: staleAssignedTasks.length,
59888
+ staleAssignedCount: maintenance.staleAssignedCount,
59889
+ queueMaintenance: maintenance,
59890
+ cleanupDryRun: maintenance,
59891
+ ...view === "active" || statusFilter?.some((status) => ACTIVE_QUEUE_STATUSES.has(status)) ? {
59892
+ activeQueue: queue.filter((task) => ACTIVE_QUEUE_STATUSES.has(String(task?.status || "")))
59893
+ } : {},
59894
+ ...view === "historical" || requestedHistoricalRows ? {
59895
+ historicalQueue: queue.filter((task) => HISTORICAL_QUEUE_STATUSES.has(String(task?.status || "")))
59896
+ } : {},
59772
59897
  // Back-compat alias for callers already reading the first hardening payload.
59773
59898
  staleAssignments: staleAssignedTasks
59774
59899
  }, null, 2);
@@ -60123,31 +60248,43 @@ async function meshLaunchSession(ctx, args) {
60123
60248
  }
60124
60249
  async function meshGitStatus(ctx, args) {
60125
60250
  const node = await findNodeWithRefresh(ctx, args.node_id);
60126
- if (!isLocalTransport(ctx.transport) && node.daemonId) {
60127
- const result = await ctx.transport.gitStatus(node.daemonId, node.workspace, true);
60128
- return JSON.stringify({
60129
- nodeId: args.node_id,
60130
- workspace: node.workspace,
60131
- status: extractGitStatus(result),
60132
- diff: extractGitDiff(result),
60133
- relatedRepos: await collectRelatedRepoStatuses(ctx, node)
60134
- }, null, 2);
60135
- } else if (isLocalTransport(ctx.transport)) {
60136
- const statusResult = await commandForNode(ctx, node, "git_status", {
60137
- workspace: node.workspace
60138
- });
60139
- const diffResult = await commandForNode(ctx, node, "git_diff_summary", {
60140
- workspace: node.workspace
60251
+ try {
60252
+ if (!isLocalTransport(ctx.transport) && node.daemonId) {
60253
+ const result = await ctx.transport.gitStatus(node.daemonId, node.workspace, true);
60254
+ return JSON.stringify({
60255
+ nodeId: args.node_id,
60256
+ workspace: node.workspace,
60257
+ status: extractGitStatus(result),
60258
+ diff: extractGitDiff(result),
60259
+ relatedRepos: await collectRelatedRepoStatuses(ctx, node)
60260
+ }, null, 2);
60261
+ } else if (isLocalTransport(ctx.transport)) {
60262
+ const statusResult = await commandForNode(ctx, node, "git_status", {
60263
+ workspace: node.workspace
60264
+ });
60265
+ const diffResult = await commandForNode(ctx, node, "git_diff_summary", {
60266
+ workspace: node.workspace
60267
+ });
60268
+ return JSON.stringify({
60269
+ nodeId: args.node_id,
60270
+ workspace: node.workspace,
60271
+ status: extractGitStatus(statusResult),
60272
+ diff: extractGitDiff(diffResult),
60273
+ relatedRepos: await collectRelatedRepoStatuses(ctx, node)
60274
+ }, null, 2);
60275
+ } else {
60276
+ return JSON.stringify({ error: "No daemonId available for cloud git_status probe" });
60277
+ }
60278
+ } catch (e) {
60279
+ const failure2 = buildCoordinatorP2pRelayFailure(e, {
60280
+ command: "git_status",
60281
+ targetDaemonId: node.daemonId,
60282
+ nodeId: args.node_id
60141
60283
  });
60142
60284
  return JSON.stringify({
60143
- nodeId: args.node_id,
60144
- workspace: node.workspace,
60145
- status: extractGitStatus(statusResult),
60146
- diff: extractGitDiff(diffResult),
60147
- relatedRepos: await collectRelatedRepoStatuses(ctx, node)
60285
+ ...failure2,
60286
+ workspace: node.workspace
60148
60287
  }, null, 2);
60149
- } else {
60150
- return JSON.stringify({ error: "No daemonId available for cloud git_status probe" });
60151
60288
  }
60152
60289
  }
60153
60290
  async function meshCheckpoint(ctx, args) {
@@ -60517,15 +60654,6 @@ var CloudTransport = class {
60517
60654
  });
60518
60655
  if (!res.ok) throw new Error(`Delete remote mesh failed: ${res.status}`);
60519
60656
  }
60520
- async syncMeshLedger(meshId, data) {
60521
- const res = await fetch(`${this.baseUrl}/api/v1/repo-meshes/${encodeURIComponent(meshId)}/ledger/sync`, {
60522
- method: "POST",
60523
- headers: this.headers(),
60524
- body: JSON.stringify(data)
60525
- });
60526
- if (!res.ok) throw new Error(`Sync mesh ledger failed: ${res.status}`);
60527
- return res.json();
60528
- }
60529
60657
  async listDaemons() {
60530
60658
  const res = await fetch(`${this.baseUrl}/api/v1/daemons`, { headers: this.headers() });
60531
60659
  if (!res.ok) throw new Error(`List daemons failed: ${res.status}`);