@wirecat/drive-cli 0.52.1 → 0.54.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 (218) hide show
  1. package/dist/bin/drive.js +2 -2
  2. package/dist/bin/drive.js.map +1 -1
  3. package/dist/bundle/{chunk-ZWSG7OCA.js → all-profiles-LFIPUPZI.js} +13 -8
  4. package/dist/bundle/{anthropic-KW6KU36Y.js → anthropic-G5ZRRWG4.js} +5 -5
  5. package/dist/bundle/{app-server-TCJZ333E.js → app-server-UVWATOQC.js} +48 -56
  6. package/dist/bundle/{bun-7SYKSCLA.js → bun-DNEFTPTR.js} +2 -2
  7. package/dist/bundle/{bun-sqlite-RI7DR6RZ.js → bun-sqlite-FWBYHIXB.js} +4 -4
  8. package/dist/bundle/{chunk-CM7GAXGD.js → chunk-2CQT2WWN.js} +5 -5
  9. package/dist/bundle/{chunk-HQVJK5E7.js → chunk-2D6AAGBP.js} +246 -383
  10. package/dist/bundle/{chunk-FG4XXZZE.js → chunk-2FFXRWI2.js} +2 -2
  11. package/dist/bundle/{chunk-2UIMEMWU.js → chunk-2HQPJ366.js} +3 -3
  12. package/dist/bundle/{chunk-CB7SBYLO.js → chunk-2HWOGSTA.js} +57 -37
  13. package/dist/bundle/{chunk-7XKAVMCF.js → chunk-2MSJVFAS.js} +8 -8
  14. package/dist/bundle/{chunk-NSIFQ5OP.js → chunk-2NWFZ43Q.js} +1 -1
  15. package/dist/bundle/{chunk-H47W2J6S.js → chunk-2Q3S47BC.js} +1312 -626
  16. package/dist/bundle/{chunk-O6IOL6RX.js → chunk-47MEPBWG.js} +21 -21
  17. package/dist/bundle/{chunk-725OHXKR.js → chunk-4RDXCE45.js} +2226 -37
  18. package/dist/bundle/{chunk-UR32UWTQ.js → chunk-5BPOAHVD.js} +13 -2
  19. package/dist/bundle/{chunk-5FONRUG6.js → chunk-5D4AEUVA.js} +1 -23
  20. package/dist/bundle/{chunk-VZ2I62HN.js → chunk-5LNOVPOR.js} +2 -2
  21. package/dist/bundle/{chunk-EKFEY3KP.js → chunk-5WQN2TUM.js} +1 -1
  22. package/dist/bundle/{chunk-ALJWBGD5.js → chunk-6MGSFYGL.js} +1 -1
  23. package/dist/bundle/{chunk-WUX7AUOQ.js → chunk-6RAEXK7Y.js} +26 -26
  24. package/dist/bundle/{chunk-BSSCTWWK.js → chunk-6SOQJRGI.js} +4 -4
  25. package/dist/bundle/{chunk-CKBHR7QO.js → chunk-75DSLCPC.js} +1 -1
  26. package/dist/bundle/{chunk-VSOLLTYT.js → chunk-76JIVDKC.js} +7 -2
  27. package/dist/bundle/{chunk-33NVQGUY.js → chunk-7WCZ2OZ5.js} +6 -6
  28. package/dist/bundle/{chunk-IDUNJCFO.js → chunk-7XU3TR7K.js} +2 -2
  29. package/dist/bundle/{chunk-7SH4JHYW.js → chunk-A4FTLORC.js} +12 -12
  30. package/dist/bundle/{chunk-CITFEQ6S.js → chunk-AACQA2CO.js} +1 -1
  31. package/dist/bundle/{chunk-PSNHPFSK.js → chunk-AAHIBA36.js} +1 -1
  32. package/dist/bundle/{chunk-PEOCBV2Z.js → chunk-BWBVBW5T.js} +8 -8
  33. package/dist/bundle/{chunk-A4UNTWAX.js → chunk-CVALO727.js} +99 -30
  34. package/dist/bundle/{chunk-G6QF5KWF.js → chunk-FHW4ENRF.js} +37 -43
  35. package/dist/bundle/{chunk-LONV6HIK.js → chunk-HAHARAJD.js} +455 -40
  36. package/dist/bundle/{chunk-2623YE5I.js → chunk-IBRXVPBI.js} +97 -99
  37. package/dist/bundle/{chunk-IWFBAWZK.js → chunk-IKODUUQG.js} +292 -19
  38. package/dist/bundle/{chunk-PQJYM5ES.js → chunk-IOMSC4ZG.js} +3 -3
  39. package/dist/bundle/{chunk-YKZ4IPLB.js → chunk-JKEAZBEZ.js} +7 -7
  40. package/dist/bundle/{chunk-FCJAHD4R.js → chunk-KIQIF5M7.js} +3 -3
  41. package/dist/bundle/{chunk-KYVXMEBC.js → chunk-KT5G3KVS.js} +3 -3
  42. package/dist/bundle/{chunk-W7IK7E4B.js → chunk-L3RV42O3.js} +20 -22
  43. package/dist/bundle/{chunk-NHBUTCNR.js → chunk-LQXLWHKM.js} +9 -9
  44. package/dist/bundle/{chunk-WBTVGFXI.js → chunk-MATUQFYL.js} +11 -11
  45. package/dist/bundle/{chunk-54O62JWP.js → chunk-MULPNGM2.js} +29 -10
  46. package/dist/bundle/{chunk-FJW3DDCF.js → chunk-N4OO3SPQ.js} +5 -5
  47. package/dist/bundle/{chunk-6DHQTUB2.js → chunk-NDWWGBSM.js} +1 -1
  48. package/dist/bundle/{chunk-DLAFGSTN.js → chunk-NHDSJMAR.js} +1 -1
  49. package/dist/bundle/{chunk-PQYVPCJ2.js → chunk-O6YYFVDD.js} +38 -37
  50. package/dist/bundle/{chunk-I7UH5CTA.js → chunk-OYGEBFFO.js} +12 -14
  51. package/dist/bundle/chunk-P7E7K467.js +110 -0
  52. package/dist/bundle/{chunk-ZNZUZGSV.js → chunk-PKNTBZXN.js} +176 -49
  53. package/dist/bundle/{chunk-YNFELLNQ.js → chunk-PU4GANCD.js} +3 -3
  54. package/dist/bundle/{chunk-5PLJKSG4.js → chunk-Q46JLJ5O.js} +7 -9
  55. package/dist/bundle/{chunk-R276546S.js → chunk-QKHFQHE7.js} +1 -1
  56. package/dist/bundle/{chunk-RNSP57TC.js → chunk-QUJCD5U7.js} +4 -4
  57. package/dist/bundle/{chunk-43QVYW3K.js → chunk-RIYXQFKU.js} +262 -88
  58. package/dist/bundle/{chunk-2AUXBJRX.js → chunk-RWEFKLXJ.js} +104 -29
  59. package/dist/bundle/{chunk-WQJBAWQP.js → chunk-SBOTSSYV.js} +879 -508
  60. package/dist/bundle/{chunk-PAXKALHV.js → chunk-U3BOQ63L.js} +118 -7
  61. package/dist/bundle/{chunk-VJZST5RD.js → chunk-UBJX5D2O.js} +2 -2
  62. package/dist/bundle/{chunk-HX7Y2ASG.js → chunk-VCGQMTHW.js} +26318 -15143
  63. package/dist/bundle/{chunk-7YMDL4JQ.js → chunk-VKYCMXEQ.js} +8 -5
  64. package/dist/bundle/{chunk-ZSXRDF6I.js → chunk-VX4RAT3A.js} +1 -1
  65. package/dist/bundle/{chunk-NYOPEHEU.js → chunk-W5SYBHRX.js} +8 -3
  66. package/dist/bundle/{chunk-XOLQSCMF.js → chunk-WGSTTWM5.js} +6 -6
  67. package/dist/bundle/{chunk-WLFUBNFX.js → chunk-WJRE45Z6.js} +4 -4
  68. package/dist/bundle/{chunk-IEXPOEEO.js → chunk-WQPTZHHR.js} +17 -26
  69. package/dist/bundle/{chunk-JEOYFKUK.js → chunk-WSX5UQNT.js} +2 -2
  70. package/dist/bundle/{chunk-LJAX6YCF.js → chunk-WYDYSQ7T.js} +2 -2
  71. package/dist/bundle/{chunk-C6Z25IBJ.js → chunk-XCUUYQN7.js} +4 -4
  72. package/dist/bundle/{chunk-GVCN3GLZ.js → chunk-YOHOQ6ZR.js} +4 -4
  73. package/dist/bundle/chunk-YZ5VMR2S.js +5305 -0
  74. package/dist/bundle/{chunk-ZDLIO76S.js → chunk-ZMMOVTUB.js} +2 -2
  75. package/dist/bundle/command-contract-VZ3ZJLEF.js +35 -0
  76. package/dist/bundle/{decode-EDN2ARXZ.js → decode-DN2DDFET.js} +4 -4
  77. package/dist/bundle/drive.js +11 -22
  78. package/dist/bundle/{echarts-GXY34GHA.js → echarts-VMHZ2UYP.js} +2 -2
  79. package/dist/bundle/{embed-3GSQIQXE.js → embed-MDN7R7BA.js} +5 -5
  80. package/dist/bundle/{embedder-6ULWRG3R.js → embedder-KEVEDNDJ.js} +8 -8
  81. package/dist/bundle/{entry-IPRJLFHO.js → entry-HTNK5TJQ.js} +6 -6
  82. package/dist/bundle/{first-run-FGHGWHC2.js → first-run-QNMCMP67.js} +9 -9
  83. package/dist/bundle/first-screen-RQBEHUQC.js +33 -0
  84. package/dist/bundle/{google-BD3ZNFVJ.js → google-QAKMV57Q.js} +9 -9
  85. package/dist/bundle/{chunk-GR5GGZKH.js → google-api-UJJS7ECO.js} +62 -6
  86. package/dist/bundle/grants-VMPKFEC2.js +98 -0
  87. package/dist/bundle/{identity-U7IHZEMR.js → identity-UODE3QAL.js} +4 -2
  88. package/dist/bundle/{instructions-K5BEQM4C.js → instructions-IWLHCDC7.js} +1 -1
  89. package/dist/bundle/{login-7HRYPZMM.js → login-GIZXEN7I.js} +60 -68
  90. package/dist/bundle/{mcp-WSGVVZWI.js → mcp-RUYPQVYS.js} +2 -2
  91. package/dist/bundle/{node-ZYWB7IET.js → node-25IJLDBZ.js} +2 -2
  92. package/dist/bundle/{node-sqlite-J3OODPYK.js → node-sqlite-DYR4FEI4.js} +4 -4
  93. package/dist/bundle/{oauth-L4VTCBLF.js → oauth-FLHXEDDY.js} +7 -7
  94. package/dist/bundle/{open-SGUN7ZVF.js → open-FWDZB7KX.js} +3 -3
  95. package/dist/bundle/{openai-RLVISEDH.js → openai-HB7UGKPW.js} +13 -13
  96. package/dist/bundle/{process-ZXO2MWRJ.js → process-P6TW37HQ.js} +1 -1
  97. package/dist/bundle/{program-YVLXSKZV.js → program-DVUNLXXS.js} +730 -919
  98. package/dist/bundle/{prompt-AUWTBLO7.js → prompt-MKWMYO3B.js} +4 -4
  99. package/dist/bundle/{reasons-J57GSRWN.js → reasons-25BEO2NE.js} +3 -3
  100. package/dist/bundle/{recognize-ORX2UBQW.js → recognize-VXGNPROM.js} +3 -3
  101. package/dist/bundle/{remote-AGIJY73X.js → remote-H5ZWLJHR.js} +6 -6
  102. package/dist/bundle/{rerank-R6PE44M5.js → rerank-5A3JDK7O.js} +6 -6
  103. package/dist/bundle/{chunk-G7DCVJ4F.js → serve-QNPNEZVR.js} +10 -7
  104. package/dist/bundle/{chunk-F7UUZATI.js → server-GWBVIRLY.js} +42 -15
  105. package/dist/bundle/server-QJU3HEGM.js +63 -0
  106. package/dist/bundle/{services-HZFTTZSF.js → services-PFXEWHJG.js} +30 -31
  107. package/dist/bundle/{sqlite-runtime-DTGPR2T2.js → sqlite-runtime-RGFISYXM.js} +4 -4
  108. package/dist/bundle/{state-WG3JKJM3.js → state-BUSX5BXF.js} +5 -5
  109. package/dist/bundle/{store-EV72MT5U.js → store-FIEE5HHG.js} +14 -16
  110. package/dist/bundle/{store-33VHIMEO.js → store-HFF5KQ44.js} +12 -14
  111. package/dist/bundle/store-maintenance-command-Z4SPEQUM.js +52 -0
  112. package/dist/bundle/{chunk-GNI7INK6.js → terminal-DHJ4D3BC.js} +2 -3
  113. package/dist/bundle/tokens-B6MUZRFM.js +96 -0
  114. package/dist/commands/context.d.ts +14 -13
  115. package/dist/commands/context.d.ts.map +1 -1
  116. package/dist/commands/context.js.map +1 -1
  117. package/dist/commands/documents.d.ts.map +1 -1
  118. package/dist/commands/documents.js +1 -4
  119. package/dist/commands/documents.js.map +1 -1
  120. package/dist/commands/mirrors.d.ts.map +1 -1
  121. package/dist/commands/mirrors.js +1 -2
  122. package/dist/commands/mirrors.js.map +1 -1
  123. package/dist/commands/upgrade.d.ts +1 -1
  124. package/dist/commands/upgrade.d.ts.map +1 -1
  125. package/dist/commands/upgrade.js +4 -9
  126. package/dist/commands/upgrade.js.map +1 -1
  127. package/dist/config.d.ts +182 -0
  128. package/dist/config.d.ts.map +1 -1
  129. package/dist/config.js +38 -3
  130. package/dist/config.js.map +1 -1
  131. package/dist/contract-overrides.d.ts +0 -3
  132. package/dist/contract-overrides.d.ts.map +1 -1
  133. package/dist/contract-overrides.js +0 -234
  134. package/dist/contract-overrides.js.map +1 -1
  135. package/dist/first-screen.d.ts +3 -2
  136. package/dist/first-screen.d.ts.map +1 -1
  137. package/dist/first-screen.js +17 -22
  138. package/dist/first-screen.js.map +1 -1
  139. package/dist/grants.d.ts +9 -0
  140. package/dist/grants.d.ts.map +1 -0
  141. package/dist/grants.js +30 -0
  142. package/dist/grants.js.map +1 -0
  143. package/dist/identity.d.ts.map +1 -1
  144. package/dist/identity.js +2 -0
  145. package/dist/identity.js.map +1 -1
  146. package/dist/login.d.ts.map +1 -1
  147. package/dist/login.js +2 -4
  148. package/dist/login.js.map +1 -1
  149. package/dist/policy-keys.d.ts +12 -0
  150. package/dist/policy-keys.d.ts.map +1 -0
  151. package/dist/policy-keys.js +107 -0
  152. package/dist/policy-keys.js.map +1 -0
  153. package/dist/policy.d.ts +1 -8
  154. package/dist/policy.d.ts.map +1 -1
  155. package/dist/policy.js +2 -105
  156. package/dist/policy.js.map +1 -1
  157. package/dist/program.d.ts +8 -4
  158. package/dist/program.d.ts.map +1 -1
  159. package/dist/program.js +251 -222
  160. package/dist/program.js.map +1 -1
  161. package/dist/testing/mcp.d.ts +28 -0
  162. package/dist/testing/mcp.d.ts.map +1 -0
  163. package/dist/testing/mcp.js +56 -0
  164. package/dist/testing/mcp.js.map +1 -0
  165. package/dist/tokens.d.ts.map +1 -1
  166. package/dist/tokens.js +0 -9
  167. package/dist/tokens.js.map +1 -1
  168. package/dist/version.d.ts +1 -1
  169. package/dist/version.js +1 -1
  170. package/package.json +6 -5
  171. package/scenarios/agent-access.md +4 -2
  172. package/dist/bundle/all-profiles-CYW6XBBS.js +0 -26
  173. package/dist/bundle/chunk-234MHU76.js +0 -384
  174. package/dist/bundle/chunk-BBYD2FA3.js +0 -9
  175. package/dist/bundle/chunk-DO4PDQY5.js +0 -48
  176. package/dist/bundle/chunk-FDWYPONW.js +0 -1988
  177. package/dist/bundle/chunk-FQRJWVEB.js +0 -2
  178. package/dist/bundle/chunk-GJN5B5JK.js +0 -522
  179. package/dist/bundle/chunk-NPSZPUK6.js +0 -193
  180. package/dist/bundle/chunk-PDGECM5D.js +0 -138
  181. package/dist/bundle/chunk-Q765VPZY.js +0 -421
  182. package/dist/bundle/chunk-QYUHS6DE.js +0 -1714
  183. package/dist/bundle/chunk-WQRGA75U.js +0 -256
  184. package/dist/bundle/chunk-YVPHJHIL.js +0 -15572
  185. package/dist/bundle/chunk-Z47LOJUS.js +0 -484
  186. package/dist/bundle/command-contract-I2YB5IXI.js +0 -38
  187. package/dist/bundle/failure-IXS2ZHA5.js +0 -37
  188. package/dist/bundle/first-screen-M62KTPZG.js +0 -36
  189. package/dist/bundle/google-api-BDUWZMRV.js +0 -83
  190. package/dist/bundle/mcp-F67RATLF.js +0 -502
  191. package/dist/bundle/mcp-JZSYPQA4.js +0 -96
  192. package/dist/bundle/serve-VOBAQHAQ.js +0 -20
  193. package/dist/bundle/server-24PS4M7U.js +0 -70
  194. package/dist/bundle/server-G6HFZ2CK.js +0 -57
  195. package/dist/bundle/store-maintenance-command-ZTUEI4EC.js +0 -58
  196. package/dist/bundle/terminal-TFCTWLOS.js +0 -11
  197. package/dist/bundle/tokens-XMOGQFI6.js +0 -102
  198. package/dist/commands/doctor.d.ts +0 -56
  199. package/dist/commands/doctor.d.ts.map +0 -1
  200. package/dist/commands/doctor.js +0 -75
  201. package/dist/commands/doctor.js.map +0 -1
  202. package/dist/commands/mcp.d.ts +0 -6
  203. package/dist/commands/mcp.d.ts.map +0 -1
  204. package/dist/commands/mcp.js +0 -156
  205. package/dist/commands/mcp.js.map +0 -1
  206. package/dist/commands/skill.d.ts +0 -6
  207. package/dist/commands/skill.d.ts.map +0 -1
  208. package/dist/commands/skill.js +0 -34
  209. package/dist/commands/skill.js.map +0 -1
  210. package/dist/failure.d.ts +0 -88
  211. package/dist/failure.d.ts.map +0 -1
  212. package/dist/failure.js +0 -60
  213. package/dist/failure.js.map +0 -1
  214. package/dist/mcp.d.ts +0 -175
  215. package/dist/mcp.d.ts.map +0 -1
  216. package/dist/mcp.js +0 -412
  217. package/dist/mcp.js.map +0 -1
  218. /package/dist/bundle/{chunk-62EDJKGP.js → chunk-HEA3XVAJ.js} +0 -0
