@arrislink/axon 1.5.1 → 1.5.3

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 +107 -17
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -11367,7 +11367,14 @@ var init_defaults = __esm(() => {
11367
11367
  "gpt-4o": { input: 5, output: 15 },
11368
11368
  "gpt-5.3-codex": { input: 10, output: 30 },
11369
11369
  "gpt-5-nano": { input: 0.5, output: 1.5 },
11370
- "glm-4.7-free": { input: 0, output: 0 }
11370
+ "glm-4.7-free": { input: 0, output: 0 },
11371
+ "deepseek-v3": { input: 0.2, output: 0.6 },
11372
+ "deepseek-r1": { input: 0.5, output: 2.5 },
11373
+ "kimi-k2.5-free": { input: 0, output: 0 },
11374
+ "minimax-m2.1-free": { input: 0, output: 0 },
11375
+ "big-pickle-free": { input: 0, output: 0 },
11376
+ "trinity-large-preview-free": { input: 0, output: 0 },
11377
+ "zen-free": { input: 0, output: 0 }
11371
11378
  };
11372
11379
  });
11373
11380
 
@@ -20625,7 +20632,7 @@ class AnthropicClient {
20625
20632
  });
20626
20633
  if (!response.ok) {
20627
20634
  const errorText = await response.text().catch(() => "");
20628
- let errorData = {};
20635
+ let errorData = { usage: { input_tokens: 0, output_tokens: 0 } };
20629
20636
  try {
20630
20637
  errorData = JSON.parse(errorText);
20631
20638
  } catch {}
@@ -20719,22 +20726,47 @@ class OMOConfigReader {
20719
20726
  if (existsSync5(path)) {
20720
20727
  try {
20721
20728
  const content = readFileSync3(path, "utf-8");
20729
+ const currentProvidersCount = this.providers.length;
20722
20730
  if (path.endsWith(".yaml") || path.endsWith(".yml")) {
20723
20731
  this.loadYamlConfig(content);
20724
20732
  } else if (path.endsWith(".json")) {
20725
20733
  this.loadJsonConfig(content, path);
20726
20734
  }
20727
- if (this.providers.length > 0) {
20728
- this.configSource = path;
20729
- break;
20735
+ if (this.providers.length > currentProvidersCount) {
20736
+ if (!this.configSource) {
20737
+ this.configSource = path;
20738
+ }
20730
20739
  }
20731
20740
  } catch (e) {
20732
20741
  console.warn(`Failed to parse config at ${path}:`, e);
20733
20742
  }
20734
20743
  }
20735
20744
  }
20736
- if (this.providers.length > 0 && !this.configSource.endsWith("opencode.json")) {
20737
- this.mergeOpenCodeProviders();
20745
+ this.mergeOpenCodeProviders();
20746
+ this.ensureAntigravityProvider();
20747
+ }
20748
+ ensureAntigravityProvider() {
20749
+ if (this.antigravityToken && !this.providers.some((p) => p.name === "antigravity")) {
20750
+ this.providers.push({
20751
+ name: "antigravity",
20752
+ type: "antigravity",
20753
+ models: [
20754
+ "opencode/claude-sonnet-4-20250514",
20755
+ "opencode/claude-opus-4-6",
20756
+ "opencode/gemini-3-pro",
20757
+ "opencode/gemini-3-flash",
20758
+ "opencode/deepseek-chat",
20759
+ "opencode/deepseek-v3",
20760
+ "opencode/deepseek-r1",
20761
+ "opencode/kimi-k2.5-free",
20762
+ "opencode/minimax-m2.1-free",
20763
+ "opencode/big-pickle-free",
20764
+ "opencode/trinity-large-preview-free",
20765
+ "opencode/zen-pro",
20766
+ "opencode/zen-free"
20767
+ ],
20768
+ endpoint: "https://api.antigravity.ai/v1"
20769
+ });
20738
20770
  }
20739
20771
  }
20740
20772
  loadAntigravityToken() {
@@ -20761,11 +20793,26 @@ class OMOConfigReader {
20761
20793
  const config = JSON.parse(content);
20762
20794
  if (config.provider) {
20763
20795
  for (const [name, details] of Object.entries(config.provider)) {
20764
- if (!this.providers.some((p) => p.name === name)) {
20796
+ const existing = this.providers.find((p) => p.name === name);
20797
+ const newModels = Object.keys(details.models || {});
20798
+ if (existing) {
20799
+ const combined = new Set([...existing.models, ...newModels]);
20800
+ if (existing.type === "antigravity" || existing.name === "antigravity") {
20801
+ combined.add("opencode/kimi-k2.5-free");
20802
+ combined.add("opencode/minimax-m2.1-free");
20803
+ combined.add("opencode/big-pickle-free");
20804
+ combined.add("opencode/trinity-large-preview-free");
20805
+ combined.add("opencode/zen-free");
20806
+ }
20807
+ existing.models = Array.from(combined);
20808
+ if (!existing.endpoint && details.endpoint) {
20809
+ existing.endpoint = details.endpoint;
20810
+ }
20811
+ } else {
20765
20812
  this.providers.push({
20766
20813
  name,
20767
20814
  type: name,
20768
- models: Object.keys(details.models || {}),
20815
+ models: newModels,
20769
20816
  endpoint: details.endpoint
20770
20817
  });
20771
20818
  }
@@ -20786,9 +20833,13 @@ class OMOConfigReader {
20786
20833
  if (config.agents) {
20787
20834
  this.providers = Object.entries(config.agents).map(([name, agent]) => {
20788
20835
  const resolvedType = resolveProviderType(agent.model || "");
20836
+ const models = [agent.model || "unknown"];
20837
+ if (resolvedType === "antigravity") {
20838
+ models.push("opencode/kimi-k2.5-free", "opencode/minimax-m2.1-free", "opencode/big-pickle-free", "opencode/trinity-large-preview-free", "opencode/zen-free");
20839
+ }
20789
20840
  return {
20790
20841
  name,
20791
- models: [agent.model || "unknown"],
20842
+ models,
20792
20843
  type: resolvedType,
20793
20844
  endpoint: undefined,
20794
20845
  api_key: undefined
@@ -21020,7 +21071,19 @@ class UnifiedLLMClient {
21020
21071
  provider = this.omoConfig.getPrimaryProvider();
21021
21072
  }
21022
21073
  if (!provider) {
21023
- throw new Error("\u672A\u627E\u5230\u53EF\u7528\u7684 LLM Provider");
21074
+ if (this.omoConfig.hasAntigravityAuth()) {
21075
+ console.warn("\u26A0\uFE0F \u672A\u627E\u5230\u53EF\u7528 Provider\uFF0C\u81EA\u52A8\u56DE\u9000\u5230 OpenCode Zen Free \u6A21\u578B");
21076
+ provider = {
21077
+ name: "fallback-zen",
21078
+ type: "antigravity",
21079
+ models: ["opencode/zen-free"],
21080
+ endpoint: "https://api.antigravity.ai/v1"
21081
+ };
21082
+ if (!modelOverride)
21083
+ modelOverride = "opencode/zen-free";
21084
+ } else {
21085
+ throw new Error("\u672A\u627E\u5230\u53EF\u7528\u7684 LLM Provider\uFF0C\u8BF7\u68C0\u67E5\u914D\u7F6E\u6216\u8BBE\u7F6E API \u5BC6\u94A5");
21086
+ }
21024
21087
  }
21025
21088
  const providerType = provider.type || provider.name;
21026
21089
  const mergedOptions = { ...options, model: modelOverride };
@@ -21121,11 +21184,9 @@ class UnifiedLLMClient {
21121
21184
  generationConfig: {
21122
21185
  temperature: options?.temperature ?? 0.7,
21123
21186
  maxOutputTokens: options?.maxTokens || 8000
21124
- }
21187
+ },
21188
+ systemInstruction: systemMessage ? { parts: [{ text: systemMessage.content }] } : undefined
21125
21189
  };
21126
- if (systemMessage) {
21127
- body.systemInstruction = { parts: [{ text: systemMessage.content }] };
21128
- }
21129
21190
  const response = await fetch(url, {
21130
21191
  method: "POST",
21131
21192
  headers: { "Content-Type": "application/json" },
@@ -54928,6 +54989,7 @@ var doctorCommand = new Command("doctor").description(t("Diagnose environment is
54928
54989
  // src/commands/config.ts
54929
54990
  init_source();
54930
54991
  var import_cli_table3 = __toESM(require_table(), 1);
54992
+ init_manager();
54931
54993
  init_llm();
54932
54994
  init_omo_config_reader();
54933
54995
  init_i18n();
@@ -54966,7 +55028,7 @@ configCommand.command("list").alias("ls").description(t("List all available Prov
54966
55028
  mark,
54967
55029
  source_default.bold(provider.name),
54968
55030
  provider.type || "-",
54969
- (provider.models || []).slice(0, 2).join(", ") + (provider.models.length > 2 ? "..." : "")
55031
+ (provider.models || []).slice(0, 5).join(", ") + (provider.models.length > 5 ? "..." : "")
54970
55032
  ]);
54971
55033
  }
54972
55034
  console.log(table.toString());
@@ -54975,6 +55037,8 @@ configCommand.command("list").alias("ls").description(t("List all available Prov
54975
55037
  console.log(source_default.green(`
54976
55038
  \u5F53\u524D\u9ED8\u8BA4: ${source_default.bold(primary.name)}`));
54977
55039
  }
55040
+ console.log(source_default.dim("\n\uD83D\uDCA1 \u63D0\u793A: \u4F7F\u7528 `ax config set-model <model>` \u624B\u52A8\u5207\u6362\u9879\u76EE\u9ED8\u8BA4\u6A21\u578B"));
55041
+ console.log(source_default.dim(" \u4F8B\u5982: ax config set-model opencode/zen-free"));
54978
55042
  });
54979
55043
  configCommand.command("show").description(t("Show current Axon running mode", "\u663E\u793A\u5F53\u524D Axon \u8FD0\u884C\u6A21\u5F0F")).action(() => {
54980
55044
  const client = new AxonLLMClient;
@@ -54992,6 +55056,9 @@ configCommand.command("show").description(t("Show current Axon running mode", "\
54992
55056
  mode === "cli" ? source_default.green(mode) : mode === "direct" ? source_default.blue(mode) : source_default.yellow(mode)
54993
55057
  ], ["\u63CF\u8FF0", desc], ["\u914D\u7F6E\u6765\u6E90", omo.getConfigSource() || "\u65E0"], ["Providers \u6570\u91CF", omo.getAllProviders().length.toString()]);
54994
55058
  console.log(table.toString());
55059
+ console.log(source_default.dim(`
55060
+ \uD83D\uDCA1 \u63D0\u793A: \u60A8\u53EF\u4EE5\u4E3A\u5F53\u524D\u9879\u76EE\u8BBE\u7F6E\u7279\u5B9A\u7684\u6A21\u578B\uFF1A`));
55061
+ console.log(source_default.cyan(" ax config set-model <model_name>"));
54995
55062
  if (mode === "fallback") {
54996
55063
  console.log(source_default.yellow(`
54997
55064
  \u26A0\uFE0F \u6B63\u5728\u4F7F\u7528 Fallback \u6A21\u5F0F (\u4EC5\u9650\u73AF\u5883\u53D8\u91CF)`));
@@ -55101,6 +55168,29 @@ configCommand.command("keys").description(t("Quick setup API key (via OMO)", "\u
55101
55168
  logger.error(`\u8BBE\u7F6E\u5931\u8D25: ${e.message}`);
55102
55169
  }
55103
55170
  });
55171
+ configCommand.command("set-model").description(t("Set default model for the current project", "\u8BBE\u7F6E\u5F53\u524D\u9879\u76EE\u7684\u9ED8\u8BA4\u6A21\u578B")).argument("<model>", t("Model name (e.g., claude-3-5-sonnet)", "\u6A21\u578B\u540D\u79F0")).option("-p, --provider <provider>", t("Specify provider", "\u6307\u5B9A\u63D0\u4F9B\u5546")).action(async (model, options) => {
55172
+ try {
55173
+ const configManager = new ConfigManager(process.cwd());
55174
+ if (!ConfigManager.isAxonProject(process.cwd())) {
55175
+ logger.error(t('Not an Axon project. Run "ax init" first.', '\u5F53\u524D\u4E0D\u662F Axon \u9879\u76EE\uFF0C\u8BF7\u5148\u8FD0\u884C "ax init"'));
55176
+ return;
55177
+ }
55178
+ const updates = {
55179
+ agents: {
55180
+ sisyphus: {
55181
+ model
55182
+ }
55183
+ }
55184
+ };
55185
+ if (options.provider) {
55186
+ updates.agents.sisyphus.provider = options.provider;
55187
+ }
55188
+ configManager.update(updates);
55189
+ logger.success(t(`Default model set to: ${model}`, `\u9ED8\u8BA4\u6A21\u578B\u5DF2\u8BBE\u7F6E\u4E3A: ${model}`));
55190
+ } catch (error) {
55191
+ logger.error(`\u8BBE\u7F6E\u5931\u8D25: ${error.message}`);
55192
+ }
55193
+ });
55104
55194
  // src/commands/docs.ts
55105
55195
  init_source();
55106
55196
  var import_cli_table32 = __toESM(require_table(), 1);
@@ -55237,7 +55327,7 @@ init_errors2();
55237
55327
  // package.json
55238
55328
  var package_default = {
55239
55329
  name: "@arrislink/axon",
55240
- version: "1.5.1",
55330
+ version: "1.5.3",
55241
55331
  description: "AI-Powered Development Operating System with unified LLM provider support",
55242
55332
  type: "module",
55243
55333
  main: "dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arrislink/axon",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "description": "AI-Powered Development Operating System with unified LLM provider support",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",