@atlaswork/atlascode 0.1.127 → 0.1.129

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 (34) hide show
  1. package/dist/atlasweb-carrier.json +3 -3
  2. package/dist/cli.js +271 -110
  3. package/dist/web-contract/index.d.ts +8 -0
  4. package/dist/web-contract/index.js +5 -2
  5. package/dist/web-session-runtime/atlascode/web/limits.d.ts +2 -0
  6. package/dist/web-session-runtime/atlascode/web/projection.d.ts +6 -0
  7. package/dist/web-session-runtime/atlascode/web/readonlyRuntime.d.ts +24 -0
  8. package/dist/web-session-runtime/atlascode/web/replayPaging.d.ts +27 -0
  9. package/dist/web-session-runtime/engine/session/load.d.ts +47 -0
  10. package/dist/web-session-runtime/engine/session/predicates.d.ts +1 -1
  11. package/dist/web-session-runtime/engine/session/readonly.d.ts +2 -0
  12. package/dist/web-session-runtime/engine/session/replayScan.d.ts +45 -0
  13. package/dist/web-session-runtime/engine/session/types.d.ts +1 -1
  14. package/dist/web-session-runtime/index.js +373 -4
  15. package/dist/web-session-runtime/kernel/protocol/webSessionV0.d.ts +8 -0
  16. package/dist/web-session-runtime/shared/index.d.ts +1 -1
  17. package/dist/web-session-runtime-execution/atlascode/web/limits.d.ts +2 -0
  18. package/dist/web-session-runtime-execution/atlascode/web/projection.d.ts +6 -0
  19. package/dist/web-session-runtime-execution/atlascode/web/readonlyRuntime.d.ts +24 -0
  20. package/dist/web-session-runtime-execution/atlascode/web/replayPaging.d.ts +27 -0
  21. package/dist/web-session-runtime-execution/engine/session/load.d.ts +47 -0
  22. package/dist/web-session-runtime-execution/engine/session/predicates.d.ts +1 -1
  23. package/dist/web-session-runtime-execution/engine/session/readonly.d.ts +2 -0
  24. package/dist/web-session-runtime-execution/engine/session/replayScan.d.ts +45 -0
  25. package/dist/web-session-runtime-execution/engine/session/types.d.ts +1 -1
  26. package/dist/web-session-runtime-execution/index.js +387 -10
  27. package/dist/web-session-runtime-execution/kernel/execution/executionKernel.d.ts +9 -2
  28. package/dist/web-session-runtime-execution/kernel/protocol/webSessionV0.d.ts +8 -0
  29. package/dist/web-session-runtime-execution/shared/index.d.ts +1 -1
  30. package/package.json +1 -1
  31. package/dist/web-session-runtime/atlascode/web/entry.d.ts +0 -21
  32. package/dist/web-session-runtime/atlascode/web/executionOutlet.d.ts +0 -60
  33. package/dist/web-session-runtime/kernel/execution/executionOutlet.d.ts +0 -60
  34. package/dist/web-session-runtime/kernel/protocol/webExecutionV0.d.ts +0 -542
package/dist/cli.js CHANGED
@@ -35446,6 +35446,13 @@ var init_record = __esm(() => {
35446
35446
  init_project();
35447
35447
  });
35448
35448
 
35449
+ // src/engine/session/replayScan.ts
35450
+ var init_replayScan = __esm(() => {
35451
+ init_load();
35452
+ init_scanner();
35453
+ init_predicates();
35454
+ });
35455
+
35449
35456
  // src/engine/session/readonly.ts