@@ -14,7 +14,7 @@ import {
14
14
  safeParse,
15
15
  stepOf,
16
16
  writes
17
- } from "./chunk-YKZ4IPLB.js";
17
+ } from "./chunk-JKEAZBEZ.js";
18
18
  import {
19
19
  __commonJS,
20
20
  __name,
@@ -1887,7 +1887,27 @@ var require_cli_table3 = __commonJS({
1887
1887
  }
1888
1888
  });
1889
1889
 
1890
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/sanitize.js
1890
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/exit-codes.js
1891
+ var EXIT_CODES = {
1892
+ validation_error: 2,
1893
+ configuration_error: 3,
1894
+ authentication_error: 4,
1895
+ permission_error: 5,
1896
+ not_found: 6,
1897
+ confirmation_required: 7,
1898
+ rate_limited: 8,
1899
+ timeout: 9,
1900
+ network_error: 10,
1901
+ provider_error: 11,
1902
+ provider_unavailable: 12,
1903
+ invalid_response: 13,
1904
+ outcome_unknown: 14,
1905
+ cancelled: 130
1906
+ };
1907
+ var exitCodeFor = /* @__PURE__ */ __name((code) => EXIT_CODES[code], "exitCodeFor");
1908
+ var GENERIC_FAILURE = 1;
1909
+
1910
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/sanitize.js
1891
1911
  var CONTROL = (
1892
1912
  // biome-ignore lint/suspicious/noControlCharactersInRegex: matching them is the whole point
1893
1913
  /[\u0000-\u0008\u000B-\u001F\u007F-\u009F\u200B\u200E\u200F\u202A-\u202E\u2066-\u2069\uFEFF\u{E0000}-\u{E007F}]/gu
@@ -1911,27 +1931,7 @@ var visibleControls = /* @__PURE__ */ __name((text) => {
1911
1931
  }, "visibleControls");
1912
1932
  var singleLine = /* @__PURE__ */ __name((text) => visibleControls(text).replace(LINE_BREAKS, escaped), "singleLine");
1913
1933
 
1914
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/exit-codes.js
1915
- var EXIT_CODES = {
1916
- validation_error: 2,
1917
- configuration_error: 3,
1918
- authentication_error: 4,
1919
- permission_error: 5,
1920
- not_found: 6,
1921
- confirmation_required: 7,
1922
- rate_limited: 8,
1923
- timeout: 9,
1924
- network_error: 10,
1925
- provider_error: 11,
1926
- provider_unavailable: 12,
1927
- invalid_response: 13,
1928
- outcome_unknown: 14,
1929
- cancelled: 130
1930
- };
1931
- var exitCodeFor = /* @__PURE__ */ __name((code) => EXIT_CODES[code], "exitCodeFor");
1932
- var GENERIC_FAILURE = 1;
1933
-
1934
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/failure.js
1934
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/failure.js
1935
1935
  var recognise = /* @__PURE__ */ __name((failure) => {
1936
1936
  if (isCliError(failure))
1937
1937
  return failure;
@@ -2078,72 +2078,7 @@ var catchCrashes = /* @__PURE__ */ __name((options) => {
2078
2078
  };
2079
2079
  }, "catchCrashes");
2080
2080
 
2081
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/result-fields.js
2082
- var forbidden = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
2083
- var validate = /* @__PURE__ */ __name((paths) => {
2084
- if (paths.length === 0 || paths.length > 128 || paths.some((path) => path.length > 256 || !/^[A-Za-z][A-Za-z0-9_]*(?:\.[A-Za-z][A-Za-z0-9_]*)*$/.test(path) || path.split(".").some((part) => forbidden.has(part))))
2085
- throw new CliError("validation_error", "field selection takes comma-separated field paths, for example id,source.title");
2086
- }, "validate");
2087
- var fieldsOf = /* @__PURE__ */ __name((value) => {
2088
- const paths = value.split(",").map((one) => one.trim());
2089
- validate(paths);
2090
- return [...new Set(paths)];
2091
- }, "fieldsOf");
2092
- var object = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "object");
2093
- var retained = /* @__PURE__ */ new Set(["operation_id", "page", "next", "missing", "meta", "coverage"]);
2094
- var itemPaths = /* @__PURE__ */ __name((paths) => paths.map((path) => path.startsWith("items.") ? path.slice(6) : path), "itemPaths");
2095
- var onePaths = /* @__PURE__ */ __name((paths) => paths.map((path) => path.startsWith("item.") ? path.slice(5) : path), "onePaths");
2096
- var select = /* @__PURE__ */ __name((value, paths) => {
2097
- if (Array.isArray(value))
2098
- return value.map((item) => select(item, paths));
2099
- if (!object(value))
2100
- return value;
2101
- const result = {};
2102
- const groups = /* @__PURE__ */ new Map();
2103
- for (const path of paths) {
2104
- const [key, ...rest] = path.split(".");
2105
- if (!key)
2106
- continue;
2107
- const children = groups.get(key) ?? [];
2108
- children.push(rest.join("."));
2109
- groups.set(key, children);
2110
- }
2111
- for (const [key, children] of groups) {
2112
- if (!Object.hasOwn(value, key) || value[key] === void 0)
2113
- continue;
2114
- const found = value[key];
2115
- if (children.includes(""))
2116
- result[key] = found;
2117
- else if (object(found) || Array.isArray(found)) {
2118
- const selected = select(found, children);
2119
- if (Array.isArray(selected) || object(selected) && Object.keys(selected).length > 0)
2120
- result[key] = selected;
2121
- }
2122
- }
2123
- for (const key of retained)
2124
- if (Object.hasOwn(value, key))
2125
- result[key] = value[key];
2126
- return result;
2127
- }, "select");
2128
- var project = /* @__PURE__ */ __name((value, fields) => {
2129
- if (Array.isArray(value))
2130
- return value.map((item) => select(item, itemPaths(fields)));
2131
- if (object(value) && Object.hasOwn(value, "type") && value.type === "item" && Object.hasOwn(value, "data") && Object.keys(value).every((key) => ["type", "data"].includes(key)))
2132
- return { ...value, data: project(value.data, fields) };
2133
- if (object(value) && Object.hasOwn(value, "type") && value.type === "end" && Object.hasOwn(value, "complete") && typeof value.complete === "boolean")
2134
- return value;
2135
- if (object(value) && Object.hasOwn(value, "item") && (Object.hasOwn(value, "meta") || Object.keys(value).every((key) => ["item", "next", "missing"].includes(key))))
2136
- return { ...value, item: project(value.item, onePaths(fields)) };
2137
- if (object(value) && Array.isArray(value.items))
2138
- return { ...value, items: value.items.map((item) => select(item, itemPaths(fields))) };
2139
- return select(value, object(value) && !Object.hasOwn(value, "items") ? itemPaths(fields) : fields);
2140
- }, "project");
2141
- var projectFields = /* @__PURE__ */ __name((value, fields) => {
2142
- validate(fields);
2143
- return project(value, fields);
2144
- }, "projectFields");
2145
-
2146
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/keyring.js
2081
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/keyring.js
2147
2082
  import { createRequire } from "node:module";
2148
2083
  var ENTRY_OPTIONS = { linux: { store: "secret-service" } };
2149
2084
  var require2 = createRequire(new URL("keyring.js", import.meta.resolve("@wirecat/cli-base")).href);
@@ -2163,7 +2098,7 @@ var systemKeyring = {
2163
2098
  delete: /* @__PURE__ */ __name((service, account) => entry(service, account).deletePassword(), "delete")
2164
2099
  };
2165
2100
 
2166
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/paths.js
2101
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/paths.js
2167
2102
  import { homedir, userInfo } from "node:os";
2168
2103
  import { join, posix, win32 } from "node:path";
2169
2104
  var PATH_KINDS = ["config", "state", "cache"];
@@ -2215,11 +2150,11 @@ var homeIsMoved = /* @__PURE__ */ __name(({ env = process.env, platform = proces
2215
2150
  var isMovedRun = /* @__PURE__ */ __name((options) => pathsAreOverridden(options) || homeIsMoved(options), "isMovedRun");
2216
2151
  var configFilePath = /* @__PURE__ */ __name((configDir, fileName = "config.json") => join(configDir, fileName), "configFilePath");
2217
2152
 
2218
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/credentials.js
2153
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/credentials.js
2219
2154
  import { readFileSync as readFileSync2 } from "node:fs";
2220
2155
  import { join as join3, resolve } from "node:path";
2221
2156
 
2222
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/config.js
2157
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/config.js
2223
2158
  import { randomBytes } from "node:crypto";
2224
2159
  import { mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
2225
2160
  import { dirname, join as join2 } from "node:path";
@@ -2263,9 +2198,10 @@ var saveConfigFile = /* @__PURE__ */ __name((path, config) => {
2263
2198
  `, 384);
2264
2199
  }, "saveConfigFile");
2265
2200
 
2266
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/credentials.js
2201
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/credentials.js
2267
2202
  var keyringService = /* @__PURE__ */ __name((service, _configDir, _isolated) => service, "keyringService");
2268
2203
  var movedRunService = /* @__PURE__ */ __name((service, configDir) => `${service}:${resolve(configDir)}`, "movedRunService");
2204
+ var warnedRuns = /* @__PURE__ */ new WeakSet();
2269
2205
  var Credentials = class {
2270
2206
  static {
2271
2207
  __name(this, "Credentials");
@@ -2280,7 +2216,6 @@ var Credentials = class {
2280
2216
  #warn;
2281
2217
  /** Set only for a moved run with the system keyring. */
2282
2218
  #temporaryService;
2283
- #warned = false;
2284
2219
  constructor(options) {
2285
2220
  this.#configDir = options.configDir;
2286
2221
  this.#storage = options.storage ?? "auto";
@@ -2298,23 +2233,29 @@ var Credentials = class {
2298
2233
  const fromEnv = this.#envVar ? this.#env[this.#envVar]?.trim() : void 0;
2299
2234
  if (fromEnv)
2300
2235
  return { secret: fromEnv, source: "environment" };
2236
+ const fromFile = this.#storage === "keyring" ? void 0 : this.#readFile()?.[account]?.secret;
2237
+ if (fromFile)
2238
+ return { secret: fromFile, source: "file" };
2301
2239
  if (this.#storage !== "file") {
2302
2240
  const temporary = this.#temporaryService;
2303
2241
  const fromKeyring = this.#tryKeyring(() => temporary && this.#keyring.get(temporary, account) || this.#keyring.get(this.#service, account));
2304
2242
  if (fromKeyring)
2305
2243
  return { secret: fromKeyring, source: "keyring" };
2306
2244
  }
2307
- const secret = this.#readFile()?.[account]?.secret;
2308
- return secret ? { secret, source: "file" } : void 0;
2245
+ return void 0;
2309
2246
  }
2310
- write(account, secret) {
2311
- if (this.#storage !== "file") {
2247
+ write(account, secret, options = {}) {
2248
+ const inFile = this.#storage === "auto" && this.#readFile()?.[account] !== void 0;
2249
+ if (this.#storage === "keyring" || this.#storage === "auto" && (options.signIn || !inFile)) {
2312
2250
  const stored = this.#tryKeyring(() => {
2313
2251
  this.#keyring.set(this.#temporaryService ?? this.#service, account, secret);
2314
2252
  return true;
2315
2253
  });
2316
- if (stored)
2254
+ if (stored) {
2255
+ if (inFile)
2256
+ this.#removeFromFile(account);
2317
2257
  return "keyring";
2258
+ }
2318
2259
  }
2319
2260
  const store = this.#readFile();
2320
2261
  if (!store) {
@@ -2334,14 +2275,18 @@ var Credentials = class {
2334
2275
  this.#warn(removed.includes("keyring") ? `removed this run's own sign-in of ${account} from the OS keyring and kept the owner's: a run with moved folders never removes it` : `kept ${account} in the OS keyring: it is the owner's sign-in, shared with every run, and a run with moved folders never removes it`);
2335
2276
  }
2336
2277
  }
2337
- const store = this.#readFile();
2338
- if (store?.[account] !== void 0) {
2339
- delete store[account];
2340
- this.#writeFile(store);
2278
+ if (this.#storage !== "keyring" && this.#removeFromFile(account))
2341
2279
  removed.push("file");
2342
- }
2343
2280
  return removed;
2344
2281
  }
2282
+ #removeFromFile(account) {
2283
+ const store = this.#readFile();
2284
+ if (store?.[account] === void 0)
2285
+ return false;
2286
+ delete store[account];
2287
+ this.#writeFile(store);
2288
+ return true;
2289
+ }
2345
2290
  /** Only for the warning: a keyring that fails here must not fail a removal that already happened. */
2346
2291
  #ownersEntryExists(account) {
2347
2292
  try {
@@ -2380,8 +2325,8 @@ var Credentials = class {
2380
2325
  try {
2381
2326
  return operation();
2382
2327
  } catch (error) {
2383
- if (!this.#warned) {
2384
- this.#warned = true;
2328
+ if (!warnedRuns.has(this.#env)) {
2329
+ warnedRuns.add(this.#env);
2385
2330
  this.#warn(`could not reach the OS keyring \u2014 it may be locked, or no keyring service is running (${error instanceof Error ? error.message : String(error)}); using ${this.#path()} instead, readable only by you`);
2386
2331
  }
2387
2332
  return void 0;
@@ -2389,166 +2334,7 @@ var Credentials = class {
2389
2334
  }
2390
2335
  };
2391
2336
 
2392
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/time.js
2393
- var abortError = /* @__PURE__ */ __name(() => new DOMException("The operation was aborted.", "AbortError"), "abortError");
2394
- var realSleep = /* @__PURE__ */ __name((ms, signal) => new Promise((resolve2, reject) => {
2395
- if (signal?.aborted) {
2396
- reject(abortError());
2397
- return;
2398
- }
2399
- const timer = setTimeout(resolve2, ms);
2400
- signal?.addEventListener("abort", () => {
2401
- clearTimeout(timer);
2402
- reject(abortError());
2403
- }, { once: true });
2404
- }), "realSleep");
2405
-
2406
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/deadline.js
2407
- var createDeadline = /* @__PURE__ */ __name(({ timeoutMs, signal, sleep = realSleep } = {}) => {
2408
- if (timeoutMs !== void 0 && (!Number.isSafeInteger(timeoutMs) || timeoutMs < 0 || timeoutMs > 2147483647))
2409
- throw new CliError("validation_error", "timeoutMs must be an integer from zero through 2147483647");
2410
- const controller = new AbortController();
2411
- const timer = new AbortController();
2412
- let disposed = false;
2413
- const abort = /* @__PURE__ */ __name((reason) => {
2414
- if (controller.signal.aborted)
2415
- return;
2416
- controller.abort(reason);
2417
- timer.abort();
2418
- signal?.removeEventListener("abort", onAbort);
2419
- }, "abort");
2420
- const onAbort = /* @__PURE__ */ __name(() => abort(isCliError(signal?.reason) ? signal.reason : new CliError("cancelled", "command cancelled")), "onAbort");
2421
- if (signal?.aborted)
2422
- onAbort();
2423
- else
2424
- signal?.addEventListener("abort", onAbort, { once: true });
2425
- const expire = /* @__PURE__ */ __name(() => abort(new CliError("timeout", "the command did not finish before its deadline", {
2426
- reason: "command.timed-out",
2427
- timeout_ms: timeoutMs,
2428
- retryable: false
2429
- })), "expire");
2430
- if (timeoutMs === 0)
2431
- expire();
2432
- if (timeoutMs !== void 0 && timeoutMs > 0 && !controller.signal.aborted) {
2433
- let waiting;
2434
- try {
2435
- waiting = sleep(timeoutMs, timer.signal, "timeout");
2436
- } catch {
2437
- waiting = Promise.reject(new Error("deadline timer failed"));
2438
- }
2439
- void waiting.then(() => {
2440
- if (!disposed && !timer.signal.aborted)
2441
- expire();
2442
- }, () => {
2443
- if (!disposed && !timer.signal.aborted)
2444
- abort(new CliError("configuration_error", "command deadline timer failed"));
2445
- });
2446
- }
2447
- return {
2448
- signal: controller.signal,
2449
- async race(body) {
2450
- if (disposed)
2451
- throw new CliError("validation_error", "deadline is already disposed");
2452
- if (controller.signal.aborted)
2453
- throw controller.signal.reason;
2454
- let interrupt = /* @__PURE__ */ __name(() => {
2455
- }, "interrupt");
2456
- const interrupted = new Promise((_, reject) => {
2457
- interrupt = /* @__PURE__ */ __name(() => reject(controller.signal.reason), "interrupt");
2458
- controller.signal.addEventListener("abort", interrupt, { once: true });
2459
- });
2460
- const running = Promise.resolve().then(() => {
2461
- if (controller.signal.aborted)
2462
- throw controller.signal.reason;
2463
- return body(controller.signal);
2464
- });
2465
- try {
2466
- return await Promise.race([running, interrupted]);
2467
- } catch (error) {
2468
- if (controller.signal.aborted) {
2469
- let settled;
2470
- await running.catch((reason) => {
2471
- settled = reason;
2472
- });
2473
- if (isCliError(settled) && settled.code === "outcome_unknown")
2474
- throw settled;
2475
- throw controller.signal.reason;
2476
- }
2477
- throw error;
2478
- } finally {
2479
- controller.signal.removeEventListener("abort", interrupt);
2480
- }
2481
- },
2482
- dispose() {
2483
- disposed = true;
2484
- timer.abort();
2485
- signal?.removeEventListener("abort", onAbort);
2486
- }
2487
- };
2488
- }, "createDeadline");
2489
-
2490
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/output-buffer.js
2491
- var createOutputBuffer = /* @__PURE__ */ __name(({ maxOutputBytes = 4 * 1024 * 1024, fields, format } = {}) => {
2492
- if (!Number.isSafeInteger(maxOutputBytes) || maxOutputBytes < 0)
2493
- throw new CliError("validation_error", "maxOutputBytes must be a nonnegative whole byte count");
2494
- const paths = fields === void 0 ? void 0 : fieldsOf(fields);
2495
- if (paths && format !== "json" && format !== "jsonl")
2496
- throw new CliError("validation_error", "field projection requires an explicit JSON or JSONL format");
2497
- let chunks = [];
2498
- let bytes = 0;
2499
- let finished = false;
2500
- const requireActive = /* @__PURE__ */ __name(() => {
2501
- if (finished)
2502
- throw new CliError("validation_error", "output buffer is already finished");
2503
- }, "requireActive");
2504
- return {
2505
- get bytes() {
2506
- return bytes;
2507
- },
2508
- data(text) {
2509
- requireActive();
2510
- let result = text;
2511
- if (paths) {
2512
- const project2 = /* @__PURE__ */ __name((value) => JSON.stringify(projectFields(JSON.parse(value), paths)), "project");
2513
- try {
2514
- result = format === "jsonl" ? text.split("\n").map((line) => line.trim() ? project2(line) : line).join("\n") : project2(text) + (text.endsWith("\n") ? "\n" : "");
2515
- } catch (error) {
2516
- if (isCliError(error))
2517
- throw error;
2518
- throw new CliError("invalid_response", "field projection requires complete JSON values or JSONL lines", {
2519
- reason: "output.fields-unavailable",
2520
- retryable: false
2521
- });
2522
- }
2523
- }
2524
- const size = Buffer.byteLength(result);
2525
- if (!Number.isSafeInteger(bytes + size) || maxOutputBytes !== 0 && bytes + size > maxOutputBytes)
2526
- throw new CliError("invalid_response", "output exceeds the configured byte limit", {
2527
- reason: "output.too-large",
2528
- max_bytes: maxOutputBytes,
2529
- buffered_bytes: bytes,
2530
- retryable: false,
2531
- partial_output: false
2532
- });
2533
- bytes += size;
2534
- chunks.push(result);
2535
- },
2536
- flush(write) {
2537
- requireActive();
2538
- finished = true;
2539
- const output = chunks;
2540
- chunks = [];
2541
- for (const text of output)
2542
- write(text);
2543
- },
2544
- discard() {
2545
- finished = true;
2546
- chunks = [];
2547
- }
2548
- };
2549
- }, "createOutputBuffer");
2550
-
2551
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/drain.js
2337
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/drain.js
2552
2338
  var waitForDrain = /* @__PURE__ */ __name((stream, signal) => {
2553
2339
  if (signal?.aborted)
2554
2340
  return Promise.reject(signal.reason);
@@ -2576,7 +2362,7 @@ var waitForDrain = /* @__PURE__ */ __name((stream, signal) => {
2576
2362
  });
2577
2363
  }, "waitForDrain");
2578
2364
 
2579
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/streams.js
2365
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/streams.js
2580
2366
  var processStreams = {
2581
2367
  drain: /* @__PURE__ */ __name(async (signal) => {
2582
2368
  await Promise.all([waitForDrain(process.stdout, signal), waitForDrain(process.stderr, signal)]);
@@ -2605,118 +2391,7 @@ var captureStreams = /* @__PURE__ */ __name(() => {
2605
2391
  };
2606
2392
  }, "captureStreams");
2607
2393
 
2608
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/pretty.js
2609
- var import_cli_table3 = __toESM(require_cli_table3(), 1);
2610
- import { styleText } from "node:util";
2611
- var renderPretty = /* @__PURE__ */ __name((value, options) => {
2612
- const paint2 = palette(options.color);
2613
- if (Array.isArray(value)) {
2614
- if (value.length === 0)
2615
- return paint2.dim("(nothing)");
2616
- return isRowLike(value) ? renderTable(value, paint2) : renderJson(value);
2617
- }
2618
- if (isPlainObject(value)) {
2619
- const listKey = Object.keys(value).find((key) => Array.isArray(value[key]) && isRowLike(value[key]));
2620
- if (listKey) {
2621
- const rest = Object.fromEntries(Object.entries(value).filter(([key]) => key !== listKey));
2622
- const table = renderTable(value[listKey], paint2);
2623
- return Object.keys(rest).length > 0 ? `${table}
2624
-
2625
- ${renderFields(rest, paint2)}` : table;
2626
- }
2627
- return renderFields(value, paint2);
2628
- }
2629
- return renderJson(value);
2630
- }, "renderPretty");
2631
- var paint = /* @__PURE__ */ __name((format, color) => (text) => color ? styleText(format, text, { validateStream: false }) : text, "paint");
2632
- var palette = /* @__PURE__ */ __name((color) => ({
2633
- dim: paint("dim", color),
2634
- bold: paint("bold", color),
2635
- label: paint("cyan", color)
2636
- }), "palette");
2637
- var isPlainObject = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isPlainObject");
2638
- var isRowLike = /* @__PURE__ */ __name((value) => value.length > 0 && value.every((item) => isPlainObject(item)) && value.length <= 500, "isRowLike");
2639
- var renderTable = /* @__PURE__ */ __name((rows, paint2) => {
2640
- const columns = [...new Set(rows.flatMap((row) => Object.keys(row)))];
2641
- const table = new import_cli_table3.default({
2642
- head: columns.map((column) => paint2.bold(visibleControls(column))),
2643
- // `chars: {}` is not enough — cli-table3 falls back to its own defaults for anything unset.
2644
- style: { head: [], border: [], "padding-left": 0, "padding-right": 2 },
2645
- chars: BORDERLESS
2646
- });
2647
- for (const row of rows)
2648
- table.push(columns.map((column) => cell(row[column])));
2649
- return table.toString();
2650
- }, "renderTable");
2651
- var renderFields = /* @__PURE__ */ __name((fields, paint2) => {
2652
- const rows = Object.entries(fields).map(([key, value]) => ({ label: visibleControls(key), value }));
2653
- const width = Math.max(...rows.map((row) => row.label.length));
2654
- return rows.map((row) => `${paint2.label(row.label.padEnd(width))} ${cell(row.value)}`).join("\n");
2655
- }, "renderFields");
2656
- var cell = /* @__PURE__ */ __name((value) => {
2657
- if (value === null || value === void 0)
2658
- return "";
2659
- if (typeof value === "object")
2660
- return visibleControls(JSON.stringify(value));
2661
- return visibleControls(String(value));
2662
- }, "cell");
2663
- var renderJson = /* @__PURE__ */ __name((value) => JSON.stringify(value, null, 2), "renderJson");
2664
- var BORDERLESS = {
2665
- top: "",
2666
- "top-mid": "",
2667
- "top-left": "",
2668
- "top-right": "",
2669
- bottom: "",
2670
- "bottom-mid": "",
2671
- "bottom-left": "",
2672
- "bottom-right": "",
2673
- left: "",
2674
- "left-mid": "",
2675
- mid: "",
2676
- "mid-mid": "",
2677
- right: "",
2678
- "right-mid": "",
2679
- middle: ""
2680
- };
2681
-
2682
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/renderer.js
2683
- var createRenderer = /* @__PURE__ */ __name(({ format, color, streams = processStreams, quiet = false }) => {
2684
- const mark = /* @__PURE__ */ __name((symbol, message) => format === "pretty" ? `${symbol} ${visibleControls(message)}` : visibleControls(message), "mark");
2685
- const say = /* @__PURE__ */ __name((symbol) => (message) => {
2686
- if (!quiet)
2687
- streams.diagnostic(mark(symbol, message));
2688
- }, "say");
2689
- const diagnostics = {
2690
- note: say("\xB7"),
2691
- success: say("\u2713"),
2692
- warn: say("!"),
2693
- failure: /* @__PURE__ */ __name((message) => streams.diagnostic(mark("\u2717", message)), "failure")
2694
- };
2695
- if (format === "jsonl") {
2696
- return {
2697
- ...diagnostics,
2698
- result: /* @__PURE__ */ __name((value) => streams.data(JSON.stringify(value)), "result"),
2699
- stream: /* @__PURE__ */ __name((items) => {
2700
- for (const item of items)
2701
- streams.data(JSON.stringify(item));
2702
- }, "stream")
2703
- };
2704
- }
2705
- if (format === "pretty") {
2706
- return {
2707
- ...diagnostics,
2708
- result: /* @__PURE__ */ __name((value) => streams.data(renderPretty(value, { color })), "result"),
2709
- stream: /* @__PURE__ */ __name((items) => streams.data(renderPretty([...items], { color })), "stream")
2710
- };
2711
- }
2712
- return {
2713
- ...diagnostics,
2714
- result: /* @__PURE__ */ __name((value) => streams.data(JSON.stringify(value)), "result"),
2715
- stream: /* @__PURE__ */ __name((items) => streams.data(JSON.stringify([...items])), "stream")
2716
- };
2717
- }, "createRenderer");
2718
-
2719
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/retry.js
2394
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/retry.js
2720
2395
  var DEFAULT_RETRY = {
2721
2396
  retries: 1,
2722
2397
  baseDelayMs: 250,
@@ -2728,7 +2403,72 @@ var backoffMs = /* @__PURE__ */ __name((attempt, config, random) => {
2728
2403
  return Math.round(random() * ceiling);
2729
2404
  }, "backoffMs");
2730
2405
 
2731
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/batch.js
2406
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/result-fields.js
2407
+ var forbidden = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
2408
+ var validate = /* @__PURE__ */ __name((paths) => {
2409
+ if (paths.length === 0 || paths.length > 128 || paths.some((path) => path.length > 256 || !/^[A-Za-z][A-Za-z0-9_]*(?:\.[A-Za-z][A-Za-z0-9_]*)*$/.test(path) || path.split(".").some((part) => forbidden.has(part))))
2410
+ throw new CliError("validation_error", "field selection takes comma-separated field paths, for example id,source.title");
2411
+ }, "validate");
2412
+ var fieldsOf = /* @__PURE__ */ __name((value) => {
2413
+ const paths = value.split(",").map((one) => one.trim());
2414
+ validate(paths);
2415
+ return [...new Set(paths)];
2416
+ }, "fieldsOf");
2417
+ var object = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "object");
2418
+ var retained = /* @__PURE__ */ new Set(["operation_id", "page", "next", "missing", "meta", "coverage"]);
2419
+ var itemPaths = /* @__PURE__ */ __name((paths) => paths.map((path) => path.startsWith("items.") ? path.slice(6) : path), "itemPaths");
2420
+ var onePaths = /* @__PURE__ */ __name((paths) => paths.map((path) => path.startsWith("item.") ? path.slice(5) : path), "onePaths");
2421
+ var select = /* @__PURE__ */ __name((value, paths) => {
2422
+ if (Array.isArray(value))
2423
+ return value.map((item) => select(item, paths));
2424
+ if (!object(value))
2425
+ return value;
2426
+ const result = {};
2427
+ const groups = /* @__PURE__ */ new Map();
2428
+ for (const path of paths) {
2429
+ const [key, ...rest] = path.split(".");
2430
+ if (!key)
2431
+ continue;
2432
+ const children = groups.get(key) ?? [];
2433
+ children.push(rest.join("."));
2434
+ groups.set(key, children);
2435
+ }
2436
+ for (const [key, children] of groups) {
2437
+ if (!Object.hasOwn(value, key) || value[key] === void 0)
2438
+ continue;
2439
+ const found = value[key];
2440
+ if (children.includes(""))
2441
+ result[key] = found;
2442
+ else if (object(found) || Array.isArray(found)) {
2443
+ const selected = select(found, children);
2444
+ if (Array.isArray(selected) || object(selected) && Object.keys(selected).length > 0)
2445
+ result[key] = selected;
2446
+ }
2447
+ }
2448
+ for (const key of retained)
2449
+ if (Object.hasOwn(value, key))
2450
+ result[key] = value[key];
2451
+ return result;
2452
+ }, "select");
2453
+ var project = /* @__PURE__ */ __name((value, fields) => {
2454
+ if (Array.isArray(value))
2455
+ return value.map((item) => select(item, itemPaths(fields)));
2456
+ if (object(value) && Object.hasOwn(value, "type") && value.type === "item" && Object.hasOwn(value, "data") && Object.keys(value).every((key) => ["type", "data"].includes(key)))
2457
+ return { ...value, data: project(value.data, fields) };
2458
+ if (object(value) && Object.hasOwn(value, "type") && value.type === "end" && Object.hasOwn(value, "complete") && typeof value.complete === "boolean")
2459
+ return value;
2460
+ if (object(value) && Object.hasOwn(value, "item") && (Object.hasOwn(value, "meta") || Object.keys(value).every((key) => ["item", "next", "missing"].includes(key))))
2461
+ return { ...value, item: project(value.item, onePaths(fields)) };
2462
+ if (object(value) && Array.isArray(value.items))
2463
+ return { ...value, items: value.items.map((item) => select(item, itemPaths(fields))) };
2464
+ return select(value, object(value) && !Object.hasOwn(value, "items") ? itemPaths(fields) : fields);
2465
+ }, "project");
2466
+ var projectFields = /* @__PURE__ */ __name((value, fields) => {
2467
+ validate(fields);
2468
+ return project(value, fields);
2469
+ }, "projectFields");
2470
+
2471
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/batch.js
2732
2472
  var BATCH_LIMITS = Object.freeze({
2733
2473
  requests: 32,
2734
2474
  input_bytes: 262144,
@@ -2855,7 +2595,21 @@ var runBatch = /* @__PURE__ */ __name(async (requests, options = {}) => {
2855
2595
  };
2856
2596
  }, "runBatch");
2857
2597
 
2858
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/logging.js
2598
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/time.js
2599
+ var abortError = /* @__PURE__ */ __name(() => new DOMException("The operation was aborted.", "AbortError"), "abortError");
2600
+ var realSleep = /* @__PURE__ */ __name((ms, signal) => new Promise((resolve2, reject) => {
2601
+ if (signal?.aborted) {
2602
+ reject(abortError());
2603
+ return;
2604
+ }
2605
+ const timer = setTimeout(resolve2, ms);
2606
+ signal?.addEventListener("abort", () => {
2607
+ clearTimeout(timer);
2608
+ reject(abortError());
2609
+ }, { once: true });
2610
+ }), "realSleep");
2611
+
2612
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/logging.js
2859
2613
  import { appendFileSync } from "node:fs";
2860
2614
  var REDACTED_FIELDS = [
2861
2615
  "authorization",
@@ -2950,6 +2704,117 @@ var silent = {
2950
2704
  }, "error")
2951
2705
  };
2952
2706
 
2707
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/pretty.js
2708
+ var import_cli_table3 = __toESM(require_cli_table3(), 1);
2709
+ import { styleText } from "node:util";
2710
+ var renderPretty = /* @__PURE__ */ __name((value, options) => {
2711
+ const paint2 = palette(options.color);
2712
+ if (Array.isArray(value)) {
2713
+ if (value.length === 0)
2714
+ return paint2.dim("(nothing)");
2715
+ return isRowLike(value) ? renderTable(value, paint2) : renderJson(value);
2716
+ }
2717
+ if (isPlainObject(value)) {
2718
+ const listKey = Object.keys(value).find((key) => Array.isArray(value[key]) && isRowLike(value[key]));
2719
+ if (listKey) {
2720
+ const rest = Object.fromEntries(Object.entries(value).filter(([key]) => key !== listKey));
2721
+ const table = renderTable(value[listKey], paint2);
2722
+ return Object.keys(rest).length > 0 ? `${table}
2723
+
2724
+ ${renderFields(rest, paint2)}` : table;
2725
+ }
2726
+ return renderFields(value, paint2);
2727
+ }
2728
+ return renderJson(value);
2729
+ }, "renderPretty");
2730
+ var paint = /* @__PURE__ */ __name((format, color) => (text) => color ? styleText(format, text, { validateStream: false }) : text, "paint");
2731
+ var palette = /* @__PURE__ */ __name((color) => ({
2732
+ dim: paint("dim", color),
2733
+ bold: paint("bold", color),
2734
+ label: paint("cyan", color)
2735
+ }), "palette");
2736
+ var isPlainObject = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isPlainObject");
2737
+ var isRowLike = /* @__PURE__ */ __name((value) => value.length > 0 && value.every((item) => isPlainObject(item)) && value.length <= 500, "isRowLike");
2738
+ var renderTable = /* @__PURE__ */ __name((rows, paint2) => {
2739
+ const columns = [...new Set(rows.flatMap((row) => Object.keys(row)))];
2740
+ const table = new import_cli_table3.default({
2741
+ head: columns.map((column) => paint2.bold(visibleControls(column))),
2742
+ // `chars: {}` is not enough — cli-table3 falls back to its own defaults for anything unset.
2743
+ style: { head: [], border: [], "padding-left": 0, "padding-right": 2 },
2744
+ chars: BORDERLESS
2745
+ });
2746
+ for (const row of rows)
2747
+ table.push(columns.map((column) => cell(row[column])));
2748
+ return table.toString();
2749
+ }, "renderTable");
2750
+ var renderFields = /* @__PURE__ */ __name((fields, paint2) => {
2751
+ const rows = Object.entries(fields).map(([key, value]) => ({ label: visibleControls(key), value }));
2752
+ const width = Math.max(...rows.map((row) => row.label.length));
2753
+ return rows.map((row) => `${paint2.label(row.label.padEnd(width))} ${cell(row.value)}`).join("\n");
2754
+ }, "renderFields");
2755
+ var cell = /* @__PURE__ */ __name((value) => {
2756
+ if (value === null || value === void 0)
2757
+ return "";
2758
+ if (typeof value === "object")
2759
+ return visibleControls(JSON.stringify(value));
2760
+ return visibleControls(String(value));
2761
+ }, "cell");
2762
+ var renderJson = /* @__PURE__ */ __name((value) => JSON.stringify(value, null, 2), "renderJson");
2763
+ var BORDERLESS = {
2764
+ top: "",
2765
+ "top-mid": "",
2766
+ "top-left": "",
2767
+ "top-right": "",
2768
+ bottom: "",
2769
+ "bottom-mid": "",
2770
+ "bottom-left": "",
2771
+ "bottom-right": "",
2772
+ left: "",
2773
+ "left-mid": "",
2774
+ mid: "",
2775
+ "mid-mid": "",
2776
+ right: "",
2777
+ "right-mid": "",
2778
+ middle: ""
2779
+ };
2780
+
2781
+ // node_modules/.pnpm/@wirecat+cli-base@0.68.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/renderer.js
2782
+ var createRenderer = /* @__PURE__ */ __name(({ format, color, streams = processStreams, quiet = false }) => {
2783
+ const mark = /* @__PURE__ */ __name((symbol, message) => format === "pretty" ? `${symbol} ${visibleControls(message)}` : visibleControls(message), "mark");
2784
+ const say = /* @__PURE__ */ __name((symbol) => (message) => {
2785
+ if (!quiet)
2786
+ streams.diagnostic(mark(symbol, message));
2787
+ }, "say");
2788
+ const diagnostics = {
2789
+ note: say("\xB7"),
2790
+ success: say("\u2713"),
2791
+ warn: say("!"),
2792
+ failure: /* @__PURE__ */ __name((message) => streams.diagnostic(mark("\u2717", message)), "failure")
2793
+ };
2794
+ if (format === "jsonl") {
2795
+ return {
2796
+ ...diagnostics,
2797
+ result: /* @__PURE__ */ __name((value) => streams.data(JSON.stringify(value)), "result"),
2798
+ stream: /* @__PURE__ */ __name((items) => {
2799
+ for (const item of items)
2800
+ streams.data(JSON.stringify(item));
2801
+ }, "stream")
2802
+ };
2803
+ }
2804
+ if (format === "pretty") {
2805
+ return {
2806
+ ...diagnostics,
2807
+ result: /* @__PURE__ */ __name((value) => streams.data(renderPretty(value, { color })), "result"),
2808
+ stream: /* @__PURE__ */ __name((items) => streams.data(renderPretty([...items], { color })), "stream")
2809
+ };
2810
+ }
2811
+ return {
2812
+ ...diagnostics,
2813
+ result: /* @__PURE__ */ __name((value) => streams.data(JSON.stringify(value)), "result"),
2814
+ stream: /* @__PURE__ */ __name((items) => streams.data(JSON.stringify([...items])), "stream")
2815
+ };
2816
+ }, "createRenderer");
2817
+
2953
2818
  export {
2954
2819
  EXIT_CODES,
2955
2820
  exitCodeFor,
@@ -2979,10 +2844,8 @@ export {
2979
2844
  keyringService,
2980
2845
  Credentials,
2981
2846
  realSleep,
2982
- createDeadline,
2983
2847
  logRecordOf,
2984
2848
  createRecordLog,
2985
- createOutputBuffer,
2986
2849
  processStreams,
2987
2850
  captureStreams,
2988
2851
  createRenderer,