@hasna/switcher 0.1.1 → 0.1.3

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 (43) hide show
  1. package/README.md +146 -7
  2. package/dist/aider-args.d.ts +7 -0
  3. package/dist/aider-config.d.ts +6 -0
  4. package/dist/auth.d.ts +3 -0
  5. package/dist/cli/index.js +7548 -2558
  6. package/dist/cli.d.ts +2 -0
  7. package/dist/cline-backend.d.ts +7 -0
  8. package/dist/codex-model-policy.d.ts +65 -0
  9. package/dist/credentials.d.ts +5 -5
  10. package/dist/direct-launch.d.ts +3 -3
  11. package/dist/domain.d.ts +320 -50
  12. package/dist/dsh-args.d.ts +5 -0
  13. package/dist/gemini-bridge.d.ts +6 -0
  14. package/dist/gemini-config.d.ts +12 -0
  15. package/dist/gemini-model-policy.d.ts +56 -0
  16. package/dist/generated/api.d.ts +220 -21
  17. package/dist/harness-arguments.d.ts +1 -0
  18. package/dist/harness-installation.d.ts +19 -0
  19. package/dist/harness-types.d.ts +10 -0
  20. package/dist/harnesses.d.ts +5 -2
  21. package/dist/hermes-backend.d.ts +19 -0
  22. package/dist/hermes-model-policy.d.ts +30 -0
  23. package/dist/index.js +136 -43
  24. package/dist/inference-gateway.d.ts +24 -0
  25. package/dist/kilo-config.d.ts +13 -0
  26. package/dist/kilo.d.ts +5 -0
  27. package/dist/launcher.d.ts +12 -6
  28. package/dist/mcp/index.js +139 -55
  29. package/dist/model-policy-schema.d.ts +137 -0
  30. package/dist/model-policy.d.ts +31 -0
  31. package/dist/native-model-policy.d.ts +23 -0
  32. package/dist/omp-backend.d.ts +7 -0
  33. package/dist/opencode-model-policy.d.ts +33 -0
  34. package/dist/opencode2-config.d.ts +3 -3
  35. package/dist/ori-backend.d.ts +2 -2
  36. package/dist/ori-model-policy.d.ts +8 -0
  37. package/dist/presets.d.ts +11 -10
  38. package/dist/sdk.d.ts +279 -38
  39. package/dist/sdk.js +136 -43
  40. package/dist/serve/index.js +1306 -125
  41. package/docs/MODEL-POLICY.md +82 -0
  42. package/openapi.json +973 -14
  43. package/package.json +14 -3
package/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.0.3",
3
3
  "info": {
4
4
  "title": "Switcher API",
5
- "version": "0.1.1",
5
+ "version": "0.1.3",
6
6
  "description": "Authenticated provider/profile/catalog control plane. Launches run locally; the API never returns provider credentials."
7
7
  },
8
8
  "security": [
@@ -1216,7 +1216,8 @@
1216
1216
  "enum": [
1217
1217
  "anthropic-messages",
1218
1218
  "openai-responses",
1219
- "openai-chat"
1219
+ "openai-chat",
1220
+ "gemini-generate-content"
1220
1221
  ]
1221
1222
  },
1222
1223
  "baseUrl": {
@@ -1227,7 +1228,8 @@
1227
1228
  "type": "string",
1228
1229
  "enum": [
1229
1230
  "bearer",
1230
- "x-api-key"
1231
+ "x-api-key",
1232
+ "api-key"
1231
1233
  ]
1232
1234
  },
1233
1235
  "catalogBaseUrl": {
@@ -1243,6 +1245,7 @@
1243
1245
  "together",
1244
1246
  "fireworks",
1245
1247
  "dashscope",
1248
+ "gemini",
1246
1249
  "none"
1247
1250
  ]
1248
1251
  },
@@ -1251,6 +1254,7 @@
1251
1254
  "enum": [
1252
1255
  "bearer",
1253
1256
  "x-api-key",
1257
+ "api-key",
1254
1258
  "none"
1255
1259
  ]
1256
1260
  },
@@ -1320,7 +1324,8 @@
1320
1324
  "enum": [
1321
1325
  "anthropic-messages",
1322
1326
  "openai-responses",
1323
- "openai-chat"
1327
+ "openai-chat",
1328
+ "gemini-generate-content"
1324
1329
  ]
1325
1330
  },
1326
1331
  "credentialEnv": {
@@ -1331,7 +1336,8 @@
1331
1336
  "type": "string",
1332
1337
  "enum": [
1333
1338
  "bearer",
1334
- "x-api-key"
1339
+ "x-api-key",
1340
+ "api-key"
1335
1341
  ],
1336
1342
  "default": "bearer"
1337
1343
  },
@@ -1348,6 +1354,7 @@
1348
1354
  "together",
1349
1355
  "fireworks",
1350
1356
  "dashscope",
