@0xmaxma/claude-gateway 1.2.23 → 1.2.31

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.
@@ -975,16 +975,25 @@ bot.command('models', async ctx => {
975
975
  if (!CALLBACK_URL_BASE) return
976
976
 
977
977
  try {
978
- const res = await fetch(CALLBACK_URL_BASE + '/command', {
979
- method: 'POST',
980
- headers: { 'Content-Type': 'application/json' },
981
- body: JSON.stringify({ command: 'get_model', chat_id: String(ctx.chat.id) }),
982
- })
983
- const data = (await res.json()) as { model?: string }
984
- const currentModel = data.model ?? ''
978
+ const [modelRes, modelsRes] = await Promise.all([
979
+ fetch(CALLBACK_URL_BASE + '/command', {
980
+ method: 'POST',
981
+ headers: { 'Content-Type': 'application/json' },
982
+ body: JSON.stringify({ command: 'get_model', chat_id: String(ctx.chat.id) }),
983
+ }),
984
+ fetch(CALLBACK_URL_BASE + '/command', {
985
+ method: 'POST',
986
+ headers: { 'Content-Type': 'application/json' },
987
+ body: JSON.stringify({ command: 'get_models' }),
988
+ }),
989
+ ])
990
+ const modelData = (await modelRes.json()) as { model?: string }
991
+ const modelsData = (await modelsRes.json()) as { models?: { id: string; label: string }[] }
992
+ const currentModel = modelData.model ?? ''
993
+ const availableModels = modelsData.models ?? AVAILABLE_MODELS
985
994
 
986
995
  const keyboard = new InlineKeyboard()
987
- for (const m of AVAILABLE_MODELS) {
996
+ for (const m of availableModels) {
988
997
  const prefix = m.id === currentModel ? '\u2705 ' : ''
989
998
  keyboard.text(`${prefix}${m.label}`, `model:${m.id}`).row()
990
999
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmaxma/claude-gateway",
3
- "version": "1.2.23",
3
+ "version": "1.2.31",
4
4
  "description": "Multi-agent gateway for Claude",
5
5
  "repository": {
6
6
  "type": "git",