@wirecat/notion-cli 0.7.0 → 0.8.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 (243) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +20 -3
  3. package/contracts/wirecat.json +238 -2
  4. package/dist/bin/notion.js +2 -2
  5. package/dist/bundle/agent-FDS2ENXJ.js +42 -0
  6. package/dist/bundle/{all-profiles-CKOACXTW.js → all-profiles-MIGUJ6UM.js} +11 -11
  7. package/dist/bundle/{anthropic-DWBBVTU3.js → anthropic-ZTYBZ7PI.js} +5 -5
  8. package/dist/bundle/{app-server-BHFYNCDE.js → app-server-MGXJZOJ2.js} +72 -72
  9. package/dist/bundle/{bun-ICK2XT7J.js → bun-NS5YLOQT.js} +2 -2
  10. package/dist/bundle/{bun-sqlite-LU5V5Y4A.js → bun-sqlite-EKMD3TXK.js} +6 -6
  11. package/dist/bundle/{chunk-UYEDQGMI.js → chunk-2BPQNFA5.js} +6 -6
  12. package/dist/bundle/{chunk-5NFIUY2P.js → chunk-2Q5ATPA6.js} +4 -4
  13. package/dist/bundle/{chunk-NCCRLAAI.js → chunk-2T76TPDD.js} +3 -3
  14. package/dist/bundle/{chunk-OCGNOJYD.js → chunk-2TVHFJKV.js} +1 -1
  15. package/dist/bundle/{chunk-ITWINZ6R.js → chunk-2XWVZDOM.js} +12 -12
  16. package/dist/bundle/{chunk-IEY7KS6Q.js → chunk-43PCMVTZ.js} +1 -1
  17. package/dist/bundle/{chunk-KWBLDSRV.js → chunk-53UXHJEO.js} +3 -3
  18. package/dist/bundle/{chunk-EMIJVLOA.js → chunk-5KL3PQWI.js} +2 -2
  19. package/dist/bundle/{chunk-SRVTGI3M.js → chunk-5QCPDJLB.js} +2 -2
  20. package/dist/bundle/{chunk-MB4HXDBT.js → chunk-64KVWK5N.js} +5 -5
  21. package/dist/bundle/{chunk-ITW26OBI.js → chunk-66M7VFIM.js} +38 -38
  22. package/dist/bundle/{chunk-QK52ARAU.js → chunk-6BOEXO72.js} +3 -3
  23. package/dist/bundle/{chunk-ZMKAI3F3.js → chunk-6P7HUUR5.js} +3 -3
  24. package/dist/bundle/{chunk-LBRTLZHI.js → chunk-77727OQH.js} +197 -155
  25. package/dist/bundle/{chunk-BXXHUO7Y.js → chunk-7KNBZOLH.js} +13 -13
  26. package/dist/bundle/{chunk-EUF5JNPG.js → chunk-7YPZPJTB.js} +1 -1
  27. package/dist/bundle/{chunk-TWY543BS.js → chunk-A5PL2GYK.js} +1 -1
  28. package/dist/bundle/{chunk-6MQSBWWF.js → chunk-AG34MPVN.js} +1 -1
  29. package/dist/bundle/{chunk-46JBCXLI.js → chunk-BCO37YUH.js} +327 -6
  30. package/dist/bundle/{chunk-7COTHS6G.js → chunk-COF6KS7A.js} +6 -6
  31. package/dist/bundle/{chunk-VXKD533R.js → chunk-CWTTCFDX.js} +995 -610
  32. package/dist/bundle/{chunk-3T3OAYL4.js → chunk-D2IVASIC.js} +2 -2
  33. package/dist/bundle/{chunk-PDVXG3T3.js → chunk-D3G375NT.js} +6 -6
  34. package/dist/bundle/{chunk-3ZSUVFR7.js → chunk-DGZNVYKK.js} +8 -8
  35. package/dist/bundle/{chunk-FHYV4VWY.js → chunk-DLEAVO2T.js} +7 -7
  36. package/dist/bundle/{chunk-UQVUXG7H.js → chunk-DW6YAEMZ.js} +10 -10
  37. package/dist/bundle/{chunk-LEPPRULN.js → chunk-E4FNVLTR.js} +23 -4
  38. package/dist/bundle/{chunk-VRBEYOJL.js → chunk-E5EYJU5R.js} +1 -1
  39. package/dist/bundle/{chunk-A3RJ6FD5.js → chunk-E5XATHAF.js} +8 -8
  40. package/dist/bundle/{chunk-63SW4UXG.js → chunk-EXHTGQR2.js} +1 -1
  41. package/dist/bundle/{chunk-FO3XY2Y2.js → chunk-EZAVBR47.js} +2 -2
  42. package/dist/bundle/{chunk-NV7NNL5T.js → chunk-F7DHR4OO.js} +7 -7
  43. package/dist/bundle/{chunk-4FHKSSXQ.js → chunk-FGWQHNKK.js} +2 -2
  44. package/dist/bundle/{chunk-B6DJQBZI.js → chunk-FSWLPNJT.js} +5 -5
  45. package/dist/bundle/{chunk-364ET7LV.js → chunk-GFI3UUIU.js} +1 -1
  46. package/dist/bundle/{chunk-2OZVCNU5.js → chunk-GGNVBN2S.js} +2 -2
  47. package/dist/bundle/{chunk-X737FHZP.js → chunk-GPFE4SS7.js} +4 -4
  48. package/dist/bundle/{chunk-OW5HW3TD.js → chunk-H76WEF2L.js} +6 -6
  49. package/dist/bundle/{chunk-RNVYNPXT.js → chunk-HPS2YGSZ.js} +1 -1
  50. package/dist/bundle/{chunk-S5P7THM5.js → chunk-HZ5LRWKH.js} +2 -2
  51. package/dist/bundle/{chunk-ZGUUP2T3.js → chunk-I5OAVMOI.js} +12 -12
  52. package/dist/bundle/{chunk-OALFRUMI.js → chunk-I62MWK5L.js} +14 -2
  53. package/dist/bundle/{chunk-3AKMIKND.js → chunk-IBFCD6TR.js} +17 -17
  54. package/dist/bundle/{chunk-HJDQTM3T.js → chunk-IL3UYHCR.js} +8 -8
  55. package/dist/bundle/{chunk-HSVKU4OJ.js → chunk-J4CXJJJU.js} +116 -30
  56. package/dist/bundle/{chunk-R4JV3VLU.js → chunk-JRZEXLRQ.js} +13 -12
  57. package/dist/bundle/{chunk-ALAPDLCP.js → chunk-KDPV6YBX.js} +2 -2
  58. package/dist/bundle/{chunk-BFCRGLOF.js → chunk-KHEISFJO.js} +3 -3
  59. package/dist/bundle/{chunk-FNESLLZS.js → chunk-KI6OOW6D.js} +8 -1
  60. package/dist/bundle/{chunk-3DGHBXH2.js → chunk-KPBUJQKT.js} +1 -1
  61. package/dist/bundle/{chunk-OP2BH55P.js → chunk-LEO5GWPD.js} +3 -3
  62. package/dist/bundle/{chunk-N3NJPHZB.js → chunk-LKUWH6KU.js} +1 -1
  63. package/dist/bundle/{chunk-JPGN473W.js → chunk-LYJDZILD.js} +3 -3
  64. package/dist/bundle/{chunk-JVRBW5LH.js → chunk-M27SMKNH.js} +5 -5
  65. package/dist/bundle/{chunk-YSF5JBRA.js → chunk-MA6U4XH2.js} +1 -1
  66. package/dist/bundle/{chunk-64IK7JFO.js → chunk-MC3LAGIW.js} +2 -2
  67. package/dist/bundle/{chunk-J3DZVB67.js → chunk-MGC2BAD2.js} +1 -1
  68. package/dist/bundle/{chunk-S35UJBFZ.js → chunk-MLXDGBH4.js} +19 -19
  69. package/dist/bundle/{chunk-IYZWHCZJ.js → chunk-NQA2STEE.js} +35 -14
  70. package/dist/bundle/{chunk-2RNJ2JP3.js → chunk-NSBTYJRP.js} +4 -4
  71. package/dist/bundle/{chunk-REOBWSGV.js → chunk-NSQN4F7H.js} +8 -8
  72. package/dist/bundle/{chunk-WUNEJRLJ.js → chunk-NVXMWAEV.js} +6 -6
  73. package/dist/bundle/{chunk-UO4O6WQ4.js → chunk-OZAP4FEG.js} +8 -8
  74. package/dist/bundle/{chunk-OFMCU3BH.js → chunk-OZZ5PTHG.js} +5 -5
  75. package/dist/bundle/{chunk-BQ6CXCLP.js → chunk-P4ADIGTL.js} +8 -8
  76. package/dist/bundle/{chunk-KBY42GKW.js → chunk-PVTW7ZOY.js} +23 -23
  77. package/dist/bundle/{chunk-PSMRUOII.js → chunk-Q5PNS2K2.js} +3 -3
  78. package/dist/bundle/{chunk-LVAFTQ45.js → chunk-QQP54EEZ.js} +29 -178
  79. package/dist/bundle/{chunk-3YXYA6HB.js → chunk-RM4DO2WZ.js} +1 -1
  80. package/dist/bundle/{chunk-JEZJFQQW.js → chunk-S3SLDYTU.js} +1 -1
  81. package/dist/bundle/{chunk-RXGX2CZX.js → chunk-S5NFSVNK.js} +63 -63
  82. package/dist/bundle/{chunk-EWXMIKZN.js → chunk-UE7ST7JC.js} +30 -30
  83. package/dist/bundle/{chunk-6UZ5D2WP.js → chunk-ULTKZLJV.js} +7 -7
  84. package/dist/bundle/{chunk-WJFQMOVM.js → chunk-VJ5EF4C7.js} +61 -61
  85. package/dist/bundle/{chunk-OS4WPXPZ.js → chunk-WBVZVP4T.js} +4 -4
  86. package/dist/bundle/{chunk-QMNEDK7Z.js → chunk-WDL3QYN2.js} +3 -3
  87. package/dist/bundle/{chunk-HOO53OYK.js → chunk-WPNY2J2X.js} +16 -16
  88. package/dist/bundle/{chunk-BFHPT67P.js → chunk-XRA2V4MM.js} +1556 -620
  89. package/dist/bundle/{chunk-3KOJNZH3.js → chunk-Y6KPZOOD.js} +3 -3
  90. package/dist/bundle/{chunk-ADCAWRRX.js → chunk-YAYVXHMO.js} +48 -48
  91. package/dist/bundle/{chunk-DCSPCOPB.js → chunk-YG2FFC2R.js} +9 -9
  92. package/dist/bundle/{chunk-X5LUHN62.js → chunk-YOZHKJEN.js} +2 -2
  93. package/dist/bundle/{chunk-VYZ2J7DT.js → chunk-ZKD3TL3O.js} +4 -4
  94. package/dist/bundle/command-contract-ZGBZCKZP.js +41 -0
  95. package/dist/bundle/{command-server-entry-F3B2KSPO.js → command-server-entry-ZXB7VUIG.js} +29 -29
  96. package/dist/bundle/{decode-FDHFF7GC.js → decode-BGLAM2YP.js} +5 -5
  97. package/dist/bundle/{dispatch-IXKG5Z5Y.js → dispatch-A3WIRXBM.js} +8 -8
  98. package/dist/bundle/{echarts-PGJPVPA4.js → echarts-ISH62J4E.js} +2 -2
  99. package/dist/bundle/{embed-U6X7CNNK.js → embed-POZWSFKL.js} +6 -6
  100. package/dist/bundle/{embedder-3ROL6ROQ.js → embedder-7DIUHQOQ.js} +9 -9
  101. package/dist/bundle/{failure-IYMRXM2X.js → failure-BBT3B4UY.js} +2 -2
  102. package/dist/bundle/{first-run-PNVNHGR7.js → first-run-SLMRAWYB.js} +12 -12
  103. package/dist/bundle/first-screen-CCLGBTQ2.js +41 -0
  104. package/dist/bundle/{instructions-MJQWRI2D.js → instructions-G5ZGHVFB.js} +1 -1
  105. package/dist/bundle/{mcp-JNHOSK4L.js → mcp-MQ2L5IIM.js} +2 -2
  106. package/dist/bundle/meeting-combined-P56K6BUT.js +25 -0
  107. package/dist/bundle/meeting-model-UY4ABXAZ.js +27 -0
  108. package/dist/bundle/{meeting-semantic-7WPLMBNT.js → meeting-semantic-VPMFO4FB.js} +6 -6
  109. package/dist/bundle/{node-3UXNV3CD.js → node-NLJINXVQ.js} +2 -2
  110. package/dist/bundle/{node-sqlite-ULWDWM3I.js → node-sqlite-LPV27ECD.js} +7 -7
  111. package/dist/bundle/notes-search-TKP34WJZ.js +64 -0
  112. package/dist/bundle/notion.js +13 -13
  113. package/dist/bundle/{oauth-LNUZMA72.js → oauth-SC4HSJ7X.js} +7 -7
  114. package/dist/bundle/{open-HGHC35M4.js → open-K2JIOWCG.js} +5 -5
  115. package/dist/bundle/{openai-ISSP57MV.js → openai-MCKQLBZM.js} +18 -18
  116. package/dist/bundle/{process-PB2WCOR2.js → process-LPVAYRO7.js} +1 -1
  117. package/dist/bundle/{program-GASBJRMG.js → program-QXA6YXUO.js} +11176 -8685
  118. package/dist/bundle/{prompt-3VGQVX2B.js → prompt-XWESMSOG.js} +5 -5
  119. package/dist/bundle/{recognize-7Q2P3NME.js → recognize-TDE6PPXV.js} +4 -4
  120. package/dist/bundle/{remote-BBAWKVIT.js → remote-OAGPQQVE.js} +11 -11
  121. package/dist/bundle/{rerank-H4PUS4HV.js → rerank-375AKI4E.js} +7 -7
  122. package/dist/bundle/{schemas-TTVUADHT.js → schemas-ZE62D6CG.js} +1 -1
  123. package/dist/bundle/{serve-FZNSKY7R.js → serve-YWCHKQEP.js} +9 -9
  124. package/dist/bundle/{server-BRRNDW6L.js → server-C4SH5PRK.js} +64 -64
  125. package/dist/bundle/server-SYGVF5BJ.js +90 -0
  126. package/dist/bundle/{services-PEU557KZ.js → services-5Z2P4D2K.js} +51 -51
  127. package/dist/bundle/{sqlite-runtime-4IZJ4YUM.js → sqlite-runtime-KLELNUHI.js} +6 -6
  128. package/dist/bundle/{state-MX3JVT5Q.js → state-OWEBLXCG.js} +6 -6
  129. package/dist/bundle/{store-JUT34REM.js → store-F63SKKV7.js} +27 -23
  130. package/dist/bundle/{store-PP4BPADZ.js → store-IVJXGAX7.js} +21 -21
  131. package/dist/bundle/store-maintenance-command-YBMOO7XH.js +77 -0
  132. package/dist/bundle/surface-G3ITURGS.js +76 -0
  133. package/dist/commands/comments.d.ts +1 -1
  134. package/dist/commands/comments.d.ts.map +1 -1
  135. package/dist/commands/comments.js +33 -2
  136. package/dist/commands/comments.js.map +1 -1
  137. package/dist/commands/databases.d.ts.map +1 -1
  138. package/dist/commands/databases.js +3 -2
  139. package/dist/commands/databases.js.map +1 -1
  140. package/dist/commands/documents.d.ts +13 -2
  141. package/dist/commands/documents.d.ts.map +1 -1
  142. package/dist/commands/documents.js +291 -23
  143. package/dist/commands/documents.js.map +1 -1
  144. package/dist/commands/library.d.ts.map +1 -1
  145. package/dist/commands/library.js +12 -4
  146. package/dist/commands/library.js.map +1 -1
  147. package/dist/commands/meetings.d.ts +7 -0
  148. package/dist/commands/meetings.d.ts.map +1 -0
  149. package/dist/commands/meetings.js +136 -0
  150. package/dist/commands/meetings.js.map +1 -0
  151. package/dist/commands/rows.d.ts +4 -0
  152. package/dist/commands/rows.d.ts.map +1 -0
  153. package/dist/commands/rows.js +51 -0
  154. package/dist/commands/rows.js.map +1 -0
  155. package/dist/commands/writing.d.ts +2 -1
  156. package/dist/commands/writing.d.ts.map +1 -1
  157. package/dist/commands/writing.js +2 -2
  158. package/dist/commands/writing.js.map +1 -1
  159. package/dist/config.d.ts.map +1 -1
  160. package/dist/config.js +12 -2
  161. package/dist/config.js.map +1 -1
  162. package/dist/context.d.ts +2 -0
  163. package/dist/context.d.ts.map +1 -1
  164. package/dist/context.js +2 -0
  165. package/dist/context.js.map +1 -1
  166. package/dist/generated/wirecat-config.d.ts.map +1 -1
  167. package/dist/generated/wirecat-config.js +8 -0
  168. package/dist/generated/wirecat-config.js.map +1 -1
  169. package/dist/knowledge.d.ts +18 -1
  170. package/dist/knowledge.d.ts.map +1 -1
  171. package/dist/library.d.ts +4 -0
  172. package/dist/library.d.ts.map +1 -1
  173. package/dist/library.js +11 -1
  174. package/dist/library.js.map +1 -1
  175. package/dist/notion/errors.d.ts.map +1 -1
  176. package/dist/notion/errors.js +19 -0
  177. package/dist/notion/errors.js.map +1 -1
  178. package/dist/notion/meeting-notes.d.ts +10 -0
  179. package/dist/notion/meeting-notes.d.ts.map +1 -0
  180. package/dist/notion/meeting-notes.js +196 -0
  181. package/dist/notion/meeting-notes.js.map +1 -0
  182. package/dist/notion/notion.d.ts +46 -0
  183. package/dist/notion/notion.d.ts.map +1 -1
  184. package/dist/notion/notion.js +105 -14
  185. package/dist/notion/notion.js.map +1 -1
  186. package/dist/notion/page-target.d.ts +30 -0
  187. package/dist/notion/page-target.d.ts.map +1 -0
  188. package/dist/notion/page-target.js +73 -0
  189. package/dist/notion/page-target.js.map +1 -0
  190. package/dist/notion/port.d.ts.map +1 -1
  191. package/dist/notion/port.js +2 -0
  192. package/dist/notion/port.js.map +1 -1
  193. package/dist/notion/properties.d.ts +55 -0
  194. package/dist/notion/properties.d.ts.map +1 -0
  195. package/dist/notion/properties.js +280 -0
  196. package/dist/notion/properties.js.map +1 -0
  197. package/dist/notion/reads.d.ts +19 -1
  198. package/dist/notion/reads.d.ts.map +1 -1
  199. package/dist/notion/reads.js +2 -1
  200. package/dist/notion/reads.js.map +1 -1
  201. package/dist/notion/rows.d.ts +14 -0
  202. package/dist/notion/rows.d.ts.map +1 -0
  203. package/dist/notion/rows.js +119 -0
  204. package/dist/notion/rows.js.map +1 -0
  205. package/dist/notion/writes.d.ts +99 -0
  206. package/dist/notion/writes.d.ts.map +1 -1
  207. package/dist/notion/writes.js +278 -67
  208. package/dist/notion/writes.js.map +1 -1
  209. package/dist/program.d.ts.map +1 -1
  210. package/dist/program.js +7 -1
  211. package/dist/program.js.map +1 -1
  212. package/dist/sync/comments.d.ts +12 -0
  213. package/dist/sync/comments.d.ts.map +1 -0
  214. package/dist/sync/comments.js +47 -0
  215. package/dist/sync/comments.js.map +1 -0
  216. package/dist/sync/files.d.ts +7 -1
  217. package/dist/sync/files.d.ts.map +1 -1
  218. package/dist/sync/files.js.map +1 -1
  219. package/dist/sync/from-config.d.ts.map +1 -1
  220. package/dist/sync/from-config.js +5 -4
  221. package/dist/sync/from-config.js.map +1 -1
  222. package/dist/sync/source.d.ts.map +1 -1
  223. package/dist/sync/source.js +21 -9
  224. package/dist/sync/source.js.map +1 -1
  225. package/dist/version.d.ts +1 -1
  226. package/dist/version.js +1 -1
  227. package/package.json +3 -3
  228. package/skills/notion-cli/SKILL.md +29 -3
  229. package/dist/bundle/agent-AILW4JPO.js +0 -42
  230. package/dist/bundle/command-contract-C2CF4QAH.js +0 -41
  231. package/dist/bundle/first-screen-DEDD64YH.js +0 -41
  232. package/dist/bundle/meeting-combined-HEC25QPY.js +0 -25
  233. package/dist/bundle/meeting-model-R7QPDNZZ.js +0 -27
  234. package/dist/bundle/notes-search-7PE3E3C7.js +0 -64
  235. package/dist/bundle/server-CQJ4LKAZ.js +0 -90
  236. package/dist/bundle/store-maintenance-command-GRFTJBSB.js +0 -77
  237. package/dist/bundle/surface-FPWES3NY.js +0 -76
  238. package/dist/bundle/{hast-util-from-html-X2DCPS3T.js → hast-util-from-html-237ZT4C7.js} +3 -3
  239. package/dist/bundle/{hast-util-to-mdast-3CSMIWK2.js → hast-util-to-mdast-H5COQ6HJ.js} +6 -6
  240. package/dist/bundle/{mdast-util-gfm-JO7PHUIB.js → mdast-util-gfm-M3K5BNY2.js} +16 -16
  241. package/dist/bundle/{mdast-util-to-hast-AYJV7KAE.js → mdast-util-to-hast-TSB5MAAV.js} +1 -1
  242. package/dist/bundle/{mdast-util-to-markdown-DOXGHRI7.js → mdast-util-to-markdown-SG6455IT.js} +10 -10
  243. package/dist/bundle/{micromark-extension-gfm-PQ7DWZM7.js → micromark-extension-gfm-7SUOOQ3A.js} +3 -3
