@cortexkit/opencode-openai-auth 1.14.1 → 1.15.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.
Files changed (87) hide show
  1. package/dist/bin.js +9 -9
  2. package/dist/{codex-request-Cl6zEfsR.d.ts → codex-request-DYqSE0ti.d.ts} +373 -2
  3. package/dist/{index-wma2ggn9.js → index-14x5shtc.js} +2 -2
  4. package/dist/index-1wcg7g9d.js +2 -0
  5. package/dist/index-50p400eg.js +8 -0
  6. package/dist/index-98q3mydm.js +64 -0
  7. package/dist/{index-yygzbxjk.js → index-bhkycxbm.js} +1 -1
  8. package/dist/{index-k5av4j8p.js → index-dzpjz8hv.js} +2 -2
  9. package/dist/{index-cxnrd85v.js → index-f7kmsdfk.js} +1 -1
  10. package/dist/{index-z9cj13z7.js → index-hnfqppx9.js} +1 -1
  11. package/dist/{index-2f330s35.js → index-m8m7rakq.js} +2 -2
  12. package/dist/index-mjsmvmt4.js +76 -0
  13. package/dist/{index-gkye2xh1.js → index-s8ghhc9z.js} +2 -2
  14. package/dist/{index-94b345dw.js → index-t65axpta.js} +1 -1
  15. package/dist/index-xjtbg7sx.js +101 -0
  16. package/dist/index.d.ts +1 -372
  17. package/dist/index.js +1 -1
  18. package/dist/openai-auth.schema.json +400 -0
  19. package/dist/rpc/port-file.js +1 -1
  20. package/dist/rpc/protocol.js +1 -1
  21. package/dist/rpc/rpc-client.js +1 -1
  22. package/dist/rpc/rpc-dir.js +1 -1
  23. package/dist/sidebar-state.js +1 -1
  24. package/dist/{token-sgwxn4xg.js → token-j34j1zhm.js} +1 -1
  25. package/dist/token-util-bf619nmg.js +1 -0
  26. package/dist/tui-preferences.js +3 -3
  27. package/dist/v2/server.d.ts +1 -1
  28. package/dist/v2/server.js +2 -2
  29. package/package.json +3 -3
  30. package/src/tui-compiled/raw/logger.js +8 -1
  31. package/src/tui-compiled/raw/shared/061e741c052de9c1-paths.js +48 -0
  32. package/src/tui-compiled/raw/shared/0766d78c6f481f18-watcher.js +41 -18
  33. package/src/tui-compiled/raw/shared/23300c068d0b2ffc-parse.js +65 -0
  34. package/src/tui-compiled/raw/shared/3000be4f79f20eb6-write.js +88 -0
  35. package/src/tui-compiled/raw/shared/44449e891fab9fbc-edit.js +229 -0
  36. package/src/tui-compiled/raw/shared/4825e03209d6ae3e-with-lock.js +1 -1
  37. package/src/tui-compiled/raw/shared/5803fadb30af0ec0-descriptors.js +81 -0
  38. package/src/tui-compiled/raw/shared/58bc35a3cd459085-define.js +52 -0
  39. package/src/tui-compiled/raw/shared/5f4bc45522ab9bc6-update.js +139 -0
  40. package/src/tui-compiled/raw/shared/6948d70969aa7a55-fs.js +19 -0
  41. package/src/tui-compiled/raw/shared/754d6017f8e419cf-builtins.js +28 -12
  42. package/src/tui-compiled/raw/shared/81758f9fe7c2a576-handle.js +228 -0
  43. package/src/tui-compiled/raw/shared/87f6e22d4fc34918-resolve.js +51 -0
  44. package/src/tui-compiled/raw/shared/8a18abe4fa2977c8-menu.js +1 -0
  45. package/src/tui-compiled/raw/shared/8ab1f5794e677151-move.js +351 -0
  46. package/src/tui-compiled/raw/shared/92e38944b51b2405-file-read-cache.js +9 -5
  47. package/src/tui-compiled/raw/shared/9865a4fa45882c6f-settings-decisions.js +13 -0
  48. package/src/tui-compiled/raw/shared/cc0f2d1963547799-index.js +7 -0
  49. package/src/tui-compiled/raw/shared/dbc61cd405941828-accounts.js +48 -5
  50. package/src/tui-compiled/raw/shared/e0ed4a490e4eaa4f-schema.js +81 -0
  51. package/src/tui-compiled/raw/shared/e8cd4929507508d8-refresh-file-lock.js +146 -2
  52. package/src/tui-compiled/raw/shared/eac0bed49f3d4110-lock-errors.js +15 -0
  53. package/src/tui-compiled/raw/shared/facfd8afc431d68a-refusal.js +15 -0
  54. package/src/tui-compiled/raw/shared/fc7db0c5aa764565-settings-install.js +85 -0
  55. package/src/tui-compiled/raw/shared/fcd26e77bc538838-snapshot.js +150 -0
  56. package/src/tui-compiled/runtime/logger.js +8 -1
  57. package/src/tui-compiled/runtime/shared/061e741c052de9c1-paths.js +48 -0
  58. package/src/tui-compiled/runtime/shared/0766d78c6f481f18-watcher.js +41 -18
  59. package/src/tui-compiled/runtime/shared/23300c068d0b2ffc-parse.js +65 -0
  60. package/src/tui-compiled/runtime/shared/3000be4f79f20eb6-write.js +88 -0
  61. package/src/tui-compiled/runtime/shared/44449e891fab9fbc-edit.js +229 -0
  62. package/src/tui-compiled/runtime/shared/4825e03209d6ae3e-with-lock.js +1 -1
  63. package/src/tui-compiled/runtime/shared/5803fadb30af0ec0-descriptors.js +81 -0
  64. package/src/tui-compiled/runtime/shared/58bc35a3cd459085-define.js +52 -0
  65. package/src/tui-compiled/runtime/shared/5f4bc45522ab9bc6-update.js +139 -0
  66. package/src/tui-compiled/runtime/shared/6948d70969aa7a55-fs.js +19 -0
  67. package/src/tui-compiled/runtime/shared/754d6017f8e419cf-builtins.js +28 -12
  68. package/src/tui-compiled/runtime/shared/81758f9fe7c2a576-handle.js +228 -0
  69. package/src/tui-compiled/runtime/shared/87f6e22d4fc34918-resolve.js +51 -0
  70. package/src/tui-compiled/runtime/shared/8a18abe4fa2977c8-menu.js +1 -0
  71. package/src/tui-compiled/runtime/shared/8ab1f5794e677151-move.js +351 -0
  72. package/src/tui-compiled/runtime/shared/92e38944b51b2405-file-read-cache.js +9 -5
  73. package/src/tui-compiled/runtime/shared/9865a4fa45882c6f-settings-decisions.js +13 -0
  74. package/src/tui-compiled/runtime/shared/cc0f2d1963547799-index.js +7 -0
  75. package/src/tui-compiled/runtime/shared/dbc61cd405941828-accounts.js +48 -5
  76. package/src/tui-compiled/runtime/shared/e0ed4a490e4eaa4f-schema.js +81 -0
  77. package/src/tui-compiled/runtime/shared/e8cd4929507508d8-refresh-file-lock.js +146 -2
  78. package/src/tui-compiled/runtime/shared/eac0bed49f3d4110-lock-errors.js +15 -0
  79. package/src/tui-compiled/runtime/shared/facfd8afc431d68a-refusal.js +15 -0
  80. package/src/tui-compiled/runtime/shared/fc7db0c5aa764565-settings-install.js +85 -0
  81. package/src/tui-compiled/runtime/shared/fcd26e77bc538838-snapshot.js +150 -0
  82. package/dist/index-3mbw88h7.js +0 -91
  83. package/dist/index-999nwa9p.js +0 -76
  84. package/dist/index-pc4vrrex.js +0 -2
  85. package/dist/index-snq7bwr6.js +0 -8
  86. package/dist/index-xk7f1aef.js +0 -64
  87. package/dist/token-util-8mrnmkge.js +0 -1
