@wirecat/cli-memo 0.131.20 → 0.131.21
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 -3
- package/dist/actions/command.d.ts +1 -1
- package/dist/actions/command.d.ts.map +1 -1
- package/dist/actions/command.js +12 -1
- package/dist/actions/command.js.map +1 -1
- package/dist/bin/memo.js +2 -2
- package/dist/bin/memo.js.map +1 -1
- package/dist/bundle/{all-profiles-MVF2XGZK.js → all-profiles-EZLU6CY7.js} +9 -7
- package/dist/bundle/{anthropic-OPFHMF2S.js → anthropic-XC34PJH5.js} +6 -4
- package/dist/bundle/{app-server-VHVC55S3.js → app-server-26YPLJ7M.js} +53 -48
- package/dist/bundle/auto-QHTPHGNA.js +86 -0
- package/dist/bundle/{bun-P6TMDZGU.js → bun-CKGKUKW5.js} +2 -2
- package/dist/bundle/{bun-sqlite-3G3NLK4O.js → bun-sqlite-S6KUSMTC.js} +5 -3
- package/dist/bundle/{chunk-XZWUBDBG.js → chunk-2NJUPIAO.js} +1 -1
- package/dist/bundle/{chunk-RFB5LOYR.js → chunk-2TBIVKBH.js} +8 -6
- package/dist/bundle/{chunk-3DVKC2XM.js → chunk-3V4WIGWC.js} +8 -19
- package/dist/bundle/{chunk-BMHSGZNE.js → chunk-5RBLNI6C.js} +4 -4
- package/dist/bundle/{chunk-LKYHSVQL.js → chunk-7F6FGMCC.js} +8 -8
- package/dist/bundle/{chunk-FMSA2X3E.js → chunk-7MLWSUEK.js} +1 -1
- package/dist/bundle/{chunk-3BMUVKC7.js → chunk-7NEWBM2O.js} +13 -9
- package/dist/bundle/{chunk-SO6VNTF6.js → chunk-AIIQ7YU4.js} +1 -1
- package/dist/bundle/{chunk-G7TF4E7B.js → chunk-B3YV6Z7Y.js} +8 -2
- package/dist/bundle/{chunk-IW3U6XXI.js → chunk-BB2MGFOZ.js} +6 -6
- package/dist/bundle/chunk-CCHHEMPM.js +71 -0
- package/dist/bundle/{chunk-6DG7VK3H.js → chunk-CCOYC6HL.js} +5 -5
- package/dist/bundle/{chunk-MXP4J6BJ.js → chunk-CDZZ2DZO.js} +70 -2517
- package/dist/bundle/{chunk-VUWUSGSN.js → chunk-CP5N3KH3.js} +4 -4
- package/dist/bundle/{chunk-NKTAEBCU.js → chunk-CRZSJHAK.js} +13 -9
- package/dist/bundle/{chunk-LPUFOWL3.js → chunk-D72URWJE.js} +1 -39
- package/dist/bundle/{chunk-BINR6MJ5.js → chunk-DNGHE2Q4.js} +1 -1
- package/dist/bundle/{chunk-KVVDRD7M.js → chunk-DZSWKA3K.js} +2 -2
- package/dist/bundle/{chunk-63XICXGM.js → chunk-E5FQ7U7L.js} +5 -3
- package/dist/bundle/{chunk-BPYQYZXA.js → chunk-EAYYWS67.js} +14 -12
- package/dist/bundle/chunk-EG2OMKWH.js +2423 -0
- package/dist/bundle/chunk-EW3XTUPB.js +166 -0
- package/dist/bundle/{chunk-KIEBEYKH.js → chunk-FFWK5NEZ.js} +10 -8
- package/dist/bundle/{chunk-3ORDQ62F.js → chunk-GV2FSWFS.js} +10 -8
- package/dist/bundle/chunk-ILHTNOIV.js +23 -0
- package/dist/bundle/{chunk-VQGVPDMH.js → chunk-INURBEAO.js} +20 -16
- package/dist/bundle/{chunk-OVFMY6ZP.js → chunk-IRDGD3QQ.js} +1 -1
- package/dist/bundle/{chunk-D6G23NFJ.js → chunk-J4GC33JU.js} +2 -2
- package/dist/bundle/{chunk-XWS4PTES.js → chunk-J55Z6EJ3.js} +363 -278
- package/dist/bundle/{chunk-TQNQS6TR.js → chunk-JJ3C5AYK.js} +64 -60
- package/dist/bundle/{chunk-LQJ4KHXK.js → chunk-JXH22ZGA.js} +15 -15
- package/dist/bundle/{chunk-5KUPVC5M.js → chunk-KUNA6MQZ.js} +2 -2
- package/dist/bundle/{chunk-LDVU22MF.js → chunk-LGNS4JVK.js} +8 -8
- package/dist/bundle/{chunk-57Q6NXQT.js → chunk-LR5EY5JY.js} +4 -4
- package/dist/bundle/{chunk-ZYM4M62Q.js → chunk-MCPDL5YU.js} +4 -4
- package/dist/bundle/{chunk-V7DZG62U.js → chunk-MHDLZCEO.js} +11 -9
- package/dist/bundle/{chunk-SHDZVM3B.js → chunk-NELE7AIX.js} +2 -2
- package/dist/bundle/{chunk-WRPRPVZF.js → chunk-NOG5O2NS.js} +44 -42
- package/dist/bundle/{chunk-FRB4UXJG.js → chunk-NWB5NAGB.js} +6 -6
- package/dist/bundle/{chunk-UC4IL2P7.js → chunk-OJRLTJRS.js} +1 -1
- package/dist/bundle/{chunk-OTHEM74Z.js → chunk-OUF6RCRZ.js} +6 -6
- package/dist/bundle/{chunk-JDJDNMCP.js → chunk-PF3ALSAV.js} +1 -1
- package/dist/bundle/{chunk-GJKM32WA.js → chunk-PO5C7VNC.js} +24 -22
- package/dist/bundle/chunk-PQLBPYJR.js +46 -0
- package/dist/bundle/{chunk-66YZUX2C.js → chunk-QMMUPDRK.js} +10 -10
- package/dist/bundle/{chunk-2MNEM2CH.js → chunk-R26CXR5Z.js} +9 -7
- package/dist/bundle/{chunk-F5CQ2NVA.js → chunk-RC7TIYUZ.js} +11 -9
- package/dist/bundle/{chunk-P22V2OLJ.js → chunk-RG6ITTLQ.js} +22 -16
- package/dist/bundle/{chunk-T557KUST.js → chunk-RHJC4PHV.js} +3 -3
- package/dist/bundle/{chunk-Z54GPSVH.js → chunk-RNXYDBQO.js} +186 -162
- package/dist/bundle/{chunk-YVECM7XA.js → chunk-SMDWUPXE.js} +4 -4
- package/dist/bundle/{chunk-KO455254.js → chunk-SXGAIQ5X.js} +13 -13
- package/dist/bundle/{chunk-EMKFG5BP.js → chunk-THGFFQCK.js} +3 -3
- package/dist/bundle/{chunk-2R25UBIH.js → chunk-TMNHNZVA.js} +26 -24
- package/dist/bundle/{chunk-WOIRWVDJ.js → chunk-UXCSNSUU.js} +563 -351
- package/dist/bundle/{chunk-EFKEG2BA.js → chunk-VECICKTE.js} +5 -5
- package/dist/bundle/{chunk-4MIPN37I.js → chunk-VQM3H422.js} +266 -176
- package/dist/bundle/chunk-VXHN3SWW.js +35 -0
- package/dist/bundle/{chunk-EL4ZKQUN.js → chunk-WEOFWTWZ.js} +6 -4
- package/dist/bundle/{chunk-LEUNYKL6.js → chunk-WUCQ56RP.js} +3 -3
- package/dist/bundle/{chunk-SJLVBJ2L.js → chunk-XA6YO24S.js} +2 -2
- package/dist/bundle/{chunk-36ULPM2W.js → chunk-XPRYBLTS.js} +6 -6
- package/dist/bundle/{chunk-2KOVYXWK.js → chunk-YAUDFROV.js} +1243 -743
- package/dist/bundle/{chunk-4G46QFK5.js → chunk-YUFUUQUO.js} +7 -5
- package/dist/bundle/{chunk-JHKTN6NL.js → chunk-ZCKU6WMX.js} +13 -11
- package/dist/bundle/{chunk-5XDYV2YT.js → chunk-ZD3STMY7.js} +1 -1
- package/dist/bundle/command-contract-TMVGYSQQ.js +32 -0
- package/dist/bundle/{decode-BUTF6VGO.js → decode-6XSZIZAA.js} +5 -3
- package/dist/bundle/dispatch-VUMQPYMA.js +411 -0
- package/dist/bundle/{echarts-KH3YOWMK.js → echarts-NGS4QG4E.js} +2 -2
- package/dist/bundle/{embed-WBVM7KQ2.js → embed-YNH5M6UL.js} +6 -4
- package/dist/bundle/{embedder-27HQIFHM.js → embedder-LLNK4JF4.js} +11 -9
- package/dist/bundle/{entry-K2WWMF2B.js → entry-DO6ZBFIS.js} +7 -5
- package/dist/bundle/failure-LHMJNFY6.js +66 -0
- package/dist/bundle/failure-Z2FXWIBY.js +24 -0
- package/dist/bundle/first-run-BXFQN6M5.js +27 -0
- package/dist/bundle/first-screen-56KZKY77.js +30 -0
- package/dist/bundle/{instructions-POJKHKRZ.js → instructions-4EJ4BBWD.js} +1 -1
- package/dist/bundle/mcp-A4HPKQK5.js +90 -0
- package/dist/bundle/{mcp-FUSDPAOL.js → mcp-MNI62HHE.js} +4 -2
- package/dist/bundle/memo.js +182 -39
- package/dist/bundle/{node-W245R2OP.js → node-QQXKQWNC.js} +2 -2
- package/dist/bundle/{node-sqlite-FUYOXFW5.js → node-sqlite-GJI2GMLW.js} +6 -4
- package/dist/bundle/{oauth-ATB3NWQA.js → oauth-Q5VGUPUR.js} +7 -5
- package/dist/bundle/{open-HEBEWCYB.js → open-NSXIYF3N.js} +5 -3
- package/dist/bundle/{openai-DN7NA2IU.js → openai-LHH7MSGQ.js} +10 -8
- package/dist/bundle/{process-QTIDOJMF.js → process-PI6XUJWP.js} +1 -1
- package/dist/bundle/{program-62ISSWCE.js → program-3ZTQ5FEM.js} +8288 -8293
- package/dist/bundle/{prompt-RQXVPJ4A.js → prompt-VFXA7IKL.js} +5 -3
- package/dist/bundle/{recognize-G7NIZ3IT.js → recognize-UWAARXOH.js} +4 -2
- package/dist/bundle/{remote-H452UBSK.js → remote-KGEVCB2Q.js} +7 -5
- package/dist/bundle/{rerank-77UYD2UD.js → rerank-SCBTCBPO.js} +7 -5
- package/dist/bundle/{serve-L6R4ODZV.js → serve-WPVKVR24.js} +9 -7
- package/dist/bundle/{server-NB3U4PPW.js → server-BMQBWBBN.js} +69 -63
- package/dist/bundle/server-NQK5EX7P.js +48 -0
- package/dist/bundle/server-UN43Y6BY.js +61 -0
- package/dist/bundle/{setup-ZGH5OZ7A.js → setup-FGSVWQ32.js} +47 -43
- package/dist/bundle/{state-KHMYDV4I.js → state-KGHS4C6J.js} +6 -4
- package/dist/bundle/{store-M7KGTLUG.js → store-VCVOIQES.js} +12 -10
- package/dist/bundle/store-maintenance-command-QTEWWDST.js +48 -0
- package/dist/bundle/update-XC6KAVCK.js +69 -0
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/dist/contract-overrides/skill.d.ts.map +1 -1
- package/dist/contract-overrides/skill.js +14 -0
- package/dist/contract-overrides/skill.js.map +1 -1
- package/dist/examples.d.ts.map +1 -1
- package/dist/examples.js +26 -0
- package/dist/examples.js.map +1 -1
- package/dist/knowledge/project-actions-command.js +1 -1
- package/dist/knowledge/project-actions-command.js.map +1 -1
- package/dist/mail/command.d.ts.map +1 -1
- package/dist/mail/command.js +11 -1
- package/dist/mail/command.js.map +1 -1
- package/dist/mail/findings-command.d.ts +8 -0
- package/dist/mail/findings-command.d.ts.map +1 -0
- package/dist/mail/findings-command.js +80 -0
- package/dist/mail/findings-command.js.map +1 -0
- package/dist/mail/messages-command.d.ts.map +1 -1
- package/dist/mail/messages-command.js +27 -3
- package/dist/mail/messages-command.js.map +1 -1
- package/dist/mail/review-command.d.ts +12 -0
- package/dist/mail/review-command.d.ts.map +1 -0
- package/dist/mail/review-command.js +46 -0
- package/dist/mail/review-command.js.map +1 -0
- package/dist/mcp/catalogue.d.ts.map +1 -1
- package/dist/mcp/catalogue.js +1 -1
- package/dist/mcp/catalogue.js.map +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +1 -1
- package/dist/program.js.map +1 -1
- package/dist/read-only.d.ts +1 -1
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +6 -0
- package/dist/reasons.js.map +1 -1
- package/dist/review/kinds.d.ts +0 -6
- package/dist/review/kinds.d.ts.map +1 -1
- package/dist/review/kinds.js +14 -45
- package/dist/review/kinds.js.map +1 -1
- package/dist/review/status.d.ts +1 -0
- package/dist/review/status.d.ts.map +1 -1
- package/dist/schedule/command.d.ts +3 -1
- package/dist/schedule/command.d.ts.map +1 -1
- package/dist/schedule/command.js +6 -1
- package/dist/schedule/command.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -3
- package/skills/cli-memo/SKILL.md +12 -4
- package/skills/mail-triage/SKILL.md +120 -0
- package/dist/bundle/auto-GDLRYDYK.js +0 -82
- package/dist/bundle/chunk-7J5HTZCM.js +0 -18
- package/dist/bundle/command-contract-NMJKYTS4.js +0 -30
- package/dist/bundle/failure-OJI6C5JA.js +0 -62
- package/dist/bundle/first-run-7P5N72VR.js +0 -23
- package/dist/bundle/first-screen-3GM5HC4Y.js +0 -28
- package/dist/bundle/mcp-YGWNSJUH.js +0 -86
- package/dist/bundle/server-SWUSQSRW.js +0 -44
- package/dist/bundle/server-W4IKTTUY.js +0 -57
- package/dist/bundle/store-maintenance-command-ZPN2ZUL4.js +0 -44
- package/dist/bundle/update-2IYA7RJU.js +0 -65
- /package/dist/bundle/{chunk-7YF2MSEC.js → chunk-YYQN5ES2.js} +0 -0
|
@@ -3,28 +3,30 @@ const require = __bundleRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
agentResult,
|
|
5
5
|
failureContext
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RG6ITTLQ.js";
|
|
7
7
|
import {
|
|
8
8
|
CommanderError,
|
|
9
9
|
judgedEffects,
|
|
10
10
|
metaOf
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-VQM3H422.js";
|
|
12
12
|
import {
|
|
13
13
|
interactiveOf,
|
|
14
14
|
optionsOf
|
|
15
15
|
} from "./chunk-BPGYTJNB.js";
|
|
16
16
|
import {
|
|
17
17
|
APP
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-B3YV6Z7Y.js";
|
|
19
19
|
import {
|
|
20
|
-
CliError,
|
|
21
20
|
ValiError,
|
|
22
21
|
errorObjectOf,
|
|
23
22
|
errorRecordOf,
|
|
24
23
|
exitCodeOfError,
|
|
25
24
|
mcpErrorResult,
|
|
26
25
|
renderError
|
|
27
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-EG2OMKWH.js";
|
|
27
|
+
import {
|
|
28
|
+
CliError
|
|
29
|
+
} from "./chunk-CCHHEMPM.js";
|
|
28
30
|
import {
|
|
29
31
|
__name
|
|
30
32
|
} from "./chunk-ZVVMGPBJ.js";
|
|
@@ -3,26 +3,28 @@ const require = __bundleRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
envName,
|
|
5
5
|
readOnlyLockOf
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NELE7AIX.js";
|
|
7
7
|
import {
|
|
8
8
|
CAPABILITY_STATEMENTS,
|
|
9
9
|
storeCapable
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-OUF6RCRZ.js";
|
|
11
11
|
import {
|
|
12
|
-
CliError,
|
|
13
12
|
catchCrashes
|
|
14
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-EG2OMKWH.js";
|
|
15
14
|
import {
|
|
16
15
|
importFrom
|
|
17
16
|
} from "./chunk-Y5E2WNWB.js";
|
|
17
|
+
import {
|
|
18
|
+
CliError
|
|
19
|
+
} from "./chunk-CCHHEMPM.js";
|
|
18
20
|
import {
|
|
19
21
|
__name
|
|
20
22
|
} from "./chunk-ZVVMGPBJ.js";
|
|
21
23
|
|
|
22
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/cli/entry.js
|
|
23
25
|
import { spawn as spawn2 } from "node:child_process";
|
|
24
26
|
|
|
25
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/sqlite-runtime.js
|
|
26
28
|
import { spawn, spawnSync } from "node:child_process";
|
|
27
29
|
import { readFileSync } from "node:fs";
|
|
28
30
|
import { dirname } from "node:path";
|
|
@@ -110,14 +112,14 @@ var relay = /* @__PURE__ */ __name((child, host = process) => new Promise(() =>
|
|
|
110
112
|
});
|
|
111
113
|
}), "relay");
|
|
112
114
|
|
|
113
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
115
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/cli/argv-log.js
|
|
114
116
|
import { appendFileSync } from "node:fs";
|
|
115
117
|
var logVersion = /* @__PURE__ */ __name((file) => {
|
|
116
118
|
appendFileSync(file, `${JSON.stringify({ command: "", options: ["--version"] })}
|
|
117
119
|
`);
|
|
118
120
|
}, "logVersion");
|
|
119
121
|
|
|
120
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
122
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/cli/entry.js
|
|
121
123
|
var processIo = /* @__PURE__ */ __name(() => ({
|
|
122
124
|
argv: process.argv,
|
|
123
125
|
env: process.env,
|
|
@@ -171,8 +173,8 @@ var startCli = /* @__PURE__ */ __name(async (entry) => {
|
|
|
171
173
|
if (command.optsWithGlobals().dryRun === true)
|
|
172
174
|
return;
|
|
173
175
|
const [{ setupAtStart }, { commandPathOf }] = await Promise.all([
|
|
174
|
-
import("./first-run-
|
|
175
|
-
import("./command-contract-
|
|
176
|
+
import("./first-run-BXFQN6M5.js"),
|
|
177
|
+
import("./command-contract-TMVGYSQQ.js")
|
|
176
178
|
]);
|
|
177
179
|
await setupAtStart({
|
|
178
180
|
command: entry.app.command,
|
|
@@ -187,7 +189,7 @@ var startCli = /* @__PURE__ */ __name(async (entry) => {
|
|
|
187
189
|
ask: /* @__PURE__ */ __name(async (question, command) => {
|
|
188
190
|
if (headless(command) || io.stdin.isTTY !== true)
|
|
189
191
|
return false;
|
|
190
|
-
const { readSecret } = await import("./prompt-
|
|
192
|
+
const { readSecret } = await import("./prompt-VFXA7IKL.js");
|
|
191
193
|
const answer = await readSecret(`${question} [y/N] `, {
|
|
192
194
|
input: io.stdin,
|
|
193
195
|
output: io.stderr,
|
|
@@ -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.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/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,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-WEOFWTWZ.js";
|
|
10
|
+
import "./chunk-VQM3H422.js";
|
|
11
|
+
import "./chunk-RC7TIYUZ.js";
|
|
12
|
+
import "./chunk-SMDWUPXE.js";
|
|
13
|
+
import "./chunk-NELE7AIX.js";
|
|
14
|
+
import "./chunk-AIIQ7YU4.js";
|
|
15
|
+
import "./chunk-RNXYDBQO.js";
|
|
16
|
+
import "./chunk-PF3ALSAV.js";
|
|
17
|
+
import "./chunk-2TBIVKBH.js";
|
|
18
|
+
import "./chunk-LR5EY5JY.js";
|
|
19
|
+
import "./chunk-VXHN3SWW.js";
|
|
20
|
+
import "./chunk-NUN6OGOV.js";
|
|
21
|
+
import "./chunk-CDZZ2DZO.js";
|
|
22
|
+
import "./chunk-EG2OMKWH.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
|
+
};
|
|
@@ -6,10 +6,12 @@ import {
|
|
|
6
6
|
decodeChannels,
|
|
7
7
|
formatOf,
|
|
8
8
|
runFfmpeg
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-VECICKTE.js";
|
|
10
|
+
import "./chunk-BB2MGFOZ.js";
|
|
11
|
+
import "./chunk-CDZZ2DZO.js";
|
|
12
|
+
import "./chunk-EG2OMKWH.js";
|
|
12
13
|
import "./chunk-Y5E2WNWB.js";
|
|
14
|
+
import "./chunk-CCHHEMPM.js";
|
|
13
15
|
import "./chunk-ZVVMGPBJ.js";
|
|
14
16
|
export {
|
|
15
17
|
LONGEST_AUDIO_SECONDS,
|
|
@@ -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-Z2FXWIBY.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.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/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.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/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) => {
|
|
@@ -13,11 +13,13 @@ import {
|
|
|
13
13
|
truncated,
|
|
14
14
|
unit,
|
|
15
15
|
warmEmbedders
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-LGNS4JVK.js";
|
|
17
|
+
import "./chunk-LR5EY5JY.js";
|
|
18
|
+
import "./chunk-VXHN3SWW.js";
|
|
19
|
+
import "./chunk-CDZZ2DZO.js";
|
|
20
|
+
import "./chunk-EG2OMKWH.js";
|
|
20
21
|
import "./chunk-Y5E2WNWB.js";
|
|
22
|
+
import "./chunk-CCHHEMPM.js";
|
|
21
23
|
import "./chunk-ZVVMGPBJ.js";
|
|
22
24
|
export {
|
|
23
25
|
WARM_IDLE_MS,
|
|
@@ -4,24 +4,26 @@ import {
|
|
|
4
4
|
openSession,
|
|
5
5
|
truncated,
|
|
6
6
|
unit
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
} from "./chunk-MXP4J6BJ.js";
|
|
7
|
+
} from "./chunk-LGNS4JVK.js";
|
|
8
|
+
import "./chunk-LR5EY5JY.js";
|
|
9
|
+
import "./chunk-VXHN3SWW.js";
|
|
10
|
+
import "./chunk-CDZZ2DZO.js";
|
|
11
|
+
import "./chunk-EG2OMKWH.js";
|
|
13
12
|
import {
|
|
14
13
|
importFrom
|
|
15
14
|
} from "./chunk-Y5E2WNWB.js";
|
|
15
|
+
import {
|
|
16
|
+
CliError
|
|
17
|
+
} from "./chunk-CCHHEMPM.js";
|
|
16
18
|
import {
|
|
17
19
|
__name
|
|
18
20
|
} from "./chunk-ZVVMGPBJ.js";
|
|
19
21
|
|
|
20
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/images/picture/embedder.js
|
|
21
23
|
import { readFileSync } from "node:fs";
|
|
22
24
|
import { join } from "node:path";
|
|
23
25
|
|
|
24
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/images/picture/preprocess.js
|
|
25
27
|
var SIZE = 224;
|
|
26
28
|
var MEAN = [0.48145466, 0.4578275, 0.40821073];
|
|
27
29
|
var STD = [0.26862954, 0.26130258, 0.27577711];
|
|
@@ -60,7 +62,7 @@ var preprocess = /* @__PURE__ */ __name(async (bytes, load = importCanvas) => {
|
|
|
60
62
|
return pixels;
|
|
61
63
|
}, "preprocess");
|
|
62
64
|
|
|
63
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
65
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/images/picture/embedder.js
|
|
64
66
|
var openPictureEmbedder = /* @__PURE__ */ __name(async (model, directory, { threads = 4, canvas } = {}) => {
|
|
65
67
|
const { Tokenizer } = await importFrom(new URL("images/picture/embedder.js", import.meta.resolve("@wirecat/cli-core")).href, "@huggingface/tokenizers");
|
|
66
68
|
const path = /* @__PURE__ */ __name((name) => join(directory, model.id, name), "path");
|