osagent 0.1.26 → 0.1.28

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.js +325 -112
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -53251,14 +53251,14 @@ var init_node = __esm({
53251
53251
  Mode2["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
53252
53252
  Mode2["MODE_DYNAMIC"] = "MODE_DYNAMIC";
53253
53253
  })(Mode || (Mode = {}));
53254
- (function(AuthType3) {
53255
- AuthType3["AUTH_TYPE_UNSPECIFIED"] = "AUTH_TYPE_UNSPECIFIED";
53256
- AuthType3["NO_AUTH"] = "NO_AUTH";
53257
- AuthType3["API_KEY_AUTH"] = "API_KEY_AUTH";
53258
- AuthType3["HTTP_BASIC_AUTH"] = "HTTP_BASIC_AUTH";
53259
- AuthType3["GOOGLE_SERVICE_ACCOUNT_AUTH"] = "GOOGLE_SERVICE_ACCOUNT_AUTH";
53260
- AuthType3["OAUTH"] = "OAUTH";
53261
- AuthType3["OIDC_AUTH"] = "OIDC_AUTH";
53254
+ (function(AuthType4) {
53255
+ AuthType4["AUTH_TYPE_UNSPECIFIED"] = "AUTH_TYPE_UNSPECIFIED";
53256
+ AuthType4["NO_AUTH"] = "NO_AUTH";
53257
+ AuthType4["API_KEY_AUTH"] = "API_KEY_AUTH";
53258
+ AuthType4["HTTP_BASIC_AUTH"] = "HTTP_BASIC_AUTH";
53259
+ AuthType4["GOOGLE_SERVICE_ACCOUNT_AUTH"] = "GOOGLE_SERVICE_ACCOUNT_AUTH";
53260
+ AuthType4["OAUTH"] = "OAUTH";
53261
+ AuthType4["OIDC_AUTH"] = "OIDC_AUTH";
53262
53262
  })(AuthType || (AuthType = {}));
53263
53263
  (function(ApiSpec2) {
53264
53264
  ApiSpec2["API_SPEC_UNSPECIFIED"] = "API_SPEC_UNSPECIFIED";
@@ -146147,27 +146147,31 @@ function createContentGeneratorConfig(config, authType, generationConfig) {
146147
146147
  return {
146148
146148
  ...newContentGeneratorConfig,
146149
146149
  model: newContentGeneratorConfig?.model || DEFAULT_OLLAMA_CODER_MODEL,
146150
- baseUrl: newContentGeneratorConfig?.baseUrl || "https://api.ollama.com",
146151
- // API key from OLLAMA_API_KEY env var or settings
146152
- apiKey: newContentGeneratorConfig?.apiKey || process.env["OLLAMA_API_KEY"]
146150
+ // Force Ollama Cloud endpoint explicitly
146151
+ baseUrl: "https://api.ollama.com",
146152
+ apiKey: process.env["OLLAMA_API_KEY"]
146153
146153
  };
146154
146154
  }
146155
146155
  if (authType === AuthType2.OLLAMA_LOCAL) {
146156
146156
  return {
146157
146157
  ...newContentGeneratorConfig,
146158
146158
  model: newContentGeneratorConfig?.model || DEFAULT_OLLAMA_CODER_MODEL,
146159
- baseUrl: newContentGeneratorConfig?.baseUrl || "http://localhost:11434/v1",
146159
+ // Force localhost endpoint explicitly
146160
+ baseUrl: "http://localhost:11434/v1",
146160
146161
  // Local Ollama doesn't require API key
146161
- apiKey: newContentGeneratorConfig?.apiKey || "ollama"
146162
+ apiKey: "ollama"
146162
146163
  };
146163
146164
  }
146164
146165
  if (authType === AuthType2.USE_GROQ) {
146166
+ const groqApiKey = process.env["GROQ_API_KEY"];
146165
146167
  return {
146166
146168
  ...newContentGeneratorConfig,
146167
146169
  model: newContentGeneratorConfig?.model || "moonshotai/kimi-k2-instruct-0905",
146168
- baseUrl: newContentGeneratorConfig?.baseUrl || "https://api.groq.com/openai/v1",
146169
- // API key from GROQ_API_KEY env var or settings
146170
- apiKey: newContentGeneratorConfig?.apiKey || process.env["GROQ_API_KEY"]
146170
+ // Force GROQ endpoint explicitly - this overrides any inherited baseUrl
146171
+ baseUrl: "https://api.groq.com/openai/v1",
146172
+ apiKey: groqApiKey,
146173
+ // Disable cache control for GROQ (not supported)
146174
+ disableCacheControl: true
146171
146175
  };
146172
146176
  }
146173
146177
  return {
@@ -146176,7 +146180,7 @@ function createContentGeneratorConfig(config, authType, generationConfig) {
146176
146180
  };
146177
146181
  }
146178
146182
  async function createContentGenerator(config, gcConfig, sessionId2, isInitialAuth) {
146179
- const version2 = "0.1.26";
146183
+ const version2 = "0.1.28";
146180
146184
  const userAgent2 = `OSAgent/${version2} (${process.platform}; ${process.arch})`;
146181
146185
  const baseHeaders = {
146182
146186
  "User-Agent": userAgent2
@@ -146251,16 +146255,16 @@ var init_contentGenerator = __esm({
146251
146255
  init_models();
146252
146256
  init_installationManager();
146253
146257
  init_loggingContentGenerator();
146254
- (function(AuthType3) {
146255
- AuthType3["LOGIN_WITH_OSAGENT"] = "oauth-personal";
146256
- AuthType3["USE_OSA"] = "OSA-api-key";
146257
- AuthType3["USE_VERTEX_AI"] = "vertex-ai";
146258
- AuthType3["CLOUD_SHELL"] = "cloud-shell";
146259
- AuthType3["USE_OPENAI"] = "openai";
146260
- AuthType3["OSA_OAUTH"] = "OSA-oauth";
146261
- AuthType3["OLLAMA_CLOUD"] = "ollama-cloud";
146262
- AuthType3["OLLAMA_LOCAL"] = "ollama-local";
146263
- AuthType3["USE_GROQ"] = "groq";
146258
+ (function(AuthType4) {
146259
+ AuthType4["LOGIN_WITH_OSAGENT"] = "oauth-personal";
146260
+ AuthType4["USE_OSA"] = "OSA-api-key";
146261
+ AuthType4["USE_VERTEX_AI"] = "vertex-ai";
146262
+ AuthType4["CLOUD_SHELL"] = "cloud-shell";
146263
+ AuthType4["USE_OPENAI"] = "openai";
146264
+ AuthType4["OSA_OAUTH"] = "OSA-oauth";
146265
+ AuthType4["OLLAMA_CLOUD"] = "ollama-cloud";
146266
+ AuthType4["OLLAMA_LOCAL"] = "ollama-local";
146267
+ AuthType4["USE_GROQ"] = "groq";
146264
146268
  })(AuthType2 || (AuthType2 = {}));
146265
146269
  __name(createContentGeneratorConfig, "createContentGeneratorConfig");
146266
146270
  __name(createContentGenerator, "createContentGenerator");
@@ -296084,6 +296088,17 @@ var SETTINGS_SCHEMA = {
296084
296088
  description: "Saved OpenAI credential profiles for quick switching via /openai-profile.",
296085
296089
  showInDialog: false,
296086
296090
  mergeStrategy: "shallow_merge" /* SHALLOW_MERGE */
296091
+ },
296092
+ // Provider-specific configurations
296093
+ providers: {
296094
+ type: "object",
296095
+ label: "Provider Configurations",
296096
+ category: "Security",
296097
+ requiresRestart: false,
296098
+ default: {},
296099
+ description: "Provider-specific configuration for each AI provider (GROQ, Ollama, OpenAI, etc.).",
296100
+ showInDialog: false,
296101
+ mergeStrategy: "shallow_merge" /* SHALLOW_MERGE */
296087
296102
  }
296088
296103
  }
296089
296104
  }
@@ -309775,7 +309790,7 @@ __name(getPackageJson, "getPackageJson");
309775
309790
  // packages/cli/src/utils/version.ts
309776
309791
  async function getCliVersion() {
309777
309792
  const pkgJson = await getPackageJson();
309778
- return "0.1.26";
309793
+ return "0.1.28";
309779
309794
  }
309780
309795
  __name(getCliVersion, "getCliVersion");
309781
309796
 
@@ -313944,8 +313959,8 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
313944
313959
 
313945
313960
  // packages/cli/src/generated/git-commit.ts
313946
313961
  init_esbuild_shims();
313947
- var GIT_COMMIT_INFO2 = "20c4873";
313948
- var CLI_VERSION2 = "0.1.26";
313962
+ var GIT_COMMIT_INFO2 = "6f7fcff";
313963
+ var CLI_VERSION2 = "0.1.28";
313949
313964
 
313950
313965
  // packages/cli/src/utils/systemInfo.ts
313951
313966
  async function getNpmVersion() {
@@ -317601,7 +317616,10 @@ var AVAILABLE_MODELS_OSA = [
317601
317616
  return t2(
317602
317617
  "Qwen3-Coder 480B Cloud - Most powerful agentic coding model with 256K context (Recommended)"
317603
317618
  );
317604
- }
317619
+ },
317620
+ contextWindow: 262144,
317621
+ // 256K
317622
+ tokensPerSecond: 100
317605
317623
  },
317606
317624
  {
317607
317625
  id: "qwen3-coder:30b",
@@ -317610,7 +317628,10 @@ var AVAILABLE_MODELS_OSA = [
317610
317628
  return t2(
317611
317629
  "Qwen3-Coder 30B - Efficient coding model with 30B params, only 3.3B activated"
317612
317630
  );
317613
- }
317631
+ },
317632
+ contextWindow: 131072,
317633
+ // 131K
317634
+ tokensPerSecond: 150
317614
317635
  },
317615
317636
  {
317616
317637
  id: MAINLINE_VLM,
@@ -317620,7 +317641,10 @@ var AVAILABLE_MODELS_OSA = [
317620
317641
  "Vision model for multimodal tasks"
317621
317642
  );
317622
317643
  },
317623
- isVision: true
317644
+ isVision: true,
317645
+ contextWindow: 131072,
317646
+ // 131K
317647
+ tokensPerSecond: 50
317624
317648
  }
317625
317649
  ];
317626
317650
  var AVAILABLE_MODELS_GROQ = [
@@ -317631,37 +317655,42 @@ var AVAILABLE_MODELS_GROQ = [
317631
317655
  return t2(
317632
317656
  "Kimi K2 0905 - Best coding model with 256K context, ~200 tok/s on GROQ"
317633
317657
  );
317634
- }
317658
+ },
317659
+ contextWindow: 262144,
317660
+ // 256K
317661
+ tokensPerSecond: 200
317635
317662
  },
317636
317663
  {
317637
317664
  id: "moonshotai/kimi-k2-instruct",
317638
- label: "Kimi K2 Instruct",
317665
+ label: "Kimi K2 Instruct (Legacy)",
317639
317666
  get description() {
317640
317667
  return t2(
317641
- "Kimi K2 Instruct - 131K context, excellent for coding and tool use"
317668
+ "Kimi K2 Instruct - 131K context (deprecated, use 0905 instead)"
317642
317669
  );
317643
- }
317670
+ },
317671
+ contextWindow: 131072,
317672
+ // 131K
317673
+ tokensPerSecond: 200
317644
317674
  },
317645
317675
  {
317646
317676
  id: "llama-3.3-70b-versatile",
317647
317677
  label: "Llama 3.3 70B",
317648
317678
  get description() {
317649
317679
  return t2("Llama 3.3 70B - Versatile model for general coding tasks");
317650
- }
317680
+ },
317681
+ contextWindow: 131072,
317682
+ // 131K
317683
+ tokensPerSecond: 280
317651
317684
  },
317652
317685
  {
317653
317686
  id: "llama-3.1-8b-instant",
317654
317687
  label: "Llama 3.1 8B Instant",
317655
317688
  get description() {
317656
317689
  return t2("Llama 3.1 8B - Ultra-fast for simple tasks");
317657
- }
317658
- },
317659
- {
317660
- id: "mixtral-8x7b-32768",
317661
- label: "Mixtral 8x7B",
317662
- get description() {
317663
- return t2("Mixtral 8x7B MoE - 32K context, good balance of speed/quality");
317664
- }
317690
+ },
317691
+ contextWindow: 131072,
317692
+ // 131K
317693
+ tokensPerSecond: 560
317665
317694
  }
317666
317695
  ];
