@wirecat/mail-cli 0.22.0 → 0.23.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/CHANGELOG.md +15 -0
  2. package/README.md +2 -1
  3. package/dist/bin/mail.js +2 -2
  4. package/dist/bundle/{all-profiles-DTUWUCQQ.js → all-profiles-CI32WFEV.js} +9 -9
  5. package/dist/bundle/{anthropic-YJAEQSNT.js → anthropic-ICSOMJIN.js} +9 -7
  6. package/dist/bundle/{app-server-3ZXSTBA3.js → app-server-3F4ZB7DH.js} +46 -46
  7. package/dist/bundle/{bun-34VBM7C5.js → bun-7AHNFZMZ.js} +2 -2
  8. package/dist/bundle/{bun-sqlite-GCT7ROCK.js → bun-sqlite-UIWRS4HI.js} +4 -4
  9. package/dist/bundle/{chunk-NOVBK4SY.js → chunk-2BAO4T4Z.js} +12 -12
  10. package/dist/bundle/{chunk-UWL2IOII.js → chunk-3QVGB2CI.js} +2 -2
  11. package/dist/bundle/{chunk-HN43G27G.js → chunk-4PNIZUEC.js} +45 -27
  12. package/dist/bundle/{chunk-LF5XM4HE.js → chunk-4TKQIXND.js} +1 -1
  13. package/dist/bundle/{chunk-HSBGNVEL.js → chunk-4YTX5YAU.js} +334 -185
  14. package/dist/bundle/{chunk-LTXYJAJK.js → chunk-5AQ4S4TZ.js} +24 -63
  15. package/dist/bundle/{chunk-ODFHIXMA.js → chunk-5AS5N7V5.js} +1 -1
  16. package/dist/bundle/{chunk-WBAA2X3E.js → chunk-5J4WNTTM.js} +11 -11
  17. package/dist/bundle/{chunk-GAPQENMY.js → chunk-5QQOUYNA.js} +22 -4
  18. package/dist/bundle/{chunk-RPCKBXKN.js → chunk-5Y2WRUYP.js} +2 -2
  19. package/dist/bundle/{chunk-AF62BPIW.js → chunk-5Z7LZAVP.js} +5 -5
  20. package/dist/bundle/{chunk-SYEICLTR.js → chunk-6FSLEARF.js} +1 -1
  21. package/dist/bundle/{chunk-QTMVGOSF.js → chunk-7DFWXIY5.js} +1336 -796
  22. package/dist/bundle/{chunk-J4UZXBEV.js → chunk-7OVVX4F4.js} +1 -1
  23. package/dist/bundle/{chunk-QE72KTS7.js → chunk-7SIWMF77.js} +1 -1
  24. package/dist/bundle/{chunk-J2U6LUT5.js → chunk-7ZDH2XEY.js} +3 -3
  25. package/dist/bundle/{chunk-SFC46MP2.js → chunk-AFPETMXZ.js} +10 -10
  26. package/dist/bundle/{chunk-Z7N4MGOQ.js → chunk-AHRHP2H2.js} +5 -5
  27. package/dist/bundle/{chunk-HJ2CXDKJ.js → chunk-B4MWHI2V.js} +12 -12
  28. package/dist/bundle/{chunk-HRRSTIGP.js → chunk-B6GITVDX.js} +10 -6
  29. package/dist/bundle/{chunk-3DSYLE5N.js → chunk-BT7UUI6E.js} +2 -2
  30. package/dist/bundle/{chunk-72N26BQM.js → chunk-CNYQ3TTZ.js} +88 -88
  31. package/dist/bundle/{chunk-RFB27ACZ.js → chunk-D6WTKSRA.js} +2 -2
  32. package/dist/bundle/{chunk-4FWJNIPH.js → chunk-ELGEHZK2.js} +1 -1
  33. package/dist/bundle/{chunk-3HDQVTND.js → chunk-ETIUB2DF.js} +5 -5
  34. package/dist/bundle/{chunk-VDUGE6TH.js → chunk-FHCOGR7S.js} +2 -2
  35. package/dist/bundle/{chunk-VQZCIDSO.js → chunk-FIZWQTUC.js} +3 -3
  36. package/dist/bundle/{chunk-KMQAHDBM.js → chunk-FVKZ55I2.js} +860 -420
  37. package/dist/bundle/{chunk-BHNBWFT5.js → chunk-GOMJNH56.js} +44 -0
  38. package/dist/bundle/{chunk-FTI73RLC.js → chunk-HGV7DSSA.js} +2 -2
  39. package/dist/bundle/{chunk-RY7PBP4F.js → chunk-HN6PB7F5.js} +16 -16
  40. package/dist/bundle/{chunk-R3WPMQYZ.js → chunk-HRIYU2HJ.js} +245 -387
  41. package/dist/bundle/{chunk-ZKLXSVIO.js → chunk-I3YNNSGB.js} +1 -1
  42. package/dist/bundle/{chunk-MDDB7M7Z.js → chunk-IMIY7HQB.js} +1 -1
  43. package/dist/bundle/{chunk-2PPEDB67.js → chunk-JDKC7EXM.js} +30 -30
  44. package/dist/bundle/{chunk-T3DTYJTG.js → chunk-JO4BJYVE.js} +1 -1
  45. package/dist/bundle/{chunk-O3M2S62X.js → chunk-KJQZXCNK.js} +3 -3
  46. package/dist/bundle/{chunk-25PD6FZY.js → chunk-KNRONMVG.js} +2 -2
  47. package/dist/bundle/{chunk-BMV56JCL.js → chunk-LLYVBO3R.js} +1 -1
  48. package/dist/bundle/{chunk-TCCN5TON.js → chunk-NEDYKKJJ.js} +24 -2
  49. package/dist/bundle/{chunk-OKO2Q6H6.js → chunk-NKDYHAHP.js} +2 -2
  50. package/dist/bundle/{chunk-P2QJA7S5.js → chunk-OMW37FXK.js} +1 -1
  51. package/dist/bundle/{chunk-P6FT6YYT.js → chunk-R4RAWEMV.js} +16 -16
  52. package/dist/bundle/{chunk-V6OIIVH3.js → chunk-RIAZTS6C.js} +11 -11
  53. package/dist/bundle/{chunk-7XLOWYGD.js → chunk-S2U5BXWS.js} +19 -4
  54. package/dist/bundle/{chunk-566MEXK5.js → chunk-SCH3NC5X.js} +3 -3
  55. package/dist/bundle/{chunk-Z75WYAX6.js → chunk-SETCGPFG.js} +7 -7
  56. package/dist/bundle/{chunk-4WIEVQ2Q.js → chunk-SGMENSI6.js} +127 -9
  57. package/dist/bundle/{chunk-I2SDXWLR.js → chunk-TEL2OMS5.js} +97 -54
  58. package/dist/bundle/{chunk-SCIC2CJS.js → chunk-UA4BOLIY.js} +4 -4
  59. package/dist/bundle/{chunk-VINSQR4X.js → chunk-UTLJQG6Q.js} +7 -7
  60. package/dist/bundle/{chunk-ZZSHGCRC.js → chunk-WQRX4RQS.js} +4 -4
  61. package/dist/bundle/{chunk-MD64ITYO.js → chunk-XP5FBDIG.js} +1 -1
  62. package/dist/bundle/{chunk-RT6SLZBI.js → chunk-XV3M3NAN.js} +1 -1
  63. package/dist/bundle/{chunk-B74SOC4R.js → chunk-ZYHBMDNU.js} +8 -8
  64. package/dist/bundle/command-contract-UIRWJVEY.js +35 -0
  65. package/dist/bundle/{decode-BIOOL5E4.js → decode-BJXABRAN.js} +4 -4
  66. package/dist/bundle/{dispatch-R5OF2FVZ.js → dispatch-G4CYFWQ2.js} +1 -1
  67. package/dist/bundle/{dist-TJVIRLE5.js → dist-LLEA6R4V.js} +36 -22
  68. package/dist/bundle/{echarts-ECPGMKXO.js → echarts-YPTKBOZV.js} +2 -2
  69. package/dist/bundle/{embed-F7JFSLHN.js → embed-DMROTI5M.js} +5 -5
  70. package/dist/bundle/{embedder-U4G74HV3.js → embedder-DWMHXCHJ.js} +8 -8
  71. package/dist/bundle/{failure-WYKVF6RH.js → failure-FFPK2WYB.js} +1 -1
  72. package/dist/bundle/{first-run-JTYPUYQP.js → first-run-FQOEF2IO.js} +8 -8
  73. package/dist/bundle/first-screen-B6LF5464.js +33 -0
  74. package/dist/bundle/{instructions-WNCGZ7OJ.js → instructions-OGKMROLD.js} +1 -1
  75. package/dist/bundle/mail.js +5 -5
  76. package/dist/bundle/{node-UIRGGMGT.js → node-HIKYE546.js} +2 -2
  77. package/dist/bundle/{node-sqlite-4ZM7OPRF.js → node-sqlite-3GJAG7VO.js} +5 -5
  78. package/dist/bundle/{oauth-5RAJZPBW.js → oauth-H3DB6IHI.js} +6 -6
  79. package/dist/bundle/{open-7ORCHOAI.js → open-DJ2PRG74.js} +4 -4
  80. package/dist/bundle/{openai-XSJNXJA7.js → openai-MDBRYB55.js} +12 -12
  81. package/dist/bundle/{process-ZLO72UVZ.js → process-4LBD72JH.js} +1 -1
  82. package/dist/bundle/{program-MXGQFQJG.js → program-F6WK6RX4.js} +3699 -2437
  83. package/dist/bundle/{prompt-IDUPCUGM.js → prompt-UNPUG6SO.js} +6 -4
  84. package/dist/bundle/{recognize-OS3EZKIM.js → recognize-DMIO4PDB.js} +3 -3
  85. package/dist/bundle/{remote-PF4LZR65.js → remote-24HJA72D.js} +6 -6
  86. package/dist/bundle/{rerank-CQNZF3JI.js → rerank-PTNCHHIU.js} +6 -6
  87. package/dist/bundle/{serve-Y2DDLGBT.js → serve-T6JHM2YD.js} +8 -8
  88. package/dist/bundle/{server-TVRT7YEY.js → server-BWEYRUR3.js} +36 -36
  89. package/dist/bundle/server-VUQNR5ZD.js +65 -0
  90. package/dist/bundle/{sqlite-runtime-5343C3OE.js → sqlite-runtime-ZJ4EH5ZM.js} +5 -5
  91. package/dist/bundle/{state-4GBTMPIV.js → state-KSN4OFYW.js} +5 -5
  92. package/dist/bundle/{store-OLBLTQPT.js → store-GVBW2ZFK.js} +24 -16
  93. package/dist/bundle/{store-QA6QJ5BB.js → store-OIEZJEA7.js} +31 -14
  94. package/dist/bundle/store-maintenance-command-KJ54HLUQ.js +54 -0
  95. package/dist/commands/account-remove.d.ts +3 -0
  96. package/dist/commands/account-remove.d.ts.map +1 -0
  97. package/dist/commands/account-remove.js +65 -0
  98. package/dist/commands/account-remove.js.map +1 -0
  99. package/dist/commands/account.d.ts.map +1 -1
  100. package/dist/commands/account.js +3 -1
  101. package/dist/commands/account.js.map +1 -1
  102. package/dist/commands/context.d.ts +3 -1
  103. package/dist/commands/context.d.ts.map +1 -1
  104. package/dist/commands/context.js.map +1 -1
  105. package/dist/mail/changes.d.ts +1 -0
  106. package/dist/mail/changes.d.ts.map +1 -1
  107. package/dist/mail/changes.js +1 -1
  108. package/dist/mail/changes.js.map +1 -1
  109. package/dist/providers.js +2 -2
  110. package/dist/providers.js.map +1 -1
  111. package/dist/version.d.ts +1 -1
  112. package/dist/version.js +1 -1
  113. package/package.json +2 -2
  114. package/dist/bundle/chunk-QPRXTLMD.js +0 -33
  115. package/dist/bundle/command-contract-Y4ZQAJEC.js +0 -35
  116. package/dist/bundle/first-screen-W6RWTAU7.js +0 -33
  117. package/dist/bundle/server-I3IALQMC.js +0 -65
  118. package/dist/bundle/store-maintenance-command-LB6CMGP4.js +0 -55
