@wirecat/drive-cli 0.52.1 → 0.54.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 (218) hide show
  1. package/dist/bin/drive.js +2 -2
  2. package/dist/bin/drive.js.map +1 -1
  3. package/dist/bundle/{chunk-ZWSG7OCA.js → all-profiles-LFIPUPZI.js} +13 -8
  4. package/dist/bundle/{anthropic-KW6KU36Y.js → anthropic-G5ZRRWG4.js} +5 -5
  5. package/dist/bundle/{app-server-TCJZ333E.js → app-server-UVWATOQC.js} +48 -56
  6. package/dist/bundle/{bun-7SYKSCLA.js → bun-DNEFTPTR.js} +2 -2
  7. package/dist/bundle/{bun-sqlite-RI7DR6RZ.js → bun-sqlite-FWBYHIXB.js} +4 -4
  8. package/dist/bundle/{chunk-CM7GAXGD.js → chunk-2CQT2WWN.js} +5 -5
  9. package/dist/bundle/{chunk-HQVJK5E7.js → chunk-2D6AAGBP.js} +246 -383
  10. package/dist/bundle/{chunk-FG4XXZZE.js → chunk-2FFXRWI2.js} +2 -2
  11. package/dist/bundle/{chunk-2UIMEMWU.js → chunk-2HQPJ366.js} +3 -3
  12. package/dist/bundle/{chunk-CB7SBYLO.js → chunk-2HWOGSTA.js} +57 -37
  13. package/dist/bundle/{chunk-7XKAVMCF.js → chunk-2MSJVFAS.js} +8 -8
  14. package/dist/bundle/{chunk-NSIFQ5OP.js → chunk-2NWFZ43Q.js} +1 -1
  15. package/dist/bundle/{chunk-H47W2J6S.js → chunk-2Q3S47BC.js} +1312 -626
  16. package/dist/bundle/{chunk-O6IOL6RX.js → chunk-47MEPBWG.js} +21 -21
  17. package/dist/bundle/{chunk-725OHXKR.js → chunk-4RDXCE45.js} +2226 -37
  18. package/dist/bundle/{chunk-UR32UWTQ.js → chunk-5BPOAHVD.js} +13 -2
  19. package/dist/bundle/{chunk-5FONRUG6.js → chunk-5D4AEUVA.js} +1 -23
  20. package/dist/bundle/{chunk-VZ2I62HN.js → chunk-5LNOVPOR.js} +2 -2
  21. package/dist/bundle/{chunk-EKFEY3KP.js → chunk-5WQN2TUM.js} +1 -1
  22. package/dist/bundle/{chunk-ALJWBGD5.js → chunk-6MGSFYGL.js} +1 -1
  23. package/dist/bundle/{chunk-WUX7AUOQ.js → chunk-6RAEXK7Y.js} +26 -26
  24. package/dist/bundle/{chunk-BSSCTWWK.js → chunk-6SOQJRGI.js} +4 -4
  25. package/dist/bundle/{chunk-CKBHR7QO.js → chunk-75DSLCPC.js} +1 -1
  26. package/dist/bundle/{chunk-VSOLLTYT.js → chunk-76JIVDKC.js} +7 -2
  27. package/dist/bundle/{chunk-33NVQGUY.js → chunk-7WCZ2OZ5.js} +6 -6
  28. package/dist/bundle/{chunk-IDUNJCFO.js → chunk-7XU3TR7K.js} +2 -2
  29. package/dist/bundle/{chunk-7SH4JHYW.js → chunk-A4FTLORC.js} +12 -12
  30. package/dist/bundle/{chunk-CITFEQ6S.js → chunk-AACQA2CO.js} +1 -1
  31. package/dist/bundle/{chunk-PSNHPFSK.js → chunk-AAHIBA36.js} +1 -1
  32. package/dist/bundle/{chunk-PEOCBV2Z.js → chunk-BWBVBW5T.js} +8 -8
  33. package/dist/bundle/{chunk-A4UNTWAX.js → chunk-CVALO727.js} +99 -30
  34. package/dist/bundle/{chunk-G6QF5KWF.js → chunk-FHW4ENRF.js} +37 -43
  35. package/dist/bundle/{chunk-LONV6HIK.js → chunk-HAHARAJD.js} +455 -40
  36. package/dist/bundle/{chunk-2623YE5I.js → chunk-IBRXVPBI.js} +97 -99
  37. package/dist/bundle/{chunk-IWFBAWZK.js → chunk-IKODUUQG.js} +292 -19
  38. package/dist/bundle/{chunk-PQJYM5ES.js → chunk-IOMSC4ZG.js} +3 -3
  39. package/dist/bundle/{chunk-YKZ4IPLB.js → chunk-JKEAZBEZ.js} +7 -7
  40. package/dist/bundle/{chunk-FCJAHD4R.js → chunk-KIQIF5M7.js} +3 -3
  41. package/dist/bundle/{chunk-KYVXMEBC.js → chunk-KT5G3KVS.js} +3 -3
  42. package/dist/bundle/{chunk-W7IK7E4B.js → chunk-L3RV42O3.js} +20 -22
  43. package/dist/bundle/{chunk-NHBUTCNR.js → chunk-LQXLWHKM.js} +9 -9
  44. package/dist/bundle/{chunk-WBTVGFXI.js → chunk-MATUQFYL.js} +11 -11
  45. package/dist/bundle/{chunk-54O62JWP.js → chunk-MULPNGM2.js} +29 -10
  46. package/dist/bundle/{chunk-FJW3DDCF.js → chunk-N4OO3SPQ.js} +5 -5
  47. package/dist/bundle/{chunk-6DHQTUB2.js → chunk-NDWWGBSM.js} +1 -1
  48. package/dist/bundle/{chunk-DLAFGSTN.js → chunk-NHDSJMAR.js} +1 -1
  49. package/dist/bundle/{chunk-PQYVPCJ2.js → chunk-O6YYFVDD.js} +38 -37
  50. package/dist/bundle/{chunk-I7UH5CTA.js → chunk-OYGEBFFO.js} +12 -14
  51. package/dist/bundle/chunk-P7E7K467.js +110 -0
  52. package/dist/bundle/{chunk-ZNZUZGSV.js → chunk-PKNTBZXN.js} +176 -49
  53. package/dist/bundle/{chunk-YNFELLNQ.js → chunk-PU4GANCD.js} +3 -3
  54. package/dist/bundle/{chunk-5PLJKSG4.js → chunk-Q46JLJ5O.js} +7 -9
  55. package/dist/bundle/{chunk-R276546S.js → chunk-QKHFQHE7.js} +1 -1
  56. package/dist/bundle/{chunk-RNSP57TC.js → chunk-QUJCD5U7.js} +4 -4
  57. package/dist/bundle/{chunk-43QVYW3K.js → chunk-RIYXQFKU.js} +262 -88
  58. package/dist/bundle/{chunk-2AUXBJRX.js → chunk-RWEFKLXJ.js} +104 -29
  59. package/dist/bundle/{chunk-WQJBAWQP.js → chunk-SBOTSSYV.js} +879 -508
  60. package/dist/bundle/{chunk-PAXKALHV.js → chunk-U3BOQ63L.js} +118 -7
  61. package/dist/bundle/{chunk-VJZST5RD.js → chunk-UBJX5D2O.js} +2 -2
  62. package/dist/bundle/{chunk-HX7Y2ASG.js → chunk-VCGQMTHW.js} +26318 -15143
  63. package/dist/bundle/{chunk-7YMDL4JQ.js → chunk-VKYCMXEQ.js} +8 -5
  64. package/dist/bundle/{chunk-ZSXRDF6I.js → chunk-VX4RAT3A.js} +1 -1
  65. package/dist/bundle/{chunk-NYOPEHEU.js → chunk-W5SYBHRX.js} +8 -3
  66. package/dist/bundle/{chunk-XOLQSCMF.js → chunk-WGSTTWM5.js} +6 -6
  67. package/dist/bundle/{chunk-WLFUBNFX.js → chunk-WJRE45Z6.js} +4 -4
  68. package/dist/bundle/{chunk-IEXPOEEO.js → chunk-WQPTZHHR.js} +17 -26
  69. package/dist/bundle/{chunk-JEOYFKUK.js → chunk-WSX5UQNT.js} +2 -2
  70. package/dist/bundle/{chunk-LJAX6YCF.js → chunk-WYDYSQ7T.js} +2 -2
  71. package/dist/bundle/{chunk-C6Z25IBJ.js → chunk-XCUUYQN7.js} +4 -4
  72. package/dist/bundle/{chunk-GVCN3GLZ.js → chunk-YOHOQ6ZR.js} +4 -4
  73. package/dist/bundle/chunk-YZ5VMR2S.js +5305 -0
  74. package/dist/bundle/{chunk-ZDLIO76S.js → chunk-ZMMOVTUB.js} +2 -2
  75. package/dist/bundle/command-contract-VZ3ZJLEF.js +35 -0
  76. package/dist/bundle/{decode-EDN2ARXZ.js → decode-DN2DDFET.js} +4 -4
  77. package/dist/bundle/drive.js +11 -22
  78. package/dist/bundle/{echarts-GXY34GHA.js → echarts-VMHZ2UYP.js} +2 -2
  79. package/dist/bundle/{embed-3GSQIQXE.js → embed-MDN7R7BA.js} +5 -5
  80. package/dist/bundle/{embedder-6ULWRG3R.js → embedder-KEVEDNDJ.js} +8 -8
  81. package/dist/bundle/{entry-IPRJLFHO.js → entry-HTNK5TJQ.js} +6 -6
  82. package/dist/bundle/{first-run-FGHGWHC2.js → first-run-QNMCMP67.js} +9 -9
  83. package/dist/bundle/first-screen-RQBEHUQC.js +33 -0
  84. package/dist/bundle/{google-BD3ZNFVJ.js → google-QAKMV57Q.js} +9 -9
  85. package/dist/bundle/{chunk-GR5GGZKH.js → google-api-UJJS7ECO.js} +62 -6
  86. package/dist/bundle/grants-VMPKFEC2.js +98 -0
  87. package/dist/bundle/{identity-U7IHZEMR.js → identity-UODE3QAL.js} +4 -2
  88. package/dist/bundle/{instructions-K5BEQM4C.js → instructions-IWLHCDC7.js} +1 -1
  89. package/dist/bundle/{login-7HRYPZMM.js → login-GIZXEN7I.js} +60 -68
  90. package/dist/bundle/{mcp-WSGVVZWI.js → mcp-RUYPQVYS.js} +2 -2
  91. package/dist/bundle/{node-ZYWB7IET.js → node-25IJLDBZ.js} +2 -2
  92. package/dist/bundle/{node-sqlite-J3OODPYK.js → node-sqlite-DYR4FEI4.js} +4 -4
  93. package/dist/bundle/{oauth-L4VTCBLF.js → oauth-FLHXEDDY.js} +7 -7
  94. package/dist/bundle/{open-SGUN7ZVF.js → open-FWDZB7KX.js} +3 -3
  95. package/dist/bundle/{openai-RLVISEDH.js → openai-HB7UGKPW.js} +13 -13
  96. package/dist/bundle/{process-ZXO2MWRJ.js → process-P6TW37HQ.js} +1 -1
  97. package/dist/bundle/{program-YVLXSKZV.js → program-DVUNLXXS.js} +730 -919
  98. package/dist/bundle/{prompt-AUWTBLO7.js → prompt-MKWMYO3B.js} +4 -4
  99. package/dist/bundle/{reasons-J57GSRWN.js → reasons-25BEO2NE.js} +3 -3
  100. package/dist/bundle/{recognize-ORX2UBQW.js → recognize-VXGNPROM.js} +3 -3
  101. package/dist/bundle/{remote-AGIJY73X.js → remote-H5ZWLJHR.js} +6 -6
  102. package/dist/bundle/{rerank-R6PE44M5.js → rerank-5A3JDK7O.js} +6 -6
  103. package/dist/bundle/{chunk-G7DCVJ4F.js → serve-QNPNEZVR.js} +10 -7
  104. package/dist/bundle/{chunk-F7UUZATI.js → server-GWBVIRLY.js} +42 -15
  105. package/dist/bundle/server-QJU3HEGM.js +63 -0
  106. package/dist/bundle/{services-HZFTTZSF.js → services-PFXEWHJG.js} +30 -31
  107. package/dist/bundle/{sqlite-runtime-DTGPR2T2.js → sqlite-runtime-RGFISYXM.js} +4 -4
  108. package/dist/bundle/{state-WG3JKJM3.js → state-BUSX5BXF.js} +5 -5
  109. package/dist/bundle/{store-EV72MT5U.js → store-FIEE5HHG.js} +14 -16
  110. package/dist/bundle/{store-33VHIMEO.js → store-HFF5KQ44.js} +12 -14
  111. package/dist/bundle/store-maintenance-command-Z4SPEQUM.js +52 -0
  112. package/dist/bundle/{chunk-GNI7INK6.js → terminal-DHJ4D3BC.js} +2 -3
  113. package/dist/bundle/tokens-B6MUZRFM.js +96 -0
  114. package/dist/commands/context.d.ts +14 -13
  115. package/dist/commands/context.d.ts.map +1 -1
  116. package/dist/commands/context.js.map +1 -1
  117. package/dist/commands/documents.d.ts.map +1 -1
  118. package/dist/commands/documents.js +1 -4
  119. package/dist/commands/documents.js.map +1 -1
  120. package/dist/commands/mirrors.d.ts.map +1 -1
  121. package/dist/commands/mirrors.js +1 -2
  122. package/dist/commands/mirrors.js.map +1 -1
  123. package/dist/commands/upgrade.d.ts +1 -1
  124. package/dist/commands/upgrade.d.ts.map +1 -1
  125. package/dist/commands/upgrade.js +4 -9
  126. package/dist/commands/upgrade.js.map +1 -1
  127. package/dist/config.d.ts +182 -0
  128. package/dist/config.d.ts.map +1 -1
  129. package/dist/config.js +38 -3
  130. package/dist/config.js.map +1 -1
  131. package/dist/contract-overrides.d.ts +0 -3
  132. package/dist/contract-overrides.d.ts.map +1 -1
  133. package/dist/contract-overrides.js +0 -234
  134. package/dist/contract-overrides.js.map +1 -1
  135. package/dist/first-screen.d.ts +3 -2
  136. package/dist/first-screen.d.ts.map +1 -1
  137. package/dist/first-screen.js +17 -22
  138. package/dist/first-screen.js.map +1 -1
  139. package/dist/grants.d.ts +9 -0
  140. package/dist/grants.d.ts.map +1 -0
  141. package/dist/grants.js +30 -0
  142. package/dist/grants.js.map +1 -0
  143. package/dist/identity.d.ts.map +1 -1
  144. package/dist/identity.js +2 -0
  145. package/dist/identity.js.map +1 -1
  146. package/dist/login.d.ts.map +1 -1
  147. package/dist/login.js +2 -4
  148. package/dist/login.js.map +1 -1
  149. package/dist/policy-keys.d.ts +12 -0
  150. package/dist/policy-keys.d.ts.map +1 -0
  151. package/dist/policy-keys.js +107 -0
  152. package/dist/policy-keys.js.map +1 -0
  153. package/dist/policy.d.ts +1 -8
  154. package/dist/policy.d.ts.map +1 -1
  155. package/dist/policy.js +2 -105
  156. package/dist/policy.js.map +1 -1
  157. package/dist/program.d.ts +8 -4
  158. package/dist/program.d.ts.map +1 -1
  159. package/dist/program.js +251 -222
  160. package/dist/program.js.map +1 -1
  161. package/dist/testing/mcp.d.ts +28 -0
  162. package/dist/testing/mcp.d.ts.map +1 -0
  163. package/dist/testing/mcp.js +56 -0
  164. package/dist/testing/mcp.js.map +1 -0
  165. package/dist/tokens.d.ts.map +1 -1
  166. package/dist/tokens.js +0 -9
  167. package/dist/tokens.js.map +1 -1
  168. package/dist/version.d.ts +1 -1
  169. package/dist/version.js +1 -1
  170. package/package.json +6 -5
  171. package/scenarios/agent-access.md +4 -2
  172. package/dist/bundle/all-profiles-CYW6XBBS.js +0 -26
  173. package/dist/bundle/chunk-234MHU76.js +0 -384
  174. package/dist/bundle/chunk-BBYD2FA3.js +0 -9
  175. package/dist/bundle/chunk-DO4PDQY5.js +0 -48
  176. package/dist/bundle/chunk-FDWYPONW.js +0 -1988
  177. package/dist/bundle/chunk-FQRJWVEB.js +0 -2
  178. package/dist/bundle/chunk-GJN5B5JK.js +0 -522
  179. package/dist/bundle/chunk-NPSZPUK6.js +0 -193
  180. package/dist/bundle/chunk-PDGECM5D.js +0 -138
  181. package/dist/bundle/chunk-Q765VPZY.js +0 -421
  182. package/dist/bundle/chunk-QYUHS6DE.js +0 -1714
  183. package/dist/bundle/chunk-WQRGA75U.js +0 -256
  184. package/dist/bundle/chunk-YVPHJHIL.js +0 -15572
  185. package/dist/bundle/chunk-Z47LOJUS.js +0 -484
  186. package/dist/bundle/command-contract-I2YB5IXI.js +0 -38
  187. package/dist/bundle/failure-IXS2ZHA5.js +0 -37
  188. package/dist/bundle/first-screen-M62KTPZG.js +0 -36
  189. package/dist/bundle/google-api-BDUWZMRV.js +0 -83
  190. package/dist/bundle/mcp-F67RATLF.js +0 -502
  191. package/dist/bundle/mcp-JZSYPQA4.js +0 -96
  192. package/dist/bundle/serve-VOBAQHAQ.js +0 -20
  193. package/dist/bundle/server-24PS4M7U.js +0 -70
  194. package/dist/bundle/server-G6HFZ2CK.js +0 -57
  195. package/dist/bundle/store-maintenance-command-ZTUEI4EC.js +0 -58
  196. package/dist/bundle/terminal-TFCTWLOS.js +0 -11
  197. package/dist/bundle/tokens-XMOGQFI6.js +0 -102
  198. package/dist/commands/doctor.d.ts +0 -56
  199. package/dist/commands/doctor.d.ts.map +0 -1
  200. package/dist/commands/doctor.js +0 -75
  201. package/dist/commands/doctor.js.map +0 -1
  202. package/dist/commands/mcp.d.ts +0 -6
  203. package/dist/commands/mcp.d.ts.map +0 -1
  204. package/dist/commands/mcp.js +0 -156
  205. package/dist/commands/mcp.js.map +0 -1
  206. package/dist/commands/skill.d.ts +0 -6
  207. package/dist/commands/skill.d.ts.map +0 -1
  208. package/dist/commands/skill.js +0 -34
  209. package/dist/commands/skill.js.map +0 -1
  210. package/dist/failure.d.ts +0 -88
  211. package/dist/failure.d.ts.map +0 -1
  212. package/dist/failure.js +0 -60
  213. package/dist/failure.js.map +0 -1
  214. package/dist/mcp.d.ts +0 -175
  215. package/dist/mcp.d.ts.map +0 -1
  216. package/dist/mcp.js +0 -412
  217. package/dist/mcp.js.map +0 -1
  218. /package/dist/bundle/{chunk-62EDJKGP.js → chunk-HEA3XVAJ.js} +0 -0