317667
317696
  var AVAILABLE_MODELS_OLLAMA_LOCAL = [
@@ -317671,7 +317700,11 @@ var AVAILABLE_MODELS_OLLAMA_LOCAL = [
317671
317700
  get description() {
317672
317701
  return t2("Qwen2.5-Coder 32B - Best local coding model (requires ~20GB VRAM)");
317673
317702
  },
317674
- isLocal: true
317703
+ isLocal: true,
317704
+ contextWindow: 131072,
317705
+ // 128K
317706
+ tokensPerSecond: 30
317707
+ // Varies by hardware
317675
317708
  },
317676
317709
  {
317677
317710
  id: "qwen2.5-coder:14b",
@@ -317679,7 +317712,10 @@ var AVAILABLE_MODELS_OLLAMA_LOCAL = [
317679
317712
  get description() {
317680
317713
  return t2("Qwen2.5-Coder 14B - Great local coding model (requires ~10GB VRAM)");
317681
317714
  },
317682
- isLocal: true
317715
+ isLocal: true,
317716
+ contextWindow: 131072,
317717
+ // 128K
317718
+ tokensPerSecond: 50
317683
317719
  },
317684
317720
  {
317685
317721
  id: "qwen2.5-coder:7b",
@@ -317687,7 +317723,10 @@ var AVAILABLE_MODELS_OLLAMA_LOCAL = [
317687
317723
  get description() {
317688
317724
  return t2("Qwen2.5-Coder 7B - Good local coding model (requires ~5GB VRAM)");
317689
317725
  },
317690
- isLocal: true
317726
+ isLocal: true,
317727
+ contextWindow: 131072,
317728
+ // 128K
317729
+ tokensPerSecond: 80
317691
317730
  },
317692
317731
  {
317693
317732
  id: "codellama:34b",
@@ -317695,7 +317734,10 @@ var AVAILABLE_MODELS_OLLAMA_LOCAL = [
317695
317734
  get description() {
317696
317735
  return t2("CodeLlama 34B - Meta coding model (requires ~20GB VRAM)");
317697
317736
  },
317698
- isLocal: true
317737
+ isLocal: true,
317738
+ contextWindow: 16384,
317739
+ // 16K
317740
+ tokensPerSecond: 25
317699
317741
  },
317700
317742
  {
317701
317743
  id: "deepseek-coder-v2:16b",
@@ -317703,7 +317745,10 @@ var AVAILABLE_MODELS_OLLAMA_LOCAL = [
317703
317745
  get description() {
317704
317746
  return t2("DeepSeek Coder V2 16B - Efficient MoE coding model");
317705
317747
  },
317706
- isLocal: true
317748
+ isLocal: true,
317749
+ contextWindow: 131072,
317750
+ // 128K
317751
+ tokensPerSecond: 60
317707
317752
  },
317708
317753
  {
317709
317754
  id: "llama3.2:latest",
@@ -317711,7 +317756,10 @@ var AVAILABLE_MODELS_OLLAMA_LOCAL = [
317711
317756
  get description() {
317712
317757
  return t2("Llama 3.2 - General purpose model with coding capabilities");
317713
317758
  },
317714
- isLocal: true
317759
+ isLocal: true,
317760
+ contextWindow: 131072,
317761
+ // 128K
317762
+ tokensPerSecond: 70
317715
317763
  }
317716
317764
  ];
317717
317765
  function getOpenAIAvailableModelFromEnv() {
@@ -317737,6 +317785,10 @@ function getAvailableModelsForAuthType(authType) {
317737
317785
  }
317738
317786
  }
317739
317787
  __name(getAvailableModelsForAuthType, "getAvailableModelsForAuthType");
317788
+ function getAllAvailableModels() {
317789
+ return [...AVAILABLE_MODELS_OSA, ...AVAILABLE_MODELS_GROQ, ...AVAILABLE_MODELS_OLLAMA_LOCAL];
317790
+ }
317791
+ __name(getAllAvailableModels, "getAllAvailableModels");
317740
317792
  function getDefaultVisionModel() {
317741
317793
  return MAINLINE_VLM;
317742
317794
  }
@@ -317747,6 +317799,19 @@ function isVisionModel(modelId) {
317747
317799
  );
317748
317800
  }
317749
317801
  __name(isVisionModel, "isVisionModel");
317802
+ function getModelContextWindow(modelId) {
317803
+ const allModels = getAllAvailableModels();
317804
+ const model = allModels.find((m) => m.id === modelId);
317805
+ return model?.contextWindow ?? 131072;
317806
+ }
317807
+ __name(getModelContextWindow, "getModelContextWindow");
317808
+ function formatContextWindow(tokens) {
317809
+ if (tokens >= 1e6) {
317810
+ return `${Math.round(tokens / 1e6)}M`;
317811
+ }
317812
+ return `${Math.round(tokens / 1024)}K`;
317813
+ }
317814
+ __name(formatContextWindow, "formatContextWindow");
317750
317815
 
317751
317816
  // packages/cli/src/ui/commands/modelCommand.ts
317752
317817
  var modelCommand = {
@@ -317817,6 +317882,56 @@ var permissionsCommand = {
317817
317882
 
317818
317883
  // packages/cli/src/ui/commands/providerCommand.ts
317819
317884
  init_esbuild_shims();
317885
+ function getProviderApiKey(context2, providerKey, envVar) {
317886
+ const { settings } = context2.services;
317887
+ const providers = settings.merged.security?.auth?.providers;
317888
+ const providerConfig = providers?.[providerKey];
317889
+ if (providerConfig?.apiKey) {
317890
+ return providerConfig.apiKey;
317891
+ }
317892
+ return process.env[envVar];
317893
+ }
317894
+ __name(getProviderApiKey, "getProviderApiKey");
317895
+ async function persistProviderSelection(context2, authType, apiKey, model) {
317896
+ const { settings } = context2.services;
317897
+ settings.setValue("User" /* User */, "security.auth.selectedType", authType);
317898
+ if (apiKey) {
317899
+ const providerKey = authType.replace(/-/g, "_");
317900
+ const currentProviders = settings.merged.security?.auth?.providers || {};
317901
+ const updatedProviders = {
317902
+ ...currentProviders,
317903
+ [providerKey]: {
317904
+ ...currentProviders[providerKey],
317905
+ apiKey,
317906
+ model
317907
+ }
317908
+ };
317909
+ settings.setValue(
317910
+ "User" /* User */,
317911
+ "security.auth.providers",
317912
+ updatedProviders
317913
+ );
317914
+ }
317915
+ }
317916
+ __name(persistProviderSelection, "persistProviderSelection");
317917
+ function getProviderDisplayName(authType) {
317918
+ if (!authType) return "Unknown";
317919
+ switch (authType) {
317920
+ case AuthType2.USE_GROQ:
317921
+ return "GROQ";
317922
+ case AuthType2.OLLAMA_LOCAL:
317923
+ return "Ollama (Local)";
317924
+ case AuthType2.OLLAMA_CLOUD:
317925
+ return "Ollama (Cloud)";
317926
+ case AuthType2.USE_OPENAI:
317927
+ return "OpenAI Compatible";
317928
+ case AuthType2.OSA_OAUTH:
317929
+ return "OSAgent Cloud";
317930
+ default:
317931
+ return String(authType);
317932
+ }
317933
+ }
317934
+ __name(getProviderDisplayName, "getProviderDisplayName");
317820
317935
  var providerCommand = {
317821
317936
  name: "provider",
317822
317937
  get description() {
@@ -317839,18 +317954,25 @@ var providerCommand = {
317839
317954
  content: t2("Configuration not available.")
317840
317955
  };
317841
317956
  }
317842
- const apiKey = process.env["GROQ_API_KEY"];
317957
+ const apiKey = getProviderApiKey(context2, "groq", "GROQ_API_KEY");
317843
317958
  if (!apiKey) {
317844
317959
  return {
317845
- type: "message",
317846
- messageType: "error",
317847
- content: t2(`GROQ API key required. Set GROQ_API_KEY environment variable.
317848
-
317849
- Get your API key at: https://console.groq.com/keys`)
317960
+ type: "start_auth",
317961
+ authType: AuthType2.USE_GROQ
317850
317962
  };
317851
317963
  }
317852
317964
  try {
317965
+ process.env["GROQ_API_KEY"] = apiKey;
317853
317966
  await config.refreshAuth(AuthType2.USE_GROQ);
317967
+ await persistProviderSelection(
317968
+ context2,
317969
+ AuthType2.USE_GROQ,
317970
+ apiKey,
317971
+ "moonshotai/kimi-k2-instruct-0905"
317972
+ );
317973
+ const contextWindow = getModelContextWindow(
317974
+ "moonshotai/kimi-k2-instruct-0905"
317975
+ );
317854
317976
  return {
317855
317977
  type: "message",
317856
317978
  messageType: "info",
@@ -317858,15 +317980,18 @@ Get your API key at: https://console.groq.com/keys`)
317858
317980
 
317859
317981
  Model: moonshotai/kimi-k2-instruct-0905
317860
317982
  Speed: ~200 tok/s
317861
- Context: 256K tokens
317983
+ Context: ${formatContextWindow(contextWindow)} tokens
317862
317984
 
317863
- Use /model to change models within GROQ.`)
317985
+ Use /model to change models within GROQ.
317986
+ Provider selection saved to settings.`)
317864
317987
  };
317865
317988
  } catch (error) {
317866
317989
  return {
317867
317990
  type: "message",
317868
317991
  messageType: "error",
317869
- content: t2(`Failed to switch to GROQ: ${error instanceof Error ? error.message : String(error)}`)
317992
+ content: t2(
317993
+ `Failed to switch to GROQ: ${error instanceof Error ? error.message : String(error)}`
317994
+ )
317870
317995
  };
317871
317996
  }
317872
317997
  }, "action")
@@ -317888,19 +318013,23 @@ Use /model to change models within GROQ.`)
317888
318013
  }
317889
318014
  try {
317890
318015
  await config.refreshAuth(AuthType2.OLLAMA_LOCAL);
318016
+ await persistProviderSelection(context2, AuthType2.OLLAMA_LOCAL);
317891
318017
  return {
317892
318018
  type: "message",
317893
318019
  messageType: "info",
317894
318020
  content: t2(`Switched to local Ollama provider.
317895
318021
 
317896
318022
  Make sure Ollama is running: ollama serve
317897
- Use /model to select a local model.`)
318023
+ Use /model to select a local model.
318024
+ Provider selection saved to settings.`)
317898
318025
  };
317899
318026
  } catch (error) {
317900
318027
  return {
317901
318028
  type: "message",
317902
318029
  messageType: "error",
317903
- content: t2(`Failed to switch to Ollama: ${error instanceof Error ? error.message : String(error)}`)
318030
+ content: t2(
318031
+ `Failed to switch to Ollama: ${error instanceof Error ? error.message : String(error)}`
318032
+ )
317904
318033
  };
317905
318034
  }
317906
318035
  }, "action")
