@siteboon/claude-code-ui 1.22.0 → 1.23.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.
@@ -14,13 +14,14 @@ router.get('/claude/status', async (req, res) => {
14
14
  return res.json({
15
15
  authenticated: true,
16
16
  email: credentialsResult.email || 'Authenticated',
17
- method: 'credentials_file'
17
+ method: credentialsResult.method // 'api_key' or 'credentials_file'
18
18
  });
19
19
  }
20
20
 
21
21
  return res.json({
22
22
  authenticated: false,
23
23
  email: null,
24
+ method: null,
24
25
  error: credentialsResult.error || 'Not authenticated'
25
26
  });
26
27
 
@@ -29,6 +30,7 @@ router.get('/claude/status', async (req, res) => {
29
30
  res.status(500).json({
30
31
  authenticated: false,
31
32
  email: null,
33
+ method: null,
32
34
  error: error.message
33
35
  });
34
36
  }
@@ -115,6 +117,20 @@ router.get('/gemini/status', async (req, res) => {
115
117
  * - method: 'api_key' for env var, 'credentials_file' for OAuth tokens
116
118
  */
117
119
  async function checkClaudeCredentials() {
120
+ // Priority 1: Check for ANTHROPIC_API_KEY environment variable
121
+ // The SDK checks this first and uses it if present, even if OAuth tokens exist.
122
+ // When set, API calls are charged via pay-as-you-go rates instead of subscription.
123
+ if (process.env.ANTHROPIC_API_KEY && process.env.ANTHROPIC_API_KEY.trim()) {
124
+ return {
125
+ authenticated: true,
126
+ email: 'API Key Auth',
127
+ method: 'api_key'
128
+ };
129
+ }
130
+
131
+ // Priority 2: Check ~/.claude/.credentials.json for OAuth tokens
132
+ // This is the standard authentication method used by Claude CLI after running
133
+ // 'claude /login' or 'claude setup-token' commands.
118
134
  try {
119
135
  const credPath = path.join(os.homedir(), '.claude', '.credentials.json');
120
136
  const content = await fs.readFile(credPath, 'utf8');
@@ -127,19 +143,22 @@ async function checkClaudeCredentials() {
127
143
  if (!isExpired) {
128
144
  return {
129
145
  authenticated: true,
130
- email: creds.email || creds.user || null
146
+ email: creds.email || creds.user || null,
147
+ method: 'credentials_file'
131
148
  };
132
149
  }
133
150
  }
134
151
 
135
152
  return {
136
153
  authenticated: false,
137
- email: null
154
+ email: null,
155
+ method: null
138
156
  };
139
157
  } catch (error) {
140
158
  return {
141
159
  authenticated: false,
142
- email: null
160
+ email: null,
161
+ method: null
143
162
  };
144
163
  }
145
164
  }
@@ -5,6 +5,7 @@ import path from 'path';
5
5
  import os from 'os';
6
6
  import TOML from '@iarna/toml';
7
7
  import { getCodexSessions, getCodexSessionMessages, deleteCodexSession } from '../projects.js';
8
+ import { applyCustomSessionNames, sessionNamesDb } from '../database/db.js';
8
9
 
9
10
  const router = express.Router();
10
11
 
@@ -59,6 +60,7 @@ router.get('/sessions', async (req, res) => {
59
60
  }
60
61
 
61
62
  const sessions = await getCodexSessions(projectPath);
63
+ applyCustomSessionNames(sessions, 'codex');
62
64
  res.json({ success: true, sessions });
63
65
  } catch (error) {
64
66
  console.error('Error fetching Codex sessions:', error);
@@ -88,6 +90,7 @@ router.delete('/sessions/:sessionId', async (req, res) => {
88
90
  try {
89
91
  const { sessionId } = req.params;
90
92
  await deleteCodexSession(sessionId);
93
+ sessionNamesDb.deleteName(sessionId, 'codex');
91
94
  res.json({ success: true });
92
95
  } catch (error) {
93
96
  console.error(`Error deleting Codex session ${req.params.sessionId}:`, error);
@@ -7,6 +7,7 @@ import sqlite3 from 'sqlite3';
7
7
  import { open } from 'sqlite';
8
8
  import crypto from 'crypto';
9
9
  import { CURSOR_MODELS } from '../../shared/modelConstants.js';
10
+ import { applyCustomSessionNames } from '../database/db.js';
10
11
 
11
12
  const router = express.Router();
12
13
 
@@ -560,8 +561,10 @@ router.get('/sessions', async (req, res) => {
560
561
  return new Date(b.createdAt) - new Date(a.createdAt);
561
562
  });
562
563
 
563
- res.json({
564
- success: true,
564
+ applyCustomSessionNames(sessions, 'cursor');
565
+
566
+ res.json({
567
+ success: true,
565
568
  sessions: sessions,
566
569
  cwdId: cwdId,
567
570
  path: cursorChatsPath
@@ -1,5 +1,6 @@
1
1
  import express from 'express';
2
2
  import sessionManager from '../sessionManager.js';
3
+ import { sessionNamesDb } from '../database/db.js';
3
4
 
4
5
  const router = express.Router();
5
6
 
@@ -36,6 +37,7 @@ router.delete('/sessions/:sessionId', async (req, res) => {
36
37
  }
37
38
 
38
39
  await sessionManager.deleteSession(sessionId);
40
+ sessionNamesDb.deleteName(sessionId, 'gemini');
39
41
  res.json({ success: true });
40
42
  } catch (error) {
41
43
  console.error(`Error deleting Gemini session ${req.params.sessionId}:`, error);
@@ -28,6 +28,8 @@ export const CLAUDE_MODELS = {
28
28
  */
29
29
  export const CURSOR_MODELS = {
30
30
  OPTIONS: [
31
+ { value: 'opus-4.6-thinking', label: 'Claude 4.6 Opus (Thinking)' },
32
+ { value: 'gpt-5.3-codex', label: 'GPT-5.3' },
31
33
  { value: 'gpt-5.2-high', label: 'GPT-5.2 High' },
32
34
  { value: 'gemini-3-pro', label: 'Gemini 3 Pro' },
33
35
  { value: 'opus-4.5-thinking', label: 'Claude 4.5 Opus (Thinking)' },
@@ -47,7 +49,7 @@ export const CURSOR_MODELS = {
47
49
  { value: 'grok', label: 'Grok' }
48
50
  ],
49
51
 
50
- DEFAULT: 'gpt-5'
52
+ DEFAULT: 'gpt-5-3-codex'
51
53
  };
52
54
 
53
55
  /**
@@ -55,6 +57,8 @@ export const CURSOR_MODELS = {
55
57
  */
56
58
  export const CODEX_MODELS = {
57
59
  OPTIONS: [
60
+ { value: 'gpt-5.4', label: 'GPT-5.4' },
61
+ { value: 'gpt-5.3-codex', label: 'GPT-5.3 Codex' },
58
62
  { value: 'gpt-5.3-codex', label: 'GPT-5.3 Codex' },
59
63
  { value: 'gpt-5.2-codex', label: 'GPT-5.2 Codex' },
60
64
  { value: 'gpt-5.2', label: 'GPT-5.2' },
@@ -63,7 +67,7 @@ export const CODEX_MODELS = {
63
67
  { value: 'o4-mini', label: 'O4-mini' }
64
68
  ],
65
69
 
66
- DEFAULT: 'gpt-5.3-codex'
70
+ DEFAULT: 'gpt-5.4'
67
71
  };
68
72
 
69
73
  /**