@wirecat/drive-cli 0.62.0 → 0.64.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 (150) hide show
  1. package/README.md +2 -1
  2. package/dist/bin/drive.js +2 -2
  3. package/dist/bundle/{all-profiles-CKD2DWUK.js → all-profiles-BPPT2AK5.js} +13 -14
  4. package/dist/bundle/{anthropic-E3T4USLA.js → anthropic-JW6GOJUD.js} +13 -11
  5. package/dist/bundle/{app-server-JB2AEWWL.js → app-server-KAQIOJMZ.js} +53 -54
  6. package/dist/bundle/{bun-CC44AAND.js → bun-UT7GNTPV.js} +2 -2
  7. package/dist/bundle/{bun-sqlite-AUMFKYVR.js → bun-sqlite-2OIVV3LS.js} +8 -8
  8. package/dist/bundle/{chunk-EOOGWUTP.js → chunk-2FEZ24DK.js} +10 -10
  9. package/dist/bundle/{chunk-N7OZPKU7.js → chunk-2W464HAE.js} +4 -4
  10. package/dist/bundle/{chunk-UGXN5D7U.js → chunk-34BIDKF4.js} +332 -430
  11. package/dist/bundle/{chunk-WZKEU7WR.js → chunk-36GPBPWM.js} +1 -1
  12. package/dist/bundle/{chunk-LQKD257P.js → chunk-3J5KAFNA.js} +2255 -1125
  13. package/dist/bundle/{chunk-7W5HYGVW.js → chunk-3NULZGQU.js} +2 -2
  14. package/dist/bundle/{chunk-XFRRKZHQ.js → chunk-46CD64J2.js} +155 -36
  15. package/dist/bundle/{chunk-DWJHL6DV.js → chunk-4CNTID2X.js} +4 -4
  16. package/dist/bundle/{chunk-LWE4JGRN.js → chunk-4YRENUB5.js} +2 -2
  17. package/dist/bundle/{chunk-SW4I5BR7.js → chunk-5HSRQ53R.js} +2 -2
  18. package/dist/bundle/{chunk-IR4SQLBR.js → chunk-5OFA5EXE.js} +2 -2
  19. package/dist/bundle/{chunk-R347FPYU.js → chunk-5ZBR55US.js} +1 -1
  20. package/dist/bundle/{chunk-Q2LRPOKL.js → chunk-66AF4FBW.js} +4 -4
  21. package/dist/bundle/{chunk-RWSXVCSG.js → chunk-6B37XO6B.js} +23 -5
  22. package/dist/bundle/{chunk-ZMOUUOT2.js → chunk-6G53ZFUT.js} +1 -1
  23. package/dist/bundle/{chunk-HCNQT3QE.js → chunk-AHB4OJCI.js} +1951 -580
  24. package/dist/bundle/{chunk-JK3U25QZ.js → chunk-B67BLRAI.js} +59 -1
  25. package/dist/bundle/{chunk-7ZXIWZQ6.js → chunk-B7XBIOMR.js} +12 -12
  26. package/dist/bundle/{chunk-FEZF3TII.js → chunk-BDYWZ7JE.js} +50 -6
  27. package/dist/bundle/{chunk-SVPCHFKI.js → chunk-BEUAICUD.js} +2 -2
  28. package/dist/bundle/{chunk-TDX4GZFO.js → chunk-BEZJA44H.js} +7 -7
  29. package/dist/bundle/{chunk-RIDQNVZM.js → chunk-BZ2ZKILM.js} +3 -3
  30. package/dist/bundle/{chunk-FUITWY7O.js → chunk-C7WBNOYW.js} +1 -1
  31. package/dist/bundle/{chunk-CJHY5YIF.js → chunk-CPMRM3GQ.js} +489 -210
  32. package/dist/bundle/{chunk-FNWIJ6EJ.js → chunk-DD7EFG6B.js} +2 -2
  33. package/dist/bundle/{chunk-W4RTIL7S.js → chunk-E2LBCCTG.js} +5 -5
  34. package/dist/bundle/{chunk-O2XOX4HB.js → chunk-EC2XGDKJ.js} +50 -34
  35. package/dist/bundle/{chunk-4OSSOWDM.js → chunk-EJ4PNHPP.js} +1 -1
  36. package/dist/bundle/{chunk-XS5POQST.js → chunk-EQEGJVO2.js} +1 -1
  37. package/dist/bundle/{chunk-U2BFYSQV.js → chunk-EWGVDFPT.js} +8983 -3343
  38. package/dist/bundle/{chunk-OBH5BA62.js → chunk-EZ6O3ST3.js} +3 -3
  39. package/dist/bundle/{chunk-HG6CAYJH.js → chunk-F2VDAG32.js} +3 -3
  40. package/dist/bundle/{chunk-RPMKG63Z.js → chunk-G3NULXOM.js} +4 -4
  41. package/dist/bundle/{chunk-OD4U7GUY.js → chunk-G4KEKKDE.js} +20 -20
  42. package/dist/bundle/{chunk-OTROVC4E.js → chunk-GSMYXGFR.js} +1 -1
  43. package/dist/bundle/{chunk-XZUS7XRO.js → chunk-GW3U6OLD.js} +1 -1
  44. package/dist/bundle/{chunk-6EY46GAN.js → chunk-HW4UPST2.js} +2 -2
  45. package/dist/bundle/{chunk-2HF2MRXI.js → chunk-IDAK4DDK.js} +1 -1
  46. package/dist/bundle/{chunk-27YUUGXQ.js → chunk-IK6KH3RE.js} +1 -1
  47. package/dist/bundle/{chunk-QTI6IVHZ.js → chunk-IX7NQJLY.js} +8 -8
  48. package/dist/bundle/{chunk-YMWENGKH.js → chunk-J62DI53V.js} +1 -1
  49. package/dist/bundle/{chunk-AH5C3D3D.js → chunk-JRXFW7HE.js} +5 -5
  50. package/dist/bundle/{chunk-KLFSRKHB.js → chunk-K6BSB53R.js} +1 -1
  51. package/dist/bundle/{chunk-ONP2IBHY.js → chunk-KE4XPPRQ.js} +98 -81
  52. package/dist/bundle/{chunk-UQLWMGSD.js → chunk-KG2XKEHL.js} +5 -5
  53. package/dist/bundle/{chunk-T5NWWXS2.js → chunk-KIN6PDFE.js} +24 -2
  54. package/dist/bundle/{chunk-QH7DOVO3.js → chunk-KVW4XNKB.js} +45 -29
  55. package/dist/bundle/{chunk-PEQA6LA5.js → chunk-LOMW6F2E.js} +230 -236
  56. package/dist/bundle/{chunk-4SIZEJ3M.js → chunk-M73NNJ3X.js} +2 -2
  57. package/dist/bundle/{chunk-QCKZ3GAA.js → chunk-N622LRPM.js} +4 -4
  58. package/dist/bundle/{chunk-YPFUYQDP.js → chunk-O2QO5UZC.js} +13 -13
  59. package/dist/bundle/{chunk-QCX6XZLA.js → chunk-OEVHZOHC.js} +12 -12
  60. package/dist/bundle/{chunk-VAYB52HF.js → chunk-OH3K2E7X.js} +402 -184
  61. package/dist/bundle/{chunk-YXYTY4GF.js → chunk-P7DEGRZA.js} +21 -21
  62. package/dist/bundle/{chunk-YUWPNG7B.js → chunk-PBMSBCVB.js} +1 -1
  63. package/dist/bundle/{chunk-67ZQCWBV.js → chunk-QEAD2LF4.js} +3 -3
  64. package/dist/bundle/{chunk-JN5TVEEL.js → chunk-QXCKJUZY.js} +124 -22
  65. package/dist/bundle/{chunk-T7X53FCJ.js → chunk-SIOIMO62.js} +37 -37
  66. package/dist/bundle/{chunk-O7ALBI2I.js → chunk-TNV2FXVK.js} +5 -5
  67. package/dist/bundle/chunk-UD55VB2N.js +87 -0
  68. package/dist/bundle/{chunk-L7K2MOIC.js → chunk-UIEA6FIV.js} +22 -22
  69. package/dist/bundle/{chunk-EW7PKB4M.js → chunk-UJR272CP.js} +29 -29
  70. package/dist/bundle/{chunk-YALI4C7C.js → chunk-USLZE36C.js} +6 -6
  71. package/dist/bundle/{chunk-YOJDGAPT.js → chunk-VIJ6ACYB.js} +8 -8
  72. package/dist/bundle/{chunk-MN4VXU3M.js → chunk-VPLFD5RJ.js} +4 -4
  73. package/dist/bundle/{chunk-VQDD64A4.js → chunk-VT2UFYPJ.js} +8 -10
  74. package/dist/bundle/{chunk-CZ2GJHLL.js → chunk-WWCYTMAV.js} +2 -2
  75. package/dist/bundle/{chunk-DJOAMGF4.js → chunk-XPXKD63J.js} +13 -13
  76. package/dist/bundle/{chunk-E43ENLJJ.js → chunk-ZF6GUZCE.js} +1 -1
  77. package/dist/bundle/{chunk-XEW2EN6F.js → chunk-ZRZ4HTCK.js} +60 -34
  78. package/dist/bundle/{chunk-2KN35F32.js → chunk-ZSZJLJIA.js} +10 -10
  79. package/dist/bundle/command-contract-H5OYJOPF.js +38 -0
  80. package/dist/bundle/{decode-WIIX3Y2X.js → decode-HTOQ6S3V.js} +8 -8
  81. package/dist/bundle/{dispatch-GEFIXA6X.js → dispatch-SH5SP6LA.js} +11 -11
  82. package/dist/bundle/drive.js +11 -11
  83. package/dist/bundle/{echarts-OYINM4C4.js → echarts-KFHB6SLX.js} +2 -2
  84. package/dist/bundle/{embed-DWZIYMBX.js → embed-YATFB2PN.js} +9 -9
  85. package/dist/bundle/{embedder-ILWH7ZRM.js → embedder-MQPDFGTJ.js} +12 -12
  86. package/dist/bundle/entry-YZBB647C.js +22 -0
  87. package/dist/bundle/{failure-GV77W3CD.js → failure-4FQL4XJI.js} +4 -4
  88. package/dist/bundle/first-run-5JT3UQZB.js +30 -0
  89. package/dist/bundle/first-screen-BEMDEWO7.js +36 -0
  90. package/dist/bundle/{google-KLZSUAVY.js → google-DVADVICN.js} +13 -13
  91. package/dist/bundle/{google-api-HZQ5R4ZO.js → google-api-QMFGCXBM.js} +55 -57
  92. package/dist/bundle/grants-WKB2E4TA.js +103 -0
  93. package/dist/bundle/{identity-J2DON4IO.js → identity-FYVDK4M2.js} +6 -6
  94. package/dist/bundle/{instructions-HGOJ23AJ.js → instructions-D3GF3B7M.js} +1 -1
  95. package/dist/bundle/{login-BD2TS4GY.js → login-COFZ2IWP.js} +61 -63
  96. package/dist/bundle/{mcp-GWDA3HOA.js → mcp-RKJG22KM.js} +2 -2
  97. package/dist/bundle/{node-CPKTDPH7.js → node-OFICOKX3.js} +2 -2
  98. package/dist/bundle/{node-sqlite-IXDCRLSX.js → node-sqlite-DNBTDOXD.js} +9 -9
  99. package/dist/bundle/oauth-PDQHWFBF.js +22 -0
  100. package/dist/bundle/{open-O7P3ZV3Y.js → open-PTPR2YWX.js} +8 -8
  101. package/dist/bundle/{openai-RCFQKCXC.js → openai-2KV5LUW4.js} +17 -17
  102. package/dist/bundle/{process-KXDRJO22.js → process-EAW6NST2.js} +1 -1
  103. package/dist/bundle/{program-UCHFC7JQ.js → program-6UV5Q5YN.js} +310 -279
  104. package/dist/bundle/prompt-634TPMJK.js +19 -0
  105. package/dist/bundle/{reasons-57J2D77K.js → reasons-DDWCEYSQ.js} +5 -5
  106. package/dist/bundle/{recognize-MRCYGP2J.js → recognize-SJO6QUDW.js} +7 -7
  107. package/dist/bundle/{remote-L3L4PHKF.js → remote-6JXZITKF.js} +10 -10
  108. package/dist/bundle/{rerank-PSOE6XFT.js → rerank-MD5VOPQ6.js} +10 -10
  109. package/dist/bundle/{serve-72OGS3BF.js → serve-LZTROA2M.js} +12 -12
  110. package/dist/bundle/server-GT7X666D.js +69 -0
  111. package/dist/bundle/{server-SCXKYHBO.js → server-NSA3UAFY.js} +43 -44
  112. package/dist/bundle/{services-YAFTELBI.js → services-F5A6XQCV.js} +69 -34
  113. package/dist/bundle/{sqlite-runtime-DLK4SU33.js → sqlite-runtime-7YF6REKS.js} +9 -9
  114. package/dist/bundle/{start-AFFA3LKM.js → start-MUFLE6FA.js} +30 -8
  115. package/dist/bundle/{state-T5VNAJSZ.js → state-UC54F3YZ.js} +9 -9
  116. package/dist/bundle/{store-4OFK7PKQ.js → store-F5FJGWMR.js} +58 -20
  117. package/dist/bundle/{store-R6MSY2IM.js → store-J53YNAH6.js} +43 -18
  118. package/dist/bundle/store-maintenance-command-GJVXLBAB.js +58 -0
  119. package/dist/bundle/tokens-H2EJKGA5.js +101 -0
  120. package/dist/commands/account.d.ts +4 -0
  121. package/dist/commands/account.d.ts.map +1 -0
  122. package/dist/commands/account.js +33 -0
  123. package/dist/commands/account.js.map +1 -0
  124. package/dist/commands/config.d.ts.map +1 -1
  125. package/dist/commands/config.js +5 -1
  126. package/dist/commands/config.js.map +1 -1
  127. package/dist/profile-lock.d.ts +1 -0
  128. package/dist/profile-lock.d.ts.map +1 -1
  129. package/dist/profile-lock.js +1 -0
  130. package/dist/profile-lock.js.map +1 -1
  131. package/dist/program.d.ts.map +1 -1
  132. package/dist/program.js +2 -0
  133. package/dist/program.js.map +1 -1
  134. package/dist/version.d.ts +1 -1
  135. package/dist/version.js +1 -1
  136. package/package.json +3 -3
  137. package/dist/bundle/chunk-AQVUEZEP.js +0 -22
  138. package/dist/bundle/chunk-DRZZBN3V.js +0 -33
  139. package/dist/bundle/chunk-UOXOLGNG.js +0 -42
  140. package/dist/bundle/command-contract-OB5BRABN.js +0 -39
  141. package/dist/bundle/entry-V5V3TOTY.js +0 -22
  142. package/dist/bundle/first-run-V3VVLQF4.js +0 -30
  143. package/dist/bundle/first-screen-Y3RIN7FU.js +0 -37
  144. package/dist/bundle/grants-L7XLHLUT.js +0 -105
  145. package/dist/bundle/oauth-HOGY4YBB.js +0 -22
  146. package/dist/bundle/prompt-EVPPBN5W.js +0 -17
  147. package/dist/bundle/server-C5TGNFXW.js +0 -70
  148. package/dist/bundle/store-maintenance-command-QDMCXGV6.js +0 -60
  149. package/dist/bundle/tokens-HIG36RNS.js +0 -103
  150. /package/dist/bundle/{chunk-ZQ3GWKDQ.js → chunk-SW6C6WH5.js} +0 -0