@@ -317920,29 +318049,72 @@ Use /model to select a local model.`)
317920
318049
  content: t2("Configuration not available.")
317921
318050
  };
317922
318051
  }
317923
- const apiKey = process.env["OPENAI_API_KEY"];
318052
+ const apiKey = getProviderApiKey(context2, "openai", "OPENAI_API_KEY");
317924
318053
  if (!apiKey) {
317925
318054
  return {
317926
- type: "message",
317927
- messageType: "error",
317928
- content: t2(`OpenAI API key required. Set OPENAI_API_KEY environment variable.`)
318055
+ type: "start_auth",
318056
+ authType: AuthType2.USE_OPENAI
317929
318057
  };
317930
318058
  }
317931
318059
  try {
318060
+ process.env["OPENAI_API_KEY"] = apiKey;
317932
318061
  await config.refreshAuth(AuthType2.USE_OPENAI);
318062
+ await persistProviderSelection(context2, AuthType2.USE_OPENAI, apiKey);
317933
318063
  return {
317934
318064
  type: "message",
317935
318065
  messageType: "info",
317936
318066
  content: t2(`Switched to OpenAI provider.
317937
318067
 
317938
318068
  Set OPENAI_BASE_URL for custom endpoints.
317939
- Use /model to select a model.`)
318069
+ Use /model to select a model.
318070
+ Provider selection saved to settings.`)
317940
318071
  };
