@cnwenf/occ 2.1.321 → 2.1.323
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 +81 -140
- 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.323","BINARY_NAME":"occ","BUILD_TIME":"2026-09-05T21:58:27.765Z","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
|
|
@@ -362131,6 +362145,10 @@ var init_ast = __esm(() => {
|
|
|
362131
362145
|
"EUID",
|
|
362132
362146
|
"GID",
|
|
362133
362147
|
"EGID",
|
|
362148
|
+
"REPORTTIME",
|
|
362149
|
+
"REPORTMEMORY",
|
|
362150
|
+
"DIRSTACKSIZE",
|
|
362151
|
+
"BAUD",
|
|
362134
362152
|
"ZLE_RPROMPT_INDENT",
|
|
362135
362153
|
"MBEGIN",
|
|
362136
362154
|
"MEND",
|
|
@@ -383873,7 +383891,7 @@ async function* runShellCommand({
|
|
|
383873
383891
|
}
|
|
383874
383892
|
}
|
|
383875
383893
|
var jsx_runtime53, EOL4 = `
|
|
383876
|
-
`, 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;
|
|
383877
383895
|
var init_BashTool = __esm(() => {
|
|
383878
383896
|
init_featureFlags();
|
|
383879
383897
|
init_v4();
|
|
@@ -383897,6 +383915,7 @@ var init_BashTool = __esm(() => {
|
|
|
383897
383915
|
init_cwd2();
|
|
383898
383916
|
init_hintRecommendation();
|
|
383899
383917
|
init_Shell();
|
|
383918
|
+
init_outputLimits();
|
|
383900
383919
|
init_sandbox_adapter();
|
|
383901
383920
|
init_semanticBoolean();
|
|
383902
383921
|
init_semanticNumber();
|
|
@@ -383999,7 +384018,9 @@ For commands that are harder to parse at a glance (piped commands, obscure flags
|
|
|
383999
384018
|
BashTool = buildTool({
|
|
384000
384019
|
name: BASH_TOOL_NAME,
|
|
384001
384020
|
searchHint: "execute shell commands",
|
|
384002
|
-
maxResultSizeChars
|
|
384021
|
+
get maxResultSizeChars() {
|
|
384022
|
+
return BASH_MAX_RESULT_SIZE_CHARS_DEFAULT;
|
|
384023
|
+
},
|
|
384003
384024
|
strict: true,
|
|
384004
384025
|
async description({
|
|
384005
384026
|
description
|
|
@@ -384352,6 +384373,11 @@ ${ghHint}` : ghHint;
|
|
|
384352
384373
|
return isOutputLineTruncated(output.stdout) || isOutputLineTruncated(output.stderr);
|
|
384353
384374
|
}
|
|
384354
384375
|
});
|
|
384376
|
+
Object.defineProperty(BashTool, "maxResultSizeChars", {
|
|
384377
|
+
get: () => getBashOutputMaxChars(),
|
|
384378
|
+
enumerable: true,
|
|
384379
|
+
configurable: true
|
|
384380
|
+
});
|
|
384355
384381
|
});
|
|
384356
384382
|
|
|
384357
384383
|
// src/tools/BashTool/bashCommandHelpers.ts
|
|
@@ -574620,7 +574646,13 @@ var init_BriefTool = __esm(() => {
|
|
|
574620
574646
|
});
|
|
574621
574647
|
|
|
574622
574648
|
// src/utils/task/outputFormatting.ts
|
|
574649
|
+
function getTaskOutputMaxChars() {
|
|
574650
|
+
return clampOutputChars(getInitialSettings().taskOutputMaxChars) ?? TASK_MAX_OUTPUT_DEFAULT;
|
|
574651
|
+
}
|
|
574623
574652
|
function getMaxTaskOutputLength() {
|
|
574653
|
+
const fromSettings = clampOutputChars(getInitialSettings().taskOutputMaxChars);
|
|
574654
|
+
if (fromSettings !== undefined)
|
|
574655
|
+
return fromSettings;
|
|
574624
574656
|
const result = validateBoundedIntEnvVar("TASK_MAX_OUTPUT_LENGTH", process.env.TASK_MAX_OUTPUT_LENGTH, TASK_MAX_OUTPUT_DEFAULT, TASK_MAX_OUTPUT_UPPER_LIMIT);
|
|
574625
574657
|
return result.effective;
|
|
574626
574658
|
}
|
|
@@ -574637,9 +574669,11 @@ function formatTaskOutput(output2, taskId) {
|
|
|
574637
574669
|
const truncated = output2.slice(-availableSpace);
|
|
574638
574670
|
return { content: header + truncated, wasTruncated: true };
|
|
574639
574671
|
}
|
|
574640
|
-
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;
|
|
574641
574673
|
var init_outputFormatting = __esm(() => {
|
|
574642
574674
|
init_envValidation();
|
|
574675
|
+
init_outputLimits();
|
|
574676
|
+
init_settings2();
|
|
574643
574677
|
init_diskOutput();
|
|
574644
574678
|
});
|
|
574645
574679
|
|
|
@@ -575074,7 +575108,7 @@ function TaskOutputResultDisplay(t0) {
|
|
|
575074
575108
|
}
|
|
575075
575109
|
return t5;
|
|
575076
575110
|
}
|
|
575077
|
-
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;
|
|
575078
575112
|
var init_TaskOutputTool = __esm(() => {
|
|
575079
575113
|
init_v4();
|
|
575080
575114
|
init_FallbackToolUseErrorMessage();
|
|
@@ -575103,7 +575137,9 @@ var init_TaskOutputTool = __esm(() => {
|
|
|
575103
575137
|
TaskOutputTool = buildTool({
|
|
575104
575138
|
name: TASK_OUTPUT_TOOL_NAME,
|
|
575105
575139
|
searchHint: "read output/logs from a background task",
|
|
575106
|
-
maxResultSizeChars
|
|
575140
|
+
get maxResultSizeChars() {
|
|
575141
|
+
return TASK_OUTPUT_MAX_RESULT_SIZE_CHARS_DEFAULT;
|
|
575142
|
+
},
|
|
575107
575143
|
shouldDefer: true,
|
|
575108
575144
|
aliases: ["AgentOutputTool", "BashOutputTool"],
|
|
575109
575145
|
userFacingName() {
|
|
@@ -575330,6 +575366,11 @@ ${content.trimEnd()}
|
|
|
575330
575366
|
});
|
|
575331
575367
|
}
|
|
575332
575368
|
});
|
|
575369
|
+
Object.defineProperty(TaskOutputTool, "maxResultSizeChars", {
|
|
575370
|
+
get: () => getTaskOutputMaxChars() + TASK_OUTPUT_INLINE_HEADROOM,
|
|
575371
|
+
enumerable: true,
|
|
575372
|
+
configurable: true
|
|
575373
|
+
});
|
|
575333
575374
|
});
|
|
575334
575375
|
|
|
575335
575376
|
// src/tools/WebSearchTool/UI.tsx
|
|
@@ -593015,7 +593056,7 @@ async function* runPowerShellCommand({
|
|
|
593015
593056
|
}
|
|
593016
593057
|
}
|
|
593017
593058
|
var jsx_runtime158, EOL6 = `
|
|
593018
|
-
`, 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;
|
|
593019
593060
|
var init_PowerShellTool = __esm(() => {
|
|
593020
593061
|
init_featureFlags();
|
|
593021
593062
|
init_v4();
|
|
@@ -593032,6 +593073,7 @@ var init_PowerShellTool = __esm(() => {
|
|
|
593032
593073
|
init_platform2();
|
|
593033
593074
|
init_hintRecommendation();
|
|
593034
593075
|
init_Shell();
|
|
593076
|
+
init_outputLimits();
|
|
593035
593077
|
init_sandbox_adapter();
|
|
593036
593078
|
init_semanticBoolean();
|
|
593037
593079
|
init_semanticNumber();
|
|
@@ -593106,7 +593148,9 @@ var init_PowerShellTool = __esm(() => {
|
|
|
593106
593148
|
PowerShellTool = buildTool({
|
|
593107
593149
|
name: POWERSHELL_TOOL_NAME,
|
|
593108
593150
|
searchHint: "execute Windows PowerShell commands",
|
|
593109
|
-
maxResultSizeChars
|
|
593151
|
+
get maxResultSizeChars() {
|
|
593152
|
+
return POWERSHELL_MAX_RESULT_SIZE_CHARS_DEFAULT;
|
|
593153
|
+
},
|
|
593110
593154
|
strict: true,
|
|
593111
593155
|
async description({
|
|
593112
593156
|
description
|
|
@@ -593409,6 +593453,11 @@ var init_PowerShellTool = __esm(() => {
|
|
|
593409
593453
|
return isOutputLineTruncated(output2.stdout) || isOutputLineTruncated(output2.stderr);
|
|
593410
593454
|
}
|
|
593411
593455
|
});
|
|
593456
|
+
Object.defineProperty(PowerShellTool, "maxResultSizeChars", {
|
|
593457
|
+
get: () => getBashOutputMaxChars(),
|
|
593458
|
+
enumerable: true,
|
|
593459
|
+
configurable: true
|
|
593460
|
+
});
|
|
593412
593461
|
});
|
|
593413
593462
|
|
|
593414
593463
|
// src/tools.ts
|
|
@@ -638830,23 +638879,6 @@ class Cursor {
|
|
|
638830
638879
|
const nextLineEnd = this.findLogicalLineEnd(nextLineStart);
|
|
638831
638880
|
return this.createCursorWithColumn(nextLineStart, nextLineEnd, currentColumn);
|
|
638832
638881
|
}
|
|
638833
|
-
nextWord() {
|
|
638834
|
-
if (this.isAtEnd()) {
|
|
638835
|
-
return this;
|
|
638836
|
-
}
|
|
638837
|
-
const chip = this.placeholderStartingAt(this.offset) ?? this.placeholderContaining(this.offset);
|
|
638838
|
-
if (chip) {
|
|
638839
|
-
return new Cursor(this.measuredText, chip.end);
|
|
638840
|
-
}
|
|
638841
|
-
const wordBoundaries = this.measuredText.getWordBoundaries();
|
|
638842
|
-
for (const boundary of wordBoundaries) {
|
|
638843
|
-
if (boundary.isWordLike && boundary.start > this.offset) {
|
|
638844
|
-
const target = this.snapOutOfPlaceholder(boundary.start, "end");
|
|
638845
|
-
return new Cursor(this.measuredText, target);
|
|
638846
|
-
}
|
|
638847
|
-
}
|
|
638848
|
-
return new Cursor(this.measuredText, this.text.length);
|
|
638849
|
-
}
|
|
638850
638882
|
endOfWord() {
|
|
638851
638883
|
if (this.isAtEnd()) {
|
|
638852
638884
|
return this;
|
|
@@ -638874,37 +638906,6 @@ class Cursor {
|
|
|
638874
638906
|
}
|
|
638875
638907
|
return this;
|
|
638876
638908
|
}
|
|
638877
|
-
prevWord() {
|
|
638878
|
-
if (this.isAtStart()) {
|
|
638879
|
-
return this;
|
|
638880
|
-
}
|
|
638881
|
-
const chipEnding = this.placeholderEndingAt(this.offset);
|
|
638882
|
-
if (chipEnding) {
|
|
638883
|
-
return new Cursor(this.measuredText, chipEnding.start);
|
|
638884
|
-
}
|
|
638885
|
-
const chipContaining = this.placeholderContaining(this.offset);
|
|
638886
|
-
if (chipContaining) {
|
|
638887
|
-
return new Cursor(this.measuredText, chipContaining.start);
|
|
638888
|
-
}
|
|
638889
|
-
const wordBoundaries = this.measuredText.getWordBoundaries();
|
|
638890
|
-
let prevWordStart = null;
|
|
638891
|
-
for (const boundary of wordBoundaries) {
|
|
638892
|
-
if (!boundary.isWordLike)
|
|
638893
|
-
continue;
|
|
638894
|
-
if (boundary.start < this.offset) {
|
|
638895
|
-
if (this.offset > boundary.start && this.offset <= boundary.end) {
|
|
638896
|
-
const target = this.snapOutOfPlaceholder(boundary.start, "start");
|
|
638897
|
-
return new Cursor(this.measuredText, target);
|
|
638898
|
-
}
|
|
638899
|
-
prevWordStart = boundary.start;
|
|
638900
|
-
}
|
|
638901
|
-
}
|
|
638902
|
-
if (prevWordStart !== null) {
|
|
638903
|
-
const target = this.snapOutOfPlaceholder(prevWordStart, "start");
|
|
638904
|
-
return new Cursor(this.measuredText, target);
|
|
638905
|
-
}
|
|
638906
|
-
return new Cursor(this.measuredText, 0);
|
|
638907
|
-
}
|
|
638908
638909
|
nextVimWord() {
|
|
638909
638910
|
if (this.isAtEnd()) {
|
|
638910
638911
|
return this;
|
|
@@ -639143,45 +639144,12 @@ class Cursor {
|
|
|
639143
639144
|
}
|
|
639144
639145
|
return this.killRange(this.offset, this.endOfLogicalLine().offset).cursor;
|
|
639145
639146
|
}
|
|
639146
|
-
deleteWordBefore() {
|
|
639147
|
-
if (this.isAtStart()) {
|
|
639148
|
-
return { cursor: this, killed: "" };
|
|
639149
|
-
}
|
|
639150
|
-
return this.killRange(this.prevWord().offset, this.offset);
|
|
639151
|
-
}
|
|
639152
639147
|
deleteWORDBefore() {
|
|
639153
639148
|
if (this.isAtStart()) {
|
|
639154
639149
|
return { cursor: this, killed: "" };
|
|
639155
639150
|
}
|
|
639156
639151
|
return this.killRange(this.prevWORD().offset, this.offset);
|
|
639157
639152
|
}
|
|
639158
|
-
deleteTokenBefore() {
|
|
639159
|
-
const chipAfter = this.placeholderStartingAt(this.offset);
|
|
639160
|
-
if (chipAfter) {
|
|
639161
|
-
const end = this.text[chipAfter.end] === " " ? chipAfter.end + 1 : chipAfter.end;
|
|
639162
|
-
return this.modifyText(new Cursor(this.measuredText, end));
|
|
639163
|
-
}
|
|
639164
|
-
if (this.isAtStart()) {
|
|
639165
|
-
return null;
|
|
639166
|
-
}
|
|
639167
|
-
const charAfter = this.text[this.offset];
|
|
639168
|
-
if (charAfter !== undefined && !/\s/.test(charAfter)) {
|
|
639169
|
-
return null;
|
|
639170
|
-
}
|
|
639171
|
-
const textBefore = this.text.slice(0, this.offset);
|
|
639172
|
-
const pasteMatch = textBefore.match(/(^|\s)\[(Pasted text #\d+(?: \+\d+ lines)?|Image #\d+|Audio #\d+|\.\.\.Truncated text #\d+ \+\d+ lines\.\.\.)\]$/);
|
|
639173
|
-
if (pasteMatch) {
|
|
639174
|
-
const matchStart = pasteMatch.index + pasteMatch[1].length;
|
|
639175
|
-
return new Cursor(this.measuredText, matchStart).modifyText(this);
|
|
639176
|
-
}
|
|
639177
|
-
return null;
|
|
639178
|
-
}
|
|
639179
|
-
deleteWordAfter() {
|
|
639180
|
-
if (this.isAtEnd()) {
|
|
639181
|
-
return this;
|
|
639182
|
-
}
|
|
639183
|
-
return this.killRange(this.offset, this.nextWord().offset).cursor;
|
|
639184
|
-
}
|
|
639185
639153
|
graphemeAt(pos) {
|
|
639186
639154
|
if (pos >= this.text.length)
|
|
639187
639155
|
return "";
|
|
@@ -639597,18 +639565,6 @@ var init_Cursor = __esm(() => {
|
|
|
639597
639565
|
WHITESPACE_REGEX2 = /\s/;
|
|
639598
639566
|
});
|
|
639599
639567
|
|
|
639600
|
-
// src/utils/keybindingFlavor.ts
|
|
639601
|
-
function getKeybindingFlavor() {
|
|
639602
|
-
return getInitialSettings().keybindingFlavor === "readline" ? "readline" : DEFAULT_KEYBINDING_FLAVOR;
|
|
639603
|
-
}
|
|
639604
|
-
function isReadlineKeybindingFlavor() {
|
|
639605
|
-
return getKeybindingFlavor() === "readline";
|
|
639606
|
-
}
|
|
639607
|
-
var DEFAULT_KEYBINDING_FLAVOR = "classic";
|
|
639608
|
-
var init_keybindingFlavor = __esm(() => {
|
|
639609
|
-
init_settings2();
|
|
639610
|
-
});
|
|
639611
|
-
|
|
639612
639568
|
// packages/modifiers-napi/src/index.ts
|
|
639613
639569
|
var exports_src6 = {};
|
|
639614
639570
|
__export(exports_src6, {
|
|
@@ -639721,7 +639677,6 @@ function useTextInput({
|
|
|
639721
639677
|
const setOffset = onOffsetChange;
|
|
639722
639678
|
const cursor = Cursor.fromText(originalValue, columns, offset);
|
|
639723
639679
|
const { addNotification, removeNotification } = useNotifications();
|
|
639724
|
-
const isReadline = isReadlineKeybindingFlavor();
|
|
639725
639680
|
const handleCtrlC = useDoublePress((show) => {
|
|
639726
639681
|
onExitMessage?.(show, "Ctrl-C");
|
|
639727
639682
|
}, () => onExit2?.(), () => {
|
|
@@ -639797,18 +639752,13 @@ function useTextInput({
|
|
|
639797
639752
|
}
|
|
639798
639753
|
return newCursor;
|
|
639799
639754
|
}
|
|
639800
|
-
function killWordBefore() {
|
|
639801
|
-
const { cursor: newCursor, killed } = cursor.deleteWordBefore();
|
|
639802
|
-
recordKill(killed, "prepend");
|
|
639803
|
-
return newCursor;
|
|
639804
|
-
}
|
|
639805
639755
|
function killWORDBefore() {
|
|
639806
639756
|
const { cursor: newCursor, killed } = cursor.deleteWORDBefore();
|
|
639807
639757
|
recordKill(killed, "prepend");
|
|
639808
639758
|
return newCursor;
|
|
639809
639759
|
}
|
|
639810
639760
|
function killWordBeforeFlavored() {
|
|
639811
|
-
const { cursor: newCursor, killed } =
|
|
639761
|
+
const { cursor: newCursor, killed } = cursor.backwardKillWord();
|
|
639812
639762
|
recordKill(killed, "prepend");
|
|
639813
639763
|
return newCursor;
|
|
639814
639764
|
}
|
|
@@ -639848,17 +639798,17 @@ function useTextInput({
|
|
|
639848
639798
|
["d", fullscreen ? NOOP_HANDLER : handleCtrlD],
|
|
639849
639799
|
["e", () => cursor.endOfLine()],
|
|
639850
639800
|
["f", fullscreen ? NOOP_HANDLER : () => cursor.right()],
|
|
639851
|
-
["h", () => cursor.
|
|
639801
|
+
["h", () => cursor.backspace()],
|
|
639852
639802
|
["n", () => downOrHistoryDown()],
|
|
639853
639803
|
["p", () => upOrHistoryUp()],
|
|
639854
639804
|
["u", fullscreen ? NOOP_HANDLER : killToLineStart],
|
|
639855
|
-
["w",
|
|
639805
|
+
["w", killWORDBefore],
|
|
639856
639806
|
["y", yank]
|
|
639857
639807
|
]);
|
|
639858
639808
|
const handleMeta = mapInput([
|
|
639859
|
-
["b", () =>
|
|
639860
|
-
["f", () =>
|
|
639861
|
-
["d",
|
|
639809
|
+
["b", () => cursor.backwardWord()],
|
|
639810
|
+
["f", () => cursor.forwardWord()],
|
|
639811
|
+
["d", killWordAfter],
|
|
639862
639812
|
["y", handleYankPop]
|
|
639863
639813
|
]);
|
|
639864
639814
|
function handleEnter(key4) {
|
|
@@ -639923,11 +639873,11 @@ function useTextInput({
|
|
|
639923
639873
|
return cursor;
|
|
639924
639874
|
};
|
|
639925
639875
|
case (key4.leftArrow && (key4.ctrl || key4.meta || key4.fn)):
|
|
639926
|
-
return () =>
|
|
639876
|
+
return () => cursor.backwardWord();
|
|
639927
639877
|
case (key4.rightArrow && (key4.ctrl || key4.meta || key4.fn)):
|
|
639928
|
-
return () =>
|
|
639878
|
+
return () => cursor.forwardWord();
|
|
639929
639879
|
case key4.backspace:
|
|
639930
|
-
return key4.super ? killToLineStart : key4.meta || key4.ctrl ? killWordBeforeFlavored : () => cursor.
|
|
639880
|
+
return key4.super ? killToLineStart : key4.meta || key4.ctrl ? killWordBeforeFlavored : () => cursor.backspace();
|
|
639931
639881
|
case key4.delete:
|
|
639932
639882
|
return key4.super || key4.meta ? killToLineEnd : () => cursor.del();
|
|
639933
639883
|
case key4.ctrl:
|
|
@@ -639992,7 +639942,7 @@ function useTextInput({
|
|
|
639992
639942
|
if (key4.ctrl && (input2 === "k" || input2 === "u" || input2 === "w")) {
|
|
639993
639943
|
return true;
|
|
639994
639944
|
}
|
|
639995
|
-
if (
|
|
639945
|
+
if (key4.meta && !key4.ctrl && input2 === "d") {
|
|
639996
639946
|
return true;
|
|
639997
639947
|
}
|
|
639998
639948
|
if (key4.backspace && (key4.meta || key4.super || key4.ctrl)) {
|
|
@@ -640015,7 +639965,7 @@ function useTextInput({
|
|
|
640015
639965
|
const delCount = (input2.match(/\x7f/g) || []).length;
|
|
640016
639966
|
let currentCursor = cursor;
|
|
640017
639967
|
for (let i6 = 0;i6 < delCount; i6++) {
|
|
640018
|
-
currentCursor = currentCursor.
|
|
639968
|
+
currentCursor = currentCursor.backspace();
|
|
640019
639969
|
}
|
|
640020
639970
|
if (!cursor.equals(currentCursor)) {
|
|
640021
639971
|
if (cursor.text !== currentCursor.text) {
|
|
@@ -640068,7 +640018,6 @@ var init_useTextInput = __esm(() => {
|
|
|
640068
640018
|
init_Cursor();
|
|
640069
640019
|
init_env();
|
|
640070
640020
|
init_fullscreen();
|
|
640071
|
-
init_keybindingFlavor();
|
|
640072
640021
|
init_useDoublePress();
|
|
640073
640022
|
init_srA11y();
|
|
640074
640023
|
init_screenReader();
|
|
@@ -650555,14 +650504,14 @@ var init_SearchBox = __esm(() => {
|
|
|
650555
650504
|
});
|
|
650556
650505
|
|
|
650557
650506
|
// src/hooks/useSearchInput.ts
|
|
650558
|
-
function isKillKey(e4
|
|
650507
|
+
function isKillKey(e4) {
|
|
650559
650508
|
if (e4.ctrl && (e4.key === "k" || e4.key === "u" || e4.key === "w")) {
|
|
650560
650509
|
return true;
|
|
650561
650510
|
}
|
|
650562
650511
|
if ((e4.meta || e4.ctrl) && e4.key === "backspace") {
|
|
650563
650512
|
return true;
|
|
650564
650513
|
}
|
|
650565
|
-
if (
|
|
650514
|
+
if (e4.meta && !e4.ctrl && e4.key.toLowerCase() === "d") {
|
|
650566
650515
|
return true;
|
|
650567
650516
|
}
|
|
650568
650517
|
return false;
|
|
@@ -650584,7 +650533,6 @@ function useSearchInput({
|
|
|
650584
650533
|
const effectiveColumns = columns ?? terminalColumns;
|
|
650585
650534
|
const [query2, setQueryState] = import_react107.useState(initialQuery);
|
|
650586
650535
|
const [cursorOffset, setCursorOffset] = import_react107.useState(initialQuery.length);
|
|
650587
|
-
const isReadline = isReadlineKeybindingFlavor();
|
|
650588
650536
|
const setQuery = import_react107.useCallback((q6) => {
|
|
650589
650537
|
setQueryState(q6);
|
|
650590
650538
|
setCursorOffset(q6.length);
|
|
@@ -650593,7 +650541,7 @@ function useSearchInput({
|
|
|
650593
650541
|
if (!isActive)
|
|
650594
650542
|
return;
|
|
650595
650543
|
const cursor = Cursor.fromText(query2, effectiveColumns, cursorOffset);
|
|
650596
|
-
if (!isKillKey(e4
|
|
650544
|
+
if (!isKillKey(e4)) {
|
|
650597
650545
|
resetKillAccumulation();
|
|
650598
650546
|
}
|
|
650599
650547
|
if (!isYankKey(e4)) {
|
|
@@ -650629,7 +650577,7 @@ function useSearchInput({
|
|
|
650629
650577
|
if (e4.key === "backspace") {
|
|
650630
650578
|
e4.preventDefault();
|
|
650631
650579
|
if (e4.meta || e4.ctrl) {
|
|
650632
|
-
const { cursor: newCursor2, killed } =
|
|
650580
|
+
const { cursor: newCursor2, killed } = cursor.backwardKillWord();
|
|
650633
650581
|
pushToKillRing(killed, "prepend");
|
|
650634
650582
|
setQueryState(newCursor2.text);
|
|
650635
650583
|
setCursorOffset(newCursor2.offset);
|
|
@@ -650654,13 +650602,13 @@ function useSearchInput({
|
|
|
650654
650602
|
}
|
|
650655
650603
|
if (e4.key === "left" && (e4.ctrl || e4.meta || e4.fn)) {
|
|
650656
650604
|
e4.preventDefault();
|
|
650657
|
-
const newCursor =
|
|
650605
|
+
const newCursor = cursor.backwardWord();
|
|
650658
650606
|
setCursorOffset(newCursor.offset);
|
|
650659
650607
|
return;
|
|
650660
650608
|
}
|
|
650661
650609
|
if (e4.key === "right" && (e4.ctrl || e4.meta || e4.fn)) {
|
|
650662
650610
|
e4.preventDefault();
|
|
650663
|
-
const newCursor =
|
|
650611
|
+
const newCursor = cursor.forwardWord();
|
|
650664
650612
|
setCursorOffset(newCursor.offset);
|
|
650665
650613
|
return;
|
|
650666
650614
|
}
|
|
@@ -650737,7 +650685,7 @@ function useSearchInput({
|
|
|
650737
650685
|
return;
|
|
650738
650686
|
}
|
|
650739
650687
|
case "w": {
|
|
650740
|
-
const { cursor: newCursor, killed } =
|
|
650688
|
+
const { cursor: newCursor, killed } = cursor.deleteWORDBefore();
|
|
650741
650689
|
pushToKillRing(killed, "prepend");
|
|
650742
650690
|
setQueryState(newCursor.text);
|
|
650743
650691
|
setCursorOffset(newCursor.offset);
|
|
@@ -650767,20 +650715,14 @@ function useSearchInput({
|
|
|
650767
650715
|
e4.preventDefault();
|
|
650768
650716
|
switch (e4.key.toLowerCase()) {
|
|
650769
650717
|
case "b":
|
|
650770
|
-
setCursorOffset(
|
|
650718
|
+
setCursorOffset(cursor.backwardWord().offset);
|
|
650771
650719
|
return;
|
|
650772
650720
|
case "f":
|
|
650773
|
-
setCursorOffset(
|
|
650721
|
+
setCursorOffset(cursor.forwardWord().offset);
|
|
650774
650722
|
return;
|
|
650775
650723
|
case "d": {
|
|
650776
|
-
|
|
650777
|
-
|
|
650778
|
-
pushToKillRing(killed, "append");
|
|
650779
|
-
setQueryState(newCursor2.text);
|
|
650780
|
-
setCursorOffset(newCursor2.offset);
|
|
650781
|
-
return;
|
|
650782
|
-
}
|
|
650783
|
-
const newCursor = cursor.deleteWordAfter();
|
|
650724
|
+
const { cursor: newCursor, killed } = cursor.killWord();
|
|
650725
|
+
pushToKillRing(killed, "append");
|
|
650784
650726
|
setQueryState(newCursor.text);
|
|
650785
650727
|
setCursorOffset(newCursor.offset);
|
|
650786
650728
|
return;
|
|
@@ -650822,7 +650764,6 @@ var init_useSearchInput = __esm(() => {
|
|
|
650822
650764
|
init_keyboard_event();
|
|
650823
650765
|
init_ink2();
|
|
650824
650766
|
init_Cursor();
|
|
650825
|
-
init_keybindingFlavor();
|
|
650826
650767
|
init_useTerminalSize();
|
|
650827
650768
|
import_react107 = __toESM(require_react(), 1);
|
|
650828
650769
|
UNHANDLED_SPECIAL_KEYS = new Set([
|