@armadra/agent 0.6.0 → 0.6.2

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 (83) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/CHANGELOG.zh-CN.md +32 -0
  3. package/dist/agent/session-settings.d.ts +4 -1
  4. package/dist/agent/session-settings.js +7 -2
  5. package/dist/ai/apis/chatgpt-backend.d.ts +7 -2
  6. package/dist/ai/apis/chatgpt-backend.js +12 -4
  7. package/dist/ai/providers/discovered-cache.d.ts +59 -0
  8. package/dist/ai/providers/discovered-cache.js +146 -0
  9. package/dist/ai/providers/model-visibility.d.ts +33 -0
  10. package/dist/ai/providers/model-visibility.js +70 -0
  11. package/dist/ai/providers/registry.d.ts +2 -0
  12. package/dist/ai/providers/registry.js +13 -7
  13. package/dist/ai/types.d.ts +5 -0
  14. package/dist/auth/chatgpt/backend-client.d.ts +11 -2
  15. package/dist/auth/chatgpt/backend-client.js +38 -6
  16. package/dist/auth/chatgpt/cli.d.ts +4 -1
  17. package/dist/auth/chatgpt/cli.js +40 -6
  18. package/dist/auth/chatgpt/follow.d.ts +16 -0
  19. package/dist/auth/chatgpt/follow.js +51 -0
  20. package/dist/auth/chatgpt/presets.d.ts +8 -0
  21. package/dist/auth/chatgpt/presets.js +12 -0
  22. package/dist/auth/testing/fake-oauth.d.ts +4 -1
  23. package/dist/auth/testing/fake-oauth.js +24 -1
  24. package/dist/bundle/ama.cjs +1663 -799
  25. package/dist/cli/compose-providers.d.ts +2 -0
  26. package/dist/cli/compose-providers.js +9 -0
  27. package/dist/cli/startup-steps.js +4 -1
  28. package/dist/cli/subcommands/config-set.js +19 -11
  29. package/dist/cli/subcommands/models-discover.d.ts +4 -1
  30. package/dist/cli/subcommands/models-discover.js +51 -3
  31. package/dist/cli/subcommands/models-enable.d.ts +13 -0
  32. package/dist/cli/subcommands/models-enable.js +145 -0
  33. package/dist/cli/subcommands/models.d.ts +2 -0
  34. package/dist/cli/subcommands/models.js +10 -2
  35. package/dist/config/json-schema.js +2 -1
  36. package/dist/config/key-docs.js +7 -1
  37. package/dist/config/schema-w5.js +9 -2
  38. package/dist/config/schema-w6.d.ts +1 -1
  39. package/dist/config/schema-w6.js +2 -1
  40. package/dist/config/settings-registry.d.ts +3 -0
  41. package/dist/config/settings-registry.js +1 -0
  42. package/dist/config/types-w5.d.ts +7 -0
  43. package/dist/config/types-w5.js +2 -0
  44. package/dist/config/types-w6.d.ts +5 -0
  45. package/dist/i18n/catalog.d.ts +50 -3
  46. package/dist/i18n/messages/auth.d.ts +16 -2
  47. package/dist/i18n/messages/auth.js +34 -2
  48. package/dist/i18n/messages/cli-help.js +4 -0
  49. package/dist/i18n/messages/config-keys.d.ts +6 -0
  50. package/dist/i18n/messages/config-keys.js +8 -2
  51. package/dist/i18n/messages/config.d.ts +8 -0
  52. package/dist/i18n/messages/config.js +2 -0
  53. package/dist/i18n/messages/errors.d.ts +1 -1
  54. package/dist/i18n/messages/interactive-startup.d.ts +0 -4
  55. package/dist/i18n/messages/interactive-startup.js +0 -4
  56. package/dist/i18n/messages/interactive.d.ts +0 -4
  57. package/dist/i18n/messages/panels.d.ts +43 -0
  58. package/dist/i18n/messages/panels.js +43 -0
  59. package/dist/i18n/messages/settings.d.ts +7 -0
  60. package/dist/i18n/messages/settings.js +7 -0
  61. package/dist/i18n/messages/subcommands-config.d.ts +2 -0
  62. package/dist/i18n/messages/subcommands-config.js +2 -0
  63. package/dist/i18n/messages/subcommands-models.d.ts +34 -0
  64. package/dist/i18n/messages/subcommands-models.js +34 -0
  65. package/dist/i18n/messages/subcommands.d.ts +28 -0
  66. package/dist/i18n/messages/subcommands.js +3 -0
  67. package/dist/modes/interactive/commands.d.ts +3 -0
  68. package/dist/modes/interactive/commands.js +18 -11
  69. package/dist/modes/interactive/config-ui.js +1 -1
  70. package/dist/modes/interactive/interactive-mode.js +2 -0
  71. package/dist/modes/interactive/model-items.d.ts +45 -0
  72. package/dist/modes/interactive/model-items.js +134 -0
  73. package/dist/modes/interactive/model-picker.d.ts +57 -0
  74. package/dist/modes/interactive/model-picker.js +191 -0
  75. package/dist/modes/interactive/startup-ui.d.ts +3 -9
  76. package/dist/modes/interactive/startup-ui.js +8 -60
  77. package/dist/tui/components/select-list.d.ts +2 -0
  78. package/dist/tui/components/select-list.js +7 -0
  79. package/docs/en/providers.md +9 -3
  80. package/docs/en/tui.md +8 -1
  81. package/docs/providers.md +27 -6
  82. package/docs/tui.md +8 -1
  83. package/package.json +1 -1
