cli-funnel 0.1.0

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.
@@ -0,0 +1,51 @@
1
+ [
2
+ {"id":"gpt-5.3-codex","name":"Codex 5.3","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"}],"defaultEffort":"medium","contextWindows":[],"fast":true},
3
+ {"id":"gpt-5.2","name":"GPT-5.2","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"}],"defaultEffort":"medium","contextWindows":[],"fast":true},
4
+ {"id":"composer-2.5","name":"Composer 2.5","efforts":[],"contextWindows":[],"fast":true},
5
+ {"id":"claude-opus-5-thinking","name":"Claude Opus 5 1M Thinking","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"},{"id":"max","label":"Max"}],"defaultEffort":"medium","contextWindows":[],"fast":true},
6
+ {"id":"gpt-5.6-sol","name":"GPT-5.6 Sol 1M","efforts":[{"id":"none","label":"None"},{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"},{"id":"max","label":"Max"}],"defaultEffort":"medium","contextWindows":[],"fast":true},
7
+ {"id":"claude-fable-5-thinking","name":"Claude Fable 5 1M Thinking (NO ZDR)","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"},{"id":"max","label":"Max"}],"defaultEffort":"medium","contextWindows":[],"fast":false},
8
+ {"id":"cursor-grok-4.5","name":"Grok 4.5","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"}],"defaultEffort":"medium","contextWindows":[],"fast":true},
9
+ {"id":"gemini-3.7-flash","name":"Gemini 3.7 Flash","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"}],"defaultEffort":"medium","contextWindows":[],"fast":false},
10
+ {"id":"claude-sonnet-5-thinking","name":"Claude Sonnet 5 1M Thinking","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"},{"id":"max","label":"Max"}],"defaultEffort":"medium","contextWindows":[],"fast":false},
11
+ {"id":"gpt-5.6-luna","name":"GPT-5.6 Luna 1M","efforts":[{"id":"none","label":"None"},{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"},{"id":"max","label":"Max"}],"defaultEffort":"medium","contextWindows":[],"fast":true},
12
+ {"id":"grok-4.7","name":"Grok 4.7","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"}],"defaultEffort":"medium","contextWindows":[],"fast":true},
13
+ {"id":"cursor-grok-4.6","name":"Grok 4.6","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"}],"defaultEffort":"medium","contextWindows":[],"fast":true},
14
+ {"id":"claude-opus-5-5","name":"Claude Opus 5.5 1M","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"},{"id":"max","label":"Max"}],"defaultEffort":"medium","contextWindows":[],"fast":true},
15
+ {"id":"claude-opus-5","name":"Claude Opus 5 1M","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"}],"defaultEffort":"medium","contextWindows":[],"fast":true},
16
+ {"id":"claude-opus-4-8","name":"Claude Opus 4.8 1M","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"},{"id":"max","label":"Max"}],"defaultEffort":"medium","contextWindows":[],"fast":true},
17
+ {"id":"claude-opus-4-8-thinking","name":"Claude Opus 4.8 1M Thinking","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"},{"id":"max","label":"Max"}],"defaultEffort":"medium","contextWindows":[],"fast":true},
18
+ {"id":"gpt-5.5","name":"GPT-5.5","efforts":[{"id":"none","label":"None"},{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"}],"defaultEffort":"medium","contextWindows":[],"fast":true},
19
+ {"id":"claude-fable-5-1","name":"Claude Fable 5.1 1M (NO ZDR)","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"},{"id":"max","label":"Max"}],"defaultEffort":"medium","contextWindows":[],"fast":false},
20
+ {"id":"claude-fable-5-1-thinking","name":"Claude Fable 5.1 1M Thinking (NO ZDR)","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"},{"id":"max","label":"Max"}],"defaultEffort":"medium","contextWindows":[],"fast":false},
21
+ {"id":"claude-fable-5","name":"Claude Fable 5 1M (NO ZDR)","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"},{"id":"max","label":"Max"}],"defaultEffort":"medium","contextWindows":[],"fast":false},
22
+ {"id":"gemini-3.8-flash","name":"Gemini 3.8 Flash","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"}],"defaultEffort":"medium","contextWindows":[],"fast":false},
23
+ {"id":"muse-spark-1.3","name":"Muse Spark 1.3 1M","efforts":[{"id":"minimal","label":"Minimal"},{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"},{"id":"max","label":"Max"}],"defaultEffort":"medium","contextWindows":[],"fast":false},
24
+ {"id":"gpt-5.6-terra","name":"GPT-5.6 Terra 1M","efforts":[{"id":"none","label":"None"},{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"},{"id":"max","label":"Max"}],"defaultEffort":"medium","contextWindows":[],"fast":true},
25
+ {"id":"claude-sonnet-5-5","name":"Claude Sonnet 5.5","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"},{"id":"max","label":"Max"}],"defaultEffort":"medium","contextWindows":[],"fast":false},
26
+ {"id":"claude-sonnet-5","name":"Claude Sonnet 5 1M","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"},{"id":"max","label":"Max"}],"defaultEffort":"medium","contextWindows":[],"fast":false},
27
+ {"id":"claude-4.6-sonnet","name":"Claude Sonnet 4.6 1M","efforts":[{"id":"medium","label":"Medium"}],"defaultEffort":"medium","contextWindows":[],"fast":false},
28
+ {"id":"claude-4.6-sonnet-thinking","name":"Claude Sonnet 4.6 1M Thinking","efforts":[{"id":"medium","label":"Medium"}],"defaultEffort":"medium","contextWindows":[],"fast":false},
29
+ {"id":"claude-opus-4-7","name":"Claude Opus 4.7 1M","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"},{"id":"max","label":"Max"}],"defaultEffort":"medium","contextWindows":[],"fast":true},
30
+ {"id":"claude-opus-4-7-thinking","name":"Claude Opus 4.7 1M Thinking","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"},{"id":"max","label":"Max"}],"defaultEffort":"medium","contextWindows":[],"fast":true},
31
+ {"id":"gpt-5.4","name":"GPT-5.4","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"}],"defaultEffort":"medium","contextWindows":[],"fast":true},
32
+ {"id":"claude-4.6-opus","name":"Claude Opus 4.6 1M","efforts":[{"id":"high","label":"High"},{"id":"max","label":"Max"}],"defaultEffort":"high","contextWindows":[],"fast":false},
33
+ {"id":"claude-4.6-opus-thinking","name":"Claude Opus 4.6 1M Thinking","efforts":[{"id":"high","label":"High"},{"id":"max","label":"Max"}],"defaultEffort":"high","contextWindows":[],"fast":false},
34
+ {"id":"claude-4.5-opus","name":"Claude Opus 4.5","efforts":[{"id":"high","label":"High"}],"defaultEffort":"high","contextWindows":[],"fast":false},
35
+ {"id":"claude-4.5-opus-thinking","name":"Claude Opus 4.5 Thinking","efforts":[{"id":"high","label":"High"}],"defaultEffort":"high","contextWindows":[],"fast":false},
36
+ {"id":"gemini-3.6-flash","name":"Gemini 3.6 Flash","efforts":[{"id":"minimal","label":"Minimal"},{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"}],"defaultEffort":"medium","contextWindows":[],"fast":false},
37
+ {"id":"gemini-3.1-pro","name":"Gemini 3.1 Pro","efforts":[],"contextWindows":[],"fast":false},
38
+ {"id":"gpt-5.4-mini","name":"GPT-5.4 Mini","efforts":[{"id":"none","label":"None"},{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"}],"defaultEffort":"medium","contextWindows":[],"fast":false},
39
+ {"id":"gpt-5.4-nano","name":"GPT-5.4 Nano","efforts":[{"id":"none","label":"None"},{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"},{"id":"xhigh","label":"Extra High"}],"defaultEffort":"medium","contextWindows":[],"fast":false},
40
+ {"id":"claude-4.5-sonnet","name":"Claude Sonnet 4.5","efforts":[],"contextWindows":[],"fast":false},
41
+ {"id":"claude-4.5-sonnet-thinking","name":"Claude Sonnet 4.5 Thinking","efforts":[],"contextWindows":[],"fast":false},
42
+ {"id":"gpt-5.1","name":"GPT-5.1","efforts":[{"id":"low","label":"Low"},{"id":"medium","label":"Medium"},{"id":"high","label":"High"}],"defaultEffort":"medium","contextWindows":[],"fast":false},
43
+ {"id":"gemini-3-flash","name":"Gemini 3 Flash","efforts":[],"contextWindows":[],"fast":false},
44
+ {"id":"gemini-3.5-flash","name":"Gemini 3.5 Flash","efforts":[],"contextWindows":[],"fast":false},
45
+ {"id":"claude-4-sonnet","name":"Claude Sonnet 4","efforts":[],"contextWindows":[],"fast":false},
46
+ {"id":"claude-4-sonnet-thinking","name":"Claude Sonnet 4 Thinking","efforts":[],"contextWindows":[],"fast":false},
47
+ {"id":"gpt-5-mini","name":"GPT-5 Mini","efforts":[],"contextWindows":[],"fast":false},
48
+ {"id":"kimi-k3","name":"Kimi K3","efforts":[{"id":"low","label":"Low"},{"id":"high","label":"High"},{"id":"max","label":"Max"}],"defaultEffort":"high","contextWindows":[],"fast":false},
49
+ {"id":"kimi-k2.7-code","name":"Kimi K2.7 Code","efforts":[],"contextWindows":[],"fast":false},
50
+ {"id":"glm-5.2","name":"GLM 5.2","efforts":[{"id":"high","label":"High"},{"id":"max","label":"Max"}],"defaultEffort":"high","contextWindows":[],"fast":false}
51
+ ]
@@ -0,0 +1,103 @@
1
+ [
2
+ {
3
+ "contextWindows": [],
4
+ "fast": false,
5
+ "id": "gemini-3.8-flash",
6
+ "name": "Gemini 3.8 Flash",
7
+ "efforts": [
8
+ {
9
+ "id": "low",
10
+ "label": "Low"
11
+ },
12
+ {
13
+ "id": "medium",
14
+ "label": "Medium"
15
+ },
16
+ {
17
+ "id": "high",
18
+ "label": "High"
19
+ }
20
+ ],
21
+ "defaultEffort": "high"
22
+ },
23
+ {
24
+ "contextWindows": [],
25
+ "fast": false,
26
+ "id": "gemini-3.7-flash",
27
+ "name": "Gemini 3.7 Flash",
28
+ "efforts": [
29
+ {
30
+ "id": "low",
31
+ "label": "Low"
32
+ },
33
+ {
34
+ "id": "medium",
35
+ "label": "Medium"
36
+ },
37
+ {
38
+ "id": "high",
39
+ "label": "High"
40
+ }
41
+ ],
42
+ "defaultEffort": "high"
43
+ },
44
+ {
45
+ "contextWindows": [],
46
+ "fast": false,
47
+ "id": "gemini-3.6-flash",
48
+ "name": "Gemini 3.6 Flash",
49
+ "efforts": [
50
+ {
51
+ "id": "low",
52
+ "label": "Low"
53
+ },
54
+ {
55
+ "id": "medium",
56
+ "label": "Medium"
57
+ },
58
+ {
59
+ "id": "high",
60
+ "label": "High"
61
+ }
62
+ ],
63
+ "defaultEffort": "high"
64
+ },
65
+ {
66
+ "contextWindows": [],
67
+ "fast": false,
68
+ "id": "gemini-3.1-pro",
69
+ "name": "Gemini 3.1 Pro",
70
+ "efforts": [
71
+ {
72
+ "id": "low",
73
+ "label": "Low"
74
+ },
75
+ {
76
+ "id": "high",
77
+ "label": "High"
78
+ }
79
+ ],
80
+ "defaultEffort": "high"
81
+ },
82
+ {
83
+ "contextWindows": [],
84
+ "fast": false,
85
+ "id": "claude-sonnet-4-6",
86
+ "name": "Claude Sonnet 4.6 (Thinking)",
87
+ "efforts": []
88
+ },
89
+ {
90
+ "contextWindows": [],
91
+ "fast": false,
92
+ "id": "claude-opus-4-6-thinking",
93
+ "name": "Claude Opus 4.6 (Thinking)",
94
+ "efforts": []
95
+ },
96
+ {
97
+ "contextWindows": [],
98
+ "fast": false,
99
+ "id": "gpt-oss-120b-medium",
100
+ "name": "GPT-OSS 120B (Medium)",
101
+ "efforts": []
102
+ }
103
+ ]
@@ -0,0 +1,93 @@
1
+ [
2
+ {
3
+ "id": "claude-fable-5-1",
4
+ "name": "Claude Fable 5.1",
5
+ "efforts": [
6
+ {
7
+ "id": "low",
8
+ "label": "Low"
9
+ },
10
+ {
11
+ "id": "medium",
12
+ "label": "Medium"
13
+ },
14
+ {
15
+ "id": "high",
16
+ "label": "High"
17
+ },
18
+ {
19
+ "id": "xhigh",
20
+ "label": "Extra high"
21
+ },
22
+ {
23
+ "id": "max",
24
+ "label": "Max"
25
+ }
26
+ ],
27
+ "contextWindows": [],
28
+ "fast": false
29
+ },
30
+ {
31
+ "id": "claude-opus-5-5",
32
+ "name": "Claude Opus 5.5",
33
+ "efforts": [
34
+ {
35
+ "id": "low",
36
+ "label": "Low"
37
+ },
38
+ {
39
+ "id": "medium",
40
+ "label": "Medium"
41
+ },
42
+ {
43
+ "id": "high",
44
+ "label": "High"
45
+ },
46
+ {
47
+ "id": "xhigh",
48
+ "label": "Extra high"
49
+ },
50
+ {
51
+ "id": "max",
52
+ "label": "Max"
53
+ }
54
+ ],
55
+ "contextWindows": [],
56
+ "fast": false
57
+ },
58
+ {
59
+ "id": "claude-sonnet-5",
60
+ "name": "Claude Sonnet 5",
61
+ "efforts": [
62
+ {
63
+ "id": "low",
64
+ "label": "Low"
65
+ },
66
+ {
67
+ "id": "medium",
68
+ "label": "Medium"
69
+ },
70
+ {
71
+ "id": "high",
72
+ "label": "High"
73
+ },
74
+ {
75
+ "id": "xhigh",
76
+ "label": "Extra high"
77
+ },
78
+ {
79
+ "id": "max",
80
+ "label": "Max"
81
+ }
82
+ ],
83
+ "contextWindows": [],
84
+ "fast": false
85
+ },
86
+ {
87
+ "id": "claude-haiku-4-5-20251001",
88
+ "name": "Claude Haiku 4.5",
89
+ "efforts": [],
90
+ "contextWindows": [],
91
+ "fast": false
92
+ }
93
+ ]
@@ -0,0 +1,217 @@
1
+ [
2
+ {
3
+ "id": "gpt-6-astra",
4
+ "name": "GPT-6-Astra",
5
+ "efforts": [
6
+ {
7
+ "id": "low",
8
+ "label": "Low"
9
+ },
10
+ {
11
+ "id": "medium",
12
+ "label": "Medium"
13
+ },
14
+ {
15
+ "id": "high",
16
+ "label": "High"
17
+ },
18
+ {
19
+ "id": "xhigh",
20
+ "label": "Extra high"
21
+ },
22
+ {
23
+ "id": "max",
24
+ "label": "Max"
25
+ },
26
+ {
27
+ "id": "ultra",
28
+ "label": "Ultra"
29
+ }
30
+ ],
31
+ "defaultEffort": "low",
32
+ "contextWindows": [],
33
+ "fast": true
34
+ },
35
+ {
36
+ "id": "gpt-6-sol",
37
+ "name": "GPT-6-Sol",
38
+ "efforts": [
39
+ {
40
+ "id": "low",
41
+ "label": "Low"
42
+ },
43
+ {
44
+ "id": "medium",
45
+ "label": "Medium"
46
+ },
47
+ {
48
+ "id": "high",
49
+ "label": "High"
50
+ },
51
+ {
52
+ "id": "xhigh",
53
+ "label": "Extra high"
54
+ },
55
+ {
56
+ "id": "max",
57
+ "label": "Max"
58
+ },
59
+ {
60
+ "id": "ultra",
61
+ "label": "Ultra"
62
+ }
63
+ ],
64
+ "defaultEffort": "medium",
65
+ "contextWindows": [],
66
+ "fast": true
67
+ },
68
+ {
69
+ "id": "gpt-6-luna",
70
+ "name": "GPT-6-Luna",
71
+ "efforts": [
72
+ {
73
+ "id": "low",
74
+ "label": "Low"
75
+ },
76
+ {
77
+ "id": "medium",
78
+ "label": "Medium"
79
+ },
80
+ {
81
+ "id": "high",
82
+ "label": "High"
83
+ },
84
+ {
85
+ "id": "xhigh",
86
+ "label": "Extra high"
87
+ },
88
+ {
89
+ "id": "max",
90
+ "label": "Max"
91
+ }
92
+ ],
93
+ "defaultEffort": "medium",
94
+ "contextWindows": [],
95
+ "fast": true
96
+ },
97
+ {
98
+ "id": "gpt-5.6-sol",
99
+ "name": "GPT-5.6-Sol",
100
+ "efforts": [
101
+ {
102
+ "id": "low",
103
+ "label": "Low"
104
+ },
105
+ {
106
+ "id": "medium",
107
+ "label": "Medium"
108
+ },
109
+ {
110
+ "id": "high",
111
+ "label": "High"
112
+ },
113
+ {
114
+ "id": "xhigh",
115
+ "label": "Extra high"
116
+ },
117
+ {
118
+ "id": "max",
119
+ "label": "Max"
120
+ },
121
+ {
122
+ "id": "ultra",
123
+ "label": "Ultra"
124
+ }
125
+ ],
126
+ "defaultEffort": "low",
127
+ "contextWindows": [],
128
+ "fast": true
129
+ },
130
+ {
131
+ "id": "gpt-5.6-terra",
132
+ "name": "GPT-5.6-Terra",
133
+ "efforts": [
134
+ {
135
+ "id": "low",
136
+ "label": "Low"
137
+ },
138
+ {
139
+ "id": "medium",
140
+ "label": "Medium"
141
+ },
142
+ {
143
+ "id": "high",
144
+ "label": "High"
145
+ },
146
+ {
147
+ "id": "xhigh",
148
+ "label": "Extra high"
149
+ },
150
+ {
151
+ "id": "max",
152
+ "label": "Max"
153
+ },
154
+ {
155
+ "id": "ultra",
156
+ "label": "Ultra"
157
+ }
158
+ ],
159
+ "defaultEffort": "medium",
160
+ "contextWindows": [],
161
+ "fast": true
162
+ },
163
+ {
164
+ "id": "gpt-5.6-luna",
165
+ "name": "GPT-5.6-Luna",
166
+ "efforts": [
167
+ {
168
+ "id": "low",
169
+ "label": "Low"
170
+ },
171
+ {
172
+ "id": "medium",
173
+ "label": "Medium"
174
+ },
175
+ {
176
+ "id": "high",
177
+ "label": "High"
178
+ },
179
+ {
180
+ "id": "xhigh",
181
+ "label": "Extra high"
182
+ },
183
+ {
184
+ "id": "max",
185
+ "label": "Max"
186
+ }
187
+ ],
188
+ "defaultEffort": "medium",
189
+ "contextWindows": [],
190
+ "fast": true
191
+ },
192
+ {
193
+ "id": "gpt-5.5",
194
+ "name": "GPT-5.5",
195
+ "efforts": [
196
+ {
197
+ "id": "low",
198
+ "label": "Low"
199
+ },
200
+ {
201
+ "id": "medium",
202
+ "label": "Medium"
203
+ },
204
+ {
205
+ "id": "high",
206
+ "label": "High"
207
+ },
208
+ {
209
+ "id": "xhigh",
210
+ "label": "Extra high"
211
+ }
212
+ ],
213
+ "defaultEffort": "medium",
214
+ "contextWindows": [],
215
+ "fast": true
216
+ }
217
+ ]
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
@@ -0,0 +1,164 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ createFunnel
4
+ } from "../chunk-2FZ64BNF.js";
5
+ import {
6
+ createHandler,
7
+ serveNode
8
+ } from "../chunk-GF7JASHO.js";
9
+ import {
10
+ ACCESS_LEVELS
11
+ } from "../chunk-YP5V5YEE.js";
12
+
13
+ // src/bin/cli.ts
14
+ import { createInterface } from "readline/promises";
15
+ import { homedir } from "os";
16
+ import { parseArgs } from "util";
17
+ var HELP = `cli-funnel <command>
18
+
19
+ doctor Show which CLIs are installed, logged in, and within the tested version range
20
+ models <provider> List models with effort levels, context sizes and fast tier
21
+ login <provider> Sign in through the provider's own login flow
22
+ logout <provider> Sign out
23
+ update <provider> Run the CLI's own updater
24
+ run <provider> <model> <prompt>
25
+ [--effort x] [--fast] [--context tokens] [--cwd dir] [--access ${ACCESS_LEVELS.join("|")}]
26
+ serve [--port 4747] [--host 127.0.0.1] [--cwd dir] [--access level] [--token secret]
27
+ HTTP API, SSE streaming and OpenAI-compatible /v1 endpoints
28
+
29
+ Providers: claude, codex, agent, antigravity`;
30
+ var { values, positionals } = parseArgs({
31
+ allowPositionals: true,
32
+ options: {
33
+ effort: { type: "string" },
34
+ fast: { type: "boolean" },
35
+ context: { type: "string" },
36
+ cwd: { type: "string" },
37
+ access: { type: "string" },
38
+ port: { type: "string" },
39
+ host: { type: "string" },
40
+ token: { type: "string" },
41
+ json: { type: "boolean" },
42
+ help: { type: "boolean", short: "h" }
43
+ }
44
+ });
45
+ var funnel = createFunnel();
46
+ var [command, providerArg, ...rest] = positionals;
47
+ var out = (s) => process.stdout.write(s + "\n");
48
+ var provider = () => {
49
+ if (!providerArg || !(providerArg in funnel.providers)) {
50
+ out(`Pick a provider: ${Object.keys(funnel.providers).join(", ")}`);
51
+ process.exit(2);
52
+ }
53
+ return providerArg;
54
+ };
55
+ async function main() {
56
+ if (!command || values.help) return out(HELP);
57
+ if (command === "doctor") {
58
+ const rows = await funnel.overview();
59
+ if (values.json) return out(JSON.stringify(rows, null, 2));
60
+ for (const r of rows) {
61
+ const i = r.installation;
62
+ const state = !i.installed ? "not installed" : `${i.version ?? "?"}${i.withinTestedRange === false ? " (outside tested range)" : ""}, ${r.auth?.loggedIn ? `logged in${r.auth.account ? " as " + r.auth.account : ""}` : "logged out"}`;
63
+ out(`${r.displayName.padEnd(14)} ${state}`);
64
+ out(`${"".padEnd(14)} access: ${r.capabilities.access.join(", ") || "none"}`);
65
+ }
66
+ return;
67
+ }
68
+ if (command === "models") {
69
+ const models = await funnel.models(provider());
70
+ if (values.json) return out(JSON.stringify(models, null, 2));
71
+ for (const m of models) {
72
+ const bits = [
73
+ m.efforts.length ? `effort ${m.efforts.map((e) => e.id).join("/")}` : "",
74
+ m.contextWindows.length ? `context ${m.contextWindows.map((c) => c >= 1e6 ? c / 1e6 + "M" : c / 1e3 + "k").join("/")}` : "",
75
+ m.fast ? "fast" : ""
76
+ ].filter(Boolean);
77
+ out(`${m.id.padEnd(34)} ${m.name}${bits.length ? " [" + bits.join(", ") + "]" : ""}`);
78
+ }
79
+ return;
80
+ }
81
+ if (command === "login") {
82
+ const session = funnel.login(provider());
83
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
84
+ for await (const e of session) {
85
+ if (e.type === "open-url") out(`Open this link to sign in:
86
+ ${e.url}`);
87
+ else if (e.type === "code-prompt") session.sendCode(await rl.question(`${e.message}
88
+ > `));
89
+ else if (e.type === "needs-terminal") out(`This provider signs in from a terminal. Run: ${e.command.join(" ")}`);
90
+ else if (e.type === "done") out(`Signed in${e.status.account ? " as " + e.status.account : ""}.`);
91
+ else if (e.type === "error") {
92
+ out(e.message);
93
+ process.exitCode = 1;
94
+ }
95
+ }
96
+ rl.close();
97
+ return;
98
+ }
99
+ if (command === "logout") {
100
+ await funnel.logout(provider());
101
+ return out("Signed out.");
102
+ }
103
+ if (command === "update") {
104
+ const r = await funnel.update(provider());
105
+ return out(r.changed ? `Updated ${r.from} -> ${r.to}` : `Already current${r.to ? " (" + r.to + ")" : ""}.`);
106
+ }
107
+ if (command === "run") {
108
+ const [model, ...words] = rest;
109
+ if (!model || !words.length) return out("Usage: cli-funnel run <provider> <model> <prompt>");
110
+ const access = values.access ?? "accept-edits";
111
+ const rl = access === "supervised" ? createInterface({ input: process.stdin, output: process.stdout }) : void 0;
112
+ const stream = funnel.stream({
113
+ selection: {
114
+ provider: provider(),
115
+ model,
116
+ effort: values.effort,
117
+ fast: values.fast,
118
+ contextWindow: values.context ? Number(values.context) : void 0,
119
+ cwd: values.cwd ?? process.cwd(),
120
+ access
121
+ },
122
+ prompt: words.join(" "),
123
+ onApproval: async (r) => {
124
+ const answer = await rl.question(`
125
+ Allow ${r.tool} ${JSON.stringify(r.input).slice(0, 200)}? [y/N] `);
126
+ return answer.trim().toLowerCase().startsWith("y") ? "allow" : "deny";
127
+ }
128
+ });
129
+ for await (const e of stream) {
130
+ if (e.type === "text.delta") process.stdout.write(e.text);
131
+ else if (e.type === "tool.start") process.stderr.write(`
132
+ [tool] ${e.name}
133
+ `);
134
+ }
135
+ const result = await stream.result;
136
+ process.stdout.write("\n");
137
+ if (values.json) out(JSON.stringify(result, null, 2));
138
+ rl?.close();
139
+ return;
140
+ }
141
+ if (command === "serve") {
142
+ const handler = createHandler(funnel, {
143
+ token: values.token,
144
+ fsRoots: [homedir(), values.cwd ?? process.cwd()],
145
+ openai: { cwd: values.cwd ?? process.cwd(), access: values.access ?? "accept-edits" }
146
+ });
147
+ const host = values.host ?? "127.0.0.1";
148
+ if (host !== "127.0.0.1" && host !== "localhost" && !values.token) {
149
+ out("Refusing to listen on a public address without --token.");
150
+ process.exit(2);
151
+ }
152
+ const { url } = await serveNode(handler, { port: values.port ? Number(values.port) : 4747, host });
153
+ out(`cli-funnel listening on ${url}`);
154
+ out(`OpenAI-compatible base URL: ${url}/v1 (model ids look like claude/claude-sonnet-5)`);
155
+ return;
156
+ }
157
+ out(HELP);
158
+ process.exitCode = 2;
159
+ }
160
+ main().catch((err) => {
161
+ process.stderr.write(`${err instanceof Error ? err.message : String(err)}
162
+ `);
163
+ process.exit(1);
164
+ });