@cnwenf/occ 2.1.322 → 2.1.324
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/cli.js +118 -175
- 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.324","BINARY_NAME":"occ","BUILD_TIME":"2026-09-07T19:25:37.674Z","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;
|
|
@@ -59645,6 +59645,8 @@ var init_types2 = __esm(() => {
|
|
|
59645
59645
|
skillOverrides: exports_external.record(exports_external.string(), exports_external.enum(["on", "name-only", "user-invocable-only", "off"])).optional().describe('Per-skill listing overrides keyed by skill name. "name-only" lists the skill without its description; "user-invocable-only" hides it from the model but keeps /name; "off" hides it from both. Absent = on.'),
|
|
59646
59646
|
disableBundledSkills: exports_external.boolean().optional().describe("Disable the skills and workflows that ship with Claude Code: bundled skills and workflows are removed entirely; built-in slash commands stay typable but are hidden from the model. Plugins, .claude/skills/, and .claude/commands/ are unaffected. Equivalent to CLAUDE_CODE_DISABLE_BUNDLED_SKILLS=1."),
|
|
59647
59647
|
defaultShell: exports_external.enum(["bash", "powershell"]).optional().describe("Default shell for input-box ! commands. " + "Defaults to 'bash' on all platforms (no Windows auto-flip)."),
|
|
59648
|
+
bashOutputMaxChars: exports_external.number().int().positive().optional().catch(undefined).describe("How many characters of a successful Bash or PowerShell command's output Claude receives inline (default 30000; values clamp to 4000-128000). Output past this is saved to a file and Claude receives a short preview plus the path. When set, this also replaces BASH_MAX_OUTPUT_LENGTH, which on its own only sizes the read-back window."),
|
|
59649
|
+
taskOutputMaxChars: exports_external.number().int().positive().optional().catch(undefined).describe("How many characters of a background task's output the TaskOutput tool hands Claude inline (default 32000; values clamp to 4000-128000). Longer output is cut to its most recent characters with the path of the full output file, except that a shell command still running returns its first characters up to this size. When set, this also replaces TASK_MAX_OUTPUT_LENGTH, which on its own only sizes that window."),
|
|
59648
59650
|
respondToBashCommands: exports_external.boolean().optional().describe("Whether Claude responds after an input-box ! bash command runs. Set to false to add the command output to context without a response. Default: true."),
|
|
59649
59651
|
allowManagedHooksOnly: exports_external.boolean().optional().describe("When true (and set in managed settings), only hooks from managed settings run. " + "User, project, and local hooks are ignored."),
|
|
59650
59652
|
allowedHttpHookUrls: exports_external.array(exports_external.string()).optional().describe("Allowlist of URL patterns that HTTP hooks may target. " + 'Supports * as a wildcard (e.g. "https://hooks.example.com/*"). ' + "When set, HTTP hooks with non-matching URLs are blocked. " + "If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. " + "Arrays merge across settings sources (same semantics as allowedMcpServers)."),
|
|
@@ -59699,7 +59701,7 @@ var init_types2 = __esm(() => {
|
|
|
59699
59701
|
tui: exports_external.enum(["default", "fullscreen"]).optional().describe('Terminal UI renderer. "fullscreen" uses the flicker-free alt-screen renderer with virtualized scrollback (equivalent to CLAUDE_CODE_NO_FLICKER=1). "default" uses the classic main-screen renderer.'),
|
|
59700
59702
|
axScreenReader: exports_external.boolean().optional().describe("Render screen-reader friendly output (flat text, no decorative borders or animations). Overridden by the CLAUDE_AX_SCREEN_READER env var and the --ax-screen-reader CLI flag."),
|
|
59701
59703
|
viewMode: exports_external.enum(["default", "verbose", "focus"]).optional().catch(undefined).describe("Default transcript view mode on startup"),
|
|
59702
|
-
keybindingFlavor: exports_external.enum(["classic", "readline"]).optional().catch(undefined).describe(`
|
|
59704
|
+
keybindingFlavor: exports_external.enum(["classic", "readline"]).optional().catch(undefined).describe(`Deprecated: no longer has any effect. The prompt's word-editing keys always follow Bash (readline) conventions.`),
|
|
59703
59705
|
vimInsertModeRemaps: exports_external.record(exports_external.string(), exports_external.unknown()).optional().catch(undefined).describe('Vim INSERT-mode key-sequence remaps, e.g. {"jj": "<Esc>"}. Each key is exactly two printable characters typed in sequence; "<Esc>" (return to NORMAL mode) is the only supported target. Applies when editorMode is "vim".'),
|
|
59704
59706
|
externalEditorContext: exports_external.boolean().optional().describe("Show the last assistant response as commented context above the prompt when opening the external editor (Ctrl+G)."),
|
|
59705
59707
|
prUrlTemplate: exports_external.string().optional().describe('URL template for the footer PR badge (e.g. "https://internal-review.example.com/pr/{number}"). Uses {number} as the PR number placeholder. Defaults to github.com.'),
|
|
@@ -252228,13 +252230,25 @@ class CircularBuffer {
|
|
|
252228
252230
|
}
|
|
252229
252231
|
|
|
252230
252232
|
// src/utils/shell/outputLimits.ts
|
|
252233
|
+
function clampOutputChars(value) {
|
|
252234
|
+
if (value === undefined)
|
|
252235
|
+
return;
|
|
252236
|
+
return Math.min(Math.max(value, OUTPUT_CHARS_MIN), OUTPUT_CHARS_MAX);
|
|
252237
|
+
}
|
|
252238
|
+
function getBashOutputMaxChars() {
|
|
252239
|
+
return clampOutputChars(getInitialSettings().bashOutputMaxChars) ?? BASH_MAX_OUTPUT_DEFAULT;
|
|
252240
|
+
}
|
|
252231
252241
|
function getMaxOutputLength() {
|
|
252242
|
+
const fromSettings = clampOutputChars(getInitialSettings().bashOutputMaxChars);
|
|
252243
|
+
if (fromSettings !== undefined)
|
|
252244
|
+
return fromSettings;
|
|
252232
252245
|
const result = validateBoundedIntEnvVar("BASH_MAX_OUTPUT_LENGTH", process.env.BASH_MAX_OUTPUT_LENGTH, BASH_MAX_OUTPUT_DEFAULT, BASH_MAX_OUTPUT_UPPER_LIMIT);
|
|
252233
252246
|
return result.effective;
|
|
252234
252247
|
}
|
|
252235
|
-
var BASH_MAX_OUTPUT_UPPER_LIMIT = 150000, BASH_MAX_OUTPUT_DEFAULT = 30000;
|
|
252248
|
+
var BASH_MAX_OUTPUT_UPPER_LIMIT = 150000, BASH_MAX_OUTPUT_DEFAULT = 30000, OUTPUT_CHARS_MIN = 4000, OUTPUT_CHARS_MAX = 128000;
|
|
252236
252249
|
var init_outputLimits = __esm(() => {
|
|
252237
252250
|
init_envValidation();
|
|
252251
|
+
init_settings2();
|
|
252238
252252
|
});
|
|
252239
252253
|
|
|
252240
252254
|
// src/utils/task/TaskOutput.ts
|
|
@@ -383877,7 +383891,7 @@ async function* runShellCommand({
|
|
|
383877
383891
|
}
|
|
383878
383892
|
}
|
|
383879
383893
|
var jsx_runtime53, EOL4 = `
|
|
383880
|
-
`, PROGRESS_THRESHOLD_MS = 2000, ASSISTANT_BLOCKING_BUDGET_MS = 15000, BASH_SEARCH_COMMANDS, BASH_READ_COMMANDS, BASH_LIST_COMMANDS, BASH_SEMANTIC_NEUTRAL_COMMANDS, BASH_SILENT_COMMANDS, DISALLOWED_AUTO_BACKGROUND_COMMANDS, isBackgroundTasksDisabled, fullInputSchema, inputSchema9, COMMON_BACKGROUND_COMMANDS, outputSchema9, GH_RATE_LIMIT_HINT_THROTTLE_MS = 60000, ghRateLimitHintAfterMs = 0, GH_RATE_LIMIT_HINT = "<system-reminder>GitHub API rate limit exceeded (5,000/hr shared across all tools and agents). Run `gh api rate_limit --jq .resources` and sleep until reset before further gh calls. If polling in a loop, use ScheduleWakeup instead of retrying.</system-reminder>", GH_COMMAND_RE, GH_RATE_LIMIT_OUTPUT_RE, BASH_READ_FILE_COMMANDS, BashTool;
|
|
383894
|
+
`, PROGRESS_THRESHOLD_MS = 2000, ASSISTANT_BLOCKING_BUDGET_MS = 15000, BASH_SEARCH_COMMANDS, BASH_READ_COMMANDS, BASH_LIST_COMMANDS, BASH_SEMANTIC_NEUTRAL_COMMANDS, BASH_SILENT_COMMANDS, DISALLOWED_AUTO_BACKGROUND_COMMANDS, isBackgroundTasksDisabled, fullInputSchema, inputSchema9, COMMON_BACKGROUND_COMMANDS, outputSchema9, GH_RATE_LIMIT_HINT_THROTTLE_MS = 60000, ghRateLimitHintAfterMs = 0, GH_RATE_LIMIT_HINT = "<system-reminder>GitHub API rate limit exceeded (5,000/hr shared across all tools and agents). Run `gh api rate_limit --jq .resources` and sleep until reset before further gh calls. If polling in a loop, use ScheduleWakeup instead of retrying.</system-reminder>", GH_COMMAND_RE, GH_RATE_LIMIT_OUTPUT_RE, BASH_READ_FILE_COMMANDS, BASH_MAX_RESULT_SIZE_CHARS_DEFAULT = 30000, BashTool;
|
|
383881
383895
|
var init_BashTool = __esm(() => {
|
|
383882
383896
|
init_featureFlags();
|
|
383883
383897
|
init_v4();
|
|
@@ -383901,6 +383915,7 @@ var init_BashTool = __esm(() => {
|
|
|
383901
383915
|
init_cwd2();
|
|
383902
383916
|
init_hintRecommendation();
|
|
383903
383917
|
init_Shell();
|
|
383918
|
+
init_outputLimits();
|
|
383904
383919
|
init_sandbox_adapter();
|
|
383905
383920
|
init_semanticBoolean();
|
|
383906
383921
|
init_semanticNumber();
|
|
@@ -384003,7 +384018,9 @@ For commands that are harder to parse at a glance (piped commands, obscure flags
|
|
|
384003
384018
|
BashTool = buildTool({
|
|
384004
384019
|
name: BASH_TOOL_NAME,
|
|
384005
384020
|
searchHint: "execute shell commands",
|
|
384006
|
-
maxResultSizeChars
|
|
384021
|
+
get maxResultSizeChars() {
|
|
384022
|
+
return BASH_MAX_RESULT_SIZE_CHARS_DEFAULT;
|
|
384023
|
+
},
|
|
384007
384024
|
strict: true,
|
|
384008
384025
|
async description({
|
|
384009
384026
|
description
|
|
@@ -384356,6 +384373,11 @@ ${ghHint}` : ghHint;
|
|
|
384356
384373
|
return isOutputLineTruncated(output.stdout) || isOutputLineTruncated(output.stderr);
|
|
384357
384374
|
}
|
|
384358
384375
|
});
|
|
384376
|
+
Object.defineProperty(BashTool, "maxResultSizeChars", {
|
|
384377
|
+
get: () => getBashOutputMaxChars(),
|
|
384378
|
+
enumerable: true,
|
|
384379
|
+
configurable: true
|
|
384380
|
+
});
|
|
384359
384381
|
});
|
|
384360
384382
|
|
|
384361
384383
|
// src/tools/BashTool/bashCommandHelpers.ts
|
|
@@ -574624,7 +574646,13 @@ var init_BriefTool = __esm(() => {
|
|
|
574624
574646
|
});
|
|
574625
574647
|
|
|
574626
574648
|
// src/utils/task/outputFormatting.ts
|
|
574649
|
+
function getTaskOutputMaxChars() {
|
|
574650
|
+
return clampOutputChars(getInitialSettings().taskOutputMaxChars) ?? TASK_MAX_OUTPUT_DEFAULT;
|
|
574651
|
+
}
|
|
574627
574652
|
function getMaxTaskOutputLength() {
|
|
574653
|
+
const fromSettings = clampOutputChars(getInitialSettings().taskOutputMaxChars);
|
|
574654
|
+
if (fromSettings !== undefined)
|
|
574655
|
+
return fromSettings;
|
|
574628
574656
|
const result = validateBoundedIntEnvVar("TASK_MAX_OUTPUT_LENGTH", process.env.TASK_MAX_OUTPUT_LENGTH, TASK_MAX_OUTPUT_DEFAULT, TASK_MAX_OUTPUT_UPPER_LIMIT);
|
|
574629
574657
|
return result.effective;
|
|
574630
574658
|
}
|
|
@@ -574641,9 +574669,11 @@ function formatTaskOutput(output2, taskId) {
|
|
|
574641
574669
|
const truncated = output2.slice(-availableSpace);
|
|
574642
574670
|
return { content: header + truncated, wasTruncated: true };
|
|
574643
574671
|
}
|
|
574644
|
-
var TASK_MAX_OUTPUT_UPPER_LIMIT = 160000, TASK_MAX_OUTPUT_DEFAULT = 32000;
|
|
574672
|
+
var TASK_MAX_OUTPUT_UPPER_LIMIT = 160000, TASK_MAX_OUTPUT_DEFAULT = 32000, TASK_OUTPUT_INLINE_HEADROOM = 18000;
|
|
574645
574673
|
var init_outputFormatting = __esm(() => {
|
|
574646
574674
|
init_envValidation();
|
|
574675
|
+
init_outputLimits();
|
|
574676
|
+
init_settings2();
|
|
574647
574677
|
init_diskOutput();
|
|
574648
574678
|
});
|
|
574649
574679
|
|
|
@@ -575078,7 +575108,7 @@ function TaskOutputResultDisplay(t0) {
|
|
|
575078
575108
|
}
|
|
575079
575109
|
return t5;
|
|
575080
575110
|
}
|
|
575081
|
-
var import_compiler_runtime115, jsx_runtime141, inputSchema20, TaskOutputTool;
|
|
575111
|
+
var import_compiler_runtime115, jsx_runtime141, inputSchema20, TASK_OUTPUT_MAX_RESULT_SIZE_CHARS_DEFAULT = 50000, TaskOutputTool;
|
|
575082
575112
|
var init_TaskOutputTool = __esm(() => {
|
|
575083
575113
|
init_v4();
|
|
575084
575114
|
init_FallbackToolUseErrorMessage();
|
|
@@ -575107,7 +575137,9 @@ var init_TaskOutputTool = __esm(() => {
|
|
|
575107
575137
|
TaskOutputTool = buildTool({
|
|
575108
575138
|
name: TASK_OUTPUT_TOOL_NAME,
|
|
575109
575139
|
searchHint: "read output/logs from a background task",
|
|
575110
|
-
maxResultSizeChars
|
|
575140
|
+
get maxResultSizeChars() {
|
|
575141
|
+
return TASK_OUTPUT_MAX_RESULT_SIZE_CHARS_DEFAULT;
|
|
575142
|
+
},
|
|
575111
575143
|
shouldDefer: true,
|
|
575112
575144
|
aliases: ["AgentOutputTool", "BashOutputTool"],
|
|
575113
575145
|
userFacingName() {
|
|
@@ -575334,6 +575366,11 @@ ${content.trimEnd()}
|
|
|
575334
575366
|
});
|
|
575335
575367
|
}
|
|
575336
575368
|
});
|
|
575369
|
+
Object.defineProperty(TaskOutputTool, "maxResultSizeChars", {
|
|
575370
|
+
get: () => getTaskOutputMaxChars() + TASK_OUTPUT_INLINE_HEADROOM,
|
|
575371
|
+
enumerable: true,
|
|
575372
|
+
configurable: true
|
|
575373
|
+
});
|
|
575337
575374
|
});
|
|
575338
575375
|
|
|
575339
575376
|
// src/tools/WebSearchTool/UI.tsx
|
|
@@ -593019,7 +593056,7 @@ async function* runPowerShellCommand({
|
|
|
593019
593056
|
}
|
|
593020
593057
|
}
|
|
593021
593058
|
var jsx_runtime158, EOL6 = `
|
|
593022
|
-
`, PS_SEARCH_COMMANDS, PS_READ_COMMANDS, PS_SEMANTIC_NEUTRAL_COMMANDS, PROGRESS_THRESHOLD_MS3 = 2000, PROGRESS_INTERVAL_MS = 1000, ASSISTANT_BLOCKING_BUDGET_MS2 = 15000, DISALLOWED_AUTO_BACKGROUND_COMMANDS2, WINDOWS_SANDBOX_POLICY_REFUSAL = "Enterprise policy requires sandboxing, but sandboxing is not available on native Windows. Shell command execution is blocked on this platform by policy.", isBackgroundTasksDisabled4, fullInputSchema3, inputSchema43, outputSchema39, COMMON_BACKGROUND_COMMANDS2, PowerShellTool;
|
|
593059
|
+
`, PS_SEARCH_COMMANDS, PS_READ_COMMANDS, PS_SEMANTIC_NEUTRAL_COMMANDS, PROGRESS_THRESHOLD_MS3 = 2000, PROGRESS_INTERVAL_MS = 1000, ASSISTANT_BLOCKING_BUDGET_MS2 = 15000, DISALLOWED_AUTO_BACKGROUND_COMMANDS2, WINDOWS_SANDBOX_POLICY_REFUSAL = "Enterprise policy requires sandboxing, but sandboxing is not available on native Windows. Shell command execution is blocked on this platform by policy.", isBackgroundTasksDisabled4, fullInputSchema3, inputSchema43, outputSchema39, COMMON_BACKGROUND_COMMANDS2, POWERSHELL_MAX_RESULT_SIZE_CHARS_DEFAULT = 30000, PowerShellTool;
|
|
593023
593060
|
var init_PowerShellTool = __esm(() => {
|
|
593024
593061
|
init_featureFlags();
|
|
593025
593062
|
init_v4();
|
|
@@ -593036,6 +593073,7 @@ var init_PowerShellTool = __esm(() => {
|
|
|
593036
593073
|
init_platform2();
|
|
593037
593074
|
init_hintRecommendation();
|
|
593038
593075
|
init_Shell();
|
|
593076
|
+
init_outputLimits();
|
|
593039
593077
|
init_sandbox_adapter();
|
|
593040
593078
|
init_semanticBoolean();
|
|
593041
593079
|
init_semanticNumber();
|
|
@@ -593110,7 +593148,9 @@ var init_PowerShellTool = __esm(() => {
|
|
|
593110
593148
|
PowerShellTool = buildTool({
|
|
593111
593149
|
name: POWERSHELL_TOOL_NAME,
|
|
593112
593150
|
searchHint: "execute Windows PowerShell commands",
|
|
593113
|
-
maxResultSizeChars
|
|
593151
|
+
get maxResultSizeChars() {
|
|
593152
|
+
return POWERSHELL_MAX_RESULT_SIZE_CHARS_DEFAULT;
|
|
593153
|
+
},
|
|
593114
593154
|
strict: true,
|
|
593115
593155
|
async description({
|
|
593116
593156
|
description
|
|
@@ -593413,6 +593453,11 @@ var init_PowerShellTool = __esm(() => {
|
|
|
593413
593453
|
return isOutputLineTruncated(output2.stdout) || isOutputLineTruncated(output2.stderr);
|
|
593414
593454
|
}
|
|
593415
593455
|
});
|
|
593456
|
+
Object.defineProperty(PowerShellTool, "maxResultSizeChars", {
|
|
593457
|
+
get: () => getBashOutputMaxChars(),
|
|
593458
|
+
enumerable: true,
|
|
593459
|
+
configurable: true
|
|
593460
|
+
});
|
|
593416
593461
|
});
|
|
593417
593462
|
|
|
593418
593463
|
// src/tools.ts
|
|
@@ -638834,23 +638879,6 @@ class Cursor {
|
|
|
638834
638879
|
const nextLineEnd = this.findLogicalLineEnd(nextLineStart);
|
|
638835
638880
|
return this.createCursorWithColumn(nextLineStart, nextLineEnd, currentColumn);
|
|
638836
638881
|
}
|
|
638837
|
-
nextWord() {
|
|
638838
|
-
if (this.isAtEnd()) {
|
|
638839
|
-
return this;
|
|
638840
|
-
}
|
|
638841
|
-
const chip = this.placeholderStartingAt(this.offset) ?? this.placeholderContaining(this.offset);
|
|
638842
|
-
if (chip) {
|
|
638843
|
-
return new Cursor(this.measuredText, chip.end);
|
|
638844
|
-
}
|
|
638845
|
-
const wordBoundaries = this.measuredText.getWordBoundaries();
|
|
638846
|
-
for (const boundary of wordBoundaries) {
|
|
638847
|
-
if (boundary.isWordLike && boundary.start > this.offset) {
|
|
638848
|
-
const target = this.snapOutOfPlaceholder(boundary.start, "end");
|
|
638849
|
-
return new Cursor(this.measuredText, target);
|
|
638850
|
-
}
|
|
638851
|
-
}
|
|
638852
|
-
return new Cursor(this.measuredText, this.text.length);
|
|
638853
|
-
}
|
|
638854
638882
|
endOfWord() {
|
|
638855
638883
|
if (this.isAtEnd()) {
|
|
638856
638884
|
return this;
|
|
@@ -638878,37 +638906,6 @@ class Cursor {
|
|
|
638878
638906
|
}
|
|
638879
638907
|
return this;
|
|
638880
638908
|
}
|
|
638881
|
-
prevWord() {
|
|
638882
|
-
if (this.isAtStart()) {
|
|
638883
|
-
return this;
|
|
638884
|
-
}
|
|
638885
|
-
const chipEnding = this.placeholderEndingAt(this.offset);
|
|
638886
|
-
if (chipEnding) {
|
|
638887
|
-
return new Cursor(this.measuredText, chipEnding.start);
|
|
638888
|
-
}
|
|
638889
|
-
const chipContaining = this.placeholderContaining(this.offset);
|
|
638890
|
-
if (chipContaining) {
|
|
638891
|
-
return new Cursor(this.measuredText, chipContaining.start);
|
|
638892
|
-
}
|
|
638893
|
-
const wordBoundaries = this.measuredText.getWordBoundaries();
|
|
638894
|
-
let prevWordStart = null;
|
|
638895
|
-
for (const boundary of wordBoundaries) {
|
|
638896
|
-
if (!boundary.isWordLike)
|
|
638897
|
-
continue;
|
|
638898
|
-
if (boundary.start < this.offset) {
|
|
638899
|
-
if (this.offset > boundary.start && this.offset <= boundary.end) {
|
|
638900
|
-
const target = this.snapOutOfPlaceholder(boundary.start, "start");
|
|
638901
|
-
return new Cursor(this.measuredText, target);
|
|
638902
|
-
}
|
|
638903
|
-
prevWordStart = boundary.start;
|
|
638904
|
-
}
|
|
638905
|
-
}
|
|
638906
|
-
if (prevWordStart !== null) {
|
|
638907
|
-
const target = this.snapOutOfPlaceholder(prevWordStart, "start");
|
|
638908
|
-
return new Cursor(this.measuredText, target);
|
|
638909
|
-
}
|
|
638910
|
-
return new Cursor(this.measuredText, 0);
|
|
638911
|
-
}
|
|
638912
638909
|
nextVimWord() {
|
|
638913
638910
|
if (this.isAtEnd()) {
|
|
638914
638911
|
return this;
|
|
@@ -639147,45 +639144,12 @@ class Cursor {
|
|
|
639147
639144
|
}
|
|
639148
639145
|
return this.killRange(this.offset, this.endOfLogicalLine().offset).cursor;
|
|
639149
639146
|
}
|
|
639150
|
-
deleteWordBefore() {
|
|
639151
|
-
if (this.isAtStart()) {
|
|
639152
|
-
return { cursor: this, killed: "" };
|
|
639153
|
-
}
|
|
639154
|
-
return this.killRange(this.prevWord().offset, this.offset);
|
|
639155
|
-
}
|
|
639156
639147
|
deleteWORDBefore() {
|
|
639157
639148
|
if (this.isAtStart()) {
|
|
639158
639149
|
return { cursor: this, killed: "" };
|
|
639159
639150
|
}
|
|
639160
639151
|
return this.killRange(this.prevWORD().offset, this.offset);
|
|
639161
639152
|
}
|
|
639162
|
-
deleteTokenBefore() {
|
|
639163
|
-
const chipAfter = this.placeholderStartingAt(this.offset);
|
|
639164
|
-
if (chipAfter) {
|
|
639165
|
-
const end = this.text[chipAfter.end] === " " ? chipAfter.end + 1 : chipAfter.end;
|
|
639166
|
-
return this.modifyText(new Cursor(this.measuredText, end));
|
|
639167
|
-
}
|
|
639168
|
-
if (this.isAtStart()) {
|
|
639169
|
-
return null;
|
|
639170
|
-
}
|
|
639171
|
-
const charAfter = this.text[this.offset];
|
|
639172
|
-
if (charAfter !== undefined && !/\s/.test(charAfter)) {
|
|
639173
|
-
return null;
|
|
639174
|
-
}
|
|
639175
|
-
const textBefore = this.text.slice(0, this.offset);
|
|
639176
|
-
const pasteMatch = textBefore.match(/(^|\s)\[(Pasted text #\d+(?: \+\d+ lines)?|Image #\d+|Audio #\d+|\.\.\.Truncated text #\d+ \+\d+ lines\.\.\.)\]$/);
|
|
639177
|
-
if (pasteMatch) {
|
|
639178
|
-
const matchStart = pasteMatch.index + pasteMatch[1].length;
|
|
639179
|
-
return new Cursor(this.measuredText, matchStart).modifyText(this);
|
|
639180
|
-
}
|
|
639181
|
-
return null;
|
|
639182
|
-
}
|
|
639183
|
-
deleteWordAfter() {
|
|
639184
|
-
if (this.isAtEnd()) {
|
|
639185
|
-
return this;
|
|
639186
|
-
}
|
|
639187
|
-
return this.killRange(this.offset, this.nextWord().offset).cursor;
|
|
639188
|
-
}
|
|
639189
639153
|
graphemeAt(pos) {
|
|
639190
639154
|
if (pos >= this.text.length)
|
|
639191
639155
|
return "";
|
|
@@ -639601,18 +639565,6 @@ var init_Cursor = __esm(() => {
|
|
|
639601
639565
|
WHITESPACE_REGEX2 = /\s/;
|
|
639602
639566
|
});
|
|
639603
639567
|
|
|
639604
|
-
// src/utils/keybindingFlavor.ts
|
|
639605
|
-
function getKeybindingFlavor() {
|
|
639606
|
-
return getInitialSettings().keybindingFlavor === "readline" ? "readline" : DEFAULT_KEYBINDING_FLAVOR;
|
|
639607
|
-
}
|
|
639608
|
-
function isReadlineKeybindingFlavor() {
|
|
639609
|
-
return getKeybindingFlavor() === "readline";
|
|
639610
|
-
}
|
|
639611
|
-
var DEFAULT_KEYBINDING_FLAVOR = "classic";
|
|
639612
|
-
var init_keybindingFlavor = __esm(() => {
|
|
639613
|
-
init_settings2();
|
|
639614
|
-
});
|
|
639615
|
-
|
|
639616
639568
|
// packages/modifiers-napi/src/index.ts
|
|
639617
639569
|
var exports_src6 = {};
|
|
639618
639570
|
__export(exports_src6, {
|
|
@@ -639725,7 +639677,6 @@ function useTextInput({
|
|
|
639725
639677
|
const setOffset = onOffsetChange;
|
|
639726
639678
|
const cursor = Cursor.fromText(originalValue, columns, offset);
|
|
639727
639679
|
const { addNotification, removeNotification } = useNotifications();
|
|
639728
|
-
const isReadline = isReadlineKeybindingFlavor();
|
|
639729
639680
|
const handleCtrlC = useDoublePress((show) => {
|
|
639730
639681
|
onExitMessage?.(show, "Ctrl-C");
|
|
639731
639682
|
}, () => onExit2?.(), () => {
|
|
@@ -639801,18 +639752,13 @@ function useTextInput({
|
|
|
639801
639752
|
}
|
|
639802
639753
|
return newCursor;
|
|
639803
639754
|
}
|
|
639804
|
-
function killWordBefore() {
|
|
639805
|
-
const { cursor: newCursor, killed } = cursor.deleteWordBefore();
|
|
639806
|
-
recordKill(killed, "prepend");
|
|
639807
|
-
return newCursor;
|
|
639808
|
-
}
|
|
639809
639755
|
function killWORDBefore() {
|
|
639810
639756
|
const { cursor: newCursor, killed } = cursor.deleteWORDBefore();
|
|
639811
639757
|
recordKill(killed, "prepend");
|
|
639812
639758
|
return newCursor;
|
|
639813
639759
|
}
|
|
639814
639760
|
function killWordBeforeFlavored() {
|
|
639815
|
-
const { cursor: newCursor, killed } =
|
|
639761
|
+
const { cursor: newCursor, killed } = cursor.backwardKillWord();
|
|
639816
639762
|
recordKill(killed, "prepend");
|
|
639817
639763
|
return newCursor;
|
|
639818
639764
|
}
|
|
@@ -639852,17 +639798,17 @@ function useTextInput({
|
|
|
639852
639798
|
["d", fullscreen ? NOOP_HANDLER : handleCtrlD],
|
|
639853
639799
|
["e", () => cursor.endOfLine()],
|
|
639854
639800
|
["f", fullscreen ? NOOP_HANDLER : () => cursor.right()],
|
|
639855
|
-
["h", () => cursor.
|
|
639801
|
+
["h", () => cursor.backspace()],
|
|
639856
639802
|
["n", () => downOrHistoryDown()],
|
|
639857
639803
|
["p", () => upOrHistoryUp()],
|
|
639858
639804
|
["u", fullscreen ? NOOP_HANDLER : killToLineStart],
|
|
639859
|
-
["w",
|
|
639805
|
+
["w", killWORDBefore],
|
|
639860
639806
|
["y", yank]
|
|
639861
639807
|
]);
|
|
639862
639808
|
const handleMeta = mapInput([
|
|
639863
|
-
["b", () =>
|
|
639864
|
-
["f", () =>
|
|
639865
|
-
["d",
|
|
639809
|
+
["b", () => cursor.backwardWord()],
|
|
639810
|
+
["f", () => cursor.forwardWord()],
|
|
639811
|
+
["d", killWordAfter],
|
|
639866
639812
|
["y", handleYankPop]
|
|
639867
639813
|
]);
|
|
639868
639814
|
function handleEnter(key4) {
|
|
@@ -639927,11 +639873,11 @@ function useTextInput({
|
|
|
639927
639873
|
return cursor;
|
|
639928
639874
|
};
|
|
639929
639875
|
case (key4.leftArrow && (key4.ctrl || key4.meta || key4.fn)):
|
|
639930
|
-
return () =>
|
|
639876
|
+
return () => cursor.backwardWord();
|
|
639931
639877
|
case (key4.rightArrow && (key4.ctrl || key4.meta || key4.fn)):
|
|
639932
|
-
return () =>
|
|
639878
|
+
return () => cursor.forwardWord();
|
|
639933
639879
|
case key4.backspace:
|
|
639934
|
-
return key4.super ? killToLineStart : key4.meta || key4.ctrl ? killWordBeforeFlavored : () => cursor.
|
|
639880
|
+
return key4.super ? killToLineStart : key4.meta || key4.ctrl ? killWordBeforeFlavored : () => cursor.backspace();
|
|
639935
639881
|
case key4.delete:
|
|
639936
639882
|
return key4.super || key4.meta ? killToLineEnd : () => cursor.del();
|
|
639937
639883
|
case key4.ctrl:
|
|
@@ -639996,7 +639942,7 @@ function useTextInput({
|
|
|
639996
639942
|
if (key4.ctrl && (input2 === "k" || input2 === "u" || input2 === "w")) {
|
|
639997
639943
|
return true;
|
|
639998
639944
|
}
|
|
639999
|
-
if (
|
|
639945
|
+
if (key4.meta && !key4.ctrl && input2 === "d") {
|
|
640000
639946
|
return true;
|
|
640001
639947
|
}
|
|
640002
639948
|
if (key4.backspace && (key4.meta || key4.super || key4.ctrl)) {
|
|
@@ -640019,7 +639965,7 @@ function useTextInput({
|
|
|
640019
639965
|
const delCount = (input2.match(/\x7f/g) || []).length;
|
|
640020
639966
|
let currentCursor = cursor;
|
|
640021
639967
|
for (let i6 = 0;i6 < delCount; i6++) {
|
|
640022
|
-
currentCursor = currentCursor.
|
|
639968
|
+
currentCursor = currentCursor.backspace();
|
|
640023
639969
|
}
|
|
640024
639970
|
if (!cursor.equals(currentCursor)) {
|
|
640025
639971
|
if (cursor.text !== currentCursor.text) {
|
|
@@ -640072,7 +640018,6 @@ var init_useTextInput = __esm(() => {
|
|
|
640072
640018
|
init_Cursor();
|
|
640073
640019
|
init_env();
|
|
640074
640020
|
init_fullscreen();
|
|
640075
|
-
init_keybindingFlavor();
|
|
640076
640021
|
init_useDoublePress();
|
|
640077
640022
|
init_srA11y();
|
|
640078
640023
|
init_screenReader();
|
|
@@ -648737,7 +648682,7 @@ var init_CustomThemeCreator = __esm(() => {
|
|
|
648737
648682
|
|
|
648738
648683
|
// src/components/ThemePicker.tsx
|
|
648739
648684
|
function ThemePicker(t0) {
|
|
648740
|
-
const $4 = import_compiler_runtime132.c(
|
|
648685
|
+
const $4 = import_compiler_runtime132.c(64);
|
|
648741
648686
|
const {
|
|
648742
648687
|
onThemeSelect,
|
|
648743
648688
|
showIntroText: t1,
|
|
@@ -648745,13 +648690,15 @@ function ThemePicker(t0) {
|
|
|
648745
648690
|
showHelpTextBelow: t32,
|
|
648746
648691
|
hideEscToCancel: t4,
|
|
648747
648692
|
skipExitHandling: t5,
|
|
648748
|
-
onCancel: onCancelProp
|
|
648693
|
+
onCancel: onCancelProp,
|
|
648694
|
+
allowCustomThemeCreation: t6a
|
|
648749
648695
|
} = t0;
|
|
648750
648696
|
const showIntroText = t1 === undefined ? false : t1;
|
|
648751
648697
|
const helpText = t22 === undefined ? "" : t22;
|
|
648752
648698
|
const showHelpTextBelow = t32 === undefined ? false : t32;
|
|
648753
648699
|
const hideEscToCancel = t4 === undefined ? false : t4;
|
|
648754
648700
|
const skipExitHandling = t5 === undefined ? false : t5;
|
|
648701
|
+
const allowCustomThemeCreation = t6a === undefined ? false : t6a;
|
|
648755
648702
|
const [theme, setThemeSetting] = useTheme();
|
|
648756
648703
|
const themeSetting = useThemeSetting();
|
|
648757
648704
|
const reloadCustomThemes = useReloadCustomThemes();
|
|
@@ -648886,15 +648833,17 @@ function ThemePicker(t0) {
|
|
|
648886
648833
|
const activeCustomSlug = typeof themeSetting === "string" && isCustomThemeSetting(themeSetting) ? parseCustomThemeSlug(themeSetting) : null;
|
|
648887
648834
|
const activeCustomTheme = activeCustomSlug ? customThemes.find((ct) => ct.slug === activeCustomSlug) : undefined;
|
|
648888
648835
|
let t10b;
|
|
648889
|
-
if ($4[59] !== customThemes) {
|
|
648836
|
+
if ($4[59] !== customThemes || $4[63] !== allowCustomThemeCreation) {
|
|
648837
|
+
const newCustomEntry = allowCustomThemeCreation ? [{
|
|
648838
|
+
label: NEW_CUSTOM_THEME_LABEL,
|
|
648839
|
+
value: NEW_CUSTOM_THEME_VALUE
|
|
648840
|
+
}] : [];
|
|
648890
648841
|
t10b = [...themeOptions, ...customThemes.map((ct) => ({
|
|
648891
648842
|
label: ct.name,
|
|
648892
648843
|
value: buildCustomThemeSlug(ct.slug)
|
|
648893
|
-
})),
|
|
648894
|
-
label: NEW_CUSTOM_THEME_LABEL,
|
|
648895
|
-
value: NEW_CUSTOM_THEME_VALUE
|
|
648896
|
-
}];
|
|
648844
|
+
})), ...newCustomEntry];
|
|
648897
648845
|
$4[59] = customThemes;
|
|
648846
|
+
$4[63] = allowCustomThemeCreation;
|
|
648898
648847
|
$4[60] = t10b;
|
|
648899
648848
|
} else {
|
|
648900
648849
|
t10b = $4[60];
|
|
@@ -650559,14 +650508,14 @@ var init_SearchBox = __esm(() => {
|
|
|
650559
650508
|
});
|
|
650560
650509
|
|
|
650561
650510
|
// src/hooks/useSearchInput.ts
|
|
650562
|
-
function isKillKey(e4
|
|
650511
|
+
function isKillKey(e4) {
|
|
650563
650512
|
if (e4.ctrl && (e4.key === "k" || e4.key === "u" || e4.key === "w")) {
|
|
650564
650513
|
return true;
|
|
650565
650514
|
}
|
|
650566
650515
|
if ((e4.meta || e4.ctrl) && e4.key === "backspace") {
|
|
650567
650516
|
return true;
|
|
650568
650517
|
}
|
|
650569
|
-
if (
|
|
650518
|
+
if (e4.meta && !e4.ctrl && e4.key.toLowerCase() === "d") {
|
|
650570
650519
|
return true;
|
|
650571
650520
|
}
|
|
650572
650521
|
return false;
|
|
@@ -650588,7 +650537,6 @@ function useSearchInput({
|
|
|
650588
650537
|
const effectiveColumns = columns ?? terminalColumns;
|
|
650589
650538
|
const [query2, setQueryState] = import_react107.useState(initialQuery);
|
|
650590
650539
|
const [cursorOffset, setCursorOffset] = import_react107.useState(initialQuery.length);
|
|
650591
|
-
const isReadline = isReadlineKeybindingFlavor();
|
|
650592
650540
|
const setQuery = import_react107.useCallback((q6) => {
|
|
650593
650541
|
setQueryState(q6);
|
|
650594
650542
|
setCursorOffset(q6.length);
|
|
@@ -650597,7 +650545,7 @@ function useSearchInput({
|
|
|
650597
650545
|
if (!isActive)
|
|
650598
650546
|
return;
|
|
650599
650547
|
const cursor = Cursor.fromText(query2, effectiveColumns, cursorOffset);
|
|
650600
|
-
if (!isKillKey(e4
|
|
650548
|
+
if (!isKillKey(e4)) {
|
|
650601
650549
|
resetKillAccumulation();
|
|
650602
650550
|
}
|
|
650603
650551
|
if (!isYankKey(e4)) {
|
|
@@ -650633,7 +650581,7 @@ function useSearchInput({
|
|
|
650633
650581
|
if (e4.key === "backspace") {
|
|
650634
650582
|
e4.preventDefault();
|
|
650635
650583
|
if (e4.meta || e4.ctrl) {
|
|
650636
|
-
const { cursor: newCursor2, killed } =
|
|
650584
|
+
const { cursor: newCursor2, killed } = cursor.backwardKillWord();
|
|
650637
650585
|
pushToKillRing(killed, "prepend");
|
|
650638
650586
|
setQueryState(newCursor2.text);
|
|
650639
650587
|
setCursorOffset(newCursor2.offset);
|
|
@@ -650658,13 +650606,13 @@ function useSearchInput({
|
|
|
650658
650606
|
}
|
|
650659
650607
|
if (e4.key === "left" && (e4.ctrl || e4.meta || e4.fn)) {
|
|
650660
650608
|
e4.preventDefault();
|
|
650661
|
-
const newCursor =
|
|
650609
|
+
const newCursor = cursor.backwardWord();
|
|
650662
650610
|
setCursorOffset(newCursor.offset);
|
|
650663
650611
|
return;
|
|
650664
650612
|
}
|
|
650665
650613
|
if (e4.key === "right" && (e4.ctrl || e4.meta || e4.fn)) {
|
|
650666
650614
|
e4.preventDefault();
|
|
650667
|
-
const newCursor =
|
|
650615
|
+
const newCursor = cursor.forwardWord();
|
|
650668
650616
|
setCursorOffset(newCursor.offset);
|
|
650669
650617
|
return;
|
|
650670
650618
|
}
|
|
@@ -650741,7 +650689,7 @@ function useSearchInput({
|
|
|
650741
650689
|
return;
|
|
650742
650690
|
}
|
|
650743
650691
|
case "w": {
|
|
650744
|
-
const { cursor: newCursor, killed } =
|
|
650692
|
+
const { cursor: newCursor, killed } = cursor.deleteWORDBefore();
|
|
650745
650693
|
pushToKillRing(killed, "prepend");
|
|
650746
650694
|
setQueryState(newCursor.text);
|
|
650747
650695
|
setCursorOffset(newCursor.offset);
|
|
@@ -650771,20 +650719,14 @@ function useSearchInput({
|
|
|
650771
650719
|
e4.preventDefault();
|
|
650772
650720
|
switch (e4.key.toLowerCase()) {
|
|
650773
650721
|
case "b":
|
|
650774
|
-
setCursorOffset(
|
|
650722
|
+
setCursorOffset(cursor.backwardWord().offset);
|
|
650775
650723
|
return;
|
|
650776
650724
|
case "f":
|
|
650777
|
-
setCursorOffset(
|
|
650725
|
+
setCursorOffset(cursor.forwardWord().offset);
|
|
650778
650726
|
return;
|
|
650779
650727
|
case "d": {
|
|
650780
|
-
|
|
650781
|
-
|
|
650782
|
-
pushToKillRing(killed, "append");
|
|
650783
|
-
setQueryState(newCursor2.text);
|
|
650784
|
-
setCursorOffset(newCursor2.offset);
|
|
650785
|
-
return;
|
|
650786
|
-
}
|
|
650787
|
-
const newCursor = cursor.deleteWordAfter();
|
|
650728
|
+
const { cursor: newCursor, killed } = cursor.killWord();
|
|
650729
|
+
pushToKillRing(killed, "append");
|
|
650788
650730
|
setQueryState(newCursor.text);
|
|
650789
650731
|
setCursorOffset(newCursor.offset);
|
|
650790
650732
|
return;
|
|
@@ -650826,7 +650768,6 @@ var init_useSearchInput = __esm(() => {
|
|
|
650826
650768
|
init_keyboard_event();
|
|
650827
650769
|
init_ink2();
|
|
650828
650770
|
init_Cursor();
|
|
650829
|
-
init_keybindingFlavor();
|
|
650830
650771
|
init_useTerminalSize();
|
|
650831
650772
|
import_react107 = __toESM(require_react(), 1);
|
|
650832
650773
|
UNHANDLED_SPECIAL_KEYS = new Set([
|
|
@@ -703803,7 +703744,8 @@ function ThemePickerCommand(t0) {
|
|
|
703803
703744
|
children: /* @__PURE__ */ jsx_runtime309.jsx(ThemePicker, {
|
|
703804
703745
|
onThemeSelect: t1,
|
|
703805
703746
|
onCancel: t22,
|
|
703806
|
-
skipExitHandling: true
|
|
703747
|
+
skipExitHandling: true,
|
|
703748
|
+
allowCustomThemeCreation: true
|
|
703807
703749
|
})
|
|
703808
703750
|
});
|
|
703809
703751
|
$4[5] = t1;
|
|
@@ -807725,30 +807667,29 @@ function ApproveApiKey(t0) {
|
|
|
807725
807667
|
let t1;
|
|
807726
807668
|
if ($4[0] !== customApiKeyTruncated || $4[1] !== onDone) {
|
|
807727
807669
|
t1 = function onChange2(value) {
|
|
807728
|
-
|
|
807729
|
-
|
|
807730
|
-
|
|
807731
|
-
|
|
807732
|
-
|
|
807733
|
-
customApiKeyResponses
|
|
807734
|
-
|
|
807735
|
-
|
|
807736
|
-
|
|
807737
|
-
|
|
807738
|
-
|
|
807739
|
-
|
|
807740
|
-
|
|
807741
|
-
|
|
807742
|
-
|
|
807743
|
-
|
|
807744
|
-
customApiKeyResponses
|
|
807745
|
-
|
|
807746
|
-
|
|
807747
|
-
|
|
807748
|
-
|
|
807749
|
-
onDone(false);
|
|
807750
|
-
}
|
|
807670
|
+
switch (value) {
|
|
807671
|
+
case "yes": {
|
|
807672
|
+
saveGlobalConfig((current_0) => ({
|
|
807673
|
+
...current_0,
|
|
807674
|
+
customApiKeyResponses: {
|
|
807675
|
+
...current_0.customApiKeyResponses,
|
|
807676
|
+
approved: [...current_0.customApiKeyResponses?.approved ?? [], customApiKeyTruncated]
|
|
807677
|
+
}
|
|
807678
|
+
}));
|
|
807679
|
+
onDone(true);
|
|
807680
|
+
break;
|
|
807681
|
+
}
|
|
807682
|
+
case "no": {
|
|
807683
|
+
saveGlobalConfig((current) => ({
|
|
807684
|
+
...current,
|
|
807685
|
+
customApiKeyResponses: {
|
|
807686
|
+
...current.customApiKeyResponses,
|
|
807687
|
+
rejected: [...current.customApiKeyResponses?.rejected ?? [], customApiKeyTruncated]
|
|
807688
|
+
}
|
|
807689
|
+
}));
|
|
807690
|
+
onDone(false);
|
|
807751
807691
|
}
|
|
807692
|
+
}
|
|
807752
807693
|
};
|
|
807753
807694
|
$4[0] = customApiKeyTruncated;
|
|
807754
807695
|
$4[1] = onDone;
|
|
@@ -807834,8 +807775,8 @@ function ApproveApiKey(t0) {
|
|
|
807834
807775
|
let t8;
|
|
807835
807776
|
if ($4[11] !== onChange) {
|
|
807836
807777
|
t8 = /* @__PURE__ */ jsx_runtime480.jsx(Select, {
|
|
807837
|
-
defaultValue: "no",
|
|
807838
807778
|
defaultFocusValue: "no",
|
|
807779
|
+
hideIndexes: true,
|
|
807839
807780
|
options: t7,
|
|
807840
807781
|
onChange: (value_0) => onChange(value_0),
|
|
807841
807782
|
onCancel: () => onChange("no")
|
|
@@ -809684,11 +809625,11 @@ function TrustDialog(t0) {
|
|
|
809684
809625
|
let t20;
|
|
809685
809626
|
if ($4[24] === Symbol.for("react.memo_cache_sentinel")) {
|
|
809686
809627
|
t20 = [{
|
|
809687
|
-
label: "Yes, I trust this folder",
|
|
809688
|
-
value: "enable_all"
|
|
809689
|
-
}, {
|
|
809690
809628
|
label: "No, exit",
|
|
809691
809629
|
value: "exit"
|
|
809630
|
+
}, {
|
|
809631
|
+
label: "Yes, I trust this folder",
|
|
809632
|
+
value: "enable_all"
|
|
809692
809633
|
}];
|
|
809693
809634
|
$4[24] = t20;
|
|
809694
809635
|
} else {
|
|
@@ -809698,6 +809639,7 @@ function TrustDialog(t0) {
|
|
|
809698
809639
|
if ($4[25] !== onChange) {
|
|
809699
809640
|
t21 = /* @__PURE__ */ jsx_runtime485.jsx(Select, {
|
|
809700
809641
|
options: t20,
|
|
809642
|
+
hideIndexes: true,
|
|
809701
809643
|
onChange: (value_0) => onChange(value_0),
|
|
809702
809644
|
onCancel: () => onChange("exit")
|
|
809703
809645
|
});
|
|
@@ -809888,6 +809830,7 @@ function BypassPermissionsModeDialog(t0) {
|
|
|
809888
809830
|
t32,
|
|
809889
809831
|
/* @__PURE__ */ jsx_runtime486.jsx(Select, {
|
|
809890
809832
|
options: t4,
|
|
809833
|
+
hideIndexes: true,
|
|
809891
809834
|
onChange: (value_0) => onChange(value_0)
|
|
809892
809835
|
})
|
|
809893
809836
|
]
|