@wirecat/tg-cli 0.113.0 → 0.115.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 (118) hide show
  1. package/dist/bin/tg.js +6 -2
  2. package/dist/bin/tg.js.map +1 -1
  3. package/dist/bundle/{adapter-EQKEFGPB.js → adapter-ODK7R4LY.js} +56 -53
  4. package/dist/bundle/{all-profiles-TTBFF663.js → all-profiles-AQYM65BS.js} +9 -8
  5. package/dist/bundle/{anthropic-XPZS7267.js → anthropic-VBDSVNIM.js} +6 -5
  6. package/dist/bundle/{app-server-ZSZ7KRAY.js → app-server-YOIHLBNS.js} +47 -43
  7. package/dist/bundle/{bot-api-X7BOVNIO.js → bot-api-TRYLGQKK.js} +51 -47
  8. package/dist/bundle/{bot-history-DWIUIPN5.js → bot-history-7DTJLBBJ.js} +18 -16
  9. package/dist/bundle/{bun-ZGZVAJU2.js → bun-XIMM6EHD.js} +2 -2
  10. package/dist/bundle/{bun-sqlite-UN2UJ6SI.js → bun-sqlite-6B3BL5IV.js} +5 -4
  11. package/dist/bundle/{chunk-K3F46QVN.js → chunk-2TC76TLJ.js} +4 -4
  12. package/dist/bundle/{chunk-JRTZ5I6M.js → chunk-5ROWSRK7.js} +2 -2
  13. package/dist/bundle/{chunk-PHYDBR5M.js → chunk-63YKD7YA.js} +2 -2
  14. package/dist/bundle/{chunk-PCRLXJRH.js → chunk-77M3IAVU.js} +193 -129
  15. package/dist/bundle/{chunk-VDATXIO4.js → chunk-A4BQGSKI.js} +9 -9
  16. package/dist/bundle/{chunk-HO53POQG.js → chunk-AICS3TSF.js} +8 -41
  17. package/dist/bundle/{chunk-AVUIWZTP.js → chunk-AVWPMJ6E.js} +2 -2
  18. package/dist/bundle/{chunk-G74QMORP.js → chunk-BEQPZA3S.js} +2 -2
  19. package/dist/bundle/{chunk-JO45BOYE.js → chunk-BIEBJLYO.js} +8 -3
  20. package/dist/bundle/{chunk-J6USEBA6.js → chunk-BPPRR7TV.js} +2200 -945
  21. package/dist/bundle/chunk-CCHHEMPM.js +71 -0
  22. package/dist/bundle/{chunk-T4TTRFP5.js → chunk-CNO3R4O4.js} +10 -8
  23. package/dist/bundle/{chunk-IDUYRTPF.js → chunk-D4E345BC.js} +2 -2
  24. package/dist/bundle/{chunk-OYNSFQ7K.js → chunk-D72URWJE.js} +1 -39
  25. package/dist/bundle/{chunk-T5RM4Y35.js → chunk-DIABP7ZP.js} +3 -3
  26. package/dist/bundle/chunk-EW3XTUPB.js +166 -0
  27. package/dist/bundle/{chunk-KOWQVHXI.js → chunk-GCFU6WBE.js} +3 -3
  28. package/dist/bundle/{chunk-6WJ5M2Q4.js → chunk-GWDMKEDY.js} +4 -4
  29. package/dist/bundle/{chunk-TQ6EA7TB.js → chunk-GX4DMI4H.js} +17 -16
  30. package/dist/bundle/{chunk-KK3JVOOV.js → chunk-HZKWB6WS.js} +36 -35
  31. package/dist/bundle/chunk-ILHTNOIV.js +23 -0
  32. package/dist/bundle/{chunk-JDQSX2JQ.js → chunk-IUDIRZVU.js} +8443 -7398
  33. package/dist/bundle/{chunk-TUD4MU7S.js → chunk-JZXQZW2D.js} +2 -2
  34. package/dist/bundle/{chunk-Q264PYGE.js → chunk-KDOBY524.js} +55 -20
  35. package/dist/bundle/{chunk-OQR442B6.js → chunk-KIZT2MI6.js} +1 -1
  36. package/dist/bundle/chunk-L4CMCC3V.js +34 -0
  37. package/dist/bundle/{chunk-IYKRHDX6.js → chunk-LUIPXRKN.js} +188 -57
  38. package/dist/bundle/{chunk-GX4LRLVD.js → chunk-M7B5IMH3.js} +5103 -937
  39. package/dist/bundle/{chunk-4GLMEES6.js → chunk-MUZ4KYGY.js} +4 -2
  40. package/dist/bundle/{chunk-KQ23JWLJ.js → chunk-NTW5ZE47.js} +164 -276
  41. package/dist/bundle/{chunk-UIVLDKWT.js → chunk-O7CBGHI7.js} +1 -1
  42. package/dist/bundle/{chunk-KVLCIZUK.js → chunk-OMP6ALBT.js} +3 -3
  43. package/dist/bundle/{chunk-VVA4555T.js → chunk-OSP335AJ.js} +8 -8
  44. package/dist/bundle/{chunk-EGR5IJCG.js → chunk-OUX3QMYI.js} +39 -31
  45. package/dist/bundle/{chunk-VDEXNNMH.js → chunk-PEJHI7QO.js} +6 -4
  46. package/dist/bundle/{chunk-6F6K3LWV.js → chunk-PEKTB3FQ.js} +18 -15
  47. package/dist/bundle/{chunk-Z6TRIW2O.js → chunk-POKTQZOM.js} +11 -9
  48. package/dist/bundle/chunk-PQLBPYJR.js +46 -0
  49. package/dist/bundle/{chunk-BI5YJZJB.js → chunk-PZAEI4NM.js} +115 -29
  50. package/dist/bundle/{chunk-HNN7EKIM.js → chunk-QK6VLKG5.js} +338 -169
  51. package/dist/bundle/{chunk-5NF7M4MN.js → chunk-RFRI2HFT.js} +1 -1
  52. package/dist/bundle/{chunk-OC4RRFKH.js → chunk-RHUNMU4Q.js} +6 -6
  53. package/dist/bundle/{chunk-PHPNA2HU.js → chunk-TMATSEP5.js} +14 -12
  54. package/dist/bundle/{chunk-JW7BMJ6O.js → chunk-TQYMLXDS.js} +5 -3
  55. package/dist/bundle/{chunk-MTX5EDYJ.js → chunk-U67TSAAO.js} +1136 -535
  56. package/dist/bundle/{chunk-7IWDS2CM.js → chunk-UBQ3LOF6.js} +4 -4
  57. package/dist/bundle/{chunk-UE75KPAC.js → chunk-UY7GJRGY.js} +4 -4
  58. package/dist/bundle/{chunk-OSBAISA5.js → chunk-VQCWVZWG.js} +8 -13
  59. package/dist/bundle/{chunk-XZ2ZHIAO.js → chunk-VVKEWWSO.js} +1 -1
  60. package/dist/bundle/{chunk-ENXO43TV.js → chunk-WDNNN3J4.js} +8 -8
  61. package/dist/bundle/{chunk-AGUCXSSM.js → chunk-WINKEV4F.js} +7 -20
  62. package/dist/bundle/{chunk-XXNJF3ZM.js → chunk-WMG4IGEB.js} +75 -33
  63. package/dist/bundle/{chunk-6OKGHHRL.js → chunk-WMRFAK5B.js} +35 -35
  64. package/dist/bundle/{chunk-4SQB5VKL.js → chunk-WOQGUIXE.js} +1 -1
  65. package/dist/bundle/{chunk-U3MJQLZQ.js → chunk-XIYRHIBK.js} +13 -13
  66. package/dist/bundle/{chunk-ZID2Y4XU.js → chunk-XY7IGVVS.js} +2 -2
  67. package/dist/bundle/{chunk-3MAYYFKY.js → chunk-Y3AQHPAJ.js} +1 -1
  68. package/dist/bundle/{chunk-WSAHUQ6K.js → chunk-YCUQKFGD.js} +3 -3
  69. package/dist/bundle/command-contract-YF4KGFXC.js +32 -0
  70. package/dist/bundle/{decode-AMQVTEMW.js → decode-2GATBZGH.js} +7 -6
  71. package/dist/bundle/dispatch-MJMW7WDH.js +411 -0
  72. package/dist/bundle/{echarts-ECYONFQJ.js → echarts-GKEZEAL7.js} +2 -2
  73. package/dist/bundle/{embed-VZYBZEWI.js → embed-TBQPLA4Y.js} +6 -5
  74. package/dist/bundle/{embedder-GSWBGHRK.js → embedder-B5DTNCRO.js} +11 -10
  75. package/dist/bundle/entry-A6DEW2TD.js +18 -0
  76. package/dist/bundle/failure-TLF3SISS.js +24 -0
  77. package/dist/bundle/first-run-3N5AABEY.js +27 -0
  78. package/dist/bundle/first-screen-HANARM67.js +30 -0
  79. package/dist/bundle/{instructions-AXLQQS3G.js → instructions-P5E34PQR.js} +1 -1
  80. package/dist/bundle/{mcp-VVMPUDSL.js → mcp-MNI62HHE.js} +5 -3
  81. package/dist/bundle/{node-7JHC5K77.js → node-GKPRXS5Y.js} +2 -2
  82. package/dist/bundle/{node-sqlite-LYJEK46T.js → node-sqlite-GIDPALK3.js} +11 -4
  83. package/dist/bundle/{oauth-BROPKI3K.js → oauth-C57W4IMD.js} +7 -6
  84. package/dist/bundle/{open-C6XQ46JK.js → open-E6Q4WRPU.js} +5 -3
  85. package/dist/bundle/{openai-VWSU7ZDD.js → openai-5WMXY2KP.js} +15 -14
  86. package/dist/bundle/{process-QKEFL5HL.js → process-U2P5Z6UF.js} +1 -1
  87. package/dist/bundle/{program-ACY7O33O.js → program-FEUDU6GF.js} +62 -57
  88. package/dist/bundle/{prompt-EGULVW2F.js → prompt-4NGAZGHE.js} +5 -4
  89. package/dist/bundle/{proxy-transport-KIMADLQ2.js → proxy-transport-MGCJ7JAW.js} +5 -4
  90. package/dist/bundle/{recognize-UMTKLWVR.js → recognize-EUHRBA7V.js} +4 -3
  91. package/dist/bundle/{remote-DABI7PSQ.js → remote-3JHLB2FV.js} +7 -6
  92. package/dist/bundle/{rerank-ZFATWWBE.js → rerank-ZZ45SZPC.js} +7 -6
  93. package/dist/bundle/{serve-B7YYCMGN.js → serve-XOGX5FC5.js} +12 -10
  94. package/dist/bundle/server-DRE5MJ76.js +59 -0
  95. package/dist/bundle/{server-DGKZISZH.js → server-I6O72XP5.js} +36 -34
  96. package/dist/bundle/{state-AQ2PABA5.js → state-BIUYTGH6.js} +6 -5
  97. package/dist/bundle/{store-46GJTFLJ.js → store-FOJFYOMR.js} +12 -10
  98. package/dist/bundle/store-maintenance-command-YKV2C34N.js +49 -0
  99. package/dist/bundle/tg.js +159 -14
  100. package/dist/commands/context.d.ts.map +1 -1
  101. package/dist/commands/context.js +6 -4
  102. package/dist/commands/context.js.map +1 -1
  103. package/dist/reasons.d.ts.map +1 -1
  104. package/dist/reasons.js +5 -0
  105. package/dist/reasons.js.map +1 -1
  106. package/dist/version.d.ts +1 -1
  107. package/dist/version.js +1 -1
  108. package/package.json +5 -4
  109. package/skills/tg-cli/SKILL.md +2 -0
  110. package/dist/bundle/chunk-452UZ2PU.js +0 -3603
  111. package/dist/bundle/command-contract-GV67H22L.js +0 -32
  112. package/dist/bundle/entry-LALZILY4.js +0 -14
  113. package/dist/bundle/first-run-LEAI623Q.js +0 -24
  114. package/dist/bundle/first-screen-MOCVLE23.js +0 -30
  115. package/dist/bundle/identity-54HA5GN6.js +0 -11
  116. package/dist/bundle/server-UC7UWUIS.js +0 -56
  117. package/dist/bundle/store-maintenance-command-FCFKHGRM.js +0 -45
  118. /package/dist/bundle/{chunk-HPXYN7F3.js → chunk-NUN6OGOV.js} +0 -0
