@wirecat/cli-memo 0.131.40 → 0.131.42

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 (138) hide show
  1. package/dist/bin/memo.js +2 -2
  2. package/dist/bundle/{all-profiles-QFW2NKJY.js → all-profiles-ZBEW2K6Y.js} +5 -5
  3. package/dist/bundle/{anthropic-IARLHPYJ.js → anthropic-2OBFMS2B.js} +3 -3
  4. package/dist/bundle/{app-server-L4N5IWJF.js → app-server-2BPUD7XU.js} +35 -35
  5. package/dist/bundle/auto-NIATDHS4.js +86 -0
  6. package/dist/bundle/{bun-NWKIEX53.js → bun-4NGTZRHL.js} +2 -2
  7. package/dist/bundle/{bun-sqlite-HORFVNNY.js → bun-sqlite-INSVTXFN.js} +2 -2
  8. package/dist/bundle/{chunk-ATR65D7K.js → chunk-2IO2DEBO.js} +8 -8
  9. package/dist/bundle/{chunk-LL5HPYW5.js → chunk-2P54ZDQO.js} +7 -7
  10. package/dist/bundle/{chunk-ADMB7OK5.js → chunk-2XCXOI4F.js} +22 -4
  11. package/dist/bundle/{chunk-4EZK5PGX.js → chunk-42VOTRWE.js} +1 -1
  12. package/dist/bundle/{chunk-XF7TG5VK.js → chunk-4OYYJSRS.js} +50 -48
  13. package/dist/bundle/{chunk-A7M74RZH.js → chunk-5O3T7Z7F.js} +1286 -765
  14. package/dist/bundle/{chunk-5G3NNIJQ.js → chunk-67TMJCHI.js} +10 -10
  15. package/dist/bundle/{chunk-RZ3UQFLE.js → chunk-6BW7SC6A.js} +1 -1
  16. package/dist/bundle/{chunk-CB34NXQP.js → chunk-A2KU4HSF.js} +57 -56
  17. package/dist/bundle/{chunk-BWNNUEHG.js → chunk-CKLLVPTR.js} +1 -1
  18. package/dist/bundle/{chunk-XV7M6VWX.js → chunk-CZ2CX43P.js} +4 -4
  19. package/dist/bundle/{chunk-ZH43Q2JO.js → chunk-DA5YMQCB.js} +2 -2
  20. package/dist/bundle/{chunk-DNZH53VQ.js → chunk-E3P7PIR3.js} +3 -3
  21. package/dist/bundle/{chunk-OGHWLR5E.js → chunk-EKFHAT36.js} +1 -1
  22. package/dist/bundle/{chunk-NCC3RXUX.js → chunk-ELPCHMDA.js} +3 -3
  23. package/dist/bundle/{chunk-XAWB4WEC.js → chunk-F6UUS3OF.js} +1 -1
  24. package/dist/bundle/{chunk-756VKGKO.js → chunk-GECE7WJD.js} +2 -2
  25. package/dist/bundle/{chunk-KWGNPUIV.js → chunk-GHLLCV4E.js} +7 -7
  26. package/dist/bundle/{chunk-WU6PDHXY.js → chunk-HCMQGNZU.js} +5 -5
  27. package/dist/bundle/{chunk-QR5KWOZ2.js → chunk-HQQC5JRS.js} +4 -4
  28. package/dist/bundle/{chunk-EGQCBZVM.js → chunk-IAML53OZ.js} +2 -2
  29. package/dist/bundle/{chunk-AKSNCK5L.js → chunk-JWQWLMFP.js} +257 -257
  30. package/dist/bundle/{chunk-FTX3OPWV.js → chunk-KBOLP4OR.js} +27 -27
  31. package/dist/bundle/{chunk-YWWTEWX3.js → chunk-KHEFBWLH.js} +1 -1
  32. package/dist/bundle/{chunk-WHWACGZX.js → chunk-KKXXP5RY.js} +7 -7
  33. package/dist/bundle/{chunk-JGDZ3G4P.js → chunk-KVKO4X7K.js} +3 -3
  34. package/dist/bundle/{chunk-A7MXWBIX.js → chunk-LBMZ7SQI.js} +2 -2
  35. package/dist/bundle/{chunk-SRYOICSG.js → chunk-LJDBOXZN.js} +1 -1
  36. package/dist/bundle/{chunk-Z6OKSDP3.js → chunk-MWKPW3RU.js} +1 -1
  37. package/dist/bundle/{chunk-2SZEKYBN.js → chunk-NCBHNEWW.js} +1 -1
  38. package/dist/bundle/{chunk-M7UHHXSH.js → chunk-NP5FU56F.js} +1 -1
  39. package/dist/bundle/{chunk-FBREYLY5.js → chunk-O34QHLL5.js} +1 -1
  40. package/dist/bundle/{chunk-U5WIWLWM.js → chunk-O4I3BJPM.js} +6 -6
  41. package/dist/bundle/{chunk-W3SMUCMB.js → chunk-O6YTC7DC.js} +1 -1
  42. package/dist/bundle/{chunk-2YJBI3NK.js → chunk-OAIRZNL2.js} +1 -1
  43. package/dist/bundle/{chunk-WAZWM4KZ.js → chunk-OJX6GNQY.js} +20 -20
  44. package/dist/bundle/{chunk-UEG3BDCX.js → chunk-OYHQYCGJ.js} +4 -4
  45. package/dist/bundle/{chunk-G3IO2TLK.js → chunk-PRL227K7.js} +5 -5
  46. package/dist/bundle/{chunk-EGRI2NUT.js → chunk-QWNEZWGZ.js} +4 -4
  47. package/dist/bundle/{chunk-EQQWJM6B.js → chunk-QWNVEFWY.js} +5 -5
  48. package/dist/bundle/{chunk-KGXVJO2V.js → chunk-QWZUMUA7.js} +5 -5
  49. package/dist/bundle/{chunk-MLHRER2H.js → chunk-RHIQ34XW.js} +2 -2
  50. package/dist/bundle/{chunk-B4XRE67Q.js → chunk-RV4EBFH2.js} +17 -9
  51. package/dist/bundle/{chunk-OZF7QBTS.js → chunk-T4NH7JI6.js} +2 -2
  52. package/dist/bundle/{chunk-5HSR6U4Z.js → chunk-TBGBA45H.js} +1 -1
  53. package/dist/bundle/{chunk-6RAU7FD2.js → chunk-TCNOZZPS.js} +11 -11
  54. package/dist/bundle/{chunk-UGHYNVWQ.js → chunk-TWBJOORY.js} +1 -1
  55. package/dist/bundle/{chunk-EIFPQD57.js → chunk-TXU5T7VA.js} +1 -1
  56. package/dist/bundle/{chunk-TWC6UJD2.js → chunk-UCLNEOQS.js} +12 -12
  57. package/dist/bundle/{chunk-OSDA5EZW.js → chunk-UK2MCVKV.js} +327 -260
  58. package/dist/bundle/{chunk-ASVVDNAS.js → chunk-UX34ZUMK.js} +3 -3
  59. package/dist/bundle/{chunk-THIXDXP3.js → chunk-W7GJREIL.js} +2 -2
  60. package/dist/bundle/{chunk-KAU67PDK.js → chunk-WFA2ZLJB.js} +159 -150
  61. package/dist/bundle/{chunk-PAE2NZ7S.js → chunk-WG6AOUQW.js} +20 -20
  62. package/dist/bundle/{chunk-6E4DCMJ5.js → chunk-WSPCOSYD.js} +4 -4
  63. package/dist/bundle/{chunk-LXQQ7Q34.js → chunk-XUNIJW7V.js} +9 -9
  64. package/dist/bundle/{chunk-5HXLRQ4Q.js → chunk-YLJWCB6F.js} +43 -43
  65. package/dist/bundle/{command-contract-ZRJPMWWI.js → command-contract-EYE52WTH.js} +11 -11
  66. package/dist/bundle/{decode-MDCEP64X.js → decode-JVG6DJJV.js} +2 -2
  67. package/dist/bundle/{echarts-RFIQAWMT.js → echarts-4IS4IPI4.js} +2 -2
  68. package/dist/bundle/{embed-443F7XR4.js → embed-7CN33CQR.js} +3 -3
  69. package/dist/bundle/{embedder-VRDPZFWC.js → embedder-TZ345BZF.js} +6 -6
  70. package/dist/bundle/{entry-36KBOBA4.js → entry-5VZRNBLV.js} +4 -4
  71. package/dist/bundle/failure-KIFYUUO6.js +66 -0
  72. package/dist/bundle/{first-run-CYZSGJTG.js → first-run-EMHSBODF.js} +5 -5
  73. package/dist/bundle/{first-screen-UY54KNVU.js → first-screen-3PJ3HFLG.js} +12 -12
  74. package/dist/bundle/{instructions-RI2WFMBA.js → instructions-BTAYTZIS.js} +1 -1
  75. package/dist/bundle/{mcp-DHX4GF3A.js → mcp-I5KREUIV.js} +35 -35
  76. package/dist/bundle/memo.js +6 -6
  77. package/dist/bundle/{node-H7LWGE5H.js → node-FMT4QVUG.js} +2 -2
  78. package/dist/bundle/{node-sqlite-N4POELFM.js → node-sqlite-2RDIBVYM.js} +3 -3
  79. package/dist/bundle/{oauth-OOUASPSL.js → oauth-MF53KMXM.js} +4 -4
  80. package/dist/bundle/{open-2T52CQDG.js → open-WKKHNBXL.js} +2 -2
  81. package/dist/bundle/{openai-76CJYDRJ.js → openai-36KNG2DB.js} +7 -7
  82. package/dist/bundle/{process-7YATIAKW.js → process-F2FWK4Q4.js} +1 -1
  83. package/dist/bundle/{program-O4I2BGM2.js → program-W55Y6LL2.js} +376 -102
  84. package/dist/bundle/{prompt-MHD5EI75.js → prompt-2TR6X3TJ.js} +2 -2
  85. package/dist/bundle/{recognize-ARCD7XPJ.js → recognize-MOBCGUI7.js} +1 -1
  86. package/dist/bundle/{remote-OQ7TUXN3.js → remote-GARKVCO7.js} +4 -4
  87. package/dist/bundle/{rerank-422D4DZR.js → rerank-L3G7P3KX.js} +4 -4
  88. package/dist/bundle/{serve-ZOT62JRM.js → serve-ABRMEJ7P.js} +6 -6
  89. package/dist/bundle/server-NMRAFTY3.js +61 -0
  90. package/dist/bundle/server-VX3L42ED.js +48 -0
  91. package/dist/bundle/{server-HAZC3T7X.js → server-XLMROR5L.js} +50 -50
  92. package/dist/bundle/{state-KBW7BI2G.js → state-5N2RVH2Y.js} +3 -3
  93. package/dist/bundle/{store-KZY5FZPD.js → store-4ML7O47C.js} +9 -9
  94. package/dist/bundle/store-maintenance-command-O3OTXKNO.js +48 -0
  95. package/dist/bundle/update-OWKZLZTS.js +69 -0
  96. package/dist/discovery/command.d.ts.map +1 -1
  97. package/dist/discovery/command.js +3 -0
  98. package/dist/discovery/command.js.map +1 -1
  99. package/dist/doctor/command.d.ts +1 -1
  100. package/dist/examples.d.ts.map +1 -1
  101. package/dist/examples.js +19 -0
  102. package/dist/examples.js.map +1 -1
  103. package/dist/finance/deals-command.d.ts +22 -0
  104. package/dist/finance/deals-command.d.ts.map +1 -0
  105. package/dist/finance/deals-command.js +235 -0
  106. package/dist/finance/deals-command.js.map +1 -0
  107. package/dist/finance/finance.d.ts +1 -1
  108. package/dist/finance/finance.d.ts.map +1 -1
  109. package/dist/finance/finance.js +2 -0
  110. package/dist/finance/finance.js.map +1 -1
  111. package/dist/knowledge/project-status-command.d.ts.map +1 -1
  112. package/dist/knowledge/project-status-command.js +14 -7
  113. package/dist/knowledge/project-status-command.js.map +1 -1
  114. package/dist/mail/findings-command.d.ts.map +1 -1
  115. package/dist/mail/findings-command.js +9 -13
  116. package/dist/mail/findings-command.js.map +1 -1
  117. package/dist/program.d.ts.map +1 -1
  118. package/dist/program.js +65 -0
  119. package/dist/program.js.map +1 -1
  120. package/dist/review/command.d.ts +40 -0
  121. package/dist/review/command.d.ts.map +1 -1
  122. package/dist/review/command.js +25 -1
  123. package/dist/review/command.js.map +1 -1
  124. package/dist/rows.d.ts.map +1 -1
  125. package/dist/rows.js +18 -0
  126. package/dist/rows.js.map +1 -1
  127. package/dist/version.d.ts +1 -1
  128. package/dist/version.js +1 -1
  129. package/package.json +2 -2
  130. package/skills/cli-memo/topics/money.md +6 -0
  131. package/skills/mail-triage/SKILL.md +8 -9
  132. package/dist/bundle/auto-24I3FBUW.js +0 -86
  133. package/dist/bundle/failure-QKFNHYKC.js +0 -66
  134. package/dist/bundle/server-EISBI6O6.js +0 -61
  135. package/dist/bundle/server-NNQ3YRBV.js +0 -48
  136. package/dist/bundle/store-maintenance-command-ZFQOMCLZ.js +0 -48
  137. package/dist/bundle/update-SAX5XN2C.js +0 -69
  138. /package/dist/bundle/{chunk-5VKETWNU.js → chunk-O3EZTSTN.js} +0 -0
