theclawbay 0.3.14 → 0.3.16

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.
@@ -626,11 +626,10 @@ async function writeKiloConfig(params) {
626
626
  return configPath;
627
627
  }
628
628
  function traePatchSnippet(params) {
629
- const patchedModels = params.models.length
630
- ? params.models
631
- : [{ id: params.model.trim() || DEFAULT_TRAE_MODEL, name: modelDisplayName(params.model.trim() || DEFAULT_TRAE_MODEL) }];
629
+ const modelId = params.model.trim() || DEFAULT_TRAE_MODEL;
630
+ const displayName = `TheClawBay ${modelDisplayName(modelId)}`;
632
631
  const proxyBaseUrl = `${trimTrailingSlash(params.backendUrl)}/api/codex-auth/v1/proxy/v1`;
633
- return `async setOriginModelListMapAndCache(e,t=!0){let{userProfile:r}=this.credentialStore.getState(),i=r?.scope!==v9.BYTEDANCE,n={},o=${JSON.stringify(patchedModels)};Object.keys(e).forEach(t=>{let r=[...(e[t]||[])],s=r[0]&&"object"==typeof r[0]?r[0]:null;if([Mh.Builder,Mh.SoloCoder].includes(t)&&s){let a=o.map((e,l)=>{let o={...s};return o.name=e.id,o.display_name="TheClawBay "+e.name,o.provider="openrouter",o.icon={dark:"https://theclawbay.com/favicon.ico",light:"https://theclawbay.com/favicon.ico"},o.ak=${JSON.stringify(params.apiKey)},o.base_url=${JSON.stringify(proxyBaseUrl)},o.is_custom_base_url=!0,o.custom_model_id=${JSON.stringify(TRAE_PATCH_MARKER)}+"-"+e.id,o.selectable=!0,o.status=!0,o.is_default=0===l,o.config_source=3,o.model_type=s.model_type??"chat_model",o.client_connect=!0,o.multimodal=!1!==s.multimodal,o.tags=Array.isArray(s.tags)?s.tags:[],o.auth_type="number"==typeof s.auth_type?s.auth_type:0,o.region=s.region??null,o.max_turns=s.max_turns??{default:50,max:50},o.context_window_size=s.context_window_size??{max:[128000],default:64000},o.features=s.features??{memory:{enable:!1},cost:{enable:!1,data:{manual_usage:0}},multimodal:{enable:!0},context_windows:{enable:!0,data:{dev_context:64000,max_context:128000,max_context_list:[128000],dev_turns:50,max_turns:50}}},o.commercial_info=s.commercial_info??{manual_usage:0,info:""},o.saas_usage=s.saas_usage??{max:0,default:null},o});n[t]=a;return}!i&&[Mh.SoloCoder,Mh.UIBuilder].includes(t)?n[t]=r?.filter(e=>e.config_source!==MK.Personal)||[]:n[t]=r}),this._modelStore.actions.setOriginModelListMap(n),t&&this._modelStorageService.storeModelListMap(n),this._logService.info("[ModelService.setOriginModelListMapAndCache] officialModels",Object.entries(n).map(([e,t])=>({scene:e,models:(t||[]).map(e=>e.display_name||e.name)})))}`;
632
+ return `async setOriginModelListMapAndCache(e,t=!0){let{userProfile:r}=this.credentialStore.getState(),i=r?.scope!==v9.BYTEDANCE,n={},o={name:${JSON.stringify(modelId)},display_name:${JSON.stringify(displayName)},multimodal:!0,is_default:!1,custom_config:'{"apply_file_path":true,"enable_invalid_json_hint":true,"is_new_pe":true,"native_function_call":true,"use_v2_process":true}',prompt_max_tokens:64000,context_window_size:{max:[128000],default:64000},is_new:!1,is_beta:null,core_memory_enable_type:"Enable",model_type:"chat_model",builder:null,is_preset:!1,client_connect:!0,provider:"openrouter",icon:{dark:"https://theclawbay.com/favicon.ico",light:"https://theclawbay.com/favicon.ico"},ak:${JSON.stringify(params.apiKey)},base_url:${JSON.stringify(proxyBaseUrl)},is_custom_base_url:!0,status:!0,custom_model_id:${JSON.stringify(TRAE_PATCH_MARKER)},fee_model_level:1,max_mode:!1,is_dollar_max:!1,is_max_default:!1,config_source:MK.Personal,selectable:!0,commercial_info:{manual_usage:0,info:""},max_turns:{default:50,max:50},tags:[],sk:null,auth_type:0,region:null,saas_usage:{max:0,default:null},features:{memory:{enable:!1},cost:{enable:!1,data:{manual_usage:0}},multimodal:{enable:!0},context_windows:{enable:!0,data:{dev_context:64000,max_context:128000,max_context_list:[128000],dev_turns:50,max_turns:50}}}};Object.keys(e).forEach(t=>{let r=[...(e[t]||[])];[Mh.Builder,Mh.SoloCoder].includes(t)&&!M2(r,M1(o))&&r.push(o),!i&&[Mh.SoloCoder,Mh.UIBuilder].includes(t)?n[t]=r?.filter(e=>e.config_source!==MK.Personal)||[]:n[t]=r}),this._modelStore.actions.setOriginModelListMap(n),t&&this._modelStorageService.storeModelListMap(n),this._logService.info("[ModelService.setOriginModelListMapAndCache] personalModels",Object.values(n).flat().filter(e=>e&&e.config_source===MK.Personal).map(e=>e.display_name||e.name))}`;
634
633
  }
635
634
  async function patchTraeBundle(params) {
636
635
  const bundlePath = traeBundlePath();
@@ -865,8 +864,8 @@ class SetupCommand extends base_command_1.BaseCommand {
865
864
  const traeDetected = optionalClients.find((client) => client.id === "trae")?.detected ?? false;
866
865
  if (selectedOptionalClients.has("trae")) {
867
866
  this.log(`- Trae: experimental bundle patch installed (${traeBundlePathPatched})`);
868
- this.log(`- Trae: replaced Builder and SoloCoder model lists with ${resolved.models.length} TheClawBay models.`);
869
- this.log(`- Trae: restart Trae and select a TheClawBay model inside Trae to test it.`);
867
+ this.log(`- Trae: added a TheClawBay custom model to the Trae picker.`);
868
+ this.log(`- Trae: restart Trae and select the TheClawBay model inside Trae to test it.`);
870
869
  }
871
870
  else if (traeDetected) {
872
871
  this.log("- Trae: detected but skipped");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "theclawbay",
3
- "version": "0.3.14",
3
+ "version": "0.3.16",
4
4
  "description": "CLI for connecting Codex, OpenClaw, OpenCode, Kilo, and experimental Trae to The Claw Bay.",
5
5
  "license": "MIT",
6
6
  "bin": {