@@ -392,6 +392,19 @@ declare const en: {
392
392
  noHits: (all: boolean) => "No matches\n" | "No matches (only sessions of this directory; --all searches all)\n";
393
393
  truncated: (limit: number) => string;
394
394
  };
395
+ modelsEnabled: {
396
+ badRef: (ref: string) => string;
397
+ unknownModel: (ref: string) => string;
398
+ added: (refs: string, path: string) => string;
399
+ alreadyListed: (refs: string) => string;
400
+ removed: (refs: string, path: string) => string;
401
+ notListed: (refs: string) => string;
402
+ cleared: (path: string) => string;
403
+ listHeader: (path: string) => string;
404
+ listUnset: string;
405
+ notInTable: string;
406
+ nothing: string;
407
+ };
395
408
  configShow: {
396
409
  usage: string;
397
410
  unknownAction: (action: string) => string;
@@ -441,6 +454,7 @@ declare const en: {
441
454
  probeHeader: (count: number, order: string, requests: number, extra: number, limit: number) => string;
442
455
  unavailable: string;
443
456
  probeStopped: (reason: string) => string;
457
+ cached: (path: string) => string;
444
458
  };
445
459
  };
446
460
  interactive: {
@@ -636,8 +650,6 @@ declare const en: {
636
650
  hintFilter: (arrows: string) => string;
637
651
  hintNumbers: (arrows: string, n: number) => string;
638
652
  hint: (arrows: string) => string;
639
- local: string;
640
- noKey: string;
641
653
  justNow: string;
642
654
  minutesAgo: (n: number) => string;
643
655
  hoursAgo: (n: number) => string;
@@ -917,6 +929,27 @@ declare const en: {
917
929
  thinkingUnsupported: string;
918
930
  emptyText: string;
919
931
  };
932
+ model: {
933
+ local: string;
934
+ key: string;
935
+ oauth: string;
936
+ needsLogin: string;
937
+ noKey: string;
938
+ current: string;
939
+ listed: string;
940
+ otherChannels: (names: string) => string;
941
+ discoverHint: (provider: string) => string;
942
+ loginHint: (provider: string) => string;
943
+ footerConfigured: string;
944
+ footerAll: string;
945
+ emptyConfigured: string;
946
+ added: (ref: string) => string;
947
+ addedFirst: (ref: string) => string;
948
+ removed: (ref: string) => string;
949
+ wildcard: (ref: string, pattern: string) => string;
950
+ noKeyHint: (provider: string) => string;
951
+ needsLoginHint: (provider: string) => string;
952
+ };
920
953
  plan: {
921
954
  title: string;
922
955
  titleVersion: (version: number) => string;
@@ -1311,6 +1344,7 @@ declare const en: {
1311
1344
  "auth.chatgpt.clientId": string;
1312
1345
  "auth.chatgpt.issuer": string;
1313
1346
  "auth.chatgpt.originator": string;
1347
+ "auth.chatgpt.codexClientVersion": string;
1314
1348
  "auth.chatgpt.redirectPorts": string;
1315
1349
  skills: string;
1316
1350
  "skills.dirs": string;
@@ -1351,6 +1385,7 @@ declare const en: {
1351
1385
  "models.aliases": string;
1352
1386
  "models.aliases.fast": string;
1353
1387
  "models.aliases.strong": string;
1388
+ "models.enabled": string;
1354
1389
  fallbackModel: string;
1355
1390
  limits: string;
1356
1391
  "limits.maxTurns": string;
@@ -1377,6 +1412,7 @@ declare const en: {
1377
1412
  "subagents.defaultModel": string;
1378
1413
  "models.aliases.fast": string;
1379
1414
  "models.aliases.strong": string;
1415
+ "models.enabled": string;
1380
1416
  fallbackModel: string;
1381
1417
  "limits.maxTurns": string;
1382
1418
  "limits.maxCostUsd": string;
@@ -1402,6 +1438,7 @@ declare const en: {
1402
1438
  stringArray: string;
1403
1439
  array: string;
1404
1440
  modelsDev: string;
1441
+ modelsEnabled: string;
1405
1442
  noChannels: string;
1406
1443
  unknownChannelOf: (name: string, available: readonly string[]) => string;
1407
1444
  modelInput: string;
@@ -1937,11 +1974,18 @@ declare const en: {
1937
1974
  siwcLimitHint: string;
1938
1975
  freePlanHint: (plan: string) => string;
1939
1976
  modelHint: string;
1977
+ modelsCached: (count: number) => string;
1978
+ siwcEligibilityHint: string;
1979
+ codexNoModels: (version: string) => string;
1980
+ };
1981
+ request: {
1982
+ notEligible: string;
1983
+ flavorMismatch: (current: string, ref: string, pinned: string) => string;
1940
1984
  };
1941
1985
  errors: {
1942
1986
  portsBusy: (ports: string, codex: boolean) => string;
1943
1987
  timeout: string;
1944
- denied: (error: string) => string;
1988
+ denied: (error: string, codexFallback: boolean) => string;
1945
1989
  stateMismatch: string;
1946
1990
  noCode: string;
1947
1991
  invalidToken: (reason: string) => string;
@@ -2116,6 +2160,8 @@ declare const en: {
2116
2160
  setDone: (key: string, value: string, scope: string) => string;
2117
2161
  unsetDone: (key: string, value: string, scope: string) => string;
2118
2162
  stillOverridden: (key: string, source: string) => string;
2163
+ writtenTo: (key: string, value: string, scope: string) => string;
2164
+ overriddenNow: (source: string, effective: string) => string;
2119
2165
  slashUsage: string;
2120
2166
  errors: {
2121
2167
  unknownKey: (key: string) => string;
@@ -2144,6 +2190,7 @@ declare const en: {
2144
2190
  agents: string;
2145
2191
  hooks: string;
2146
2192
  auth: string;
2193
+ modelsEnabled: string;
2147
2194
  };
2148
2195
  cli: {
2149
2196
  usage: string;
@@ -45,11 +45,18 @@ export declare const en: {
45
45
  siwcLimitHint: string;
46
46
  freePlanHint: (plan: string) => string;
47
47
  modelHint: string;
48
+ modelsCached: (count: number) => string;
49
+ siwcEligibilityHint: string;
50
+ codexNoModels: (version: string) => string;
51
+ };
52
+ request: {
53
+ notEligible: string;
54
+ flavorMismatch: (current: string, ref: string, pinned: string) => string;
48
55
  };
49
56
  errors: {
50
57
  portsBusy: (ports: string, codex: boolean) => string;
51
58
  timeout: string;
52
- denied: (error: string) => string;
59
+ denied: (error: string, codexFallback: boolean) => string;
53
60
  stateMismatch: string;
54
61
  noCode: string;
55
62
  invalidToken: (reason: string) => string;
@@ -135,11 +142,18 @@ export declare const zh: {
135
142
  siwcLimitHint: string;
136
143
  freePlanHint: (plan: string) => string;
137
144
  modelHint: string;
145
+ modelsCached: (count: number) => string;
146
+ siwcEligibilityHint: string;
147
+ codexNoModels: (version: string) => string;
148
+ };
149
+ request: {
150
+ notEligible: string;
151
+ flavorMismatch: (current: string, ref: string, pinned: string) => string;
138
152
  };
139
153
  errors: {
140
154
  portsBusy: (ports: string, codex: boolean) => string;
141
155
  timeout: string;
142
- denied: (error: string) => string;
156
+ denied: (error: string, codexFallback: boolean) => string;
143
157
  stateMismatch: string;
144
158
  noCode: string;
145
159
  invalidToken: (reason: string) => string;
@@ -46,11 +46,28 @@ export const en = {
46
46
  siwcLimitHint: "Tip: set a weekly limit for ama in ChatGPT → Settings → Usage → App limits. For personal use only; never share one sign-in between several people.",
47
47
  freePlanHint: (plan) => `Note: the "${plan}" plan may not include subscription usage for ama.`,
48
48
  modelHint: "Use it with --model chatgpt/<model>; list the models your account can use with ama models discover chatgpt.",
49
+ modelsCached: (count) => `Your account can use ${count} model(s); pick one with /model or --model chatgpt/<model>.`,
50
+ siwcEligibilityHint: "Whether this account can share its plan usage with ama is only confirmed on the first request.",
51
+ codexNoModels: (version) => `The codex backend returned no models. codexClientVersion (${version}) may be too old: set a newer Codex CLI version with ama config set auth.chatgpt.codexClientVersion <version>, then run ama models discover chatgpt.`,
52
+ },
53
+ request: {
54
+ notEligible: "this ChatGPT account cannot share plan usage with ama (403 subscription_sharing_user_not_eligible). Possible causes:\n" +
55
+ " 1. Plan: plan usage is shared with Plus / Pro only\n" +
56
+ " 2. Workspace account: Team / Enterprise / Edu workspaces may not offer it\n" +
57
+ " 3. Region restriction, or not yet rolled out during the preview (most likely when a Pro account still gets this error)\n" +
58
+ "You can sign in the other way instead: ama auth login chatgpt --flavor codex",
59
+ flavorMismatch: (current, ref, pinned) => `signed in with ${current}, but ${ref} pins the @${pinned} channel. Drop @${pinned} so the channel follows the sign-in, or run ama auth login chatgpt --flavor ${pinned}`,
49
60
  },
50
61
  errors: {
51
62
  portsBusy: (ports, codex) => `callback port ${ports} is in use: finish the other sign-in first, or use --paste${codex ? " / --device" : ""}`,
52
63
  timeout: "sign-in timed out; run the command again",
53
- denied: (error) => `sign-in was not authorized (${error})`,
64
+ denied: (error, codexFallback) => `sign-in was not authorized (${error}). Possible causes:\n` +
65
+ " 1. The authorization page was cancelled, or using your ChatGPT plan was not checked: run ama auth login chatgpt again and keep that option checked\n" +
66
+ " 2. The account or plan is not eligible: plan usage is shared with Plus / Pro only; Team / Enterprise workspaces may not offer it; the browser may be signed in to another account\n" +
67
+ " 3. Your region is not supported" +
68
+ (codexFallback
69
+ ? "\nYou can also try the fallback: ama auth login chatgpt --flavor codex"
70
+ : ""),
54
71
  stateMismatch: "the pasted URL does not belong to this sign-in (state mismatch); start again",
55
72
  noCode: "the pasted URL has no code; copy the whole address after the browser redirects",
56
73
  invalidToken: (reason) => `id_token failed verification (${reason}); sign-in rejected`,
@@ -137,11 +154,26 @@ export const zh = {
137
154
  siwcLimitHint: "提示:可在 ChatGPT → 设置 → Usage → App limits 给 ama 设周上限。仅限本人使用,不要让多人共用一个登录。",
138
155
  freePlanHint: (plan) => `注意:「${plan}」计划可能不含给 ama 用的订阅额度。`,
139
156
  modelHint: "用 --model chatgpt/<模型> 使用;账户可用的模型用 ama models discover chatgpt 查看。",
157
+ modelsCached: (count) => `账户可用 ${count} 个模型,用 /model 或 --model chatgpt/<模型> 选择。`,
158
+ siwcEligibilityHint: "这个账户能否把套餐额度共享给 ama,要到首次请求时才能确认。",
159
+ codexNoModels: (version) => `codex 后端没有返回模型,可能是 codexClientVersion(${version})过旧:用 ama config set auth.chatgpt.codexClientVersion <版本> 设为较新的 Codex CLI 版本,再运行 ama models discover chatgpt。`,
160
+ },
161
+ request: {
162
+ notEligible: "这个 ChatGPT 账户不能把套餐额度共享给 ama(403 subscription_sharing_user_not_eligible)。可能的原因:\n" +
163
+ " 1. 账户套餐:额度共享只对 Plus / Pro 开放\n" +
164
+ " 2. 工作空间账户:Team / Enterprise / Edu 工作空间可能未开放\n" +
165
+ " 3. 地区受限,或预览期尚未开放(Pro 账户仍报此错时最可能是这一条)\n" +
166
+ "可以改用另一种登录方式:ama auth login chatgpt --flavor codex",
167
+ flavorMismatch: (current, ref, pinned) => `当前以 ${current} 方式登录,但 ${ref} 显式指定了 @${pinned} 渠道。去掉 @${pinned} 让渠道跟随登录方式,或运行 ama auth login chatgpt --flavor ${pinned}`,
140
168
  },
141
169
  errors: {
142
170
  portsBusy: (ports, codex) => `回调端口 ${ports} 被占用:请先结束其它登录,或用 --paste${codex ? " / --device" : ""}`,
143
171
  timeout: "登录超时,请重新运行命令",
144
- denied: (error) => `授权未通过(${error})`,
172
+ denied: (error, codexFallback) => `授权未通过(${error})。可能的原因:\n` +
173
+ " 1. 在授权页取消了,或没有勾选使用 ChatGPT 套餐额度:重新运行 ama auth login chatgpt 并确认勾选\n" +
174
+ " 2. 账户或套餐不符合:额度共享只对 Plus / Pro 开放;Team / Enterprise 工作空间可能未开放;浏览器可能登录了别的账户\n" +
175
+ " 3. 所在地区受限" +
176
+ (codexFallback ? "\n也可以改用备用方式:ama auth login chatgpt --flavor codex" : ""),
145
177
  stateMismatch: "粘贴的 URL 不属于这次登录(state 不符),请重新开始",
146
178
  noCode: "粘贴的 URL 里没有 code;请在浏览器跳转后复制完整地址",
147
179
  invalidToken: (reason) => `id_token 校验失败(${reason}),已拒绝这次登录`,
@@ -91,6 +91,8 @@ Subcommands
91
91
  Timeline of turns, requests, tools and subagents (text / HTML / JSON)
92
92
  ama models list [--provider <id>] List models (with source and key status)
93
93
  ama models check <provider/id> Send one minimal request to check availability
94
+ ama models enable|disable <provider/model|provider/*>…
95
+ Edit the /model list (models.enabled); list --enabled shows it
94
96
  ama models discover <provider> [--probe] [--write] [--limit N]
95
97
  List models from a relay's /v1/models, probe protocols, write the config
96
98
  ama models refresh [--provider <id>] Refresh models.dev metadata into the data directory (startup stays
@@ -206,6 +208,8 @@ export const zh = {
206
208
  回合、请求、工具与子 Agent 的时间线(文本 / HTML / JSON)
207
209
  ama models list [--provider <id>] 列出模型(含来源与 key 状态)
208
210
  ama models check <provider/id> 发一次最小请求检查可用性
211
+ ama models enable|disable <provider/model|provider/*>…
212
+ 编辑 /model 的模型清单(models.enabled);list --enabled 查看
209
213
  ama models discover <provider> [--probe] [--write] [--limit N]
210
214
  从中转 /v1/models 列出模型,探测协议并写入配置
211
215
  ama models refresh [--provider <id>] 联网刷新 models.dev 元数据到数据目录(启动不联网;
@@ -71,6 +71,7 @@ export declare const en: {
71
71
  "auth.chatgpt.clientId": string;
72
72
  "auth.chatgpt.issuer": string;
73
73
  "auth.chatgpt.originator": string;
74
+ "auth.chatgpt.codexClientVersion": string;
74
75
  "auth.chatgpt.redirectPorts": string;
75
76
  skills: string;
76
77
  "skills.dirs": string;
@@ -111,6 +112,7 @@ export declare const en: {
111
112
  "models.aliases": string;
112
113
  "models.aliases.fast": string;
113
114
  "models.aliases.strong": string;
115
+ "models.enabled": string;
114
116
  fallbackModel: string;
115
117
  limits: string;
116
118
  "limits.maxTurns": string;
@@ -137,6 +139,7 @@ export declare const en: {
137
139
  "subagents.defaultModel": string;
138
140
  "models.aliases.fast": string;
139
141
  "models.aliases.strong": string;
142
+ "models.enabled": string;
140
143
  fallbackModel: string;
141
144
  "limits.maxTurns": string;
142
145
  "limits.maxCostUsd": string;
@@ -212,6 +215,7 @@ export declare const zh: {
212
215
  "auth.chatgpt.clientId": string;
213
216
  "auth.chatgpt.issuer": string;
214
217
  "auth.chatgpt.originator": string;
218
+ "auth.chatgpt.codexClientVersion": string;
215
219
  "auth.chatgpt.redirectPorts": string;
216
220
  skills: string;
217
221
  "skills.dirs": string;
@@ -252,6 +256,7 @@ export declare const zh: {
252
256
  "models.aliases": string;
253
257
  "models.aliases.fast": string;
254
258
  "models.aliases.strong": string;
259
+ "models.enabled": string;
255
260
  fallbackModel: string;
256
261
  limits: string;
257
262
  "limits.maxTurns": string;
@@ -278,6 +283,7 @@ export declare const zh: {
278
283
  "subagents.defaultModel": string;
279
284
  "models.aliases.fast": string;
280
285
  "models.aliases.strong": string;
286
+ "models.enabled": string;
281
287
  fallbackModel: string;
282
288
  "limits.maxTurns": string;
283
289
  "limits.maxCostUsd": string;
@@ -20,6 +20,7 @@ const dynamicDefaultsEn = {
20
20
  "subagents.defaultModel": "unset: inherit the parent session model",
21
21
  "models.aliases.fast": "unset: fast is treated as inherit",
22
22
  "models.aliases.strong": "unset: strong is treated as inherit",
23
+ "models.enabled": "unset: /model shows every model of configured providers",
23
24
  fallbackModel: "unset: no fallback",
24
25
  "limits.maxTurns": "unset: unlimited",
25
26
  "limits.maxCostUsd": "unset: unlimited",
@@ -42,6 +43,7 @@ const dynamicDefaultsZh = {
42
43
  "subagents.defaultModel": "不设:继承父会话模型",
43
44
  "models.aliases.fast": "不设:fast 按 inherit 处理",
44
45
  "models.aliases.strong": "不设:strong 按 inherit 处理",
46
+ "models.enabled": "不设:/model 显示已配置供应商的全部模型",
45
47
  fallbackModel: "不设:不回退",
46
48
  "limits.maxTurns": "不设:不限",
47
49
  "limits.maxCostUsd": "不设:不限",
@@ -116,6 +118,7 @@ const keysEn = {
116
118
  "auth.chatgpt.clientId": "OAuth client id",
117
119
  "auth.chatgpt.issuer": "Authorization server (override with AMA_CHATGPT_ISSUER for tests)",
118
120
  "auth.chatgpt.originator": "originator request header for the codex flavor",
121
+ "auth.chatgpt.codexClientVersion": "Codex CLI version sent as client_version when listing codex-flavor models (the backend hides models newer than it); AMA_CHATGPT_CODEX_CLIENT_VERSION overrides",
119
122
  "auth.chatgpt.redirectPorts": "Local callback ports, tried in order; 0 = any free port",
120
123
  skills: "Skills",
121
124
  "skills.dirs": "Extra skill directories; accumulated across levels",
@@ -152,10 +155,11 @@ const keysEn = {
152
155
  "subagents.maxConcurrent": "Sub-sessions running at the same time",
153
156
  "subagents.maxPending": "Queue limit; task fails beyond it",
154
157
  "subagents.defaultModel": "Default sub-session model provider/model[@channel]",
155
- models: "Model aliases; user level only (effective from wave 5 W5-G)",
158
+ models: "Model aliases and the model picker list; user level only (effective from wave 5 W5-G)",
156
159
  "models.aliases": "Models that model: fast / strong in sub-agent definitions point to",
157
160
  "models.aliases.fast": "Model for the fast alias provider/model[@channel]",
158
161
  "models.aliases.strong": "Model for the strong alias provider/model[@channel]",
162
+ "models.enabled": "Models shown by /model (provider/model[@channel], provider/* for a whole provider); unset: every model of providers with a key, a sign-in or a local server",
159
163
  fallbackModel: "Fallback model provider/model[@channel]: switch and retry once when retryable errors are exhausted or the model is overloaded; the next turn returns to the main model; user level only (effective from wave 5 W5-H2)",
160
164
  limits: "Session budget; the run ends when reached (-p exit code 8); --max-turns / --max-cost override; user level only (effective from wave 5 W5-H2)",
161
165
  "limits.maxTurns": "Maximum turns per run",
@@ -233,6 +237,7 @@ const keysZh = {
233
237
  "auth.chatgpt.clientId": "OAuth 客户端 id",
234
238
  "auth.chatgpt.issuer": "授权服务器(测试用 AMA_CHATGPT_ISSUER 覆盖)",
235
239
  "auth.chatgpt.originator": "codex flavor 的 originator 请求头",
240
+ "auth.chatgpt.codexClientVersion": "codex flavor 列模型时作为 client_version 发送的 Codex CLI 版本号(后端不给比它新的模型);AMA_CHATGPT_CODEX_CLIENT_VERSION 优先",
236
241
  "auth.chatgpt.redirectPorts": "本地回调端口,依次尝试;0 = 任意空闲端口",
237
242
  skills: "Skill",
238
243
  "skills.dirs": "追加的 Skill 目录;各层累加",
@@ -269,10 +274,11 @@ const keysZh = {
269
274
  "subagents.maxConcurrent": "同时运行的子会话数",
270
275
  "subagents.maxPending": "排队上限,超出时 task 报错",
271
276
  "subagents.defaultModel": "子会话缺省模型 provider/model[@channel]",
272
- models: "模型别名;只认用户级(第五波 W5-G 起生效)",
277
+ models: "模型别名与模型选择器清单;只认用户级(第五波 W5-G 起生效)",
273
278
  "models.aliases": "子 Agent 定义里 model: fast / strong 指向的模型",
274
279
  "models.aliases.fast": "fast 别名的模型 provider/model[@channel]",
275
280
  "models.aliases.strong": "strong 别名的模型 provider/model[@channel]",
281
+ "models.enabled": "/model 显示的模型(provider/model[@channel],provider/* 表示整个供应商);不设:已配置 key、已登录或本地可达的供应商的全部模型",
276
282
  fallbackModel: "回退模型 provider/model[@channel]:可重试错误用尽或过载时切换重试一次,下一回合回主模型;只认用户级(第五波 W5-H2 起生效)",
277
283
  limits: "会话预算,到限结束本次运行(-p 退出码 8);--max-turns / --max-cost 覆盖;只认用户级(第五波 W5-H2 起生效)",
278
284
  "limits.maxTurns": "一次运行最多回合数",
@@ -71,6 +71,7 @@ export declare const en: {
71
71
  "auth.chatgpt.clientId": string;
72
72
  "auth.chatgpt.issuer": string;
73
73
  "auth.chatgpt.originator": string;
74
+ "auth.chatgpt.codexClientVersion": string;
74
75
  "auth.chatgpt.redirectPorts": string;
75
76
  skills: string;
76
77
  "skills.dirs": string;
@@ -111,6 +112,7 @@ export declare const en: {
111
112
  "models.aliases": string;
112
113
  "models.aliases.fast": string;
113
114
  "models.aliases.strong": string;
115
+ "models.enabled": string;
114
116
  fallbackModel: string;
115
117
  limits: string;
116
118
  "limits.maxTurns": string;
@@ -137,6 +139,7 @@ export declare const en: {
137
139
  "subagents.defaultModel": string;
138
140
  "models.aliases.fast": string;
139
141
  "models.aliases.strong": string;
142
+ "models.enabled": string;
140
143
  fallbackModel: string;
141
144
  "limits.maxTurns": string;
142
145
  "limits.maxCostUsd": string;
@@ -163,6 +166,7 @@ export declare const en: {
163
166
  stringArray: string;
164
167
  array: string;
165
168
  modelsDev: string;
169
+ modelsEnabled: string;
166
170
  noChannels: string;
167
171
  unknownChannelOf: (name: string, available: readonly string[]) => string;
168
172
  modelInput: string;
@@ -323,6 +327,7 @@ export declare const zh: {
323
327
  "auth.chatgpt.clientId": string;
324
328
  "auth.chatgpt.issuer": string;
325
329
  "auth.chatgpt.originator": string;
330
+ "auth.chatgpt.codexClientVersion": string;
326
331
  "auth.chatgpt.redirectPorts": string;
327
332
  skills: string;
328
333
  "skills.dirs": string;
@@ -363,6 +368,7 @@ export declare const zh: {
363
368
  "models.aliases": string;
364
369
  "models.aliases.fast": string;
365
370
  "models.aliases.strong": string;
371
+ "models.enabled": string;
366
372
  fallbackModel: string;
367
373
  limits: string;
368
374
  "limits.maxTurns": string;
@@ -389,6 +395,7 @@ export declare const zh: {
389
395
  "subagents.defaultModel": string;
390
396
  "models.aliases.fast": string;
391
397
  "models.aliases.strong": string;
398
+ "models.enabled": string;
392
399
  fallbackModel: string;
393
400
  "limits.maxTurns": string;
394
401
  "limits.maxCostUsd": string;
@@ -414,6 +421,7 @@ export declare const zh: {
414
421
  stringArray: string;
415
422
  array: string;
416
423
  modelsDev: string;
424
+ modelsEnabled: string;
417
425
  noChannels: string;
418
426
  unknownChannelOf: (name: string, available: readonly string[]) => string;
419
427
  modelInput: string;
@@ -25,6 +25,7 @@ export const en = {
25
25
  stringArray: "should be an array of strings",
26
26
  array: "should be an array",
27
27
  modelsDev: `should be "provider/model" or false`,
28
+ modelsEnabled: `should be "provider/model[@channel]" or "provider/*"`,
28
29
  noChannels: "the provider has no channels",
29
30
  unknownChannelOf: (name, available) => `channel "${name}" does not exist (available: ${available.join(", ")})`,
30
31
  modelInput: `should be ("text" | "image")[]`,
@@ -144,6 +145,7 @@ export const zh = {
144
145
  stringArray: "应为字符串数组",
145
146
  array: "应为数组",
146
147
  modelsDev: `应为 "provider/model" 或 false`,
148
+ modelsEnabled: `应为 "provider/model[@channel]" 或 "provider/*"`,
147
149
  noChannels: "供应商没有 channels",
148
150
  unknownChannelOf: (name, available) => `渠道 "${name}" 不存在(可用:${available.join(", ")})`,
149
151
  modelInput: `应为 ("text" | "image")[]`,
@@ -75,7 +75,7 @@ export declare const zh: {
75
75
  refreshFailed: (reason: string) => string;
76
76
  notListed: (unknown: string, choices: string) => string;
77
77
  refreshStatus: (status: "failed" | "unchanged" | "updated", providers: number, models: number, at: string | undefined) => string;
78
- section: (kind: "removed" | "added" | "changed", count: number) => string;
78
+ section: (kind: "added" | "removed" | "changed", count: number) => string;
79
79
  more: (count: number) => string;
80
80
  changed: (ref: string, parts: readonly string[]) => string;
81
81
  };
@@ -30,8 +30,6 @@ export declare const en: {
30
30
  hintFilter: (arrows: string) => string;
31
31
  hintNumbers: (arrows: string, n: number) => string;
32
32
  hint: (arrows: string) => string;
33
- local: string;
34
- noKey: string;
35
33
  justNow: string;
36
34
  minutesAgo: (n: number) => string;
37
35
  hoursAgo: (n: number) => string;
@@ -78,8 +76,6 @@ export declare const zh: {
78
76
  hintFilter: (arrows: string) => string;
79
77
  hintNumbers: (arrows: string, n: number) => string;
80
78
  hint: (arrows: string) => string;
81
- local: string;
82
- noKey: string;
83
79
  justNow: string;
84
80
  minutesAgo: (n: number) => string;
85
81
  hoursAgo: (n: number) => string;
@@ -31,8 +31,6 @@ export const en = {
31
31
  hintFilter: (arrows) => `type to filter · ${arrows} select · Enter confirm · Esc cancel`,
32
32
  hintNumbers: (arrows, n) => `${arrows} select · Enter confirm · 1-${n} pick · Esc cancel`,
33
33
  hint: (arrows) => `${arrows} select · Enter confirm · Esc cancel`,
34
- local: "local",
35
- noKey: "no key",
36
34
  justNow: "just now",
37
35
  minutesAgo: (n) => `${n}m ago`,
38
36
  hoursAgo: (n) => `${n}h ago`,
@@ -79,8 +77,6 @@ export const zh = {
79
77
  hintFilter: (arrows) => `输入过滤 · ${arrows} 选择 · Enter 确认 · Esc 取消`,
80
78
  hintNumbers: (arrows, n) => `${arrows} 选择 · Enter 确认 · 1-${n} 直接选 · Esc 取消`,
81
79
  hint: (arrows) => `${arrows} 选择 · Enter 确认 · Esc 取消`,
82
- local: "本地",
83
- noKey: "无 key",
84
80
  justNow: "刚刚",
85
81
  minutesAgo: (n) => `${n} 分钟前`,
86
82
  hoursAgo: (n) => `${n} 小时前`,
@@ -206,8 +206,6 @@ export declare const en: {
206
206
  hintFilter: (arrows: string) => string;
207
207
  hintNumbers: (arrows: string, n: number) => string;
208
208
  hint: (arrows: string) => string;
209
- local: string;
210
- noKey: string;
211
209
  justNow: string;
212
210
  minutesAgo: (n: number) => string;
213
211
  hoursAgo: (n: number) => string;
@@ -445,8 +443,6 @@ export declare const zh: {
445
443
  hintFilter: (arrows: string) => string;
446
444
  hintNumbers: (arrows: string, n: number) => string;
447
445
  hint: (arrows: string) => string;
448
- local: string;
449
- noKey: string;
450
446
  justNow: string;
451
447
  minutesAgo: (n: number) => string;
452
448
  hoursAgo: (n: number) => string;
@@ -51,6 +51,28 @@ export declare const en: {
51
51
  thinkingUnsupported: string;
52
52
  emptyText: string;
53
53
  };
54
+ /** 模型选择器(`/model`、启动选择器、`/config` 的模型项)。 */
55
+ model: {
56
+ local: string;
57
+ key: string;
58
+ oauth: string;
59
+ needsLogin: string;
60
+ noKey: string;
61
+ current: string;
62
+ listed: string;
63
+ otherChannels: (names: string) => string;
64
+ discoverHint: (provider: string) => string;
65
+ loginHint: (provider: string) => string;
66
+ footerConfigured: string;
67
+ footerAll: string;
68
+ emptyConfigured: string;
69
+ added: (ref: string) => string;
70
+ addedFirst: (ref: string) => string;
71
+ removed: (ref: string) => string;
72
+ wildcard: (ref: string, pattern: string) => string;
73
+ noKeyHint: (provider: string) => string;
74
+ needsLoginHint: (provider: string) => string;
75
+ };
54
76
  plan: {
55
77
  title: string;
56
78
  titleVersion: (version: number) => string;
@@ -140,6 +162,27 @@ export declare const zh: {
140
162
  thinkingUnsupported: string;
141
163
  emptyText: string;
142
164
  };
165
+ model: {
166
+ local: string;
167
+ key: string;
168
+ oauth: string;
169
+ needsLogin: string;
170
+ noKey: string;
171
+ current: string;
172
+ listed: string;
173
+ otherChannels: (names: string) => string;
174
+ discoverHint: (provider: string) => string;
175
+ loginHint: (provider: string) => string;
176
+ footerConfigured: string;
177
+ footerAll: string;
178
+ emptyConfigured: string;
179
+ added: (ref: string) => string;
180
+ addedFirst: (ref: string) => string;
181
+ removed: (ref: string) => string;
182
+ wildcard: (ref: string, pattern: string) => string;
183
+ noKeyHint: (provider: string) => string;
184
+ needsLoginHint: (provider: string) => string;
185
+ };
143
186
  plan: {
144
187
  title: string;
145
188
  titleVersion: (version: number) => string;
@@ -51,6 +51,28 @@ export const en = {
51
51
  thinkingUnsupported: "The current model does not support thinking",
52
52
  emptyText: "(empty)",
53
53
  },
54
+ /** 模型选择器(`/model`、启动选择器、`/config` 的模型项)。 */
55
+ model: {
56
+ local: "local",
57
+ key: "key ✓",
58
+ oauth: "signed in ✓",
59
+ needsLogin: "sign in again",
60
+ noKey: "no key configured",
61
+ current: "current",
62
+ listed: "listed",
63
+ otherChannels: (names) => `also ${names}`,
64
+ discoverHint: (provider) => `Run ama models discover ${provider} to list its models`,
65
+ loginHint: (provider) => `Run ama auth login ${provider} to sign in`,
66
+ footerConfigured: "Tab all · Space list · @ channels · Enter switch · Esc cancel",
67
+ footerAll: "Tab configured · Space list · @ channels · Enter switch · Esc cancel",
68
+ emptyConfigured: "(no configured models; Tab shows all)",
69
+ added: (ref) => `Added ${ref} to models.enabled`,
70
+ addedFirst: (ref) => `Added ${ref} to models.enabled; /model now shows only listed models (Tab shows all)`,
71
+ removed: (ref) => `Removed ${ref} from models.enabled`,
72
+ wildcard: (ref, pattern) => `${ref} is listed through ${pattern}; remove it with ama models disable ${pattern}`,
73
+ noKeyHint: (provider) => `${provider} has no key: run ama auth set ${provider} (custom providers: ama providers add)`,
74
+ needsLoginHint: (provider) => `${provider} needs a new sign-in: run ama auth login ${provider}`,
75
+ },
54
76
  plan: {
55
77
  title: "Plan",
56
78
  titleVersion: (version) => `Plan v${version}`,
@@ -140,6 +162,27 @@ export const zh = {
140
162
  thinkingUnsupported: "当前模型不支持思考",
141
163
  emptyText: "(空)",
142
164
  },
165
+ model: {
166
+ local: "本地",
167
+ key: "key ✓",
168
+ oauth: "已登录 ✓",
169
+ needsLogin: "需重新登录",
170
+ noKey: "未配置 key",
171
+ current: "当前",
172
+ listed: "清单内",
173
+ otherChannels: (names) => `另有 ${names}`,
174
+ discoverHint: (provider) => `运行 ama models discover ${provider} 获取模型`,
175
+ loginHint: (provider) => `运行 ama auth login ${provider} 登录`,
176
+ footerConfigured: "Tab 全部 · Space 清单 · @ 渠道 · Enter 切换 · Esc 取消",
177
+ footerAll: "Tab 已配置 · Space 清单 · @ 渠道 · Enter 切换 · Esc 取消",
178
+ emptyConfigured: "(没有已配置的模型,Tab 看全部)",
179
+ added: (ref) => `已把 ${ref} 加入 models.enabled`,
180
+ addedFirst: (ref) => `已把 ${ref} 加入 models.enabled;/model 之后只显示清单内的模型(Tab 看全部)`,
181
+ removed: (ref) => `已把 ${ref} 移出 models.enabled`,
182
+ wildcard: (ref, pattern) => `${ref} 经 ${pattern} 列入清单;用 ama models disable ${pattern} 移除`,
183
+ noKeyHint: (provider) => `${provider} 未配置 key:运行 ama auth set ${provider}(自定义供应商用 ama providers add)`,
184
+ needsLoginHint: (provider) => `${provider} 需要重新登录:运行 ama auth login ${provider}`,
185
+ },
143
186
  plan: {
144
187
  title: "计划",
145
188
  titleVersion: (version) => `计划 v${version}`,
@@ -135,6 +135,9 @@ export declare const en: {
135
135
  setDone: (key: string, value: string, scope: string) => string;
136
136
  unsetDone: (key: string, value: string, scope: string) => string;
137
137
  stillOverridden: (key: string, source: string) => string;
138
+ /** `ama config set` when a higher layer hides the write: first line = what was written. */
139
+ writtenTo: (key: string, value: string, scope: string) => string;
140
+ overriddenNow: (source: string, effective: string) => string;
138
141
  slashUsage: string;
139
142
  errors: {
140
143
  unknownKey: (key: string) => string;
@@ -163,6 +166,7 @@ export declare const en: {
163
166
  agents: string;
164
167
  hooks: string;
165
168
  auth: string;
169
+ modelsEnabled: string;
166
170
  };
167
171
  cli: {
168
172
  usage: string;
@@ -305,6 +309,8 @@ export declare const zh: {
305
309
  setDone: (key: string, value: string, scope: string) => string;
306
310
  unsetDone: (key: string, value: string, scope: string) => string;
307
311
  stillOverridden: (key: string, source: string) => string;
312
+ writtenTo: (key: string, value: string, scope: string) => string;
313
+ overriddenNow: (source: string, effective: string) => string;
308
314
  slashUsage: string;
309
315
  errors: {
310
316
  unknownKey: (key: string) => string;
@@ -333,6 +339,7 @@ export declare const zh: {
333
339
  agents: string;
334
340
  hooks: string;
335
341
  auth: string;
342
+ modelsEnabled: string;
336
343
  };
337
344
  cli: {
338
345
  usage: string;