1357
+ "gemini",
1351
1358
  "none"
1352
1359
  ]
1353
1360
  },
@@ -1356,6 +1363,7 @@
1356
1363
  "enum": [
1357
1364
  "bearer",
1358
1365
  "x-api-key",
1366
+ "api-key",
1359
1367
  "none"
1360
1368
  ]
1361
1369
  },
@@ -1428,6 +1436,15 @@
1428
1436
  "maxLength": 100
1429
1437
  },
1430
1438
  "maxItems": 100
1439
+ },
1440
+ "supportedGenerationMethods": {
1441
+ "type": "array",
1442
+ "items": {
1443
+ "type": "string",
1444
+ "minLength": 1,
1445
+ "maxLength": 100
1446
+ },
1447
+ "maxItems": 100
1431
1448
  }
1432
1449
  },
1433
1450
  "required": [
@@ -1469,7 +1486,8 @@
1469
1486
  "enum": [
1470
1487
  "anthropic-messages",
1471
1488
  "openai-responses",
1472
- "openai-chat"
1489
+ "openai-chat",
1490
+ "gemini-generate-content"
1473
1491
  ]
1474
1492
  },
1475
1493
  "credentialEnv": {
@@ -1480,7 +1498,8 @@
1480
1498
  "type": "string",
1481
1499
  "enum": [
1482
1500
  "bearer",
1483
- "x-api-key"
1501
+ "x-api-key",
1502
+ "api-key"
1484
1503
  ],
1485
1504
  "default": "bearer"
1486
1505
  },
@@ -1497,6 +1516,7 @@
1497
1516
  "together",
1498
1517
  "fireworks",
1499
1518
  "dashscope",
1519
+ "gemini",
1500
1520
  "none"
1501
1521
  ]
1502
1522
  },
@@ -1505,6 +1525,7 @@
1505
1525
  "enum": [
1506
1526
  "bearer",
1507
1527
  "x-api-key",
1528
+ "api-key",
1508
1529
  "none"
1509
1530
  ]
1510
1531
  },
@@ -1577,6 +1598,15 @@
1577
1598
  "maxLength": 100
1578
1599
  },
1579
1600
  "maxItems": 100
1601
+ },
1602
+ "supportedGenerationMethods": {
1603
+ "type": "array",
1604
+ "items": {
1605
+ "type": "string",
1606
+ "minLength": 1,
1607
+ "maxLength": 100
1608
+ },
1609
+ "maxItems": 100
1580
1610
  }
1581
1611
  },
1582
1612
  "required": [
@@ -1629,14 +1659,122 @@
1629
1659
  "claude",
1630
1660
  "codex",
1631
1661
  "grok",
1662
+ "opencode",
1632
1663
  "opencode2",
1633
- "pi"
1664
+ "pi",
1665
+ "omp",
1666
+ "dsh",
1667
+ "cline",
1668
+ "hermes",
1669
+ "prime-agent",
1670
+ "gemini",
1671
+ "aider",
1672
+ "kilo"
1634
1673
  ]
1635
1674
  },
1636
1675
  "model": {
1637
1676
  "type": "string",
1638
1677
  "minLength": 1,
1639
1678
  "maxLength": 300
1679
+ },
1680
+ "modelPolicy": {
1681
+ "type": "object",
1682
+ "properties": {
1683
+ "version": {
1684
+ "type": "number",
1685
+ "enum": [
1686
+ 1
1687
+ ],
1688
+ "default": 1
1689
+ },
1690
+ "roles": {
1691
+ "type": "object",
1692
+ "properties": {
1693
+ "subagent": {
1694
+ "type": "string",
1695
+ "minLength": 1,
1696
+ "maxLength": 300,
1697
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1698
+ },
1699
+ "fast": {
1700
+ "type": "string",
1701
+ "minLength": 1,
1702
+ "maxLength": 300,
1703
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1704
+ },
1705
+ "planning": {
1706
+ "type": "string",
1707
+ "minLength": 1,
1708
+ "maxLength": 300,
1709
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1710
+ },
1711
+ "review": {
1712
+ "type": "string",
1713
+ "minLength": 1,
1714
+ "maxLength": 300,
1715
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1716
+ },
1717
+ "summary": {
1718
+ "type": "string",
1719
+ "minLength": 1,
1720
+ "maxLength": 300,
1721
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1722
+ },
1723
+ "compaction": {
1724
+ "type": "string",
1725
+ "minLength": 1,
1726
+ "maxLength": 300,
1727
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1728
+ },
1729
+ "weak": {
1730
+ "type": "string",
1731
+ "minLength": 1,
1732
+ "maxLength": 300,
1733
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1734
+ },
1735
+ "editor": {
1736
+ "type": "string",
1737
+ "minLength": 1,
1738
+ "maxLength": 300,
1739
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1740
+ }
1741
+ },
1742
+ "additionalProperties": false
1743
+ },
1744
+ "allowedModels": {
1745
+ "type": "array",
1746
+ "items": {
1747
+ "type": "string",
1748
+ "minLength": 1,
1749
+ "maxLength": 300,
1750
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1751
+ },
1752
+ "maxItems": 500
1753
+ },
1754
+ "aliases": {
1755
+ "type": "object",
1756
+ "additionalProperties": {
1757
+ "type": "string",
1758
+ "minLength": 1,
1759
+ "maxLength": 300,
1760
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1761
+ }
1762
+ },
1763
+ "fallbacks": {
1764
+ "type": "object",
1765
+ "additionalProperties": {
1766
+ "type": "array",
1767
+ "items": {
1768
+ "type": "string",
1769
+ "minLength": 1,
1770
+ "maxLength": 300,
1771
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1772
+ },
1773
+ "maxItems": 20
1774
+ }
1775
+ }
1776
+ },
1777
+ "additionalProperties": false
1640
1778
  }
