@wirecat/drive-cli 0.64.0 → 0.66.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 (228) hide show
  1. package/contracts/wirecat.json +2871 -0
  2. package/dist/bin/drive.js +2 -2
  3. package/dist/bin/drive.js.map +1 -1
  4. package/dist/browse.d.ts +1 -1
  5. package/dist/browse.d.ts.map +1 -1
  6. package/dist/browse.js +1 -1
  7. package/dist/bundle/{all-profiles-BPPT2AK5.js → all-profiles-WCQLIHUG.js} +14 -13
  8. package/dist/bundle/{anthropic-JW6GOJUD.js → anthropic-5RJMB6O7.js} +32 -16
  9. package/dist/bundle/{app-server-KAQIOJMZ.js → app-server-3RGYXPKG.js} +72 -58
  10. package/dist/bundle/{bun-UT7GNTPV.js → bun-L34VEKGG.js} +2 -2
  11. package/dist/bundle/{bun-sqlite-2OIVV3LS.js → bun-sqlite-H6IAXQXI.js} +12 -8
  12. package/dist/bundle/chunk-2AF77WMH.js +13 -0
  13. package/dist/bundle/{chunk-KVW4XNKB.js → chunk-2S3E2HVV.js} +107 -48
  14. package/dist/bundle/{chunk-IX7NQJLY.js → chunk-3NYH756U.js} +49 -116
  15. package/dist/bundle/chunk-3QFUDXMQ.js +53 -0
  16. package/dist/bundle/{chunk-5ZBR55US.js → chunk-3SDJIMZB.js} +1 -1
  17. package/dist/bundle/{chunk-AHB4OJCI.js → chunk-4UHBJSMI.js} +21735 -27143
  18. package/dist/bundle/chunk-5HVJK3ZJ.js +101 -0
  19. package/dist/bundle/{chunk-GSMYXGFR.js → chunk-5K54RZBK.js} +13 -5
  20. package/dist/bundle/{chunk-LOMW6F2E.js → chunk-5PLINHEY.js} +5403 -4847
  21. package/dist/bundle/{chunk-J62DI53V.js → chunk-5VDVGDOC.js} +1 -1
  22. package/dist/bundle/{chunk-66AF4FBW.js → chunk-5XLU4NN6.js} +4 -4
  23. package/dist/bundle/{chunk-4CNTID2X.js → chunk-6UJCCOZC.js} +4 -4
  24. package/dist/bundle/{chunk-G4KEKKDE.js → chunk-6X3KUFRQ.js} +60 -29
  25. package/dist/bundle/{chunk-QEAD2LF4.js → chunk-7EP4AU6A.js} +3 -3
  26. package/dist/bundle/{chunk-ZRZ4HTCK.js → chunk-7LT2G5BC.js} +171 -174
  27. package/dist/bundle/{chunk-2W464HAE.js → chunk-7ZGJRVBH.js} +7 -5
  28. package/dist/bundle/{chunk-FXBHOCJK.js → chunk-ADLS6FVG.js} +1 -1
  29. package/dist/bundle/{chunk-KG2XKEHL.js → chunk-ALE67WRR.js} +5 -5
  30. package/dist/bundle/{chunk-ZSZJLJIA.js → chunk-AP4MX247.js} +38 -28
  31. package/dist/bundle/{chunk-EWGVDFPT.js → chunk-BIJW6AYA.js} +41873 -36466
  32. package/dist/bundle/{chunk-B7XBIOMR.js → chunk-BQXSE645.js} +16 -16
  33. package/dist/bundle/{chunk-F2VDAG32.js → chunk-COGWKO2T.js} +3 -3
  34. package/dist/bundle/{chunk-EZ6O3ST3.js → chunk-D4MIMH2N.js} +12 -6
  35. package/dist/bundle/{chunk-4YRENUB5.js → chunk-D7KOAPG6.js} +2 -2
  36. package/dist/bundle/chunk-E2F2XIX6.js +224 -0
  37. package/dist/bundle/{chunk-36GPBPWM.js → chunk-FA2TNA5X.js} +3 -1
  38. package/dist/bundle/{chunk-SIOIMO62.js → chunk-FHBTQPA3.js} +69 -63
  39. package/dist/bundle/{chunk-34BIDKF4.js → chunk-FKKPVPZR.js} +649 -212
  40. package/dist/bundle/chunk-G4TNKBDX.js +185 -0
  41. package/dist/bundle/{chunk-2FEZ24DK.js → chunk-GVA3KTCD.js} +20 -20
  42. package/dist/bundle/chunk-GY4DAJSK.js +167 -0
  43. package/dist/bundle/{chunk-5OFA5EXE.js → chunk-H7XL6WTW.js} +2 -2
  44. package/dist/bundle/{chunk-K6BSB53R.js → chunk-HHRJPLFO.js} +1 -1
  45. package/dist/bundle/{chunk-P7DEGRZA.js → chunk-HPKE2GDP.js} +49 -28
  46. package/dist/bundle/{chunk-QXCKJUZY.js → chunk-HPSHQVJU.js} +633 -465
  47. package/dist/bundle/{chunk-BEZJA44H.js → chunk-HQBLJLYH.js} +7 -7
  48. package/dist/bundle/{chunk-JRXFW7HE.js → chunk-I5R5CMQR.js} +5 -5
  49. package/dist/bundle/{chunk-EJ4PNHPP.js → chunk-IIHZTV6V.js} +1 -1
  50. package/dist/bundle/{chunk-G3NULXOM.js → chunk-IRNDYNQX.js} +4 -4
  51. package/dist/bundle/{chunk-N622LRPM.js → chunk-JCHF7LZT.js} +4 -4
  52. package/dist/bundle/{chunk-WWCYTMAV.js → chunk-JHMEETXI.js} +2 -2
  53. package/dist/bundle/{chunk-ZF6GUZCE.js → chunk-JLCR24UM.js} +1 -1
  54. package/dist/bundle/{chunk-IDAK4DDK.js → chunk-JQXK3M5M.js} +1 -1
  55. package/dist/bundle/{chunk-KIN6PDFE.js → chunk-KOY5HUBY.js} +14 -5
  56. package/dist/bundle/{chunk-5HSRQ53R.js → chunk-KRG5X5PH.js} +2 -2
  57. package/dist/bundle/{chunk-VIJ6ACYB.js → chunk-LVAPSAHF.js} +8 -8
  58. package/dist/bundle/{chunk-OEVHZOHC.js → chunk-M7543RUJ.js} +50 -18
  59. package/dist/bundle/{chunk-BZ2ZKILM.js → chunk-MZWXTJ4O.js} +3 -3
  60. package/dist/bundle/{chunk-EC2XGDKJ.js → chunk-NK4GVFJH.js} +4 -4
  61. package/dist/bundle/chunk-NYECVHFH.js +10283 -0
  62. package/dist/bundle/{chunk-HW4UPST2.js → chunk-NYZS2LKF.js} +2 -2
  63. package/dist/bundle/chunk-O53WLYX3.js +72 -0
  64. package/dist/bundle/{chunk-IK6KH3RE.js → chunk-OIF4B526.js} +1 -1
  65. package/dist/bundle/{chunk-UJR272CP.js → chunk-OT7SQQJK.js} +359 -903
  66. package/dist/bundle/chunk-OZOQLAWK.js +72 -0
  67. package/dist/bundle/{chunk-VT2UFYPJ.js → chunk-P7HQFII6.js} +22 -15
  68. package/dist/bundle/{chunk-6G53ZFUT.js → chunk-PJGOQSE5.js} +1 -1
  69. package/dist/bundle/{chunk-OH3K2E7X.js → chunk-PKM55ZRR.js} +704 -1214
  70. package/dist/bundle/{chunk-GW3U6OLD.js → chunk-PUMDOCAF.js} +1 -1
  71. package/dist/bundle/{chunk-EQEGJVO2.js → chunk-QF7VL4C3.js} +1 -1
  72. package/dist/bundle/{chunk-CPMRM3GQ.js → chunk-QJ57PV55.js} +1941 -662
  73. package/dist/bundle/{chunk-O2QO5UZC.js → chunk-QSELSDWE.js} +13 -13
  74. package/dist/bundle/{chunk-BEUAICUD.js → chunk-SOOU5WO6.js} +2 -2
  75. package/dist/bundle/{chunk-46CD64J2.js → chunk-SZ6JFOL4.js} +269 -64
  76. package/dist/bundle/{chunk-UD55VB2N.js → chunk-T3ULDA7C.js} +3 -3
  77. package/dist/bundle/{chunk-E2LBCCTG.js → chunk-TAHISPDE.js} +5 -5
  78. package/dist/bundle/{chunk-6B37XO6B.js → chunk-TYLEICTX.js} +3 -3
  79. package/dist/bundle/{chunk-TNV2FXVK.js → chunk-UAKX6DP4.js} +5 -5
  80. package/dist/bundle/{chunk-VPLFD5RJ.js → chunk-UG3GHFGY.js} +4 -4
  81. package/dist/bundle/{chunk-B67BLRAI.js → chunk-ULXEW6FT.js} +3 -60
  82. package/dist/bundle/{chunk-C7WBNOYW.js → chunk-UNTIVT47.js} +26 -2
  83. package/dist/bundle/chunk-UQPW42HF.js +18 -0
  84. package/dist/bundle/{chunk-USLZE36C.js → chunk-V2WXTILT.js} +6 -6
  85. package/dist/bundle/{chunk-BDYWZ7JE.js → chunk-VQKNKJYL.js} +46 -7
  86. package/dist/bundle/{chunk-XPXKD63J.js → chunk-VR3YKXHL.js} +93 -31
  87. package/dist/bundle/{chunk-UIEA6FIV.js → chunk-VUUPFDRU.js} +27 -28
  88. package/dist/bundle/{chunk-KE4XPPRQ.js → chunk-WYTYHUFH.js} +1750 -138
  89. package/dist/bundle/{chunk-PBMSBCVB.js → chunk-XLGDNI4S.js} +1 -1
  90. package/dist/bundle/{chunk-3J5KAFNA.js → chunk-XVZNFA2P.js} +4935 -3623
  91. package/dist/bundle/chunk-Y5U4HIZS.js +71 -0
  92. package/dist/bundle/chunk-YTIPTHEE.js +47 -0
  93. package/dist/bundle/cli-KW6QQVS5.js +1101 -0
  94. package/dist/bundle/command-contract-CE543JBN.js +41 -0
  95. package/dist/bundle/command-server-entry-OC4E4DED.js +171 -0
  96. package/dist/bundle/{decode-HTOQ6S3V.js → decode-AH5ZLLDK.js} +8 -8
  97. package/dist/bundle/{dispatch-SH5SP6LA.js → dispatch-CDWZZ54Q.js} +9 -9
  98. package/dist/bundle/drive.js +13 -13
  99. package/dist/bundle/{echarts-KFHB6SLX.js → echarts-VC7MTXWY.js} +2 -2
  100. package/dist/bundle/{embed-YATFB2PN.js → embed-EPSQY6QG.js} +9 -9
  101. package/dist/bundle/{embedder-MQPDFGTJ.js → embedder-TK4U4TJR.js} +12 -12
  102. package/dist/bundle/entry-3VN23M7M.js +25 -0
  103. package/dist/bundle/{failure-4FQL4XJI.js → failure-WSVZOPFE.js} +4 -4
  104. package/dist/bundle/first-run-7ZYJ7EB3.js +30 -0
  105. package/dist/bundle/first-screen-CZDH7QY3.js +39 -0
  106. package/dist/bundle/google-OBZMWA7J.js +45 -0
  107. package/dist/bundle/{google-api-QMFGCXBM.js → google-api-AV4X2JH3.js} +68 -57
  108. package/dist/bundle/grants-WTRLN4ZI.js +111 -0
  109. package/dist/bundle/{identity-FYVDK4M2.js → identity-CGHHF7AK.js} +8 -6
  110. package/dist/bundle/{instructions-D3GF3B7M.js → instructions-24PHDBBE.js} +1 -1
  111. package/dist/bundle/{login-COFZ2IWP.js → login-XHFESAFM.js} +73 -64
  112. package/dist/bundle/{mcp-RKJG22KM.js → mcp-M5YCSWJJ.js} +2 -2
  113. package/dist/bundle/{node-OFICOKX3.js → node-GIDULTV5.js} +2 -2
  114. package/dist/bundle/{node-KM3CUABH.js → node-P4E63KXA.js} +9 -9
  115. package/dist/bundle/{node-sqlite-DNBTDOXD.js → node-sqlite-LINBOAWK.js} +13 -9
  116. package/dist/bundle/oauth-JHUX3KE3.js +22 -0
  117. package/dist/bundle/{open-PTPR2YWX.js → open-RYFKPNCJ.js} +8 -8
  118. package/dist/bundle/{openai-2KV5LUW4.js → openai-Q7YYUHJF.js} +28 -42
  119. package/dist/bundle/{process-EAW6NST2.js → process-VPIZTIJR.js} +1 -1
  120. package/dist/bundle/{program-6UV5Q5YN.js → program-IUXFRBZA.js} +419 -604
  121. package/dist/bundle/{prompt-634TPMJK.js → prompt-LF4KX3XL.js} +8 -8
  122. package/dist/bundle/{reasons-DDWCEYSQ.js → reasons-JPYOU5GV.js} +5 -5
  123. package/dist/bundle/{recognize-SJO6QUDW.js → recognize-KEWTJXFH.js} +7 -7
  124. package/dist/bundle/{remote-6JXZITKF.js → remote-HGGLB76S.js} +13 -10
  125. package/dist/bundle/{rerank-MD5VOPQ6.js → rerank-TDUKETFT.js} +10 -10
  126. package/dist/bundle/{serve-LZTROA2M.js → serve-XFYMKW5W.js} +12 -12
  127. package/dist/bundle/server-BDEV3CZJ.js +74 -0
  128. package/dist/bundle/{server-NSA3UAFY.js → server-PXIPSGFP.js} +48 -44
  129. package/dist/bundle/{services-F5A6XQCV.js → services-2BOCGMJU.js} +111 -41
  130. package/dist/bundle/{sqlite-runtime-7YF6REKS.js → sqlite-runtime-R7M5XUMW.js} +9 -9
  131. package/dist/bundle/{start-MUFLE6FA.js → start-YRLT4MQZ.js} +7 -7
  132. package/dist/bundle/{state-UC54F3YZ.js → state-NZ7WRJWH.js} +9 -9
  133. package/dist/bundle/{store-F5FJGWMR.js → store-7LCVDO7G.js} +63 -28
  134. package/dist/bundle/{store-J53YNAH6.js → store-ICDGPSEN.js} +27 -18
  135. package/dist/bundle/store-maintenance-command-SJPLY6IH.js +65 -0
  136. package/dist/bundle/tokens-FGTBE7VW.js +111 -0
  137. package/dist/commands/config.d.ts.map +1 -1
  138. package/dist/commands/config.js +6 -5
  139. package/dist/commands/config.js.map +1 -1
  140. package/dist/commands/context.d.ts +4 -2
  141. package/dist/commands/context.d.ts.map +1 -1
  142. package/dist/commands/context.js.map +1 -1
  143. package/dist/commands/discovery.d.ts +0 -1
  144. package/dist/commands/discovery.d.ts.map +1 -1
  145. package/dist/commands/discovery.js +6 -26
  146. package/dist/commands/discovery.js.map +1 -1
  147. package/dist/commands/documents.d.ts +2 -0
  148. package/dist/commands/documents.d.ts.map +1 -1
  149. package/dist/commands/documents.js +39 -3
  150. package/dist/commands/documents.js.map +1 -1
  151. package/dist/commands/knowledge.d.ts.map +1 -1
  152. package/dist/commands/knowledge.js +7 -6
  153. package/dist/commands/knowledge.js.map +1 -1
  154. package/dist/commands/search.d.ts.map +1 -1
  155. package/dist/commands/search.js +11 -8
  156. package/dist/commands/search.js.map +1 -1
  157. package/dist/config.d.ts +14 -0
  158. package/dist/config.d.ts.map +1 -1
  159. package/dist/config.js +35 -4
  160. package/dist/config.js.map +1 -1
  161. package/dist/contract-overrides.d.ts +16 -4
  162. package/dist/contract-overrides.d.ts.map +1 -1
  163. package/dist/contract-overrides.js +86 -410
  164. package/dist/contract-overrides.js.map +1 -1
  165. package/dist/documents-add.d.ts +49 -0
  166. package/dist/documents-add.d.ts.map +1 -0
  167. package/dist/documents-add.js +122 -0
  168. package/dist/documents-add.js.map +1 -0
  169. package/dist/errors.d.ts +1 -0
  170. package/dist/errors.d.ts.map +1 -1
  171. package/dist/errors.js +13 -1
  172. package/dist/errors.js.map +1 -1
  173. package/dist/google-api.d.ts.map +1 -1
  174. package/dist/google-api.js +4 -1
  175. package/dist/google-api.js.map +1 -1
  176. package/dist/identity.d.ts +4 -0
  177. package/dist/identity.d.ts.map +1 -1
  178. package/dist/identity.js +22 -0
  179. package/dist/identity.js.map +1 -1
  180. package/dist/knowledge.d.ts +1 -1
  181. package/dist/knowledge.d.ts.map +1 -1
  182. package/dist/knowledge.js +17 -19
  183. package/dist/knowledge.js.map +1 -1
  184. package/dist/login.d.ts.map +1 -1
  185. package/dist/login.js +2 -2
  186. package/dist/login.js.map +1 -1
  187. package/dist/model.d.ts +3 -0
  188. package/dist/model.d.ts.map +1 -1
  189. package/dist/model.js.map +1 -1
  190. package/dist/program.d.ts.map +1 -1
  191. package/dist/program.js +30 -21
  192. package/dist/program.js.map +1 -1
  193. package/dist/reasons.d.ts.map +1 -1
  194. package/dist/reasons.js +25 -1
  195. package/dist/reasons.js.map +1 -1
  196. package/dist/store-transition.js +2 -2
  197. package/dist/store-transition.js.map +1 -1
  198. package/dist/store.d.ts.map +1 -1
  199. package/dist/store.js +27 -7
  200. package/dist/store.js.map +1 -1
  201. package/dist/tokens.d.ts +9 -2
  202. package/dist/tokens.d.ts.map +1 -1
  203. package/dist/tokens.js +18 -15
  204. package/dist/tokens.js.map +1 -1
  205. package/dist/version.d.ts +1 -1
  206. package/dist/version.js +1 -1
  207. package/dist/wcat.d.ts +3 -0
  208. package/dist/wcat.d.ts.map +1 -0
  209. package/dist/wcat.js +4 -0
  210. package/dist/wcat.js.map +1 -0
  211. package/package.json +8 -8
  212. package/dist/bundle/chunk-3NULZGQU.js +0 -27
  213. package/dist/bundle/chunk-DD7EFG6B.js +0 -35
  214. package/dist/bundle/chunk-M73NNJ3X.js +0 -26
  215. package/dist/bundle/chunk-SBZB7HMU.js +0 -1055
  216. package/dist/bundle/command-contract-H5OYJOPF.js +0 -38
  217. package/dist/bundle/dist-PY3MVR3G.js +0 -21
  218. package/dist/bundle/entry-YZBB647C.js +0 -22
  219. package/dist/bundle/first-run-5JT3UQZB.js +0 -30
  220. package/dist/bundle/first-screen-BEMDEWO7.js +0 -36
  221. package/dist/bundle/google-DVADVICN.js +0 -36
  222. package/dist/bundle/grants-WKB2E4TA.js +0 -103
  223. package/dist/bundle/oauth-PDQHWFBF.js +0 -22
  224. package/dist/bundle/server-GT7X666D.js +0 -69
  225. package/dist/bundle/store-maintenance-command-GJVXLBAB.js +0 -58
  226. package/dist/bundle/tokens-H2EJKGA5.js +0 -101
  227. package/dist/bundle/{chunk-SW6C6WH5.js → chunk-HVJJWJYQ.js} +0 -0
  228. package/dist/bundle/{mdast-util-from-markdown-FXEPSNER.js → mdast-util-from-markdown-CE73EWJ2.js} +3 -3
