@wirecat/drive-cli 0.63.0 → 0.65.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/README.md +2 -1
- package/dist/bin/drive.js +2 -2
- package/dist/bundle/{all-profiles-GZJS3UKC.js → all-profiles-PD7GJHFA.js} +14 -13
- package/dist/bundle/{anthropic-RGV3WXX5.js → anthropic-PJKFON5H.js} +25 -14
- package/dist/bundle/{app-server-AA2PJ7PV.js → app-server-6ELQA6FJ.js} +59 -56
- package/dist/bundle/{bun-OXZYIA3R.js → bun-P54TGES2.js} +2 -2
- package/dist/bundle/{bun-sqlite-D45NSDM3.js → bun-sqlite-TND5ZRJH.js} +12 -8
- package/dist/bundle/chunk-2AFI4KGI.js +185 -0
- package/dist/bundle/{chunk-Q5DJTRKV.js → chunk-3HXNDF6Q.js} +2 -2
- package/dist/bundle/{chunk-DJHLVUL6.js → chunk-3ONWN3IA.js} +278 -49
- package/dist/bundle/{chunk-WYGWWHZP.js → chunk-42G2XNPN.js} +2 -2
- package/dist/bundle/chunk-4AOINPN2.js +66 -0
- package/dist/bundle/{chunk-J4DIHPZ6.js → chunk-4EDWLR22.js} +1 -1
- package/dist/bundle/{chunk-ABYGSJZ4.js → chunk-4Y5YBFMS.js} +7 -7
- package/dist/bundle/{chunk-YGU6ULU5.js → chunk-54V4H6PM.js} +16 -16
- package/dist/bundle/{chunk-2TFXK3R4.js → chunk-5XSBCMAF.js} +4 -4
- package/dist/bundle/{chunk-2HF2MRXI.js → chunk-6DCLZLGX.js} +1 -1
- package/dist/bundle/{chunk-OD4U7GUY.js → chunk-7AQGVX5O.js} +20 -20
- package/dist/bundle/{chunk-YIP7ELON.js → chunk-7TAP7Y2E.js} +727 -518
- package/dist/bundle/{chunk-TF23BZW5.js → chunk-A27UVLPK.js} +3 -3
- package/dist/bundle/{chunk-LZEOQW7S.js → chunk-A4QNADEX.js} +58 -52
- package/dist/bundle/{chunk-FXBHOCJK.js → chunk-ADLS6FVG.js} +1 -1
- package/dist/bundle/{chunk-LMAVCYLQ.js → chunk-B2LPCHQN.js} +4 -4
- package/dist/bundle/{chunk-5PPL7JDM.js → chunk-CGQRZRTH.js} +2 -2
- package/dist/bundle/{chunk-VAUMOZU5.js → chunk-CWLL63JD.js} +107 -48
- package/dist/bundle/{chunk-V3NVXIQR.js → chunk-D6Z43SOG.js} +1563 -266
- package/dist/bundle/{chunk-OXY6SSZG.js → chunk-D7WB54P7.js} +127 -28
- package/dist/bundle/{chunk-VJEOGKAN.js → chunk-DA63E2UM.js} +13 -9
- package/dist/bundle/{chunk-EOOGWUTP.js → chunk-ECEP4SO3.js} +20 -20
- package/dist/bundle/{chunk-NEFSGCVA.js → chunk-EHU6EYGO.js} +38 -28
- package/dist/bundle/{chunk-4OSSOWDM.js → chunk-ELJUBPY4.js} +1 -1
- package/dist/bundle/{chunk-FRIJUILO.js → chunk-EM7NL5ES.js} +3 -3
- package/dist/bundle/{chunk-3BZRKLJ6.js → chunk-EU5MD24W.js} +13 -13
- package/dist/bundle/{chunk-MOTRI3SY.js → chunk-EZ2OLYEK.js} +24 -2
- package/dist/bundle/{chunk-6MQSQ4LX.js → chunk-F56DRBGY.js} +370 -717
- package/dist/bundle/{chunk-ZOJU7ZFI.js → chunk-FA6JNXCC.js} +8 -8
- package/dist/bundle/{chunk-ND6LLYGF.js → chunk-FBHSWQU7.js} +1531 -136
- package/dist/bundle/{chunk-Z42YYLTS.js → chunk-GW3LBY3T.js} +74 -72
- package/dist/bundle/{chunk-Y6GNA7HE.js → chunk-HP3NT6JJ.js} +23 -5
- package/dist/bundle/{chunk-DJ3SDJZY.js → chunk-I272E6UR.js} +9 -8
- package/dist/bundle/{chunk-L37LMMRJ.js → chunk-IBO23OID.js} +2 -2
- package/dist/bundle/{chunk-CE2TJBLP.js → chunk-II4S2DBJ.js} +3 -3
- package/dist/bundle/{chunk-ZM5J6ZMB.js → chunk-IKHOIXJR.js} +2 -2
- package/dist/bundle/{chunk-PO5RQQIG.js → chunk-IMHW7VIV.js} +5 -5
- package/dist/bundle/{chunk-3HK5WMI5.js → chunk-JMJIH6JH.js} +6 -6
- package/dist/bundle/{chunk-FUITWY7O.js → chunk-JPPPLKAO.js} +26 -1
- package/dist/bundle/{chunk-4S4JMW6I.js → chunk-LMKPP2JP.js} +1 -1
- package/dist/bundle/{chunk-HZZCEQTH.js → chunk-M7ELUGU6.js} +4 -4
- package/dist/bundle/{chunk-ZMOUUOT2.js → chunk-MCPOZNWG.js} +1 -1
- package/dist/bundle/{chunk-XNVFKMVR.js → chunk-NI5PD5KM.js} +39485 -35729
- package/dist/bundle/{chunk-2TDUGC5D.js → chunk-NQ5XMSLA.js} +4927 -1978
- package/dist/bundle/chunk-NQRTKYJB.js +257 -0
- package/dist/bundle/{chunk-44SBK6KB.js → chunk-O6K2E7OA.js} +4201 -2565
- package/dist/bundle/{chunk-534OBX5Y.js → chunk-O7ZDCOZE.js} +1 -1
- package/dist/bundle/{chunk-7EMQ26BA.js → chunk-OFJXHEFT.js} +13 -13
- package/dist/bundle/chunk-OWMZUWCM.js +109 -0
- package/dist/bundle/chunk-PHOL2DZM.js +138 -0
- package/dist/bundle/{chunk-UQLWMGSD.js → chunk-PLP5527C.js} +5 -5
- package/dist/bundle/{chunk-3QINVLZI.js → chunk-RNHGQ35R.js} +1 -1
- package/dist/bundle/{chunk-27YUUGXQ.js → chunk-RX5CJ55S.js} +1 -1
- package/dist/bundle/{chunk-XIUDS3OK.js → chunk-SE352DBY.js} +1 -1
- package/dist/bundle/chunk-SEQWBZYH.js +18 -0
- package/dist/bundle/{chunk-33MGFUED.js → chunk-SIWXYB4E.js} +3789 -3538
- package/dist/bundle/{chunk-4CIZWCXV.js → chunk-SNLSEYJO.js} +1 -1
- package/dist/bundle/{chunk-XDC3TWTL.js → chunk-SS4LKLD7.js} +52 -605
- package/dist/bundle/{chunk-BKYMKVHT.js → chunk-TMHF4BCL.js} +2 -2
- package/dist/bundle/{chunk-FEZF3TII.js → chunk-TOVWMURV.js} +74 -6
- package/dist/bundle/{chunk-QCKZ3GAA.js → chunk-TTP4NOP3.js} +4 -4
- package/dist/bundle/chunk-UTNRBOEN.js +53 -0
- package/dist/bundle/{chunk-2NIC72HH.js → chunk-VDZY3L7U.js} +3 -1
- package/dist/bundle/chunk-VHQYWFWV.js +13 -0
- package/dist/bundle/{chunk-VKPCONDQ.js → chunk-VLXWAH5E.js} +4 -4
- package/dist/bundle/{chunk-6KQJSFYF.js → chunk-VMAMRFFC.js} +23 -23
- package/dist/bundle/{chunk-6EY46GAN.js → chunk-W2XY6C5S.js} +2 -2
- package/dist/bundle/{chunk-J24ZFCWM.js → chunk-WRAUO5EJ.js} +22 -24
- package/dist/bundle/{chunk-S4RXABDR.js → chunk-WRMJN6UQ.js} +3 -3
- package/dist/bundle/{chunk-UPOSDTPT.js → chunk-WVJHZIDH.js} +3 -3
- package/dist/bundle/{chunk-E4SDKMBJ.js → chunk-X7YGGWXI.js} +1 -59
- package/dist/bundle/{chunk-O2XOX4HB.js → chunk-XPWZSW6Y.js} +50 -34
- package/dist/bundle/{chunk-PDCCYHCH.js → chunk-XYE7XZPB.js} +5 -5
- package/dist/bundle/{chunk-RKELRWH7.js → chunk-Y5PKRITX.js} +5 -5
- package/dist/bundle/{chunk-XR6ESRU6.js → chunk-Z2ADO6UA.js} +2 -2
- package/dist/bundle/{chunk-YUWPNG7B.js → chunk-ZD4MB7NH.js} +1 -1
- package/dist/bundle/{chunk-TWUH22Z5.js → chunk-ZILALBYQ.js} +4 -4
- package/dist/bundle/{chunk-SXM6MHRR.js → chunk-ZR2EJPMQ.js} +44 -15
- package/dist/bundle/command-contract-25E4PYMD.js +40 -0
- package/dist/bundle/command-server-entry-36JXYIJB.js +170 -0
- package/dist/bundle/{decode-G5YEIPNC.js → decode-T5ZW57WZ.js} +8 -8
- package/dist/bundle/{dispatch-GEFIXA6X.js → dispatch-RMA2XFYA.js} +11 -11
- package/dist/bundle/drive.js +11 -11
- package/dist/bundle/{echarts-W2CWHNXR.js → echarts-KQ44LPSF.js} +2 -2
- package/dist/bundle/{embed-OBFFPVF4.js → embed-Q7XST53J.js} +9 -9
- package/dist/bundle/{embedder-NGCBQHIG.js → embedder-RWZSBVW2.js} +12 -12
- package/dist/bundle/entry-HPLW4QL2.js +25 -0
- package/dist/bundle/{failure-GV77W3CD.js → failure-7NP4QPIN.js} +4 -4
- package/dist/bundle/first-run-RL3RKYZW.js +30 -0
- package/dist/bundle/first-screen-NX3TM2VJ.js +38 -0
- package/dist/bundle/google-DPD5N6AQ.js +42 -0
- package/dist/bundle/{google-api-Z3NSTBBR.js → google-api-P5DRHD7L.js} +61 -56
- package/dist/bundle/grants-TX4MHLI4.js +109 -0
- package/dist/bundle/{identity-OM6GFZ7T.js → identity-VDV6CHRW.js} +6 -6
- package/dist/bundle/{instructions-YQBQSYSS.js → instructions-Q45FVY6H.js} +1 -1
- package/dist/bundle/{login-7RYSDVN3.js → login-XKN3NI6X.js} +67 -62
- package/dist/bundle/{mcp-GWDA3HOA.js → mcp-7KQUJNFN.js} +2 -2
- package/dist/bundle/{node-IVU33RL7.js → node-MSW565D3.js} +2 -2
- package/dist/bundle/{node-KM3CUABH.js → node-P4E63KXA.js} +9 -9
- package/dist/bundle/{node-sqlite-SIH5BEW2.js → node-sqlite-S74XVVHL.js} +13 -9
- package/dist/bundle/oauth-6R7AWAES.js +22 -0
- package/dist/bundle/{open-IAO2SNII.js → open-P7UQG7XJ.js} +8 -8
- package/dist/bundle/{openai-SGOUBHXP.js → openai-DDHJ57KZ.js} +19 -40
- package/dist/bundle/{process-BPBMV3AT.js → process-NMUB5SHK.js} +1 -1
- package/dist/bundle/{program-MYKKJ4F6.js → program-PJNWP6JW.js} +517 -330
- package/dist/bundle/prompt-VOSMK4C2.js +19 -0
- package/dist/bundle/{reasons-57J2D77K.js → reasons-KDAXOC5S.js} +5 -5
- package/dist/bundle/{recognize-A5C5RPB3.js → recognize-GZIY63HS.js} +7 -7
- package/dist/bundle/{remote-VWYFLRGO.js → remote-V3YGN7LN.js} +10 -10
- package/dist/bundle/{rerank-4NGQWREA.js → rerank-XRU6AVN7.js} +10 -10
- package/dist/bundle/{serve-Y6LQTFH5.js → serve-NDOAFA57.js} +12 -12
- package/dist/bundle/{server-6AUHIIUA.js → server-BKGWJYMC.js} +46 -44
- package/dist/bundle/server-QD2MUJJZ.js +72 -0
- package/dist/bundle/{services-2W4J7EMW.js → services-TYDMFQCA.js} +129 -39
- package/dist/bundle/{sqlite-runtime-P6BBDX2H.js → sqlite-runtime-UAFJKSJR.js} +9 -9
- package/dist/bundle/{start-AFFA3LKM.js → start-2ZLDP2OE.js} +30 -8
- package/dist/bundle/{state-PXKKXR3R.js → state-6SP27J2K.js} +9 -9
- package/dist/bundle/{store-CN6JEUC4.js → store-4UUY545Q.js} +42 -18
- package/dist/bundle/{store-IVV2BAGZ.js → store-EJN27MXI.js} +69 -28
- package/dist/bundle/store-maintenance-command-LETURZDC.js +60 -0
- package/dist/bundle/tokens-MTFJPTYT.js +107 -0
- package/dist/commands/account.d.ts +4 -0
- package/dist/commands/account.d.ts.map +1 -0
- package/dist/commands/account.js +33 -0
- package/dist/commands/account.js.map +1 -0
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +6 -5
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/context.d.ts +4 -2
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/documents.d.ts +2 -0
- package/dist/commands/documents.d.ts.map +1 -1
- package/dist/commands/documents.js +39 -3
- package/dist/commands/documents.js.map +1 -1
- package/dist/config.d.ts +13 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +32 -2
- package/dist/config.js.map +1 -1
- package/dist/documents-add.d.ts +49 -0
- package/dist/documents-add.d.ts.map +1 -0
- package/dist/documents-add.js +122 -0
- package/dist/documents-add.js.map +1 -0
- package/dist/errors.d.ts +1 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +9 -1
- package/dist/errors.js.map +1 -1
- package/dist/knowledge.d.ts +1 -1
- package/dist/knowledge.d.ts.map +1 -1
- package/dist/knowledge.js +15 -17
- package/dist/knowledge.js.map +1 -1
- package/dist/model.d.ts +3 -0
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js.map +1 -1
- package/dist/profile-lock.d.ts +1 -0
- package/dist/profile-lock.d.ts.map +1 -1
- package/dist/profile-lock.js +1 -0
- package/dist/profile-lock.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +24 -15
- package/dist/program.js.map +1 -1
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +25 -0
- package/dist/reasons.js.map +1 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +20 -0
- package/dist/store.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/dist/bundle/chunk-AEX37ETW.js +0 -35
- package/dist/bundle/chunk-OTROVC4E.js +0 -62
- package/dist/bundle/chunk-Z5KC7XBR.js +0 -33
- package/dist/bundle/command-contract-BRW3AP44.js +0 -38
- package/dist/bundle/entry-ET6HGM7A.js +0 -22
- package/dist/bundle/first-run-JG52UZVO.js +0 -30
- package/dist/bundle/first-screen-CIL3GFAA.js +0 -36
- package/dist/bundle/google-CIWUVJ5C.js +0 -36
- package/dist/bundle/grants-3S4RL3WB.js +0 -104
- package/dist/bundle/oauth-PT4JEHLL.js +0 -22
- package/dist/bundle/prompt-3ZM64DCB.js +0 -17
- package/dist/bundle/server-PFHI35HA.js +0 -69
- package/dist/bundle/store-maintenance-command-MSY2QNEH.js +0 -59
- package/dist/bundle/tokens-P4LPNUFW.js +0 -102
- package/dist/bundle/{chunk-ZQ3GWKDQ.js → chunk-YVNHQFLC.js} +0 -0
- package/dist/bundle/{mdast-util-from-markdown-FXEPSNER.js → mdast-util-from-markdown-CE73EWJ2.js} +3 -3
|
@@ -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.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/background/processes.js
|
|
8
8
|
import { execFileSync } from "node:child_process";
|
|
9
9
|
import { readdirSync, readFileSync, readlinkSync } from "node:fs";
|
|
10
10
|
var alive = /* @__PURE__ */ __name((pid) => {
|
|
@@ -3,27 +3,27 @@ const require = __bundleRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
activeProfile,
|
|
5
5
|
paths
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZR2EJPMQ.js";
|
|
7
7
|
import {
|
|
8
8
|
READ_SCOPE,
|
|
9
9
|
WRITE_SCOPE,
|
|
10
10
|
providerRequest
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-NQ5XMSLA.js";
|
|
12
12
|
import {
|
|
13
13
|
googleError
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-NQRTKYJB.js";
|
|
15
15
|
import {
|
|
16
16
|
withTimeLimit
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-FBHSWQU7.js";
|
|
18
18
|
import {
|
|
19
19
|
acquireLock
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-EU5MD24W.js";
|
|
21
21
|
import {
|
|
22
22
|
Credentials,
|
|
23
23
|
isMovedRun,
|
|
24
24
|
keyringService,
|
|
25
25
|
systemKeyring
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-7AQGVX5O.js";
|
|
27
27
|
import {
|
|
28
28
|
minLength,
|
|
29
29
|
nullable,
|
|
@@ -33,16 +33,16 @@ import {
|
|
|
33
33
|
pipe,
|
|
34
34
|
safeParse,
|
|
35
35
|
string
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-TOVWMURV.js";
|
|
37
37
|
import {
|
|
38
38
|
CliError,
|
|
39
39
|
isCliError
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-ELJUBPY4.js";
|
|
41
41
|
import {
|
|
42
42
|
__name
|
|
43
43
|
} from "./chunk-ZVVMGPBJ.js";
|
|
44
44
|
|
|
45
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/oauth/authorize.js
|
|
46
46
|
import { createHash, randomBytes } from "node:crypto";
|
|
47
47
|
import { createServer } from "node:http";
|
|
48
48
|
var DEFAULT_TIMEOUT_MS = 3e5;
|
|
@@ -178,12 +178,12 @@ var authorize = /* @__PURE__ */ __name(async (options) => {
|
|
|
178
178
|
}
|
|
179
179
|
}, "authorize");
|
|
180
180
|
|
|
181
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
181
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/oauth/keeper.js
|
|
182
182
|
import { createHash as createHash2 } from "node:crypto";
|
|
183
183
|
import { join } from "node:path";
|
|
184
184
|
import { setTimeout as delay } from "node:timers/promises";
|
|
185
185
|
|
|
186
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
186
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/oauth/requests.js
|
|
187
187
|
var REQUEST_LIMIT_MS = 3e4;
|
|
188
188
|
var TOKEN_LOG_EVENT = "oauth.token";
|
|
189
189
|
var object2 = /* @__PURE__ */ __name((value) => {
|
|
@@ -303,7 +303,7 @@ var revokeToken = /* @__PURE__ */ __name(async (provider, tokens, context) => {
|
|
|
303
303
|
});
|
|
304
304
|
}, "revokeToken");
|
|
305
305
|
|
|
306
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
306
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/oauth/keeper.js
|
|
307
307
|
var inFlight = /* @__PURE__ */ new Map();
|
|
308
308
|
var refreshedInMemory = /* @__PURE__ */ new Map();
|
|
309
309
|
var tokenKeeper = /* @__PURE__ */ __name((options) => {
|
|
@@ -465,7 +465,7 @@ var tokenKeeper = /* @__PURE__ */ __name((options) => {
|
|
|
465
465
|
};
|
|
466
466
|
}, "tokenKeeper");
|
|
467
467
|
|
|
468
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
468
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/oauth/storage.js
|
|
469
469
|
var invalid = /* @__PURE__ */ __name(() => new CliError("authentication_error", "the saved sign-in cannot be read; sign in again", { reason: "oauth.invalid" }), "invalid");
|
|
470
470
|
var parse = /* @__PURE__ */ __name((raw) => {
|
|
471
471
|
let value;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
check,
|
|
5
|
+
getDotPath,
|
|
6
|
+
maxLength,
|
|
7
|
+
minLength,
|
|
8
|
+
optional,
|
|
9
|
+
picklist,
|
|
10
|
+
pipe,
|
|
11
|
+
record,
|
|
12
|
+
regex,
|
|
13
|
+
safeParse,
|
|
14
|
+
strictObject,
|
|
15
|
+
string,
|
|
16
|
+
trim
|
|
17
|
+
} from "./chunk-TOVWMURV.js";
|
|
18
|
+
import {
|
|
19
|
+
CliError
|
|
20
|
+
} from "./chunk-ELJUBPY4.js";
|
|
21
|
+
import {
|
|
22
|
+
__name
|
|
23
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
24
|
+
|
|
25
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/models/endpoint.js
|
|
26
|
+
var endpoint = /* @__PURE__ */ __name((value) => {
|
|
27
|
+
try {
|
|
28
|
+
const url = new URL(value);
|
|
29
|
+
return ["https:", "http:"].includes(url.protocol) && !url.username && !url.password && !url.search && !url.hash;
|
|
30
|
+
} catch {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
}, "endpoint");
|
|
34
|
+
|
|
35
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/models/settings.js
|
|
36
|
+
var MODEL_FIELDS = ["provider", "model", "base_url"];
|
|
37
|
+
var modelSettingsShape = record(pipe(string(), regex(/^[a-z][a-z0-9-]*$/)), strictObject({
|
|
38
|
+
provider: optional(picklist(["off", "openai", "anthropic"])),
|
|
39
|
+
model: optional(pipe(string(), trim(), minLength(1), maxLength(200))),
|
|
40
|
+
base_url: optional(pipe(string(), check((value) => endpoint(value), "use an HTTP/S endpoint without credentials, query or fragment")))
|
|
41
|
+
}));
|
|
42
|
+
var resolveModelSettings = /* @__PURE__ */ __name((prefix, layers, env) => {
|
|
43
|
+
const configured = layers.map(([from, scope]) => [from, scope?.models ?? {}]);
|
|
44
|
+
const purposes = /* @__PURE__ */ new Set([
|
|
45
|
+
"default",
|
|
46
|
+
"analysis",
|
|
47
|
+
"replies",
|
|
48
|
+
...configured.flatMap(([, models2]) => Object.keys(models2))
|
|
49
|
+
]);
|
|
50
|
+
for (const name of Object.keys(env)) {
|
|
51
|
+
const match = new RegExp(`^${prefix}_MODELS_([A-Z][A-Z0-9_]*)_(PROVIDER|MODEL|BASE_URL)$`).exec(name);
|
|
52
|
+
if (match?.[1])
|
|
53
|
+
purposes.add(match[1].toLowerCase().replaceAll("_", "-"));
|
|
54
|
+
}
|
|
55
|
+
const models = {};
|
|
56
|
+
const sources = {};
|
|
57
|
+
for (const purpose of purposes) {
|
|
58
|
+
const resolved = {};
|
|
59
|
+
for (const field of MODEL_FIELDS) {
|
|
60
|
+
const variable = `${prefix}_MODELS_${purpose.replaceAll("-", "_").toUpperCase()}_${field.toUpperCase()}`;
|
|
61
|
+
const candidates = [
|
|
62
|
+
[variable, env[variable]?.trim() || void 0],
|
|
63
|
+
...configured.map(([from, model]) => [
|
|
64
|
+
`${from}: models.${purpose}.${field}`,
|
|
65
|
+
model[purpose]?.[field]
|
|
66
|
+
]),
|
|
67
|
+
...purpose === "default" ? [] : [
|
|
68
|
+
[
|
|
69
|
+
`${prefix}_MODELS_DEFAULT_${field.toUpperCase()}`,
|
|
70
|
+
env[`${prefix}_MODELS_DEFAULT_${field.toUpperCase()}`]?.trim() || void 0
|
|
71
|
+
],
|
|
72
|
+
...configured.map(([from, model]) => [
|
|
73
|
+
`${from}: models.default.${field}`,
|
|
74
|
+
model.default?.[field]
|
|
75
|
+
])
|
|
76
|
+
]
|
|
77
|
+
];
|
|
78
|
+
const selected = candidates.find(([, value]) => value !== void 0);
|
|
79
|
+
if (selected)
|
|
80
|
+
resolved[field] = selected[1];
|
|
81
|
+
sources[`models.${purpose}.${field}`] = selected?.[0] ?? "default";
|
|
82
|
+
}
|
|
83
|
+
if (Object.keys(resolved).length)
|
|
84
|
+
models[purpose] = resolved;
|
|
85
|
+
}
|
|
86
|
+
const checked = safeParse(modelSettingsShape, models);
|
|
87
|
+
if (!checked.success)
|
|
88
|
+
throw new CliError("configuration_error", `models.${getDotPath(checked.issues[0]) ?? "settings"} is invalid`);
|
|
89
|
+
return { models: checked.output, sources };
|
|
90
|
+
}, "resolveModelSettings");
|
|
91
|
+
var modelTarget = /* @__PURE__ */ __name((settings, purpose) => {
|
|
92
|
+
const configured = { ...settings.models?.default, ...settings.models?.[purpose] };
|
|
93
|
+
if (configured.provider === void 0 || configured.provider === "off")
|
|
94
|
+
return void 0;
|
|
95
|
+
if (!configured.model)
|
|
96
|
+
throw new CliError("configuration_error", `set models.${purpose}.model before calling its provider`);
|
|
97
|
+
return {
|
|
98
|
+
provider: configured.provider,
|
|
99
|
+
model: configured.model,
|
|
100
|
+
...configured.base_url === void 0 ? {} : { baseUrl: configured.base_url }
|
|
101
|
+
};
|
|
102
|
+
}, "modelTarget");
|
|
103
|
+
|
|
104
|
+
export {
|
|
105
|
+
endpoint,
|
|
106
|
+
modelSettingsShape,
|
|
107
|
+
resolveModelSettings,
|
|
108
|
+
modelTarget
|
|
109
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
CliError,
|
|
5
|
+
isCliError
|
|
6
|
+
} from "./chunk-ELJUBPY4.js";
|
|
7
|
+
import {
|
|
8
|
+
__name
|
|
9
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
10
|
+
|
|
11
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/http/hosts.js
|
|
12
|
+
var LABEL = "[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?";
|
|
13
|
+
var HOST_PATTERN = new RegExp(`^(?:${LABEL}(?:\\.${LABEL})*|\\*\\.${LABEL}(?:\\.${LABEL})+)$`);
|
|
14
|
+
var hostProblems = /* @__PURE__ */ __name((hosts) => [
|
|
15
|
+
...hosts.filter((host) => !HOST_PATTERN.test(host) || host.length > 253).map((host) => `${JSON.stringify(host)} is not a host: a lower-case hostname with no scheme, port or path, or one leading *. before two labels or more`),
|
|
16
|
+
...hosts.filter((host, at) => hosts.indexOf(host) !== at).map((host) => `${JSON.stringify(host)} is listed twice`)
|
|
17
|
+
], "hostProblems");
|
|
18
|
+
var hostCovered = /* @__PURE__ */ __name((hostname, hosts) => {
|
|
19
|
+
const name = hostname.toLowerCase().replace(/\.$/, "");
|
|
20
|
+
return hosts.some((host) => host.startsWith("*.") ? name.endsWith(host.slice(1)) : name === host);
|
|
21
|
+
}, "hostCovered");
|
|
22
|
+
|
|
23
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/http/fetch.js
|
|
24
|
+
var HOST_FETCH_TIMEOUT_MS = 3e4;
|
|
25
|
+
var REDIRECTS = 5;
|
|
26
|
+
var REDIRECT_STATUSES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
|
|
27
|
+
var CREDENTIAL_HEADERS = ["authorization", "cookie", "proxy-authorization"];
|
|
28
|
+
var NO_BODY = /* @__PURE__ */ new Set([204, 205, 304]);
|
|
29
|
+
var deadline = /* @__PURE__ */ __name((ms) => {
|
|
30
|
+
const controller = new AbortController();
|
|
31
|
+
const timer = setTimeout(() => controller.abort(new DOMException(`no answer within ${ms} ms`, "TimeoutError")), ms);
|
|
32
|
+
timer.unref?.();
|
|
33
|
+
return { signal: controller.signal, clear: /* @__PURE__ */ __name(() => clearTimeout(timer), "clear") };
|
|
34
|
+
}, "deadline");
|
|
35
|
+
var released = /* @__PURE__ */ __name((response, clear) => {
|
|
36
|
+
if (!response.body || NO_BODY.has(response.status) || response.status < 200 || response.status > 599) {
|
|
37
|
+
clear();
|
|
38
|
+
return response;
|
|
39
|
+
}
|
|
40
|
+
const { status, statusText, headers, url, redirected } = response;
|
|
41
|
+
const wrapped = new Response(response.body.pipeThrough(new TransformStream({ flush: clear })), {
|
|
42
|
+
status,
|
|
43
|
+
statusText,
|
|
44
|
+
headers
|
|
45
|
+
});
|
|
46
|
+
return Object.defineProperties(wrapped, { url: { value: url }, redirected: { value: redirected } });
|
|
47
|
+
}, "released");
|
|
48
|
+
var undeclared = /* @__PURE__ */ __name((url) => new CliError("configuration_error", `${url.hostname} is not a host this CLI declares: add "${url.hostname}" to \`hosts\` in its WCAT identity and run cli-dev manifest`, { reason: "network.host-undeclared", sent: false }), "undeclared");
|
|
49
|
+
var checked = /* @__PURE__ */ __name((url, hosts) => {
|
|
50
|
+
if (url.protocol !== "https:" && url.protocol !== "http:")
|
|
51
|
+
throw new CliError("validation_error", `only http and https are fetched, not ${url.protocol.replace(/:$/, "")}`, {
|
|
52
|
+
sent: false
|
|
53
|
+
});
|
|
54
|
+
if (!hostCovered(url.hostname, hosts))
|
|
55
|
+
throw undeclared(url);
|
|
56
|
+
return url;
|
|
57
|
+
}, "checked");
|
|
58
|
+
var hostFetch = /* @__PURE__ */ __name((options) => {
|
|
59
|
+
const problems = hostProblems(options.hosts);
|
|
60
|
+
if (problems.length > 0)
|
|
61
|
+
throw new CliError("configuration_error", problems.join("; "));
|
|
62
|
+
const { hosts, fetch: send = globalThis.fetch, timeoutMs = HOST_FETCH_TIMEOUT_MS, redirects = REDIRECTS } = options;
|
|
63
|
+
return async (input, init = {}) => {
|
|
64
|
+
const request = input instanceof Request ? input : void 0;
|
|
65
|
+
let url = checked(new URL(request?.url ?? String(input)), hosts);
|
|
66
|
+
const caller = init.signal ?? request?.signal;
|
|
67
|
+
const timeout = deadline(timeoutMs);
|
|
68
|
+
const signal = caller ? AbortSignal.any([caller, timeout.signal]) : timeout.signal;
|
|
69
|
+
const follow = (init.redirect ?? request?.redirect ?? "follow") === "follow";
|
|
70
|
+
let method = (init.method ?? request?.method ?? "GET").toUpperCase();
|
|
71
|
+
let body = init.body ?? request?.body ?? void 0;
|
|
72
|
+
const headers = new Headers(init.headers ?? request?.headers);
|
|
73
|
+
try {
|
|
74
|
+
let response = await send(input, { ...init, signal, ...follow ? { redirect: "manual" } : {} });
|
|
75
|
+
for (let hop = 0; follow && REDIRECT_STATUSES.has(response.status); hop += 1) {
|
|
76
|
+
const location = response.headers.get("location");
|
|
77
|
+
if (!location)
|
|
78
|
+
return released(response, timeout.clear);
|
|
79
|
+
if (hop >= redirects)
|
|
80
|
+
throw new CliError("invalid_response", `more than ${redirects} redirects from ${url.hostname}`);
|
|
81
|
+
void response.body?.cancel().catch(() => {
|
|
82
|
+
});
|
|
83
|
+
const next = checked(new URL(location, url), hosts);
|
|
84
|
+
if (response.status === 303 || (response.status === 301 || response.status === 302) && method === "POST") {
|
|
85
|
+
method = method === "HEAD" ? "HEAD" : "GET";
|
|
86
|
+
body = void 0;
|
|
87
|
+
headers.delete("content-type");
|
|
88
|
+
headers.delete("content-length");
|
|
89
|
+
} else if (body instanceof ReadableStream)
|
|
90
|
+
throw new CliError("invalid_response", `${url.hostname} redirected a streamed body, which cannot be sent again`);
|
|
91
|
+
if (next.origin !== url.origin)
|
|
92
|
+
for (const name of CREDENTIAL_HEADERS)
|
|
93
|
+
headers.delete(name);
|
|
94
|
+
url = next;
|
|
95
|
+
response = await send(url, { ...init, method, headers, body, signal, redirect: "manual" });
|
|
96
|
+
}
|
|
97
|
+
return released(response, timeout.clear);
|
|
98
|
+
} catch (error) {
|
|
99
|
+
timeout.clear();
|
|
100
|
+
if (isCliError(error))
|
|
101
|
+
throw error;
|
|
102
|
+
if (caller?.aborted)
|
|
103
|
+
throw isCliError(caller.reason) ? caller.reason : new CliError("cancelled", "request cancelled");
|
|
104
|
+
if (timeout.signal.aborted)
|
|
105
|
+
throw new CliError("timeout", `${url.hostname} did not answer within ${timeoutMs} ms`, { retryable: true });
|
|
106
|
+
throw new CliError("network_error", `${url.hostname} could not be reached`, { retryable: true });
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
}, "hostFetch");
|
|
110
|
+
|
|
111
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/http/index.js
|
|
112
|
+
var parseRetryAfter = /* @__PURE__ */ __name((header, now) => {
|
|
113
|
+
if (!header)
|
|
114
|
+
return void 0;
|
|
115
|
+
const trimmed = header.trim();
|
|
116
|
+
if (/^\d+$/.test(trimmed))
|
|
117
|
+
return Number(trimmed) * 1e3;
|
|
118
|
+
const at = Date.parse(trimmed);
|
|
119
|
+
if (Number.isNaN(at))
|
|
120
|
+
return void 0;
|
|
121
|
+
const delta = at - now().getTime();
|
|
122
|
+
return delta > 0 ? delta : void 0;
|
|
123
|
+
}, "parseRetryAfter");
|
|
124
|
+
var parseRateLimitReset = /* @__PURE__ */ __name((header, now) => {
|
|
125
|
+
if (!header)
|
|
126
|
+
return void 0;
|
|
127
|
+
const seconds = Number(header.trim());
|
|
128
|
+
if (!Number.isFinite(seconds))
|
|
129
|
+
return void 0;
|
|
130
|
+
const delta = seconds * 1e3 - now().getTime();
|
|
131
|
+
return delta > 0 ? delta : void 0;
|
|
132
|
+
}, "parseRateLimitReset");
|
|
133
|
+
var providerWaitMs = /* @__PURE__ */ __name((headers, now) => parseRetryAfter(headers.get("retry-after"), now) ?? parseRateLimitReset(headers.get("x-ratelimit-reset"), now), "providerWaitMs");
|
|
134
|
+
|
|
135
|
+
export {
|
|
136
|
+
hostFetch,
|
|
137
|
+
providerWaitMs
|
|
138
|
+
};
|
|
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
visibleControls
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-6DCLZLGX.js";
|
|
6
6
|
import {
|
|
7
7
|
BASE_REASONS,
|
|
8
8
|
COMMON_DETAILS,
|
|
@@ -10,16 +10,16 @@ import {
|
|
|
10
10
|
CRASH_REASON,
|
|
11
11
|
stepOf,
|
|
12
12
|
writes
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-TOVWMURV.js";
|
|
14
14
|
import {
|
|
15
15
|
errorCodes,
|
|
16
16
|
isCliError
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ELJUBPY4.js";
|
|
18
18
|
import {
|
|
19
19
|
__name
|
|
20
20
|
} from "./chunk-ZVVMGPBJ.js";
|
|
21
21
|
|
|
22
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
22
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/exit-codes.js
|
|
23
23
|
var EXIT_CODES = {
|
|
24
24
|
validation_error: 2,
|
|
25
25
|
configuration_error: 3,
|
|
@@ -40,7 +40,7 @@ var EXIT_CODES = {
|
|
|
40
40
|
var exitCodeFor = /* @__PURE__ */ __name((code) => EXIT_CODES[code], "exitCodeFor");
|
|
41
41
|
var GENERIC_FAILURE = 1;
|
|
42
42
|
|
|
43
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
43
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/failure.js
|
|
44
44
|
var recognise = /* @__PURE__ */ __name((failure) => {
|
|
45
45
|
if (isCliError(failure))
|
|
46
46
|
return failure;
|
|
@@ -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.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/mcp/instructions.js
|
|
8
8
|
var instructions = /* @__PURE__ */ __name(({ command, name, profile, writes, skill }) => {
|
|
9
9
|
const all = typeof profile !== "string";
|
|
10
10
|
const offers = /* @__PURE__ */ __name((key) => all || writes.includes(key), "offers");
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
__name
|
|
5
5
|
} from "./chunk-ZVVMGPBJ.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
7
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/installer.js
|
|
8
8
|
var installerOf = /* @__PURE__ */ __name((scriptPath) => {
|
|
9
9
|
const path = scriptPath.replaceAll("\\", "/");
|
|
10
10
|
if (path.includes("/_npx/"))
|
|
@@ -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.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/mcp/bot/instructions.js
|
|
8
8
|
var botInstructions = /* @__PURE__ */ __name(({ command, name, profile, writes, skill }) => [
|
|
9
9
|
`The owner's ${name} bot "${profile}", through the official Bot API \u2014 not the owner's personal account. What it writes, people see as the bot.`,
|
|
10
10
|
"Use these tools to read the chats this bot is in, find a message or a person, and \u2014 when the profile allows \u2014 write as the bot.",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
__name
|
|
5
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
6
|
+
|
|
7
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_795ed7a67bda78d624888739490b3720/node_modules/@wirecat/cli-core/dist/cli/stdin-field.js
|
|
8
|
+
var fields = /* @__PURE__ */ new WeakMap();
|
|
9
|
+
var readsStdin = /* @__PURE__ */ __name((command, field) => {
|
|
10
|
+
fields.set(command, field);
|
|
11
|
+
return command;
|
|
12
|
+
}, "readsStdin");
|
|
13
|
+
var stdinFieldOf = /* @__PURE__ */ __name((command) => fields.get(command), "stdinFieldOf");
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
readsStdin,
|
|
17
|
+
stdinFieldOf
|
|
18
|
+
};
|