@@ -8,7 +8,7 @@ import {
8
8
  metadataJson,
9
9
  supported,
10
10
  tooManyEntries
11
- } from "./chunk-YUWPNG7B.js";
11
+ } from "./chunk-PBMSBCVB.js";
12
12
  import {
13
13
  ACCOUNT_FREE_COMMANDS,
14
14
  ANY_PROFILE_COMMANDS,
@@ -19,7 +19,7 @@ import {
19
19
  describeDriveProgram,
20
20
  examples,
21
21
  markProfileFree
22
- } from "./chunk-67ZQCWBV.js";
22
+ } from "./chunk-QEAD2LF4.js";
23
23
  import {
24
24
  DEFAULTS_ONLY,
25
25
  DEFAULT_LEVELS,
@@ -49,7 +49,7 @@ import {
49
49
  unknownProfile,
50
50
  withDefaults,
51
51
  writeConfig
52
- } from "./chunk-QCX6XZLA.js";
52
+ } from "./chunk-OEVHZOHC.js";
53
53
  import {
54
54
  blockKey,
55
55
  blocksMarkdown,
@@ -68,7 +68,7 @@ import {
68
68
  syncDocuments,
69
69
  syncMirrors,
70
70
  watchMirrors
71
- } from "./chunk-L7K2MOIC.js";
71
+ } from "./chunk-UIEA6FIV.js";
72
72
  import {
73
73
  apiMethod,
74
74
  apiMethods,
@@ -77,10 +77,11 @@ import {
77
77
  schemas,
78
78
  validateApiParams,
79
79
  validateRequest
80
- } from "./chunk-N7OZPKU7.js";
80
+ } from "./chunk-2W464HAE.js";
81
81
  import {
82
82
  DISCOVERY_DESCRIPTIONS,
83
83
  MEMO_SCENARIOS,
84
+ accountRemoveCommand,
84
85
  addContractInfo,
85
86
  answerFields,
86
87
  apiPlainJson,
@@ -107,24 +108,23 @@ import {
107
108
  skillCommand,
108
109
  suggest,
109
110
  upgradeCommand
110
- } from "./chunk-HCNQT3QE.js";
111
+ } from "./chunk-AHB4OJCI.js";
111
112
  import {
112
113
  googleError
113
- } from "./chunk-OTROVC4E.js";
114
- import "./chunk-KLFSRKHB.js";
114
+ } from "./chunk-GSMYXGFR.js";
115
+ import "./chunk-K6BSB53R.js";
115
116
  import "./chunk-SBZB7HMU.js";
