@wirecat/tg-cli 0.98.0 → 0.100.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.
Files changed (113) hide show
  1. package/README.md +2 -1
  2. package/dist/bin/tg.js +23 -28
  3. package/dist/bundle/adapter-2LVPMFKF.js +2790 -0
  4. package/dist/bundle/all-profiles-BLTK2AAB.js +255 -0
  5. package/dist/bundle/anthropic-RJE4XEOO.js +71 -0
  6. package/dist/bundle/bot-api-4XM3NVWG.js +39793 -0
  7. package/dist/bundle/bot-history-WVM5GEQN.js +167 -0
  8. package/dist/bundle/bun-UZXO2LRQ.js +169 -0
  9. package/dist/bundle/bun-sqlite-GJLGSQIT.js +70 -0
  10. package/dist/bundle/chunk-2IM4M7Q2.js +98 -0
  11. package/dist/bundle/chunk-2MXQ2EUN.js +1344 -0
  12. package/dist/bundle/chunk-2XUGPE5W.js +73 -0
  13. package/dist/bundle/chunk-3KHKYYCR.js +24782 -0
  14. package/dist/bundle/chunk-3MVHRZWR.js +2 -0
  15. package/dist/bundle/chunk-3N6LXAPE.js +724 -0
  16. package/dist/bundle/chunk-3QDPV34J.js +6668 -0
  17. package/dist/bundle/chunk-3S5CL55R.js +100 -0
  18. package/dist/bundle/chunk-4U7QOFDA.js +33511 -0
  19. package/dist/bundle/chunk-4VBDVZNE.js +524 -0
  20. package/dist/bundle/chunk-4YCLWWZ3.js +277 -0
  21. package/dist/bundle/chunk-66E5QDLH.js +24 -0
  22. package/dist/bundle/chunk-6VEOR6GD.js +166 -0
  23. package/dist/bundle/chunk-6YLT4YVJ.js +45 -0
  24. package/dist/bundle/chunk-7BFO3DY6.js +21 -0
  25. package/dist/bundle/chunk-A7OBVRJV.js +738 -0
  26. package/dist/bundle/chunk-AFV74GK3.js +50 -0
  27. package/dist/bundle/chunk-ASDZHG5I.js +25 -0
  28. package/dist/bundle/chunk-ATZ44Z77.js +3253 -0
  29. package/dist/bundle/chunk-AVWK4NCW.js +24600 -0
  30. package/dist/bundle/chunk-BAIZAZ6Q.js +82 -0
  31. package/dist/bundle/chunk-BJG6JA5U.js +35 -0
  32. package/dist/bundle/chunk-BL36RR34.js +285 -0
  33. package/dist/bundle/chunk-BZANDKWT.js +71 -0
  34. package/dist/bundle/chunk-CV5ASHTW.js +8170 -0
  35. package/dist/bundle/chunk-DN4QUTWU.js +78 -0
  36. package/dist/bundle/chunk-DVOUKGFK.js +1950 -0
  37. package/dist/bundle/chunk-GTURDJJD.js +570 -0
  38. package/dist/bundle/chunk-GYEOQS2D.js +2795 -0
  39. package/dist/bundle/chunk-H3X5LS6U.js +153 -0
  40. package/dist/bundle/chunk-HKT5EOT5.js +6848 -0
  41. package/dist/bundle/chunk-HXTTDIL7.js +82 -0
  42. package/dist/bundle/chunk-I6WZJVRT.js +1123 -0
  43. package/dist/bundle/chunk-JFJVS5JC.js +41 -0
  44. package/dist/bundle/chunk-JSKT5UZX.js +2315 -0
  45. package/dist/bundle/chunk-KE6L2UEG.js +3068 -0
  46. package/dist/bundle/chunk-LI7TXFLS.js +122 -0
  47. package/dist/bundle/chunk-MQNFEVAH.js +58 -0
  48. package/dist/bundle/chunk-MUEXF4ME.js +582 -0
  49. package/dist/bundle/chunk-OOOV3JBZ.js +35527 -0
  50. package/dist/bundle/chunk-OW3COBN5.js +1275 -0
  51. package/dist/bundle/chunk-P26LWFNZ.js +35 -0
  52. package/dist/bundle/chunk-Q26JMPBP.js +215 -0
  53. package/dist/bundle/chunk-QU2FJMFB.js +18282 -0
  54. package/dist/bundle/chunk-QY3YOOTP.js +18 -0
  55. package/dist/bundle/chunk-RDQMV6EU.js +46 -0
  56. package/dist/bundle/chunk-RER6DAHP.js +3514 -0
  57. package/dist/bundle/chunk-SGJYU3SB.js +54 -0
  58. package/dist/bundle/chunk-SMJTL5U7.js +117 -0
  59. package/dist/bundle/chunk-SYPL4PHV.js +76 -0
  60. package/dist/bundle/chunk-THVNP6S6.js +31 -0
  61. package/dist/bundle/chunk-U7LXA4SO.js +1007 -0
  62. package/dist/bundle/chunk-UD4DOZCN.js +886 -0
  63. package/dist/bundle/chunk-UMLPXNJI.js +63 -0
  64. package/dist/bundle/chunk-V4JSVH4M.js +190 -0
  65. package/dist/bundle/chunk-WE3LBRMB.js +2374 -0
  66. package/dist/bundle/chunk-WKOY3POD.js +452 -0
  67. package/dist/bundle/chunk-X4Y2ROJI.js +541 -0
  68. package/dist/bundle/chunk-YG7PNCSW.js +230 -0
  69. package/dist/bundle/chunk-Z2FHEIXN.js +63 -0
  70. package/dist/bundle/chunk-ZZLKX62Z.js +928 -0
  71. package/dist/bundle/command-contract-AIVKJYIR.js +31 -0
  72. package/dist/bundle/dist-RJMT44PL.js +7577 -0
  73. package/dist/bundle/echarts-YHSYUWLY.js +42501 -0
  74. package/dist/bundle/embed-3HGI2XIW.js +35 -0
  75. package/dist/bundle/embedder-2CJMZETJ.js +108 -0
  76. package/dist/bundle/entry-UVE53OV3.js +14 -0
  77. package/dist/bundle/first-run-6GYC2QS3.js +24 -0
  78. package/dist/bundle/first-screen-HRRLVLOG.js +29 -0
  79. package/dist/bundle/identity-HEV5E57G.js +11 -0
  80. package/dist/bundle/instructions-5UVAXSQV.js +9 -0
  81. package/dist/bundle/mcp-NWXBVNUA.js +165 -0
  82. package/dist/bundle/node-IUL5HSYI.js +2340 -0
  83. package/dist/bundle/node-UPPL626U.js +21 -0
  84. package/dist/bundle/node-YHYEGYVE.js +176 -0
  85. package/dist/bundle/node-sqlite-CQ33A3R2.js +46 -0
  86. package/dist/bundle/oauth-OB3JFAD7.js +18 -0
  87. package/dist/bundle/open-JHGZIXU2.js +20 -0
  88. package/dist/bundle/process-PSKS3N5B.js +91 -0
  89. package/dist/bundle/program-RPYVPNRX.js +1060 -0
  90. package/dist/bundle/prompt-7BXUMJGG.js +13 -0
  91. package/dist/bundle/proxy-transport-3EEMW2HW.js +17 -0
  92. package/dist/bundle/recognize-YMZPL47R.js +191 -0
  93. package/dist/bundle/remote-LQ3Q22NG.js +26 -0
  94. package/dist/bundle/rerank-SM7IYVXJ.js +49 -0
  95. package/dist/bundle/serve-GHUEP5H5.js +181 -0
  96. package/dist/bundle/server-A45HVXQY.js +178 -0
  97. package/dist/bundle/server-K2BQPPHN.js +785 -0
  98. package/dist/bundle/state-WIOL52GZ.js +30 -0
  99. package/dist/bundle/store-XE5AKUJZ.js +121 -0
  100. package/dist/bundle/store-maintenance-command-YS5E7VUN.js +46 -0
  101. package/dist/bundle/tg.js +40 -0
  102. package/dist/commands/context.d.ts.map +1 -1
  103. package/dist/commands/context.js +3 -2
  104. package/dist/commands/context.js.map +1 -1
  105. package/dist/telegram/errors.d.ts.map +1 -1
  106. package/dist/telegram/errors.js +1 -1
  107. package/dist/telegram/errors.js.map +1 -1
  108. package/dist/version.d.ts +1 -1
  109. package/dist/version.d.ts.map +1 -1
  110. package/dist/version.js +1 -1
  111. package/dist/version.js.map +1 -1
  112. package/package.json +5 -3
  113. package/skills/tg-cli/SKILL.md +2 -1
