cc-claw 0.10.0 → 0.10.1

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 (3) hide show
  1. package/README.md +1 -0
  2. package/dist/cli.js +87 -2
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -137,6 +137,7 @@ Read commands work offline (direct DB access). Write commands require the daemon
137
137
  | `/backend` | Switch backend via keyboard |
138
138
  | `/claude` `/gemini` `/codex` `/cursor` | Quick switch |
139
139
  | `/model` | Switch model + thinking level |
140
+ | `/thinking` | Adjust thinking/reasoning level |
140
141
  | `/summarizer` | Session summarization model |
141
142
 
142
143
  ### Scheduling
package/dist/cli.js CHANGED
@@ -72,7 +72,7 @@ var VERSION;
72
72
  var init_version = __esm({
73
73
  "src/version.ts"() {
74
74
  "use strict";
75
- VERSION = true ? "0.10.0" : (() => {
75
+ VERSION = true ? "0.10.1" : (() => {
76
76
  try {
77
77
  return JSON.parse(readFileSync(join2(process.cwd(), "package.json"), "utf-8")).version ?? "unknown";
78
78
  } catch {
@@ -3719,11 +3719,12 @@ function extractToolResult(tc) {
3719
3719
  if (tc.error !== void 0) return { output: `Error: ${String(tc.error)}` };
3720
3720
  return { output: "" };
3721
3721
  }
3722
- var THINKING_VARIANTS, CursorAdapter;
3722
+ var THINKING_VARIANTS, FREE_TIER_MODEL_THRESHOLD, CursorAdapter;
3723
3723
  var init_cursor = __esm({
3724
3724
  "src/backends/cursor.ts"() {
3725
3725
  "use strict";
3726
3726
  init_env();
3727
+ init_log();
3727
3728
  THINKING_VARIANTS = {
3728
3729
  "gpt-5.4-medium": { off: "gpt-5.4-low", low: "gpt-5.4-low", high: "gpt-5.4-high", extra_high: "gpt-5.4-xhigh" },
3729
3730
  "gpt-5.4-high": { off: "gpt-5.4-low", low: "gpt-5.4-low", medium: "gpt-5.4-medium", extra_high: "gpt-5.4-xhigh" },
@@ -3740,9 +3741,12 @@ var init_cursor = __esm({
3740
3741
  "claude-4.6-sonnet-medium": { high: "claude-4.6-sonnet-medium-thinking", extra_high: "claude-4.6-sonnet-medium-thinking" },
3741
3742
  "claude-4.6-sonnet-medium-thinking": { off: "claude-4.6-sonnet-medium", low: "claude-4.6-sonnet-medium", medium: "claude-4.6-sonnet-medium" }
3742
3743
  };
3744
+ FREE_TIER_MODEL_THRESHOLD = 5;
3743
3745
  CursorAdapter = class {
3744
3746
  id = "cursor";
3745
3747
  displayName = "Cursor";
3748
+ _tier = null;
3749
+ _tierProbed = false;
3746
3750
  availableModels = {
3747
3751
  "claude-4.6-opus-high-thinking": {
3748
3752
  label: "Opus 4.6 Thinking \u2014 most capable",
@@ -3831,6 +3835,47 @@ var init_cursor = __esm({
3831
3835
  }
3832
3836
  return this._resolvedPath;
3833
3837
  }
3838
+ /**
3839
+ * Probe Cursor subscription tier by running `agent models`.
3840
+ * Free accounts get ≤5 models (auto, composer-2, composer-2-fast).
3841
+ * Paid accounts get 80+. Called once on startup — strips unavailable
3842
+ * models from availableModels so /model only shows what works.
3843
+ */
3844
+ probeTier() {
3845
+ if (this._tier) return this._tier;
3846
+ if (this._tierProbed) return "unknown";
3847
+ this._tierProbed = true;
3848
+ try {
3849
+ const exe = this.getExecutablePath();
3850
+ const output2 = execSync4(`${exe} models`, { encoding: "utf-8", timeout: 1e4 });
3851
+ const lines = output2.split("\n").filter((l) => l.includes(" - "));
3852
+ const modelIds = new Set(lines.map((l) => l.trim().split(" - ")[0].trim()).filter(Boolean));
3853
+ if (modelIds.size <= FREE_TIER_MODEL_THRESHOLD) {
3854
+ this._tier = "free";
3855
+ log(`[cursor] Tier: free (${modelIds.size} models: ${[...modelIds].join(", ")})`);
3856
+ for (const key of Object.keys(this.availableModels)) {
3857
+ if (!modelIds.has(key)) {
3858
+ delete this.availableModels[key];
3859
+ }
3860
+ }
3861
+ if (!this.availableModels["auto"]) {
3862
+ this.availableModels["auto"] = {
3863
+ label: "Auto \u2014 Cursor picks the model",
3864
+ thinking: "none"
3865
+ };
3866
+ }
3867
+ this.defaultModel = modelIds.has("composer-2") ? "composer-2" : "auto";
3868
+ this.summarizerModel = this.defaultModel;
3869
+ } else {
3870
+ this._tier = "pro";
3871
+ log(`[cursor] Tier: pro (${modelIds.size} models)`);
3872
+ }
3873
+ } catch (err) {
3874
+ warn(`[cursor] Tier probe failed: ${err}`);
3875
+ this._tier = "unknown";
3876
+ }
3877
+ return this._tier;
3878
+ }
3834
3879
  getEnv(thinkingOverrides) {
3835
3880
  const env = buildBaseEnv(thinkingOverrides);
3836
3881
  if (process.env.CURSOR_API_KEY) {
@@ -10050,6 +10095,7 @@ var init_telegram2 = __esm({
10050
10095
  { command: "codex", description: "Switch to Codex backend" },
10051
10096
  { command: "cursor", description: "Switch to Cursor backend" },
10052
10097
  { command: "model", description: "Switch model for active backend" },
10098
+ { command: "thinking", description: "Adjust thinking/reasoning level" },
10053
10099
  { command: "summarizer", description: "Configure session summarization model" },
10054
10100
  // Permissions & tools
10055
10101
  { command: "permissions", description: "Permission mode (yolo/safe/readonly/plan)" },
@@ -13766,6 +13812,42 @@ Appends model + thinking level to each response.`, [
13766
13812
  }
13767
13813
  break;
13768
13814
  }
13815
+ case "thinking":
13816
+ case "think": {
13817
+ let adapter;
13818
+ try {
13819
+ adapter = getAdapterForChat(chatId);
13820
+ } catch {
13821
+ await channel.sendText(chatId, "No backend set. Use /backend first.", "plain");
13822
+ break;
13823
+ }
13824
+ const currentModel = getModel(chatId) ?? adapter.defaultModel;
13825
+ const modelInfo = adapter.availableModels[currentModel];
13826
+ const currentLevel = getThinkingLevel(chatId) || "auto";
13827
+ if (!modelInfo || modelInfo.thinking !== "adjustable" || !modelInfo.thinkingLevels) {
13828
+ await channel.sendText(chatId, `Current model (${shortModelName(currentModel)}) doesn't support adjustable thinking.
13829
+ Use /model to pick a model with \u26A1 thinking support.`, "plain");
13830
+ break;
13831
+ }
13832
+ if (typeof channel.sendKeyboard === "function") {
13833
+ const buttons = modelInfo.thinkingLevels.map((level) => [{
13834
+ label: `${level === currentLevel ? "\u2713 " : ""}${level === "auto" ? "Auto" : capitalize(level)}`,
13835
+ data: `thinking:${level}`,
13836
+ ...level === currentLevel ? { style: "primary" } : {}
13837
+ }]);
13838
+ await channel.sendKeyboard(
13839
+ chatId,
13840
+ `\u{1F4AD} Thinking Level \u2014 ${shortModelName(currentModel)}
13841
+ Current: ${capitalize(currentLevel)}`,
13842
+ buttons
13843
+ );
13844
+ } else {
13845
+ await channel.sendText(chatId, `Thinking: ${capitalize(currentLevel)}
13846
+ Levels: ${modelInfo.thinkingLevels.join(", ")}
13847
+ Set via callback (keyboard required).`, "plain");
13848
+ }
13849
+ break;
13850
+ }
13769
13851
  case "imagine":
13770
13852
  case "image": {
13771
13853
  if (!commandArgs) {
@@ -16879,6 +16961,7 @@ var init_router = __esm({
16879
16961
  Brain: [
16880
16962
  { cmd: "/backend", desc: "Switch AI backend" },
16881
16963
  { cmd: "/model", desc: "Switch model" },
16964
+ { cmd: "/thinking", desc: "Adjust thinking level" },
16882
16965
  { cmd: "/permissions", desc: "Set permission mode" },
16883
16966
  { cmd: "/response_style", desc: "Set response verbosity" },
16884
16967
  { cmd: "/model_signature", desc: "Toggle model signature" }
@@ -17759,6 +17842,8 @@ async function main() {
17759
17842
  probeBackendAvailability2();
17760
17843
  const claude = getAdapter2("claude");
17761
17844
  if ("getAuthMode" in claude) claude.getAuthMode();
17845
+ const cursor = getAdapter2("cursor");
17846
+ if ("probeTier" in cursor) cursor.probeTier();
17762
17847
  } catch {
17763
17848
  }
17764
17849
  let pendingSummarizeNotify = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-claw",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "CC-Claw: Personal AI assistant on Telegram — multi-backend (Claude, Gemini, Codex, Cursor), sub-agent orchestration, MCP management",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",