@atlaswork/atlascode 0.1.128 → 0.1.130
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/dist/atlasweb-carrier.json +3 -3
- package/dist/cli.js +263 -110
- package/dist/web-session-runtime/atlascode/web/limits.d.ts +1 -0
- package/dist/web-session-runtime/index.js +4 -3
- package/dist/web-session-runtime-execution/atlascode/web/limits.d.ts +1 -0
- package/dist/web-session-runtime-execution/index.js +14 -5
- package/dist/web-session-runtime-execution/kernel/execution/executionKernel.d.ts +9 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"product": "atlascode",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"runtimeSha256": "
|
|
5
|
-
"executionSha256": "
|
|
3
|
+
"version": "0.1.130",
|
|
4
|
+
"runtimeSha256": "5710d05618ccfc396ca914195625655e81b279041c587a9d7e190a7ff85be80c",
|
|
5
|
+
"executionSha256": "0fd96bfadfdc26128b8852ef1b94a3018a099a223a5f256f5ef47a576e6ffe6b"
|
|
6
6
|
}
|
package/dist/cli.js
CHANGED
|
@@ -93312,6 +93312,108 @@ var init_streamJsonStdoutGuard = __esm(() => {
|
|
|
93312
93312
|
init_engine();
|
|
93313
93313
|
});
|
|
93314
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
|
+
|
|
93315
93417
|
// src/cli/headlessPrompt.ts
|
|
93316
93418
|
function headlessBaseSystemPrompt() {
|
|
93317
93419
|
return asSystemPrompt([
|
|
@@ -93449,7 +93551,7 @@ var init_headlessSessionEnd = __esm(() => {
|
|
|
93449
93551
|
});
|
|
93450
93552
|
|
|
93451
93553
|
// src/cli/print.ts
|
|
93452
|
-
import { randomUUID as
|
|
93554
|
+
import { randomUUID as randomUUID22 } from "crypto";
|
|
93453
93555
|
import { readFile as readFile14 } from "node:fs/promises";
|
|
93454
93556
|
import { join as join42, resolve as resolve17 } from "path";
|
|
93455
93557
|
function bridgeMcpToolClientLocal(client) {
|
|
@@ -93580,7 +93682,7 @@ function makeUserMessage(text) {
|
|
|
93580
93682
|
type: "user",
|
|
93581
93683
|
role: "user",
|
|
93582
93684
|
message: { role: "user", content: text },
|
|
93583
|
-
uuid:
|
|
93685
|
+
uuid: randomUUID22(),
|
|
93584
93686
|
timestamp: String(Date.now())
|
|
93585
93687
|
};
|
|
93586
93688
|
}
|
|
@@ -93772,7 +93874,7 @@ async function reEvaluateDeferredToolCalls(params) {
|
|
|
93772
93874
|
assistantMsg = {
|
|
93773
93875
|
type: "assistant",
|
|
93774
93876
|
role: "assistant",
|
|
93775
|
-
uuid:
|
|
93877
|
+
uuid: randomUUID22(),
|
|
93776
93878
|
timestamp: new Date().toISOString(),
|
|
93777
93879
|
message: { role: "assistant", content: [tu] }
|
|
93778
93880
|
};
|
|
@@ -93801,7 +93903,7 @@ async function reEvaluateDeferredToolCalls(params) {
|
|
|
93801
93903
|
const resultMsg = {
|
|
93802
93904
|
type: "user",
|
|
93803
93905
|
role: "user",
|
|
93804
|
-
uuid:
|
|
93906
|
+
uuid: randomUUID22(),
|
|
93805
93907
|
timestamp: now,
|
|
93806
93908
|
message: { role: "user", content: [outcome.block] },
|
|
93807
93909
|
toolUseResult: outcome.toolUseResult
|
|
@@ -93894,6 +93996,10 @@ async function runHeadless(inputPrompt, options) {
|
|
|
93894
93996
|
if (options.outputFormat === "stream-json") {
|
|
93895
93997
|
installStreamJsonStdoutGuard();
|
|
93896
93998
|
}
|
|
93999
|
+
const approvalChannel = options.approvalChannel === "stream-json" ? new StreamJsonApprovalChannel({
|
|
94000
|
+
write: (message) => structuredIO.write(message),
|
|
94001
|
+
input: process.stdin
|
|
94002
|
+
}) : undefined;
|
|
93897
94003
|
const mcpManager = getMcpConnectionManager();
|
|
93898
94004
|
const settings = getSettingsWithErrors();
|
|
93899
94005
|
const pricingOverrides = settings.settings.cost?.pricingOverrides;
|
|
@@ -93979,6 +94085,31 @@ async function runHeadless(inputPrompt, options) {
|
|
|
93979
94085
|
getAppState: () => ({ toolPermissionContext: tpcRef.current })
|
|
93980
94086
|
});
|
|
93981
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
|
+
}
|
|
93982
94113
|
if (verdict.ask && hasPromptRoute) {
|
|
93983
94114
|
const sTool = { name: tool.name };
|
|
93984
94115
|
const decision = await canUseTool(sTool, input ?? {}, makeCtx(), {}, "");
|
|
@@ -94076,7 +94207,7 @@ async function runHeadless(inputPrompt, options) {
|
|
|
94076
94207
|
result: resultText,
|
|
94077
94208
|
usage: aggregated.usage,
|
|
94078
94209
|
...aggregated.totalCostUsd !== undefined ? { total_cost_usd: aggregated.totalCostUsd } : {},
|
|
94079
|
-
uuid:
|
|
94210
|
+
uuid: randomUUID22()
|
|
94080
94211
|
};
|
|
94081
94212
|
};
|
|
94082
94213
|
const drainToOutput = async () => {
|
|
@@ -94099,7 +94230,7 @@ async function runHeadless(inputPrompt, options) {
|
|
|
94099
94230
|
role: "assistant",
|
|
94100
94231
|
content
|
|
94101
94232
|
},
|
|
94102
|
-
uuid:
|
|
94233
|
+
uuid: randomUUID22()
|
|
94103
94234
|
});
|
|
94104
94235
|
}
|
|
94105
94236
|
const resultMessage = buildResultMessage(loopResult, false);
|
|
@@ -94119,7 +94250,7 @@ async function runHeadless(inputPrompt, options) {
|
|
|
94119
94250
|
type: "assistant",
|
|
94120
94251
|
session_id: sessionId,
|
|
94121
94252
|
message: { role: "assistant", content },
|
|
94122
|
-
uuid:
|
|
94253
|
+
uuid: randomUUID22()
|
|
94123
94254
|
});
|
|
94124
94255
|
}
|
|
94125
94256
|
await drainToOutput();
|
|
@@ -94133,7 +94264,7 @@ async function runHeadless(inputPrompt, options) {
|
|
|
94133
94264
|
result: `Deferred tool call ${p.toolName} (${p.toolUseId}) by PreToolUse hook` + (p.deferReason ? `: ${p.deferReason}` : "") + `. Session suspended — resume with: atlas -p --resume ${sessionId}`,
|
|
94134
94265
|
usage: aggregatedDeferred.usage,
|
|
94135
94266
|
...aggregatedDeferred.totalCostUsd !== undefined ? { total_cost_usd: aggregatedDeferred.totalCostUsd } : {},
|
|
94136
|
-
uuid:
|
|
94267
|
+
uuid: randomUUID22()
|
|
94137
94268
|
};
|
|
94138
94269
|
await writeMessage(resultMessage);
|
|
94139
94270
|
return resultMessage;
|
|
@@ -94309,7 +94440,7 @@ async function runHeadless(inputPrompt, options) {
|
|
|
94309
94440
|
num_turns: 0,
|
|
94310
94441
|
stop_reason: null,
|
|
94311
94442
|
session_id: sessionId,
|
|
94312
|
-
uuid:
|
|
94443
|
+
uuid: randomUUID22(),
|
|
94313
94444
|
errors: [String(error)]
|
|
94314
94445
|
});
|
|
94315
94446
|
} catch {}
|
|
@@ -94386,6 +94517,7 @@ var init_print = __esm(() => {
|
|
|
94386
94517
|
init_structuredIO();
|
|
94387
94518
|
init_sessionList();
|
|
94388
94519
|
init_streamJsonStdoutGuard();
|
|
94520
|
+
init_approvalChannel();
|
|
94389
94521
|
init_headlessPrompt();
|
|
94390
94522
|
init_debugSink();
|
|
94391
94523
|
init_hooksWiring();
|
|
@@ -95232,7 +95364,7 @@ var init_mcp4 = __esm(() => {
|
|
|
95232
95364
|
});
|
|
95233
95365
|
|
|
95234
95366
|
// src/cli/handlers/autoMode.ts
|
|
95235
|
-
import { randomUUID as
|
|
95367
|
+
import { randomUUID as randomUUID23 } from "node:crypto";
|
|
95236
95368
|
function writeRules(rules) {
|
|
95237
95369
|
process.stdout.write(JSON.stringify(rules, null, 2) + `
|
|
95238
95370
|
`);
|
|
@@ -95255,7 +95387,7 @@ function makeUserMessage2(text) {
|
|
|
95255
95387
|
type: "user",
|
|
95256
95388
|
role: "user",
|
|
95257
95389
|
message: { role: "user", content: text },
|
|
95258
|
-
uuid:
|
|
95390
|
+
uuid: randomUUID23(),
|
|
95259
95391
|
timestamp: String(Date.now())
|
|
95260
95392
|
};
|
|
95261
95393
|
}
|
|
@@ -95458,6 +95590,7 @@ function buildHeadlessOptions(options) {
|
|
|
95458
95590
|
baseTools: options.tools,
|
|
95459
95591
|
permissionMode: options.permissionMode ?? (options.permissionPrompts === "none" ? "dontAsk" : undefined),
|
|
95460
95592
|
permissionPromptToolName: options.permissionPromptTool,
|
|
95593
|
+
approvalChannel: options.approvalChannel,
|
|
95461
95594
|
maxTurns: options.maxTurns,
|
|
95462
95595
|
model: options.model,
|
|
95463
95596
|
dangerouslySkipPermissions: options.dangerouslySkipPermissions === true ? true : undefined,
|
|
@@ -95528,6 +95661,18 @@ async function mainActionSeam(prompt, options) {
|
|
|
95528
95661
|
`);
|
|
95529
95662
|
process.exit(1);
|
|
95530
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
|
+
}
|
|
95531
95676
|
await Promise.resolve().then(() => init_dispatch());
|
|
95532
95677
|
await Promise.resolve().then(() => init_print());
|
|
95533
95678
|
const inputPrompt = await getInputPrompt(prompt ?? "", inputFormat);
|
|
@@ -95554,7 +95699,7 @@ function buildProgram() {
|
|
|
95554
95699
|
throw new Error("--task-budget must be a positive integer");
|
|
95555
95700
|
}
|
|
95556
95701
|
return tokens;
|
|
95557
|
-
}).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) => {
|
|
95558
95703
|
const n = Number(v);
|
|
95559
95704
|
return Number.isFinite(n) ? n : undefined;
|
|
95560
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) => {
|
|
@@ -96091,7 +96236,7 @@ function createExecutionKernel(options) {
|
|
|
96091
96236
|
}
|
|
96092
96237
|
emit(st, { workspaceId: ws, sessionId: s, turnId: turn.turnId }, "turn.delta", { text });
|
|
96093
96238
|
},
|
|
96094
|
-
requestApproval: () => {
|
|
96239
|
+
requestApproval: (req) => {
|
|
96095
96240
|
const approvalId = `appr-${++approvalCounter}`;
|
|
96096
96241
|
return new Promise((resolve) => {
|
|
96097
96242
|
const approval = {
|
|
@@ -96105,7 +96250,15 @@ function createExecutionKernel(options) {
|
|
|
96105
96250
|
resolve
|
|
96106
96251
|
};
|
|
96107
96252
|
approvals.set(approvalId, approval);
|
|
96108
|
-
emit(st, { workspaceId: ws, sessionId: s, turnId: turn.turnId }, "approval.requested", {
|
|
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
|
+
});
|
|
96109
96262
|
approval.timer = setTimeout(() => {
|
|
96110
96263
|
settleApproval(approval, "expired");
|
|
96111
96264
|
}, approvalTimeoutMs);
|
|
@@ -195405,7 +195558,7 @@ var init_coordinatorMode2 = __esm(() => {
|
|
|
195405
195558
|
});
|
|
195406
195559
|
|
|
195407
195560
|
// src/tui/tools/AgentTool/forkSubagent.ts
|
|
195408
|
-
import { randomUUID as
|
|
195561
|
+
import { randomUUID as randomUUID24 } from "crypto";
|
|
195409
195562
|
function isForkSubagentEnabled2() {
|
|
195410
195563
|
if (feature("FORK_SUBAGENT")) {
|
|
195411
195564
|
if (isCoordinatorMode2())
|
|
@@ -195419,7 +195572,7 @@ function isForkSubagentEnabled2() {
|
|
|
195419
195572
|
function buildForkedMessages2(directive, assistantMessage) {
|
|
195420
195573
|
const fullAssistantMessage = {
|
|
195421
195574
|
...assistantMessage,
|
|
195422
|
-
uuid:
|
|
195575
|
+
uuid: randomUUID24(),
|
|
195423
195576
|
message: {
|
|
195424
195577
|
...assistantMessage.message,
|
|
195425
195578
|
content: [...assistantMessage.message.content]
|
|
@@ -197000,7 +197153,7 @@ function sequential(fn) {
|
|
|
197000
197153
|
}
|
|
197001
197154
|
|
|
197002
197155
|
// src/tui/utils/commitAttribution.ts
|
|
197003
|
-
import { createHash as createHash3, randomUUID as
|
|
197156
|
+
import { createHash as createHash3, randomUUID as randomUUID25 } from "crypto";
|
|
197004
197157
|
import { stat as stat27 } from "fs/promises";
|
|
197005
197158
|
import { isAbsolute as isAbsolute17, join as join77, relative as relative9, sep as sep15 } from "path";
|
|
197006
197159
|
function getAttributionRepoRoot() {
|
|
@@ -197227,7 +197380,7 @@ function incrementPromptCount(attribution, saveSnapshot) {
|
|
|
197227
197380
|
...attribution,
|
|
197228
197381
|
promptCount: attribution.promptCount + 1
|
|
197229
197382
|
};
|
|
197230
|
-
const snapshot = stateToSnapshotMessage(newAttribution,
|
|
197383
|
+
const snapshot = stateToSnapshotMessage(newAttribution, randomUUID25());
|
|
197231
197384
|
saveSnapshot(snapshot);
|
|
197232
197385
|
return newAttribution;
|
|
197233
197386
|
}
|
|
@@ -216949,7 +217102,7 @@ var init_xaaIdpLogin = __esm(() => {
|
|
|
216949
217102
|
});
|
|
216950
217103
|
|
|
216951
217104
|
// src/tui/services/mcp/auth.ts
|
|
216952
|
-
import { createHash as createHash6, randomBytes as randomBytes15, randomUUID as
|
|
217105
|
+
import { createHash as createHash6, randomBytes as randomBytes15, randomUUID as randomUUID26 } from "crypto";
|
|
216953
217106
|
import { mkdir as mkdir22 } from "fs/promises";
|
|
216954
217107
|
import { createServer as createServer3 } from "http";
|
|
216955
217108
|
import { join as join91 } from "path";
|
|
@@ -217405,7 +217558,7 @@ async function performMCPOAuthFlow(serverName, serverConfig, onAuthorizationUrl,
|
|
|
217405
217558
|
scope: cachedStepUpScope,
|
|
217406
217559
|
resourceMetadataUrl
|
|
217407
217560
|
};
|
|
217408
|
-
const flowAttemptId =
|
|
217561
|
+
const flowAttemptId = randomUUID26();
|
|
217409
217562
|
let authorizationCodeObtained = false;
|
|
217410
217563
|
try {
|
|
217411
217564
|
const configuredCallbackPort = serverConfig.oauth?.callbackPort;
|
|
@@ -237176,12 +237329,12 @@ var init_prompt10 = __esm(() => {
|
|
|
237176
237329
|
});
|
|
237177
237330
|
|
|
237178
237331
|
// src/tui/services/lsp/LSPDiagnosticRegistry.ts
|
|
237179
|
-
import { randomUUID as
|
|
237332
|
+
import { randomUUID as randomUUID27 } from "crypto";
|
|
237180
237333
|
function registerPendingLSPDiagnostic2({
|
|
237181
237334
|
serverName,
|
|
237182
237335
|
files
|
|
237183
237336
|
}) {
|
|
237184
|
-
const diagnosticId =
|
|
237337
|
+
const diagnosticId = randomUUID27();
|
|
237185
237338
|
logForDebugging3(`LSP Diagnostics: Registering ${files.length} diagnostic file(s) from ${serverName} (ID: ${diagnosticId})`);
|
|
237186
237339
|
pendingDiagnostics2.set(diagnosticId, {
|
|
237187
237340
|
serverName,
|
|
@@ -237457,7 +237610,7 @@ var init_tokens = __esm(() => {
|
|
|
237457
237610
|
});
|
|
237458
237611
|
|
|
237459
237612
|
// src/tui/utils/pdf.ts
|
|
237460
|
-
import { randomUUID as
|
|
237613
|
+
import { randomUUID as randomUUID28 } from "crypto";
|
|
237461
237614
|
import { mkdir as mkdir28, readdir as readdir22, readFile as readFile35 } from "fs/promises";
|
|
237462
237615
|
import { join as join104 } from "path";
|
|
237463
237616
|
async function getPDFPageCount2(filePath) {
|
|
@@ -237515,7 +237668,7 @@ async function extractPDFPages2(filePath, options) {
|
|
|
237515
237668
|
}
|
|
237516
237669
|
};
|
|
237517
237670
|
}
|
|
237518
|
-
const uuid =
|
|
237671
|
+
const uuid = randomUUID28();
|
|
237519
237672
|
const outputDir = join104(getToolResultsDir(), `pdf-${uuid}`);
|
|
237520
237673
|
await mkdir28(outputDir, { recursive: true });
|
|
237521
237674
|
const prefix = join104(outputDir, "page");
|
|
@@ -238048,7 +238201,7 @@ var autoModeActive2 = false, autoModeFlagCli = false, autoModeCircuitBroken2 = f
|
|
|
238048
238201
|
// src/tui/utils/attachments.ts
|
|
238049
238202
|
import { readdir as readdir23, stat as stat35 } from "fs/promises";
|
|
238050
238203
|
import { dirname as dirname48, parse as parse12, relative as relative11, resolve as resolve37 } from "path";
|
|
238051
|
-
import { randomUUID as
|
|
238204
|
+
import { randomUUID as randomUUID29 } from "crypto";
|
|
238052
238205
|
async function getAttachments(input, toolUseContext, ideSelection, queuedCommands, messages, querySource, options) {
|
|
238053
238206
|
if (isEnvTruthy2(process.env.ATLAS_DISABLE_ATTACHMENTS) || isEnvTruthy2(process.env.ATLAS_SIMPLE)) {
|
|
238054
238207
|
return getQueuedCommandAttachments(queuedCommands);
|
|
@@ -239076,7 +239229,7 @@ function createAttachmentMessage(attachment) {
|
|
|
239076
239229
|
return {
|
|
239077
239230
|
attachment,
|
|
239078
239231
|
type: "attachment",
|
|
239079
|
-
uuid:
|
|
239232
|
+
uuid: randomUUID29(),
|
|
239080
239233
|
timestamp: new Date().toISOString()
|
|
239081
239234
|
};
|
|
239082
239235
|
}
|
|
@@ -250967,7 +251120,7 @@ var init_PowerShellTool = __esm(() => {
|
|
|
250967
251120
|
});
|
|
250968
251121
|
|
|
250969
251122
|
// src/tui/utils/promptShellExecution.ts
|
|
250970
|
-
import { randomUUID as
|
|
251123
|
+
import { randomUUID as randomUUID30 } from "crypto";
|
|
250971
251124
|
async function executeShellCommandsInPrompt2(text, context, slashCommandName, shell) {
|
|
250972
251125
|
let result = text;
|
|
250973
251126
|
const shellTool = shell === "powershell" && isPowerShellToolEnabled() ? getPowerShellTool() : BashTool2;
|
|
@@ -250983,7 +251136,7 @@ async function executeShellCommandsInPrompt2(text, context, slashCommandName, sh
|
|
|
250983
251136
|
throw new MalformedCommandError2(`Shell command permission check failed for pattern "${match[0]}": ${permissionResult.message || "Permission denied"}`);
|
|
250984
251137
|
}
|
|
250985
251138
|
const { data } = await shellTool.call({ command }, context);
|
|
250986
|
-
const toolResultBlock = await processToolResultBlock(shellTool, data,
|
|
251139
|
+
const toolResultBlock = await processToolResultBlock(shellTool, data, randomUUID30());
|
|
250987
251140
|
const output = typeof toolResultBlock.content === "string" ? toolResultBlock.content : formatBashOutput2(data.stdout, data.stderr);
|
|
250988
251141
|
result = result.replace(match[0], () => output);
|
|
250989
251142
|
} catch (e) {
|
|
@@ -307272,7 +307425,7 @@ var init_skillUsageTracking = __esm(() => {
|
|
|
307272
307425
|
});
|
|
307273
307426
|
|
|
307274
307427
|
// src/tui/utils/processUserInput/processSlashCommand.tsx
|
|
307275
|
-
import { randomUUID as
|
|
307428
|
+
import { randomUUID as randomUUID31 } from "crypto";
|
|
307276
307429
|
async function executeForkedSlashCommand(command, args, context, precedingInputBlocks, setToolJSX, canUseTool) {
|
|
307277
307430
|
const agentId = createAgentId();
|
|
307278
307431
|
const pluginMarketplace = command.pluginInfo ? parsePluginIdentifier2(command.pluginInfo.repository).marketplace : undefined;
|
|
@@ -307304,7 +307457,7 @@ async function executeForkedSlashCommand(command, args, context, precedingInputB
|
|
|
307304
307457
|
parentToolUseID,
|
|
307305
307458
|
toolUseID: `${parentToolUseID}-${toolUseCounter}`,
|
|
307306
307459
|
timestamp: new Date().toISOString(),
|
|
307307
|
-
uuid:
|
|
307460
|
+
uuid: randomUUID31()
|
|
307308
307461
|
};
|
|
307309
307462
|
};
|
|
307310
307463
|
const updateProgress = () => {
|
|
@@ -307422,7 +307575,7 @@ async function processSlashCommand(inputString, precedingInputBlocks, imageConte
|
|
|
307422
307575
|
resultText: unknownMessage
|
|
307423
307576
|
};
|
|
307424
307577
|
}
|
|
307425
|
-
const promptId =
|
|
307578
|
+
const promptId = randomUUID31();
|
|
307426
307579
|
setPromptId(promptId);
|
|
307427
307580
|
logOTelEvent("user_prompt", {
|
|
307428
307581
|
prompt_length: String(inputString.length),
|
|
@@ -307823,7 +307976,7 @@ __export(exports_MonitorMcpTask, {
|
|
|
307823
307976
|
var killMonitorMcp = null, killMonitorMcpTasksForAgent = null;
|
|
307824
307977
|
|
|
307825
307978
|
// src/tui/tools/AgentTool/runAgent.ts
|
|
307826
|
-
import { randomUUID as
|
|
307979
|
+
import { randomUUID as randomUUID32 } from "crypto";
|
|
307827
307980
|
async function initializeAgentMcpServers(agentDefinition, parentClients) {
|
|
307828
307981
|
if (!agentDefinition.mcpServers?.length) {
|
|
307829
307982
|
return {
|
|
@@ -308013,7 +308166,7 @@ async function* runAgent2({
|
|
|
308013
308166
|
type: "hook_additional_context",
|
|
308014
308167
|
content: additionalContexts,
|
|
308015
308168
|
hookName: "SubagentStart",
|
|
308016
|
-
toolUseID:
|
|
308169
|
+
toolUseID: randomUUID32(),
|
|
308017
308170
|
hookEvent: "SubagentStart"
|
|
308018
308171
|
});
|
|
308019
308172
|
initialMessages.push(contextMessage);
|
|
@@ -335797,7 +335950,7 @@ var init_cron2 = __esm(() => {
|
|
|
335797
335950
|
});
|
|
335798
335951
|
|
|
335799
335952
|
// src/tui/utils/cronTasks.ts
|
|
335800
|
-
import { randomUUID as
|
|
335953
|
+
import { randomUUID as randomUUID33 } from "crypto";
|
|
335801
335954
|
import { readFileSync as readFileSync21 } from "fs";
|
|
335802
335955
|
import { mkdir as mkdir37, writeFile as writeFile33 } from "fs/promises";
|
|
335803
335956
|
import { join as join127 } from "path";
|
|
@@ -335866,7 +336019,7 @@ async function writeCronTasks2(tasks, dir) {
|
|
|
335866
336019
|
`, "utf-8");
|
|
335867
336020
|
}
|
|
335868
336021
|
async function addCronTask2(cron, prompt, recurring, durable, agentId) {
|
|
335869
|
-
const id =
|
|
336022
|
+
const id = randomUUID33().slice(0, 8);
|
|
335870
336023
|
const task = {
|
|
335871
336024
|
id,
|
|
335872
336025
|
cron,
|
|
@@ -341951,7 +342104,7 @@ var init_toolSearch = __esm(() => {
|
|
|
341951
342104
|
});
|
|
341952
342105
|
|
|
341953
342106
|
// src/tui/services/vcr.ts
|
|
341954
|
-
import { createHash as createHash10, randomUUID as
|
|
342107
|
+
import { createHash as createHash10, randomUUID as randomUUID34 } from "crypto";
|
|
341955
342108
|
import { mkdir as mkdir39, readFile as readFile47, writeFile as writeFile35 } from "fs/promises";
|
|
341956
342109
|
import { dirname as dirname64, join as join130 } from "path";
|
|
341957
342110
|
function shouldUseVCR() {
|
|
@@ -347911,7 +348064,7 @@ var init_messageDisplayHooks = __esm(() => {
|
|
|
347911
348064
|
});
|
|
347912
348065
|
|
|
347913
348066
|
// src/tui/utils/messages.ts
|
|
347914
|
-
import { randomUUID as
|
|
348067
|
+
import { randomUUID as randomUUID35 } from "crypto";
|
|
347915
348068
|
function isFeatureOn(name) {
|
|
347916
348069
|
const key = "FEATURE_" + name;
|
|
347917
348070
|
const genv = globalThis.process?.env;
|
|
@@ -348002,10 +348155,10 @@ function baseCreateAssistantMessage({
|
|
|
348002
348155
|
}) {
|
|
348003
348156
|
return {
|
|
348004
348157
|
type: "assistant",
|
|
348005
|
-
uuid:
|
|
348158
|
+
uuid: randomUUID35(),
|
|
348006
348159
|
timestamp: new Date().toISOString(),
|
|
348007
348160
|
message: {
|
|
348008
|
-
id:
|
|
348161
|
+
id: randomUUID35(),
|
|
348009
348162
|
container: null,
|
|
348010
348163
|
model: SYNTHETIC_MODEL,
|
|
348011
348164
|
role: "assistant",
|
|
@@ -348086,7 +348239,7 @@ function createUserMessage2({
|
|
|
348086
348239
|
isVirtual,
|
|
348087
348240
|
isCompactSummary,
|
|
348088
348241
|
summarizeMetadata,
|
|
348089
|
-
uuid: uuid ||
|
|
348242
|
+
uuid: uuid || randomUUID35(),
|
|
348090
348243
|
timestamp: timestamp ?? new Date().toISOString(),
|
|
348091
348244
|
toolUseResult,
|
|
348092
348245
|
mcpMeta,
|
|
@@ -350426,7 +350579,7 @@ function createSystemMessage(content, level, toolUseID, preventContinuation) {
|
|
|
350426
350579
|
content,
|
|
350427
350580
|
isMeta: false,
|
|
350428
350581
|
timestamp: new Date().toISOString(),
|
|
350429
|
-
uuid:
|
|
350582
|
+
uuid: randomUUID35(),
|
|
350430
350583
|
toolUseID,
|
|
350431
350584
|
level,
|
|
350432
350585
|
...preventContinuation && { preventContinuation }
|
|
@@ -350441,7 +350594,7 @@ function createPermissionRetryMessage(commands) {
|
|
|
350441
350594
|
level: "info",
|
|
350442
350595
|
isMeta: false,
|
|
350443
350596
|
timestamp: new Date().toISOString(),
|
|
350444
|
-
uuid:
|
|
350597
|
+
uuid: randomUUID35()
|
|
350445
350598
|
};
|
|
350446
350599
|
}
|
|
350447
350600
|
function createScheduledTaskFireMessage(content) {
|
|
@@ -350451,7 +350604,7 @@ function createScheduledTaskFireMessage(content) {
|
|
|
350451
350604
|
content,
|
|
350452
350605
|
isMeta: false,
|
|
350453
350606
|
timestamp: new Date().toISOString(),
|
|
350454
|
-
uuid:
|
|
350607
|
+
uuid: randomUUID35()
|
|
350455
350608
|
};
|
|
350456
350609
|
}
|
|
350457
350610
|
function createTurnDurationMessage(durationMs, budget, messageCount) {
|
|
@@ -350464,7 +350617,7 @@ function createTurnDurationMessage(durationMs, budget, messageCount) {
|
|
|
350464
350617
|
budgetNudges: budget?.nudges,
|
|
350465
350618
|
messageCount,
|
|
350466
350619
|
timestamp: new Date().toISOString(),
|
|
350467
|
-
uuid:
|
|
350620
|
+
uuid: randomUUID35(),
|
|
350468
350621
|
isMeta: false
|
|
350469
350622
|
};
|
|
350470
350623
|
}
|
|
@@ -350474,7 +350627,7 @@ function createAwaySummaryMessage(content) {
|
|
|
350474
350627
|
subtype: "away_summary",
|
|
350475
350628
|
content,
|
|
350476
350629
|
timestamp: new Date().toISOString(),
|
|
350477
|
-
uuid:
|
|
350630
|
+
uuid: randomUUID35(),
|
|
350478
350631
|
isMeta: false
|
|
350479
350632
|
};
|
|
350480
350633
|
}
|
|
@@ -350484,7 +350637,7 @@ function createMemorySavedMessage(writtenPaths) {
|
|
|
350484
350637
|
subtype: "memory_saved",
|
|
350485
350638
|
writtenPaths,
|
|
350486
350639
|
timestamp: new Date().toISOString(),
|
|
350487
|
-
uuid:
|
|
350640
|
+
uuid: randomUUID35(),
|
|
350488
350641
|
isMeta: false
|
|
350489
350642
|
};
|
|
350490
350643
|
}
|
|
@@ -350493,7 +350646,7 @@ function createAgentsKilledMessage() {
|
|
|
350493
350646
|
type: "system",
|
|
350494
350647
|
subtype: "agents_killed",
|
|
350495
350648
|
timestamp: new Date().toISOString(),
|
|
350496
|
-
uuid:
|
|
350649
|
+
uuid: randomUUID35(),
|
|
350497
350650
|
isMeta: false
|
|
350498
350651
|
};
|
|
350499
350652
|
}
|
|
@@ -350504,7 +350657,7 @@ function createCommandInputMessage(content) {
|
|
|
350504
350657
|
content,
|
|
350505
350658
|
level: "info",
|
|
350506
350659
|
timestamp: new Date().toISOString(),
|
|
350507
|
-
uuid:
|
|
350660
|
+
uuid: randomUUID35(),
|
|
350508
350661
|
isMeta: false
|
|
350509
350662
|
};
|
|
350510
350663
|
}
|
|
@@ -350515,7 +350668,7 @@ function createCompactBoundaryMessage2(trigger, preTokens, lastPreCompactMessage
|
|
|
350515
350668
|
content: `Conversation compacted`,
|
|
350516
350669
|
isMeta: false,
|
|
350517
350670
|
timestamp: new Date().toISOString(),
|
|
350518
|
-
uuid:
|
|
350671
|
+
uuid: randomUUID35(),
|
|
350519
350672
|
level: "info",
|
|
350520
350673
|
compactMetadata: {
|
|
350521
350674
|
trigger,
|
|
@@ -351149,9 +351302,9 @@ var init_hookHelpers = __esm(() => {
|
|
|
351149
351302
|
});
|
|
351150
351303
|
|
|
351151
351304
|
// src/tui/utils/hooks/execPromptHook.ts
|
|
351152
|
-
import { randomUUID as
|
|
351305
|
+
import { randomUUID as randomUUID36 } from "crypto";
|
|
351153
351306
|
async function execPromptHook(hook, hookName, hookEvent, jsonInput, signal, toolUseContext, messages, toolUseID) {
|
|
351154
|
-
const effectiveToolUseID = toolUseID || `hook-${
|
|
351307
|
+
const effectiveToolUseID = toolUseID || `hook-${randomUUID36()}`;
|
|
351155
351308
|
try {
|
|
351156
351309
|
const processedPrompt = addArgumentsToPrompt(hook.prompt, jsonInput);
|
|
351157
351310
|
if (processedPrompt === null) {
|
|
@@ -351306,9 +351459,9 @@ var init_execPromptHook = __esm(() => {
|
|
|
351306
351459
|
});
|
|
351307
351460
|
|
|
351308
351461
|
// src/tui/utils/hooks/execAgentHook.ts
|
|
351309
|
-
import { randomUUID as
|
|
351462
|
+
import { randomUUID as randomUUID37 } from "crypto";
|
|
351310
351463
|
async function execAgentHook(hook, hookName, hookEvent, jsonInput, signal, toolUseContext, toolUseID, _messages, agentName) {
|
|
351311
|
-
const effectiveToolUseID = toolUseID || `hook-${
|
|
351464
|
+
const effectiveToolUseID = toolUseID || `hook-${randomUUID37()}`;
|
|
351312
351465
|
const transcriptPath = toolUseContext.agentId ? getAgentTranscriptPath2(toolUseContext.agentId) : getTranscriptPath2();
|
|
351313
351466
|
const hookStartTime = Date.now();
|
|
351314
351467
|
try {
|
|
@@ -351354,7 +351507,7 @@ When done, return your result using the ${SYNTHETIC_OUTPUT_TOOL_NAME2} tool with
|
|
|
351354
351507
|
]);
|
|
351355
351508
|
const model = hook.model ?? getDefaultFastModel();
|
|
351356
351509
|
const MAX_AGENT_TURNS = 50;
|
|
351357
|
-
const hookAgentId = asAgentId(`hook-agent-${
|
|
351510
|
+
const hookAgentId = asAgentId(`hook-agent-${randomUUID37()}`);
|
|
351358
351511
|
const agentToolUseContext = {
|
|
351359
351512
|
...toolUseContext,
|
|
351360
351513
|
agentId: hookAgentId,
|
|
@@ -351808,7 +351961,7 @@ var init_execHttpHook = __esm(() => {
|
|
|
351808
351961
|
// src/tui/utils/hooks.ts
|
|
351809
351962
|
import { basename as basename40 } from "path";
|
|
351810
351963
|
import { spawn as spawn11 } from "child_process";
|
|
351811
|
-
import { randomUUID as
|
|
351964
|
+
import { randomUUID as randomUUID38 } from "crypto";
|
|
351812
351965
|
function getSessionEndHookTimeoutMs() {
|
|
351813
351966
|
const raw = process.env.ATLAS_SESSIONEND_HOOKS_TIMEOUT_MS;
|
|
351814
351967
|
const parsed = raw ? parseInt(raw, 10) : NaN;
|
|
@@ -352838,7 +352991,7 @@ async function* executeHooks({
|
|
|
352838
352991
|
parentToolUseID: toolUseID,
|
|
352839
352992
|
toolUseID,
|
|
352840
352993
|
timestamp: new Date().toISOString(),
|
|
352841
|
-
uuid:
|
|
352994
|
+
uuid: randomUUID38()
|
|
352842
352995
|
}
|
|
352843
352996
|
};
|
|
352844
352997
|
}
|
|
@@ -352931,7 +353084,7 @@ async function* executeHooks({
|
|
|
352931
353084
|
const { signal: abortSignal, cleanup } = createCombinedAbortSignal(signal, {
|
|
352932
353085
|
timeoutMs: commandTimeoutMs
|
|
352933
353086
|
});
|
|
352934
|
-
const hookId =
|
|
353087
|
+
const hookId = randomUUID38();
|
|
352935
353088
|
const hookStartMs = Date.now();
|
|
352936
353089
|
const hookCommand = getHookDisplayText(hook);
|
|
352937
353090
|
try {
|
|
@@ -353600,7 +353753,7 @@ async function executeHooksOutsideREPL({
|
|
|
353600
353753
|
const callbackTimeoutMs = hook.timeout ? hook.timeout * 1000 : timeoutMs;
|
|
353601
353754
|
const { signal: abortSignal, cleanup } = createCombinedAbortSignal(signal, { timeoutMs: callbackTimeoutMs });
|
|
353602
353755
|
try {
|
|
353603
|
-
const toolUseID =
|
|
353756
|
+
const toolUseID = randomUUID38();
|
|
353604
353757
|
const json = await runWithHookReentrancy(hookEvent, hook, pluginRoot, () => hook.callback(hookInput, toolUseID, abortSignal, hookIndex));
|
|
353605
353758
|
cleanup?.();
|
|
353606
353759
|
if (isAsyncHookJSONOutput(json)) {
|
|
@@ -353711,7 +353864,7 @@ async function executeHooksOutsideREPL({
|
|
|
353711
353864
|
const commandTimeoutMs = hook.timeout ? hook.timeout * 1000 : timeoutMs;
|
|
353712
353865
|
const { signal: abortSignal, cleanup } = createCombinedAbortSignal(signal, { timeoutMs: commandTimeoutMs });
|
|
353713
353866
|
try {
|
|
353714
|
-
const result = await runWithHookReentrancy(hookEvent, hook, pluginRoot, () => execCommandHook(hook, hookEvent, hookName, jsonInput, abortSignal,
|
|
353867
|
+
const result = await runWithHookReentrancy(hookEvent, hook, pluginRoot, () => execCommandHook(hook, hookEvent, hookName, jsonInput, abortSignal, randomUUID38(), hookIndex, pluginRoot, pluginId));
|
|
353715
353868
|
cleanup?.();
|
|
353716
353869
|
if (result.aborted) {
|
|
353717
353870
|
logForDebugging3(`${hookName} [${hook.command}] cancelled`);
|
|
@@ -353807,7 +353960,7 @@ async function* executeTaskCreatedHooks(taskId, taskSubject, taskDescription, te
|
|
|
353807
353960
|
};
|
|
353808
353961
|
yield* executeHooks({
|
|
353809
353962
|
hookInput,
|
|
353810
|
-
toolUseID:
|
|
353963
|
+
toolUseID: randomUUID38(),
|
|
353811
353964
|
signal,
|
|
353812
353965
|
timeoutMs,
|
|
353813
353966
|
toolUseContext
|
|
@@ -353825,7 +353978,7 @@ async function* executeTaskCompletedHooks(taskId, taskSubject, taskDescription,
|
|
|
353825
353978
|
};
|
|
353826
353979
|
yield* executeHooks({
|
|
353827
353980
|
hookInput,
|
|
353828
|
-
toolUseID:
|
|
353981
|
+
toolUseID: randomUUID38(),
|
|
353829
353982
|
signal,
|
|
353830
353983
|
timeoutMs,
|
|
353831
353984
|
toolUseContext
|
|
@@ -353844,7 +353997,7 @@ async function* executeUserPromptSubmitHooks(prompt, permissionMode, toolUseCont
|
|
|
353844
353997
|
};
|
|
353845
353998
|
yield* executeHooks({
|
|
353846
353999
|
hookInput,
|
|
353847
|
-
toolUseID:
|
|
354000
|
+
toolUseID: randomUUID38(),
|
|
353848
354001
|
signal: toolUseContext.abortController.signal,
|
|
353849
354002
|
timeoutMs: TOOL_HOOK_EXECUTION_TIMEOUT_MS,
|
|
353850
354003
|
toolUseContext,
|
|
@@ -353861,7 +354014,7 @@ async function* executeSessionStartHooks(source, sessionId, agentType, model, si
|
|
|
353861
354014
|
};
|
|
353862
354015
|
yield* executeHooks({
|
|
353863
354016
|
hookInput,
|
|
353864
|
-
toolUseID:
|
|
354017
|
+
toolUseID: randomUUID38(),
|
|
353865
354018
|
matchQuery: source,
|
|
353866
354019
|
signal,
|
|
353867
354020
|
timeoutMs,
|
|
@@ -353878,7 +354031,7 @@ async function* executePreModelSwitchHooks(oldModel, newModel, source, signal, t
|
|
|
353878
354031
|
};
|
|
353879
354032
|
yield* executeHooks({
|
|
353880
354033
|
hookInput,
|
|
353881
|
-
toolUseID:
|
|
354034
|
+
toolUseID: randomUUID38(),
|
|
353882
354035
|
matchQuery: newModel,
|
|
353883
354036
|
signal,
|
|
353884
354037
|
timeoutMs
|
|
@@ -353894,7 +354047,7 @@ async function* executePostModelSwitchHooks(oldModel, newModel, source, signal,
|
|
|
353894
354047
|
};
|
|
353895
354048
|
yield* executeHooks({
|
|
353896
354049
|
hookInput,
|
|
353897
|
-
toolUseID:
|
|
354050
|
+
toolUseID: randomUUID38(),
|
|
353898
354051
|
matchQuery: newModel,
|
|
353899
354052
|
signal,
|
|
353900
354053
|
timeoutMs
|
|
@@ -353909,7 +354062,7 @@ async function* executeDirectoryAddedHooks(directory, source, signal, timeoutMs
|
|
|
353909
354062
|
};
|
|
353910
354063
|
yield* executeHooks({
|
|
353911
354064
|
hookInput,
|
|
353912
|
-
toolUseID:
|
|
354065
|
+
toolUseID: randomUUID38(),
|
|
353913
354066
|
matchQuery: directory,
|
|
353914
354067
|
signal,
|
|
353915
354068
|
timeoutMs
|
|
@@ -353923,7 +354076,7 @@ async function* executeMessageDisplayHooks(message, signal, timeoutMs = TOOL_HOO
|
|
|
353923
354076
|
};
|
|
353924
354077
|
yield* executeHooks({
|
|
353925
354078
|
hookInput,
|
|
353926
|
-
toolUseID:
|
|
354079
|
+
toolUseID: randomUUID38(),
|
|
353927
354080
|
matchQuery: undefined,
|
|
353928
354081
|
signal,
|
|
353929
354082
|
timeoutMs
|
|
@@ -353937,7 +354090,7 @@ async function* executeSetupHooks(trigger, signal, timeoutMs = TOOL_HOOK_EXECUTI
|
|
|
353937
354090
|
};
|
|
353938
354091
|
yield* executeHooks({
|
|
353939
354092
|
hookInput,
|
|
353940
|
-
toolUseID:
|
|
354093
|
+
toolUseID: randomUUID38(),
|
|
353941
354094
|
matchQuery: trigger,
|
|
353942
354095
|
signal,
|
|
353943
354096
|
timeoutMs,
|
|
@@ -353953,7 +354106,7 @@ async function* executeSubagentStartHooks(agentId, agentType, signal, timeoutMs
|
|
|
353953
354106
|
};
|
|
353954
354107
|
yield* executeHooks({
|
|
353955
354108
|
hookInput,
|
|
353956
|
-
toolUseID:
|
|
354109
|
+
toolUseID: randomUUID38(),
|
|
353957
354110
|
matchQuery: agentType,
|
|
353958
354111
|
signal,
|
|
353959
354112
|
timeoutMs
|
|
@@ -354321,7 +354474,7 @@ async function executeStatusLineCommand(statusLineInput, signal, timeoutMs = 500
|
|
|
354321
354474
|
const abortSignal = signal || AbortSignal.timeout(timeoutMs);
|
|
354322
354475
|
try {
|
|
354323
354476
|
const jsonInput = jsonStringify5(statusLineInput);
|
|
354324
|
-
const result = await execCommandHook(statusLine, "StatusLine", "statusLine", jsonInput, abortSignal,
|
|
354477
|
+
const result = await execCommandHook(statusLine, "StatusLine", "statusLine", jsonInput, abortSignal, randomUUID38());
|
|
354325
354478
|
if (result.aborted) {
|
|
354326
354479
|
return;
|
|
354327
354480
|
}
|
|
@@ -354365,7 +354518,7 @@ async function executeFileSuggestionCommand(fileSuggestionInput, signal, timeout
|
|
|
354365
354518
|
try {
|
|
354366
354519
|
const jsonInput = jsonStringify5(fileSuggestionInput);
|
|
354367
354520
|
const hook = { type: "command", command: fileSuggestion.command };
|
|
354368
|
-
const result = await execCommandHook(hook, "FileSuggestion", "FileSuggestion", jsonInput, abortSignal,
|
|
354521
|
+
const result = await execCommandHook(hook, "FileSuggestion", "FileSuggestion", jsonInput, abortSignal, randomUUID38());
|
|
354369
354522
|
if (result.aborted || result.status !== 0) {
|
|
354370
354523
|
return [];
|
|
354371
354524
|
}
|
|
@@ -359028,7 +359181,7 @@ var init_caches = __esm(() => {
|
|
|
359028
359181
|
});
|
|
359029
359182
|
|
|
359030
359183
|
// src/tui/commands/clear/conversation.ts
|
|
359031
|
-
import { randomUUID as
|
|
359184
|
+
import { randomUUID as randomUUID39 } from "crypto";
|
|
359032
359185
|
async function clearConversation({
|
|
359033
359186
|
setMessages,
|
|
359034
359187
|
readFileState,
|
|
@@ -359064,7 +359217,7 @@ async function clearConversation({
|
|
|
359064
359217
|
}
|
|
359065
359218
|
setMessages(() => []);
|
|
359066
359219
|
if (setConversationId) {
|
|
359067
|
-
setConversationId(
|
|
359220
|
+
setConversationId(randomUUID39());
|
|
359068
359221
|
}
|
|
359069
359222
|
clearSessionCaches(preservedAgentIds);
|
|
359070
359223
|
setCwd2(getOriginalCwd());
|
|
@@ -373777,11 +373930,11 @@ var init_editor = __esm(() => {
|
|
|
373777
373930
|
});
|
|
373778
373931
|
|
|
373779
373932
|
// src/tui/utils/tempfile.ts
|
|
373780
|
-
import { createHash as createHash11, randomUUID as
|
|
373933
|
+
import { createHash as createHash11, randomUUID as randomUUID40 } from "crypto";
|
|
373781
373934
|
import { tmpdir as tmpdir9 } from "os";
|
|
373782
373935
|
import { join as join144 } from "path";
|
|
373783
373936
|
function generateTempFilePath2(prefix = "atlas-prompt", extension = ".md", options) {
|
|
373784
|
-
const id = options?.contentHash ? createHash11("sha256").update(options.contentHash).digest("hex").slice(0, 16) :
|
|
373937
|
+
const id = options?.contentHash ? createHash11("sha256").update(options.contentHash).digest("hex").slice(0, 16) : randomUUID40();
|
|
373785
373938
|
return join144(tmpdir9(), `${prefix}-${id}${extension}`);
|
|
373786
373939
|
}
|
|
373787
373940
|
var init_tempfile = () => {};
|
|
@@ -406644,7 +406797,7 @@ __export(exports_branch, {
|
|
|
406644
406797
|
deriveFirstPrompt: () => deriveFirstPrompt,
|
|
406645
406798
|
getUniqueForkName: () => getUniqueForkName
|
|
406646
406799
|
});
|
|
406647
|
-
import { randomUUID as
|
|
406800
|
+
import { randomUUID as randomUUID41 } from "crypto";
|
|
406648
406801
|
import { mkdir as mkdir46, readFile as readFile55, writeFile as writeFile43 } from "fs/promises";
|
|
406649
406802
|
function deriveFirstPrompt(firstUserMessage) {
|
|
406650
406803
|
const content = firstUserMessage?.message?.content;
|
|
@@ -406656,7 +406809,7 @@ function deriveFirstPrompt(firstUserMessage) {
|
|
|
406656
406809
|
return raw.replace(/\s+/g, " ").trim().slice(0, 100) || "Branched conversation";
|
|
406657
406810
|
}
|
|
406658
406811
|
async function createFork(customTitle, target) {
|
|
406659
|
-
const forkSessionId =
|
|
406812
|
+
const forkSessionId = randomUUID41();
|
|
406660
406813
|
const originalSessionId = target?.sessionId ?? getSessionId();
|
|
406661
406814
|
const projectDir = getProjectDir3(getOriginalCwd());
|
|
406662
406815
|
const forkSessionPath = getTranscriptPathForSession3(forkSessionId);
|
|
@@ -435897,7 +436050,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
435897
436050
|
});
|
|
435898
436051
|
|
|
435899
436052
|
// src/tui/utils/plans.ts
|
|
435900
|
-
import { randomUUID as
|
|
436053
|
+
import { randomUUID as randomUUID42 } from "crypto";
|
|
435901
436054
|
import { copyFile as copyFile8, writeFile as writeFile50 } from "fs/promises";
|
|
435902
436055
|
import { join as join167, resolve as resolve57, sep as sep37 } from "path";
|
|
435903
436056
|
function getPlanSlug2(sessionId) {
|
|
@@ -436080,7 +436233,7 @@ async function persistFileSnapshotIfRemote() {
|
|
|
436080
436233
|
level: "info",
|
|
436081
436234
|
isMeta: true,
|
|
436082
436235
|
timestamp: new Date().toISOString(),
|
|
436083
|
-
uuid:
|
|
436236
|
+
uuid: randomUUID42(),
|
|
436084
436237
|
snapshotFiles
|
|
436085
436238
|
};
|
|
436086
436239
|
await Promise.resolve().then(() => init_sessionStorage());
|
|
@@ -437516,7 +437669,7 @@ var init_logging = __esm(() => {
|
|
|
437516
437669
|
});
|
|
437517
437670
|
|
|
437518
437671
|
// src/tui/utils/forkedAgent.ts
|
|
437519
|
-
import { randomUUID as
|
|
437672
|
+
import { randomUUID as randomUUID43 } from "crypto";
|
|
437520
437673
|
function getLastCacheSafeParams() {
|
|
437521
437674
|
return lastCacheSafeParams;
|
|
437522
437675
|
}
|
|
@@ -437622,7 +437775,7 @@ function createSubagentContext(parentContext, overrides) {
|
|
|
437622
437775
|
agentId: overrides?.agentId ?? createAgentId(),
|
|
437623
437776
|
agentType: overrides?.agentType,
|
|
437624
437777
|
queryTracking: {
|
|
437625
|
-
chainId:
|
|
437778
|
+
chainId: randomUUID43(),
|
|
437626
437779
|
depth: (parentContext.queryTracking?.depth ?? -1) + 1
|
|
437627
437780
|
},
|
|
437628
437781
|
fileReadingLimits: parentContext.fileReadingLimits,
|
|
@@ -439438,7 +439591,7 @@ var init_queryHelpers = __esm(() => {
|
|
|
439438
439591
|
});
|
|
439439
439592
|
|
|
439440
439593
|
// src/tui/services/PromptSuggestion/speculation.ts
|
|
439441
|
-
import { randomUUID as
|
|
439594
|
+
import { randomUUID as randomUUID44 } from "crypto";
|
|
439442
439595
|
import { rm as rm11 } from "fs";
|
|
439443
439596
|
import { appendFile as appendFile5, copyFile as copyFile9, mkdir as mkdir54 } from "fs/promises";
|
|
439444
439597
|
import { dirname as dirname77, isAbsolute as isAbsolute32, join as join170, relative as relative28 } from "path";
|
|
@@ -439587,7 +439740,7 @@ async function startSpeculation(suggestionText, context, setAppState, isPipeline
|
|
|
439587
439740
|
if (!isSpeculationEnabled())
|
|
439588
439741
|
return;
|
|
439589
439742
|
abortSpeculation(setAppState);
|
|
439590
|
-
const id =
|
|
439743
|
+
const id = randomUUID44().slice(0, 8);
|
|
439591
439744
|
const abortController = createChildAbortController2(context.toolUseContext.abortController);
|
|
439592
439745
|
if (abortController.signal.aborted)
|
|
439593
439746
|
return;
|
|
@@ -445681,7 +445834,7 @@ var init_useLogMessages = __esm(() => {
|
|
|
445681
445834
|
});
|
|
445682
445835
|
|
|
445683
445836
|
// src/tui/components/MessageSelector.tsx
|
|
445684
|
-
import { randomUUID as
|
|
445837
|
+
import { randomUUID as randomUUID45 } from "crypto";
|
|
445685
445838
|
import * as path26 from "path";
|
|
445686
445839
|
function isTextBlock2(block) {
|
|
445687
445840
|
return block.type === "text";
|
|
@@ -445701,7 +445854,7 @@ function MessageSelector({
|
|
|
445701
445854
|
const fileHistory = useAppState((s) => s.fileHistory);
|
|
445702
445855
|
const [error, setError] = import_react179.useState(undefined);
|
|
445703
445856
|
const isFileHistoryEnabled = fileHistoryEnabled();
|
|
445704
|
-
const currentUUID = import_react179.useMemo(
|
|
445857
|
+
const currentUUID = import_react179.useMemo(randomUUID45, []);
|
|
445705
445858
|
const messageOptions = import_react179.useMemo(() => [...messages.filter(selectableUserMessagesFilter), {
|
|
445706
445859
|
...createUserMessage2({
|
|
445707
445860
|
content: ""
|
|
@@ -451672,7 +451825,7 @@ var init_FileEditToolDiff = __esm(() => {
|
|
|
451672
451825
|
});
|
|
451673
451826
|
|
|
451674
451827
|
// src/tui/hooks/useDiffInIDE.ts
|
|
451675
|
-
import { randomUUID as
|
|
451828
|
+
import { randomUUID as randomUUID46 } from "crypto";
|
|
451676
451829
|
import { basename as basename52 } from "path";
|
|
451677
451830
|
function useDiffInIDE({
|
|
451678
451831
|
onChange,
|
|
@@ -451683,7 +451836,7 @@ function useDiffInIDE({
|
|
|
451683
451836
|
}) {
|
|
451684
451837
|
const isUnmounted = import_react191.useRef(false);
|
|
451685
451838
|
const [hasError, setHasError] = import_react191.useState(false);
|
|
451686
|
-
const sha = import_react191.useMemo(() =>
|
|
451839
|
+
const sha = import_react191.useMemo(() => randomUUID46().slice(0, 6), []);
|
|
451687
451840
|
const tabName = import_react191.useMemo(() => `✻ [Atlas] ${basename52(filePath)} (${sha}) ⧉`, [filePath, sha]);
|
|
451688
451841
|
const shouldShowDiffInIDE = hasAccessToIDEExtensionDiffFeature(toolUseContext.options.mcpClients) && getGlobalConfig().diffTool === "auto" && !filePath.endsWith(".ipynb");
|
|
451689
451842
|
const ideName = getConnectedIdeName(toolUseContext.options.mcpClients) ?? "IDE";
|
|
@@ -467287,7 +467440,7 @@ var init_teamDiscovery2 = __esm(() => {
|
|
|
467287
467440
|
});
|
|
467288
467441
|
|
|
467289
467442
|
// src/tui/components/teams/TeamsDialog.tsx
|
|
467290
|
-
import { randomUUID as
|
|
467443
|
+
import { randomUUID as randomUUID47 } from "crypto";
|
|
467291
467444
|
function TeamsDialog({
|
|
467292
467445
|
initialTeams,
|
|
467293
467446
|
onDone
|
|
@@ -467911,7 +468064,7 @@ async function killTeammate(paneId, backendType, teamName, teammateId, teammateN
|
|
|
467911
468064
|
},
|
|
467912
468065
|
inbox: {
|
|
467913
468066
|
messages: [...prev.inbox.messages, {
|
|
467914
|
-
id:
|
|
468067
|
+
id: randomUUID47(),
|
|
467915
468068
|
from: "system",
|
|
467916
468069
|
text: jsonStringify5({
|
|
467917
468070
|
type: "teammate_terminated",
|
|
@@ -473303,7 +473456,7 @@ var init_PromptInput = __esm(() => {
|
|
|
473303
473456
|
});
|
|
473304
473457
|
|
|
473305
473458
|
// src/tui/utils/hooks/apiQueryHookHelper.ts
|
|
473306
|
-
import { randomUUID as
|
|
473459
|
+
import { randomUUID as randomUUID48 } from "crypto";
|
|
473307
473460
|
function createApiQueryHook(config) {
|
|
473308
473461
|
return async (context) => {
|
|
473309
473462
|
try {
|
|
@@ -473311,7 +473464,7 @@ function createApiQueryHook(config) {
|
|
|
473311
473464
|
if (!shouldRun) {
|
|
473312
473465
|
return;
|
|
473313
473466
|
}
|
|
473314
|
-
const uuid =
|
|
473467
|
+
const uuid = randomUUID48();
|
|
473315
473468
|
const messages = config.buildMessages(context);
|
|
473316
473469
|
context.queryMessageCount = messages.length;
|
|
473317
473470
|
const systemPrompt = config.systemPrompt ? asSystemPrompt2([config.systemPrompt]) : context.systemPrompt;
|
|
@@ -476341,7 +476494,7 @@ var init_PermissionContext = __esm(() => {
|
|
|
476341
476494
|
});
|
|
476342
476495
|
|
|
476343
476496
|
// src/tui/hooks/toolPermission/handlers/interactiveHandler.ts
|
|
476344
|
-
import { randomUUID as
|
|
476497
|
+
import { randomUUID as randomUUID49 } from "crypto";
|
|
476345
476498
|
function handleInteractivePermission(params, resolve) {
|
|
476346
476499
|
const {
|
|
476347
476500
|
ctx,
|
|
@@ -476354,7 +476507,7 @@ function handleInteractivePermission(params, resolve) {
|
|
|
476354
476507
|
let userInteracted = false;
|
|
476355
476508
|
let checkmarkTransitionTimer;
|
|
476356
476509
|
let checkmarkAbortHandler;
|
|
476357
|
-
const bridgeRequestId = bridgeCallbacks ?
|
|
476510
|
+
const bridgeRequestId = bridgeCallbacks ? randomUUID49() : undefined;
|
|
476358
476511
|
const permissionPromptStartTimeMs = Date.now();
|
|
476359
476512
|
const displayInput = result.updatedInput ?? ctx.input;
|
|
476360
476513
|
function clearClassifierIndicator() {
|
|
@@ -477101,9 +477254,9 @@ function matchesKeepGoingKeyword(input) {
|
|
|
477101
477254
|
}
|
|
477102
477255
|
|
|
477103
477256
|
// src/tui/utils/processUserInput/processTextPrompt.ts
|
|
477104
|
-
import { randomUUID as
|
|
477257
|
+
import { randomUUID as randomUUID50 } from "crypto";
|
|
477105
477258
|
function processTextPrompt(input, imageContentBlocks, imagePasteIds, attachmentMessages, uuid, permissionMode, isMeta) {
|
|
477106
|
-
const promptId =
|
|
477259
|
+
const promptId = randomUUID50();
|
|
477107
477260
|
setPromptId(promptId);
|
|
477108
477261
|
const userPromptText = typeof input === "string" ? input : input.find((block) => block.type === "text")?.text || "";
|
|
477109
477262
|
startInteractionSpan(userPromptText);
|
|
@@ -477227,7 +477380,7 @@ var init_resolveDefaultShell = __esm(() => {
|
|
|
477227
477380
|
});
|
|
477228
477381
|
|
|
477229
477382
|
// src/tui/utils/processUserInput/processBashCommand.tsx
|
|
477230
|
-
import { randomUUID as
|
|
477383
|
+
import { randomUUID as randomUUID51 } from "crypto";
|
|
477231
477384
|
async function processBashCommand(inputString, precedingInputBlocks, attachmentMessages, context, setToolJSX) {
|
|
477232
477385
|
const usePowerShell = isPowerShellToolEnabled() && resolveDefaultShell() === "powershell";
|
|
477233
477386
|
const userMessage = createUserMessage2({
|
|
@@ -477288,7 +477441,7 @@ async function processBashCommand(inputString, precedingInputBlocks, attachmentM
|
|
|
477288
477441
|
const mapped = await processToolResultBlock(shellTool, {
|
|
477289
477442
|
...data,
|
|
477290
477443
|
stderr: ""
|
|
477291
|
-
},
|
|
477444
|
+
}, randomUUID51());
|
|
477292
477445
|
const stdout = typeof mapped.content === "string" ? mapped.content : escapeXml2(data.stdout);
|
|
477293
477446
|
return {
|
|
477294
477447
|
messages: [createSyntheticUserCaveatMessage(), userMessage, ...attachmentMessages, createUserMessage2({
|
|
@@ -477336,7 +477489,7 @@ var init_processBashCommand = __esm(() => {
|
|
|
477336
477489
|
});
|
|
477337
477490
|
|
|
477338
477491
|
// src/tui/utils/processUserInput/processUserInput.ts
|
|
477339
|
-
import { randomUUID as
|
|
477492
|
+
import { randomUUID as randomUUID52 } from "crypto";
|
|
477340
477493
|
async function processUserInput({
|
|
477341
477494
|
input,
|
|
477342
477495
|
preExpansionInput,
|
|
@@ -477385,7 +477538,7 @@ async function processUserInput({
|
|
|
477385
477538
|
type: "hook_additional_context",
|
|
477386
477539
|
content: hookResult.additionalContexts.map(applyTruncation),
|
|
477387
477540
|
hookName: "UserPromptSubmit",
|
|
477388
|
-
toolUseID: `hook-${
|
|
477541
|
+
toolUseID: `hook-${randomUUID52()}`,
|
|
477389
477542
|
hookEvent: "UserPromptSubmit"
|
|
477390
477543
|
}));
|
|
477391
477544
|
}
|
|
@@ -479184,7 +479337,7 @@ var init_sessionRestore = __esm(() => {
|
|
|
479184
479337
|
});
|
|
479185
479338
|
|
|
479186
479339
|
// src/tui/hooks/useInboxPoller.ts
|
|
479187
|
-
import { randomUUID as
|
|
479340
|
+
import { randomUUID as randomUUID53 } from "crypto";
|
|
479188
479341
|
function getAgentNameToPoll(appState) {
|
|
479189
479342
|
if (isInProcessTeammate()) {
|
|
479190
479343
|
return;
|
|
@@ -479618,7 +479771,7 @@ function useInboxPoller({
|
|
|
479618
479771
|
messages: [
|
|
479619
479772
|
...prev.inbox.messages,
|
|
479620
479773
|
{
|
|
479621
|
-
id:
|
|
479774
|
+
id: randomUUID53(),
|
|
479622
479775
|
from: "system",
|
|
479623
479776
|
text: jsonStringify5({
|
|
479624
479777
|
type: "teammate_terminated",
|
|
@@ -479658,7 +479811,7 @@ ${messageContent}
|
|
|
479658
479811
|
messages: [
|
|
479659
479812
|
...prev.inbox.messages,
|
|
479660
479813
|
...regularMessages.map((m) => ({
|
|
479661
|
-
id:
|
|
479814
|
+
id: randomUUID53(),
|
|
479662
479815
|
from: m.from,
|
|
479663
479816
|
text: m.text,
|
|
479664
479817
|
timestamp: m.timestamp,
|
|
@@ -486207,7 +486360,7 @@ import { spawnSync as spawnSync7 } from "child_process";
|
|
|
486207
486360
|
import { dirname as dirname85, join as join184 } from "path";
|
|
486208
486361
|
import { tmpdir as tmpdir12 } from "os";
|
|
486209
486362
|
import { writeFile as writeFile54 } from "fs/promises";
|
|
486210
|
-
import { randomUUID as
|
|
486363
|
+
import { randomUUID as randomUUID54 } from "crypto";
|
|
486211
486364
|
function _useMoreRightStub(_args) {
|
|
486212
486365
|
return {
|
|
486213
486366
|
onBeforeQuery: async () => true,
|
|
@@ -486944,7 +487097,7 @@ function REPL({
|
|
|
486944
487097
|
const [spinnerShimmerColor, setSpinnerShimmerColor] = import_react283.useState(null);
|
|
486945
487098
|
const [isMessageSelectorVisible, setIsMessageSelectorVisible] = import_react283.useState(false);
|
|
486946
487099
|
const [messageSelectorPreselect, setMessageSelectorPreselect] = import_react283.useState(undefined);
|
|
486947
|
-
const [conversationId, setConversationId] = import_react283.useState(
|
|
487100
|
+
const [conversationId, setConversationId] = import_react283.useState(randomUUID54());
|
|
486948
487101
|
const [idleReturnPending, setIdleReturnPending] = import_react283.useState(null);
|
|
486949
487102
|
const skipIdleCheckRef = import_react283.useRef(false);
|
|
486950
487103
|
const lastQueryCompletionTimeRef = import_react283.useRef(lastQueryCompletionTime);
|
|
@@ -487357,10 +487510,10 @@ function REPL({
|
|
|
487357
487510
|
if (feature("BRIDGE_MODE")) {
|
|
487358
487511
|
const bridgeCallbacks = store.getState().replBridgePermissionCallbacks;
|
|
487359
487512
|
if (bridgeCallbacks) {
|
|
487360
|
-
const bridgeRequestId =
|
|
487513
|
+
const bridgeRequestId = randomUUID54();
|
|
487361
487514
|
bridgeCallbacks.sendRequest(bridgeRequestId, SANDBOX_NETWORK_ACCESS_TOOL_NAME, {
|
|
487362
487515
|
host: hostPattern.host
|
|
487363
|
-
},
|
|
487516
|
+
}, randomUUID54(), `Allow network connection to ${hostPattern.host}?`);
|
|
487364
487517
|
const unsubscribe = bridgeCallbacks.onResponse(bridgeRequestId, (response) => {
|
|
487365
487518
|
unsubscribe();
|
|
487366
487519
|
const allow = response.behavior === "allow";
|
|
@@ -487631,7 +487784,7 @@ Error: sandbox required but unavailable: ${reason}
|
|
|
487631
487784
|
} else {
|
|
487632
487785
|
setMessages(() => [newMessage]);
|
|
487633
487786
|
}
|
|
487634
|
-
setConversationId(
|
|
487787
|
+
setConversationId(randomUUID54());
|
|
487635
487788
|
} else if (newMessage.type === "progress" && isEphemeralToolProgress2(newMessage.data.type)) {
|
|
487636
487789
|
setMessages((oldMessages) => {
|
|
487637
487790
|
const last = oldMessages.at(-1);
|
|
@@ -487710,7 +487863,7 @@ Error: sandbox required but unavailable: ${reason}
|
|
|
487710
487863
|
});
|
|
487711
487864
|
if (!shouldQuery) {
|
|
487712
487865
|
if (newMessages.some(isCompactBoundaryMessage2)) {
|
|
487713
|
-
setConversationId(
|
|
487866
|
+
setConversationId(randomUUID54());
|
|
487714
487867
|
}
|
|
487715
487868
|
resetLoadingState();
|
|
487716
487869
|
setAbortController(null);
|
|
@@ -488358,7 +488511,7 @@ ${serialized}`;
|
|
|
488358
488511
|
if (messageIndex === -1)
|
|
488359
488512
|
return;
|
|
488360
488513
|
setMessages(prev.slice(0, messageIndex));
|
|
488361
|
-
setConversationId(
|
|
488514
|
+
setConversationId(randomUUID54());
|
|
488362
488515
|
resetMicrocompactState();
|
|
488363
488516
|
if (feature("CONTEXT_COLLAPSE")) {
|
|
488364
488517
|
__toCommonJS(exports_contextCollapse).resetContextCollapse();
|
|
@@ -489519,7 +489672,7 @@ Note: ctrl + z now suspends AtlasCode, ctrl + _ undoes input.
|
|
|
489519
489672
|
} else {
|
|
489520
489673
|
setMessages(postCompact);
|
|
489521
489674
|
}
|
|
489522
|
-
setConversationId(
|
|
489675
|
+
setConversationId(randomUUID54());
|
|
489523
489676
|
runPostCompactCleanup(context.options.querySource);
|
|
489524
489677
|
if (direction === "from") {
|
|
489525
489678
|
const r = textForResubmit(message);
|
|
@@ -24,6 +24,7 @@ export declare const DEFAULT_MAX_PARSE_RECORDS = 100000;
|
|
|
24
24
|
export declare const HARD_MAX_PARSE_RECORDS = 500000;
|
|
25
25
|
export declare const DEFAULT_MAX_PROJECTION_BYTES: number;
|
|
26
26
|
export declare const HARD_MAX_PROJECTION_BYTES: number;
|
|
27
|
+
export declare const DEFAULT_MAX_FOLLOW_PROJECTION_BYTES: number;
|
|
27
28
|
export declare const TITLE_HEAD_BYTES: number;
|
|
28
29
|
/** wire 契约 title ≤512 code points(SessionSummarySchema)——钳制上限。 */
|
|
29
30
|
export declare const TITLE_MAX_CODE_POINTS = 512;
|
|
@@ -1252,6 +1252,7 @@ var DEFAULT_MAX_PARSE_RECORDS = 1e5;
|
|
|
1252
1252
|
var HARD_MAX_PARSE_RECORDS = 500000;
|
|
1253
1253
|
var DEFAULT_MAX_PROJECTION_BYTES = 4 * MIB;
|
|
1254
1254
|
var HARD_MAX_PROJECTION_BYTES = 16 * MIB;
|
|
1255
|
+
var DEFAULT_MAX_FOLLOW_PROJECTION_BYTES = 16 * MIB;
|
|
1255
1256
|
var TITLE_HEAD_BYTES = 64 * 1024;
|
|
1256
1257
|
var TITLE_MAX_CODE_POINTS = 512;
|
|
1257
1258
|
var TITLE_USER_MESSAGE_CODE_POINTS = 120;
|
|
@@ -1261,7 +1262,7 @@ var DEFAULT_MAX_CONCURRENT_READS = 4;
|
|
|
1261
1262
|
var HARD_MAX_CONCURRENT_READS = 16;
|
|
1262
1263
|
var DEFAULT_MAX_PENDING_EVENTS = 8;
|
|
1263
1264
|
var HARD_MAX_PENDING_EVENTS = 32;
|
|
1264
|
-
var DEFAULT_MAX_PENDING_BYTES =
|
|
1265
|
+
var DEFAULT_MAX_PENDING_BYTES = 16 * MIB;
|
|
1265
1266
|
var HARD_MAX_PENDING_BYTES = 32 * MIB;
|
|
1266
1267
|
var DEFAULT_POLLING_INTERVAL_MS = 1000;
|
|
1267
1268
|
var HARD_MIN_POLLING_INTERVAL_MS = 100;
|
|
@@ -1280,7 +1281,7 @@ var HARD_MIN_CLOSE_DEADLINE_MS = 1;
|
|
|
1280
1281
|
var HARD_MAX_CLOSE_DEADLINE_MS = 1e4;
|
|
1281
1282
|
var DEFAULT_LEDGER_CAPACITY = 128;
|
|
1282
1283
|
var HARD_MAX_LEDGER_CAPACITY = 1024;
|
|
1283
|
-
var DEFAULT_LEDGER_PAYLOAD_BYTES =
|
|
1284
|
+
var DEFAULT_LEDGER_PAYLOAD_BYTES = 32 * MIB;
|
|
1284
1285
|
var HARD_MAX_LEDGER_PAYLOAD_BYTES = 64 * MIB;
|
|
1285
1286
|
var READ_CHUNK_SIZE = 64 * 1024;
|
|
1286
1287
|
var PARSE_BATCH_SIZE = 256;
|
|
@@ -2948,7 +2949,7 @@ function createReadonlySessionRuntime(options) {
|
|
|
2948
2949
|
idleLeaseMs: L.idleLeaseMs,
|
|
2949
2950
|
pendingEvents: L.maxPendingEvents,
|
|
2950
2951
|
pendingBytes: L.maxPendingBytes,
|
|
2951
|
-
maxProjectionBytes:
|
|
2952
|
+
maxProjectionBytes: options.limits?.maxProjectionBytes ?? DEFAULT_MAX_FOLLOW_PROJECTION_BYTES,
|
|
2952
2953
|
maxRecordBytes: L.maxRecordBytes,
|
|
2953
2954
|
maxTranscriptBytes: L.maxTranscriptBytes
|
|
2954
2955
|
},
|
|
@@ -24,6 +24,7 @@ export declare const DEFAULT_MAX_PARSE_RECORDS = 100000;
|
|
|
24
24
|
export declare const HARD_MAX_PARSE_RECORDS = 500000;
|
|
25
25
|
export declare const DEFAULT_MAX_PROJECTION_BYTES: number;
|
|
26
26
|
export declare const HARD_MAX_PROJECTION_BYTES: number;
|
|
27
|
+
export declare const DEFAULT_MAX_FOLLOW_PROJECTION_BYTES: number;
|
|
27
28
|
export declare const TITLE_HEAD_BYTES: number;
|
|
28
29
|
/** wire 契约 title ≤512 code points(SessionSummarySchema)——钳制上限。 */
|
|
29
30
|
export declare const TITLE_MAX_CODE_POINTS = 512;
|
|
@@ -1252,6 +1252,7 @@ var DEFAULT_MAX_PARSE_RECORDS = 1e5;
|
|
|
1252
1252
|
var HARD_MAX_PARSE_RECORDS = 500000;
|
|
1253
1253
|
var DEFAULT_MAX_PROJECTION_BYTES = 4 * MIB;
|
|
1254
1254
|
var HARD_MAX_PROJECTION_BYTES = 16 * MIB;
|
|
1255
|
+
var DEFAULT_MAX_FOLLOW_PROJECTION_BYTES = 16 * MIB;
|
|
1255
1256
|
var TITLE_HEAD_BYTES = 64 * 1024;
|
|
1256
1257
|
var TITLE_MAX_CODE_POINTS = 512;
|
|
1257
1258
|
var TITLE_USER_MESSAGE_CODE_POINTS = 120;
|
|
@@ -1261,7 +1262,7 @@ var DEFAULT_MAX_CONCURRENT_READS = 4;
|
|
|
1261
1262
|
var HARD_MAX_CONCURRENT_READS = 16;
|
|
1262
1263
|
var DEFAULT_MAX_PENDING_EVENTS = 8;
|
|
1263
1264
|
var HARD_MAX_PENDING_EVENTS = 32;
|
|
1264
|
-
var DEFAULT_MAX_PENDING_BYTES =
|
|
1265
|
+
var DEFAULT_MAX_PENDING_BYTES = 16 * MIB;
|
|
1265
1266
|
var HARD_MAX_PENDING_BYTES = 32 * MIB;
|
|
1266
1267
|
var DEFAULT_POLLING_INTERVAL_MS = 1000;
|
|
1267
1268
|
var HARD_MIN_POLLING_INTERVAL_MS = 100;
|
|
@@ -1280,7 +1281,7 @@ var HARD_MIN_CLOSE_DEADLINE_MS = 1;
|
|
|
1280
1281
|
var HARD_MAX_CLOSE_DEADLINE_MS = 1e4;
|
|
1281
1282
|
var DEFAULT_LEDGER_CAPACITY = 128;
|
|
1282
1283
|
var HARD_MAX_LEDGER_CAPACITY = 1024;
|
|
1283
|
-
var DEFAULT_LEDGER_PAYLOAD_BYTES =
|
|
1284
|
+
var DEFAULT_LEDGER_PAYLOAD_BYTES = 32 * MIB;
|
|
1284
1285
|
var HARD_MAX_LEDGER_PAYLOAD_BYTES = 64 * MIB;
|
|
1285
1286
|
var READ_CHUNK_SIZE = 64 * 1024;
|
|
1286
1287
|
var PARSE_BATCH_SIZE = 256;
|
|
@@ -2948,7 +2949,7 @@ function createReadonlySessionRuntime(options) {
|
|
|
2948
2949
|
idleLeaseMs: L.idleLeaseMs,
|
|
2949
2950
|
pendingEvents: L.maxPendingEvents,
|
|
2950
2951
|
pendingBytes: L.maxPendingBytes,
|
|
2951
|
-
maxProjectionBytes:
|
|
2952
|
+
maxProjectionBytes: options.limits?.maxProjectionBytes ?? DEFAULT_MAX_FOLLOW_PROJECTION_BYTES,
|
|
2952
2953
|
maxRecordBytes: L.maxRecordBytes,
|
|
2953
2954
|
maxTranscriptBytes: L.maxTranscriptBytes
|
|
2954
2955
|
},
|
|
@@ -8881,7 +8882,7 @@ function createExecutionKernel(options) {
|
|
|
8881
8882
|
}
|
|
8882
8883
|
emit(st, { workspaceId: ws, sessionId: s, turnId: turn.turnId }, "turn.delta", { text });
|
|
8883
8884
|
},
|
|
8884
|
-
requestApproval: () => {
|
|
8885
|
+
requestApproval: (req) => {
|
|
8885
8886
|
const approvalId = `appr-${++approvalCounter}`;
|
|
8886
8887
|
return new Promise((resolve) => {
|
|
8887
8888
|
const approval = {
|
|
@@ -8895,7 +8896,15 @@ function createExecutionKernel(options) {
|
|
|
8895
8896
|
resolve
|
|
8896
8897
|
};
|
|
8897
8898
|
approvals.set(approvalId, approval);
|
|
8898
|
-
emit(st, { workspaceId: ws, sessionId: s, turnId: turn.turnId }, "approval.requested", {
|
|
8899
|
+
emit(st, { workspaceId: ws, sessionId: s, turnId: turn.turnId }, "approval.requested", {
|
|
8900
|
+
approvalId,
|
|
8901
|
+
toolName: req?.toolName ?? "unknown",
|
|
8902
|
+
actionDigest: req?.actionDigest ?? {},
|
|
8903
|
+
workspaceId: ws,
|
|
8904
|
+
turnId: turn.turnId,
|
|
8905
|
+
requestedAt: approval.requestedAt,
|
|
8906
|
+
sourceLane: "execution-upstream"
|
|
8907
|
+
});
|
|
8899
8908
|
approval.timer = setTimeout(() => {
|
|
8900
8909
|
settleApproval(approval, "expired");
|
|
8901
8910
|
}, approvalTimeoutMs);
|
|
@@ -33,8 +33,15 @@ export type ExecutionTurnRunnerDeps = {
|
|
|
33
33
|
};
|
|
34
34
|
text: string;
|
|
35
35
|
signal: AbortSignal;
|
|
36
|
-
/**
|
|
37
|
-
|
|
36
|
+
/**
|
|
37
|
+
* 注册待批操作:resolve 于 decide / 300s expired / turn 取消(voidedByCancel)。
|
|
38
|
+
* 0.1.129 C2-a(呈批书 §1,批复 @af5684e9):参数加性 optional(既有零参
|
|
39
|
+
* 调用点零破坏)——req 载入 approval.requested 七字段事件(C2-b)。
|
|
40
|
+
*/
|
|
41
|
+
requestApproval: (req?: {
|
|
42
|
+
toolName?: string;
|
|
43
|
+
actionDigest?: Record<string, unknown>;
|
|
44
|
+
}) => Promise<ExecutionApprovalDecision>;
|
|
38
45
|
/**
|
|
39
46
|
* 回合流增量发射(B1 前置件形 1,f4 附条件采认 @2026-11-21):经 kernel
|
|
40
47
|
* 既有 emit 权威落 `turn.delta`(cursor 单调/bind 三元组/缓冲上限同执法,
|
package/package.json
CHANGED