chatroom-cli 1.48.0 → 1.49.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.
package/dist/index.js CHANGED
@@ -26937,6 +26937,40 @@ var init_registry2 = __esm(() => {
26937
26937
  registry = new Map;
26938
26938
  });
26939
26939
 
26940
+ // src/infrastructure/services/remote-agents/claude/claude-models.ts
26941
+ async function fetchClaudeModels() {
26942
+ const apiKey = process.env.ANTHROPIC_API_KEY?.trim();
26943
+ if (!apiKey)
26944
+ return;
26945
+ try {
26946
+ const resp = await fetch("https://api.anthropic.com/v1/models", {
26947
+ headers: {
26948
+ "x-api-key": apiKey,
26949
+ "anthropic-version": "2023-06-01"
26950
+ }
26951
+ });
26952
+ if (!resp.ok)
26953
+ return;
26954
+ const json = await resp.json();
26955
+ const ids3 = json.data.map((m) => m.id).filter((id3) => id3.startsWith("claude-"));
26956
+ return ids3.length > 0 ? ids3 : undefined;
26957
+ } catch {
26958
+ return;
26959
+ }
26960
+ }
26961
+ var CLAUDE_FALLBACK_MODELS;
26962
+ var init_claude_models = __esm(() => {
26963
+ CLAUDE_FALLBACK_MODELS = [
26964
+ "opus",
26965
+ "sonnet",
26966
+ "haiku",
26967
+ "claude-opus-4-8",
26968
+ "claude-opus-4-6",
26969
+ "claude-sonnet-4-6",
26970
+ "claude-haiku-4-5"
26971
+ ];
26972
+ });
26973
+
26940
26974
  // src/infrastructure/services/remote-agents/claude/claude-stream-reader.ts
26941
26975
  import { createInterface as createInterface4 } from "node:readline";
26942
26976
 
@@ -27002,6 +27036,7 @@ var init_claude_stream_reader = () => {};
27002
27036
  var CLAUDE_COMMAND = "claude", DEFAULT_MAX_TURNS = 200, ClaudeCodeAgentService;
27003
27037
  var init_claude_code_agent_service = __esm(() => {
27004
27038
  init_base_cli_agent_service();
27039
+ init_claude_models();
27005
27040
  init_claude_stream_reader();
27006
27041
  ClaudeCodeAgentService = class ClaudeCodeAgentService extends BaseCLIAgentService {
27007
27042
  id = "claude";
@@ -27017,7 +27052,10 @@ var init_claude_code_agent_service = __esm(() => {
27017
27052
  return this.checkVersion(CLAUDE_COMMAND);
27018
27053
  }
27019
27054
  async listModels() {
27020
- return ["claude-haiku-4-5", "claude-sonnet-4-6", "claude-opus-4-6"];
27055
+ const dynamic = await fetchClaudeModels();
27056
+ if (dynamic)
27057
+ return dynamic;
27058
+ return [...CLAUDE_FALLBACK_MODELS];
27021
27059
  }
27022
27060
  async spawn(options) {
27023
27061
  const { prompt, systemPrompt, model } = options;
@@ -86469,4 +86507,4 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
86469
86507
  });
86470
86508
  program2.parse();
86471
86509
 
86472
- //# debugId=AD4499C508D701CE64756E2164756E21
86510
+ //# debugId=2DBCEF13548BACBB64756E2164756E21