@cnwenf/occ 2.1.292 → 2.1.294
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/README.zh-CN.md +2 -2
- package/dist/cli.js +560 -272
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
globalThis.MACRO={"VERSION":"2.1.
|
|
2
|
+
globalThis.MACRO={"VERSION":"2.1.294","BINARY_NAME":"occ","BUILD_TIME":"2026-08-06T04:37:11.915Z","FEEDBACK_CHANNEL":"","ISSUES_EXPLAINER":"","NATIVE_PACKAGE_URL":"","PACKAGE_URL":"@cnwenf/occ","VERSION_CHANGELOG":""};
|
|
3
3
|
// @bun
|
|
4
4
|
var __create = Object.create;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
@@ -359985,9 +359985,7 @@ function collectCommands(node, commands7, varScope) {
|
|
|
359985
359985
|
loopVar = child.text;
|
|
359986
359986
|
} else if (child.type === "do_group") {
|
|
359987
359987
|
doGroup = child;
|
|
359988
|
-
} else if (child.type === "for" || child.type === "in" || child.type === "select" || child.type === ";") {
|
|
359989
|
-
continue;
|
|
359990
|
-
} else if (child.type === "command_substitution") {
|
|
359988
|
+
} else if (child.type === "for" || child.type === "in" || child.type === "select" || child.type === ";") {} else if (child.type === "command_substitution") {
|
|
359991
359989
|
const err2 = collectCommandSubstitution(child, commands7, varScope);
|
|
359992
359990
|
if (err2)
|
|
359993
359991
|
return err2;
|
|
@@ -360100,15 +360098,24 @@ function collectCommands(node, commands7, varScope) {
|
|
|
360100
360098
|
return null;
|
|
360101
360099
|
}
|
|
360102
360100
|
if (node.type === "test_command") {
|
|
360101
|
+
const inBracketBracket = node.children.some((c9) => c9?.type === "[[");
|
|
360102
|
+
const gapErr = checkTestCommandUnparsedBytes(node, inBracketBracket);
|
|
360103
|
+
if (gapErr)
|
|
360104
|
+
return gapErr;
|
|
360103
360105
|
const argv = ["[["];
|
|
360104
360106
|
for (const child of node.children) {
|
|
360105
360107
|
if (!child)
|
|
360106
360108
|
continue;
|
|
360107
|
-
if (child.type === "[[" || child.type === "]]")
|
|
360108
|
-
|
|
360109
|
-
|
|
360109
|
+
if (child.type === "[[" || child.type === "]]" || child.type === "[" || child.type === "]") {
|
|
360110
|
+
if (child.text === "") {
|
|
360111
|
+
return {
|
|
360112
|
+
kind: "too-complex",
|
|
360113
|
+
reason: "test_command early-close (quote in operator position)"
|
|
360114
|
+
};
|
|
360115
|
+
}
|
|
360110
360116
|
continue;
|
|
360111
|
-
|
|
360117
|
+
}
|
|
360118
|
+
const err2 = walkTestExpr(child, argv, commands7, varScope, inBracketBracket);
|
|
360112
360119
|
if (err2)
|
|
360113
360120
|
return err2;
|
|
360114
360121
|
}
|
|
@@ -360144,16 +360151,104 @@ function collectCommands(node, commands7, varScope) {
|
|
|
360144
360151
|
}
|
|
360145
360152
|
return tooComplex(node);
|
|
360146
360153
|
}
|
|
360147
|
-
function
|
|
360154
|
+
function isWhitespaceOrCommentGap(text2, inBracketBracket) {
|
|
360155
|
+
let i6 = 0;
|
|
360156
|
+
while (i6 < text2.length) {
|
|
360157
|
+
const ch2 = text2[i6];
|
|
360158
|
+
if (ch2 === " " || ch2 === "\t") {
|
|
360159
|
+
i6++;
|
|
360160
|
+
continue;
|
|
360161
|
+
}
|
|
360162
|
+
if (ch2 === "\\" && text2[i6 + 1] === `
|
|
360163
|
+
`) {
|
|
360164
|
+
i6 += 2;
|
|
360165
|
+
continue;
|
|
360166
|
+
}
|
|
360167
|
+
if (inBracketBracket && ch2 === `
|
|
360168
|
+
`) {
|
|
360169
|
+
i6++;
|
|
360170
|
+
continue;
|
|
360171
|
+
}
|
|
360172
|
+
if (inBracketBracket && ch2 === "#") {
|
|
360173
|
+
i6++;
|
|
360174
|
+
while (i6 < text2.length && text2[i6] !== `
|
|
360175
|
+
`)
|
|
360176
|
+
i6++;
|
|
360177
|
+
continue;
|
|
360178
|
+
}
|
|
360179
|
+
return false;
|
|
360180
|
+
}
|
|
360181
|
+
return true;
|
|
360182
|
+
}
|
|
360183
|
+
function checkTestCommandUnparsedBytes(node, inBracketBracket) {
|
|
360184
|
+
const bytes = Buffer.from(node.text, "utf8");
|
|
360185
|
+
let cursor = node.startIndex;
|
|
360186
|
+
for (const child of node.children) {
|
|
360187
|
+
if (!child)
|
|
360188
|
+
continue;
|
|
360189
|
+
if (child.endIndex > node.endIndex || child.startIndex < node.startIndex) {
|
|
360190
|
+
return {
|
|
360191
|
+
kind: "too-complex",
|
|
360192
|
+
reason: "Test command child extends past the node span \u2014 gap byte accounting is untrustworthy"
|
|
360193
|
+
};
|
|
360194
|
+
}
|
|
360195
|
+
if (child.startIndex > cursor) {
|
|
360196
|
+
const gap = bytes.subarray(cursor - node.startIndex, child.startIndex - node.startIndex).toString("utf8");
|
|
360197
|
+
if (!isWhitespaceOrCommentGap(gap, inBracketBracket)) {
|
|
360198
|
+
return {
|
|
360199
|
+
kind: "too-complex",
|
|
360200
|
+
reason: "Test command has unparsed bytes between children \u2014 parser dropped content that shell will see"
|
|
360201
|
+
};
|
|
360202
|
+
}
|
|
360203
|
+
}
|
|
360204
|
+
cursor = Math.max(cursor, child.endIndex);
|
|
360205
|
+
if (TEST_EXPR_TYPES.has(child.type)) {
|
|
360206
|
+
const err2 = checkTestCommandUnparsedBytes(child, inBracketBracket);
|
|
360207
|
+
if (err2)
|
|
360208
|
+
return err2;
|
|
360209
|
+
}
|
|
360210
|
+
}
|
|
360211
|
+
if (cursor < node.endIndex) {
|
|
360212
|
+
const tail = bytes.subarray(cursor - node.startIndex).toString("utf8");
|
|
360213
|
+
if (!isWhitespaceOrCommentGap(tail, inBracketBracket)) {
|
|
360214
|
+
return {
|
|
360215
|
+
kind: "too-complex",
|
|
360216
|
+
reason: "Test command has unparsed bytes after its last child \u2014 parser dropped content that shell will see"
|
|
360217
|
+
};
|
|
360218
|
+
}
|
|
360219
|
+
}
|
|
360220
|
+
return null;
|
|
360221
|
+
}
|
|
360222
|
+
function containsStandaloneBracketCloser(text2) {
|
|
360223
|
+
const masked = text2.replace(/\[(?::[a-zA-Z]+:|=[A-Za-z0-9-]*=|\.[A-Za-z0-9-]*\.|[!^]?)\]\](?!\])/g, "\x00");
|
|
360224
|
+
const wordChar = /[A-Za-z0-9_]/;
|
|
360225
|
+
let idx = masked.indexOf("]]");
|
|
360226
|
+
while (idx !== -1) {
|
|
360227
|
+
const before = idx > 0 ? masked[idx - 1] : "";
|
|
360228
|
+
const after = idx + 2 < masked.length ? masked[idx + 2] : "";
|
|
360229
|
+
if (!(wordChar.test(before) && wordChar.test(after)))
|
|
360230
|
+
return true;
|
|
360231
|
+
idx = masked.indexOf("]]", idx + 1);
|
|
360232
|
+
}
|
|
360233
|
+
return false;
|
|
360234
|
+
}
|
|
360235
|
+
function walkTestExpr(node, argv, innerCommands, varScope, inBracketBracket) {
|
|
360148
360236
|
switch (node.type) {
|
|
360149
360237
|
case "unary_expression":
|
|
360150
360238
|
case "binary_expression":
|
|
360151
360239
|
case "negated_expression":
|
|
360152
360240
|
case "parenthesized_expression": {
|
|
360153
|
-
for (
|
|
360241
|
+
for (let i6 = 0;i6 < node.children.length; i6++) {
|
|
360242
|
+
const c9 = node.children[i6];
|
|
360154
360243
|
if (!c9)
|
|
360155
360244
|
continue;
|
|
360156
|
-
|
|
360245
|
+
if ((c9.type === "simple_expansion" || c9.type === "expansion") && (node.children[i6 + 1]?.text.startsWith("[") || /^:[a-zA-Z&]/.test(node.children[i6 + 1]?.text ?? "") || c9.children.some((cc) => cc?.type === "special_variable_name") && /^\w*(\[|:[a-zA-Z&])/.test(node.children[i6 + 1]?.text ?? ""))) {
|
|
360246
|
+
return {
|
|
360247
|
+
kind: "too-complex",
|
|
360248
|
+
reason: "zsh $name[expr] / $name:mod in [[ ]] operand \u2014 recursive eval"
|
|
360249
|
+
};
|
|
360250
|
+
}
|
|
360251
|
+
const err2 = walkTestExpr(c9, argv, innerCommands, varScope, inBracketBracket);
|
|
360157
360252
|
if (err2)
|
|
360158
360253
|
return err2;
|
|
360159
360254
|
}
|
|
@@ -360171,16 +360266,132 @@ function walkTestExpr(node, argv, innerCommands, varScope) {
|
|
|
360171
360266
|
case "<":
|
|
360172
360267
|
case ">":
|
|
360173
360268
|
case "=~":
|
|
360269
|
+
if (node.text === "") {
|
|
360270
|
+
return {
|
|
360271
|
+
kind: "too-complex",
|
|
360272
|
+
reason: "Test command has a synthesized zero-width token \u2014 parser diverged from shell"
|
|
360273
|
+
};
|
|
360274
|
+
}
|
|
360174
360275
|
argv.push(node.text);
|
|
360175
360276
|
return null;
|
|
360176
360277
|
case "regex":
|
|
360177
|
-
case "extglob_pattern":
|
|
360278
|
+
case "extglob_pattern": {
|
|
360279
|
+
if (/\$[({[\w#?!*@$'"+~^=-]|`|[<>]\(/.test(node.text)) {
|
|
360280
|
+
return {
|
|
360281
|
+
kind: "too-complex",
|
|
360282
|
+
reason: `[[ ]] ${node.type} contains expansion / command / process substitution`,
|
|
360283
|
+
nodeType: node.type
|
|
360284
|
+
};
|
|
360285
|
+
}
|
|
360286
|
+
if (node.type === "extglob_pattern") {
|
|
360287
|
+
const text2 = node.text;
|
|
360288
|
+
let i6 = 0;
|
|
360289
|
+
while (i6 < text2.length) {
|
|
360290
|
+
if (text2[i6] === "\\" && i6 + 1 < text2.length) {
|
|
360291
|
+
i6 += 2;
|
|
360292
|
+
continue;
|
|
360293
|
+
}
|
|
360294
|
+
if (text2[i6] === "&") {
|
|
360295
|
+
return {
|
|
360296
|
+
kind: "too-complex",
|
|
360297
|
+
reason: "[[ ]] pattern contains unquoted & (zsh splits the word at & at any depth)"
|
|
360298
|
+
};
|
|
360299
|
+
}
|
|
360300
|
+
i6++;
|
|
360301
|
+
}
|
|
360302
|
+
}
|
|
360303
|
+
if (node.type === "regex") {
|
|
360304
|
+
const text2 = node.text;
|
|
360305
|
+
let parenDepth = 0;
|
|
360306
|
+
let i6 = 0;
|
|
360307
|
+
while (i6 < text2.length) {
|
|
360308
|
+
const ch2 = text2[i6];
|
|
360309
|
+
if (ch2 === "\\" && i6 + 1 < text2.length) {
|
|
360310
|
+
i6 += 2;
|
|
360311
|
+
continue;
|
|
360312
|
+
}
|
|
360313
|
+
if (parenDepth === 0 && ch2 === "|" && text2[i6 + 1] === ch2) {
|
|
360314
|
+
return {
|
|
360315
|
+
kind: "too-complex",
|
|
360316
|
+
reason: "[[ ]] regex contains glued || (zsh splits it as a cond operator)",
|
|
360317
|
+
nodeType: node.type
|
|
360318
|
+
};
|
|
360319
|
+
}
|
|
360320
|
+
if (ch2 === "&") {
|
|
360321
|
+
return {
|
|
360322
|
+
kind: "too-complex",
|
|
360323
|
+
reason: "[[ ]] regex contains unquoted & (zsh splits the word at & at any depth)",
|
|
360324
|
+
nodeType: node.type
|
|
360325
|
+
};
|
|
360326
|
+
}
|
|
360327
|
+
if (ch2 === '"' || ch2 === "'") {
|
|
360328
|
+
const quote2 = ch2;
|
|
360329
|
+
i6++;
|
|
360330
|
+
while (i6 < text2.length && text2[i6] !== quote2) {
|
|
360331
|
+
if (quote2 === '"' && text2[i6] === "\\" && i6 + 1 < text2.length) {
|
|
360332
|
+
i6++;
|
|
360333
|
+
}
|
|
360334
|
+
i6++;
|
|
360335
|
+
}
|
|
360336
|
+
if (i6 < text2.length)
|
|
360337
|
+
i6++;
|
|
360338
|
+
continue;
|
|
360339
|
+
}
|
|
360340
|
+
if (ch2 === "(") {
|
|
360341
|
+
parenDepth++;
|
|
360342
|
+
} else if (ch2 === ")") {
|
|
360343
|
+
parenDepth--;
|
|
360344
|
+
if (parenDepth < 0) {
|
|
360345
|
+
return {
|
|
360346
|
+
kind: "too-complex",
|
|
360347
|
+
reason: "[[ ]] regex has unbalanced parentheses (parser desync)",
|
|
360348
|
+
nodeType: node.type
|
|
360349
|
+
};
|
|
360350
|
+
}
|
|
360351
|
+
}
|
|
360352
|
+
i6++;
|
|
360353
|
+
}
|
|
360354
|
+
if (parenDepth !== 0) {
|
|
360355
|
+
return {
|
|
360356
|
+
kind: "too-complex",
|
|
360357
|
+
reason: "[[ ]] regex has unbalanced parentheses (parser desync)",
|
|
360358
|
+
nodeType: node.type
|
|
360359
|
+
};
|
|
360360
|
+
}
|
|
360361
|
+
}
|
|
360362
|
+
if (node.text.includes("&&")) {
|
|
360363
|
+
return {
|
|
360364
|
+
kind: "too-complex",
|
|
360365
|
+
reason: "[[ ]] pattern leaf contains `&&` \u2014 shell cond-lexer divergence (zsh splits the word there)",
|
|
360366
|
+
nodeType: node.type
|
|
360367
|
+
};
|
|
360368
|
+
}
|
|
360369
|
+
if (containsStandaloneBracketCloser(node.text)) {
|
|
360370
|
+
return {
|
|
360371
|
+
kind: "too-complex",
|
|
360372
|
+
reason: "[[ ]] pattern leaf contains a potential standalone `]]` closer \u2014 shell cond-lexer divergence (zsh may close the conditional early)",
|
|
360373
|
+
nodeType: node.type
|
|
360374
|
+
};
|
|
360375
|
+
}
|
|
360178
360376
|
argv.push(node.text);
|
|
360179
360377
|
return null;
|
|
360378
|
+
}
|
|
360379
|
+
case "test_rhs_missing":
|
|
360380
|
+
return {
|
|
360381
|
+
kind: "too-complex",
|
|
360382
|
+
reason: "Test command comparison is missing its right-hand side \u2014 parser dropped consumed bytes"
|
|
360383
|
+
};
|
|
360180
360384
|
default: {
|
|
360181
360385
|
const arg = walkArgument(node, innerCommands, varScope);
|
|
360182
360386
|
if (typeof arg !== "string")
|
|
360183
360387
|
return arg;
|
|
360388
|
+
if (inBracketBracket && (containsStandaloneBracketCloser(arg) || containsStandaloneBracketCloser(node.text)) || /]].*[;\n&|<>]/s.test(arg)) {
|
|
360389
|
+
return {
|
|
360390
|
+
kind: "too-complex",
|
|
360391
|
+
reason: inBracketBracket ? "[[ ]] quoted operand contains `]]` closer or `]]`+separator bytes \u2014 possible parser quote-state desync" : "test command quoted operand contains `]]`+separator bytes \u2014 possible parser quote-state desync",
|
|
360392
|
+
nodeType: node.type
|
|
360393
|
+
};
|
|
360394
|
+
}
|
|
360184
360395
|
argv.push(arg);
|
|
360185
360396
|
return null;
|
|
360186
360397
|
}
|
|
@@ -360618,7 +360829,6 @@ function walkVariableAssignment(node, innerCommands, varScope) {
|
|
|
360618
360829
|
name3 = child.text;
|
|
360619
360830
|
} else if (child.type === "=" || child.type === "+=") {
|
|
360620
360831
|
isAppend = child.type === "+=";
|
|
360621
|
-
continue;
|
|
360622
360832
|
} else if (child.type === "command_substitution") {
|
|
360623
360833
|
const err2 = collectCommandSubstitution(child, innerCommands, varScope);
|
|
360624
360834
|
if (err2)
|
|
@@ -360675,7 +360885,7 @@ function walkVariableAssignment(node, innerCommands, varScope) {
|
|
|
360675
360885
|
if (!/^[A-Za-z0-9 _+:./=[\]-]*$/.test(value.replace(/\$\{[A-Za-z_][A-Za-z0-9_]*\}/g, ""))) {
|
|
360676
360886
|
return {
|
|
360677
360887
|
kind: "too-complex",
|
|
360678
|
-
reason:
|
|
360888
|
+
reason: `PS4 value outside safe charset \u2014 only \${VAR} refs and [A-Za-z0-9 _+:.=/[]-] allowed`,
|
|
360679
360889
|
nodeType: "variable_assignment"
|
|
360680
360890
|
};
|
|
360681
360891
|
}
|
|
@@ -361031,7 +361241,7 @@ function checkSemantics(commands7) {
|
|
|
361031
361241
|
}
|
|
361032
361242
|
return { ok: true };
|
|
361033
361243
|
}
|
|
361034
|
-
var STRUCTURAL_TYPES, SEPARATOR_TYPES, CMDSUB_PLACEHOLDER = "__CMDSUB_OUTPUT__", VAR_PLACEHOLDER = "__TRACKED_VAR__", BARE_VAR_UNSAFE_RE, STDBUF_SHORT_SEP_RE, STDBUF_SHORT_FUSED_RE, STDBUF_LONG_RE, SAFE_ENV_VARS, SPECIAL_VAR_NAMES, DANGEROUS_TYPES, DANGEROUS_TYPE_IDS, REDIRECT_OPS, BRACE_EXPANSION_RE, CONTROL_CHAR_RE, UNICODE_WHITESPACE_RE, BACKSLASH_WHITESPACE_RE, ZSH_TILDE_BRACKET_RE, ZSH_EQUALS_EXPANSION_RE, BRACE_WITH_QUOTE_RE, DOLLAR, ARITH_LEAF_RE, ZSH_DANGEROUS_BUILTINS, EVAL_LIKE_BUILTINS, SUBSCRIPT_EVAL_FLAGS, TEST_ARITH_CMP_OPS, BARE_SUBSCRIPT_NAME_BUILTINS, READ_DATA_FLAGS, PROC_ENVIRON_RE, NEWLINE_HASH_RE;
|
|
361244
|
+
var STRUCTURAL_TYPES, SEPARATOR_TYPES, CMDSUB_PLACEHOLDER = "__CMDSUB_OUTPUT__", VAR_PLACEHOLDER = "__TRACKED_VAR__", BARE_VAR_UNSAFE_RE, STDBUF_SHORT_SEP_RE, STDBUF_SHORT_FUSED_RE, STDBUF_LONG_RE, SAFE_ENV_VARS, SPECIAL_VAR_NAMES, DANGEROUS_TYPES, DANGEROUS_TYPE_IDS, REDIRECT_OPS, BRACE_EXPANSION_RE, CONTROL_CHAR_RE, UNICODE_WHITESPACE_RE, BACKSLASH_WHITESPACE_RE, ZSH_TILDE_BRACKET_RE, ZSH_EQUALS_EXPANSION_RE, BRACE_WITH_QUOTE_RE, DOLLAR, TEST_EXPR_TYPES, ARITH_LEAF_RE, ZSH_DANGEROUS_BUILTINS, EVAL_LIKE_BUILTINS, SUBSCRIPT_EVAL_FLAGS, TEST_ARITH_CMP_OPS, BARE_SUBSCRIPT_NAME_BUILTINS, READ_DATA_FLAGS, PROC_ENVIRON_RE, NEWLINE_HASH_RE;
|
|
361035
361245
|
var init_ast = __esm(() => {
|
|
361036
361246
|
init_bashParser();
|
|
361037
361247
|
init_parser5();
|
|
@@ -361117,6 +361327,12 @@ var init_ast = __esm(() => {
|
|
|
361117
361327
|
ZSH_EQUALS_EXPANSION_RE = /(?:^|[\s;&|])=[a-zA-Z_]/;
|
|
361118
361328
|
BRACE_WITH_QUOTE_RE = /\{[^}]*['"]/;
|
|
361119
361329
|
DOLLAR = String.fromCharCode(36);
|
|
361330
|
+
TEST_EXPR_TYPES = new Set([
|
|
361331
|
+
"unary_expression",
|
|
361332
|
+
"binary_expression",
|
|
361333
|
+
"negated_expression",
|
|
361334
|
+
"parenthesized_expression"
|
|
361335
|
+
]);
|
|
361120
361336
|
ARITH_LEAF_RE = /^(?:[0-9]+|0[xX][0-9a-fA-F]+|[0-9]+#[0-9a-zA-Z]+|[-+*/%^&|~!<>=?:(),]+|<<|>>|\*\*|&&|\|\||[<>=!]=|\$\(\(|\)\))$/;
|
|
361121
361337
|
ZSH_DANGEROUS_BUILTINS = new Set([
|
|
361122
361338
|
"zmodload",
|
|
@@ -362031,6 +362247,7 @@ var init_killShellTasks = __esm(() => {
|
|
|
362031
362247
|
});
|
|
362032
362248
|
|
|
362033
362249
|
// src/tasks/LocalShellTask/LocalShellTask.tsx
|
|
362250
|
+
import { statSync as statSync12 } from "fs";
|
|
362034
362251
|
import { stat as stat21 } from "fs/promises";
|
|
362035
362252
|
function looksLikePrompt(tail) {
|
|
362036
362253
|
const lastLine2 = tail.trimEnd().split(`
|
|
@@ -362091,6 +362308,16 @@ The command is likely blocked on an interactive prompt. Kill this task and re-ru
|
|
|
362091
362308
|
clearInterval(timer);
|
|
362092
362309
|
};
|
|
362093
362310
|
}
|
|
362311
|
+
function monitorCompletedSummary(description, exitCode, outputBytes) {
|
|
362312
|
+
return outputBytes === 0 ? `Monitor "${description}" ended without producing output${exitCode !== undefined ? ` (exit ${exitCode})` : ""}` : `Monitor "${description}" stream ended`;
|
|
362313
|
+
}
|
|
362314
|
+
function readMonitorOutputBytes(outputPath) {
|
|
362315
|
+
try {
|
|
362316
|
+
return statSync12(outputPath).size;
|
|
362317
|
+
} catch (e4) {
|
|
362318
|
+
return e4.code === "ENOENT" ? 0 : undefined;
|
|
362319
|
+
}
|
|
362320
|
+
}
|
|
362094
362321
|
function enqueueShellNotification(taskId, description, status, exitCode, setAppState, toolUseId, kind = "bash", agentId) {
|
|
362095
362322
|
let shouldEnqueue = false;
|
|
362096
362323
|
updateTaskState(taskId, setAppState, (task) => {
|
|
@@ -362107,12 +362334,15 @@ function enqueueShellNotification(taskId, description, status, exitCode, setAppS
|
|
|
362107
362334
|
return;
|
|
362108
362335
|
}
|
|
362109
362336
|
abortSpeculation(setAppState);
|
|
362337
|
+
const outputPath = getTaskOutputPath(taskId);
|
|
362110
362338
|
let summary;
|
|
362111
362339
|
if (feature("MONITOR_TOOL") && kind === "monitor") {
|
|
362112
362340
|
switch (status) {
|
|
362113
|
-
case "completed":
|
|
362114
|
-
|
|
362341
|
+
case "completed": {
|
|
362342
|
+
const outputBytes = readMonitorOutputBytes(outputPath);
|
|
362343
|
+
summary = monitorCompletedSummary(description, exitCode, outputBytes);
|
|
362115
362344
|
break;
|
|
362345
|
+
}
|
|
362116
362346
|
case "failed":
|
|
362117
362347
|
summary = `Monitor "${description}" script failed${exitCode !== undefined ? ` (exit ${exitCode})` : ""}`;
|
|
362118
362348
|
break;
|
|
@@ -362133,7 +362363,6 @@ function enqueueShellNotification(taskId, description, status, exitCode, setAppS
|
|
|
362133
362363
|
break;
|
|
362134
362364
|
}
|
|
362135
362365
|
}
|
|
362136
|
-
const outputPath = getTaskOutputPath(taskId);
|
|
362137
362366
|
const toolUseIdLine = toolUseId ? `
|
|
362138
362367
|
<${TOOL_USE_ID_TAG}>${toolUseId}</${TOOL_USE_ID_TAG}>` : "";
|
|
362139
362368
|
const message = `<${TASK_NOTIFICATION_TAG}>
|
|
@@ -384281,6 +384510,42 @@ function hasUnsafeHelpManForm(command4) {
|
|
|
384281
384510
|
}
|
|
384282
384511
|
return false;
|
|
384283
384512
|
}
|
|
384513
|
+
function hasQuotedBracketCloserInConditional(command4) {
|
|
384514
|
+
if (!command4.includes("[["))
|
|
384515
|
+
return false;
|
|
384516
|
+
if (!command4.includes("]]"))
|
|
384517
|
+
return false;
|
|
384518
|
+
const isWordChar2 = (c9) => c9 !== undefined && /[A-Za-z0-9_]/.test(c9);
|
|
384519
|
+
let inSingle = false;
|
|
384520
|
+
let inDouble = false;
|
|
384521
|
+
for (let i6 = 0;i6 < command4.length; i6++) {
|
|
384522
|
+
const ch2 = command4[i6];
|
|
384523
|
+
if (ch2 === "\\" && !inSingle) {
|
|
384524
|
+
const next = command4[i6 + 1];
|
|
384525
|
+
const isEscape = !inDouble || next === "$" || next === "`" || next === '"' || next === "\\" || next === `
|
|
384526
|
+
`;
|
|
384527
|
+
if (isEscape && next !== undefined)
|
|
384528
|
+
i6++;
|
|
384529
|
+
continue;
|
|
384530
|
+
}
|
|
384531
|
+
if (ch2 === "'" && !inDouble) {
|
|
384532
|
+
inSingle = !inSingle;
|
|
384533
|
+
continue;
|
|
384534
|
+
}
|
|
384535
|
+
if (ch2 === '"' && !inSingle) {
|
|
384536
|
+
inDouble = !inDouble;
|
|
384537
|
+
continue;
|
|
384538
|
+
}
|
|
384539
|
+
if ((inSingle || inDouble) && ch2 === "]" && command4[i6 + 1] === "]") {
|
|
384540
|
+
const before = command4[i6 - 1];
|
|
384541
|
+
const after = command4[i6 + 2];
|
|
384542
|
+
if (!(isWordChar2(before) && isWordChar2(after)))
|
|
384543
|
+
return true;
|
|
384544
|
+
i6++;
|
|
384545
|
+
}
|
|
384546
|
+
}
|
|
384547
|
+
return false;
|
|
384548
|
+
}
|
|
384284
384549
|
async function bashToolHasPermission(input, context4, getCommandSubcommandPrefixFn = getCommandSubcommandPrefix) {
|
|
384285
384550
|
let appState = context4.getAppState();
|
|
384286
384551
|
{
|
|
@@ -384371,6 +384636,15 @@ async function bashToolHasPermission(input, context4, getCommandSubcommandPrefix
|
|
|
384371
384636
|
};
|
|
384372
384637
|
}
|
|
384373
384638
|
}
|
|
384639
|
+
{
|
|
384640
|
+
const mode = appState.toolPermissionContext.mode;
|
|
384641
|
+
if (mode !== "bypassPermissions" && hasQuotedBracketCloserInConditional(input.command)) {
|
|
384642
|
+
return {
|
|
384643
|
+
behavior: "ask",
|
|
384644
|
+
message: "Potential `]]` closer hidden in a quoted [[ ]] operand requires confirmation."
|
|
384645
|
+
};
|
|
384646
|
+
}
|
|
384647
|
+
}
|
|
384374
384648
|
const injectionCheckDisabled = isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_COMMAND_INJECTION_CHECK);
|
|
384375
384649
|
const shadowEnabled = feature("TREE_SITTER_BASH_SHADOW") ? getFeatureValue_CACHED_MAY_BE_STALE("tengu_birch_trellis", true) : false;
|
|
384376
384650
|
let astRoot = injectionCheckDisabled ? null : feature("TREE_SITTER_BASH_SHADOW") && !shadowEnabled ? null : await parseCommandRaw(input.command);
|
|
@@ -471082,9 +471356,14 @@ async function* runAgent({
|
|
|
471082
471356
|
const state3 = toolUseContext.getAppState();
|
|
471083
471357
|
let toolPermissionContext = state3.toolPermissionContext;
|
|
471084
471358
|
if (agentPermissionMode && state3.toolPermissionContext.mode !== "bypassPermissions" && state3.toolPermissionContext.mode !== "acceptEdits" && !(feature("TRANSCRIPT_CLASSIFIER") && state3.toolPermissionContext.mode === "auto")) {
|
|
471359
|
+
let effectiveMode = agentPermissionMode;
|
|
471360
|
+
if (agentPermissionMode === "bypassPermissions" && isBypassPermissionsModeDisabled()) {
|
|
471361
|
+
logForDebugging(`Subagent declared permissionMode: bypassPermissions but this session is not running in a contained no-internet environment (or bypass is policy-disabled); keeping parent mode '${state3.toolPermissionContext.mode}'.`, { level: "warn" });
|
|
471362
|
+
effectiveMode = state3.toolPermissionContext.mode;
|
|
471363
|
+
}
|
|
471085
471364
|
toolPermissionContext = {
|
|
471086
471365
|
...toolPermissionContext,
|
|
471087
|
-
mode:
|
|
471366
|
+
mode: effectiveMode
|
|
471088
471367
|
};
|
|
471089
471368
|
}
|
|
471090
471369
|
const shouldAvoidPrompts = canShowPermissionPrompts !== undefined ? !canShowPermissionPrompts : agentPermissionMode === "bubble" ? false : isAsync2;
|
|
@@ -471409,6 +471688,7 @@ var init_runAgent = __esm(() => {
|
|
|
471409
471688
|
init_sessionHooks();
|
|
471410
471689
|
init_hooks5();
|
|
471411
471690
|
init_messages3();
|
|
471691
|
+
init_permissionSetup();
|
|
471412
471692
|
init_cost_tracker();
|
|
471413
471693
|
init_agent();
|
|
471414
471694
|
init_sessionStorage();
|
|
@@ -564823,10 +565103,10 @@ var init_cliui = __esm(() => {
|
|
|
564823
565103
|
|
|
564824
565104
|
// node_modules/.bun/escalade@3.2.0/node_modules/escalade/sync/index.mjs
|
|
564825
565105
|
import { dirname as dirname43, resolve as resolve38 } from "path";
|
|
564826
|
-
import { readdirSync as readdirSync7, statSync as
|
|
565106
|
+
import { readdirSync as readdirSync7, statSync as statSync13 } from "fs";
|
|
564827
565107
|
function sync_default(start, callback) {
|
|
564828
565108
|
let dir = resolve38(".", start);
|
|
564829
|
-
let tmp, stats =
|
|
565109
|
+
let tmp, stats = statSync13(dir);
|
|
564830
565110
|
if (!stats.isDirectory()) {
|
|
564831
565111
|
dir = dirname43(dir);
|
|
564832
565112
|
}
|
|
@@ -565853,7 +566133,7 @@ var init_yerror = __esm(() => {
|
|
|
565853
566133
|
});
|
|
565854
566134
|
|
|
565855
566135
|
// node_modules/.bun/y18n@5.0.8/node_modules/y18n/build/lib/platform-shims/node.js
|
|
565856
|
-
import { readFileSync as readFileSync23, statSync as
|
|
566136
|
+
import { readFileSync as readFileSync23, statSync as statSync14, writeFile as writeFile28 } from "fs";
|
|
565857
566137
|
import { format as format5 } from "util";
|
|
565858
566138
|
import { resolve as resolve40 } from "path";
|
|
565859
566139
|
var node_default2;
|
|
@@ -565867,7 +566147,7 @@ var init_node12 = __esm(() => {
|
|
|
565867
566147
|
resolve: resolve40,
|
|
565868
566148
|
exists: (file2) => {
|
|
565869
566149
|
try {
|
|
565870
|
-
return
|
|
566150
|
+
return statSync14(file2).isFile();
|
|
565871
566151
|
} catch (err2) {
|
|
565872
566152
|
return false;
|
|
565873
566153
|
}
|
|
@@ -583931,7 +584211,7 @@ __export(exports_workflowDiscovery, {
|
|
|
583931
584211
|
USER_WORKFLOWS_DIR: () => USER_WORKFLOWS_DIR,
|
|
583932
584212
|
PROJECT_WORKFLOWS_DIR: () => PROJECT_WORKFLOWS_DIR
|
|
583933
584213
|
});
|
|
583934
|
-
import { existsSync as existsSync16, readdirSync as readdirSync8, statSync as
|
|
584214
|
+
import { existsSync as existsSync16, readdirSync as readdirSync8, statSync as statSync15 } from "fs";
|
|
583935
584215
|
import { homedir as homedir31 } from "os";
|
|
583936
584216
|
import { join as join109 } from "path";
|
|
583937
584217
|
function isWorkflowsEnabled() {
|
|
@@ -583958,7 +584238,7 @@ function listScripts(dir, source2) {
|
|
|
583958
584238
|
continue;
|
|
583959
584239
|
const full = join109(dir, entry);
|
|
583960
584240
|
try {
|
|
583961
|
-
if (!
|
|
584241
|
+
if (!statSync15(full).isFile())
|
|
583962
584242
|
continue;
|
|
583963
584243
|
} catch {
|
|
583964
584244
|
continue;
|
|
@@ -583987,7 +584267,7 @@ function resolveWorkflowScript(name3, source2, cwd2 = process.cwd()) {
|
|
|
583987
584267
|
const full = join109(dir, `${name3}.js`);
|
|
583988
584268
|
if (existsSync16(full)) {
|
|
583989
584269
|
try {
|
|
583990
|
-
if (
|
|
584270
|
+
if (statSync15(full).isFile())
|
|
583991
584271
|
return full;
|
|
583992
584272
|
} catch {}
|
|
583993
584273
|
}
|
|
@@ -639383,7 +639663,7 @@ var init_process2 = () => {};
|
|
|
639383
639663
|
|
|
639384
639664
|
// src/daemon/lockfile.ts
|
|
639385
639665
|
import { open as open13, readFile as readFile50, unlink as unlink22, writeFile as writeFile43 } from "fs/promises";
|
|
639386
|
-
import { existsSync as existsSync18, statSync as
|
|
639666
|
+
import { existsSync as existsSync18, statSync as statSync16 } from "fs";
|
|
639387
639667
|
import { join as join135 } from "path";
|
|
639388
639668
|
function getDaemonLockfilePath() {
|
|
639389
639669
|
return join135(getClaudeConfigHomeDir(), "daemon.lock");
|
|
@@ -639528,7 +639808,7 @@ async function displaceHolder() {
|
|
|
639528
639808
|
}
|
|
639529
639809
|
function lockfileMtime() {
|
|
639530
639810
|
try {
|
|
639531
|
-
return
|
|
639811
|
+
return statSync16(getDaemonLockfilePath()).mtimeMs;
|
|
639532
639812
|
} catch {
|
|
639533
639813
|
return null;
|
|
639534
639814
|
}
|
|
@@ -640711,7 +640991,7 @@ __export(exports_supervisor, {
|
|
|
640711
640991
|
daemonInstall: () => daemonInstall,
|
|
640712
640992
|
checkBinaryIdentity: () => checkBinaryIdentity
|
|
640713
640993
|
});
|
|
640714
|
-
import { existsSync as existsSync22, statSync as
|
|
640994
|
+
import { existsSync as existsSync22, statSync as statSync17 } from "fs";
|
|
640715
640995
|
function buildIdentity() {
|
|
640716
640996
|
return {
|
|
640717
640997
|
supervisorPid: process.pid,
|
|
@@ -640734,7 +641014,7 @@ function checkBinaryIdentity() {
|
|
|
640734
641014
|
if (!execPath2 || !existsSync22(execPath2)) {
|
|
640735
641015
|
return "binary identity unresolvable";
|
|
640736
641016
|
}
|
|
640737
|
-
|
|
641017
|
+
statSync17(execPath2);
|
|
640738
641018
|
} catch {
|
|
640739
641019
|
return "binary identity unresolvable";
|
|
640740
641020
|
}
|
|
@@ -642700,7 +642980,7 @@ var init_file_index = __esm(() => {
|
|
|
642700
642980
|
});
|
|
642701
642981
|
|
|
642702
642982
|
// src/hooks/fileSuggestions.ts
|
|
642703
|
-
import { statSync as
|
|
642983
|
+
import { statSync as statSync18 } from "fs";
|
|
642704
642984
|
import * as path35 from "path";
|
|
642705
642985
|
function getFileIndex() {
|
|
642706
642986
|
if (!fileIndex) {
|
|
@@ -642748,7 +643028,7 @@ function getGitIndexMtime() {
|
|
|
642748
643028
|
if (!repoRoot)
|
|
642749
643029
|
return null;
|
|
642750
643030
|
try {
|
|
642751
|
-
return
|
|
643031
|
+
return statSync18(path35.join(repoRoot, ".git", "index")).mtimeMs;
|
|
642752
643032
|
} catch {
|
|
642753
643033
|
return null;
|
|
642754
643034
|
}
|
|
@@ -684266,70 +684546,172 @@ var init_logoV2Utils = __esm(() => {
|
|
|
684266
684546
|
cachedActivity = [];
|
|
684267
684547
|
});
|
|
684268
684548
|
|
|
684269
|
-
// src/components/LogoV2/
|
|
684270
|
-
function
|
|
684271
|
-
const
|
|
684272
|
-
return lines2.map((
|
|
684549
|
+
// src/components/LogoV2/OccMark.tsx
|
|
684550
|
+
function normalizeMark(lines2) {
|
|
684551
|
+
const width = Math.max(...lines2.map(stringWidth));
|
|
684552
|
+
return lines2.map((line) => line + " ".repeat(width - stringWidth(line)));
|
|
684273
684553
|
}
|
|
684274
|
-
function
|
|
684275
|
-
|
|
684276
|
-
|
|
684277
|
-
|
|
684278
|
-
|
|
684279
|
-
|
|
684280
|
-
|
|
684281
|
-
|
|
684282
|
-
|
|
684283
|
-
|
|
684284
|
-
|
|
684285
|
-
|
|
684286
|
-
|
|
684287
|
-
|
|
684288
|
-
|
|
684289
|
-
|
|
684290
|
-
|
|
684291
|
-
|
|
684292
|
-
|
|
684293
|
-
|
|
684294
|
-
|
|
684295
|
-
|
|
684296
|
-
|
|
684554
|
+
function getOccMark(mode) {
|
|
684555
|
+
return OCC_MARKS[mode];
|
|
684556
|
+
}
|
|
684557
|
+
function getOccMarkWidth(art) {
|
|
684558
|
+
return Math.max(...art.map(stringWidth));
|
|
684559
|
+
}
|
|
684560
|
+
function gradientThemeFamily(themeName) {
|
|
684561
|
+
return themeName.startsWith("light") ? "light" : "dark";
|
|
684562
|
+
}
|
|
684563
|
+
function sampleGradient(stops, t4) {
|
|
684564
|
+
if (stops.length === 0)
|
|
684565
|
+
return [0, 0, 0];
|
|
684566
|
+
if (stops.length === 1)
|
|
684567
|
+
return stops[0];
|
|
684568
|
+
const clamped = Math.min(Math.max(t4, 0), 1);
|
|
684569
|
+
const scaled = clamped * (stops.length - 1);
|
|
684570
|
+
const index2 = Math.min(Math.floor(scaled), stops.length - 2);
|
|
684571
|
+
const local = scaled - index2;
|
|
684572
|
+
const from2 = stops[index2];
|
|
684573
|
+
const to = stops[index2 + 1];
|
|
684574
|
+
return [
|
|
684575
|
+
Math.round(from2[0] + (to[0] - from2[0]) * local),
|
|
684576
|
+
Math.round(from2[1] + (to[1] - from2[1]) * local),
|
|
684577
|
+
Math.round(from2[2] + (to[2] - from2[2]) * local)
|
|
684578
|
+
];
|
|
684579
|
+
}
|
|
684580
|
+
function markCellT(art, row, column) {
|
|
684581
|
+
const width = getOccMarkWidth(art);
|
|
684582
|
+
const horizontal = width > 1 ? column / (width - 1) : 0;
|
|
684583
|
+
const vertical = art.length > 1 ? row / (art.length - 1) : 0;
|
|
684584
|
+
return horizontal * 0.72 + vertical * 0.28;
|
|
684585
|
+
}
|
|
684586
|
+
function rgbColor(rgb3) {
|
|
684587
|
+
return `rgb(${rgb3[0]},${rgb3[1]},${rgb3[2]})`;
|
|
684588
|
+
}
|
|
684589
|
+
function highlightColor(rgb3, amount = 0.62) {
|
|
684590
|
+
return [
|
|
684591
|
+
Math.round(rgb3[0] + (255 - rgb3[0]) * amount),
|
|
684592
|
+
Math.round(rgb3[1] + (255 - rgb3[1]) * amount),
|
|
684593
|
+
Math.round(rgb3[2] + (255 - rgb3[2]) * amount)
|
|
684594
|
+
];
|
|
684595
|
+
}
|
|
684596
|
+
function isShimmerCell(art, row, column, progress) {
|
|
684597
|
+
if (progress === null)
|
|
684598
|
+
return false;
|
|
684599
|
+
const width = getOccMarkWidth(art);
|
|
684600
|
+
const diagonal = (column + (art.length - 1 - row) * 1.6) / (width + (art.length - 1) * 1.6);
|
|
684601
|
+
const bandPosition = -SHIMMER_BAND_WIDTH + progress * 1.45;
|
|
684602
|
+
return Math.abs(diagonal - bandPosition) < SHIMMER_BAND_WIDTH;
|
|
684603
|
+
}
|
|
684604
|
+
function MarkRow({
|
|
684605
|
+
art,
|
|
684606
|
+
row,
|
|
684607
|
+
stops,
|
|
684608
|
+
progress
|
|
684609
|
+
}) {
|
|
684610
|
+
const line = art[row];
|
|
684611
|
+
const cells = [...line];
|
|
684612
|
+
const nodes = [];
|
|
684613
|
+
let spaceRun = "";
|
|
684614
|
+
const flushSpaces = (key4) => {
|
|
684615
|
+
if (spaceRun.length > 0) {
|
|
684616
|
+
nodes.push(/* @__PURE__ */ jsx_runtime258.jsx(ThemedText, {
|
|
684617
|
+
children: spaceRun
|
|
684618
|
+
}, key4));
|
|
684619
|
+
spaceRun = "";
|
|
684620
|
+
}
|
|
684621
|
+
};
|
|
684622
|
+
for (let column = 0;column < cells.length; column++) {
|
|
684623
|
+
const char = cells[column];
|
|
684624
|
+
if (char === " " || char === "\t") {
|
|
684625
|
+
spaceRun += " ";
|
|
684297
684626
|
continue;
|
|
684298
684627
|
}
|
|
684299
|
-
|
|
684300
|
-
|
|
684301
|
-
|
|
684302
|
-
|
|
684303
|
-
|
|
684304
|
-
|
|
684305
|
-
|
|
684306
|
-
|
|
684307
|
-
}
|
|
684628
|
+
flushSpaces(`${row}-sp-${column}`);
|
|
684629
|
+
const base2 = sampleGradient(stops, markCellT(art, row, column));
|
|
684630
|
+
const shimmering = isShimmerCell(art, row, column, progress);
|
|
684631
|
+
nodes.push(/* @__PURE__ */ jsx_runtime258.jsx(ThemedText, {
|
|
684632
|
+
color: rgbColor(shimmering ? highlightColor(base2) : base2),
|
|
684633
|
+
bold: true,
|
|
684634
|
+
children: char
|
|
684635
|
+
}, `${row}-${column}`));
|
|
684308
684636
|
}
|
|
684309
|
-
|
|
684637
|
+
flushSpaces(`${row}-end`);
|
|
684310
684638
|
return /* @__PURE__ */ jsx_runtime258.jsx(ThemedText, {
|
|
684311
|
-
children:
|
|
684312
|
-
}
|
|
684639
|
+
children: nodes
|
|
684640
|
+
});
|
|
684313
684641
|
}
|
|
684314
|
-
function
|
|
684642
|
+
function OccMark(props) {
|
|
684643
|
+
const mode = props.mode ?? "compact";
|
|
684644
|
+
const art = getOccMark(mode);
|
|
684645
|
+
const [themeName] = useTheme();
|
|
684646
|
+
const stops = GRADIENT_STOPS[gradientThemeFamily(themeName)];
|
|
684647
|
+
const animate = props.animate ?? !(getInitialSettings().prefersReducedMotion ?? false);
|
|
684648
|
+
const [done, setDone] = import_react146.useState(!animate);
|
|
684649
|
+
const startTimeRef = import_react146.useRef(null);
|
|
684650
|
+
const [ref, time3] = useAnimationFrame(done ? null : SHIMMER_FRAME_MS);
|
|
684651
|
+
import_react146.useEffect(() => {
|
|
684652
|
+
if (done)
|
|
684653
|
+
return;
|
|
684654
|
+
const timer2 = setTimeout(setDone, SHIMMER_DURATION_MS, true);
|
|
684655
|
+
return () => clearTimeout(timer2);
|
|
684656
|
+
}, [done]);
|
|
684657
|
+
if (startTimeRef.current === null) {
|
|
684658
|
+
startTimeRef.current = time3;
|
|
684659
|
+
}
|
|
684660
|
+
const elapsed = Math.max(0, time3 - startTimeRef.current);
|
|
684661
|
+
const progress = done ? null : Math.min(elapsed / SHIMMER_DURATION_MS, 1);
|
|
684315
684662
|
return /* @__PURE__ */ jsx_runtime258.jsx(ThemedBox_default, {
|
|
684663
|
+
ref,
|
|
684316
684664
|
flexDirection: "column",
|
|
684317
|
-
|
|
684665
|
+
flexShrink: 0,
|
|
684666
|
+
children: art.map((_4, row) => /* @__PURE__ */ jsx_runtime258.jsx(MarkRow, {
|
|
684667
|
+
art,
|
|
684668
|
+
row,
|
|
684669
|
+
stops,
|
|
684670
|
+
progress
|
|
684671
|
+
}, row))
|
|
684318
684672
|
});
|
|
684319
684673
|
}
|
|
684320
|
-
var jsx_runtime258,
|
|
684321
|
-
var
|
|
684674
|
+
var import_react146, jsx_runtime258, OCC_MARKS, GRADIENT_STOPS, SHIMMER_FRAME_MS = 84, SHIMMER_DURATION_MS = 1850, SHIMMER_BAND_WIDTH = 0.24;
|
|
684675
|
+
var init_OccMark = __esm(() => {
|
|
684322
684676
|
init_ink2();
|
|
684677
|
+
init_stringWidth();
|
|
684678
|
+
init_settings2();
|
|
684679
|
+
init_ThemeProvider();
|
|
684680
|
+
import_react146 = __toESM(require_react(), 1);
|
|
684323
684681
|
jsx_runtime258 = __toESM(require_jsx_runtime(), 1);
|
|
684324
|
-
|
|
684325
|
-
|
|
684326
|
-
|
|
684327
|
-
|
|
684328
|
-
|
|
684329
|
-
|
|
684330
|
-
|
|
684331
|
-
|
|
684332
|
-
|
|
684682
|
+
OCC_MARKS = {
|
|
684683
|
+
wide: normalizeMark([
|
|
684684
|
+
"\u259F\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2599",
|
|
684685
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u259B",
|
|
684686
|
+
"\u2588\u2588",
|
|
684687
|
+
"\u2588\u2588",
|
|
684688
|
+
"\u2588\u2588",
|
|
684689
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u259C",
|
|
684690
|
+
"\u259C\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u259B"
|
|
684691
|
+
]),
|
|
684692
|
+
compact: normalizeMark([
|
|
684693
|
+
"\u259F\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2599",
|
|
684694
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u259B",
|
|
684695
|
+
"\u2588\u2588",
|
|
684696
|
+
"\u2588\u2588",
|
|
684697
|
+
"\u2588\u2588",
|
|
684698
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u259C",
|
|
684699
|
+
"\u259C\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u259B"
|
|
684700
|
+
]),
|
|
684701
|
+
plain: normalizeMark(["\u259F\u2588\u2588\u2588\u2588\u2588\u2588\u2599", "\u2588\u2588", "\u2588\u2588", "\u2588\u2588", "\u259C\u2588\u2588\u2588\u2588\u2588\u2588\u259B"])
|
|
684702
|
+
};
|
|
684703
|
+
GRADIENT_STOPS = {
|
|
684704
|
+
dark: [
|
|
684705
|
+
[255, 199, 110],
|
|
684706
|
+
[255, 116, 64],
|
|
684707
|
+
[233, 60, 136]
|
|
684708
|
+
],
|
|
684709
|
+
light: [
|
|
684710
|
+
[181, 110, 0],
|
|
684711
|
+
[194, 62, 24],
|
|
684712
|
+
[162, 22, 82]
|
|
684713
|
+
]
|
|
684714
|
+
};
|
|
684333
684715
|
});
|
|
684334
684716
|
|
|
684335
684717
|
// src/components/LogoV2/Feed.tsx
|
|
@@ -684853,7 +685235,7 @@ function shouldShowGuestPassesUpsell() {
|
|
|
684853
685235
|
return true;
|
|
684854
685236
|
}
|
|
684855
685237
|
function useShowGuestPassesUpsell() {
|
|
684856
|
-
const [show] =
|
|
685238
|
+
const [show] = import_react147.useState(_temp120);
|
|
684857
685239
|
return show;
|
|
684858
685240
|
}
|
|
684859
685241
|
function _temp120() {
|
|
@@ -684905,28 +685287,18 @@ function GuestPassesUpsell() {
|
|
|
684905
685287
|
}
|
|
684906
685288
|
return t0;
|
|
684907
685289
|
}
|
|
684908
|
-
var import_compiler_runtime196,
|
|
685290
|
+
var import_compiler_runtime196, import_react147, jsx_runtime262;
|
|
684909
685291
|
var init_GuestPassesUpsell = __esm(() => {
|
|
684910
685292
|
init_ink2();
|
|
684911
685293
|
init_analytics();
|
|
684912
685294
|
init_referral();
|
|
684913
685295
|
init_config4();
|
|
684914
685296
|
import_compiler_runtime196 = __toESM(require_compiler_runtime(), 1);
|
|
684915
|
-
|
|
685297
|
+
import_react147 = __toESM(require_react(), 1);
|
|
684916
685298
|
jsx_runtime262 = __toESM(require_jsx_runtime(), 1);
|
|
684917
685299
|
});
|
|
684918
685300
|
|
|
684919
685301
|
// src/components/LogoV2/OccWelcome.tsx
|
|
684920
|
-
function normalizeLogo(lines2) {
|
|
684921
|
-
const width = Math.max(...lines2.map(stringWidth));
|
|
684922
|
-
return lines2.map((line) => line + " ".repeat(width - stringWidth(line)));
|
|
684923
|
-
}
|
|
684924
|
-
function getOccLogo(mode) {
|
|
684925
|
-
return OCC_LOGOS[mode];
|
|
684926
|
-
}
|
|
684927
|
-
function getOccLogoWidth(art) {
|
|
684928
|
-
return Math.max(...art.map(stringWidth));
|
|
684929
|
-
}
|
|
684930
685302
|
function getOccWelcomeMode(columns, plain = false) {
|
|
684931
685303
|
if (plain || columns < COMPACT_MIN_COLUMNS)
|
|
684932
685304
|
return "plain";
|
|
@@ -684953,92 +685325,33 @@ function welcomeTip(mode, sessionTip) {
|
|
|
684953
685325
|
}
|
|
684954
685326
|
return "Type /help for commands";
|
|
684955
685327
|
}
|
|
684956
|
-
function
|
|
684957
|
-
|
|
684958
|
-
|
|
684959
|
-
return [];
|
|
684960
|
-
const runs = [];
|
|
684961
|
-
const artWidth = getOccLogoWidth(art);
|
|
684962
|
-
let displayColumn = 0;
|
|
684963
|
-
for (let column = 0;column < chars.length; column++) {
|
|
684964
|
-
const char = chars[column];
|
|
684965
|
-
const diagonal = (displayColumn + (art.length - 1 - row) * 1.6) / (artWidth + art.length * 1.6);
|
|
684966
|
-
const bandPosition = progress === null ? -1 : -SHIMMER_BAND_WIDTH + progress * 1.45;
|
|
684967
|
-
const highlighted = progress !== null && char !== " " && Math.abs(diagonal - bandPosition) < SHIMMER_BAND_WIDTH;
|
|
684968
|
-
const previous = runs[runs.length - 1];
|
|
684969
|
-
if (previous?.highlighted === highlighted) {
|
|
684970
|
-
previous.text += char;
|
|
684971
|
-
} else {
|
|
684972
|
-
runs.push({ text: char, highlighted });
|
|
684973
|
-
}
|
|
684974
|
-
displayColumn += stringWidth(char);
|
|
684975
|
-
}
|
|
684976
|
-
return runs;
|
|
684977
|
-
}
|
|
684978
|
-
function OccLogo({
|
|
684979
|
-
art,
|
|
684980
|
-
animate
|
|
684981
|
-
}) {
|
|
684982
|
-
const [done, setDone] = import_react147.useState(!animate);
|
|
684983
|
-
const startTimeRef = import_react147.useRef(null);
|
|
684984
|
-
const [ref, time3] = useAnimationFrame(done ? null : SHIMMER_FRAME_MS);
|
|
684985
|
-
import_react147.useEffect(() => {
|
|
684986
|
-
if (done)
|
|
684987
|
-
return;
|
|
684988
|
-
const timer2 = setTimeout(setDone, SHIMMER_DURATION_MS, true);
|
|
684989
|
-
return () => clearTimeout(timer2);
|
|
684990
|
-
}, [done]);
|
|
684991
|
-
if (startTimeRef.current === null) {
|
|
684992
|
-
startTimeRef.current = time3;
|
|
684993
|
-
}
|
|
684994
|
-
const elapsed = Math.max(0, time3 - startTimeRef.current);
|
|
684995
|
-
const progress = done ? null : Math.min(elapsed / SHIMMER_DURATION_MS, 1);
|
|
684996
|
-
return /* @__PURE__ */ jsx_runtime263.jsx(ThemedBox_default, {
|
|
684997
|
-
ref,
|
|
684998
|
-
flexDirection: "column",
|
|
684999
|
-
flexShrink: 0,
|
|
685000
|
-
children: art.map((line, row) => /* @__PURE__ */ jsx_runtime263.jsx(ThemedText, {
|
|
685001
|
-
children: getShimmerRuns(line, row, progress, art).map((run, index2) => /* @__PURE__ */ jsx_runtime263.jsx(ThemedText, {
|
|
685002
|
-
color: run.highlighted ? "claudeShimmer" : "claude",
|
|
685003
|
-
bold: run.highlighted,
|
|
685004
|
-
children: run.text
|
|
685005
|
-
}, `${row}-${index2}`))
|
|
685006
|
-
}, row))
|
|
685007
|
-
});
|
|
685008
|
-
}
|
|
685009
|
-
function Header({
|
|
685010
|
-
version: version5,
|
|
685011
|
-
showTagline,
|
|
685328
|
+
function DataRow({
|
|
685329
|
+
label,
|
|
685330
|
+
value,
|
|
685012
685331
|
width
|
|
685013
685332
|
}) {
|
|
685014
|
-
|
|
685015
|
-
|
|
685016
|
-
|
|
685333
|
+
const labelCell = `${label} `.slice(0, LABEL_COLUMN_WIDTH).padEnd(LABEL_COLUMN_WIDTH);
|
|
685334
|
+
return /* @__PURE__ */ jsx_runtime263.jsxs(ThemedText, {
|
|
685335
|
+
wrap: "truncate",
|
|
685017
685336
|
children: [
|
|
685018
|
-
/* @__PURE__ */ jsx_runtime263.
|
|
685019
|
-
|
|
685020
|
-
|
|
685021
|
-
color: "claude",
|
|
685022
|
-
bold: true,
|
|
685023
|
-
children: "OCC"
|
|
685024
|
-
}),
|
|
685025
|
-
/* @__PURE__ */ jsx_runtime263.jsxs(ThemedText, {
|
|
685026
|
-
dimColor: true,
|
|
685027
|
-
children: [
|
|
685028
|
-
" v",
|
|
685029
|
-
version5
|
|
685030
|
-
]
|
|
685031
|
-
})
|
|
685032
|
-
]
|
|
685337
|
+
/* @__PURE__ */ jsx_runtime263.jsx(ThemedText, {
|
|
685338
|
+
color: "inactive",
|
|
685339
|
+
children: labelCell
|
|
685033
685340
|
}),
|
|
685034
|
-
|
|
685035
|
-
|
|
685036
|
-
wrap: "truncate",
|
|
685037
|
-
children: "Open C Code"
|
|
685341
|
+
/* @__PURE__ */ jsx_runtime263.jsx(ThemedText, {
|
|
685342
|
+
children: truncate(value, Math.max(width - LABEL_COLUMN_WIDTH, 1))
|
|
685038
685343
|
})
|
|
685039
685344
|
]
|
|
685040
685345
|
});
|
|
685041
685346
|
}
|
|
685347
|
+
function DashedRule({ width }) {
|
|
685348
|
+
return /* @__PURE__ */ jsx_runtime263.jsx(ThemedText, {
|
|
685349
|
+
color: "inactive",
|
|
685350
|
+
dimColor: true,
|
|
685351
|
+
wrap: "truncate",
|
|
685352
|
+
children: "\u254C".repeat(Math.max(width, 1))
|
|
685353
|
+
});
|
|
685354
|
+
}
|
|
685042
685355
|
function Metadata({
|
|
685043
685356
|
width,
|
|
685044
685357
|
model,
|
|
@@ -685048,37 +685361,25 @@ function Metadata({
|
|
|
685048
685361
|
}) {
|
|
685049
685362
|
const modelLine = truncate(`${model} \xB7 ${billing}`, Math.max(width, 1));
|
|
685050
685363
|
const agentPrefix = agentName ? `@${agentName} \xB7 ` : "";
|
|
685051
|
-
const
|
|
685364
|
+
const locationValue = `${agentPrefix}${location}`;
|
|
685052
685365
|
return /* @__PURE__ */ jsx_runtime263.jsxs(ThemedBox_default, {
|
|
685053
685366
|
flexDirection: "column",
|
|
685054
685367
|
minWidth: 0,
|
|
685055
685368
|
children: [
|
|
685056
685369
|
/* @__PURE__ */ jsx_runtime263.jsx(ThemedText, {
|
|
685057
685370
|
bold: true,
|
|
685058
|
-
children: "Ready when you are."
|
|
685059
|
-
}),
|
|
685060
|
-
/* @__PURE__ */ jsx_runtime263.jsx(ThemedText, {
|
|
685061
|
-
dimColor: true,
|
|
685062
685371
|
wrap: "truncate",
|
|
685063
|
-
children:
|
|
685372
|
+
children: "Ready when you are."
|
|
685064
685373
|
}),
|
|
685065
|
-
/* @__PURE__ */ jsx_runtime263.
|
|
685066
|
-
|
|
685067
|
-
|
|
685068
|
-
|
|
685069
|
-
color: "claude",
|
|
685070
|
-
children: agentPrefix
|
|
685071
|
-
}),
|
|
685072
|
-
/* @__PURE__ */ jsx_runtime263.jsx(ThemedText, {
|
|
685073
|
-
dimColor: true,
|
|
685074
|
-
children: truncate(location, locationWidth)
|
|
685075
|
-
})
|
|
685076
|
-
]
|
|
685374
|
+
/* @__PURE__ */ jsx_runtime263.jsx(DataRow, {
|
|
685375
|
+
label: "MODEL",
|
|
685376
|
+
value: modelLine,
|
|
685377
|
+
width
|
|
685077
685378
|
}),
|
|
685078
|
-
/* @__PURE__ */ jsx_runtime263.jsx(
|
|
685079
|
-
|
|
685080
|
-
|
|
685081
|
-
|
|
685379
|
+
/* @__PURE__ */ jsx_runtime263.jsx(DataRow, {
|
|
685380
|
+
label: "PROJ",
|
|
685381
|
+
value: locationValue,
|
|
685382
|
+
width
|
|
685082
685383
|
})
|
|
685083
685384
|
]
|
|
685084
685385
|
});
|
|
@@ -685087,16 +685388,17 @@ function PlainWelcome(props) {
|
|
|
685087
685388
|
const width = Math.max(props.columns, 1);
|
|
685088
685389
|
const location = formatWelcomeLocation(props.branch, props.cwd, width);
|
|
685089
685390
|
const modelLine = truncate(`${props.model} \xB7 ${props.billing}`, width);
|
|
685090
|
-
const logo =
|
|
685091
|
-
const showLogo = !props.plain && width >=
|
|
685391
|
+
const logo = getOccMark("plain");
|
|
685392
|
+
const showLogo = !props.plain && width >= getOccMarkWidth(logo);
|
|
685393
|
+
const animate = !props.reducedMotion && !props.plain;
|
|
685092
685394
|
return /* @__PURE__ */ jsx_runtime263.jsxs(ThemedBox_default, {
|
|
685093
685395
|
flexDirection: "column",
|
|
685094
685396
|
children: [
|
|
685095
685397
|
showLogo && /* @__PURE__ */ jsx_runtime263.jsx(ThemedBox_default, {
|
|
685096
685398
|
marginBottom: 1,
|
|
685097
|
-
children: /* @__PURE__ */ jsx_runtime263.jsx(
|
|
685098
|
-
|
|
685099
|
-
animate
|
|
685399
|
+
children: /* @__PURE__ */ jsx_runtime263.jsx(OccMark, {
|
|
685400
|
+
mode: "plain",
|
|
685401
|
+
animate
|
|
685100
685402
|
})
|
|
685101
685403
|
}),
|
|
685102
685404
|
/* @__PURE__ */ jsx_runtime263.jsxs(ThemedText, {
|
|
@@ -685140,37 +685442,36 @@ function OccWelcome(props) {
|
|
|
685140
685442
|
...props
|
|
685141
685443
|
});
|
|
685142
685444
|
}
|
|
685445
|
+
const [themeName] = useTheme();
|
|
685143
685446
|
const cardWidth = Math.min(Math.max(props.columns, 1), WELCOME_MAX_WIDTH);
|
|
685144
685447
|
const contentWidth = Math.max(cardWidth - 4, 1);
|
|
685145
|
-
const
|
|
685146
|
-
const
|
|
685147
|
-
const
|
|
685448
|
+
const markMode = mode === "wide" ? "wide" : "compact";
|
|
685449
|
+
const logo = getOccMark(markMode);
|
|
685450
|
+
const logoWidth = getOccMarkWidth(logo);
|
|
685451
|
+
const metaWidth = mode === "wide" ? Math.max(contentWidth - logoWidth - 3, 1) : contentWidth;
|
|
685452
|
+
const location = formatWelcomeLocation(props.branch, props.cwd, metaWidth);
|
|
685148
685453
|
const animate = !props.reducedMotion;
|
|
685454
|
+
const borderTitle = `${color("claude", themeName)("OCC")}${color("inactive", themeName)(` v${props.version} \xB7 Open C Code`)}`;
|
|
685149
685455
|
return /* @__PURE__ */ jsx_runtime263.jsxs(ThemedBox_default, {
|
|
685150
685456
|
width: cardWidth,
|
|
685151
685457
|
flexDirection: "column",
|
|
685152
685458
|
borderStyle: "round",
|
|
685153
|
-
borderColor: "
|
|
685154
|
-
|
|
685459
|
+
borderColor: "claude",
|
|
685460
|
+
borderText: { content: borderTitle, position: "top", align: "start", offset: 2 },
|
|
685155
685461
|
paddingX: 1,
|
|
685156
685462
|
children: [
|
|
685157
|
-
/* @__PURE__ */ jsx_runtime263.jsx(Header, {
|
|
685158
|
-
version: props.version,
|
|
685159
|
-
showTagline: true,
|
|
685160
|
-
width: contentWidth
|
|
685161
|
-
}),
|
|
685162
685463
|
mode === "wide" ? /* @__PURE__ */ jsx_runtime263.jsxs(ThemedBox_default, {
|
|
685163
685464
|
marginTop: 1,
|
|
685164
685465
|
flexDirection: "row",
|
|
685165
685466
|
gap: 3,
|
|
685166
685467
|
alignItems: "center",
|
|
685167
685468
|
children: [
|
|
685168
|
-
/* @__PURE__ */ jsx_runtime263.jsx(
|
|
685169
|
-
|
|
685469
|
+
/* @__PURE__ */ jsx_runtime263.jsx(OccMark, {
|
|
685470
|
+
mode: "wide",
|
|
685170
685471
|
animate
|
|
685171
685472
|
}),
|
|
685172
685473
|
/* @__PURE__ */ jsx_runtime263.jsx(Metadata, {
|
|
685173
|
-
width:
|
|
685474
|
+
width: metaWidth,
|
|
685174
685475
|
model: props.model,
|
|
685175
685476
|
billing: props.billing,
|
|
685176
685477
|
location,
|
|
@@ -685182,8 +685483,8 @@ function OccWelcome(props) {
|
|
|
685182
685483
|
flexDirection: "column",
|
|
685183
685484
|
alignItems: "center",
|
|
685184
685485
|
children: [
|
|
685185
|
-
/* @__PURE__ */ jsx_runtime263.jsx(
|
|
685186
|
-
|
|
685486
|
+
/* @__PURE__ */ jsx_runtime263.jsx(OccMark, {
|
|
685487
|
+
mode: "compact",
|
|
685187
685488
|
animate
|
|
685188
685489
|
}),
|
|
685189
685490
|
/* @__PURE__ */ jsx_runtime263.jsx(ThemedBox_default, {
|
|
@@ -685199,19 +685500,22 @@ function OccWelcome(props) {
|
|
|
685199
685500
|
})
|
|
685200
685501
|
]
|
|
685201
685502
|
}),
|
|
685202
|
-
/* @__PURE__ */ jsx_runtime263.
|
|
685503
|
+
/* @__PURE__ */ jsx_runtime263.jsxs(ThemedBox_default, {
|
|
685203
685504
|
marginTop: 1,
|
|
685204
|
-
|
|
685205
|
-
|
|
685206
|
-
|
|
685207
|
-
|
|
685208
|
-
|
|
685209
|
-
|
|
685210
|
-
|
|
685211
|
-
|
|
685212
|
-
|
|
685213
|
-
|
|
685214
|
-
|
|
685505
|
+
flexDirection: "column",
|
|
685506
|
+
children: [
|
|
685507
|
+
/* @__PURE__ */ jsx_runtime263.jsx(DashedRule, {
|
|
685508
|
+
width: contentWidth
|
|
685509
|
+
}),
|
|
685510
|
+
/* @__PURE__ */ jsx_runtime263.jsx(ThemedBox_default, {
|
|
685511
|
+
marginTop: 0,
|
|
685512
|
+
children: /* @__PURE__ */ jsx_runtime263.jsx(ThemedText, {
|
|
685513
|
+
dimColor: true,
|
|
685514
|
+
wrap: "truncate",
|
|
685515
|
+
children: `\u25B8 ${welcomeTip(mode, props.tip)}`
|
|
685516
|
+
})
|
|
685517
|
+
})
|
|
685518
|
+
]
|
|
685215
685519
|
}),
|
|
685216
685520
|
props.children && /* @__PURE__ */ jsx_runtime263.jsx(ThemedBox_default, {
|
|
685217
685521
|
marginTop: 1,
|
|
@@ -685220,32 +685524,13 @@ function OccWelcome(props) {
|
|
|
685220
685524
|
]
|
|
685221
685525
|
});
|
|
685222
685526
|
}
|
|
685223
|
-
var
|
|
685527
|
+
var jsx_runtime263, WELCOME_MAX_WIDTH = 84, WIDE_MIN_COLUMNS = 76, COMPACT_MIN_COLUMNS = 44, LABEL_COLUMN_WIDTH = 7;
|
|
685224
685528
|
var init_OccWelcome = __esm(() => {
|
|
685225
685529
|
init_ink2();
|
|
685226
|
-
init_stringWidth();
|
|
685227
685530
|
init_format();
|
|
685228
|
-
|
|
685531
|
+
init_ThemeProvider();
|
|
685532
|
+
init_OccMark();
|
|
685229
685533
|
jsx_runtime263 = __toESM(require_jsx_runtime(), 1);
|
|
685230
|
-
OCC_LOGOS = {
|
|
685231
|
-
wide: normalizeLogo([
|
|
685232
|
-
"\u259F\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2599",
|
|
685233
|
-
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u259B",
|
|
685234
|
-
"\u2588\u2588 ",
|
|
685235
|
-
"\u2588\u2588 ",
|
|
685236
|
-
"\u2588\u2588 ",
|
|
685237
|
-
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u259C",
|
|
685238
|
-
"\u259C\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u259B"
|
|
685239
|
-
]),
|
|
685240
|
-
compact: normalizeLogo([
|
|
685241
|
-
"\u259F\u2588\u2588\u2588\u2588\u2588\u2588\u2599",
|
|
685242
|
-
"\u2588\u2588 ",
|
|
685243
|
-
"\u2588\u2588 ",
|
|
685244
|
-
"\u2588\u2588 ",
|
|
685245
|
-
"\u259C\u2588\u2588\u2588\u2588\u2588\u2588\u259B"
|
|
685246
|
-
]),
|
|
685247
|
-
plain: normalizeLogo(["\u259F\u2588\u2588\u2588\u2588\u2599", "\u2588\u2588 ", "\u259C\u2588\u2588\u2588\u2588\u259B"])
|
|
685248
|
-
};
|
|
685249
685534
|
});
|
|
685250
685535
|
|
|
685251
685536
|
// src/components/LogoV2/welcomeTips.ts
|
|
@@ -686262,7 +686547,9 @@ function LogoV2() {
|
|
|
686262
686547
|
if ($4[34] === Symbol.for("react.memo_cache_sentinel")) {
|
|
686263
686548
|
t122 = /* @__PURE__ */ jsx_runtime270.jsx(ThemedBox_default, {
|
|
686264
686549
|
marginY: 1,
|
|
686265
|
-
children: /* @__PURE__ */ jsx_runtime270.jsx(
|
|
686550
|
+
children: /* @__PURE__ */ jsx_runtime270.jsx(OccMark, {
|
|
686551
|
+
mode: "compact"
|
|
686552
|
+
})
|
|
686266
686553
|
});
|
|
686267
686554
|
$4[34] = t122;
|
|
686268
686555
|
} else {
|
|
@@ -686407,7 +686694,9 @@ function LogoV2() {
|
|
|
686407
686694
|
}
|
|
686408
686695
|
let t19;
|
|
686409
686696
|
if ($4[48] === Symbol.for("react.memo_cache_sentinel")) {
|
|
686410
|
-
t19 = /* @__PURE__ */ jsx_runtime270.jsx(
|
|
686697
|
+
t19 = /* @__PURE__ */ jsx_runtime270.jsx(OccMark, {
|
|
686698
|
+
mode: "compact"
|
|
686699
|
+
});
|
|
686411
686700
|
$4[48] = t19;
|
|
686412
686701
|
} else {
|
|
686413
686702
|
t19 = $4[48];
|
|
@@ -686708,7 +686997,7 @@ var init_LogoV2 = __esm(() => {
|
|
|
686708
686997
|
init_logoV2Utils();
|
|
686709
686998
|
init_format();
|
|
686710
686999
|
init_file();
|
|
686711
|
-
|
|
687000
|
+
init_OccMark();
|
|
686712
687001
|
init_FeedColumn();
|
|
686713
687002
|
init_feedConfigs();
|
|
686714
687003
|
init_config4();
|
|
@@ -690594,8 +690883,8 @@ function formatSnippet({
|
|
|
690594
690883
|
before,
|
|
690595
690884
|
match,
|
|
690596
690885
|
after
|
|
690597
|
-
},
|
|
690598
|
-
return source_default.dim(before) +
|
|
690886
|
+
}, highlightColor2) {
|
|
690887
|
+
return source_default.dim(before) + highlightColor2(match) + source_default.dim(after);
|
|
690599
690888
|
}
|
|
690600
690889
|
function extractSnippet(text2, query2, contextChars) {
|
|
690601
690890
|
const matchIndex = text2.toLowerCase().indexOf(query2.toLowerCase());
|
|
@@ -690684,7 +690973,7 @@ function LogSelector(t0) {
|
|
|
690684
690973
|
} else {
|
|
690685
690974
|
t5 = $4[4];
|
|
690686
690975
|
}
|
|
690687
|
-
const
|
|
690976
|
+
const highlightColor2 = t5;
|
|
690688
690977
|
const isAgenticSearchEnabled = false;
|
|
690689
690978
|
const [currentBranch, setCurrentBranch] = import_react163.default.useState(null);
|
|
690690
690979
|
const [branchFilterEnabled, setBranchFilterEnabled] = import_react163.default.useState(false);
|
|
@@ -691049,14 +691338,14 @@ function LogSelector(t0) {
|
|
|
691049
691338
|
break bb2;
|
|
691050
691339
|
}
|
|
691051
691340
|
let t302;
|
|
691052
|
-
if ($4[66] !== displayedLogs || $4[67] !==
|
|
691341
|
+
if ($4[66] !== displayedLogs || $4[67] !== highlightColor2 || $4[68] !== maxLabelWidth || $4[69] !== showAllProjects || $4[70] !== snippets) {
|
|
691053
691342
|
const sessionGroups = groupLogsBySessionId(displayedLogs);
|
|
691054
691343
|
t302 = Array.from(sessionGroups.entries()).map((t312) => {
|
|
691055
691344
|
const [sessionId, groupLogs] = t312;
|
|
691056
691345
|
const latestLog = groupLogs[0];
|
|
691057
691346
|
const indexInFiltered = displayedLogs.indexOf(latestLog);
|
|
691058
691347
|
const snippet_0 = snippets.get(latestLog);
|
|
691059
|
-
const snippetStr = snippet_0 ? formatSnippet(snippet_0,
|
|
691348
|
+
const snippetStr = snippet_0 ? formatSnippet(snippet_0, highlightColor2) : null;
|
|
691060
691349
|
if (groupLogs.length === 1) {
|
|
691061
691350
|
const metadata = buildLogMetadata(latestLog, {
|
|
691062
691351
|
showProjectPath: showAllProjects
|
|
@@ -691077,7 +691366,7 @@ function LogSelector(t0) {
|
|
|
691077
691366
|
const children3 = groupLogs.slice(1).map((log_8, index2) => {
|
|
691078
691367
|
const childIndexInFiltered = displayedLogs.indexOf(log_8);
|
|
691079
691368
|
const childSnippet = snippets.get(log_8);
|
|
691080
|
-
const childSnippetStr = childSnippet ? formatSnippet(childSnippet,
|
|
691369
|
+
const childSnippetStr = childSnippet ? formatSnippet(childSnippet, highlightColor2) : null;
|
|
691081
691370
|
const childMetadata = buildLogMetadata(log_8, {
|
|
691082
691371
|
isChild: true,
|
|
691083
691372
|
showProjectPath: showAllProjects
|
|
@@ -691116,7 +691405,7 @@ function LogSelector(t0) {
|
|
|
691116
691405
|
};
|
|
691117
691406
|
});
|
|
691118
691407
|
$4[66] = displayedLogs;
|
|
691119
|
-
$4[67] =
|
|
691408
|
+
$4[67] = highlightColor2;
|
|
691120
691409
|
$4[68] = maxLabelWidth;
|
|
691121
691410
|
$4[69] = showAllProjects;
|
|
691122
691411
|
$4[70] = snippets;
|
|
@@ -691141,9 +691430,9 @@ function LogSelector(t0) {
|
|
|
691141
691430
|
break bb3;
|
|
691142
691431
|
}
|
|
691143
691432
|
let t312;
|
|
691144
|
-
if ($4[73] !== displayedLogs || $4[74] !==
|
|
691433
|
+
if ($4[73] !== displayedLogs || $4[74] !== highlightColor2 || $4[75] !== maxLabelWidth || $4[76] !== showAllProjects || $4[77] !== snippets) {
|
|
691145
691434
|
let t323;
|
|
691146
|
-
if ($4[79] !==
|
|
691435
|
+
if ($4[79] !== highlightColor2 || $4[80] !== maxLabelWidth || $4[81] !== showAllProjects || $4[82] !== snippets) {
|
|
691147
691436
|
t323 = (log_9, index_0) => {
|
|
691148
691437
|
const rawSummary = getLogDisplayTitle(log_9);
|
|
691149
691438
|
const summaryWithSidechain = rawSummary + (log_9.isSidechain ? " (sidechain)" : "");
|
|
@@ -691151,7 +691440,7 @@ function LogSelector(t0) {
|
|
|
691151
691440
|
const baseDescription = formatLogMetadata(log_9);
|
|
691152
691441
|
const projectSuffix = showAllProjects && log_9.projectPath ? ` \xB7 ${log_9.projectPath}` : "";
|
|
691153
691442
|
const snippet_1 = snippets.get(log_9);
|
|
691154
|
-
const snippetStr_0 = snippet_1 ? formatSnippet(snippet_1,
|
|
691443
|
+
const snippetStr_0 = snippet_1 ? formatSnippet(snippet_1, highlightColor2) : null;
|
|
691155
691444
|
return {
|
|
691156
691445
|
label: summary,
|
|
691157
691446
|
description: snippetStr_0 ? `${baseDescription}${projectSuffix}
|
|
@@ -691160,7 +691449,7 @@ function LogSelector(t0) {
|
|
|
691160
691449
|
value: index_0.toString()
|
|
691161
691450
|
};
|
|
691162
691451
|
};
|
|
691163
|
-
$4[79] =
|
|
691452
|
+
$4[79] = highlightColor2;
|
|
691164
691453
|
$4[80] = maxLabelWidth;
|
|
691165
691454
|
$4[81] = showAllProjects;
|
|
691166
691455
|
$4[82] = snippets;
|
|
@@ -691170,7 +691459,7 @@ function LogSelector(t0) {
|
|
|
691170
691459
|
}
|
|
691171
691460
|
t312 = displayedLogs.map(t323);
|
|
691172
691461
|
$4[73] = displayedLogs;
|
|
691173
|
-
$4[74] =
|
|
691462
|
+
$4[74] = highlightColor2;
|
|
691174
691463
|
$4[75] = maxLabelWidth;
|
|
691175
691464
|
$4[76] = showAllProjects;
|
|
691176
691465
|
$4[77] = snippets;
|
|
@@ -700000,7 +700289,7 @@ var init_autocompact2 = __esm(() => {
|
|
|
700000
700289
|
});
|
|
700001
700290
|
|
|
700002
700291
|
// src/commands/cd/cdLogic.ts
|
|
700003
|
-
import { realpathSync as realpathSync8, statSync as
|
|
700292
|
+
import { realpathSync as realpathSync8, statSync as statSync19 } from "fs";
|
|
700004
700293
|
import { resolve as resolve57 } from "path";
|
|
700005
700294
|
function resolveDirectoryTarget(target) {
|
|
700006
700295
|
const resolved = resolve57(target);
|
|
@@ -700011,7 +700300,7 @@ function resolveDirectoryTarget(target) {
|
|
|
700011
700300
|
return { ok: false, error: `Directory does not exist: ${resolved}` };
|
|
700012
700301
|
}
|
|
700013
700302
|
try {
|
|
700014
|
-
if (!
|
|
700303
|
+
if (!statSync19(physical).isDirectory()) {
|
|
700015
700304
|
return { ok: false, error: `Not a directory: ${resolved}` };
|
|
700016
700305
|
}
|
|
700017
700306
|
} catch {
|
|
@@ -729276,7 +729565,7 @@ import {
|
|
|
729276
729565
|
symlink as symlink5,
|
|
729277
729566
|
utimes as utimes2
|
|
729278
729567
|
} from "fs/promises";
|
|
729279
|
-
import { existsSync as existsSync26, readFileSync as readFileSync34, statSync as
|
|
729568
|
+
import { existsSync as existsSync26, readFileSync as readFileSync34, statSync as statSync20 } from "fs";
|
|
729280
729569
|
import { basename as basename51, dirname as dirname73, join as join166 } from "path";
|
|
729281
729570
|
function validateWorktreeSlug(slug) {
|
|
729282
729571
|
if (slug.length > MAX_WORKTREE_SLUG_LENGTH) {
|
|
@@ -729323,7 +729612,7 @@ function getLinkedGitWorktreePath() {
|
|
|
729323
729612
|
const dotGit = join166(dir, ".git");
|
|
729324
729613
|
try {
|
|
729325
729614
|
if (existsSync26(dotGit)) {
|
|
729326
|
-
const stats =
|
|
729615
|
+
const stats = statSync20(dotGit);
|
|
729327
729616
|
if (stats.isFile()) {
|
|
729328
729617
|
const content = readFileSync34(dotGit, "utf8").trim();
|
|
729329
729618
|
if (content.startsWith("gitdir:")) {
|
|
@@ -816549,8 +816838,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands7, tools, initia
|
|
|
816549
816838
|
const mutableMessages = initialMessages;
|
|
816550
816839
|
let readFileState = extractReadFilesFromMessages(initialMessages, cwd2(), READ_FILE_STATE_CACHE_SIZE);
|
|
816551
816840
|
const pendingSeeds = createFileStateCacheWithSizeLimit(READ_FILE_STATE_CACHE_SIZE);
|
|
816552
|
-
|
|
816553
|
-
if (turnInterruptionState && turnInterruptionState.kind !== "none" && resumeInterruptedTurnEnv) {
|
|
816841
|
+
if (turnInterruptionState && turnInterruptionState.kind !== "none" && isEnvTruthy(process.env.CLAUDE_CODE_RESUME_INTERRUPTED_TURN)) {
|
|
816554
816842
|
logForDebugging(`[print.ts] Auto-resuming interrupted turn (kind: ${turnInterruptionState.kind})`);
|
|
816555
816843
|
removeInterruptedMessage(mutableMessages, turnInterruptionState.message);
|
|
816556
816844
|
enqueue({
|