317941
318072
  } catch (error) {
317942
318073
  return {
317943
318074
  type: "message",
317944
318075
  messageType: "error",
317945
- content: t2(`Failed to switch to OpenAI: ${error instanceof Error ? error.message : String(error)}`)
318076
+ content: t2(
318077
+ `Failed to switch to OpenAI: ${error instanceof Error ? error.message : String(error)}`
318078
+ )
318079
+ };
318080
+ }
318081
+ }, "action")
318082
+ },
318083
+ {
318084
+ name: "osa",
318085
+ altNames: ["osagent", "cloud"],
318086
+ get description() {
318087
+ return t2("Switch to OSAgent Cloud (default)");
318088
+ },
318089
+ kind: "built-in" /* BUILT_IN */,
318090
+ action: /* @__PURE__ */ __name(async (context2) => {
318091
+ const { config } = context2.services;
318092
+ if (!config) {
318093
+ return {
318094
+ type: "message",
318095
+ messageType: "error",
318096
+ content: t2("Configuration not available.")
318097
+ };
318098
+ }
318099
+ try {
318100
+ await config.refreshAuth(AuthType2.OSA_OAUTH);
318101
+ await persistProviderSelection(context2, AuthType2.OSA_OAUTH);
318102
+ return {
318103
+ type: "message",
318104
+ messageType: "info",
318105
+ content: t2(`Switched to OSAgent Cloud provider.
318106
+
318107
+ Model: qwen3-coder:480b-cloud
318108
+ Use /model to change models.
318109
+ Provider selection saved to settings.`)
318110
+ };
318111
+ } catch (error) {
318112
+ return {
318113
+ type: "message",
318114
+ messageType: "error",
318115
+ content: t2(
318116
+ `Failed to switch to OSAgent Cloud: ${error instanceof Error ? error.message : String(error)}`
318117
+ )
317946
318118
  };
317947
318119
  }
317948
318120
  }, "action")
@@ -317954,7 +318126,7 @@ Use /model to select a model.`)
317954
318126
  },
317955
318127
  kind: "built-in" /* BUILT_IN */,
317956
318128
  action: /* @__PURE__ */ __name(async (context2) => {
317957
- const { config } = context2.services;
318129
+ const { config, settings } = context2.services;
317958
318130
  if (!config) {
317959
318131
  return {
317960
318132
  type: "message",
@@ -317966,39 +318138,43 @@ Use /model to select a model.`)
317966
318138
  const contentGeneratorConfig = config.getContentGeneratorConfig();