@@ -6,17 +6,17 @@ import {
6
6
  autoState,
7
7
  lastAutoRun,
8
8
  recordAutoRun
9
- } from "./chunk-EGRI2NUT.js";
9
+ } from "./chunk-QWNEZWGZ.js";
10
10
  import {
11
11
  installer,
12
12
  latest,
13
13
  upgradeCommand
14
- } from "./chunk-G3IO2TLK.js";
14
+ } from "./chunk-PRL227K7.js";
15
15
  import {
16
16
  mcpOwnerAllowed,
17
17
  readOnlyAvailability,
18
18
  refuseWritesUnderLock
19
- } from "./chunk-WU6PDHXY.js";
19
+ } from "./chunk-HCMQGNZU.js";
20
20
  import {
21
21
  answers,
22
22
  atDetail,
@@ -26,7 +26,7 @@ import {
26
26
  trackAnswers,
27
27
  wholeList,
28
28
  withStore
29
- } from "./chunk-ADMB7OK5.js";
29
+ } from "./chunk-2XCXOI4F.js";
30
30
  import {
31
31
  ATTACHMENT_CHARS,
32
32
  DIALECTS,
@@ -43,6 +43,7 @@ import {
43
43
  isReference,
44
44
  loadConfig,
45
45
  lowerSuspicious,
46
+ mailMark,
46
47
  mailReadCommands,
47
48
  markItem,
48
49
  matcher,
@@ -55,15 +56,15 @@ import {
55
56
  showMail,
56
57
  unsetConfigKey,
57
58
  updateConfig
58
- } from "./chunk-XF7TG5VK.js";
59
+ } from "./chunk-4OYYJSRS.js";
59
60
  import "./chunk-QP3KNC5D.js";
60
- import "./chunk-EGQCBZVM.js";
61
- import "./chunk-WHWACGZX.js";
62
- import "./chunk-JGDZ3G4P.js";
61
+ import "./chunk-IAML53OZ.js";
62
+ import "./chunk-KKXXP5RY.js";
63
+ import "./chunk-KVKO4X7K.js";
63
64
  import {
64
65
  errorObject,
65
66
  recognisable
66
- } from "./chunk-DNZH53VQ.js";
67
+ } from "./chunk-E3P7PIR3.js";
67
68
  import {
68
69
  DISCOVERY_DESCRIPTIONS,
69
70
  addContractInfo,
@@ -99,29 +100,29 @@ import {
99
100
  tasksCommand,
100
101
  tasksStatsCommand,
101
102
  withSqliteSidecars
102
- } from "./chunk-OSDA5EZW.js";
103
- import "./chunk-M7UHHXSH.js";
104
- import "./chunk-FBREYLY5.js";
103
+ } from "./chunk-UK2MCVKV.js";
104
+ import "./chunk-NP5FU56F.js";
105
+ import "./chunk-O34QHLL5.js";
105
106
  import {
106
107
  allHitItem,
107
108
  coverageGaps,
108
109
  messageHitItem,
109
110
  noteHitItem,
110
111
  shownOf
111
- } from "./chunk-PAE2NZ7S.js";
112
- import "./chunk-OGHWLR5E.js";
112
+ } from "./chunk-WG6AOUQW.js";
113
+ import "./chunk-EKFHAT36.js";
113
114
  import {
114
115
  SKILL_TARGETS,
115
116
  skillCommand,
116
117
  skillPath,
117
118
  skillVersion
118
- } from "./chunk-B4XRE67Q.js";
119
+ } from "./chunk-RV4EBFH2.js";
119
120
  import {
120
121
  modelGateway,
121
122
  storeInfo,
122
123
  storeSummary
123
- } from "./chunk-5HXLRQ4Q.js";
124
- import "./chunk-WAZWM4KZ.js";
124
+ } from "./chunk-YLJWCB6F.js";
125
+ import "./chunk-OJX6GNQY.js";
125
126
  import {
126
127
  LIST_QUERY_GUIDE,
127
128
  STATUS_SIGNALS,
@@ -173,18 +174,18 @@ import {
173
174
  termField,
174
175
  typedQuery,
175
176
  withQuery
176
- } from "./chunk-AKSNCK5L.js";
177
+ } from "./chunk-JWQWLMFP.js";
177
178
  import {
178
179
  readBoundedUtf8File,
179
180
  writeFileAtomic
180
- } from "./chunk-TWC6UJD2.js";
181
+ } from "./chunk-UCLNEOQS.js";
181
182
  import {
182
183
  commandsText,
183
184
  inSection,
184
185
  installHelp
185
- } from "./chunk-U5WIWLWM.js";
186
+ } from "./chunk-O4I3BJPM.js";
186
187
  import "./chunk-HTQTIKWP.js";
187
- import "./chunk-OZF7QBTS.js";
188
+ import "./chunk-T4NH7JI6.js";
188
189
  import {
189
190
  Command,
190
191
  FETCH,
@@ -214,23 +215,26 @@ import {
214
215
  runsDirFor,
215
216
  settingRows,
216
217
  settingsFor
217
- } from "./chunk-KAU67PDK.js";
218
- import "./chunk-LL5HPYW5.js";
219
- import "./chunk-5G3NNIJQ.js";
218
+ } from "./chunk-WFA2ZLJB.js";
219
+ import "./chunk-2P54ZDQO.js";
220
+ import "./chunk-67TMJCHI.js";
220
221
  import {
221
222
  isNewer
222
223
  } from "./chunk-JY34MQW4.js";
223
224
  import "./chunk-LER7G4XY.js";
224
- import "./chunk-NCC3RXUX.js";
225
- import "./chunk-LXQQ7Q34.js";
226
- import "./chunk-UGHYNVWQ.js";
227
- import "./chunk-QR5KWOZ2.js";
225
+ import "./chunk-ELPCHMDA.js";
226
+ import "./chunk-XUNIJW7V.js";
227
+ import "./chunk-TWBJOORY.js";
228
+ import "./chunk-HQQC5JRS.js";
228
229
  import {
229
230
  releaseLock,
230
231
  takeLock
231
- } from "./chunk-MLHRER2H.js";
232
- import "./chunk-2SZEKYBN.js";
232
+ } from "./chunk-RHIQ34XW.js";
233
+ import "./chunk-NCBHNEWW.js";
233
234
  import {
235
+ DEAL_KINDS,
236
+ DEAL_ROLES,
237
+ DEAL_STATUSES,
234
238
  EVIDENCE_FINDINGS_KIND,
235
239
  MAIL_FINDINGS_KIND,
236
240
  MAX_FILE_BYTES,
@@ -256,6 +260,7 @@ import {
256
260
  formatReference,
257
261
  isFolderProvider,
258
262
  looksLikeReference,
263
+ mailFindingFieldsHelp,
259
264
  mailOwnText,
260
265
  openOf,
261
266
  openStore,
@@ -263,7 +268,7 @@ import {
263
268
  parseReference,
264
269
  providerNamed,
265
270
  refLabel
266
- } from "./chunk-A7M74RZH.js";
271
+ } from "./chunk-5O3T7Z7F.js";
267
272
  import {
268
273
  FACT_STATUSES,
269
274
  FACT_TYPES,
@@ -296,22 +301,22 @@ import {
296
301
  timezoneOf,
297
302
  validateQuery,
298
303
  walkQuery
299
- } from "./chunk-CB34NXQP.js";
300
- import "./chunk-4EZK5PGX.js";
301
- import "./chunk-KWGNPUIV.js";
302
- import "./chunk-UEG3BDCX.js";
303
- import "./chunk-THIXDXP3.js";
304
- import "./chunk-5HSR6U4Z.js";
305
- import "./chunk-SRYOICSG.js";
306
- import "./chunk-YWWTEWX3.js";
307
- import "./chunk-ZH43Q2JO.js";
308
- import "./chunk-KGXVJO2V.js";
304
+ } from "./chunk-A2KU4HSF.js";
305
+ import "./chunk-42VOTRWE.js";
306
+ import "./chunk-GHLLCV4E.js";
307
+ import "./chunk-OYHQYCGJ.js";
308
+ import "./chunk-W7GJREIL.js";
309
+ import "./chunk-TBGBA45H.js";
310
+ import "./chunk-LJDBOXZN.js";
311
+ import "./chunk-KHEFBWLH.js";
312
+ import "./chunk-DA5YMQCB.js";
313
+ import "./chunk-QWZUMUA7.js";
309
314
  import {
310
315
  sharedModelsDirectory
311
- } from "./chunk-ASVVDNAS.js";
316
+ } from "./chunk-UX34ZUMK.js";
312
317
  import {
313
318
  storePath
314
- } from "./chunk-XAWB4WEC.js";
319
+ } from "./chunk-F6UUS3OF.js";
315
320
  import {
316
321
  provideTerminal,
317
322
  terminalOf
@@ -321,12 +326,12 @@ import {
321
326
  REASONS,
322
327
  STORE_CLIENT,
323
328
  VERSION
324
- } from "./chunk-RZ3UQFLE.js";
329
+ } from "./chunk-6BW7SC6A.js";
325
330
  import "./chunk-CID4MNRQ.js";
326
331
  import "./chunk-AT5Y62SD.js";
327
332
  import "./chunk-D72URWJE.js";
