@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,193 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- stringWidth,
5
- wrapAnsi
6
- } from "./chunk-HTQTIKWP.js";
7
- import {
8
- singleLine,
9
- visibleControls
10
- } from "./chunk-HQVJK5E7.js";
11
- import {
12
- __name
13
- } from "./chunk-ZVVMGPBJ.js";
14
-
15
- // 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/render/messages.js
16
- import { styleText } from "node:util";
17
- var TIME_WIDTH = 8;
18
- var INDENT = " ".repeat(TIME_WIDTH + 2);
19
- var MIN_WIDTH = 40;
20
- var SENDER_COLOURS = ["green", "yellow", "magenta", "blue", "red"];
21
- var renderMessages = /* @__PURE__ */ __name((messages, options = {}) => {
22
- if (messages.length === 0)
23
- return "(nothing)";
24
- const day = dayFormatter(options);
25
- const paint = painter(options);
26
- let previous;
27
- const blocks = [];
28
- for (const message of messages) {
29
- const date = day(message.timestamp);
30
- if (date !== previous)
31
- blocks.push(paint("dim", `\u2500\u2500 ${date} \u2500\u2500`));
32
- previous = date;
33
- blocks.push(renderMessage(message, options));
34
- }
35
- return blocks.join("\n\n");
36
- }, "renderMessages");
37
- var renderMessage = /* @__PURE__ */ __name((message, options = {}) => {
38
- const paint = painter(options);
39
- const width = Math.max(MIN_WIDTH, options.width ?? 80);
40
- const room = width - INDENT.length;
41
- const time = timeFormatter(options);
42
- const verbosity = options.verbosity ?? 0;
43
- const chat = "chatTitle" in message ? paint("dim", ` \xB7 ${singleLine(message.chatTitle ?? message.chatId)}`) : "";
44
- const mark = "anchor" in message && message.anchor ? paint("bold", " \u25C0") : "";
45
- const lines = [`${paint("dim", time(message.timestamp))} ${senderOf(message, options)}${chat}${mark}`];
46
- const body = /* @__PURE__ */ __name((text) => wrapAnsi(visibleControls(text), room, { hard: true }).split("\n"), "body");
47
- const email = message.email;
48
- if (email)
49
- lines.push(paint("dim", mailLine(email)));
50
- if (message.replyTo)
51
- lines.push(paint("dim", preview("\u21B3", message.replyTo, room, options)));
52
- if (message.forwardedFrom) {
53
- lines.push(paint("dim", `\u21AA ${nameOf(message.forwardedFrom, options)}`));
54
- if (message.forwardedFrom.text)
55
- for (const line of body(message.forwardedFrom.text))
56
- lines.push(line);
57
- lines.push(...attachmentLines(message.forwardedFrom.attachments, paint, options));
58
- }
59
- if (message.text)
60
- for (const line of body(message.text))
61
- lines.push(line);
62
- lines.push(...attachmentLines(message.attachments, paint, options));
63
- if (message.reactions && message.reactions.total > 0)
64
- lines.push(paint("dim", reactionLine(message.reactions)));
65
- if (message.editedAt)
66
- lines.push(paint("dim", `edited ${editedAt(message, options)}`));
67
- if (verbosity >= 1) {
68
- const fields = [
69
- ["message", message.id],
70
- ["sender", message.senderId],
71
- ["chat", message.chatId],
72
- ["reply to", message.replyTo?.id ?? message.replyToId],
73
- ["thread", message.threadId],
74
- ["forward of", message.forwardedFrom?.id],
75
- ...message.attachments.map((a) => ["link", a.url])
76
- ];
77
- if (verbosity >= 2) {
78
- fields.push(["provider", options.provider], ["profile", options.profile], ["sent", message.timestamp], ["edited", message.editedAt], ["outgoing", message.outgoing === null ? "unknown" : String(message.outgoing)], ...message.attachments.map((a) => ["attachment", JSON.stringify(a)]), ["metadata", message.providerMetadata && JSON.stringify(message.providerMetadata)]);
79
- }
80
- const shown = fields.filter((field) => typeof field[1] === "string");
81
- const label = Math.max(...shown.map(([key]) => key.length));
82
- lines.push("", ...shown.map(([key, value]) => paint("dim", `${key.padEnd(label)} ${singleLine(value)}`)));
83
- }
84
- return lines.map((line, index) => index === 0 || line === "" ? line : `${INDENT}${line}`).join("\n");
85
- }, "renderMessage");
86
- var mailLine = /* @__PURE__ */ __name(({ to, cc, labels }) => {
87
- const names = /* @__PURE__ */ __name((people) => people.map(({ name, address }) => singleLine(name ?? address)).join(", "), "names");
88
- return [to.length ? `to ${names(to)}` : "", cc.length ? `cc ${names(cc)}` : "", labels.join(", ")].filter(Boolean).join(" \xB7 ");
89
- }, "mailLine");
90
- var painter = /* @__PURE__ */ __name(({ color = false }) => (style, text) => color ? styleText(style, text, { validateStream: false }) : text, "painter");
91
- var senderOf = /* @__PURE__ */ __name((message, options) => {
92
- const paint = painter(options);
93
- if (message.outgoing === true)
94
- return paint(["bold", "cyan"], you(options));
95
- const name = nameOf(message, options);
96
- if (!options.senderColors)
97
- return paint("bold", name);
98
- const colour = SENDER_COLOURS[hash(message.senderId ?? name) % SENDER_COLOURS.length] ?? "green";
99
- return paint(["bold", colour], name);
100
- }, "senderOf");
101
- var nameOf = /* @__PURE__ */ __name(({ senderName, senderId, outgoing }, options) => outgoing === true ? you(options) : singleLine(senderName ?? senderId ?? "unknown"), "nameOf");
102
- var DEFAULT_LOCALE = "ru-RU";
103
- var you = /* @__PURE__ */ __name(({ locale = DEFAULT_LOCALE }) => locale.startsWith("ru") ? "\u0432\u044B" : "you", "you");
104
- var hash = /* @__PURE__ */ __name((value) => [...value].reduce((sum, char) => sum * 31 + char.charCodeAt(0) >>> 0, 7), "hash");
105
- var preview = /* @__PURE__ */ __name((mark, quoted, room, options) => {
106
- const text = singleLine(quoted.text.split("\n")[0] ?? "") || (quoted.attachments[0] ? `\u{1F4CE} ${quoted.attachments[0].kind}` : "");
107
- const line = text ? `${mark} ${nameOf(quoted, options)}: ${text}` : `${mark} message ${quoted.id}`;
108
- if (stringWidth(line) <= room)
109
- return line;
110
- return `${wrapAnsi(line, room - 1, { hard: true }).split("\n")[0]}\u2026`;
111
- }, "preview");
112
- var attachmentLines = /* @__PURE__ */ __name((attachments, paint, options) => {
113
- const link = /* @__PURE__ */ __name((label, raw) => {
114
- if (raw === void 0)
115
- return label;
116
- const url = singleLine(raw);
117
- return options.color ? `\x1B]8;;${url}\x07${label}\x1B]8;;\x07` : `${label} ${url}`;
118
- }, "link");
119
- let number = 0;
120
- const keyboard = attachments.flatMap((attachment) => attachment.buttons ?? []).map((row) => paint("dim", row.map((button) => link(`[${++number} ${singleLine(button.text)}]`, button.url)).join(" ")));
121
- const polls = attachments.flatMap((attachment) => attachment.poll ? pollLines(attachment.poll) : []);
122
- const cards = attachments.flatMap(({ contact }) => contact ? [
123
- paint("dim", `\u{1F464} ${[contact.name, contact.phone].flatMap((part) => part ? [singleLine(part)] : []).join(" \xB7 ")}`)
124
- ] : []);
125
- const groups = /* @__PURE__ */ new Map();
126
- for (const attachment of attachments) {
127
- if (attachment.buttons || attachment.poll || attachment.contact)
128
- continue;
129
- const key = singleLine(attachment.name ?? attachment.title ?? attachment.kind);
130
- groups.set(key, [...groups.get(key) ?? [], attachment]);
131
- }
132
- const files = [...groups].map(([label, same]) => {
133
- const first = same[0];
134
- const size = first?.size === void 0 ? "" : ` \xB7 ${megabytes(first.size)}`;
135
- if (same.length === 1)
136
- return paint("dim", `\u{1F4CE} ${link(`${label}${size}`, first?.url)}`);
137
- const each = same.map((attachment, index) => link(String(index + 1), attachment.url)).join(" ");
138
- return paint("dim", `\u{1F4CE} ${label} \xD7${same.length} ${each}`);
139
- });
140
- return [...polls, ...cards, ...files, ...keyboard];
141
- }, "attachmentLines");
142
- var pollLines = /* @__PURE__ */ __name((poll) => {
143
- const kind = [
144
- poll.closed ? "closed" : "",
145
- poll.multiple ? "several answers" : "",
146
- poll.anonymous ? "anonymous" : "",
147
- poll.quiz ? "quiz" : ""
148
- ].filter(Boolean);
149
- const count = /* @__PURE__ */ __name((voters) => voters === null ? "?" : String(voters), "count");
150
- return [
151
- `\u{1F4CA} ${visibleControls(poll.question)}`,
152
- ...poll.answers.map((answer) => ` [${answer.id}] ${visibleControls(answer.text)} \u2014 ${count(answer.voters)}${answer.chosen ? " \u2713" : ""}`),
153
- ` ${[`${count(poll.voters)} voted`, ...kind].join(" \xB7 ")}`
154
- ];
155
- }, "pollLines");
156
- var megabytes = /* @__PURE__ */ __name((bytes) => bytes >= 1e6 ? `${Math.round(bytes / 1e6)} MB` : `${Math.max(1, Math.round(bytes / 1e3))} KB`, "megabytes");
157
- var parts = /* @__PURE__ */ __name((format, iso) => Object.fromEntries(format.formatToParts(new Date(iso)).map(({ type, value }) => [type, value])), "parts");
158
- var timeFormatter = /* @__PURE__ */ __name(({ timeZone }) => {
159
- const format = new Intl.DateTimeFormat("en-GB", {
160
- hour: "2-digit",
161
- minute: "2-digit",
162
- second: "2-digit",
163
- hourCycle: "h23",
164
- ...timeZone ? { timeZone } : {}
165
- });
166
- return (iso) => {
167
- const { hour, minute, second } = parts(format, iso);
168
- return `${hour}:${minute}:${second}`;
169
- };
170
- }, "timeFormatter");
171
- var dayFormatter = /* @__PURE__ */ __name(({ locale = DEFAULT_LOCALE, timeZone }) => {
172
- const format = new Intl.DateTimeFormat(locale, {
173
- day: "numeric",
174
- month: "long",
175
- year: "numeric",
176
- ...timeZone ? { timeZone } : {}
177
- });
178
- return (iso) => format.format(new Date(iso)).replace(/\s*г\.$/, "");
179
- }, "dayFormatter");
180
- var reactionLine = /* @__PURE__ */ __name(({ counts, mine }) => {
181
- const shown = counts.map(({ reaction, count }) => `${singleLine(reaction)} ${count}`).join(" ");
182
- return mine ? `${shown} (you: ${singleLine(mine)})` : shown;
183
- }, "reactionLine");
184
- var editedAt = /* @__PURE__ */ __name((message, options) => {
185
- const edited = message.editedAt ?? message.timestamp;
186
- const time = timeFormatter(options)(edited);
187
- const day = dayFormatter(options);
188
- return day(edited) === day(message.timestamp) ? time : `${day(edited)} ${time}`;
189
- }, "editedAt");
190
-
191
- export {
192
- renderMessages
193
- };
@@ -1,138 +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/tasks/model.js
11
- var TASK_KINDS = ["question", "request", "mention", "promise"];
12
- var TASK_STATES = ["open", "done", "dismissed"];
13
- var TASK_ORIGINS = ["rule", "agent", "owner"];
14
- var TASK_VERDICTS = ["useful", "not_useful"];
15
- function closeTask(task, state, by, at, reason) {
16
- if (task.state !== "open")
17
- throw new CliError("validation_error", `task ${task.id} is already ${task.state}`, { reason: "task.closed" });
18
- const { claimedBy: _by, claimedUntil: _until, ...unclaimed } = task;
19
- return { ...unclaimed, state, closedAt: at, closedBy: by, ...reason === void 0 ? {} : { reason } };
20
- }
21
- __name(closeTask, "closeTask");
22
-
23
- // 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/tasks/service.js
24
- function createTaskService({ store, now = /* @__PURE__ */ __name(() => /* @__PURE__ */ new Date(), "now"), newId = /* @__PURE__ */ __name(() => crypto.randomUUID(), "newId") }) {
25
- async function find(id) {
26
- const task = await store.get(id);
27
- if (!task)
28
- throw new CliError("not_found", `no task ${id}`);
29
- return task;
30
- }
31
- __name(find, "find");
32
- return {
33
- /**
34
- * A rule never makes a second task from a source it has seen, whatever that task's state, so a
35
- * dismissed one stays dismissed — nor from a message attached or merged into a task. A person or an agent may
36
- * add a task of another kind to it. A task a rule opens goes through the host's duplicate check.
37
- */
38
- async add(input) {
39
- const rule = input.origin === "rule";
40
- const existing = await store.findBySource(input.account, input.source, rule ? { linked: true } : void 0);
41
- const same = rule ? existing[0] : existing.find((task2) => task2.kind === input.kind);
42
- if (same)
43
- return { task: same, created: false };
44
- const task = { ...input, id: newId(), state: "open", createdAt: now() };
45
- await store.insert(task);
46
- if (!rule || !store.reviewDuplicates)
47
- return { task, created: true };
48
- return { task, created: true, review: await store.reviewDuplicates(task.id) };
49
- },
50
- async close(id, { as, by, reason }) {
51
- const task = closeTask(await find(id), as, by, now(), reason);
52
- await store.update(task);
53
- return task;
54
- },
55
- list: /* @__PURE__ */ __name((filter = {}) => store.list(filter), "list"),
56
- async stats(filter = {}) {
57
- const byGroup = /* @__PURE__ */ new Map();
58
- for (const task of await store.list(filter))
59
- byGroup.set(task.group, [...byGroup.get(task.group) ?? [], task]);
60
- return [...byGroup].map(([group, tasks]) => {
61
- const open = tasks.filter((task) => task.state === "open");
62
- const closeMs = tasks.flatMap((task) => task.closedAt ? [task.closedAt.getTime() - task.createdAt.getTime()] : []);
63
- const oldestOpenAt = open.map((task) => task.createdAt).sort((a, b) => a.getTime() - b.getTime())[0];
64
- return {
65
- group,
66
- open: open.length,
67
- ...oldestOpenAt ? { oldestOpenAt } : {},
68
- ...closeMs.length > 0 ? { medianCloseMs: median(closeMs) } : {}
69
- };
70
- });
71
- }
72
- };
73
- }
74
- __name(createTaskService, "createTaskService");
75
- function median(values) {
76
- const sorted = [...values].sort((a, b) => a - b);
77
- const middle = Math.floor(sorted.length / 2);
78
- const upper = sorted[middle] ?? 0;
79
- return sorted.length % 2 === 1 ? upper : ((sorted[middle - 1] ?? 0) + upper) / 2;
80
- }
81
- __name(median, "median");
82
-
83
- // 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/tasks/store.js
84
- function matches(task, filter) {
85
- return (filter.account === void 0 || task.account === filter.account) && (filter.state === void 0 || task.state === filter.state) && (filter.group === void 0 || task.group === filter.group) && (filter.kind === void 0 || task.kind === filter.kind) && (filter.createdBefore === void 0 || task.createdAt < filter.createdBefore);
86
- }
87
- __name(matches, "matches");
88
-
89
- // 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/knowledge.js
90
- var FACT_TYPES = ["fact", "statement", "question", "decision", "promise"];
91
- var FACT_STATUSES = ["proposed", "accepted", "superseded", "reversed", "rejected"];
92
- var MEMORY_KINDS = ["summary", "digest", "preference"];
93
- var MEMORY_STATUSES = ["proposed", "confirmed", "stale", "superseded"];
94
- var MEMORY_SCOPES = ["personal", "work"];
95
- var WORK_TASK_TYPES = ["bug", "feature", "chore"];
96
- var TASK_TYPES = [...WORK_TASK_TYPES, ...TASK_KINDS];
97
-
98
- // 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/store/sqlite/link-kinds.js
99
- var LINK_KINDS = [
100
- "links-to",
101
- "blocked-by",
102
- "follow-up-of",
103
- "about",
104
- "member-of",
105
- "labelled",
106
- "answered-by",
107
- "evidence",
108
- "created-from",
109
- "duplicate-of",
110
- "related-to",
111
- "assigned-to",
112
- "attached"
113
- ];
114
- var LINK_ORIGINS = ["file", "owner", "suggested", "message"];
115
- var LINK_SOURCES = [...LINK_ORIGINS, "calendar"];
116
- var RELATION_KINDS = ["member-of", "related-to"];
117
- var linkKind = /* @__PURE__ */ __name((kind) => `'${kind}'`, "linkKind");
118
-
119
- export {
120
- LINK_KINDS,
121
- LINK_ORIGINS,
122
- LINK_SOURCES,
123
- RELATION_KINDS,
124
- linkKind,
125
- TASK_KINDS,
126
- TASK_STATES,
127
- TASK_ORIGINS,
128
- TASK_VERDICTS,
129
- createTaskService,
130
- matches,
131
- FACT_TYPES,
132
- FACT_STATUSES,
133
- MEMORY_KINDS,
134
- MEMORY_STATUSES,
135
- MEMORY_SCOPES,
136
- WORK_TASK_TYPES,
137
- TASK_TYPES
138
- };