@@ -3,14 +3,14 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  isCliFailure,
5
5
  isStoreDamage
6
- } from "./chunk-S5P7THM5.js";
6
+ } from "./chunk-HZ5LRWKH.js";
7
7
  import {
8
8
  refuseOwnerStoreInTests
9
- } from "./chunk-X5LUHN62.js";
9
+ } from "./chunk-YOZHKJEN.js";
10
10
  import {
11
11
  isoTime,
12
12
  reference
13
- } from "./chunk-A3RJ6FD5.js";
13
+ } from "./chunk-E5XATHAF.js";
14
14
  import {
15
15
  array,
16
16
  boolean,
@@ -31,15 +31,15 @@ import {
31
31
  } from "./chunk-S4UUN6LD.js";
32
32
  import {
33
33
  CliError
34
- } from "./chunk-4FHKSSXQ.js";
34
+ } from "./chunk-FGWQHNKK.js";
35
35
  import {
36
36
  __name
37
37
  } from "./chunk-ZVVMGPBJ.js";
38
38
 
39
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/categories.js
39
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/categories.js
40
40
  var CATEGORIES = ["client", "supplier", "partner", "employer"];
41
41
 
42
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/tasks/model.js
42
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/tasks/model.js
43
43
  var TASK_KINDS = ["question", "request", "mention", "promise"];