317967
318139
  const model = contentGeneratorConfig?.model || "unknown";
317968
318140
  const baseUrl = contentGeneratorConfig?.baseUrl || "default";
317969
- let providerName = "Unknown";
317970
- switch (authType) {
317971
- case AuthType2.USE_GROQ:
317972
- providerName = "GROQ";
317973
- break;
317974
- case AuthType2.OLLAMA_LOCAL:
317975
- providerName = "Ollama (Local)";
317976
- break;
317977
- case AuthType2.OLLAMA_CLOUD:
317978
- providerName = "Ollama (Cloud)";
317979
- break;
317980
- case AuthType2.USE_OPENAI:
317981
- providerName = "OpenAI Compatible";
317982
- break;
317983
- case AuthType2.OSA_OAUTH:
317984
- providerName = "OSAgent Cloud";
317985
- break;
317986
- default:
317987
- providerName = String(authType);
318141
+ const providerName = getProviderDisplayName(authType);
318142
+ const contextWindow = getModelContextWindow(model);
318143
+ const savedAuthType = settings.merged.security?.auth?.selectedType;
318144
+ const providers = settings.merged.security?.auth?.providers;
318145
+ const providerStatuses = [];
318146
+ const providerList = [
318147
+ { key: "groq", name: "GROQ", envVar: "GROQ_API_KEY" },
318148
+ { key: "openai", name: "OpenAI", envVar: "OPENAI_API_KEY" },
318149
+ { key: "ollama_local", name: "Ollama Local", envVar: null },
318150
+ { key: "osa_oauth", name: "OSAgent Cloud", envVar: null }
318151
+ ];
318152
+ for (const p of providerList) {
318153
+ const hasSettingsKey = !!providers?.[p.key]?.apiKey;
318154
+ const hasEnvKey = p.envVar ? !!process.env[p.envVar] : true;
318155
+ const configured = hasSettingsKey || hasEnvKey;
318156
+ const status = configured ? "\u2713" : "\u25CB";
318157
+ providerStatuses.push(` ${status} ${p.name}`);
317988
318158
  }
317989
318159
  return {
317990
318160
  type: "message",
317991
318161
  messageType: "info",
317992
318162
  content: t2(`Provider Status
317993
318163
  \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
317994
- Provider: ${providerName}
318164
+ Active: ${providerName}
317995
318165
  Model: ${model}
318166
+ Context: ${formatContextWindow(contextWindow)} tokens
317996
318167
  Base URL: ${baseUrl}
318168
+ Saved in Settings: ${savedAuthType ? "Yes" : "No"}
318169
+
318170
+ Configured Providers:
318171
+ ${providerStatuses.join("\n")}
317997
318172
 
317998
318173
  Commands:
317999
318174
  /provider groq - Switch to GROQ (Kimi K2)
318000
318175
  /provider ollama - Switch to local Ollama
318001
318176
  /provider openai - Switch to OpenAI compatible
318177
+ /provider osa - Switch to OSAgent Cloud
318002
318178
  /model - Change model within current provider`)
318003
318179
  };
318004
318180
  }, "action")
