@vibeapi/cli 0.0.160 → 0.0.162

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.
@@ -386,7 +386,6 @@
386
386
  "low",
387
387
  "medium",
388
388
  "high",
389
- "xhigh",
390
389
  "max"
391
390
  ]
392
391
  },
@@ -425,7 +424,6 @@
425
424
  "low",
426
425
  "medium",
427
426
  "high",
428
- "xhigh",
429
427
  "max"
430
428
  ]
431
429
  },
@@ -495,7 +493,6 @@
495
493
  "outputModalities": [
496
494
  "text"
497
495
  ],
498
- "knowledgeCutoff": "2025-05-31",
499
496
  "reasoningEfforts": [
500
497
  "none",
501
498
  "low",
@@ -523,7 +520,7 @@
523
520
  "reasoning": true,
524
521
  "imageOutput": false,
525
522
  "video": false,
526
- "structuredOutput": false,
523
+ "structuredOutput": true,
527
524
  "contextWindowTokens": 1000000,
528
525
  "maxOutput": 384000,
529
526
  "inputModalities": [
@@ -533,8 +530,8 @@
533
530
  "outputModalities": [
534
531
  "text"
535
532
  ],
536
- "knowledgeCutoff": "2025-05-31",
537
533
  "reasoningEfforts": [
534
+ "none",
538
535
  "low",
539
536
  "high",
540
537
  "max"
@@ -570,7 +567,6 @@
570
567
  "outputModalities": [
571
568
  "text"
572
569
  ],
573
- "knowledgeCutoff": "2025-05-31",
574
570
  "reasoningEfforts": [
575
571
  "low",
576
572
  "high",
@@ -679,7 +675,9 @@
679
675
  "text"
680
676
  ],
681
677
  "reasoningEfforts": [
682
- "high"
678
+ "none",
679
+ "high",
680
+ "max"
683
681
  ]
684
682
  },
685
683
  "endpoint_types": [
@@ -749,6 +747,11 @@
749
747
  ],
750
748
  "outputModalities": [
751
749
  "text"
750
+ ],
751
+ "reasoningEfforts": [
752
+ "low",
753
+ "high",
754
+ "max"
752
755
  ]
753
756
  },
754
757
  "endpoint_types": [
@@ -784,7 +787,9 @@
784
787
  ],
785
788
  "reasoningEfforts": [
786
789
  "none",
787
- "high"
790
+ "low",
791
+ "medium",
792
+ "xhigh"
788
793
  ]
789
794
  },
790
795
  "endpoint_types": [
@@ -817,6 +822,12 @@
817
822
  ],
818
823
  "outputModalities": [
819
824
  "text"
825
+ ],
826
+ "reasoningEfforts": [
827
+ "none",
828
+ "low",
829
+ "medium",
830
+ "xhigh"
820
831
  ]
821
832
  },
822
833
  "endpoint_types": [
@@ -845,9 +856,6 @@
845
856
  ],
846
857
  "outputModalities": [
847
858
  "text"
848
- ],
849
- "reasoningEfforts": [
850
- "high"
851
859
  ]
852
860
  },
853
861
  "endpoint_types": [
@@ -880,8 +888,7 @@
880
888
  ],
881
889
  "outputModalities": [
882
890
  "text"
883
- ],
884
- "knowledgeCutoff": "2025-04-30"
891
+ ]
885
892
  },
886
893
  "endpoint_types": [
887
894
  "anthropic",
@@ -904,7 +911,7 @@
904
911
  "imageOutput": false,
905
912
  "video": true,
906
913
  "contextWindowTokens": 1000000,
907
- "maxOutput": 512000,
914
+ "maxOutput": 524288,
908
915
  "inputModalities": [
909
916
  "text",
910
917
  "image",
@@ -912,11 +919,6 @@
912
919
  ],
913
920
  "outputModalities": [
914
921
  "text"
915
- ],
916
- "knowledgeCutoff": "2026-01-31",
917
- "reasoningEfforts": [
918
- "low",
919
- "high"
920
922
  ]
921
923
  },
922
924
  "endpoint_types": [
@@ -965,9 +967,6 @@
965
967
  "xhigh",
966
968
  "max"
967
969
  ],
968
- "functionCallEndpoints": [
969
- "openai-response"
970
- ],
971
970
  "settings": {
972
971
  "disabledParams": [
973
972
  "temperature",
@@ -1026,9 +1025,6 @@
1026
1025
  "max"
1027
1026
  ],
1028
1027
  "defaultReasoningEffort": "medium",
1029
- "functionCallEndpoints": [
1030
- "openai-response"
1031
- ],
1032
1028
  "settings": {
1033
1029
  "disabledParams": [
1034
1030
  "temperature",
@@ -1331,7 +1327,6 @@
1331
1327
  "outputModalities": [
1332
1328
  "text"
1333
1329
  ],
1334
- "knowledgeCutoff": "2025-05-31",
1335
1330
  "reasoningEfforts": [
1336
1331
  "none",
1337
1332
  "low",
@@ -1359,7 +1354,7 @@
1359
1354
  "reasoning": true,
1360
1355
  "imageOutput": false,
1361
1356
  "video": false,
1362
- "structuredOutput": false,
1357
+ "structuredOutput": true,
1363
1358
  "contextWindowTokens": 1000000,
1364
1359
  "maxOutput": 384000,
1365
1360
  "inputModalities": [
@@ -1369,8 +1364,8 @@
1369
1364
  "outputModalities": [
1370
1365
  "text"
1371
1366
  ],
1372
- "knowledgeCutoff": "2025-05-31",
1373
1367
  "reasoningEfforts": [
1368
+ "none",
1374
1369
  "low",
1375
1370
  "high",
1376
1371
  "max"
@@ -1406,7 +1401,6 @@
1406
1401
  "outputModalities": [
1407
1402
  "text"
1408
1403
  ],
1409
- "knowledgeCutoff": "2025-05-31",
1410
1404
  "reasoningEfforts": [
1411
1405
  "low",
1412
1406
  "high",
@@ -1515,7 +1509,9 @@
1515
1509
  "text"
1516
1510
  ],
1517
1511
  "reasoningEfforts": [
1518
- "high"
1512
+ "none",
1513
+ "high",
1514
+ "max"
1519
1515
  ]
1520
1516
  },
1521
1517
  "endpoint_types": [
@@ -1585,6 +1581,11 @@
1585
1581
  ],
1586
1582
  "outputModalities": [
1587
1583
  "text"
1584
+ ],
1585
+ "reasoningEfforts": [
1586
+ "low",
1587
+ "high",
1588
+ "max"
1588
1589
  ]
1589
1590
  },
1590
1591
  "endpoint_types": [
@@ -1620,7 +1621,9 @@
1620
1621
  ],
1621
1622
  "reasoningEfforts": [
1622
1623
  "none",
1623
- "high"
1624
+ "low",
1625
+ "medium",
1626
+ "xhigh"
1624
1627
  ]
1625
1628
  },
1626
1629
  "endpoint_types": [
@@ -1653,6 +1656,12 @@
1653
1656
  ],
1654
1657
  "outputModalities": [
1655
1658
  "text"
1659
+ ],
1660
+ "reasoningEfforts": [
1661
+ "none",
1662
+ "low",
1663
+ "medium",
1664
+ "xhigh"
1656
1665
  ]
1657
1666
  },
1658
1667
  "endpoint_types": [
@@ -1681,9 +1690,6 @@
1681
1690
  ],
1682
1691
  "outputModalities": [
1683
1692
  "text"
1684
- ],
1685
- "reasoningEfforts": [
1686
- "high"
1687
1693
  ]
1688
1694
  },
1689
1695
  "endpoint_types": [
@@ -1716,8 +1722,7 @@
1716
1722
  ],
1717
1723
  "outputModalities": [
1718
1724
  "text"
1719
- ],
1720
- "knowledgeCutoff": "2025-04-30"
1725
+ ]
1721
1726
  },
