@cnwenf/occ 2.1.286 → 2.1.288
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 +27 -5
- 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.288","BINARY_NAME":"occ","BUILD_TIME":"2026-07-27T17:54:44.726Z","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;
|
|
@@ -96173,7 +96173,7 @@ var init_bedrock = __esm(() => {
|
|
|
96173
96173
|
});
|
|
96174
96174
|
|
|
96175
96175
|
// src/utils/model/configs.ts
|
|
96176
|
-
var CLAUDE_3_7_SONNET_CONFIG, CLAUDE_3_5_V2_SONNET_CONFIG, CLAUDE_3_5_HAIKU_CONFIG, CLAUDE_HAIKU_4_5_CONFIG, CLAUDE_SONNET_4_CONFIG, CLAUDE_SONNET_4_5_CONFIG, CLAUDE_OPUS_4_CONFIG, CLAUDE_OPUS_4_1_CONFIG, CLAUDE_OPUS_4_5_CONFIG, CLAUDE_OPUS_4_6_CONFIG, CLAUDE_SONNET_4_6_CONFIG, CLAUDE_OPUS_4_7_CONFIG, CLAUDE_OPUS_4_8_CONFIG, CLAUDE_SONNET_5_CONFIG, CLAUDE_FABLE_5_CONFIG, ALL_MODEL_CONFIGS, CANONICAL_MODEL_IDS, CANONICAL_ID_TO_KEY;
|
|
96176
|
+
var CLAUDE_3_7_SONNET_CONFIG, CLAUDE_3_5_V2_SONNET_CONFIG, CLAUDE_3_5_HAIKU_CONFIG, CLAUDE_HAIKU_4_5_CONFIG, CLAUDE_SONNET_4_CONFIG, CLAUDE_SONNET_4_5_CONFIG, CLAUDE_OPUS_4_CONFIG, CLAUDE_OPUS_4_1_CONFIG, CLAUDE_OPUS_4_5_CONFIG, CLAUDE_OPUS_4_6_CONFIG, CLAUDE_SONNET_4_6_CONFIG, CLAUDE_OPUS_4_7_CONFIG, CLAUDE_OPUS_4_8_CONFIG, CLAUDE_OPUS_5_CONFIG, CLAUDE_SONNET_5_CONFIG, CLAUDE_FABLE_5_CONFIG, ALL_MODEL_CONFIGS, CANONICAL_MODEL_IDS, CANONICAL_ID_TO_KEY;
|
|
96177
96177
|
var init_configs = __esm(() => {
|
|
96178
96178
|
CLAUDE_3_7_SONNET_CONFIG = {
|
|
96179
96179
|
firstParty: "claude-3-7-sonnet-20250219",
|
|
@@ -96292,6 +96292,15 @@ var init_configs = __esm(() => {
|
|
|
96292
96292
|
mantle: "anthropic.claude-opus-4-8",
|
|
96293
96293
|
gateway: "claude-opus-4-8"
|
|
96294
96294
|
};
|
|
96295
|
+
CLAUDE_OPUS_5_CONFIG = {
|
|
96296
|
+
firstParty: "claude-opus-5",
|
|
96297
|
+
bedrock: "us.anthropic.claude-opus-5",
|
|
96298
|
+
vertex: "claude-opus-5",
|
|
96299
|
+
foundry: "claude-opus-5",
|
|
96300
|
+
anthropic_aws: "claude-opus-5",
|
|
96301
|
+
mantle: "anthropic.claude-opus-5",
|
|
96302
|
+
gateway: "claude-opus-5"
|
|
96303
|
+
};
|
|
96295
96304
|
CLAUDE_SONNET_5_CONFIG = {
|
|
96296
96305
|
firstParty: "claude-sonnet-5",
|
|
96297
96306
|
bedrock: "us.anthropic.claude-sonnet-5",
|
|
@@ -96325,6 +96334,7 @@ var init_configs = __esm(() => {
|
|
|
96325
96334
|
opus46: CLAUDE_OPUS_4_6_CONFIG,
|
|
96326
96335
|
opus47: CLAUDE_OPUS_4_7_CONFIG,
|
|
96327
96336
|
opus48: CLAUDE_OPUS_4_8_CONFIG,
|
|
96337
|
+
opus5: CLAUDE_OPUS_5_CONFIG,
|
|
96328
96338
|
fable5: CLAUDE_FABLE_5_CONFIG
|
|
96329
96339
|
};
|
|
96330
96340
|
CANONICAL_MODEL_IDS = Object.values(ALL_MODEL_CONFIGS).map((c7) => c7.firstParty);
|
|
@@ -100930,7 +100940,7 @@ function getDefaultOpusModel() {
|
|
|
100930
100940
|
if (getAPIProvider() === "gateway") {
|
|
100931
100941
|
return getModelStrings2().opus47;
|
|
100932
100942
|
}
|
|
100933
|
-
return getModelStrings2().
|
|
100943
|
+
return getModelStrings2().opus5;
|
|
100934
100944
|
}
|
|
100935
100945
|
function getDefaultSonnetModel() {
|
|
100936
100946
|
if (process.env.ANTHROPIC_DEFAULT_SONNET_MODEL) {
|
|
@@ -101007,6 +101017,9 @@ function getDefaultMainLoopModel() {
|
|
|
101007
101017
|
}
|
|
101008
101018
|
function firstPartyNameToCanonical(name) {
|
|
101009
101019
|
name = name.toLowerCase();
|
|
101020
|
+
if (name.includes("claude-opus-5")) {
|
|
101021
|
+
return "claude-opus-5";
|
|
101022
|
+
}
|
|
101010
101023
|
if (name.includes("claude-opus-4-8")) {
|
|
101011
101024
|
return "claude-opus-4-8";
|
|
101012
101025
|
}
|
|
@@ -101115,6 +101128,10 @@ function renderModelSetting(setting) {
|
|
|
101115
101128
|
}
|
|
101116
101129
|
function getPublicModelDisplayName(model) {
|
|
101117
101130
|
switch (model) {
|
|
101131
|
+
case getModelStrings2().opus5:
|
|
101132
|
+
return "Opus 5";
|
|
101133
|
+
case getModelStrings2().opus5 + "[1m]":
|
|
101134
|
+
return "Opus 5 (1M context)";
|
|
101118
101135
|
case getModelStrings2().opus48:
|
|
101119
101136
|
return "Opus 4.8";
|
|
101120
101137
|
case getModelStrings2().opus48 + "[1m]":
|
|
@@ -101271,6 +101288,9 @@ function getMarketingNameForModel(modelId) {
|
|
|
101271
101288
|
}
|
|
101272
101289
|
const has1m = modelId.toLowerCase().includes("[1m]");
|
|
101273
101290
|
const canonical = getCanonicalName(modelId);
|
|
101291
|
+
if (canonical.includes("claude-opus-5")) {
|
|
101292
|
+
return has1m ? "Opus 5 (with 1M context)" : "Opus 5";
|
|
101293
|
+
}
|
|
101274
101294
|
if (canonical.includes("claude-opus-4-8")) {
|
|
101275
101295
|
return has1m ? "Opus 4.8 (with 1M context)" : "Opus 4.8";
|
|
101276
101296
|
}
|
|
@@ -139662,7 +139682,7 @@ function modelSupports1M(model) {
|
|
|
139662
139682
|
return false;
|
|
139663
139683
|
}
|
|
139664
139684
|
const canonical = getCanonicalName(model);
|
|
139665
|
-
return canonical.includes("claude-sonnet-4") || canonical.includes("claude-sonnet-5") || canonical.includes("opus-4-6") || canonical.includes("opus-4-7") || canonical.includes("opus-4-8");
|
|
139685
|
+
return canonical.includes("claude-sonnet-4") || canonical.includes("claude-sonnet-5") || canonical.includes("opus-4-6") || canonical.includes("opus-4-7") || canonical.includes("opus-4-8") || canonical.includes("opus-5");
|
|
139666
139686
|
}
|
|
139667
139687
|
function getContextWindowForModel(model, betas) {
|
|
139668
139688
|
if (process.env.USER_TYPE === "ant" && process.env.CLAUDE_CODE_MAX_CONTEXT_TOKENS) {
|
|
@@ -366454,6 +366474,8 @@ function sanitizeSurfaceKey(surfaceKey) {
|
|
|
366454
366474
|
return `${surface}/${sanitizedModel}`;
|
|
366455
366475
|
}
|
|
366456
366476
|
function sanitizeModelName(shortName) {
|
|
366477
|
+
if (shortName.includes("opus-5"))
|
|
366478
|
+
return "claude-opus-5";
|
|
366457
366479
|
if (shortName.includes("opus-4-6"))
|
|
366458
366480
|
return "claude-opus-4-6";
|
|
366459
366481
|
if (shortName.includes("opus-4-5"))
|
|
@@ -823241,7 +823263,7 @@ async function run() {
|
|
|
823241
823263
|
})).option("-c, --continue", "Continue the most recent conversation in the current directory", () => true).option("-r, --resume [value]", "Resume a conversation by session ID, or open interactive picker with optional search term", (value) => value || true).option("--fork-session", "When resuming, create a new session ID instead of reusing the original (use with --resume or --continue)", () => true).addOption(new Option("--prefill <text>", "Pre-fill the prompt input with text without submitting it").hideHelp()).addOption(new Option("--deep-link-origin", "Signal that this session was launched from a deep link").hideHelp()).addOption(new Option("--deep-link-repo <slug>", "Repo slug the deep link ?repo= parameter resolved to the current cwd").hideHelp()).addOption(new Option("--deep-link-last-fetch <ms>", "FETCH_HEAD mtime in epoch ms, precomputed by the deep link trampoline").argParser((v6) => {
|
|
823242
823264
|
const n6 = Number(v6);
|
|
823243
823265
|
return Number.isFinite(n6) ? n6 : undefined;
|
|
823244
|
-
}).hideHelp()).option("--from-pr [value]", "Resume a session linked to a PR by PR number/URL, or open interactive picker with optional search term", (value) => value || true).option("--no-session-persistence", "Disable session persistence - sessions will not be saved to disk and cannot be resumed (only works with --print)").addOption(new Option("--resume-session-at <message id>", "When resuming, only messages up to and including the assistant message with <message.id> (use with --resume in print mode)").argParser(String).hideHelp()).addOption(new Option("--rewind-files <user-message-id>", "Restore files to state at the specified user message and exit (requires --resume)").hideHelp()).option("--model <model>", `Model for the current session. Provide an alias for the latest model (e.g. '
|
|
823266
|
+
}).hideHelp()).option("--from-pr [value]", "Resume a session linked to a PR by PR number/URL, or open interactive picker with optional search term", (value) => value || true).option("--no-session-persistence", "Disable session persistence - sessions will not be saved to disk and cannot be resumed (only works with --print)").addOption(new Option("--resume-session-at <message id>", "When resuming, only messages up to and including the assistant message with <message.id> (use with --resume in print mode)").argParser(String).hideHelp()).addOption(new Option("--rewind-files <user-message-id>", "Restore files to state at the specified user message and exit (requires --resume)").hideHelp()).option("--model <model>", `Model for the current session. Provide an alias for the latest model (e.g. 'fable', 'opus', or 'sonnet') or a model's full name (e.g. 'claude-fable-5').`).addOption(new Option("--effort <level>", `Effort level for the current session (${EFFORT_LEVELS.join(", ")})`).argParser((rawValue) => {
|
|
823245
823267
|
const value = rawValue.toLowerCase();
|
|
823246
823268
|
if (!EFFORT_LEVELS.includes(value)) {
|
|
823247
823269
|
throw new InvalidArgumentError(`It must be one of: ${EFFORT_LEVELS.join(", ")}`);
|