@@ -1,384 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- singleLine
5
- } from "./chunk-HQVJK5E7.js";
6
- import {
7
- CliError
8
- } from "./chunk-YKZ4IPLB.js";
9
- import {
10
- __name
11
- } from "./chunk-ZVVMGPBJ.js";
12
-
13
- // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/providers.js
14
- var KINDS = ["messages", "mail", "notes", "documents", "meetings", "events"];
15
- var PROVIDERS = [
16
- { name: "telegram", kind: "messages", aliases: ["tg"] },
17
- { name: "telegram-bot", kind: "messages", aliases: ["tg-bot"] },
18
- { name: "max", kind: "messages", aliases: [] },
19
- { name: "max-bot", kind: "messages", aliases: [] },
20
- { name: "whatsapp", kind: "messages", aliases: ["wa"] },
21
- { name: "whatsapp-bot", kind: "messages", aliases: ["wa-bot"] },
22
- { name: "email", kind: "mail", aliases: [] },
23
- { name: "notes", kind: "notes", aliases: [] },
24
- { name: "local", kind: "notes", aliases: [] },
25
- { name: "obsidian", kind: "notes", aliases: [] },
26
- { name: "zoom", kind: "meetings", aliases: [] }
27
- ];
28
- var FOLDER_PROVIDERS = ["local", "obsidian", "folder"];
29
- var isFolderProvider = /* @__PURE__ */ __name((provider) => FOLDER_PROVIDERS.includes(provider), "isFolderProvider");
30
- var folderProviderSql = /* @__PURE__ */ __name((column = "provider") => `${column} IN (${FOLDER_PROVIDERS.map((name) => `'${name}'`).join(", ")})`, "folderProviderSql");
31
- var folderProviderOf = /* @__PURE__ */ __name((format) => format === "markdown" ? "local" : "obsidian", "folderProviderOf");
32
- var DOCUMENT_ACCOUNT_PROVIDERS = ["google-drive"];
33
- var isDocumentAccountProvider = /* @__PURE__ */ __name((provider) => DOCUMENT_ACCOUNT_PROVIDERS.includes(provider), "isDocumentAccountProvider");
34
- var filesAccountSql = /* @__PURE__ */ __name((column = "provider") => `${column} IN (${[...FOLDER_PROVIDERS, ...DOCUMENT_ACCOUNT_PROVIDERS].map((name) => `'${name}'`).join(", ")})`, "filesAccountSql");
35
- var INTERNAL_NOTES = "internal";
36
- var UNKNOWN_PROVIDER = "unknown provider \u2014 run its CLI once";
37
- var WORD = /^[a-z0-9][a-z0-9_-]*$/;
38
- var invalid = /* @__PURE__ */ __name((message) => {
39
- throw new CliError("validation_error", message);
40
- }, "invalid");
41
- var wordOf = /* @__PURE__ */ __name((value, what) => typeof value === "string" && WORD.test(value) ? value : invalid(`${what} is lowercase letters, digits, - and _ \u2014 not ${JSON.stringify(value)}`), "wordOf");
42
- var providerEntryOf = /* @__PURE__ */ __name((value) => {
43
- if (typeof value !== "object" || value === null || Array.isArray(value))
44
- return invalid("a provider entry is an object");
45
- const { name, kind, aliases = [], command } = value;
46
- const named = wordOf(name, "a provider's name");
47
- if (typeof kind !== "string" || !KINDS.includes(kind))
48
- invalid(`provider ${named}'s kind is one of ${KINDS.join(", ")} \u2014 not ${JSON.stringify(kind)}`);
49
- if (!Array.isArray(aliases))
50
- invalid(`provider ${named}'s aliases are a list`);
51
- return {
52
- name: named,
53
- kind,
54
- aliases: [...new Set(aliases.map((alias) => wordOf(alias, `an alias of ${named}`)))],
55
- ...command === void 0 ? {} : { command: wordOf(command, `the command of ${named}`) }
56
- };
57
- }, "providerEntryOf");
58
- var describe = /* @__PURE__ */ __name(({ name, kind, command }) => `${name} (${kind}${command ? `, from ${command}` : ""})`, "describe");
59
- var wordsOf = /* @__PURE__ */ __name(({ name, aliases }) => [name, ...aliases], "wordsOf");
60
- var joined = /* @__PURE__ */ __name((known, entry) => {
61
- const same = known.find(({ name }) => name === entry.name);
62
- if (same && same.kind !== entry.kind)
63
- invalid(`two provider entries disagree on the kind: ${describe(same)} and ${describe(entry)}`);
64
- const merged = same ? {
65
- ...same,
66
- aliases: [.../* @__PURE__ */ new Set([...same.aliases, ...entry.aliases])],
67
- ...entry.command ? { command: entry.command } : {}
68
- } : entry;
69
- const others = known.filter((one) => one !== same);
70
- for (const word of wordsOf(merged)) {
71
- const owner = others.find((one) => wordsOf(one).includes(word));
72
- if (owner)
73
- invalid(`"${word}" names two providers: ${describe(owner)} and ${describe(merged)}`);
74
- }
75
- return same ? known.map((one) => one === same ? merged : one) : [...known, merged];
76
- }, "joined");
77
- var registry = PROVIDERS;
78
- var providers = /* @__PURE__ */ __name(() => registry, "providers");
79
- var useStoredProviders = /* @__PURE__ */ __name((entries) => {
80
- const left = [];
81
- registry = entries.reduce((known, entry) => {
82
- try {
83
- return joined(known, providerEntryOf(entry));
84
- } catch (error) {
85
- if (!(error instanceof CliError))
86
- throw error;
87
- left.push(entry);
88
- return known;
89
- }
90
- }, PROVIDERS);
91
- return left;
92
- }, "useStoredProviders");
93
- var addProvider = /* @__PURE__ */ __name((entry) => {
94
- registry = joined(registry, providerEntryOf(entry));
95
- }, "addProvider");
96
- var isKind = /* @__PURE__ */ __name((word) => KINDS.includes(word.toLowerCase()), "isKind");
97
- var providerNamed = /* @__PURE__ */ __name((word) => {
98
- const wanted = word.toLowerCase();
99
- return registry.find((entry) => wordsOf(entry).includes(wanted));
100
- }, "providerNamed");
101
- var kindIn = /* @__PURE__ */ __name((provider) => isFolderProvider(provider) ? "notes" : registry.find(({ name }) => name === provider)?.kind, "kindIn");
102
- var kindOf = /* @__PURE__ */ __name((provider) => kindIn(provider) ?? "messages", "kindOf");
103
-
104
- // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/locator.js
105
- var SCHEME = "msg:";
106
- var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat, message }) => SCHEME + [provider, account, chat, message].map(encodeURIComponent).join("/"), "formatLocator");
107
- var isLocator = /* @__PURE__ */ __name((reference) => reference.trim().startsWith(SCHEME), "isLocator");
108
- var parseLocator = /* @__PURE__ */ __name((reference) => {
109
- const trimmed = reference.trim();
110
- const parts2 = trimmed.startsWith(SCHEME) ? trimmed.slice(SCHEME.length).split("/") : [];
111
- if (parts2.length !== 4 || parts2.some((part) => part === "")) {
112
- throw new CliError("validation_error", `"${singleLine(reference)}" is not a message locator \u2014 expected msg:<provider>/<account>/<chat>/<message>`);
113
- }
114
- const [provider, account, chat, message] = parts2.map(decodeURIComponent);
115
- return { provider, account, chat, message };
116
- }, "parseLocator");
117
-
118
- // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/references.js
119
- var SIMPLE_REFERENCES = [
120
- "note",
121
- "document",
122
- "person",
123
- "organization",
124
- "project",
125
- "task",
126
- "memory",
127
- "fact",
128
- "bot",
129
- "entity"
130
- ];
131
- var parts = /* @__PURE__ */ __name((rest, count, reference, shape) => {
132
- const split = rest.split("/");
133
- if (split.length !== count || split.some((part) => part === ""))
134
- throw new CliError("validation_error", `"${singleLine(reference)}" is not a reference \u2014 expected ${shape}`);
135
- return split.map(decodeURIComponent);
136
- }, "parts");
137
- var formatReference = /* @__PURE__ */ __name((reference) => {
138
- switch (reference.type) {
139
- case "message":
140
- return formatLocator(reference);
141
- case "chat":
142
- return `chat:${[reference.provider, reference.account, reference.chat].map(encodeURIComponent).join("/")}`;
143
- case "contact":
144
- return `contact:${[reference.provider, reference.id].map(encodeURIComponent).join("/")}`;
145
- case "folder":
146
- return reference.path === null ? `folder:${encodeURIComponent(reference.id)}` : `folder:${encodeURIComponent(reference.id)}/${encodeURIComponent(reference.path)}`;
147
- default:
148
- return `${reference.type}:${reference.id}`;
149
- }
150
- }, "formatReference");
151
- var parseReference = /* @__PURE__ */ __name((text) => {
152
- const reference = text.trim();
153
- const colon = reference.indexOf(":");
154
- const prefix = colon < 0 ? "" : reference.slice(0, colon);
155
- const rest = reference.slice(colon + 1);
156
- switch (prefix) {
157
- case "msg":
158
- return { type: "message", ...parseLocator(reference) };
159
- case "chat": {
160
- const [provider, account, chat] = parts(rest, 3, reference, "chat:<provider>/<account>/<chat>");
161
- return { type: "chat", provider, account, chat };
162
- }
163
- case "contact": {
164
- const [provider, id] = parts(rest, 2, reference, "contact:<provider>/<id>");
165
- return { type: "contact", provider, id };
166
- }
167
- case "folder": {
168
- const slash = rest.indexOf("/");
169
- const id = decodeURIComponent(slash < 0 ? rest : rest.slice(0, slash));
170
- const path = slash < 0 ? null : folderPath(decodeURIComponent(rest.slice(slash + 1)));
171
- if (!id.trim() || path === "")
172
- throw new CliError("validation_error", `"${singleLine(reference)}" is not a reference \u2014 expected folder:<id>[/<path>]`);
173
- return { type: "folder", id, path };
174
- }
175
- default:
176
- if (SIMPLE_REFERENCES.includes(prefix)) {
177
- if (!rest.trim())
178
- throw new CliError("validation_error", `"${singleLine(reference)}" names no ${prefix}`);
179
- return { type: prefix, id: rest };
180
- }
181
- throw new CliError("validation_error", `"${singleLine(reference)}" is not a reference \u2014 expected msg:, chat:, contact:, folder:, ${SIMPLE_REFERENCES.filter((one) => one !== "entity").join(":, ")}:`);
182
- }
183
- }, "parseReference");
184
- var folderPath = /* @__PURE__ */ __name((path) => {
185
- const clean = path.split("/").filter((part) => part !== "" && part !== ".").join("/");
186
- return clean === "" ? path.trim() === "" ? "" : null : clean;
187
- }, "folderPath");
188
- var canonicalReference = /* @__PURE__ */ __name((text) => formatReference(parseReference(text)), "canonicalReference");
189
-
190
- // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/counters.js
191
- var COUNTER_FIELDS = ["views", "reactions", "comments"];
192
- var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
193
- var counterObservationTime = /* @__PURE__ */ __name((observation, now) => {
194
- const at = Date.parse(observation.observedAt);
195
- if (!validCounter(observation.value) || !Number.isSafeInteger(at) || at < 0 || at > now || !["remote_fetch", "remote_update"].includes(observation.source))
196
- throw new CliError("validation_error", "counter observation needs a valid value, source and nonfuture observation time");
197
- if (observation.reactions && (!validCounter(observation.reactions.total) || observation.reactions.total !== observation.value))
198
- throw new CliError("validation_error", "reaction observation payload and total disagree");
199
- return at;
200
- }, "counterObservationTime");
201
- var counterFreshness = /* @__PURE__ */ __name((states) => {
202
- if (!states.length || states.every((one) => one.freshness === "unknown"))
203
- return "unknown";
204
- if (states.some((one) => one.freshness === "unknown"))
205
- return "partial";
206
- return states.some((one) => one.freshness === "stale") ? "stale" : "fresh";
207
- }, "counterFreshness");
208
-
209
- // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
210
- var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
211
- var AUTHOR_MEASURES = [
212
- "messages",
213
- "words",
214
- "reactions",
215
- "replies",
216
- "answers",
217
- "answer-time",
218
- "threads",
219
- "active-days"
220
- ];
221
- var CONTEXT = /* @__PURE__ */ new Set([
222
- "replies",
223
- "replies-from-others",
224
- "replies-from-others-per-message",
225
- "thread-size",
226
- "threads",
227
- "answers",
228
- "answer-time"
229
- ]);
230
- var needsRankingContext = /* @__PURE__ */ __name((options) => options.components.some((name) => CONTEXT.has(name)), "needsRankingContext");
231
- var presets = {
232
- helpful: { answers: 0.5, "replies-from-others": 0.25, reactions: 0.25 },
233
- active: { "active-days": 0.6, messages: 0.4 },
234
- engaging: { "reactions-per-message": 0.5, "replies-from-others-per-message": 0.5 }
235
- };
236
- function invalid2(message) {
237
- throw new CliError("validation_error", message, { reason: "ranking.invalid" });
238
- }
239
- __name(invalid2, "invalid");
240
- var rankingOptions = /* @__PURE__ */ __name((target, input) => {
241
- const measures = target === "messages" ? MESSAGE_MEASURES : AUTHOR_MEASURES;
242
- const { measure, score, weights: given, minMessages } = input;
243
- const messageKind = input.messageKind ?? "all";
244
- if (!["all", "posts", "comments"].includes(messageKind))
245
- invalid2("message_kind takes all, posts or comments");
246
- if (target === "messages" && minMessages !== void 0)
247
- invalid2("min_messages applies to stats contacts top");
248
- if (minMessages !== void 0 && (!Number.isSafeInteger(minMessages) || minMessages < 1))
249
- invalid2("min_messages takes a positive integer");
250
- if (measure !== void 0 && !measures.includes(measure))
251
- invalid2(`--measure takes ${measures.join(", ")}`);
252
- if (measure !== void 0 && (score !== void 0 || given !== void 0))
253
- invalid2("--measure cannot be combined with --score or --weights");
254
- if (score !== void 0 && !["helpful", "active", "engaging"].includes(score))
255
- invalid2("--score takes helpful, active or engaging");
256
- if (target === "messages" && score !== void 0 && score !== "engaging")
257
- invalid2("helpful and active scores apply to authors only");
258
- const scoring = score !== void 0 || given !== void 0;
259
- const preset = score;
260
- let weights = null;
261
- if (scoring) {
262
- let raw = given !== void 0 ? given : target === "messages" ? { reactions: 0.5, "replies-from-others": 0.5 } : presets[preset];
263
- if (typeof raw === "string") {
264
- try {
265
- raw = JSON.parse(raw);
266
- } catch {
267
- invalid2("--weights takes a JSON object of component weights");
268
- }
269
- }
270
- if (!raw || typeof raw !== "object" || Array.isArray(raw))
271
- invalid2("--weights takes a JSON object of component weights");
272
- const allowed = target === "messages" ? [...MESSAGE_MEASURES, "replies-from-others"] : [
273
- ...AUTHOR_MEASURES.filter((name) => name !== "answer-time"),
274
- "replies-from-others",
275
- "reactions-per-message",
276
- "replies-from-others-per-message"
277
- ];
278
- const entries = Object.entries(raw);
279
- for (const [name, weight] of entries) {
280
- if (!allowed.includes(name))
281
- invalid2(`unknown ${target} score component: ${name}`);
282
- if (typeof weight !== "number" || !Number.isFinite(weight) || weight < 0)
283
- invalid2(`weight for ${name} must be a finite nonnegative number`);
284
- }
285
- if (!entries.some(([, weight]) => weight > 0))
286
- invalid2("--weights needs at least one positive weight");
287
- weights = Object.fromEntries(entries);
288
- }
289
- const selected = measure ?? (target === "messages" ? "reactions" : "messages");
290
- return {
291
- target,
292
- messageKind,
293
- minMessages: minMessages ?? (target === "contacts" && score === "engaging" ? 5 : 1),
294
- measure: scoring ? "score" : selected,
295
- order: !scoring && selected === "answer-time" ? "ascending" : "descending",
296
- weights,
297
- preset: scoring ? preset ?? "custom" : null,
298
- components: weights === null ? [selected] : Object.entries(weights).filter(([, weight]) => weight > 0).map(([name]) => name)
299
- };
300
- }, "rankingOptions");
301
- var rankingScore = /* @__PURE__ */ __name((raw, maxima, weights) => {
302
- const entries = Object.entries(weights).filter(([, weight]) => weight > 0);
303
- const scale = Math.max(...entries.map(([, weight]) => weight));
304
- const denominator = entries.reduce((sum2, [, weight]) => sum2 + weight / scale, 0);
305
- if (!Number.isFinite(scale) || scale <= 0 || !Number.isFinite(denominator) || denominator <= 0)
306
- return null;
307
- const normalized = {};
308
- const contributions = {};
309
- let sum = 0;
310
- for (const [name, weight] of entries) {
311
- const value = raw[name];
312
- const maximum = maxima[name];
313
- if (value == null || !Number.isFinite(value) || value < 0 || maximum === void 0 || !Number.isFinite(maximum) || maximum < value)
314
- return null;
315
- const part = maximum === 0 ? 0 : value / maximum;
316
- normalized[name] = part;
317
- contributions[name] = 100 * part * (weight / scale) / denominator;
318
- sum += contributions[name];
319
- }
320
- return { score: Math.min(100, sum), normalized, contributions };
321
- }, "rankingScore");
322
- var RANKING_TOKENIZER_VERSION = 1;
323
- var withoutUrls = /* @__PURE__ */ __name((text) => text.replace(/\S+/gu, (token) => {
324
- for (let offset = 0; ; ) {
325
- const marker = token.indexOf("://", offset);
326
- if (marker < 0)
327
- break;
328
- let start = marker;
329
- while (start > 0 && /[a-z0-9+.-]/iu.test(token[start - 1]))
330
- start--;
331
- if (/^[a-z][a-z0-9+.-]*$/iu.test(token.slice(start, marker)) && (start === 0 || !/\w/u.test(token[start - 1])))
332
- return token.slice(0, start);
333
- offset = marker + 3;
334
- }
335
- const folded = token.toLowerCase();
336
- for (let offset = 0; ; ) {
337
- const start = folded.indexOf("www.", offset);
338
- if (start < 0)
339
- break;
340
- if (start === 0 || !/\w/u.test(token[start - 1]))
341
- return token.slice(0, start);
342
- offset = start + 4;
343
- }
344
- return token;
345
- }), "withoutUrls");
346
- var rankingWords = /* @__PURE__ */ __name((text) => withoutUrls(text).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
347
- var rankingQuestion = /* @__PURE__ */ __name((text) => withoutUrls(text).includes("?"), "rankingQuestion");
348
-
349
- export {
350
- isFolderProvider,
351
- folderProviderSql,
352
- folderProviderOf,
353
- DOCUMENT_ACCOUNT_PROVIDERS,
354
- isDocumentAccountProvider,
355
- filesAccountSql,
356
- INTERNAL_NOTES,
357
- UNKNOWN_PROVIDER,
358
- providerEntryOf,
359
- providers,
360
- useStoredProviders,
361
- addProvider,
362
- isKind,
363
- providerNamed,
364
- kindIn,
365
- kindOf,
366
- formatLocator,
367
- isLocator,
368
- parseLocator,
369
- formatReference,
370
- parseReference,
371
- canonicalReference,
372
- COUNTER_FIELDS,
373
- validCounter,
374
- counterObservationTime,
375
- counterFreshness,
376
- MESSAGE_MEASURES,
377
- AUTHOR_MEASURES,
378
- needsRankingContext,
379
- rankingOptions,
380
- rankingScore,
381
- RANKING_TOKENIZER_VERSION,
382
- rankingWords,
383
- rankingQuestion
384
- };
@@ -1,9 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
-
4
- // dist/version.js
5
- var VERSION = "0.52.1";
6
-
7
- export {
8
- VERSION
9
- };
@@ -1,48 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- CliError
5
- } from "./chunk-YKZ4IPLB.js";
6
- import {
7
- __name
8
- } from "./chunk-ZVVMGPBJ.js";
9
-
10
- // node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/http/public-url.js
11
- var EXAMPLE = "--public-url https://<name>.ts.net";
12
- var publicUrlOf = /* @__PURE__ */ __name((given, { missing, reaches, path = false }) => {
13
- if (!given)
14
- throw new CliError("configuration_error", `${missing} needs the tunnel's address: ${EXAMPLE}`);
15
- let url;
16
- try {
17
- url = new URL(given);
18
- } catch {
19
- throw new CliError("validation_error", `--public-url is not an address: ${EXAMPLE}`);
20
- }
21
- if (url.username || url.password)
22
- throw new CliError("validation_error", "--public-url must not contain login credentials");
23
- const local = url.protocol === "http:" && ["localhost", "127.0.0.1"].includes(url.hostname);
24
- if (url.protocol !== "https:" && !local)
25
- throw new CliError("validation_error", `--public-url must be https \u2014 ${reaches} through it`);
26
- if (url.search || url.hash || !path && url.pathname !== "/")
27
- throw new CliError("validation_error", path ? `--public-url is the tunnel's address, or a path of it, without a query: ${EXAMPLE}/tg` : `--public-url is the tunnel's address only, without a path: ${EXAMPLE}`);
28
- if (path && !/^(\/[A-Za-z0-9_-][A-Za-z0-9._-]*)*\/?$/.test(url.pathname))
29
- throw new CliError("validation_error", "--public-url's path takes letters, digits, dot, dash and underscore: /tg");
30
- if (path)
31
- url.pathname = url.pathname.replace(/\/+$/, "") || "/";
32
- return url;
33
- }, "publicUrlOf");
34
- var portOf = /* @__PURE__ */ __name((given, fallback) => {
35
- if (given === void 0)
36
- return fallback;
37
- const port = Number(given);
38
- if (!Number.isInteger(port) || port < 1 || port > 65535)
39
- throw new CliError("validation_error", "--port takes 1\u201365535");
40
- return port;
41
- }, "portOf");
42
- var mcpUrlOf = /* @__PURE__ */ __name((publicUrl) => new URL(`${publicUrl.pathname.replace(/\/+$/, "")}/mcp`, publicUrl.origin), "mcpUrlOf");
43
-
44
- export {
45
- publicUrlOf,
46
- portOf,
47
- mcpUrlOf
48
- };