@wirecat/tg-cli 0.132.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 +139 -319
- 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-OXVMOWVE.js → adapter-Y4IXTXAG.js} +104 -68
- package/dist/bundle/agent-G7VHOJMS.js +37 -0
- package/dist/bundle/{all-profiles-6OQC7PBL.js → all-profiles-SUGID6CX.js} +62 -20
- package/dist/bundle/{anthropic-YFMIHFW5.js → anthropic-4QKTXT4B.js} +5 -5
- package/dist/bundle/{app-server-S7CJPJXN.js → app-server-TPOD6LIJ.js} +75 -65
- package/dist/bundle/{bot-api-KJ6EZ4R6.js → bot-api-KBESP422.js} +73 -91
- package/dist/bundle/{bot-history-JYCXDFW4.js → bot-history-3EORA23G.js} +23 -22
- package/dist/bundle/{bun-FVTOBYZ2.js → bun-FL76M4M2.js} +2 -2
- package/dist/bundle/{bun-sqlite-KDGWBNOR.js → bun-sqlite-H37OSTAJ.js} +6 -6
- package/dist/bundle/{chunk-JZJV3DYK.js → chunk-2GT563YH.js} +2 -2
- package/dist/bundle/{chunk-EPR67IRV.js → chunk-2JWY7CXJ.js} +4 -4
- package/dist/bundle/{chunk-UGD4SCUI.js → chunk-3O25FAPA.js} +3 -4
- package/dist/bundle/{chunk-AERP2QR6.js → chunk-3PG6QVQZ.js} +11 -25
- package/dist/bundle/{chunk-DXPGMUOR.js → chunk-3QQWTP77.js} +2 -2
- package/dist/bundle/{chunk-FIUH52FE.js → chunk-3ZNO27UE.js} +1 -1
- package/dist/bundle/{chunk-Y57EKZZK.js → chunk-4R2ZJGFF.js} +3274 -1674
- package/dist/bundle/{chunk-6LPUK62N.js → chunk-4S2DHHJM.js} +2 -100
- package/dist/bundle/{chunk-LF6FACSW.js → chunk-4X6BX3XP.js} +144 -10
- package/dist/bundle/{chunk-LZ3HFDYL.js → chunk-6DGVK5KS.js} +2 -2
- package/dist/bundle/chunk-6DJJVFSG.js +388 -0
- package/dist/bundle/{chunk-BSXS7VAC.js → chunk-6MEHKUN6.js} +1 -1
- package/dist/bundle/{chunk-44A2XRDE.js → chunk-6UNLEQA5.js} +31 -20
- package/dist/bundle/{chunk-M2TV6BDB.js → chunk-77E7Q4EQ.js} +7 -7
- package/dist/bundle/chunk-7GGDCQJ5.js +353 -0
- package/dist/bundle/{chunk-OGZZUDJJ.js → chunk-AHVWZDXO.js} +79 -64
- package/dist/bundle/{chunk-YVI5SQPY.js → chunk-ANBI3OXK.js} +1 -1
- package/dist/bundle/{chunk-PR4F3TYK.js → chunk-AYWST6NA.js} +60 -51
- package/dist/bundle/{chunk-7SEVVE3X.js → chunk-CA7DY2YU.js} +3 -3
- package/dist/bundle/{chunk-O43PARFS.js → chunk-CDKXZLMP.js} +273 -176
- package/dist/bundle/{chunk-YAPO7QNO.js → chunk-CNGNR4CY.js} +6 -6
- package/dist/bundle/{chunk-2UGSIHLV.js → chunk-CSXCCK6J.js} +2 -2
- package/dist/bundle/{chunk-N5LZ6L4D.js → chunk-DG35TQ6P.js} +3 -3
- package/dist/bundle/{chunk-LMGVPDXN.js → chunk-EXMAWEHC.js} +2 -2
- package/dist/bundle/{chunk-A5D3J7XZ.js → chunk-FR3ATU5I.js} +4 -4
- package/dist/bundle/{chunk-JDNDWZYS.js → chunk-FR4Y5CGW.js} +4 -4
- package/dist/bundle/{chunk-YSNQGOUI.js → chunk-GIGZTI74.js} +2115 -1975
- package/dist/bundle/{chunk-3QHKZLBU.js → chunk-H3TLAYGY.js} +4 -4
- package/dist/bundle/{chunk-KJICORS4.js → chunk-HD7DV5B2.js} +65 -43
- package/dist/bundle/{chunk-NLRGMP7M.js → chunk-HETHFOHC.js} +3 -3
- package/dist/bundle/{chunk-4YB7JU2W.js → chunk-HEZK4W3U.js} +6 -6
- package/dist/bundle/{chunk-2LZD2VFV.js → chunk-IJ7R2WMK.js} +4 -4
- package/dist/bundle/{chunk-4ZTVJHWU.js → chunk-ITJ7DGNA.js} +4 -4
- package/dist/bundle/{chunk-5UPEEMEF.js → chunk-J5RB4ASI.js} +142 -372
- package/dist/bundle/{chunk-IY7CTAOQ.js → chunk-JAL443BH.js} +9 -9
- package/dist/bundle/{chunk-U7PHJSTX.js → chunk-JCDD5T3A.js} +2 -2
- package/dist/bundle/{chunk-BLZEQVP4.js → chunk-JHZJBNDO.js} +2 -2
- package/dist/bundle/chunk-JWLODUN3.js +555 -0
- package/dist/bundle/{chunk-4CKYANQH.js → chunk-JWNSG5GI.js} +1 -1
- package/dist/bundle/{chunk-YRXSNH3R.js → chunk-JXEO5EIN.js} +2 -2
- package/dist/bundle/{chunk-DSJNZXTP.js → chunk-K5FK6WWN.js} +1 -1
- package/dist/bundle/{chunk-LG3K5NHX.js → chunk-L47PFECD.js} +7 -7
- package/dist/bundle/{chunk-OIRNHSAH.js → chunk-L4PNDW4S.js} +6 -6
- package/dist/bundle/{chunk-WAVRUADL.js → chunk-M323L5SG.js} +30 -15
- package/dist/bundle/{chunk-AUZWIBHJ.js → chunk-MMDFPBFZ.js} +43 -64
- package/dist/bundle/{chunk-FKGYXIN7.js → chunk-MUV73B5A.js} +7 -7
- package/dist/bundle/chunk-MXA3FU2R.js +116 -0
- package/dist/bundle/{chunk-42MXCMW6.js → chunk-NUD4CBHK.js} +3 -3
- package/dist/bundle/{chunk-PG37E63A.js → chunk-NYEVPAF2.js} +511 -472
- package/dist/bundle/{chunk-QS46C5SW.js → chunk-O3QBO6NW.js} +17 -17
- package/dist/bundle/{chunk-CFWFESBO.js → chunk-O4ZOQJ6W.js} +9 -9
- package/dist/bundle/{chunk-74UPKW7H.js → chunk-OJSPB4LA.js} +2 -2
- package/dist/bundle/{chunk-JNWKV3QV.js → chunk-PCBVSHKD.js} +4 -4
- package/dist/bundle/{chunk-5RDNBG7D.js → chunk-PK5WEGPJ.js} +2 -2
- package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
- package/dist/bundle/{chunk-BMI2NWFI.js → chunk-PRI2XTM7.js} +35 -12
- package/dist/bundle/chunk-PRM7GKBV.js +340 -0
- package/dist/bundle/{chunk-ZZ32DXTH.js → chunk-PZ2ZFPGO.js} +1 -1
- package/dist/bundle/chunk-QYRK4XXH.js +727 -0
- package/dist/bundle/{chunk-QNEAPLOP.js → chunk-RVA3CRSY.js} +12 -12
- package/dist/bundle/{chunk-4EDJJQJI.js → chunk-SPXNI53Z.js} +38 -9
- package/dist/bundle/{chunk-ZRW3DF25.js → chunk-TI5U6AUT.js} +34 -28
- package/dist/bundle/{chunk-SMQ45RZX.js → chunk-TKWYXM7L.js} +9 -60
- package/dist/bundle/{chunk-ZJIGVT6Z.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-JMJOWT4N.js → chunk-VH4J7IIS.js} +1 -1
- package/dist/bundle/{chunk-UAFSDTID.js → chunk-VNJRWFHP.js} +1 -1
- package/dist/bundle/chunk-W2QSDPG6.js +80 -0
- package/dist/bundle/{chunk-ESOFH7PA.js → chunk-WGGUKQE7.js} +134 -558
- package/dist/bundle/{chunk-NWDADTPE.js → chunk-WPXVJGSL.js} +3 -3
- package/dist/bundle/{chunk-NWCFO37P.js → chunk-XLNV3U6N.js} +3 -3
- package/dist/bundle/{chunk-JPSRC732.js → chunk-XS4EE7MO.js} +17 -15
- package/dist/bundle/{chunk-FPSRT2TX.js → chunk-XVRLD3LN.js} +2 -2
- package/dist/bundle/{chunk-O3AM32YN.js → chunk-XZ6XEAJP.js} +18 -18
- package/dist/bundle/{chunk-B4LGDOG5.js → chunk-YHTSJMZ5.js} +3734 -3380
- package/dist/bundle/chunk-YPJCURT6.js +108 -0
- package/dist/bundle/{chunk-HBSKP7OV.js → chunk-Z77R76S2.js} +1 -1
- package/dist/bundle/{chunk-PYECFCPD.js → chunk-ZC7OEYDX.js} +1 -1
- package/dist/bundle/{chunk-IYJ4B632.js → chunk-ZW2N2GI2.js} +12 -12
- package/dist/bundle/command-contract-LEFXJAA3.js +37 -0
- package/dist/bundle/{command-server-entry-TM264M2J.js → command-server-entry-WQAE5UGU.js} +27 -27
- package/dist/bundle/{decode-RJFOSHCE.js → decode-2J2DOVGV.js} +5 -5
- package/dist/bundle/{dispatch-7OZP3X4O.js → dispatch-IZ2TP5GW.js} +8 -8
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/{echarts-PYKF4D7B.js → echarts-GFIIHZ4U.js} +2 -2
- package/dist/bundle/{embed-JFN6Z5TG.js → embed-AGOXADHW.js} +6 -6
- package/dist/bundle/{embedder-WN54JIMY.js → embedder-PCIXGM2Y.js} +9 -9
- package/dist/bundle/{entry-Z6LO6N6S.js → entry-HUQXUV52.js} +9 -9
- package/dist/bundle/{failure-UONA2IA5.js → failure-JSRHZ2S6.js} +2 -2
- package/dist/bundle/{first-run-WQAKES7G.js → first-run-2LXN7B33.js} +12 -12
- package/dist/bundle/first-screen-VUE6RCSF.js +37 -0
- package/dist/bundle/{instructions-PR4BBBTM.js → instructions-RSLTJVFJ.js} +1 -1
- package/dist/bundle/{mcp-O6ACR2DX.js → mcp-MMENCB7I.js} +2 -2
- package/dist/bundle/meeting-combined-PBNPHOM3.js +23 -0
- package/dist/bundle/{meeting-model-YVTUOM4H.js → meeting-model-SI77WMMK.js} +11 -11
- package/dist/bundle/{meeting-semantic-X4KG6RNV.js → meeting-semantic-WRXWUR4M.js} +6 -6
- package/dist/bundle/{node-OVS5LTVZ.js → node-5XGMCUGQ.js} +2 -2
- package/dist/bundle/{node-sqlite-LC44SM4Z.js → node-sqlite-ES7SQSIC.js} +7 -7
- package/dist/bundle/{oauth-NSVUFQCW.js → oauth-QFM4Y6N7.js} +8 -8
- package/dist/bundle/{open-XN5SJFVY.js → open-2MD2DKGQ.js} +5 -5
- package/dist/bundle/{openai-WOYZHJNL.js → openai-6TMKJKYO.js} +15 -15
- package/dist/bundle/{process-UFBRGTQC.js → process-VA2DP7MY.js} +1 -1
- package/dist/bundle/{program-RAGBRRQH.js → program-K3SLEA42.js} +70 -63
- package/dist/bundle/{prompt-6HAKBUQN.js → prompt-VZSPCE6E.js} +5 -5
- package/dist/bundle/{proxy-transport-5EJVFUTC.js → proxy-transport-OJU2EOOC.js} +5 -5
- package/dist/bundle/{recognize-CN5COBVJ.js → recognize-LH3ZZEIL.js} +4 -4
- package/dist/bundle/{remote-STX5AMGE.js → remote-JNW5HN2I.js} +9 -9
- package/dist/bundle/{rerank-ZCOWTXIJ.js → rerank-P23UJMII.js} +7 -7
- package/dist/bundle/{serve-XMQEOIG2.js → serve-VSLLMILH.js} +15 -15
- package/dist/bundle/{server-PGGUD3DM.js → server-FBRRRKCS.js} +68 -57
- package/dist/bundle/server-TA4QP7PG.js +78 -0
- package/dist/bundle/{sqlite-runtime-PS4DSOIU.js → sqlite-runtime-LWATDAAU.js} +6 -6
- package/dist/bundle/{state-GL4ZC57O.js → state-3AFJL2EL.js} +6 -6
- package/dist/bundle/{store-VISFXSHL.js → store-6TLYL2VU.js} +30 -17
- package/dist/bundle/{store-HJ76TLWD.js → store-PEXV5DNA.js} +24 -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 +80 -576
- package/skills/tg-cli/references/files.md +64 -0
- package/skills/tg-cli/references/history.md +22 -0
- package/skills/tg-cli/references/mcp-and-bots.md +54 -0
- package/skills/tg-cli/references/messages.md +115 -0
- package/skills/tg-cli/references/people.md +85 -0
- package/skills/tg-cli/references/search.md +132 -0
- package/skills/tg-cli/references/setup.md +91 -0
- package/skills/tg-cli/references/stats.md +45 -0
- package/skills/tg-cli/references/tasks.md +54 -0
- package/dist/bundle/chunk-VKE77B3F.js +0 -2
- package/dist/bundle/command-contract-FRH7LBGE.js +0 -37
- package/dist/bundle/first-screen-4RFG22SA.js +0 -35
- package/dist/bundle/meeting-combined-MHWTZOF2.js +0 -23
- package/dist/bundle/server-WTNYWCZ4.js +0 -69
- package/dist/bundle/store-maintenance-command-SMARMN5C.js +0 -60
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
timezoneOf,
|
|
5
|
+
zonedMoment
|
|
6
|
+
} from "./chunk-NYEVPAF2.js";
|
|
7
|
+
import {
|
|
8
|
+
CliError
|
|
9
|
+
} from "./chunk-PK5WEGPJ.js";
|
|
10
|
+
import {
|
|
11
|
+
__name
|
|
12
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
13
|
+
|
|
14
|
+
// 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/moment.js
|
|
15
|
+
var calendarMoment = /* @__PURE__ */ __name((wanted, flag, { zone, end = false } = {}) => {
|
|
16
|
+
try {
|
|
17
|
+
return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
|
|
18
|
+
} catch (error) {
|
|
19
|
+
if (!(error instanceof CliError))
|
|
20
|
+
throw error;
|
|
21
|
+
const alternative = error.details?.alternative;
|
|
22
|
+
throw new CliError("validation_error", `${flag}: "${wanted}" is not a time${alternative ? ` \u2014 ${alternative}` : ""}`);
|
|
23
|
+
}
|
|
24
|
+
}, "calendarMoment");
|
|
25
|
+
var dayIn = /* @__PURE__ */ __name((at, zone) => new Intl.DateTimeFormat("en-CA", { timeZone: zone, year: "numeric", month: "2-digit", day: "2-digit" }).format(at), "dayIn");
|
|
26
|
+
var MINUTE = 6e4;
|
|
27
|
+
var YEAR = 365 * 24 * 60 * MINUTE;
|
|
28
|
+
var RELATIVE = /^(\d+)(m|h|d)$/;
|
|
29
|
+
var RELATIVE_MS = { m: MINUTE, h: 60 * MINUTE, d: 24 * 60 * MINUTE };
|
|
30
|
+
var DATE_ALONE = /^\d{4}-\d{2}-\d{2}$/;
|
|
31
|
+
var ZONED = /(?:Z|[+-]\d{2}:?\d{2})$/i;
|
|
32
|
+
var dayWord = /* @__PURE__ */ __name((word, zone, now) => {
|
|
33
|
+
const today = new Intl.DateTimeFormat("en-CA", { timeZone: zone }).format(now);
|
|
34
|
+
if (word === "today")
|
|
35
|
+
return today;
|
|
36
|
+
const date = /* @__PURE__ */ new Date(`${today}T00:00:00Z`);
|
|
37
|
+
date.setUTCDate(date.getUTCDate() - 1);
|
|
38
|
+
return date.toISOString().slice(0, 10);
|
|
39
|
+
}, "dayWord");
|
|
40
|
+
var readMoment = /* @__PURE__ */ __name((typed, flag, { zone, end = false, now = Date.now(), direction = -1 } = {}) => {
|
|
41
|
+
const wanted = typed.trim();
|
|
42
|
+
const [, amount, unit] = RELATIVE.exec(wanted) ?? [];
|
|
43
|
+
if (amount && unit)
|
|
44
|
+
return { time: now + direction * Number(amount) * (RELATIVE_MS[unit] ?? 0), local: false, dateAlone: false };
|
|
45
|
+
const word = wanted.toLowerCase();
|
|
46
|
+
const date = word === "today" || word === "yesterday" ? dayWord(word, timezoneOf(zone), now) : wanted;
|
|
47
|
+
if (!/^\d{4}-\d{2}-\d{2}/.test(date))
|
|
48
|
+
return void 0;
|
|
49
|
+
const iso = date.replace(/^(\d{4}-\d{2}-\d{2}) +(?=\d)/, "$1T");
|
|
50
|
+
return {
|
|
51
|
+
time: calendarMoment(iso, flag, { ...zone === void 0 ? {} : { zone }, end }),
|
|
52
|
+
local: !ZONED.test(iso),
|
|
53
|
+
dateAlone: DATE_ALONE.test(iso)
|
|
54
|
+
};
|
|
55
|
+
}, "readMoment");
|
|
56
|
+
var lead = /* @__PURE__ */ __name((ms) => ms === MINUTE ? "a minute" : ms === YEAR ? "a year" : `${Math.ceil(ms / MINUTE)} minutes`, "lead");
|
|
57
|
+
var aheadOf = /* @__PURE__ */ __name((reference, flag, now = Date.now(), options = {}) => {
|
|
58
|
+
const { refuseDate = false, soonest, latest, ...at } = options;
|
|
59
|
+
const read = readMoment(reference, flag, { ...at, now, direction: 1 });
|
|
60
|
+
if (read === void 0)
|
|
61
|
+
throw new CliError("validation_error", `${flag} takes an ISO 8601 time, today, or 30m, 2h, 3d from now \u2014 not "${reference.trim()}"`);
|
|
62
|
+
if (refuseDate && read.dateAlone)
|
|
63
|
+
throw new CliError("validation_error", DATE_ALONE.test(reference.trim()) ? `${flag} needs a time of day as well: ${reference.trim()}T09:00` : `${flag} needs a time of day as well, like 2026-11-20T09:00`);
|
|
64
|
+
if (soonest === 0 && read.time <= now)
|
|
65
|
+
throw new CliError("validation_error", `${flag} is in the past`);
|
|
66
|
+
if (soonest !== void 0 && soonest > 0 && read.time < now + soonest)
|
|
67
|
+
throw new CliError("validation_error", `${flag} has to be at least ${lead(soonest)} from now`);
|
|
68
|
+
if (latest !== void 0 && read.time > now + latest)
|
|
69
|
+
throw new CliError("validation_error", `${flag} can be at most ${lead(latest)} from now`);
|
|
70
|
+
return read.time;
|
|
71
|
+
}, "aheadOf");
|
|
72
|
+
|
|
73
|
+
export {
|
|
74
|
+
calendarMoment,
|
|
75
|
+
dayIn,
|
|
76
|
+
MINUTE,
|
|
77
|
+
YEAR,
|
|
78
|
+
readMoment,
|
|
79
|
+
aheadOf
|
|
80
|
+
};
|