@@ -0,0 +1,54 @@
1
+ import { createRequire as __tgRequire } from "node:module";
2
+ const require = __tgRequire(import.meta.url);
3
+ import {
4
+ readSharedSection,
5
+ writeSharedSection
6
+ } from "./chunk-UD4DOZCN.js";
7
+ import {
8
+ CliError
9
+ } from "./chunk-WE3LBRMB.js";
10
+ import {
11
+ __name
12
+ } from "./chunk-AFV74GK3.js";
13
+
14
+ // node_modules/.pnpm/@wirecat+cli-core@0.452.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.63.0_commander@15._e609b9d6c8060966368a91e843fe8bd2/node_modules/@wirecat/cli-core/dist/cli/setup-answers.js
15
+ var PERMISSION_ANSWERS = ["readonly", "allow"];
16
+ var QUESTIONS = ["languages", "tools", "permissions"];
17
+ var SECTION = "setup";
18
+ var readSetupAnswers = /* @__PURE__ */ __name((path) => {
19
+ const section = readSharedSection(path, SECTION);
20
+ if (section === void 0)
21
+ return {};
22
+ const answers = section;
23
+ if (section === null || typeof section !== "object" || Array.isArray(section) || answers.languages !== void 0 && answers.languages !== true || answers.tools !== void 0 && answers.tools !== true || answers.permissions !== void 0 && !PERMISSION_ANSWERS.includes(answers.permissions))
24
+ throw new CliError("configuration_error", `${path}: ${SECTION} holds what setup asked \u2014 languages: true, tools: true, permissions: ${PERMISSION_ANSWERS.join(" | ")}`);
25
+ return answers;
26
+ }, "readSetupAnswers");
27
+ var unanswered = /* @__PURE__ */ __name((answers) => QUESTIONS.filter((question) => answers[question] === void 0), "unanswered");
28
+ var writeSetupAnswers = /* @__PURE__ */ __name((path, answers) => {
29
+ let kept = {};
30
+ try {
31
+ kept = readSetupAnswers(path);
32
+ } catch (error) {
33
+ if (!(error instanceof CliError) || !error.message.includes(`${SECTION} holds`))
34
+ throw error;
35
+ }
36
+ writeSharedSection(path, SECTION, { ...kept, ...answers });
37
+ }, "writeSetupAnswers");
38
+ var permissionCeiling = /* @__PURE__ */ __name((path) => {
39
+ let answer;
40
+ try {
41
+ answer = readSetupAnswers(path).permissions;
42
+ } catch {
43
+ return "readonly";
44
+ }
45
+ return answer === "allow" ? void 0 : answer;
46
+ }, "permissionCeiling");
47
+
48
+ export {
49
+ QUESTIONS,
50
+ readSetupAnswers,
51
+ unanswered,
52
+ writeSetupAnswers,
53
+ permissionCeiling
54
+ };
@@ -0,0 +1,117 @@
1
+ import { createRequire as __tgRequire } from "node:module";
2
+ const require = __tgRequire(import.meta.url);
3
+ import {
4
+ array,
5
+ integer,
6
+ isoTime,
7
+ isoTimestamp,
8
+ minLength,
9
+ minValue,
10
+ nullable,
11
+ number,
12
+ optional,
13
+ picklist,
14
+ pipe,
15
+ record,
16
+ reference,
17
+ strictObject,
18
+ string,
19
+ unknown
20
+ } from "./chunk-WE3LBRMB.js";
21
+
22
+ // node_modules/.pnpm/@wirecat+cli-core@0.452.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.63.0_commander@15._e609b9d6c8060966368a91e843fe8bd2/node_modules/@wirecat/cli-core/dist/entities/fields.js
23
+ var text = string();
24
+ var id = pipe(string(), minLength(1));
25
+ var time = isoTime;
26
+ var zonedTime = pipe(string(), isoTimestamp("an ISO 8601 time with a zone"));
27
+ var count = pipe(number(), integer(), minValue(0));
28
+ var providerMetadata = optional(record(string(), unknown()));
29
+ var author = strictObject({
30
+ type: picklist(["person", "bot"]),
31
+ id,
32
+ name: nullable(text)
33
+ });
34
+
35
+ // node_modules/.pnpm/@wirecat+cli-core@0.452.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.63.0_commander@15._e609b9d6c8060966368a91e843fe8bd2/node_modules/@wirecat/cli-core/dist/entities/note.js
36
+ var link = {
37
+ target_text: nullable(text),
38
+ kind: text,
39
+ anchor: nullable(text)
40
+ };
41
+ var note = strictObject({
42
+ ref: reference,
43
+ kind: optional(picklist(["note", "document"])),
44
+ provider: optional(text),
45
+ account: optional(text),
46
+ url: optional(text),
47
+ id,
48
+ source: picklist(["file", "internal"]),
49
+ folder_id: nullable(id),
50
+ path: nullable(text),
51
+ title: nullable(text),
52
+ text,
53
+ /** Raises on every edit; `notes edit --revision` takes it, so an edit made meanwhile is refused, not lost. */
54
+ revision: count,
55
+ /** A file's front matter as parsed, keys as the file writes them; null for a note without it. */
56
+ front_matter: nullable(record(string(), unknown())),
57
+ /** The hash of a file's bytes when last imported; null for a note written here. */
58
+ content_hash: nullable(text),
59
+ /** The file the note was exported to, where that is known; null otherwise. */
60
+ export_path: nullable(text),
61
+ created_at: time,
62
+ /** When the store's copy last changed. */
63
+ updated_at: time,
64
+ deleted_at: optional(nullable(time)),
65
+ tags: optional(array(text)),
66
+ /** The first line holding a word of a search. */
67
+ excerpt: optional(text),
68
+ /** Which halves of a search found it. */
69
+ found_by: optional(array(picklist(["title", "words", "meaning"]))),
70
+ /** What the note links to; `to` is null while the name written matches nothing stored. */
71
+ links: optional(array(strictObject({ to: nullable(reference), ...link }))),
72
+ /** The notes and messages that link to it. */
73
+ backlinks: optional(array(strictObject({ from: reference, ...link })))
74
+ });
75
+
76
+ // node_modules/.pnpm/@wirecat+cli-core@0.452.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.63.0_commander@15._e609b9d6c8060966368a91e843fe8bd2/node_modules/@wirecat/cli-core/dist/entities/knowledge-lists.js
77
+ var organization = strictObject({
78
+ id,
79
+ ref: reference,
80
+ kind: picklist(["company", "team", "family", "community"]),
81
+ name: text,
82
+ scope: picklist(["personal", "work"]),
83
+ created_at: time
84
+ });
85
+ var project = strictObject({
86
+ id,
87
+ ref: reference,
88
+ key: text,
89
+ name: text,
90
+ type: picklist(["work", "client", "personal", "oss", "other"]),
91
+ organization_id: nullable(id),
92
+ scope: picklist(["personal", "work"]),
93
+ created_at: time
94
+ });
95
+ var reminder = strictObject({
96
+ id,
97
+ task: text,
98
+ due_at: time,
99
+ timezone: text,
100
+ state: picklist(["pending", "leased", "delivered", "cancelled"]),
101
+ revision: number(),
102
+ receipt: nullable(text)
103
+ });
104
+
105
+ export {
106
+ text,
107
+ id,
108
+ time,
109
+ zonedTime,
110
+ count,
111
+ providerMetadata,
112
+ author,
113
+ note,
114
+ organization,
115
+ project,
116
+ reminder
117
+ };
@@ -0,0 +1,76 @@
1
+ import { createRequire as __tgRequire } from "node:module";
2
+ const require = __tgRequire(import.meta.url);
3
+ import {
4
+ __name
5
+ } from "./chunk-AFV74GK3.js";
6
+
7
+ // node_modules/.pnpm/@wirecat+cli-core@0.452.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.63.0_commander@15._e609b9d6c8060966368a91e843fe8bd2/node_modules/@wirecat/cli-core/dist/mcp/stdio-wire.js
8
+ import { PassThrough, Writable } from "node:stream";
9
+ var lineReader = /* @__PURE__ */ __name((onMessage) => {
10
+ let rest = "";
11
+ return (chunk) => {
12
+ const lines = (rest + chunk.toString()).split("\n");
13
+ rest = lines.pop() ?? "";
14
+ for (const line of lines) {
15
+ try {
16
+ const message = JSON.parse(line);
17
+ if (message !== null && typeof message === "object")
18
+ onMessage(message);
19
+ } catch {
20
+ }
21
+ }
22
+ };
23
+ }, "lineReader");
24
+ var answeredWire = /* @__PURE__ */ __name((source, sink) => {
25
+ const asked = /* @__PURE__ */ new Set();
26
+ let settle;
27
+ const input = new PassThrough();
28
+ const onData = lineReader(({ id, method }) => {
29
+ if (id !== void 0 && typeof method === "string")
30
+ asked.add(JSON.stringify(id));
31
+ });
32
+ const output = new Writable({
33
+ write: /* @__PURE__ */ __name((chunk, _encoding, done) => {
34
+ noteAnswer(chunk);
35
+ sink.write(chunk, done);
36
+ }, "write")
37
+ });
38
+ const noteAnswer = lineReader(({ id, method }) => {
39
+ if (id === void 0 || method !== void 0)
40
+ return;
41
+ asked.delete(JSON.stringify(id));
42
+ if (asked.size === 0)
43
+ settle?.();
44
+ });
45
+ const forward = /* @__PURE__ */ __name((chunk) => {
46
+ onData(chunk);
47
+ input.write(chunk);
48
+ }, "forward");
49
+ source.on("data", forward);
50
+ const ended = new Promise((resolve) => {
51
+ source.once("end", resolve);
52
+ source.once("close", resolve);
53
+ });
54
+ return {
55
+ input,
56
+ output,
57
+ ended,
58
+ answered: /* @__PURE__ */ __name(() => new Promise((resolve) => {
59
+ if (asked.size === 0)
60
+ resolve();
61
+ else
62
+ settle = resolve;
63
+ }), "answered"),
64
+ /** Lets go of the real stdin, so it no longer holds the process open. */
65
+ release: /* @__PURE__ */ __name(() => {
66
+ source.off("data", forward);
67
+ if (source.listenerCount("data") === 0)
68
+ source.pause();
69
+ input.end();
70
+ }, "release")
71
+ };
72
+ }, "answeredWire");
73
+
74
+ export {
75
+ answeredWire
76
+ };
@@ -0,0 +1,31 @@
1
+ import { createRequire as __tgRequire } from "node:module";
2
+ const require = __tgRequire(import.meta.url);
3
+ import {
4
+ CliError,
5
+ finite,
6
+ getDotPath,
7
+ maxValue,
8
+ minValue,
9
+ number,
10
+ optional,
11
+ pipe,
12
+ safeParse
13
+ } from "./chunk-WE3LBRMB.js";
14
+ import {
15
+ __name
16
+ } from "./chunk-AFV74GK3.js";
17
+
18
+ // node_modules/.pnpm/@wirecat+cli-core@0.452.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.63.0_commander@15._e609b9d6c8060966368a91e843fe8bd2/node_modules/@wirecat/cli-core/dist/models/options.js
19
+ var checkedOptions = /* @__PURE__ */ __name((provider, schema, options) => {
20
+ const parsed = safeParse(schema, options);
21
+ if (!parsed.success) {
22
+ throw new CliError("validation_error", `${provider} option ${getDotPath(parsed.issues[0]) ?? "options"} is unknown or has the wrong type`);
23
+ }
24
+ return parsed.output;
25
+ }, "checkedOptions");
26
+ var range = /* @__PURE__ */ __name((min, max) => optional(pipe(number(), finite(), minValue(min), maxValue(max))), "range");
27
+
28
+ export {
29
+ checkedOptions,
30
+ range
31
+ };