1641
1779
  },
1642
1780
  "required": [
@@ -1670,8 +1808,17 @@
1670
1808
  "claude",
1671
1809
  "codex",
1672
1810
  "grok",
1811
+ "opencode",
1673
1812
  "opencode2",
1674
- "pi"
1813
+ "pi",
1814
+ "omp",
1815
+ "dsh",
1816
+ "cline",
1817
+ "hermes",
1818
+ "prime-agent",
1819
+ "gemini",
1820
+ "aider",
1821
+ "kilo"
1675
1822
  ]
1676
1823
  },
1677
1824
  "model": {
@@ -1679,6 +1826,105 @@
1679
1826
  "minLength": 1,
1680
1827
  "maxLength": 300
1681
1828
  },
1829
+ "modelPolicy": {
1830
+ "type": "object",
1831
+ "properties": {
1832
+ "version": {
1833
+ "type": "number",
1834
+ "enum": [
1835
+ 1
1836
+ ],
1837
+ "default": 1
1838
+ },
1839
+ "roles": {
1840
+ "type": "object",
1841
+ "properties": {
1842
+ "subagent": {
1843
+ "type": "string",
1844
+ "minLength": 1,
1845
+ "maxLength": 300,
1846
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1847
+ },
1848
+ "fast": {
1849
+ "type": "string",
1850
+ "minLength": 1,
1851
+ "maxLength": 300,
1852
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1853
+ },
1854
+ "planning": {
1855
+ "type": "string",
1856
+ "minLength": 1,
1857
+ "maxLength": 300,
1858
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1859
+ },
1860
+ "review": {
1861
+ "type": "string",
1862
+ "minLength": 1,
1863
+ "maxLength": 300,
1864
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1865
+ },
1866
+ "summary": {
1867
+ "type": "string",
1868
+ "minLength": 1,
1869
+ "maxLength": 300,
1870
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1871
+ },
1872
+ "compaction": {
1873
+ "type": "string",
1874
+ "minLength": 1,
1875
+ "maxLength": 300,
1876
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1877
+ },
1878
+ "weak": {
1879
+ "type": "string",
1880
+ "minLength": 1,
1881
+ "maxLength": 300,
1882
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1883
+ },
1884
+ "editor": {
1885
+ "type": "string",
1886
+ "minLength": 1,
1887
+ "maxLength": 300,
1888
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1889
+ }
1890
+ },
1891
+ "additionalProperties": false
1892
+ },
1893
+ "allowedModels": {
1894
+ "type": "array",
1895
+ "items": {
1896
+ "type": "string",
1897
+ "minLength": 1,
1898
+ "maxLength": 300,
1899
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1900
+ },
1901
+ "maxItems": 500
1902
+ },
1903
+ "aliases": {
1904
+ "type": "object",
1905
+ "additionalProperties": {
1906
+ "type": "string",
1907
+ "minLength": 1,
1908
+ "maxLength": 300,
1909
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1910
+ }
1911
+ },
1912
+ "fallbacks": {
1913
+ "type": "object",
1914
+ "additionalProperties": {
1915
+ "type": "array",
1916
+ "items": {
1917
+ "type": "string",
1918
+ "minLength": 1,
1919
+ "maxLength": 300,
1920
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
1921
+ },
1922
+ "maxItems": 20
1923
+ }
1924
+ }
1925
+ },
1926
+ "additionalProperties": false
1927
+ },
1682
1928
  "version": {
1683
1929
  "type": "integer",
1684
1930
  "exclusiveMinimum": true,
@@ -1752,6 +1998,15 @@
1752
1998
  "maxLength": 100
1753
1999
  },
1754
2000
  "maxItems": 100
2001
+ },
2002
+ "supportedGenerationMethods": {
2003
+ "type": "array",
2004
+ "items": {
2005
+ "type": "string",
2006
+ "minLength": 1,
2007
+ "maxLength": 100
2008
+ },
2009
+ "maxItems": 100
1755
2010
  }