@@ -0,0 +1,71 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ __name
5
+ } from "./chunk-ZVVMGPBJ.js";
6
+
7
+ // node_modules/.pnpm/@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/errors.js
8
+ var errorCodes = [
9
+ "validation_error",
10
+ "configuration_error",
11
+ "authentication_error",
12
+ "permission_error",
13
+ "not_found",
14
+ "confirmation_required",
15
+ "rate_limited",
16
+ "timeout",
17
+ "network_error",
18
+ "provider_error",
19
+ "provider_unavailable",
20
+ "invalid_response",
21
+ "outcome_unknown",
22
+ "cancelled"
23
+ ];
24
+ var BRAND = /* @__PURE__ */ Symbol.for("@wirecat/cli-base/CliError");
25
+ var CliError = class extends Error {
26
+ static {
27
+ __name(this, "CliError");
28
+ }
29
+ code;
30
+ details;
31
+ constructor(code, message, details = {}) {
32
+ super(message);
33
+ this.name = "CliError";
34
+ this.code = code;
35
+ this.details = details;
36
+ Object.defineProperty(this, BRAND, { value: true });
37
+ }
38
+ };
39
+ var isCliError = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && value[BRAND] === true, "isCliError");
40
+
41
+ // node_modules/.pnpm/@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/sanitize.js
42
+ var CONTROL = (
43
+ // biome-ignore lint/suspicious/noControlCharactersInRegex: matching them is the whole point
44
+ /[\u0000-\u0008\u000B-\u001F\u007F-\u009F\u200B\u200E\u200F\u202A-\u202E\u2066-\u2069\uFEFF\u{E0000}-\u{E007F}]/gu
45
+ );
46
+ var SUBDIVISION_FLAG = /\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}/gu;
47
+ var LINE_BREAKS = /[\t\n\u2028\u2029]/g;
48
+ var escaped = /* @__PURE__ */ __name((c) => {
49
+ const code = c.codePointAt(0) ?? 0;
50
+ if (code > 65535)
51
+ return `\\u{${code.toString(16)}}`;
52
+ return code > 255 ? `\\u${code.toString(16).padStart(4, "0")}` : `\\x${code.toString(16).padStart(2, "0")}`;
53
+ }, "escaped");
54
+ var visibleControls = /* @__PURE__ */ __name((text) => {
55
+ let at = 0;
56
+ let result = "";
57
+ for (const flag of text.matchAll(SUBDIVISION_FLAG)) {
58
+ result += text.slice(at, flag.index).replace(CONTROL, escaped) + flag[0];
59
+ at = flag.index + flag[0].length;
60
+ }
61
+ return result + text.slice(at).replace(CONTROL, escaped);
62
+ }, "visibleControls");
63
+ var singleLine = /* @__PURE__ */ __name((text) => visibleControls(text).replace(LINE_BREAKS, escaped), "singleLine");
64
+
65
+ export {
66
+ errorCodes,
67
+ CliError,
68
+ isCliError,
69
+ visibleControls,
70
+ singleLine
71
+ };
@@ -7,7 +7,7 @@ import {
7
7
  commandPathOf,
8
8
  findCommand,
9
9
  outputOf
10
- } from "./chunk-HO53POQG.js";
10
+ } from "./chunk-AICS3TSF.js";
11
11
  import {
12
12
  Command,
13
13
  Help,
@@ -18,16 +18,18 @@ import {
18
18
  environmentOf,
19
19
  metaOf,
20
20
  takesProfile
21
- } from "./chunk-GX4LRLVD.js";
21
+ } from "./chunk-M7B5IMH3.js";
22
22
  import {
23
- CliError,
24
23
  writes
25
- } from "./chunk-PCRLXJRH.js";
24
+ } from "./chunk-77M3IAVU.js";
25
+ import {
26
+ CliError
27
+ } from "./chunk-CCHHEMPM.js";
26
28
  import {
27
29
  __name
28
30
  } from "./chunk-ZVVMGPBJ.js";