@@ -0,0 +1,400 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "schema_version": {
6
+ "type": "integer",
7
+ "minimum": 1
8
+ },
9
+ "$schema": {
10
+ "type": "string"
11
+ },
12
+ "routing_mode": {
13
+ "anyOf": [
14
+ {
15
+ "enum": ["ordered", "main-first", "fallback-first", "sticky-balanced"]
16
+ },
17
+ {
18
+ "type": "object",
19
+ "properties": {
20
+ "default": {
21
+ "enum": [
22
+ "ordered",
23
+ "main-first",
24
+ "fallback-first",
25
+ "sticky-balanced"
26
+ ]
27
+ },
28
+ "opencode": {
29
+ "enum": [
30
+ "ordered",
31
+ "main-first",
32
+ "fallback-first",
33
+ "sticky-balanced"
34
+ ]
35
+ },
36
+ "pi": {
37
+ "enum": [
38
+ "ordered",
39
+ "main-first",
40
+ "fallback-first",
41
+ "sticky-balanced"
42
+ ]
43
+ }
44
+ },
45
+ "additionalProperties": false
46
+ }
47
+ ]
48
+ },
49
+ "max_same_account_wait": {
50
+ "anyOf": [
51
+ {
52
+ "enum": ["off", "15m", "cache"]
53
+ },
54
+ {
55
+ "type": "object",
56
+ "properties": {
57
+ "default": {
58
+ "enum": ["off", "15m", "cache"]
59
+ },
60
+ "opencode": {
61
+ "enum": ["off", "15m", "cache"]
62
+ },
63
+ "pi": {
64
+ "enum": ["off", "15m", "cache"]
65
+ }
66
+ },
67
+ "additionalProperties": false
68
+ }
69
+ ]
70
+ },
71
+ "fallback_on": {
72
+ "anyOf": [
73
+ {
74
+ "type": "array",
75
+ "items": {
76
+ "type": "integer"
77
+ }
78
+ },
79
+ {
80
+ "type": "object",
81
+ "properties": {
82
+ "default": {
83
+ "type": "array",
84
+ "items": {
85
+ "type": "integer"
86
+ }
87
+ },
88
+ "opencode": {
89
+ "type": "array",
90
+ "items": {
91
+ "type": "integer"
92
+ }
93
+ },
94
+ "pi": {
95
+ "type": "array",
96
+ "items": {
97
+ "type": "integer"
98
+ }
99
+ }
100
+ },
101
+ "additionalProperties": false
102
+ }
103
+ ]
104
+ },
105
+ "refresh_enabled": {
106
+ "type": "boolean"
107
+ },
108
+ "refresh_before_expiry_minutes": {
109
+ "anyOf": [
110
+ {
111
+ "type": "number"
112
+ },
113
+ {
114
+ "type": "object",
115
+ "properties": {
116
+ "default": {
117
+ "type": "number"
118
+ },
119
+ "opencode": {
120
+ "type": "number"
121
+ },
122
+ "pi": {
123
+ "type": "number"
124
+ }
125
+ },
126
+ "additionalProperties": false
127
+ }
128
+ ]
129
+ },
130
+ "quota_enabled": {
131
+ "anyOf": [
132
+ {
133
+ "type": "boolean"
134
+ },
135
+ {
136
+ "type": "object",
137
+ "properties": {
138
+ "default": {
139
+ "type": "boolean"
140
+ },
141
+ "opencode": {
142
+ "type": "boolean"
143
+ },
144
+ "pi": {
145
+ "type": "boolean"
146
+ }
147
+ },
148
+ "additionalProperties": false
149
+ }
150
+ ]
151
+ },
152
+ "quota_check_interval_minutes": {
153
+ "type": "number",
154
+ "minimum": 1
155
+ },
156
+ "quota_minimum_remaining": {
157
+ "anyOf": [
158
+ {
159
+ "type": "array",
160
+ "items": {
161
+ "type": "object",
162
+ "properties": {
163
+ "window": {
164
+ "enum": ["primary", "secondary"]
165
+ },
166
+ "floor": {
167
+ "type": "number"
168
+ }
169
+ },
170
+ "additionalProperties": false,
171
+ "required": ["window", "floor"]
172
+ }
173
+ },
174
+ {
175
+ "type": "object",
176
+ "properties": {
177
+ "default": {
178
+ "type": "array",
179
+ "items": {
180
+ "type": "object",
181
+ "properties": {
182
+ "window": {
183
+ "enum": ["primary", "secondary"]
184
+ },
185
+ "floor": {
186
+ "type": "number"
187
+ }
188
+ },
189
+ "additionalProperties": false,
190
+ "required": ["window", "floor"]
191
+ }
192
+ },
193
+ "opencode": {
194
+ "type": "array",
195
+ "items": {
196
+ "type": "object",
197
+ "properties": {
198
+ "window": {
199
+ "enum": ["primary", "secondary"]
200
+ },
201
+ "floor": {
202
+ "type": "number"
203
+ }
204
+ },
205
+ "additionalProperties": false,
206
+ "required": ["window", "floor"]
207
+ }
208
+ },
209
+ "pi": {
210
+ "type": "array",
211
+ "items": {
212
+ "type": "object",
213
+ "properties": {
214
+ "window": {
215
+ "enum": ["primary", "secondary"]
216
+ },
217
+ "floor": {
218
+ "type": "number"
219
+ }
220
+ },
221
+ "additionalProperties": false,
222
+ "required": ["window", "floor"]
223
+ }
224
+ }
225
+ },
226
+ "additionalProperties": false
227
+ }
228
+ ]
229
+ },
230
+ "quota_fail_closed_on_unknown": {
231
+ "anyOf": [
232
+ {
233
+ "type": "boolean"
234
+ },
235
+ {
236
+ "type": "object",
237
+ "properties": {
238
+ "default": {
239
+ "type": "boolean"
240
+ },
241
+ "opencode": {
242
+ "type": "boolean"
243
+ },
244
+ "pi": {
245
+ "type": "boolean"
246
+ }
247
+ },
248
+ "additionalProperties": false
249
+ }
250
+ ]
251
+ },
252
+ "cost_zeroing": {
253
+ "type": "boolean"
254
+ },
255
+ "killswitch_enabled": {
256
+ "anyOf": [
257
+ {
258
+ "type": "boolean"
259
+ },
260
+ {
261
+ "type": "object",
262
+ "properties": {
263
+ "default": {
264
+ "type": "boolean"
265
+ },
266
+ "opencode": {
267
+ "type": "boolean"
268
+ },
269
+ "pi": {
270
+ "type": "boolean"
271
+ }
272
+ },
273
+ "additionalProperties": false
274
+ }
275
+ ]
276
+ },
277
+ "killswitch_default_primary": {
278
+ "anyOf": [
279
+ {
280
+ "type": "number"
281
+ },
282
+ {
283
+ "type": "object",
284
+ "properties": {
285
+ "default": {
286
+ "type": "number"
287
+ },
288
+ "opencode": {
289
+ "type": "number"
290
+ },
291
+ "pi": {
292
+ "type": "number"
293
+ }
294
+ },
295
+ "additionalProperties": false
296
+ }
297
+ ]
298
+ },
299
+ "killswitch_default_secondary": {
300
+ "anyOf": [
301
+ {
302
+ "type": "number"
303
+ },
304
+ {
305
+ "type": "object",
306
+ "properties": {
307
+ "default": {
308
+ "type": "number"
309
+ },
310
+ "opencode": {
311
+ "type": "number"
312
+ },
313
+ "pi": {
314
+ "type": "number"
315
+ }
316
+ },
317
+ "additionalProperties": false
318
+ }
319
+ ]
320
+ },
321
+ "killswitch_account_floors": {
322
+ "type": "array",
323
+ "items": {
324
+ "type": "object",
325
+ "properties": {
326
+ "account": {
327
+ "type": "string"
328
+ },
329
+ "host": {
330
+ "enum": ["opencode", "pi", "both"]
331
+ },
332
+ "primary": {
333
+ "type": "number"
334
+ },
335
+ "secondary": {
336
+ "type": "number"
337
+ }
338
+ },
339
+ "additionalProperties": false,
340
+ "required": ["account", "host", "primary", "secondary"]
341
+ }
342
+ },
343
+ "cache_keep_enabled": {
344
+ "type": "boolean"
345
+ },
346
+ "cache_keep_subagents": {
347
+ "type": "boolean"
348
+ },
349
+ "cache_keep_sustain": {
350
+ "type": "boolean"
351
+ },
352
+ "cache_keep_window": {
353
+ "type": "array",
354
+ "items": {
355
+ "type": "object",
356
+ "properties": {
357
+ "start_hour": {
358
+ "type": "integer",
359
+ "minimum": 0,
360
+ "maximum": 23
361
+ },
362
+ "end_hour": {
363
+ "type": "integer",
364
+ "minimum": 0,
365
+ "maximum": 23
366
+ }
367
+ },
368
+ "additionalProperties": false,
369
+ "required": ["start_hour", "end_hour"]
370
+ }
371
+ },
372
+ "log_level": {
373
+ "enum": ["error", "warn", "info", "debug", "trace", "default"]
374
+ },
375
+ "request_dumps": {
376
+ "type": "boolean"
377
+ },
378
+ "dump_dir": {
379
+ "type": "string"
380
+ },
381
+ "dump_max_bytes": {
382
+ "type": "integer",
383
+ "minimum": 0,
384
+ "maximum": 9007199254740991
385
+ },
386
+ "web_sockets": {
387
+ "type": "boolean"
388
+ },
389
+ "raw_web_socket": {
390
+ "type": "boolean"
391
+ },
392
+ "responses_lite": {
393
+ "type": "boolean"
394
+ },
395
+ "codex_api_endpoint": {
396
+ "type": "string"
397
+ }
398
+ },
399
+ "additionalProperties": false
400
+ }
@@ -1 +1 @@
1
- import{Lf as b,Mf as c}from"../index-gkye2xh1.js";import{Qf as a}from"../index-wma2ggn9.js";import"../index-2f330s35.js";import"../index-94b345dw.js";import"../index-cxnrd85v.js";export{b as writePortFile,c as isOpenaiRpcStateDir,a as discoverPortFile};
1
+ import{lg as b,mg as c}from"../index-s8ghhc9z.js";import{qg as a}from"../index-14x5shtc.js";import"../index-m8m7rakq.js";import"../index-t65axpta.js";import"../index-f7kmsdfk.js";export{b as writePortFile,c as isOpenaiRpcStateDir,a as discoverPortFile};
@@ -1 +1 @@
1
- import{cg as b}from"../index-pc4vrrex.js";import"../index-2f330s35.js";import"../index-cxnrd85v.js";export{b as isNotifyPayload};
1
+ import{Eg as b}from"../index-1wcg7g9d.js";import"../index-m8m7rakq.js";import"../index-f7kmsdfk.js";export{b as isNotifyPayload};
@@ -1 +1 @@
1
- import{Rf as F,Sf as f}from"../index-wma2ggn9.js";import"../index-2f330s35.js";import"../index-cxnrd85v.js";function y(r,s,v){return f(r,s,v)}export{y as createRpcClient,F as DEFAULT_RPC_TIMEOUT_MS};
1
+ import{rg as F,sg as f}from"../index-14x5shtc.js";import"../index-m8m7rakq.js";import"../index-f7kmsdfk.js";function y(r,s,v){return f(r,s,v)}export{y as createRpcClient,F as DEFAULT_RPC_TIMEOUT_MS};
@@ -1 +1 @@
1
- import{qg as a,rg as b,sg as c,tg as d}from"../index-94b345dw.js";import"../index-cxnrd85v.js";export{a as tmpdir,d as resolveRpcDir,c as getRpcDir,b as RPC_DIRECTORY_PREFIX};
1
+ import{Sg as a,Tg as b,Ug as c,Vg as d}from"../index-t65axpta.js";import"../index-f7kmsdfk.js";export{a as tmpdir,d as resolveRpcDir,c as getRpcDir,b as RPC_DIRECTORY_PREFIX};
@@ -1 +1 @@
1
- import{$c as C,Ac as b,Bc as c,Cc as d,Dc as e,Ec as f,Fc as g,Gc as h,Hc as i,Ic as j,Jc as k,Kc as l,Lc as m,Mc as n,Nc as o,Oc as p,Pc as q,Qc as r,Rc as s,Sc as t,Tc as u,Uc as v,Vc as w,Wc as x,Xc as y,Yc as z,Zc as A,_c as B,ad as D,bd as E,cd as F,dd as G,ed as H,fd as I,gd as J,hd as K,id as L,jd as M,kd as N,ld as O,md as P,nd as Q,od as R,pd as S,qd as T,zc as a}from"./index-k5av4j8p.js";import"./index-3mbw88h7.js";import"./index-snq7bwr6.js";import"./index-pc4vrrex.js";import"./index-2f330s35.js";import"./index-cxnrd85v.js";export{y as upsertSidebarActiveRouting,p as spendControlExhaustedResetAt,O as sidebarQuotaProjection,I as settleWithinBudget,w as setSidebarState,x as setSidebarMachineState,z as setSidebarLegacyRouting,e as setLegacySidebarStateFileForTest,C as resolveSidebarStickyAssignment,s as resolveSessionStickyAccount,t as resolveSessionSidebarRouting,N as resolveActiveAccount,A as removeSidebarActiveRouting,K as rememberStickyPin,v as pruneStickyAssignments,u as pruneActiveRouting,D as planSidebarStickyAssignmentFromSnapshot,B as planSidebarStickyAssignment,E as persistSidebarStickyAssignment,k as normalizeSidebarState,o as isUsableRoutingEntry,r as isQuotaExhausted,h as hashSidebarSessionId,i as getSidebarStateFile,l as getSidebarState,d as getPresentQuotaWindows,P as getCollapsedQuotaSummary,Q as getCollapsedAccountLines,c as formatWindowLabel,S as fitCollapsedLabel,q as exhaustedQuotaResetAt,G as drainSidebarWrites,R as displayWidth,J as createSidebarStateCache,M as createSidebarBookkeepingQueue,T as computeQuotaPacing,F as clearSidebarStickyAssignment,L as applyStickyPinOverlay,b as accountServesOnCredits,a as accountCreditsText,g as STICKY_ASSIGNMENT_MAX_ENTRIES,f as STICKY_ASSIGNMENT_MAX_AGE_MS,H as HOT_PATH_READ_BUDGET_MS,j as DEFAULT_SIDEBAR_STATE,n as ACTIVE_ROUTING_MAX_ENTRIES,m as ACTIVE_ROUTING_MAX_AGE_MS};
1
+ import{$c as w,Fc as a,Gc as b,Hc as c,Ic as d,Jc as e,Kc as f,Lc as g,Mc as h,Nc as i,Oc as j,Pc as k,Qc as l,Rc as m,Sc as n,Tc as o,Uc as p,Vc as q,Wc as r,Xc as s,Yc as t,Zc as u,_c as v,ad as x,bd as y,cd as z,dd as A,ed as B,fd as C,gd as D,hd as E,id as F,jd as G,kd as H,ld as I,md as J,nd as K,od as L,pd as M,qd as N,rd as O,sd as P,td as Q,ud as R,vd as S,wd as T}from"./index-dzpjz8hv.js";import"./index-xjtbg7sx.js";import"./index-50p400eg.js";import"./index-1wcg7g9d.js";import"./index-m8m7rakq.js";import"./index-f7kmsdfk.js";export{y as upsertSidebarActiveRouting,p as spendControlExhaustedResetAt,O as sidebarQuotaProjection,I as settleWithinBudget,w as setSidebarState,x as setSidebarMachineState,z as setSidebarLegacyRouting,e as setLegacySidebarStateFileForTest,C as resolveSidebarStickyAssignment,s as resolveSessionStickyAccount,t as resolveSessionSidebarRouting,N as resolveActiveAccount,A as removeSidebarActiveRouting,K as rememberStickyPin,v as pruneStickyAssignments,u as pruneActiveRouting,D as planSidebarStickyAssignmentFromSnapshot,B as planSidebarStickyAssignment,E as persistSidebarStickyAssignment,k as normalizeSidebarState,o as isUsableRoutingEntry,r as isQuotaExhausted,h as hashSidebarSessionId,i as getSidebarStateFile,l as getSidebarState,d as getPresentQuotaWindows,P as getCollapsedQuotaSummary,Q as getCollapsedAccountLines,c as formatWindowLabel,S as fitCollapsedLabel,q as exhaustedQuotaResetAt,G as drainSidebarWrites,R as displayWidth,J as createSidebarStateCache,M as createSidebarBookkeepingQueue,T as computeQuotaPacing,F as clearSidebarStickyAssignment,L as applyStickyPinOverlay,b as accountServesOnCredits,a as accountCreditsText,g as STICKY_ASSIGNMENT_MAX_ENTRIES,f as STICKY_ASSIGNMENT_MAX_AGE_MS,H as HOT_PATH_READ_BUDGET_MS,j as DEFAULT_SIDEBAR_STATE,n as ACTIVE_ROUTING_MAX_ENTRIES,m as ACTIVE_ROUTING_MAX_AGE_MS};
@@ -1 +1 @@
1
- import{a as U,b as V}from"./index-z9cj13z7.js";import{ug as R}from"./index-cxnrd85v.js";var E=R((M,Q)=>{var{defineProperty:H,getOwnPropertyDescriptor:W,getOwnPropertyNames:X}=Object,Y=Object.prototype.hasOwnProperty,Z=(z,q)=>{for(var B in q)H(z,B,{get:q[B],enumerable:!0})},$=(z,q,B,F)=>{if(q&&typeof q==="object"||typeof q==="function"){for(let v of X(q))if(!Y.call(z,v)&&v!==B)H(z,v,{get:()=>q[v],enumerable:!(F=W(q,v))||F.enumerable})}return z},A=(z)=>$(H({},"__esModule",{value:!0}),z),L={};Z(L,{refreshToken:()=>D});Q.exports=A(L);var K=U(),G=V();async function D(z){let q=z?.project,B=z?.team;if(!q&&!B){let v=(0,G.findProjectInfo)();q=v.projectId,B=v.teamId}else if(!q||!B){let v=(0,G.findProjectInfo)();q=q??v.projectId,B=B??v.teamId}if(!q)throw new K.VercelOidcTokenError("Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`");let F=(0,G.loadToken)(q);if(!F||(0,G.isExpired)((0,G.getTokenPayload)(F.token),z?.expirationBufferMs)){let v=await(0,G.getVercelToken)({expirationBufferMs:z?.expirationBufferMs});if(F=await(0,G.getVercelOidcToken)(v,q,B),!F)throw new K.VercelOidcTokenError("Failed to refresh OIDC token");(0,G.saveToken)(F,q)}process.env.VERCEL_OIDC_TOKEN=F.token;return}});export default E();
1
+ import{a as U,b as V}from"./index-hnfqppx9.js";import{Wg as R}from"./index-f7kmsdfk.js";var E=R((M,Q)=>{var{defineProperty:H,getOwnPropertyDescriptor:W,getOwnPropertyNames:X}=Object,Y=Object.prototype.hasOwnProperty,Z=(z,q)=>{for(var B in q)H(z,B,{get:q[B],enumerable:!0})},$=(z,q,B,F)=>{if(q&&typeof q==="object"||typeof q==="function"){for(let v of X(q))if(!Y.call(z,v)&&v!==B)H(z,v,{get:()=>q[v],enumerable:!(F=W(q,v))||F.enumerable})}return z},A=(z)=>$(H({},"__esModule",{value:!0}),z),L={};Z(L,{refreshToken:()=>D});Q.exports=A(L);var K=U(),G=V();async function D(z){let q=z?.project,B=z?.team;if(!q&&!B){let v=(0,G.findProjectInfo)();q=v.projectId,B=v.teamId}else if(!q||!B){let v=(0,G.findProjectInfo)();q=q??v.projectId,B=B??v.teamId}if(!q)throw new K.VercelOidcTokenError("Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`");let F=(0,G.loadToken)(q);if(!F||(0,G.isExpired)((0,G.getTokenPayload)(F.token),z?.expirationBufferMs)){let v=await(0,G.getVercelToken)({expirationBufferMs:z?.expirationBufferMs});if(F=await(0,G.getVercelOidcToken)(v,q,B),!F)throw new K.VercelOidcTokenError("Failed to refresh OIDC token");(0,G.saveToken)(F,q)}process.env.VERCEL_OIDC_TOKEN=F.token;return}});export default E();
@@ -0,0 +1 @@
1
+ import{b as a}from"./index-hnfqppx9.js";import"./index-f7kmsdfk.js";export default a();
@@ -1,9 +1,9 @@
1
- import{Df as u,Ef as P,wf as h}from"./index-snq7bwr6.js";import{eg as M,fg as R,lg as S}from"./index-2f330s35.js";import"./index-cxnrd85v.js";import{mkdir as Yq,writeFile as Vq}from"node:fs/promises";import{homedir as Wq}from"node:os";import{dirname as Dq,join as b}from"node:path";import{applyEdits as t,modify as r,parse as e}from"jsonc-parser";function qq(z){return z!==null&&typeof z==="object"&&!Array.isArray(z)}async function k(z){try{let q=[],H=e(await S(z,M),q,{allowTrailingComma:!0});return q.length===0&&qq(H)?H:{}}catch(q){if(q instanceof R&&q.code!=="ENOENT")throw q;return{}}}var zq=`// Shared preferences for TUI plugins.
1
+ import{Vf as _,bg as R,cg as I,dg as x}from"./index-50p400eg.js";import{Gg as N,Hg as L,Ng as j}from"./index-m8m7rakq.js";import"./index-f7kmsdfk.js";import{mkdir as T,writeFile as h}from"node:fs/promises";import{homedir as y}from"node:os";import{dirname as f,join as C}from"node:path";import{applyEdits as g,modify as k,parse as b}from"jsonc-parser";function E(z){return z!==null&&typeof z==="object"&&!Array.isArray(z)}async function S(z){try{let q=[],H=b(await j(z,N),q,{allowTrailingComma:!0});return q.length===0&&E(H)?H:{}}catch(q){if(q instanceof L&&q.code!=="ENOENT")throw q;return{}}}var w=`// Shared preferences for TUI plugins.
2
2
  // Plugins update individual keys in place and preserve comments.