@@ -318014,26 +318190,7 @@ Commands:
318014
318190
  };
318015
318191
  }
318016
318192
  const authType = config.getAuthType();
318017
- let providerName = "Unknown";
318018
- switch (authType) {
318019
- case AuthType2.USE_GROQ:
318020
- providerName = "GROQ";
318021
- break;
318022
- case AuthType2.OLLAMA_LOCAL:
318023
- providerName = "Ollama (Local)";
318024
- break;
318025
- case AuthType2.OLLAMA_CLOUD:
318026
- providerName = "Ollama (Cloud)";
318027
- break;
318028
- case AuthType2.USE_OPENAI:
318029
- providerName = "OpenAI Compatible";
318030
- break;
318031
- case AuthType2.OSA_OAUTH:
318032
- providerName = "OSAgent Cloud";
318033
- break;
318034
- default:
318035
- providerName = String(authType);
318036
- }
318193
+ const providerName = getProviderDisplayName(authType);
318037
318194
  return {
318038
318195
  type: "message",
318039
318196
  messageType: "info",
@@ -318046,8 +318203,13 @@ Available Providers:
318046
318203
  /provider groq - GROQ (Kimi K2, ~200 tok/s, 256K context)
318047
318204
  /provider ollama - Local Ollama (qwen2.5-coder, etc.)
318048
318205
  /provider openai - OpenAI compatible APIs
318206
+ /provider osa - OSAgent Cloud (default)
318049
318207
  /provider status - Show detailed status
318050
318208
 
318209
+ Configuration:
318210
+ API keys can be set via environment variables or saved in settings.
318211
+ Use the provider commands to configure and save your preferences.
318212
+
318051
318213
  Environment Variables:
318052
318214
  GROQ_API_KEY - For GROQ provider
318053
318215
  OPENAI_API_KEY - For OpenAI provider
@@ -351462,6 +351624,31 @@ var DialogManager = /* @__PURE__ */ __name(({
351462
351624
  }
351463
351625
  );
351464
351626
  }
351627
+ if (uiState.pendingAuthType === AuthType2.USE_GROQ) {
351628
+ return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
351629
+ OpenAIKeyPrompt,
351630
+ {
351631
+ onSubmit: (apiKey, _baseUrl, model) => {
351632
+ process34.env["GROQ_API_KEY"] = apiKey;
351633
+ uiActions.handleAuthSelect(AuthType2.USE_GROQ, "User" /* User */, {
351634
+ apiKey,
351635
+ // Always use GROQ endpoint - ignore user-provided baseUrl
351636
+ baseUrl: "https://api.groq.com/openai/v1",
351637
+ model: model || "moonshotai/kimi-k2-instruct-0905"
351638
+ });
351639
+ },
351640
+ onCancel: () => {
351641
+ uiActions.cancelAuthentication();
351642
+ uiActions.setAuthState("updating" /* Updating */);
351643
+ },
351644
+ defaultApiKey: process34.env["GROQ_API_KEY"] || "",
351645
+ defaultBaseUrl: "https://api.groq.com/openai/v1",
351646
+ defaultModel: "moonshotai/kimi-k2-instruct-0905",
351647
+ providerName: "GROQ",
351648
+ apiKeyUrl: "https://console.groq.com/keys"
351649
+ }
351650
+ );
351651
+ }
351465
351652
  if (uiState.pendingAuthType === AuthType2.OSA_OAUTH) {
351466
351653
  return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
351467
351654
  OSAOAuthProgress,
@@ -355164,6 +355351,18 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
355164
355351
  await performAuth(authType, scope, credentials);
355165
355352
  return;
355166
355353
  }
