@wirecat/tg-cli 0.99.0 → 0.101.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 +6 -5
- package/dist/bin/tg.js +23 -28
- package/dist/bundle/adapter-A3VD4Y6Z.js +2790 -0
- package/dist/bundle/all-profiles-UPVNHXB2.js +264 -0
- package/dist/bundle/anthropic-IRKNWPIB.js +71 -0
- package/dist/bundle/bot-api-UNTQG2M5.js +39793 -0
- package/dist/bundle/bot-history-V4RTY5K7.js +167 -0
- package/dist/bundle/bun-2JZPG2NL.js +169 -0
- package/dist/bundle/bun-sqlite-TZHKM225.js +70 -0
- package/dist/bundle/chunk-22PQUX72.js +190 -0
- package/dist/bundle/chunk-2DGOFLDA.js +58 -0
- package/dist/bundle/chunk-2SJOUK6J.js +2 -0
- package/dist/bundle/chunk-2XBSVRT2.js +98 -0
- package/dist/bundle/chunk-3KHKYYCR.js +24782 -0
- package/dist/bundle/chunk-4ZS73HTJ.js +6848 -0
- package/dist/bundle/chunk-54R2GDQ3.js +119 -0
- package/dist/bundle/chunk-5GKXETRP.js +1345 -0
- package/dist/bundle/chunk-5KU4UQBM.js +570 -0
- package/dist/bundle/chunk-5TPT2S2Z.js +41 -0
- package/dist/bundle/chunk-64DK7S4F.js +76 -0
- package/dist/bundle/chunk-6IPY2QRG.js +82 -0
- package/dist/bundle/chunk-7BFO3DY6.js +21 -0
- package/dist/bundle/chunk-7CBUCTB6.js +1142 -0
- package/dist/bundle/chunk-A5JSTZZZ.js +122 -0
- package/dist/bundle/chunk-ACGTFLEB.js +1275 -0
- package/dist/bundle/chunk-AFV74GK3.js +50 -0
- package/dist/bundle/chunk-AVWK4NCW.js +24600 -0
- package/dist/bundle/chunk-BJG6JA5U.js +35 -0
- package/dist/bundle/chunk-BX6HH4F6.js +215 -0
- package/dist/bundle/chunk-BXQS5RCE.js +8170 -0
- package/dist/bundle/chunk-CJ6IYCYP.js +583 -0
- package/dist/bundle/chunk-DG62L57H.js +2795 -0
- package/dist/bundle/chunk-DYNSP6FW.js +33720 -0
- package/dist/bundle/chunk-F7TDFWXY.js +82 -0
- package/dist/bundle/chunk-G2US6LJB.js +35 -0
- package/dist/bundle/chunk-G3ZRY436.js +3077 -0
- package/dist/bundle/chunk-G77QOTXE.js +18 -0
- package/dist/bundle/chunk-H6OXALTJ.js +45 -0
- package/dist/bundle/chunk-LPB2MDUW.js +452 -0
- package/dist/bundle/chunk-MLLJ74LM.js +24 -0
- package/dist/bundle/chunk-N5UFBWDM.js +166 -0
- package/dist/bundle/chunk-NC5WS7OP.js +31 -0
- package/dist/bundle/chunk-NKJJJAIJ.js +237 -0
- package/dist/bundle/chunk-NMGO6LW6.js +1950 -0
- package/dist/bundle/chunk-ODSVNH3H.js +18588 -0
- package/dist/bundle/chunk-OEJ5DMCX.js +2374 -0
- package/dist/bundle/chunk-OILBDLWL.js +724 -0
- package/dist/bundle/chunk-OPBTNQ35.js +1007 -0
- package/dist/bundle/chunk-PUBS2F5J.js +35803 -0
- package/dist/bundle/chunk-PYTOIDSM.js +153 -0
- package/dist/bundle/chunk-QOWSVDPZ.js +3526 -0
- package/dist/bundle/chunk-QYVVRQTN.js +73 -0
- package/dist/bundle/chunk-RF54YDBB.js +46 -0
- package/dist/bundle/chunk-RVCS7Q3A.js +6672 -0
- package/dist/bundle/chunk-S2JSZWEC.js +277 -0
- package/dist/bundle/chunk-S7ZNLLY5.js +54 -0
- package/dist/bundle/chunk-TGREFJVA.js +2315 -0
- package/dist/bundle/chunk-U46UNBMT.js +524 -0
- package/dist/bundle/chunk-UN6CKIBN.js +285 -0
- package/dist/bundle/chunk-VA5YEJS3.js +161 -0
- package/dist/bundle/chunk-VCGL2ETF.js +78 -0
- package/dist/bundle/chunk-VRSN7VLO.js +63 -0
- package/dist/bundle/chunk-VYDTI254.js +3332 -0
- package/dist/bundle/chunk-W2336E7Y.js +886 -0
- package/dist/bundle/chunk-X4Y2ROJI.js +541 -0
- package/dist/bundle/chunk-XCKD54TN.js +100 -0
- package/dist/bundle/chunk-ZEOCU24Z.js +738 -0
- package/dist/bundle/chunk-ZJVZXJOG.js +71 -0
- package/dist/bundle/chunk-ZV24I2UJ.js +25 -0
- package/dist/bundle/chunk-ZZLKX62Z.js +928 -0
- package/dist/bundle/command-contract-TKDI7E56.js +31 -0
- package/dist/bundle/dist-RJMT44PL.js +7577 -0
- package/dist/bundle/echarts-QZ6PR3VC.js +42501 -0
- package/dist/bundle/embed-UBXCXSRD.js +35 -0
- package/dist/bundle/embedder-B4ZTKC23.js +108 -0
- package/dist/bundle/entry-BTUTHO5M.js +14 -0
- package/dist/bundle/first-run-UC4HRIFV.js +24 -0
- package/dist/bundle/first-screen-SMCX6YKY.js +29 -0
- package/dist/bundle/identity-QSDEGDH7.js +11 -0
- package/dist/bundle/instructions-BBGLZKO3.js +9 -0
- package/dist/bundle/mcp-4Y37G2UY.js +165 -0
- package/dist/bundle/node-IUL5HSYI.js +2340 -0
- package/dist/bundle/node-LZZX22VR.js +176 -0
- package/dist/bundle/node-UPPL626U.js +21 -0
- package/dist/bundle/node-sqlite-BPGT6T5U.js +46 -0
- package/dist/bundle/oauth-XNE2KPKJ.js +18 -0
- package/dist/bundle/open-SXGYZLB5.js +20 -0
- package/dist/bundle/process-GPUXC4PG.js +91 -0
- package/dist/bundle/program-NEXEAL7T.js +1060 -0
- package/dist/bundle/prompt-SORGLEYI.js +13 -0
- package/dist/bundle/proxy-transport-G4MA6BGU.js +17 -0
- package/dist/bundle/recognize-UJBXORVD.js +191 -0
- package/dist/bundle/remote-W72AR7KH.js +26 -0
- package/dist/bundle/rerank-3Y2VZM3J.js +49 -0
- package/dist/bundle/serve-VDZIVOPR.js +196 -0
- package/dist/bundle/server-BERXP4GW.js +785 -0
- package/dist/bundle/server-ZFHN4GUF.js +178 -0
- package/dist/bundle/state-DGR4EE3E.js +34 -0
- package/dist/bundle/store-MRCFSCZD.js +121 -0
- package/dist/bundle/store-maintenance-command-DCMZDMYS.js +46 -0
- package/dist/bundle/tg.js +40 -0
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +3 -1
- package/dist/commands/context.js.map +1 -1
- package/dist/install/postinstall.js +1 -1
- package/dist/install/postinstall.js.map +1 -1
- package/dist/program.js +1 -1
- package/dist/program.js.map +1 -1
- package/dist/telegram/errors.js +1 -1
- package/dist/telegram/errors.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/install/windows.ps1 +1 -1
- package/package.json +6 -4
- package/skills/{wirecat-tg → tg-cli}/SKILL.md +4 -4
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { createRequire as __tgRequire } from "node:module";
|
|
2
|
+
const require = __tgRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
executableEnvironment,
|
|
5
|
+
executableOnPath,
|
|
6
|
+
require_cross_spawn
|
|
7
|
+
} from "./chunk-5KU4UQBM.js";
|
|
8
|
+
import {
|
|
9
|
+
loadConfigFile,
|
|
10
|
+
saveConfigFile
|
|
11
|
+
} from "./chunk-DG62L57H.js";
|
|
12
|
+
import {
|
|
13
|
+
number,
|
|
14
|
+
object,
|
|
15
|
+
optional,
|
|
16
|
+
string
|
|
17
|
+
} from "./chunk-OEJ5DMCX.js";
|
|
18
|
+
import {
|
|
19
|
+
__name,
|
|
20
|
+
__toESM
|
|
21
|
+
} from "./chunk-AFV74GK3.js";
|
|
22
|
+
|
|
23
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.64.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/update/index.js
|
|
24
|
+
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
25
|
+
import { existsSync } from "node:fs";
|
|
26
|
+
var installerOf = /* @__PURE__ */ __name((scriptPath) => {
|
|
27
|
+
const path = scriptPath.replaceAll("\\", "/");
|
|
28
|
+
if (path.includes("/_npx/"))
|
|
29
|
+
return "npx";
|
|
30
|
+
if (path.includes("/install/global/node_modules/"))
|
|
31
|
+
return "bun";
|
|
32
|
+
if (/\/\.?pnpm\//.test(path))
|
|
33
|
+
return "pnpm";
|
|
34
|
+
if (path.includes("/node_modules/"))
|
|
35
|
+
return "npm";
|
|
36
|
+
return path.includes("/dist/") ? "checkout" : "unknown";
|
|
37
|
+
}, "installerOf");
|
|
38
|
+
var updateCommand = /* @__PURE__ */ __name((installer, packageName) => {
|
|
39
|
+
const target = `${packageName}@latest`;
|
|
40
|
+
switch (installer) {
|
|
41
|
+
// pnpm 11 installs only versions a day old (minimumReleaseAge 1440); a fix must reach users the day it ships.
|
|
42
|
+
// Only the package's own scope is exempt — every other dependency keeps the wait.
|
|
43
|
+
case "pnpm":
|
|
44
|
+
return ["pnpm", "add", "-g", target, `--config.minimumReleaseAgeExclude=${ownScope(packageName)}`];
|
|
45
|
+
case "npm":
|
|
46
|
+
return ["npm", "install", "-g", target];
|
|
47
|
+
case "bun":
|
|
48
|
+
return ["bun", "add", "-g", target];
|
|
49
|
+
default:
|
|
50
|
+
return void 0;
|
|
51
|
+
}
|
|
52
|
+
}, "updateCommand");
|
|
53
|
+
var ownScope = /* @__PURE__ */ __name((packageName) => packageName.startsWith("@") ? `${packageName.split("/", 1)[0]}/*` : packageName, "ownScope");
|
|
54
|
+
var isNewer = /* @__PURE__ */ __name((candidate, current) => {
|
|
55
|
+
const parse = /* @__PURE__ */ __name((version) => /^\d+\.\d+\.\d+$/.test(version) ? version.split(".").map(Number) : void 0, "parse");
|
|
56
|
+
const a = parse(candidate);
|
|
57
|
+
const b = parse(current);
|
|
58
|
+
if (!a || !b)
|
|
59
|
+
return false;
|
|
60
|
+
for (let i = 0; i < 3; i++) {
|
|
61
|
+
if (a[i] !== b[i])
|
|
62
|
+
return a[i] > b[i];
|
|
63
|
+
}
|
|
64
|
+
return false;
|
|
65
|
+
}, "isNewer");
|
|
66
|
+
var latestVersion = /* @__PURE__ */ __name(async (packageName, fetch, { timeoutMs = 1e3 } = {}) => {
|
|
67
|
+
try {
|
|
68
|
+
const response = await fetch(`https://registry.npmjs.org/${packageName}/latest`, {
|
|
69
|
+
signal: AbortSignal.timeout(timeoutMs),
|
|
70
|
+
headers: { accept: "application/json" }
|
|
71
|
+
});
|
|
72
|
+
if (!response.ok)
|
|
73
|
+
return void 0;
|
|
74
|
+
const { version } = await response.json();
|
|
75
|
+
return typeof version === "string" ? version : void 0;
|
|
76
|
+
} catch {
|
|
77
|
+
return void 0;
|
|
78
|
+
}
|
|
79
|
+
}, "latestVersion");
|
|
80
|
+
var CHECK_EVERY_MS = 24 * 60 * 60 * 1e3;
|
|
81
|
+
var mayNotify = /* @__PURE__ */ __name(({ format, stderrIsTTY, quiet, enabled, installer, env, offVariables = [] }) => enabled && format === "pretty" && stderrIsTTY && !quiet && updateCommand(installer, "any") !== void 0 && !env.CI && !env.NO_UPDATE_NOTIFIER && offVariables.every((name) => !env[name]), "mayNotify");
|
|
82
|
+
var updateState = object({
|
|
83
|
+
checkedAt: number(),
|
|
84
|
+
latest: optional(string()),
|
|
85
|
+
/** When the skill hint (`cli-base/skill`) was last shown — the other daily notice kept in this file. */
|
|
86
|
+
skillHintAt: optional(number())
|
|
87
|
+
});
|
|
88
|
+
var readNoticeState = /* @__PURE__ */ __name((path) => {
|
|
89
|
+
try {
|
|
90
|
+
return loadConfigFile(path, updateState, () => ({ checkedAt: 0 }));
|
|
91
|
+
} catch {
|
|
92
|
+
return { checkedAt: 0 };
|
|
93
|
+
}
|
|
94
|
+
}, "readNoticeState");
|
|
95
|
+
var readUpdateState = /* @__PURE__ */ __name((path) => {
|
|
96
|
+
const state = readNoticeState(path);
|
|
97
|
+
return state.checkedAt > 0 ? state : void 0;
|
|
98
|
+
}, "readUpdateState");
|
|
99
|
+
var writeUpdateState = /* @__PURE__ */ __name((path, state) => {
|
|
100
|
+
try {
|
|
101
|
+
saveConfigFile(path, { ...readNoticeState(path), ...state });
|
|
102
|
+
} catch {
|
|
103
|
+
}
|
|
104
|
+
}, "writeUpdateState");
|
|
105
|
+
var checkIsDue = /* @__PURE__ */ __name((state, now) => state === void 0 || now - state.checkedAt >= CHECK_EVERY_MS, "checkIsDue");
|
|
106
|
+
var spawnPlan = /* @__PURE__ */ __name(([command, ...args], platform = process.platform, env = process.env, exists = existsSync) => ({ file: executableOnPath(command, env, platform, exists), args, shell: false }), "spawnPlan");
|
|
107
|
+
var runUpdate = /* @__PURE__ */ __name((argv) => {
|
|
108
|
+
const { file, args, shell } = spawnPlan(argv);
|
|
109
|
+
const { status, error } = import_cross_spawn.default.sync(file, args, {
|
|
110
|
+
stdio: ["inherit", 2, 2],
|
|
111
|
+
shell,
|
|
112
|
+
env: executableEnvironment(process.env)
|
|
113
|
+
});
|
|
114
|
+
if (error)
|
|
115
|
+
throw new Error(`could not start ${argv[0]}: ${error.message}`);
|
|
116
|
+
return status ?? 1;
|
|
117
|
+
}, "runUpdate");
|
|
118
|
+
var updateNotice = /* @__PURE__ */ __name(async ({ argv, packageName, command, upgradeCommand = "upgrade", version, statePath, fetch, now = Date.now, ...context }) => {
|
|
119
|
+
try {
|
|
120
|
+
const path = commandWords(argv).slice(0, 2);
|
|
121
|
+
if (path.includes("complete") || path.includes(upgradeCommand))
|
|
122
|
+
return void 0;
|
|
123
|
+
if (!mayNotify(context))
|
|
124
|
+
return void 0;
|
|
125
|
+
const at = now();
|
|
126
|
+
let state = readUpdateState(statePath);
|
|
127
|
+
if (checkIsDue(state, at)) {
|
|
128
|
+
const found = await latestVersion(packageName, fetch, { timeoutMs: 1e3 });
|
|
129
|
+
const seen = found ?? state?.latest;
|
|
130
|
+
state = seen ? { checkedAt: at, latest: seen } : { checkedAt: at };
|
|
131
|
+
writeUpdateState(statePath, state);
|
|
132
|
+
}
|
|
133
|
+
return state?.latest && isNewer(state.latest, version) ? `${command} ${state.latest} is out \u2014 you have ${version}. \`${command} ${upgradeCommand}\` installs it.` : void 0;
|
|
134
|
+
} catch {
|
|
135
|
+
return void 0;
|
|
136
|
+
}
|
|
137
|
+
}, "updateNotice");
|
|
138
|
+
var commandWords = /* @__PURE__ */ __name((argv) => {
|
|
139
|
+
const end = argv.indexOf("--");
|
|
140
|
+
return argv.slice(0, end < 0 ? void 0 : end).filter((word) => !word.startsWith("-"));
|
|
141
|
+
}, "commandWords");
|
|
142
|
+
|
|
143
|
+
export {
|
|
144
|
+
installerOf,
|
|
145
|
+
updateCommand,
|
|
146
|
+
isNewer,
|
|
147
|
+
latestVersion,
|
|
148
|
+
CHECK_EVERY_MS,
|
|
149
|
+
readNoticeState,
|
|
150
|
+
writeUpdateState,
|
|
151
|
+
runUpdate,
|
|
152
|
+
updateNotice
|
|
153
|
+
};
|