@wirecat/drive-cli 0.61.0 → 0.62.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.
- package/dist/bin/drive.js +2 -2
- package/dist/browse.d.ts +20 -0
- package/dist/browse.d.ts.map +1 -0
- package/dist/browse.js +146 -0
- package/dist/browse.js.map +1 -0
- package/dist/bundle/{all-profiles-H4L3Z5UM.js → all-profiles-CKD2DWUK.js} +14 -14
- package/dist/bundle/{anthropic-PPGFISVP.js → anthropic-E3T4USLA.js} +9 -9
- package/dist/bundle/{app-server-YXVK2FUZ.js → app-server-JB2AEWWL.js} +58 -55
- package/dist/bundle/{bun-DKZAL6ML.js → bun-CC44AAND.js} +2 -2
- package/dist/bundle/{bun-sqlite-MTZY36QK.js → bun-sqlite-AUMFKYVR.js} +8 -8
- package/dist/bundle/{chunk-KV4267S4.js → chunk-27YUUGXQ.js} +1 -1
- package/dist/bundle/{chunk-6IBM4Z3V.js → chunk-2HF2MRXI.js} +1 -1
- package/dist/bundle/{chunk-3I2D5TK2.js → chunk-2KN35F32.js} +10 -10
- package/dist/bundle/{chunk-WZ5XK74U.js → chunk-4OSSOWDM.js} +1 -1
- package/dist/bundle/{chunk-UO2IUDVK.js → chunk-4SIZEJ3M.js} +2 -2
- package/dist/bundle/{chunk-6Y2FWJZ4.js → chunk-67ZQCWBV.js} +3 -3
- package/dist/bundle/{chunk-OFFA54TW.js → chunk-6EY46GAN.js} +2 -2
- package/dist/bundle/{chunk-ECEYAQGN.js → chunk-7W5HYGVW.js} +4 -2
- package/dist/bundle/{chunk-67HS46KM.js → chunk-7ZXIWZQ6.js} +12 -12
- package/dist/bundle/{chunk-J5UDQD5S.js → chunk-AH5C3D3D.js} +5 -5
- package/dist/bundle/{chunk-BCWUDTYQ.js → chunk-AQVUEZEP.js} +2 -2
- package/dist/bundle/{chunk-K7LS3NGM.js → chunk-CJHY5YIF.js} +494 -227
- package/dist/bundle/{chunk-PY7LKNOS.js → chunk-CZ2GJHLL.js} +2 -2
- package/dist/bundle/{chunk-NIX2MWHZ.js → chunk-DJOAMGF4.js} +39 -25
- package/dist/bundle/{chunk-AWN22PJK.js → chunk-DRZZBN3V.js} +3 -3
- package/dist/bundle/{chunk-DEPMQHXQ.js → chunk-DWJHL6DV.js} +4 -4
- package/dist/bundle/{chunk-QSGT4ZH4.js → chunk-E43ENLJJ.js} +1 -1
- package/dist/bundle/{chunk-NZ2EIZLX.js → chunk-EOOGWUTP.js} +10 -10
- package/dist/bundle/{chunk-5W56YMQS.js → chunk-EW7PKB4M.js} +58 -49
- package/dist/bundle/{chunk-VYXVPYA3.js → chunk-FEZF3TII.js} +6 -6
- package/dist/bundle/{chunk-I26VL4W7.js → chunk-FNWIJ6EJ.js} +2 -2
- package/dist/bundle/{chunk-OLPJRD4S.js → chunk-FUITWY7O.js} +1 -1
- package/dist/bundle/{chunk-XZBR2O63.js → chunk-HCNQT3QE.js} +1439 -770
- package/dist/bundle/{chunk-Q4XVBKX4.js → chunk-HG6CAYJH.js} +3 -3
- package/dist/bundle/{chunk-O5CUFS7T.js → chunk-IR4SQLBR.js} +2 -2
- package/dist/bundle/{chunk-VPDAH7PJ.js → chunk-JK3U25QZ.js} +1 -1
- package/dist/bundle/{chunk-UKOYQC5O.js → chunk-JN5TVEEL.js} +94 -26
- package/dist/bundle/{chunk-5W7D5H2R.js → chunk-KLFSRKHB.js} +1 -1
- package/dist/bundle/{chunk-RFRCOAWS.js → chunk-L7K2MOIC.js} +22 -22
- package/dist/bundle/{chunk-XYCCGGKN.js → chunk-LQKD257P.js} +582 -424
- package/dist/bundle/{chunk-73WSULMI.js → chunk-LWE4JGRN.js} +2 -2
- package/dist/bundle/{chunk-XGMDWIUP.js → chunk-MN4VXU3M.js} +4 -4
- package/dist/bundle/{chunk-N2RLJTIW.js → chunk-N7OZPKU7.js} +4 -4
- package/dist/bundle/{chunk-OGNOQDWB.js → chunk-O2XOX4HB.js} +34 -10
- package/dist/bundle/{chunk-3SJQNS72.js → chunk-O7ALBI2I.js} +5 -5
- package/dist/bundle/{chunk-3WZH3WV3.js → chunk-OBH5BA62.js} +3 -3
- package/dist/bundle/{chunk-DCBFNBEB.js → chunk-OD4U7GUY.js} +20 -20
- package/dist/bundle/{chunk-PJTX2MOI.js → chunk-ONP2IBHY.js} +26 -26
- package/dist/bundle/{chunk-BXR7BKM3.js → chunk-OTROVC4E.js} +1 -1
- package/dist/bundle/{chunk-JVBLXSAA.js → chunk-PEQA6LA5.js} +617 -243
- package/dist/bundle/{chunk-XLFJLZJL.js → chunk-Q2LRPOKL.js} +22 -14
- package/dist/bundle/{chunk-E5EXJ2XS.js → chunk-QCKZ3GAA.js} +4 -4
- package/dist/bundle/{chunk-BQMIDYBA.js → chunk-QCX6XZLA.js} +12 -12
- package/dist/bundle/{chunk-TKGAYKXW.js → chunk-QH7DOVO3.js} +204 -58
- package/dist/bundle/{chunk-YMBFZA3H.js → chunk-QTI6IVHZ.js} +8 -8
- package/dist/bundle/{chunk-YWIU4HOT.js → chunk-R347FPYU.js} +1 -1
- package/dist/bundle/chunk-RIDQNVZM.js +64 -0
- package/dist/bundle/{chunk-AM4RIWOZ.js → chunk-RPMKG63Z.js} +18 -4
- package/dist/bundle/{chunk-EPCJUL6M.js → chunk-RWSXVCSG.js} +3 -3
- package/dist/bundle/{chunk-36CWGEVX.js → chunk-SVPCHFKI.js} +2 -2
- package/dist/bundle/{chunk-ZHYRHERD.js → chunk-SW4I5BR7.js} +2 -2
- package/dist/bundle/{chunk-FE5JJXKA.js → chunk-T5NWWXS2.js} +2 -2
- package/dist/bundle/{chunk-E6J5YH2N.js → chunk-T7X53FCJ.js} +34 -34
- package/dist/bundle/{chunk-X2CXW4HM.js → chunk-TDX4GZFO.js} +7 -7
- package/dist/bundle/{chunk-3UPIJ7DW.js → chunk-U2BFYSQV.js} +14158 -2039
- package/dist/bundle/{chunk-HFM653T3.js → chunk-UGXN5D7U.js} +719 -128
- package/dist/bundle/{chunk-WUP2MJDN.js → chunk-UOXOLGNG.js} +2 -2
- package/dist/bundle/{chunk-J4HQVHMN.js → chunk-UQLWMGSD.js} +5 -5
- package/dist/bundle/{chunk-6DN4VPA7.js → chunk-VAYB52HF.js} +33 -31
- package/dist/bundle/{chunk-BF6TQMNB.js → chunk-VQDD64A4.js} +8 -8
- package/dist/bundle/{chunk-ZMNYK3FC.js → chunk-W4RTIL7S.js} +5 -5
- package/dist/bundle/{chunk-HGOYQUT7.js → chunk-WZKEU7WR.js} +4 -2
- package/dist/bundle/{chunk-QR5VQXQ5.js → chunk-XEW2EN6F.js} +51 -37
- package/dist/bundle/{chunk-DXPOVLQC.js → chunk-XFRRKZHQ.js} +223 -89
- package/dist/bundle/{chunk-XGNC5OJG.js → chunk-XS5POQST.js} +1 -1
- package/dist/bundle/{chunk-LARQTWIL.js → chunk-XZUS7XRO.js} +1 -1
- package/dist/bundle/{chunk-6SUGANRJ.js → chunk-YALI4C7C.js} +6 -6
- package/dist/bundle/{chunk-WIU733D2.js → chunk-YMWENGKH.js} +1 -1
- package/dist/bundle/{chunk-CACYL36O.js → chunk-YOJDGAPT.js} +8 -8
- package/dist/bundle/{chunk-S4YK6TTG.js → chunk-YPFUYQDP.js} +13 -13
- package/dist/bundle/{chunk-3252WXOL.js → chunk-YUWPNG7B.js} +1 -1
- package/dist/bundle/{chunk-2RJA4BQB.js → chunk-YXYTY4GF.js} +39 -26
- package/dist/bundle/{chunk-YPF6OS37.js → chunk-ZMOUUOT2.js} +1 -1
- package/dist/bundle/command-contract-OB5BRABN.js +39 -0
- package/dist/bundle/{decode-62A3HGPW.js → decode-WIIX3Y2X.js} +8 -8
- package/dist/bundle/{dispatch-IE7PBEQC.js → dispatch-GEFIXA6X.js} +9 -9
- package/dist/bundle/drive.js +11 -11
- package/dist/bundle/{echarts-BGBPRGR5.js → echarts-OYINM4C4.js} +2 -2
- package/dist/bundle/{embed-J3IBVV2V.js → embed-DWZIYMBX.js} +9 -9
- package/dist/bundle/{embedder-QFPMDRT2.js → embedder-ILWH7ZRM.js} +12 -12
- package/dist/bundle/entry-V5V3TOTY.js +22 -0
- package/dist/bundle/{failure-BKOGBMIC.js → failure-GV77W3CD.js} +4 -4
- package/dist/bundle/first-run-V3VVLQF4.js +30 -0
- package/dist/bundle/first-screen-Y3RIN7FU.js +37 -0
- package/dist/bundle/{google-RXM2XEPD.js → google-KLZSUAVY.js} +13 -13
- package/dist/bundle/{google-api-NC65BZO4.js → google-api-HZQ5R4ZO.js} +57 -57
- package/dist/bundle/grants-L7XLHLUT.js +105 -0
- package/dist/bundle/{identity-PI6F2GWA.js → identity-J2DON4IO.js} +6 -6
- package/dist/bundle/{instructions-6LPDSKAD.js → instructions-HGOJ23AJ.js} +1 -1
- package/dist/bundle/{login-HTY7GT2S.js → login-BD2TS4GY.js} +63 -63
- package/dist/bundle/{mcp-PPVOM4SE.js → mcp-GWDA3HOA.js} +2 -2
- package/dist/bundle/{node-IB246NCQ.js → node-CPKTDPH7.js} +2 -2
- package/dist/bundle/{node-sqlite-G2Y5SFJM.js → node-sqlite-IXDCRLSX.js} +9 -9
- package/dist/bundle/oauth-HOGY4YBB.js +22 -0
- package/dist/bundle/{open-WD4GFSJD.js → open-O7P3ZV3Y.js} +8 -8
- package/dist/bundle/{openai-QVM4PMY7.js → openai-RCFQKCXC.js} +17 -17
- package/dist/bundle/{process-SWPJGPQC.js → process-KXDRJO22.js} +1 -1
- package/dist/bundle/{program-WHYFAMXR.js → program-UCHFC7JQ.js} +228 -85
- package/dist/bundle/prompt-EVPPBN5W.js +17 -0
- package/dist/bundle/{reasons-Q34DQWB6.js → reasons-57J2D77K.js} +5 -5
- package/dist/bundle/{recognize-DM3YWHSE.js → recognize-MRCYGP2J.js} +7 -7
- package/dist/bundle/{remote-KXVWRK7J.js → remote-L3L4PHKF.js} +10 -10
- package/dist/bundle/{rerank-TINXM3MY.js → rerank-PSOE6XFT.js} +10 -10
- package/dist/bundle/{serve-IY2WL656.js → serve-72OGS3BF.js} +12 -12
- package/dist/bundle/server-C5TGNFXW.js +70 -0
- package/dist/bundle/{server-VPY3OWPC.js → server-SCXKYHBO.js} +44 -44
- package/dist/bundle/{services-PXNBOCOC.js → services-YAFTELBI.js} +42 -32
- package/dist/bundle/{sqlite-runtime-5ZK2CV7Y.js → sqlite-runtime-DLK4SU33.js} +9 -9
- package/dist/bundle/{start-LDVCN3DK.js → start-AFFA3LKM.js} +9 -7
- package/dist/bundle/{state-3MKTT3VS.js → state-T5VNAJSZ.js} +9 -9
- package/dist/bundle/{store-7M4MSUJV.js → store-4OFK7PKQ.js} +48 -28
- package/dist/bundle/{store-4VQOT5IJ.js → store-R6MSY2IM.js} +20 -18
- package/dist/bundle/store-maintenance-command-QDMCXGV6.js +60 -0
- package/dist/bundle/tokens-HIG36RNS.js +103 -0
- package/dist/commands/folders.d.ts +2 -1
- package/dist/commands/folders.d.ts.map +1 -1
- package/dist/commands/folders.js +16 -3
- package/dist/commands/folders.js.map +1 -1
- package/dist/program.js +1 -1
- package/dist/program.js.map +1 -1
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +15 -6
- package/dist/tokens.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/bundle/chunk-W767AUNR.js +0 -132
- package/dist/bundle/command-contract-T3EO5AYD.js +0 -39
- package/dist/bundle/entry-YQSYER66.js +0 -22
- package/dist/bundle/first-run-ZIFPVZAI.js +0 -30
- package/dist/bundle/first-screen-L5U26EY7.js +0 -37
- package/dist/bundle/grants-SEWUYYH3.js +0 -105
- package/dist/bundle/oauth-MWBKBI4T.js +0 -22
- package/dist/bundle/prompt-OVYCGZB7.js +0 -17
- package/dist/bundle/server-EMWVVT2C.js +0 -70
- package/dist/bundle/store-maintenance-command-NRATYBWD.js +0 -60
- package/dist/bundle/tokens-XUKLM3SL.js +0 -103
- /package/dist/bundle/{chunk-LU3WKZBA.js → chunk-ZQ3GWKDQ.js} +0 -0
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
ACCESS_SECONDS,
|
|
9
9
|
REFRESH_SECONDS,
|
|
10
10
|
readStored
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-DWJHL6DV.js";
|
|
12
12
|
import {
|
|
13
13
|
__name
|
|
14
14
|
} from "./chunk-ZVVMGPBJ.js";
|
|
15
15
|
|
|
16
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16
|
+
// 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/mcp/http/oauth.js
|
|
17
17
|
import { createHash, randomBytes, randomInt, timingSafeEqual } from "node:crypto";
|
|
18
18
|
import { chmodSync, mkdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
19
19
|
import { dirname } from "node:path";
|
|
@@ -3,24 +3,27 @@ const require = __bundleRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
activeProfile,
|
|
5
5
|
paths
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QCX6XZLA.js";
|
|
7
7
|
import {
|
|
8
8
|
READ_SCOPE,
|
|
9
9
|
WRITE_SCOPE,
|
|
10
10
|
providerRequest
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-HCNQT3QE.js";
|
|
12
12
|
import {
|
|
13
13
|
googleError
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-OTROVC4E.js";
|
|
15
|
+
import {
|
|
16
|
+
withTimeLimit
|
|
17
|
+
} from "./chunk-LQKD257P.js";
|
|
15
18
|
import {
|
|
16
19
|
acquireLock
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-YPFUYQDP.js";
|
|
18
21
|
import {
|
|
19
22
|
Credentials,
|
|
20
23
|
isMovedRun,
|
|
21
24
|
keyringService,
|
|
22
25
|
systemKeyring
|
|
23
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-OD4U7GUY.js";
|
|
24
27
|
import {
|
|
25
28
|
minLength,
|
|
26
29
|
nullable,
|
|
@@ -30,16 +33,16 @@ import {
|
|
|
30
33
|
pipe,
|
|
31
34
|
safeParse,
|
|
32
35
|
string
|
|
33
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-FEZF3TII.js";
|
|
34
37
|
import {
|
|
35
38
|
CliError,
|
|
36
39
|
isCliError
|
|
37
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-4OSSOWDM.js";
|
|
38
41
|
import {
|
|
39
42
|
__name
|
|
40
43
|
} from "./chunk-ZVVMGPBJ.js";
|
|
41
44
|
|
|
42
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45
|
+
// 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/oauth/authorize.js
|
|
43
46
|
import { createHash, randomBytes } from "node:crypto";
|
|
44
47
|
import { createServer } from "node:http";
|
|
45
48
|
var DEFAULT_TIMEOUT_MS = 3e5;
|
|
@@ -175,12 +178,12 @@ var authorize = /* @__PURE__ */ __name(async (options) => {
|
|
|
175
178
|
}
|
|
176
179
|
}, "authorize");
|
|
177
180
|
|
|
178
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
181
|
+
// 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/oauth/keeper.js
|
|
179
182
|
import { createHash as createHash2 } from "node:crypto";
|
|
180
183
|
import { join } from "node:path";
|
|
181
184
|
import { setTimeout as delay } from "node:timers/promises";
|
|
182
185
|
|
|
183
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
186
|
+
// 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/oauth/requests.js
|
|
184
187
|
var REQUEST_LIMIT_MS = 3e4;
|
|
185
188
|
var TOKEN_LOG_EVENT = "oauth.token";
|
|
186
189
|
var object2 = /* @__PURE__ */ __name((value) => {
|
|
@@ -188,20 +191,20 @@ var object2 = /* @__PURE__ */ __name((value) => {
|
|
|
188
191
|
throw new Error("not an object");
|
|
189
192
|
return value;
|
|
190
193
|
}, "object");
|
|
191
|
-
var requestSignal = /* @__PURE__ */ __name((signal) => signal ? AbortSignal.any([signal,
|
|
194
|
+
var requestSignal = /* @__PURE__ */ __name((deadline, signal) => signal ? AbortSignal.any([signal, deadline]) : deadline, "requestSignal");
|
|
192
195
|
var cancelledBy = /* @__PURE__ */ __name((signal) => {
|
|
193
196
|
if (!signal?.aborted)
|
|
194
197
|
return;
|
|
195
198
|
throw isCliError(signal.reason) ? signal.reason : new CliError("cancelled", "sign-in was cancelled");
|
|
196
199
|
}, "cancelledBy");
|
|
197
|
-
var post = /* @__PURE__ */ __name(async (url, body, context) => {
|
|
200
|
+
var post = /* @__PURE__ */ __name(async (url, body, context, deadline) => {
|
|
198
201
|
cancelledBy(context.signal);
|
|
199
202
|
try {
|
|
200
203
|
return await context.fetch(url, {
|
|
201
204
|
method: "POST",
|
|
202
205
|
headers: { "content-type": "application/x-www-form-urlencoded", accept: "application/json" },
|
|
203
206
|
body,
|
|
204
|
-
signal: requestSignal(context.signal),
|
|
207
|
+
signal: requestSignal(deadline, context.signal),
|
|
205
208
|
redirect: "error"
|
|
206
209
|
});
|
|
207
210
|
} catch {
|
|
@@ -213,11 +216,12 @@ var clientFields = /* @__PURE__ */ __name(({ client }) => ({
|
|
|
213
216
|
client_id: client.clientId,
|
|
214
217
|
...client.clientSecret ? { client_secret: client.clientSecret } : {}
|
|
215
218
|
}), "clientFields");
|
|
216
|
-
var requestTokens = /* @__PURE__ */ __name(
|
|
219
|
+
var requestTokens = /* @__PURE__ */ __name((provider, params, context) => withTimeLimit(REQUEST_LIMIT_MS, (deadline) => exchangeTokens(provider, params, context, deadline)), "requestTokens");
|
|
220
|
+
var exchangeTokens = /* @__PURE__ */ __name(async (provider, params, context, deadline) => {
|
|
217
221
|
const operation = params.grant_type ?? "unknown";
|
|
218
222
|
const record = /* @__PURE__ */ __name((level, fields) => context.log?.[level]({ event: TOKEN_LOG_EVENT, provider: provider.id, operation, pid: process.pid, ...fields }), "record");
|
|
219
223
|
const again = `run ${context.signInCommand} again`;
|
|
220
|
-
const response = await post(provider.tokenUrl, new URLSearchParams({ ...params, ...clientFields(context) }), context);
|
|
224
|
+
const response = await post(provider.tokenUrl, new URLSearchParams({ ...params, ...clientFields(context) }), context, deadline);
|
|
221
225
|
if (!response) {
|
|
222
226
|
record("warn", { outcome: "no_response" });
|
|
223
227
|
throw new CliError("outcome_unknown", `${provider.name} token request did not finish; ${again} if it keeps failing`, {
|
|
@@ -275,13 +279,15 @@ var requestTokens = /* @__PURE__ */ __name(async (provider, params, context) =>
|
|
|
275
279
|
scopes,
|
|
276
280
|
...tokenType ? { tokenType } : {}
|
|
277
281
|
};
|
|
278
|
-
}, "
|
|
282
|
+
}, "exchangeTokens");
|
|
279
283
|
var revokeToken = /* @__PURE__ */ __name(async (provider, tokens, context) => {
|
|
280
284
|
if (provider.revoke)
|
|
281
285
|
return provider.revoke(tokens, context);
|
|
282
286
|
if (!provider.revokeUrl)
|
|
283
287
|
throw new CliError("validation_error", `${provider.name} declares no way to revoke a sign-in`);
|
|
284
|
-
const
|
|
288
|
+
const { revokeUrl } = provider;
|
|
289
|
+
const form = new URLSearchParams({ token: tokens.refreshToken, ...clientFields(context) });
|
|
290
|
+
const response = await withTimeLimit(REQUEST_LIMIT_MS, (deadline) => post(revokeUrl, form, context, deadline));
|
|
285
291
|
context.log?.[response?.ok ? "info" : "warn"]({
|
|
286
292
|
event: TOKEN_LOG_EVENT,
|
|
287
293
|
provider: provider.id,
|
|
@@ -297,7 +303,7 @@ var revokeToken = /* @__PURE__ */ __name(async (provider, tokens, context) => {
|
|
|
297
303
|
});
|
|
298
304
|
}, "revokeToken");
|
|
299
305
|
|
|
300
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
306
|
+
// 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/oauth/keeper.js
|
|
301
307
|
var inFlight = /* @__PURE__ */ new Map();
|
|
302
308
|
var refreshedInMemory = /* @__PURE__ */ new Map();
|
|
303
309
|
var tokenKeeper = /* @__PURE__ */ __name((options) => {
|
|
@@ -459,7 +465,7 @@ var tokenKeeper = /* @__PURE__ */ __name((options) => {
|
|
|
459
465
|
};
|
|
460
466
|
}, "tokenKeeper");
|
|
461
467
|
|
|
462
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
468
|
+
// 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/oauth/storage.js
|
|
463
469
|
var invalid = /* @__PURE__ */ __name(() => new CliError("authentication_error", "the saved sign-in cannot be read; sign in again", { reason: "oauth.invalid" }), "invalid");
|
|
464
470
|
var parse = /* @__PURE__ */ __name((raw) => {
|
|
465
471
|
let value;
|
|
@@ -655,16 +661,24 @@ var sessionKeeper = /* @__PURE__ */ __name((options) => tokenKeeper({
|
|
|
655
661
|
}), "sessionKeeper");
|
|
656
662
|
var authorizedClient = /* @__PURE__ */ __name((env, name, keyring, signal) => {
|
|
657
663
|
const profile = activeProfile(env, name);
|
|
664
|
+
const unreadable = /* @__PURE__ */ __name(() => new CliError("authentication_error", `could not load Google sign-in \u2014 run drive ${name} session start again`, {
|
|
665
|
+
reason: "oauth.expired"
|
|
666
|
+
}), "unreadable");
|
|
667
|
+
let secret;
|
|
668
|
+
try {
|
|
669
|
+
secret = credentials(env, profile.storage, keyring).read(name)?.secret;
|
|
670
|
+
} catch {
|
|
671
|
+
throw unreadable();
|
|
672
|
+
}
|
|
673
|
+
if (!secret)
|
|
674
|
+
throw new CliError("authentication_error", `this profile has no saved Google sign-in \u2014 run drive ${name} session start`, {
|
|
675
|
+
reason: "oauth.missing"
|
|
676
|
+
});
|
|
658
677
|
let parsed;
|
|
659
678
|
try {
|
|
660
|
-
const secret = credentials(env, profile.storage, keyring).read(name)?.secret;
|
|
661
|
-
if (!secret)
|
|
662
|
-
throw new Error("missing login");
|
|
663
679
|
parsed = safeParse(Session, JSON.parse(secret));
|
|
664
680
|
} catch {
|
|
665
|
-
throw
|
|
666
|
-
reason: "oauth.expired"
|
|
667
|
-
});
|
|
681
|
+
throw unreadable();
|
|
668
682
|
}
|
|
669
683
|
if (!parsed.success || parsed.output.principal !== profile.principal)
|
|
670
684
|
throw new CliError("authentication_error", "saved sign-in is invalid or belongs to another account", {
|
|
@@ -9,15 +9,15 @@ import {
|
|
|
9
9
|
optional,
|
|
10
10
|
pipe,
|
|
11
11
|
safeParse
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FEZF3TII.js";
|
|
13
13
|
import {
|
|
14
14
|
CliError
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-4OSSOWDM.js";
|
|
16
16
|
import {
|
|
17
17
|
__name
|
|
18
18
|
} from "./chunk-ZVVMGPBJ.js";
|
|
19
19
|
|
|
20
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20
|
+
// 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/models/options.js
|
|
21
21
|
var checkedOptions = /* @__PURE__ */ __name((provider, schema, options) => {
|
|
22
22
|
const parsed = safeParse(schema, options);
|
|
23
23
|
if (!parsed.success) {
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
readLock,
|
|
6
6
|
releaseLock,
|
|
7
7
|
takeLock
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-HG6CAYJH.js";
|
|
9
9
|
import {
|
|
10
10
|
__name
|
|
11
11
|
} from "./chunk-ZVVMGPBJ.js";
|
|
12
12
|
|
|
13
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13
|
+
// 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/mcp/http/state.js
|
|
14
14
|
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "node:fs";
|
|
15
15
|
|
|
16
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16
|
+
// 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/mcp/http/activity.js
|
|
17
17
|
import { randomBytes } from "node:crypto";
|
|
18
18
|
import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
19
19
|
import { dirname } from "node:path";
|
|
@@ -86,7 +86,7 @@ var activityRecorder = /* @__PURE__ */ __name((path, now = Date.now) => {
|
|
|
86
86
|
};
|
|
87
87
|
}, "activityRecorder");
|
|
88
88
|
|
|
89
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
89
|
+
// 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/mcp/http/state.js
|
|
90
90
|
var ACCESS_SECONDS = 60 * 60;
|
|
91
91
|
var REFRESH_SECONDS = 30 * 24 * 60 * 60;
|
|
92
92
|
var readStored = /* @__PURE__ */ __name((path) => existsSync2(path) ? JSON.parse(readFileSync2(path, "utf8")) : { clients: [], tokens: [] }, "readStored");
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
__name
|
|
5
5
|
} from "./chunk-ZVVMGPBJ.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7
|
+
// 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/mcp/stdio-wire.js
|
|
8
8
|
import { PassThrough, Writable } from "node:stream";
|
|
9
9
|
var lineReader = /* @__PURE__ */ __name((onMessage) => {
|
|
10
10
|
let rest = "";
|
|
@@ -19,16 +19,16 @@ import {
|
|
|
19
19
|
reference,
|
|
20
20
|
string,
|
|
21
21
|
variant
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-FEZF3TII.js";
|
|
23
23
|
import {
|
|
24
24
|
CliError,
|
|
25
25
|
isCliError
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-4OSSOWDM.js";
|
|
27
27
|
import {
|
|
28
28
|
__name
|
|
29
29
|
} from "./chunk-ZVVMGPBJ.js";
|
|
30
30
|
|
|
31
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
31
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/types.js
|
|
32
32
|
var QUERY_LIMITS = {
|
|
33
33
|
bytes: 8192,
|
|
34
34
|
depth: 32,
|
|
@@ -72,7 +72,7 @@ function queryError(reason, span, alternative, context = {}, details = {}) {
|
|
|
72
72
|
__name(queryError, "queryError");
|
|
73
73
|
var walkQuery = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => walkQuery(node2)), "walkQuery");
|
|
74
74
|
|
|
75
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
75
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/dates.js
|
|
76
76
|
var timezoneOf = /* @__PURE__ */ __name((given) => {
|
|
77
77
|
const zone = given ?? Intl.DateTimeFormat().resolvedOptions().timeZone ?? "UTC";
|
|
78
78
|
try {
|
|
@@ -217,7 +217,7 @@ var dateRange = /* @__PURE__ */ __name((lower, upper, lowerInclusive, upperInclu
|
|
|
217
217
|
};
|
|
218
218
|
}, "dateRange");
|
|
219
219
|
|
|
220
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
220
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/evaluate.js
|
|
221
221
|
var wordsOf = /* @__PURE__ */ __name((text) => text.toLowerCase().match(/[\p{L}\p{N}]+/gu) ?? [], "wordsOf");
|
|
222
222
|
var pattern = /* @__PURE__ */ __name((value) => new RegExp(`^${[...value].map((char) => char === "*" ? ".*" : char === "?" ? "." : char.replace(/[.+^${}()|[\]\\]/, "\\$&")).join("")}$`, "iu"), "pattern");
|
|
223
223
|
var present = /* @__PURE__ */ __name((value) => value !== void 0 && value !== null && value !== "", "present");
|
|
@@ -272,7 +272,7 @@ var matches = /* @__PURE__ */ __name((node, item, byName, options) => {
|
|
|
272
272
|
}, "matches");
|
|
273
273
|
var evaluate = /* @__PURE__ */ __name((ast, fields, item, options = {}) => matches(ast.root, item, new Map(fields.map((field) => [field.name, field])), options), "evaluate");
|
|
274
274
|
|
|
275
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
275
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/fields.js
|
|
276
276
|
var FIELD_TYPES = ["kw", "txt", "enum", "num", "time", "bool", "ref"];
|
|
277
277
|
var OPERATORS_BY_TYPE = {
|
|
278
278
|
kw: ["term", "phrase", "wildcard"],
|
|
@@ -351,7 +351,7 @@ var queryFieldsOf = /* @__PURE__ */ __name((schema, annotations = {}) => {
|
|
|
351
351
|
return [...own, ...relations, ...states];
|
|
352
352
|
}, "queryFieldsOf");
|
|
353
353
|
|
|
354
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
354
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/help.js
|
|
355
355
|
var shownOf = /* @__PURE__ */ __name((registry) => registry.backend === "native" ? registry.fields.filter((field) => field.native) : registry.fields, "shownOf");
|
|
356
356
|
var leftOut = /* @__PURE__ */ __name((fields) => fields.filter((field) => field.negatable).map((field) => field.name), "leftOut");
|
|
357
357
|
var has = /* @__PURE__ */ __name((fields, operator) => fields.some((field) => field.operators.includes(operator)), "has");
|
|
@@ -388,7 +388,7 @@ var queryDescription = /* @__PURE__ */ __name((registry) => {
|
|
|
388
388
|
return `${terms}; fields: ${fields.join(", ")}; e.g. ${shown[0]?.example ?? ""}${defaults}`;
|
|
389
389
|
}, "queryDescription");
|
|
390
390
|
|
|
391
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
391
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/parser.js
|
|
392
392
|
var whitespace = /* @__PURE__ */ __name((c) => /[ \t\n\r\u3000]/u.test(c), "whitespace");
|
|
393
393
|
var reserved = /* @__PURE__ */ new Set([
|
|
394
394
|
"+",
|
|
@@ -697,7 +697,7 @@ var implicitTextTerms = /* @__PURE__ */ __name((text) => {
|
|
|
697
697
|
return new Set(tokens.flatMap((token, index) => (token.kind === "term" || token.kind === "number") && ![":", "=", "<", ">", "<=", ">="].includes(tokens[index - 1]?.kind ?? "") && ![":", "=", "<", ">", "<=", ">="].includes(tokens[index + 1]?.kind ?? "") ? [token.span.start] : []));
|
|
698
698
|
}, "implicitTextTerms");
|
|
699
699
|
|
|
700
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
700
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/validate.js
|
|
701
701
|
var inContext = /* @__PURE__ */ __name((context, run) => {
|
|
702
702
|
try {
|
|
703
703
|
run();
|
|
@@ -772,7 +772,7 @@ var validateQuery = /* @__PURE__ */ __name((ast, registry, options = {}) => {
|
|
|
772
772
|
}, "validateQuery");
|
|
773
773
|
var fieldsNamed = /* @__PURE__ */ __name((ast) => new Set(walkQuery(ast.root).map((node) => node.field)), "fieldsNamed");
|
|
774
774
|
|
|
775
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
775
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/registry.js
|
|
776
776
|
var describeQuery = /* @__PURE__ */ __name((registry) => ({
|
|
777
777
|
entity: registry.entity,
|
|
778
778
|
backend: registry.backend,
|
|
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
refuseLacking
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YXYTY4GF.js";
|
|
6
6
|
import {
|
|
7
7
|
asFirstWord,
|
|
8
8
|
baseContext,
|
|
@@ -13,17 +13,17 @@ import {
|
|
|
13
13
|
recalledAccount,
|
|
14
14
|
rememberAccount,
|
|
15
15
|
rootOf2 as rootOf
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-PEQA6LA5.js";
|
|
17
17
|
import {
|
|
18
18
|
providerErrorKey
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-VQDD64A4.js";
|
|
20
20
|
import {
|
|
21
21
|
MESSENGER_CHANGE_REFUSAL,
|
|
22
22
|
readOnlyRefusal
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-7W5HYGVW.js";
|
|
24
24
|
import {
|
|
25
25
|
servingProfiles
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-HG6CAYJH.js";
|
|
27
27
|
import {
|
|
28
28
|
OFFLINE,
|
|
29
29
|
capability,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
profilesOnAccount,
|
|
37
37
|
servicesFor,
|
|
38
38
|
throughWrapper
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-LQKD257P.js";
|
|
40
40
|
import {
|
|
41
41
|
AUTHORITY_KEY,
|
|
42
42
|
CEILING_KEY,
|
|
@@ -54,27 +54,27 @@ import {
|
|
|
54
54
|
logAttributes,
|
|
55
55
|
readKeysForCommand,
|
|
56
56
|
skipFlagFor
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-VAYB52HF.js";
|
|
58
58
|
import {
|
|
59
59
|
isCliFailure
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-AQVUEZEP.js";
|
|
61
61
|
import {
|
|
62
62
|
openStore
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-U2BFYSQV.js";
|
|
64
64
|
import {
|
|
65
65
|
logRecordOf,
|
|
66
66
|
realSleep,
|
|
67
67
|
resolvePaths,
|
|
68
68
|
writeSecurely
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-OD4U7GUY.js";
|
|
70
70
|
import {
|
|
71
71
|
CliError
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-4OSSOWDM.js";
|
|
73
73
|
import {
|
|
74
74
|
__name
|
|
75
75
|
} from "./chunk-ZVVMGPBJ.js";
|
|
76
76
|
|
|
77
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
77
|
+
// 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/cli/messenger/ask.js
|
|
78
78
|
import { openSync } from "node:fs";
|
|
79
79
|
import { createInterface } from "node:readline";
|
|
80
80
|
import { ReadStream } from "node:tty";
|
|
@@ -129,10 +129,10 @@ var terminalAsker = /* @__PURE__ */ __name((command) => async (key, request) =>
|
|
|
129
129
|
throw new CliError("cancelled", `${key}: not done \u2014 the answer was no`);
|
|
130
130
|
}, "terminalAsker");
|
|
131
131
|
|
|
132
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
132
|
+
// 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/sends/guard.js
|
|
133
133
|
import { randomUUID } from "node:crypto";
|
|
134
134
|
|
|
135
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
135
|
+
// 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/sends/flood.js
|
|
136
136
|
import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
137
137
|
import { dirname, join } from "node:path";
|
|
138
138
|
var MOST_DEADLINES = 50;
|
|
@@ -216,11 +216,11 @@ var FloodMemory = class {
|
|
|
216
216
|
}
|
|
217
217
|
};
|
|
218
218
|
|
|
219
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
219
|
+
// 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/sends/journal.js
|
|
220
220
|
import { appendFileSync, mkdirSync as mkdirSync3, readFileSync as readFileSync2 } from "node:fs";
|
|
221
221
|
import { dirname as dirname3, join as join2 } from "node:path";
|
|
222
222
|
|
|
223
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
223
|
+
// 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/sends/file-lock.js
|
|
224
224
|
import { closeSync, mkdirSync as mkdirSync2, openSync as openSync2, statSync, unlinkSync } from "node:fs";
|
|
225
225
|
import { dirname as dirname2 } from "node:path";
|
|
226
226
|
var LOCK_WAIT_MS = 5e3;
|
|
@@ -287,7 +287,7 @@ var lockTime = /* @__PURE__ */ __name((lock) => {
|
|
|
287
287
|
}
|
|
288
288
|
}, "lockTime");
|
|
289
289
|
|
|
290
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
290
|
+
// 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/sends/journal.js
|
|
291
291
|
var sendsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join2(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "sends", `${profile}.jsonl`), "sendsPathFor");
|
|
292
292
|
var SendJournal = class {
|
|
293
293
|
static {
|
|
@@ -364,7 +364,7 @@ var withSendId = /* @__PURE__ */ __name((entry) => {
|
|
|
364
364
|
return cid === void 0 || rest.sendId !== void 0 ? rest : { ...rest, sendId: String(cid) };
|
|
365
365
|
}, "withSendId");
|
|
366
366
|
|
|
367
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
367
|
+
// 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/sends/recipients.js
|
|
368
368
|
import { existsSync, readFileSync as readFileSync3, rmSync } from "node:fs";
|
|
369
369
|
import { join as join3 } from "node:path";
|
|
370
370
|
var recipientsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join3(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "profiles", `${profile}.recipients.json`), "recipientsPathFor");
|
|
@@ -476,7 +476,7 @@ var RecipientList = class {
|
|
|
476
476
|
}
|
|
477
477
|
};
|
|
478
478
|
|
|
479
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
479
|
+
// 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/sends/guard.js
|
|
480
480
|
var HOUR_MS = 60 * 60 * 1e3;
|
|
481
481
|
var READS_UNDER_HOLD = /* @__PURE__ */ new Set([
|
|
482
482
|
"attachments.extract",
|
|
@@ -669,7 +669,7 @@ var guardFor = /* @__PURE__ */ __name((app, settings, warn, env = process.env, a
|
|
|
669
669
|
}), "guardFor");
|
|
670
670
|
var journalFailure = /* @__PURE__ */ __name((error) => error?.code ?? (error instanceof Error ? error.name : "error"), "journalFailure");
|
|
671
671
|
|
|
672
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
672
|
+
// 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/sends/pace.js
|
|
673
673
|
import { readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
674
674
|
import { join as join4 } from "node:path";
|
|
675
675
|
var DEFAULT_PACE = { perMinute: 60, burst: 20 };
|
|
@@ -727,8 +727,39 @@ var Pacer = class {
|
|
|
727
727
|
renameSync2(temporary, this.path);
|
|
728
728
|
}
|
|
729
729
|
};
|
|
730
|
+
var ANNOUNCE_WAIT_MS = 5e3;
|
|
731
|
+
var LONGEST_PACE_WAIT_MS = 5 * 6e4;
|
|
732
|
+
var waitForTurn = /* @__PURE__ */ __name(async (pacer, options) => {
|
|
733
|
+
const { name, operation, warn } = options;
|
|
734
|
+
const now = options.now ?? Date.now;
|
|
735
|
+
let at = now();
|
|
736
|
+
try {
|
|
737
|
+
at = await pacer.reserve();
|
|
738
|
+
} catch (error) {
|
|
739
|
+
warn?.(`could not remember ${name}'s wait (${error instanceof Error ? error.message : String(error)})`, {
|
|
740
|
+
event: "warning",
|
|
741
|
+
code: "wait_not_remembered",
|
|
742
|
+
operation
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
const waitMs = at - now();
|
|
746
|
+
if (waitMs <= 0)
|
|
747
|
+
return;
|
|
748
|
+
if (waitMs > LONGEST_PACE_WAIT_MS)
|
|
749
|
+
throw new CliError("rate_limited", `${name} asked this profile to wait, ${Math.ceil(waitMs / 1e3)} s are left \u2014 nothing was sent to ${name}`, { retry_after_ms: waitMs, retry_at: new Date(at).toISOString(), remembered: true });
|
|
750
|
+
if (waitMs >= ANNOUNCE_WAIT_MS) {
|
|
751
|
+
const seconds = Math.ceil(waitMs / 1e3);
|
|
752
|
+
warn?.(`waiting ${seconds} s to keep this profile's pace with ${name}`, {
|
|
753
|
+
event: "warning",
|
|
754
|
+
code: "pace_wait",
|
|
755
|
+
operation,
|
|
756
|
+
counts: { seconds }
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
await (options.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms))))(waitMs);
|
|
760
|
+
}, "waitForTurn");
|
|
730
761
|
|
|
731
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
762
|
+
// 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/cli/permission-keys.js
|
|
732
763
|
var HOUSEKEEPING = /* @__PURE__ */ new Set([
|
|
733
764
|
"help",
|
|
734
765
|
"guide",
|
|
@@ -808,12 +839,10 @@ var refuseUnknownPermissionKeys = /* @__PURE__ */ __name((command, settings, too
|
|
|
808
839
|
throw new CliError("validation_error", `--permission ${key} names no command`, { permission: key });
|
|
809
840
|
}, "refuseUnknownPermissionKeys");
|
|
810
841
|
|
|
811
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
842
|
+
// 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/cli/messenger/flooded.js
|
|
812
843
|
var LONG_LIVED = /* @__PURE__ */ new Set(["self", "newSendId", "close", "formatMarkdown", "formatHtml", "storedChats"]);
|
|
813
844
|
var LISTENING = /* @__PURE__ */ new Set(["watch", "feed", "listen", "listenHistory"]);
|
|
814
845
|
var BLOCKING = /* @__PURE__ */ new Set(["frozen", "limited", "banned"]);
|
|
815
|
-
var ANNOUNCE_WAIT_MS = 5e3;
|
|
816
|
-
var LONGEST_PACE_WAIT_MS = 5 * 6e4;
|
|
817
846
|
var chatOf = /* @__PURE__ */ __name((args) => typeof args[0] === "string" && /^-?\d+$/.test(args[0]) ? args[0] : void 0, "chatOf");
|
|
818
847
|
var flooded = /* @__PURE__ */ __name((messenger, memory, { name, warn, pacer }) => {
|
|
819
848
|
const kept = /* @__PURE__ */ __name(async (operation, what2) => {
|
|
@@ -869,28 +898,8 @@ var flooded = /* @__PURE__ */ __name((messenger, memory, { name, warn, pacer })
|
|
|
869
898
|
await kept(operation, () => pacer.holdFor(waitMs));
|
|
870
899
|
}, "noted");
|
|
871
900
|
const turn = /* @__PURE__ */ __name(async (operation) => {
|
|
872
|
-
if (
|
|
873
|
-
|
|
874
|
-
let at = Date.now();
|
|
875
|
-
await kept(operation, async () => {
|
|
876
|
-
at = await pacer.reserve();
|
|
877
|
-
});
|
|
878
|
-
const waitMs = at - Date.now();
|
|
879
|
-
if (waitMs <= 0)
|
|
880
|
-
return;
|
|
881
|
-
if (waitMs > LONGEST_PACE_WAIT_MS) {
|
|
882
|
-
throw new CliError("rate_limited", `${name} asked this profile to wait, ${Math.ceil(waitMs / 1e3)} s are left \u2014 nothing was sent to ${name}`, { retry_after_ms: waitMs, retry_at: new Date(at).toISOString(), remembered: true });
|
|
883
|
-
}
|
|
884
|
-
if (waitMs >= ANNOUNCE_WAIT_MS) {
|
|
885
|
-
const seconds = Math.ceil(waitMs / 1e3);
|
|
886
|
-
warn(`waiting ${seconds} s to keep this profile's pace with ${name}`, {
|
|
887
|
-
event: "warning",
|
|
888
|
-
code: "pace_wait",
|
|
889
|
-
operation,
|
|
890
|
-
counts: { seconds }
|
|
891
|
-
});
|
|
892
|
-
}
|
|
893
|
-
await new Promise((resolve) => setTimeout(resolve, waitMs));
|
|
901
|
+
if (pacer)
|
|
902
|
+
await waitForTurn(pacer, { name, operation, warn });
|
|
894
903
|
}, "turn");
|
|
895
904
|
return throughWrapper(messenger, {}, (operation, call) => {
|
|
896
905
|
if (LONG_LIVED.has(operation))
|
|
@@ -927,7 +936,7 @@ var flooded = /* @__PURE__ */ __name((messenger, memory, { name, warn, pacer })
|
|
|
927
936
|
});
|
|
928
937
|
}, "flooded");
|
|
929
938
|
|
|
930
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
939
|
+
// 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/cli/messenger/observed.js
|
|
931
940
|
var observed = /* @__PURE__ */ __name((messenger, events) => {
|
|
932
941
|
const timed = /* @__PURE__ */ __name(async (operation, named, work, after) => {
|
|
933
942
|
const write = currentOperation();
|
|
@@ -1026,7 +1035,7 @@ var byPart = /* @__PURE__ */ __name((batch, counts) => {
|
|
|
1026
1035
|
counts[part] = (counts[part] ?? 0) + items.length;
|
|
1027
1036
|
}, "byPart");
|
|
1028
1037
|
|
|
1029
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1038
|
+
// 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/cli/messenger/stored.js
|
|
1030
1039
|
var REKEY_PACING = { lockMs: 50, pauseMs: 25 };
|
|
1031
1040
|
var stored = /* @__PURE__ */ __name((messenger, { account, store, warn, events, pending, announcing, deletedWithoutChat, profile, rekeyed, rekeyPacing = REKEY_PACING, closing, namesFromStore, recipientIds, countsUnread = false, historyLimits, command = "cli" }) => {
|
|
1032
1041
|
let warned = false;
|
|
@@ -1602,7 +1611,7 @@ var keep = /* @__PURE__ */ __name(async (store, account, event, seenAt, among, c
|
|
|
1602
1611
|
}
|
|
1603
1612
|
}, "keep");
|
|
1604
1613
|
|
|
1605
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1614
|
+
// 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/cli/messenger/context.js
|
|
1606
1615
|
var lazyStore = /* @__PURE__ */ __name((env, command, version) => {
|
|
1607
1616
|
let opened;
|
|
1608
1617
|
return {
|
|
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
errorCodes
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-4OSSOWDM.js";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-ZVVMGPBJ.js";
|
|
@@ -1241,7 +1241,7 @@ function unwrap(schema) {
|
|
|
1241
1241
|
}
|
|
1242
1242
|
__name(unwrap, "unwrap");
|
|
1243
1243
|
|
|
1244
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1244
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/effects.js
|
|
1245
1245
|
var EFFECT_LEVELS = ["none", "read", "write"];
|
|
1246
1246
|
var effectsSchema = strictObject({
|
|
1247
1247
|
remote: picklist(EFFECT_LEVELS),
|
|
@@ -1878,7 +1878,7 @@ function toStandardJsonSchema(schema) {
|
|
|
1878
1878
|
}
|
|
1879
1879
|
__name(toStandardJsonSchema, "toStandardJsonSchema");
|
|
1880
1880
|
|
|
1881
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1881
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/registry.js
|
|
1882
1882
|
var word = pipe(string(), regex(/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/, "a lower-case word, words joined by -"));
|
|
1883
1883
|
var SNAKE_CASE = /^[a-z][a-z0-9]*(_[a-z0-9]+)*$/;
|
|
1884
1884
|
var text = pipe(string(), regex(/\S/, "must not be empty"));
|
|
@@ -1920,7 +1920,7 @@ var fill = /* @__PURE__ */ __name((template, values) => template.replace(PLACEHO
|
|
|
1920
1920
|
return String(value);
|
|
1921
1921
|
}), "fill");
|
|
1922
1922
|
|
|
1923
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1923
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/output.js
|
|
1924
1924
|
var MAX_NEXT_STEPS = 2;
|
|
1925
1925
|
var COMPACT_FLAG = "--compact";
|
|
1926
1926
|
var isoTime = pipe(string(), isoTimestamp("an ISO 8601 time in UTC"), endsWith("Z", "an ISO 8601 time in UTC, ending in `Z`"));
|
|
@@ -2032,7 +2032,7 @@ var jsonlOf = /* @__PURE__ */ __name(({ items, page, meta }) => [
|
|
|
2032
2032
|
JSON.stringify({ type: "end", complete: meta.complete, ...meta.issues ? { issues: meta.issues } : {}, page })
|
|
2033
2033
|
].join("\n"), "jsonlOf");
|
|
2034
2034
|
|
|
2035
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2035
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/errors.js
|
|
2036
2036
|
var CRASH_CODE = "internal_error";
|
|
2037
2037
|
var CRASH_REASON = "command.crashed";
|
|
2038
2038
|
var errorObjectSchema = strictObject({
|
|
@@ -2125,7 +2125,7 @@ var BASE_REASONS = defineReasons([
|
|
|
2125
2125
|
{ reason: CRASH_REASON, code: CRASH_CODE, message: "the command failed; this is a bug", details: [] }
|
|
2126
2126
|
]);
|
|
2127
2127
|
|
|
2128
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2128
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/steps.js
|
|
2129
2129
|
var SAME_COMMAND = "*";
|
|
2130
2130
|
var commandPath = pipe(string(), regex(/^[a-z][a-z0-9-]*( [a-z][a-z0-9-]*)*$/, "a command path such as `messages sync`"));
|
|
2131
2131
|
var stepSchema = union([
|