116
- import "./chunk-XZUS7XRO.js";
117
- import "./chunk-XEW2EN6F.js";
118
- import "./chunk-JN5TVEEL.js";
117
+ import "./chunk-GW3U6OLD.js";
118
+ import "./chunk-ZRZ4HTCK.js";
119
+ import "./chunk-QXCKJUZY.js";
119
120
  import {
120
- modelGateway,
121
121
  storeInfo
122
- } from "./chunk-UGXN5D7U.js";
122
+ } from "./chunk-34BIDKF4.js";
123
123
  import {
124
124
  RecipientList,
125
125
  SendJournal,
126
126
  sendGuard
127
- } from "./chunk-EW7PKB4M.js";
127
+ } from "./chunk-UJR272CP.js";
128
128
  import {
129
129
  LIST_QUERY_GUIDE,
130
130
  listQuery,
@@ -135,13 +135,13 @@ import {
135
135
  typedQuery,
136
136
  unfilteredQuery,
137
137
  withQuery
138
- } from "./chunk-YXYTY4GF.js";
138
+ } from "./chunk-P7DEGRZA.js";
139
139
  import {
140
140
  commandsText,
141
141
  inSection
142
- } from "./chunk-QTI6IVHZ.js";
142
+ } from "./chunk-IX7NQJLY.js";
143
143
  import "./chunk-HTQTIKWP.js";
144
- import "./chunk-O7ALBI2I.js";
144
+ import "./chunk-TNV2FXVK.js";
145
145
  import {
146
146
  FETCH,
147
147
  InvalidArgumentError,
@@ -164,7 +164,6 @@ import {
164
164
  jsonlRecords,
165
165
  listOf,
166
166
  metaOf,
167
- modelTarget,
168
167
  outputFor,
169
168
  overrideSharedContract,
170
169
  refuseCommandName,
@@ -173,29 +172,25 @@ import {
173
172
  rootOf,
174
173
  settingRows,
175
174
  snakeKeys
176
- } from "./chunk-PEQA6LA5.js";
177
- import "./chunk-VQDD64A4.js";
178
- import "./chunk-7ZXIWZQ6.js";
175
+ } from "./chunk-LOMW6F2E.js";
176
+ import "./chunk-VT2UFYPJ.js";
177
+ import "./chunk-B7XBIOMR.js";
179
178
  import {
180
179
  setupPermissionCeiling
181
- } from "./chunk-MN4VXU3M.js";
182
- import "./chunk-2KN35F32.js";
183
- import {
184
- readOnlyLockOf,
185
- readOnlyRefusal
186
- } from "./chunk-7W5HYGVW.js";
187
- import "./chunk-DWJHL6DV.js";
188
- import "./chunk-HG6CAYJH.js";
189
- import "./chunk-YMWENGKH.js";
190
- import "./chunk-DRZZBN3V.js";
180
+ } from "./chunk-VPLFD5RJ.js";
181
+ import "./chunk-ZSZJLJIA.js";
182
+ import "./chunk-4CNTID2X.js";
183
+ import "./chunk-F2VDAG32.js";
184
+ import "./chunk-J62DI53V.js";
191
185
  import {
186
+ modelGateway,
192
187
  newOperationId
193
- } from "./chunk-LQKD257P.js";
188
+ } from "./chunk-3J5KAFNA.js";
194
189
  import {
195
190
  columnName,
196
191
  readSpreadsheet
197
- } from "./chunk-ONP2IBHY.js";
198
- import "./chunk-YPFUYQDP.js";
192
+ } from "./chunk-KE4XPPRQ.js";
193
+ import "./chunk-O2QO5UZC.js";
199
194
  import {
200
195
  CEILING_KEY,
201
196
  LEVELS,
@@ -203,41 +198,45 @@ import {
203
198
  inRun,
204
199
  layerPermissions,
205
200
  levelFor,
201
+ modelTarget,
206
202
  parseDuration
207
- } from "./chunk-VAYB52HF.js";
208
- import "./chunk-AQVUEZEP.js";
203
+ } from "./chunk-OH3K2E7X.js";
209
204
  import {
210
205
  latestVersion,
211
206
  runUpdate,
212
207
  updateNotice
213
- } from "./chunk-QCKZ3GAA.js";
214
- import "./chunk-ZMOUUOT2.js";
215
- import "./chunk-T5NWWXS2.js";
216
- import "./chunk-OBH5BA62.js";
217
- import "./chunk-AH5C3D3D.js";
218
- import "./chunk-5DPV7X27.js";
219
- import "./chunk-Q2LRPOKL.js";
208
+ } from "./chunk-N622LRPM.js";
209
+ import "./chunk-6G53ZFUT.js";
210
+ import {
211
+ readOnlyLockOf,
212
+ readOnlyRefusal
213
+ } from "./chunk-3NULZGQU.js";
214
+ import "./chunk-KIN6PDFE.js";
215
+ import "./chunk-EZ6O3ST3.js";
220
216
  import {
221
217
  applyDocumentTransfer,
222
218
  previewDocumentTransfer
223
- } from "./chunk-QH7DOVO3.js";
219
+ } from "./chunk-KVW4XNKB.js";
224
220
  import {
225
221
  note
226
- } from "./chunk-RIDQNVZM.js";
227
- import "./chunk-SVPCHFKI.js";
222
+ } from "./chunk-BZ2ZKILM.js";
223
+ import "./chunk-JRXFW7HE.js";
224
+ import "./chunk-5DPV7X27.js";
225
+ import "./chunk-66AF4FBW.js";
226
+ import "./chunk-BEUAICUD.js";
228
227
  import {
229
228
  CATALOG_QUERY,
230
229
  IMPORTED_DOCUMENT_QUERY,
231
230
  openStore
232
- } from "./chunk-U2BFYSQV.js";
233
- import "./chunk-UOXOLGNG.js";
231
+ } from "./chunk-EWGVDFPT.js";
232
+ import "./chunk-UD55VB2N.js";
234
233
  import {
235
234
  FACT_STATUSES,
236
235
  FACT_TYPES,
237
236
  MEMORY_KINDS,
238
237
  MEMORY_SCOPES,
239
238
  MEMORY_STATUSES
240
- } from "./chunk-CJHY5YIF.js";
239
+ } from "./chunk-CPMRM3GQ.js";
241
240
  import {
242
241
  dateRange,
243
242
  defineQuery,
@@ -247,40 +246,40 @@ import {
247
246
  timezoneOf,
248
247
  validateQuery,
249
248
  zonedMoment
250
- } from "./chunk-EOOGWUTP.js";
251
- import "./chunk-JK3U25QZ.js";
252
- import "./chunk-YOJDGAPT.js";
253
- import "./chunk-TDX4GZFO.js";
249
+ } from "./chunk-2FEZ24DK.js";
250
+ import "./chunk-B67BLRAI.js";
251
+ import "./chunk-VIJ6ACYB.js";
252
+ import "./chunk-BEZJA44H.js";
254
253
  import {
255
254
  storePath
256
- } from "./chunk-FNWIJ6EJ.js";
257
- import "./chunk-YALI4C7C.js";
258
- import "./chunk-XS5POQST.js";
259
- import "./chunk-RWSXVCSG.js";
260
- import "./chunk-IR4SQLBR.js";
255
+ } from "./chunk-DD7EFG6B.js";
256
+ import "./chunk-USLZE36C.js";
257
+ import "./chunk-EQEGJVO2.js";
258
+ import "./chunk-6B37XO6B.js";
259
+ import "./chunk-5OFA5EXE.js";
261
260
  import "./chunk-D72URWJE.js";