@@ -0,0 +1,101 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ endpoint
5
+ } from "./chunk-GY4DAJSK.js";
6
+ import {
7
+ check,
8
+ getDotPath,
9
+ maxLength,
10
+ minLength,
11
+ optional,
12
+ picklist,
13
+ pipe,
14
+ record,
15
+ regex,
16
+ safeParse,
17
+ strictObject,
18
+ string,
19
+ trim
20
+ } from "./chunk-VQKNKJYL.js";
21
+ import {
22
+ CliError
23
+ } from "./chunk-IIHZTV6V.js";
24
+ import {
25
+ __name
26
+ } from "./chunk-ZVVMGPBJ.js";
27
+
28
+ // node_modules/.pnpm/@wirecat+cli-core@0.650.0_@wirecat+cli-base@0.98.0_commander@15.0.0_esbuild@0.28.2_type_7618ae642a1b316105e0e055c769f604/node_modules/@wirecat/cli-core/dist/models/settings.js
29
+ var MODEL_FIELDS = ["provider", "model", "base_url"];
30
+ var modelSettingsShape = record(pipe(string(), regex(/^[a-z][a-z0-9-]*$/)), strictObject({
31
+ provider: optional(picklist(["off", "openai", "anthropic"])),
32
+ model: optional(pipe(string(), trim(), minLength(1), maxLength(200))),
33
+ base_url: optional(pipe(string(), check((value) => endpoint(value), "use an HTTP/S endpoint without credentials, query or fragment")))
34
+ }));
35
+ var resolveModelSettings = /* @__PURE__ */ __name((prefix, layers, env) => {
36
+ const configured = layers.map(([from, scope]) => [from, scope?.models ?? {}]);
37
+ const purposes = /* @__PURE__ */ new Set([
38
+ "default",
39
+ "analysis",
40
+ "replies",
41
+ ...configured.flatMap(([, models2]) => Object.keys(models2))
42
+ ]);
43
+ for (const name of Object.keys(env)) {
44
+ const match = new RegExp(`^${prefix}_MODELS_([A-Z][A-Z0-9_]*)_(PROVIDER|MODEL|BASE_URL)$`).exec(name);
45
+ if (match?.[1])
46
+ purposes.add(match[1].toLowerCase().replaceAll("_", "-"));
47
+ }
48
+ const models = {};
49
+ const sources = {};
50
+ for (const purpose of purposes) {
51
+ const resolved = {};
52
+ for (const field of MODEL_FIELDS) {
53
+ const variable = `${prefix}_MODELS_${purpose.replaceAll("-", "_").toUpperCase()}_${field.toUpperCase()}`;
54
+ const candidates = [
55
+ [variable, env[variable]?.trim() || void 0],
56
+ ...configured.map(([from, model]) => [
57
+ `${from}: models.${purpose}.${field}`,
58
+ model[purpose]?.[field]
59
+ ]),
60
+ ...purpose === "default" ? [] : [
61
+ [
62
+ `${prefix}_MODELS_DEFAULT_${field.toUpperCase()}`,
63
+ env[`${prefix}_MODELS_DEFAULT_${field.toUpperCase()}`]?.trim() || void 0
64
+ ],
65
+ ...configured.map(([from, model]) => [
66
+ `${from}: models.default.${field}`,
67
+ model.default?.[field]
68
+ ])
69
+ ]
70
+ ];
71
+ const selected = candidates.find(([, value]) => value !== void 0);
72
+ if (selected)
73
+ resolved[field] = selected[1];
74
+ sources[`models.${purpose}.${field}`] = selected?.[0] ?? "default";
75
+ }
76
+ if (Object.keys(resolved).length)
77
+ models[purpose] = resolved;
78
+ }
79
+ const checked = safeParse(modelSettingsShape, models);
80
+ if (!checked.success)
81
+ throw new CliError("configuration_error", `models.${getDotPath(checked.issues[0]) ?? "settings"} is invalid`);
82
+ return { models: checked.output, sources };
83
+ }, "resolveModelSettings");
84
+ var modelTarget = /* @__PURE__ */ __name((settings, purpose) => {
85
+ const configured = { ...settings.models?.default, ...settings.models?.[purpose] };
86
+ if (configured.provider === void 0 || configured.provider === "off")
87
+ return void 0;
88
+ if (!configured.model)
89
+ throw new CliError("configuration_error", `set models.${purpose}.model before calling its provider`);
90
+ return {
91
+ provider: configured.provider,
92
+ model: configured.model,
93
+ ...configured.base_url === void 0 ? {} : { baseUrl: configured.base_url }
94
+ };
95
+ }, "modelTarget");
96
+
97
+ export {
98
+ modelSettingsShape,
99
+ resolveModelSettings,
100
+ modelTarget
101
+ };
@@ -3,7 +3,7 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  CliError,
5
5
  isCliError
