@wirecat/drive-cli 0.68.0 → 0.69.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/bundle/{all-profiles-BU6XUFUP.js → all-profiles-B4A737YW.js} +20 -30
- package/dist/bundle/{anthropic-ZP5B7S2Z.js → anthropic-RZGPDESM.js} +3 -3
- package/dist/bundle/{app-server-EB4DH6T7.js → app-server-OWEW7DY5.js} +47 -63
- package/dist/bundle/{bun-PWMM6L45.js → bun-V5QLYBZU.js} +2 -2
- package/dist/bundle/{bun-sqlite-6VPR2SVC.js → bun-sqlite-KHLHXXGH.js} +4 -4
- package/dist/bundle/{chunk-7TNQZKRD.js → chunk-22SH77TG.js} +65 -64
- package/dist/bundle/{chunk-MLSXHTUB.js → chunk-25FT44S3.js} +1480 -464
- package/dist/bundle/{chunk-5G2BY4B6.js → chunk-2DS2TDGW.js} +29 -28
- package/dist/bundle/{chunk-PGPHEC2X.js → chunk-2Q4CB4EI.js} +1 -1
- package/dist/bundle/{chunk-74NCZKRW.js → chunk-2VFAXC6O.js} +13 -13
- package/dist/bundle/{chunk-NV75QPML.js → chunk-376ZGVUZ.js} +4 -4
- package/dist/bundle/{chunk-6WAC2LOS.js → chunk-3RLRJHAI.js} +1558 -928
- package/dist/bundle/{chunk-QVJMFZFW.js → chunk-3URYKAJP.js} +1 -1
- package/dist/bundle/{chunk-UYBLNGZ2.js → chunk-3YKAFLXY.js} +1 -1
- package/dist/bundle/{chunk-CMWFYZ45.js → chunk-4J5GJJ2I.js} +1 -1
- package/dist/bundle/{chunk-QKY24RWV.js → chunk-4YECZ6CN.js} +11 -11
- package/dist/bundle/{chunk-FAMXUI2X.js → chunk-4ZFO2CVH.js} +4 -4
- package/dist/bundle/{chunk-IVOG6T6P.js → chunk-533XOW74.js} +2 -2
- package/dist/bundle/{chunk-Q6BD6RUH.js → chunk-5B5NOAIA.js} +100 -55
- package/dist/bundle/{chunk-MW46BLWH.js → chunk-5SJZDEIO.js} +2 -0
- package/dist/bundle/{chunk-CVAJMRRD.js → chunk-6D44YQ5X.js} +5 -5
- package/dist/bundle/{chunk-EOC7RHJ2.js → chunk-6EL5AVXX.js} +3 -5
- package/dist/bundle/{chunk-TI2OANJZ.js → chunk-6XNTELM5.js} +1 -1
- package/dist/bundle/{chunk-WUFZGPXX.js → chunk-AD7VI3XU.js} +6 -6
- package/dist/bundle/{chunk-YUGTJBV3.js → chunk-AMQGKMLZ.js} +2 -2
- package/dist/bundle/{chunk-SOS4U2RF.js → chunk-BBJVV4E2.js} +24 -25
- package/dist/bundle/{chunk-JMZQBRRZ.js → chunk-BVVXYZSU.js} +5 -5
- package/dist/bundle/{chunk-AIEMFRBU.js → chunk-CAQ5GW3A.js} +1 -1
- package/dist/bundle/{chunk-PWIEOATY.js → chunk-CDSB7WVG.js} +323 -12
- package/dist/bundle/{chunk-KPKIHJIT.js → chunk-CU6RATZH.js} +3 -3
- package/dist/bundle/{chunk-43NEDPXB.js → chunk-CZ4UEXCE.js} +4 -4
- package/dist/bundle/{chunk-UFPRP7MG.js → chunk-E7URRFBB.js} +7 -7
- package/dist/bundle/{chunk-YYIWPH53.js → chunk-EL2E3ABX.js} +12 -12
- package/dist/bundle/{chunk-MWCPKUU4.js → chunk-EWUQIUTB.js} +4 -4
- package/dist/bundle/{chunk-7A77GYCE.js → chunk-F5UUJU6R.js} +2 -2
- package/dist/bundle/{chunk-O7T3WGCV.js → chunk-GHFBT2ZM.js} +4 -4
- package/dist/bundle/{chunk-7BXVI7XF.js → chunk-GK6KXBL6.js} +1 -1
- package/dist/bundle/{chunk-5W65QTYS.js → chunk-GTDCP5OG.js} +3 -3
- package/dist/bundle/{chunk-GTLXBAJV.js → chunk-HEBZCKMU.js} +1669 -662
- package/dist/bundle/{chunk-AXYG2DDY.js → chunk-I55XYREN.js} +636 -227
- package/dist/bundle/{chunk-UUQJVKPB.js → chunk-IQ2QU2X6.js} +1608 -1096
- package/dist/bundle/{chunk-ULNN3LCY.js → chunk-KUQDBWPU.js} +40 -32
- package/dist/bundle/{chunk-6QR7NKMG.js → chunk-L342KHIZ.js} +105 -1
- package/dist/bundle/{chunk-DYLYH7VE.js → chunk-LRCSDAYK.js} +3 -3
- package/dist/bundle/{chunk-QTRYJZL7.js → chunk-LUZRVBQR.js} +4 -4
- package/dist/bundle/{chunk-PJ3FKBXG.js → chunk-MHXZ62CU.js} +1 -1
- package/dist/bundle/{chunk-WGX4DZPW.js → chunk-N4ACIIQB.js} +2 -2
- package/dist/bundle/{chunk-DU23ET2O.js → chunk-NVDR72GP.js} +19 -19
- package/dist/bundle/{chunk-F7KAMSXA.js → chunk-O6PD7RZY.js} +2 -2
- package/dist/bundle/{chunk-JZ3MT7IE.js → chunk-OOIAJRKQ.js} +1 -1
- package/dist/bundle/{chunk-ZVQDOKDY.js → chunk-OUM4ZO53.js} +1 -1
- package/dist/bundle/{chunk-ZSVMZH5O.js → chunk-PB6NWKH3.js} +2 -2
- package/dist/bundle/{chunk-EEE4H2PA.js → chunk-QJGFQRTL.js} +10 -10
- package/dist/bundle/chunk-RLGQMMYE.js +707 -0
- package/dist/bundle/{chunk-CRIEW4FP.js → chunk-RWQ7T4Y5.js} +2 -2
- package/dist/bundle/{chunk-EXWZCI5G.js → chunk-SEJBS7SI.js} +1 -1
- package/dist/bundle/{chunk-CK2SQ2CE.js → chunk-SY2HLH5R.js} +32 -19
- package/dist/bundle/{chunk-6HFZZ2PW.js → chunk-SYUXKV2E.js} +1 -1
- package/dist/bundle/{chunk-ZAIE3G5I.js → chunk-T4FMXDDV.js} +2 -2
- package/dist/bundle/{chunk-U52QE4QV.js → chunk-T6X6EZ5N.js} +3 -3
- package/dist/bundle/{chunk-Z5BMYI2V.js → chunk-TZ75K6R7.js} +6 -6
- package/dist/bundle/{chunk-D4MVEOU2.js → chunk-U3RXH6RY.js} +1 -1
- package/dist/bundle/{chunk-QRSPFCRY.js → chunk-V4FMN5A6.js} +16 -16
- package/dist/bundle/{chunk-QWGEOQHA.js → chunk-VUPWDCYV.js} +1 -1
- package/dist/bundle/{chunk-WCNTDETD.js → chunk-WNMPIRRF.js} +98 -6
- package/dist/bundle/{chunk-RT5NT62B.js → chunk-WOUIHZRI.js} +13 -15
- package/dist/bundle/{chunk-UIKVP23D.js → chunk-WQOGHND4.js} +1 -1
- package/dist/bundle/{chunk-2VYEGKQ3.js → chunk-XUHQ7DVT.js} +1 -1
- package/dist/bundle/{chunk-DIZBJLPM.js → chunk-XVH3WZSZ.js} +45 -55
- package/dist/bundle/{chunk-MOKEB656.js → chunk-ZBYKCVSV.js} +1 -1
- package/dist/bundle/{chunk-BXHFJTU5.js → chunk-ZUG67442.js} +2 -2
- package/dist/bundle/{cli-L7P36YUH.js → cli-BS4L3HAP.js} +100 -70
- package/dist/bundle/{command-contract-EYFGMKIG.js → command-contract-HYURWSD6.js} +16 -17
- package/dist/bundle/{command-server-entry-H3VGPOLJ.js → command-server-entry-CJ2CV7ZV.js} +23 -24
- package/dist/bundle/{decode-JEU6JWCV.js → decode-E2NM5SSM.js} +3 -3
- package/dist/bundle/drive.js +4 -4
- package/dist/bundle/{echarts-SDZA2SWG.js → echarts-QIXLXS3G.js} +2 -2
- package/dist/bundle/{embed-WUKOASQG.js → embed-YNZW5X6M.js} +4 -4
- package/dist/bundle/{embedder-UBRAXRDZ.js → embedder-LRC2PKTS.js} +7 -7
- package/dist/bundle/{entry-C4NUQFTF.js → entry-2IMSWRJU.js} +7 -7
- package/dist/bundle/{first-run-PKHBS7B4.js → first-run-7CPHQDM5.js} +7 -7
- package/dist/bundle/first-screen-OKZ7GMFR.js +38 -0
- package/dist/bundle/{google-XXHSMTVK.js → google-WDKDBDD4.js} +15 -15
- package/dist/bundle/{google-api-SQQ4BSNR.js → google-api-7JDZDCWE.js} +52 -53
- package/dist/bundle/{grants-2U4JVT6O.js → grants-AU25GWKF.js} +57 -58
- package/dist/bundle/{identity-SRL6RSU2.js → identity-E43WKN5F.js} +1 -1
- package/dist/bundle/{instructions-7T6JJIFS.js → instructions-MD2RZT5Z.js} +1 -1
- package/dist/bundle/{login-N243GGEE.js → login-RBDJPQAG.js} +57 -58
- package/dist/bundle/{node-BZDMUFTW.js → node-IEVT2FSJ.js} +2 -2
- package/dist/bundle/{node-sqlite-SZQCCMV2.js → node-sqlite-IENH4TRX.js} +5 -5
- package/dist/bundle/{oauth-CMAFXX6A.js → oauth-3JGSN47Z.js} +5 -5
- package/dist/bundle/{open-RVTPKDA3.js → open-TZ5H7NYM.js} +3 -3
- package/dist/bundle/{openai-6NN63BMH.js → openai-XF2KB7W2.js} +14 -14
- package/dist/bundle/{process-756VBE7E.js → process-6Q23D3TO.js} +1 -1
- package/dist/bundle/{program-B4QBJYB5.js → program-D5XWOHV5.js} +86 -89
- package/dist/bundle/{prompt-HGP2DSRW.js → prompt-KUC5D4GX.js} +3 -3
- package/dist/bundle/{recognize-26SHB7HI.js → recognize-DPFW7HO3.js} +2 -2
- package/dist/bundle/{remote-Z4PWHZ5N.js → remote-MODTSUNH.js} +8 -8
- package/dist/bundle/{rerank-QHJZJK3Q.js → rerank-JK7SERLE.js} +5 -5
- package/dist/bundle/{serve-MYJW5IEM.js → serve-BV2WHZLW.js} +7 -7
- package/dist/bundle/server-6YDI4Y36.js +72 -0
- package/dist/bundle/{server-XFW3V7CR.js → server-N3WPEU7Z.js} +45 -44
- package/dist/bundle/{services-IQG2RVTO.js → services-SV6CFUCS.js} +42 -27
- package/dist/bundle/{sqlite-runtime-X4GB5PBV.js → sqlite-runtime-RZ5PLZVQ.js} +4 -4
- package/dist/bundle/{state-ATQK2X3W.js → state-RAZIREVG.js} +4 -4
- package/dist/bundle/{store-QUBUPK6F.js → store-2DLGLYS6.js} +18 -14
- package/dist/bundle/{store-MEHEUOJH.js → store-DQKJKX2G.js} +12 -12
- package/dist/bundle/store-maintenance-command-UJ5F5L4H.js +64 -0
- package/dist/bundle/tokens-LY3WML55.js +110 -0
- package/dist/policy.d.ts +1 -1
- package/dist/policy.d.ts.map +1 -1
- package/dist/policy.js +3 -3
- package/dist/policy.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/dist/bundle/chunk-2UHQVRH2.js +0 -1235
- package/dist/bundle/chunk-J5LXL435.js +0 -1316
- package/dist/bundle/chunk-R5FTCNLJ.js +0 -76
- package/dist/bundle/first-screen-QOVOM4BF.js +0 -39
- package/dist/bundle/server-HBZPIHDX.js +0 -74
- package/dist/bundle/store-maintenance-command-33ULVDWY.js +0 -65
- package/dist/bundle/tokens-A2GP4F34.js +0 -111
|
@@ -5,11 +5,9 @@ import {
|
|
|
5
5
|
answerProjectionSchema,
|
|
6
6
|
answerSchema,
|
|
7
7
|
describeOptions,
|
|
8
|
+
keyForCommand,
|
|
8
9
|
metaOf
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import {
|
|
11
|
-
keyForCommand
|
|
12
|
-
} from "./chunk-J5LXL435.js";
|
|
10
|
+
} from "./chunk-25FT44S3.js";
|
|
13
11
|
import {
|
|
14
12
|
jsonSchemaOf
|
|
15
13
|
} from "./chunk-JRFKCYMW.js";
|
|
@@ -20,7 +18,7 @@ import {
|
|
|
20
18
|
__name
|
|
21
19
|
} from "./chunk-ZVVMGPBJ.js";
|
|
22
20
|
|
|
23
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/command-contract.js
|
|
24
22
|
var SCHEMA_DIALECT = "https://json-schema.org/draft/2020-12/schema";
|
|
25
23
|
var outputOf = /* @__PURE__ */ __name((command) => {
|
|
26
24
|
const entity = answerEntitySchema(command);
|
|
@@ -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.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/http/listen.js
|
|
8
8
|
import { createServer } from "node:http";
|
|
9
9
|
import { Readable } from "node:stream";
|
|
10
10
|
var MAX_BODY = 4 * 1024 * 1024;
|
|
@@ -3,10 +3,10 @@ const require = __bundleRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
secretNamed,
|
|
5
5
|
withoutSecrets
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VUPWDCYV.js";
|
|
7
7
|
import {
|
|
8
8
|
isCliFailure
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3YKAFLXY.js";
|
|
10
10
|
import {
|
|
11
11
|
isContentKey
|
|
12
12
|
} from "./chunk-5TK2YQCO.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
__name
|
|
15
15
|
} from "./chunk-ZVVMGPBJ.js";
|
|
16
16
|
|
|
17
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/runs/events.js
|
|
18
18
|
var providerErrorKey = /* @__PURE__ */ __name((value) => typeof value === "string" && /^[A-Za-z][A-Za-z0-9._-]{0,63}$/.test(value) ? value : void 0, "providerErrorKey");
|
|
19
19
|
var renderEvent = /* @__PURE__ */ __name((event) => {
|
|
20
20
|
if (event.event === "store")
|
|
@@ -66,11 +66,11 @@ var MARK = { request: "\u2192", response: "\u2190", cache: "\u2022", warning: "!
|
|
|
66
66
|
var age = /* @__PURE__ */ __name((ms) => ms < 1e3 ? `${ms}ms` : `${Math.round(ms / 1e3)}s`, "age");
|
|
67
67
|
var size = /* @__PURE__ */ __name((bytes) => bytes < 1e3 ? `${bytes} B` : `${(bytes / 1e3).toFixed(1)} kB`, "size");
|
|
68
68
|
|
|
69
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
69
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/runs/run-context.js
|
|
70
70
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
71
71
|
import { createHash } from "node:crypto";
|
|
72
72
|
|
|
73
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
73
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/runs/error-detail.js
|
|
74
74
|
import { homedir } from "node:os";
|
|
75
75
|
var MESSAGE_AT_MOST = 500;
|
|
76
76
|
var CAUSES_AT_MOST = 5;
|
|
@@ -183,7 +183,7 @@ var redactText = /* @__PURE__ */ __name((text) => {
|
|
|
183
183
|
return out.length > MESSAGE_AT_MOST ? `${out.slice(0, MESSAGE_AT_MOST)}\u2026` : out;
|
|
184
184
|
}, "redactText");
|
|
185
185
|
|
|
186
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
186
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/runs/run-context.js
|
|
187
187
|
var REDACTED = "[redacted]";
|
|
188
188
|
var keepsSuccess = /* @__PURE__ */ __name(({ record, fromFlag, env, caller, persistent = false }) => {
|
|
189
189
|
if (!record)
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
describeProgram,
|
|
7
7
|
flatten,
|
|
8
8
|
profileFree
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-25FT44S3.js";
|
|
10
10
|
import {
|
|
11
11
|
VERSION
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SYUXKV2E.js";
|
|
13
13
|
import {
|
|
14
14
|
CliError
|
|
15
15
|
} from "./chunk-EA2OB75T.js";
|
|
@@ -7,66 +7,65 @@ import {
|
|
|
7
7
|
agentJson,
|
|
8
8
|
commandAvailability,
|
|
9
9
|
failureContext
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SY2HLH5R.js";
|
|
11
11
|
import {
|
|
12
12
|
callerOf
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-WNMPIRRF.js";
|
|
14
14
|
import {
|
|
15
|
-
QUERY_ARGUMENT,
|
|
16
15
|
lentConnection,
|
|
17
16
|
refuseLacking
|
|
18
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-RLGQMMYE.js";
|
|
19
18
|
import {
|
|
19
|
+
QUERY_ARGUMENT,
|
|
20
20
|
onlineDeps,
|
|
21
21
|
servicesFor,
|
|
22
22
|
storeModeDeps
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-HEBZCKMU.js";
|
|
24
24
|
import {
|
|
25
25
|
DEFAULT_OUTPUT_BYTES,
|
|
26
26
|
ENTITIES,
|
|
27
27
|
LOCAL_WRITE,
|
|
28
28
|
REMOTE_WRITE,
|
|
29
29
|
answerSchema,
|
|
30
|
+
authorityAllowed,
|
|
31
|
+
botApiAllowed,
|
|
30
32
|
changesMessenger,
|
|
33
|
+
fetchesAt,
|
|
31
34
|
flatten,
|
|
32
35
|
judgedAnswer,
|
|
33
36
|
judgedEffects,
|
|
37
|
+
keyForCommand,
|
|
38
|
+
levelFor,
|
|
34
39
|
listOf,
|
|
40
|
+
readKeysForCommand,
|
|
35
41
|
refuseStoreChange,
|
|
36
42
|
sealed,
|
|
37
43
|
startRecording
|
|
38
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-25FT44S3.js";
|
|
39
45
|
import {
|
|
40
46
|
currentCaller,
|
|
41
47
|
keepsSuccess,
|
|
42
48
|
runContextOf,
|
|
43
49
|
withCaller
|
|
44
|
-
} from "./chunk-
|
|
45
|
-
import {
|
|
46
|
-
authorityAllowed,
|
|
47
|
-
botApiAllowed,
|
|
48
|
-
keyForCommand,
|
|
49
|
-
levelFor,
|
|
50
|
-
readKeysForCommand
|
|
51
|
-
} from "./chunk-J5LXL435.js";
|
|
50
|
+
} from "./chunk-AD7VI3XU.js";
|
|
52
51
|
import {
|
|
53
52
|
MAX_BUFFERED_INPUT
|
|
54
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-2Q4CB4EI.js";
|
|
55
54
|
import {
|
|
56
55
|
enclosingTraceId,
|
|
57
56
|
inRun,
|
|
58
57
|
newRunId,
|
|
59
58
|
traceOf
|
|
60
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-I55XYREN.js";
|
|
61
60
|
import {
|
|
62
61
|
queryDescription
|
|
63
62
|
} from "./chunk-UPCEHSIZ.js";
|
|
64
63
|
import {
|
|
65
64
|
storeDamaged
|
|
66
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-3YKAFLXY.js";
|
|
67
66
|
import {
|
|
68
67
|
captureStreams
|
|
69
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-5SJZDEIO.js";
|
|
70
69
|
import {
|
|
71
70
|
errorObjectOf,
|
|
72
71
|
mcpErrorResult
|
|
@@ -119,7 +118,7 @@ import {
|
|
|
119
118
|
__name
|
|
120
119
|
} from "./chunk-ZVVMGPBJ.js";
|
|
121
120
|
|
|
122
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
121
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/mcp/agent.js
|
|
123
122
|
import { Readable } from "node:stream";
|
|
124
123
|
|
|
125
124
|
// node_modules/.pnpm/@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/lint.js
|
|
@@ -3291,7 +3290,7 @@ var VOCABULARY = defineVocabulary({
|
|
|
3291
3290
|
]
|
|
3292
3291
|
});
|
|
3293
3292
|
|
|
3294
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3293
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/mcp/agent.js
|
|
3295
3294
|
var TYPES = new Map(VOCABULARY.flags.map((flag) => [flag.name, flag.type]));
|
|
3296
3295
|
var snake = /* @__PURE__ */ __name((name) => name.replaceAll("|", "_or_").replace(/[^a-z0-9]+/gi, "_"), "snake");
|
|
3297
3296
|
var longOf = /* @__PURE__ */ __name((option) => option.flags.match(/--[a-z0-9][a-z0-9-]*/)?.[0], "longOf");
|
|
@@ -3518,7 +3517,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3518
3517
|
}
|
|
3519
3518
|
}, "runCommandForAgent");
|
|
3520
3519
|
|
|
3521
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3520
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/mcp/tool.js
|
|
3522
3521
|
var limit = optional(pipe(number(), integer(), minValue(1), maxValue(100), description("how many")));
|
|
3523
3522
|
var page = optional(pipe(number(), integer(), minValue(1), description("which page, from 1")));
|
|
3524
3523
|
var message = pipe(
|
|
@@ -3572,8 +3571,8 @@ var toolKey = /* @__PURE__ */ __name((name, definition) => definition.key !== vo
|
|
|
3572
3571
|
var inputOf = /* @__PURE__ */ __name((definition, syncAllowed) => strictObject(syncAllowed || !("sync_first" in definition.input.entries) ? definition.input.entries : Object.fromEntries(Object.entries(definition.input.entries).filter(([name]) => !["sync_first", "sync_time", "max_chats", "max_messages"].includes(name)))), "inputOf");
|
|
3573
3572
|
var syncAllowedFor = /* @__PURE__ */ __name((key2, defaults) => {
|
|
3574
3573
|
const permissions = defaults.settings.permissions ?? {};
|
|
3575
|
-
const shared = defaults.syncAllowed ?? levelFor(permissions, "messages.sync-first").level
|
|
3576
|
-
return shared && (!key2.startsWith("stats_") || levelFor(permissions, `${key2.replaceAll("_", ".")}.sync-first`).level
|
|
3574
|
+
const shared = defaults.syncAllowed ?? fetchesAt(levelFor(permissions, "messages.sync-first").level);
|
|
3575
|
+
return shared && (!key2.startsWith("stats_") || fetchesAt(levelFor(permissions, `${key2.replaceAll("_", ".")}.sync-first`).level));
|
|
3577
3576
|
}, "syncAllowedFor");
|
|
3578
3577
|
var entryRunner = /* @__PURE__ */ __name((registration) => {
|
|
3579
3578
|
const run = callRunner(registration);
|
|
@@ -3736,7 +3735,7 @@ var BinaryResource = class {
|
|
|
3736
3735
|
};
|
|
3737
3736
|
var answered = /* @__PURE__ */ __name((answer, maxBytes = DEFAULT_OUTPUT_BYTES, targets) => {
|
|
3738
3737
|
const bounded = /* @__PURE__ */ __name((result) => {
|
|
3739
|
-
if (maxBytes !== 0 && Buffer.byteLength(JSON.stringify(result)) > maxBytes)
|
|
3738
|
+
if (maxBytes !== 0 && Buffer.byteLength(JSON.stringify(result.content)) > maxBytes)
|
|
3740
3739
|
throw new CliError("invalid_response", "tool output exceeds its byte limit \u2014 reduce limit or use a narrower request", { reason: "output.too-large", max_bytes: maxBytes, retryable: false });
|
|
3741
3740
|
return result;
|
|
3742
3741
|
}, "bounded");
|
|
@@ -3777,7 +3776,7 @@ var failed = /* @__PURE__ */ __name((error, errors, effects) => {
|
|
|
3777
3776
|
return mcpErrorResult(JSON.parse(agentJson(errorObjectOf(storeDamaged(error), context))));
|
|
3778
3777
|
}, "failed");
|
|
3779
3778
|
|
|
3780
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3779
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/mcp/surface.js
|
|
3781
3780
|
import { randomUUID } from "node:crypto";
|
|
3782
3781
|
var MATCHES = 8;
|
|
3783
3782
|
var ANSWER = answerSchema();
|
|
@@ -2,17 +2,17 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
stdinFieldOf
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MHXZ62CU.js";
|
|
6
6
|
import {
|
|
7
7
|
isCommandServer
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-XUHQ7DVT.js";
|
|
9
9
|
import {
|
|
10
10
|
commandPathOf
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6EL5AVXX.js";
|
|
12
12
|
import {
|
|
13
13
|
commandServerRequest,
|
|
14
14
|
metaOf
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-25FT44S3.js";
|
|
16
16
|
import {
|
|
17
17
|
errorObjectOf,
|
|
18
18
|
renderError
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
__name
|
|
25
25
|
} from "./chunk-ZVVMGPBJ.js";
|
|
26
26
|
|
|
27
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/command-server.js
|
|
28
28
|
import { createInterface } from "node:readline";
|
|
29
29
|
var COMMAND_SERVER_PROTOCOL = 1;
|
|
30
30
|
var COMMAND_SERVER_IDLE_MS = 10 * 6e4;
|
|
@@ -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.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/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");
|
|
@@ -2,10 +2,11 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
storePath
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-RWQ7T4Y5.js";
|
|
6
6
|
import {
|
|
7
|
-
resolvePaths
|
|
8
|
-
|
|
7
|
+
resolvePaths,
|
|
8
|
+
writeSecurely
|
|
9
|
+
} from "./chunk-5SJZDEIO.js";
|
|
9
10
|
import {
|
|
10
11
|
singleLine
|
|
11
12
|
} from "./chunk-HCZYJMBP.js";
|
|
@@ -16,11 +17,295 @@ import {
|
|
|
16
17
|
__name
|
|
17
18
|
} from "./chunk-ZVVMGPBJ.js";
|
|
18
19
|
|
|
19
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20
|
-
import { mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from "node:fs";
|
|
20
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/store/shared-config.js
|
|
21
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from "node:fs";
|
|
21
22
|
import { dirname, join, resolve } from "node:path";
|
|
22
23
|
|
|
23
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/config-repair.js
|
|
25
|
+
var REPAIR_WORDS = {
|
|
26
|
+
byte_order_mark: "an invisible byte-order mark at the start",
|
|
27
|
+
comment: "a comment, which JSON does not allow",
|
|
28
|
+
trailing_comma: "a comma before a closing bracket",
|
|
29
|
+
missing_comma: "a missing comma",
|
|
30
|
+
unquoted_key: "a key without double quotes",
|
|
31
|
+
single_quotes: "text in single quotes",
|
|
32
|
+
missing_closer: "the file stops before its closing brackets \u2014 whatever followed this line was already lost"
|
|
33
|
+
};
|
|
34
|
+
var GiveUp = class {
|
|
35
|
+
static {
|
|
36
|
+
__name(this, "GiveUp");
|
|
37
|
+
}
|
|
38
|
+
at;
|
|
39
|
+
why;
|
|
40
|
+
constructor(at, why) {
|
|
41
|
+
this.at = at;
|
|
42
|
+
this.why = why;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
var NUMBER = /^-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?/;
|
|
46
|
+
var LITERAL = /^(true|false|null)/;
|
|
47
|
+
var KEY = /^[A-Za-z_$][\w$.-]*/;
|
|
48
|
+
var ENDS_VALUE = /^[\s,\]}/]?$/;
|
|
49
|
+
var repairConfigText = /* @__PURE__ */ __name((text) => {
|
|
50
|
+
try {
|
|
51
|
+
JSON.parse(text);
|
|
52
|
+
return { state: "valid" };
|
|
53
|
+
} catch {
|
|
54
|
+
}
|
|
55
|
+
const fixes = [];
|
|
56
|
+
const lineAt = /* @__PURE__ */ __name((offset) => text.slice(0, offset).split("\n").length, "lineAt");
|
|
57
|
+
const fix = /* @__PURE__ */ __name((kind, offset) => fixes.push({ kind, line: lineAt(offset) }), "fix");
|
|
58
|
+
const giveUp = /* @__PURE__ */ __name((why, offset = at) => {
|
|
59
|
+
throw new GiveUp(offset, why);
|
|
60
|
+
}, "giveUp");
|
|
61
|
+
let at = 0;
|
|
62
|
+
let truncated = false;
|
|
63
|
+
let last = "open";
|
|
64
|
+
let lastEnd = 0;
|
|
65
|
+
const previous = /* @__PURE__ */ __name(() => last, "previous");
|
|
66
|
+
const skip = /* @__PURE__ */ __name(() => {
|
|
67
|
+
for (; ; ) {
|
|
68
|
+
while (/\s/.test(text[at] ?? ""))
|
|
69
|
+
at++;
|
|
70
|
+
if (text.startsWith("//", at)) {
|
|
71
|
+
fix("comment", at);
|
|
72
|
+
while (at < text.length && text[at] !== "\n")
|
|
73
|
+
at++;
|
|
74
|
+
} else if (text.startsWith("/*", at)) {
|
|
75
|
+
const end = text.indexOf("*/", at + 2);
|
|
76
|
+
if (end < 0)
|
|
77
|
+
giveUp("a /* comment is never closed");
|
|
78
|
+
fix("comment", at);
|
|
79
|
+
at = end + 2;
|
|
80
|
+
} else
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
}, "skip");
|
|
84
|
+
const string = /* @__PURE__ */ __name(() => {
|
|
85
|
+
const quote = text[at];
|
|
86
|
+
const start = at;
|
|
87
|
+
if (quote === "'")
|
|
88
|
+
fix("single_quotes", at);
|
|
89
|
+
at++;
|
|
90
|
+
let body = "";
|
|
91
|
+
for (; ; ) {
|
|
92
|
+
if (at >= text.length)
|
|
93
|
+
giveUp("the file stops inside a quoted text", start);
|
|
94
|
+
const char = text[at];
|
|
95
|
+
if (char === quote)
|
|
96
|
+
break;
|
|
97
|
+
if (text.charCodeAt(at) < 32)
|
|
98
|
+
giveUp("a line break inside a quoted text");
|
|
99
|
+
if (char === "\\") {
|
|
100
|
+
const next = text[at + 1] ?? "";
|
|
101
|
+
if (quote === "'" && next === "'")
|
|
102
|
+
body += "'";
|
|
103
|
+
else if (/^["\\/bfnrt]$/.test(next))
|
|
104
|
+
body += `\\${next}`;
|
|
105
|
+
else if (next === "u" && /^[0-9a-fA-F]{4}$/.test(text.slice(at + 2, at + 6))) {
|
|
106
|
+
body += text.slice(at, at + 6);
|
|
107
|
+
at += 4;
|
|
108
|
+
} else
|
|
109
|
+
giveUp("an escape JSON has no meaning for");
|
|
110
|
+
at += 2;
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
body += char === '"' ? '\\"' : char;
|
|
114
|
+
at++;
|
|
115
|
+
}
|
|
116
|
+
at++;
|
|
117
|
+
return JSON.parse(`"${body}"`);
|
|
118
|
+
}, "string");
|
|
119
|
+
const key = /* @__PURE__ */ __name(() => {
|
|
120
|
+
const char = text[at] ?? "";
|
|
121
|
+
if (char === '"' || char === "'")
|
|
122
|
+
return string();
|
|
123
|
+
const word = KEY.exec(text.slice(at))?.[0];
|
|
124
|
+
if (!word)
|
|
125
|
+
return giveUp("something other than a key where a key should be");
|
|
126
|
+
fix("unquoted_key", at);
|
|
127
|
+
at += word.length;
|
|
128
|
+
return word;
|
|
129
|
+
}, "key");
|
|
130
|
+
const scalar = /* @__PURE__ */ __name(() => {
|
|
131
|
+
const char = text[at] ?? "";
|
|
132
|
+
if (char === '"' || char === "'")
|
|
133
|
+
return { json: JSON.stringify(string()) };
|
|
134
|
+
const word = (NUMBER.exec(text.slice(at)) ?? LITERAL.exec(text.slice(at)))?.[0];
|
|
135
|
+
if (!word || !ENDS_VALUE.test(text[at + word.length] ?? ""))
|
|
136
|
+
return giveUp("a value that is not JSON \u2014 text needs quotes, and only true, false and null go without");
|
|
137
|
+
if (at + word.length === text.length && NUMBER.test(word))
|
|
138
|
+
giveUp("the file stops inside a number");
|
|
139
|
+
at += word.length;
|
|
140
|
+
return { json: word };
|
|
141
|
+
}, "scalar");
|
|
142
|
+
const members = /* @__PURE__ */ __name((close, one) => {
|
|
143
|
+
const out = [];
|
|
144
|
+
at++;
|
|
145
|
+
last = "open";
|
|
146
|
+
let comma = -1;
|
|
147
|
+
for (; ; ) {
|
|
148
|
+
skip();
|
|
149
|
+
if (truncated)
|
|
150
|
+
return out;
|
|
151
|
+
if (at >= text.length) {
|
|
152
|
+
if (previous() === "close")
|
|
153
|
+
giveUp("the file stops after a closing bracket, so which brackets are missing has two readings");
|
|
154
|
+
if (previous() === "comma")
|
|
155
|
+
fix("trailing_comma", comma);
|
|
156
|
+
fix("missing_closer", text.length);
|
|
157
|
+
truncated = true;
|
|
158
|
+
return out;
|
|
159
|
+
}
|
|
160
|
+
const char = text[at];
|
|
161
|
+
if (char === close) {
|
|
162
|
+
if (previous() === "comma")
|
|
163
|
+
fix("trailing_comma", comma);
|
|
164
|
+
at++;
|
|
165
|
+
last = "close";
|
|
166
|
+
return out;
|
|
167
|
+
}
|
|
168
|
+
if (char === "}" || char === "]")
|
|
169
|
+
giveUp(`a ${char} where ${close} should close`);
|
|
170
|
+
if (char === ",") {
|
|
171
|
+
if (previous() !== "value" && previous() !== "close")
|
|
172
|
+
giveUp("a comma with nothing before it");
|
|
173
|
+
comma = at;
|
|
174
|
+
at++;
|
|
175
|
+
last = "comma";
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
if (previous() === "value" || previous() === "close") {
|
|
179
|
+
if (lineAt(at) === lineAt(lastEnd))
|
|
180
|
+
giveUp("two entries on one line with no comma between them");
|
|
181
|
+
fix("missing_comma", lastEnd);
|
|
182
|
+
}
|
|
183
|
+
out.push(one());
|
|
184
|
+
}
|
|
185
|
+
}, "members");
|
|
186
|
+
const value = /* @__PURE__ */ __name(() => {
|
|
187
|
+
const char = text[at] ?? "";
|
|
188
|
+
let node;
|
|
189
|
+
if (char === "{") {
|
|
190
|
+
const seen = /* @__PURE__ */ new Set();
|
|
191
|
+
node = {
|
|
192
|
+
object: members("}", () => {
|
|
193
|
+
const start = at;
|
|
194
|
+
const name = key();
|
|
195
|
+
if (seen.has(name))
|
|
196
|
+
giveUp("a key appears twice in one object", start);
|
|
197
|
+
seen.add(name);
|
|
198
|
+
skip();
|
|
199
|
+
if (at >= text.length)
|
|
200
|
+
giveUp("the file stops after a key, before its value");
|
|
201
|
+
if (text[at] !== ":")
|
|
202
|
+
giveUp("a key with no colon after it");
|
|
203
|
+
at++;
|
|
204
|
+
skip();
|
|
205
|
+
if (at >= text.length)
|
|
206
|
+
giveUp("the file stops after a key, before its value");
|
|
207
|
+
return [name, value()];
|
|
208
|
+
})
|
|
209
|
+
};
|
|
210
|
+
} else if (char === "[") {
|
|
211
|
+
node = {
|
|
212
|
+
array: members("]", () => {
|
|
213
|
+
return value();
|
|
214
|
+
})
|
|
215
|
+
};
|
|
216
|
+
} else
|
|
217
|
+
node = scalar();
|
|
218
|
+
if (!truncated) {
|
|
219
|
+
last = "json" in node ? "value" : "close";
|
|
220
|
+
lastEnd = at;
|
|
221
|
+
}
|
|
222
|
+
return node;
|
|
223
|
+
}, "value");
|
|
224
|
+
try {
|
|
225
|
+
if (text.includes("\0") || text.includes(String.fromCharCode(65533)))
|
|
226
|
+
giveUp("the file is not text", 0);
|
|
227
|
+
if (text.charCodeAt(0) === 65279) {
|
|
228
|
+
fix("byte_order_mark", 0);
|
|
229
|
+
at = 1;
|
|
230
|
+
}
|
|
231
|
+
skip();
|
|
232
|
+
if (text[at] !== "{")
|
|
233
|
+
giveUp(at >= text.length ? "the file is empty" : "the file does not start with {");
|
|
234
|
+
const root = value();
|
|
235
|
+
skip();
|
|
236
|
+
if (at < text.length)
|
|
237
|
+
giveUp("more text after the closing }");
|
|
238
|
+
const repaired = `${serialise(root, "")}
|
|
239
|
+
`;
|
|
240
|
+
JSON.parse(repaired);
|
|
241
|
+
return { state: "repaired", text: repaired, fixes };
|
|
242
|
+
} catch (error) {
|
|
243
|
+
if (!(error instanceof GiveUp))
|
|
244
|
+
throw error;
|
|
245
|
+
const before = text.slice(0, error.at).split("\n");
|
|
246
|
+
return {
|
|
247
|
+
state: "refused",
|
|
248
|
+
line: before.length,
|
|
249
|
+
column: (before.at(-1)?.length ?? 0) + 1,
|
|
250
|
+
why: error.why
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
}, "repairConfigText");
|
|
254
|
+
var serialise = /* @__PURE__ */ __name((node, indent) => {
|
|
255
|
+
if ("json" in node)
|
|
256
|
+
return node.json;
|
|
257
|
+
const inner = `${indent} `;
|
|
258
|
+
const parts = "object" in node ? node.object.map(([name, item]) => `${inner}${JSON.stringify(name)}: ${serialise(item, inner)}`) : node.array.map((item) => `${inner}${serialise(item, inner)}`);
|
|
259
|
+
const [open, close] = "object" in node ? ["{", "}"] : ["[", "]"];
|
|
260
|
+
return parts.length === 0 ? `${open}${close}` : `${open}
|
|
261
|
+
${parts.join(",\n")}
|
|
262
|
+
${indent}${close}`;
|
|
263
|
+
}, "serialise");
|
|
264
|
+
var SAFE_REPAIRS = /* @__PURE__ */ new Set([
|
|
265
|
+
"byte_order_mark",
|
|
266
|
+
"comment",
|
|
267
|
+
"trailing_comma",
|
|
268
|
+
"missing_comma"
|
|
269
|
+
]);
|
|
270
|
+
var FIX_FOR = {
|
|
271
|
+
unquoted_key: /* @__PURE__ */ __name((line) => `put the key on line ${line} in double quotes`, "unquoted_key"),
|
|
272
|
+
single_quotes: /* @__PURE__ */ __name((line) => `use double quotes for the text on line ${line}`, "single_quotes"),
|
|
273
|
+
missing_closer: /* @__PURE__ */ __name((line) => `add the closing } or ] the file lacks after line ${line}, and check that nothing after it was lost`, "missing_closer")
|
|
274
|
+
};
|
|
275
|
+
var FIX_FOR_REFUSAL = [
|
|
276
|
+
[/no comma between/, (line, before) => `add a comma after ${before} on line ${line}`],
|
|
277
|
+
[/no colon after/, (line) => `add a colon after the key on line ${line}`],
|
|
278
|
+
[/comma with nothing before/, (line) => `remove the extra comma on line ${line}`],
|
|
279
|
+
[/inside a quoted text/, (line) => `close the quotes on line ${line}`],
|
|
280
|
+
[/value that is not JSON/, (line) => `put the value on line ${line} in double quotes`],
|
|
281
|
+
[/key appears twice/, (line) => `keep one of the two keys named on line ${line}; the file holds both`]
|
|
282
|
+
];
|
|
283
|
+
var shown = /* @__PURE__ */ __name((line) => line.trim().replace(/("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[^\s"',:{}[\]]+)(\s*:)?/g, (token, _value, key) => key || /^(true|false|null)$/.test(token) ? token : '"\u2026"'), "shown");
|
|
284
|
+
var explainBrokenJson = /* @__PURE__ */ __name((text, result) => {
|
|
285
|
+
const lines = text.replace(/^\uFEFF/u, "").split(/\r?\n/);
|
|
286
|
+
const around = /* @__PURE__ */ __name((line2) => {
|
|
287
|
+
const near = lines[line2 - 1]?.trim() ? lines[line2 - 1] : lines[line2 - 2];
|
|
288
|
+
return near ? ` \u2014 near \`${shown(near)}\`` : "";
|
|
289
|
+
}, "around");
|
|
290
|
+
if (result.state === "repaired") {
|
|
291
|
+
const asked = result.fixes.find((one) => !SAFE_REPAIRS.has(one.kind)) ?? result.fixes[0];
|
|
292
|
+
if (!asked)
|
|
293
|
+
return "it is not valid JSON";
|
|
294
|
+
const fix2 = FIX_FOR[asked.kind]?.(asked.line);
|
|
295
|
+
return `line ${asked.line} has ${REPAIR_WORDS[asked.kind]}${around(asked.line)}${fix2 ? `; likely fix: ${fix2}` : ""}`;
|
|
296
|
+
}
|
|
297
|
+
if (result.state === "valid")
|
|
298
|
+
return "it is valid JSON";
|
|
299
|
+
const { line, why } = result;
|
|
300
|
+
const column = line === 1 && text.charCodeAt(0) === 65279 ? result.column - 1 : result.column;
|
|
301
|
+
const head = (lines[line - 1] ?? "").slice(0, column - 1);
|
|
302
|
+
const entry = head.slice(Math.max(head.lastIndexOf(","), head.lastIndexOf("{"), head.lastIndexOf("[")) + 1);
|
|
303
|
+
const before = shown(entry) || shown(lines[line - 2] ?? "");
|
|
304
|
+
const fix = FIX_FOR_REFUSAL.find(([pattern]) => pattern.test(why))?.[1](line, `\`${before}\``);
|
|
305
|
+
return `line ${line}, column ${column}: ${why}${around(line)}; likely fix: ${fix ?? "correct that part by hand"}`;
|
|
306
|
+
}, "explainBrokenJson");
|
|
307
|
+
|
|
308
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/task-categories.js
|
|
24
309
|
var DEFAULT_TASK_CATEGORIES = [
|
|
25
310
|
{
|
|
26
311
|
name: "taxes",
|
|
@@ -775,7 +1060,7 @@ var storedTaskCategories = /* @__PURE__ */ __name((json) => {
|
|
|
775
1060
|
}
|
|
776
1061
|
}, "storedTaskCategories");
|
|
777
1062
|
|
|
778
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1063
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/store/shared-config.js
|
|
779
1064
|
var SECTION = "task_categories";
|
|
780
1065
|
var sharedConfigPath = /* @__PURE__ */ __name((store, env = process.env) => {
|
|
781
1066
|
const paths = resolvePaths({ appName: "WireCat", prefix: "WIRECAT", env });
|
|
@@ -783,10 +1068,33 @@ var sharedConfigPath = /* @__PURE__ */ __name((store, env = process.env) => {
|
|
|
783
1068
|
return join(paths.config, "config.json");
|
|
784
1069
|
return resolve(store) === resolve(storePath({ ...env, MESSAGING_STORE: void 0 })) ? join(paths.config, "config.json") : join(dirname(store), "config.json");
|
|
785
1070
|
}, "sharedConfigPath");
|
|
1071
|
+
var backupPathFor = /* @__PURE__ */ __name((file) => {
|
|
1072
|
+
const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
1073
|
+
let path = `${file}.bak-${stamp}`;
|
|
1074
|
+
for (let n = 2; existsSync(path); n++)
|
|
1075
|
+
path = `${file}.bak-${stamp}-${n}`;
|
|
1076
|
+
return path;
|
|
1077
|
+
}, "backupPathFor");
|
|
1078
|
+
var mended = /* @__PURE__ */ __name((path, bytes) => {
|
|
1079
|
+
const text = bytes.toString("utf8");
|
|
1080
|
+
const result = repairConfigText(text);
|
|
1081
|
+
if (result.state === "repaired" && result.fixes.every((one) => SAFE_REPAIRS.has(one.kind))) {
|
|
1082
|
+
try {
|
|
1083
|
+
writeSecurely(backupPathFor(path), bytes, statSync(path).mode & 511);
|
|
1084
|
+
writeSecurely(path, result.text, 384);
|
|
1085
|
+
} catch {
|
|
1086
|
+
}
|
|
1087
|
+
return JSON.parse(result.text);
|
|
1088
|
+
}
|
|
1089
|
+
throw new CliError("configuration_error", `${path} is not valid JSON, ${explainBrokenJson(text, result)}`, {
|
|
1090
|
+
reason: "config.invalid_json",
|
|
1091
|
+
file: path
|
|
1092
|
+
});
|
|
1093
|
+
}, "mended");
|
|
786
1094
|
var readJson = /* @__PURE__ */ __name((path) => {
|
|
787
|
-
let
|
|
1095
|
+
let bytes;
|
|
788
1096
|
try {
|
|
789
|
-
|
|
1097
|
+
bytes = readFileSync(path);
|
|
790
1098
|
} catch (error) {
|
|
791
1099
|
if (error.code === "ENOENT")
|
|
792
1100
|
return void 0;
|
|
@@ -794,9 +1102,9 @@ var readJson = /* @__PURE__ */ __name((path) => {
|
|
|
794
1102
|
}
|
|
795
1103
|
let parsed;
|
|
796
1104
|
try {
|
|
797
|
-
parsed = JSON.parse(
|
|
798
|
-
} catch
|
|
799
|
-
|
|
1105
|
+
parsed = JSON.parse(bytes.toString("utf8"));
|
|
1106
|
+
} catch {
|
|
1107
|
+
parsed = mended(path, bytes);
|
|
800
1108
|
}
|
|
801
1109
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed))
|
|
802
1110
|
throw new CliError("configuration_error", `${path} must hold a JSON object`);
|
|
@@ -871,6 +1179,8 @@ var taskCategoriesReader = /* @__PURE__ */ __name((path) => {
|
|
|
871
1179
|
}, "taskCategoriesReader");
|
|
872
1180
|
|
|
873
1181
|
export {
|
|
1182
|
+
REPAIR_WORDS,
|
|
1183
|
+
repairConfigText,
|
|
874
1184
|
DEFAULT_TASK_CATEGORIES,
|
|
875
1185
|
FALLBACK_CATEGORY,
|
|
876
1186
|
unlistedNote,
|
|
@@ -878,6 +1188,7 @@ export {
|
|
|
878
1188
|
taskCategoryValue,
|
|
879
1189
|
storedTaskCategories,
|
|
880
1190
|
sharedConfigPath,
|
|
1191
|
+
backupPathFor,
|
|
881
1192
|
readTaskCategoryEdits,
|
|
882
1193
|
applyTaskCategoryEdits,
|
|
883
1194
|
editsFrom,
|