1756
2011
  },
1757
2012
  "required": [
@@ -1760,6 +2015,175 @@
1760
2015
  ],
1761
2016
  "additionalProperties": false
1762
2017
  },
2018
+ "ModelPolicy": {
2019
+ "type": "object",
2020
+ "properties": {
2021
+ "version": {
2022
+ "type": "number",
2023
+ "enum": [
2024
+ 1
2025
+ ],
2026
+ "default": 1
2027
+ },
2028
+ "roles": {
2029
+ "type": "object",
2030
+ "properties": {
2031
+ "subagent": {
2032
+ "type": "string",
2033
+ "minLength": 1,
2034
+ "maxLength": 300,
2035
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2036
+ },
2037
+ "fast": {
2038
+ "type": "string",
2039
+ "minLength": 1,
2040
+ "maxLength": 300,
2041
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2042
+ },
2043
+ "planning": {
2044
+ "type": "string",
2045
+ "minLength": 1,
2046
+ "maxLength": 300,
2047
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2048
+ },
2049
+ "review": {
2050
+ "type": "string",
2051
+ "minLength": 1,
2052
+ "maxLength": 300,
2053
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2054
+ },
2055
+ "summary": {
2056
+ "type": "string",
2057
+ "minLength": 1,
2058
+ "maxLength": 300,
2059
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2060
+ },
2061
+ "compaction": {
2062
+ "type": "string",
2063
+ "minLength": 1,
2064
+ "maxLength": 300,
2065
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2066
+ },
2067
+ "weak": {
2068
+ "type": "string",
2069
+ "minLength": 1,
2070
+ "maxLength": 300,
2071
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2072
+ },
2073
+ "editor": {
2074
+ "type": "string",
2075
+ "minLength": 1,
2076
+ "maxLength": 300,
2077
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2078
+ }
2079
+ },
2080
+ "additionalProperties": false
2081
+ },
2082
+ "allowedModels": {
2083
+ "type": "array",
2084
+ "items": {
2085
+ "type": "string",
2086
+ "minLength": 1,
2087
+ "maxLength": 300,
2088
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2089
+ },
2090
+ "maxItems": 500
2091
+ },
2092
+ "aliases": {
2093
+ "type": "object",
2094
+ "additionalProperties": {
2095
+ "type": "string",
2096
+ "minLength": 1,
2097
+ "maxLength": 300,
2098
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2099
+ }
2100
+ },
2101
+ "fallbacks": {
2102
+ "type": "object",
2103
+ "additionalProperties": {
2104
+ "type": "array",
2105
+ "items": {
2106
+ "type": "string",
2107
+ "minLength": 1,
2108
+ "maxLength": 300,
2109
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2110
+ },
2111
+ "maxItems": 20
2112
+ }
2113
+ }
2114
+ },
2115
+ "additionalProperties": false
2116
+ },
2117
+ "RoutingEvent": {
2118
+ "type": "object",
2119
+ "properties": {
2120
+ "at": {
2121
+ "type": "string",
2122
+ "format": "date-time"
2123
+ },
2124
+ "requestId": {
2125
+ "type": "string",
2126
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
2127
+ },
2128
+ "requestedModel": {
2129
+ "type": "string",
2130
+ "minLength": 1,
2131
+ "maxLength": 300,
2132
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2133
+ },
2134
+ "resolvedModel": {
2135
+ "type": "string",
2136
+ "minLength": 1,
2137
+ "maxLength": 300,
2138
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2139
+ },
2140
+ "reportedModel": {
2141
+ "type": "string",
2142
+ "minLength": 1,
2143
+ "maxLength": 300,
2144
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2145
+ },
2146
+ "decision": {
2147
+ "type": "string",
2148
+ "enum": [
2149
+ "allow",
2150
+ "alias",
2151
+ "reject",
2152
+ "fallback"
2153
+ ]
2154
+ },
2155
+ "role": {
2156
+ "type": "string",
2157
+ "enum": [
2158
+ "main",
2159
+ "subagent",
2160
+ "fast",
2161
+ "planning",
2162
+ "review",
2163
+ "summary",
2164
+ "compaction",
2165
+ "weak",
2166
+ "editor"
2167
+ ]
2168
+ },
2169
+ "reason": {
2170
+ "type": "string",
2171
+ "pattern": "^[a-z][a-z0-9_]{0,63}$"
2172
+ },
2173
+ "upstreamStatus": {
2174
+ "type": "integer",
2175
+ "minimum": 100,
2176
+ "maximum": 599
2177
+ }
2178
+ },
2179
+ "required": [
2180
+ "at",
2181
+ "requestId",
2182
+ "requestedModel",
2183
+ "decision"
2184
+ ],
2185
+ "additionalProperties": false
2186
+ },
1763
2187
  "ModelPage": {
1764
2188
  "type": "object",
1765
2189
  "properties": {
@@ -1819,6 +2243,15 @@
1819
2243
  },
1820
2244
  "maxItems": 100
1821
2245
  },