328
- import "./chunk-EQQWJM6B.js";
329
- import "./chunk-BWNNUEHG.js";
333
+ import "./chunk-QWNVEFWY.js";
334
+ import "./chunk-CKLLVPTR.js";
330
335
  import {
331
336
  createDeadline,
332
337
  createRenderer,
@@ -365,7 +370,7 @@ import {
365
370
  errorCodes,
366
371
  isCliError
367
372
  } from "./chunk-RZ54DSVU.js";
368
- import "./chunk-EIFPQD57.js";
373
+ import "./chunk-TXU5T7VA.js";
369
374
  import {
370
375
  __name
371
376
  } from "./chunk-ZVVMGPBJ.js";
@@ -647,7 +652,7 @@ var collect = /* @__PURE__ */ __name((value, previous = []) => [...previous, val
647
652
  var readScope = /* @__PURE__ */ __name((command, help = ONE_ACCOUNT_HELP) => sourceOptions(command, help).option("--json", "print JSON; --json=id,title keeps only those fields"), "readScope");
648
653
  var writeScope = /* @__PURE__ */ __name((command, help) => writeOptions(command, help).option("--json", "print JSON; --json=id,title keeps only those fields"), "writeScope");
649
654
 
650
- // node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/mail/sender-scores.js
655
+ // node_modules/.pnpm/@wirecat+cli-core@0.588.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_b859f846da38ad2f474ef5e15fe95f19/node_modules/@wirecat/cli-core/dist/mail/sender-scores.js
651
656
  var SCORED = "mail_sender_scores";
652
657
  var DAY = 864e5;
653
658
  var RECENT = 2 * 365 * DAY;
@@ -663,7 +668,7 @@ var demotedSenders = /* @__PURE__ */ __name(async (store) => {
663
668
  return senders;
664
669
  }, "demotedSenders");
665
670
 
666
- // node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/mail/sync.js
671
+ // node_modules/.pnpm/@wirecat+cli-core@0.588.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_b859f846da38ad2f474ef5e15fe95f19/node_modules/@wirecat/cli-core/dist/mail/sync.js
667
672
  var DAY2 = 864e5;
668
673
  var EDGE = 2 * DAY2;
669
674
 
@@ -1892,7 +1897,7 @@ import { createHash } from "node:crypto";
1892
1897
  import { existsSync, readFileSync as readFileSync2, statSync } from "node:fs";
1893
1898
  import { basename, extname, relative, sep } from "node:path";
1894
1899
 
1895
- // node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/services/documents/extraction.js
1900
+ // node_modules/.pnpm/@wirecat+cli-core@0.588.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_b859f846da38ad2f474ef5e15fe95f19/node_modules/@wirecat/cli-core/dist/services/documents/extraction.js
1896
1901
  var Proposal = object({
1897
1902
  kind: picklist(["summary", "digest", "fact", "preference"]),
1898
1903
  body: pipe(string(), trim(), minLength(1), maxLength(15e3)),
@@ -1900,10 +1905,10 @@ var Proposal = object({
1900
1905
  });
1901
1906
  var Proposals = object({ items: pipe(array(Proposal), maxLength(20)) });
1902
1907
 
1903
- // node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/services/documents/mirrors.js
1908
+ // node_modules/.pnpm/@wirecat+cli-core@0.588.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_b859f846da38ad2f474ef5e15fe95f19/node_modules/@wirecat/cli-core/dist/services/documents/mirrors.js
1904
1909
  var ID = pipe(string(), regex(/^[A-Za-z0-9_-]{1,200}$/));
1905
1910
 
1906
- // node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/services/documents/sync.js
1911
+ // node_modules/.pnpm/@wirecat+cli-core@0.588.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_b859f846da38ad2f474ef5e15fe95f19/node_modules/@wirecat/cli-core/dist/services/documents/sync.js
1907
1912
  var MAX_PICTURE_BYTES = 25 * 1024 * 1024;
1908
1913
 
1909
1914
  // dist/notes/links.js
@@ -3993,6 +3998,9 @@ var SECTIONS = [
3993
3998
  ["organizations", "organise"],
3994
3999
  ["invoices", "organise"],
3995
4000
  ["orders", "organise"],
4001
+ ["deals", "organise"],
4002
+ ["leads", "organise"],
4003
+ ["pipelines", "organise"],
3996
4004
  ["payments", "organise"],
3997
4005
  ["records", "organise"],
3998
4006
  ["projects", "organise"],
@@ -4367,6 +4375,25 @@ var EXAMPLES = {
4367
4375
  "facts list": ["memo facts list kind:decision project:HRB"],
4368
4376
  "orders list": ["memo orders list status:shipped", `memo orders list number:A-1042 'supplier:"Shop One"' --json`],
4369
4377
  "orders show": ["memo orders show order:3"],
4378
+ "pipelines list": ["memo pipelines list", "memo pipelines list kind:lead --json"],
4379
+ "pipelines show": ["memo pipelines show pipeline:2", "memo pipelines show Sales --since-time 2026-09-01"],
4380
+ "pipelines add": [
4381
+ "memo pipelines add Sales Call Quote Contract won lost",
4382
+ "memo pipelines add Inbound new called --kind lead"
4383
+ ],
4384
+ "deals list": ["memo deals list status:open project:HRB", "memo deals list stage:Quote --json"],
4385
+ "deals show": ["memo deals show deal:5"],
4386
+ "deals add": [
4387
+ "memo deals add 'Site for the clinic' Call 500000.00 RUB --organization organization:3 --project HRB",
4388
+ "memo deals add 'Support contract' Sales/Quote --person person:7 --role decision-maker --due 2026-12-01"
4389
+ ],
4390
+ "deals move": ["memo deals move deal:5 Quote"],
4391
+ "deals close": ["memo deals close deal:5 won", "memo deals close deal:6 lost --reason 'chose a cheaper studio'"],
4392
+ "leads list": ["memo leads list status:open"],
4393
+ "leads show": ["memo leads show lead:3"],
4394
+ "leads add": ["memo leads add 'Call from the site'", "memo leads add 'Clinic in Kazan' contacted --person person:9"],
4395
+ "leads move": ["memo leads move lead:3 qualified"],
4396
+ "leads close": ["memo leads close lead:3 lost --reason 'no budget'"],
4370
4397
  "orders add": [
4371
4398
  "memo orders add 'Shop One' 2499.00 RUB --kind personal --title A-1042",
4372
4399
  "memo orders add 'Office Supply' --kind client --organization organization:3"
@@ -4618,7 +4645,7 @@ var memoriesCommand = /* @__PURE__ */ __name((program, streams, env) => {
4618
4645
  ...options.supersedes === void 0 ? {} : { supersedes: options.supersedes }
4619
4646
  }, await by))));
4620
4647
  });
4621
- withQuery(annotate(memories.command("list"), { effects: LOCAL_READ }).description("memories, newest first"), MEMORY_QUERY).option("--limit <n>", "most memories, up to 500", positive, 100).option("--json", "print JSON; --json=id,title keeps only those fields").action((words, { json: json6, limit }) => run(json6, (store) => listMemories(store, words, limit)));
4648
+ withQuery(annotate(memories.command("list"), { effects: LOCAL_READ }).description("memories, newest first"), MEMORY_QUERY).option("--limit <n>", "most memories, up to 500", positive, 100).option("--json", "print JSON; --json=id,title keeps only those fields").action((words, { json: json7, limit }) => run(json7, (store) => listMemories(store, words, limit)));
4622
4649
  annotate(memories.command("show"), { effects: LOCAL_READ, output: { entity: "memory" } }).description("one memory with its evidence").argument("<ref>", "memory:<id>").option("--sources", "read each piece of evidence back: who, when, a short excerpt, and whether it is gone").option("--json", "print JSON; --json=id,title keeps only those fields").action((ref, options) => run(options.json, async (store) => itemAnswer({
4623
4650
  ...memoryItem(await store.memories.get(ref)),
4624
4651
  ...options.sources ? { sources: await store.memories.sources(ref) } : {}
@@ -4736,7 +4763,7 @@ var factsCommand = /* @__PURE__ */ __name((program, streams, env) => {
4736
4763
  ...options.supersedes === void 0 ? {} : { supersedes: options.supersedes }
4737
4764
  }))));
4738
4765
  });
4739
- withQuery(annotate(facts.command("list"), { effects: LOCAL_READ }).description("facts, latest first"), FACT_QUERY).option("--limit <n>", "most facts, up to 500", positive, 100).option("--json", "print JSON; --json=id,title keeps only those fields").action((words, { json: json6, limit }) => run(json6, (store) => listFacts(store, words, limit)));
4766
+ withQuery(annotate(facts.command("list"), { effects: LOCAL_READ }).description("facts, latest first"), FACT_QUERY).option("--limit <n>", "most facts, up to 500", positive, 100).option("--json", "print JSON; --json=id,title keeps only those fields").action((words, { json: json7, limit }) => run(json7, (store) => listFacts(store, words, limit)));
4740
4767
  annotate(facts.command("show"), { effects: LOCAL_READ, output: { entity: "fact" } }).description("one fact with its evidence").argument("<ref>", "fact:<id>").option("--sources", "read each piece of evidence back: who, when, a short excerpt, and whether it is gone").option("--json", "print JSON; --json=id,title keeps only those fields").action((ref, options) => run(options.json, async (store) => itemAnswer({
4741
4768
  ...factItem(await store.facts.get(ref)),
4742
4769
  ...options.sources ? { sources: await store.facts.sources(ref) } : {}
@@ -4776,6 +4803,7 @@ var INVOICE_QUERY = {
4776
4803
  termField("status", "enum", "status:partly_paid", { values: INVOICE_STATUSES }),
4777
4804
  termField("review", "enum", "review:proposed", { values: FINANCE_REVIEWS }),
4778
4805
  termField("counterparty", "ref", 'counterparty:"organization:3"'),
4806
+ termField("number", "kw", "number:FACT-2026-00012"),
4779
4807
  termField("open", "bool", "open:true")
4780
4808
  ]
4781
4809
  };
@@ -4799,6 +4827,7 @@ var listInvoices = /* @__PURE__ */ __name(async (store, words, limit) => {
4799
4827
  ...terms.has("direction") ? { direction: terms.get("direction") } : {},
4800
4828
  ...terms.has("status") ? { status: terms.get("status") } : {},
4801
4829
  ...terms.has("counterparty") ? { counterparty: terms.get("counterparty") } : {},
4830
+ ...terms.has("number") ? { number: terms.get("number") } : {},
4802
4831
  ...terms.has("open") ? { open: terms.get("open") === "true" } : {}
4803
4832
  };
4804
4833
  return pageOf("invoices list", limit, (most) => store.finance.invoices({ ...filter, limit: most }));
@@ -4898,7 +4927,7 @@ var writeMeta = /* @__PURE__ */ __name((command) => byOption(command.option("--p
4898
4927
  var financeCommands = /* @__PURE__ */ __name((program, streams, env) => {
4899
4928
  const { run } = answers(program, streams, env);
4900
4929
  const invoices = program.command("invoices").description("invoices you issued or received, with their lines and what paid them; amounts per currency").summary("invoices you issued or received, and what paid them");
4901
- withQuery(json(annotate(invoices.command("list"), { effects: LOCAL_READ })).description("invoices, newest first; review:proposed lists what waits for you"), INVOICE_QUERY).option("--limit <n>", "most invoices, up to 500", positive, 100).action((words, { json: json6, limit }) => run(json6, (store) => listInvoices(store, words, limit)));
4930
+ withQuery(json(annotate(invoices.command("list"), { effects: LOCAL_READ })).description("invoices, newest first; review:proposed lists what waits for you"), INVOICE_QUERY).option("--limit <n>", "most invoices, up to 500", positive, 100).action((words, { json: json7, limit }) => run(json7, (store) => listInvoices(store, words, limit)));
4902
4931
  json(annotate(invoices.command("show"), { effects: LOCAL_READ, output: { entity: "invoice" } })).description("one invoice with its lines and the payments allocated to it").argument("<ref>", "invoice:<id>").action((ref, options) => run(options.json, async (store) => itemAnswer(await store.finance.invoice(ref))));
4903
4932
  json(writeMeta(party(annotate(invoices.command("add"), {
4904
4933
  effects: LOCAL_WRITE,
@@ -4922,7 +4951,7 @@ var financeCommands = /* @__PURE__ */ __name((program, streams, env) => {
4922
4951
  });
4923
4952
  });
4924
4953
  const payments = program.command("payments").description("money paid to you or by you, and the invoices each payment settles; amounts per currency").summary("money paid to you or by you, and what it settles");
4925
- withQuery(json(annotate(payments.command("list"), { effects: LOCAL_READ })).description("payments, newest first; review:proposed lists what waits for you"), PAYMENT_QUERY).option("--limit <n>", "most payments, up to 500", positive, 100).action((words, { json: json6, limit }) => run(json6, (store) => listPayments(store, words, limit)));
4954
+ withQuery(json(annotate(payments.command("list"), { effects: LOCAL_READ })).description("payments, newest first; review:proposed lists what waits for you"), PAYMENT_QUERY).option("--limit <n>", "most payments, up to 500", positive, 100).action((words, { json: json7, limit }) => run(json7, (store) => listPayments(store, words, limit)));
4926
4955
  json(annotate(payments.command("show"), { effects: LOCAL_READ, output: { entity: "payment" } })).description("one payment with the invoices it is allocated to").argument("<ref>", "payment:<id>").action((ref, options) => run(options.json, async (store) => itemAnswer(await store.finance.payment(ref))));
4927
4956
  json(writeMeta(party(annotate(payments.command("add"), { effects: LOCAL_WRITE, output: { entity: "payment" } }), "who paid or was paid").option("--kind <kind>", "in (paid to you) or out (paid by you)").option("--title <title>", "the payment's reference, such as the bank's purpose line").option("--occurred-time <time>", "the day it was paid, such as 2026-11-01; today when left out"))).description(`record a payment; ${PROPOSES}. payments allocate matches it to an invoice`).summary("record a payment; an agent's waits for your review").argument("<amount>", "a decimal, such as 50000.00").argument("<currency>", "ISO 4217, such as RUB").action(async (amount, currency, options, command) => {
4928
4957
  const by = await whoRuns(command, env, { asOwner: options.asOwner, question: "record this payment as yours?" });
@@ -4953,6 +4982,163 @@ var financeCommands = /* @__PURE__ */ __name((program, streams, env) => {
4953
4982
  });
4954
4983
  }, "financeCommands");
4955
4984
 
4985
+ // dist/finance/deals-command.js
4986
+ var queryOf = /* @__PURE__ */ __name((entity) => ({
4987
+ entity,
4988
+ backend: "native",
4989
+ fields: [
4990
+ termField("project", "kw", "project:PMED"),
4991
+ termField("status", "enum", "status:open", { values: DEAL_STATUSES }),
4992
+ termField("stage", "kw", 'stage:"Quote sent"'),
4993
+ termField("pipeline", "kw", "pipeline:Sales"),
4994
+ termField("organization", "ref", 'organization:"organization:3"')
4995
+ ]
4996
+ }), "queryOf");
4997
+ var QUERIES = { deal: queryOf("deal"), lead: queryOf("lead") };
4998
+ var PIPELINE_QUERY = {
4999
+ entity: "pipeline",
5000
+ backend: "native",
5001
+ fields: [termField("kind", "enum", "kind:lead", { values: DEAL_KINDS }), termField("name", "kw", "name:Sales")]
5002
+ };
5003
+ var listDeals = /* @__PURE__ */ __name(async (store, kind, words, limit) => {
5004
+ const command = `${kind}s list`;
5005
+ const terms = queryTerms(words, QUERIES[kind], command);
5006
+ const filter = {
5007
+ kind,
5008
+ ...terms.has("project") ? { project: await canonicalProject(store, terms.get("project")) } : {},
5009
+ ...terms.has("status") ? { status: terms.get("status") } : {},
5010
+ ...terms.has("stage") ? { stage: terms.get("stage") } : {},
5011
+ ...terms.has("pipeline") ? { pipeline: terms.get("pipeline") } : {},
5012
+ ...terms.has("organization") ? { organization: terms.get("organization") } : {}
5013
+ };
5014
+ return pageOf(command, limit, (most) => store.deals.list({ ...filter, limit: most }));
5015
+ }, "listDeals");
5016
+ var roleOf = /* @__PURE__ */ __name((role) => {
5017
+ const value = role ?? "contact";
5018
+ if (!DEAL_ROLES.includes(value))
5019
+ throw new CliError("validation_error", `--role is one of ${DEAL_ROLES.join(", ")}`, { param: "--role" });
5020
+ return value;
5021
+ }, "roleOf");
5022
+ var referenceOf = /* @__PURE__ */ __name((kind, value) => /^\d+$/.test(value.trim()) ? `${kind}:${value.trim()}` : value.trim(), "referenceOf");
5023
+ var stageOf = /* @__PURE__ */ __name((stage) => {
5024
+ if (stage === void 0)
5025
+ return {};
5026
+ const at = stage.lastIndexOf("/");
5027
+ return at <= 0 ? { stage } : { pipeline: stage.slice(0, at), stage: stage.slice(at + 1) };
5028
+ }, "stageOf");
5029
+ var json2 = /* @__PURE__ */ __name((command) => command.option("--json", "print JSON; --json=ref,title keeps only those fields"), "json");
5030
+ var WHAT = {
5031
+ deal: { one: "deal", hope: "what you hope to sell, such as 'Site for the clinic'" },
5032
+ lead: { one: "lead", hope: "who or what came in, such as 'Call from the site'" }
5033
+ };
5034
+ var itemCommands = /* @__PURE__ */ __name((program, kind, run, env) => {
5035
+ const { one: one2, hope } = WHAT[kind];
5036
+ const group = program.command(`${kind}s`).description(kind === "deal" ? "deals you hope to win: the client, the expected amount, the stage and whether it was won or lost" : "leads: first contacts in a lead pipeline, before they are deals").summary(kind === "deal" ? "deals in your pipelines, open, won or lost" : "leads in your lead pipelines");
5037
+ withQuery(json2(annotate(group.command("list"), { effects: LOCAL_READ })).description(`${one2}s, newest first; status:open is what is still in play`), QUERIES[kind]).summary(`${one2}s, newest first`).option("--limit <n>", `most ${one2}s, up to 500`, positive, 100).action((words, { json: json7, limit }) => run(json7, (store) => listDeals(store, kind, words, limit)));
5038
+ json2(annotate(group.command("show"), { effects: LOCAL_READ, output: { entity: kind } })).description(`one ${one2} with its pipeline, stage, status, amount, the people on it and what it was read from`).summary(`one ${one2} with its stage, status, amount and people`).argument("<ref>", `${kind}:<id>`).action((ref, options) => run(options.json, async (store) => itemAnswer(await store.deals.get(ref))));
5039
+ json2(annotate(group.command("add"), { effects: LOCAL_WRITE, output: { entity: kind }, literal_after_dashes: true }).option("--organization <organization>", "the client: organization:<id>").option("--person <uid>", `a person on the ${one2}: person:<id>; repeat for another, up to 20`, collect).option("--role <role>", `what those people are on it: ${DEAL_ROLES.join(", ")}; contact by default`).option("--due <time>", "the day you expect it to close, such as 2026-12-01").option("--project <project>", "the project it belongs to: its key or project:<id>").option("--reason <text>", "why an agent records it, kept with it").option("--evidence <ref...>", "what shows it, up to 8: msg:, note:, document: or another reference")).description(`record a ${one2} in a stage; it is written at once, whoever runs it`).summary(`record a ${one2} in a stage`).argument("<title>", hope).argument(kind === "deal" ? "<stage>" : "[stage]", kind === "deal" ? "the stage it is in; Sales/Quote or pipeline:3/Quote names the pipeline when two have that stage" : "the stage it is in; the first stage of the only lead pipeline when left out").argument("[amount]", "the expected amount, a decimal such as 500000.00").argument("[currency]", "ISO 4217, such as RUB; given with the amount").action(async (title, stage, amount, currency, options) => {
5040
+ const by = authorOf(env);
5041
+ const role = roleOf(options.role);
5042
+ await run(options.json, async (store) => {
5043
+ const closeDate = dayOf(options.due);
5044
+ return itemAnswer(await store.deals.add({
5045
+ by,
5046
+ kind,
5047
+ title,
5048
+ ...stageOf(stage),
5049
+ ...options.organization === void 0 ? {} : { organization: referenceOf("organization", options.organization) },
5050
+ ...options.person === void 0 ? {} : { people: options.person.map((person) => ({ person: referenceOf("person", person), role })) },
5051
+ ...amount === void 0 ? {} : { amount },
5052
+ ...currency === void 0 ? {} : { currency },
5053
+ ...closeDate === void 0 ? {} : { closeDate },
5054
+ ...options.project === void 0 ? {} : { project: await canonicalProject(store, options.project) },
5055
+ ...options.reason === void 0 ? {} : { reason: options.reason },
5056
+ ...options.evidence === void 0 ? {} : { evidence: options.evidence }
5057
+ }));
5058
+ });
5059
+ });
5060
+ json2(annotate(group.command("move"), { effects: LOCAL_WRITE, output: { entity: kind } })).description(`move a ${one2} to another stage of its pipeline; a won or lost stage closes it, an open one reopens it`).summary(`move a ${one2} to another stage`).argument("<ref>", `${kind}:<id>`).argument("<stage>", `a stage of the ${one2}'s pipeline`).action(async (ref, stage, options) => {
5061
+ const by = authorOf(env);
5062
+ await run(options.json, async (store) => itemAnswer(await store.deals.move(ref, { stage, by })));
5063
+ });
5064
+ json2(annotate(group.command("close"), { effects: LOCAL_WRITE, output: { entity: kind } }).option("--occurred-time <time>", "the day it closed, such as 2026-11-20; today when left out").option("--reason <text>", "why it was won or lost, kept with it")).description(`close a ${one2} as won or lost; it moves to its pipeline's won or lost stage when there is one`).summary(`close a ${one2} as won or lost`).argument("<ref>", `${kind}:<id>`).argument("<outcome>", "won or lost").action(async (ref, outcome, options) => {
5065
+ if (outcome !== "won" && outcome !== "lost")
5066
+ throw new CliError("validation_error", `a ${one2} closes as won or lost`, { param: "outcome" });
5067
+ const by = authorOf(env);
5068
+ const date = dayOf(options.occurredTime);
5069
+ await run(options.json, async (store) => itemAnswer(await store.deals.close(ref, {
5070
+ status: outcome,
5071
+ by,
5072
+ ...date === void 0 ? {} : { date },
5073
+ ...options.reason === void 0 ? {} : { reason: options.reason }
5074
+ })));
5075
+ });
5076
+ }, "itemCommands");
5077
+ var percent = /* @__PURE__ */ __name((share) => share === null ? "" : `, ${Math.round(share * 100)}% go on`, "percent");
5078
+ var funnelText = /* @__PURE__ */ __name((report) => [
5079
+ `${report.name} (${report.kind}), ${report.ref}${report.since === null ? "" : `, made since ${report.since}`}`,
5080
+ ...report.stages.map((stage) => ` ${stage.position}. ${stage.name}${stage.outcome === "open" ? "" : ` [${stage.outcome}]`}: ${stage.open} open, ${stage.reached} reached${percent(stage.conversion)}`),
5081
+ ` ${report.totals.items} in all: ${report.totals.open} open, ${report.totals.won} won, ${report.totals.lost} lost` + (report.totals.winRate === null ? "" : `, win rate ${Math.round(report.totals.winRate * 100)}%`)
5082
+ ].join("\n"), "funnelText");
5083
+ var dealCommands = /* @__PURE__ */ __name((program, streams, env) => {
5084
+ const { run, print } = answers(program, streams, env);
5085
+ const pipelines = program.command("pipelines").description("sales pipelines: the stages a deal or a lead goes through, in order, and how many get through each").summary("sales pipelines, their stages and conversion");
5086
+ withQuery(json2(annotate(pipelines.command("list"), { effects: LOCAL_READ })).description("every pipeline with its stages in order and how many open deals or leads stand in each"), PIPELINE_QUERY).summary("every pipeline with its stages").action((words, options) => run(options.json, async (store) => {
5087
+ const terms = queryTerms(words, PIPELINE_QUERY, "pipelines list");
5088
+ const name = terms.get("name")?.toLocaleLowerCase();
5089
+ const kind = terms.get("kind");
5090
+ const all = await store.deals.pipelines(kind === void 0 ? {} : { kind });
5091
+ return wholeList("pipelines list", name === void 0 ? all : all.filter((one2) => one2.name.toLocaleLowerCase() === name));
5092
+ }));
5093
+ json2(annotate(pipelines.command("show"), { effects: LOCAL_READ, output: { entity: "pipeline" } }).option("--since-time <time>", "count only deals or leads made since this day, such as 2026-09-01")).description("one pipeline's funnel: per stage the open deals or leads in it, how many reached it, and the share that went on to the next stage; then won, lost and the win rate").summary("one pipeline's stages with counts and conversion").argument("<pipeline>", "pipeline:<id>, or a name only one pipeline has").action(async (pipeline, options) => {
5094
+ const since = dayOf(options.sinceTime);
5095
+ const report = await withStore(env, (store) => store.deals.pipeline(pipeline, since === void 0 ? {} : { since }));
5096
+ print(options.json, itemAnswer(report), funnelText(report));
5097
+ });
5098
+ json2(annotate(pipelines.command("add"), { effects: LOCAL_WRITE, literal_after_dashes: true }).option("--kind <kind>", "what it holds: deal or lead; deal by default")).description("make a pipeline with its stages in order; a stage named won or lost (any letter case) ends a deal or lead as that").summary("make a pipeline with its stages").argument("<name>", "the pipeline's name, such as Sales").argument("<stage...>", "its stages in order, such as Call Quote Contract won lost").action(async (name, stages, options) => {
5099
+ const kind = options.kind ?? "deal";
5100
+ if (!DEAL_KINDS.includes(kind))
5101
+ throw new CliError("validation_error", "--kind is deal or lead", { param: "--kind" });
5102
+ const by = authorOf(env);
5103
+ await run(options.json, async (store) => itemAnswer(await store.deals.addPipeline({
5104
+ name,
5105
+ kind,
5106
+ stages: stages.map((stage) => {
5107
+ const word = stage.trim().toLocaleLowerCase();
5108
+ return word === "won" || word === "lost" ? { name: stage, outcome: word } : stage;
5109
+ }),
5110
+ by
5111
+ })));
5112
+ });
5113
+ itemCommands(program, "deal", run, env);
5114
+ itemCommands(program, "lead", run, env);
5115
+ }, "dealCommands");
5116
+ var STATUS_DEALS = 5;
5117
+ var openDealsOf = /* @__PURE__ */ __name(async (store, projects) => {
5118
+ const found = (await Promise.all(projects.map((project) => store.deals.list({ project, status: "open" })))).flat();
5119
+ const sorted = found.sort((a, b) => (a.closeDate ?? "9999").localeCompare(b.closeDate ?? "9999") || b.createdAt.localeCompare(a.createdAt));
5120
+ return {
5121
+ deals: sorted.slice(0, STATUS_DEALS).map((deal) => ({
5122
+ ref: deal.ref,
5123
+ title: deal.title,
5124
+ stage: deal.stage,
5125
+ amount: deal.amount,
5126
+ currency: deal.currency,
5127
+ close_date: deal.closeDate
5128
+ })),
5129
+ more: Math.max(sorted.length - STATUS_DEALS, 0)
5130
+ };
5131
+ }, "openDealsOf");
5132
+ var dealsText = /* @__PURE__ */ __name(({ deals, more }) => deals.length === 0 ? [] : [
5133
+ "open deals:",
5134
+ ...deals.map((deal) => {
5135
+ const money = deal.amount === null ? "" : `, ${deal.amount} ${deal.currency}`;
5136
+ const due = deal.close_date === null ? "" : `, close ${deal.close_date}`;
5137
+ return ` ${deal.ref} ${deal.title} \xB7 ${deal.stage}${money}${due}`;
5138
+ }),
5139
+ ...more > 0 ? [` +${more} more: memo deals list status:open`] : []
5140
+ ], "dealsText");
5141
+
4956
5142
  // dist/finance/orders-command.js
4957
5143
  var ORDER_QUERY = {
4958
5144
  entity: "order",
@@ -4985,13 +5171,13 @@ var oneOf2 = /* @__PURE__ */ __name((value, allowed, flag) => {
4985
5171
  throw new CliError("validation_error", `${flag} is one of ${allowed.join(", ")}`, { param: flag });
4986
5172
  return value;
4987
5173
  }, "oneOf");
4988
- var json2 = /* @__PURE__ */ __name((command) => command.option("--json", "print JSON; --json=ref,title keeps only those fields"), "json");
5174
+ var json3 = /* @__PURE__ */ __name((command) => command.option("--json", "print JSON; --json=ref,title keeps only those fields"), "json");
4989
5175
  var orderCommands = /* @__PURE__ */ __name((program, streams, env) => {
4990
5176
  const { run } = answers(program, streams, env);
4991
5177
  const orders = program.command("orders").description("orders you placed or took, for whom, from which shop, and how far delivery got").summary("orders you placed or took, and how far delivery got");
4992
- withQuery(json2(annotate(orders.command("list"), { effects: LOCAL_READ })).description("orders, newest first; review:proposed is what waits for you"), ORDER_QUERY).option("--limit <n>", "most orders, up to 500", positive, 100).action((words, { json: json6, limit }) => run(json6, (store) => listOrders(store, words, limit)));
4993
- json2(annotate(orders.command("show"), { effects: LOCAL_READ, output: { entity: "order" } })).description("one order with its customer, shop, amount, status and the mail it was read from").argument("<ref>", "order:<id>").action((ref, options) => run(options.json, async (store) => itemAnswer(await store.orders.get(ref))));
4994
- json2(byOption(annotate(orders.command("add"), { effects: LOCAL_WRITE, output: { entity: "order" }, literal_after_dashes: true }).option("--kind <kind>", `why it was ordered: ${ORDER_PURPOSES.join(", ")}`).option("--person <uid>", "whom it is for, when not you: person:<id>").option("--organization <organization>", "whom it is for, when not you: organization:<id>").option("--title <title>", "the shop's order number").option("--occurred-time <time>", "the day it was ordered, such as 2026-11-01").option("--project <project>", "the project it belongs to: its key or project:<id>").option("--reason <text>", "why an agent proposes it, for the owner who decides").option("--evidence <ref...>", "what shows it, up to 8: msg:, note:, document: or another reference"))).description("record a placed order; yours is confirmed at once, an agent's waits as proposed for you in memo review").summary("record an order; an agent's waits for your review").argument("<shop>", "the shop or supplier, as its mail names it").argument("[amount]", "the order's amount, a decimal such as 2499.00").argument("[currency]", "ISO 4217, such as RUB; given with the amount").action(async (shop, amount, currency, options, command) => {
5178
+ withQuery(json3(annotate(orders.command("list"), { effects: LOCAL_READ })).description("orders, newest first; review:proposed is what waits for you"), ORDER_QUERY).option("--limit <n>", "most orders, up to 500", positive, 100).action((words, { json: json7, limit }) => run(json7, (store) => listOrders(store, words, limit)));
5179
+ json3(annotate(orders.command("show"), { effects: LOCAL_READ, output: { entity: "order" } })).description("one order with its customer, shop, amount, status and the mail it was read from").argument("<ref>", "order:<id>").action((ref, options) => run(options.json, async (store) => itemAnswer(await store.orders.get(ref))));
5180
+ json3(byOption(annotate(orders.command("add"), { effects: LOCAL_WRITE, output: { entity: "order" }, literal_after_dashes: true }).option("--kind <kind>", `why it was ordered: ${ORDER_PURPOSES.join(", ")}`).option("--person <uid>", "whom it is for, when not you: person:<id>").option("--organization <organization>", "whom it is for, when not you: organization:<id>").option("--title <title>", "the shop's order number").option("--occurred-time <time>", "the day it was ordered, such as 2026-11-01").option("--project <project>", "the project it belongs to: its key or project:<id>").option("--reason <text>", "why an agent proposes it, for the owner who decides").option("--evidence <ref...>", "what shows it, up to 8: msg:, note:, document: or another reference"))).description("record a placed order; yours is confirmed at once, an agent's waits as proposed for you in memo review").summary("record an order; an agent's waits for your review").argument("<shop>", "the shop or supplier, as its mail names it").argument("[amount]", "the order's amount, a decimal such as 2499.00").argument("[currency]", "ISO 4217, such as RUB; given with the amount").action(async (shop, amount, currency, options, command) => {
4995
5181
  const by = await whoRuns(command, env, { asOwner: options.asOwner, question: "record this order as yours?" });
4996
5182
  await run(options.json, async (store) => {
4997
5183
  const customer = partyOf(options, false);
@@ -5281,18 +5467,18 @@ var ACTIONS_QUERY = {
5281
5467
  fields: [termField("status", "enum", "status:proposed", { values: ["proposed", "reviewed"] })],
5282
5468
  defaults: ["status:proposed"]
5283
5469
  };
5284
- var json3 = /* @__PURE__ */ __name((command) => command.option("--json", "print JSON; --json=id,status keeps only those fields"), "json");
5470
+ var json4 = /* @__PURE__ */ __name((command) => command.option("--json", "print JSON; --json=id,status keeps only those fields"), "json");
5285
5471
  var projectActionsCommand = /* @__PURE__ */ __name((projects, streams, env) => {
5286
5472
  const group = projects.command("actions").description("cited key documents and findings an agent proposed for a project, with the evidence to decide them").summary("an agent's proposals for a project, and deciding them");
5287
5473
  const { run } = answers(projects, streams, env);
5288
- json3(annotate(group.command("add"), { effects: LOCAL_WRITE })).description("stage an agent's cited facts and follow-ups about one project for review").argument("<file>", FINDINGS_INPUT_HELP).addHelpText("after", "\nInput: schema_version 1, key, extractor, findings. Every finding names id, kind and evidence: 1\u20138 msg:, document: or note: references with the fingerprint projects evidence or notes show gives. A fact may name a project and a subject (person:, organization:, task: or project:), or neither; a task names its project. Facts name type and statement; tasks name type, title, reason and commitment (explicit or inferred). A due_at or assignee needs due_evidence or assignee_evidence citing this finding's references. A payment names payment {amount, currency, direction to_us|from_us, state paid|expected|cancelled, counterparty, paid_at}: an expected one becomes an invoice and needs a person: or organization: counterparty; a paid or cancelled one names in supersedes the invoice: it settles or voids. At most one project per batch. The same key and input returns the same batch; actions confirm and reject decide it by its id.\n").action(async (file, given, command) => {
5474
+ json4(annotate(group.command("add"), { effects: LOCAL_WRITE })).description("stage an agent's cited facts and follow-ups about one project for review").argument("<file>", FINDINGS_INPUT_HELP).addHelpText("after", "\nInput: schema_version 1, key, extractor, findings. Every finding names id, kind and evidence: 1\u20138 msg:, document: or note: references with the fingerprint projects evidence or notes show gives. A fact may name a project and a subject (person:, organization:, task: or project:), or neither; a task names its project. Facts name type and statement; tasks name type, title, reason and commitment (explicit or inferred). A due_at or assignee needs due_evidence or assignee_evidence citing this finding's references. A payment names payment {amount, currency, direction to_us|from_us, state paid|expected|cancelled, counterparty, paid_at}: an expected one becomes an invoice and needs a person: or organization: counterparty; a paid or cancelled one names in supersedes the invoice: it settles or voids. At most one project per batch. The same key and input returns the same batch; actions confirm and reject decide it by its id.\n").action(async (file, given, command) => {
5289
5475
  const input = parseEvidenceFindingsJson(await readFindingsInput(file, environmentOf(projects).stdin ?? process.stdin));
5290
5476
  const author = await whoRuns(command, env, { question: "" });
5291
5477
  if (author === "owner")
5292
5478
  throw new CliError("validation_error", "findings are an agent's proposals; record your own with memo facts add");
5293
5479
  await run(given.json, async (store) => itemAnswer(await store.evidenceFindings.stage(input, author)));
5294
5480
  });
5295
- withQuery(json3(answerEntity(annotate(group.command("list"), { effects: LOCAL_READ }), "project_action", union([
5481
+ withQuery(json4(answerEntity(annotate(group.command("list"), { effects: LOCAL_READ }), "project_action", union([
5296
5482
  strictObject({
5297
5483
  kind: literal("key_document"),
5298
5484
  id: string(),
@@ -5333,7 +5519,7 @@ var projectActionsCommand = /* @__PURE__ */ __name((projects, streams, env) => {
5333
5519
  });
5334
5520
  }));
5335
5521
  for (const name of ["confirm", "reject"]) {
5336
- const command = byOption(json3(annotate(group.command(name), { effects: LOCAL_WRITE })).description(name === "confirm" ? "confirm a suggested key document, or create the named findings of a batch and reject its other new ones; an agent decides for you only when agent_decisions is true, and with --reason" : "reject a suggested key document, or every new finding of a batch").summary(name === "confirm" ? "confirm a proposal, yours or an agent's with --reason" : "reject a proposal").argument("<project>", "the project's id, project:<id>, key, exact name or alias").argument("<id>", "key:<id> for a key document, or a findings batch number, as projects actions list gives them"));
5522
+ const command = byOption(json4(annotate(group.command(name), { effects: LOCAL_WRITE })).description(name === "confirm" ? "confirm a suggested key document, or create the named findings of a batch and reject its other new ones; an agent decides for you only when agent_decisions is true, and with --reason" : "reject a suggested key document, or every new finding of a batch").summary(name === "confirm" ? "confirm a proposal, yours or an agent's with --reason" : "reject a proposal").argument("<project>", "the project's id, project:<id>, key, exact name or alias").argument("<id>", "key:<id> for a key document, or a findings batch number, as projects actions list gives them"));
5337
5523
  if (name === "confirm")
5338
5524
  command.argument("[findings...]", "the finding IDs of a batch to create");
5339
5525
  command.option("--fingerprint <hash>", "a findings batch's fingerprint, as projects actions list gives it").option("--reason <text>", "why, in a few words; required when an agent decides for you").action(async (reference2, id, ...rest) => {
@@ -5794,7 +5980,7 @@ var projectGatherCommand = /* @__PURE__ */ __name((projects, print, env, warn) =
5794
5980
  // dist/knowledge/project-status-command.js
5795
5981
  var withFinance = /* @__PURE__ */ __name((row) => ({
5796
5982
  ...row,
5797
- sections: { ...row.sections, finance: "memo_finance" }
5983
+ sections: { ...row.sections, finance: "memo_finance", deals: "memo_deal" }
5798
5984
  }), "withFinance");
5799
5985
  var titled = /* @__PURE__ */ __name(async (store, found) => {
5800
5986
  const summaries = await store.refs.summaries(found.chats.map((chat) => chat.ref));
@@ -5825,14 +6011,14 @@ var outside = /* @__PURE__ */ __name((blocked) => (step, found) => {
5825
6011
  };
5826
6012
  }, "outside");
5827
6013
  var asAction = /* @__PURE__ */ __name((step) => step.kind === "command" ? { kind: "user_action", step: step.step, why: `${step.why}: ${step.line}`, safe_to_auto_execute: false } : step, "asAction");
5828
- var projectStatusCommand = /* @__PURE__ */ __name((projects, print, env) => answerEntity(annotate(projects.command("status"), { effects: LOCAL_READ, partial: true }), "project_status", projectStatusSchema, { row: withFinance(projectStatusRow(STATUS_SIGNALS)) }).description("where a project stands, from the stored messages of every chat confirmed as the project's or its child projects', in every account those links name (meta.accounts lists them): the last message, who replies next, open questions both ways, promises, amounts with their direction, payments recorded, billed, paid and owed per currency from confirmed invoices and payments (finance), how long each --context-query has been quiet on their side, and how much of each chat is held. Amounts, directions and promises found by words are marked pattern: read the cited message before trusting one. Others' questions in a group with no role, and others' word-found promises in a group, are counted on the chat's row as unlisted, not listed. next names at most two chats to read, with the messenger command that reads them. No model call; nothing leaves this machine").summary("where a project stands: whose move, open asks, money, chats to read next").argument("<project>", "an existing project's id, project:<id>, key, exact name or alias").option("--since-time <time>", "how far back: days (60d, at most 730d) or a start date (2026-09-01)", "60d").option("--before-time <time>", "fixed exclusive end: ISO 8601 timestamp with UTC offset; days back count from it").option("--context-query <words>", "words that all appear in one text; reports their last mention per side. Repeat for another", collect, []).option("--sync-profile <tool=profile>", "the messenger profile the next steps name when several are signed in to a chat's account, such as max=default; repeat for another tool", syncProfileOf).option("--purpose <purpose>", "the linked chats' purposes to read, comma-separated: work, sales, support, other, or all; default work", purposeList).addOption(annotateOption(new Option("--compact", "one line per signal, chat and next step, for an agent"), { mcp: false })).option("--json", "print JSON; --json=id,title keeps only those fields").action(async (project, options) => {
6014
+ var projectStatusCommand = /* @__PURE__ */ __name((projects, print, env) => answerEntity(annotate(projects.command("status"), { effects: LOCAL_READ, partial: true }), "project_status", projectStatusSchema, { row: withFinance(projectStatusRow(STATUS_SIGNALS)) }).description("where a project stands, from the stored messages of every chat confirmed as the project's or its child projects', in every account those links name (meta.accounts lists them): the last message, who replies next, open questions both ways, promises, amounts with their direction, payments recorded, billed, paid and owed per currency from confirmed invoices and payments (finance), up to five open confirmed deals (deals), how long each --context-query has been quiet on their side, and how much of each chat is held. Amounts, directions and promises found by words are marked pattern: read the cited message before trusting one. Others' questions in a group with no role, and others' word-found promises in a group, are counted on the chat's row as unlisted, not listed. next names at most two chats to read, with the messenger command that reads them. No model call; nothing leaves this machine").summary("where a project stands: whose move, open asks, money, chats to read next").argument("<project>", "an existing project's id, project:<id>, key, exact name or alias").option("--since-time <time>", "how far back: days (60d, at most 730d) or a start date (2026-09-01)", "60d").option("--before-time <time>", "fixed exclusive end: ISO 8601 timestamp with UTC offset; days back count from it").option("--context-query <words>", "words that all appear in one text; reports their last mention per side. Repeat for another", collect, []).option("--sync-profile <tool=profile>", "the messenger profile the next steps name when several are signed in to a chat's account, such as max=default; repeat for another tool", syncProfileOf).option("--purpose <purpose>", "the linked chats' purposes to read, comma-separated: work, sales, support, other, or all; default work", purposeList).addOption(annotateOption(new Option("--compact", "one line per signal, chat and next step, for an agent"), { mcp: false })).option("--json", "print JSON; --json=id,title keeps only those fields").action(async (project, options) => {
5829
6015
  if (options.compact && options.json)
5830
6016
  throw new CliError("validation_error", "--compact and --json ask for different output \u2014 pick one", {
5831
6017
  reason: "output.conflict",
5832
6018
  param: "--compact"
5833
6019
  });
5834
6020
  const chosen = options.syncProfile ?? {};
5835
- const { found, finance } = await withStore(env, async (store) => {
6021
+ const { found, finance, open } = await withStore(env, async (store) => {
5836
6022
  const status = await projectStatus(store, {
5837
6023
  project,
5838
6024
  ...projectWindowOf(options.sinceTime),
@@ -5840,8 +6026,9 @@ var projectStatusCommand = /* @__PURE__ */ __name((projects, print, env) => answ
5840
6026
  contextQueries: options.contextQuery,
5841
6027
  ...options.purpose ? { purposes: options.purpose } : {}
5842
6028
  });
5843
- const books = await financeOf(store, [status.project.ref, ...status.children.map((child) => child.ref)]);
5844
- return { found: await titled(store, status), finance: books };
6029
+ const projects2 = [status.project.ref, ...status.children.map((child) => child.ref)];
6030
+ const books = await financeOf(store, projects2);
6031
+ return { found: await titled(store, status), finance: books, open: await openDealsOf(store, projects2) };
5845
6032
  });
5846
6033
  const blocked = /* @__PURE__ */ new Set();
5847
6034
  const step = outside(blocked);
@@ -5852,11 +6039,16 @@ var projectStatusCommand = /* @__PURE__ */ __name((projects, print, env) => answ
5852
6039
  };
5853
6040
  const { item, next, missing, meta } = projectStatusAnswer(found, hints);
5854
6041
  const gaps = [...missing, ...blocked.size ? [{ field: "next_command", why: [...blocked].join("; ") }] : []];
5855
- print(options.json, itemOf({ ...item, ...finance.length ? { finance } : {} }, {
6042
+ print(options.json, itemOf({
6043
+ ...item,
6044
+ ...finance.length ? { finance } : {},
6045
+ ...open.deals.length ? { deals: open.deals } : {},
6046
+ ...open.more ? { deals_more: open.more } : {}
6047
+ }, {
5856
6048
  ...next.length ? { next: next.map(asAction) } : {},
5857
6049
  ...gaps.length ? { missing: gaps } : {},
5858
6050
  meta
5859
- }), [projectStatusText(found, hints), ...financeText(finance)].join("\n"), options.compact === true);
6051
+ }), [projectStatusText(found, hints), ...financeText(finance), ...dealsText(open)].join("\n"), options.compact === true);
5860
6052
  }), "projectStatusCommand");
5861
6053
 
5862
6054
  // dist/knowledge/project-transfer.js
@@ -6297,18 +6489,14 @@ Input: schema_version 1, key, extractor, findings. key is the one \`mail review
6297
6489
  mail-findings.add step (mail-triage:9123456, or mail-triage:9123456-r1 after the owner moved the mark back); pass it
6298
6490
  as --key or in the JSON. The same key and input give the same batch, the same key with another input is refused. 1\u201330 findings, at most 5 from one sender; each cites 1\u20138 msg:email/\u2026 references with the
6299
6491
  fingerprint review gave, and at least one email of this mailbox.
6300
- Kinds: task (type bug|feature|chore, title, reason, commitment explicit|inferred, optional project, due_at with
6301
- due_evidence, assignee with assignee_evidence; no project means the mailbox's inbox project) \xB7 task_update (task,
6302
- change close|due|detail, reason; due needs due_at, detail needs detail) \xB7 fact (type, statement, subject or project)
6303
- \xB7 memory (memory_kind, scope, body, subject or project) \xB7 link (from, to, reason: contact:email/<address> \u2192 person:N,
6304
- person:N \u2192 organization:N, chat:email/\u2026 \u2192 project:N) \xB7 new_contact (address of a cited email's sender or recipient,
6305
- name, reason) \xB7 invoice (direction receivable|payable, counterparty person:N|organization:N or counterparty_name with
6306
- optional counterparty_email, currency, lines of description and amount, optional total, number, issue_date,
6307
- due_date, project) \xB7 payment (direction in|out, amount,
6308
- currency, date, optional payer or payer_name, payee or payee_name, reference, allocations of stored invoices) \xB7
6309
- order (purpose personal|business|client|other, supplier_name, optional customer or customer_name, supplier, number,
6310
- total with currency, status, order_date, invoice, payment, source_url) \xB7 order_update (supplier_name and number of
6311
- a stored order, status, date when delivered).
6492
+ Every finding gives id, kind, evidence and the fields its kind needs, reason among them; the others are optional:
6493
+ ${mailFindingFieldsHelp()}
6494
+ A task's due_at is a timestamp with a timezone and comes with due_evidence, the cited refs that give the date:
6495
+ "due_at":"2026-11-09T09:00:00Z","due_evidence":["msg:email/\u2026"]; assignee comes with assignee_evidence the same way.
6496
+ An invoice names counterparty (person:N or organization:N) or counterparty_name. A task_update's due change gives
6497
+ due_at, its detail change gives detail; a link goes contact:email/<address> \u2192 person:N, person:N \u2192 organization:N or
6498
+ chat:email/\u2026 \u2192 project:N; a memory is about a subject or a project; an order_update names a stored order, with date
6499
+ only when delivered.
6312
6500
  An invoice, payment or order is checked as memo invoices|payments|orders add checks yours; a refusal names why.
6313
6501
  A cited email that changed since review refuses the batch (mail-findings.stale), one still partial too
6314
6502
  (mail-findings.partial). Nothing is created until the owner confirms: memo review confirm <batch>/<finding>.
@@ -6339,11 +6527,11 @@ var keyed = /* @__PURE__ */ __name((text2, key) => {
6339
6527
  });
6340
6528
  return JSON.stringify({ ...raw, key });
6341
6529
  }, "keyed");
6342
- var json4 = /* @__PURE__ */ __name((command) => command.option("--json", "print JSON; --json=id,status keeps only those fields"), "json");
6530
+ var json5 = /* @__PURE__ */ __name((command) => command.option("--json", "print JSON; --json=id,status keeps only those fields"), "json");
6343
6531
  var mailFindingsCommand = /* @__PURE__ */ __name((program, mail, streams, env) => {
6344
6532
  const { run } = answers(program, streams, env);
6345
6533
  const findings = mail.command("findings").description("cited tasks, task updates, facts, memories, links, contacts, invoices, payments and orders an agent read in new mail").summary("what an agent read in new mail, cited, waiting for the owner");
6346
- json4(proposesOnly(annotate(findings.command("add"), { effects: LOCAL_WRITE, output: { entity: "mail_findings" } }))).description("stage one mailbox's findings for the owner; nothing is created until the owner confirms").summary("stage one mailbox's findings; the owner confirms them").argument("<file>", FINDINGS_INPUT_HELP).option("--source <accounts>", MAILBOX_HELP).option("--key <key>", "the findings key `mail review --holder` gave in its mail-findings.add step").option("--dry-run", "check the batch as staging would, invoices, payments and orders tried and rolled back, and stage nothing; answers valid and every finding's problem at once").addHelpText("after", INPUT_HELP).action(async (file, given) => {
6534
+ json5(proposesOnly(annotate(findings.command("add"), { effects: LOCAL_WRITE, output: { entity: "mail_findings" } }))).description("stage one mailbox's findings for the owner; nothing is created until the owner confirms").summary("stage one mailbox's findings; the owner confirms them").argument("<file>", FINDINGS_INPUT_HELP).option("--source <accounts>", MAILBOX_HELP).option("--key <key>", "the findings key `mail review --holder` gave in its mail-findings.add step").option("--dry-run", "check the batch as staging would, invoices, payments and orders tried and rolled back, and stage nothing; answers valid and every finding's problem at once").addHelpText("after", INPUT_HELP).action(async (file, given) => {
6347
6535
  const read = await readFindingsInput(file, environmentOf(program).stdin ?? process.stdin);
6348
6536
  const text2 = keyed(read, given.key);
6349
6537
  const input = given.dryRun ? readMailFindingsJson(text2) : parseMailFindingsJson(text2);
@@ -6362,8 +6550,8 @@ var mailFindingsCommand = /* @__PURE__ */ __name((program, mail, streams, env) =
6362
6550
  return itemAnswer({ dryRun: true, ...checked }, issues.length ? { meta: { complete: false, issues } } : void 0);
6363
6551
  });
6364
6552
  });
6365
- json4(annotate(findings.command("show"), { effects: LOCAL_READ, output: { entity: "mail_findings" } })).description("one findings batch: its findings with their evidence, earlier decisions and the review receipt").summary("one findings batch with its evidence and decisions").argument("<id>", "the batch id `mail findings add` or `list` gave").action((id, given) => run(given.json, async (store) => itemAnswer(await store.mailFindings.get(id))));
6366
- withQuery(json4(annotate(findings.command("list"), { effects: LOCAL_READ, output: { entity: "mail_findings" } })), FINDINGS_QUERY2).description("mail findings batches, newest first; status:proposed is what waits for the owner").option("--source <accounts>", "only this mailbox's batches: email:<address>").option("--limit <n>", "batches per page, at most 50", positive, 20).option("--page <n>", "which page, from 1", positive, 1).action((words, given) => run(given.json, async (store) => {
6553
+ json5(annotate(findings.command("show"), { effects: LOCAL_READ, output: { entity: "mail_findings" } })).description("one findings batch: its findings with their evidence, earlier decisions and the review receipt").summary("one findings batch with its evidence and decisions").argument("<id>", "the batch id `mail findings add` or `list` gave").action((id, given) => run(given.json, async (store) => itemAnswer(await store.mailFindings.get(id))));
6554
+ withQuery(json5(annotate(findings.command("list"), { effects: LOCAL_READ, output: { entity: "mail_findings" } })), FINDINGS_QUERY2).description("mail findings batches, newest first; status:proposed is what waits for the owner").option("--source <accounts>", "only this mailbox's batches: email:<address>").option("--limit <n>", "batches per page, at most 50", positive, 20).option("--page <n>", "which page, from 1", positive, 1).action((words, given) => run(given.json, async (store) => {
6367
6555
  const status = queryTerms(words, FINDINGS_QUERY2, "mail findings list").get("status");
6368
6556
  const account2 = given.source ? await oneMailboxOf(store, env, given.source) : void 0;
6369
6557
  const found = await store.mailFindings.list({
@@ -6503,10 +6691,10 @@ var mcpCommandDefinition = /* @__PURE__ */ __name((program, streams, env, create
6503
6691
  }).summary("serve this profile's commands to an AI agent").description("serve memo commands over MCP on stdio or authenticated HTTP, limited by saved permissions").option("--permission <key=level>", "tighten one saved permission for this server; repeat for more keys", (value, previous = []) => [...previous, value]).option("--http", "serve on 127.0.0.1 behind an HTTPS tunnel with an owner access-code login").option("--port <port>", `local HTTP port (default ${DEFAULT_PORT}); requires --http`).option("--public-url <url>", "tunnel's HTTPS address without /mcp, or a path of it such as https://<name>.ts.net/memo; requires --http").action(async (options) => {
6504
6692
  if (!options.http && (options.port !== void 0 || options.publicUrl !== void 0))
6505
6693
  throw new CliError("validation_error", "--port and --public-url require --http");
6506
- const { createMemoServer } = await import("./server-HAZC3T7X.js");
6694
+ const { createMemoServer } = await import("./server-XLMROR5L.js");
6507
6695
  const build = /* @__PURE__ */ __name(() => createMemoServer(env, createProgram2, options.permission), "build");
6508
6696
  if (options.http) {
6509
- const { httpLockFile, mcpUrlOf, portOf, publicUrlOf, serveOverHttp } = await import("./mcp-DHX4GF3A.js");
6697
+ const { httpLockFile, mcpUrlOf, portOf, publicUrlOf, serveOverHttp } = await import("./mcp-I5KREUIV.js");
6510
6698
  const publicUrl = publicUrlOf(options.publicUrl, {
6511
6699
  missing: "--http",
6512
6700
  reaches: "the browser apps reach memo",
@@ -6558,7 +6746,7 @@ var mcpCommandDefinition = /* @__PURE__ */ __name((program, streams, env, create
6558
6746
  });
6559
6747
  });
6560
6748
  annotate(mcp2.command("revoke"), { effects: LOCAL_WRITE, mcp: false, examples: ["memo mcp revoke --json"] }).summary("forget every login given to a browser app").description("forget every login `memo mcp serve --http` gave a browser app; each app must log in again").option("--json", "print JSON").action(async function() {
6561
- const { revokeAll } = await import("./mcp-DHX4GF3A.js");
6749
+ const { revokeAll } = await import("./mcp-I5KREUIV.js");
6562
6750
  revokeAll(httpTokenFile(env));
6563
6751
  out.print(this.opts().json, itemAnswer({ revoked: true }));
6564
6752
  });
@@ -7089,14 +7277,14 @@ var notesCommandDefinition = /* @__PURE__ */ __name((program, streams, env) => {
7089
7277
  ...answer.backlinks.length ? [`linked from: ${answer.backlinks.map(({ from }) => from).join(", ")}`] : []
7090
7278
  ].join("\n"));
7091
7279
  });
7092
- withQuery(annotate(notes2.command("list"), { effects: LOCAL_READ }).description("notes, newest first"), NOTES_LIST_QUERY).option("--limit <n>", "most notes, at most 500", positive, 20).option("--page <n>", "which page, from 1", positive, 1).option("--json", "print JSON; --json=id,title keeps only those fields").action(async (words, { json: json6, ...paging }) => {
7280
+ withQuery(annotate(notes2.command("list"), { effects: LOCAL_READ }).description("notes, newest first"), NOTES_LIST_QUERY).option("--limit <n>", "most notes, at most 500", positive, 20).option("--page <n>", "which page, from 1", positive, 1).option("--json", "print JSON; --json=id,title keeps only those fields").action(async (words, { json: json7, ...paging }) => {
7093
7281
  const terms = queryTerms(words, NOTES_LIST_QUERY, "notes list");
7094
7282
  const about = terms.get("about");
7095
7283
  const source = terms.get("source");
7096
7284
  const search2 = terms.get("text");
7097
7285
  if (about !== void 0 && terms.size > 1)
7098
7286
  throw new CliError("validation_error", "about: stands alone in notes list: its notes are found through links");
7099
- const options = { ...paging, json: json6 };
7287
+ const options = { ...paging, json: json7 };
7100
7288
  const page = await withNotes(async (store) => listNotes(store, {
7101
7289
  limit: options.limit,
7102
7290
  offset: (options.page - 1) * options.limit,
@@ -7446,6 +7634,28 @@ var recordsCommand = /* @__PURE__ */ __name((program, streams, env) => {
7446
7634
  }, "recordsCommand");
7447
7635
 
7448
7636
  // dist/review/command.js
7637
+ var COUNTED = strictObject({
7638
+ count: number(),
7639
+ kinds: record(string(), number()),
7640
+ complete: boolean()
7641
+ });
7642
+ var REVIEW_STATUS = strictObject({
7643
+ since: string(),
7644
+ at: string(),
7645
+ /** Per mail account, `email:<address>`: threads with new mail since, owed and waiting ones, the agents' marks. */
7646
+ mail: array(strictObject({
7647
+ account: string(),
7648
+ threads: number(),
7649
+ owed: number(),
7650
+ waiting: number(),
7651
+ coverage: array(mailMark)
7652
+ })),
7653
+ /** Proposed since `since`, whatever became of them. */
7654
+ proposed: COUNTED,
7655
+ /** Waiting for the owner now. */
7656
+ waiting: COUNTED,
7657
+ quiet: boolean()
7658
+ });
7449
7659
  var PROPOSAL = strictObject({
7450
7660
  id: string(),
7451
7661
  kind: string(),
@@ -7478,11 +7688,11 @@ var ROW = {
7478
7688
  ],
7479
7689
  text: ["reason"]
7480
7690
  };
7481
- var json5 = /* @__PURE__ */ __name((command) => command.option("--json", "print JSON; --json=id,title keeps only those fields"), "json");
7691
+ var json6 = /* @__PURE__ */ __name((command) => command.option("--json", "print JSON; --json=id,title keeps only those fields"), "json");
7482
7692
  var reviewCommand = /* @__PURE__ */ __name((program, streams, env) => {
7483
7693
  const { print } = answers(program, streams, env);
7484
7694
  const review = program.command("review").description("every proposal waiting for your decision, across projects: links, key documents, facts, invoices, payments and more").summary("every proposal waiting for your decision, across projects");
7485
- json5(answerEntity(withQuery(annotate(review.command("list", { isDefault: true }), { effects: LOCAL_READ }).description("what waits for the owner's decision, newest first, with titles, who proposed it, why and the evidence").summary("what waits for your decision, newest first, with titles and evidence"), REVIEW_QUERY), "memo_proposal", PROPOSAL, { row: ROW })).option("--limit <n>", "proposals per page, at most 50", positive, 20).option("--page <n>", "which page, from 1", positive, 1).option("--compact", "one line per proposal").action(async (words, given) => {
7695
+ json6(answerEntity(withQuery(annotate(review.command("list", { isDefault: true }), { effects: LOCAL_READ }).description("what waits for the owner's decision, newest first, with titles, who proposed it, why and the evidence").summary("what waits for your decision, newest first, with titles and evidence"), REVIEW_QUERY), "memo_proposal", PROPOSAL, { row: ROW })).option("--limit <n>", "proposals per page, at most 50", positive, 20).option("--page <n>", "which page, from 1", positive, 1).option("--compact", "one line per proposal").action(async (words, given) => {
7486
7696
  if (given.limit > 50)
7487
7697
  throw new CliError("validation_error", "--limit is at most 50", { param: "limit" });
7488
7698
  const found = await withStore(env, (store) => listReview(store, env, words, given));
@@ -7497,7 +7707,7 @@ var reviewCommand = /* @__PURE__ */ __name((program, streams, env) => {
7497
7707
  });
7498
7708
  print(given.json, body, reviewText(found.items, found.hasMore), given.compact);
7499
7709
  });
7500
- json5(annotate(review.command("show"), { effects: LOCAL_READ })).description("one proposal with its titles, signals and the text around each piece of evidence").argument("<id>", "the proposal's id, as review lists it: 17070, fact:512, memory:88, link:17, payment:4, close:Q-15").option("--brief", "only references and their titles, without excerpts or nearby text").option("--before-n <n>", "messages or document paragraphs before the evidence, at most 5", whole, 2).option("--after-n <n>", "messages or document paragraphs after the evidence, at most 5", whole, 2).option("--compact", "one line, as review prints it").action(async (id, given) => {
7710
+ json6(annotate(review.command("show"), { effects: LOCAL_READ })).description("one proposal with its titles, signals and the text around each piece of evidence").argument("<id>", "the proposal's id, as review lists it: 17070, fact:512, memory:88, link:17, payment:4, close:Q-15").option("--brief", "only references and their titles, without excerpts or nearby text").option("--before-n <n>", "messages or document paragraphs before the evidence, at most 5", whole, 2).option("--after-n <n>", "messages or document paragraphs after the evidence, at most 5", whole, 2).option("--compact", "one line, as review prints it").action(async (id, given) => {
7501
7711
  const body = await withStore(env, async (store) => {
7502
7712
  const shown = await showReview(store, env, id);
7503
7713
  const window = {
@@ -7519,7 +7729,7 @@ var reviewCommand = /* @__PURE__ */ __name((program, streams, env) => {
7519
7729
  print(given.json, body, void 0, given.compact);
7520
7730
  });
7521
7731
  for (const name of ["confirm", "reject"]) {
7522
- const command = byOption(json5(annotate(review.command(name), { effects: LOCAL_WRITE }))).description(name === "confirm" ? "confirm proposals by id or range (17070-17079,fact:500-502,17080/f1); each is decided on its own, so a refusal leaves the others decided. An agent decides only with --reason, never its own or a scan's" : "turn proposals down by id or range, with why; each is decided on its own").summary(name === "confirm" ? "confirm proposals by id or range; each on its own" : "turn proposals down, with why").argument("<ids...>", name === "confirm" ? "ids or ranges as review lists them; 17080/f1 accepts that finding and rejects the batch's others" : "ids or ranges as review lists them; a batch is turned down whole");
7732
+ const command = byOption(json6(annotate(review.command(name), { effects: LOCAL_WRITE }))).description(name === "confirm" ? "confirm proposals by id or range (17070-17079,fact:500-502,17080/f1); each is decided on its own, so a refusal leaves the others decided. An agent decides only with --reason, never its own or a scan's" : "turn proposals down by id or range, with why; each is decided on its own").summary(name === "confirm" ? "confirm proposals by id or range; each on its own" : "turn proposals down, with why").argument("<ids...>", name === "confirm" ? "ids or ranges as review lists them; 17080/f1 accepts that finding and rejects the batch's others" : "ids or ranges as review lists them; a batch is turned down whole");
7523
7733
  if (name === "confirm")
7524
7734
  command.option("--reason <text>", "why, in a few words; required when an agent decides");
7525
7735
  else
@@ -7540,7 +7750,7 @@ var reviewCommand = /* @__PURE__ */ __name((program, streams, env) => {
7540
7750
  print(given.json, itemAnswer(result, issues.length ? { meta: { complete: false, issues } } : void 0), decidedText(result), given.compact);
7541
7751
  });
7542
7752
  }
7543
- json5(annotate(review.command("status"), { effects: LOCAL_READ, output: { entity: "review_status" } })).summary("since yesterday: new mail, what is owed and waiting, what agents proposed").description("the owner's daily look, with no model call: per mail account the threads with new mail, what you owe and wait for, and how far each agent's processing mark has read; then what was proposed and what waits").option("--since-time <time>", "how far back: hours or days (12h, 7d) or a start date (2026-11-01)", "1d").action(async (given) => {
7753
+ json6(answerEntity(annotate(review.command("status"), { effects: LOCAL_READ }), "review_status", REVIEW_STATUS)).summary("since yesterday: new mail, what is owed and waiting, what agents proposed").description("the owner's daily look, with no model call: per mail account the threads with new mail, what you owe and wait for, and how far each agent's processing mark has read; then what was proposed and what waits").option("--since-time <time>", "how far back: hours or days (12h, 7d) or a start date (2026-11-01)", "1d").action(async (given) => {
7544
7754
  const since = /^\d{4}-\d{2}-\d{2}/.test(given.sinceTime) ? Date.parse(given.sinceTime) : Date.now() - parseDuration(given.sinceTime, "--since-time");
7545
7755
  if (Number.isNaN(since))
7546
7756
  throw new CliError("validation_error", `--since-time takes 12h, 7d or a date, not "${given.sinceTime}"`, {
@@ -8045,8 +8255,8 @@ For an agent: read with --compact, one line per hit with its reference. Never wr
8045
8255
  for (const { source, reason } of answer.skipped)
8046
8256
  streams.diagnostic(`${source} not searched: ${reason}
8047
8257
  `);
8048
- const { limit, page, json: json6, ...rest } = options;
8049
- print(json6, notesAnswer(answer, limit, page, { query: words.join(" "), ...rest }), searchText(answer, (page - 1) * limit));
8258
+ const { limit, page, json: json7, ...rest } = options;
8259
+ print(json7, notesAnswer(answer, limit, page, { query: words.join(" "), ...rest }), searchText(answer, (page - 1) * limit));
8050
8260
  });
8051
8261
  searchMemoriesCommand(group, streams, env);
8052
8262
  annotate(group.command("people"), { effects: LOCAL_READ, output: { entity: "person" } }).description("people whose name, username or alias holds every word, in every account unless --source narrows it; each with its person:<id> for --contact and its identities").summary("people by name across every account").argument("<name...>", "parts of the name, username or alias; case and accents do not matter").option("--source <accounts>", ACCOUNTS_HELP).option("--limit <n>", "most people, at most 100", (value) => {
@@ -8989,6 +9199,69 @@ var OWN_ENTITIES = entityFields({
8989
9199
  agent_action: ["id", "actor", "tool", "tier", "target", "status", "error", "started_at", "finished_at"],
8990
9200
  meeting_project: ["id", "meeting", "project", "confirmed", "provenance", "fingerprint"],
8991
9201
  notes_folder: ["id", "name", "path", "format", "kept_by"],
9202
+ deal: [
9203
+ "id",
9204
+ "ref",
9205
+ "kind",
9206
+ "title",
9207
+ "summary",
9208
+ "pipeline",
9209
+ "pipeline_name",
9210
+ "stage",
9211
+ "status",
9212
+ "organization",
9213
+ "currency",
9214
+ "amount",
9215
+ "close_date",
9216
+ "closed_date",
9217
+ "closed_reason",
9218
+ "rank",
9219
+ "deal",
9220
+ "account",
9221
+ "external_id",
9222
+ "people",
9223
+ "author",
9224
+ "model",
9225
+ "source",
9226
+ "reason",
9227
+ "project",
9228
+ "project_name",
9229
+ "created_at",
9230
+ "updated_at",
9231
+ "evidence"
9232
+ ],
9233
+ lead: [
9234
+ "id",
9235
+ "ref",
9236
+ "kind",
9237
+ "title",
9238
+ "summary",
9239
+ "pipeline",
9240
+ "pipeline_name",
9241
+ "stage",
9242
+ "status",
9243
+ "organization",
9244
+ "currency",
9245
+ "amount",
9246
+ "close_date",
9247
+ "closed_date",
9248
+ "closed_reason",
9249
+ "rank",
9250
+ "deal",
9251
+ "account",
9252
+ "external_id",
9253
+ "people",
9254
+ "author",
9255
+ "model",
9256
+ "source",
9257
+ "reason",
9258
+ "project",
9259
+ "project_name",
9260
+ "created_at",
9261
+ "updated_at",
9262
+ "evidence"
9263
+ ],
9264
+ pipeline: ["id", "ref", "name", "kind", "account", "external_id", "stages", "totals", "since", "created_at"],
8992
9265
  order: [
8993
9266
  "id",
8994
9267
  "ref",
@@ -9151,6 +9424,7 @@ var createProgram = /* @__PURE__ */ __name(({ streams: raw = processStreams, env
9151
9424
  factsCommand(program, streams, env);
9152
9425
  financeCommands(program, streams, env);
9153
9426
  orderCommands(program, streams, env);
9427
+ dealCommands(program, streams, env);
9154
9428
  recordsCommand(program, streams, env);
9155
9429
  findingsCommand(program, streams, env);
9156
9430
  actionsCommand(program, streams, env);
@@ -9173,10 +9447,10 @@ var createProgram = /* @__PURE__ */ __name(({ streams: raw = processStreams, env
9173
9447
  const skill2 = customizeSharedCommand(skillCommand2(APP, new URL("../skills/cli-memo/SKILL.md", new URL("../program.js", import.meta.url).href)), "Memo installs its own stored-data instructions through its environment, prints the packaged primary skill without filesystem effects, and takes --json on each skill command because it has no global one.", () => {
9174
9448
  const out = answers(program, streams, env);
9175
9449
  const skill3 = skillCommand(APP, new URL("../skills/cli-memo/SKILL.md", new URL("../program.js", import.meta.url).href), (command) => {
9176
- const json6 = command.opts().json === true;
9177
- const renderer = createRenderer({ format: json6 ? "json" : "pretty", color: false, streams });
9450
+ const json7 = command.opts().json === true;
9451
+ const renderer = createRenderer({ format: json7 ? "json" : "pretty", color: false, streams });
9178
9452
  return {
9179
- renderer: json6 ? { ...renderer, result: /* @__PURE__ */ __name((value) => out.print(true, itemAnswer(value)), "result") } : renderer,
9453
+ renderer: json7 ? { ...renderer, result: /* @__PURE__ */ __name((value) => out.print(true, itemAnswer(value)), "result") } : renderer,
9180
9454
  streams,
9181
9455
  env
9182
9456
  };