@cnwenf/occ 2.1.305 → 2.1.306

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 +25 -16
  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.306","BINARY_NAME":"occ","BUILD_TIME":"2026-08-19T19:58:24.299Z","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;
@@ -264261,6 +264261,11 @@ function shouldInjectAgentListInMessages() {
264261
264261
  }
264262
264262
  async function getPrompt2(agentDefinitions, isCoordinator, allowedAgentTypes) {
264263
264263
  const effectiveAgents = allowedAgentTypes ? agentDefinitions.filter((a5) => allowedAgentTypes.includes(a5.agentType)) : agentDefinitions;
264264
+ const normalizeAgentType = (s4) => s4.toLowerCase().replace(/[\s_-]+/g, "-");
264265
+ const gpMatches = agentDefinitions.filter((a5) => normalizeAgentType(a5.agentType) === normalizeAgentType(GENERAL_PURPOSE_AGENT.agentType));
264266
+ const passesAllowlist = (a5) => allowedAgentTypes?.includes(a5.agentType) ?? true;
264267
+ const gpExact = gpMatches.find((a5) => a5.agentType === GENERAL_PURPOSE_AGENT.agentType);
264268
+ const generalPurposeAvailable = gpExact ? passesAllowlist(gpExact) : gpMatches.length === 1 && passesAllowlist(gpMatches[0]);
264264
264269
  const forkEnabled = isForkSubagentEnabled();
264265
264270
  const whenToForkSection = forkEnabled ? `
264266
264271
 
@@ -264376,7 +264381,7 @@ The ${AGENT_TOOL_NAME} tool launches specialized agents (subprocesses) that auto
264376
264381
 
264377
264382
  ${agentListSection}
264378
264383
 
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.`}`;
264384
+ ${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
264385
  if (isCoordinator) {
264381
264386
  return shared4;
264382
264387
  }
@@ -264421,6 +264426,7 @@ var init_prompt12 = __esm(() => {
264421
264426
  init_teammateContext();
264422
264427
  init_prompt3();
264423
264428
  init_prompt4();
264429
+ init_generalPurposeAgent();
264424
264430
  init_constants3();
264425
264431
  init_forkSubagent();
264426
264432
  });
@@ -461438,26 +461444,18 @@ function AssistantTextMessage(t0) {
461438
461444
  return null;
461439
461445
  }
461440
461446
  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;
461447
+ const autoCompactOffSuffix = isAutoCompactExplicitlyOff() ? " \xB7 auto-compact is off \xB7 /config to turn it on" : "";
461449
461448
  let t32;
461450
- if ($3[4] === Symbol.for("react.memo_cache_sentinel")) {
461449
+ if ($3[4] === Symbol.for("react.memo_cache_sentinel") || $3[3] !== autoCompactOffSuffix) {
461450
+ const upgradeHint = getUpgradeMessage("warning");
461451
461451
  t32 = /* @__PURE__ */ jsx_runtime88.jsx(MessageResponse, {
461452
461452
  height: 1,
461453
- children: /* @__PURE__ */ jsx_runtime88.jsxs(ThemedText, {
461453
+ children: /* @__PURE__ */ jsx_runtime88.jsx(ThemedText, {
461454
461454
  color: "error",
461455
- children: [
461456
- "Context limit reached \xB7 /compact or /clear to continue",
461457
- upgradeHint ? ` \xB7 ${upgradeHint}` : ""
461458
- ]
461455
+ children: `Context limit reached \xB7 ${isEnvTruthy(process.env.DISABLE_COMPACT) ? "/clear to continue" : "/compact or /clear to continue"}${autoCompactOffSuffix}${upgradeHint ? ` \xB7 ${upgradeHint}` : ""}`
461459
461456
  })
461460
461457
  });
461458
+ $3[3] = autoCompactOffSuffix;
461461
461459
  $3[4] = t32;
461462
461460
  } else {
461463
461461
  t32 = $3[4];
@@ -461732,6 +461730,8 @@ var init_AssistantTextMessage = __esm(() => {
461732
461730
  init_ink2();
461733
461731
  init_errors10();
461734
461732
  init_messages3();
461733
+ init_envUtils();
461734
+ init_autoCompact();
461735
461735
  init_contextWindowUpgradeCheck();
461736
461736
  init_model();
461737
461737
  init_macOsKeychainStorage();
@@ -478196,6 +478196,9 @@ var init_AgentTool = __esm(() => {
478196
478196
  const denyRule = getDenyRuleForAgent(appState.toolPermissionContext, AGENT_TOOL_NAME, effectiveType);
478197
478197
  throw new Error(`Agent type '${effectiveType}' has been denied by permission rule '${AGENT_TOOL_NAME}(${effectiveType})' from ${denyRule?.source ?? "settings"}.`);
478198
478198
  }
478199
+ if (subagent_type === undefined) {
478200
+ 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"}`);
478201
+ }
478199
478202
  throw new Error(`Agent type '${effectiveType}' not found. Available agents: ${agents.map((a5) => a5.agentType).join(", ")}`);
478200
478203
  }
478201
478204
  selectedAgent = found;
@@ -605512,6 +605515,12 @@ function isAutoCompactEnabled() {
605512
605515
  const userConfig = getGlobalConfig();
605513
605516
  return userConfig.autoCompactEnabled;
605514
605517
  }
605518
+ function isAutoCompactExplicitlyOff() {
605519
+ if (isEnvTruthy(process.env.DISABLE_COMPACT) || isEnvTruthy(process.env.DISABLE_AUTO_COMPACT)) {
605520
+ return false;
605521
+ }
605522
+ return getGlobalConfig().autoCompactEnabled === false;
605523
+ }
605515
605524
  async function shouldAutoCompact(messages, model, querySource, snipTokensFreed = 0) {
605516
605525
  if (querySource === "session_memory" || querySource === "compact") {
605517
605526
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnwenf/occ",
3
- "version": "2.1.305",
3
+ "version": "2.1.306",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "bin": {