1722
1727
  "endpoint_types": [
1723
1728
  "anthropic",
@@ -1740,7 +1745,7 @@
1740
1745
  "imageOutput": false,
1741
1746
  "video": true,
1742
1747
  "contextWindowTokens": 1000000,
1743
- "maxOutput": 512000,
1748
+ "maxOutput": 524288,
1744
1749
  "inputModalities": [
1745
1750
  "text",
1746
1751
  "image",
@@ -1748,11 +1753,6 @@
1748
1753
  ],
1749
1754
  "outputModalities": [
1750
1755
  "text"
1751
- ],
1752
- "knowledgeCutoff": "2026-01-31",
1753
- "reasoningEfforts": [
1754
- "low",
1755
- "high"
1756
1756
  ]
1757
1757
  },
1758
1758
  "endpoint_types": [
@@ -1817,7 +1817,7 @@
1817
1817
  "video": true,
1818
1818
  "structuredOutput": true,
1819
1819
  "contextWindowTokens": 1048576,
1820
- "maxOutput": 32768,
1820
+ "maxOutput": 65536,
1821
1821
  "inputModalities": [
1822
1822
  "text",
1823
1823
  "image",
@@ -386,7 +386,6 @@
386
386
  "low",
387
387
  "medium",
388
388
  "high",
389
- "xhigh",
390
389
  "max"
391
390
  ]
392
391
  },
@@ -425,7 +424,6 @@
425
424
  "low",
426
425
  "medium",
427
426
  "high",
428
- "xhigh",
429
427
  "max"
430
428
  ]
431
429
  },
@@ -495,7 +493,6 @@
495
493
  "outputModalities": [
496
494
  "text"
497
495
  ],
498
- "knowledgeCutoff": "2025-05-31",
499
496
  "reasoningEfforts": [
500
497
  "none",
501
498
  "low",
@@ -523,7 +520,7 @@
523
520
  "reasoning": true,
524
521
  "imageOutput": false,
525
522
  "video": false,
526
- "structuredOutput": false,
523
+ "structuredOutput": true,
527
524
  "contextWindowTokens": 1000000,
528
525
  "maxOutput": 384000,
529
526
  "inputModalities": [
@@ -533,8 +530,8 @@
533
530
  "outputModalities": [
534
531
  "text"
535
532
  ],
536
- "knowledgeCutoff": "2025-05-31",
537
533
  "reasoningEfforts": [
534
+ "none",
538
535
  "low",
539
536
  "high",
540
537
  "max"
@@ -570,7 +567,6 @@
570
567
  "outputModalities": [
571
568
  "text"
572
569
  ],
573
- "knowledgeCutoff": "2025-05-31",
574
570
  "reasoningEfforts": [
575
571
  "low",
576
572
  "high",
@@ -679,7 +675,9 @@
679
675
  "text"
680
676
  ],
681
677
  "reasoningEfforts": [
682
- "high"
678
+ "none",
679
+ "high",
680
+ "max"
683
681
  ]
684
682
  },
685
683
  "endpoint_types": [
@@ -749,6 +747,11 @@
749
747
  ],
750
748
  "outputModalities": [
751
749
  "text"
750
+ ],
751
+ "reasoningEfforts": [
752
+ "low",
753
+ "high",
754
+ "max"
752
755
  ]
753
756
  },
754
757
  "endpoint_types": [
@@ -784,7 +787,9 @@
784
787
  ],
785
788
  "reasoningEfforts": [
786
789
  "none",
787
- "high"
790
+ "low",
791
+ "medium",
792
+ "xhigh"
788
793
  ]
789
794
  },
790
795
  "endpoint_types": [
@@ -817,6 +822,12 @@
817
822
  ],
818
823
  "outputModalities": [
819
824
  "text"
825
+ ],
826
+ "reasoningEfforts": [
827
+ "none",
828
+ "low",
829
+ "medium",
830
+ "xhigh"
820
831
  ]
821
832
  },
822
833
  "endpoint_types": [
@@ -845,9 +856,6 @@
845
856
  ],
846
857
  "outputModalities": [
847
858
  "text"
848
- ],
849
- "reasoningEfforts": [
850
- "high"
851
859
  ]
852
860
  },
853
861
  "endpoint_types": [
@@ -880,8 +888,7 @@
880
888
  ],
881
889
  "outputModalities": [
882
890
  "text"
883
- ],
884
- "knowledgeCutoff": "2025-04-30"
891
+ ]
885
892
  },
886
893
  "endpoint_types": [
887
894
  "anthropic",
@@ -904,7 +911,7 @@
904
911
  "imageOutput": false,
905
912
  "video": true,
906
913
  "contextWindowTokens": 1000000,
907
- "maxOutput": 512000,
914
+ "maxOutput": 524288,
908
915
  "inputModalities": [
909
916
  "text",
910
917
  "image",
@@ -912,11 +919,6 @@
912
919
  ],
913
920
  "outputModalities": [
914
921
  "text"
915
- ],
916
- "knowledgeCutoff": "2026-01-31",
917
- "reasoningEfforts": [
918
- "low",
919
- "high"
920
922
  ]
921
923
  },
922
924
  "endpoint_types": [
@@ -965,9 +967,6 @@
965
967
  "xhigh",
966
968
  "max"
967
969
  ],
