@cnwenf/occ 2.1.305 → 2.1.307

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.
Files changed (2) hide show
  1. package/dist/cli.js +79 -21
  2. 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.305","BINARY_NAME":"occ","BUILD_TIME":"2026-08-18T19:38:44.255Z","FEEDBACK_CHANNEL":"","ISSUES_EXPLAINER":"","NATIVE_PACKAGE_URL":"","PACKAGE_URL":"@cnwenf/occ","VERSION_CHANGELOG":""};
2
+ globalThis.MACRO={"VERSION":"2.1.307","BINARY_NAME":"occ","BUILD_TIME":"2026-08-20T23:38:42.953Z","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;
@@ -101103,6 +101103,7 @@ var init_modelAllowlist = __esm(() => {
101103
101103
  var exports_model = {};
101104
101104
  __export(exports_model, {
101105
101105
  resolveSkillModelOverride: () => resolveSkillModelOverride,
101106
+ resolveAnthropicDefaultModel: () => resolveAnthropicDefaultModel,
101106
101107
  renderModelSetting: () => renderModelSetting,
101107
101108
  renderModelName: () => renderModelName,
101108
101109
  renderDefaultModelSetting: () => renderDefaultModelSetting,
@@ -101241,7 +101242,32 @@ function getRuntimeMainLoopModel(params) {
101241
101242
  }
101242
101243
  return mainLoopModel;
101243
101244
  }
101245
+ function resolveAnthropicDefaultModel() {
101246
+ const raw = process.env.ANTHROPIC_DEFAULT_MODEL;
101247
+ if (raw === undefined || raw.trim() === "") {
101248
+ return;
101249
+ }
101250
+ const normalized = raw.trim().toLowerCase();
101251
+ if (normalized === "default" || normalized === "inherit") {
101252
+ return;
101253
+ }
101254
+ const aliasForm = normalized.replace(/\[1m\]$/i, "");
101255
+ if (aliasForm === "opusplan" || aliasForm === "haiku") {
101256
+ return;
101257
+ }
101258
+ if (getEnforceAvailableModels()) {
101259
+ return;
101260
+ }
101261
+ if (!isModelAllowed(raw)) {
101262
+ return;
101263
+ }
101264
+ return raw;
101265
+ }
101244
101266
  function getDefaultMainLoopModelSetting() {
101267
+ const anthropicDefault = resolveAnthropicDefaultModel();
101268
+ if (anthropicDefault !== undefined) {
101269
+ return anthropicDefault;
101270
+ }
101245
101271
  let setting;
101246
101272
  if (process.env.USER_TYPE === "ant") {
101247
101273
  setting = getAntModelOverrideConfig()?.defaultModel ?? getDefaultOpusModel() + "[1m]";
@@ -264261,6 +264287,11 @@ function shouldInjectAgentListInMessages() {
264261
264287
  }
264262
264288
  async function getPrompt2(agentDefinitions, isCoordinator, allowedAgentTypes) {
264263
264289
  const effectiveAgents = allowedAgentTypes ? agentDefinitions.filter((a5) => allowedAgentTypes.includes(a5.agentType)) : agentDefinitions;
264290
+ const normalizeAgentType = (s4) => s4.toLowerCase().replace(/[\s_-]+/g, "-");
264291
+ const gpMatches = agentDefinitions.filter((a5) => normalizeAgentType(a5.agentType) === normalizeAgentType(GENERAL_PURPOSE_AGENT.agentType));
264292
+ const passesAllowlist = (a5) => allowedAgentTypes?.includes(a5.agentType) ?? true;
264293
+ const gpExact = gpMatches.find((a5) => a5.agentType === GENERAL_PURPOSE_AGENT.agentType);
264294
+ const generalPurposeAvailable = gpExact ? passesAllowlist(gpExact) : gpMatches.length === 1 && passesAllowlist(gpMatches[0]);
264264
264295
  const forkEnabled = isForkSubagentEnabled();
264265
264296
  const whenToForkSection = forkEnabled ? `
264266
264297
 
@@ -264376,7 +264407,7 @@ The ${AGENT_TOOL_NAME} tool launches specialized agents (subprocesses) that auto
264376
264407
 
264377
264408
  ${agentListSection}
264378
264409
 
264379
- ${forkEnabled ? `When using the ${AGENT_TOOL_NAME} tool, specify a subagent_type to use a specialized agent, or omit it to fork yourself \u2014 a fork inherits your full conversation context.` : `When using the ${AGENT_TOOL_NAME} tool, specify a subagent_type parameter to select which agent type to use. If omitted, the general-purpose agent is used.`}`;
264410
+ ${forkEnabled ? `When using the ${AGENT_TOOL_NAME} tool, specify a subagent_type to use a specialized agent, or omit it to fork yourself \u2014 a fork inherits your full conversation context.` : `When using the ${AGENT_TOOL_NAME} tool, specify a subagent_type parameter to select which agent type to use. ${generalPurposeAvailable ? "If omitted, the general-purpose agent is used." : "subagent_type is required: the general-purpose agent is not available in this session, so choose one of the listed agent types."}`}`;
264380
264411
  if (isCoordinator) {
264381
264412
  return shared4;
264382
264413
  }
@@ -264421,6 +264452,7 @@ var init_prompt12 = __esm(() => {
264421
264452
  init_teammateContext();
264422
264453
  init_prompt3();
264423
264454
  init_prompt4();
264455
+ init_generalPurposeAgent();
264424
264456
  init_constants3();
264425
264457
  init_forkSubagent();
264426
264458
  });
@@ -461438,26 +461470,18 @@ function AssistantTextMessage(t0) {
461438
461470
  return null;
461439
461471
  }
461440
461472
  case PROMPT_TOO_LONG_ERROR_MESSAGE: {
461441
- let t22;
461442
- if ($3[3] === Symbol.for("react.memo_cache_sentinel")) {
461443
- t22 = getUpgradeMessage("warning");
461444
- $3[3] = t22;
461445
- } else {
461446
- t22 = $3[3];
461447
- }
461448
- const upgradeHint = t22;
461473
+ const autoCompactOffSuffix = isAutoCompactExplicitlyOff() ? " \xB7 auto-compact is off \xB7 /config to turn it on" : "";
461449
461474
  let t32;
461450
- if ($3[4] === Symbol.for("react.memo_cache_sentinel")) {
461475
+ if ($3[4] === Symbol.for("react.memo_cache_sentinel") || $3[3] !== autoCompactOffSuffix) {
461476
+ const upgradeHint = getUpgradeMessage("warning");
461451
461477
  t32 = /* @__PURE__ */ jsx_runtime88.jsx(MessageResponse, {
461452
461478
  height: 1,
461453
- children: /* @__PURE__ */ jsx_runtime88.jsxs(ThemedText, {
461479
+ children: /* @__PURE__ */ jsx_runtime88.jsx(ThemedText, {
461454
461480
  color: "error",
461455
- children: [
461456
- "Context limit reached \xB7 /compact or /clear to continue",
461457
- upgradeHint ? ` \xB7 ${upgradeHint}` : ""
461458
- ]
461481
+ children: `Context limit reached \xB7 ${isEnvTruthy(process.env.DISABLE_COMPACT) ? "/clear to continue" : "/compact or /clear to continue"}${autoCompactOffSuffix}${upgradeHint ? ` \xB7 ${upgradeHint}` : ""}`
461459
461482
  })
461460
461483
  });
461484
+ $3[3] = autoCompactOffSuffix;
461461
461485
  $3[4] = t32;
461462
461486
  } else {
461463
461487
  t32 = $3[4];
@@ -461732,6 +461756,8 @@ var init_AssistantTextMessage = __esm(() => {
461732
461756
  init_ink2();
461733
461757
  init_errors10();
461734
461758
  init_messages3();
461759
+ init_envUtils();
461760
+ init_autoCompact();
461735
461761
  init_contextWindowUpgradeCheck();
461736
461762
  init_model();
461737
461763
  init_macOsKeychainStorage();
@@ -478196,6 +478222,9 @@ var init_AgentTool = __esm(() => {
478196
478222
  const denyRule = getDenyRuleForAgent(appState.toolPermissionContext, AGENT_TOOL_NAME, effectiveType);
478197
478223
  throw new Error(`Agent type '${effectiveType}' has been denied by permission rule '${AGENT_TOOL_NAME}(${effectiveType})' from ${denyRule?.source ?? "settings"}.`);
478198
478224
  }
478225
+ if (subagent_type === undefined) {
478226
+ throw new Error(`subagent_type is required: the general-purpose agent is not available in this session. Available agents: ${agents.map((a5) => a5.agentType).join(", ") || "none"}`);
478227
+ }
478199
478228
  throw new Error(`Agent type '${effectiveType}' not found. Available agents: ${agents.map((a5) => a5.agentType).join(", ")}`);
478200
478229
  }
478201
478230
  selectedAgent = found;
@@ -601658,7 +601687,7 @@ async function getAttachments(input2, toolUseContext, ideSelection, queuedComman
601658
601687
  const mainThreadAttachments = isMainThread ? [
601659
601688
  maybe("ide_selection", async () => getSelectedLinesFromIDE(ideSelection, toolUseContext)),
601660
601689
  maybe("ide_opened_file", async () => getOpenedFileFromIDE(ideSelection, toolUseContext)),
601661
- maybe("output_style", async () => Promise.resolve(getOutputStyleAttachment())),
601690
+ maybe("output_style", () => getOutputStyleAttachment()),
601662
601691
  maybe("diagnostics", async () => getDiagnosticAttachments(toolUseContext)),
601663
601692
  maybe("lsp_diagnostics", async () => getLSPDiagnosticAttachments(toolUseContext)),
601664
601693
  maybe("unified_tasks", async () => getUnifiedTaskAttachments(toolUseContext)),
@@ -602004,16 +602033,18 @@ function getCriticalSystemReminderAttachment(toolUseContext) {
602004
602033
  }
602005
602034
  return [{ type: "critical_system_reminder", content: reminder }];
602006
602035
  }
602007
- function getOutputStyleAttachment() {
602036
+ async function getOutputStyleAttachment() {
602008
602037
  const settings = getSettings_DEPRECATED();
602009
602038
  const outputStyle = settings?.outputStyle || "default";
602010
602039
  if (outputStyle === "default") {
602011
602040
  return [];
602012
602041
  }
602042
+ const styleConfig = await getOutputStyleConfig();
602013
602043
  return [
602014
602044
  {
602015
602045
  type: "output_style",
602016
- style: outputStyle
602046
+ style: outputStyle,
602047
+ turnReminder: styleConfig?.turnReminder
602017
602048
  }
602018
602049
  ];
602019
602050
  }
@@ -603375,6 +603406,7 @@ var init_attachments2 = __esm(() => {
603375
603406
  init_common2();
603376
603407
  init_pdf();
603377
603408
  init_apiLimits();
603409
+ init_outputStyles();
603378
603410
  init_agentSwarmsEnabled();
603379
603411
  init_findRelevantMemories();
603380
603412
  init_paths();
@@ -605512,6 +605544,12 @@ function isAutoCompactEnabled() {
605512
605544
  const userConfig = getGlobalConfig();
605513
605545
  return userConfig.autoCompactEnabled;
605514
605546
  }
605547
+ function isAutoCompactExplicitlyOff() {
605548
+ if (isEnvTruthy(process.env.DISABLE_COMPACT) || isEnvTruthy(process.env.DISABLE_AUTO_COMPACT)) {
605549
+ return false;
605550
+ }
605551
+ return getGlobalConfig().autoCompactEnabled === false;
605552
+ }
605515
605553
  async function shouldAutoCompact(messages, model, querySource, snipTokensFreed = 0) {
605516
605554
  if (querySource === "session_memory" || querySource === "compact") {
605517
605555
  return false;
@@ -613194,7 +613232,16 @@ async function getOutputStyleConfig() {
613194
613232
  const outputStyle = settings?.outputStyle || DEFAULT_OUTPUT_STYLE_NAME;
613195
613233
  return allStyles[outputStyle] ?? null;
613196
613234
  }
613197
- var EXPLANATORY_FEATURE_PROMPT, DEFAULT_OUTPUT_STYLE_NAME = "default", OUTPUT_STYLE_CONFIG, getAllOutputStyles;
613235
+ var EXPLANATORY_FEATURE_PROMPT, DEFAULT_OUTPUT_STYLE_NAME = "default", CONCISE_STYLE_RULES = `The user chose brevity over narration. You should:
613236
+
613237
+ 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.
613238
+ 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.
613239
+ 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.
613240
+ 4. **State things plainly** \u2014 Skip hedging boilerplate. Mention a caveat only when it changes what the user should do next.
613241
+ 5. **Give full detail on request** \u2014 When the user asks for an explanation or detail, answer completely. Conciseness never means withholding requested information.
613242
+ 6. **Never trade correctness for brevity** \u2014 Error reports, failing test output, security warnings, and confirmations for destructive actions keep their full content.
613243
+
613244
+ 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;
613198
613245
  var init_outputStyles = __esm(() => {
613199
613246
  init_figures();
613200
613247
  init_memoize();
@@ -613213,6 +613260,17 @@ In order to encourage learning, before and after writing code, always provide br
613213
613260
  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.`;
613214
613261
  OUTPUT_STYLE_CONFIG = {
613215
613262
  [DEFAULT_OUTPUT_STYLE_NAME]: null,
613263
+ Concise: {
613264
+ name: "Concise",
613265
+ source: "built-in",
613266
+ description: "Claude responds tersely, leading with results and skipping preamble and narration",
613267
+ keepCodingInstructions: true,
613268
+ 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.
613269
+
613270
+ # Concise Style Active
613271
+ ${CONCISE_STYLE_RULES}`,
613272
+ turnReminder: CONCISE_TURN_REMINDER
613273
+ },
613216
613274
  Explanatory: {
613217
613275
  name: "Explanatory",
613218
613276
  source: "built-in",
@@ -615641,7 +615699,7 @@ ${attachment.content}`,
615641
615699
  }
615642
615700
  return wrapMessagesInSystemReminder([
615643
615701
  createUserMessage({
615644
- content: `${outputStyle.name} output style is active. Remember to follow the specific guidelines for this style.`,
615702
+ content: `${outputStyle.name} output style is active. ${attachment.turnReminder ?? "Remember to follow the specific guidelines for this style."}`,
615645
615703
  isMeta: true
615646
615704
  })
615647
615705
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnwenf/occ",
3
- "version": "2.1.305",
3
+ "version": "2.1.307",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "bin": {