@adhdev/daemon-standalone 0.9.76-rc.66 → 0.9.76-rc.68

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.76-rc.66",
3
+ "version": "0.9.76-rc.68",
4
4
  "description": "ADHDev standalone daemon — embedded HTTP/WS server for local dashboard",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -26081,13 +26081,25 @@ function loadNodePty() {
26081
26081
  return cachedPty;
26082
26082
  }
26083
26083
  function stripAnsi(str2) {
26084
- return str2.replace(/\x1B\][^\x07]*\x07/g, "").replace(/\x1B\][\s\S]*?\x1B\\/g, "").replace(/\x1B[P^_X][\s\S]*?(?:\x07|\x1B\\)/g, "").replace(/\x1B\[\d*[A-HJKSTfG]/g, " ").replace(/\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g, "").replace(/ +/g, " ");
26084
+ return str2.replace(/\x1B\][^\x07]*(?:\x07|\x1B\\)/g, "").replace(/\x1B[P^_X][\s\S]*?(?:\x07|\x1B\\)/g, "").replace(/\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g, "");
26085
+ }
26086
+ function parseCount(params, fallback = 1) {
26087
+ const first = Number(String(params || "").split(";")[0] || fallback);
26088
+ return Math.max(1, Number.isFinite(first) ? first : fallback);
26089
+ }
26090
+ function isCombiningMark(ch) {
26091
+ return /[\u0300-\u036F\u1AB0-\u1AFF\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/.test(ch);
26092
+ }
26093
+ function isWideCodePoint(ch) {
26094
+ const cp = ch.codePointAt(0) || 0;
26095
+ return cp >= 4352 && (cp <= 4447 || cp === 9001 || cp === 9002 || cp >= 11904 && cp <= 42191 && cp !== 12351 || cp >= 44032 && cp <= 55203 || cp >= 63744 && cp <= 64255 || cp >= 65040 && cp <= 65049 || cp >= 65072 && cp <= 65135 || cp >= 65280 && cp <= 65376 || cp >= 65504 && cp <= 65510 || cp >= 127744 && cp <= 129791);
26085
26096
  }
26086
26097
  function stripTerminalNoise(str2) {
26087
- return String(str2 || "").replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F]/g, "").replace(/(^|[\s([])(?:\??\d{1,4}(?:;\d{1,4})*[A-Za-z])(?=$|[\s)\]])/g, "$1").replace(/(^|[\s([])(?:\[\??\d{1,4}(?:;\d{1,4})*[A-Za-z])(?=$|[\s)\]])/g, "$1").replace(/(^|[\s([])(?:\d{1,4};\?)(?=$|[\s)\]])/g, "$1").replace(/(^|[\s([])(?:\d+\$r[0-9;\" ]*[A-Za-z]?)(?=$|[\s)\]])/g, "$1").replace(/(^|[\s([])(?:>\|[A-Za-z0-9_.:-]+(?:\([^)]*\))?)(?=$|[\s)\]])/g, "$1").replace(/(^|[\s([])(?:[A-Z]\d(?:\s+[A-Z]\d)+)(?=$|[\s)\]])/g, "$1").replace(/(^|[\s([])(?:\d+;[^\s)\]]+)(?=$|[\s)\]])/g, "$1").replace(/\r+/g, "\n").replace(/[ \t]+\n/g, "\n").replace(/\n{3,}/g, "\n\n").replace(/ {2,}/g, " ");
26098
+ return String(str2 || "").replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F]/g, "").replace(/\r+/g, "\n").replace(/[ \t]+\n/g, "\n").replace(/\n{4,}/g, "\n\n\n");
26088
26099
  }
26089
26100
  function sanitizeTerminalText(str2) {
26090
- return stripTerminalNoise(stripAnsi(str2));
26101
+ const accumulator = new TerminalTranscriptAccumulator();
26102
+ return stripTerminalNoise(stripAnsi(accumulator.append(str2)));
26091
26103
  }
26092
26104
  function listCliScriptNames(scripts) {
26093
26105
  if (!scripts) return [];
@@ -35097,6 +35109,9 @@ function normalizeExistingPath(filePath) {
35097
35109
  function readNonEmptyString(value) {
35098
35110
  return typeof value === "string" && value.trim() ? value.trim() : "";
35099
35111
  }
35112
+ function isMeshCoordinatorEvent(eventName) {
35113
+ return typeof eventName === "string" && MESH_COORDINATOR_EVENTS.has(eventName);
35114
+ }
35100
35115
  function formatCompletionMetadata(event) {
35101
35116
  const parts = [
35102
35117
  readNonEmptyString(event.targetSessionId) ? `session_id=${readNonEmptyString(event.targetSessionId)}` : "",
@@ -35113,6 +35128,12 @@ function buildMeshSystemMessage(args) {
35113
35128
  if (args.event === "agent:waiting_approval") {
35114
35129
  return `[System] ${args.nodeLabel} is waiting for approval to proceed${metadata}. You may use mesh_read_chat and mesh_approve to handle it.`;
35115
35130
  }
35131
+ if (args.event === "agent:stopped") {
35132
+ return `[System] ${args.nodeLabel} has stopped${metadata}. Use mesh_read_chat once if you need to inspect its last output.`;
35133
+ }
35134
+ if (args.event === "monitor:long_generating") {
35135
+ return `[System] ${args.nodeLabel} has been generating for a long time${metadata}. Use mesh_read_chat once for a status check, but do not poll repeatedly.`;
35136
+ }
35116
35137
  return "";
35117
35138
  }
35118
35139
  function injectMeshSystemMessage(components, args) {
@@ -35138,7 +35159,7 @@ function injectMeshSystemMessage(components, args) {
35138
35159
  }
35139
35160
  function handleMeshForwardEvent(components, payload) {
35140
35161
  const eventName = readNonEmptyString(payload.event);
35141
- if (eventName !== "agent:generating_completed" && eventName !== "agent:waiting_approval") {
35162
+ if (!isMeshCoordinatorEvent(eventName)) {
35142
35163
  return { success: false, error: "unsupported mesh event" };
35143
35164
  }
35144
35165
  const meshId = readNonEmptyString(payload.meshId);
@@ -35159,7 +35180,7 @@ function handleMeshForwardEvent(components, payload) {
35159
35180
  }
35160
35181
  function setupMeshEventForwarding(components) {
35161
35182
  components.instanceManager.onEvent((event) => {
35162
- if (event.event !== "agent:generating_completed" && event.event !== "agent:waiting_approval") return;
35183
+ if (!isMeshCoordinatorEvent(event.event)) return;
35163
35184
  const instanceId = readNonEmptyString(event.instanceId);
35164
35185
  if (!instanceId) return;
35165
35186
  const sourceInstance = components.instanceManager.getInstance(instanceId);
@@ -40384,7 +40405,7 @@ async function shutdownDaemonComponents(components) {
40384
40405
  }
40385
40406
  cdpManagers.clear();
40386
40407
  }
40387
- 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, fs2, path10, os4, os8, os9, path14, import_child_process2, os10, path15, os11, import_child_process3, import_fs6, import_promises5, path, import_util4, import_promises6, path22, path32, fs, os5, path5, import_crypto4, path6, path7, import_fs7, import_path3, import_child_process4, import_fs8, import_os3, path8, import_child_process5, os22, path9, import_fs9, os32, import_child_process6, http, crypto2, fs3, path11, os52, fs4, os6, path12, import_crypto5, fs5, path13, os7, os13, path18, crypto4, import_fs10, 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_crypto6, import_fs11, import_module2, os17, import_path4, os18, import_child_process11, import_child_process12, fs9, os19, path222, import_os4, import_path5, 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, 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, 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, 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, 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, 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, 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, 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;
40408
+ 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, fs2, path10, os4, os8, os9, path14, import_child_process2, os10, path15, os11, import_child_process3, import_fs6, import_promises5, path, import_util4, import_promises6, path22, path32, fs, os5, path5, import_crypto4, path6, path7, import_fs7, import_path3, import_child_process4, import_fs8, import_os3, path8, import_child_process5, os22, path9, import_fs9, os32, import_child_process6, http, crypto2, fs3, path11, os52, fs4, os6, path12, import_crypto5, fs5, path13, os7, os13, path18, crypto4, import_fs10, 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_crypto6, import_fs11, import_module2, os17, import_path4, os18, import_child_process11, import_child_process12, fs9, os19, path222, import_os4, import_path5, 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, 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, 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, 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, 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, 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, MESH_COORDINATOR_EVENTS, READ_DEBUG_ENABLED, recentReadDebugSignatureBySession, UPGRADE_HELPER_ENV, CHANNEL_NPM_TAG, CHANNEL_SERVER_URL, 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;
40388
40409
  var init_dist2 = __esm({
40389
40410
  "../daemon-core/dist/index.mjs"() {
40390
40411
  "use strict";
@@ -40968,6 +40989,155 @@ Before doing any coordinator work, confirm that the actual callable tool list in
40968
40989
  "src/cli-adapters/provider-cli-shared.ts"() {
40969
40990
  "use strict";
40970
40991
  init_spawn_env();
40992
+ TerminalTranscriptAccumulator = class {
40993
+ lines = [[]];
40994
+ row = 0;
40995
+ col = 0;
40996
+ savedCursor = null;
40997
+ pendingEscape = "";
40998
+ append(data) {
40999
+ const input = this.pendingEscape + String(data || "");
41000
+ this.pendingEscape = "";
41001
+ for (let i = 0; i < input.length; i += 1) {
41002
+ let ch = input[i];
41003
+ if (ch === "\x1B") {
41004
+ const consumed = this.consumeEscape(input.slice(i));
41005
+ if (consumed === 0) {
41006
+ this.pendingEscape = input.slice(i);
41007
+ break;
41008
+ }
41009
+ i += consumed - 1;
41010
+ continue;
41011
+ }
41012
+ const cp = input.codePointAt(i);
41013
+ if (cp && cp > 65535) {
41014
+ ch = String.fromCodePoint(cp);
41015
+ i += 1;
41016
+ }
41017
+ this.writeControlOrChar(ch);
41018
+ }
41019
+ return this.getText();
41020
+ }
41021
+ reset() {
41022
+ this.lines = [[]];
41023
+ this.row = 0;
41024
+ this.col = 0;
41025
+ this.savedCursor = null;
41026
+ this.pendingEscape = "";
41027
+ }
41028
+ getText() {
41029
+ return this.lines.map((line) => line.join("").replace(/[ \t]+$/g, "")).join("\n");
41030
+ }
41031
+ ensureRow(row = this.row) {
41032
+ while (this.lines.length <= row) this.lines.push([]);
41033
+ }
41034
+ writeControlOrChar(ch) {
41035
+ if (ch === "\r") {
41036
+ this.col = 0;
41037
+ return;
41038
+ }
41039
+ if (ch === "\n") {
41040
+ this.row += 1;
41041
+ this.col = 0;
41042
+ this.ensureRow();
41043
+ return;
41044
+ }
41045
+ if (ch === "\b") {
41046
+ this.col = Math.max(0, this.col - 1);
41047
+ return;
41048
+ }
41049
+ if (ch < " " || ch === "\x7F") return;
41050
+ this.ensureRow();
41051
+ const line = this.lines[this.row];
41052
+ if (isCombiningMark(ch) && this.col > 0) {
41053
+ line[this.col - 1] = `${line[this.col - 1] || ""}${ch}`;
41054
+ return;
41055
+ }
41056
+ while (line.length < this.col) line.push(" ");
41057
+ line[this.col] = ch;
41058
+ this.col += isWideCodePoint(ch) ? 2 : 1;
41059
+ }
41060
+ consumeEscape(seq2) {
41061
+ if (seq2.length < 2) return 0;
41062
+ const next = seq2[1];
41063
+ if (next === "7") {
41064
+ this.savedCursor = { row: this.row, col: this.col };
41065
+ return 2;
41066
+ }
41067
+ if (next === "8") {
41068
+ if (this.savedCursor) {
41069
+ this.row = this.savedCursor.row;
41070
+ this.col = this.savedCursor.col;
41071
+ this.ensureRow();
41072
+ }
41073
+ return 2;
41074
+ }
41075
+ if (next === "]") {
41076
+ const bel = seq2.indexOf("\x07", 2);
41077
+ const st = seq2.indexOf("\x1B\\", 2);
41078
+ const end = bel >= 0 && (st < 0 || bel < st) ? bel + 1 : st >= 0 ? st + 2 : 0;
41079
+ return end;
41080
+ }
41081
+ if (next === "[") {
41082
+ const match = seq2.match(/^\x1B\[([0-?]*)([ -/]*)([@-~])/);
41083
+ if (!match) return seq2.length < 32 ? 0 : 1;
41084
+ this.applyCsi(match[1] || "", match[3]);
41085
+ return match[0].length;
41086
+ }
41087
+ if (/[P^_X]/.test(next)) {
41088
+ const bel = seq2.indexOf("\x07", 2);
41089
+ const st = seq2.indexOf("\x1B\\", 2);
41090
+ const end = bel >= 0 && (st < 0 || bel < st) ? bel + 1 : st >= 0 ? st + 2 : 0;
41091
+ return end;
41092
+ }
41093
+ return 2;
41094
+ }
41095
+ applyCsi(params, final) {
41096
+ const count = parseCount(params);
41097
+ this.ensureRow();
41098
+ if (final === "A") this.row = Math.max(0, this.row - count);
41099
+ else if (final === "B") this.row += count;
41100
+ else if (final === "C") this.col += count;
41101
+ else if (final === "D") this.col = Math.max(0, this.col - count);
41102
+ else if (final === "G") this.col = Math.max(0, count - 1);
41103
+ else if (final === "H" || final === "f") {
41104
+ const parts = String(params || "").split(";");
41105
+ this.row = Math.max(0, (Number(parts[0] || 1) || 1) - 1);
41106
+ this.col = Math.max(0, (Number(parts[1] || 1) || 1) - 1);
41107
+ } else if (final === "J") {
41108
+ const mode = Number(params || 0) || 0;
41109
+ if (mode === 2 || mode === 3) {
41110
+ this.lines = [[]];
41111
+ this.row = 0;
41112
+ this.col = 0;
41113
+ } else if (mode === 0) {
41114
+ this.lines[this.row] = this.lines[this.row].slice(0, this.col);
41115
+ this.lines.splice(this.row + 1);
41116
+ } else if (mode === 1) {
41117
+ for (let r = 0; r < this.row; r += 1) this.lines[r] = [];
41118
+ const line = this.lines[this.row];
41119
+ for (let c = 0; c <= Math.min(this.col, line.length - 1); c += 1) line[c] = " ";
41120
+ }
41121
+ } else if (final === "K") {
41122
+ const mode = Number(params || 0) || 0;
41123
+ const line = this.lines[this.row];
41124
+ if (mode === 2) this.lines[this.row] = [];
41125
+ else if (mode === 1) {
41126
+ for (let c = 0; c <= Math.min(this.col, line.length - 1); c += 1) line[c] = " ";
41127
+ } else {
41128
+ this.lines[this.row] = line.slice(0, this.col);
41129
+ }
41130
+ } else if (final === "s") {
41131
+ this.savedCursor = { row: this.row, col: this.col };
41132
+ } else if (final === "u") {
41133
+ if (this.savedCursor) {
41134
+ this.row = this.savedCursor.row;
41135
+ this.col = this.savedCursor.col;
41136
+ }
41137
+ }
41138
+ this.ensureRow();
41139
+ }
41140
+ };
40971
41141
  buildCliSpawnEnv = sanitizeSpawnEnv;
40972
41142
  }
40973
41143
  });
@@ -41107,8 +41277,10 @@ Before doing any coordinator work, confirm that the actual callable tool list in
41107
41277
  // ─── CLI Scripts (script-based parsing) ───
41108
41278
  cliScripts;
41109
41279
  runtimeSettings = {};
41110
- /** Full accumulated ANSI-stripped PTY output */
41280
+ /** Full accumulated rendered PTY transcript for parser/readback use */
41111
41281
  accumulatedBuffer = "";
41282
+ /** Stateful rendered transcript accumulator; raw debug remains in accumulatedRawBuffer. */
41283
+ transcriptAccumulator = new TerminalTranscriptAccumulator();
41112
41284
  /** Full accumulated raw PTY output (with ANSI) */
41113
41285
  accumulatedRawBuffer = "";
41114
41286
  /** Current visible terminal screen snapshot */
@@ -41174,6 +41346,7 @@ ${lastSnapshot}`;
41174
41346
  }
41175
41347
  resetTerminalScreen(rows, cols) {
41176
41348
  this.terminalScreen.reset(rows, cols);
41349
+ this.transcriptAccumulator.reset();
41177
41350
  this.lastScreenText = "";
41178
41351
  this.lastScreenSnapshot = "";
41179
41352
  this.lastScreenChangeAt = 0;
@@ -41432,6 +41605,7 @@ ${lastSnapshot}`;
41432
41605
  handleOutput(rawData) {
41433
41606
  this.terminalScreen.write(rawData);
41434
41607
  const cleanData = sanitizeTerminalText(rawData);
41608
+ const renderedTranscript = this.transcriptAccumulator.append(rawData);
41435
41609
  const now = Date.now();
41436
41610
  const shouldReadScreen = this.shouldReadTerminalScreenSnapshot(now);
41437
41611
  const screenText = shouldReadScreen ? this.readTerminalScreenText(now) : this.lastScreenText;
@@ -41472,13 +41646,14 @@ ${lastSnapshot}`;
41472
41646
  }
41473
41647
  }
41474
41648
  const prevRecentLen = this.recentOutputBuffer.length;
41475
- const prevAccumulatedLen = this.accumulatedBuffer.length;
41476
41649
  const prevAccumulatedRawLen = this.accumulatedRawBuffer.length;
41477
- this.recentOutputBuffer = appendBoundedText(this.recentOutputBuffer, cleanData, _ProviderCliAdapter.MAX_RECENT_OUTPUT_BUFFER);
41478
- this.accumulatedBuffer = appendBoundedText(this.accumulatedBuffer, cleanData, _ProviderCliAdapter.MAX_ACCUMULATED_BUFFER);
41650
+ const nextAccumulatedBuffer = renderedTranscript.length <= _ProviderCliAdapter.MAX_ACCUMULATED_BUFFER ? renderedTranscript : renderedTranscript.slice(-_ProviderCliAdapter.MAX_ACCUMULATED_BUFFER);
41651
+ const nextRecentOutputBuffer = nextAccumulatedBuffer.slice(-_ProviderCliAdapter.MAX_RECENT_OUTPUT_BUFFER);
41652
+ this.recentOutputBuffer = nextRecentOutputBuffer;
41653
+ this.accumulatedBuffer = nextAccumulatedBuffer;
41479
41654
  this.accumulatedRawBuffer = appendBoundedText(this.accumulatedRawBuffer, rawData, _ProviderCliAdapter.MAX_ACCUMULATED_BUFFER);
41480
- const droppedRecent = this.recordBoundedAppendDrop(prevRecentLen, cleanData.length, this.recentOutputBuffer.length);
41481
- const droppedClean = this.recordBoundedAppendDrop(prevAccumulatedLen, cleanData.length, this.accumulatedBuffer.length);
41655
+ const droppedRecent = Math.max(0, prevRecentLen - this.recentOutputBuffer.length);
41656
+ const droppedClean = Math.max(0, renderedTranscript.length - this.accumulatedBuffer.length);
41482
41657
  const droppedRaw = this.recordBoundedAppendDrop(prevAccumulatedRawLen, rawData.length, this.accumulatedRawBuffer.length);
41483
41658
  this.recentOutputDroppedChars += droppedRecent;
41484
41659
  this.accumulatedBufferDroppedChars += droppedClean;
@@ -51350,6 +51525,12 @@ Run 'adhdev doctor' for detailed diagnostics.`
51350
51525
  HERMES_MCP_CONFIG_PATH = "~/.hermes/config.yaml";
51351
51526
  init_mesh_config();
51352
51527
  init_logger();
51528
+ MESH_COORDINATOR_EVENTS = /* @__PURE__ */ new Set([
51529
+ "agent:generating_completed",
51530
+ "agent:waiting_approval",
51531
+ "agent:stopped",
51532
+ "monitor:long_generating"
51533
+ ]);
51353
51534
  init_config();
51354
51535
  init_terminal_screen();
51355
51536
  init_logger();
@@ -56868,6 +57049,7 @@ async function meshLaunchSession(ctx, args) {
56868
57049
  }
56869
57050
  }
56870
57051
  const coordinatorNode = resolveCoordinatorNode(ctx);
57052
+ const coordinatorDaemonId = coordinatorNode?.daemonId || ctx.localDaemonId;
56871
57053
  const spawnedSessionVisibility = readSpawnedSessionVisibility(ctx.mesh.policy);
56872
57054
  const result = await commandForNode(ctx, node, "launch_cli", {
56873
57055
  cliType: resolvedProviderType,
@@ -56876,7 +57058,7 @@ async function meshLaunchSession(ctx, args) {
56876
57058
  meshNodeFor: ctx.mesh.id,
56877
57059
  meshNodeId: args.node_id,
56878
57060
  spawnedSessionVisibility,
56879
- ...coordinatorNode?.daemonId ? { meshCoordinatorDaemonId: coordinatorNode.daemonId } : {},
57061
+ ...coordinatorDaemonId ? { meshCoordinatorDaemonId: coordinatorDaemonId } : {},
56880
57062
  ...coordinatorNode?.id ? { meshCoordinatorNodeId: coordinatorNode.id } : {},
56881
57063
  launchedByCoordinator: true
56882
57064
  }