swixter 0.0.7 → 0.0.8

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/cli/index.js +80 -1
  2. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -13234,7 +13234,7 @@ var CONFIG_VERSION = "2.0.0", EXPORT_VERSION = "1.0.0";
13234
13234
  var init_versions2 = () => {};
13235
13235
 
13236
13236
  // src/constants/meta.ts
13237
- var APP_VERSION = "0.0.7";
13237
+ var APP_VERSION = "0.0.8";
13238
13238
  var init_meta = () => {};
13239
13239
 
13240
13240
  // src/constants/install.ts
@@ -21318,6 +21318,58 @@ async function cmdEdit(profileName) {
21318
21318
  xe(ERRORS.cancelled);
21319
21319
  return;
21320
21320
  }
21321
+ let models = undefined;
21322
+ let editedModels = false;
21323
+ const currentModelsInfo = profile.models ? `Current: ${Object.entries(profile.models).filter(([, v2]) => v2).map(([k3, v2]) => `${k3}=${v2}`).join(", ")}` : "No models configured";
21324
+ const configureModels = await ye({
21325
+ message: `Edit model settings? (${currentModelsInfo})`,
21326
+ initialValue: false
21327
+ });
21328
+ if (pD(configureModels)) {
21329
+ xe(ERRORS.cancelled);
21330
+ return;
21331
+ }
21332
+ if (configureModels) {
21333
+ editedModels = true;
21334
+ const anthropicModel = await he({
21335
+ message: PROMPTS.anthropicModel,
21336
+ placeholder: profile.models?.anthropicModel || "claude-3-5-sonnet-20241022"
21337
+ });
21338
+ if (pD(anthropicModel)) {
21339
+ xe(ERRORS.cancelled);
21340
+ return;
21341
+ }
21342
+ const defaultHaikuModel = await he({
21343
+ message: PROMPTS.defaultHaikuModel,
21344
+ placeholder: profile.models?.defaultHaikuModel || "claude-3-5-haiku-20241022"
21345
+ });
21346
+ if (pD(defaultHaikuModel)) {
21347
+ xe(ERRORS.cancelled);
21348
+ return;
21349
+ }
21350
+ const defaultOpusModel = await he({
21351
+ message: PROMPTS.defaultOpusModel,
21352
+ placeholder: profile.models?.defaultOpusModel || "claude-3-opus-20240229"
21353
+ });
21354
+ if (pD(defaultOpusModel)) {
21355
+ xe(ERRORS.cancelled);
21356
+ return;
21357
+ }
21358
+ const defaultSonnetModel = await he({
21359
+ message: PROMPTS.defaultSonnetModel,
21360
+ placeholder: profile.models?.defaultSonnetModel || "claude-3-5-sonnet-20241022"
21361
+ });
21362
+ if (pD(defaultSonnetModel)) {
21363
+ xe(ERRORS.cancelled);
21364
+ return;
21365
+ }
21366
+ models = {
21367
+ ...anthropicModel && { anthropicModel },
21368
+ ...defaultHaikuModel && { defaultHaikuModel },
21369
+ ...defaultOpusModel && { defaultOpusModel },
21370
+ ...defaultSonnetModel && { defaultSonnetModel }
21371
+ };
21372
+ }
21321
21373
  const shouldApply = await ye({
21322
21374
  message: "Apply this profile to Claude Code now?",
21323
21375
  initialValue: false
@@ -21348,6 +21400,13 @@ async function cmdEdit(profileName) {
21348
21400
  updatedProfile.baseURL = profile.baseURL;
21349
21401
  }
21350
21402
  }
21403
+ if (editedModels) {
21404
+ if (models && Object.keys(models).length > 0) {
21405
+ updatedProfile.models = models;
21406
+ }
21407
+ } else if (profile.models) {
21408
+ updatedProfile.models = profile.models;
21409
+ }
21351
21410
  const finalBaseURL = updatedProfile.baseURL || newPreset?.baseURL || "";
21352
21411
  await upsertProfile(updatedProfile, CODER_NAME);
21353
21412
  spinner.stop("Profile updated successfully!");
@@ -22060,6 +22119,15 @@ async function cmdEdit2(profileName) {
22060
22119
  xe(ERRORS.cancelled);
22061
22120
  return;
22062
22121
  }
22122
+ const currentModel = profile.model || profile.openaiModel || "";
22123
+ const newModelName = await he({
22124
+ message: `Model name (leave empty to keep current${currentModel ? `: ${currentModel}` : ""}, enter 'clear' to remove)`,
22125
+ placeholder: currentModel || "e.g., gpt-4"
22126
+ });
22127
+ if (pD(newModelName)) {
22128
+ xe(ERRORS.cancelled);
22129
+ return;
22130
+ }
22063
22131
  const shouldApply = await ye({
22064
22132
  message: "Apply this profile to Continue now?",
22065
22133
  initialValue: false
@@ -22085,13 +22153,24 @@ async function cmdEdit2(profileName) {
22085
22153
  updatedProfile.baseURL = profile.baseURL;
22086
22154
  }
22087
22155
  }
22156
+ if (newModelName && newModelName === "clear") {} else if (newModelName) {
22157
+ updatedProfile.model = newModelName;
22158
+ updatedProfile.openaiModel = newModelName;
22159
+ } else {
22160
+ if (profile.model)
22161
+ updatedProfile.model = profile.model;
22162
+ if (profile.openaiModel)
22163
+ updatedProfile.openaiModel = profile.openaiModel;
22164
+ }
22088
22165
  const finalBaseURL = updatedProfile.baseURL || newPreset?.baseURL || "";
22166
+ const finalModel = updatedProfile.model || updatedProfile.openaiModel || "";
22089
22167
  await upsertProfile(updatedProfile, CODER_NAME2);
22090
22168
  spinner.stop("Profile updated successfully!");
22091
22169
  console.log();
22092
22170
  console.log(` Profile name: ${import_picocolors9.default.cyan(updatedProfile.name)}`);
22093
22171
  console.log(` Provider: ${import_picocolors9.default.yellow(newPreset?.displayName)}`);
22094
22172
  console.log(` Base URL: ${import_picocolors9.default.yellow(finalBaseURL || "Default")}`);
22173
+ console.log(` Model: ${import_picocolors9.default.yellow(finalModel || "None")}`);
22095
22174
  console.log();
22096
22175
  if (shouldApply) {
22097
22176
  await setActiveProfileForCoder(CODER_NAME2, profileName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swixter",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "CLI tool for managing AI coding assistant configurations - easily switch between providers (Claude Code, Codex, Continue) with Anthropic, Ollama, or custom APIs",
5
5
  "main": "dist/cli/index.js",
6
6
  "module": "dist/cli/index.js",