@hasna/switcher 0.1.2 → 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.
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.2",
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": [
@@ -1676,6 +1676,105 @@
1676
1676
  "type": "string",
1677
1677
  "minLength": 1,
1678
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
1679
1778
  }
1680
1779
  },
1681
1780
  "required": [
@@ -1727,6 +1826,105 @@
1727
1826
  "minLength": 1,
1728
1827
  "maxLength": 300
1729
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
+ },
1730
1928
  "version": {
1731
1929
  "type": "integer",
1732
1930
  "exclusiveMinimum": true,
@@ -1817,6 +2015,175 @@
1817
2015
  ],
1818
2016
  "additionalProperties": false
1819
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
+ },
1820
2187
  "ModelPage": {
1821
2188
  "type": "object",
1822
2189
  "properties": {
@@ -2236,6 +2603,105 @@
2236
2603
  "minLength": 1,
2237
2604
  "maxLength": 300
2238
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
+ },
2239
2705
  "version": {
2240
2706
  "type": "integer",
2241
2707
  "exclusiveMinimum": true,
@@ -2372,6 +2838,12 @@
2372
2838
  "RunInput": {
2373
2839
  "type": "object",
2374
2840
  "properties": {
2841
+ "modelPolicyVersion": {
2842
+ "type": "number",
2843
+ "enum": [
2844
+ 1
2845
+ ]
2846
+ },
2375
2847
  "profileId": {
2376
2848
  "type": "string",
2377
2849
  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,79}$"
@@ -2400,12 +2872,112 @@
2400
2872
  "minLength": 1,
2401
2873
  "maxLength": 300
2402
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
+ },
2403
2974
  "planToken": {
2404
2975
  "type": "string",
2405
2976
  "pattern": "^[a-f0-9]{64}$"
2406
2977
  }
2407
2978
  },
2408
2979
  "required": [
2980
+ "modelPolicyVersion",
2409
2981
  "profileId",
2410
2982
  "harness",
2411
2983
  "model",
@@ -2428,6 +3000,85 @@
2428
3000
  "type": "integer",
2429
3001
  "minimum": 0,
2430
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
2431
3082
  }
2432
3083
  },
2433
3084
  "required": [
@@ -2439,6 +3090,12 @@
2439
3090
  "Run": {
2440
3091
  "type": "object",
2441
3092
  "properties": {
3093
+ "modelPolicyVersion": {
3094
+ "type": "number",
3095
+ "enum": [
3096
+ 1
3097
+ ]
3098
+ },
2442
3099
  "profileId": {
2443
3100
  "type": "string",
2444
3101
  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,79}$"
@@ -2467,6 +3124,105 @@
2467
3124
  "minLength": 1,
2468
3125
  "maxLength": 300
2469
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
+ },
2470
3226
  "planToken": {
2471
3227
  "type": "string",
2472
3228
  "pattern": "^[a-f0-9]{64}$"
@@ -2514,6 +3270,85 @@
2514
3270
  },
2515
3271
  "exitCode": {
2516
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
2517
3352
  }
2518
3353
  },
2519
3354
  "required": [