2246
+ "supportedGenerationMethods": {
2247
+ "type": "array",
2248
+ "items": {
2249
+ "type": "string",
2250
+ "minLength": 1,
2251
+ "maxLength": 100
2252
+ },
2253
+ "maxItems": 100
2254
+ },
1822
2255
  "codingEligible": {
1823
2256
  "type": "boolean"
1824
2257
  }
@@ -1919,6 +2352,15 @@
1919
2352
  "maxLength": 100
1920
2353
  },
1921
2354
  "maxItems": 100
2355
+ },
2356
+ "supportedGenerationMethods": {
2357
+ "type": "array",
2358
+ "items": {
2359
+ "type": "string",
2360
+ "minLength": 1,
2361
+ "maxLength": 100
2362
+ },
2363
+ "maxItems": 100
1922
2364
  }
1923
2365
  },
1924
2366
  "required": [
@@ -1970,7 +2412,8 @@
1970
2412
  "enum": [
1971
2413
  "anthropic-messages",
1972
2414
  "openai-responses",
1973
- "openai-chat"
2415
+ "openai-chat",
2416
+ "gemini-generate-content"
1974
2417
  ]
1975
2418
  },
1976
2419
  "credentialEnv": {
@@ -1981,7 +2424,8 @@
1981
2424
  "type": "string",
1982
2425
  "enum": [
1983
2426
  "bearer",
1984
- "x-api-key"
2427
+ "x-api-key",
2428
+ "api-key"
1985
2429
  ],
1986
2430
  "default": "bearer"
1987
2431
  },
@@ -1998,6 +2442,7 @@
1998
2442
  "together",
1999
2443
  "fireworks",
2000
2444
  "dashscope",
2445
+ "gemini",
2001
2446
  "none"
2002
2447
  ]
2003
2448
  },
@@ -2006,6 +2451,7 @@
2006
2451
  "enum": [
2007
2452
  "bearer",
2008
2453
  "x-api-key",
2454
+ "api-key",
2009
2455
  "none"
2010
2456
  ]
2011
2457
  },
@@ -2078,6 +2524,15 @@
2078
2524
  "maxLength": 100
2079
2525
  },
2080
2526
  "maxItems": 100
2527
+ },
2528
+ "supportedGenerationMethods": {
2529
+ "type": "array",
2530
+ "items": {
2531
+ "type": "string",
2532
+ "minLength": 1,
2533
+ "maxLength": 100
2534
+ },
2535
+ "maxItems": 100
2081
2536
  }
2082
2537
  },
2083
2538
  "required": [
@@ -2130,8 +2585,17 @@
2130
2585
  "claude",
2131
2586
  "codex",
2132
2587
  "grok",
2588
+ "opencode",
2133
2589
  "opencode2",
2134
- "pi"
2590
+ "pi",
2591
+ "omp",
2592
+ "dsh",
2593
+ "cline",
2594
+ "hermes",
2595
+ "prime-agent",
2596
+ "gemini",
2597
+ "aider",
2598
+ "kilo"
2135
2599
  ]
2136
2600
  },
2137
2601
  "model": {
@@ -2139,6 +2603,105 @@
2139
2603
  "minLength": 1,
2140
2604
  "maxLength": 300
2141
2605
  },
2606
+ "modelPolicy": {
2607
+ "type": "object",
2608
+ "properties": {
2609
+ "version": {
2610
+ "type": "number",
2611
+ "enum": [
2612
+ 1
2613
+ ],
2614
+ "default": 1
2615
+ },
2616
+ "roles": {
2617
+ "type": "object",
2618
+ "properties": {
2619
+ "subagent": {
2620
+ "type": "string",
2621
+ "minLength": 1,
2622
+ "maxLength": 300,
2623
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2624
+ },
2625
+ "fast": {
2626
+ "type": "string",
2627
+ "minLength": 1,
2628
+ "maxLength": 300,
2629
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2630
+ },
2631
+ "planning": {
2632
+ "type": "string",
2633
+ "minLength": 1,
2634
+ "maxLength": 300,
2635
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2636
+ },
2637
+ "review": {
2638
+ "type": "string",
2639
+ "minLength": 1,
2640
+ "maxLength": 300,
2641
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2642
+ },
2643
+ "summary": {
2644
+ "type": "string",
2645
+ "minLength": 1,
2646
+ "maxLength": 300,
2647
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2648
+ },
2649
+ "compaction": {
2650
+ "type": "string",
2651
+ "minLength": 1,
2652
+ "maxLength": 300,
2653
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2654
+ },
2655
+ "weak": {
2656
+ "type": "string",
2657
+ "minLength": 1,
2658
+ "maxLength": 300,
2659
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2660
+ },
2661
+ "editor": {
2662
+ "type": "string",
2663
+ "minLength": 1,
2664
+ "maxLength": 300,
2665
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2666
+ }
2667
+ },
2668
+ "additionalProperties": false
2669
+ },
2670
+ "allowedModels": {
2671
+ "type": "array",
2672
+ "items": {
2673
+ "type": "string",
2674
+ "minLength": 1,
2675
+ "maxLength": 300,
2676
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2677
+ },
2678
+ "maxItems": 500
2679
+ },
2680
+ "aliases": {
2681
+ "type": "object",
2682
+ "additionalProperties": {
2683
+ "type": "string",
2684
+ "minLength": 1,
2685
+ "maxLength": 300,
2686
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2687
+ }
2688
+ },
2689
+ "fallbacks": {
2690
+ "type": "object",
2691
+ "additionalProperties": {
2692
+ "type": "array",
2693
+ "items": {
2694
+ "type": "string",
2695
+ "minLength": 1,
2696
+ "maxLength": 300,
2697
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2698
+ },
2699
+ "maxItems": 20
2700
+ }
2701
+ }
2702
+ },
2703
+ "additionalProperties": false
2704
+ },
2142
2705
  "version": {
2143
2706
  "type": "integer",
2144
2707
  "exclusiveMinimum": true,
@@ -2217,6 +2780,15 @@
2217
2780
  "maxLength": 100
2218
2781
  },