35450
35457
  async function loadTranscriptFull(filePath, opts) {
35451
35458
  return loadTranscriptFile(filePath, {
@@ -35457,6 +35464,7 @@ async function loadTranscriptFull(filePath, opts) {
35457
35464
  var init_readonly = __esm(() => {
35458
35465
  init_load();
35459
35466
  init_load();
35467
+ init_replayScan();
35460
35468
  });
35461
35469
 
35462
35470
  // src/engine/session/sessionMemory.ts
@@ -93304,6 +93312,108 @@ var init_streamJsonStdoutGuard = __esm(() => {
93304
93312
  init_engine();
93305
93313
  });
93306
93314
 
93315
+ // src/cli/approvalChannel.ts
93316
+ import { randomUUID as randomUUID21 } from "node:crypto";
93317
+ function buildInputDigest(input) {
93318
+ const digest = {};
93319
+ if (input === undefined || input === null)
93320
+ return digest;
93321
+ for (const key of DIGEST_KEYS) {
93322
+ const value = input[key];
93323
+ if (typeof value !== "string" || value.length === 0)
93324
+ continue;
93325
+ digest[key] = value.length <= DIGEST_VALUE_MAX_CHARS ? value : value.slice(0, DIGEST_VALUE_MAX_CHARS);
93326
+ }
93327
+ return digest;
93328
+ }
93329
+
93330
+ class StreamJsonApprovalChannel {
93331
+ deps;
93332
+ lineIterator;
93333
+ lineBuffer = "";
93334
+ constructor(deps) {
93335
+ this.deps = deps;
93336
+ this.lineIterator = deps.input[Symbol.asyncIterator]();
93337
+ }
93338
+ async requestApproval(req) {
93339
+ const approvalId = randomUUID21();
93340
+ await this.deps.write({
93341
+ type: "approval_request",
93342
+ approval_id: approvalId,
93343
+ tool_name: req.toolName,
93344
+ input_digest: buildInputDigest(req.input),
93345
+ session_id: req.sessionId
93346
+ });
93347
+ for (;; ) {
93348
+ const line = await this.nextLine();
93349
+ if (line === null)
93350
+ throw new ApprovalStreamClosedError;
93351
+ const trimmed = line.trim();
93352
+ if (trimmed === "")
93353
+ continue;
93354
+ let parsed;
93355
+ try {
93356
+ parsed = JSON.parse(trimmed);
93357
+ } catch {
93358
+ this.warn(`[approval-channel] non-JSON decision line ignored`);
93359
+ continue;
93360
+ }
93361
+ const rec = parsed;
93362
+ if (rec.type !== "approval_response") {
93363
+ this.warn(`[approval-channel] non-approval_response line ignored (type=${String(rec.type)})`);
93364
+ continue;
93365
+ }
93366
+ if (rec.approval_id !== approvalId) {
93367
+ this.warn(`[approval-channel] decision for unknown approval_id ignored`);
93368
+ continue;
93369
+ }
93370
+ if (rec.decision === "approved" || rec.decision === "denied" || rec.decision === "expired") {
93371
+ return rec.decision;
93372
+ }
93373
+ this.warn(`[approval-channel] malformed decision value ignored (${String(rec.decision)})`);
93374
+ }
93375
+ }
93376
+ warn(line) {
93377
+ if (this.deps.warn !== undefined) {
93378
+ this.deps.warn(line);
93379
+ return;
93380
+ }
93381
+ process.stderr.write(`${line}
93382
+ `);
93383
+ }
93384
+ async nextLine() {
93385
+ for (;; ) {
93386
+ const newline = this.lineBuffer.indexOf(`
93387
+ `);
93388
+ if (newline !== -1) {
93389
+ const line = this.lineBuffer.slice(0, newline);
93390
+ this.lineBuffer = this.lineBuffer.slice(newline + 1);
93391
+ return line;
93392
+ }
93393
+ const next = await this.lineIterator.next();
93394
+ if (next.done === true)
93395
+ return null;
93396
+ this.lineBuffer += next.value;
93397
+ }
93398
+ }
93399
+ }
93400
+ var DIGEST_KEYS, DIGEST_VALUE_MAX_CHARS = 200, ApprovalStreamClosedError;
93401
+ var init_approvalChannel = __esm(() => {
93402
+ DIGEST_KEYS = [
93403
+ "file_path",
93404
+ "command",
93405
+ "description",
93406
+ "url",
93407
+ "pattern"
93408
+ ];
93409
+ ApprovalStreamClosedError = class ApprovalStreamClosedError extends Error {
93410
+ constructor() {
93411
+ super("approval stream closed before decision received");
93412
+ this.name = "ApprovalStreamClosedError";
93413
+ }
93414
+ };
93415
+ });
93416
+
93307
93417
  // src/cli/headlessPrompt.ts
93308
93418
  function headlessBaseSystemPrompt() {
93309
93419
  return asSystemPrompt([
@@ -93441,7 +93551,7 @@ var init_headlessSessionEnd = __esm(() => {
93441
93551
  });
93442
93552
 
93443
93553
  // src/cli/print.ts
93444
- import { randomUUID as randomUUID21 } from "crypto";
93554
+ import { randomUUID as randomUUID22 } from "crypto";
93445
93555
  import { readFile as readFile14 } from "node:fs/promises";
93446
93556
  import { join as join42, resolve as resolve17 } from "path";
93447
93557
  function bridgeMcpToolClientLocal(client) {
@@ -93572,7 +93682,7 @@ function makeUserMessage(text) {
93572
93682
  type: "user",
93573
93683
  role: "user",
93574
93684
  message: { role: "user", content: text },
93575
- uuid: randomUUID21(),
93685
+ uuid: randomUUID22(),
93576
93686
  timestamp: String(Date.now())
93577
93687
  };
93578
93688
  }
@@ -93764,7 +93874,7 @@ async function reEvaluateDeferredToolCalls(params) {
93764
93874
  assistantMsg = {
93765
93875
  type: "assistant",
93766
93876
  role: "assistant",
93767
- uuid: randomUUID21(),
93877
+ uuid: randomUUID22(),
93768
93878
  timestamp: new Date().toISOString(),
93769
93879
  message: { role: "assistant", content: [tu] }
93770
93880
  };
@@ -93793,7 +93903,7 @@ async function reEvaluateDeferredToolCalls(params) {
93793
93903
  const resultMsg = {
93794
93904
  type: "user",
93795
93905
  role: "user",
93796
- uuid: randomUUID21(),
93906
+ uuid: randomUUID22(),
93797
93907
  timestamp: now,
93798
93908
  message: { role: "user", content: [outcome.block] },
93799
93909
  toolUseResult: outcome.toolUseResult
@@ -93886,6 +93996,10 @@ async function runHeadless(inputPrompt, options) {
93886
93996
  if (options.outputFormat === "stream-json") {
93887
93997
  installStreamJsonStdoutGuard();
93888
93998
  }
93999
+ const approvalChannel = options.approvalChannel === "stream-json" ? new StreamJsonApprovalChannel({
94000
+ write: (message) => structuredIO.write(message),
94001
+ input: process.stdin
94002
+ }) : undefined;
93889
94003
  const mcpManager = getMcpConnectionManager();
93890
94004
  const settings = getSettingsWithErrors();
93891
94005
  const pricingOverrides = settings.settings.cost?.pricingOverrides;
@@ -93971,6 +94085,31 @@ async function runHeadless(inputPrompt, options) {
93971
94085
  getAppState: () => ({ toolPermissionContext: tpcRef.current })
93972
94086
  });
93973
94087
  const verdict = await gate(tool, input);
94088
+ if (verdict.ask && approvalChannel) {
94089
+ const toolName = tool.name;
94090
+ try {
94091
+ const decision = await approvalChannel.requestApproval({
94092
+ toolName,
94093
+ input: input ?? {},
94094
+ sessionId: getSessionEnv().getSessionId()
94095
+ });
94096
+ if (decision === "approved") {
94097
+ return { allowed: true };
94098
+ }
94099
+ return {
94100
+ allowed: false,
94101
+ reason: decision === "expired" ? "approval expired" : "approval denied"
94102
+ };
94103
+ } catch (error) {
94104
+ if (error instanceof ApprovalStreamClosedError) {
94105
+ return {
94106
+ allowed: false,
94107
+ reason: "approval stream closed before decision"
94108
+ };
94109
+ }
94110
+ throw error;
94111
+ }
94112
+ }
93974
94113
  if (verdict.ask && hasPromptRoute) {
93975
94114
  const sTool = { name: tool.name };
93976
94115
  const decision = await canUseTool(sTool, input ?? {}, makeCtx(), {}, "");
@@ -94068,7 +94207,7 @@ async function runHeadless(inputPrompt, options) {
94068
94207
  result: resultText,
94069
94208
  usage: aggregated.usage,
94070
94209
  ...aggregated.totalCostUsd !== undefined ? { total_cost_usd: aggregated.totalCostUsd } : {},
94071
- uuid: randomUUID21()
94210
+ uuid: randomUUID22()
94072
94211
  };
94073
94212
  };
94074
94213
  const drainToOutput = async () => {
@@ -94091,7 +94230,7 @@ async function runHeadless(inputPrompt, options) {
94091
94230
  role: "assistant",
94092
94231
  content
94093
94232
  },
94094
- uuid: randomUUID21()
94233
+ uuid: randomUUID22()
94095
94234
  });
94096
94235
  }
94097
94236
  const resultMessage = buildResultMessage(loopResult, false);
@@ -94111,7 +94250,7 @@ async function runHeadless(inputPrompt, options) {
94111
94250
  type: "assistant",
94112
94251
  session_id: sessionId,
94113
94252
  message: { role: "assistant", content },
94114
- uuid: randomUUID21()
94253
+ uuid: randomUUID22()
94115
94254
  });
94116
94255
  }
94117
94256
  await drainToOutput();
@@ -94125,7 +94264,7 @@ async function runHeadless(inputPrompt, options) {
94125
94264
  result: `Deferred tool call ${p.toolName} (${p.toolUseId}) by PreToolUse hook` + (p.deferReason ? `: ${p.deferReason}` : "") + `. Session suspended — resume with: atlas -p --resume ${sessionId}`,
94126
94265
  usage: aggregatedDeferred.usage,
94127
94266
  ...aggregatedDeferred.totalCostUsd !== undefined ? { total_cost_usd: aggregatedDeferred.totalCostUsd } : {},
94128
- uuid: randomUUID21()
94267
+ uuid: randomUUID22()
94129
94268
  };
94130
94269
  await writeMessage(resultMessage);
94131
94270
  return resultMessage;
@@ -94301,7 +94440,7 @@ async function runHeadless(inputPrompt, options) {
94301
94440
  num_turns: 0,
94302
94441
  stop_reason: null,
94303
94442
  session_id: sessionId,
94304
- uuid: randomUUID21(),
94443
+ uuid: randomUUID22(),
94305
94444
  errors: [String(error)]
94306
94445
  });
94307
94446
  } catch {}
@@ -94378,6 +94517,7 @@ var init_print = __esm(() => {
94378
94517
  init_structuredIO();
94379
94518
  init_sessionList();
94380
94519
  init_streamJsonStdoutGuard();
94520
+ init_approvalChannel();
94381
94521
  init_headlessPrompt();
94382
94522
  init_debugSink();
94383
94523
  init_hooksWiring();
@@ -95224,7 +95364,7 @@ var init_mcp4 = __esm(() => {
95224
95364
  });
95225
95365
 
95226
95366
  // src/cli/handlers/autoMode.ts
95227
- import { randomUUID as randomUUID22 } from "node:crypto";
95367
+ import { randomUUID as randomUUID23 } from "node:crypto";
95228
95368
  function writeRules(rules) {
95229
95369
  process.stdout.write(JSON.stringify(rules, null, 2) + `
95230
95370
  `);
@@ -95247,7 +95387,7 @@ function makeUserMessage2(text) {
95247
95387
  type: "user",
95248
95388
  role: "user",
95249
95389
  message: { role: "user", content: text },
95250
- uuid: randomUUID22(),
95390
+ uuid: randomUUID23(),
95251
95391
  timestamp: String(Date.now())
95252
95392
  };
95253
95393
  }
@@ -95450,6 +95590,7 @@ function buildHeadlessOptions(options) {
95450
95590
  baseTools: options.tools,
95451
95591
  permissionMode: options.permissionMode ?? (options.permissionPrompts === "none" ? "dontAsk" : undefined),
95452
95592
  permissionPromptToolName: options.permissionPromptTool,
95593
+ approvalChannel: options.approvalChannel,
95453
95594
  maxTurns: options.maxTurns,
95454
95595
  model: options.model,
95455
95596
  dangerouslySkipPermissions: options.dangerouslySkipPermissions === true ? true : undefined,
@@ -95520,6 +95661,18 @@ async function mainActionSeam(prompt, options) {
95520
95661
  `);
95521
95662
  process.exit(1);
95522
95663
  }
95664
+ if (options.approvalChannel) {
95665
+ if (outputFormat !== "stream-json") {
95666
+ process.stderr.write(`Error: --approval-channel requires --output-format=stream-json.
95667
+ `);
95668
+ process.exit(1);
95669
+ }
95670
+ if (inputFormat === "stream-json") {
95671
+ process.stderr.write(`Error: --approval-channel is mutually exclusive with --input-format=stream-json.
95672
+ `);
95673
+ process.exit(1);
95674
+ }
95675
+ }
95523
95676
  await Promise.resolve().then(() => init_dispatch());
95524
95677
  await Promise.resolve().then(() => init_print());
95525
95678
  const inputPrompt = await getInputPrompt(prompt ?? "", inputFormat);
@@ -95546,7 +95699,7 @@ function buildProgram() {
95546
95699
  throw new Error("--task-budget must be a positive integer");
95547
95700
  }
95548
95701
  return tokens;
95549
- }).hideHelp()).option("--replay-user-messages", "Re-emit user messages from stdin back on stdout for acknowledgment (only works with --input-format=stream-json and --output-format=stream-json)", () => true).addOption(new Option("--enable-auth-status", "Enable auth status messages in SDK mode").default(false).hideHelp()).option("--allowedTools, --allowed-tools <tools...>", 'Comma or space-separated list of tool names to allow (e.g. "Bash(git:*) Edit")').option("--tools <tools...>", 'Specify the list of available tools from the built-in set. Use "" to disable all tools, "default" to use all tools, or specify tool names (e.g. "Bash,Edit,Read").').option("--disallowedTools, --disallowed-tools <tools...>", 'Comma or space-separated list of tool names to deny (e.g. "Bash(git:*) Edit")').option("--restricted", "Run in restricted mode: strips command-execution tools (Bash/PowerShell), WebFetch, and Agent; rejects bypassPermissions and --dangerously-skip-permissions; ignores user/project/local settings (env: ATLAS_RESTRICTED)").option("--mcp-config <configs...>", "Load MCP servers from JSON files or strings (space-separated)").addOption(new Option("--permission-prompt-tool <tool>", "MCP tool to use for permission prompts (only works with --print)").argParser(String).hideHelp()).addOption(new Option("--system-prompt <prompt>", "System prompt to use for the session").argParser(String)).addOption(new Option("--system-prompt-file <file>", "Read system prompt from a file").argParser(String).hideHelp()).addOption(new Option("--append-system-prompt <prompt>", "Append a system prompt to the default system prompt").argParser(String)).addOption(new Option("--append-system-prompt-file <file>", "Read system prompt from a file and append to the default system prompt").argParser(String).hideHelp()).addOption(new Option("--permission-mode <mode>", "Permission mode to use for the session").argParser(String).choices(PERMISSION_MODES)).addOption(new Option("--permission-prompts <mode>", "Permission prompt policy; 'none' auto-denies prompts that would otherwise ask").argParser(String).choices(["none"])).option("-c, --continue", "Continue the most recent conversation in the current directory", () => true).option("-r, --resume [value]", "Resume a conversation by session ID, or open interactive picker with optional search term", (value) => value || true).option("--fork-session", "When resuming, create a new session ID instead of reusing the original (use with --resume or --continue)", () => true).addOption(new Option("--prefill <text>", "Pre-fill the prompt input with text without submitting it").hideHelp()).addOption(new Option("--deep-link-origin", "Signal that this session was launched from a deep link").hideHelp()).addOption(new Option("--deep-link-repo <slug>", "Repo slug the deep link ?repo= parameter resolved to the current cwd").hideHelp()).addOption(new Option("--deep-link-last-fetch <ms>", "FETCH_HEAD mtime in epoch ms, precomputed by the deep link trampoline").argParser((v) => {
95702
+ }).hideHelp()).option("--replay-user-messages", "Re-emit user messages from stdin back on stdout for acknowledgment (only works with --input-format=stream-json and --output-format=stream-json)", () => true).addOption(new Option("--enable-auth-status", "Enable auth status messages in SDK mode").default(false).hideHelp()).option("--allowedTools, --allowed-tools <tools...>", 'Comma or space-separated list of tool names to allow (e.g. "Bash(git:*) Edit")').option("--tools <tools...>", 'Specify the list of available tools from the built-in set. Use "" to disable all tools, "default" to use all tools, or specify tool names (e.g. "Bash,Edit,Read").').option("--disallowedTools, --disallowed-tools <tools...>", 'Comma or space-separated list of tool names to deny (e.g. "Bash(git:*) Edit")').option("--restricted", "Run in restricted mode: strips command-execution tools (Bash/PowerShell), WebFetch, and Agent; rejects bypassPermissions and --dangerously-skip-permissions; ignores user/project/local settings (env: ATLAS_RESTRICTED)").option("--mcp-config <configs...>", "Load MCP servers from JSON files or strings (space-separated)").addOption(new Option("--permission-prompt-tool <tool>", "MCP tool to use for permission prompts (only works with --print)").argParser(String).hideHelp()).addOption(new Option("--approval-channel <channel>", "Structured approval channel for -p (stream-json: approval_request on stdout, approval_response on stdin)").choices(["stream-json"]).hideHelp()).addOption(new Option("--system-prompt <prompt>", "System prompt to use for the session").argParser(String)).addOption(new Option("--system-prompt-file <file>", "Read system prompt from a file").argParser(String).hideHelp()).addOption(new Option("--append-system-prompt <prompt>", "Append a system prompt to the default system prompt").argParser(String)).addOption(new Option("--append-system-prompt-file <file>", "Read system prompt from a file and append to the default system prompt").argParser(String).hideHelp()).addOption(new Option("--permission-mode <mode>", "Permission mode to use for the session").argParser(String).choices(PERMISSION_MODES)).addOption(new Option("--permission-prompts <mode>", "Permission prompt policy; 'none' auto-denies prompts that would otherwise ask").argParser(String).choices(["none"])).option("-c, --continue", "Continue the most recent conversation in the current directory", () => true).option("-r, --resume [value]", "Resume a conversation by session ID, or open interactive picker with optional search term", (value) => value || true).option("--fork-session", "When resuming, create a new session ID instead of reusing the original (use with --resume or --continue)", () => true).addOption(new Option("--prefill <text>", "Pre-fill the prompt input with text without submitting it").hideHelp()).addOption(new Option("--deep-link-origin", "Signal that this session was launched from a deep link").hideHelp()).addOption(new Option("--deep-link-repo <slug>", "Repo slug the deep link ?repo= parameter resolved to the current cwd").hideHelp()).addOption(new Option("--deep-link-last-fetch <ms>", "FETCH_HEAD mtime in epoch ms, precomputed by the deep link trampoline").argParser((v) => {
95550
95703
  const n = Number(v);
95551
95704
  return Number.isFinite(n) ? n : undefined;
95552
95705
  }).hideHelp()).option("--from-pr [value]", "Resume a session linked to a PR by PR number/URL, or open interactive picker with optional search term", (value) => value || true).option("--no-session-persistence", "Disable session persistence - sessions will not be saved to disk and cannot be resumed (only works with --print)").addOption(new Option("--resume-session-at <message id>", "When resuming, only messages up to and including the assistant message with <message.id> (use with --resume in print mode)").argParser(String).hideHelp()).addOption(new Option("--rewind-files <user-message-id>", "Restore files to state at the specified user message and exit (requires --resume)").hideHelp()).option("--model <model>", "Model for the current session. Provide a role alias (e.g. 'small' or 'premium') or a provider/model reference (e.g. 'bailian/qwen38-27b').").addOption(new Option("--effort <level>", "Effort level for the current session (low, medium, high, xhigh, max)").argParser((rawValue) => {
@@ -96083,7 +96236,7 @@ function createExecutionKernel(options) {
96083
96236
  }
96084
96237
  emit(st, { workspaceId: ws, sessionId: s, turnId: turn.turnId }, "turn.delta", { text });
96085
96238
  },
96086
- requestApproval: () => {
96239
+ requestApproval: (req) => {
96087
96240
  const approvalId = `appr-${++approvalCounter}`;
96088
96241
  return new Promise((resolve) => {
96089
96242
  const approval = {
@@ -96097,7 +96250,15 @@ function createExecutionKernel(options) {
96097
96250
  resolve
96098
96251
  };
96099
96252
  approvals.set(approvalId, approval);
96100
- emit(st, { workspaceId: ws, sessionId: s, turnId: turn.turnId }, "approval.requested", { approvalId });
96253
+ emit(st, { workspaceId: ws, sessionId: s, turnId: turn.turnId }, "approval.requested", {
96254
+ approvalId,
96255
+ toolName: req?.toolName ?? "unknown",
96256
+ actionDigest: req?.actionDigest ?? {},
96257
+ workspaceId: ws,
96258
+ turnId: turn.turnId,
96259
+ requestedAt: approval.requestedAt,
96260
+ sourceLane: "execution-upstream"
96261
+ });
96101
96262
  approval.timer = setTimeout(() => {
96102
96263
  settleApproval(approval, "expired");
96103
96264
  }, approvalTimeoutMs);
@@ -195397,7 +195558,7 @@ var init_coordinatorMode2 = __esm(() => {
195397
195558
  });
195398
195559
 
195399
195560
  // src/tui/tools/AgentTool/forkSubagent.ts
195400
- import { randomUUID as randomUUID23 } from "crypto";
195561
+ import { randomUUID as randomUUID24 } from "crypto";
195401
195562
  function isForkSubagentEnabled2() {
195402
195563
  if (feature("FORK_SUBAGENT")) {
195403
195564
  if (isCoordinatorMode2())
@@ -195411,7 +195572,7 @@ function isForkSubagentEnabled2() {
195411
195572
  function buildForkedMessages2(directive, assistantMessage) {
195412
195573
  const fullAssistantMessage = {
195413
195574
  ...assistantMessage,
195414
- uuid: randomUUID23(),
195575
+ uuid: randomUUID24(),
195415
195576
  message: {
195416
195577
  ...assistantMessage.message,
195417
195578
  content: [...assistantMessage.message.content]
@@ -196992,7 +197153,7 @@ function sequential(fn) {
196992
197153
  }
196993
197154
 
196994
197155
  // src/tui/utils/commitAttribution.ts
196995
- import { createHash as createHash3, randomUUID as randomUUID24 } from "crypto";
197156
+ import { createHash as createHash3, randomUUID as randomUUID25 } from "crypto";
196996
197157
  import { stat as stat27 } from "fs/promises";
196997
197158
  import { isAbsolute as isAbsolute17, join as join77, relative as relative9, sep as sep15 } from "path";
196998
197159
  function getAttributionRepoRoot() {
@@ -197219,7 +197380,7 @@ function incrementPromptCount(attribution, saveSnapshot) {
197219
197380
  ...attribution,
197220
197381
  promptCount: attribution.promptCount + 1
197221
197382
  };
197222
- const snapshot = stateToSnapshotMessage(newAttribution, randomUUID24());
197383
+ const snapshot = stateToSnapshotMessage(newAttribution, randomUUID25());
197223
197384
  saveSnapshot(snapshot);
197224
197385
  return newAttribution;
197225
197386
  }
@@ -216941,7 +217102,7 @@ var init_xaaIdpLogin = __esm(() => {
216941
217102
  });
216942
217103
 
216943
217104
  // src/tui/services/mcp/auth.ts
216944
- import { createHash as createHash6, randomBytes as randomBytes15, randomUUID as randomUUID25 } from "crypto";
217105
+ import { createHash as createHash6, randomBytes as randomBytes15, randomUUID as randomUUID26 } from "crypto";
216945
217106
  import { mkdir as mkdir22 } from "fs/promises";
216946
217107
  import { createServer as createServer3 } from "http";
216947
217108
  import { join as join91 } from "path";
@@ -217397,7 +217558,7 @@ async function performMCPOAuthFlow(serverName, serverConfig, onAuthorizationUrl,
217397
217558
  scope: cachedStepUpScope,
217398
217559
  resourceMetadataUrl
217399
217560
  };
217400
- const flowAttemptId = randomUUID25();
217561
+ const flowAttemptId = randomUUID26();
217401
217562
  let authorizationCodeObtained = false;
217402
217563
  try {
217403
217564
  const configuredCallbackPort = serverConfig.oauth?.callbackPort;
@@ -237168,12 +237329,12 @@ var init_prompt10 = __esm(() => {
237168
237329
  });
237169
237330
 
237170
237331
  // src/tui/services/lsp/LSPDiagnosticRegistry.ts
237171
- import { randomUUID as randomUUID26 } from "crypto";
237332
+ import { randomUUID as randomUUID27 } from "crypto";
237172
237333
  function registerPendingLSPDiagnostic2({
237173
237334
  serverName,
237174
237335
  files
237175
237336
  }) {
237176
- const diagnosticId = randomUUID26();
237337
+ const diagnosticId = randomUUID27();
237177
237338
  logForDebugging3(`LSP Diagnostics: Registering ${files.length} diagnostic file(s) from ${serverName} (ID: ${diagnosticId})`);
237178
237339
  pendingDiagnostics2.set(diagnosticId, {
237179
237340
  serverName,
@@ -237449,7 +237610,7 @@ var init_tokens = __esm(() => {
237449
237610
  });
237450
237611
 
237451
237612
  // src/tui/utils/pdf.ts
237452
- import { randomUUID as randomUUID27 } from "crypto";
237613
+ import { randomUUID as randomUUID28 } from "crypto";
237453
237614
  import { mkdir as mkdir28, readdir as readdir22, readFile as readFile35 } from "fs/promises";
237454
237615
  import { join as join104 } from "path";
237455
237616
  async function getPDFPageCount2(filePath) {
@@ -237507,7 +237668,7 @@ async function extractPDFPages2(filePath, options) {
237507
237668
  }
237508
237669
  };
237509
237670
  }
237510
- const uuid = randomUUID27();
237671
+ const uuid = randomUUID28();
237511
237672
  const outputDir = join104(getToolResultsDir(), `pdf-${uuid}`);
237512
237673
  await mkdir28(outputDir, { recursive: true });
237513
237674
  const prefix = join104(outputDir, "page");
@@ -238040,7 +238201,7 @@ var autoModeActive2 = false, autoModeFlagCli = false, autoModeCircuitBroken2 = f
238040
238201
  // src/tui/utils/attachments.ts
238041
238202
  import { readdir as readdir23, stat as stat35 } from "fs/promises";
238042
238203
  import { dirname as dirname48, parse as parse12, relative as relative11, resolve as resolve37 } from "path";
238043
- import { randomUUID as randomUUID28 } from "crypto";
238204
+ import { randomUUID as randomUUID29 } from "crypto";
238044
238205
  async function getAttachments(input, toolUseContext, ideSelection, queuedCommands, messages, querySource, options) {
238045
238206
  if (isEnvTruthy2(process.env.ATLAS_DISABLE_ATTACHMENTS) || isEnvTruthy2(process.env.ATLAS_SIMPLE)) {
238046
238207
  return getQueuedCommandAttachments(queuedCommands);
@@ -239068,7 +239229,7 @@ function createAttachmentMessage(attachment) {
239068
239229
  return {
239069
239230
  attachment,
239070
239231
  type: "attachment",
239071
- uuid: randomUUID28(),
239232
+ uuid: randomUUID29(),
239072
239233
  timestamp: new Date().toISOString()
239073
239234
  };
239074
239235
  }
@@ -250959,7 +251120,7 @@ var init_PowerShellTool = __esm(() => {
250959
251120
  });
250960
251121
 
250961
251122
  // src/tui/utils/promptShellExecution.ts
250962
- import { randomUUID as randomUUID29 } from "crypto";
251123
+ import { randomUUID as randomUUID30 } from "crypto";
250963
251124
  async function executeShellCommandsInPrompt2(text, context, slashCommandName, shell) {
250964
251125
  let result = text;
250965
251126
  const shellTool = shell === "powershell" && isPowerShellToolEnabled() ? getPowerShellTool() : BashTool2;
@@ -250975,7 +251136,7 @@ async function executeShellCommandsInPrompt2(text, context, slashCommandName, sh
250975
251136
  throw new MalformedCommandError2(`Shell command permission check failed for pattern "${match[0]}": ${permissionResult.message || "Permission denied"}`);
250976
251137
  }
250977
251138
  const { data } = await shellTool.call({ command }, context);
250978
- const toolResultBlock = await processToolResultBlock(shellTool, data, randomUUID29());
251139
+ const toolResultBlock = await processToolResultBlock(shellTool, data, randomUUID30());
250979
251140
  const output = typeof toolResultBlock.content === "string" ? toolResultBlock.content : formatBashOutput2(data.stdout, data.stderr);
250980
251141
  result = result.replace(match[0], () => output);
250981
251142
  } catch (e) {
@@ -307264,7 +307425,7 @@ var init_skillUsageTracking = __esm(() => {
307264
307425
  });
307265
307426
 
307266
307427
  // src/tui/utils/processUserInput/processSlashCommand.tsx
307267
- import { randomUUID as randomUUID30 } from "crypto";
307428
+ import { randomUUID as randomUUID31 } from "crypto";
307268
307429
  async function executeForkedSlashCommand(command, args, context, precedingInputBlocks, setToolJSX, canUseTool) {
307269
307430
  const agentId = createAgentId();
307270
307431
  const pluginMarketplace = command.pluginInfo ? parsePluginIdentifier2(command.pluginInfo.repository).marketplace : undefined;
@@ -307296,7 +307457,7 @@ async function executeForkedSlashCommand(command, args, context, precedingInputB
307296
307457
  parentToolUseID,
307297
307458
  toolUseID: `${parentToolUseID}-${toolUseCounter}`,
307298
307459
  timestamp: new Date().toISOString(),
307299
- uuid: randomUUID30()
307460
+ uuid: randomUUID31()
307300
307461
  };
307301
307462
  };
307302
307463
  const updateProgress = () => {
@@ -307414,7 +307575,7 @@ async function processSlashCommand(inputString, precedingInputBlocks, imageConte
307414
307575
  resultText: unknownMessage
307415
307576
  };
307416
307577
  }
307417
- const promptId = randomUUID30();
307578
+ const promptId = randomUUID31();
307418
307579
  setPromptId(promptId);
307419
307580
  logOTelEvent("user_prompt", {
307420
307581
  prompt_length: String(inputString.length),
@@ -307815,7 +307976,7 @@ __export(exports_MonitorMcpTask, {
307815
307976
  var killMonitorMcp = null, killMonitorMcpTasksForAgent = null;
307816
307977
 
307817
307978
  // src/tui/tools/AgentTool/runAgent.ts
307818
- import { randomUUID as randomUUID31 } from "crypto";
307979
+ import { randomUUID as randomUUID32 } from "crypto";
307819
307980
  async function initializeAgentMcpServers(agentDefinition, parentClients) {
307820
307981
  if (!agentDefinition.mcpServers?.length) {
307821
307982
  return {
@@ -308005,7 +308166,7 @@ async function* runAgent2({
308005
308166
  type: "hook_additional_context",
308006
308167
  content: additionalContexts,
308007
308168
  hookName: "SubagentStart",
308008
- toolUseID: randomUUID31(),
308169
+ toolUseID: randomUUID32(),
308009
308170
  hookEvent: "SubagentStart"
308010
308171
  });
308011
308172
  initialMessages.push(contextMessage);
@@ -335789,7 +335950,7 @@ var init_cron2 = __esm(() => {
335789
335950
  });
335790
335951
 
335791
335952
  // src/tui/utils/cronTasks.ts
335792
- import { randomUUID as randomUUID32 } from "crypto";
335953
+ import { randomUUID as randomUUID33 } from "crypto";
335793
335954
  import { readFileSync as readFileSync21 } from "fs";
335794
335955
  import { mkdir as mkdir37, writeFile as writeFile33 } from "fs/promises";
335795
335956
  import { join as join127 } from "path";
@@ -335858,7 +336019,7 @@ async function writeCronTasks2(tasks, dir) {
335858
336019
  `, "utf-8");
335859
336020
  }
335860
336021
  async function addCronTask2(cron, prompt, recurring, durable, agentId) {
335861
- const id = randomUUID32().slice(0, 8);
336022
+ const id = randomUUID33().slice(0, 8);
335862
336023
  const task = {
335863
336024
  id,
335864
336025
  cron,
@@ -341943,7 +342104,7 @@ var init_toolSearch = __esm(() => {
341943
342104
  });
341944
342105
 
341945
342106
  // src/tui/services/vcr.ts
341946
- import { createHash as createHash10, randomUUID as randomUUID33 } from "crypto";
342107
+ import { createHash as createHash10, randomUUID as randomUUID34 } from "crypto";
341947
342108
  import { mkdir as mkdir39, readFile as readFile47, writeFile as writeFile35 } from "fs/promises";
341948
342109
  import { dirname as dirname64, join as join130 } from "path";
341949
342110
  function shouldUseVCR() {
@@ -347903,7 +348064,7 @@ var init_messageDisplayHooks = __esm(() => {
347903
348064
  });
347904
348065
 
347905
348066
  // src/tui/utils/messages.ts
347906
- import { randomUUID as randomUUID34 } from "crypto";
348067
+ import { randomUUID as randomUUID35 } from "crypto";
347907
348068
  function isFeatureOn(name) {
347908
348069
  const key = "FEATURE_" + name;
347909
348070
  const genv = globalThis.process?.env;
@@ -347994,10 +348155,10 @@ function baseCreateAssistantMessage({
347994
348155
  }) {
347995
348156
  return {
347996
348157
  type: "assistant",
347997
- uuid: randomUUID34(),
348158
+ uuid: randomUUID35(),
347998
348159
  timestamp: new Date().toISOString(),
347999
348160
  message: {
348000
- id: randomUUID34(),
348161
+ id: randomUUID35(),
348001
348162
  container: null,
348002
348163
  model: SYNTHETIC_MODEL,
348003
348164
  role: "assistant",
@@ -348078,7 +348239,7 @@ function createUserMessage2({
348078
348239
  isVirtual,
348079
348240
  isCompactSummary,
348080
348241
  summarizeMetadata,
348081
- uuid: uuid || randomUUID34(),
348242
+ uuid: uuid || randomUUID35(),
348082
348243
  timestamp: timestamp ?? new Date().toISOString(),
348083
348244
  toolUseResult,
348084
348245
  mcpMeta,
@@ -350418,7 +350579,7 @@ function createSystemMessage(content, level, toolUseID, preventContinuation) {
350418
350579
  content,
350419
350580
  isMeta: false,
350420
350581
  timestamp: new Date().toISOString(),
350421
- uuid: randomUUID34(),
350582
+ uuid: randomUUID35(),
350422
350583
  toolUseID,
350423
350584
  level,
350424
350585
  ...preventContinuation && { preventContinuation }
@@ -350433,7 +350594,7 @@ function createPermissionRetryMessage(commands) {
350433
350594
  level: "info",
350434
350595
  isMeta: false,
350435
350596
  timestamp: new Date().toISOString(),
350436
- uuid: randomUUID34()
350597
+ uuid: randomUUID35()
350437
350598
  };
350438
350599
  }
350439
350600
  function createScheduledTaskFireMessage(content) {
@@ -350443,7 +350604,7 @@ function createScheduledTaskFireMessage(content) {
350443
350604
  content,
350444
350605
  isMeta: false,
350445
350606
  timestamp: new Date().toISOString(),
350446
- uuid: randomUUID34()
350607
+ uuid: randomUUID35()
350447
350608
  };
350448
350609
  }
350449
350610
  function createTurnDurationMessage(durationMs, budget, messageCount) {
@@ -350456,7 +350617,7 @@ function createTurnDurationMessage(durationMs, budget, messageCount) {
350456
350617
  budgetNudges: budget?.nudges,
350457
350618
  messageCount,
350458
350619
  timestamp: new Date().toISOString(),
350459
- uuid: randomUUID34(),
350620
+ uuid: randomUUID35(),
350460
350621
  isMeta: false
350461
350622
  };
350462
350623
  }
@@ -350466,7 +350627,7 @@ function createAwaySummaryMessage(content) {
350466
350627
  subtype: "away_summary",
350467
350628
  content,
350468
350629
  timestamp: new Date().toISOString(),
350469
- uuid: randomUUID34(),
350630
+ uuid: randomUUID35(),
350470
350631
  isMeta: false
350471
350632
  };
350472
350633
  }
@@ -350476,7 +350637,7 @@ function createMemorySavedMessage(writtenPaths) {
350476
350637
  subtype: "memory_saved",
350477
350638
  writtenPaths,
350478
350639
  timestamp: new Date().toISOString(),
350479
- uuid: randomUUID34(),
350640
+ uuid: randomUUID35(),
350480
350641
  isMeta: false
350481
350642
  };
350482
350643
  }
@@ -350485,7 +350646,7 @@ function createAgentsKilledMessage() {
350485
350646
  type: "system",
350486
350647
  subtype: "agents_killed",
350487
350648
  timestamp: new Date().toISOString(),
350488
- uuid: randomUUID34(),
350649
+ uuid: randomUUID35(),
350489
350650
  isMeta: false
350490
350651
  };
350491
350652
  }
@@ -350496,7 +350657,7 @@ function createCommandInputMessage(content) {
350496
350657
  content,
350497
350658
  level: "info",
350498
350659
  timestamp: new Date().toISOString(),
350499
- uuid: randomUUID34(),
350660
+ uuid: randomUUID35(),
350500
350661
  isMeta: false
350501
350662
  };
350502
350663
  }
@@ -350507,7 +350668,7 @@ function createCompactBoundaryMessage2(trigger, preTokens, lastPreCompactMessage
350507
350668
  content: `Conversation compacted`,
350508
350669
  isMeta: false,
350509
350670
  timestamp: new Date().toISOString(),
350510
- uuid: randomUUID34(),
350671
+ uuid: randomUUID35(),
350511
350672
  level: "info",
350512
350673
  compactMetadata: {
350513
350674
  trigger,
@@ -351141,9 +351302,9 @@ var init_hookHelpers = __esm(() => {
351141
351302
  });
351142
351303
 
351143
351304
  // src/tui/utils/hooks/execPromptHook.ts
351144
- import { randomUUID as randomUUID35 } from "crypto";
351305
+ import { randomUUID as randomUUID36 } from "crypto";
351145
351306
  async function execPromptHook(hook, hookName, hookEvent, jsonInput, signal, toolUseContext, messages, toolUseID) {
351146
- const effectiveToolUseID = toolUseID || `hook-${randomUUID35()}`;
351307
+ const effectiveToolUseID = toolUseID || `hook-${randomUUID36()}`;
351147
351308
  try {
351148
351309
  const processedPrompt = addArgumentsToPrompt(hook.prompt, jsonInput);
351149
351310
  if (processedPrompt === null) {
@@ -351298,9 +351459,9 @@ var init_execPromptHook = __esm(() => {
351298
351459
  });
351299
351460
 
351300
351461
  // src/tui/utils/hooks/execAgentHook.ts
351301
- import { randomUUID as randomUUID36 } from "crypto";
351462
+ import { randomUUID as randomUUID37 } from "crypto";
351302
351463
  async function execAgentHook(hook, hookName, hookEvent, jsonInput, signal, toolUseContext, toolUseID, _messages, agentName) {
351303
- const effectiveToolUseID = toolUseID || `hook-${randomUUID36()}`;
351464
+ const effectiveToolUseID = toolUseID || `hook-${randomUUID37()}`;
351304
351465
  const transcriptPath = toolUseContext.agentId ? getAgentTranscriptPath2(toolUseContext.agentId) : getTranscriptPath2();
351305
351466
  const hookStartTime = Date.now();
351306
351467
  try {
@@ -351346,7 +351507,7 @@ When done, return your result using the ${SYNTHETIC_OUTPUT_TOOL_NAME2} tool with
351346
351507
  ]);
351347
351508
  const model = hook.model ?? getDefaultFastModel();
351348
351509
  const MAX_AGENT_TURNS = 50;
351349
- const hookAgentId = asAgentId(`hook-agent-${randomUUID36()}`);
351510
+ const hookAgentId = asAgentId(`hook-agent-${randomUUID37()}`);
351350
351511
  const agentToolUseContext = {
351351
351512
  ...toolUseContext,
351352
351513
  agentId: hookAgentId,
@@ -351800,7 +351961,7 @@ var init_execHttpHook = __esm(() => {
351800
351961
  // src/tui/utils/hooks.ts
351801
351962
  import { basename as basename40 } from "path";
351802
351963
  import { spawn as spawn11 } from "child_process";
351803
- import { randomUUID as randomUUID37 } from "crypto";
351964
+ import { randomUUID as randomUUID38 } from "crypto";
351804
351965
  function getSessionEndHookTimeoutMs() {
351805
351966
  const raw = process.env.ATLAS_SESSIONEND_HOOKS_TIMEOUT_MS;
351806
351967
  const parsed = raw ? parseInt(raw, 10) : NaN;
@@ -352830,7 +352991,7 @@ async function* executeHooks({
352830
352991
  parentToolUseID: toolUseID,
352831
352992
  toolUseID,
352832
352993
  timestamp: new Date().toISOString(),
352833
- uuid: randomUUID37()
352994
+ uuid: randomUUID38()
352834
352995
  }
352835
352996
  };
352836
352997
  }
@@ -352923,7 +353084,7 @@ async function* executeHooks({
352923
353084
  const { signal: abortSignal, cleanup } = createCombinedAbortSignal(signal, {
352924
353085
  timeoutMs: commandTimeoutMs
352925
353086
  });
352926
- const hookId = randomUUID37();
353087
+ const hookId = randomUUID38();
352927
353088
  const hookStartMs = Date.now();
352928
353089
  const hookCommand = getHookDisplayText(hook);
352929
353090
  try {
@@ -353592,7 +353753,7 @@ async function executeHooksOutsideREPL({
353592
353753
  const callbackTimeoutMs = hook.timeout ? hook.timeout * 1000 : timeoutMs;
353593
353754
  const { signal: abortSignal, cleanup } = createCombinedAbortSignal(signal, { timeoutMs: callbackTimeoutMs });
353594
353755
  try {
353595
- const toolUseID = randomUUID37();
353756
+ const toolUseID = randomUUID38();
353596
353757
  const json = await runWithHookReentrancy(hookEvent, hook, pluginRoot, () => hook.callback(hookInput, toolUseID, abortSignal, hookIndex));
353597
353758
  cleanup?.();
353598
353759
  if (isAsyncHookJSONOutput(json)) {
@@ -353703,7 +353864,7 @@ async function executeHooksOutsideREPL({
353703
353864
  const commandTimeoutMs = hook.timeout ? hook.timeout * 1000 : timeoutMs;
353704
353865
  const { signal: abortSignal, cleanup } = createCombinedAbortSignal(signal, { timeoutMs: commandTimeoutMs });
353705
353866
  try {
353706
- const result = await runWithHookReentrancy(hookEvent, hook, pluginRoot, () => execCommandHook(hook, hookEvent, hookName, jsonInput, abortSignal, randomUUID37(), hookIndex, pluginRoot, pluginId));
353867
+ const result = await runWithHookReentrancy(hookEvent, hook, pluginRoot, () => execCommandHook(hook, hookEvent, hookName, jsonInput, abortSignal, randomUUID38(), hookIndex, pluginRoot, pluginId));
353707
353868
  cleanup?.();
353708
353869
  if (result.aborted) {
353709
353870
  logForDebugging3(`${hookName} [${hook.command}] cancelled`);
@@ -353799,7 +353960,7 @@ async function* executeTaskCreatedHooks(taskId, taskSubject, taskDescription, te
353799
353960
  };
353800
353961
  yield* executeHooks({
353801
353962
  hookInput,
353802
- toolUseID: randomUUID37(),
353963
+ toolUseID: randomUUID38(),
353803
353964
  signal,
353804
353965
  timeoutMs,
353805
353966
  toolUseContext
@@ -353817,7 +353978,7 @@ async function* executeTaskCompletedHooks(taskId, taskSubject, taskDescription,
353817
353978
  };
353818
353979
  yield* executeHooks({
353819
353980
  hookInput,
353820
- toolUseID: randomUUID37(),
353981
+ toolUseID: randomUUID38(),
353821
353982
  signal,
353822
353983
  timeoutMs,
353823
353984
  toolUseContext
@@ -353836,7 +353997,7 @@ async function* executeUserPromptSubmitHooks(prompt, permissionMode, toolUseCont
353836
353997
  };
353837
353998
  yield* executeHooks({
353838
353999
  hookInput,
353839
- toolUseID: randomUUID37(),
354000
+ toolUseID: randomUUID38(),
353840
354001
  signal: toolUseContext.abortController.signal,
353841
354002
  timeoutMs: TOOL_HOOK_EXECUTION_TIMEOUT_MS,
353842
354003
  toolUseContext,
@@ -353853,7 +354014,7 @@ async function* executeSessionStartHooks(source, sessionId, agentType, model, si
353853
354014
  };
353854
354015
  yield* executeHooks({
353855
354016
  hookInput,
353856
- toolUseID: randomUUID37(),
354017
+ toolUseID: randomUUID38(),
353857
354018
  matchQuery: source,
353858
354019
  signal,
353859
354020
  timeoutMs,
@@ -353870,7 +354031,7 @@ async function* executePreModelSwitchHooks(oldModel, newModel, source, signal, t
353870
354031
  };
353871
354032
  yield* executeHooks({
353872
354033
  hookInput,
353873
- toolUseID: randomUUID37(),
354034
+ toolUseID: randomUUID38(),
353874
354035
  matchQuery: newModel,
353875
354036
  signal,
353876
354037
  timeoutMs
@@ -353886,7 +354047,7 @@ async function* executePostModelSwitchHooks(oldModel, newModel, source, signal,
353886
354047
  };
353887
354048
  yield* executeHooks({
353888
354049
  hookInput,
353889
- toolUseID: randomUUID37(),
354050
+ toolUseID: randomUUID38(),
353890
354051
  matchQuery: newModel,
353891
354052
  signal,
353892
354053
  timeoutMs
@@ -353901,7 +354062,7 @@ async function* executeDirectoryAddedHooks(directory, source, signal, timeoutMs
353901
354062
  };
353902
354063
  yield* executeHooks({
353903
354064
  hookInput,
353904
- toolUseID: randomUUID37(),
354065
+ toolUseID: randomUUID38(),
353905
354066
  matchQuery: directory,
353906
354067
  signal,
353907
354068
  timeoutMs
@@ -353915,7 +354076,7 @@ async function* executeMessageDisplayHooks(message, signal, timeoutMs = TOOL_HOO
353915
354076
  };
353916
354077
  yield* executeHooks({
353917
354078
  hookInput,
353918
- toolUseID: randomUUID37(),
354079
+ toolUseID: randomUUID38(),
353919
354080
  matchQuery: undefined,
353920
354081
  signal,
353921
354082
  timeoutMs
@@ -353929,7 +354090,7 @@ async function* executeSetupHooks(trigger, signal, timeoutMs = TOOL_HOOK_EXECUTI
353929
354090
  };
353930
354091
  yield* executeHooks({
353931
354092
  hookInput,
353932
- toolUseID: randomUUID37(),
354093
+ toolUseID: randomUUID38(),
353933
354094
  matchQuery: trigger,
353934
354095
  signal,
353935
354096
  timeoutMs,
@@ -353945,7 +354106,7 @@ async function* executeSubagentStartHooks(agentId, agentType, signal, timeoutMs
353945
354106
  };
353946
354107
  yield* executeHooks({
353947
354108
  hookInput,
353948
- toolUseID: randomUUID37(),
354109
+ toolUseID: randomUUID38(),
353949
354110
  matchQuery: agentType,
353950
354111
  signal,
353951
354112
  timeoutMs
@@ -354313,7 +354474,7 @@ async function executeStatusLineCommand(statusLineInput, signal, timeoutMs = 500
354313
354474
  const abortSignal = signal || AbortSignal.timeout(timeoutMs);
354314
354475
  try {
354315
354476
  const jsonInput = jsonStringify5(statusLineInput);
354316
- const result = await execCommandHook(statusLine, "StatusLine", "statusLine", jsonInput, abortSignal, randomUUID37());
354477
+ const result = await execCommandHook(statusLine, "StatusLine", "statusLine", jsonInput, abortSignal, randomUUID38());
354317
354478
  if (result.aborted) {
354318
354479
  return;
354319
354480
  }
@@ -354357,7 +354518,7 @@ async function executeFileSuggestionCommand(fileSuggestionInput, signal, timeout
354357
354518
  try {
354358
354519
  const jsonInput = jsonStringify5(fileSuggestionInput);
354359
354520
  const hook = { type: "command", command: fileSuggestion.command };
354360
- const result = await execCommandHook(hook, "FileSuggestion", "FileSuggestion", jsonInput, abortSignal, randomUUID37());
354521
+ const result = await execCommandHook(hook, "FileSuggestion", "FileSuggestion", jsonInput, abortSignal, randomUUID38());
354361
354522
  if (result.aborted || result.status !== 0) {
354362
354523
  return [];
354363
354524
  }
@@ -359020,7 +359181,7 @@ var init_caches = __esm(() => {
359020
359181
  });
359021
359182
 
359022
359183
  // src/tui/commands/clear/conversation.ts
359023
- import { randomUUID as randomUUID38 } from "crypto";
359184
+ import { randomUUID as randomUUID39 } from "crypto";
359024
359185
  async function clearConversation({
359025
359186
  setMessages,
359026
359187
  readFileState,
@@ -359056,7 +359217,7 @@ async function clearConversation({
359056
359217
  }
359057
359218
  setMessages(() => []);
359058
359219
  if (setConversationId) {
359059
- setConversationId(randomUUID38());
359220
+ setConversationId(randomUUID39());
359060
359221
  }
359061
359222
  clearSessionCaches(preservedAgentIds);
359062
359223
  setCwd2(getOriginalCwd());
@@ -373769,11 +373930,11 @@ var init_editor = __esm(() => {
373769
373930
  });
373770
373931
 
373771
373932
  // src/tui/utils/tempfile.ts
373772
- import { createHash as createHash11, randomUUID as randomUUID39 } from "crypto";
373933
+ import { createHash as createHash11, randomUUID as randomUUID40 } from "crypto";
373773
373934
  import { tmpdir as tmpdir9 } from "os";
373774
373935
  import { join as join144 } from "path";
373775
373936
  function generateTempFilePath2(prefix = "atlas-prompt", extension = ".md", options) {
373776
- const id = options?.contentHash ? createHash11("sha256").update(options.contentHash).digest("hex").slice(0, 16) : randomUUID39();
373937
+ const id = options?.contentHash ? createHash11("sha256").update(options.contentHash).digest("hex").slice(0, 16) : randomUUID40();
373777
373938
  return join144(tmpdir9(), `${prefix}-${id}${extension}`);
373778
373939
  }
373779
373940
  var init_tempfile = () => {};
@@ -406636,7 +406797,7 @@ __export(exports_branch, {
406636
406797
  deriveFirstPrompt: () => deriveFirstPrompt,
406637
406798
  getUniqueForkName: () => getUniqueForkName
406638
406799
  });
406639
- import { randomUUID as randomUUID40 } from "crypto";
406800
+ import { randomUUID as randomUUID41 } from "crypto";
406640
406801
  import { mkdir as mkdir46, readFile as readFile55, writeFile as writeFile43 } from "fs/promises";
406641
406802
  function deriveFirstPrompt(firstUserMessage) {
406642
406803
  const content = firstUserMessage?.message?.content;
@@ -406648,7 +406809,7 @@ function deriveFirstPrompt(firstUserMessage) {
406648
406809
  return raw.replace(/\s+/g, " ").trim().slice(0, 100) || "Branched conversation";
406649
406810
  }
406650
406811
  async function createFork(customTitle, target) {
406651
- const forkSessionId = randomUUID40();
406812
+ const forkSessionId = randomUUID41();
406652
406813
  const originalSessionId = target?.sessionId ?? getSessionId();
406653
406814
  const projectDir = getProjectDir3(getOriginalCwd());
406654
406815
  const forkSessionPath = getTranscriptPathForSession3(forkSessionId);
@@ -435889,7 +436050,7 @@ var init_sessionStorage = __esm(() => {
435889
436050
  });
435890
436051
 
435891
436052
  // src/tui/utils/plans.ts
435892
- import { randomUUID as randomUUID41 } from "crypto";
436053
+ import { randomUUID as randomUUID42 } from "crypto";
435893
436054
  import { copyFile as copyFile8, writeFile as writeFile50 } from "fs/promises";
435894
436055
  import { join as join167, resolve as resolve57, sep as sep37 } from "path";
435895
436056
  function getPlanSlug2(sessionId) {
@@ -436072,7 +436233,7 @@ async function persistFileSnapshotIfRemote() {
436072
436233
  level: "info",
436073
436234
  isMeta: true,
436074
436235
  timestamp: new Date().toISOString(),
436075
- uuid: randomUUID41(),
436236
+ uuid: randomUUID42(),
436076
436237
  snapshotFiles
436077
436238
  };
436078
436239
  await Promise.resolve().then(() => init_sessionStorage());
@@ -437508,7 +437669,7 @@ var init_logging = __esm(() => {
437508
437669
  });
437509
437670
 
437510
437671
  // src/tui/utils/forkedAgent.ts
437511
- import { randomUUID as randomUUID42 } from "crypto";
437672
+ import { randomUUID as randomUUID43 } from "crypto";
437512
437673
  function getLastCacheSafeParams() {
437513
437674
  return lastCacheSafeParams;
437514
437675
  }
@@ -437614,7 +437775,7 @@ function createSubagentContext(parentContext, overrides) {
437614
437775
  agentId: overrides?.agentId ?? createAgentId(),
437615
437776
  agentType: overrides?.agentType,
437616
437777
  queryTracking: {
437617
- chainId: randomUUID42(),
437778
+ chainId: randomUUID43(),
437618
437779
  depth: (parentContext.queryTracking?.depth ?? -1) + 1
437619
437780
  },
437620
437781
  fileReadingLimits: parentContext.fileReadingLimits,
@@ -439430,7 +439591,7 @@ var init_queryHelpers = __esm(() => {
439430
439591
  });
439431
439592
 
439432
439593
  // src/tui/services/PromptSuggestion/speculation.ts
439433
- import { randomUUID as randomUUID43 } from "crypto";
439594
+ import { randomUUID as randomUUID44 } from "crypto";
439434
439595
  import { rm as rm11 } from "fs";
439435
439596
  import { appendFile as appendFile5, copyFile as copyFile9, mkdir as mkdir54 } from "fs/promises";
439436
439597
  import { dirname as dirname77, isAbsolute as isAbsolute32, join as join170, relative as relative28 } from "path";
@@ -439579,7 +439740,7 @@ async function startSpeculation(suggestionText, context, setAppState, isPipeline
439579
439740
  if (!isSpeculationEnabled())
439580
439741
  return;
439581
439742
  abortSpeculation(setAppState);
439582
- const id = randomUUID43().slice(0, 8);
439743
+ const id = randomUUID44().slice(0, 8);
439583
439744
  const abortController = createChildAbortController2(context.toolUseContext.abortController);
439584
439745
  if (abortController.signal.aborted)
439585
439746
  return;
@@ -445673,7 +445834,7 @@ var init_useLogMessages = __esm(() => {
445673
445834
  });
445674
445835
 
445675
445836
  // src/tui/components/MessageSelector.tsx
445676
- import { randomUUID as randomUUID44 } from "crypto";
445837
+ import { randomUUID as randomUUID45 } from "crypto";
445677
445838
  import * as path26 from "path";
445678
445839
  function isTextBlock2(block) {
445679
445840
  return block.type === "text";
@@ -445693,7 +445854,7 @@ function MessageSelector({
445693
445854
  const fileHistory = useAppState((s) => s.fileHistory);
445694
445855
  const [error, setError] = import_react179.useState(undefined);
445695
445856
  const isFileHistoryEnabled = fileHistoryEnabled();
445696
- const currentUUID = import_react179.useMemo(randomUUID44, []);
445857
+ const currentUUID = import_react179.useMemo(randomUUID45, []);
445697
445858
  const messageOptions = import_react179.useMemo(() => [...messages.filter(selectableUserMessagesFilter), {
445698
445859
  ...createUserMessage2({
445699
445860
  content: ""
@@ -451664,7 +451825,7 @@ var init_FileEditToolDiff = __esm(() => {
451664
451825
  });
451665
451826
 
451666
451827
  // src/tui/hooks/useDiffInIDE.ts
451667
- import { randomUUID as randomUUID45 } from "crypto";
451828
+ import { randomUUID as randomUUID46 } from "crypto";
451668
451829
  import { basename as basename52 } from "path";
451669
451830
  function useDiffInIDE({
451670
451831
  onChange,
@@ -451675,7 +451836,7 @@ function useDiffInIDE({
451675
451836
  }) {
451676
451837
  const isUnmounted = import_react191.useRef(false);
451677
451838
  const [hasError, setHasError] = import_react191.useState(false);
451678
- const sha = import_react191.useMemo(() => randomUUID45().slice(0, 6), []);
451839
+ const sha = import_react191.useMemo(() => randomUUID46().slice(0, 6), []);
451679
451840
  const tabName = import_react191.useMemo(() => `✻ [Atlas] ${basename52(filePath)} (${sha}) ⧉`, [filePath, sha]);
451680
451841
  const shouldShowDiffInIDE = hasAccessToIDEExtensionDiffFeature(toolUseContext.options.mcpClients) && getGlobalConfig().diffTool === "auto" && !filePath.endsWith(".ipynb");
451681
451842
  const ideName = getConnectedIdeName(toolUseContext.options.mcpClients) ?? "IDE";
@@ -467279,7 +467440,7 @@ var init_teamDiscovery2 = __esm(() => {
467279
467440
  });
467280
467441
 
467281
467442
  // src/tui/components/teams/TeamsDialog.tsx
467282
- import { randomUUID as randomUUID46 } from "crypto";
467443
+ import { randomUUID as randomUUID47 } from "crypto";
467283
467444
  function TeamsDialog({
467284
467445
  initialTeams,
467285
467446
  onDone
@@ -467903,7 +468064,7 @@ async function killTeammate(paneId, backendType, teamName, teammateId, teammateN
467903
468064
  },
467904
468065
  inbox: {
467905
468066
  messages: [...prev.inbox.messages, {
467906
- id: randomUUID46(),
468067
+ id: randomUUID47(),
467907
468068
  from: "system",
467908
468069
  text: jsonStringify5({
467909
468070
  type: "teammate_terminated",
@@ -473295,7 +473456,7 @@ var init_PromptInput = __esm(() => {
473295
473456
  });
473296
473457
 
473297
473458
  // src/tui/utils/hooks/apiQueryHookHelper.ts
473298
- import { randomUUID as randomUUID47 } from "crypto";
473459
+ import { randomUUID as randomUUID48 } from "crypto";
473299
473460
  function createApiQueryHook(config) {
473300
473461
  return async (context) => {
473301
473462
  try {
@@ -473303,7 +473464,7 @@ function createApiQueryHook(config) {
473303
473464
  if (!shouldRun) {
473304
473465
  return;
473305
473466
  }
473306
- const uuid = randomUUID47();
473467
+ const uuid = randomUUID48();
473307
473468
  const messages = config.buildMessages(context);
473308
473469
  context.queryMessageCount = messages.length;
473309
473470
  const systemPrompt = config.systemPrompt ? asSystemPrompt2([config.systemPrompt]) : context.systemPrompt;
@@ -476333,7 +476494,7 @@ var init_PermissionContext = __esm(() => {
476333
476494
  });
476334
476495
 
476335
476496
  // src/tui/hooks/toolPermission/handlers/interactiveHandler.ts
476336
- import { randomUUID as randomUUID48 } from "crypto";
476497
+ import { randomUUID as randomUUID49 } from "crypto";
476337
476498
  function handleInteractivePermission(params, resolve) {
476338
476499
  const {
476339
476500
  ctx,
@@ -476346,7 +476507,7 @@ function handleInteractivePermission(params, resolve) {
476346
476507
  let userInteracted = false;
476347
476508
  let checkmarkTransitionTimer;
476348
476509
  let checkmarkAbortHandler;
476349
- const bridgeRequestId = bridgeCallbacks ? randomUUID48() : undefined;
476510
+ const bridgeRequestId = bridgeCallbacks ? randomUUID49() : undefined;
476350
476511
  const permissionPromptStartTimeMs = Date.now();
476351
476512
  const displayInput = result.updatedInput ?? ctx.input;
476352
476513
  function clearClassifierIndicator() {
@@ -477093,9 +477254,9 @@ function matchesKeepGoingKeyword(input) {
477093
477254
  }
477094
477255
 
477095
477256
  // src/tui/utils/processUserInput/processTextPrompt.ts
477096
- import { randomUUID as randomUUID49 } from "crypto";
477257
+ import { randomUUID as randomUUID50 } from "crypto";
477097
477258
  function processTextPrompt(input, imageContentBlocks, imagePasteIds, attachmentMessages, uuid, permissionMode, isMeta) {
477098
- const promptId = randomUUID49();
477259
+ const promptId = randomUUID50();
477099
477260
  setPromptId(promptId);
477100
477261
  const userPromptText = typeof input === "string" ? input : input.find((block) => block.type === "text")?.text || "";
477101
477262
  startInteractionSpan(userPromptText);
@@ -477219,7 +477380,7 @@ var init_resolveDefaultShell = __esm(() => {
477219
477380
  });
477220
477381
 
477221
477382
  // src/tui/utils/processUserInput/processBashCommand.tsx
477222
- import { randomUUID as randomUUID50 } from "crypto";
477383
+ import { randomUUID as randomUUID51 } from "crypto";
477223
477384
  async function processBashCommand(inputString, precedingInputBlocks, attachmentMessages, context, setToolJSX) {
477224
477385
  const usePowerShell = isPowerShellToolEnabled() && resolveDefaultShell() === "powershell";
477225
477386
  const userMessage = createUserMessage2({
@@ -477280,7 +477441,7 @@ async function processBashCommand(inputString, precedingInputBlocks, attachmentM
477280
477441
  const mapped = await processToolResultBlock(shellTool, {
477281
477442
  ...data,
477282
477443
  stderr: ""
477283
- }, randomUUID50());
477444
+ }, randomUUID51());
477284
477445
  const stdout = typeof mapped.content === "string" ? mapped.content : escapeXml2(data.stdout);
477285
477446
  return {
477286
477447
  messages: [createSyntheticUserCaveatMessage(), userMessage, ...attachmentMessages, createUserMessage2({
@@ -477328,7 +477489,7 @@ var init_processBashCommand = __esm(() => {
477328
477489
  });
477329
477490
 
477330
477491
  // src/tui/utils/processUserInput/processUserInput.ts
477331
- import { randomUUID as randomUUID51 } from "crypto";
477492
+ import { randomUUID as randomUUID52 } from "crypto";
477332
477493
  async function processUserInput({
477333
477494
  input,
477334
477495
  preExpansionInput,
@@ -477377,7 +477538,7 @@ async function processUserInput({
477377
477538
  type: "hook_additional_context",
477378
477539
  content: hookResult.additionalContexts.map(applyTruncation),
477379
477540
  hookName: "UserPromptSubmit",
477380
- toolUseID: `hook-${randomUUID51()}`,
477541
+ toolUseID: `hook-${randomUUID52()}`,
477381
477542
  hookEvent: "UserPromptSubmit"
477382
477543
  }));
477383
477544
  }
@@ -479176,7 +479337,7 @@ var init_sessionRestore = __esm(() => {
479176
479337
  });
479177
479338
 
479178
479339
  // src/tui/hooks/useInboxPoller.ts
479179
- import { randomUUID as randomUUID52 } from "crypto";
479340
+ import { randomUUID as randomUUID53 } from "crypto";
479180
479341
  function getAgentNameToPoll(appState) {
479181
479342
  if (isInProcessTeammate()) {
479182
479343
  return;
@@ -479610,7 +479771,7 @@ function useInboxPoller({
479610
479771
  messages: [
479611
479772
  ...prev.inbox.messages,
479612
479773
  {
479613
- id: randomUUID52(),
479774
+ id: randomUUID53(),
479614
479775
  from: "system",
479615
479776
  text: jsonStringify5({
479616
479777
  type: "teammate_terminated",
@@ -479650,7 +479811,7 @@ ${messageContent}
479650
479811
  messages: [
479651
479812
  ...prev.inbox.messages,
479652
479813
  ...regularMessages.map((m) => ({
479653
- id: randomUUID52(),
479814
+ id: randomUUID53(),
479654
479815
  from: m.from,
479655
479816
  text: m.text,
479656
479817
  timestamp: m.timestamp,
@@ -486199,7 +486360,7 @@ import { spawnSync as spawnSync7 } from "child_process";
486199
486360
  import { dirname as dirname85, join as join184 } from "path";
486200
486361
  import { tmpdir as tmpdir12 } from "os";
486201
486362
  import { writeFile as writeFile54 } from "fs/promises";
486202
- import { randomUUID as randomUUID53 } from "crypto";
486363
+ import { randomUUID as randomUUID54 } from "crypto";
486203
486364
  function _useMoreRightStub(_args) {
486204
486365
  return {
486205
486366
  onBeforeQuery: async () => true,
@@ -486936,7 +487097,7 @@ function REPL({
486936
487097
  const [spinnerShimmerColor, setSpinnerShimmerColor] = import_react283.useState(null);
486937
487098
  const [isMessageSelectorVisible, setIsMessageSelectorVisible] = import_react283.useState(false);
486938
487099
  const [messageSelectorPreselect, setMessageSelectorPreselect] = import_react283.useState(undefined);
486939
- const [conversationId, setConversationId] = import_react283.useState(randomUUID53());
487100
+ const [conversationId, setConversationId] = import_react283.useState(randomUUID54());
486940
487101
  const [idleReturnPending, setIdleReturnPending] = import_react283.useState(null);
486941
487102
  const skipIdleCheckRef = import_react283.useRef(false);
486942
487103
  const lastQueryCompletionTimeRef = import_react283.useRef(lastQueryCompletionTime);
@@ -487349,10 +487510,10 @@ function REPL({
487349
487510
  if (feature("BRIDGE_MODE")) {
487350
487511
  const bridgeCallbacks = store.getState().replBridgePermissionCallbacks;
487351
487512
  if (bridgeCallbacks) {
487352
- const bridgeRequestId = randomUUID53();
487513
+ const bridgeRequestId = randomUUID54();
487353
487514
  bridgeCallbacks.sendRequest(bridgeRequestId, SANDBOX_NETWORK_ACCESS_TOOL_NAME, {
487354
487515
  host: hostPattern.host
487355
- }, randomUUID53(), `Allow network connection to ${hostPattern.host}?`);
487516
+ }, randomUUID54(), `Allow network connection to ${hostPattern.host}?`);
487356
487517
  const unsubscribe = bridgeCallbacks.onResponse(bridgeRequestId, (response) => {
487357
487518
  unsubscribe();
487358
487519
  const allow = response.behavior === "allow";
@@ -487623,7 +487784,7 @@ Error: sandbox required but unavailable: ${reason}
487623
487784
  } else {
487624
487785
  setMessages(() => [newMessage]);
487625
487786
  }
487626
- setConversationId(randomUUID53());
487787
+ setConversationId(randomUUID54());
487627
487788
  } else if (newMessage.type === "progress" && isEphemeralToolProgress2(newMessage.data.type)) {
487628
487789
  setMessages((oldMessages) => {
487629
487790
  const last = oldMessages.at(-1);
@@ -487702,7 +487863,7 @@ Error: sandbox required but unavailable: ${reason}
487702
487863
  });
487703
487864
  if (!shouldQuery) {
487704
487865
  if (newMessages.some(isCompactBoundaryMessage2)) {
487705
- setConversationId(randomUUID53());
487866
+ setConversationId(randomUUID54());
487706
487867
  }
487707
487868
  resetLoadingState();
487708
487869
  setAbortController(null);
@@ -488350,7 +488511,7 @@ ${serialized}`;
488350
488511
  if (messageIndex === -1)
488351
488512
  return;
488352
488513
  setMessages(prev.slice(0, messageIndex));
488353
- setConversationId(randomUUID53());
488514
+ setConversationId(randomUUID54());
488354
488515
  resetMicrocompactState();
488355
488516
  if (feature("CONTEXT_COLLAPSE")) {
488356
488517
  __toCommonJS(exports_contextCollapse).resetContextCollapse();
@@ -489511,7 +489672,7 @@ Note: ctrl + z now suspends AtlasCode, ctrl + _ undoes input.
489511
489672
  } else {
489512
489673
  setMessages(postCompact);
489513
489674
  }
489514
- setConversationId(randomUUID53());
489675
+ setConversationId(randomUUID54());
489515
489676
  runPostCompactCleanup(context.options.querySource);
489516
489677
  if (direction === "from") {
489517
489678
  const r = textForResubmit(message);