6
- } from "./chunk-EJ4PNHPP.js";
6
+ } from "./chunk-IIHZTV6V.js";
7
7
  import {
8
8
  __name
9
9
  } from "./chunk-ZVVMGPBJ.js";
@@ -12,12 +12,16 @@ import {
12
12
  var googleError = /* @__PURE__ */ __name((error) => {
13
13
  if (isCliError(error))
14
14
  return error;
15
+ const cause = error?.cause;
16
+ if (isCliError(cause) && error.code !== "TimeoutError")
17
+ return cause;
15
18
  const value = error;
16
19
  if (value?.name === "AbortError" || value?.code === "ERR_CANCELED")
17
20
  return new CliError("cancelled", "Google operation was cancelled", { reason: "command.cancelled" });
18
21
  const status = value?.status ?? value?.response?.status;
19
22
  const payload = value?.response?.data?.error;
20
23
  const reason = typeof payload === "string" ? payload : payload?.errors?.[0]?.reason;
24
+ const told = status === 403 && typeof reason === "string" && /^[A-Za-z]{1,64}$/.test(reason) ? { google_reason: reason } : {};
21
25
  const disabled = typeof payload === "object" && payload !== null && Array.isArray(payload.details) && payload.details.some((detail) => detail !== null && typeof detail === "object" && "@type" in detail && detail["@type"] === "type.googleapis.com/google.rpc.ErrorInfo" && "domain" in detail && detail.domain === "googleapis.com" && "reason" in detail && detail.reason === "SERVICE_DISABLED");
22
26
  if (reason === "invalid_grant" || reason === "invalid_token")
23
27
  return new CliError("authentication_error", "Google sign-in is no longer valid \u2014 run drive <profile> session start again", {
@@ -29,10 +33,11 @@ var googleError = /* @__PURE__ */ __name((error) => {
29
33
  });
30
34
  if (status === 403 && (reason === "accessNotConfigured" || disabled))
31
35
  return new CliError("configuration_error", "Google API is disabled for this OAuth project; its owner must enable it in Google Cloud API Library", { reason: "api.disabled", status });
32
- if (reason === "rateLimitExceeded" || reason === "userRateLimitExceeded")
36
+ if (reason === "rateLimitExceeded" || reason === "userRateLimitExceeded" || reason === "dailyLimitExceeded" || reason === "quotaExceeded")
33
37
  return new CliError("rate_limited", "Google rate limit reached; retry the command", {
34
38
  retryable: true,
35
- ...status ? { status } : {}
39
+ ...status ? { status } : {},
40
+ ...told
36
41
  });
37
42
  if (reason === "exportSizeLimitExceeded")
38
43
  return new CliError("validation_error", "Google exports at most 10 MB of a native file; this one is larger", {
@@ -44,7 +49,8 @@ var googleError = /* @__PURE__ */ __name((error) => {
44
49
  });
45
50
  if (status === 403)
46
51
  return new CliError("permission_error", "Google denied this operation; check access and OAuth permissions", {
47
- status
52
+ status,
53
+ ...told
48
54
  });
49
55
  if (status === 404)
50
56
  return new CliError("not_found", "Google source is unavailable or no longer accessible", { status });
@@ -56,7 +62,9 @@ var googleError = /* @__PURE__ */ __name((error) => {
56
62
  retryable: true
57
63
  });
58
64
  }, "googleError");
65
+ var offlineRefused = /* @__PURE__ */ __name((what = "this command may require network access") => new CliError("permission_error", `${what}; --offline was requested`, { reason: "offline.refused" }), "offlineRefused");
59
66
 
60
67
  export {
61
- googleError
68
+ googleError,
69
+ offlineRefused
62
70
  };