@cnwenf/occ 2.1.306 → 2.1.308
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 +89 -8
- 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.308","BINARY_NAME":"occ","BUILD_TIME":"2026-08-21T18:25:57.305Z","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;
|
|
@@ -59651,6 +59651,7 @@ var init_types2 = __esm(() => {
|
|
|
59651
59651
|
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.'),
|
|
59652
59652
|
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."),
|
|
59653
59653
|
viewMode: exports_external.enum(["default", "verbose", "focus"]).optional().catch(undefined).describe("Default transcript view mode on startup"),
|
|
59654
|
+
keybindingFlavor: exports_external.enum(["classic", "readline"]).optional().catch(undefined).describe(`Which conventions the prompt's editing keys follow: "readline" matches Bash and other readline programs (Ctrl+W deletes back to the previous whitespace); "classic" (default) keeps Claude Code's long-standing behavior (Ctrl+W deletes the previous word)`),
|
|
59654
59655
|
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".'),
|
|
59655
59656
|
externalEditorContext: exports_external.boolean().optional().describe("Show the last assistant response as commented context above the prompt when opening the external editor (Ctrl+G)."),
|
|
59656
59657
|
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.'),
|
|
@@ -101103,6 +101104,7 @@ var init_modelAllowlist = __esm(() => {
|
|
|
101103
101104
|
var exports_model = {};
|
|
101104
101105
|
__export(exports_model, {
|
|
101105
101106
|
resolveSkillModelOverride: () => resolveSkillModelOverride,
|
|
101107
|
+
resolveAnthropicDefaultModel: () => resolveAnthropicDefaultModel,
|
|
101106
101108
|
renderModelSetting: () => renderModelSetting,
|
|
101107
101109
|
renderModelName: () => renderModelName,
|
|
101108
101110
|
renderDefaultModelSetting: () => renderDefaultModelSetting,
|
|
@@ -101241,7 +101243,32 @@ function getRuntimeMainLoopModel(params) {
|
|
|
101241
101243
|
}
|
|
101242
101244
|
return mainLoopModel;
|
|
101243
101245
|
}
|
|
101246
|
+
function resolveAnthropicDefaultModel() {
|
|
101247
|
+
const raw = process.env.ANTHROPIC_DEFAULT_MODEL;
|
|
101248
|
+
if (raw === undefined || raw.trim() === "") {
|
|
101249
|
+
return;
|
|
101250
|
+
}
|
|
101251
|
+
const normalized = raw.trim().toLowerCase();
|
|
101252
|
+
if (normalized === "default" || normalized === "inherit") {
|
|
101253
|
+
return;
|
|
101254
|
+
}
|
|
101255
|
+
const aliasForm = normalized.replace(/\[1m\]$/i, "");
|
|
101256
|
+
if (aliasForm === "opusplan" || aliasForm === "haiku") {
|
|
101257
|
+
return;
|
|
101258
|
+
}
|
|
101259
|
+
if (getEnforceAvailableModels()) {
|
|
101260
|
+
return;
|
|
101261
|
+
}
|
|
101262
|
+
if (!isModelAllowed(raw)) {
|
|
101263
|
+
return;
|
|
101264
|
+
}
|
|
101265
|
+
return raw;
|
|
101266
|
+
}
|
|
101244
101267
|
function getDefaultMainLoopModelSetting() {
|
|
101268
|
+
const anthropicDefault = resolveAnthropicDefaultModel();
|
|
101269
|
+
if (anthropicDefault !== undefined) {
|
|
101270
|
+
return anthropicDefault;
|
|
101271
|
+
}
|
|
101245
101272
|
let setting;
|
|
101246
101273
|
if (process.env.USER_TYPE === "ant") {
|
|
101247
101274
|
setting = getAntModelOverrideConfig()?.defaultModel ?? getDefaultOpusModel() + "[1m]";
|
|
@@ -601661,7 +601688,7 @@ async function getAttachments(input2, toolUseContext, ideSelection, queuedComman
|
|
|
601661
601688
|
const mainThreadAttachments = isMainThread ? [
|
|
601662
601689
|
maybe("ide_selection", async () => getSelectedLinesFromIDE(ideSelection, toolUseContext)),
|
|
601663
601690
|
maybe("ide_opened_file", async () => getOpenedFileFromIDE(ideSelection, toolUseContext)),
|
|
601664
|
-
maybe("output_style",
|
|
601691
|
+
maybe("output_style", () => getOutputStyleAttachment()),
|
|
601665
601692
|
maybe("diagnostics", async () => getDiagnosticAttachments(toolUseContext)),
|
|
601666
601693
|
maybe("lsp_diagnostics", async () => getLSPDiagnosticAttachments(toolUseContext)),
|
|
601667
601694
|
maybe("unified_tasks", async () => getUnifiedTaskAttachments(toolUseContext)),
|
|
@@ -602007,16 +602034,18 @@ function getCriticalSystemReminderAttachment(toolUseContext) {
|
|
|
602007
602034
|
}
|
|
602008
602035
|
return [{ type: "critical_system_reminder", content: reminder }];
|
|
602009
602036
|
}
|
|
602010
|
-
function getOutputStyleAttachment() {
|
|
602037
|
+
async function getOutputStyleAttachment() {
|
|
602011
602038
|
const settings = getSettings_DEPRECATED();
|
|
602012
602039
|
const outputStyle = settings?.outputStyle || "default";
|
|
602013
602040
|
if (outputStyle === "default") {
|
|
602014
602041
|
return [];
|
|
602015
602042
|
}
|
|
602043
|
+
const styleConfig = await getOutputStyleConfig();
|
|
602016
602044
|
return [
|
|
602017
602045
|
{
|
|
602018
602046
|
type: "output_style",
|
|
602019
|
-
style: outputStyle
|
|
602047
|
+
style: outputStyle,
|
|
602048
|
+
turnReminder: styleConfig?.turnReminder
|
|
602020
602049
|
}
|
|
602021
602050
|
];
|
|
602022
602051
|
}
|
|
@@ -603378,6 +603407,7 @@ var init_attachments2 = __esm(() => {
|
|
|
603378
603407
|
init_common2();
|
|
603379
603408
|
init_pdf();
|
|
603380
603409
|
init_apiLimits();
|
|
603410
|
+
init_outputStyles();
|
|
603381
603411
|
init_agentSwarmsEnabled();
|
|
603382
603412
|
init_findRelevantMemories();
|
|
603383
603413
|
init_paths();
|
|
@@ -613203,7 +613233,16 @@ async function getOutputStyleConfig() {
|
|
|
613203
613233
|
const outputStyle = settings?.outputStyle || DEFAULT_OUTPUT_STYLE_NAME;
|
|
613204
613234
|
return allStyles[outputStyle] ?? null;
|
|
613205
613235
|
}
|
|
613206
|
-
var EXPLANATORY_FEATURE_PROMPT, DEFAULT_OUTPUT_STYLE_NAME = "default",
|
|
613236
|
+
var EXPLANATORY_FEATURE_PROMPT, DEFAULT_OUTPUT_STYLE_NAME = "default", CONCISE_STYLE_RULES = `The user chose brevity over narration. You should:
|
|
613237
|
+
|
|
613238
|
+
1. **Lead with the result** \u2014 Your first sentence answers "what happened" or "what's the answer." No preamble ("Let me...", "Now I'll...") and no closing recap of what you already said.
|
|
613239
|
+
2. **Cut narration, keep substance** \u2014 Don't restate the request, the plan, or each step you took. Report outcomes, decisions, and anything the user must act on.
|
|
613240
|
+
3. **Short by default** \u2014 Answer simple questions in 1-3 sentences of plain prose. Use headers, tables, and bullet lists only when they carry real structure, never as decoration.
|
|
613241
|
+
4. **State things plainly** \u2014 Skip hedging boilerplate. Mention a caveat only when it changes what the user should do next.
|
|
613242
|
+
5. **Give full detail on request** \u2014 When the user asks for an explanation or detail, answer completely. Conciseness never means withholding requested information.
|
|
613243
|
+
6. **Never trade correctness for brevity** \u2014 Error reports, failing test output, security warnings, and confirmations for destructive actions keep their full content.
|
|
613244
|
+
|
|
613245
|
+
Where these rules conflict with more general communication or formatting guidance elsewhere in your instructions, these rules win.`, CONCISE_TURN_REMINDER = "Be concise: lead with the result, skip preamble and narration, keep only what the user needs.", OUTPUT_STYLE_CONFIG, getAllOutputStyles;
|
|
613207
613246
|
var init_outputStyles = __esm(() => {
|
|
613208
613247
|
init_figures();
|
|
613209
613248
|
init_memoize();
|
|
@@ -613222,6 +613261,17 @@ In order to encourage learning, before and after writing code, always provide br
|
|
|
613222
613261
|
These insights should be included in the conversation, not in the codebase. You should generally focus on interesting insights that are specific to the codebase or the code you just wrote, rather than general programming concepts.`;
|
|
613223
613262
|
OUTPUT_STYLE_CONFIG = {
|
|
613224
613263
|
[DEFAULT_OUTPUT_STYLE_NAME]: null,
|
|
613264
|
+
Concise: {
|
|
613265
|
+
name: "Concise",
|
|
613266
|
+
source: "built-in",
|
|
613267
|
+
description: "Claude responds tersely, leading with results and skipping preamble and narration",
|
|
613268
|
+
keepCodingInstructions: true,
|
|
613269
|
+
prompt: `You are an interactive CLI tool that helps users with software engineering tasks. Keep your responses short and direct while doing the work just as thoroughly.
|
|
613270
|
+
|
|
613271
|
+
# Concise Style Active
|
|
613272
|
+
${CONCISE_STYLE_RULES}`,
|
|
613273
|
+
turnReminder: CONCISE_TURN_REMINDER
|
|
613274
|
+
},
|
|
613225
613275
|
Explanatory: {
|
|
613226
613276
|
name: "Explanatory",
|
|
613227
613277
|
source: "built-in",
|
|
@@ -615650,7 +615700,7 @@ ${attachment.content}`,
|
|
|
615650
615700
|
}
|
|
615651
615701
|
return wrapMessagesInSystemReminder([
|
|
615652
615702
|
createUserMessage({
|
|
615653
|
-
content: `${outputStyle.name} output style is active. Remember to follow the specific guidelines for this style
|
|
615703
|
+
content: `${outputStyle.name} output style is active. ${attachment.turnReminder ?? "Remember to follow the specific guidelines for this style."}`,
|
|
615654
615704
|
isMeta: true
|
|
615655
615705
|
})
|
|
615656
615706
|
]);
|
|
@@ -637812,6 +637862,15 @@ class Cursor {
|
|
|
637812
637862
|
const killed = this.text.slice(prevWordCursor.offset, this.offset);
|
|
637813
637863
|
return { cursor: prevWordCursor.modifyText(this), killed };
|
|
637814
637864
|
}
|
|
637865
|
+
deleteWORDBefore() {
|
|
637866
|
+
if (this.isAtStart()) {
|
|
637867
|
+
return { cursor: this, killed: "" };
|
|
637868
|
+
}
|
|
637869
|
+
const target = this.snapOutOfImageRef(this.prevWORD().offset, "start");
|
|
637870
|
+
const prevWORDCursor = new Cursor(this.measuredText, target);
|
|
637871
|
+
const killed = this.text.slice(prevWORDCursor.offset, this.offset);
|
|
637872
|
+
return { cursor: prevWORDCursor.modifyText(this), killed };
|
|
637873
|
+
}
|
|
637815
637874
|
deleteTokenBefore() {
|
|
637816
637875
|
const chipAfter = this.imageRefStartingAt(this.offset);
|
|
637817
637876
|
if (chipAfter) {
|
|
@@ -638225,6 +638284,18 @@ var init_Cursor = __esm(() => {
|
|
|
638225
638284
|
WHITESPACE_REGEX2 = /\s/;
|
|
638226
638285
|
});
|
|
638227
638286
|
|
|
638287
|
+
// src/utils/keybindingFlavor.ts
|
|
638288
|
+
function getKeybindingFlavor() {
|
|
638289
|
+
return getInitialSettings().keybindingFlavor === "readline" ? "readline" : DEFAULT_KEYBINDING_FLAVOR;
|
|
638290
|
+
}
|
|
638291
|
+
function isReadlineKeybindingFlavor() {
|
|
638292
|
+
return getKeybindingFlavor() === "readline";
|
|
638293
|
+
}
|
|
638294
|
+
var DEFAULT_KEYBINDING_FLAVOR = "classic";
|
|
638295
|
+
var init_keybindingFlavor = __esm(() => {
|
|
638296
|
+
init_settings2();
|
|
638297
|
+
});
|
|
638298
|
+
|
|
638228
638299
|
// packages/modifiers-napi/src/index.ts
|
|
638229
638300
|
var exports_src6 = {};
|
|
638230
638301
|
__export(exports_src6, {
|
|
@@ -638337,6 +638408,7 @@ function useTextInput({
|
|
|
638337
638408
|
const setOffset = onOffsetChange;
|
|
638338
638409
|
const cursor = Cursor.fromText(originalValue, columns, offset);
|
|
638339
638410
|
const { addNotification, removeNotification } = useNotifications();
|
|
638411
|
+
const isReadline = isReadlineKeybindingFlavor();
|
|
638340
638412
|
const handleCtrlC = useDoublePress((show) => {
|
|
638341
638413
|
onExitMessage?.(show, "Ctrl-C");
|
|
638342
638414
|
}, () => onExit2?.(), () => {
|
|
@@ -638412,6 +638484,12 @@ function useTextInput({
|
|
|
638412
638484
|
announceDeletedText(killed);
|
|
638413
638485
|
return newCursor;
|
|
638414
638486
|
}
|
|
638487
|
+
function killWORDBefore() {
|
|
638488
|
+
const { cursor: newCursor, killed } = cursor.deleteWORDBefore();
|
|
638489
|
+
pushToKillRing(killed, "prepend");
|
|
638490
|
+
announceDeletedText(killed);
|
|
638491
|
+
return newCursor;
|
|
638492
|
+
}
|
|
638415
638493
|
function yank() {
|
|
638416
638494
|
const text2 = getLastKill();
|
|
638417
638495
|
if (text2.length > 0) {
|
|
@@ -638447,7 +638525,7 @@ function useTextInput({
|
|
|
638447
638525
|
["n", () => downOrHistoryDown()],
|
|
638448
638526
|
["p", () => upOrHistoryUp()],
|
|
638449
638527
|
["u", fullscreen ? NOOP_HANDLER : killToLineStart],
|
|
638450
|
-
["w", killWordBefore],
|
|
638528
|
+
["w", isReadline ? killWORDBefore : killWordBefore],
|
|
638451
638529
|
["y", yank]
|
|
638452
638530
|
]);
|
|
638453
638531
|
const handleMeta = mapInput([
|
|
@@ -638657,6 +638735,7 @@ var init_useTextInput = __esm(() => {
|
|
|
638657
638735
|
init_Cursor();
|
|
638658
638736
|
init_env();
|
|
638659
638737
|
init_fullscreen();
|
|
638738
|
+
init_keybindingFlavor();
|
|
638660
638739
|
init_useDoublePress();
|
|
638661
638740
|
init_srA11y();
|
|
638662
638741
|
init_screenReader();
|
|
@@ -649169,6 +649248,7 @@ function useSearchInput({
|
|
|
649169
649248
|
const effectiveColumns = columns ?? terminalColumns;
|
|
649170
649249
|
const [query2, setQueryState] = import_react107.useState(initialQuery);
|
|
649171
649250
|
const [cursorOffset, setCursorOffset] = import_react107.useState(initialQuery.length);
|
|
649251
|
+
const isReadline = isReadlineKeybindingFlavor();
|
|
649172
649252
|
const setQuery = import_react107.useCallback((q6) => {
|
|
649173
649253
|
setQueryState(q6);
|
|
649174
649254
|
setCursorOffset(q6.length);
|
|
@@ -649321,7 +649401,7 @@ function useSearchInput({
|
|
|
649321
649401
|
return;
|
|
649322
649402
|
}
|
|
649323
649403
|
case "w": {
|
|
649324
|
-
const { cursor: newCursor, killed } = cursor.deleteWordBefore();
|
|
649404
|
+
const { cursor: newCursor, killed } = isReadline ? cursor.deleteWORDBefore() : cursor.deleteWordBefore();
|
|
649325
649405
|
pushToKillRing(killed, "prepend");
|
|
649326
649406
|
setQueryState(newCursor.text);
|
|
649327
649407
|
setCursorOffset(newCursor.offset);
|
|
@@ -649399,6 +649479,7 @@ var init_useSearchInput = __esm(() => {
|
|
|
649399
649479
|
init_keyboard_event();
|
|
649400
649480
|
init_ink2();
|
|
649401
649481
|
init_Cursor();
|
|
649482
|
+
init_keybindingFlavor();
|
|
649402
649483
|
init_useTerminalSize();
|
|
649403
649484
|
import_react107 = __toESM(require_react(), 1);
|
|
649404
649485
|
UNHANDLED_SPECIAL_KEYS = new Set([
|