29
31
 
30
- // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/cli/help/sections.js
32
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/help/sections.js
31
33
  var SECTIONS = {
32
34
  read: "Read",
33
35
  write: "Write",
@@ -92,7 +94,7 @@ var CORE_SECTIONS = {
92
94
  upgrade: "setup"
93
95
  };
94
96
 
95
- // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/cli/help/commands-text.js
97
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/help/commands-text.js
96
98
  var DESCRIPTION = 90;
97
99
  var COLUMN = 52;
98
100
  var short = /* @__PURE__ */ __name((text) => {
@@ -131,7 +133,7 @@ var commandsText = /* @__PURE__ */ __name((root, commands, scope) => {
131
133
  `;
132
134
  }, "commandsText");
133
135
 
134
- // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/cli/help/command-help.js
136
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/help/command-help.js
135
137
  var ARGUMENT_KINDS = {
136
138
  chat: "chat",
137
139
  chats: "chat",
@@ -323,7 +325,7 @@ var installCommandHelp = /* @__PURE__ */ __name((program, { profile = true } = {
323
325
  command.addHelpText("after", () => commandHelpText(command));
324
326
  }, "installCommandHelp");
325
327
 
326
- // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/cli/help/first-screen.js
328
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/help/first-screen.js
327
329
  var WIRECAT_TOOLS = [
328
330
  {
329
331
  command: "tg",
@@ -2,12 +2,12 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  CliError
5
- } from "./chunk-PCRLXJRH.js";
5
+ } from "./chunk-CCHHEMPM.js";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
9
9
 
10
- // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/ports/app.js
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/ports/app.js
11
11
  var envName = /* @__PURE__ */ __name((app, name) => `${app.envPrefix}_${name}`, "envName");
12
12
  var readOnlyLockOf = /* @__PURE__ */ __name((app, env) => {
13
13
  const name = envName(app, "READ_ONLY");
@@ -527,44 +527,6 @@ var require_cross_spawn = __commonJS({
527
527
  }
528
528
  });
529
529
 
530
- // node_modules/.pnpm/@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/executable.js
531
- import { existsSync } from "node:fs";
532
- import { win32 } from "node:path";
533
- var variable = /* @__PURE__ */ __name((env, name) => Object.entries(env).find(([key]) => key.toUpperCase() === name)?.[1], "variable");
534
- var executableOnPath = /* @__PURE__ */ __name((command, env, platform = process.platform, exists = existsSync) => {
535
- if (platform !== "win32" || win32.isAbsolute(command))
536
- return command;
537
- if (/[\\/]/.test(command))
538
- return command;
539
- const extensions = win32.extname(command) ? [""] : (variable(env, "PATHEXT") ?? ".EXE;.COM;.CMD;.BAT").split(";").filter((ext) => /^\.[a-z0-9]+$/i.test(ext));
540
- for (const entry of (variable(env, "PATH") ?? "").split(";")) {
541
- const directory = entry.replace(/^"(.*)"$/, "$1");
542
- for (const extension of extensions) {
543
- const candidate = win32.join(directory, command + extension);
544
- if (exists(candidate))
545
- return candidate;
546
- }
547
- }
548
- return command;
549
- }, "executableOnPath");
550
- var executableEnvironment = /* @__PURE__ */ __name((env, platform = process.platform) => {
551
- if (platform !== "win32")
552
- return env;
553
- const configured = variable(env, "COMSPEC");
554
- const system = variable(env, "SYSTEMROOT");
555
- const shell = configured ? configured : system && win32.isAbsolute(system) ? win32.join(system, "System32", "cmd.exe") : void 0;
556
- if (!shell)
557
- return env;
558
- const result = { ...env };
559
- for (const key of Object.keys(result))
560
- if (key.toUpperCase() === "COMSPEC")
561
- delete result[key];
562
- result.comspec = shell;
563
- return result;
564
- }, "executableEnvironment");
565
-
566
530
  export {
567
- require_cross_spawn,
568
- executableOnPath,
569
- executableEnvironment
531
+ require_cross_spawn
570
532
  };
@@ -2,15 +2,15 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  unit
5
- } from "./chunk-ENXO43TV.js";
5
+ } from "./chunk-WDNNN3J4.js";
6
6
  import {
7
7
  CliError
8
- } from "./chunk-PCRLXJRH.js";
8
+ } from "./chunk-CCHHEMPM.js";
9
9
  import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
12
12
 
13
- // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/embeddings/remote.js
13
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/embeddings/remote.js
14
14
  import { setTimeout } from "node:timers/promises";
15
15
  var OPENAI_URL = "https://api.openai.com/v1";
16
16
  var OPENAI_MODELS = {
@@ -0,0 +1,166 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ singleLine
5
+ } from "./chunk-CCHHEMPM.js";
6
+ import {
7
+ __name
8
+ } from "./chunk-ZVVMGPBJ.js";
9
+
10
+ // node_modules/.pnpm/@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/names.js
11
+ var FIRST_PARTY_TOOLS = [
12
+ { name: "tg", package: "@wirecat/tg-cli" },
13
+ { name: "max", package: "@wirecat/max-cli" },
14
+ { name: "wa", package: "@wirecat/whatsapp-cli" },
15
+ { name: "zm", package: "@wirecat/zoom-cli" },
16
+ { name: "drive", package: "@wirecat/drive-cli" },
17
+ { name: "memo", package: "@wirecat/cli-memo" },
18
+ { name: "mail", package: "@wirecat/mail-cli" },
19
+ // memo reads email today; the name is held for a tool of its own.
20
+ { name: "email" }
21
+ ];
22
+ var BUILT_IN_COMMANDS = ["help", "version", "shortcuts", "doctor", "update", "upgrade", "app"];
23
+ var RESERVED_NAMES = [
24
+ ...FIRST_PARTY_TOOLS.map((tool) => tool.name),
25
+ ...BUILT_IN_COMMANDS,
26
+ "wcat"
27
+ ];
28
+ var TOOL_NAME = /^[a-z][a-z0-9-]{0,39}$/;
29
+ var PROGRAM_PREFIX = "wcat-";
30
+ var DESCRIBE_FLAG = "--wcat-describe";
31
+ var DISPATCH_FLAG = "--wcat-dispatch";
32
+
33
+ // node_modules/.pnpm/@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/describe.js
34
+ var DESCRIBE_FORMAT = 1;
35
+ var describeAnswer = /* @__PURE__ */ __name((tool) => ({
36
+ wcat_describe: DESCRIBE_FORMAT,
37
+ name: tool.command,
38
+ version: tool.version,
39
+ description: tool.description,
40
+ ...tool.docs ? { docs_url: tool.docs } : {}
41
+ }), "describeAnswer");
42
+ var MAX_TEXT = 200;
43
+ var clean = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim() !== "" ? singleLine(value.trim()).slice(0, MAX_TEXT) : void 0, "clean");
44
+ var parseDescribe = /* @__PURE__ */ __name((text) => {
45
+ let answer;
46
+ try {
47
+ answer = JSON.parse(text);
48
+ } catch {
49
+ return void 0;
50
+ }
51
+ if (typeof answer !== "object" || answer === null || !("wcat_describe" in answer))
52
+ return void 0;
53
+ const { version, description, docs_url: docs } = answer;
54
+ const url = clean(docs);
55
+ return {
56
+ version: clean(version) ?? "",
57
+ description: clean(description) ?? "",
58
+ ...url && /^https?:\/\//.test(url) ? { docs: url } : {}
59
+ };
60
+ }, "parseDescribe");
61
+
62
+ // node_modules/.pnpm/@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/shim.js
63
+ import { lstatSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
64
+ import { join } from "node:path";
65
+ var SHIM_FORMAT = 1;
66
+ var MARK = /^(?:#|REM) wirecat-shim (\d+) (launcher|shortcut) (\S+)\r?$/m;
67
+ var NOTE = {
68
+ launcher: "Written by @wirecat/cli-base. Any WireCat tool rewrites it when it breaks; it is safe to delete.",
69
+ shortcut: "Made by `wcat shortcuts add`; `wcat shortcuts remove` takes it out."
70
+ };
71
+ var shellQuote = /* @__PURE__ */ __name((text) => `'${text.replaceAll("'", `'\\''`)}'`, "shellQuote");
72
+ var shimFiles = /* @__PURE__ */ __name((kind, { dir, name, target, platform }) => {
73
+ const mark = `wirecat-shim ${SHIM_FORMAT} ${kind} ${target}`;
74
+ const extra = kind === "launcher" ? ` ${DISPATCH_FLAG}` : "";
75
+ if (platform !== "win32")
76
+ return [
77
+ {
78
+ path: join(dir, name),
79
+ text: `#!/bin/sh
80
+ # ${mark}
81
+ # ${NOTE[kind]}
82
+ exec ${shellQuote(join(dir, target))}${extra} "$@"
83
+ `
84
+ }
85
+ ];
86
+ return [
87
+ {
88
+ path: join(dir, `${name}.cmd`),
89
+ text: ["@ECHO off", `REM ${mark}`, `REM ${NOTE[kind]}`, `"%~dp0${target}"${extra} %*`, ""].join("\r\n")
90
+ },
91
+ {
92
+ path: join(dir, `${name}.ps1`),
93
+ text: [
94
+ `# ${mark}`,
95
+ `# ${NOTE[kind]}`,
96
+ // PowerShell hands a .cmd its arguments unquoted, so `a&b` would run `b`; npm and pnpm write a .ps1 beside
97
+ // their .cmd, and it is started instead whenever it is there.
98
+ `$stem = Join-Path $PSScriptRoot "${target.replace(/\.(cmd|exe|bat)$/i, "")}"`,
99
+ `$target = if (Test-Path -LiteralPath "$stem.ps1") { "$stem.ps1" } else { Join-Path $PSScriptRoot "${target}" }`,
100
+ "if ($MyInvocation.ExpectingInput) {",
101
+ ` $input | & $target${extra} @args`,
102
+ "} else {",
103
+ ` & $target${extra} @args`,
104
+ "}",
105
+ "exit $LASTEXITCODE",
106
+ ""
107
+ ].join("\r\n")
108
+ }
109
+ ];
110
+ }, "shimFiles");
111
+ var parseShim = /* @__PURE__ */ __name((text) => {
112
+ const found = MARK.exec(text.split("\n", 3).join("\n"));
113
+ if (!found)
114
+ return void 0;
115
+ return { format: Number(found[1]), kind: found[2], target: found[3] };
116
+ }, "parseShim");
117
+ var MAX_SHIM_BYTES = 4096;
118
+ var fileState = /* @__PURE__ */ __name((path) => {
119
+ let stat;
120
+ try {
121
+ stat = lstatSync(path);
122
+ } catch (error) {
123
+ return error.code === "ENOENT" ? { state: "missing" } : { state: "foreign" };
124
+ }
125
+ if (!stat.isFile() || stat.size > MAX_SHIM_BYTES)
126
+ return { state: "foreign" };
127
+ try {
128
+ const text = readFileSync(path, "utf8");
129
+ const mark = parseShim(text);
130
+ return mark ? { state: "ours", mark, text } : { state: "foreign" };
131
+ } catch {
132
+ return { state: "foreign" };
133
+ }
134
+ }, "fileState");
135
+ var exists = /* @__PURE__ */ __name((path) => {
136
+ try {
137
+ return statSync(path).isFile();
138
+ } catch {
139
+ return false;
140
+ }
141
+ }, "exists");
142
+ var writeShim = /* @__PURE__ */ __name(({ path, text }) => {
143
+ const temporary = `${path}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
144
+ try {
145
+ writeFileSync(temporary, text, { mode: 493 });
146
+ renameSync(temporary, path);
147
+ } finally {
148
+ rmSync(temporary, { force: true });
149
+ }
150
+ }, "writeShim");
151
+
152
+ export {
153
+ describeAnswer,
154
+ parseDescribe,
155
+ FIRST_PARTY_TOOLS,
156
+ BUILT_IN_COMMANDS,
157
+ TOOL_NAME,
158
+ PROGRAM_PREFIX,
159
+ DESCRIBE_FLAG,
160
+ DISPATCH_FLAG,
161
+ SHIM_FORMAT,
162
+ shimFiles,
163
+ fileState,
164
+ exists,
165
+ writeShim
166
+ };
@@ -2,16 +2,16 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  alive
5
- } from "./chunk-OQR442B6.js";
5
+ } from "./chunk-KIZT2MI6.js";
6
6
  import {
7
7
  resolvePaths,
8
8
  writeSecurely
9
- } from "./chunk-KQ23JWLJ.js";
9
+ } from "./chunk-NTW5ZE47.js";
10
10
  import {
11
11
  __name
12
12
  } from "./chunk-ZVVMGPBJ.js";
13
13
 
14
- // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/background/lock.js
14
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/background/lock.js
15
15
  import { existsSync, linkSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
16
16
  import { dirname, join } from "node:path";
17
17
  var lockPath = /* @__PURE__ */ __name((app, profile, env) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "serve", `${profile}.lock`), "lockPath");
@@ -4,15 +4,15 @@ import {
4
4
  organization,
5
5
  project,
6
6
  reminder
7
- } from "./chunk-6OKGHHRL.js";
7
+ } from "./chunk-WMRFAK5B.js";
8
8
  import {
9
9
  queryFieldsOf
10
- } from "./chunk-HNN7EKIM.js";
10
+ } from "./chunk-QK6VLKG5.js";
11
11
 
12
- // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/snapshot.js
12
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/snapshot.js
13
13
  var MAX_BYTES = 16 * 1024 * 1024;
14
14
 
15
- // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
15
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
16
16
  var ORGANIZATIONS_QUERY = {
17
17
  entity: "organization",
18
18
  backend: "sql",
@@ -3,28 +3,28 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  envName,
5
5
  readOnlyLockOf
6
- } from "./chunk-IDUYRTPF.js";
6
+ } from "./chunk-D4E345BC.js";
7
7
  import {
8
8
  CAPABILITY_STATEMENTS,
9
9
  storeCapable
10
- } from "./chunk-OSBAISA5.js";
10
+ } from "./chunk-VQCWVZWG.js";
11
11
  import {
12
12
  catchCrashes
13
- } from "./chunk-KQ23JWLJ.js";
14
- import {
15
- CliError
16
- } from "./chunk-PCRLXJRH.js";
13
+ } from "./chunk-77M3IAVU.js";
17
14
  import {
18
15
  importFrom
19
16
  } from "./chunk-Y5E2WNWB.js";
17
+ import {
18
+ CliError
19
+ } from "./chunk-CCHHEMPM.js";
20
20
  import {
21
21
  __name
22
22
  } from "./chunk-ZVVMGPBJ.js";
23
23
 
24
- // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/cli/entry.js
24
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/entry.js
25
25
  import { spawn as spawn2 } from "node:child_process";
26
26
 
27
- // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/sqlite-runtime.js
27
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/sqlite-runtime.js
28
28
  import { spawn, spawnSync } from "node:child_process";
29
29
  import { readFileSync } from "node:fs";
30
30
  import { dirname } from "node:path";
@@ -112,7 +112,7 @@ var relay = /* @__PURE__ */ __name((child, host = process) => new Promise(() =>
112
112
  });
113
113
  }), "relay");
114
114
 
115
- // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/cli/argv-log.js
115
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/argv-log.js
116
116
  import { appendFileSync } from "node:fs";
117
117
  var logParsedArgv = /* @__PURE__ */ __name((file, action) => {
118
118
  const words = [];
@@ -136,7 +136,7 @@ var logVersion = /* @__PURE__ */ __name((file) => {
136
136
  `);
137
137
  }, "logVersion");
138
138
 
139
- // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/cli/entry.js
139
+ // node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/entry.js
140
140
  var processIo = /* @__PURE__ */ __name(() => ({
141
141
  argv: process.argv,
142
142
  env: process.env,
@@ -190,8 +190,8 @@ var startCli = /* @__PURE__ */ __name(async (entry) => {
190
190
  if (command.optsWithGlobals().dryRun === true)
191
191
  return;
192
192
  const [{ setupAtStart }, { commandPathOf }] = await Promise.all([
193
- import("./first-run-LEAI623Q.js"),
194
- import("./command-contract-GV67H22L.js")
193
+ import("./first-run-3N5AABEY.js"),
194
+ import("./command-contract-YF4KGFXC.js")
195
195
  ]);
196
196
  await setupAtStart({
197
197
  command: entry.app.command,
@@ -206,7 +206,7 @@ var startCli = /* @__PURE__ */ __name(async (entry) => {
206
206
  ask: /* @__PURE__ */ __name(async (question, command) => {
207
207
  if (headless(command) || io.stdin.isTTY !== true)
208
208
  return false;
209
- const { readSecret } = await import("./prompt-EGULVW2F.js");
209
+ const { readSecret } = await import("./prompt-4NGAZGHE.js");
210
210
  const answer = await readSecret(`${question} [y/N] `, {
211
211
  input: io.stdin,
212
212
  output: io.stderr,
@@ -215,7 +215,7 @@ var startCli = /* @__PURE__ */ __name(async (entry) => {
215
215
  });
216
216
  return /^(y|yes)$/i.test(answer.trim());
217
217
  }, "ask"),
218
- openBrowser: /* @__PURE__ */ __name((url, browser) => openBrowser(io, url, browser), "openBrowser"),
218
+ openBrowser: /* @__PURE__ */ __name((url, browser) => openBrowser(url, browser, io), "openBrowser"),
219
219
  outputClosed: /* @__PURE__ */ __name(() => closed, "outputClosed")
220
220
  };
221
221
  let code;
@@ -258,7 +258,7 @@ var commanderExit = /* @__PURE__ */ __name((error) => {
258
258
  return 0;
259
259
  return code === "commander.help" ? 2 : void 0;
260
260
  }, "commanderExit");
261
- var openBrowser = /* @__PURE__ */ __name((io, url, browser) => {
261
+ var openBrowser = /* @__PURE__ */ __name((url, browser, io = { platform: process.platform, spawn: spawn2 }) => {
262
262
  const [command, prefix] = browser !== void 0 ? [browser, []] : io.platform === "darwin" ? ["open", []] : io.platform === "win32" ? ["rundll32.exe", ["url.dll,FileProtocolHandler"]] : ["xdg-open", []];
263
263
  return new Promise((resolve, reject) => {
264
264
  const child = io.spawn(command, [...prefix, url], { detached: true, stdio: "ignore", windowsHide: true });
@@ -273,5 +273,6 @@ var openBrowser = /* @__PURE__ */ __name((io, url, browser) => {
273
273
  export {
274
274
  logParsedArgv,
275
275
  logVersion,
276
- startCli
276
+ startCli,
277
+ openBrowser
277
278
  };