2219
2782
  "maxItems": 100
2783
+ },
2784
+ "supportedGenerationMethods": {
2785
+ "type": "array",
2786
+ "items": {
2787
+ "type": "string",
2788
+ "minLength": 1,
2789
+ "maxLength": 100
2790
+ },
2791
+ "maxItems": 100
2220
2792
  }
2221
2793
  },
2222
2794
  "required": [
@@ -2266,6 +2838,12 @@
2266
2838
  "RunInput": {
2267
2839
  "type": "object",
2268
2840
  "properties": {
2841
+ "modelPolicyVersion": {
2842
+ "type": "number",
2843
+ "enum": [
2844
+ 1
2845
+ ]
2846
+ },
2269
2847
  "profileId": {
2270
2848
  "type": "string",
2271
2849
  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,79}$"
@@ -2276,8 +2854,17 @@
2276
2854
  "claude",
2277
2855
  "codex",
2278
2856
  "grok",
2857
+ "opencode",
2279
2858
  "opencode2",
2280
- "pi"
2859
+ "pi",
2860
+ "omp",
2861
+ "dsh",
2862
+ "cline",
2863
+ "hermes",
2864
+ "prime-agent",
2865
+ "gemini",
2866
+ "aider",
2867
+ "kilo"
2281
2868
  ]
2282
2869
  },
2283
2870
  "model": {
@@ -2285,12 +2872,112 @@
2285
2872
  "minLength": 1,
2286
2873
  "maxLength": 300
2287
2874
  },
2875
+ "modelPolicy": {
2876
+ "type": "object",
2877
+ "properties": {
2878
+ "version": {
2879
+ "type": "number",
2880
+ "enum": [
2881
+ 1
2882
+ ],
2883
+ "default": 1
2884
+ },
2885
+ "roles": {
2886
+ "type": "object",
2887
+ "properties": {
2888
+ "subagent": {
2889
+ "type": "string",
2890
+ "minLength": 1,
2891
+ "maxLength": 300,
2892
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2893
+ },
2894
+ "fast": {
2895
+ "type": "string",
2896
+ "minLength": 1,
2897
+ "maxLength": 300,
2898
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2899
+ },
2900
+ "planning": {
2901
+ "type": "string",
2902
+ "minLength": 1,
2903
+ "maxLength": 300,
2904
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2905
+ },
2906
+ "review": {
2907
+ "type": "string",
2908
+ "minLength": 1,
2909
+ "maxLength": 300,
2910
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2911
+ },
2912
+ "summary": {
2913
+ "type": "string",
2914
+ "minLength": 1,
2915
+ "maxLength": 300,
2916
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2917
+ },
2918
+ "compaction": {
2919
+ "type": "string",
2920
+ "minLength": 1,
2921
+ "maxLength": 300,
2922
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2923
+ },
2924
+ "weak": {
2925
+ "type": "string",
2926
+ "minLength": 1,
2927
+ "maxLength": 300,
2928
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2929
+ },
2930
+ "editor": {
2931
+ "type": "string",
2932
+ "minLength": 1,
2933
+ "maxLength": 300,
2934
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2935
+ }
2936
+ },
2937
+ "additionalProperties": false
2938
+ },
2939
+ "allowedModels": {
2940
+ "type": "array",
2941
+ "items": {
2942
+ "type": "string",
2943
+ "minLength": 1,
2944
+ "maxLength": 300,
2945
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2946
+ },
2947
+ "maxItems": 500
2948
+ },
2949
+ "aliases": {
2950
+ "type": "object",
2951
+ "additionalProperties": {
2952
+ "type": "string",
2953
+ "minLength": 1,
2954
+ "maxLength": 300,
2955
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2956
+ }
2957
+ },
2958
+ "fallbacks": {
2959
+ "type": "object",
2960
+ "additionalProperties": {
2961
+ "type": "array",
2962
+ "items": {
2963
+ "type": "string",
2964
+ "minLength": 1,
2965
+ "maxLength": 300,
2966
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
2967
+ },
2968
+ "maxItems": 20
2969
+ }
2970
+ }
2971
+ },
2972
+ "additionalProperties": false
2973
+ },
2288
2974
  "planToken": {
2289
2975
  "type": "string",
2290
2976
  "pattern": "^[a-f0-9]{64}$"
2291
2977
  }
2292
2978
  },
