claudish 14.25.0 → 14.26.0

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/index.js +669 -49
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -5525,7 +5525,7 @@ var init_env_placeholder = __esm(() => {
5525
5525
  });
5526
5526
 
5527
5527
  // src/version.ts
5528
- var VERSION = "14.25.0";
5528
+ var VERSION = "14.26.0";
5529
5529
 
5530
5530
  // src/redact.ts
5531
5531
  function isPlaceholder(value) {
@@ -13287,6 +13287,80 @@ var init_bundled_recommended_list = __esm(() => {
13287
13287
  ]
13288
13288
  }
13289
13289
  },
13290
+ "gpt-6.1-terra": {
13291
+ code_review: {
13292
+ basis: "vendor_guidance",
13293
+ effort: "xhigh",
13294
+ sendableOn: [
13295
+ {
13296
+ encoding: "request_parameter",
13297
+ externalModelId: "gpt-6.1-terra",
13298
+ routeId: "openai",
13299
+ routeProfileId: "codex-subscription"
13300
+ }
13301
+ ]
13302
+ },
13303
+ debugging: {
13304
+ basis: "vendor_guidance",
13305
+ effort: "high",
13306
+ sendableOn: [
13307
+ {
13308
+ encoding: "request_parameter",
13309
+ externalModelId: "gpt-6.1-terra",
13310
+ routeId: "openai",
13311
+ routeProfileId: "codex-subscription"
13312
+ }
13313
+ ]
13314
+ },
13315
+ default: {
13316
+ basis: "vendor_default",
13317
+ effort: "medium",
13318
+ sendableOn: [
13319
+ {
13320
+ encoding: "request_parameter",
13321
+ externalModelId: "gpt-6.1-terra",
13322
+ routeId: "openai",
13323
+ routeProfileId: "codex-subscription"
13324
+ }
13325
+ ]
13326
+ },
13327
+ frontend_ui: {
13328
+ basis: "owner_choice",
13329
+ effort: "high",
13330
+ sendableOn: [
13331
+ {
13332
+ encoding: "request_parameter",
13333
+ externalModelId: "gpt-6.1-terra",
13334
+ routeId: "openai",
13335
+ routeProfileId: "codex-subscription"
13336
+ }
13337
+ ]
13338
+ },
13339
+ quick_edit: {
13340
+ basis: "vendor_guidance",
13341
+ effort: "low",
13342
+ sendableOn: [
13343
+ {
13344
+ encoding: "request_parameter",
13345
+ externalModelId: "gpt-6.1-terra",
13346
+ routeId: "openai",
13347
+ routeProfileId: "codex-subscription"
13348
+ }
13349
+ ]
13350
+ },
13351
+ terminal_ops: {
13352
+ basis: "benchmark_knee",
13353
+ effort: "xhigh",
13354
+ sendableOn: [
13355
+ {
13356
+ encoding: "request_parameter",
13357
+ externalModelId: "gpt-6.1-terra",
13358
+ routeId: "openai",
13359
+ routeProfileId: "codex-subscription"
13360
+ }
13361
+ ]
13362
+ }
13363
+ },
13290
13364
  "kimi-k3.1-pro": {
13291
13365
  code_review: {
13292
13366
  basis: "owner_choice",
@@ -14054,7 +14128,7 @@ var init_bundled_recommended_list = __esm(() => {
14054
14128
  }
14055
14129
  }
14056
14130
  },
14057
- fetchedAt: "2026-11-15T00:03:45.109Z",
14131
+ fetchedAt: "2026-11-15T14:24:57.472Z",
14058
14132
  format: 1,
14059
14133
  recommendations: {
14060
14134
  contractVersion: 3,
@@ -14136,7 +14210,7 @@ var init_bundled_recommended_list = __esm(() => {
14136
14210
  tier: "cost_efficient"
14137
14211
  },
14138
14212
  {
14139
- modelId: "gpt-6.1-sol",
14213
+ modelId: "gpt-6.1-terra",
14140
14214
  tier: "cost_efficient"
14141
14215
  },
14142
14216
  {
@@ -14160,11 +14234,11 @@ var init_bundled_recommended_list = __esm(() => {
14160
14234
  tier: "luxury"
14161
14235
  }
14162
14236
  ],
14163
- generationId: "g-20261114234105679-14dde71a"
14237
+ generationId: "g-20261115114852784-7f4f3a66"
14164
14238
  },
14165
14239
  source: "https://us-central1-claudish-6da10.cloudfunctions.net"
14166
14240
  },
14167
- catalogGenerationId: "g-20261114234105679-14dde71a",
14241
+ catalogGenerationId: "g-20261115114852784-7f4f3a66",
14168
14242
  entries: [
14169
14243
  {
14170
14244
  aggregators: [
@@ -16731,6 +16805,266 @@ var init_bundled_recommended_list = __esm(() => {
16731
16805
  videoInput: false,
16732
16806
  videoOutput: false
16733
16807
  },
16808
+ {
16809
+ aggregators: [
16810
+ {
16811
+ externalModelId: "gpt-6.1-terra",
16812
+ reasoning: {
16813
+ mode: {
16814
+ status: "rejected"
16815
+ },
16816
+ request: {
16817
+ status: "unknown"
16818
+ }
16819
+ },
16820
+ route: {
16821
+ routeId: "openai",
16822
+ routeProfileId: "codex-subscription"
16823
+ },
16824
+ routeStatus: "mapped",
16825
+ sourceProviderId: "openai-codex",
16826
+ wire: {
16827
+ api: "responses",
16828
+ evidence: [],
16829
+ reasoning: {
16830
+ disable: [
16831
+ {
16832
+ path: "/reasoning/effort",
16833
+ value: "none"
16834
+ }
16835
+ ],
16836
+ effort: {
16837
+ default: "low",
16838
+ path: "/reasoning/effort",
16839
+ values: {
16840
+ high: "high",
16841
+ low: "low",
16842
+ max: "max",
16843
+ medium: "medium",
16844
+ none: "none",
16845
+ xhigh: "xhigh"
16846
+ }
16847
+ },
16848
+ enable: {
16849
+ status: "not_applicable"
16850
+ },
16851
+ mode: {
16852
+ path: "/reasoning/mode",
16853
+ status: "rejected"
16854
+ },
16855
+ status: "supported"
16856
+ },
16857
+ speed: {
16858
+ access: "open",
16859
+ default: "standard",
16860
+ echo: {
16861
+ status: "not_applicable"
16862
+ },
16863
+ headers: [],
16864
+ path: "/service_tier",
16865
+ status: "supported",
16866
+ values: {
16867
+ fast: "priority"
16868
+ }
16869
+ },
16870
+ status: "known",
16871
+ tokenParam: "max_output_tokens",
16872
+ toolsWithReasoning: "ok"
16873
+ }
16874
+ },
16875
+ {
16876
+ externalModelId: "gpt-6.1-terra",
16877
+ pricing: {
16878
+ cachedRead: 0.05,
16879
+ cachedWrite: 1.25,
16880
+ input: 1,
16881
+ output: 5,
16882
+ type: "flat"
16883
+ },
16884
+ reasoning: {
16885
+ mode: {
16886
+ default: "standard",
16887
+ status: "supported",
16888
+ values: [
16889
+ "standard",
16890
+ "pro"
16891
+ ]
16892
+ },
16893
+ request: {
16894
+ api: "responses",
16895
+ disable: [
16896
+ {
16897
+ path: "/reasoning/effort",
16898
+ value: "none"
16899
+ }
16900
+ ],
16901
+ effort: {
16902
+ default: "medium",
16903
+ path: "/reasoning/effort",
16904
+ values: {
16905
+ high: "high",
16906
+ low: "low",
16907
+ max: "max",
16908
+ medium: "medium",
16909
+ none: "none",
16910
+ xhigh: "xhigh"
16911
+ }
16912
+ },
16913
+ status: "supported"
16914
+ }
16915
+ },
16916
+ route: {
16917
+ routeId: "openai",
16918
+ routeProfileId: "direct-api"
16919
+ },
16920
+ routeStatus: "mapped",
16921
+ sourceProviderId: "openai",
16922
+ wire: {
16923
+ api: "responses",
16924
+ evidence: [],
16925
+ reasoning: {
16926
+ disable: [
16927
+ {
16928
+ path: "/reasoning/effort",
16929
+ value: "none"
16930
+ }
16931
+ ],
16932
+ effort: {
16933
+ default: "medium",
16934
+ path: "/reasoning/effort",
16935
+ values: {
16936
+ high: "high",
16937
+ low: "low",
16938
+ max: "max",
16939
+ medium: "medium",
16940
+ none: "none",
16941
+ xhigh: "xhigh"
16942
+ }
16943
+ },
16944
+ enable: {
16945
+ status: "not_applicable"
16946
+ },
16947
+ mode: {
16948
+ access: "open",
16949
+ default: "standard",
16950
+ echo: "/reasoning/mode",
16951
+ headers: [],
16952
+ path: "/reasoning/mode",
16953
+ status: "supported",
16954
+ values: {
16955
+ pro: "pro",
16956
+ standard: "standard"
16957
+ }
16958
+ },
16959
+ status: "supported"
16960
+ },
16961
+ speed: {
16962
+ status: "unknown"
16963
+ },
16964
+ status: "known",
16965
+ tokenParam: "max_output_tokens",
16966
+ toolsWithReasoning: "ok"
16967
+ }
16968
+ }
16969
+ ],
16970
+ aliases: [
16971
+ "openai/gpt-6.1-terra",
16972
+ "gpt-6-1-terra-high",
16973
+ "gpt-6-1-terra-low",
16974
+ "gpt-6-1-terra-max",
16975
+ "gpt-6-1-terra-medium",
16976
+ "gpt-6-1-terra-xhigh"
16977
+ ],
16978
+ contextWindow: 1050000,
16979
+ contractVersion: 3,
16980
+ displayName: "GPT-6.1 Terra",
16981
+ endpoints: {
16982
+ openai: {
16983
+ api: "responses",
16984
+ toolsWithReasoning: "ok"
16985
+ }
16986
+ },
16987
+ inputModalities: [
16988
+ "image",
16989
+ "text"
16990
+ ],
16991
+ maxOutputTokens: 128000,
16992
+ modelId: "gpt-6.1-terra",
16993
+ outputModalities: [
16994
+ "text"
16995
+ ],
16996
+ provider: "openai",
16997
+ reasoning: {
16998
+ control: "effort",
16999
+ defaultEffort: "medium",
17000
+ efforts: [
17001
+ "max",
17002
+ "xhigh",
17003
+ "high",
17004
+ "medium",
17005
+ "low",
17006
+ "none"
17007
+ ],
17008
+ mandatory: false,
17009
+ supported: true
17010
+ },
17011
+ releaseDate: "2026-10-26",
17012
+ status: "active",
17013
+ subscriptionPlanIds: [
17014
+ "cognition-devin",
17015
+ "llm-gateway-devpass",
17016
+ "openai-codex"
17017
+ ],
17018
+ supportsTools: true,
17019
+ supportsVision: true,
17020
+ tokenParam: "max_output_tokens",
17021
+ videoInput: false,
17022
+ videoOutput: false
17023
+ },
17024
+ {
17025
+ aggregators: [],
17026
+ aliases: [
17027
+ "openai/gpt-6.1-terra-pro"
17028
+ ],
17029
+ contextWindow: 1050000,
17030
+ contractVersion: 3,
17031
+ displayName: "GPT-6.1 Terra Pro",
17032
+ inputModalities: [
17033
+ "file",
17034
+ "image",
17035
+ "text"
17036
+ ],
17037
+ modelId: "gpt-6.1-terra-pro",
17038
+ outputModalities: [
17039
+ "text"
17040
+ ],
17041
+ provider: "openai",
17042
+ reasoning: {
17043
+ control: "effort",
17044
+ defaultEffort: "medium",
17045
+ efforts: [
17046
+ "max",
17047
+ "xhigh",
17048
+ "high",
17049
+ "medium",
17050
+ "low"
17051
+ ],
17052
+ mandatory: true,
17053
+ supported: true
17054
+ },
17055
+ releaseDate: "2026-10-26",
17056
+ routeVariant: {
17057
+ baseModelId: "gpt-6.1-terra",
17058
+ kind: "provider-preset",
17059
+ preset: "reasoning.mode=pro",
17060
+ provider: "openrouter"
17061
+ },
17062
+ status: "active",
17063
+ supportsTools: true,
17064
+ supportsVision: true,
17065
+ videoInput: false,
17066
+ videoOutput: false
17067
+ },
16734
17068
  {
16735
17069
  aggregators: [
16736
17070
  {
@@ -17915,7 +18249,7 @@ var init_bundled_recommended_list = __esm(() => {
17915
18249
  supportsVision: true
17916
18250
  }
17917
18251
  ],
17918
- lastUpdated: "2026-11-14T23:41:05.679Z",
18252
+ lastUpdated: "2026-11-15T11:48:52.784Z",
17919
18253
  models: [],
17920
18254
  plans: [
17921
18255
  {
@@ -18443,6 +18777,56 @@ var init_bundled_recommended_list = __esm(() => {
18443
18777
  },
18444
18778
  sourceText: "GPT-6.1 Sol XHigh Thinking"
18445
18779
  },
18780
+ {
18781
+ externalModelId: "gpt-6-1-terra-high",
18782
+ kind: "provider_model",
18783
+ provider: "cognition",
18784
+ resolution: {
18785
+ modelId: "gpt-6.1-terra",
18786
+ status: "mapped"
18787
+ },
18788
+ sourceText: "GPT-6.1 Terra High Thinking"
18789
+ },
18790
+ {
18791
+ externalModelId: "gpt-6-1-terra-low",
18792
+ kind: "provider_model",
18793
+ provider: "cognition",
18794
+ resolution: {
18795
+ modelId: "gpt-6.1-terra",
18796
+ status: "mapped"
18797
+ },
18798
+ sourceText: "GPT-6.1 Terra Low Thinking"
18799
+ },
18800
+ {
18801
+ externalModelId: "gpt-6-1-terra-max",
18802
+ kind: "provider_model",
18803
+ provider: "cognition",
18804
+ resolution: {
18805
+ modelId: "gpt-6.1-terra",
18806
+ status: "mapped"
18807
+ },
18808
+ sourceText: "GPT-6.1 Terra Max Thinking"
18809
+ },
18810
+ {
18811
+ externalModelId: "gpt-6-1-terra-medium",
18812
+ kind: "provider_model",
18813
+ provider: "cognition",
18814
+ resolution: {
18815
+ modelId: "gpt-6.1-terra",
18816
+ status: "mapped"
18817
+ },
18818
+ sourceText: "GPT-6.1 Terra Medium Thinking"
18819
+ },
18820
+ {
18821
+ externalModelId: "gpt-6-1-terra-xhigh",
18822
+ kind: "provider_model",
18823
+ provider: "cognition",
18824
+ resolution: {
18825
+ modelId: "gpt-6.1-terra",
18826
+ status: "mapped"
18827
+ },
18828
+ sourceText: "GPT-6.1 Terra XHigh Thinking"
18829
+ },
18446
18830
  {
18447
18831
  externalModelId: "gpt-6-astra-high",
18448
18832
  kind: "provider_model",
@@ -18831,6 +19215,16 @@ var init_bundled_recommended_list = __esm(() => {
18831
19215
  },
18832
19216
  sourceText: "gpt-6.1-sol"
18833
19217
  },
19218
+ {
19219
+ externalModelId: "gpt-6.1-terra",
19220
+ kind: "provider_model",
19221
+ provider: "llmgateway",
19222
+ resolution: {
19223
+ modelId: "gpt-6.1-terra",
19224
+ status: "mapped"
19225
+ },
19226
+ sourceText: "gpt-6.1-terra"
19227
+ },
18834
19228
  {
18835
19229
  externalModelId: "gpt-6-luna",
18836
19230
  kind: "provider_model",
@@ -19096,16 +19490,6 @@ var init_bundled_recommended_list = __esm(() => {
19096
19490
  contractVersion: 3,
19097
19491
  id: "ollama-cloud",
19098
19492
  inclusions: [
19099
- {
19100
- externalModelId: "glm-5.3",
19101
- kind: "provider_model",
19102
- provider: "ollamacloud",
19103
- resolution: {
19104
- modelId: "glm-5.3",
19105
- status: "mapped"
19106
- },
19107
- sourceText: "glm-5.3"
19108
- },
19109
19493
  {
19110
19494
  externalModelId: "mimo-v2.6-flash",
19111
19495
  kind: "provider_model",
@@ -19117,14 +19501,14 @@ var init_bundled_recommended_list = __esm(() => {
19117
19501
  sourceText: "mimo-v2.6-flash"
19118
19502
  },
19119
19503
  {
19120
- externalModelId: "mimo-v2.6-pro",
19504
+ externalModelId: "deepseek-v4.1-flash",
19121
19505
  kind: "provider_model",
19122
19506
  provider: "ollamacloud",
19123
19507
  resolution: {
19124
- modelId: "mimo-v2.6-pro",
19508
+ modelId: "deepseek-v4.1-flash",
19125
19509
  status: "mapped"
19126
19510
  },
19127
- sourceText: "mimo-v2.6-pro"
19511
+ sourceText: "deepseek-v4.1-flash"
19128
19512
  },
19129
19513
  {
19130
19514
  externalModelId: "kimi-k3.1-pro",
@@ -19157,14 +19541,24 @@ var init_bundled_recommended_list = __esm(() => {
19157
19541
  sourceText: "glm-5.3-flash"
19158
19542
  },
19159
19543
  {
19160
- externalModelId: "deepseek-v4.1-flash",
19544
+ externalModelId: "mimo-v2.6-pro",
19161
19545
  kind: "provider_model",
19162
19546
  provider: "ollamacloud",
19163
19547
  resolution: {
19164
- modelId: "deepseek-v4.1-flash",
19548
+ modelId: "mimo-v2.6-pro",
19165
19549
  status: "mapped"
19166
19550
  },
19167
- sourceText: "deepseek-v4.1-flash"
19551
+ sourceText: "mimo-v2.6-pro"
19552
+ },
19553
+ {
19554
+ externalModelId: "glm-5.3",
19555
+ kind: "provider_model",
19556
+ provider: "ollamacloud",
19557
+ resolution: {
19558
+ modelId: "glm-5.3",
19559
+ status: "mapped"
19560
+ },
19561
+ sourceText: "glm-5.3"
19168
19562
  }
19169
19563
  ],
19170
19564
  modelDiscovery: "catalog",
@@ -19208,6 +19602,16 @@ var init_bundled_recommended_list = __esm(() => {
19208
19602
  status: "mapped"
19209
19603
  },
19210
19604
  sourceText: "gpt-6.1-sol"
19605
+ },
19606
+ {
19607
+ externalModelId: "gpt-6.1-terra",
19608
+ kind: "provider_model",
19609
+ provider: "openai",
19610
+ resolution: {
19611
+ modelId: "gpt-6.1-terra",
19612
+ status: "mapped"
19613
+ },
19614
+ sourceText: "gpt-6.1-terra"
19211
19615
  }
19212
19616
  ],
19213
19617
  modelDiscovery: "hybrid",
@@ -19409,7 +19813,7 @@ var init_bundled_recommended_list = __esm(() => {
19409
19813
  }
19410
19814
  ],
19411
19815
  routeRegistry: {
19412
- generationId: "g-20261114234105679-14dde71a",
19816
+ generationId: "g-20261115114852784-7f4f3a66",
19413
19817
  registry: {
19414
19818
  contractVersion: 3,
19415
19819
  registryVersion: "3.7.0",
@@ -21803,6 +22207,11 @@ class BaseAPIFormat {
21803
22207
  getMaxToolCount() {
21804
22208
  return null;
21805
22209
  }
22210
+ declaredToolNames(names) {
22211
+ const limit = this.getToolNameLimit();
22212
+ const bindings = newToolNameBindings();
22213
+ return new Map(names.map((name) => [name, limit ? encodeToolName(name, limit, bindings) : name]));
22214
+ }
21806
22215
  getToolNameMap() {
21807
22216
  return this.toolNameBindings.byEncoded;
21808
22217
  }
@@ -23086,6 +23495,9 @@ var init_gemini_api_format = __esm(() => {
23086
23495
  }
23087
23496
  return parts;
23088
23497
  }
23498
+ declaredToolNames(names) {
23499
+ return new Map(names.map((name) => [name, sanitizeToolNameForGemini(name)]));
23500
+ }
23089
23501
  convertTools(claudeRequest, _summarize = false) {
23090
23502
  const result = convertToolsToGemini(claudeRequest.tools);
23091
23503
  return result || [];
@@ -23119,33 +23531,29 @@ CRITICAL INSTRUCTION FOR OUTPUT FORMAT:
23119
23531
  }
23120
23532
  }
23121
23533
  if (this.thinkingFromModelName) {
23122
- const effort = this.resolveEffortLevel(claudeRequest);
23123
- if (effort) {
23124
- if (matchesModelFamily(this.modelId, "gemini-3")) {
23534
+ if (!this.pinnedEffort && claudeRequest?.thinking?.type === "disabled") {
23535
+ log(`[GeminiAPIFormat] thinking omitted (disabled) for ${this.modelId}`);
23536
+ } else {
23537
+ const effort = this.resolveEffortLevel(claudeRequest);
23538
+ if (effort && matchesModelFamily(this.modelId, "gemini-3")) {
23125
23539
  payload.generationConfig.thinkingConfig = {
23126
23540
  thinkingLevel: this.effortToThinkingLevel(effort)
23127
23541
  };
23128
23542
  log(`[GeminiAPIFormat] thinkingLevel -> ${payload.generationConfig.thinkingConfig.thinkingLevel} (from ${effort}) for ${this.modelId}`);
23129
- } else {
23130
- const budget = this.budgetWithinOutputCap(this.effortToThinkingBudget(effort), claudeRequest.max_tokens);
23131
- if (budget === undefined) {
23132
- log(`[GeminiAPIFormat] thinking omitted (from ${effort}): max_tokens ${claudeRequest.max_tokens} leaves no valid budget for ${this.modelId}`);
23543
+ } else if (effort) {
23544
+ const tier = this.effortToThinkingBudget(effort);
23545
+ if (tier === undefined) {
23546
+ log(`[GeminiAPIFormat] thinking omitted (from ${effort}) for ${this.modelId}`);
23133
23547
  } else {
23134
- payload.generationConfig.thinkingConfig = { thinkingBudget: budget };
23135
- log(`[GeminiAPIFormat] thinkingBudget -> ${budget} (from ${effort}) for ${this.modelId}`);
23548
+ const budget = this.budgetWithinOutputCap(tier, claudeRequest.max_tokens);
23549
+ if (budget === undefined) {
23550
+ log(`[GeminiAPIFormat] thinking omitted (from ${effort}): max_tokens ${claudeRequest.max_tokens} leaves no valid budget for ${this.modelId}`);
23551
+ } else {
23552
+ payload.generationConfig.thinkingConfig = { thinkingBudget: budget };
23553
+ log(`[GeminiAPIFormat] thinkingBudget -> ${budget} (from ${effort}) for ${this.modelId}`);
23554
+ }
23136
23555
  }
23137
23556
  }
23138
- } else if (claudeRequest.thinking) {
23139
- const { budget_tokens } = claudeRequest.thinking;
23140
- if (matchesModelFamily(this.modelId, "gemini-3")) {
23141
- payload.generationConfig.thinkingConfig = {
23142
- thinkingLevel: budget_tokens >= 16000 ? "high" : "low"
23143
- };
23144
- } else {
23145
- payload.generationConfig.thinkingConfig = {
23146
- thinkingBudget: Math.min(budget_tokens, GeminiAPIFormat.MAX_GEMINI_BUDGET)
23147
- };
23148
- }
23149
23557
  }
23150
23558
  }
23151
23559
  return payload;
@@ -23181,7 +23589,7 @@ CRITICAL INSTRUCTION FOR OUTPUT FORMAT:
23181
23589
  switch (effort) {
23182
23590
  case "none":
23183
23591
  case "minimal":
23184
- return 0;
23592
+ return;
23185
23593
  case "low":
23186
23594
  return 1024;
23187
23595
  case "medium":
@@ -23567,6 +23975,9 @@ var init_ollama_api_format = __esm(() => {
23567
23975
  }
23568
23976
  return messages;
23569
23977
  }
23978
+ declaredToolNames(names) {
23979
+ return new Map(names.map((name) => [name, null]));
23980
+ }
23570
23981
  convertTools(_claudeRequest, _summarize) {
23571
23982
  return [];
23572
23983
  }
@@ -62910,6 +63321,145 @@ function inlineSystemAsUserText(messages) {
62910
63321
  }
62911
63322
  var REMINDER_OPEN = "<system-reminder>", textBlock2 = (text) => ({ type: "text", text });
62912
63323
 
63324
+ // src/handlers/shared/format/provider-refused-text.ts
63325
+ function skipBlankLines(text, from) {
63326
+ let lineStart = from;
63327
+ for (;; ) {
63328
+ let i = lineStart;
63329
+ while (isBlank(text[i]))
63330
+ i++;
63331
+ if (text[i] !== `
63332
+ `)
63333
+ return lineStart;
63334
+ lineStart = i + 1;
63335
+ }
63336
+ }
63337
+ function afterParagraph(text, from) {
63338
+ let nl = text.indexOf(`
63339
+ `, from);
63340
+ while (nl !== -1) {
63341
+ const next = skipBlankLines(text, nl + 1);
63342
+ if (next > nl + 1)
63343
+ return next;
63344
+ nl = text.indexOf(`
63345
+ `, nl + 1);
63346
+ }
63347
+ return -1;
63348
+ }
63349
+ function removeParagraphs(text, opening) {
63350
+ let out = "";
63351
+ let from = 0;
63352
+ let cutAtEnd = false;
63353
+ let at = text.indexOf(opening);
63354
+ while (at !== -1) {
63355
+ if (at > 0 && text[at - 1] !== `
63356
+ `) {
63357
+ at = text.indexOf(opening, at + opening.length);
63358
+ continue;
63359
+ }
63360
+ const next = afterParagraph(text, at);
63361
+ const end = next === -1 ? text.length : next;
63362
+ if (next === -1)
63363
+ cutAtEnd = true;
63364
+ out += text.slice(from, at);
63365
+ from = end;
63366
+ at = text.indexOf(opening, end);
63367
+ }
63368
+ if (from === 0)
63369
+ return text;
63370
+ out += text.slice(from);
63371
+ if (!cutAtEnd)
63372
+ return out;
63373
+ let last = out.length;
63374
+ while (last > 0 && isLineEnd(out[last - 1]))
63375
+ last--;
63376
+ return out.slice(0, last);
63377
+ }
63378
+ function startsListLine(text, lineStart, at) {
63379
+ let i = lineStart;
63380
+ while (text[i] === " " || text[i] === "\t")
63381
+ i++;
63382
+ if (i === at)
63383
+ return true;
63384
+ return text[i] === "-" && text[i + 1] === " " && i + 2 === at;
63385
+ }
63386
+ function removeLines(text, opening) {
63387
+ let out = "";
63388
+ let from = 0;
63389
+ let cutAtEnd = false;
63390
+ let at = text.indexOf(opening);
63391
+ while (at !== -1) {
63392
+ const lineStart = text.lastIndexOf(`
63393
+ `, at - 1) + 1;
63394
+ const nl = text.indexOf(`
63395
+ `, at);
63396
+ if (!startsListLine(text, lineStart, at)) {
63397
+ at = nl === -1 ? -1 : text.indexOf(opening, nl + 1);
63398
+ continue;
63399
+ }
63400
+ out += text.slice(from, lineStart);
63401
+ from = nl === -1 ? text.length : nl + 1;
63402
+ cutAtEnd = nl === -1;
63403
+ at = text.indexOf(opening, from);
63404
+ }
63405
+ if (from === 0)
63406
+ return text;
63407
+ out += text.slice(from);
63408
+ if (!cutAtEnd)
63409
+ return out;
63410
+ let last = out.length;
63411
+ if (out[last - 1] === `
63412
+ `)
63413
+ last--;
63414
+ if (out[last - 1] === "\r")
63415
+ last--;
63416
+ return out.slice(0, last);
63417
+ }
63418
+ function clean(text, refused) {
63419
+ return refused.reduce((current, { opening, unit }) => unit === "line" ? removeLines(current, opening) : removeParagraphs(current, opening), text);
63420
+ }
63421
+ function removeProviderRefusedText(req, providerName) {
63422
+ const openings = REFUSED_TEXT[providerName];
63423
+ if (!openings)
63424
+ return req;
63425
+ const system = req.system;
63426
+ if (typeof system === "string") {
63427
+ const text = clean(system, openings);
63428
+ return text === system ? req : { ...req, system: text };
63429
+ }
63430
+ if (!Array.isArray(system))
63431
+ return req;
63432
+ let changed = false;
63433
+ const blocks = [];
63434
+ for (const block of system) {
63435
+ const text = typeof block === "string" ? block : block?.type === "text" ? block.text : null;
63436
+ if (typeof text !== "string") {
63437
+ blocks.push(block);
63438
+ continue;
63439
+ }
63440
+ const cleaned = clean(text, openings);
63441
+ if (cleaned === text) {
63442
+ blocks.push(block);
63443
+ continue;
63444
+ }
63445
+ changed = true;
63446
+ if (cleaned.trim() === "")
63447
+ continue;
63448
+ blocks.push(typeof block === "string" ? cleaned : { ...block, text: cleaned });
63449
+ }
63450
+ return changed ? { ...req, system: blocks } : req;
63451
+ }
63452
+ var REFUSED_TEXT, isLineEnd = (ch) => ch === `
63453
+ ` || ch === "\r", isBlank = (ch) => ch === " " || ch === "\t" || ch === "\r";
63454
+ var init_provider_refused_text = __esm(() => {
63455
+ REFUSED_TEXT = {
63456
+ antigravity: [
63457
+ { opening: "IMPORTANT: Assist with authorized security testing", unit: "paragraph" },
63458
+ { opening: "Text inside <pasted_content> tags", unit: "line" }
63459
+ ]
63460
+ };
63461
+ });
63462
+
62913
63463
  // src/handlers/shared/format/tool-name-alias.ts
62914
63464
  function renameToolUses(content, forward) {
62915
63465
  if (!Array.isArray(content))
@@ -62950,8 +63500,14 @@ var AGY_TOOL_ALIAS, PROVIDER_ALIASES, identity = (name) => name;
62950
63500
  var init_tool_name_alias = __esm(() => {
62951
63501
  AGY_TOOL_ALIAS = [
62952
63502
  ["Bash", "run_command"],
62953
- ["Write", "write_to_file"],
63503
+ ["Read", "read_file"],
63504
+ ["Write", "write_file"],
62954
63505
  ["Edit", "edit_file"],
63506
+ ["Agent", "invoke_subagent"],
63507
+ ["AskUserQuestion", "ask_question"],
63508
+ ["WebSearch", "search_web"],
63509
+ ["SendMessage", "send_message"],
63510
+ ["Workflow", "run_workflow"],
62955
63511
  ["Grep", "grep_search"],
62956
63512
  ["Glob", "find_by_name"],
62957
63513
  ["LS", "list_dir"]
@@ -62961,6 +63517,53 @@ var init_tool_name_alias = __esm(() => {
62961
63517
  };
62962
63518
  });
62963
63519
 
63520
+ // src/handlers/shared/format/tool-reference-text.ts
63521
+ function itemsAsText(items, wording) {
63522
+ if (!items.some(isReference))
63523
+ return items;
63524
+ const out = [];
63525
+ for (const item of items) {
63526
+ if (!isReference(item)) {
63527
+ out.push(item);
63528
+ continue;
63529
+ }
63530
+ if (typeof item.tool_name !== "string" || item.tool_name === "")
63531
+ continue;
63532
+ const name = wording.nameOf(item.tool_name);
63533
+ const text = wording.isDeclared(item.tool_name) ? loadedText(name) : notLoadedText(name);
63534
+ out.push({ type: "text", text });
63535
+ }
63536
+ return out;
63537
+ }
63538
+ function blocksAsText(blocks, wording) {
63539
+ let changed = false;
63540
+ const out = blocks.map((block) => {
63541
+ if (block?.type !== "tool_result" || !Array.isArray(block.content))
63542
+ return block;
63543
+ const content = itemsAsText(block.content, wording);
63544
+ if (content === block.content)
63545
+ return block;
63546
+ changed = true;
63547
+ return { ...block, content };
63548
+ });
63549
+ return changed ? out : blocks;
63550
+ }
63551
+ function toolReferencesAsText(messages, wording = {}) {
63552
+ const full = { nameOf: wording.nameOf ?? identity2, isDeclared: wording.isDeclared ?? always };
63553
+ let changed = false;
63554
+ const out = messages.map((message) => {
63555
+ if (message?.role !== "user" || !Array.isArray(message.content))
63556
+ return message;
63557
+ const content = blocksAsText(message.content, full);
63558
+ if (content === message.content)
63559
+ return message;
63560
+ changed = true;
63561
+ return { ...message, content };
63562
+ });
63563
+ return changed ? out : messages;
63564
+ }
63565
+ var identity2 = (name) => name, always = () => true, loadedText = (name) => `Loaded: ${name}. It is in your tool list now.`, notLoadedText = (name) => `Not loaded: ${name}. It is not in your tool list.`, isReference = (item) => item?.type === "tool_reference";
63566
+
62964
63567
  // src/handlers/shared/responses-leg-issuer.ts
62965
63568
  function isSameCredentialSilo(turn, next) {
62966
63569
  return (turn.auth?.arm ?? undefined) === (next.auth?.arm ?? undefined) && turn.accountKey === next.accountKey;
@@ -67982,12 +68585,25 @@ class ComposedHandler {
67982
68585
  if (!keepIdentity) {
67983
68586
  claudeRequest = scrubHarnessIdentity(claudeRequest, identityHeadFor(this.provider.name));
67984
68587
  }
68588
+ claudeRequest = removeProviderRefusedText(claudeRequest, this.provider.name);
67985
68589
  const toolAlias = aliasToolsForProvider(claudeRequest, this.provider.name);
67986
68590
  claudeRequest = toolAlias.request;
67987
68591
  const withInlineSystem = inlineSystemAsUserText(claudeRequest.messages);
67988
68592
  if (withInlineSystem !== claudeRequest.messages) {
67989
68593
  claudeRequest = { ...claudeRequest, messages: withInlineSystem };
67990
68594
  }
68595
+ let declaredNames;
68596
+ const sentName = (name) => {
68597
+ declaredNames ??= adapter.declaredToolNames((claudeRequest.tools ?? []).slice(0, adapter.getMaxToolCount() ?? undefined).map((tool) => tool?.name).filter((toolName) => typeof toolName === "string"));
68598
+ return declaredNames.get(toolAlias.forward(name)) ?? null;
68599
+ };
68600
+ const withToolReferences = toolReferencesAsText(claudeRequest.messages, {
68601
+ nameOf: (name) => sentName(name) ?? toolAlias.forward(name),
68602
+ isDeclared: (name) => sentName(name) !== null
68603
+ });
68604
+ if (withToolReferences !== claudeRequest.messages) {
68605
+ claudeRequest = { ...claudeRequest, messages: withToolReferences };
68606
+ }
67991
68607
  let messages = adapter.convertMessages(claudeRequest, undefined);
67992
68608
  let tools = adapter.convertTools(claudeRequest, this.options.summarizeTools);
67993
68609
  const maxToolCount = adapter.getMaxToolCount();
@@ -69646,6 +70262,7 @@ var init_composed_handler = __esm(() => {
69646
70262
  init_connection_error();
69647
70263
  init_devin_stream_head_sniffer();
69648
70264
  init_identity_filter();
70265
+ init_provider_refused_text();
69649
70266
  init_tool_name_alias();
69650
70267
  init_model_unsupported();
69651
70268
  init_quota_exhaustion();
@@ -109932,7 +110549,7 @@ async function readMagmuxVersion(found) {
109932
110549
  const out = await runMagmuxVersion(found, MAGMUX_VERSION_TIMEOUT_MS);
109933
110550
  return out.match(VERSION_PATTERN)?.[1] ?? "";
109934
110551
  }
109935
- function runMagmuxVersion(found, timeoutMs) {
110552
+ function runMagmuxVersion(found, timeoutMs, drainMs = EXIT_DRAIN_MS) {
109936
110553
  return new Promise((resolveRun, rejectRun) => {
109937
110554
  let settled = false;
109938
110555
  let child;
@@ -109940,8 +110557,11 @@ function runMagmuxVersion(found, timeoutMs) {
109940
110557
  const timer = setTimeout(() => {
109941
110558
  const ranAt = Math.round(performance.now() - startedAt);
109942
110559
  const code = child?.exitCode ?? child?.signalCode ?? null;
109943
- const childState = code === null ? "still running" : `already exited (${code})`;
109944
- fail(`no answer in ${timeoutMs} ms (timer ran at ${ranAt} ms; child ${childState})`);
110560
+ if (code !== null) {
110561
+ setTimeout(() => fail(`exited (${code}) but no exit event within ${drainMs + EXIT_DRAIN_MS} ms`), drainMs + EXIT_DRAIN_MS);
110562
+ return;
110563
+ }
110564
+ fail(`no answer in ${timeoutMs} ms (timer ran at ${ranAt} ms; child still running)`);
109945
110565
  try {
109946
110566
  child?.kill("SIGKILL");
109947
110567
  } catch {}
@@ -109983,7 +110603,7 @@ function runMagmuxVersion(found, timeoutMs) {
109983
110603
  if (code === 0 || VERSION_PATTERN.test(out))
109984
110604
  return done();
109985
110605
  fail(`exited with ${code ?? signal}${out.trim() ? `: ${out.trim()}` : ""}`);
109986
- }, EXIT_DRAIN_MS);
110606
+ }, drainMs);
109987
110607
  });
109988
110608
  } catch (e) {
109989
110609
  fail(e instanceof Error ? e.message : String(e));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudish",
3
- "version": "14.25.0",
3
+ "version": "14.26.0",
4
4
  "description": "Run Claude Code with any model - OpenRouter, Ollama, LM Studio & local models",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -74,10 +74,10 @@
74
74
  "ai"
75
75
  ],
76
76
  "optionalDependencies": {
77
- "@claudish/magmux-darwin-arm64": "14.25.0",
78
- "@claudish/magmux-darwin-x64": "14.25.0",
79
- "@claudish/magmux-linux-arm64": "14.25.0",
80
- "@claudish/magmux-linux-x64": "14.25.0"
77
+ "@claudish/magmux-darwin-arm64": "14.26.0",
78
+ "@claudish/magmux-darwin-x64": "14.26.0",
79
+ "@claudish/magmux-linux-arm64": "14.26.0",
80
+ "@claudish/magmux-linux-x64": "14.26.0"
81
81
  },
82
82
  "author": "Jack Rudenko <i@madappgang.com>",
83
83
  "license": "MIT",