@wirecat/tg-cli 0.133.0 → 0.134.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- package/contracts/wirecat.json +82 -2
- package/dist/bin/tg.js +2 -2
- package/dist/bot/generated/types.d.ts +188 -0
- package/dist/bot/generated/types.d.ts.map +1 -1
- package/dist/bundle/{adapter-GSGX3WBH.js → adapter-Y4IXTXAG.js} +104 -69
- package/dist/bundle/agent-G7VHOJMS.js +37 -0
- package/dist/bundle/{all-profiles-VOCJ55YH.js → all-profiles-SUGID6CX.js} +62 -20
- package/dist/bundle/{anthropic-J6CTLU3W.js → anthropic-4QKTXT4B.js} +5 -5
- package/dist/bundle/{app-server-GVFGA4TJ.js → app-server-TPOD6LIJ.js} +72 -62
- package/dist/bundle/{bot-api-LWONPIGK.js → bot-api-KBESP422.js} +73 -92
- package/dist/bundle/{bot-history-XOW7Y2GC.js → bot-history-3EORA23G.js} +23 -22
- package/dist/bundle/{bun-436CH6CP.js → bun-FL76M4M2.js} +2 -2
- package/dist/bundle/{bun-sqlite-ZLB5RK5Q.js → bun-sqlite-H37OSTAJ.js} +6 -6
- package/dist/bundle/{chunk-YY6FGKGD.js → chunk-2GT563YH.js} +2 -2
- package/dist/bundle/{chunk-5L44DSHV.js → chunk-2JWY7CXJ.js} +4 -4
- package/dist/bundle/{chunk-OX73ERZW.js → chunk-3O25FAPA.js} +3 -4
- package/dist/bundle/{chunk-TCI7I6YF.js → chunk-3PG6QVQZ.js} +11 -25
- package/dist/bundle/{chunk-NTWXL2QV.js → chunk-3QQWTP77.js} +2 -2
- package/dist/bundle/{chunk-TTDZVWDU.js → chunk-3ZNO27UE.js} +1 -1
- package/dist/bundle/{chunk-7NYP4RBO.js → chunk-4R2ZJGFF.js} +2125 -1179
- package/dist/bundle/{chunk-VGN5YXYI.js → chunk-4S2DHHJM.js} +2 -100
- package/dist/bundle/{chunk-H7ML7X3G.js → chunk-4X6BX3XP.js} +144 -10
- package/dist/bundle/{chunk-D2SJLZSH.js → chunk-6DGVK5KS.js} +2 -2
- package/dist/bundle/chunk-6DJJVFSG.js +388 -0
- package/dist/bundle/{chunk-M6QOM6SL.js → chunk-6MEHKUN6.js} +1 -1
- package/dist/bundle/{chunk-6CHIGUCY.js → chunk-6UNLEQA5.js} +31 -20
- package/dist/bundle/{chunk-WCYKVX3B.js → chunk-77E7Q4EQ.js} +7 -7
- package/dist/bundle/chunk-7GGDCQJ5.js +353 -0
- package/dist/bundle/{chunk-UIAKLELF.js → chunk-AHVWZDXO.js} +79 -64
- package/dist/bundle/{chunk-NO2LIHWA.js → chunk-ANBI3OXK.js} +1 -1
- package/dist/bundle/{chunk-LQQSDGQ6.js → chunk-AYWST6NA.js} +56 -46
- package/dist/bundle/{chunk-NAXOT35J.js → chunk-CA7DY2YU.js} +3 -3
- package/dist/bundle/{chunk-UKBK2VWZ.js → chunk-CDKXZLMP.js} +225 -175
- package/dist/bundle/{chunk-5HKPQPD4.js → chunk-CNGNR4CY.js} +6 -6
- package/dist/bundle/{chunk-KUA24HWG.js → chunk-CSXCCK6J.js} +2 -2
- package/dist/bundle/{chunk-VTQMR3XG.js → chunk-DG35TQ6P.js} +3 -3
- package/dist/bundle/{chunk-IPPCQ7IK.js → chunk-EXMAWEHC.js} +2 -2
- package/dist/bundle/{chunk-CEJYNB3I.js → chunk-FR3ATU5I.js} +4 -4
- package/dist/bundle/{chunk-XOX4BX5A.js → chunk-FR4Y5CGW.js} +4 -4
- package/dist/bundle/{chunk-JPNVEPS4.js → chunk-GIGZTI74.js} +2023 -1928
- package/dist/bundle/{chunk-UZ63ORMY.js → chunk-H3TLAYGY.js} +4 -4
- package/dist/bundle/{chunk-LBZEZO32.js → chunk-HD7DV5B2.js} +65 -43
- package/dist/bundle/{chunk-TPD37ECC.js → chunk-HETHFOHC.js} +3 -3
- package/dist/bundle/{chunk-JKSD43L7.js → chunk-HEZK4W3U.js} +6 -6
- package/dist/bundle/{chunk-SMU6NA7F.js → chunk-IJ7R2WMK.js} +4 -4
- package/dist/bundle/{chunk-7NF3V5L2.js → chunk-ITJ7DGNA.js} +4 -4
- package/dist/bundle/{chunk-JGMXBAGH.js → chunk-J5RB4ASI.js} +140 -433
- package/dist/bundle/{chunk-57KJ3TRS.js → chunk-JAL443BH.js} +9 -9
- package/dist/bundle/{chunk-IH4Z3KZU.js → chunk-JCDD5T3A.js} +2 -2
- package/dist/bundle/{chunk-BXVB42KJ.js → chunk-JHZJBNDO.js} +2 -2
- package/dist/bundle/chunk-JWLODUN3.js +555 -0
- package/dist/bundle/{chunk-54WLIPIQ.js → chunk-JWNSG5GI.js} +1 -1
- package/dist/bundle/{chunk-UGS57TT5.js → chunk-JXEO5EIN.js} +2 -2
- package/dist/bundle/{chunk-QYLZD4DS.js → chunk-K5FK6WWN.js} +1 -1
- package/dist/bundle/{chunk-QWO7L4UH.js → chunk-L47PFECD.js} +7 -7
- package/dist/bundle/{chunk-IYAXLLGR.js → chunk-L4PNDW4S.js} +6 -6
- package/dist/bundle/{chunk-ZHO3TPHM.js → chunk-M323L5SG.js} +30 -15
- package/dist/bundle/{chunk-6A44ZZFC.js → chunk-MMDFPBFZ.js} +43 -64
- package/dist/bundle/{chunk-OWY52JBO.js → chunk-MUV73B5A.js} +7 -7
- package/dist/bundle/{chunk-2KQDJHF3.js → chunk-MXA3FU2R.js} +29 -1
- package/dist/bundle/{chunk-6H2NW6HK.js → chunk-NUD4CBHK.js} +3 -3
- package/dist/bundle/{chunk-RABUG4KA.js → chunk-NYEVPAF2.js} +511 -472
- package/dist/bundle/{chunk-VWJTYAIQ.js → chunk-O3QBO6NW.js} +17 -17
- package/dist/bundle/{chunk-N7QREPZW.js → chunk-O4ZOQJ6W.js} +9 -9
- package/dist/bundle/{chunk-KEN4B57V.js → chunk-OJSPB4LA.js} +2 -2
- package/dist/bundle/{chunk-UQYL6TJ7.js → chunk-PCBVSHKD.js} +4 -4
- package/dist/bundle/{chunk-LIQMUDIZ.js → chunk-PK5WEGPJ.js} +2 -2
- package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
- package/dist/bundle/{chunk-O6JUVATT.js → chunk-PRI2XTM7.js} +35 -12
- package/dist/bundle/chunk-PRM7GKBV.js +340 -0
- package/dist/bundle/{chunk-YAPDU3SV.js → chunk-PZ2ZFPGO.js} +1 -1
- package/dist/bundle/chunk-QYRK4XXH.js +727 -0
- package/dist/bundle/{chunk-XDQU5HBO.js → chunk-RVA3CRSY.js} +12 -12
- package/dist/bundle/{chunk-QVGEL66U.js → chunk-SPXNI53Z.js} +38 -9
- package/dist/bundle/{chunk-QGWISM4W.js → chunk-TI5U6AUT.js} +34 -28
- package/dist/bundle/{chunk-THYGLTRB.js → chunk-TKWYXM7L.js} +7 -7
- package/dist/bundle/{chunk-XKOMP3HV.js → chunk-TZCFJJEU.js} +6 -6
- package/dist/bundle/chunk-UTTEAOJ3.js +7 -0
- package/dist/bundle/chunk-V6G4LTXU.js +50 -0
- package/dist/bundle/{chunk-KVFUH5IT.js → chunk-VH4J7IIS.js} +1 -1
- package/dist/bundle/{chunk-VCAOH45X.js → chunk-VNJRWFHP.js} +1 -1
- package/dist/bundle/chunk-W2QSDPG6.js +80 -0
- package/dist/bundle/{chunk-LOS4D6ZB.js → chunk-WGGUKQE7.js} +113 -567
- package/dist/bundle/{chunk-ZYAHZKYF.js → chunk-WPXVJGSL.js} +3 -3
- package/dist/bundle/{chunk-IBCXEVNY.js → chunk-XLNV3U6N.js} +3 -3
- package/dist/bundle/{chunk-6S77EKZU.js → chunk-XS4EE7MO.js} +17 -15
- package/dist/bundle/{chunk-6VCSOQFL.js → chunk-XVRLD3LN.js} +2 -2
- package/dist/bundle/{chunk-HB5DP6L5.js → chunk-XZ6XEAJP.js} +18 -18
- package/dist/bundle/{chunk-N3JUHGKM.js → chunk-YHTSJMZ5.js} +3706 -3372
- package/dist/bundle/chunk-YPJCURT6.js +108 -0
- package/dist/bundle/{chunk-SMI2EUH4.js → chunk-Z77R76S2.js} +1 -1
- package/dist/bundle/{chunk-KHUXDSXN.js → chunk-ZC7OEYDX.js} +1 -1
- package/dist/bundle/{chunk-5LRTYBZW.js → chunk-ZW2N2GI2.js} +12 -12
- package/dist/bundle/command-contract-LEFXJAA3.js +37 -0
- package/dist/bundle/{command-server-entry-AE27QXTE.js → command-server-entry-WQAE5UGU.js} +27 -27
- package/dist/bundle/{decode-RQPPZ72F.js → decode-2J2DOVGV.js} +5 -5
- package/dist/bundle/{dispatch-KQO2MCSH.js → dispatch-IZ2TP5GW.js} +8 -8
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/{echarts-FZRIACN4.js → echarts-GFIIHZ4U.js} +2 -2
- package/dist/bundle/{embed-TOSWWMDL.js → embed-AGOXADHW.js} +6 -6
- package/dist/bundle/{embedder-JHIQSBGD.js → embedder-PCIXGM2Y.js} +9 -9
- package/dist/bundle/{entry-DU4KRXTG.js → entry-HUQXUV52.js} +9 -9
- package/dist/bundle/{failure-3YC3YGYO.js → failure-JSRHZ2S6.js} +2 -2
- package/dist/bundle/{first-run-DQQT4FID.js → first-run-2LXN7B33.js} +12 -12
- package/dist/bundle/first-screen-VUE6RCSF.js +37 -0
- package/dist/bundle/{instructions-WI64CJQ6.js → instructions-RSLTJVFJ.js} +1 -1
- package/dist/bundle/{mcp-VMS6PBCU.js → mcp-MMENCB7I.js} +2 -2
- package/dist/bundle/meeting-combined-PBNPHOM3.js +23 -0
- package/dist/bundle/{meeting-model-XNRSREIK.js → meeting-model-SI77WMMK.js} +11 -11
- package/dist/bundle/{meeting-semantic-OOSCHQMB.js → meeting-semantic-WRXWUR4M.js} +6 -6
- package/dist/bundle/{node-JLKDNVKV.js → node-5XGMCUGQ.js} +2 -2
- package/dist/bundle/{node-sqlite-YOGH26O2.js → node-sqlite-ES7SQSIC.js} +7 -7
- package/dist/bundle/{oauth-FOMXM5HP.js → oauth-QFM4Y6N7.js} +8 -8
- package/dist/bundle/{open-SM2UXUKM.js → open-2MD2DKGQ.js} +5 -5
- package/dist/bundle/{openai-J2H7S6ZF.js → openai-6TMKJKYO.js} +15 -15
- package/dist/bundle/{process-HI7OZBOI.js → process-VA2DP7MY.js} +1 -1
- package/dist/bundle/{program-VY4HFU25.js → program-K3SLEA42.js} +70 -64
- package/dist/bundle/{prompt-NUUVFMOF.js → prompt-VZSPCE6E.js} +5 -5
- package/dist/bundle/{proxy-transport-AN4VMRRN.js → proxy-transport-OJU2EOOC.js} +5 -5
- package/dist/bundle/{recognize-MALJHPDI.js → recognize-LH3ZZEIL.js} +4 -4
- package/dist/bundle/{remote-QUDRSTS2.js → remote-JNW5HN2I.js} +9 -9
- package/dist/bundle/{rerank-2DSO3D3S.js → rerank-P23UJMII.js} +7 -7
- package/dist/bundle/{serve-NCJ52MY3.js → serve-VSLLMILH.js} +15 -15
- package/dist/bundle/{server-Y3M544AM.js → server-FBRRRKCS.js} +65 -54
- package/dist/bundle/server-TA4QP7PG.js +78 -0
- package/dist/bundle/{sqlite-runtime-NJUSXVKK.js → sqlite-runtime-LWATDAAU.js} +6 -6
- package/dist/bundle/{state-AVOWQVET.js → state-3AFJL2EL.js} +6 -6
- package/dist/bundle/{store-MMIYOL4H.js → store-6TLYL2VU.js} +28 -17
- package/dist/bundle/{store-BZ5ICDRP.js → store-PEXV5DNA.js} +20 -19
- package/dist/bundle/store-maintenance-command-IYJLUQ5X.js +65 -0
- package/dist/bundle/surface-L4VY4WFG.js +64 -0
- package/dist/bundle/tg.js +13 -13
- package/dist/telegram/adapter.d.ts +9 -2
- package/dist/telegram/adapter.d.ts.map +1 -1
- package/dist/telegram/adapter.js +5 -6
- package/dist/telegram/adapter.js.map +1 -1
- package/dist/telegram/messages.d.ts +12 -0
- package/dist/telegram/messages.d.ts.map +1 -1
- package/dist/telegram/messages.js +40 -0
- package/dist/telegram/messages.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/skills/tg-cli/SKILL.md +4 -2
- package/skills/tg-cli/references/messages.md +5 -1
- package/skills/tg-cli/references/search.md +2 -0
- package/dist/bundle/chunk-SHTHNBHG.js +0 -2
- package/dist/bundle/command-contract-TQIARAB4.js +0 -37
- package/dist/bundle/first-screen-7N4CTZSA.js +0 -37
- package/dist/bundle/meeting-combined-3RAOFQ7M.js +0 -23
- package/dist/bundle/server-CHGON5I2.js +0 -70
- package/dist/bundle/store-maintenance-command-VKZ4WHUB.js +0 -61
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
CHECK_EVERY_MS,
|
|
5
|
+
isNewer,
|
|
6
|
+
readNoticeState,
|
|
7
|
+
writeUpdateState
|
|
8
|
+
} from "./chunk-FR3ATU5I.js";
|
|
9
|
+
import {
|
|
10
|
+
executableEnvironment,
|
|
11
|
+
executableOnPath
|
|
12
|
+
} from "./chunk-ANBI3OXK.js";
|
|
13
|
+
import {
|
|
14
|
+
require_cross_spawn
|
|
15
|
+
} from "./chunk-D72URWJE.js";
|
|
16
|
+
import {
|
|
17
|
+
Command,
|
|
18
|
+
Option,
|
|
19
|
+
annotate
|
|
20
|
+
} from "./chunk-CDKXZLMP.js";
|
|
21
|
+
import {
|
|
22
|
+
refuseOwnerHomeInTests
|
|
23
|
+
} from "./chunk-6UNLEQA5.js";
|
|
24
|
+
import {
|
|
25
|
+
CliError
|
|
26
|
+
} from "./chunk-PK5WEGPJ.js";
|
|
27
|
+
import {
|
|
28
|
+
__name,
|
|
29
|
+
__toESM
|
|
30
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
31
|
+
|
|
32
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.122.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/skill/index.js
|
|
33
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
34
|
+
import { homedir } from "node:os";
|
|
35
|
+
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
36
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
37
|
+
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
38
|
+
var SKILL_TARGETS = ["claude", "agents"];
|
|
39
|
+
var homeOf = /* @__PURE__ */ __name((env) => {
|
|
40
|
+
refuseOwnerHomeInTests(env);
|
|
41
|
+
return env.HOME || env.USERPROFILE || homedir();
|
|
42
|
+
}, "homeOf");
|
|
43
|
+
var skillPath = /* @__PURE__ */ __name((target, appName, env) => join(homeOf(env), target === "claude" ? ".claude" : ".agents", "skills", appName, "SKILL.md"), "skillPath");
|
|
44
|
+
var FRONTMATTER = /^---(\r?\n)([\s\S]*?\r?\n)?---(\r?\n|$)/;
|
|
45
|
+
var scalar = /* @__PURE__ */ __name((key, indent) => new RegExp(`^${indent}${key}:[ \\t]*["']?([^"'\\r\\n]*?)["']?[ \\t]*\\r?\\n?$`), "scalar");
|
|
46
|
+
var frontmatterLines = /* @__PURE__ */ __name((content) => (FRONTMATTER.exec(content)?.[2] ?? "").split(/(?<=\n)/), "frontmatterLines");
|
|
47
|
+
var metadataBlock = /* @__PURE__ */ __name((lines) => {
|
|
48
|
+
const start = lines.findIndex((line) => /^metadata:/.test(line));
|
|
49
|
+
if (start === -1)
|
|
50
|
+
return void 0;
|
|
51
|
+
if (!/^metadata:[ \t]*\r?\n?$/.test(lines[start])) {
|
|
52
|
+
throw new CliError("configuration_error", "SKILL.md: write `metadata` as an indented block, not on one line");
|
|
53
|
+
}
|
|
54
|
+
let end = start + 1;
|
|
55
|
+
while (end < lines.length && /^[ \t]/.test(lines[end]))
|
|
56
|
+
end++;
|
|
57
|
+
return [start, end];
|
|
58
|
+
}, "metadataBlock");
|
|
59
|
+
var skillVersion = /* @__PURE__ */ __name((content) => {
|
|
60
|
+
const lines = frontmatterLines(content);
|
|
61
|
+
const block = metadataBlock(lines);
|
|
62
|
+
const nested = block && lines.slice(block[0] + 1, block[1]).find((line2) => scalar("version", "[ \\t]+").test(line2));
|
|
63
|
+
const line = nested ?? lines.find((line2) => scalar("version", "").test(line2));
|
|
64
|
+
return line === void 0 ? void 0 : scalar("version", "[ \\t]*").exec(line)?.[1];
|
|
65
|
+
}, "skillVersion");
|
|
66
|
+
var skillName = /* @__PURE__ */ __name((content) => {
|
|
67
|
+
const line = frontmatterLines(content).find((line2) => scalar("name", "").test(line2));
|
|
68
|
+
return line === void 0 ? void 0 : scalar("name", "").exec(line)?.[1];
|
|
69
|
+
}, "skillName");
|
|
70
|
+
var withVersion = /* @__PURE__ */ __name((content, version) => {
|
|
71
|
+
const match = FRONTMATTER.exec(content);
|
|
72
|
+
if (!match)
|
|
73
|
+
return `---
|
|
74
|
+
metadata:
|
|
75
|
+
version: "${version}"
|
|
76
|
+
---
|
|
77
|
+
${content}`;
|
|
78
|
+
const [whole, eol = "\n", body = "", close = ""] = match;
|
|
79
|
+
const lines = body.split(/(?<=\n)/).filter((line) => line !== "");
|
|
80
|
+
const block = metadataBlock(lines);
|
|
81
|
+
if (!block) {
|
|
82
|
+
lines.push(`metadata:${eol}`, ` version: "${version}"${eol}`);
|
|
83
|
+
} else {
|
|
84
|
+
const [start, end] = block;
|
|
85
|
+
const indent = /^[ \t]+/.exec(lines[start + 1] ?? "")?.[0] ?? " ";
|
|
86
|
+
const at = lines.slice(start + 1, end).findIndex((line) => scalar("version", "[ \\t]+").test(line));
|
|
87
|
+
if (at === -1)
|
|
88
|
+
lines.splice(start + 1, 0, `${indent}version: "${version}"${eol}`);
|
|
89
|
+
else {
|
|
90
|
+
const old = lines[start + 1 + at];
|
|
91
|
+
const lineEol = /\r?\n$/.exec(old)?.[0] ?? "";
|
|
92
|
+
lines[start + 1 + at] = `${/^[ \t]+/.exec(old)?.[0]}version: "${version}"${lineEol}`;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return `---${eol}${lines.join("")}---${close}${content.slice(whole.length)}`;
|
|
96
|
+
}, "withVersion");
|
|
97
|
+
var skillFiles = /* @__PURE__ */ __name((skill) => {
|
|
98
|
+
const root = dirname(fileURLToPath(skill));
|
|
99
|
+
const found = [];
|
|
100
|
+
const walk = /* @__PURE__ */ __name((folder) => {
|
|
101
|
+
for (const entry of readdirSync(folder, { withFileTypes: true })) {
|
|
102
|
+
if (entry.name.startsWith("."))
|
|
103
|
+
continue;
|
|
104
|
+
const path = join(folder, entry.name);
|
|
105
|
+
if (entry.isDirectory())
|
|
106
|
+
walk(path);
|
|
107
|
+
else if (entry.isFile() && path !== join(root, "SKILL.md"))
|
|
108
|
+
found.push(relative(root, path).split(sep).join("/"));
|
|
109
|
+
}
|
|
110
|
+
}, "walk");
|
|
111
|
+
walk(root);
|
|
112
|
+
return found.sort();
|
|
113
|
+
}, "skillFiles");
|
|
114
|
+
var writeSkillFolder = /* @__PURE__ */ __name((app, skill, folder) => {
|
|
115
|
+
const source = readFileSync(skill, "utf8");
|
|
116
|
+
const name = skillName(source);
|
|
117
|
+
if (name !== app.appName) {
|
|
118
|
+
throw new CliError("configuration_error", `SKILL.md is named ${name === void 0 ? "nothing" : `"${name}"`}, but installs into a directory "${app.appName}"; the two must match`);
|
|
119
|
+
}
|
|
120
|
+
const root = dirname(fileURLToPath(skill));
|
|
121
|
+
for (const file of skillFiles(skill)) {
|
|
122
|
+
const target = join(folder, file);
|
|
123
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
124
|
+
writeFileSync(target, readFileSync(join(root, file)));
|
|
125
|
+
}
|
|
126
|
+
const path = join(folder, "SKILL.md");
|
|
127
|
+
mkdirSync(folder, { recursive: true });
|
|
128
|
+
writeFileSync(path, withVersion(source, app.version));
|
|
129
|
+
return path;
|
|
130
|
+
}, "writeSkillFolder");
|
|
131
|
+
var installSkill = /* @__PURE__ */ __name((app, skill, { targets = SKILL_TARGETS, env = process.env } = {}) => targets.map((target) => writeSkillFolder(app, skill, dirname(skillPath(target, app.appName, env)))), "installSkill");
|
|
132
|
+
var skillStatus = /* @__PURE__ */ __name((app, env = process.env) => SKILL_TARGETS.map((target) => {
|
|
133
|
+
const path = skillPath(target, app.appName, env);
|
|
134
|
+
return { target, ...copyStatus(app, path) ?? { path, installed: null, state: "missing" } };
|
|
135
|
+
}), "skillStatus");
|
|
136
|
+
var copyStatus = /* @__PURE__ */ __name((app, path) => {
|
|
137
|
+
let content;
|
|
138
|
+
try {
|
|
139
|
+
content = readFileSync(path, "utf8");
|
|
140
|
+
} catch {
|
|
141
|
+
return void 0;
|
|
142
|
+
}
|
|
143
|
+
const installed = skillVersion(content);
|
|
144
|
+
if (installed === void 0)
|
|
145
|
+
return { path, installed: null, state: "unversioned" };
|
|
146
|
+
return { path, installed, state: isNewer(app.version, installed) ? "stale" : "current" };
|
|
147
|
+
}, "copyStatus");
|
|
148
|
+
var runProgram = /* @__PURE__ */ __name((file, args, env) => {
|
|
149
|
+
const result = import_cross_spawn.default.sync(executableOnPath(file, env), [...args], {
|
|
150
|
+
encoding: "utf8",
|
|
151
|
+
timeout: 3e4,
|
|
152
|
+
maxBuffer: 256e3,
|
|
153
|
+
env: executableEnvironment(env)
|
|
154
|
+
});
|
|
155
|
+
return { status: result.status, ...result.error ? { error: result.error } : {}, stdout: result.stdout ?? "" };
|
|
156
|
+
}, "runProgram");
|
|
157
|
+
var hermesHome = /* @__PURE__ */ __name((env, platform = process.platform) => {
|
|
158
|
+
refuseOwnerHomeInTests(env, platform);
|
|
159
|
+
const set = env.HERMES_HOME?.trim();
|
|
160
|
+
if (set)
|
|
161
|
+
return set;
|
|
162
|
+
if (platform === "win32")
|
|
163
|
+
return join(env.LOCALAPPDATA || join(homeOf(env), "AppData", "Local"), "hermes");
|
|
164
|
+
return join(homeOf(env), ".hermes");
|
|
165
|
+
}, "hermesHome");
|
|
166
|
+
var hermesCopyPath = /* @__PURE__ */ __name((appName, env) => join(hermesHome(env), "skills", appName, "SKILL.md"), "hermesCopyPath");
|
|
167
|
+
var EXTERNAL_DIRS = "skills.external_dirs";
|
|
168
|
+
var externalDirs = /* @__PURE__ */ __name((env, run) => {
|
|
169
|
+
const answer = run("hermes", ["config", "get", EXTERNAL_DIRS, "--json"], env);
|
|
170
|
+
if (answer.error || answer.status !== 0)
|
|
171
|
+
return void 0;
|
|
172
|
+
let value;
|
|
173
|
+
try {
|
|
174
|
+
value = JSON.parse(answer.stdout);
|
|
175
|
+
} catch {
|
|
176
|
+
return void 0;
|
|
177
|
+
}
|
|
178
|
+
if (value === null)
|
|
179
|
+
return [];
|
|
180
|
+
if (typeof value === "string")
|
|
181
|
+
return [value];
|
|
182
|
+
return Array.isArray(value) && value.every((entry) => typeof entry === "string") ? value : void 0;
|
|
183
|
+
}, "externalDirs");
|
|
184
|
+
var expanded = /* @__PURE__ */ __name((entry, env) => resolve(entry.replace(/^~(?=$|[\\/])/, homeOf(env)).replace(/\$\{(\w+)\}|\$(\w+)/g, (whole, braced, bare) => env[braced ?? bare ?? ""] ?? whole)), "expanded");
|
|
185
|
+
var lists = /* @__PURE__ */ __name((dirs, folder, env) => dirs.some((entry) => expanded(entry, env) === resolve(folder)), "lists");
|
|
186
|
+
var removeOwnCopy = /* @__PURE__ */ __name((app, skill, env) => {
|
|
187
|
+
const path = hermesCopyPath(app.appName, env);
|
|
188
|
+
const shipped = new Set(skillFiles(skill));
|
|
189
|
+
const top = /* @__PURE__ */ new Set(["SKILL.md", ...[...shipped].map((file) => file.split("/")[0])]);
|
|
190
|
+
try {
|
|
191
|
+
if (!readdirSync(dirname(path)).every((entry) => top.has(entry)))
|
|
192
|
+
return void 0;
|
|
193
|
+
if (!skillFiles(pathToFileURL(path)).every((file) => shipped.has(file)))
|
|
194
|
+
return void 0;
|
|
195
|
+
if (skillName(readFileSync(path, "utf8")) !== app.appName)
|
|
196
|
+
return void 0;
|
|
197
|
+
rmSync(dirname(path), { recursive: true });
|
|
198
|
+
return path;
|
|
199
|
+
} catch {
|
|
200
|
+
return void 0;
|
|
201
|
+
}
|
|
202
|
+
}, "removeOwnCopy");
|
|
203
|
+
var readFolder = /* @__PURE__ */ __name((folder, env, run) => {
|
|
204
|
+
const dirs = externalDirs(env, run);
|
|
205
|
+
if (dirs === void 0)
|
|
206
|
+
return "Hermes could not be asked for skills.external_dirs";
|
|
207
|
+
if (lists(dirs, folder, env))
|
|
208
|
+
return void 0;
|
|
209
|
+
const set = run("hermes", ["config", "set", EXTERNAL_DIRS, JSON.stringify([...dirs, folder])], env);
|
|
210
|
+
if (set.error || set.status !== 0)
|
|
211
|
+
return "hermes config set failed";
|
|
212
|
+
const after = externalDirs(env, run);
|
|
213
|
+
return after !== void 0 && lists(after, folder, env) ? void 0 : "Hermes did not keep the folder";
|
|
214
|
+
}, "readFolder");
|
|
215
|
+
var installHermesSkill = /* @__PURE__ */ __name((app, skill, { env = process.env, run = runProgram } = {}) => {
|
|
216
|
+
if (!existsSync(hermesHome(env)) && run("hermes", ["--version"], env).error)
|
|
217
|
+
throw new CliError("not_found", "Hermes is not installed here; install Hermes first, or set HERMES_HOME");
|
|
218
|
+
const [shared] = installSkill(app, skill, { targets: ["agents"], env });
|
|
219
|
+
const reason = readFolder(dirname(dirname(shared)), env, run);
|
|
220
|
+
if (reason === void 0) {
|
|
221
|
+
const removed = removeOwnCopy(app, skill, env);
|
|
222
|
+
return { written: [shared], hermes: { via: "external_dirs", path: shared, ...removed ? { removed } : {} } };
|
|
223
|
+
}
|
|
224
|
+
const copy = writeSkillFolder(app, skill, dirname(hermesCopyPath(app.appName, env)));
|
|
225
|
+
return { written: [shared, copy], hermes: { via: "copy", path: copy, reason } };
|
|
226
|
+
}, "installHermesSkill");
|
|
227
|
+
var hermesSkillStatus = /* @__PURE__ */ __name((app, { env = process.env, run = runProgram } = {}) => {
|
|
228
|
+
const own = copyStatus(app, hermesCopyPath(app.appName, env));
|
|
229
|
+
if (own)
|
|
230
|
+
return { ...own, via: "copy" };
|
|
231
|
+
const shared = skillPath("agents", app.appName, env);
|
|
232
|
+
const dirs = existsSync(hermesHome(env)) ? externalDirs(env, run) : void 0;
|
|
233
|
+
const read = dirs !== void 0 && lists(dirs, dirname(dirname(shared)), env) ? copyStatus(app, shared) : void 0;
|
|
234
|
+
if (read)
|
|
235
|
+
return { ...read, via: "external_dirs" };
|
|
236
|
+
return { path: shared, installed: null, state: "missing", via: null };
|
|
237
|
+
}, "hermesSkillStatus");
|
|
238
|
+
var skillParts = /* @__PURE__ */ __name((skill) => {
|
|
239
|
+
try {
|
|
240
|
+
return Object.fromEntries(skillFiles(skill).filter((file) => file.endsWith(".md")).reverse().map((file) => [basename(file, ".md"), new URL(file, skill)]));
|
|
241
|
+
} catch {
|
|
242
|
+
return {};
|
|
243
|
+
}
|
|
244
|
+
}, "skillParts");
|
|
245
|
+
var skillCommand = /* @__PURE__ */ __name((app, skill, environment, more = {}) => {
|
|
246
|
+
const command = new Command("skill").description("the instructions an agent is given for this tool");
|
|
247
|
+
const machine = /* @__PURE__ */ __name((self) => {
|
|
248
|
+
const { json, jsonl } = self.optsWithGlobals();
|
|
249
|
+
return json === true || jsonl === true;
|
|
250
|
+
}, "machine");
|
|
251
|
+
const shown = { ...skillParts(skill), ...more };
|
|
252
|
+
const named = Object.keys(shown);
|
|
253
|
+
const show = annotate(command.command("show"), { effects: { remote: "none", local: "read" } }).summary("print the tool's instructions for AI agents").description(`print SKILL.md \u2014 \`${app.command} skill install\` puts it where Claude Code, Codex, Gemini CLI and OpenClaw look for it, and where Hermes does on request; --for prints the copy already there`);
|
|
254
|
+
if (named.length > 0)
|
|
255
|
+
show.argument("[name]", `a part of this skill, or a skill shipped for a task: ${named.join(", ")}`);
|
|
256
|
+
show.addOption(new Option("--for <agents>", "print the copy installed for these agents instead of this version's").choices(SKILL_TARGETS));
|
|
257
|
+
show.action(function(given) {
|
|
258
|
+
const name = typeof given === "string" ? given : void 0;
|
|
259
|
+
const { renderer, streams, env } = environment(this);
|
|
260
|
+
const { for: target } = this.opts();
|
|
261
|
+
if (target !== void 0) {
|
|
262
|
+
if (name !== void 0)
|
|
263
|
+
throw new CliError("validation_error", `only ${app.appName} is installed; leave out "${name}" with --for`);
|
|
264
|
+
const path = skillPath(target, app.appName, env ?? process.env);
|
|
265
|
+
let content2;
|
|
266
|
+
try {
|
|
267
|
+
content2 = readFileSync(path, "utf8").trimEnd();
|
|
268
|
+
} catch {
|
|
269
|
+
throw new CliError("not_found", `no skill is installed for ${target} at ${path} \u2014 \`${app.command} skill install --for ${target}\` writes it`);
|
|
270
|
+
}
|
|
271
|
+
if (machine(this))
|
|
272
|
+
renderer.result({ name: app.appName, target, path, installed: skillVersion(content2) ?? null, content: content2 });
|
|
273
|
+
else
|
|
274
|
+
streams.data(content2);
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
const source = name === void 0 ? skill : shown[name];
|
|
278
|
+
if (!source) {
|
|
279
|
+
throw new CliError("validation_error", `no skill "${name}" \u2014 there are: ${named.join(", ")}`);
|
|
280
|
+
}
|
|
281
|
+
const content = name === void 0 ? readFileSync(source, "utf8").trimEnd() : readFileSync(source, "utf8").trimEnd().replaceAll("{{command}}", app.command);
|
|
282
|
+
if (machine(this))
|
|
283
|
+
renderer.result({ name: name ?? app.appName, content });
|
|
284
|
+
else
|
|
285
|
+
streams.data(content);
|
|
286
|
+
});
|
|
287
|
+
annotate(command.command("install"), { effects: { remote: "none", local: "write" } }).summary("install the tool's instructions for AI agents").description(`write SKILL.md to ~/.claude/skills/${app.appName}/ (Claude Code) and ~/.agents/skills/${app.appName}/ (Codex, Gemini CLI, OpenClaw); --for hermes also has Hermes read ~/.agents/skills, which changes Hermes's own settings, so all leaves it out`).addOption(new Option("--for <agents>", "which agents to install for").choices(["claude", "agents", "hermes", "all"]).default("all")).action(function({ for: chosen }) {
|
|
288
|
+
const { renderer, env } = environment(this);
|
|
289
|
+
if (chosen === "hermes") {
|
|
290
|
+
const { written: written2, hermes } = installHermesSkill(app, skill, env ? { env } : {});
|
|
291
|
+
renderer.result({ name: app.appName, version: app.version, written: written2, hermes });
|
|
292
|
+
renderer.success(hermes.via === "external_dirs" ? `${app.appName} ${app.version} skill installed: ${hermes.path}; Hermes reads ${dirname(dirname(hermes.path))} (skills.external_dirs)` : `${app.appName} ${app.version} skill installed: ${hermes.path}, a copy for Hermes (${hermes.reason})`);
|
|
293
|
+
if (hermes.removed)
|
|
294
|
+
renderer.note(`removed the earlier copy Hermes would also have found: ${hermes.removed}`);
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
const targets = chosen === "all" ? SKILL_TARGETS : [chosen];
|
|
298
|
+
const written = installSkill(app, skill, { targets, ...env ? { env } : {} });
|
|
299
|
+
renderer.result({ name: app.appName, version: app.version, written });
|
|
300
|
+
renderer.success(`${app.appName} ${app.version} skill installed: ${written.join(", ")}`);
|
|
301
|
+
});
|
|
302
|
+
annotate(command.command("status"), {
|
|
303
|
+
effects: { remote: "none", local: "read" },
|
|
304
|
+
examples: [`${app.command} skill status`, `${app.command} skill status --json`]
|
|
305
|
+
}).summary("whether the installed instructions for AI agents match this version").description(`for each place \`${app.command} skill install\` writes to, and for the copy Hermes reads: the path, the version installed there, and whether it is current, stale, missing or unversioned`).action(function() {
|
|
306
|
+
const { renderer, env } = environment(this);
|
|
307
|
+
const targets = skillStatus(app, env ?? process.env);
|
|
308
|
+
const hermes = hermesSkillStatus(app, env ? { env } : {});
|
|
309
|
+
renderer.result({ name: app.appName, version: app.version, targets, hermes });
|
|
310
|
+
});
|
|
311
|
+
return command;
|
|
312
|
+
}, "skillCommand");
|
|
313
|
+
var isAgent = /* @__PURE__ */ __name((env) => Boolean(env.AI_AGENT || env.CLAUDECODE), "isAgent");
|
|
314
|
+
var needsInstall = /* @__PURE__ */ __name((app, env) => {
|
|
315
|
+
const states = skillStatus(app, env).map(({ state }) => state);
|
|
316
|
+
return states.every((state) => state === "missing") || states.some((state) => state === "stale" || state === "unversioned");
|
|
317
|
+
}, "needsInstall");
|
|
318
|
+
var skillHint = /* @__PURE__ */ __name(({ app, argv, env, statePath, enabled = true, now = Date.now }) => {
|
|
319
|
+
try {
|
|
320
|
+
if (!enabled || !isAgent(env))
|
|
321
|
+
return void 0;
|
|
322
|
+
if (argv.includes("skill") || argv.includes("complete"))
|
|
323
|
+
return void 0;
|
|
324
|
+
const at = now();
|
|
325
|
+
const shown = readNoticeState(statePath).skillHintAt;
|
|
326
|
+
if (shown !== void 0 && at - shown < CHECK_EVERY_MS)
|
|
327
|
+
return void 0;
|
|
328
|
+
if (!needsInstall(app, env))
|
|
329
|
+
return void 0;
|
|
330
|
+
writeUpdateState(statePath, { skillHintAt: at });
|
|
331
|
+
return `agents: \`${app.command} skill install\` installs this tool's guide`;
|
|
332
|
+
} catch {
|
|
333
|
+
return void 0;
|
|
334
|
+
}
|
|
335
|
+
}, "skillHint");
|
|
336
|
+
var skillResource = /* @__PURE__ */ __name((app, skill) => {
|
|
337
|
+
const uri = `${app.command}://skill`;
|
|
338
|
+
return {
|
|
339
|
+
uri,
|
|
340
|
+
name: "skill",
|
|
341
|
+
title: `${app.appName} SKILL.md`,
|
|
342
|
+
description: `How to use ${app.command}: the guide an agent is given for this tool.`,
|
|
343
|
+
mimeType: "text/markdown",
|
|
344
|
+
read: /* @__PURE__ */ __name(() => ({ contents: [{ uri, mimeType: "text/markdown", text: readFileSync(skill, "utf8") }] }), "read"),
|
|
345
|
+
instruction: `- The full guide is the resource ${uri}; \`${app.command} skill install\` installs it as an agent skill.`
|
|
346
|
+
};
|
|
347
|
+
}, "skillResource");
|
|
348
|
+
var skillResources = /* @__PURE__ */ __name((app, skill) => {
|
|
349
|
+
const main = skillResource(app, skill);
|
|
350
|
+
let parts = [];
|
|
351
|
+
try {
|
|
352
|
+
parts = skillFiles(skill).filter((file) => file.endsWith(".md"));
|
|
353
|
+
} catch {
|
|
354
|
+
}
|
|
355
|
+
if (parts.length === 0)
|
|
356
|
+
return [main];
|
|
357
|
+
return [
|
|
358
|
+
{
|
|
359
|
+
...main,
|
|
360
|
+
instruction: `- The guide is the resource ${main.uri}; the parts it links are ${main.uri}/<path>, read only the one a task needs. \`${app.command} skill install\` installs it as an agent skill.`
|
|
361
|
+
},
|
|
362
|
+
...parts.map((file) => {
|
|
363
|
+
const uri = `${main.uri}/${file}`;
|
|
364
|
+
return {
|
|
365
|
+
uri,
|
|
366
|
+
name: `skill/${file}`,
|
|
367
|
+
title: `${app.appName} ${file}`,
|
|
368
|
+
description: `A part of the ${app.command} guide that ${main.uri} links to.`,
|
|
369
|
+
mimeType: "text/markdown",
|
|
370
|
+
read: /* @__PURE__ */ __name(() => ({
|
|
371
|
+
contents: [{ uri, mimeType: "text/markdown", text: readFileSync(new URL(file, skill), "utf8") }]
|
|
372
|
+
}), "read"),
|
|
373
|
+
instruction: ""
|
|
374
|
+
};
|
|
375
|
+
})
|
|
376
|
+
];
|
|
377
|
+
}, "skillResources");
|
|
378
|
+
|
|
379
|
+
export {
|
|
380
|
+
skillVersion,
|
|
381
|
+
writeSkillFolder,
|
|
382
|
+
installSkill,
|
|
383
|
+
skillStatus,
|
|
384
|
+
hermesCopyPath,
|
|
385
|
+
skillCommand,
|
|
386
|
+
skillHint,
|
|
387
|
+
skillResources
|
|
388
|
+
};
|
|
@@ -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.714.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.122.0_commander@15_dd9fedf917a0d541ef7fdcdb0be0e64b/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.",
|
|
@@ -19,11 +19,11 @@ import {
|
|
|
19
19
|
string,
|
|
20
20
|
text,
|
|
21
21
|
unknown
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-SPXNI53Z.js";
|
|
23
23
|
import {
|
|
24
24
|
CliError,
|
|
25
25
|
visibleControls
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-PK5WEGPJ.js";
|
|
27
27
|
import {
|
|
28
28
|
__commonJS,
|
|
29
29
|
__name,
|
|
@@ -1896,7 +1896,7 @@ var require_cli_table3 = __commonJS({
|
|
|
1896
1896
|
}
|
|
1897
1897
|
});
|
|
1898
1898
|
|
|
1899
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1899
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.122.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/drain.js
|
|
1900
1900
|
var waitForDrain = /* @__PURE__ */ __name((stream, signal) => {
|
|
1901
1901
|
if (signal?.aborted)
|
|
1902
1902
|
return Promise.reject(signal.reason);
|
|
@@ -1924,7 +1924,7 @@ var waitForDrain = /* @__PURE__ */ __name((stream, signal) => {
|
|
|
1924
1924
|
});
|
|
1925
1925
|
}, "waitForDrain");
|
|
1926
1926
|
|
|
1927
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1927
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.122.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/streams.js
|
|
1928
1928
|
var processStreams = {
|
|
1929
1929
|
drain: /* @__PURE__ */ __name(async (signal) => {
|
|
1930
1930
|
await Promise.all([waitForDrain(process.stdout, signal), waitForDrain(process.stderr, signal)]);
|
|
@@ -1953,7 +1953,7 @@ var captureStreams = /* @__PURE__ */ __name(() => {
|
|
|
1953
1953
|
};
|
|
1954
1954
|
}, "captureStreams");
|
|
1955
1955
|
|
|
1956
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1956
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.122.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/retry.js
|
|
1957
1957
|
var DEFAULT_RETRY = {
|
|
1958
1958
|
retries: 1,
|
|
1959
1959
|
baseDelayMs: 250,
|
|
@@ -1965,7 +1965,7 @@ var backoffMs = /* @__PURE__ */ __name((attempt, config, random) => {
|
|
|
1965
1965
|
return Math.round(random() * ceiling);
|
|
1966
1966
|
}, "backoffMs");
|
|
1967
1967
|
|
|
1968
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1968
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.122.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/result-fields.js
|
|
1969
1969
|
var forbidden = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
|
|
1970
1970
|
var validate = /* @__PURE__ */ __name((paths) => {
|
|
1971
1971
|
if (paths.length === 0 || paths.length > 128 || paths.some((path) => path.length > 256 || !/^[A-Za-z][A-Za-z0-9_]*(?:\.[A-Za-z][A-Za-z0-9_]*)*$/.test(path) || path.split(".").some((part) => forbidden.has(part))))
|
|
@@ -2030,7 +2030,7 @@ var projectFields = /* @__PURE__ */ __name((value, fields) => {
|
|
|
2030
2030
|
return project(value, fields);
|
|
2031
2031
|
}, "projectFields");
|
|
2032
2032
|
|
|
2033
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2033
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.122.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/batch.js
|
|
2034
2034
|
var BATCH_LIMITS = Object.freeze({
|
|
2035
2035
|
requests: 32,
|
|
2036
2036
|
input_bytes: 262144,
|
|
@@ -2157,7 +2157,7 @@ var runBatch = /* @__PURE__ */ __name(async (requests, options = {}) => {
|
|
|
2157
2157
|
};
|
|
2158
2158
|
}, "runBatch");
|
|
2159
2159
|
|
|
2160
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2160
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.122.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/config.js
|
|
2161
2161
|
import { randomBytes } from "node:crypto";
|
|
2162
2162
|
import { mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
2163
2163
|
import { dirname, join } from "node:path";
|
|
@@ -2201,16 +2201,16 @@ var saveConfigFile = /* @__PURE__ */ __name((path, config) => {
|
|
|
2201
2201
|
`, 384);
|
|
2202
2202
|
}, "saveConfigFile");
|
|
2203
2203
|
|
|
2204
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2204
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.122.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/constants.js
|
|
2205
2205
|
var BASE_CONSTANTS = new URL("../constants.json", new URL("constants.js", import.meta.resolve("@wirecat/cli-base")).href);
|
|
2206
2206
|
var baseConstantsSchema = object({});
|
|
2207
2207
|
var LayerSchema = record(string(), unknown());
|
|
2208
2208
|
|
|
2209
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2209
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.122.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/credentials.js
|
|
2210
2210
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
2211
2211
|
import { join as join3, resolve } from "node:path";
|
|
2212
2212
|
|
|
2213
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2213
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.122.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/keyring.js
|
|
2214
2214
|
import { createRequire } from "node:module";
|
|
2215
2215
|
var ENTRY_OPTIONS = { linux: { store: "secret-service" } };
|
|
2216
2216
|
var require2 = createRequire(new URL("keyring.js", import.meta.resolve("@wirecat/cli-base")).href);
|
|
@@ -2236,7 +2236,7 @@ var systemKeyring = {
|
|
|
2236
2236
|
delete: /* @__PURE__ */ __name((service, account) => entry(service, account).deletePassword(), "delete")
|
|
2237
2237
|
};
|
|
2238
2238
|
|
|
2239
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2239
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.122.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/paths.js
|
|
2240
2240
|
import { realpathSync } from "node:fs";
|
|
2241
2241
|
import { homedir, userInfo } from "node:os";
|
|
2242
2242
|
import { join as join2, posix, win32 } from "node:path";
|
|
@@ -2310,7 +2310,7 @@ var homeIsMoved = /* @__PURE__ */ __name(({ env = process.env, platform = proces
|
|
|
2310
2310
|
var isMovedRun = /* @__PURE__ */ __name((options) => pathsAreOverridden(options) || homeIsMoved(options), "isMovedRun");
|
|
2311
2311
|
var configFilePath = /* @__PURE__ */ __name((configDir, fileName = "config.json") => join2(configDir, fileName), "configFilePath");
|
|
2312
2312
|
|
|
2313
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2313
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.122.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/credentials.js
|
|
2314
2314
|
var movedRunService = /* @__PURE__ */ __name((service, configDir) => `${service}:${resolve(configDir)}`, "movedRunService");
|
|
2315
2315
|
var warnedRuns = /* @__PURE__ */ new WeakSet();
|
|
2316
2316
|
var Credentials = class {
|
|
@@ -2349,7 +2349,12 @@ var Credentials = class {
|
|
|
2349
2349
|
return { secret: fromFile, source: "file" };
|
|
2350
2350
|
if (this.#storage !== "file") {
|
|
2351
2351
|
const temporary = this.#temporaryService;
|
|
2352
|
-
|
|
2352
|
+
let fromKeyring;
|
|
2353
|
+
try {
|
|
2354
|
+
fromKeyring = temporary && this.#keyring.get(temporary, account) || this.#keyring.get(this.#service, account);
|
|
2355
|
+
} catch (error) {
|
|
2356
|
+
throw this.#unreachable(account, error);
|
|
2357
|
+
}
|
|
2353
2358
|
if (fromKeyring)
|
|
2354
2359
|
return { secret: fromKeyring, source: "keyring" };
|
|
2355
2360
|
}
|
|
@@ -2430,6 +2435,10 @@ var Credentials = class {
|
|
|
2430
2435
|
writeSecurely(this.#path(), `${JSON.stringify(store, null, 2)}
|
|
2431
2436
|
`, 384);
|
|
2432
2437
|
}
|
|
2438
|
+
#unreachable(account, error) {
|
|
2439
|
+
const where = this.#storage === "keyring" ? "" : `, and ${this.#path()} holds no sign-in for ${account}`;
|
|
2440
|
+
return new CliError("configuration_error", `the OS keyring did not answer (${error instanceof Error ? error.message : String(error)})${where}. On Linux a restarted session bus is a known cause: log out and back in, or set DBUS_SESSION_BUS_ADDRESS=unix:path=$XDG_RUNTIME_DIR/bus. On a machine with no keyring, sign in with file storage.`, { reason: "keyring.unreachable" });
|
|
2441
|
+
}
|
|
2433
2442
|
#tryKeyring(operation) {
|
|
2434
2443
|
if (this.#storage === "keyring")
|
|
2435
2444
|
return operation();
|
|
@@ -2445,7 +2454,7 @@ var Credentials = class {
|
|
|
2445
2454
|
}
|
|
2446
2455
|
};
|
|
2447
2456
|
|
|
2448
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2457
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.122.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/time.js
|
|
2449
2458
|
var abortError = /* @__PURE__ */ __name(() => new DOMException("The operation was aborted.", "AbortError"), "abortError");
|
|
2450
2459
|
var realSleep = /* @__PURE__ */ __name((ms, signal) => new Promise((resolve2, reject) => {
|
|
2451
2460
|
if (signal?.aborted) {
|
|
@@ -2458,11 +2467,12 @@ var realSleep = /* @__PURE__ */ __name((ms, signal) => new Promise((resolve2, re
|
|
|
2458
2467
|
reject(abortError());
|
|
2459
2468
|
}, { once: true });
|
|
2460
2469
|
}), "realSleep");
|
|
2470
|
+
var wallClock = /* @__PURE__ */ __name(() => /* @__PURE__ */ new Date(), "wallClock");
|
|
2461
2471
|
|
|
2462
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2472
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.122.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/logging.js
|
|
2463
2473
|
import { appendFileSync } from "node:fs";
|
|
2464
2474
|
|
|
2465
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2475
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.122.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/log.js
|
|
2466
2476
|
var LOG_SEVERITIES = ["trace", "debug", "info", "warn", "error", "fatal"];
|
|
2467
2477
|
var logRecordSchema = strictObject({
|
|
2468
2478
|
time: isoTime,
|
|
@@ -2540,7 +2550,7 @@ var traceIdOf = /* @__PURE__ */ __name((traceparent) => {
|
|
|
2540
2550
|
return traceId;
|
|
2541
2551
|
}, "traceIdOf");
|
|
2542
2552
|
|
|
2543
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2553
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.122.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/logging.js
|
|
2544
2554
|
var REDACTED_FIELDS = [
|
|
2545
2555
|
"authorization",
|
|
2546
2556
|
"Authorization",
|
|
@@ -2634,7 +2644,7 @@ var silent = {
|
|
|
2634
2644
|
}, "error")
|
|
2635
2645
|
};
|
|
2636
2646
|
|
|
2637
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2647
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.122.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/pretty.js
|
|
2638
2648
|
var import_cli_table3 = __toESM(require_cli_table3(), 1);
|
|
2639
2649
|
import { styleText } from "node:util";
|
|
2640
2650
|
var renderPretty = /* @__PURE__ */ __name((value, options) => {
|
|
@@ -2709,7 +2719,7 @@ var BORDERLESS = {
|
|
|
2709
2719
|
middle: ""
|
|
2710
2720
|
};
|
|
2711
2721
|
|
|
2712
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2722
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.122.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/renderer.js
|
|
2713
2723
|
var createRenderer = /* @__PURE__ */ __name(({ format, color, streams = processStreams, quiet = false }) => {
|
|
2714
2724
|
const mark = /* @__PURE__ */ __name((symbol, message) => format === "pretty" ? `${symbol} ${visibleControls(message)}` : visibleControls(message), "mark");
|
|
2715
2725
|
const say = /* @__PURE__ */ __name((symbol) => (message) => {
|
|
@@ -2762,6 +2772,7 @@ export {
|
|
|
2762
2772
|
configFilePath,
|
|
2763
2773
|
Credentials,
|
|
2764
2774
|
realSleep,
|
|
2775
|
+
wallClock,
|
|
2765
2776
|
defineLogEvents,
|
|
2766
2777
|
isContentKey,
|
|
2767
2778
|
traceIdOf,
|
|
@@ -2,24 +2,24 @@ 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-XVRLD3LN.js";
|
|
6
6
|
import {
|
|
7
7
|
resolvePaths,
|
|
8
8
|
writeSecurely
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-6UNLEQA5.js";
|
|
10
10
|
import {
|
|
11
11
|
CliError,
|
|
12
12
|
singleLine
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-PK5WEGPJ.js";
|
|
14
14
|
import {
|
|
15
15
|
__name
|
|
16
16
|
} from "./chunk-ZVVMGPBJ.js";
|
|
17
17
|
|
|
18
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.714.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.122.0_commander@15_dd9fedf917a0d541ef7fdcdb0be0e64b/node_modules/@wirecat/cli-core/dist/store/shared-config.js
|
|
19
19
|
import { existsSync, mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from "node:fs";
|
|
20
20
|
import { dirname, join, resolve } from "node:path";
|
|
21
21
|
|
|
22
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.714.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.122.0_commander@15_dd9fedf917a0d541ef7fdcdb0be0e64b/node_modules/@wirecat/cli-core/dist/domain/config-repair.js
|
|
23
23
|
var REPAIR_WORDS = {
|
|
24
24
|
byte_order_mark: "an invisible byte-order mark at the start",
|
|
25
25
|
comment: "a comment, which JSON does not allow",
|
|
@@ -303,7 +303,7 @@ var explainBrokenJson = /* @__PURE__ */ __name((text, result) => {
|
|
|
303
303
|
return `line ${line}, column ${column}: ${why}${around(line)}; likely fix: ${fix ?? "correct that part by hand"}`;
|
|
304
304
|
}, "explainBrokenJson");
|
|
305
305
|
|
|
306
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
306
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.714.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.122.0_commander@15_dd9fedf917a0d541ef7fdcdb0be0e64b/node_modules/@wirecat/cli-core/dist/domain/task-categories.js
|
|
307
307
|
var DEFAULT_TASK_CATEGORIES = [
|
|
308
308
|
{
|
|
309
309
|
name: "taxes",
|
|
@@ -1058,7 +1058,7 @@ var storedTaskCategories = /* @__PURE__ */ __name((json) => {
|
|
|
1058
1058
|
}
|
|
1059
1059
|
}, "storedTaskCategories");
|
|
1060
1060
|
|
|
1061
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1061
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.714.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.122.0_commander@15_dd9fedf917a0d541ef7fdcdb0be0e64b/node_modules/@wirecat/cli-core/dist/store/shared-config.js
|
|
1062
1062
|
var SECTION = "task_categories";
|
|
1063
1063
|
var sharedConfigPath = /* @__PURE__ */ __name((store, env = process.env) => {
|
|
1064
1064
|
const paths = resolvePaths({ appName: "WireCat", prefix: "WIRECAT", env });
|