2293
2979
  "required": [
2980
+ "modelPolicyVersion",
2294
2981
  "profileId",
2295
2982
  "harness",
2296
2983
  "model",
@@ -2313,6 +3000,85 @@
2313
3000
  "type": "integer",
2314
3001
  "minimum": 0,
2315
3002
  "maximum": 255
3003
+ },
3004
+ "routingEvents": {
3005
+ "type": "array",
3006
+ "items": {
3007
+ "type": "object",
3008
+ "properties": {
3009
+ "at": {
3010
+ "type": "string",
3011
+ "format": "date-time"
3012
+ },
3013
+ "requestId": {
3014
+ "type": "string",
3015
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
3016
+ },
3017
+ "requestedModel": {
3018
+ "type": "string",
3019
+ "minLength": 1,
3020
+ "maxLength": 300,
3021
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
3022
+ },
3023
+ "resolvedModel": {
3024
+ "type": "string",
3025
+ "minLength": 1,
3026
+ "maxLength": 300,
3027
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
3028
+ },
3029
+ "reportedModel": {
3030
+ "type": "string",
3031
+ "minLength": 1,
3032
+ "maxLength": 300,
3033
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
3034
+ },
3035
+ "decision": {
3036
+ "type": "string",
3037
+ "enum": [
3038
+ "allow",
3039
+ "alias",
3040
+ "reject",
3041
+ "fallback"
3042
+ ]
3043
+ },
3044
+ "role": {
3045
+ "type": "string",
3046
+ "enum": [
3047
+ "main",
3048
+ "subagent",
3049
+ "fast",
3050
+ "planning",
3051
+ "review",
3052
+ "summary",
3053
+ "compaction",
3054
+ "weak",
3055
+ "editor"
3056
+ ]
3057
+ },
3058
+ "reason": {
3059
+ "type": "string",
3060
+ "pattern": "^[a-z][a-z0-9_]{0,63}$"
3061
+ },
3062
+ "upstreamStatus": {
3063
+ "type": "integer",
3064
+ "minimum": 100,
3065
+ "maximum": 599
3066
+ }
3067
+ },
3068
+ "required": [
3069
+ "at",
3070
+ "requestId",
3071
+ "requestedModel",
3072
+ "decision"
3073
+ ],
3074
+ "additionalProperties": false
3075
+ },
3076
+ "maxItems": 1000
3077
+ },
3078
+ "routingEventsDropped": {
3079
+ "type": "integer",
3080
+ "minimum": 0,
3081
+ "maximum": 1000000
2316
3082
  }
2317
3083
  },