3
3
  {}
4
- `;function g(z){let{file:q,pluginKey:H,beforeCommit:Q}=z,$={...P.preferences,timeoutMs:z.timeoutMs??P.preferences.timeoutMs},Z=Promise.resolve();async function X(U,j){await u(q,$,async(K)=>{let J;try{J=await S(q,M)}catch(G){if(G.code!=="ENOENT")throw G;J=""}if(J.trim()==="")J=zq;let B=t(J,r(J,[H,...U],j,{formattingOptions:{insertSpaces:!0,tabSize:2}}));await h(q,B,{serialize:(G)=>String(G),beforeRename:async()=>{await Q?.(),await K.assertOwned()}})})}return{queueTuiPreferenceUpdate(U,j){let K=[...U],J=structuredClone(j),B=Z.then(()=>X(K,J));return Z=B.catch(()=>{}),B}}}import{readFileSync as Hq,realpathSync as Qq,statSync as Xq,watch as Zq}from"node:fs";import{readFile as $q,stat as Bq}from"node:fs/promises";import{basename as p,dirname as s,join as Gq,resolve as Jq}from"node:path";import{clearTimeout as w,setTimeout as c}from"node:timers";function n(z){let q=Jq(z);if(M)return q;try{return Qq(q)}catch{let H=s(q);return H===q?q:Gq(n(H),p(q))}}function d(z){return z&&`${z.dev}:${z.ino}:${z.mtimeMs}:${z.size}`}function T(z,q,H={}){let Q=globalThis,$=Symbol.for("cortexkit.common-auth.tui-prefs.watchers.v1"),Z=Q[$]??new Map;Q[$]=Z;let X=n(z),U=Z.get(X);if(U)return U.subscribe(q);let j=p(X),K=M?(Y)=>S(Y):H.fs?.readFile??((Y)=>$q(Y,"utf8")),J=H.fs?.stat??Bq,B=null,G=null,x=null,C=null;if(!M)try{let Y=d((H.fs?.statSync??Xq)(X));C=(H.fs?.readFileSync??((V)=>Hq(V,"utf8")))(X),x=Y}catch{}let N=!1,L=new Set,E=Promise.resolve(),v=(Y)=>{return E=E.then(async()=>{if(N)return;let V=d(await J(X).catch(()=>null));if(!Y&&V===x)return;if(V===null){x=null;return}let I=await K(X).catch((W)=>{if(W instanceof R&&W.code!=="ENOENT")if(H.onError)H.onError(W);else process.emitWarning(W.message,W.name);return null});if(N)return;if(I===null)return;if(x=V,I===C)return;C=I;for(let W of[...L]){if(!L.has(W))continue;try{W.notify()}catch{}}}),E},i=()=>{if(N)return;if(B)w(B);B=c(()=>{B=null,v(!0)},150)},O=null;try{O=(H.watchDirectory??Zq)(s(X),(Y,V)=>{let I=V?.toString(),W=I===j||I?.startsWith(`${j}.`)&&I.endsWith(".tmp");if(I!=null&&!W)return;i()}),O.on("error",()=>{O?.close(),O=null})}catch{}let f=()=>{if(N||G)return;G=c(()=>{if(G=null,N)return;v(!1).finally(f)},1000),G.unref()},F={subscribe:(Y)=>{let V={notify:Y};return L.add(V),()=>{if(!L.delete(V)||L.size>0)return;if(N=!0,B)w(B);if(G)w(G);if(O?.close(),Z.get(X)===F)Z.delete(X)}}};return Z.set(X,F),f(),F.subscribe(q)}var Uq="OPENCODE_TUI_PREFERENCES_FILE",Iq="tui-preferences.jsonc";function m(){let z=process.env[Uq];if(z)return z;let q=process.env.OPENCODE_CONFIG_DIR||b(process.env.XDG_CONFIG_HOME||b(Wq(),".config"),"opencode");return b(q,Iq)}function _(z){return typeof z==="object"&&z!==null&&!Array.isArray(z)}function dq(){return k(m())}var Mq="openai-auth",Aq=160,l={forceToTop:!1,order:Aq,startCollapsed:!1,rememberCollapsed:!0,collapsed:null,pollMs:1500,refreshDebounceMs:200,header:{label:"OPENAI",showVersion:!0},sections:{quota:!0,fallbackAccounts:!0,routing:!0,health:!0,pacing:!0},appearance:{barWidth:10,barFilledChar:"█",barEmptyChar:"░",warnThreshold:50,errorThreshold:80}};function D(z,q){return typeof z==="boolean"?z:q}function A(z,q,H,Q){if(typeof z!=="number"||!Number.isFinite(z))return q;return Math.min(Math.max(Math.round(z),H),Q)}function jq(z,q,H){if(typeof z!=="string"||z.length===0)return q;return z.slice(0,H)}function o(z,q){if(typeof z!=="string")return q;return[...z][0]??q}function pq(z){let q=z[Mq];if(!_(q))return structuredClone(l);let H=l,Q=_(q.header)?q.header:{},$=_(q.sections)?q.sections:{},Z=_(q.appearance)?q.appearance:{},X=A(Z.warnThreshold,H.appearance.warnThreshold,0,99),U=Math.max(A(Z.errorThreshold,H.appearance.errorThreshold,0,100),Math.min(X+1,100));return{forceToTop:D(q.forceToTop,H.forceToTop),order:A(q.order,H.order,-1e4,1e4),startCollapsed:D(q.startCollapsed,H.startCollapsed),rememberCollapsed:D(q.rememberCollapsed,H.rememberCollapsed),collapsed:typeof q.collapsed==="boolean"?q.collapsed:null,pollMs:A(q.pollMs,H.pollMs,500,30000),refreshDebounceMs:A(q.refreshDebounceMs,H.refreshDebounceMs,50,5000),header:{label:jq(Q.label,H.header.label,20),showVersion:D(Q.showVersion,H.header.showVersion)},sections:{quota:D($.quota,H.sections.quota),fallbackAccounts:D($.fallbackAccounts,H.sections.fallbackAccounts),routing:D($.routing,H.sections.routing),health:D($.health,H.sections.health),pacing:D($.pacing,H.sections.pacing)},appearance:{barWidth:A(Z.barWidth,H.appearance.barWidth,4,40),barFilledChar:o(Z.barFilledChar,H.appearance.barFilledChar),barEmptyChar:o(Z.barEmptyChar,H.appearance.barEmptyChar),warnThreshold:X,errorThreshold:U}}}var Nq=-1e5;function sq(z,q,H){let Q=z[q];if(!_(Q))return H;if(Q.forceToTop===!0)return Nq+Object.keys(z).indexOf(q);return A(Q.order,H,-1e4,1e4)}var Kq=`// Shared preferences for opencode TUI plugins.
4
+ `;function A(z){let{file:q,pluginKey:H,beforeCommit:Q}=z,X={...I.preferences,timeoutMs:z.timeoutMs??I.preferences.timeoutMs},$=Promise.resolve();async function V(J,D){await R(q,X,async(U)=>{let B;try{B=await j(q,N)}catch(M){if(M.code!=="ENOENT")throw M;B=""}if(B.trim()==="")B=w;let W=g(B,k(B,[H,...J],D,{formattingOptions:{insertSpaces:!0,tabSize:2}}));await _(q,W,{serialize:(M)=>String(M),beforeRename:async()=>{await Q?.(),await U.assertOwned()}})})}return{queueTuiPreferenceUpdate(J,D){let U=[...J],B=structuredClone(D),W=$.then(()=>V(U,B));return $=W.catch(()=>{}),W}}}var p="OPENCODE_TUI_PREFERENCES_FILE",c="tui-preferences.jsonc";function K(){let z=process.env[p];if(z)return z;let q=process.env.OPENCODE_CONFIG_DIR||C(process.env.XDG_CONFIG_HOME||C(y(),".config"),"opencode");return C(q,c)}function Y(z){return typeof z==="object"&&z!==null&&!Array.isArray(z)}function Jq(){return S(K())}var v="openai-auth",d=160,m={forceToTop:!1,order:d,startCollapsed:!1,rememberCollapsed:!0,collapsed:null,pollMs:1500,refreshDebounceMs:200,header:{label:"OPENAI",showVersion:!0},sections:{quota:!0,fallbackAccounts:!0,routing:!0,health:!0,pacing:!0},appearance:{barWidth:10,barFilledChar:"█",barEmptyChar:"░",warnThreshold:50,errorThreshold:80}};function Z(z,q){return typeof z==="boolean"?z:q}function G(z,q,H,Q){if(typeof z!=="number"||!Number.isFinite(z))return q;return Math.min(Math.max(Math.round(z),H),Q)}function u(z,q,H){if(typeof z!=="string"||z.length===0)return q;return z.slice(0,H)}function P(z,q){if(typeof z!=="string")return q;return[...z][0]??q}function Yq(z){let q=z[v];if(!Y(q))return structuredClone(m);let H=m,Q=Y(q.header)?q.header:{},X=Y(q.sections)?q.sections:{},$=Y(q.appearance)?q.appearance:{},V=G($.warnThreshold,H.appearance.warnThreshold,0,99),J=Math.max(G($.errorThreshold,H.appearance.errorThreshold,0,100),Math.min(V+1,100));return{forceToTop:Z(q.forceToTop,H.forceToTop),order:G(q.order,H.order,-1e4,1e4),startCollapsed:Z(q.startCollapsed,H.startCollapsed),rememberCollapsed:Z(q.rememberCollapsed,H.rememberCollapsed),collapsed:typeof q.collapsed==="boolean"?q.collapsed:null,pollMs:G(q.pollMs,H.pollMs,500,30000),refreshDebounceMs:G(q.refreshDebounceMs,H.refreshDebounceMs,50,5000),header:{label:u(Q.label,H.header.label,20),showVersion:Z(Q.showVersion,H.header.showVersion)},sections:{quota:Z(X.quota,H.sections.quota),fallbackAccounts:Z(X.fallbackAccounts,H.sections.fallbackAccounts),routing:Z(X.routing,H.sections.routing),health:Z(X.health,H.sections.health),pacing:Z(X.pacing,H.sections.pacing)},appearance:{barWidth:G($.barWidth,H.appearance.barWidth,4,40),barFilledChar:P($.barFilledChar,H.appearance.barFilledChar),barEmptyChar:P($.barEmptyChar,H.appearance.barEmptyChar),warnThreshold:V,errorThreshold:J}}}var s=-1e5;function Vq(z,q,H){let Q=z[q];if(!Y(Q))return H;if(Q.forceToTop===!0)return s+Object.keys(z).indexOf(q);return G(Q.order,H,-1e4,1e4)}var n=`// Shared preferences for opencode TUI plugins.
5
5
  // One top-level key per plugin (short name). See each plugin's README for