968
- "functionCallEndpoints": [
969
- "openai-response"
970
- ],
971
970
  "settings": {
972
971
  "disabledParams": [
973
972
  "temperature",
@@ -1026,9 +1025,6 @@
1026
1025
  "max"
1027
1026
  ],
1028
1027
  "defaultReasoningEffort": "medium",
1029
- "functionCallEndpoints": [
1030
- "openai-response"
1031
- ],
1032
1028
  "settings": {
1033
1029
  "disabledParams": [
1034
1030
  "temperature",
@@ -1331,7 +1327,6 @@
1331
1327
  "outputModalities": [
1332
1328
  "text"
1333
1329
  ],
1334
- "knowledgeCutoff": "2025-05-31",
1335
1330
  "reasoningEfforts": [
1336
1331
  "none",
1337
1332
  "low",
@@ -1359,7 +1354,7 @@
1359
1354
  "reasoning": true,
1360
1355
  "imageOutput": false,
1361
1356
  "video": false,
1362
- "structuredOutput": false,
1357
+ "structuredOutput": true,
1363
1358
  "contextWindowTokens": 1000000,
1364
1359
  "maxOutput": 384000,
1365
1360
  "inputModalities": [
@@ -1369,8 +1364,8 @@
1369
1364
  "outputModalities": [
1370
1365
  "text"
1371
1366
  ],
1372
- "knowledgeCutoff": "2025-05-31",
1373
1367
  "reasoningEfforts": [
1368
+ "none",
1374
1369
  "low",
1375
1370
  "high",
1376
1371
  "max"
@@ -1406,7 +1401,6 @@
1406
1401
  "outputModalities": [
1407
1402
  "text"
1408
1403
  ],
1409
- "knowledgeCutoff": "2025-05-31",
1410
1404
  "reasoningEfforts": [
1411
1405
  "low",
1412
1406
  "high",
@@ -1515,7 +1509,9 @@
1515
1509
  "text"
1516
1510
  ],
1517
1511
  "reasoningEfforts": [
1518
- "high"
1512
+ "none",
1513
+ "high",
1514
+ "max"
1519
1515
  ]
1520
1516
  },
1521
1517
  "endpoint_types": [
@@ -1585,6 +1581,11 @@
1585
1581
  ],
1586
1582
  "outputModalities": [
1587
1583
  "text"
1584
+ ],
1585
+ "reasoningEfforts": [
1586
+ "low",
1587
+ "high",
1588
+ "max"
1588
1589
  ]
1589
1590
  },
1590
1591
  "endpoint_types": [
@@ -1620,7 +1621,9 @@
1620
1621
  ],
1621
1622
  "reasoningEfforts": [
1622
1623
  "none",
1623
- "high"
1624
+ "low",
1625
+ "medium",
1626
+ "xhigh"
1624
1627
  ]
1625
1628
  },
1626
1629
  "endpoint_types": [
@@ -1653,6 +1656,12 @@
1653
1656
  ],
1654
1657
  "outputModalities": [
1655
1658
  "text"
1659
+ ],
1660
+ "reasoningEfforts": [
1661
+ "none",
1662
+ "low",
1663
+ "medium",
1664
+ "xhigh"
1656
1665
  ]
1657
1666
  },
1658
1667
  "endpoint_types": [
@@ -1681,9 +1690,6 @@
1681
1690
  ],
1682
1691
  "outputModalities": [
1683
1692
  "text"
1684
- ],
1685
- "reasoningEfforts": [
1686
- "high"
1687
1693
  ]
1688
1694
  },
1689
1695
  "endpoint_types": [
@@ -1716,8 +1722,7 @@
1716
1722
  ],
1717
1723
  "outputModalities": [
1718
1724
  "text"
1719
- ],
1720
- "knowledgeCutoff": "2025-04-30"
1725
+ ]
1721
1726
  },
1722
1727
  "endpoint_types": [
1723
1728
  "anthropic",
@@ -1740,7 +1745,7 @@
1740
1745
  "imageOutput": false,
1741
1746
  "video": true,
1742
1747
  "contextWindowTokens": 1000000,
1743
- "maxOutput": 512000,
1748
+ "maxOutput": 524288,
1744
1749
  "inputModalities": [
1745
1750
  "text",
1746
1751
  "image",
@@ -1748,11 +1753,6 @@
1748
1753
  ],
1749
1754
  "outputModalities": [
1750
1755
  "text"
1751
- ],
1752
- "knowledgeCutoff": "2026-01-31",
1753
- "reasoningEfforts": [
1754
- "low",
1755
- "high"
1756
1756
  ]
1757
1757
  },