44
44
  var TASK_STATES = ["open", "todo", "in_progress", "done", "dismissed"];
45
45
  var CLOSED_STATES = ["done", "dismissed"];
@@ -54,7 +54,7 @@ function closeTask(task, state, by, at, reason) {
54
54
  }
55
55
  __name(closeTask, "closeTask");
56
56
 
57
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/tasks/priority.js
57
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/tasks/priority.js
58
58
  var PRIORITY_LABELS = ["low", "medium", "high", "critical"];
59
59
  var MIDDLE = { low: 0.125, medium: 0.375, high: 0.625, critical: 0.875 };
60
60
  var LEGACY_PRIORITY_SCORES = [0.875, 0.625, 0.375, 0.1875, 0.0625];
@@ -83,7 +83,7 @@ var priorityOf = /* @__PURE__ */ __name((value) => {
83
83
  }, "priorityOf");
84
84
  var priorityOption = /* @__PURE__ */ __name((value) => priorityOf(value) ?? "none", "priorityOption");
85
85
 
86
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/tasks/service.js
86
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/tasks/service.js
87
87
  function createTaskService({ store, now = /* @__PURE__ */ __name(() => /* @__PURE__ */ new Date(), "now"), newId = /* @__PURE__ */ __name(() => crypto.randomUUID(), "newId") }) {
88
88
  async function find(id2) {
89
89
  const task = await store.get(id2);
@@ -143,20 +143,20 @@ function median(values) {
143
143
  }
144
144
  __name(median, "median");
145
145
 
146
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/tasks/store.js
146
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/tasks/store.js
147
147
  function matches(task, filter) {
148
148
  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);
149
149
  }
150
150
  __name(matches, "matches");
151
151
 
152
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/source-review.js
152
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/source-review.js
153
153
  var SOURCE_REVIEW_KIND = "memory_source_review";
154
154
  var SOURCE_REVIEW_CAUSES = ["changed", "outdated", "deleted", "contradicted"];
155
155
  var ERASED_TEXT = "[source erased]";
156
156
  var severity = /* @__PURE__ */ __name((cause) => SOURCE_REVIEW_CAUSES.indexOf(cause), "severity");
157
157
  var graver = /* @__PURE__ */ __name((a, b) => severity(b) > severity(a) ? b : a, "graver");
158
158
 
159
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/entities/fields.js
159
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/entities/fields.js
160
160
  var text = string();
161
161
  var id = pipe(string(), minLength(1));
162
162
  var time = isoTime;
@@ -181,7 +181,7 @@ var author = strictObject({
181
181
  name: nullable(text)
182
182
  });
183
183
 
184
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/entities/knowledge-lists.js
184
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/entities/knowledge-lists.js
185
185
  var organization = strictObject({
186
186
  id,
187
187
  ref: reference,
@@ -211,7 +211,7 @@ var reminder = strictObject({
211
211
  receipt: nullable(text)
212
212
  });
213
213
 
214
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/marks.js
214
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/marks.js
215
215
  import { readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
216
216
  var damageMarkPath = /* @__PURE__ */ __name((store) => `${store}.damaged.json`, "damageMarkPath");
217
217
  var healthMarkPath = /* @__PURE__ */ __name((store) => `${store}.health.json`, "healthMarkPath");
@@ -332,7 +332,7 @@ var recordDeepCheck = /* @__PURE__ */ __name((store, health, { cli, version, sch
332
332
  return { previous, cleared };
333
333
  }, "recordDeepCheck");
334
334
 
335
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/money.js
335
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/money.js
336
336
  var CURRENCY_SCALES = {
337
337
  AED: 2,
338
338
  AMD: 2,
@@ -426,7 +426,7 @@ var quantityOf = /* @__PURE__ */ __name((text2) => {
426
426
  }, "quantityOf");
427
427
  var lineUnits = /* @__PURE__ */ __name((thousandths, unitPrice) => Number((thousandths * BigInt(unitPrice) + 500n) / 1000n), "lineUnits");
428
428
 
429
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/finance.js
429
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/finance.js
430
430
  var INVOICE_DIRECTIONS = ["receivable", "payable"];
431
431
  var INVOICE_STATUSES = ["draft", "issued", "partly_paid", "paid", "void"];
432
432
  var MONEY_DIRECTIONS = ["in", "out"];
@@ -455,7 +455,7 @@ var paymentLine = /* @__PURE__ */ __name((payment) => {
455
455
  var invoiceTitle = /* @__PURE__ */ __name((invoice) => `Invoice ${invoiceLine(invoice)}`, "invoiceTitle");
456
456
  var paymentEntryTitle = /* @__PURE__ */ __name((payment) => `Payment \xB7 ${paymentLine(payment)}`, "paymentEntryTitle");
457
457
 
458
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/business.js
458
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/business.js
459
459
  var CATALOG_KINDS = ["product", "service"];
460
460
  var BUSINESS_KINDS = ["invoice", "payment", "order", "contract", "subscription", "product", "wallet"];
461
461
  var CONTRACT_KINDS = ["sale", "purchase", "service", "lease", "employment", "nda", "license", "other"];
@@ -483,7 +483,7 @@ var subscriptionLine = /* @__PURE__ */ __name((subscription) => `${subscription.
483
483
  var walletLine = /* @__PURE__ */ __name((wallet) => `${wallet.name} \xB7 ${wallet.kind}, ${wallet.currency}${wallet.numberHint === null ? "" : `, \u2026${wallet.numberHint}`}` + notes(wallet.closed ? "closed" : null), "walletLine");
484
484
  var transactionLine = /* @__PURE__ */ __name((transaction) => `${moneyLabel(transaction.amount, transaction.currency)} ${transaction.direction}${transaction.label === null ? "" : ` \xB7 ${transaction.label}`}, ${dayMonth(transaction.date)}` + notes(transaction.status === "pending" ? "pending" : null, pending(transaction.review)), "transactionLine");
485
485
 
486
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/knowledge.js
486
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/knowledge.js
487
487
  var FACT_STATUSES = ["proposed", "accepted", "superseded", "reversed", "rejected"];
488
488
  var MEMORY_KINDS = ["summary", "digest", "preference"];
489
489
  var MEMORY_STATUSES = ["proposed", "confirmed", "stale", "superseded"];
@@ -491,7 +491,7 @@ var MEMORY_SCOPES = ["personal", "work"];
491
491
  var WORK_TASK_TYPES = ["bug", "feature", "chore"];
492
492
  var TASK_TYPES = [...WORK_TASK_TYPES, ...TASK_KINDS];
493
493
 
494
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/deals.js
494
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/deals.js
495
495
  var DEAL_KINDS = ["deal", "lead"];
496
496
  var DEAL_STATUSES = ["open", "won", "lost"];
497
497
  var STAGE_OUTCOMES = DEAL_STATUSES;
@@ -501,7 +501,7 @@ var dealLine = /* @__PURE__ */ __name((deal) => {
501
501
  return `${deal.title} \xB7 ${deal.stage}${money}${deal.status === "open" ? "" : ` (${deal.status})`}`;
502
502
  }, "dealLine");
503
503
 
504
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/orders.js
504
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/orders.js
505
505
  var ORDER_STATUSES = ["placed", "shipped", "delivered", "cancelled", "returned"];
506
506
  var ORDER_PURPOSES = ["personal", "business", "client", "other"];
507
507
  var orderLine = /* @__PURE__ */ __name((order) => {
@@ -512,7 +512,7 @@ var orderLine = /* @__PURE__ */ __name((order) => {
512
512
  }, "orderLine");
513
513
  var orderTitle = /* @__PURE__ */ __name((order) => `Order ${orderLine(order)}`, "orderTitle");
514
514
 
515
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/relations.js
515
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/relations.js
516
516
  var ORGANIZATION_ROLES = [
517
517
  "employee",
518
518
  "contractor",
@@ -615,7 +615,7 @@ var KEYED = "kind IN ('member-of', 'related-to', 'reports-to', 'customer-of', 'p
615
615
  var notOverriddenSql = /* @__PURE__ */ __name((alias) => `NOT EXISTS (SELECT 1 FROM links override WHERE ${KEYED} AND override.kind = ${alias}.kind AND override.from_type = ${alias}.from_type AND override.from_id = ${alias}.from_id AND override.to_type = ${alias}.to_type AND override.to_id = ${alias}.to_id AND json_extract(override.metadata, '$.overrides') = ${alias}.id)`, "notOverriddenSql");
616
616
  var usableLinkSql = /* @__PURE__ */ __name((alias, now) => `(${alias}.confirmed = 1 OR (${alias}.account_id IS NOT NULL AND ${alias}.deleted_at IS NULL))` + (now === void 0 ? "" : ` AND (${alias}.ends_at IS NULL OR ${alias}.ends_at > ${Math.trunc(now)})`), "usableLinkSql");
617
617
 
618
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/crm.js
618
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/crm.js
619
619
  var CRM_KINDS = ["organization", "person", "deal", "lead"];
620
620
  var CRM_ACTIVITY_KINDS = ["call", "email", "meeting", "todo", "task", "comment", "other"];
621
621
  var isCrmUserId = /* @__PURE__ */ __name((id2) => /^\d{1,20}$/.test(id2), "isCrmUserId");
@@ -625,7 +625,7 @@ var normalCrmUserId = /* @__PURE__ */ __name((id2) => {
625
625
  }, "normalCrmUserId");
626
626
  var isItemKind = /* @__PURE__ */ __name((kind) => kind === "deal" || kind === "lead", "isItemKind");
627
627
 
628
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/link-source.js
628
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/link-source.js
629
629
  var REPORTER_SQL = "(SELECT provider || ':' || external_id FROM accounts r WHERE r.id = links.account_id) AS reporter";
630
630
  var sourceOf = /* @__PURE__ */ __name((database, row, metadata) => {
631
631
  const reporter = row.account_id == null ? void 0 : "reporter" in row ? row.reporter : database.prepare("SELECT provider || ':' || external_id AS key FROM accounts WHERE id = ?").get(Number(row.account_id))?.key;
@@ -635,7 +635,7 @@ var sourceOf = /* @__PURE__ */ __name((database, row, metadata) => {
635
635
  };
636
636
  }, "sourceOf");
637
637
 
638
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/link-kinds.js
638
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/link-kinds.js
639
639
  var LINK_KINDS = [
640
640
  "links-to",
641
641
  "blocked-by",
@@ -3,14 +3,14 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  executableEnvironment,
5
5
  executableOnPath
6
- } from "./chunk-OCGNOJYD.js";
6
+ } from "./chunk-2TVHFJKV.js";
7
7
  import {
8
8
  require_cross_spawn
9
9
  } from "./chunk-D72URWJE.js";
10
10
  import {
11
11
  loadConfigFile,
12
12
  saveConfigFile
13
- } from "./chunk-S35UJBFZ.js";
13
+ } from "./chunk-MLXDGBH4.js";
14
14
  import {
15
15
  number,
16
16
  object,
@@ -22,7 +22,7 @@ import {
22
22
  __toESM
23
23
  } from "./chunk-ZVVMGPBJ.js";
24
24
 
25
- // node_modules/.pnpm/@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/update/index.js
25
+ // node_modules/.pnpm/@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/update/index.js
26
26
  var import_cross_spawn = __toESM(require_cross_spawn(), 1);
27
27
  import { existsSync } from "node:fs";
28
28
  var updateCommand = /* @__PURE__ */ __name((installer, packageName) => {
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  refuseLacking
5
- } from "./chunk-OALFRUMI.js";
5
+ } from "./chunk-I62MWK5L.js";
6
6
  import {
7
7
  DEFAULT_PACE,
8
8
  FloodMemory,
@@ -14,214 +14,72 @@ import {
14
14
  holdEnd,
15
15
  pacePathFor,
16
16
  recipientsPathFor,
17
+ refuseUnknownPermissionKeys,
17
18
  servicesFor,
19
+ terminalAsker,
18
20
  waitForTurn
19
- } from "./chunk-BFHPT67P.js";
21
+ } from "./chunk-XRA2V4MM.js";
20
22
  import {
21
- AUTHORITY_KEY,
22
23
  CEILING_KEY,
23
- DEFAULT_PERMISSIONS,
24
- KEYED_UNDER_HOUSEKEEPING,
25
- WRITE_KEYS,
26
24
  asFirstWord,
27
25
  baseContext,
28
26
  environmentOf,
29
27
  fetchesUnder,
30
- issueMessage,
31
- keyForCommand,
32
28
  levelFor,
33
29
  limitBatch,
34
- permissionIssues,
35
- publicIssue,
36
30
  readKeysForCommand,
37
31
  recalledAccount,
38
32
  rememberAccount,
39
- rootOf2 as rootOf,
40
- skipFlagFor
41
- } from "./chunk-LBRTLZHI.js";
33
+ rootOf2 as rootOf
34
+ } from "./chunk-77727OQH.js";
42
35
  import {
43
36
  providerErrorKey
44
- } from "./chunk-BQ6CXCLP.js";
37
+ } from "./chunk-P4ADIGTL.js";
45
38
  import {
46
39
  OFFLINE,
47
40
  chatIdIn,
48
41
  profilesOnAccount
49
- } from "./chunk-ADCAWRRX.js";
42
+ } from "./chunk-YAYVXHMO.js";
50
43
  import {
51
44
  capability,
52
45
  throughWrapper
53
- } from "./chunk-EMIJVLOA.js";
46
+ } from "./chunk-5KL3PQWI.js";
54
47
  import {
55
48
  codeOf,
56
49
  currentOperation
57
- } from "./chunk-3ZSUVFR7.js";
50
+ } from "./chunk-DGZNVYKK.js";
58
51
  import {
59
52
  servingProfiles
60
- } from "./chunk-KWBLDSRV.js";
53
+ } from "./chunk-53UXHJEO.js";
61
54
  import {
62
55
  openStore
63
- } from "./chunk-VXKD533R.js";
56
+ } from "./chunk-CWTTCFDX.js";
64
57
  import {
65
58
  chatReferenceOf,
66
59
  ensureAccount,
67
60
  foldName,
68
61
  isId,
69
62
  pickPerson
70
- } from "./chunk-UQVUXG7H.js";
63
+ } from "./chunk-DW6YAEMZ.js";
71
64
  import {
72
65
  isCliFailure
73
- } from "./chunk-S5P7THM5.js";
66
+ } from "./chunk-HZ5LRWKH.js";
74
67
  import {
75
68
  CliError
76
- } from "./chunk-4FHKSSXQ.js";
69
+ } from "./chunk-FGWQHNKK.js";
77
70
  import {
78
71
  __name
79
72
  } from "./chunk-ZVVMGPBJ.js";
80
73
 
81
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/cli/messenger/ask.js
82
- import { openSync } from "node:fs";
83
- import { createInterface } from "node:readline";
84
- import { ReadStream } from "node:tty";
85
- var fromTerminal = /* @__PURE__ */ __name(async (question) => {
86
- if (!process.stdin.isTTY || !process.stderr.isTTY)
87
- return null;
88
- let input;
89
- try {
90
- input = new ReadStream(openSync("/dev/tty", "r"));
91
- } catch {
92
- return null;
93
- }
94
- const reader = createInterface({ input, output: process.stderr, terminal: true });
95
- try {
96
- return await new Promise((resolve, reject) => {
97
- const cancel = /* @__PURE__ */ __name(() => reject(new CliError("cancelled", "cancelled \u2014 nothing was done")), "cancel");
98
- reader.once("SIGINT", cancel);
99
- reader.once("close", cancel);
100
- reader.question(question, resolve);
101
- });
102
- } finally {
103
- reader.close();
104
- input.destroy();
105
- }
106
- }, "fromTerminal");
107
- var what = /* @__PURE__ */ __name((key, { chatId, count, personIds, forEveryone }) => [
108
- key,
109
- forEveryone ? "for everyone" : void 0,
110
- count !== void 0 ? `${count} ${count === 1 ? "item" : "items"}` : void 0,
111
- personIds?.length ? `${personIds.length} ${personIds.length === 1 ? "person" : "people"}` : void 0,
112
- chatId !== null ? `in chat ${chatId}` : void 0
113
- ].filter(Boolean).join(", "), "what");
114
- var answerOf = /* @__PURE__ */ __name(async (command, question) => {
115
- const given = command.optsWithGlobals();
116
- if (given.json === true || given.jsonl === true)
117
- return null;
118
- return (environmentOf(command).answer ?? fromTerminal)(question);
119
- }, "answerOf");
120
- var terminalAsker = /* @__PURE__ */ __name((command) => async (key, request) => {
121
- if (environmentOf(command).agent)
122
- return;
123
- const flag = skipFlagFor(key);
124
- const given = command.optsWithGlobals();
125
- if (flag === "--yes" ? given.yes === true : given.allowDangerous === true)
126
- return;
127
- const machine = given.json === true || given.jsonl === true;
128
- const answer = machine ? null : await (environmentOf(command).answer ?? fromTerminal)(`${what(key, request)} \u2014 go ahead? [y/N] `);
129
- if (answer === null) {
130
- throw new CliError("confirmation_required", `${key} asks before it acts (its permission level is ask), and nobody is at a terminal to answer \u2014 add ${flag} to go ahead`, { permission: key });
131
- }
132
- if (!/^\s*y(es)?\s*$/i.test(answer))
133
- throw new CliError("cancelled", `${key}: not done \u2014 the answer was no`);
134
- }, "terminalAsker");
135
-
136
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/cli/permission-keys.js
137
- var HOUSEKEEPING = /* @__PURE__ */ new Set([
138
- "help",
139
- "guide",
140
- "config",
141
- "session",
142
- "doctor",
143
- "commands",
144
- "complete",
145
- "upgrade",
146
- "skill",
147
- "mcp",
148
- "runs"
149
- ]);
150
- var commandPathKey = /* @__PURE__ */ __name((path) => path[0] === void 0 || HOUSEKEEPING.has(path[0]) && !KEYED_UNDER_HOUSEKEEPING.has(path.join(".")) ? null : path.join("."), "commandPathKey");
151
- var commandPermissions = /* @__PURE__ */ __name(({ keyOf = commandPathKey, extra = [], defaults = {}, alsoChecks } = {}) => ({
152
- keyOf,
153
- extra: [AUTHORITY_KEY, ...extra],
154
- defaults: { ...DEFAULT_PERMISSIONS, ...defaults },
155
- ...alsoChecks ? { alsoChecks } : {}
156
- }), "commandPermissions");
157
- var pathOf = /* @__PURE__ */ __name((command) => {
158
- const words = [];
159
- for (let at = command; at?.parent; at = at.parent)
160
- words.unshift(at.name());
161
- return words;
162
- }, "pathOf");
163
- var rootOf2 = /* @__PURE__ */ __name((command) => {
164
- let at = command;
165
- while (at.parent)
166
- at = at.parent;
167
- return at;
168
- }, "rootOf");
169
- var everyCommand = /* @__PURE__ */ __name((command) => [command, ...command.commands.flatMap(everyCommand)], "everyCommand");
170
- var knownPermissionKeys = /* @__PURE__ */ __name((command, keyOf = (one) => keyForCommand(pathOf(one)), extra = []) => {
171
- const known = /* @__PURE__ */ new Set();
172
- const add = /* @__PURE__ */ __name((key) => {
173
- for (let parts = key.split("."); parts.length > 0; parts = parts.slice(0, -1))
174
- known.add(parts.join("."));
175
- }, "add");
176
- if (typeof keyOf !== "function") {
177
- for (const one of everyCommand(rootOf2(command))) {
178
- const key = keyOf.keyOf(pathOf(one));
179
- if (key)
180
- add(key);
181
- }
182
- for (const key of [...keyOf.extra, ...extra])
183
- add(key);
184
- return known;
185
- }
186
- for (const one of everyCommand(rootOf2(command))) {
187
- const own = keyOf(one);
188
- const key = own === void 0 ? keyForCommand(pathOf(one)) : own;
189
- if (key)
190
- add(key);
191
- }
192
- for (const key of [...WRITE_KEYS, ...extra])
193
- add(key);
194
- return known;
195
- }, "knownPermissionKeys");
196
- var knownBeside = /* @__PURE__ */ __name((key, known) => {
197
- const parent = key.split(".").slice(0, -1).join(".");
198
- const depth = parent === "" ? 1 : parent.split(".").length + 1;
199
- return [...known].filter((one) => one.split(".").length === depth && (parent === "" || one.startsWith(`${parent}.`))).sort();
200
- }, "knownBeside");
201
- var unknownPermissionKeys = /* @__PURE__ */ __name((levels, known) => Object.keys(levels).filter((key) => key !== CEILING_KEY && !known.has(key)), "unknownPermissionKeys");
202
- var unknownPermissionIssues = /* @__PURE__ */ __name((command, settings, tool, keyOf) => {
203
- const saved = settings.savedPermissions ?? Object.keys(settings.permissions).filter((key) => key !== CEILING_KEY && settings.permissionSources[key] !== "flag").map((key) => ({ key, at: ["profiles", settings.profile, "permissions", key] }));
204
- return permissionIssues(saved, knownPermissionKeys(command, keyOf), { file: settings.configPath, tool }).map(publicIssue);
205
- }, "unknownPermissionIssues");
206
- var refuseUnknownPermissionKeys = /* @__PURE__ */ __name((command, settings, tool, keyOf) => {
207
- const issues = unknownPermissionIssues(command, settings, tool, keyOf);
208
- if (issues.length > 0)
209
- throw new CliError("configuration_error", issueMessage(issues), { permission: issues[0]?.key });
210
- const flagged = Object.keys(settings.permissions).filter((key2) => settings.permissionSources[key2] === "flag");
211
- const [key] = unknownPermissionKeys(Object.fromEntries(flagged.map((one) => [one, true])), knownPermissionKeys(command, keyOf));
212
- if (key !== void 0)
213
- throw new CliError("validation_error", `--permission ${key} names no command`, { permission: key });
214
- }, "refuseUnknownPermissionKeys");
215
-
216
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/cli/messenger/flooded.js
74
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/cli/messenger/flooded.js
217
75
  var LONG_LIVED = /* @__PURE__ */ new Set(["self", "newSendId", "close", "formatMarkdown", "formatHtml", "storedChats"]);
218
76
  var LISTENING = /* @__PURE__ */ new Set(["watch", "feed", "listen", "listenHistory"]);
219
77
  var BLOCKING = /* @__PURE__ */ new Set(["frozen", "limited", "banned"]);
220
78
  var chatOf = /* @__PURE__ */ __name((args) => typeof args[0] === "string" && /^-?\d+$/.test(args[0]) ? args[0] : void 0, "chatOf");
221
79
  var flooded = /* @__PURE__ */ __name((messenger, memory, { name, warn, pacer }) => {
222
- const kept = /* @__PURE__ */ __name(async (operation, what2) => {
80
+ const kept = /* @__PURE__ */ __name(async (operation, what) => {
223
81
  try {
224
- await what2();
82
+ await what();
225
83
  } catch (error) {
226
84
  warn(`could not remember ${name}'s wait (${error instanceof Error ? error.message : String(error)})`, {
227
85
  event: "warning",
@@ -310,7 +168,7 @@ var flooded = /* @__PURE__ */ __name((messenger, memory, { name, warn, pacer })
310
168
  });
311
169
  }, "flooded");
312
170
 
313
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/cli/messenger/observed.js
171
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/cli/messenger/observed.js
314
172
  var observed = /* @__PURE__ */ __name((messenger, events) => {
315
173
  const timed = /* @__PURE__ */ __name(async (operation, named, work, after) => {
316
174
  const write = currentOperation();
@@ -409,7 +267,7 @@ var byPart = /* @__PURE__ */ __name((batch, counts) => {
409
267
  counts[part] = (counts[part] ?? 0) + items.length;
410
268
  }, "byPart");
411
269
 
412
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/cli/messenger/stored.js
270
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/cli/messenger/stored.js
413
271
  var REKEY_PACING = { lockMs: 50, pauseMs: 25 };
414
272
  var stored = /* @__PURE__ */ __name((messenger, { account, store, warn, events, pending, announcing, deletedWithoutChat, profile, rekeyed, rekeyPacing = REKEY_PACING, closing, namesFromStore, recipientIds, countsUnread = false, historyLimits, command = "cli" }) => {
415
273
  let warned = false;
@@ -985,7 +843,7 @@ var keep = /* @__PURE__ */ __name(async (store, account, event, seenAt, among, c
985
843
  }
986
844
  }, "keep");
987
845
 
988
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/cli/messenger/context.js
846
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/cli/messenger/context.js
989
847
  var lazyStore = /* @__PURE__ */ __name((env, command, version) => {
990
848
  let opened;
991
849
  return {
@@ -1079,7 +937,7 @@ var settled = /* @__PURE__ */ __name(async (pending, ms) => {
1079
937
  clearTimeout(timer);
1080
938
  }
1081
939
  }, "settled");
1082
- var listened = /* @__PURE__ */ __name(({ run, operation, what: what2 }, events, warn, waitMs) => {
940
+ var listened = /* @__PURE__ */ __name(({ run, operation, what }, events, warn, waitMs) => {
1083
941
  const abort = new AbortController();
1084
942
  let closing = false;
1085
943
  const ended = Promise.resolve().then(() => run(abort.signal)).catch((error) => {
@@ -1087,11 +945,11 @@ var listened = /* @__PURE__ */ __name(({ run, operation, what: what2 }, events,
1087
945
  return;
1088
946
  const warning = { event: "warning", code: "listen_failed", operation };
1089
947
  events(warning);
1090
- warn(`${what2} arriving during this command are not saved: ${error instanceof Error ? error.message : String(error)}`, warning);
948
+ warn(`${what} arriving during this command are not saved: ${error instanceof Error ? error.message : String(error)}`, warning);
1091
949
  });
1092
950
  return {
1093
951
  operation,
1094
- what: what2,
952
+ what,
1095
953
  closing: /* @__PURE__ */ __name(() => {
1096
954
  closing = true;
1097
955
  }, "closing"),
@@ -1182,10 +1040,10 @@ var connected = /* @__PURE__ */ __name((connection, { app, provider, name, delet
1182
1040
  events(warning);
1183
1041
  warn(text, warning);
1184
1042
  }, "warned");
1185
- passives.forEach(({ operation, what: what2 }, at) => {
1043
+ passives.forEach(({ operation, what }, at) => {
1186
1044
  if (ended[at])
1187
1045
  return;
1188
- warned({ event: "warning", code: "store_not_written", operation }, `not saved to the local store: the messenger was still handing on ${what2} at exit`);
1046
+ warned({ event: "warning", code: "store_not_written", operation }, `not saved to the local store: the messenger was still handing on ${what} at exit`);
1189
1047
  });
1190
1048
  await settled(/* @__PURE__ */ new Set([...pending, ...announcing]), closeWaitMs);
1191
1049
  closing.abort();
@@ -1244,14 +1102,14 @@ var warnUnserved = /* @__PURE__ */ __name(async (messenger, profile, { env, rend
1244
1102
  const newest = (await store.chats.chatStats(account)).map((one) => one.newestAt).reduce((latest, at) => at !== null && (latest === null || at > latest) ? at : latest, null);
1245
1103
  renderer.warn(`no \`${messenger.app.command} ${profile} serve\` keeps profile "${profile}" up to date \u2014 ` + (newest === null ? "the local store holds no messages yet" : `the newest stored message is from ${newest}`));
1246
1104
  }, "warnUnserved");
1247
- var pathOf2 = /* @__PURE__ */ __name((command) => {
1105
+ var pathOf = /* @__PURE__ */ __name((command) => {
1248
1106
  const words = [];
1249
1107
  for (let at = command; at?.parent; at = at.parent)
1250
1108
  words.unshift(at.name());
1251
1109
  return words;
1252
1110
  }, "pathOf");
1253
1111
  var refuseDenied = /* @__PURE__ */ __name((command, settings) => {
1254
- for (const key of readKeysForCommand(pathOf2(command))) {
1112
+ for (const key of readKeysForCommand(pathOf(command))) {
1255
1113
  const { level, key: named } = levelFor(settings.permissions, key);
1256
1114
  if (level !== "deny")
1257
1115
  continue;
@@ -1274,7 +1132,7 @@ var messengerContext = /* @__PURE__ */ __name((command, messenger, resolving = {
1274
1132
  const base = baseContext(command, (flags, options) => messenger.resolveSettings(flags, { ...options, ...resolving }));
1275
1133
  const { profile } = base.settings;
1276
1134
  refuseDenied(command, base.settings);
1277
- refuseLacking(messenger, pathOf2(command));
1135
+ refuseLacking(messenger, pathOf(command));
1278
1136
  refuseUnknownPermissionKeys(command, base.settings, app.command, messenger.permissionKey);
1279
1137
  const warn = /* @__PURE__ */ __name((text, warning) => base.renderer.warn(text, warning), "warn");
1280
1138
  const accountFor = /* @__PURE__ */ __name(() => {
@@ -1386,13 +1244,6 @@ var messengerContext = /* @__PURE__ */ __name((command, messenger, resolving = {
1386
1244
  }, "messengerContext");
1387
1245
 
1388
1246
  export {
1389
- answerOf,
1390
- terminalAsker,
1391
- commandPermissions,
1392
- knownPermissionKeys,
1393
- knownBeside,
1394
- unknownPermissionIssues,
1395
- refuseUnknownPermissionKeys,
1396
1247
  fill,
1397
1248
  connectedFor,
1398
1249
  refuseLocalWrite,
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/mcp/bot/instructions.js
7
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/mcp/bot/instructions.js
8
8
  var botInstructions = /* @__PURE__ */ __name(({ command, name, profile, writes, skill }) => [
9
9
  `The owner's ${name} bot "${profile}", through the official Bot API \u2014 not the owner's personal account. What it writes, people see as the bot.`,
10
10
  "Use these tools to read the chats this bot is in, find a message or a person, and \u2014 when the profile allows \u2014 write as the bot.",
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/mcp/instructions.js
7
+ // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/mcp/instructions.js
8
8
  var instructions = /* @__PURE__ */ __name(({ command, name, profile, writes, skill }) => {
9
9
  const all = typeof profile !== "string";
10
10
  const offers = /* @__PURE__ */ __name((key) => all || writes.includes(key), "offers");