6
6
  // its supported settings. This file is safe to hand-edit; plugins update
7
7
  // individual keys in place and preserve comments.
8
8
  {}
9
- `,a=new Map;function Lq(z,q){let H=JSON.stringify([z,q]),Q=a.get(H);if(!Q)Q=g({file:z,pluginKey:q}),a.set(H,Q);return Q}async function Oq(z){await Yq(Dq(z),{recursive:!0}),await Vq(z,Kq,{encoding:"utf8",flag:"wx"}).catch(()=>{})}var y=Promise.resolve();function nq(z,q,H){let Q=m(),$=Lq(Q,z);return y=y.then(()=>Oq(Q)).then(()=>$.queueTuiPreferenceUpdate(q,H)).catch(()=>{}),y}function lq(z){return T(m(),z)}export{lq as watchTuiPreferences,pq as resolveOpenaiAuthPrefs,dq as readTuiPreferencesFile,nq as queueTuiPreferenceUpdate,m as getTuiPreferencesFile,sq as computeEffectiveOrder,Uq as TUI_PREFS_FILE_ENV,Mq as PLUGIN_KEY,Aq as DEFAULT_SLOT_ORDER,l as DEFAULT_PREFS};
9
+ `,F=new Map;function o(z,q){let H=JSON.stringify([z,q]),Q=F.get(H);if(!Q)Q=A({file:z,pluginKey:q}),F.set(H,Q);return Q}async function i(z){await T(f(z),{recursive:!0}),await h(z,n,{encoding:"utf8",flag:"wx"}).catch(()=>{})}var O=Promise.resolve();function Wq(z,q,H){let Q=K(),X=o(Q,z);return O=O.then(()=>i(Q)).then(()=>X.queueTuiPreferenceUpdate(q,H)).catch(()=>{}),O}function Mq(z){return x(K(),z)}export{Mq as watchTuiPreferences,Yq as resolveOpenaiAuthPrefs,Jq as readTuiPreferencesFile,Wq as queueTuiPreferenceUpdate,K as getTuiPreferencesFile,Vq as computeEffectiveOrder,p as TUI_PREFS_FILE_ENV,v as PLUGIN_KEY,d as DEFAULT_SLOT_ORDER,m as DEFAULT_PREFS};
@@ -1,4 +1,4 @@
1
- import { c as HostSlotAdapter, d as OpenAiVaultOptions, f as BeginAccountLoginOptions, i as CodexSessionMetadata, o as RuntimeLayoutOptions, p as BeginAccountLoginResult, r as CodexRequestRuntime, s as PoolLifecycleDeps, v as AccountPaths } from "../codex-request-Cl6zEfsR.js";
1
+ import { C as AccountPaths, c as HostSlotAdapter, d as OpenAiVaultOptions, f as BeginAccountLoginOptions, i as CodexSessionMetadata, o as RuntimeLayoutOptions, p as BeginAccountLoginResult, r as CodexRequestRuntime, s as PoolLifecycleDeps } from "../codex-request-DYqSE0ti.js";
2
2
  import { i as OpenDialogPayload, n as ApplyResult } from "../protocol-BZZtDn5h.js";
3
3
  import { Plugin } from "@opencode/plugin";
4
4
  import "@opencode/plugin/promise/integration";