@wirecat/tg-cli 0.113.0 → 0.115.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/tg.js +6 -2
- package/dist/bin/tg.js.map +1 -1
- package/dist/bundle/{adapter-EQKEFGPB.js → adapter-ODK7R4LY.js} +56 -53
- package/dist/bundle/{all-profiles-TTBFF663.js → all-profiles-AQYM65BS.js} +9 -8
- package/dist/bundle/{anthropic-XPZS7267.js → anthropic-VBDSVNIM.js} +6 -5
- package/dist/bundle/{app-server-ZSZ7KRAY.js → app-server-YOIHLBNS.js} +47 -43
- package/dist/bundle/{bot-api-X7BOVNIO.js → bot-api-TRYLGQKK.js} +51 -47
- package/dist/bundle/{bot-history-DWIUIPN5.js → bot-history-7DTJLBBJ.js} +18 -16
- package/dist/bundle/{bun-ZGZVAJU2.js → bun-XIMM6EHD.js} +2 -2
- package/dist/bundle/{bun-sqlite-UN2UJ6SI.js → bun-sqlite-6B3BL5IV.js} +5 -4
- package/dist/bundle/{chunk-K3F46QVN.js → chunk-2TC76TLJ.js} +4 -4
- package/dist/bundle/{chunk-JRTZ5I6M.js → chunk-5ROWSRK7.js} +2 -2
- package/dist/bundle/{chunk-PHYDBR5M.js → chunk-63YKD7YA.js} +2 -2
- package/dist/bundle/{chunk-PCRLXJRH.js → chunk-77M3IAVU.js} +193 -129
- package/dist/bundle/{chunk-VDATXIO4.js → chunk-A4BQGSKI.js} +9 -9
- package/dist/bundle/{chunk-HO53POQG.js → chunk-AICS3TSF.js} +8 -41
- package/dist/bundle/{chunk-AVUIWZTP.js → chunk-AVWPMJ6E.js} +2 -2
- package/dist/bundle/{chunk-G74QMORP.js → chunk-BEQPZA3S.js} +2 -2
- package/dist/bundle/{chunk-JO45BOYE.js → chunk-BIEBJLYO.js} +8 -3
- package/dist/bundle/{chunk-J6USEBA6.js → chunk-BPPRR7TV.js} +2200 -945
- package/dist/bundle/chunk-CCHHEMPM.js +71 -0
- package/dist/bundle/{chunk-T4TTRFP5.js → chunk-CNO3R4O4.js} +10 -8
- package/dist/bundle/{chunk-IDUYRTPF.js → chunk-D4E345BC.js} +2 -2
- package/dist/bundle/{chunk-OYNSFQ7K.js → chunk-D72URWJE.js} +1 -39
- package/dist/bundle/{chunk-T5RM4Y35.js → chunk-DIABP7ZP.js} +3 -3
- package/dist/bundle/chunk-EW3XTUPB.js +166 -0
- package/dist/bundle/{chunk-KOWQVHXI.js → chunk-GCFU6WBE.js} +3 -3
- package/dist/bundle/{chunk-6WJ5M2Q4.js → chunk-GWDMKEDY.js} +4 -4
- package/dist/bundle/{chunk-TQ6EA7TB.js → chunk-GX4DMI4H.js} +17 -16
- package/dist/bundle/{chunk-KK3JVOOV.js → chunk-HZKWB6WS.js} +36 -35
- package/dist/bundle/chunk-ILHTNOIV.js +23 -0
- package/dist/bundle/{chunk-JDQSX2JQ.js → chunk-IUDIRZVU.js} +8443 -7398
- package/dist/bundle/{chunk-TUD4MU7S.js → chunk-JZXQZW2D.js} +2 -2
- package/dist/bundle/{chunk-Q264PYGE.js → chunk-KDOBY524.js} +55 -20
- package/dist/bundle/{chunk-OQR442B6.js → chunk-KIZT2MI6.js} +1 -1
- package/dist/bundle/chunk-L4CMCC3V.js +34 -0
- package/dist/bundle/{chunk-IYKRHDX6.js → chunk-LUIPXRKN.js} +188 -57
- package/dist/bundle/{chunk-GX4LRLVD.js → chunk-M7B5IMH3.js} +5103 -937
- package/dist/bundle/{chunk-4GLMEES6.js → chunk-MUZ4KYGY.js} +4 -2
- package/dist/bundle/{chunk-KQ23JWLJ.js → chunk-NTW5ZE47.js} +164 -276
- package/dist/bundle/{chunk-UIVLDKWT.js → chunk-O7CBGHI7.js} +1 -1
- package/dist/bundle/{chunk-KVLCIZUK.js → chunk-OMP6ALBT.js} +3 -3
- package/dist/bundle/{chunk-VVA4555T.js → chunk-OSP335AJ.js} +8 -8
- package/dist/bundle/{chunk-EGR5IJCG.js → chunk-OUX3QMYI.js} +39 -31
- package/dist/bundle/{chunk-VDEXNNMH.js → chunk-PEJHI7QO.js} +6 -4
- package/dist/bundle/{chunk-6F6K3LWV.js → chunk-PEKTB3FQ.js} +18 -15
- package/dist/bundle/{chunk-Z6TRIW2O.js → chunk-POKTQZOM.js} +11 -9
- package/dist/bundle/chunk-PQLBPYJR.js +46 -0
- package/dist/bundle/{chunk-BI5YJZJB.js → chunk-PZAEI4NM.js} +115 -29
- package/dist/bundle/{chunk-HNN7EKIM.js → chunk-QK6VLKG5.js} +338 -169
- package/dist/bundle/{chunk-5NF7M4MN.js → chunk-RFRI2HFT.js} +1 -1
- package/dist/bundle/{chunk-OC4RRFKH.js → chunk-RHUNMU4Q.js} +6 -6
- package/dist/bundle/{chunk-PHPNA2HU.js → chunk-TMATSEP5.js} +14 -12
- package/dist/bundle/{chunk-JW7BMJ6O.js → chunk-TQYMLXDS.js} +5 -3
- package/dist/bundle/{chunk-MTX5EDYJ.js → chunk-U67TSAAO.js} +1136 -535
- package/dist/bundle/{chunk-7IWDS2CM.js → chunk-UBQ3LOF6.js} +4 -4
- package/dist/bundle/{chunk-UE75KPAC.js → chunk-UY7GJRGY.js} +4 -4
- package/dist/bundle/{chunk-OSBAISA5.js → chunk-VQCWVZWG.js} +8 -13
- package/dist/bundle/{chunk-XZ2ZHIAO.js → chunk-VVKEWWSO.js} +1 -1
- package/dist/bundle/{chunk-ENXO43TV.js → chunk-WDNNN3J4.js} +8 -8
- package/dist/bundle/{chunk-AGUCXSSM.js → chunk-WINKEV4F.js} +7 -20
- package/dist/bundle/{chunk-XXNJF3ZM.js → chunk-WMG4IGEB.js} +75 -33
- package/dist/bundle/{chunk-6OKGHHRL.js → chunk-WMRFAK5B.js} +35 -35
- package/dist/bundle/{chunk-4SQB5VKL.js → chunk-WOQGUIXE.js} +1 -1
- package/dist/bundle/{chunk-U3MJQLZQ.js → chunk-XIYRHIBK.js} +13 -13
- package/dist/bundle/{chunk-ZID2Y4XU.js → chunk-XY7IGVVS.js} +2 -2
- package/dist/bundle/{chunk-3MAYYFKY.js → chunk-Y3AQHPAJ.js} +1 -1
- package/dist/bundle/{chunk-WSAHUQ6K.js → chunk-YCUQKFGD.js} +3 -3
- package/dist/bundle/command-contract-YF4KGFXC.js +32 -0
- package/dist/bundle/{decode-AMQVTEMW.js → decode-2GATBZGH.js} +7 -6
- package/dist/bundle/dispatch-MJMW7WDH.js +411 -0
- package/dist/bundle/{echarts-ECYONFQJ.js → echarts-GKEZEAL7.js} +2 -2
- package/dist/bundle/{embed-VZYBZEWI.js → embed-TBQPLA4Y.js} +6 -5
- package/dist/bundle/{embedder-GSWBGHRK.js → embedder-B5DTNCRO.js} +11 -10
- package/dist/bundle/entry-A6DEW2TD.js +18 -0
- package/dist/bundle/failure-TLF3SISS.js +24 -0
- package/dist/bundle/first-run-3N5AABEY.js +27 -0
- package/dist/bundle/first-screen-HANARM67.js +30 -0
- package/dist/bundle/{instructions-AXLQQS3G.js → instructions-P5E34PQR.js} +1 -1
- package/dist/bundle/{mcp-VVMPUDSL.js → mcp-MNI62HHE.js} +5 -3
- package/dist/bundle/{node-7JHC5K77.js → node-GKPRXS5Y.js} +2 -2
- package/dist/bundle/{node-sqlite-LYJEK46T.js → node-sqlite-GIDPALK3.js} +11 -4
- package/dist/bundle/{oauth-BROPKI3K.js → oauth-C57W4IMD.js} +7 -6
- package/dist/bundle/{open-C6XQ46JK.js → open-E6Q4WRPU.js} +5 -3
- package/dist/bundle/{openai-VWSU7ZDD.js → openai-5WMXY2KP.js} +15 -14
- package/dist/bundle/{process-QKEFL5HL.js → process-U2P5Z6UF.js} +1 -1
- package/dist/bundle/{program-ACY7O33O.js → program-FEUDU6GF.js} +62 -57
- package/dist/bundle/{prompt-EGULVW2F.js → prompt-4NGAZGHE.js} +5 -4
- package/dist/bundle/{proxy-transport-KIMADLQ2.js → proxy-transport-MGCJ7JAW.js} +5 -4
- package/dist/bundle/{recognize-UMTKLWVR.js → recognize-EUHRBA7V.js} +4 -3
- package/dist/bundle/{remote-DABI7PSQ.js → remote-3JHLB2FV.js} +7 -6
- package/dist/bundle/{rerank-ZFATWWBE.js → rerank-ZZ45SZPC.js} +7 -6
- package/dist/bundle/{serve-B7YYCMGN.js → serve-XOGX5FC5.js} +12 -10
- package/dist/bundle/server-DRE5MJ76.js +59 -0
- package/dist/bundle/{server-DGKZISZH.js → server-I6O72XP5.js} +36 -34
- package/dist/bundle/{state-AQ2PABA5.js → state-BIUYTGH6.js} +6 -5
- package/dist/bundle/{store-46GJTFLJ.js → store-FOJFYOMR.js} +12 -10
- package/dist/bundle/store-maintenance-command-YKV2C34N.js +49 -0
- package/dist/bundle/tg.js +159 -14
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +6 -4
- package/dist/commands/context.js.map +1 -1
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +5 -0
- package/dist/reasons.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -4
- package/skills/tg-cli/SKILL.md +2 -0
- package/dist/bundle/chunk-452UZ2PU.js +0 -3603
- package/dist/bundle/command-contract-GV67H22L.js +0 -32
- package/dist/bundle/entry-LALZILY4.js +0 -14
- package/dist/bundle/first-run-LEAI623Q.js +0 -24
- package/dist/bundle/first-screen-MOCVLE23.js +0 -30
- package/dist/bundle/identity-54HA5GN6.js +0 -11
- package/dist/bundle/server-UC7UWUIS.js +0 -56
- package/dist/bundle/store-maintenance-command-FCFKHGRM.js +0 -45
- /package/dist/bundle/{chunk-HPXYN7F3.js → chunk-NUN6OGOV.js} +0 -0
|
@@ -2,12 +2,12 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
CliError
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CCHHEMPM.js";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-ZVVMGPBJ.js";
|
|
9
9
|
|
|
10
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/files/ordinary-file.js
|
|
11
11
|
import { constants } from "node:fs";
|
|
12
12
|
import { lstat, open } from "node:fs/promises";
|
|
13
13
|
var deviceOf = /* @__PURE__ */ __name((dev) => process.platform === "win32" ? BigInt.asUintN(32, dev) : dev, "deviceOf");
|
|
@@ -73,7 +73,7 @@ var syncDirectory = /* @__PURE__ */ __name(async (path) => {
|
|
|
73
73
|
}
|
|
74
74
|
}, "syncDirectory");
|
|
75
75
|
|
|
76
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
76
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/files/atomic-write.js
|
|
77
77
|
import { randomUUID } from "node:crypto";
|
|
78
78
|
import { constants as constants2 } from "node:fs";
|
|
79
79
|
import { link, open as open2, realpath, rename, unlink } from "node:fs/promises";
|
|
@@ -111,7 +111,7 @@ var writeFileAtomic = /* @__PURE__ */ __name(async (path, content, { mode = 384,
|
|
|
111
111
|
}
|
|
112
112
|
}, "writeFileAtomic");
|
|
113
113
|
|
|
114
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
114
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/files/bounded-utf8.js
|
|
115
115
|
var readBoundedUtf8File = /* @__PURE__ */ __name(async (path, { maxBytes }) => {
|
|
116
116
|
if (!Number.isSafeInteger(maxBytes) || maxBytes < 1 || maxBytes > 16 * 1024 * 1024)
|
|
117
117
|
throw new CliError("validation_error", "file maxBytes takes 1\u201316777216 bytes");
|
|
@@ -140,21 +140,21 @@ var readBoundedUtf8File = /* @__PURE__ */ __name(async (path, { maxBytes }) => {
|
|
|
140
140
|
}
|
|
141
141
|
}, "readBoundedUtf8File");
|
|
142
142
|
|
|
143
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
143
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/files/lock.js
|
|
144
144
|
import { mkdir as mkdir2 } from "node:fs/promises";
|
|
145
145
|
import { basename as basename2, dirname as dirname2 } from "node:path";
|
|
146
146
|
|
|
147
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
147
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/files/native-writer-lease.js
|
|
148
148
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
149
149
|
import { lstat as lstat3, mkdir, open as open3, realpath as realpath3, rmdir as rmdir2, unlink as unlink4 } from "node:fs/promises";
|
|
150
150
|
import { hostname as hostname2 } from "node:os";
|
|
151
151
|
import { join as join3 } from "node:path";
|
|
152
152
|
|
|
153
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
153
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/files/native-lease-inspection.js
|
|
154
154
|
import { lstat as lstat2, readdir, realpath as realpath2, unlink as unlink2 } from "node:fs/promises";
|
|
155
155
|
import { join as join2 } from "node:path";
|
|
156
156
|
|
|
157
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
157
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/files/native-lease-owner.js
|
|
158
158
|
import { hostname } from "node:os";
|
|
159
159
|
var missingLeaseFile = /* @__PURE__ */ __name((error) => typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT", "missingLeaseFile");
|
|
160
160
|
var readLeaseOwner = /* @__PURE__ */ __name(async (path, name, signal) => {
|
|
@@ -199,7 +199,7 @@ var leaseOwnerStatus = /* @__PURE__ */ __name((owner) => {
|
|
|
199
199
|
}
|
|
200
200
|
}, "leaseOwnerStatus");
|
|
201
201
|
|
|
202
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
202
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/files/native-lease-inspection.js
|
|
203
203
|
var leaseInspection = /* @__PURE__ */ __name((markerDirectory) => {
|
|
204
204
|
const inspect = /* @__PURE__ */ __name(async (destination, options = {}) => {
|
|
205
205
|
options.signal?.throwIfAborted();
|
|
@@ -258,7 +258,7 @@ var leaseInspection = /* @__PURE__ */ __name((markerDirectory) => {
|
|
|
258
258
|
return { inspect, recover };
|
|
259
259
|
}, "leaseInspection");
|
|
260
260
|
|
|
261
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
261
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/files/native-lease-release.js
|
|
262
262
|
import { rmdir, unlink as unlink3 } from "node:fs/promises";
|
|
263
263
|
var ownedNativeLease = /* @__PURE__ */ __name((path, name, owner, folder, identity) => {
|
|
264
264
|
let releasing;
|
|
@@ -283,7 +283,7 @@ var ownedNativeLease = /* @__PURE__ */ __name((path, name, owner, folder, identi
|
|
|
283
283
|
};
|
|
284
284
|
}, "ownedNativeLease");
|
|
285
285
|
|
|
286
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
286
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/files/native-writer-lease.js
|
|
287
287
|
var validName = /* @__PURE__ */ __name((value) => typeof value === "string" && value.length > 0 && value !== "." && value !== ".." && !/[\\/\0:]/.test(value), "validName");
|
|
288
288
|
var nativeWriterLeaseStore = /* @__PURE__ */ __name((layout) => {
|
|
289
289
|
const { markerDirectory, legacyMarker } = layout;
|
|
@@ -354,7 +354,7 @@ var nativeWriterLeaseStore = /* @__PURE__ */ __name((layout) => {
|
|
|
354
354
|
};
|
|
355
355
|
}, "nativeWriterLeaseStore");
|
|
356
356
|
|
|
357
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
357
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/files/lock.js
|
|
358
358
|
var acquireLock = /* @__PURE__ */ __name(async (path, { signal } = {}) => {
|
|
359
359
|
const folder = dirname2(path);
|
|
360
360
|
await mkdir2(folder, { recursive: true, mode: 448 });
|
|
@@ -369,7 +369,7 @@ var acquireLock = /* @__PURE__ */ __name(async (path, { signal } = {}) => {
|
|
|
369
369
|
});
|
|
370
370
|
}, "acquireLock");
|
|
371
371
|
|
|
372
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
372
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/files/safe-name.js
|
|
373
373
|
import { basename as basename3 } from "node:path";
|
|
374
374
|
var safeName = /* @__PURE__ */ __name((name, platform = process.platform) => {
|
|
375
375
|
let plain = name === void 0 ? "" : basename3(name.replaceAll("\\", "/")).replace(/[\p{Cc}---]/gu, "").replace(/^\.+/, "");
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
agentOf,
|
|
30
30
|
clientHash,
|
|
31
31
|
currentCaller
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-POKTQZOM.js";
|
|
33
33
|
import {
|
|
34
34
|
__name
|
|
35
35
|
} from "./chunk-ZVVMGPBJ.js";
|
|
@@ -541,7 +541,7 @@ function toError(value) {
|
|
|
541
541
|
}
|
|
542
542
|
__name(toError, "toError");
|
|
543
543
|
|
|
544
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
544
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/mcp/caller.js
|
|
545
545
|
var callingAgent = /* @__PURE__ */ __name((fallback, caller = currentCaller()) => {
|
|
546
546
|
const client = caller?.agent?.client?.name;
|
|
547
547
|
if (client && client !== "unknown")
|
|
@@ -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.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/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;
|
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
MAX_SECRET_INPUT,
|
|
5
5
|
bufferedInput,
|
|
6
6
|
inputPolicy
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-AVWPMJ6E.js";
|
|
8
8
|
import {
|
|
9
9
|
CliError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CCHHEMPM.js";
|
|
11
11
|
import {
|
|
12
12
|
__name
|
|
13
13
|
} from "./chunk-ZVVMGPBJ.js";
|
|
14
14
|
|
|
15
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/terminal/prompt.js
|
|
16
16
|
import { createInterface } from "node:readline";
|
|
17
17
|
import { Writable } from "node:stream";
|
|
18
18
|
var readSecret = /* @__PURE__ */ __name(async (prompt, { input = process.stdin, output = process.stderr, echo = false, signal: givenSignal } = {}) => {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
SCHEMA_DIALECT,
|
|
5
|
+
commandContract,
|
|
6
|
+
commandPathOf,
|
|
7
|
+
findCommand,
|
|
8
|
+
outputOf
|
|
9
|
+
} from "./chunk-AICS3TSF.js";
|
|
10
|
+
import "./chunk-M7B5IMH3.js";
|
|
11
|
+
import "./chunk-WMRFAK5B.js";
|
|
12
|
+
import "./chunk-POKTQZOM.js";
|
|
13
|
+
import "./chunk-OMP6ALBT.js";
|
|
14
|
+
import "./chunk-D4E345BC.js";
|
|
15
|
+
import "./chunk-KIZT2MI6.js";
|
|
16
|
+
import "./chunk-QK6VLKG5.js";
|
|
17
|
+
import "./chunk-A4BQGSKI.js";
|
|
18
|
+
import "./chunk-PEJHI7QO.js";
|
|
19
|
+
import "./chunk-63YKD7YA.js";
|
|
20
|
+
import "./chunk-NUN6OGOV.js";
|
|
21
|
+
import "./chunk-NTW5ZE47.js";
|
|
22
|
+
import "./chunk-77M3IAVU.js";
|
|
23
|
+
import "./chunk-Y5E2WNWB.js";
|
|
24
|
+
import "./chunk-CCHHEMPM.js";
|
|
25
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
26
|
+
export {
|
|
27
|
+
SCHEMA_DIALECT,
|
|
28
|
+
commandContract,
|
|
29
|
+
commandPathOf,
|
|
30
|
+
findCommand,
|
|
31
|
+
outputOf
|
|
32
|
+
};
|
|
@@ -3,19 +3,20 @@ const require = __bundleRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
SAMPLE_RATE,
|
|
5
5
|
decodeOgg
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import
|
|
9
|
-
CliError
|
|
10
|
-
} from "./chunk-PCRLXJRH.js";
|
|
6
|
+
} from "./chunk-RHUNMU4Q.js";
|
|
7
|
+
import "./chunk-NTW5ZE47.js";
|
|
8
|
+
import "./chunk-77M3IAVU.js";
|
|
11
9
|
import {
|
|
12
10
|
importFrom
|
|
13
11
|
} from "./chunk-Y5E2WNWB.js";
|
|
12
|
+
import {
|
|
13
|
+
CliError
|
|
14
|
+
} from "./chunk-CCHHEMPM.js";
|
|
14
15
|
import {
|
|
15
16
|
__name
|
|
16
17
|
} from "./chunk-ZVVMGPBJ.js";
|
|
17
18
|
|
|
18
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/speech/decode.js
|
|
19
20
|
import { spawn } from "node:child_process";
|
|
20
21
|
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
21
22
|
import { createRequire } from "node:module";
|
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
require_cross_spawn
|
|
5
|
+
} from "./chunk-D72URWJE.js";
|
|
6
|
+
import {
|
|
7
|
+
BUILT_IN_COMMANDS,
|
|
8
|
+
DESCRIBE_FLAG,
|
|
9
|
+
FIRST_PARTY_TOOLS,
|
|
10
|
+
PROGRAM_PREFIX,
|
|
11
|
+
TOOL_NAME,
|
|
12
|
+
fileState,
|
|
13
|
+
parseDescribe,
|
|
14
|
+
shimFiles,
|
|
15
|
+
writeShim
|
|
16
|
+
} from "./chunk-EW3XTUPB.js";
|
|
17
|
+
import "./chunk-Y5E2WNWB.js";
|
|
18
|
+
import {
|
|
19
|
+
CliError
|
|
20
|
+
} from "./chunk-CCHHEMPM.js";
|
|
21
|
+
import {
|
|
22
|
+
__name,
|
|
23
|
+
__toESM
|
|
24
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
25
|
+
|
|
26
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/dispatch.js
|
|
27
|
+
var import_cross_spawn2 = __toESM(require_cross_spawn(), 1);
|
|
28
|
+
import { randomUUID } from "node:crypto";
|
|
29
|
+
import { constants } from "node:os";
|
|
30
|
+
|
|
31
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/path.js
|
|
32
|
+
import { readdirSync, statSync } from "node:fs";
|
|
33
|
+
import { join } from "node:path";
|
|
34
|
+
var variable = /* @__PURE__ */ __name((env, name, platform) => platform === "win32" ? Object.entries(env).find(([key]) => key.toUpperCase() === name)?.[1] : env[name], "variable");
|
|
35
|
+
var pathEntries = /* @__PURE__ */ __name(({ env, platform }) => {
|
|
36
|
+
const raw = variable(env, "PATH", platform) ?? "";
|
|
37
|
+
const entries = raw.split(platform === "win32" ? ";" : ":").map((entry) => entry.replace(/^"(.*)"$/, "$1"));
|
|
38
|
+
const seen = /* @__PURE__ */ new Set();
|
|
39
|
+
return entries.filter((entry) => {
|
|
40
|
+
const key = platform === "win32" ? entry.toLowerCase().replace(/[\\/]+$/, "") : entry.replace(/\/+$/, "");
|
|
41
|
+
if (entry === "" || seen.has(key))
|
|
42
|
+
return false;
|
|
43
|
+
seen.add(key);
|
|
44
|
+
return true;
|
|
45
|
+
});
|
|
46
|
+
}, "pathEntries");
|
|
47
|
+
var programExtensions = /* @__PURE__ */ __name(({ env, platform }) => platform === "win32" ? (variable(env, "PATHEXT", platform) ?? ".COM;.EXE;.BAT;.CMD").split(";").filter((ext) => /^\.[a-z0-9]+$/i.test(ext)).map((ext) => ext.toLowerCase()) : [""], "programExtensions");
|
|
48
|
+
var isProgram = /* @__PURE__ */ __name((path, platform) => {
|
|
49
|
+
try {
|
|
50
|
+
const stat = statSync(path);
|
|
51
|
+
return stat.isFile() && (platform === "win32" || (stat.mode & 73) !== 0);
|
|
52
|
+
} catch {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}, "isProgram");
|
|
56
|
+
var findOnPath = /* @__PURE__ */ __name((command, search) => {
|
|
57
|
+
const extensions = programExtensions(search);
|
|
58
|
+
return pathEntries(search).flatMap((dir) => {
|
|
59
|
+
for (const extension of extensions) {
|
|
60
|
+
const path = join(dir, command + extension);
|
|
61
|
+
if (isProgram(path, search.platform))
|
|
62
|
+
return [path];
|
|
63
|
+
}
|
|
64
|
+
return [];
|
|
65
|
+
});
|
|
66
|
+
}, "findOnPath");
|
|
67
|
+
var findTools = /* @__PURE__ */ __name((search) => {
|
|
68
|
+
const extensions = programExtensions(search);
|
|
69
|
+
const tools = /* @__PURE__ */ new Map();
|
|
70
|
+
for (const dir of pathEntries(search)) {
|
|
71
|
+
let files;
|
|
72
|
+
try {
|
|
73
|
+
files = readdirSync(dir);
|
|
74
|
+
} catch {
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
const here = /* @__PURE__ */ new Map();
|
|
78
|
+
for (const file of files) {
|
|
79
|
+
if (!(search.platform === "win32" ? file.toLowerCase() : file).startsWith(PROGRAM_PREFIX))
|
|
80
|
+
continue;
|
|
81
|
+
const extension = extensions.find((ext) => ext !== "" && file.toLowerCase().endsWith(ext)) ?? "";
|
|
82
|
+
if (search.platform === "win32" && extension === "")
|
|
83
|
+
continue;
|
|
84
|
+
const base = search.platform === "win32" ? file.toLowerCase() : file;
|
|
85
|
+
const name = base.slice(PROGRAM_PREFIX.length, base.length - extension.length);
|
|
86
|
+
if (!TOOL_NAME.test(name))
|
|
87
|
+
continue;
|
|
88
|
+
const best = here.get(name);
|
|
89
|
+
const rank = /* @__PURE__ */ __name((path2) => extensions.findIndex((ext) => path2.toLowerCase().endsWith(ext)), "rank");
|
|
90
|
+
const path = join(dir, file);
|
|
91
|
+
if (best !== void 0 && rank(best) <= rank(path))
|
|
92
|
+
continue;
|
|
93
|
+
if (isProgram(path, search.platform))
|
|
94
|
+
here.set(name, path);
|
|
95
|
+
}
|
|
96
|
+
for (const [name, path] of here)
|
|
97
|
+
tools.set(name, [...tools.get(name) ?? [], path]);
|
|
98
|
+
}
|
|
99
|
+
return new Map([...tools].sort(([a], [b]) => a < b ? -1 : 1));
|
|
100
|
+
}, "findTools");
|
|
101
|
+
var isBuiltIn = /* @__PURE__ */ __name((name) => name === "wcat" || BUILT_IN_COMMANDS.includes(name), "isBuiltIn");
|
|
102
|
+
|
|
103
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/probe.js
|
|
104
|
+
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
105
|
+
import { readFileSync } from "node:fs";
|
|
106
|
+
var MAX_ANSWER_BYTES = 64 * 1024;
|
|
107
|
+
var probeDescribe = /* @__PURE__ */ __name((path, { env, timeoutMs }) => new Promise((resolve) => {
|
|
108
|
+
let child;
|
|
109
|
+
try {
|
|
110
|
+
child = (0, import_cross_spawn.default)(path, [DESCRIBE_FLAG], { stdio: ["ignore", "pipe", "ignore"], env, windowsHide: true });
|
|
111
|
+
} catch {
|
|
112
|
+
resolve(void 0);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const chunks = [];
|
|
116
|
+
let size = 0;
|
|
117
|
+
let settled = false;
|
|
118
|
+
const settle = /* @__PURE__ */ __name((answer) => {
|
|
119
|
+
if (settled)
|
|
120
|
+
return;
|
|
121
|
+
settled = true;
|
|
122
|
+
clearTimeout(timer);
|
|
123
|
+
resolve(answer);
|
|
124
|
+
}, "settle");
|
|
125
|
+
const giveUp = /* @__PURE__ */ __name(() => {
|
|
126
|
+
child.kill();
|
|
127
|
+
child.stdout?.destroy();
|
|
128
|
+
child.unref();
|
|
129
|
+
settle(void 0);
|
|
130
|
+
}, "giveUp");
|
|
131
|
+
const timer = setTimeout(giveUp, timeoutMs);
|
|
132
|
+
child.stdout?.on("data", (chunk) => {
|
|
133
|
+
size += chunk.length;
|
|
134
|
+
if (size > MAX_ANSWER_BYTES)
|
|
135
|
+
giveUp();
|
|
136
|
+
else
|
|
137
|
+
chunks.push(chunk);
|
|
138
|
+
});
|
|
139
|
+
child.once("error", () => settle(void 0));
|
|
140
|
+
child.once("close", (code) => settle(code === 0 ? parseDescribe(Buffer.concat(chunks).toString("utf8")) : void 0));
|
|
141
|
+
}), "probeDescribe");
|
|
142
|
+
var baseVersion = /* @__PURE__ */ __name(() => {
|
|
143
|
+
try {
|
|
144
|
+
const raw = readFileSync(new URL("../../package.json", new URL("wcat/probe.js", import.meta.resolve("@wirecat/cli-base")).href), "utf8");
|
|
145
|
+
const { name, version } = JSON.parse(raw);
|
|
146
|
+
return name === "@wirecat/cli-base" && typeof version === "string" ? version : "unknown";
|
|
147
|
+
} catch {
|
|
148
|
+
return "unknown";
|
|
149
|
+
}
|
|
150
|
+
}, "baseVersion");
|
|
151
|
+
|
|
152
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/shortcuts.js
|
|
153
|
+
import { closeSync, openSync, readSync, realpathSync, rmSync } from "node:fs";
|
|
154
|
+
import { basename, dirname } from "node:path";
|
|
155
|
+
var WIRECAT_PACKAGE = /node_modules[\\/]+@wirecat[\\/]/;
|
|
156
|
+
var isWirecatPackage = /* @__PURE__ */ __name((path) => {
|
|
157
|
+
try {
|
|
158
|
+
if (WIRECAT_PACKAGE.test(realpathSync(path)))
|
|
159
|
+
return true;
|
|
160
|
+
const buffer = Buffer.alloc(16 * 1024);
|
|
161
|
+
const fd = openSync(path, "r");
|
|
162
|
+
try {
|
|
163
|
+
const read = readSync(fd, buffer, 0, buffer.length, 0);
|
|
164
|
+
return WIRECAT_PACKAGE.test(buffer.subarray(0, read).toString("latin1"));
|
|
165
|
+
} finally {
|
|
166
|
+
closeSync(fd);
|
|
167
|
+
}
|
|
168
|
+
} catch {
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
}, "isWirecatPackage");
|
|
172
|
+
var ourShortcut = /* @__PURE__ */ __name((path) => {
|
|
173
|
+
const state = fileState(path);
|
|
174
|
+
return state.state === "ours" && state.mark.kind === "shortcut";
|
|
175
|
+
}, "ourShortcut");
|
|
176
|
+
var statusOf = /* @__PURE__ */ __name((name, program, search) => {
|
|
177
|
+
const files = shimFiles("shortcut", {
|
|
178
|
+
dir: dirname(program),
|
|
179
|
+
name,
|
|
180
|
+
target: basename(program),
|
|
181
|
+
platform: search.platform
|
|
182
|
+
});
|
|
183
|
+
const named = findOnPath(name, search);
|
|
184
|
+
const made = [...files.map((file) => file.path), ...named].find(ourShortcut);
|
|
185
|
+
if (made)
|
|
186
|
+
return { name, status: "made", path: made, program };
|
|
187
|
+
const first = named[0];
|
|
188
|
+
if (first === void 0)
|
|
189
|
+
return { name, status: "free", program };
|
|
190
|
+
return { name, status: isWirecatPackage(first) ? "package" : "taken", path: first, program };
|
|
191
|
+
}, "statusOf");
|
|
192
|
+
var changeFile = /* @__PURE__ */ __name((path, change) => {
|
|
193
|
+
try {
|
|
194
|
+
change();
|
|
195
|
+
} catch (error) {
|
|
196
|
+
throw new CliError("permission_error", `could not change ${path}: ${error.code ?? error}`, {
|
|
197
|
+
reason: "access.denied"
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
}, "changeFile");
|
|
201
|
+
var installedPrograms = /* @__PURE__ */ __name((search) => new Map([...findTools(search)].filter(([name]) => !isBuiltIn(name))), "installedPrograms");
|
|
202
|
+
var chosen = /* @__PURE__ */ __name((names, search) => {
|
|
203
|
+
const installed = installedPrograms(search);
|
|
204
|
+
if (names === void 0 || names.length === 0)
|
|
205
|
+
return [...installed].map(([name, paths]) => [name, paths[0]]);
|
|
206
|
+
const missing = names.filter((name) => !installed.has(name));
|
|
207
|
+
if (missing.length > 0)
|
|
208
|
+
throw new CliError("not_found", `not installed: ${missing.map((name) => `wcat-${name}`).join(", ")}`, {
|
|
209
|
+
reason: "tool.not-installed",
|
|
210
|
+
tool: missing[0],
|
|
211
|
+
installed: [...installed.keys()]
|
|
212
|
+
});
|
|
213
|
+
return [...new Set(names)].map((name) => [name, installed.get(name)[0]]);
|
|
214
|
+
}, "chosen");
|
|
215
|
+
var listShortcuts = /* @__PURE__ */ __name((search, names) => chosen(names, search).map(([name, program]) => statusOf(name, program, search)), "listShortcuts");
|
|
216
|
+
var addShortcuts = /* @__PURE__ */ __name((search, names) => listShortcuts(search, names).map((shortcut) => {
|
|
217
|
+
if (shortcut.status !== "free")
|
|
218
|
+
return { ...shortcut, changed: false };
|
|
219
|
+
const files = shimFiles("shortcut", {
|
|
220
|
+
dir: dirname(shortcut.program),
|
|
221
|
+
name: shortcut.name,
|
|
222
|
+
target: basename(shortcut.program),
|
|
223
|
+
platform: search.platform
|
|
224
|
+
});
|
|
225
|
+
for (const file of files)
|
|
226
|
+
changeFile(file.path, () => writeShim(file));
|
|
227
|
+
return { ...shortcut, status: "made", path: files[0]?.path, changed: true };
|
|
228
|
+
}), "addShortcuts");
|
|
229
|
+
var removeShortcuts = /* @__PURE__ */ __name((search, names) => listShortcuts(search, names).map((shortcut) => {
|
|
230
|
+
if (shortcut.status !== "made")
|
|
231
|
+
return { ...shortcut, changed: false };
|
|
232
|
+
const files = shimFiles("shortcut", {
|
|
233
|
+
dir: dirname(shortcut.path),
|
|
234
|
+
name: shortcut.name,
|
|
235
|
+
target: basename(shortcut.program),
|
|
236
|
+
platform: search.platform
|
|
237
|
+
});
|
|
238
|
+
for (const file of files)
|
|
239
|
+
if (ourShortcut(file.path))
|
|
240
|
+
changeFile(file.path, () => rmSync(file.path, { force: true }));
|
|
241
|
+
return { ...statusOf(shortcut.name, shortcut.program, search), changed: true };
|
|
242
|
+
}), "removeShortcuts");
|
|
243
|
+
|
|
244
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/dispatch.js
|
|
245
|
+
var DEFAULT_DESCRIBE_TIMEOUT_MS = 2e3;
|
|
246
|
+
var listTools = /* @__PURE__ */ __name(async (context) => {
|
|
247
|
+
const installed = installedPrograms(context);
|
|
248
|
+
const timeoutMs = context.describeTimeoutMs ?? DEFAULT_DESCRIBE_TIMEOUT_MS;
|
|
249
|
+
const found = await Promise.all([...installed].map(async ([name, paths]) => {
|
|
250
|
+
const [path, ...shadowed] = paths;
|
|
251
|
+
const own = context.self?.command === name ? context.self : void 0;
|
|
252
|
+
const described = own ?? await probeDescribe(path, { env: context.env, timeoutMs });
|
|
253
|
+
return {
|
|
254
|
+
name,
|
|
255
|
+
installed: true,
|
|
256
|
+
path,
|
|
257
|
+
...described?.version ? { version: described.version } : {},
|
|
258
|
+
...described?.description ? { description: described.description } : {},
|
|
259
|
+
...described?.docs ? { docs_url: described.docs } : {},
|
|
260
|
+
...shadowed.length > 0 ? { shadowed } : {}
|
|
261
|
+
};
|
|
262
|
+
}));
|
|
263
|
+
const missing = FIRST_PARTY_TOOLS.filter((tool) => tool.package && !installed.has(tool.name)).map((tool) => ({
|
|
264
|
+
name: tool.name,
|
|
265
|
+
installed: false,
|
|
266
|
+
package: tool.package,
|
|
267
|
+
install: `npm install -g ${tool.package}`
|
|
268
|
+
}));
|
|
269
|
+
return [...found, ...missing];
|
|
270
|
+
}, "listTools");
|
|
271
|
+
var envelope = /* @__PURE__ */ __name((items, started) => ({
|
|
272
|
+
items,
|
|
273
|
+
page: { mode: "page", limit: Math.max(items.length, 1), has_more: false },
|
|
274
|
+
meta: { run_id: randomUUID(), duration_ms: Math.max(0, Math.round(performance.now() - started)), complete: true }
|
|
275
|
+
}), "envelope");
|
|
276
|
+
var column = /* @__PURE__ */ __name((rows) => {
|
|
277
|
+
const widths = rows[0]?.map((_, at) => rows.reduce((wide, row) => Math.max(wide, (row[at] ?? "").length), 0)) ?? [];
|
|
278
|
+
return rows.map((row) => ` ${row.map((cell, at) => cell.padEnd(widths[at] ?? 0)).join(" ")}`.trimEnd());
|
|
279
|
+
}, "column");
|
|
280
|
+
var USAGE = [
|
|
281
|
+
"wcat <tool> [arguments] run a tool: wcat tg --help",
|
|
282
|
+
"wcat shortcuts [add|remove] [tool...] short names, such as tg, for installed tools",
|
|
283
|
+
"wcat --json the list below as JSON"
|
|
284
|
+
];
|
|
285
|
+
var listText = /* @__PURE__ */ __name((tools) => {
|
|
286
|
+
const installed = tools.filter((tool) => tool.installed);
|
|
287
|
+
const missing = tools.filter((tool) => !tool.installed);
|
|
288
|
+
return [
|
|
289
|
+
"wcat runs WireCat tools, and any other wcat-<name> program on PATH.",
|
|
290
|
+
"",
|
|
291
|
+
...USAGE,
|
|
292
|
+
"",
|
|
293
|
+
installed.length > 0 ? "Installed:" : "Installed: none",
|
|
294
|
+
...column(installed.map((tool) => [tool.name, tool.version ?? "", tool.description ?? "(no description)"])),
|
|
295
|
+
...missing.length > 0 ? ["", "Not installed:", ...column(missing.map((tool) => [tool.name, tool.install ?? ""]))] : [],
|
|
296
|
+
""
|
|
297
|
+
].join("\n");
|
|
298
|
+
}, "listText");
|
|
299
|
+
var shadowWarnings = /* @__PURE__ */ __name((tools) => tools.filter((tool) => tool.shadowed).map((tool) => `wcat: ${(tool.shadowed?.length ?? 0) + 1} programs are named ${PROGRAM_PREFIX}${tool.name}; wcat runs the first:
|
|
300
|
+
${[tool.path, ...tool.shadowed ?? []].map((path) => ` ${path}`).join("\n")}
|
|
301
|
+
`).join(""), "shadowWarnings");
|
|
302
|
+
var shortcutText = /* @__PURE__ */ __name((shortcuts2) => {
|
|
303
|
+
if (shortcuts2.length === 0)
|
|
304
|
+
return "No wcat-<name> programs are installed.\n";
|
|
305
|
+
const said = /* @__PURE__ */ __name((shortcut) => {
|
|
306
|
+
switch (shortcut.status) {
|
|
307
|
+
case "made":
|
|
308
|
+
return `made: ${shortcut.path}`;
|
|
309
|
+
case "free":
|
|
310
|
+
return shortcut.changed ? "removed" : "free: wcat shortcuts add makes it";
|
|
311
|
+
case "package":
|
|
312
|
+
return `installed by the package: ${shortcut.path}`;
|
|
313
|
+
case "taken":
|
|
314
|
+
return `taken by ${shortcut.path}`;
|
|
315
|
+
}
|
|
316
|
+
}, "said");
|
|
317
|
+
return `${column(shortcuts2.map((shortcut) => [shortcut.name, said(shortcut)])).join("\n")}
|
|
318
|
+
`;
|
|
319
|
+
}, "shortcutText");
|
|
320
|
+
var signalNumber = /* @__PURE__ */ __name((signal) => constants.signals[signal] ?? 1, "signalNumber");
|
|
321
|
+
var runTool = /* @__PURE__ */ __name((path, args, context) => new Promise((resolve, reject) => {
|
|
322
|
+
const signals = context.signals ?? process;
|
|
323
|
+
const child = (0, import_cross_spawn2.default)(path, [...args], { stdio: "inherit", env: context.env });
|
|
324
|
+
const pass = /* @__PURE__ */ __name((signal) => () => child.kill(signal), "pass");
|
|
325
|
+
const term = pass("SIGTERM");
|
|
326
|
+
const hup = pass("SIGHUP");
|
|
327
|
+
const ignore = /* @__PURE__ */ __name(() => {
|
|
328
|
+
}, "ignore");
|
|
329
|
+
signals.on("SIGTERM", term).on("SIGHUP", hup).on("SIGINT", ignore);
|
|
330
|
+
const done = /* @__PURE__ */ __name(() => signals.off("SIGTERM", term).off("SIGHUP", hup).off("SIGINT", ignore), "done");
|
|
331
|
+
child.once("error", (error) => {
|
|
332
|
+
done();
|
|
333
|
+
reject(new CliError("configuration_error", `could not start ${path}: ${error.message}`));
|
|
334
|
+
});
|
|
335
|
+
child.once("exit", (code, signal) => {
|
|
336
|
+
done();
|
|
337
|
+
resolve(code ?? (signal ? 128 + signalNumber(signal) : 1));
|
|
338
|
+
});
|
|
339
|
+
}), "runTool");
|
|
340
|
+
var fail = /* @__PURE__ */ __name(async (error, json, context) => {
|
|
341
|
+
const { errorObjectOf, exitCodeOfError, renderError } = await import("./failure-TLF3SISS.js");
|
|
342
|
+
const object = errorObjectOf(error);
|
|
343
|
+
context.stderr.write(`${renderError(object, { cli: "wcat", interactive: !json })}
|
|
344
|
+
`);
|
|
345
|
+
return exitCodeOfError(object);
|
|
346
|
+
}, "fail");
|
|
347
|
+
var shortcuts = /* @__PURE__ */ __name(async (args, json, context) => {
|
|
348
|
+
const [action, ...names] = args;
|
|
349
|
+
const started = performance.now();
|
|
350
|
+
const result = action === "add" ? addShortcuts(context, names) : action === "remove" ? removeShortcuts(context, names) : action === void 0 || action === "list" ? listShortcuts(context, names) : void 0;
|
|
351
|
+
if (result === void 0)
|
|
352
|
+
throw new CliError("validation_error", `wcat shortcuts takes list, add or remove, not "${action}"`, {
|
|
353
|
+
reason: "input.invalid"
|
|
354
|
+
});
|
|
355
|
+
context.stdout.write(json ? `${JSON.stringify(envelope(result, started))}
|
|
356
|
+
` : shortcutText(result));
|
|
357
|
+
return 0;
|
|
358
|
+
}, "shortcuts");
|
|
359
|
+
var runWcat = /* @__PURE__ */ __name(async (args, context) => {
|
|
360
|
+
const [first, ...rest] = args;
|
|
361
|
+
const json = args.includes("--json");
|
|
362
|
+
const words = args.filter((word) => word !== "--json");
|
|
363
|
+
const started = performance.now();
|
|
364
|
+
try {
|
|
365
|
+
if (first === "--version" || first === "-V" || first === "version") {
|
|
366
|
+
const tools = await listTools(context);
|
|
367
|
+
const by = context.self ? `, run by ${PROGRAM_PREFIX}${context.self.command} ${context.self.version}` : "";
|
|
368
|
+
context.stdout.write(`wcat ${baseVersion()} (@wirecat/cli-base${by})
|
|
369
|
+
|
|
370
|
+
${listText(tools)}`);
|
|
371
|
+
return 0;
|
|
372
|
+
}
|
|
373
|
+
if (words.length === 0 || first === "--help" || first === "-h" || first === "help") {
|
|
374
|
+
const tools = await listTools(context);
|
|
375
|
+
if (json)
|
|
376
|
+
context.stdout.write(`${JSON.stringify(envelope(tools, started))}
|
|
377
|
+
`);
|
|
378
|
+
else {
|
|
379
|
+
context.stderr.write(shadowWarnings(tools));
|
|
380
|
+
context.stdout.write(listText(tools));
|
|
381
|
+
}
|
|
382
|
+
return 0;
|
|
383
|
+
}
|
|
384
|
+
if (first === "shortcuts")
|
|
385
|
+
return await shortcuts(words.slice(1), json, context);
|
|
386
|
+
if (BUILT_IN_COMMANDS.includes(first))
|
|
387
|
+
throw new CliError("validation_error", `wcat ${first} is reserved for a later version of wcat`, {
|
|
388
|
+
reason: "input.invalid"
|
|
389
|
+
});
|
|
390
|
+
if (first?.startsWith("-"))
|
|
391
|
+
throw new CliError("validation_error", `wcat does not take ${first} before a tool's name`, {
|
|
392
|
+
reason: "input.invalid"
|
|
393
|
+
});
|
|
394
|
+
const name = first;
|
|
395
|
+
const [path, ...shadowed] = TOOL_NAME.test(name) ? findOnPath(`${PROGRAM_PREFIX}${name}`, context) : [];
|
|
396
|
+
if (path === void 0) {
|
|
397
|
+
const installed = [...installedPrograms(context).keys()];
|
|
398
|
+
throw new CliError("not_found", `no ${PROGRAM_PREFIX}${name} on PATH; installed: ${installed.length > 0 ? installed.join(", ") : "none"}`, { reason: "tool.not-installed", tool: name, installed });
|
|
399
|
+
}
|
|
400
|
+
if (shadowed.length > 0 && context.stderr.isTTY)
|
|
401
|
+
context.stderr.write(shadowWarnings([{ name, installed: true, path, shadowed }]));
|
|
402
|
+
return await runTool(path, rest, context);
|
|
403
|
+
} catch (error) {
|
|
404
|
+
return fail(error, json, context);
|
|
405
|
+
}
|
|
406
|
+
}, "runWcat");
|
|
407
|
+
export {
|
|
408
|
+
listTools,
|
|
409
|
+
runTool,
|
|
410
|
+
runWcat
|
|
411
|
+
};
|
|
@@ -42399,7 +42399,7 @@ function install11(registers) {
|
|
|
42399
42399
|
}
|
|
42400
42400
|
__name(install11, "install");
|
|
42401
42401
|
|
|
42402
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42402
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/charts/echarts-option.js
|
|
42403
42403
|
var echartsOption = /* @__PURE__ */ __name((chart) => ({
|
|
42404
42404
|
animation: false,
|
|
42405
42405
|
backgroundColor: "#111827",
|
|
@@ -42447,7 +42447,7 @@ var echartsOption = /* @__PURE__ */ __name((chart) => ({
|
|
|
42447
42447
|
} : {}
|
|
42448
42448
|
}), "echartsOption");
|
|
42449
42449
|
|
|
42450
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42450
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/charts/echarts.js
|
|
42451
42451
|
use([install2, install, install6, install5, install10, install7, install11]);
|
|
42452
42452
|
var echartsRenderer = {
|
|
42453
42453
|
render: /* @__PURE__ */ __name(async (chart, size) => {
|