262
261
  import {
263
262
  installerOf
264
- } from "./chunk-27YUUGXQ.js";
263
+ } from "./chunk-IK6KH3RE.js";
265
264
  import {
266
265
  DRIVE_APP,
267
266
  PACKAGE,
268
267
  VERSION
269
- } from "./chunk-4SIZEJ3M.js";
268
+ } from "./chunk-M73NNJ3X.js";
270
269
  import {
271
270
  REASONS
272
- } from "./chunk-FUITWY7O.js";
273
- import "./chunk-ZQ3GWKDQ.js";
274
- import "./chunk-WZKEU7WR.js";
271
+ } from "./chunk-C7WBNOYW.js";
272
+ import "./chunk-SW6C6WH5.js";
273
+ import "./chunk-36GPBPWM.js";
275
274
  import {
276
275
  processStreams,
277
276
  saveConfigFile,
278
277
  writeSecurely
279
- } from "./chunk-OD4U7GUY.js";
280
- import "./chunk-UQLWMGSD.js";
278
+ } from "./chunk-G4KEKKDE.js";
279
+ import "./chunk-KG2XKEHL.js";
281
280
  import "./chunk-Y5E2WNWB.js";
282
- import "./chunk-2HF2MRXI.js";
283
- import "./chunk-6EY46GAN.js";
281
+ import "./chunk-IDAK4DDK.js";
282
+ import "./chunk-HW4UPST2.js";
284
283
  import {
285
284
  array,
286
285
  boolean,
@@ -304,11 +303,11 @@ import {
304
303
  string,
305
304
  unknown,
306
305
  writes
307
- } from "./chunk-FEZF3TII.js";
306
+ } from "./chunk-BDYWZ7JE.js";
308
307
  import {
309
308
  CliError,
310
309
  isCliError
311
- } from "./chunk-4OSSOWDM.js";
310
+ } from "./chunk-EJ4PNHPP.js";
312
311
  import {
313
312
  __commonJS,
314
313
  __name,
@@ -1963,7 +1962,208 @@ var require_proper_lockfile = __commonJS({
1963
1962
  // dist/program.js
1964
1963
  import { randomUUID as randomUUID2 } from "node:crypto";
1965
1964
  import { mkdirSync as mkdirSync4, readFileSync as readFileSync6 } from "node:fs";
1966
- import { join as join10 } from "node:path";
1965
+ import { join as join11 } from "node:path";
1966
+
1967
+ // dist/commands/account.js
1968
+ import { join as join2 } from "node:path";
1969
+
1970
+ // dist/profile-lock.js
1971
+ var import_proper_lockfile = __toESM(require_proper_lockfile(), 1);
1972
+
1973
+ // dist/state.js
1974
+ import { mkdirSync, readFileSync, unlinkSync } from "node:fs";
1975
+ import { join } from "node:path";
1976
+ var ID = pipe(string(), regex(/^[A-Za-z0-9_-]{1,200}$/));
1977
+ var User = object({ id: optional(string()), email: optional(string()), name: optional(string()) });
1978
+ var File = object({
1979
+ id: ID,
1980
+ name: string(),
1981
+ mime: string(),
1982
+ parents: array(ID),
1983
+ version: optional(string()),
1984
+ modifiedAt: optional(string()),
1985
+ url: string(),
1986
+ trashed: boolean(),
1987
+ canDownload: boolean(),
1988
+ size: optional(number()),
1989
+ createdAt: optional(string()),
1990
+ description: optional(string()),
1991
+ driveId: optional(string()),
1992
+ owners: optional(array(User)),
1993
+ lastModifiedBy: optional(User),
1994
+ providerMetadata: optional(unknown())
1995
+ });
1996
+ var Skip = object({
1997
+ id: ID,
1998
+ reason: string(),
1999
+ file: optional(File),
2000
+ textLimit: optional(number()),
2001
+ storeRefusedIn: optional(string())
2002
+ });
2003
+ var State = object({
2004
+ version: literal(1),
2005
+ store: optional(string()),
2006
+ linkedThrough: optional(string()),
2007
+ linksPending: optional(boolean()),
2008
+ linksVersion: optional(pipe(number(), integer(), minValue(1))),
2009
+ principal: string(),
2010
+ scope: string(),
2011
+ cursor: optional(string()),
2012
+ folders: record(ID, File),
2013
+ documents: record(ID, object({
2014
+ metadata: File,
2015
+ hash: string(),
2016
+ reference: string(),
2017
+ tabs: number(),
2018
+ notRead: optional(string()),
2019
+ picture: optional(picklist(["saved", "too-large"]))
2020
+ })),
2021
+ skipped: array(Skip),
2022
+ lastSync: optional(string()),
2023
+ pending: optional(object({
2024
+ cursor: string(),
2025
+ scope: string(),
2026
+ folders: record(ID, File),
2027
+ jobs: array(object({ id: ID, kind: picklist(["save", "remove"]), file: optional(File) })),
2028
+ skipped: array(Skip)
2029
+ }))
2030
+ });
2031
+ var Walk = object({
2032
+ scope: string(),
2033
+ cursor: string(),
2034
+ stack: array(object({ id: ID, ancestry: array(ID), folder: optional(File) })),
2035
+ visited: array(ID),
2036
+ folders: record(ID, File),
2037
+ files: array(File),
2038
+ discovered: number()
2039
+ });
2040
+ var profileDir = /* @__PURE__ */ __name((env, name) => join(paths(env).state, "profiles", profileName(name)), "profileDir");
2041
+ var statePath = /* @__PURE__ */ __name((env, name) => join(profileDir(env, name), "state.json"), "statePath");
2042
+ var readState = /* @__PURE__ */ __name((env, name, principal) => {
2043
+ let value;
2044
+ try {
2045
+ value = JSON.parse(readFileSync(statePath(env, name), "utf8"));
2046
+ } catch (error) {
2047
+ if (error.code === "ENOENT")
2048
+ return { version: 1, principal, scope: "", folders: {}, documents: {}, skipped: [] };
2049
+ throw new CliError("configuration_error", "sync state is unreadable; refusing to reset its checkpoint", {
2050
+ reason: "state.invalid"
2051
+ });
2052
+ }
2053
+ const parsed = safeParse(State, value);
2054
+ if (!parsed.success || parsed.output.principal !== principal)
2055
+ throw new CliError("configuration_error", "sync state is invalid or belongs to another Google account", {
2056
+ reason: "state.invalid"
2057
+ });
2058
+ return parsed.output;
2059
+ }, "readState");
2060
+ var saveState = /* @__PURE__ */ __name((env, name, state) => {
2061
+ writeSecurely(statePath(env, name), `${JSON.stringify(state)}
2062
+ `, 384);
2063
+ }, "saveState");
2064
+ var walkPath = /* @__PURE__ */ __name((env, name) => join(profileDir(env, name), "walk.json"), "walkPath");
2065
+ var readWalk = /* @__PURE__ */ __name((env, name, scope) => {
2066
+ try {
2067
+ const parsed = safeParse(Walk, JSON.parse(readFileSync(walkPath(env, name), "utf8")));
2068
+ return parsed.success && parsed.output.scope === scope ? parsed.output : void 0;
2069
+ } catch {
2070
+ return void 0;
2071
+ }
2072
+ }, "readWalk");
2073
+ var saveWalk = /* @__PURE__ */ __name((env, name, walk) => {
2074
+ writeSecurely(walkPath(env, name), `${JSON.stringify(walk)}
2075
+ `, 384);
2076
+ }, "saveWalk");
2077
+ var removeWalk = /* @__PURE__ */ __name((env, name) => {
2078
+ try {
2079
+ unlinkSync(walkPath(env, name));
2080
+ } catch (error) {
2081
+ if (error.code !== "ENOENT")
2082
+ throw error;
2083
+ }
2084
+ }, "removeWalk");
2085
+ var ensureProfileDir = /* @__PURE__ */ __name((env, name) => {
2086
+ mkdirSync(profileDir(env, name), { recursive: true, mode: 448 });
2087
+ }, "ensureProfileDir");
2088
+ var snapshotPath = /* @__PURE__ */ __name((env, name, id) => join(profileDir(env, name), "documents", `${fileId(id)}.json`), "snapshotPath");
2089
+ var saveSnapshot = /* @__PURE__ */ __name((env, name, content) => {
2090
+ const path = snapshotPath(env, name, content.metadata.id);
2091
+ writeSecurely(path, `${JSON.stringify(content)}
2092
+ `, 384);
2093
+ writeSecurely(path.replace(/\.json$/, ".md"), content.markdown, 384);
2094
+ }, "saveSnapshot");
2095
+ var removeSnapshot = /* @__PURE__ */ __name((env, name, id) => {
2096
+ const path = snapshotPath(env, name, id);
2097
+ for (const file of [path, path.replace(/\.json$/, ".md")]) {
2098
+ try {
2099
+ unlinkSync(file);
2100
+ } catch (error) {
2101
+ if (error.code !== "ENOENT")
2102
+ throw error;
2103
+ }
2104
+ }
2105
+ }, "removeSnapshot");
2106
+ var readSnapshot = /* @__PURE__ */ __name((env, name, id) => {
2107
+ try {
2108
+ return JSON.parse(readFileSync(snapshotPath(env, name, id), "utf8"));
2109
+ } catch {
2110
+ throw new CliError("not_found", "source snapshot is unavailable \u2014 run drive <profile> sync --rescan", {
2111
+ reason: "state.snapshot-missing"
2112
+ });
2113
+ }
2114
+ }, "readSnapshot");
2115
+
2116
+ // dist/profile-lock.js
2117
+ var lockProfile = /* @__PURE__ */ __name(async (env, name) => {
2118
+ ensureProfileDir(env, name);
2119
+ let compromised = false;
2120
+ try {
2121
+ const release = await import_proper_lockfile.default.lock(profileDir(env, name), {
2122
+ stale: 3e4,
2123
+ retries: 0,
2124
+ onCompromised: /* @__PURE__ */ __name(() => {
2125
+ compromised = true;
2126
+ }, "onCompromised")
2127
+ });
2128
+ return {
2129
+ release,
2130
+ assertHeld: /* @__PURE__ */ __name(() => {
2131
+ if (compromised)
2132
+ throw new CliError("provider_unavailable", "profile lock was lost; retry the operation", {
2133
+ reason: "profile.busy"
2134
+ });
2135
+ }, "assertHeld")
2136
+ };
2137
+ } catch {
2138
+ throw new CliError("provider_unavailable", "another sync or knowledge operation holds this profile's lock; retry later", { reason: "profile.busy" });
2139
+ }
2140
+ }, "lockProfile");
2141
+ var profileLocked = /* @__PURE__ */ __name((env, name) => import_proper_lockfile.default.checkSync(profileDir(env, name), { stale: 3e4, realpath: false }), "profileLocked");
2142
+
2143
+ // dist/commands/account.js
2144
+ var removal = {
2145
+ signOut: /* @__PURE__ */ __name(async (profile, { env, keyring, mayRevoke }) => {
2146
+ const storage = readConfig(env).profiles[profile]?.storage ?? "keyring";
2147
+ const { sessionKeeper } = await import("./tokens-H2EJKGA5.js");
2148
+ const { revoked } = await sessionKeeper({
2149
+ env,
2150
+ name: profile,
2151
+ storage,
2152
+ client: application(env, { profile }),
2153
+ ...keyring ? { keyring } : {}
2154
+ }).signOut({ revoke: mayRevoke });
2155
+ return { revoked, removed: ["the Google sign-in"] };
2156
+ }, "signOut"),
2157
+ account: /* @__PURE__ */ __name((profile, { env }) => {
2158
+ const principal = readConfig(env).profiles[profile]?.principal;
2159
+ return principal ? { provider: "google-drive", account: principal } : void 0;
2160
+ }, "account"),
2161
+ dataFiles: /* @__PURE__ */ __name((profile, { env }) => [profileDir(env, profile), join2(paths(env).cache, "exports", profile)], "dataFiles"),
2162
+ busy: /* @__PURE__ */ __name((profile, { env }) => profileLocked(env, profile) ? "a sync or knowledge operation" : void 0, "busy")
2163
+ };
2164
+ var installAccountCommands = /* @__PURE__ */ __name((program, _context) => {
2165
+ annotate(program.command("account"), { effects: LOCAL_READ }).description("remove this profile from this computer").addCommand(accountRemoveCommand(DRIVE_APP, removal, { resolveSettings: configuration.resolveSettings }));
2166
+ }, "installAccountCommands");
1967
2167
 
1968
2168
  // dist/catalog.js
1969
2169
  var catalogInput = /* @__PURE__ */ __name((file) => ({
@@ -2208,178 +2408,6 @@ var snakeKeys2 = /* @__PURE__ */ __name((value, record2 = false) => {
2208
2408
  }, "snakeKeys");
2209
2409
  var allOf = /* @__PURE__ */ __name((items) => listOf("", { items, limit: Math.max(1, items.length), has_more: false }), "allOf");
2210
2410
 
2211
- // dist/profile-lock.js
2212
- var import_proper_lockfile = __toESM(require_proper_lockfile(), 1);
2213
-
2214
- // dist/state.js
2215
- import { mkdirSync, readFileSync, unlinkSync } from "node:fs";
2216
- import { join } from "node:path";
2217
- var ID = pipe(string(), regex(/^[A-Za-z0-9_-]{1,200}$/));
2218
- var User = object({ id: optional(string()), email: optional(string()), name: optional(string()) });
2219
- var File = object({
2220
- id: ID,
2221
- name: string(),
2222
- mime: string(),
2223
- parents: array(ID),
2224
- version: optional(string()),
2225
- modifiedAt: optional(string()),
2226
- url: string(),
2227
- trashed: boolean(),
2228
- canDownload: boolean(),
2229
- size: optional(number()),
2230
- createdAt: optional(string()),
2231
- description: optional(string()),
2232
- driveId: optional(string()),
2233
- owners: optional(array(User)),
2234
- lastModifiedBy: optional(User),
2235
- providerMetadata: optional(unknown())
2236
- });
2237
- var Skip = object({
2238
- id: ID,
2239
- reason: string(),
2240
- file: optional(File),
2241
- textLimit: optional(number()),
2242
- storeRefusedIn: optional(string())
2243
- });
2244
- var State = object({
2245
- version: literal(1),
2246
- store: optional(string()),
2247
- linkedThrough: optional(string()),
2248
- linksPending: optional(boolean()),
2249
- linksVersion: optional(pipe(number(), integer(), minValue(1))),
2250
- principal: string(),
2251
- scope: string(),
2252
- cursor: optional(string()),
2253
- folders: record(ID, File),
2254
- documents: record(ID, object({
2255
- metadata: File,
2256
- hash: string(),
2257
- reference: string(),
2258
- tabs: number(),
2259
- notRead: optional(string()),
2260
- picture: optional(picklist(["saved", "too-large"]))
2261
- })),
2262
- skipped: array(Skip),
2263
- lastSync: optional(string()),
2264
- pending: optional(object({
2265
- cursor: string(),
2266
- scope: string(),
2267
- folders: record(ID, File),
2268
- jobs: array(object({ id: ID, kind: picklist(["save", "remove"]), file: optional(File) })),
2269
- skipped: array(Skip)
2270
- }))
2271
- });
2272
- var Walk = object({
2273
- scope: string(),
2274
- cursor: string(),
2275
- stack: array(object({ id: ID, ancestry: array(ID), folder: optional(File) })),
2276
- visited: array(ID),
2277
- folders: record(ID, File),
2278
- files: array(File),
2279
- discovered: number()
2280
- });
2281
- var profileDir = /* @__PURE__ */ __name((env, name) => join(paths(env).state, "profiles", profileName(name)), "profileDir");
2282
- var statePath = /* @__PURE__ */ __name((env, name) => join(profileDir(env, name), "state.json"), "statePath");
2283
- var readState = /* @__PURE__ */ __name((env, name, principal) => {
2284
- let value;
2285
- try {
2286
- value = JSON.parse(readFileSync(statePath(env, name), "utf8"));
2287
- } catch (error) {
2288
- if (error.code === "ENOENT")
2289
- return { version: 1, principal, scope: "", folders: {}, documents: {}, skipped: [] };
2290
- throw new CliError("configuration_error", "sync state is unreadable; refusing to reset its checkpoint", {
2291
- reason: "state.invalid"
2292
- });
2293
- }
2294
- const parsed = safeParse(State, value);
2295
- if (!parsed.success || parsed.output.principal !== principal)
2296
- throw new CliError("configuration_error", "sync state is invalid or belongs to another Google account", {
2297
- reason: "state.invalid"
2298
- });
2299
- return parsed.output;
2300
- }, "readState");
2301
- var saveState = /* @__PURE__ */ __name((env, name, state) => {
2302
- writeSecurely(statePath(env, name), `${JSON.stringify(state)}
2303
- `, 384);
2304
- }, "saveState");
2305
- var walkPath = /* @__PURE__ */ __name((env, name) => join(profileDir(env, name), "walk.json"), "walkPath");
2306
- var readWalk = /* @__PURE__ */ __name((env, name, scope) => {
2307
- try {
2308
- const parsed = safeParse(Walk, JSON.parse(readFileSync(walkPath(env, name), "utf8")));
2309
- return parsed.success && parsed.output.scope === scope ? parsed.output : void 0;
2310
- } catch {
2311
- return void 0;
2312
- }
2313
- }, "readWalk");
2314
- var saveWalk = /* @__PURE__ */ __name((env, name, walk) => {
2315
- writeSecurely(walkPath(env, name), `${JSON.stringify(walk)}
2316
- `, 384);
2317
- }, "saveWalk");
2318
- var removeWalk = /* @__PURE__ */ __name((env, name) => {
2319
- try {
2320
- unlinkSync(walkPath(env, name));
2321
- } catch (error) {
2322
- if (error.code !== "ENOENT")
2323
- throw error;
2324
- }
2325
- }, "removeWalk");
2326
- var ensureProfileDir = /* @__PURE__ */ __name((env, name) => {
2327
- mkdirSync(profileDir(env, name), { recursive: true, mode: 448 });
2328
- }, "ensureProfileDir");
2329
- var snapshotPath = /* @__PURE__ */ __name((env, name, id) => join(profileDir(env, name), "documents", `${fileId(id)}.json`), "snapshotPath");
2330
- var saveSnapshot = /* @__PURE__ */ __name((env, name, content) => {
2331
- const path = snapshotPath(env, name, content.metadata.id);
2332
- writeSecurely(path, `${JSON.stringify(content)}
2333
- `, 384);
2334
- writeSecurely(path.replace(/\.json$/, ".md"), content.markdown, 384);
2335
- }, "saveSnapshot");
2336
- var removeSnapshot = /* @__PURE__ */ __name((env, name, id) => {
2337
- const path = snapshotPath(env, name, id);
2338
- for (const file of [path, path.replace(/\.json$/, ".md")]) {
2339
- try {
2340
- unlinkSync(file);
2341
- } catch (error) {
2342
- if (error.code !== "ENOENT")
2343
- throw error;
2344
- }
2345
- }
2346
- }, "removeSnapshot");
2347
- var readSnapshot = /* @__PURE__ */ __name((env, name, id) => {
2348
- try {
2349
- return JSON.parse(readFileSync(snapshotPath(env, name, id), "utf8"));
2350
- } catch {
2351
- throw new CliError("not_found", "source snapshot is unavailable \u2014 run drive <profile> sync --rescan", {
2352
- reason: "state.snapshot-missing"
2353
- });
2354
- }
2355
- }, "readSnapshot");
2356
-
2357
- // dist/profile-lock.js
2358
- var lockProfile = /* @__PURE__ */ __name(async (env, name) => {
2359
- ensureProfileDir(env, name);
2360
- let compromised = false;
2361
- try {
2362
- const release = await import_proper_lockfile.default.lock(profileDir(env, name), {
2363
- stale: 3e4,
2364
- retries: 0,
2365
- onCompromised: /* @__PURE__ */ __name(() => {
2366
- compromised = true;
2367
- }, "onCompromised")
2368
- });
2369
- return {
2370
- release,
2371
- assertHeld: /* @__PURE__ */ __name(() => {
2372
- if (compromised)
2373
- throw new CliError("provider_unavailable", "profile lock was lost; retry the operation", {
2374
- reason: "profile.busy"
2375
- });
2376
- }, "assertHeld")
2377
- };
2378
- } catch {
2379
- throw new CliError("provider_unavailable", "another sync or knowledge operation holds this profile's lock; retry later", { reason: "profile.busy" });
2380
- }
2381
- }, "lockProfile");
2382
-
2383
2411
  // dist/commands/catalog.js
2384
2412
  var local = /* @__PURE__ */ __name((command, mutates = false) => annotate(command, { effects: mutates ? LOCAL_WRITE : LOCAL_READ }), "local");
2385
2413
  var installCatalogCommands = /* @__PURE__ */ __name((program, helpers) => {
@@ -2468,10 +2496,10 @@ var installCatalogCommands = /* @__PURE__ */ __name((program, helpers) => {
2468
2496
  }, "installCatalogCommands");
2469
2497
 
2470
2498
  // dist/commands/config.js
2471
- import { join as join3 } from "node:path";
2499
+ import { join as join4 } from "node:path";
2472
2500
 
2473
2501
  // dist/policy.js
2474
- import { join as join2 } from "node:path";
2502
+ import { join as join3 } from "node:path";
2475
2503
  var ORDER = { deny: 0, readonly: 1, ask: 2, allow: 3 };
2476
2504
  var overridesOf = /* @__PURE__ */ __name((entries = []) => {
2477
2505
  const levels = {};
@@ -2560,11 +2588,11 @@ var guardedGoogleWrite = /* @__PURE__ */ __name(async (env, profile, key, act, f
2560
2588
  permissionDefaults: DEFAULT_LEVELS,
2561
2589
  ask: /* @__PURE__ */ __name(async (permission) => checkPolicy(env, profile, permission, true, flags, ask), "ask"),
2562
2590
  sendsPerHour: Number.MAX_SAFE_INTEGER,
2563
- journal: new SendJournal(join2(paths(env).state, "sends", `${profile}.jsonl`), {
2591
+ journal: new SendJournal(join3(paths(env).state, "sends", `${profile}.jsonl`), {
2564
2592
  service: "drive",
2565
2593
  version: VERSION
2566
2594
  }),
2567
- recipients: new RecipientList(join2(paths(env).state, "recipients", `${profile}.json`), "drive"),
2595
+ recipients: new RecipientList(join3(paths(env).state, "recipients", `${profile}.json`), "drive"),
2568
2596
  warn: /* @__PURE__ */ __name(() => {
2569
2597
  }, "warn")
2570
2598
  });
@@ -2732,7 +2760,7 @@ var installModelCommands = /* @__PURE__ */ __name((program, { env, output, strea
2732
2760
  throw new CliError("permission_error", "downloading a model needs the network; --offline was requested", {
2733
2761
  reason: "offline.refused"
2734
2762
  });
2735
- const { downloadImageModel, downloadTextModel } = await import("./services-YAFTELBI.js");
2763
+ const { downloadImageModel, downloadTextModel } = await import("./services-F5A6XQCV.js");
2736
2764
  const progress = /* @__PURE__ */ __name((line) => {
2737
2765
  if (!program.opts().quiet)
2738
2766
  streams.diagnostic(line);
@@ -2746,7 +2774,7 @@ var installModelCommands = /* @__PURE__ */ __name((program, { env, output, strea
2746
2774
  licence: model.licence,
2747
2775
  size_bytes: model.files.reduce((sum, file) => sum + file.bytes, 0),
2748
2776
  downloaded: true,
2749
- path: join3(directory, model.id)
2777
+ path: join4(directory, model.id)
2750
2778
  }));
2751
2779
  }, "download");
2752
2780
  const sharedModels = modelCatalogueCommand(DRIVE_APP, {
@@ -2756,8 +2784,10 @@ var installModelCommands = /* @__PURE__ */ __name((program, { env, output, strea
2756
2784
  diagnostic: /* @__PURE__ */ __name((line) => streams.diagnostic(line), "diagnostic"),
2757
2785
  offline: /* @__PURE__ */ __name(() => policyFlags().offline === true, "offline")
2758
2786
  });
2787
+ const own = new Set(models.commands.map((command) => command.name()));
2759
2788
  for (const command of sharedModels.commands)
2760
- models.addCommand(command);
2789
+ if (!own.has(command.name()))
2790
+ models.addCommand(command);
2761
2791
  const images = annotate(program.command("images"), { effects: LOCAL_READ }).description("the local model that picture search uses");
2762
2792
  const imageModels = annotate(images.command("models"), { effects: LOCAL_READ }).description("models that read pictures, for picture search");
2763
2793
  examples(annotate(imageModels.command("download"), { effects: FETCH, output: { entity: "model" } }).description("download a picture model once into the folder every WireCat CLI shares"), ["drive images models download clip-b32"]).argument("<model>", "model id, such as clip-b32").action((id) => download("image", id, false));
@@ -4090,7 +4120,7 @@ var installKnowledgeCommands = /* @__PURE__ */ __name((...args) => {
4090
4120
 
4091
4121
  // dist/commands/mirrors.js
4092
4122
  import { statSync } from "node:fs";
4093
- import { join as join4, resolve } from "node:path";
4123
+ import { join as join5, resolve } from "node:path";
4094
4124
 
4095
4125
  // dist/mirror-docs.js
4096
4126
  import { readFileSync as readFileSync3 } from "node:fs";
@@ -4860,7 +4890,7 @@ var installMirrorCommands = /* @__PURE__ */ __name((program, context, { call })
4860
4890
  });
4861
4891
  return mirror;
4862
4892
  }, "find");
4863
- const stateOf = /* @__PURE__ */ __name((name, principal) => (mirror) => fileMirrorState(join4(profileDir(env, name), "mirrors"), mirror, principal, ["doc", "sheet"]), "stateOf");
4893
+ const stateOf = /* @__PURE__ */ __name((name, principal) => (mirror) => fileMirrorState(join5(profileDir(env, name), "mirrors"), mirror, principal, ["doc", "sheet"]), "stateOf");
4864
4894
  const syncing = /* @__PURE__ */ __name((name, principal, google) => ({
4865
4895
  target: googleTarget(call, () => google.identity()),
4866
4896
  stateOf: stateOf(name, principal),
@@ -5026,7 +5056,7 @@ var describeCycle = /* @__PURE__ */ __name((cycle) => {
5026
5056
  // dist/download.js
5027
5057
  import { randomUUID } from "node:crypto";
5028
5058
  import { closeSync, createWriteStream, linkSync, lstatSync, mkdirSync as mkdirSync2, openSync, renameSync, rmSync, writeFileSync as writeFileSync2 } from "node:fs";
5029
- import { dirname, join as join5 } from "node:path";
5059
+ import { dirname, join as join6 } from "node:path";
5030
5060
  import { pipeline } from "node:stream/promises";
5031
5061
  var EXPORT_FORMATS = {
5032
5062
  pdf: "application/pdf",
@@ -5051,7 +5081,7 @@ var saveDownload = /* @__PURE__ */ __name(async (path, overwrite, read, createDi
5051
5081
  const source = await read();
5052
5082
  if (createDirectory)
5053
5083
  mkdirSync2(dirname(path), { recursive: true, mode: 448 });
5054
- const temp = join5(dirname(path), `.${randomUUID()}.tmp`);
5084
+ const temp = join6(dirname(path), `.${randomUUID()}.tmp`);
5055
5085
  let created = false;
5056
5086
  let size2 = 0;
5057
5087
  try {
@@ -22722,7 +22752,7 @@ var installSessionCommands = /* @__PURE__ */ __name((program, context) => {
22722
22752
  const app = application(env, { file: args.clientFile, clientId: args.clientId, profile: selected() });
22723
22753
  if (!app.clientSecret)
22724
22754
  streams.diagnostic("your Google app has no secret here, and Google refuses a Desktop app without one: set DRIVE_GOOGLE_CLIENT_SECRET\n");
22725
- const { login } = await import("./login-BD2TS4GY.js");
22755
+ const { login } = await import("./login-COFZ2IWP.js");
22726
22756
  output(itemOf(await login({
22727
22757
  env,
22728
22758
  profile: selected(),
@@ -22753,7 +22783,7 @@ var installSessionCommands = /* @__PURE__ */ __name((program, context) => {
22753
22783
  const name = selected();
22754
22784
  const config = readConfig(env);
22755
22785
  const profile = activeProfile(env, name);
22756
- const { credentials } = await import("./tokens-HIG36RNS.js");
22786
+ const { credentials } = await import("./tokens-H2EJKGA5.js");
22757
22787
  const store = credentials(env, profile.storage, options.keyring);
22758
22788
  store.remove(name);
22759
22789
  writeConfig(env, config);
@@ -22800,7 +22830,7 @@ var selection = /* @__PURE__ */ __name((env, name, source) => {
22800
22830
  return { profile, state, options: { source, destination, collection: `google-drive:${profile.principal}`, env } };
22801
22831
  }, "selection");
22802
22832
  var checkStoreImport = /* @__PURE__ */ __name(async (env, name, source, bindings) => {
22803
- const { ensureSqlite } = await import("./sqlite-runtime-DLK4SU33.js");
22833
+ const { ensureSqlite } = await import("./sqlite-runtime-7YF6REKS.js");
22804
22834
  await ensureSqlite();
22805
22835
  const { state, options } = selection(env, name, source);
22806
22836
  const preview = await previewDocumentTransfer({ ...options, bindings });
@@ -22861,7 +22891,7 @@ var installStoreCommands = /* @__PURE__ */ __name((program, context) => {
22861
22891
 
22862
22892
  // dist/commands/sync.js
22863
22893
  import { existsSync } from "node:fs";
22864
- import { join as join6, resolve as resolve4 } from "node:path";
22894
+ import { join as join7, resolve as resolve4 } from "node:path";
22865
22895
 
22866
22896
  // dist/sync.js
22867
22897
  import { resolve as resolve3 } from "node:path";
@@ -22953,7 +22983,7 @@ var installSyncCommands = /* @__PURE__ */ __name((program, context) => {
22953
22983
  const name = selected();
22954
22984
  const profile = activeProfile(env, name);
22955
22985
  const state = readState(env, name, profile.principal);
22956
- const legacyStore = join6(paths(env).state, "drive.db");
22986
+ const legacyStore = join7(paths(env).state, "drive.db");
22957
22987
  output(itemOf({
22958
22988
  profile: name,
22959
22989
  store: {
@@ -22972,9 +23002,9 @@ var installSyncCommands = /* @__PURE__ */ __name((program, context) => {
22972
23002
  }, "installSyncCommands");
22973
23003
 
22974
23004
  // dist/commands/upgrade.js
22975
- import { join as join7 } from "node:path";
23005
+ import { join as join8 } from "node:path";
22976
23006
 
22977
- // node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4b96f151b4ca40121094ad166c695991/node_modules/@wirecat/cli-core/dist/update/index.js
23007
+ // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_e0755e4bb52a6ea6d9033617574418d1/node_modules/@wirecat/cli-core/dist/update/index.js
22978
23008
  import { realpathSync } from "node:fs";
22979
23009
  import { fileURLToPath } from "node:url";
22980
23010
  var QUIET_WORDS = [
@@ -23044,7 +23074,7 @@ var update = appUpdate({
23044
23074
  command: "drive",
23045
23075
  version: DRIVE_APP.version,
23046
23076
  entry: new URL("../commands/upgrade.js", import.meta.url).href,
23047
- statePath: /* @__PURE__ */ __name((env) => join7(paths(env).state, "update-check.json"), "statePath"),
23077
+ statePath: /* @__PURE__ */ __name((env) => join8(paths(env).state, "update-check.json"), "statePath"),
23048
23078
  enabled: /* @__PURE__ */ __name(() => false, "enabled"),
23049
23079
  offVariables: ["DRIVE_NO_UPDATE_CHECK"]
23050
23080
  });
@@ -23300,7 +23330,7 @@ var saveContributors = /* @__PURE__ */ __name(async (store, principal, metadata,
23300
23330
 
23301
23331
  // dist/store-transition.js
23302
23332
  import { existsSync as existsSync2 } from "node:fs";
23303
- import { join as join8, resolve as resolve5 } from "node:path";
23333
+ import { join as join9, resolve as resolve5 } from "node:path";
23304
23334
  var prepareStore = /* @__PURE__ */ __name(async (index, env, name, rescan = false) => {
23305
23335
  const profile = activeProfile(env, name);
23306
23336
  const target = resolve5(storePath(env));
@@ -23312,7 +23342,7 @@ var prepareStore = /* @__PURE__ */ __name(async (index, env, name, rescan = fals
23312
23342
  const lock = await lockProfile(env, name);
23313
23343
  try {
23314
23344
  const state = readState(env, name, profile.principal);
23315
- const previous = resolve5(state.store ?? join8(paths(env).state, "drive.db"));
23345
+ const previous = resolve5(state.store ?? join9(paths(env).state, "drive.db"));
23316
23346
  if (previous !== target && existsSync2(previous)) {
23317
23347
  const old = await openStore({ path: previous, env, command: "drive", version: VERSION });
23318
23348
  try {
@@ -23393,9 +23423,9 @@ var DRIVE_PROVIDER = {
23393
23423
  var openIndex = /* @__PURE__ */ __name(async (env, name, rescan = false) => {
23394
23424
  if (name)
23395
23425
  activeProfile(env, name);
23396
- const { ensureSqlite } = await import("./sqlite-runtime-DLK4SU33.js");
23426
+ const { ensureSqlite } = await import("./sqlite-runtime-7YF6REKS.js");
23397
23427
  await ensureSqlite();
23398
- const { openStore: openStore2, storePath: storePath2 } = await import("./store-4OFK7PKQ.js");
23428
+ const { openStore: openStore2, storePath: storePath2 } = await import("./store-F5FJGWMR.js");
23399
23429
  if (env.DRIVE_STORE)
23400
23430
  throw new CliError("configuration_error", "DRIVE_STORE has been retired; use MESSAGING_STORE to select the shared database", { reason: "store.override-retired" });
23401
23431
  const store = await openStore2({ path: storePath2(env), env, command: "drive", version: VERSION });
@@ -23440,7 +23470,7 @@ var indexOver = /* @__PURE__ */ __name((store, env, pictureEmbedder) => {
23440
23470
  linkMessages: /* @__PURE__ */ __name((documents, since) => store.notes.linkMessages({ documents, ...since ? { since } : {} }), "linkMessages"),
23441
23471
  knowledge: documentKnowledge2(store, async (principal) => (await folder(principal, false))?.id),
23442
23472
  openPictures: /* @__PURE__ */ __name(async () => {
23443
- const { openPictureEmbedderFor, savePicture } = await import("./services-YAFTELBI.js");
23473
+ const { openPictureEmbedderFor, savePicture } = await import("./services-F5A6XQCV.js");
23444
23474
  const embedder = pictureEmbedder ?? await openPictureEmbedderFor({ env, command: "drive" });
23445
23475
  return {
23446
23476
  save: /* @__PURE__ */ __name((reference, bytes) => savePicture(store, { ref: reference }, bytes, { embedder }), "save"),
@@ -23459,7 +23489,7 @@ var indexOver = /* @__PURE__ */ __name((store, env, pictureEmbedder) => {
23459
23489
  has_more: false,
23460
23490
  meaning_skipped: "this Google account has no imported sources"
23461
23491
  };
23462
- const { searchNotes } = await import("./services-YAFTELBI.js");
23492
+ const { searchNotes } = await import("./services-F5A6XQCV.js");
23463
23493
  const result = await searchNotes(store, query, {
23464
23494
  ...options,
23465
23495
  folderIds: selected ? [selected.id] : [],
@@ -23490,7 +23520,7 @@ var indexOver = /* @__PURE__ */ __name((store, env, pictureEmbedder) => {
23490
23520
  };
23491
23521
  }, "search"),
23492
23522
  embed: /* @__PURE__ */ __name(async (max) => {
23493
- const { embedNotes } = await import("./services-YAFTELBI.js");
23523
+ const { embedNotes } = await import("./services-F5A6XQCV.js");
23494
23524
  return embedNotes(store, { maxChunks: max, env, command: "drive" });
23495
23525
  }, "embed"),
23496
23526
  close: /* @__PURE__ */ __name(() => store.close(), "close")
@@ -23501,7 +23531,7 @@ var indexOver = /* @__PURE__ */ __name((store, env, pictureEmbedder) => {
23501
23531
  import { createHash as createHash2 } from "node:crypto";
23502
23532
  import { createReadStream, mkdirSync as mkdirSync3, readFileSync as readFileSync5, rmSync as rmSync2, statSync as statSync3, writeFileSync as writeFileSync3 } from "node:fs";
23503
23533
  import { open } from "node:fs/promises";
23504
- import { basename, join as join9, resolve as resolve6 } from "node:path";
23534
+ import { basename, join as join10, resolve as resolve6 } from "node:path";
23505
23535
  var START = "https://www.googleapis.com/upload/drive/v3/files";
23506
23536
  var FIELDS = "id,name,size,md5Checksum,mimeType,parents";
23507
23537
  var QUANTUM = 256 * 1024;
@@ -23532,7 +23562,7 @@ var uploadFile = /* @__PURE__ */ __name(async (input) => {
23532
23562
  throw new CliError("validation_error", "a chunk must be a multiple of 256 KiB");
23533
23563
  const sleep = input.sleep ?? ((ms) => new Promise((wake) => setTimeout(wake, ms)));
23534
23564
  const key = createHash2("sha256").update(JSON.stringify([path, size2, stat.mtimeMs, name, input.parent ?? ""])).digest("hex").slice(0, 24);
23535
- const checkpointPath = join9(input.stateDir, "uploads", `${key}.json`);
23565
+ const checkpointPath = join10(input.stateDir, "uploads", `${key}.json`);
23536
23566
  const readCheckpoint = /* @__PURE__ */ __name(() => {
23537
23567
  try {
23538
23568
  return JSON.parse(readFileSync5(checkpointPath, "utf8"));
@@ -23541,7 +23571,7 @@ var uploadFile = /* @__PURE__ */ __name(async (input) => {
23541
23571
  }
23542
23572
  }, "readCheckpoint");
23543
23573
  const saveCheckpoint = /* @__PURE__ */ __name((sessionUri) => {
23544
- mkdirSync3(join9(input.stateDir, "uploads"), { recursive: true, mode: 448 });
23574
+ mkdirSync3(join10(input.stateDir, "uploads"), { recursive: true, mode: 448 });
23545
23575
  const checkpoint = {
23546
23576
  session_uri: sessionUri,
23547
23577
  path,
@@ -23777,7 +23807,7 @@ var installDrive = /* @__PURE__ */ __name((program) => {
23777
23807
  }, "output");
23778
23808
  const signal = /* @__PURE__ */ __name(() => environment().signal, "signal");
23779
23809
  const signedIn = /* @__PURE__ */ __name(async (name, scope2) => {
23780
- const { authorizedClient, checkAuthorization } = await import("./tokens-HIG36RNS.js");
23810
+ const { authorizedClient, checkAuthorization } = await import("./tokens-H2EJKGA5.js");
23781
23811
  const client = authorizedClient(env, name, environment().keyring, signal());
23782
23812
  await checkAuthorization(client, scope2);
23783
23813
  return client;
@@ -23787,7 +23817,7 @@ var installDrive = /* @__PURE__ */ __name((program) => {
23787
23817
  const fake = environment().source;
23788
23818
  if (fake)
23789
23819
  return fake(name);
23790
- const [{ googleSource }, client] = await Promise.all([import("./google-KLZSUAVY.js"), signedIn(name)]);
23820
+ const [{ googleSource }, client] = await Promise.all([import("./google-DVADVICN.js"), signedIn(name)]);
23791
23821
  return googleSource(client);
23792
23822
  }, "source");
23793
23823
  const withIndex = /* @__PURE__ */ __name(async (fn) => {
@@ -23853,6 +23883,7 @@ var installDrive = /* @__PURE__ */ __name((program) => {
23853
23883
  runsOf.set(program, runs);
23854
23884
  const imported = importedDocument(context);
23855
23885
  installSessionCommands(program, context);
23886
+ installAccountCommands(program, context);
23856
23887
  installFolderCommands(program, context, (method, params) => remote.call(method, params));
23857
23888
  installSyncCommands(program, context);
23858
23889
  installStoreCommands(program, context);
@@ -23929,7 +23960,7 @@ var installDrive = /* @__PURE__ */ __name((program) => {
23929
23960
  if (fake)
23930
23961
  return await fake.call(method, params, body);
23931
23962
  const [{ googleApi }, client] = await Promise.all([
23932
- import("./google-api-HZQ5R4ZO.js"),
23963
+ import("./google-api-QMFGCXBM.js"),
23933
23964
  signedIn(selected(), descriptor.scope)
23934
23965
  ]);
23935
23966
  return await googleApi(client).call(method, params, body);
@@ -23955,7 +23986,7 @@ var installDrive = /* @__PURE__ */ __name((program) => {
23955
23986
  if (fake)
23956
23987
  return fake(id, mime);
23957
23988
  const [{ googleDownload }, client] = await Promise.all([
23958
- import("./google-api-HZQ5R4ZO.js"),
23989
+ import("./google-api-QMFGCXBM.js"),
23959
23990
  signedIn(selected(), apiMethod(method).scope)
23960
23991
  ]);
23961
23992
  return googleDownload(client)(id, mime);
@@ -23973,7 +24004,7 @@ var installDrive = /* @__PURE__ */ __name((program) => {
23973
24004
  let request = environment().uploadRequest;
23974
24005
  if (!request) {
23975
24006
  const [{ googleUploadRequest }, client] = await Promise.all([
23976
- import("./google-api-HZQ5R4ZO.js"),
24007
+ import("./google-api-QMFGCXBM.js"),
23977
24008
  signedIn(selected(), apiMethod(method).scope)
23978
24009
  ]);
23979
24010
  request = googleUploadRequest(client);
@@ -24078,9 +24109,9 @@ Availability: unavailable \u2014 ${availability.reason}
24078
24109
  const name = action.opts().output;
24079
24110
  if (typeof name !== "string" || !/^[A-Za-z0-9][A-Za-z0-9._-]{0,199}$/.test(name))
24080
24111
  throw new CliError("validation_error", "MCP exports take a filename inside the profile export folder");
24081
- const directory = join10(paths(env).cache, "exports", selected());
24112
+ const directory = join11(paths(env).cache, "exports", selected());
24082
24113
  mkdirSync4(directory, { recursive: true, mode: 448 });
24083
- action.setOptionValue("output", join10(directory, name));
24114
+ action.setOptionValue("output", join11(directory, name));
24084
24115
  }
24085
24116
  if (agent() && changesAuthority(action)) {
24086
24117
  const authority = policySettings(env, selected(), policyFlags());
@@ -24177,7 +24208,7 @@ var mcpCommand = /* @__PURE__ */ __name(() => {
24177
24208
  const environment = environmentOf(action);
24178
24209
  if (environment.api)
24179
24210
  return;
24180
- const { grantAvailability } = await import("./grants-L7XLHLUT.js");
24211
+ const { grantAvailability } = await import("./grants-WKB2E4TA.js");
24181
24212
  availability = grantAvailability(rootOf(root), environment.env ?? process.env, environment.keyring);
24182
24213
  });
24183
24214
  }, "mcpCommand");