@@ -4,7 +4,7 @@ import {
4
4
  commandPathOf,
5
5
  findCommand,
6
6
  outputOf
7
- } from "./chunk-ZZSHGCRC.js";
7
+ } from "./chunk-WQRX4RQS.js";
8
8
  import {
9
9
  wrapAnsi
10
10
  } from "./chunk-HTQTIKWP.js";
@@ -18,10 +18,10 @@ import {
18
18
  environmentOf,
19
19
  metaOf,
20
20
  takesProfile
21
- } from "./chunk-HSBGNVEL.js";
21
+ } from "./chunk-4YTX5YAU.js";
22
22
  import {
23
23
  writes
24
- } from "./chunk-BHNBWFT5.js";
24
+ } from "./chunk-GOMJNH56.js";
25
25
  import {
26
26
  CliError
27
27
  } from "./chunk-DALBYUPC.js";
@@ -29,7 +29,7 @@ import {
29
29
  __name
30
30
  } from "./chunk-ZVVMGPBJ.js";
31
31
 
32
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_2045f8d992dff370989171c93240f8d7/node_modules/@wirecat/cli-core/dist/cli/help/sections.js
32
+ // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_af5f2db22f61976c09fb28de9c7dc33e/node_modules/@wirecat/cli-core/dist/cli/help/sections.js
33
33
  var SECTIONS = {
34
34
  read: "Read",
35
35
  write: "Write",
@@ -90,7 +90,7 @@ var CORE_SECTIONS = {
90
90
  upgrade: "setup"
91
91
  };
92
92
 
93
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_2045f8d992dff370989171c93240f8d7/node_modules/@wirecat/cli-core/dist/cli/help/commands-text.js
93
+ // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_af5f2db22f61976c09fb28de9c7dc33e/node_modules/@wirecat/cli-core/dist/cli/help/commands-text.js
94
94
  var DESCRIPTION = 90;
95
95
  var COLUMN = 52;
96
96
  var short = /* @__PURE__ */ __name((text) => {
@@ -129,7 +129,7 @@ var commandsText = /* @__PURE__ */ __name((root, commands, scope) => {
129
129
  `;
130
130
  }, "commandsText");
131
131
 
132
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_2045f8d992dff370989171c93240f8d7/node_modules/@wirecat/cli-core/dist/cli/help/command-help.js
132
+ // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_af5f2db22f61976c09fb28de9c7dc33e/node_modules/@wirecat/cli-core/dist/cli/help/command-help.js
133
133
  var ARGUMENT_KINDS = {
134
134
  chat: "chat",
135
135
  chats: "chat",
@@ -321,7 +321,7 @@ var installCommandHelp = /* @__PURE__ */ __name((program, { profile = true } = {
321
321
  command.addHelpText("after", () => commandHelpText(command));
322
322
  }, "installCommandHelp");
323
323
 
324
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_2045f8d992dff370989171c93240f8d7/node_modules/@wirecat/cli-core/dist/cli/help/first-screen.js
324
+ // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_af5f2db22f61976c09fb28de9c7dc33e/node_modules/@wirecat/cli-core/dist/cli/help/first-screen.js
325
325
  var WIRECAT_TOOLS = [
326
326
  {
327
327
  command: "tg",
@@ -2,13 +2,16 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  validateFormattedText
5
- } from "./chunk-SFC46MP2.js";
5
+ } from "./chunk-AFPETMXZ.js";
6
6
  import {
7
7
  inputPolicy
8
- } from "./chunk-MDDB7M7Z.js";
8
+ } from "./chunk-IMIY7HQB.js";
9
+ import {
10
+ parseReference
11
+ } from "./chunk-5AQ4S4TZ.js";
9
12
  import {
10
13
  indent
11
- } from "./chunk-BMV56JCL.js";
14
+ } from "./chunk-LLYVBO3R.js";
12
15
  import {
13
16
  CliError
14
17
  } from "./chunk-DALBYUPC.js";
@@ -16,12 +19,120 @@ import {
16
19
  __name
17
20
  } from "./chunk-ZVVMGPBJ.js";
18
21
 
19
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_2045f8d992dff370989171c93240f8d7/node_modules/@wirecat/cli-core/dist/domain/checks.js
22
+ // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_af5f2db22f61976c09fb28de9c7dc33e/node_modules/@wirecat/cli-core/dist/domain/checks.js
20
23
  var spelled = /* @__PURE__ */ __name((check, args) => `${check.replaceAll(".", " ")}${args === void 0 ? "" : ` ${args}`}`, "spelled");
21
24
  var bareCheck = /* @__PURE__ */ __name((check, args) => `\`${spelled(check, args)}\``, "bareCheck");
22
25
  var checkWords = /* @__PURE__ */ __name((command, profile) => (check, args) => `\`${command} ${profile === void 0 ? "" : `${profile} `}${spelled(check, args)}\``, "checkWords");
23
26
 
24
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_2045f8d992dff370989171c93240f8d7/node_modules/@wirecat/cli-core/dist/domain/markdown.js
27
+ // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_af5f2db22f61976c09fb28de9c7dc33e/node_modules/@wirecat/cli-core/dist/domain/links.js
28
+ var LINK_VERSION = "v1";
29
+ var DEFAULT_LINK_CONFIG = { base: "https://wirecat.dev/o", enabled: true };
30
+ var APP_PREFIX = "wirecat://open";
31
+ var MAX_PATH = 512;
32
+ var MAX_SEGMENTS = 6;
33
+ var TASK_FILTERS = ["overdue", "today", "tomorrow"];
34
+ var DATE = /^\d{4}-\d{2}-\d{2}$/;
35
+ var DATE_TIME = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:\d{2})$/;
36
+ var isMoment = /* @__PURE__ */ __name((text, pattern) => pattern.test(text) && !Number.isNaN(Date.parse(text)), "isMoment");
37
+ var partsOf = /* @__PURE__ */ __name((target) => {
38
+ switch (target.type) {
39
+ case "message":
40
+ return ["msg", target.provider, target.account, target.chat, target.message];
41
+ case "chat":
42
+ return ["chat", target.provider, target.account, target.chat];
43
+ case "task":
44
+ return ["task", target.id];
45
+ case "tasks":
46
+ return target.filter === "new" ? ["tasks", "new", target.since] : ["tasks", target.filter];
47
+ case "proposal":
48
+ return ["proposal", target.id];
49
+ case "digest":
50
+ return ["digest", target.date];
51
+ case "sync":
52
+ return target.account === void 0 ? ["sync", target.tool] : ["sync", target.tool, target.account];
53
+ }
54
+ }, "partsOf");
55
+ var pathOf = /* @__PURE__ */ __name((target) => partsOf(target).map(encodeURIComponent).join("/"), "pathOf");
56
+ var targetOfParts = /* @__PURE__ */ __name((parts) => {
57
+ const [kind, ...rest] = parts;
58
+ const [a = "", b = "", c = "", d = ""] = rest;
59
+ switch (kind) {
60
+ case "msg":
61
+ return rest.length === 4 ? { type: "message", provider: a, account: b, chat: c, message: d } : null;
62
+ case "chat":
63
+ return rest.length === 3 ? { type: "chat", provider: a, account: b, chat: c } : null;
64
+ case "task":
65
+ return rest.length === 1 ? { type: "task", id: a } : null;
66
+ case "tasks":
67
+ if (rest.length === 1 && TASK_FILTERS.includes(a))
68
+ return { type: "tasks", filter: a };
69
+ return rest.length === 2 && a === "new" && (isMoment(b, DATE) || isMoment(b, DATE_TIME)) ? { type: "tasks", filter: "new", since: b } : null;
70
+ case "proposal":
71
+ return rest.length === 1 ? { type: "proposal", id: a } : null;
72
+ case "digest":
73
+ return rest.length === 1 && isMoment(a, DATE) ? { type: "digest", date: a } : null;
74
+ case "sync":
75
+ return rest.length === 1 || rest.length === 2 ? { type: "sync", tool: a, ...rest.length === 2 ? { account: b } : {} } : null;
76
+ default:
77
+ return null;
78
+ }
79
+ }, "targetOfParts");
80
+ var targetOfPath = /* @__PURE__ */ __name((path) => {
81
+ const raw = path.split("/");
82
+ if (raw.some((part) => part === ""))
83
+ return null;
84
+ try {
85
+ return targetOfParts(raw.map(decodeURIComponent));
86
+ } catch {
87
+ return null;
88
+ }
89
+ }, "targetOfPath");
90
+ var formatLink = /* @__PURE__ */ __name((target) => `/${LINK_VERSION}/${pathOf(target)}`, "formatLink");
91
+ var parseLink = /* @__PURE__ */ __name((text) => {
92
+ const link = text.trim();
93
+ const path = link.startsWith(`${APP_PREFIX}/`) ? link.slice(APP_PREFIX.length) : link.startsWith("https://") && link.includes("#") ? link.slice(link.indexOf("#") + 1) : link;
94
+ if (path.length > MAX_PATH || !path.startsWith(`/${LINK_VERSION}/`))
95
+ return null;
96
+ const rest = path.split("?")[0].slice(LINK_VERSION.length + 2);
97
+ if (rest.split("/").length + 1 > MAX_SEGMENTS)
98
+ return null;
99
+ return targetOfPath(rest);
100
+ }, "parseLink");
101
+ var LINK_ONLY = /* @__PURE__ */ new Set(["tasks", "proposal", "digest", "sync"]);
102
+ var FROM_REFERENCE = /* @__PURE__ */ new Set(["message", "chat", "task"]);
103
+ var linkTargetOf = /* @__PURE__ */ __name((ref) => {
104
+ const text = ref.trim();
105
+ const colon = text.indexOf(":");
106
+ if (colon < 0)
107
+ return null;
108
+ const kind = text.slice(0, colon);
109
+ if (LINK_ONLY.has(kind))
110
+ return targetOfPath(`${kind}/${text.slice(colon + 1)}`);
111
+ try {
112
+ const reference = parseReference(text);
113
+ return FROM_REFERENCE.has(reference.type) ? reference : null;
114
+ } catch {
115
+ return null;
116
+ }
117
+ }, "linkTargetOf");
118
+ var linkConfigOf = /* @__PURE__ */ __name((section) => {
119
+ const value = section && typeof section === "object" ? section : {};
120
+ const base = typeof value.base === "string" && /^https:\/\/[^\s#?]+$/.test(value.base) ? value.base.replace(/\/+$/, "") : DEFAULT_LINK_CONFIG.base;
121
+ return { base, enabled: typeof value.enabled === "boolean" ? value.enabled : DEFAULT_LINK_CONFIG.enabled };
122
+ }, "linkConfigOf");
123
+ var linkFor = /* @__PURE__ */ __name((ref, { form, config = DEFAULT_LINK_CONFIG, env = process.env }) => {
124
+ if (!config.enabled || env.WIRECAT_LINKS === "off")
125
+ return null;
126
+ const target = typeof ref === "string" ? linkTargetOf(ref) : ref;
127
+ if (target === null)
128
+ return null;
129
+ const path = formatLink(target);
130
+ if (path.length > MAX_PATH || parseLink(path) === null)
131
+ return null;
132
+ return form === "app" ? `${APP_PREFIX}${path}` : `${config.base}#${path}`;
133
+ }, "linkFor");
134
+
135
+ // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_af5f2db22f61976c09fb28de9c7dc33e/node_modules/@wirecat/cli-core/dist/domain/markdown.js
25
136
  var MARKERS = [
26
137
  ["**", "bold"],
27
138
  ["~~", "strike"],
@@ -67,7 +178,7 @@ var closing = /* @__PURE__ */ __name((input, open, marker) => {
67
178
  return end;
68
179
  }, "closing");
69
180
 
70
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_2045f8d992dff370989171c93240f8d7/node_modules/@wirecat/cli-core/dist/domain/markdown-spans.js
181
+ // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_af5f2db22f61976c09fb28de9c7dc33e/node_modules/@wirecat/cli-core/dist/domain/markdown-spans.js
71
182
  var STYLES = [
72
183
  ["**", "bold"],
73
184
  ["__", "underline"],
@@ -227,7 +338,7 @@ var parseMarkdownSpans = /* @__PURE__ */ __name((input) => {
227
338
  return validateFormattedText(result);
228
339
  }, "parseMarkdownSpans");
229
340
 
230
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_2045f8d992dff370989171c93240f8d7/node_modules/@wirecat/cli-core/dist/domain/polls.js
341
+ // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_af5f2db22f61976c09fb28de9c7dc33e/node_modules/@wirecat/cli-core/dist/domain/polls.js
231
342
  var countedPoll = /* @__PURE__ */ __name((poll, votes, self) => {
232
343
  const cast = votes.filter((vote) => vote.answers.length > 0);
233
344
  const mine = self === null ? void 0 : votes.find((vote) => vote.person.id === self);
@@ -1876,7 +1987,7 @@ var createDataURL = /* @__PURE__ */ __name(function(width, height, getPixel) {
1876
1987
  var qrcode_default = qrcode;
1877
1988
  var stringToBytes = qrcode.stringToBytes;
1878
1989
 
1879
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_2045f8d992dff370989171c93240f8d7/node_modules/@wirecat/cli-core/dist/terminal/qr.js
1990
+ // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_af5f2db22f61976c09fb28de9c7dc33e/node_modules/@wirecat/cli-core/dist/terminal/qr.js
1880
1991
  var QUIET_ZONE = 4;
1881
1992
  var BLACK_ON_WHITE = "\x1B[30;107m";
1882
1993
  var RESET = "\x1B[0m";
@@ -1923,7 +2034,7 @@ var plainQr = /* @__PURE__ */ __name((link) => {
1923
2034
  return lines.join("\n");
1924
2035
  }, "plainQr");
1925
2036
 
1926
- // node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_2045f8d992dff370989171c93240f8d7/node_modules/@wirecat/cli-core/dist/terminal/login-qr.js
2037
+ // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_af5f2db22f61976c09fb28de9c7dc33e/node_modules/@wirecat/cli-core/dist/terminal/login-qr.js
1927
2038
  var MARGIN = 2;
1928
2039
  var atTerminal = /* @__PURE__ */ __name((input) => input.isTTY === true && !inputPolicy(input).noInput, "atTerminal");
1929
2040
  var PASTE_QR = "agents: paste the QR code above into the chat as a code block, exactly as printed; when a new one is printed, paste it and say the old one expired";
@@ -1959,6 +2070,13 @@ ${indent(drawn.text, pad + MARGIN)}`);
1959
2070
  }), "loginQr");
1960
2071
 
1961
2072
  export {
2073
+ LINK_VERSION,
2074
+ DEFAULT_LINK_CONFIG,
2075
+ formatLink,
2076
+ parseLink,
2077
+ linkTargetOf,
2078
+ linkConfigOf,
2079
+ linkFor,
1962
2080
  bareCheck,
1963
2081
  checkWords,
1964
2082
  parseMarkdown,