@clawos-dev/clawd 0.2.729 → 0.2.731

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.cjs CHANGED
@@ -16645,6 +16645,10 @@ async function probeClaude(env = process.env) {
16645
16645
  if (w3) return { available: true, path: w3 };
16646
16646
  return { available: false };
16647
16647
  }
16648
+ function withOneMContext(model) {
16649
+ if (!model || model.endsWith(ONE_M_CONTEXT) || !/opus|sonnet|fable/i.test(model)) return model;
16650
+ return model + ONE_M_CONTEXT;
16651
+ }
16648
16652
  function buildSpawnArgs(ctx) {
16649
16653
  const args = [
16650
16654
  "--print",
@@ -16662,7 +16666,8 @@ function buildSpawnArgs(ctx) {
16662
16666
  "stdio",
16663
16667
  "--verbose"
16664
16668
  ];
16665
- if (ctx.model) args.push("--model", ctx.model);
16669
+ const model = withOneMContext(ctx.model);
16670
+ if (model) args.push("--model", model);
16666
16671
  switch (ctx.personaMode) {
16667
16672
  case "guest":
16668
16673
  args.push("--setting-sources", "project,local");
@@ -17104,7 +17109,7 @@ function encodeClaudeStdin(text) {
17104
17109
  };
17105
17110
  return JSON.stringify(frame) + "\n";
17106
17111
  }
17107
- var import_node_child_process3, import_node_child_process4, import_node_fs13, ATTACHMENT_SILENT_SUBTYPES2, unknownTypeHandler, ATTACHMENT_RE, IMAGE_EXT_MIME, CLAUDE_MODEL_IDS, CLAUDE_MODELS, _assertModelIdsAligned, CLAUDE_PERMISSION_MODES, CLAUDE_CAPABILITIES, ClaudeAdapter;
17112
+ var import_node_child_process3, import_node_child_process4, import_node_fs13, ONE_M_CONTEXT, ATTACHMENT_SILENT_SUBTYPES2, unknownTypeHandler, ATTACHMENT_RE, IMAGE_EXT_MIME, CLAUDE_MODEL_IDS, CLAUDE_MODELS, _assertModelIdsAligned, CLAUDE_PERMISSION_MODES, CLAUDE_CAPABILITIES, ClaudeAdapter;
17108
17113
  var init_claude = __esm({
17109
17114
  "src/tools/claude.ts"() {
17110
17115
  "use strict";
@@ -17116,6 +17121,7 @@ var init_claude = __esm({
17116
17121
  init_subscription_channels_apply();
17117
17122
  init_claude_history();
17118
17123
  init_tool_result_extra();
17124
+ ONE_M_CONTEXT = "[1m]";
17119
17125
  ATTACHMENT_SILENT_SUBTYPES2 = /* @__PURE__ */ new Set([
17120
17126
  "hook_additional_context",
17121
17127
  "hook_success",
@@ -17248,9 +17254,10 @@ var init_claude = __esm({
17248
17254
  const channel = this.getSubscriptionChannel?.();
17249
17255
  if (!channel) return buildSpawnEnv(ctx.env);
17250
17256
  const env = { ...ctx.env, ...claudeSubscriptionEnv(channel) };
17251
- if (ctx.model && !CLAUDE_MODEL_IDS.includes(ctx.model.replace(/\[1m\]$/, ""))) {
17252
- for (const alias of CLAUDE_MODEL_IDS) env["ANTHROPIC_DEFAULT_" + alias.toUpperCase() + "_MODEL"] = ctx.model;
17253
- env.CLAUDE_CODE_SUBAGENT_MODEL = ctx.model;
17257
+ const model = withOneMContext(ctx.model);
17258
+ if (model && !CLAUDE_MODEL_IDS.includes(model.replace(/\[1m\]$/, ""))) {
17259
+ for (const alias of CLAUDE_MODEL_IDS) env["ANTHROPIC_DEFAULT_" + alias.toUpperCase() + "_MODEL"] = model;
17260
+ env.CLAUDE_CODE_SUBAGENT_MODEL = model;
17254
17261
  }
17255
17262
  return buildSpawnEnv(env);
17256
17263
  }
@@ -56813,7 +56820,8 @@ function buildTuiSpawnArgs(ctx, isResume = false) {
56813
56820
  if (ctx.toolSessionId) {
56814
56821
  args.push(isResume ? "--resume" : "--session-id", ctx.toolSessionId);
56815
56822
  }
56816
- if (ctx.model) args.push("--model", ctx.model);
56823
+ const model = withOneMContext(ctx.model);
56824
+ if (model) args.push("--model", model);
56817
56825
  switch (ctx.personaMode) {
56818
56826
  case "guest":
56819
56827
  args.push("--setting-sources", "project,local");
@@ -76161,7 +76169,7 @@ function computeMethodAccess(args) {
76161
76169
  }
76162
76170
 
76163
76171
  // src/version.ts
76164
- var version = "0.2.729".length > 0 ? "0.2.729" : "dev";
76172
+ var version = "0.2.731".length > 0 ? "0.2.731" : "dev";
76165
76173
 
76166
76174
  // src/cli-probe/probe.ts
76167
76175
  var fs87 = __toESM(require("fs"), 1);