355354
+ if (authType === AuthType2.USE_GROQ) {
355355
+ if (credentials) {
355356
+ config.updateCredentials({
355357
+ apiKey: credentials.apiKey,
355358
+ // Always use GROQ endpoint - ignore user-provided baseUrl
355359
+ baseUrl: "https://api.groq.com/openai/v1",
355360
+ model: credentials.model || "moonshotai/kimi-k2-instruct-0905"
355361
+ });
355362
+ await performAuth(authType, scope, credentials);
355363
+ }
355364
+ return;
355365
+ }
355167
355366
  await performAuth(authType, scope);
355168
355367
  },
355169
355368
  [config, performAuth]
@@ -355171,6 +355370,12 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
355171
355370
  const openAuthDialog = (0, import_react106.useCallback)(() => {
355172
355371
  setIsAuthDialogOpen(true);
355173
355372
  }, []);
355373
+ const startAuthForProvider = (0, import_react106.useCallback)((authType) => {
355374
+ setPendingAuthType(authType);
355375
+ setAuthError(null);
355376
+ setIsAuthDialogOpen(false);
355377
+ setIsAuthenticating(true);
355378
+ }, []);
355174
355379
  const cancelAuthentication = (0, import_react106.useCallback)(() => {
355175
355380
  if (isAuthenticating && pendingAuthType === AuthType2.OSA_OAUTH) {
355176
355381
  cancelOSAAuth();
@@ -355214,6 +355419,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
355214
355419
  OSAAuthState,
355215
355420
  handleAuthSelect,
355216
355421
  openAuthDialog,
355422
+ startAuthForProvider,
355217
355423
  cancelAuthentication
355218
355424
  };
355219
355425
  }, "useAuthCommand");
