@cnwenf/occ 2.1.322 → 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 +77 -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
|
|
@@ -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();
|
|
@@ -650559,14 +650504,14 @@ var init_SearchBox = __esm(() => {
|
|
|
650559
650504
|
});
|
|
650560
650505
|
|
|
650561
650506
|
// src/hooks/useSearchInput.ts
|
|
650562
|
-
function isKillKey(e4
|
|
650507
|
+
function isKillKey(e4) {
|
|
650563
650508
|
if (e4.ctrl && (e4.key === "k" || e4.key === "u" || e4.key === "w")) {
|
|
650564
650509
|
return true;
|
|
650565
650510
|
}
|
|
650566
650511
|
if ((e4.meta || e4.ctrl) && e4.key === "backspace") {
|
|
650567
650512
|
return true;
|
|
650568
650513
|
}
|
|
650569
|
-
if (
|
|
650514
|
+
if (e4.meta && !e4.ctrl && e4.key.toLowerCase() === "d") {
|
|
650570
650515
|
return true;
|
|
650571
650516
|
}
|
|
650572
650517
|
return false;
|
|
@@ -650588,7 +650533,6 @@ function useSearchInput({
|
|
|
650588
650533
|
const effectiveColumns = columns ?? terminalColumns;
|
|
650589
650534
|
const [query2, setQueryState] = import_react107.useState(initialQuery);
|
|
650590
650535
|
const [cursorOffset, setCursorOffset] = import_react107.useState(initialQuery.length);
|
|
650591
|
-
const isReadline = isReadlineKeybindingFlavor();
|
|
650592
650536
|
const setQuery = import_react107.useCallback((q6) => {
|
|
650593
650537
|
setQueryState(q6);
|
|
650594
650538
|
setCursorOffset(q6.length);
|
|
@@ -650597,7 +650541,7 @@ function useSearchInput({
|
|
|
650597
650541
|
if (!isActive)
|
|
650598
650542
|
return;
|
|
650599
650543
|
const cursor = Cursor.fromText(query2, effectiveColumns, cursorOffset);
|
|
650600
|
-
if (!isKillKey(e4
|
|
650544
|
+
if (!isKillKey(e4)) {
|
|
650601
650545
|
resetKillAccumulation();
|
|
650602
650546
|
}
|
|
650603
650547
|
if (!isYankKey(e4)) {
|
|
@@ -650633,7 +650577,7 @@ function useSearchInput({
|
|
|
650633
650577
|
if (e4.key === "backspace") {
|
|
650634
650578
|
e4.preventDefault();
|
|
650635
650579
|
if (e4.meta || e4.ctrl) {
|
|
650636
|
-
const { cursor: newCursor2, killed } =
|
|
650580
|
+
const { cursor: newCursor2, killed } = cursor.backwardKillWord();
|
|
650637
650581
|
pushToKillRing(killed, "prepend");
|
|
650638
650582
|
setQueryState(newCursor2.text);
|
|
650639
650583
|
setCursorOffset(newCursor2.offset);
|
|
@@ -650658,13 +650602,13 @@ function useSearchInput({
|
|
|
650658
650602
|
}
|
|
650659
650603
|
if (e4.key === "left" && (e4.ctrl || e4.meta || e4.fn)) {
|
|
650660
650604
|
e4.preventDefault();
|
|
650661
|
-
const newCursor =
|
|
650605
|
+
const newCursor = cursor.backwardWord();
|
|
650662
650606
|
setCursorOffset(newCursor.offset);
|
|
650663
650607
|
return;
|
|
650664
650608
|
}
|
|
650665
650609
|
if (e4.key === "right" && (e4.ctrl || e4.meta || e4.fn)) {
|
|
650666
650610
|
e4.preventDefault();
|
|
650667
|
-
const newCursor =
|
|
650611
|
+
const newCursor = cursor.forwardWord();
|
|
650668
650612
|
setCursorOffset(newCursor.offset);
|
|
650669
650613
|
return;
|
|
650670
650614
|
}
|
|
@@ -650741,7 +650685,7 @@ function useSearchInput({
|
|
|
650741
650685
|
return;
|
|
650742
650686
|
}
|
|
650743
650687
|
case "w": {
|
|
650744
|
-
const { cursor: newCursor, killed } =
|
|
650688
|
+
const { cursor: newCursor, killed } = cursor.deleteWORDBefore();
|
|
650745
650689
|
pushToKillRing(killed, "prepend");
|
|
650746
650690
|
setQueryState(newCursor.text);
|
|
650747
650691
|
setCursorOffset(newCursor.offset);
|
|
@@ -650771,20 +650715,14 @@ function useSearchInput({
|
|
|
650771
650715
|
e4.preventDefault();
|
|
650772
650716
|
switch (e4.key.toLowerCase()) {
|
|
650773
650717
|
case "b":
|
|
650774
|
-
setCursorOffset(
|
|
650718
|
+
setCursorOffset(cursor.backwardWord().offset);
|
|
650775
650719
|
return;
|
|
650776
650720
|
case "f":
|
|
650777
|
-
setCursorOffset(
|
|
650721
|
+
setCursorOffset(cursor.forwardWord().offset);
|
|
650778
650722
|
return;
|
|
650779
650723
|
case "d": {
|
|
650780
|
-
|
|
650781
|
-
|
|
650782
|
-
pushToKillRing(killed, "append");
|
|
650783
|
-
setQueryState(newCursor2.text);
|
|
650784
|
-
setCursorOffset(newCursor2.offset);
|
|
650785
|
-
return;
|
|
650786
|
-
}
|
|
650787
|
-
const newCursor = cursor.deleteWordAfter();
|
|
650724
|
+
const { cursor: newCursor, killed } = cursor.killWord();
|
|
650725
|
+
pushToKillRing(killed, "append");
|
|
650788
650726
|
setQueryState(newCursor.text);
|
|
650789
650727
|
setCursorOffset(newCursor.offset);
|
|
650790
650728
|
return;
|
|
@@ -650826,7 +650764,6 @@ var init_useSearchInput = __esm(() => {
|
|
|
650826
650764
|
init_keyboard_event();
|
|
650827
650765
|
init_ink2();
|
|
650828
650766
|
init_Cursor();
|
|
650829
|
-
init_keybindingFlavor();
|
|
650830
650767
|
init_useTerminalSize();
|
|
650831
650768
|
import_react107 = __toESM(require_react(), 1);
|
|
650832
650769
|
UNHANDLED_SPECIAL_KEYS = new Set([
|