@ccpocket/bridge 1.90.0 → 1.91.1

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.
@@ -10,6 +10,11 @@ import { RecordingStore } from "./recording-store.js";
10
10
  import type { FirebaseAuthClient } from "./firebase-auth.js";
11
11
  import type { PromptHistoryBackupStore } from "./prompt-history-backup.js";
12
12
  import type { PromptHistoryStore } from "./prompt-history-store.js";
13
+ export interface ClaudeModelOption {
14
+ value: string;
15
+ displayName?: string;
16
+ description?: string;
17
+ }
13
18
  export declare function downloadMimeType(filePath: string): string;
14
19
  export interface BridgeServerOptions {
15
20
  server: HttpServer;
@@ -75,6 +80,7 @@ export declare class BridgeWebSocketServer {
75
80
  private codexMetadataRequest;
76
81
  private lastConnectMetadataRefreshAt;
77
82
  private claudeModels;
83
+ private claudeModelOptions;
78
84
  private claudeModelEfforts;
79
85
  private claudeModelsRequest;
80
86
  private codexModels;
package/dist/websocket.js CHANGED
@@ -42,23 +42,22 @@ function projectRequestMetadata(request) {
42
42
  const RESUME_OPERATION_TIMEOUT_MS = 5 * 60 * 1000;
43
43
  const RESUME_COMPLETED_TTL_MS = 30 * 1000;
44
44
  // ---- Available model lists (delivered to clients via session_list) ----
45
- const FALLBACK_CLAUDE_MODELS = [
46
- "claude-opus-4-7",
47
- "claude-opus-4-7[1m]",
48
- "claude-opus-4-6",
49
- "claude-opus-4-6[1m]",
50
- "claude-opus-4-5-20251101",
51
- "claude-sonnet-4-6",
52
- "claude-haiku-4-6",
45
+ // Used only when the Agent SDK cannot report its model list. These are the
46
+ // Claude Code aliases, which always resolve to the current model of each
47
+ // family, so the fallback never needs version-specific updates.
48
+ const FALLBACK_CLAUDE_MODEL_OPTIONS = [
49
+ { value: "default", displayName: "Default (recommended)" },
50
+ { value: "opus", displayName: "Opus" },
51
+ { value: "sonnet", displayName: "Sonnet" },
52
+ { value: "haiku", displayName: "Haiku" },
53
53
  ];
54
+ const FALLBACK_CLAUDE_MODELS = FALLBACK_CLAUDE_MODEL_OPTIONS.map((option) => option.value);
55
+ const FALLBACK_CLAUDE_EFFORTS = ["low", "medium", "high"];
54
56
  const FALLBACK_CLAUDE_MODEL_EFFORTS = {
55
- "claude-opus-4-7": ["low", "medium", "high", "xhigh", "max"],
56
- "claude-opus-4-7[1m]": ["low", "medium", "high", "xhigh", "max"],
57
- "claude-opus-4-6": ["low", "medium", "high", "max"],
58
- "claude-opus-4-6[1m]": ["low", "medium", "high", "max"],
59
- "claude-opus-4-5-20251101": ["low", "medium", "high"],
60
- "claude-sonnet-4-6": ["low", "medium", "high", "max"],
61
- "claude-haiku-4-6": [],
57
+ default: FALLBACK_CLAUDE_EFFORTS,
58
+ opus: FALLBACK_CLAUDE_EFFORTS,
59
+ sonnet: FALLBACK_CLAUDE_EFFORTS,
60
+ haiku: [],
62
61
  };
63
62
  const FALLBACK_CODEX_MODELS = [
64
63
  "gpt-5.6-sol",
@@ -546,6 +545,7 @@ export class BridgeWebSocketServer {
546
545
  codexMetadataRequest = null;
547
546
  lastConnectMetadataRefreshAt = null;
548
547
  claudeModels = FALLBACK_CLAUDE_MODELS;
548
+ claudeModelOptions = FALLBACK_CLAUDE_MODEL_OPTIONS;
549
549
  claudeModelEfforts = {
550
550
  ...FALLBACK_CLAUDE_MODEL_EFFORTS,
551
551
  };
@@ -6639,6 +6639,7 @@ export class BridgeWebSocketServer {
6639
6639
  sessions,
6640
6640
  allowedDirs: this.allowedDirs,
6641
6641
  claudeModels: this.claudeModels,
6642
+ claudeModelOptions: this.claudeModelOptions,
6642
6643
  claudeModelEfforts: this.claudeModelEfforts,
6643
6644
  codexModels: this.codexModels,
6644
6645
  codexModelReasoningEfforts: this.codexModelReasoningEfforts,
@@ -6679,6 +6680,7 @@ export class BridgeWebSocketServer {
6679
6680
  sessions,
6680
6681
  allowedDirs: this.allowedDirs,
6681
6682
  claudeModels: this.claudeModels,
6683
+ claudeModelOptions: this.claudeModelOptions,
6682
6684
  claudeModelEfforts: this.claudeModelEfforts,
6683
6685
  codexModels: this.codexModels,
6684
6686
  codexModelReasoningEfforts: this.codexModelReasoningEfforts,
@@ -7298,10 +7300,16 @@ export class BridgeWebSocketServer {
7298
7300
  }
7299
7301
  applyClaudeModels(models) {
7300
7302
  this.claudeModels = models.map((model) => model.model);
7303
+ this.claudeModelOptions = models.map((model) => ({
7304
+ value: model.model,
7305
+ ...(model.displayName ? { displayName: model.displayName } : {}),
7306
+ ...(model.description ? { description: model.description } : {}),
7307
+ }));
7301
7308
  this.claudeModelEfforts = Object.fromEntries(models.map((model) => [model.model, model.effortLevels]));
7302
7309
  }
7303
7310
  applyFallbackClaudeModels() {
7304
7311
  this.claudeModels = FALLBACK_CLAUDE_MODELS;
7312
+ this.claudeModelOptions = FALLBACK_CLAUDE_MODEL_OPTIONS;
7305
7313
  this.claudeModelEfforts = { ...FALLBACK_CLAUDE_MODEL_EFFORTS };
7306
7314
  }
7307
7315
  async readCodexModels(codexProcess) {