2318
3084
  "required": [
@@ -2324,6 +3090,12 @@
2324
3090
  "Run": {
2325
3091
  "type": "object",
2326
3092
  "properties": {
3093
+ "modelPolicyVersion": {
3094
+ "type": "number",
3095
+ "enum": [
3096
+ 1
3097
+ ]
3098
+ },
2327
3099
  "profileId": {
2328
3100
  "type": "string",
2329
3101
  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,79}$"
@@ -2334,8 +3106,17 @@
2334
3106
  "claude",
2335
3107
  "codex",
2336
3108
  "grok",
3109
+ "opencode",
2337
3110
  "opencode2",
2338
- "pi"
3111
+ "pi",
3112
+ "omp",
3113
+ "dsh",
3114
+ "cline",
3115
+ "hermes",
3116
+ "prime-agent",
3117
+ "gemini",
3118
+ "aider",
3119
+ "kilo"
2339
3120
  ]
2340
3121
  },
2341
3122
  "model": {
@@ -2343,6 +3124,105 @@
2343
3124
  "minLength": 1,
2344
3125
  "maxLength": 300
2345
3126
  },
3127
+ "modelPolicy": {
3128
+ "type": "object",
3129
+ "properties": {
3130
+ "version": {
3131
+ "type": "number",
3132
+ "enum": [
3133
+ 1
3134
+ ],
3135
+ "default": 1
3136
+ },
3137
+ "roles": {
3138
+ "type": "object",
3139
+ "properties": {
3140
+ "subagent": {
3141
+ "type": "string",
3142
+ "minLength": 1,
3143
+ "maxLength": 300,
3144
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
3145
+ },
3146
+ "fast": {
3147
+ "type": "string",
3148
+ "minLength": 1,
3149
+ "maxLength": 300,
3150
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
3151
+ },
3152
+ "planning": {
3153
+ "type": "string",
3154
+ "minLength": 1,
3155
+ "maxLength": 300,
3156
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
3157
+ },
3158
+ "review": {
3159
+ "type": "string",
3160
+ "minLength": 1,
3161
+ "maxLength": 300,
3162
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
3163
+ },
3164
+ "summary": {
3165
+ "type": "string",
3166
+ "minLength": 1,
3167
+ "maxLength": 300,
3168
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
3169
+ },
3170
+ "compaction": {
3171
+ "type": "string",
3172
+ "minLength": 1,
3173
+ "maxLength": 300,
3174
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
3175
+ },
3176
+ "weak": {
3177
+ "type": "string",
3178
+ "minLength": 1,
3179
+ "maxLength": 300,
3180
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
3181
+ },
3182
+ "editor": {
3183
+ "type": "string",
3184
+ "minLength": 1,
3185
+ "maxLength": 300,
3186
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
3187
+ }
3188
+ },
3189
+ "additionalProperties": false
3190
+ },
3191
+ "allowedModels": {
3192
+ "type": "array",
3193
+ "items": {
3194
+ "type": "string",
3195
+ "minLength": 1,
3196
+ "maxLength": 300,
3197
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
3198
+ },
3199
+ "maxItems": 500
3200
+ },
3201
+ "aliases": {
3202
+ "type": "object",
3203
+ "additionalProperties": {
3204
+ "type": "string",
3205
+ "minLength": 1,
3206
+ "maxLength": 300,
3207
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
3208
+ }
3209
+ },
3210
+ "fallbacks": {
3211
+ "type": "object",
3212
+ "additionalProperties": {
3213
+ "type": "array",
3214
+ "items": {
3215
+ "type": "string",
3216
+ "minLength": 1,
3217
+ "maxLength": 300,
3218
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
3219
+ },
3220
+ "maxItems": 20
3221
+ }
3222
+ }
3223
+ },
3224
+ "additionalProperties": false
3225
+ },
2346
3226
  "planToken": {
2347
3227
  "type": "string",
2348
3228
  "pattern": "^[a-f0-9]{64}$"
@@ -2390,6 +3270,85 @@
2390
3270
  },
2391
3271
  "exitCode": {
2392
3272
  "type": "integer"
3273
+ },
3274
+ "routingEvents": {
3275
+ "type": "array",
3276
+ "items": {
3277
+ "type": "object",
3278
+ "properties": {
3279
+ "at": {
3280
+ "type": "string",
3281
+ "format": "date-time"
3282
+ },
3283
+ "requestId": {
3284
+ "type": "string",
3285
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
3286
+ },
3287
+ "requestedModel": {
3288
+ "type": "string",
3289
+ "minLength": 1,
3290
+ "maxLength": 300,
3291
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
3292
+ },
3293
+ "resolvedModel": {
3294
+ "type": "string",
3295
+ "minLength": 1,
3296
+ "maxLength": 300,
3297
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
3298
+ },
3299
+ "reportedModel": {
3300
+ "type": "string",
3301
+ "minLength": 1,
3302
+ "maxLength": 300,
3303
+ "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
3304
+ },
3305
+ "decision": {
3306
+ "type": "string",
3307
+ "enum": [
3308
+ "allow",
3309
+ "alias",
3310
+ "reject",
3311
+ "fallback"
3312
+ ]
3313
+ },
3314
+ "role": {
3315
+ "type": "string",
3316
+ "enum": [
3317
+ "main",
3318
+ "subagent",
3319
+ "fast",
3320
+ "planning",
3321
+ "review",
3322
+ "summary",
3323
+ "compaction",
3324
+ "weak",
3325
+ "editor"
3326
+ ]
3327
+ },
3328
+ "reason": {
3329
+ "type": "string",
3330
+ "pattern": "^[a-z][a-z0-9_]{0,63}$"
3331
+ },
3332
+ "upstreamStatus": {
3333
+ "type": "integer",
3334
+ "minimum": 100,
3335
+ "maximum": 599
3336
+ }
3337
+ },
3338
+ "required": [
3339
+ "at",
3340
+ "requestId",
3341
+ "requestedModel",
3342
+ "decision"
3343
+ ],
3344
+ "additionalProperties": false
3345
+ },
3346
+ "maxItems": 1000
3347
+ },
3348
+ "routingEventsDropped": {
3349
+ "type": "integer",
3350
+ "minimum": 0,
3351
+ "maximum": 1000000
2393
3352
  }
2394
3353
  },
2395
3354
  "required": [