1758
1758
  "endpoint_types": [
@@ -1817,7 +1817,7 @@
1817
1817
  "video": true,
1818
1818
  "structuredOutput": true,
1819
1819
  "contextWindowTokens": 1048576,
1820
- "maxOutput": 32768,
1820
+ "maxOutput": 65536,
1821
1821
  "inputModalities": [
1822
1822
  "text",
1823
1823
  "image",
@@ -87,6 +87,8 @@ export interface ModelRegistryData {
87
87
  defaultToolModel?: string;
88
88
  /** Per-tool default model. Empty string (e.g. claude-code) means "use the tool's built-in default". */
89
89
  toolDefaults?: Record<string, string>;
90
+ /** Models a tool's short menu lists on top of its usual picks (tool id → model ids). */
91
+ toolMenuModels?: Record<string, string[]>;
90
92
  presets: ModelPreset[];
91
93
  claudeCode?: Partial<ClaudeCodeRules>;
92
94
  claudeDesktop?: Partial<ClaudeDesktopRules>;
@@ -120,6 +122,7 @@ export declare function getDefaultToolModel(): string;
120
122
  * tool's own built-in default"), otherwise the global default tool model.
121
123
  */
122
124
  export declare function getToolDefaultModel(toolName: string): string;
125
+ export declare function getToolMenuModels(toolName: string): string[];
123
126
  export declare function getPresets(): ModelPreset[];
124
127
  export declare function resolvePreset(preset: ModelPreset): Models;
125
128
  export declare function getClaudeCodeTierChains(): Record<string, string[]>;
@@ -1 +1 @@
1
- import{dirname as e,join as t}from"path";import{fileURLToPath as o}from"url";import{existsSync as l,readFileSync as n}from"fs";import{currentClientConfig as r,usableClientSection as s}from"./client-config.js";import{brand as a}from"./brand.js";const i=e(o(import.meta.url)),d=(e=[],t=[])=>[...new Set([...e,...t])];export function overlayClientSection(e,t){if(!t)return e;const o={...e.retiredDefaultModels??{}};for(const[e,l]of Object.entries(t.retiredDefaultModels??{}))o[e]=d(o[e],l);return{...e,defaultModels:{...e.defaultModels,...t.defaultModels??{}},retiredDefaultModels:o,toolDefaults:{...e.toolDefaults??{},...t.toolDefaults??{}},claudeCode:t.tierChains?{...e.claudeCode??{},tierChains:{...e.claudeCode?.tierChains??{},...t.tierChains}}:e.claudeCode,claudeDesktop:t.oneMillionFallback?{...e.claudeDesktop??{},oneMillionFallback:[...t.oneMillionFallback]}:e.claudeDesktop,gatewayModels:t.retiredModels?{...e.gatewayModels??{},retired:d(e.gatewayModels?.retired,t.retiredModels)}:e.gatewayModels,toolMinVersions:{...e.toolMinVersions??{},...t.toolMinVersions??{}},agy:t.agyModels?{...e.agy??{},gatewayModels:[...t.agyModels]}:e.agy}}let u=null;function c(){return u||(u=overlayClientSection(function(){const e=[t(i,"..","..","models.json"),t(i,"..","models.json"),t(i,"models.json")];for(const t of e)if(l(t))return JSON.parse(n(t,"utf-8"));throw new Error(`models.json not found, searched: ${e.join(", ")}`)}(),s(r()?.config))),u}export function getDefaultModels(){return{...c().defaultModels}}export function isRetiredDefaultModel(e,t){return c().retiredDefaultModels?.[e]?.includes(t)??!1}export function getRetiredDefaultModelIds(){return[...new Set(Object.values(c().retiredDefaultModels??{}).flat())]}export function getDefaultToolModel(){return c().defaultToolModel?.trim()||"gpt-5.5"}export function getToolDefaultModel(e){const t=c().toolDefaults;return t&&Object.prototype.hasOwnProperty.call(t,e)?(t[e]??"").trim():getDefaultToolModel()}export function getPresets(){return[...c().presets]}export function resolvePreset(e){return e.models?{...e.models}:e.model?{haiku:e.model,sonnet:e.model,opus:e.model,reasoning:e.model}:getDefaultModels()}export function getClaudeCodeTierChains(){const e=c().claudeCode?.tierChains??{};return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,[...t]]))}export function getClaudeDesktopRules(){const e=c().claudeDesktop??{};return{oneMillionFallback:[...e.oneMillionFallback??[]],oneMillionExclusions:(e.oneMillionExclusions??[]).map(e=>({...e,models:[...e.models]}))}}export function getGatewayModelRules(){const e=c().gatewayModels??{};return{autoCompactRatio:e.autoCompactRatio??.8,models:(e.models??[]).map(e=>({...e})),retired:[...e.retired??[]]}}export function getBuiltinGatewayAddresses(){return a().gatewayAddresses.map(e=>({...e}))}export function getCodexRules(){return{standardContextWindow:c().codex?.standardContextWindow??272e3}}export function getAgyRules(){return{gatewayModels:[...c().agy?.gatewayModels??[]]}}export function compareVersions(e,t){const o=e.split(".").map(e=>parseInt(e,10)||0),l=t.split(".").map(e=>parseInt(e,10)||0);for(let e=0;e<Math.max(o.length,l.length);e++){const t=(o[e]??0)-(l[e]??0);if(0!==t)return t}return 0}export function getToolMinVersion(e){return c().toolMinVersions?.[e]?.trim()||null}export function reloadRegistry(){u=null}
1
+ import{dirname as e,join as o}from"path";import{fileURLToPath as t}from"url";import{existsSync as l,readFileSync as n}from"fs";import{currentClientConfig as r,usableClientSection as s}from"./client-config.js";import{brand as a}from"./brand.js";const i=e(t(import.meta.url)),d=(e=[],o=[])=>[...new Set([...e,...o])];export function overlayClientSection(e,o){if(!o)return e;const t={...e.retiredDefaultModels??{}};for(const[e,l]of Object.entries(o.retiredDefaultModels??{}))t[e]=d(t[e],l);return{...e,defaultModels:{...e.defaultModels,...o.defaultModels??{}},retiredDefaultModels:t,toolDefaults:{...e.toolDefaults??{},...o.toolDefaults??{}},claudeCode:o.tierChains?{...e.claudeCode??{},tierChains:{...e.claudeCode?.tierChains??{},...o.tierChains}}:e.claudeCode,claudeDesktop:o.oneMillionFallback?{...e.claudeDesktop??{},oneMillionFallback:[...o.oneMillionFallback]}:e.claudeDesktop,gatewayModels:o.retiredModels?{...e.gatewayModels??{},retired:d(e.gatewayModels?.retired,o.retiredModels)}:e.gatewayModels,toolMinVersions:{...e.toolMinVersions??{},...o.toolMinVersions??{}},agy:o.agyModels?{...e.agy??{},gatewayModels:[...o.agyModels]}:e.agy}}let u=null;function c(){return u||(u=overlayClientSection(function(){const e=[o(i,"..","..","models.json"),o(i,"..","models.json"),o(i,"models.json")];for(const o of e)if(l(o))return JSON.parse(n(o,"utf-8"));throw new Error(`models.json not found, searched: ${e.join(", ")}`)}(),s(r()?.config))),u}export function getDefaultModels(){return{...c().defaultModels}}export function isRetiredDefaultModel(e,o){return c().retiredDefaultModels?.[e]?.includes(o)??!1}export function getRetiredDefaultModelIds(){return[...new Set(Object.values(c().retiredDefaultModels??{}).flat())]}export function getDefaultToolModel(){return c().defaultToolModel?.trim()||"gpt-5.5"}export function getToolDefaultModel(e){const o=c().toolDefaults;return o&&Object.prototype.hasOwnProperty.call(o,e)?(o[e]??"").trim():getDefaultToolModel()}export function getToolMenuModels(e){return[...c().toolMenuModels?.[e]??[]]}export function getPresets(){return[...c().presets]}export function resolvePreset(e){return e.models?{...e.models}:e.model?{haiku:e.model,sonnet:e.model,opus:e.model,reasoning:e.model}:getDefaultModels()}export function getClaudeCodeTierChains(){const e=c().claudeCode?.tierChains??{};return Object.fromEntries(Object.entries(e).map(([e,o])=>[e,[...o]]))}export function getClaudeDesktopRules(){const e=c().claudeDesktop??{};return{oneMillionFallback:[...e.oneMillionFallback??[]],oneMillionExclusions:(e.oneMillionExclusions??[]).map(e=>({...e,models:[...e.models]}))}}export function getGatewayModelRules(){const e=c().gatewayModels??{};return{autoCompactRatio:e.autoCompactRatio??.8,models:(e.models??[]).map(e=>({...e})),retired:[...e.retired??[]]}}export function getBuiltinGatewayAddresses(){return a().gatewayAddresses.map(e=>({...e}))}export function getCodexRules(){return{standardContextWindow:c().codex?.standardContextWindow??272e3}}export function getAgyRules(){return{gatewayModels:[...c().agy?.gatewayModels??[]]}}export function compareVersions(e,o){const t=e.split(".").map(e=>parseInt(e,10)||0),l=o.split(".").map(e=>parseInt(e,10)||0);for(let e=0;e<Math.max(t.length,l.length);e++){const o=(t[e]??0)-(l[e]??0);if(0!==o)return o}return 0}export function getToolMinVersion(e){return c().toolMinVersions?.[e]?.trim()||null}export function reloadRegistry(){u=null}
@@ -1 +1 @@
1
- import{chmodSync as t,existsSync as r,readFileSync as e}from"fs";import{join as n}from"path";import{i18n as o}from"../i18n.js";import{prettyModelName as i}from"../gateway-models.js";import{getAgyRules as a}from"../model-registry.js";import{logger as l}from"../../utils/logger.js";import{readPersistentEnvFile as s,removePersistentEnv as c,writePersistentEnv as u}from"../persistent-env.js";import{backupBeforeWrite as p,atomicWriteFile as g}from"./backup.js";import{findInstalls as d,mirrorInstallCommand as m}from"./tool-installs.js";import{toolHome as y}from"./types.js";import{brand as f,PROVIDER_KEY as v}from"../brand.js";const A="agy",_="AGY_LLM_GATEWAY_MODELS",h=["GEMINI_API_KEY","GOOGLE_GEMINI_BASE_URL","AGY_LLM_GATEWAY_URL","AGY_LLM_GATEWAY_API_KEY"],E="gemini",j=()=>n(y(),".gemini","antigravity-cli"),b=()=>n(j(),"settings.json"),w=()=>n(j(),`${v}.env`),I=()=>n(y(),".antigravity","settings.json"),K=f().installMirror?.agy,P={command:"agy",native:{binDir:"win32"===process.platform?["AppData","Local","agy","bin"]:[".local","bin"],updateArgs:["update"],dataDirs:[]},...K?{mirrorScript:{sh:`${K}/install.sh`,ps1:`${K}/install.ps1`}}:{}};function M(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}function G(t,n){if(!r(t))return{};const o=e(t,"utf-8");if(!o.trim())return{};try{const t=JSON.parse(o);if(!M(t))throw new Error(`${n} root must be an object`);return t}catch(t){throw new Error(`Existing ${n} cannot be parsed; back it up and fix it first: ${t instanceof Error?t.message:String(t)}`)}}const L=()=>G(b(),"~/.gemini/antigravity-cli/settings.json"),C=()=>G(I(),"~/.antigravity/settings.json");function N(r,e,n){p(r),g(r,JSON.stringify(e,null,2)+"\n",n),void 0!==n&&t(r,n)}function S(t){return(t||"").replace(/\/+$/,"").replace(/\/v1(beta)?$/,"")}function Y(t){const r=a().gatewayModels,e=t?r.filter(r=>t.models.includes(r)):[];return e.length>0?e:r}const $=t=>i(t.replace(/-preview$/,""));function k(t){const r=t.gateway;return M(r)&&!0===r.enabled&&"string"==typeof r.apiKey&&r.apiKey.trim()&&"string"==typeof r.url?{url:r.url,apiKey:r.apiKey}:null}function O(t){const r=t.models;return M(r)&&Array.isArray(r.list)?r.list.map(t=>M(t)&&"string"==typeof t.modelId?t.modelId:"").filter(Boolean):[]}function x(){try{if(L().modelProvider!==E)return null}catch{return null}const t=s(w()),r=t.GEMINI_API_KEY;return r&&r.trim()?{apiKey:r,url:t.GOOGLE_GEMINI_BASE_URL??""}:null}function U(t,r,e){const n=L(),o=C();o.gateway={...M(o.gateway)?o.gateway:{},enabled:!0,url:r,apiKey:t,wireProtocol:"genai"},o.models={...M(o.models)?o.models:{},defaultModelId:e[0],list:e.map(t=>({modelId:t,displayName:$(t),supportsThinking:!0}))},N(I(),o,384),h.some(t=>void 0!==s(w())[t])&&c(A,w(),h);const i=u(A,w(),{[_]:e.join(",")}).rcFiles;for(const t of h)delete process.env[t];return n.modelProvider===E&&(delete n.modelProvider,N(b(),n)),i}let D=null,R=null;export const antigravityAdapter={name:"agy",displayName:"Antigravity CLI",command:"agy",installCommand:m(P),installSpec:P,configPath:I(),wantsModelCatalog:!0,loadPrivateConfig(t){L(),C();const r=Y(t.catalog);D=U(t.apiKey,S(t.baseUrl),r),R=r},unloadPrivateConfig(){try{const t=C();k(t)&&(delete t.gateway,delete t.models,N(I(),t,384))}catch(t){l.logError("antigravityAdapter.unloadPrivateConfig",t)}try{const t=L();t.modelProvider===E&&(delete t.modelProvider,N(b(),t))}catch(t){l.logError("antigravityAdapter.unloadPrivateConfig",t)}c(A,w(),[_,...h])},detectCurrentConfig(){try{const t=k(C());if(t)return{apiKey:t.apiKey}}catch{return{apiKey:null}}return{apiKey:x()?.apiKey??null}},listedModels(){try{const t=C();if(k(t))return O(t)}catch{return null}return x()?[]:null},refreshModelMenu(t){const r=C(),e=k(r)??x();if(!e)return;const n=Y(t.catalog),o=e.url||S(t.baseUrl);null!==k(r)&&O(r).join(",")===n.join(",")&&s(w())[_]===n.join(",")&&null===x()||U(e.apiKey,o,n)},getConfig(){try{return C()}catch(t){return l.logError("antigravityAdapter.getConfig",t),null}},applyNotes(){const t=[];if(R&&R.length>0){const r=R.map($);t.push({kind:"summary",text:o.t("tools.agy.menu_written",{count:String(r.length),list:r.join(o.t("tools.grok.list_separator")),default:r[0]})})}return null===D||0===d(P).length||t.push({kind:"action",text:o.t("tools.agy.effort_after_reopen")}),t},backupPaths:()=>[I(),b(),w()],forceResetPaths:()=>[w()]};
1
+ import{chmodSync as t,existsSync as r,readFileSync as e}from"fs";import{join as n}from"path";import{i18n as o}from"../i18n.js";import{prettyModelName as i}from"../gateway-models.js";import{getAgyRules as a}from"../model-registry.js";import{logger as l}from"../../utils/logger.js";import{readPersistentEnvFile as s,removePersistentEnv as c,writePersistentEnv as u}from"../persistent-env.js";import{backupBeforeWrite as p,atomicWriteFile as g}from"./backup.js";import{findInstalls as d,mirrorInstallCommand as m}from"./tool-installs.js";import{toolHome as y}from"./types.js";import{brand as f,PROVIDER_KEY as v}from"../brand.js";const A="agy",_="AGY_LLM_GATEWAY_URL",h="AGY_LLM_GATEWAY_API_KEY",E="AGY_LLM_GATEWAY_MODELS",j=["GEMINI_API_KEY","GOOGLE_GEMINI_BASE_URL"],w="gemini",K=()=>n(y(),".gemini","antigravity-cli"),b=()=>n(K(),"settings.json"),I=()=>n(K(),`${v}.env`),P=()=>n(y(),".antigravity","settings.json"),M=f().installMirror?.agy,G={command:"agy",native:{binDir:"win32"===process.platform?["AppData","Local","agy","bin"]:[".local","bin"],updateArgs:["update"],dataDirs:[]},...M?{mirrorScript:{sh:`${M}/install.sh`,ps1:`${M}/install.ps1`}}:{}};function L(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}function C(t,n){if(!r(t))return{};const o=e(t,"utf-8");if(!o.trim())return{};try{const t=JSON.parse(o);if(!L(t))throw new Error(`${n} root must be an object`);return t}catch(t){throw new Error(`Existing ${n} cannot be parsed; back it up and fix it first: ${t instanceof Error?t.message:String(t)}`)}}const N=()=>C(b(),"~/.gemini/antigravity-cli/settings.json"),S=()=>C(P(),"~/.antigravity/settings.json");function Y(r,e,n){p(r),g(r,JSON.stringify(e,null,2)+"\n",n),void 0!==n&&t(r,n)}function $(t){return(t||"").replace(/\/+$/,"").replace(/\/v1(beta)?$/,"")}function k(t){const r=a().gatewayModels,e=t?r.filter(r=>t.models.includes(r)):[];return e.length>0?e:r}const O=t=>i(t.replace(/-preview$/,""));function x(t){const r=t.gateway;return L(r)&&!0===r.enabled&&"string"==typeof r.apiKey&&r.apiKey.trim()&&"string"==typeof r.url?{url:r.url,apiKey:r.apiKey}:null}function U(t){const r=t.models;return L(r)&&Array.isArray(r.list)?r.list.map(t=>L(t)&&"string"==typeof t.modelId?t.modelId:"").filter(Boolean):[]}function D(){try{if(N().modelProvider!==w)return null}catch{return null}const t=s(I()),r=t.GEMINI_API_KEY;return r&&r.trim()?{apiKey:r,url:t.GOOGLE_GEMINI_BASE_URL??""}:null}function R(t){const r=s(I());return r[_]===t.url&&r[h]===t.apiKey}function T(t,r,e){const n=N(),o=S();o.gateway={...L(o.gateway)?o.gateway:{},enabled:!0,url:r,apiKey:t,wireProtocol:"genai"},o.models={...L(o.models)?o.models:{},defaultModelId:e[0],list:e.map(t=>({modelId:t,displayName:O(t),supportsThinking:!0}))},Y(P(),o,384),j.some(t=>void 0!==s(I())[t])&&c(A,I(),j);const i=u(A,I(),{[_]:r,[h]:t,[E]:e.join(",")}).rcFiles;for(const t of j)delete process.env[t];return n.modelProvider===w&&(delete n.modelProvider,Y(b(),n)),i}let B=null,W=null;export const antigravityAdapter={name:"agy",displayName:"Antigravity CLI",command:"agy",installCommand:m(G),installSpec:G,configPath:P(),wantsModelCatalog:!0,loadPrivateConfig(t){N(),S();const r=k(t.catalog);B=T(t.apiKey,$(t.baseUrl),r),W=r},unloadPrivateConfig(){try{const t=S();x(t)&&(delete t.gateway,delete t.models,Y(P(),t,384))}catch(t){l.logError("antigravityAdapter.unloadPrivateConfig",t)}try{const t=N();t.modelProvider===w&&(delete t.modelProvider,Y(b(),t))}catch(t){l.logError("antigravityAdapter.unloadPrivateConfig",t)}c(A,I(),[_,h,E,...j])},detectCurrentConfig(){try{const t=x(S());if(t)return{apiKey:t.apiKey}}catch{return{apiKey:null}}return{apiKey:D()?.apiKey??null}},listedModels(){try{const t=S(),r=x(t);if(r)return R(r)?U(t):[]}catch{return null}return D()?[]:null},refreshModelMenu(t){const r=S(),e=x(r)??D();if(!e)return;const n=k(t.catalog),o=e.url||$(t.baseUrl),i=x(r);null!==i&&R(i)&&U(r).join(",")===n.join(",")&&s(I())[E]===n.join(",")&&null===D()||T(e.apiKey,o,n)},getConfig(){try{return S()}catch(t){return l.logError("antigravityAdapter.getConfig",t),null}},applyNotes(){const t=[];if(W&&W.length>0){const r=W.map(O);t.push({kind:"summary",text:o.t("tools.agy.menu_written",{count:String(r.length),list:r.join(o.t("tools.grok.list_separator")),default:r[0]})})}return null===B||0===d(G).length||t.push({kind:"action",text:o.t("tools.agy.open_new_terminal")}),t},backupPaths:()=>[P(),b(),I()],forceResetPaths:()=>[I()]};
@@ -48,8 +48,9 @@ export declare function modelEntry(spec: GatewayModelSpec, baseUrl: string, apiK
48
48
  * models the gateway serves over an OpenAI-style interface. The default comes first, the rest
49
49
  * keep the gateway's order; reordering or marking models in the gateway console changes the menu.
50
50
  * When the key's owner chose models in the console (`personal`), every chosen model is written.
51
+ * `extras` are a tool's own additions to the short menu, under the same limits.
51
52
  */
52
- export declare function menuSpecs(catalog: ModelCatalog | undefined, picked: string): GatewayModelSpec[];
53
+ export declare function menuSpecs(catalog: ModelCatalog | undefined, picked: string, extras?: string[]): GatewayModelSpec[];
53
54
  /**
54
55
  * Replace our entries with `specs`; the user's own entries keep their place. A user entry with
55
56
  * the same id as one of ours is replaced (its id now means our model); returned as `replaced`.
@@ -1 +1 @@
1
- import{existsSync as e,readFileSync as t}from"fs";import{BRAND_NAME as r}from"../brand.js";import{gatewayModelSpecs as n,modelFamily as o,prettyModelName as i,vendorNames as s}from"../gateway-models.js";import{backupBeforeWrite as a,atomicWriteFile as p}from"./backup.js";import{withV1 as d}from"./types.js";export const CUSTOM_MODEL_PREFIX="custom-local:";const u="openai",l="openai-response",c=e=>!!e&&"object"==typeof e&&!Array.isArray(e);export const isOurEntry=e=>c(e)&&e.vendor===r;export function readModelsFile(r){if(!e(r))return{entries:[],wrap:e=>({models:e})};const n=t(r,"utf-8");if(!n.trim())return{entries:[],wrap:e=>({models:e})};let o;try{o=JSON.parse(n)}catch(e){throw new Error(`Existing ${r} cannot be parsed; back it up and fix it first: ${e instanceof Error?e.message:String(e)}`)}if(Array.isArray(o))return{entries:o,wrap:e=>e};if(c(o))return{entries:Array.isArray(o.models)?o.models:[],wrap:e=>({...o,models:e})};throw new Error(`Existing ${r} must hold a JSON object or array`)}export function writeModelsFile(r,n,o){const i=`${JSON.stringify(n.wrap(o),null,2)}\n`;e(r)&&t(r,"utf-8")===i||(a(r),p(r,i,384))}export const bareModelId=e=>e.replace(/\[[^\]]*\]$/,"");export function usesResponses(e){const t=e.endpointTypes??[];return"gpt"===o(e.id)?0===t.length||t.includes(l):t.length>0&&!t.includes(u)&&t.includes(l)}function f(e){const t=e.endpointTypes;return!t||0===t.length||t.includes(u)||t.includes(l)}export function modelEntry(e,t,n,s=!1){const a=e.capabilities??{},p=usesResponses(e),u=o(e.id),l={id:e.id,name:s?e.id:e.name??i(e.id),vendor:r,url:p?d(t):`${d(t)}/chat/completions`,apiKey:n};p&&(l.api="openai-responses");const c=a.contextWindow??e.contextWindow;c&&(l.maxInputTokens=c);const f=a.maxOutput??e.maxOutputTokens;return f&&(l.maxOutputTokens=f),l.supportsToolCall=a.toolCall??!0,l.supportsImages=a.vision??"other"!==u,void 0!==a.reasoning&&(l.supportsReasoning=a.reasoning),a.reasoning&&a.reasoningEfforts&&(l.reasoning={...a.defaultReasoningEffort?{defaultEffort:a.defaultReasoningEffort}:{},supportedEfforts:a.reasoningEfforts}),l}export function menuSpecs(e,t){let r=n("codebuddy",e?.clientModels,e?.clientPersonal).filter(f);if(e){const n=new Set(e.models);r=r.filter(e=>n.has(e.id)),!r.some(e=>e.id===t)&&n.has(t)&&(r=[{id:t},...r])}else r.some(e=>e.id===t)||(r=[{id:t},...r]);const o=(e?.clientPersonal??[]).length>0,i=new Set,a=r.filter(e=>{if(o)return!0;const r=s([e.id])[0],n=!i.has(r);return i.add(r),e.id===t||!0===e.recommended||n}),p=a.findIndex(e=>e.id===t);return p>0?[a[p],...a.slice(0,p),...a.slice(p+1)]:a}export function mergeEntries(e,t,r,n,o=!1){const i=new Set(t.map(e=>e.id)),s=[],a=e.filter(e=>{if(isOurEntry(e))return!1;const t=c(e)&&"string"==typeof e.id?e.id:void 0;return!t||!i.has(t)||(s.push(t),!1)});return{entries:[...t.map(e=>modelEntry(e,r,n,o)),...a],replaced:s}}export function foreignIdsReplaced(e,t){const r=new Set(t.map(e=>e.id));return e.filter(e=>!isOurEntry(e)).filter(e=>c(e)&&"string"==typeof e.id&&r.has(e.id)).map(e=>String(e.id))}export function ourEntries(e){return e.filter(isOurEntry)}export function ourApiKey(e){const t=ourEntries(e)[0]?.apiKey;return"string"==typeof t&&t.trim()?t:null}
1
+ import{existsSync as e,readFileSync as t}from"fs";import{BRAND_NAME as r}from"../brand.js";import{gatewayModelSpecs as n,modelFamily as o,prettyModelName as i,vendorNames as s}from"../gateway-models.js";import{backupBeforeWrite as a,atomicWriteFile as d}from"./backup.js";import{withV1 as p}from"./types.js";export const CUSTOM_MODEL_PREFIX="custom-local:";const u="openai",l="openai-response",c=e=>!!e&&"object"==typeof e&&!Array.isArray(e);export const isOurEntry=e=>c(e)&&e.vendor===r;export function readModelsFile(r){if(!e(r))return{entries:[],wrap:e=>({models:e})};const n=t(r,"utf-8");if(!n.trim())return{entries:[],wrap:e=>({models:e})};let o;try{o=JSON.parse(n)}catch(e){throw new Error(`Existing ${r} cannot be parsed; back it up and fix it first: ${e instanceof Error?e.message:String(e)}`)}if(Array.isArray(o))return{entries:o,wrap:e=>e};if(c(o))return{entries:Array.isArray(o.models)?o.models:[],wrap:e=>({...o,models:e})};throw new Error(`Existing ${r} must hold a JSON object or array`)}export function writeModelsFile(r,n,o){const i=`${JSON.stringify(n.wrap(o),null,2)}\n`;e(r)&&t(r,"utf-8")===i||(a(r),d(r,i,384))}export const bareModelId=e=>e.replace(/\[[^\]]*\]$/,"");export function usesResponses(e){const t=e.endpointTypes??[];return"gpt"===o(e.id)?0===t.length||t.includes(l):t.length>0&&!t.includes(u)&&t.includes(l)}function f(e){const t=e.endpointTypes;return!t||0===t.length||t.includes(u)||t.includes(l)}export function modelEntry(e,t,n,s=!1){const a=e.capabilities??{},d=usesResponses(e),u=o(e.id),l={id:e.id,name:s?e.id:e.name??i(e.id),vendor:r,url:d?p(t):`${p(t)}/chat/completions`,apiKey:n};d&&(l.api="openai-responses");const c=a.contextWindow??e.contextWindow;c&&(l.maxInputTokens=c);const f=a.maxOutput??e.maxOutputTokens;return f&&(l.maxOutputTokens=f),l.supportsToolCall=a.toolCall??!0,l.supportsImages=a.vision??"other"!==u,void 0!==a.reasoning&&(l.supportsReasoning=a.reasoning),a.reasoning&&a.reasoningEfforts&&(l.reasoning={...a.defaultReasoningEffort?{defaultEffort:a.defaultReasoningEffort}:{},supportedEfforts:a.reasoningEfforts}),l}export function menuSpecs(e,t,r=[]){let o=n("codebuddy",e?.clientModels,e?.clientPersonal).filter(f);if(e){const r=new Set(e.models);o=o.filter(e=>r.has(e.id)),!o.some(e=>e.id===t)&&r.has(t)&&(o=[{id:t},...o])}else o.some(e=>e.id===t)||(o=[{id:t},...o]);const i=(e?.clientPersonal??[]).length>0,a=new Set,d=o.filter(e=>{if(i)return!0;const n=s([e.id])[0],o=!a.has(n);return a.add(n),e.id===t||!0===e.recommended||r.includes(e.id)||o}),p=d.findIndex(e=>e.id===t);return p>0?[d[p],...d.slice(0,p),...d.slice(p+1)]:d}export function mergeEntries(e,t,r,n,o=!1){const i=new Set(t.map(e=>e.id)),s=[],a=e.filter(e=>{if(isOurEntry(e))return!1;const t=c(e)&&"string"==typeof e.id?e.id:void 0;return!t||!i.has(t)||(s.push(t),!1)});return{entries:[...t.map(e=>modelEntry(e,r,n,o)),...a],replaced:s}}export function foreignIdsReplaced(e,t){const r=new Set(t.map(e=>e.id));return e.filter(e=>!isOurEntry(e)).filter(e=>c(e)&&"string"==typeof e.id&&r.has(e.id)).map(e=>String(e.id))}export function ourEntries(e){return e.filter(isOurEntry)}export function ourApiKey(e){const t=ourEntries(e)[0]?.apiKey;return"string"==typeof t&&t.trim()?t:null}
@@ -1 +1 @@
1
- import{existsSync as t}from"fs";import{join as r}from"path";import{logger as o}from"../../utils/logger.js";import{i18n as e}from"../i18n.js";import{getToolDefaultModel as n}from"../model-registry.js";import{prettyModelName as d,vendorNames as s}from"../gateway-models.js";import{bareModelId as i,foreignIdsReplaced as a,isOurEntry as l,menuSpecs as p,mergeEntries as u,ourApiKey as c,ourEntries as m,readModelsFile as y,writeModelsFile as g}from"./codebuddy-models.js";import{pickModel as f,toolHome as b}from"./types.js";const k=()=>process.env.WORKBUDDY_CONFIG_DIR?.trim()||process.env.CODEBUDDY_CONFIG_DIR?.trim()||r(b(),".workbuddy"),w=()=>r(k(),"models.json"),h="https://www.codebuddy.cn/work/";let C=null;function _(t,r){const o=y(w()),{entries:e,replaced:n}=u(o.entries,r,t.baseUrl,t.apiKey,!0);return g(w(),o,e),n}const j=t=>i(f(t.models,n("workbuddy")));export const workbuddyAdapter={name:"workbuddy",displayName:"WorkBuddy",command:"workbuddy",installCommand:"darwin"===process.platform?`open ${h}`:h,get configPath(){return w()},wantsModelCatalog:!0,isInstalled:function(){return!!t(k())||"darwin"===process.platform&&["/Applications/WorkBuddy.app",r(b(),"Applications","WorkBuddy.app")].some(r=>t(r))},loadPrivateConfig(t){const r=p(t.catalog,j(t)),o=_(t,r);C={names:r.map(t=>t.name??d(t.id)),vendors:s(r.map(t=>t.id)),replaced:o}},unloadPrivateConfig(){try{const t=y(w());if(0===m(t.entries).length)return;g(w(),t,t.entries.filter(t=>!l(t)))}catch(t){o.logError("workbuddyAdapter.unloadPrivateConfig",t)}},detectCurrentConfig(){try{return{apiKey:c(y(w()).entries)}}catch{return{apiKey:null}}},listedModels(){try{const t=m(y(w()).entries);return t.length>0?t.map(t=>String(t.id)):null}catch{return null}},refreshModelMenu(t){_(t,p(t.catalog,j(t)))},planNotes(){try{const t=y(w()),r=a(t.entries,p(void 0,n("workbuddy")));return r.length>0?[e.t("tools.codebuddy.replaces_models",{path:w(),list:r.join(e.t("tools.codebuddy.list_separator"))})]:[]}catch{return[]}},applyNotes(){if(!C)return[];const t=[{kind:"summary",text:e.t("tools.workbuddy.menu_written",{count:String(C.names.length),list:C.vendors.join(e.t("tools.codebuddy.list_separator"))})},{kind:"action",text:e.t("tools.workbuddy.pick_in_app")}];return C.replaced.length>0&&t.push({kind:"detail",text:e.t("tools.codebuddy.replaced_models",{tool:"workbuddy",list:C.replaced.join(e.t("tools.codebuddy.list_separator"))})}),t},backupPaths:()=>[w()],getConfig(){try{return y(w()).entries}catch(t){return o.logError("workbuddyAdapter.getConfig",t),null}}};
1
+ import{existsSync as t}from"fs";import{join as r}from"path";import{logger as o}from"../../utils/logger.js";import{i18n as e}from"../i18n.js";import{getToolDefaultModel as n,getToolMenuModels as d}from"../model-registry.js";import{prettyModelName as s,vendorNames as i}from"../gateway-models.js";import{bareModelId as a,foreignIdsReplaced as l,isOurEntry as p,menuSpecs as u,mergeEntries as c,ourApiKey as m,ourEntries as y,readModelsFile as g,writeModelsFile as f}from"./codebuddy-models.js";import{pickModel as b,toolHome as k}from"./types.js";const w=()=>process.env.WORKBUDDY_CONFIG_DIR?.trim()||process.env.CODEBUDDY_CONFIG_DIR?.trim()||r(k(),".workbuddy"),h=()=>r(w(),"models.json"),C="https://www.codebuddy.cn/work/";let _=null;function j(t,r){const o=g(h()),{entries:e,replaced:n}=c(o.entries,r,t.baseUrl,t.apiKey,!0);return f(h(),o,e),n}const v=t=>a(b(t.models,n("workbuddy"))),D=(t,r)=>u(t,r,d("workbuddy"));export const workbuddyAdapter={name:"workbuddy",displayName:"WorkBuddy",command:"workbuddy",installCommand:"darwin"===process.platform?`open ${C}`:C,get configPath(){return h()},wantsModelCatalog:!0,isInstalled:function(){return!!t(w())||"darwin"===process.platform&&["/Applications/WorkBuddy.app",r(k(),"Applications","WorkBuddy.app")].some(r=>t(r))},loadPrivateConfig(t){const r=D(t.catalog,v(t)),o=j(t,r);_={names:r.map(t=>t.name??s(t.id)),vendors:i(r.map(t=>t.id)),replaced:o}},unloadPrivateConfig(){try{const t=g(h());if(0===y(t.entries).length)return;f(h(),t,t.entries.filter(t=>!p(t)))}catch(t){o.logError("workbuddyAdapter.unloadPrivateConfig",t)}},detectCurrentConfig(){try{return{apiKey:m(g(h()).entries)}}catch{return{apiKey:null}}},listedModels(){try{const t=y(g(h()).entries);return t.length>0?t.map(t=>String(t.id)):null}catch{return null}},refreshModelMenu(t){j(t,D(t.catalog,v(t)))},planNotes(){try{const t=g(h()),r=l(t.entries,D(void 0,n("workbuddy")));return r.length>0?[e.t("tools.codebuddy.replaces_models",{path:h(),list:r.join(e.t("tools.codebuddy.list_separator"))})]:[]}catch{return[]}},applyNotes(){if(!_)return[];const t=[{kind:"summary",text:e.t("tools.workbuddy.menu_written",{count:String(_.names.length),list:_.vendors.join(e.t("tools.codebuddy.list_separator"))})},{kind:"action",text:e.t("tools.workbuddy.pick_in_app")}];return _.replaced.length>0&&t.push({kind:"detail",text:e.t("tools.codebuddy.replaced_models",{tool:"workbuddy",list:_.replaced.join(e.t("tools.codebuddy.list_separator"))})}),t},backupPaths:()=>[h()],getConfig(){try{return g(h()).entries}catch(t){return o.logError("workbuddyAdapter.getConfig",t),null}}};
@@ -374,7 +374,7 @@
374
374
  "version_outdated": "version {{current}} is too old (needs {{min}} or later); upgrade with {{upgrade}}",
375
375
  "agy": {
376
376
  "menu_written": "{{count}} models in the menu ({{list}}), default {{default}}",
377
- "effort_after_reopen": "agy works right away; in a new terminal the model menu also offers thinking levels (low / medium / high)"
377
+ "open_new_terminal": "Run agy in a new terminal: terminals already open do not see the new settings"
378
378
  },
379
379
  "grok": {
380
380
  "menu_written": "{{count}} models in the menu ({{list}}), default {{default}}",
@@ -374,7 +374,7 @@
374
374
  "version_outdated": "版本 {{current}} 过旧,需要 {{min}} 或更高版本,运行 {{upgrade}} 升级",
375
375
  "agy": {
376
376
  "menu_written": "模型菜单共 {{count}} 个({{list}}),默认 {{default}}",
377
- "effort_after_reopen": "现在即可运行 agy;在新开的终端里,模型菜单还会提供思考档位(低、中、高)"
377
+ "open_new_terminal": "在新开的终端里运行 agy;已打开的终端读不到新配置"
378
378
  },
379
379
  "grok": {
380
380
  "menu_written": "模型菜单共 {{count}} 个({{list}}),默认 {{default}}",
package/dist/models.json CHANGED
@@ -22,6 +22,9 @@
22
22
  "codebuddy": "gpt-6-astra",
23
23
  "workbuddy": "gpt-6-astra"
24
24
  },
25
+ "toolMenuModels": {
26
+ "workbuddy": ["gpt-6.1-sol", "gpt-6.1-terra", "claude-sonnet-5-5"]
27
+ },
25
28
  "presets": [
26
29
  {
27
30
  "name": "GPT-5.5",
package/models.json CHANGED
@@ -22,6 +22,9 @@
22
22
  "codebuddy": "gpt-6-astra",
23
23
  "workbuddy": "gpt-6-astra"
24
24
  },
25
+ "toolMenuModels": {
26
+ "workbuddy": ["gpt-6.1-sol", "gpt-6.1-terra", "claude-sonnet-5-5"]
27
+ },
25
28
  "presets": [
26
29
  {
27
30
  "name": "GPT-5.5",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibeapi/cli",
3
- "version": "0.0.160",
3
+ "version": "0.0.162",
4
4
  "description": "CLI tool for managing AI coding assistants (Claude Code, Codex, OpenClaw, Hermes, AtomCode, Grok Build) with one unified config",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",