@@ -356100,6 +356306,10 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
356100
356306
  true
356101
356307
  );
356102
356308
  }
356309
+ case "start_auth": {
356310
+ actions.startAuthForProvider(result.authType);
356311
+ return { type: "handled" };
356312
+ }
356103
356313
  default: {
356104
356314
  const unhandled = result;
356105
356315
  throw new Error(
@@ -362832,6 +363042,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
362832
363042
  OSAAuthState,
362833
363043
  handleAuthSelect,
362834
363044
  openAuthDialog,
363045
+ startAuthForProvider,
362835
363046
  cancelAuthentication
362836
363047
  } = useAuthCommand(settings, config, historyManager.addItem);
362837
363048
  const { proQuotaRequest, handleProQuotaChoice } = useQuotaAndFallback({
@@ -362921,7 +363132,8 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
362921
363132
  addConfirmUpdateExtensionRequest,
362922
363133
  openSubagentCreateDialog,
362923
363134
  openAgentsManagerDialog,
362924
- _showQuitConfirmation: showQuitConfirmation
363135
+ _showQuitConfirmation: showQuitConfirmation,
363136
+ startAuthForProvider
362925
363137
  }),
362926
363138
  [
362927
363139
  openAuthDialog,
@@ -362938,7 +363150,8 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
362938
363150
  addConfirmUpdateExtensionRequest,
362939
363151
  showQuitConfirmation,
362940
363152
  openSubagentCreateDialog,
362941
- openAgentsManagerDialog
363153
+ openAgentsManagerDialog,
363154
+ startAuthForProvider
362942
363155
  ]
362943
363156
  );
362944
363157
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osagent",
3
- "version": "0.1.26",
3
+ "version": "0.1.28",
4
4
  "description": "OS Agent - AI-powered CLI for autonomous coding with Ollama Cloud and Qwen models",
5
5
  "author": "Roberto Luna",
6
6
  "license": "Apache-2.0",