@wirecat/cli-memo 0.131.76 → 0.131.77

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 (154) hide show
  1. package/dist/bin/memo.js +2 -2
  2. package/dist/bin/memo.js.map +1 -1
  3. package/dist/bundle/{all-profiles-CGQTLFDM.js → all-profiles-4UWCPMRQ.js} +10 -8
  4. package/dist/bundle/{anthropic-C744EPRR.js → anthropic-HECHQVOK.js} +7 -5
  5. package/dist/bundle/{app-server-LOH7WXAB.js → app-server-GQEQWFYQ.js} +42 -40
  6. package/dist/bundle/auto-3O7JD27U.js +91 -0
  7. package/dist/bundle/{bun-SQWZDSWT.js → bun-IWGIAD7H.js} +2 -2
  8. package/dist/bundle/{bun-sqlite-YVBFXNWB.js → bun-sqlite-VJFM4TVN.js} +7 -5
  9. package/dist/bundle/{chunk-7OZEQIK7.js → chunk-2DLCQ4AK.js} +1 -1
  10. package/dist/bundle/{chunk-W46O6RJ5.js → chunk-2IQWMWMC.js} +42 -130
  11. package/dist/bundle/{chunk-4O2MYFYC.js → chunk-3EPBPSP6.js} +1 -1
  12. package/dist/bundle/{chunk-KEBL3PY4.js → chunk-3QBRLN6T.js} +2 -2
  13. package/dist/bundle/{chunk-NE3UIK5P.js → chunk-3URQNBDV.js} +2 -2
  14. package/dist/bundle/{chunk-SF2OLWBU.js → chunk-4EFQOTNQ.js} +7 -7
  15. package/dist/bundle/{chunk-5NY7U6CM.js → chunk-4VO2RJAE.js} +12 -10
  16. package/dist/bundle/{chunk-AUCXJVUI.js → chunk-5APYWW46.js} +34 -32
  17. package/dist/bundle/{chunk-VYCLOFPC.js → chunk-6A37YXAL.js} +6 -184
  18. package/dist/bundle/{chunk-RTSRESGX.js → chunk-6RN34ZWU.js} +6 -6
  19. package/dist/bundle/{chunk-7PSGKP3R.js → chunk-6VISMU6R.js} +8 -8
  20. package/dist/bundle/{chunk-AI6PMW7L.js → chunk-76T57Y3Q.js} +6 -6
  21. package/dist/bundle/{chunk-V6CRCAWN.js → chunk-7YALAAL4.js} +364 -305
  22. package/dist/bundle/{chunk-KA5MDFLU.js → chunk-A3QZXQI3.js} +1 -1
  23. package/dist/bundle/{chunk-YSOTOUHJ.js → chunk-A54EZ6DV.js} +15 -15
  24. package/dist/bundle/{chunk-MODHP5VA.js → chunk-AH6V2UJZ.js} +22 -18
  25. package/dist/bundle/{chunk-2EZFUIL4.js → chunk-BA6GHX5B.js} +27 -27
  26. package/dist/bundle/{chunk-TPWAXJUQ.js → chunk-BFEXVALS.js} +1 -1
  27. package/dist/bundle/{chunk-H3WELZYK.js → chunk-BNOSAHVH.js} +3 -3
  28. package/dist/bundle/{chunk-Z3NRIW4M.js → chunk-C3HS26N5.js} +1 -1
  29. package/dist/bundle/{chunk-6RPLAGAL.js → chunk-CFZZUGUD.js} +22 -22
  30. package/dist/bundle/{chunk-KYLKZKQ7.js → chunk-CPKS7JKX.js} +2 -2
  31. package/dist/bundle/{chunk-4DTJF6E7.js → chunk-D7KQYLAN.js} +8 -8
  32. package/dist/bundle/{chunk-N2FIIVJV.js → chunk-DE5BNDIA.js} +4 -4
  33. package/dist/bundle/{chunk-LLBZDBPT.js → chunk-DJYMK7EI.js} +4 -4
  34. package/dist/bundle/{chunk-YRJ2576I.js → chunk-DNPE4LOZ.js} +11 -11
  35. package/dist/bundle/chunk-EXFRC4OT.js +106 -0
  36. package/dist/bundle/{chunk-ODCHYVTW.js → chunk-EY46RMMS.js} +158 -154
  37. package/dist/bundle/{chunk-C7OOLF5J.js → chunk-HFZHXP4U.js} +6 -6
  38. package/dist/bundle/{chunk-Y7YXXWQI.js → chunk-HKDUGTWQ.js} +3 -3
  39. package/dist/bundle/{chunk-7XFJRX6F.js → chunk-HWIKY7KF.js} +3 -3
  40. package/dist/bundle/{chunk-ZHAHSVQO.js → chunk-INXIJXU2.js} +7 -7
  41. package/dist/bundle/{chunk-YNXQAB4X.js → chunk-IYINNZQE.js} +11 -11
  42. package/dist/bundle/{chunk-42UNPXTC.js → chunk-JKLJM7EG.js} +2 -2
  43. package/dist/bundle/{chunk-GB64N6DP.js → chunk-JSGRDE5Q.js} +298 -297
  44. package/dist/bundle/{chunk-O3KNZVDZ.js → chunk-JTLPFUIQ.js} +4 -4
  45. package/dist/bundle/{chunk-TXVXEE7L.js → chunk-KTBPBMNR.js} +6 -6
  46. package/dist/bundle/{chunk-NM4QMIOQ.js → chunk-KYW7RWGE.js} +3 -3
  47. package/dist/bundle/{chunk-OEH5JUAL.js → chunk-LHVNZ25W.js} +13 -13
  48. package/dist/bundle/{chunk-OJU774SG.js → chunk-LO74ISD6.js} +4 -4
  49. package/dist/bundle/{chunk-GBU4U55M.js → chunk-M4MM4QUM.js} +1 -1
  50. package/dist/bundle/{chunk-TD4HM7XL.js → chunk-MRUE3BWX.js} +1 -1
  51. package/dist/bundle/{chunk-ZIA7AU7L.js → chunk-MZHH5XMX.js} +2 -2
  52. package/dist/bundle/{chunk-3NCRQMEN.js → chunk-NGWUFB4K.js} +1 -1
  53. package/dist/bundle/{chunk-DDSKTPU7.js → chunk-OAWNQZ3V.js} +4 -4
  54. package/dist/bundle/{chunk-YD7XTYEC.js → chunk-OB3OPV55.js} +6 -6
  55. package/dist/bundle/{chunk-5AQIET5P.js → chunk-OQSIFLZS.js} +2 -2
  56. package/dist/bundle/{chunk-6YRVBXFH.js → chunk-PPARTGFE.js} +10 -10
  57. package/dist/bundle/{chunk-VFJAGY3L.js → chunk-QNJ6O6J4.js} +3 -3
  58. package/dist/bundle/{chunk-TGURQ4YH.js → chunk-S5T4SO7I.js} +2 -2
  59. package/dist/bundle/{chunk-W5ARY4U2.js → chunk-SHO3T3F2.js} +4 -4
  60. package/dist/bundle/{chunk-HAMGOLFU.js → chunk-TFXKS2WG.js} +1 -1
  61. package/dist/bundle/{chunk-47WS4BML.js → chunk-TIHQFMH2.js} +12 -10
  62. package/dist/bundle/{chunk-EVLOYNXC.js → chunk-TXXKLYJQ.js} +4 -4
  63. package/dist/bundle/{chunk-2KGYREGD.js → chunk-UD5JUJES.js} +357 -357
  64. package/dist/bundle/{chunk-S54Z74G2.js → chunk-UDRKGCDS.js} +2 -2
  65. package/dist/bundle/{chunk-4IWOPJL4.js → chunk-UIS44ZMF.js} +7 -7
  66. package/dist/bundle/{chunk-XGPSFPLH.js → chunk-VIY77EDM.js} +48 -48
  67. package/dist/bundle/{chunk-DUON3SRD.js → chunk-VMTTWF2M.js} +8 -8
  68. package/dist/bundle/{chunk-YU7KZW5I.js → chunk-W36BMC6F.js} +5 -5
  69. package/dist/bundle/{chunk-FUATAPSB.js → chunk-WZZ426CJ.js} +83 -81
  70. package/dist/bundle/chunk-X2SA73EE.js +200 -0
  71. package/dist/bundle/{chunk-3PLYUZAR.js → chunk-XLZPP5MB.js} +1 -1
  72. package/dist/bundle/{chunk-FH753LZS.js → chunk-YABNPKKQ.js} +2 -2
  73. package/dist/bundle/{chunk-PFNEOHCY.js → chunk-YZ4J67GU.js} +3 -3
  74. package/dist/bundle/{chunk-RLRKBPLJ.js → chunk-ZPB3VTS7.js} +17 -13
  75. package/dist/bundle/{chunk-MFQTOOHR.js → chunk-ZPPMGXER.js} +35 -35
  76. package/dist/bundle/command-contract-SEDOYJIJ.js +34 -0
  77. package/dist/bundle/{command-server-entry-472XWNSN.js → command-server-entry-TQBKNSM3.js} +22 -20
  78. package/dist/bundle/{decode-SFZ67QJN.js → decode-VFRSEIBD.js} +7 -5
  79. package/dist/bundle/{dispatch-PHB2Y6ZL.js → dispatch-N73TJNYM.js} +3 -3
  80. package/dist/bundle/{echarts-3U34KH7O.js → echarts-DP2GC2C6.js} +2 -2
  81. package/dist/bundle/{embed-ZEZXJ45Q.js → embed-BIINGRNY.js} +8 -6
  82. package/dist/bundle/{embedder-AASO2I4Z.js → embedder-2AUO2PHQ.js} +11 -9
  83. package/dist/bundle/entry-APUFP74B.js +23 -0
  84. package/dist/bundle/entry-LGJ2Y7AS.js +78 -0
  85. package/dist/bundle/failure-5QSMH2CD.js +71 -0
  86. package/dist/bundle/{failure-OBT7CUVW.js → failure-IPHFR3KW.js} +3 -2
  87. package/dist/bundle/{first-run-YL3TIUU3.js → first-run-7UMKRQL7.js} +11 -9
  88. package/dist/bundle/first-screen-H5CQSLIX.js +32 -0
  89. package/dist/bundle/{instructions-HG2ZZ7AP.js → instructions-WDKCHEG6.js} +1 -1
  90. package/dist/bundle/mcp-3HKOGYHL.js +92 -0
  91. package/dist/bundle/memo.js +9 -56
  92. package/dist/bundle/{node-7AQN6OTR.js → node-QBL3F2VF.js} +2 -2
  93. package/dist/bundle/{node-sqlite-55KMFPGI.js → node-sqlite-WFKC73E5.js} +8 -6
  94. package/dist/bundle/{oauth-S2GLD4PY.js → oauth-4PT7N4SE.js} +9 -7
  95. package/dist/bundle/{open-6R4UPST5.js → open-I7XENSGI.js} +7 -5
  96. package/dist/bundle/openai-DUSBTUFI.js +26 -0
  97. package/dist/bundle/{process-C7J3IT7Q.js → process-TVXEHAK6.js} +1 -1
  98. package/dist/bundle/{program-KWI6M5IB.js → program-3X4EPBEW.js} +298 -148
  99. package/dist/bundle/{prompt-EEFKVWSA.js → prompt-QRYXTON7.js} +7 -5
  100. package/dist/bundle/{recognize-STYHVWQ6.js → recognize-ZLDPIN36.js} +6 -4
  101. package/dist/bundle/{remote-6MXZXHYY.js → remote-3GRP5YE3.js} +9 -7
  102. package/dist/bundle/{rerank-IMX2ONZG.js → rerank-6B2FI6LN.js} +9 -7
  103. package/dist/bundle/serve-ZP3TEANT.js +24 -0
  104. package/dist/bundle/{server-L6OS2MJ5.js → server-3SJJNNSX.js} +62 -59
  105. package/dist/bundle/server-72VZYABL.js +50 -0
  106. package/dist/bundle/server-UY47EXPQ.js +64 -0
  107. package/dist/bundle/{state-7MP4KKPG.js → state-JDH2X2CY.js} +8 -6
  108. package/dist/bundle/{store-EMAKEEYI.js → store-FDNYGJUF.js} +14 -12
  109. package/dist/bundle/store-maintenance-command-5LFS45JM.js +49 -0
  110. package/dist/bundle/update-257J2SPM.js +74 -0
  111. package/dist/run/entry.d.ts +7 -0
  112. package/dist/run/entry.d.ts.map +1 -0
  113. package/dist/run/entry.js +62 -0
  114. package/dist/run/entry.js.map +1 -0
  115. package/dist/sources/command.d.ts.map +1 -1
  116. package/dist/sources/command.js +29 -3
  117. package/dist/sources/command.js.map +1 -1
  118. package/dist/sources/read.d.ts +16 -2
  119. package/dist/sources/read.d.ts.map +1 -1
  120. package/dist/sources/read.js +40 -4
  121. package/dist/sources/read.js.map +1 -1
  122. package/dist/sources/readers/ai-model.d.ts +4 -0
  123. package/dist/sources/readers/ai-model.d.ts.map +1 -0
  124. package/dist/sources/readers/ai-model.js +74 -0
  125. package/dist/sources/readers/ai-model.js.map +1 -0
  126. package/dist/sources/readers/index.d.ts +1 -0
  127. package/dist/sources/readers/index.d.ts.map +1 -1
  128. package/dist/sources/readers/index.js +3 -1
  129. package/dist/sources/readers/index.js.map +1 -1
  130. package/dist/sources/readers/keys.js +1 -1
  131. package/dist/sources/readers/keys.js.map +1 -1
  132. package/dist/sources/readers/types.d.ts +5 -2
  133. package/dist/sources/readers/types.d.ts.map +1 -1
  134. package/dist/sources/readers/types.js +1 -1
  135. package/dist/sources/readers/types.js.map +1 -1
  136. package/dist/sources/suggest-command.d.ts.map +1 -1
  137. package/dist/sources/suggest-command.js +16 -5
  138. package/dist/sources/suggest-command.js.map +1 -1
  139. package/dist/version.d.ts +1 -1
  140. package/dist/version.js +1 -1
  141. package/package.json +2 -2
  142. package/dist/bundle/auto-R3ABUML7.js +0 -89
  143. package/dist/bundle/command-contract-IEUSFI3B.js +0 -32
  144. package/dist/bundle/entry-7VHMR3LD.js +0 -21
  145. package/dist/bundle/failure-DJSK3LGN.js +0 -69
  146. package/dist/bundle/first-screen-OQVOWRYM.js +0 -30
  147. package/dist/bundle/mcp-EUFDOVMI.js +0 -90
  148. package/dist/bundle/openai-JK5GCSDK.js +0 -24
  149. package/dist/bundle/serve-ZNN464BH.js +0 -22
  150. package/dist/bundle/server-4CHUUMVI.js +0 -48
  151. package/dist/bundle/server-VCZCAQOB.js +0 -62
  152. package/dist/bundle/store-maintenance-command-LWN6OUFA.js +0 -47
  153. package/dist/bundle/update-I4X2UO6J.js +0 -72
  154. /package/dist/bundle/{chunk-IKIYW7FW.js → chunk-6AALVDEA.js} +0 -0
@@ -6,18 +6,18 @@ import {
6
6
  autoState,
7
7
  lastAutoRun,
8
8
  recordAutoRun
9
- } from "./chunk-AI6PMW7L.js";
9
+ } from "./chunk-76T57Y3Q.js";
10
10
  import {
11
11
  installer,
12
12
  latest,
13
13
  upgradeCommand
14
- } from "./chunk-ZHAHSVQO.js";
14
+ } from "./chunk-INXIJXU2.js";
15
15
  import {
16
16
  mcpOwnerAllowed,
17
17
  memoLevels,
18
18
  readOnlyAvailability,
19
19
  refuseWritesUnderLock
20
- } from "./chunk-RTSRESGX.js";
20
+ } from "./chunk-6RN34ZWU.js";
21
21
  import {
22
22
  answers,
23
23
  atDetail,
@@ -29,7 +29,7 @@ import {
29
29
  trackAnswers,
30
30
  wholeList,
31
31
  withStore
32
- } from "./chunk-4DTJF6E7.js";
32
+ } from "./chunk-D7KQYLAN.js";
33
33
  import {
34
34
  ATTACHMENT_CHARS,
35
35
  DIALECTS,
@@ -66,15 +66,19 @@ import {
66
66
  showMail,
67
67
  unsetConfigKey,
68
68
  updateConfig
69
- } from "./chunk-MFQTOOHR.js";
69
+ } from "./chunk-ZPPMGXER.js";
70
70
  import "./chunk-QP3KNC5D.js";
71
- import "./chunk-VFJAGY3L.js";
72
- import "./chunk-6YRVBXFH.js";
73
- import "./chunk-DDSKTPU7.js";
71
+ import "./chunk-QNJ6O6J4.js";
72
+ import "./chunk-PPARTGFE.js";
73
+ import "./chunk-OAWNQZ3V.js";
74
74
  import {
75
75
  errorObject,
76
76
  recognisable
77
- } from "./chunk-47WS4BML.js";
77
+ } from "./chunk-TIHQFMH2.js";
78
+ import {
79
+ provideTerminal,
80
+ terminalOf
81
+ } from "./chunk-BPGYTJNB.js";
78
82
  import {
79
83
  AGENT_INPUT_MAX_CHARS,
80
84
  DISCOVERY_DESCRIPTIONS,
@@ -85,6 +89,10 @@ import {
85
89
  addMeetingPreparationCommand,
86
90
  advancePastSkipped,
87
91
  agentSchedule,
92
+ aiImageReader,
93
+ aiLeavesComputer,
94
+ aiSettingPath,
95
+ aiTextReader,
88
96
  backfillScheduleRun,
89
97
  baseStagesCommand,
90
98
  calendarOf,
@@ -117,6 +125,7 @@ import {
117
125
  projectStatusSchema,
118
126
  projectStatusText,
119
127
  projectWindowOf,
128
+ readAiSetting,
120
129
  readMailFindingsJson,
121
130
  readSchedule,
122
131
  recordRuns,
@@ -142,34 +151,34 @@ import {
142
151
  thisMachine,
143
152
  withSqliteSidecars,
144
153
  writeSchedule
145
- } from "./chunk-V6CRCAWN.js";
146
- import "./chunk-TPWAXJUQ.js";
147
- import "./chunk-KA5MDFLU.js";
148
- import "./chunk-3PLYUZAR.js";
154
+ } from "./chunk-7YALAAL4.js";
155
+ import "./chunk-BFEXVALS.js";
156
+ import "./chunk-A3QZXQI3.js";
157
+ import "./chunk-XLZPP5MB.js";
149
158
  import {
150
159
  allHitItem,
151
160
  coverageGaps,
152
161
  messageHitItem,
153
162
  noteHitItem,
154
163
  shownOf
155
- } from "./chunk-6RPLAGAL.js";
156
- import "./chunk-42UNPXTC.js";
164
+ } from "./chunk-CFZZUGUD.js";
165
+ import "./chunk-JKLJM7EG.js";
157
166
  import {
158
167
  REASONS as REASONS2,
159
168
  SKILL_TARGETS,
160
169
  skillCommand,
161
170
  skillPath,
162
171
  skillVersion
163
- } from "./chunk-RLRKBPLJ.js";
164
- import "./chunk-N2FIIVJV.js";
172
+ } from "./chunk-ZPB3VTS7.js";
173
+ import "./chunk-DE5BNDIA.js";
165
174
  import {
166
175
  recoveryNotes,
167
176
  storeInfo,
168
177
  storeRecoveryCheck,
169
178
  storeRecoveryRun,
170
179
  storeSummary
171
- } from "./chunk-XGPSFPLH.js";
172
- import "./chunk-YSOTOUHJ.js";
180
+ } from "./chunk-VIY77EDM.js";
181
+ import "./chunk-A54EZ6DV.js";
173
182
  import {
174
183
  LIST_QUERY_GUIDE,
175
184
  RESOURCES_SEARCHED,
@@ -214,6 +223,7 @@ import {
214
223
  moveGroupMember,
215
224
  nativeField,
216
225
  nativeTerms,
226
+ ocrImage,
217
227
  organizationContext,
218
228
  parseProposalIds,
219
229
  personBusiness,
@@ -245,31 +255,31 @@ import {
245
255
  timeLimit,
246
256
  typedQuery,
247
257
  withQuery
248
- } from "./chunk-GB64N6DP.js";
258
+ } from "./chunk-JSGRDE5Q.js";
249
259
  import {
250
260
  readBoundedUtf8File,
251
261
  writeFileAtomic
252
- } from "./chunk-OEH5JUAL.js";
262
+ } from "./chunk-LHVNZ25W.js";
253
263
  import {
254
264
  releaseLock,
255
265
  servingProfiles,
256
266
  takeLock
257
- } from "./chunk-PFNEOHCY.js";
258
- import "./chunk-NM4QMIOQ.js";
267
+ } from "./chunk-YZ4J67GU.js";
268
+ import "./chunk-KYW7RWGE.js";
259
269
  import {
260
270
  commandsText,
261
271
  inSection,
262
272
  installHelp
263
- } from "./chunk-7PSGKP3R.js";
273
+ } from "./chunk-6VISMU6R.js";
264
274
  import "./chunk-HTQTIKWP.js";
265
- import "./chunk-YRJ2576I.js";
275
+ import "./chunk-DNPE4LOZ.js";
266
276
  import {
267
277
  isNewer
268
- } from "./chunk-KEBL3PY4.js";
278
+ } from "./chunk-3QBRLN6T.js";
269
279
  import "./chunk-OYKQX4H3.js";
270
- import "./chunk-YNXQAB4X.js";
271
- import "./chunk-H3WELZYK.js";
272
- import "./chunk-5AQIET5P.js";
280
+ import "./chunk-IYINNZQE.js";
281
+ import "./chunk-BNOSAHVH.js";
282
+ import "./chunk-OQSIFLZS.js";
273
283
  import {
274
284
  EVIDENCE_FINDINGS_KIND,
275
285
  MAIL_FINDINGS_KIND,
@@ -309,29 +319,25 @@ import {
309
319
  refLabel,
310
320
  storedProfilesFor,
311
321
  writesWithOf
312
- } from "./chunk-2KGYREGD.js";
313
- import "./chunk-DUON3SRD.js";
314
- import "./chunk-GBU4U55M.js";
315
- import "./chunk-LLBZDBPT.js";
316
- import "./chunk-YD7XTYEC.js";
317
- import {
318
- provideTerminal,
319
- terminalOf
320
- } from "./chunk-BPGYTJNB.js";
322
+ } from "./chunk-UD5JUJES.js";
323
+ import "./chunk-VMTTWF2M.js";
324
+ import "./chunk-M4MM4QUM.js";
325
+ import "./chunk-DJYMK7EI.js";
326
+ import "./chunk-OB3OPV55.js";
321
327
  import {
322
328
  APP,
323
329
  REASONS,
324
330
  STORE_CLIENT,
325
331
  VERSION
326
- } from "./chunk-TGURQ4YH.js";
332
+ } from "./chunk-S5T4SO7I.js";
327
333
  import "./chunk-NT5IOEEK.js";
328
334
  import "./chunk-D72URWJE.js";
329
- import "./chunk-4IWOPJL4.js";
330
- import "./chunk-HAMGOLFU.js";
331
- import "./chunk-Y7YXXWQI.js";
332
- import "./chunk-C7OOLF5J.js";
333
- import "./chunk-3NCRQMEN.js";
334
- import "./chunk-O3KNZVDZ.js";
335
+ import "./chunk-UIS44ZMF.js";
336
+ import "./chunk-TFXKS2WG.js";
337
+ import "./chunk-HKDUGTWQ.js";
338
+ import "./chunk-HFZHXP4U.js";
339
+ import "./chunk-NGWUFB4K.js";
340
+ import "./chunk-JTLPFUIQ.js";
335
341
  import {
336
342
  Command,
337
343
  DEFAULT_TEXT_MODEL,
@@ -371,11 +377,11 @@ import {
371
377
  snakeKeys,
372
378
  textModels,
373
379
  textModelsFile
374
- } from "./chunk-ODCHYVTW.js";
375
- import "./chunk-SF2OLWBU.js";
376
- import "./chunk-TD4HM7XL.js";
377
- import "./chunk-EVLOYNXC.js";
378
- import "./chunk-S54Z74G2.js";
380
+ } from "./chunk-EY46RMMS.js";
381
+ import "./chunk-4EFQOTNQ.js";
382
+ import "./chunk-MRUE3BWX.js";
383
+ import "./chunk-TXXKLYJQ.js";
384
+ import "./chunk-UDRKGCDS.js";
379
385
  import {
380
386
  CATALOG_KINDS,
381
387
  CATEGORIES,
@@ -448,15 +454,15 @@ import {
448
454
  timezoneOf,
449
455
  validateQuery,
450
456
  walkQuery
451
- } from "./chunk-FUATAPSB.js";
452
- import "./chunk-7XFJRX6F.js";
453
- import "./chunk-TXVXEE7L.js";
457
+ } from "./chunk-WZZ426CJ.js";
458
+ import "./chunk-HWIKY7KF.js";
459
+ import "./chunk-KTBPBMNR.js";
454
460
  import {
455
461
  sharedModelsDirectory
456
- } from "./chunk-OJU774SG.js";
462
+ } from "./chunk-LO74ISD6.js";
457
463
  import {
458
464
  storePath
459
- } from "./chunk-FH753LZS.js";
465
+ } from "./chunk-YABNPKKQ.js";
460
466
  import "./chunk-G5GW3FFJ.js";
461
467
  import {
462
468
  Credentials,
@@ -471,7 +477,9 @@ import {
471
477
  readBatchInput,
472
478
  resolvePaths,
473
479
  writeSecurely
474
- } from "./chunk-W46O6RJ5.js";
480
+ } from "./chunk-2IQWMWMC.js";
481
+ import "./chunk-EXFRC4OT.js";
482
+ import "./chunk-X2SA73EE.js";
475
483
  import {
476
484
  MAX_NEXT_STEPS,
477
485
  array,
@@ -493,13 +501,13 @@ import {
493
501
  trim,
494
502
  union,
495
503
  unknown
496
- } from "./chunk-VYCLOFPC.js";
504
+ } from "./chunk-6A37YXAL.js";
497
505
  import "./chunk-Y5E2WNWB.js";
498
506
  import {
499
507
  CliError,
500
508
  errorCodes,
501
509
  isCliError
502
- } from "./chunk-2EZFUIL4.js";
510
+ } from "./chunk-BA6GHX5B.js";
503
511
  import {
504
512
  __name
505
513
  } from "./chunk-ZVVMGPBJ.js";
@@ -521,16 +529,16 @@ var fromTerminal = /* @__PURE__ */ __name(async (question) => {
521
529
  } catch {
522
530
  return null;
523
531
  }
524
- const reader = createInterface({ input, output: process.stderr, terminal: true });
532
+ const reader2 = createInterface({ input, output: process.stderr, terminal: true });
525
533
  try {
526
534
  return await new Promise((resolve6, reject) => {
527
535
  const cancel = /* @__PURE__ */ __name(() => reject(new CliError("cancelled", "cancelled \u2014 nothing was done")), "cancel");
528
- reader.once("SIGINT", cancel);
529
- reader.once("close", cancel);
530
- reader.question(question, resolve6);
536
+ reader2.once("SIGINT", cancel);
537
+ reader2.once("close", cancel);
538
+ reader2.question(question, resolve6);
531
539
  });
532
540
  } finally {
533
- reader.close();
541
+ reader2.close();
534
542
  input.destroy();
535
543
  }
536
544
  }, "fromTerminal");
@@ -879,7 +887,7 @@ var readScope = /* @__PURE__ */ __name((command, help = ONE_ACCOUNT_HELP) => sou
879
887
  var writeScope = /* @__PURE__ */ __name((command, help) => writeOptions(command, help).option("--json", "print JSON; --json=id,title keeps only those fields"), "writeScope");
880
888
  var jsonOption = /* @__PURE__ */ __name((command, fields = "ref,title") => command.option("--json", `print JSON; --json=${fields} keeps only those fields`), "jsonOption");
881
889
 
882
- // node_modules/.pnpm/@wirecat+cli-core@0.627.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_6a3445916b5ce0182fa072182fe8aa66/node_modules/@wirecat/cli-core/dist/mail/sender-scores.js
890
+ // node_modules/.pnpm/@wirecat+cli-core@0.628.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_ae6a34897f184099b1a87c0d4b483e54/node_modules/@wirecat/cli-core/dist/mail/sender-scores.js
883
891
  var SCORED = "mail_sender_scores";
884
892
  var DAY = 864e5;
885
893
  var RECENT = 2 * 365 * DAY;
@@ -895,7 +903,7 @@ var demotedSenders = /* @__PURE__ */ __name(async (store) => {
895
903
  return senders;
896
904
  }, "demotedSenders");
897
905
 
898
- // node_modules/.pnpm/@wirecat+cli-core@0.627.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_6a3445916b5ce0182fa072182fe8aa66/node_modules/@wirecat/cli-core/dist/mail/sync.js
906
+ // node_modules/.pnpm/@wirecat+cli-core@0.628.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_ae6a34897f184099b1a87c0d4b483e54/node_modules/@wirecat/cli-core/dist/mail/sync.js
899
907
  var DAY2 = 864e5;
900
908
  var EDGE = 2 * DAY2;
901
909
 
@@ -2340,7 +2348,7 @@ import { createHash } from "node:crypto";
2340
2348
  import { existsSync, readFileSync as readFileSync2, statSync } from "node:fs";
2341
2349
  import { basename, extname, relative, sep } from "node:path";
2342
2350
 
2343
- // node_modules/.pnpm/@wirecat+cli-core@0.627.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_6a3445916b5ce0182fa072182fe8aa66/node_modules/@wirecat/cli-core/dist/services/documents/extraction.js
2351
+ // node_modules/.pnpm/@wirecat+cli-core@0.628.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_ae6a34897f184099b1a87c0d4b483e54/node_modules/@wirecat/cli-core/dist/services/documents/extraction.js
2344
2352
  var Proposal = object({
2345
2353
  kind: picklist(["summary", "digest", "fact", "preference"]),
2346
2354
  body: pipe(string(), trim(), minLength(1), maxLength(15e3)),
@@ -2348,13 +2356,13 @@ var Proposal = object({
2348
2356
  });
2349
2357
  var Proposals = object({ items: pipe(array(Proposal), maxLength(20)) });
2350
2358
 
2351
- // node_modules/.pnpm/@wirecat+cli-core@0.627.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_6a3445916b5ce0182fa072182fe8aa66/node_modules/@wirecat/cli-core/dist/services/documents/mirrors.js
2359
+ // node_modules/.pnpm/@wirecat+cli-core@0.628.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_ae6a34897f184099b1a87c0d4b483e54/node_modules/@wirecat/cli-core/dist/services/documents/mirrors.js
2352
2360
  var ID = pipe(string(), regex(/^[A-Za-z0-9_-]{1,200}$/));
2353
2361
 
2354
- // node_modules/.pnpm/@wirecat+cli-core@0.627.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_6a3445916b5ce0182fa072182fe8aa66/node_modules/@wirecat/cli-core/dist/services/documents/sync.js
2362
+ // node_modules/.pnpm/@wirecat+cli-core@0.628.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_ae6a34897f184099b1a87c0d4b483e54/node_modules/@wirecat/cli-core/dist/services/documents/sync.js
2355
2363
  var MAX_PICTURE_BYTES = 25 * 1024 * 1024;
2356
2364
 
2357
- // node_modules/.pnpm/@wirecat+cli-core@0.627.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_6a3445916b5ce0182fa072182fe8aa66/node_modules/@wirecat/cli-core/dist/fetch/addresses.js
2365
+ // node_modules/.pnpm/@wirecat+cli-core@0.628.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_ae6a34897f184099b1a87c0d4b483e54/node_modules/@wirecat/cli-core/dist/fetch/addresses.js
2358
2366
  import { isIP } from "node:net";
2359
2367
  var within3 = /* @__PURE__ */ __name((address, [prefix, bits]) => {
2360
2368
  for (let bit = 0; bit < bits; bit++) {
@@ -2425,7 +2433,7 @@ var isPublicAddress = /* @__PURE__ */ __name((address) => {
2425
2433
  return within3(bytes, [[32], 3]) && !V6_PRIVATE.some((prefix) => within3(bytes, prefix));
2426
2434
  }, "isPublicAddress");
2427
2435
 
2428
- // node_modules/.pnpm/@wirecat+cli-core@0.627.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_6a3445916b5ce0182fa072182fe8aa66/node_modules/@wirecat/cli-core/dist/fetch/page.js
2436
+ // node_modules/.pnpm/@wirecat+cli-core@0.628.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_ae6a34897f184099b1a87c0d4b483e54/node_modules/@wirecat/cli-core/dist/fetch/page.js
2429
2437
  import { lookup as dnsLookup } from "node:dns/promises";
2430
2438
  import { request as httpRequest } from "node:http";
2431
2439
  import { request as httpsRequest } from "node:https";
@@ -5270,7 +5278,7 @@ var signedInAccount = /* @__PURE__ */ __name((tool, profile, env) => {
5270
5278
  return void 0;
5271
5279
  }
5272
5280
  }, "signedInAccount");
5273
- var profileFor = /* @__PURE__ */ __name((provider, account2, env, chosen2 = {}) => {
5281
+ var profileFor = /* @__PURE__ */ __name((provider, account2, env, chosen3 = {}) => {
5274
5282
  const tool = messengerToolOf(provider);
5275
5283
  if (!tool)
5276
5284
  return void 0;
@@ -5278,7 +5286,7 @@ var profileFor = /* @__PURE__ */ __name((provider, account2, env, chosen2 = {})
5278
5286
  const profiles = existsSync5(dir) ? readdirSync2(dir).filter((name2) => name2.endsWith(".json")).map((name2) => name2.slice(0, -".json".length)).sort() : [];
5279
5287
  const accountOf = /* @__PURE__ */ __name((profile) => signedInAccount(tool, profile, env), "accountOf");
5280
5288
  const all = profiles.join(", ") || "none";
5281
- const pick = chosen2[tool.tool];
5289
+ const pick = chosen3[tool.tool];
5282
5290
  if (pick !== void 0) {
5283
5291
  if (!profiles.includes(pick))
5284
5292
  return { why: `${tool.tool} profile ${pick} is not signed in here; profiles: ${all}`, profiles };
@@ -5361,14 +5369,14 @@ var answerOf = /* @__PURE__ */ __name((stdout) => {
5361
5369
  }
5362
5370
  }, "answerOf");
5363
5371
  var MARGIN_MS = 5e3;
5364
- var messengerFetcher = /* @__PURE__ */ __name(({ env, note, chosen: chosen2 = {}, run = runChild, now = Date.now }) => {
5372
+ var messengerFetcher = /* @__PURE__ */ __name(({ env, note, chosen: chosen3 = {}, run = runChild, now = Date.now }) => {
5365
5373
  const binaries = /* @__PURE__ */ new Map();
5366
5374
  return {
5367
5375
  fetch: /* @__PURE__ */ __name(async ({ account: account2, chatId, after, until, signal }) => {
5368
5376
  const tool = messengerToolOf(account2.provider);
5369
5377
  if (!tool)
5370
5378
  return { state: "failed", reason: `no WireCat messenger CLI syncs ${account2.provider}` };
5371
- const found = profileFor(account2.provider, account2.account, env, chosen2);
5379
+ const found = profileFor(account2.provider, account2.account, env, chosen3);
5372
5380
  if (!found || !("profile" in found))
5373
5381
  return { state: "failed", reason: found?.why ?? "no profile" };
5374
5382
  if (!binaries.has(tool.tool))
@@ -5425,23 +5433,23 @@ var isEvent = /* @__PURE__ */ __name((line3) => {
5425
5433
  return false;
5426
5434
  }
5427
5435
  }, "isEvent");
5428
- var chatCommand = /* @__PURE__ */ __name((chat, words, env, chosen2) => {
5436
+ var chatCommand = /* @__PURE__ */ __name((chat, words, env, chosen3) => {
5429
5437
  const tool = messengerToolOf(chat.provider);
5430
5438
  if (!tool)
5431
5439
  return null;
5432
- const found = profileFor(chat.provider, chat.account, env, chosen2);
5440
+ const found = profileFor(chat.provider, chat.account, env, chosen3);
5433
5441
  const line3 = /* @__PURE__ */ __name((profile) => `${tool.tool} ${profile} ${words}`, "line");
5434
5442
  if (found && "profile" in found)
5435
5443
  return { command: line3(found.profile) };
5436
5444
  return { command: null, line: line3("<profile>"), why: found?.why ?? "no profile" };
5437
5445
  }, "chatCommand");
5438
- var chatSync = /* @__PURE__ */ __name((chat, since, env, chosen2 = {}) => (
5446
+ var chatSync = /* @__PURE__ */ __name((chat, since, env, chosen3 = {}) => (
5439
5447
  // A negative group id needs no `--`: no WireCat CLI has a digit short option.
5440
- chatCommand(chat, `messages sync ${chat.chat} --since-time ${since}`, env, chosen2)
5448
+ chatCommand(chat, `messages sync ${chat.chat} --since-time ${since}`, env, chosen3)
5441
5449
  ), "chatSync");
5442
- var chatRead = /* @__PURE__ */ __name((chat, since, env, chosen2 = {}) => chatCommand(chat, `messages list --compact ${chat.chat} "date>=${since}"`, env, chosen2), "chatRead");
5443
- var syncHint = /* @__PURE__ */ __name((chat, since, env, chosen2 = {}) => {
5444
- const sync = chatSync(chat, since, env, chosen2);
5450
+ var chatRead = /* @__PURE__ */ __name((chat, since, env, chosen3 = {}) => chatCommand(chat, `messages list --compact ${chat.chat} "date>=${since}"`, env, chosen3), "chatRead");
5451
+ var syncHint = /* @__PURE__ */ __name((chat, since, env, chosen3 = {}) => {
5452
+ const sync = chatSync(chat, since, env, chosen3);
5445
5453
  if (!sync)
5446
5454
  return null;
5447
5455
  return sync.command ?? `${sync.line} (${sync.why})`;
@@ -6960,7 +6968,7 @@ var doctorCommand = /* @__PURE__ */ __name((...args) => {
6960
6968
  }, SHELL_OVERRIDES.doctor);
6961
6969
  }, "doctorCommand");
6962
6970
 
6963
- // node_modules/.pnpm/@wirecat+cli-core@0.627.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_6a3445916b5ce0182fa072182fe8aa66/node_modules/@wirecat/cli-core/dist/calendar/sync.js
6971
+ // node_modules/.pnpm/@wirecat+cli-core@0.628.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_ae6a34897f184099b1a87c0d4b483e54/node_modules/@wirecat/cli-core/dist/calendar/sync.js
6964
6972
  var DAY8 = 864e5;
6965
6973
  var SLOTS_EVERY = 7 * DAY8;
6966
6974
  var isWindow = /* @__PURE__ */ __name((value) => typeof value?.from === "number" && typeof value.to === "number", "isWindow");
@@ -7040,10 +7048,10 @@ var calendarStatus = /* @__PURE__ */ __name(async (store, accountId, { profile,
7040
7048
  return { items, page: 1, limit: Math.max(1, items.length), hasMore: false };
7041
7049
  }, "calendarStatus");
7042
7050
 
7043
- // node_modules/.pnpm/@wirecat+cli-core@0.627.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_6a3445916b5ce0182fa072182fe8aa66/node_modules/@wirecat/cli-core/dist/calendar/feeds.js
7051
+ // node_modules/.pnpm/@wirecat+cli-core@0.628.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_ae6a34897f184099b1a87c0d4b483e54/node_modules/@wirecat/cli-core/dist/calendar/feeds.js
7044
7052
  var FEED_LIMITS = { maxBytes: 10 * 1024 * 1024, timeoutMs: 3e4, redirects: 5 };
7045
7053
 
7046
- // node_modules/.pnpm/@wirecat+cli-core@0.627.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_6a3445916b5ce0182fa072182fe8aa66/node_modules/@wirecat/cli-core/dist/calendar/reads.js
7054
+ // node_modules/.pnpm/@wirecat+cli-core@0.628.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_ae6a34897f184099b1a87c0d4b483e54/node_modules/@wirecat/cli-core/dist/calendar/reads.js
7047
7055
  var LIST = "events list";
7048
7056
  var EVENT_TYPES = [
7049
7057
  "default",
@@ -7120,7 +7128,7 @@ var accountsMeta = /* @__PURE__ */ __name(async (store, accounts, skipped, now)
7120
7128
  };
7121
7129
  }, "accountsMeta");
7122
7130
 
7123
- // node_modules/.pnpm/@wirecat+cli-core@0.627.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_6a3445916b5ce0182fa072182fe8aa66/node_modules/@wirecat/cli-core/dist/calendar/writer.js
7131
+ // node_modules/.pnpm/@wirecat+cli-core@0.628.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_ae6a34897f184099b1a87c0d4b483e54/node_modules/@wirecat/cli-core/dist/calendar/writer.js
7124
7132
  var EVENTS_NOTIFY_KEY = "events.notify";
7125
7133
  var EVENTS_DELETE_SERIES_KEY = "events.delete.series";
7126
7134
  var EVENTS_REMIND_HOOK_KEY = "events.remind.hook";
@@ -7186,10 +7194,10 @@ var readAccounts = /* @__PURE__ */ __name(async (store) => {
7186
7194
  return read;
7187
7195
  }, "readAccounts");
7188
7196
  var narrowed = /* @__PURE__ */ __name((accounts, value) => {
7189
- const chosen2 = accounts.filter(({ key }) => accountName(key) === value || key.provider === value);
7190
- if (chosen2.length === 0)
7197
+ const chosen3 = accounts.filter(({ key }) => accountName(key) === value || key.provider === value);
7198
+ if (chosen3.length === 0)
7191
7199
  throw new CliError("not_found", `account:${value} names no calendar account \u2014 the store holds ${accounts.map(({ key }) => accountName(key)).join(", ") || "none"}`, { reason: "events.account-unknown" });
7192
- return chosen2;
7200
+ return chosen3;
7193
7201
  }, "narrowed");
7194
7202
  var calendarOf2 = /* @__PURE__ */ __name((accounts, value) => {
7195
7203
  const all = accounts.flatMap((account2) => account2.calendars.map((calendar) => ({ account: account2, calendar })));
@@ -9829,7 +9837,7 @@ var projectGatherCommand = /* @__PURE__ */ __name((projects, print, env, warn) =
9829
9837
  // Declared as a fetch for --sync-first; cli-base fixes effects per command, and without it nothing leaves this machine.
9830
9838
  annotate(projects.command("evidence"), { effects: FETCH, partial: true }).description("cited references about a project in stored messages, mail, meeting transcripts and imported notes folders. The project's name, its key, each of its aliases and each --alias, each --context-query and each --contact name is its own search: every word of it must appear in one text, in any order, as whole words; their hits are joined. Every message of a chat confirmed as the project's (memo relationships add chat:<provider>/<account>/<chat> project:<id>) is read too, when --source holds its account, and so is everything a confirmed person member of the project wrote (as --contact person:<id>, without aliases). New mail and documents are indexed for search first, unless --no-catch-up. Reads what the store holds; with --sync-first it first syncs the linked chats the store lacks for the window by running their messenger CLI (tg, max, wa) with the profile signed in to each chat's account, or the one --sync-profile names when several are; proposes and confirms nothing. A partial answer exits 0 with meta.complete false").summary("find what the store holds about a project: names, words, people, linked chats").argument("<project>", "an existing project's id, key, exact name or alias, or a new project's name").requiredOption("--source <accounts>", `where to look, or all: ${ACCOUNTS_HELP}`).option("--alias <name>", "another name of the project, searched on its own; repeat for more", collect, []).option("--context-query <words>", "more words that all appear in one text; repeat for another search", collect, []).option("--contact <person>", "a name to search, or person:<id> to read what that person's stored identities wrote and search the aliases you gave them; what only names them or comes from them is context, not the project", collect, []).option("--since-time <time>", "how far back: days (90d, 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("--limit <n>", "new references at most, up to 500", positive, 100).option("--max-pages <pages>", "store pages read at most this run, up to 512", positive).option("--cursor <cursor>", "continue a stopped search from its checkpoint, with the same options").option("--before-n <n>", "messages before each message hit, shown as its context, at most 5", whole, 2).option("--after-n <n>", "messages after each message hit, shown as its context, at most 5", whole, 2).option("--no-catch-up", "read the search index as it is, without indexing new mail and documents first").addOption(cliOnly(new Option("--sync-first", "first sync the linked chats the store does not hold back to --since-time, through their messenger CLI; off by default"))).addOption(cliOnly(new Option("--sync-time <duration>", "time for all of --sync-first's syncs together").default("3m"))).addOption(cliOnly(new Option("--sync-profile <tool=profile>", "the messenger profile to sync as when several are signed in to a chat's account, such as max=default; repeat for another tool. It must be signed in to that account").argParser(syncProfileOf))).option("--purpose <purpose>", "the linked chats' purposes to read, comma-separated: work, sales, support, other, or all; default work", purposeList).option("--include-proposed", "also read chats and members proposed for the project, after the confirmed ones").option("--json", "print JSON; --json=id,title keeps only those fields").action(async (project, options) => {
9831
9839
  const maxFetchMs = parseDuration(options.syncTime, "--sync-time");
9832
- const chosen2 = options.syncProfile ?? {};
9840
+ const chosen3 = options.syncProfile ?? {};
9833
9841
  const { found, scan } = await withStore(env, async (store) => {
9834
9842
  const found2 = await gatherStoredProject(store, {
9835
9843
  project,
@@ -9847,7 +9855,7 @@ var projectGatherCommand = /* @__PURE__ */ __name((projects, print, env, warn) =
9847
9855
  ...options.cursor === void 0 ? {} : { checkpoint: options.cursor },
9848
9856
  ...options.purpose ? { purposes: options.purpose } : {},
9849
9857
  ...options.includeProposed ? { includeProposed: true } : {},
9850
- ...options.syncFirst ? { fetcher: messengerFetcher({ env, note: warn, chosen: chosen2 }), maxFetchMs } : {}
9858
+ ...options.syncFirst ? { fetcher: messengerFetcher({ env, note: warn, chosen: chosen3 }), maxFetchMs } : {}
9851
9859
  });
9852
9860
  const known2 = await projectOf(store, project).catch((error) => {
9853
9861
  if (error instanceof CliError && error.code === "not_found")
@@ -9857,7 +9865,7 @@ var projectGatherCommand = /* @__PURE__ */ __name((projects, print, env, warn) =
9857
9865
  return { found: found2, scan: known2 ? await scanStep(store, known2, options.source) : [] };
9858
9866
  });
9859
9867
  const since = new Date(found.window.after).toISOString().slice(0, 10);
9860
- const syncs = found.linkedChats.map((one2) => one2.completeness === null || one2.completeness.state === "complete" ? null : chatSync(one2, since, env, chosen2));
9868
+ const syncs = found.linkedChats.map((one2) => one2.completeness === null || one2.completeness.state === "complete" ? null : chatSync(one2, since, env, chosen3));
9861
9869
  const parts2 = projectAnswerParts(options.sinceTime, found);
9862
9870
  const blocked = [...new Set(syncs.flatMap((one2) => one2 && one2.command === null ? [one2.why] : []))];
9863
9871
  const missing = [...parts2.missing ?? [], ...blocked.map((why) => ({ field: "sync_command", why }))];
@@ -9866,7 +9874,7 @@ var projectGatherCommand = /* @__PURE__ */ __name((projects, print, env, warn) =
9866
9874
  ...found,
9867
9875
  linkedChats: found.linkedChats.map((one2, i) => ({ ...one2, syncCommand: syncs[i]?.command ?? null }))
9868
9876
  }, { ...parts2, ...missing.length ? { missing } : {}, ...next.length ? { next } : {} }), projectEvidenceText(found, {
9869
- sync: /* @__PURE__ */ __name((chat, at2) => syncHint(chat, at2, env, chosen2), "sync"),
9877
+ sync: /* @__PURE__ */ __name((chat, at2) => syncHint(chat, at2, env, chosen3), "sync"),
9870
9878
  showDocument: "memo notes show"
9871
9879
  }));
9872
9880
  })
@@ -9912,7 +9920,7 @@ var projectStatusCommand = /* @__PURE__ */ __name((projects, print, env) => answ
9912
9920
  reason: "output.conflict",
9913
9921
  param: "--compact"
9914
9922
  });
9915
- const chosen2 = options.syncProfile ?? {};
9923
+ const chosen3 = options.syncProfile ?? {};
9916
9924
  const { found, finance, open: open2 } = await withStore(env, async (store) => {
9917
9925
  const scope = await groupScopeOf(store, env);
9918
9926
  const status = await projectStatus(store, {
@@ -9930,8 +9938,8 @@ var projectStatusCommand = /* @__PURE__ */ __name((projects, print, env) => answ
9930
9938
  const blocked = /* @__PURE__ */ new Set();
9931
9939
  const step = outside(blocked);
9932
9940
  const hints = {
9933
- sync: /* @__PURE__ */ __name((chat, since) => step("messages.sync", chatSync(linked(chat), since, env, chosen2)), "sync"),
9934
- read: /* @__PURE__ */ __name((chat, since) => step("messages.list", chatRead(linked(chat), since, env, chosen2)), "read"),
9941
+ sync: /* @__PURE__ */ __name((chat, since) => step("messages.sync", chatSync(linked(chat), since, env, chosen3)), "sync"),
9942
+ read: /* @__PURE__ */ __name((chat, since) => step("messages.list", chatRead(linked(chat), since, env, chosen3)), "read"),
9935
9943
  line: /* @__PURE__ */ __name((one2) => one2.kind === "command" ? one2.line ?? one2.command : one2.why, "line")
9936
9944
  };
9937
9945
  const lock = groupLockOf(APP, env);
@@ -10856,10 +10864,10 @@ var mcpCommandDefinition = /* @__PURE__ */ __name((program, streams, env, create
10856
10864
  }).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) => {
10857
10865
  if (!options.http && (options.port !== void 0 || options.publicUrl !== void 0))
10858
10866
  throw new CliError("validation_error", "--port and --public-url require --http");
10859
- const { createMemoServer } = await import("./server-L6OS2MJ5.js");
10867
+ const { createMemoServer } = await import("./server-3SJJNNSX.js");
10860
10868
  const build = /* @__PURE__ */ __name(() => createMemoServer(env, createProgram2, options.permission), "build");
10861
10869
  if (options.http) {
10862
- const { httpLockFile, mcpUrlOf, portOf, publicUrlOf, serveOverHttp } = await import("./mcp-EUFDOVMI.js");
10870
+ const { httpLockFile, mcpUrlOf, portOf, publicUrlOf, serveOverHttp } = await import("./mcp-3HKOGYHL.js");
10863
10871
  const publicUrl = publicUrlOf(options.publicUrl, {
10864
10872
  missing: "--http",
10865
10873
  reaches: "the browser apps reach memo",
@@ -10911,7 +10919,7 @@ var mcpCommandDefinition = /* @__PURE__ */ __name((program, streams, env, create
10911
10919
  });
10912
10920
  });
10913
10921
  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() {
10914
- const { revokeAll } = await import("./mcp-EUFDOVMI.js");
10922
+ const { revokeAll } = await import("./mcp-3HKOGYHL.js");
10915
10923
  revokeAll(httpTokenFile(env));
10916
10924
  out.print(this.opts().json, itemAnswer({ revoked: true }));
10917
10925
  });
@@ -11332,10 +11340,10 @@ var internalNotes = /* @__PURE__ */ __name(async (store) => {
11332
11340
  }, "internalNotes");
11333
11341
  var titleOf2 = /* @__PURE__ */ __name((note) => note.title ?? (note.text.split("\n").find((line3) => line3.trim())?.trim().slice(0, MAX_TITLE) || note.id), "titleOf");
11334
11342
  var exportTarget = /* @__PURE__ */ __name((config, dir, format) => {
11335
- const chosen2 = typeof dir === "string" ? dir : config.notes?.export?.dir;
11336
- if (chosen2 === void 0)
11343
+ const chosen3 = typeof dir === "string" ? dir : config.notes?.export?.dir;
11344
+ if (chosen3 === void 0)
11337
11345
  throw new CliError("configuration_error", "name a folder \u2014 --output-dir <dir>, --export <dir>, or notes.export.dir in the config");
11338
- return { dir: resolve3(chosen2), format: format ?? config.notes?.export?.format ?? "obsidian" };
11346
+ return { dir: resolve3(chosen3), format: format ?? config.notes?.export?.format ?? "obsidian" };
11339
11347
  }, "exportTarget");
11340
11348
  var exportInternal = /* @__PURE__ */ __name(async (store, { dir, format, notes: notes2 }) => {
11341
11349
  const exported = [];
@@ -11820,16 +11828,16 @@ var identitiesCommands = /* @__PURE__ */ __name((people, program, streams, env)
11820
11828
  byOption(annotate(people.command("unlink"), { effects: LOCAL_WRITE }).summary("take identities off a person, to one new person; only you").description("take identities off their person: one gets a person of its own again, several move together to one new person; only you, and no automatic match joins them back").argument("<identities...>", "the identities that leave, each <messenger>:<id> exactly, all of one person")).option("--json", "print JSON; --json=id,title keeps only those fields").action(async (refs, options, command) => {
11821
11829
  await asOwner(command, env, `unlink ${refs.join(" ")}?`);
11822
11830
  const person = await withStore(env, async (store) => {
11823
- const chosen2 = [];
11831
+ const chosen3 = [];
11824
11832
  for (const ref of refs)
11825
- chosen2.push(await exactIdentityOf(store, ref));
11826
- const [first] = chosen2;
11827
- if (chosen2.length === 1)
11833
+ chosen3.push(await exactIdentityOf(store, ref));
11834
+ const [first] = chosen3;
11835
+ if (chosen3.length === 1)
11828
11836
  return store.people.unlinkIdentity(first, { method: "unlink", by: "owner" });
11829
11837
  const held = await store.people.personOf(first);
11830
11838
  if (held === void 0)
11831
11839
  throw new CliError("not_found", `the store has no person for "${refs[0]}"`, { reason: "person.not-found" });
11832
- return store.people.split(held.uid, chosen2, "owner");
11840
+ return store.people.split(held.uid, chosen3, "owner");
11833
11841
  });
11834
11842
  print(options.json, itemAnswer(personAnswer(person)), `person:${person.uid}`);
11835
11843
  });
@@ -13624,7 +13632,7 @@ var readText = /* @__PURE__ */ __name(async (stdin, { maxChars }) => {
13624
13632
  title: firstLine2(text3)
13625
13633
  };
13626
13634
  }, "readText");
13627
- var readFile2 = /* @__PURE__ */ __name(async (path, { maxChars, load = importEngine }) => {
13635
+ var readFile2 = /* @__PURE__ */ __name(async (path, { maxChars, load = importEngine, image }) => {
13628
13636
  const stat = statSync5(path, { throwIfNoEntry: false });
13629
13637
  const name2 = basename4(path);
13630
13638
  if (!stat)
@@ -13645,6 +13653,42 @@ var readFile2 = /* @__PURE__ */ __name(async (path, { maxChars, load = importEng
13645
13653
  bytes,
13646
13654
  size: bytes.byteLength
13647
13655
  };
13656
+ const byName = name2.replace(/\.[^.]+$/, "") || name2;
13657
+ if (found.status === "needs-agent" && mime?.startsWith("image/") && image) {
13658
+ const reader2 = image();
13659
+ if ("refused" in reader2)
13660
+ return {
13661
+ ...base,
13662
+ text: "",
13663
+ read: "no-text",
13664
+ extractor: found.extractor ?? null,
13665
+ truncated: false,
13666
+ title: byName,
13667
+ image: { read_by: null, reason: reader2.refused }
13668
+ };
13669
+ const seen = await ocrImage(bytes, reader2.pipeline);
13670
+ if (seen.status === "extracted") {
13671
+ const { text: text4, cut: cut3 } = bounded(seen.text, maxChars);
13672
+ return {
13673
+ ...base,
13674
+ text: text4,
13675
+ read: "extracted",
13676
+ extractor: seen.extractor,
13677
+ truncated: cut3,
13678
+ title: byName,
13679
+ image: { read_by: reader2.by, reason: null }
13680
+ };
13681
+ }
13682
+ return {
13683
+ ...base,
13684
+ text: "",
13685
+ read: "no-text",
13686
+ extractor: reader2.pipeline.extractor,
13687
+ truncated: false,
13688
+ title: byName,
13689
+ image: { read_by: null, reason: seen.status === "needs-agent" ? "image.unsupported" : "ai.failed" }
13690
+ };
13691
+ }
13648
13692
  if (found.status === "needs-agent")
13649
13693
  return {
13650
13694
  ...base,
@@ -13652,7 +13696,7 @@ var readFile2 = /* @__PURE__ */ __name(async (path, { maxChars, load = importEng
13652
13696
  read: "no-text",
13653
13697
  extractor: found.extractor ?? null,
13654
13698
  truncated: false,
13655
- title: name2.replace(/\.[^.]+$/, "") || name2
13699
+ title: byName
13656
13700
  };
13657
13701
  if (found.status !== "extracted")
13658
13702
  throw refusal(found, name2);
@@ -13665,7 +13709,7 @@ var readFile2 = /* @__PURE__ */ __name(async (path, { maxChars, load = importEng
13665
13709
  read: "extracted",
13666
13710
  extractor: found.extractor,
13667
13711
  truncated: cut2 || found.truncated === true,
13668
- title: titleIn(found.metadata) ?? (name2.replace(/\.[^.]+$/, "") || name2),
13712
+ title: titleIn(found.metadata) ?? byName,
13669
13713
  ...found.metadata ? { metadata: found.metadata } : {},
13670
13714
  ...found.sections ? { sections: found.sections } : {}
13671
13715
  };
@@ -13708,6 +13752,73 @@ var previewOf = /* @__PURE__ */ __name((read) => {
13708
13752
  };
13709
13753
  }, "previewOf");
13710
13754
 
13755
+ // dist/sources/readers/ai-model.js
13756
+ var SET = "memo models ai set";
13757
+ var chosen = /* @__PURE__ */ __name((context) => aiTextReader({
13758
+ app: APP,
13759
+ env: context.env,
13760
+ fetch: context.fetch,
13761
+ ...context.keyring ? { keyring: context.keyring } : {},
13762
+ ...context.signal ? { signal: context.signal } : {}
13763
+ }), "chosen");
13764
+ var setting = /* @__PURE__ */ __name((env) => {
13765
+ try {
13766
+ return readAiSetting(aiSettingPath(env));
13767
+ } catch {
13768
+ return void 0;
13769
+ }
13770
+ }, "setting");
13771
+ var reader = /* @__PURE__ */ __name((context) => {
13772
+ try {
13773
+ return chosen(context);
13774
+ } catch {
13775
+ return { refused: "ai.not-set" };
13776
+ }
13777
+ }, "reader");
13778
+ var problemOf = /* @__PURE__ */ __name((refused2) => refused2 === "ai.not-set" ? `no AI model is chosen: ${SET}` : `the AI model has no key: ${SET} --secret-stdin`, "problemOf");
13779
+ var aiModel = {
13780
+ id: "ai-model",
13781
+ title: "AI model",
13782
+ provider: "ai-model",
13783
+ leavesComputer: /* @__PURE__ */ __name((env) => {
13784
+ const found = setting(env);
13785
+ return found === void 0 || aiLeavesComputer(found);
13786
+ }, "leavesComputer"),
13787
+ modelOf: /* @__PURE__ */ __name((env) => {
13788
+ const found = setting(env);
13789
+ return found ? `${found.provider}/${found.model}` : null;
13790
+ }, "modelOf"),
13791
+ readsFiles: false,
13792
+ needsModel: false,
13793
+ probe: /* @__PURE__ */ __name(async (context) => {
13794
+ const found = reader(context);
13795
+ const refused2 = "refused" in found ? found.refused : void 0;
13796
+ return {
13797
+ available: refused2 !== "ai.not-set",
13798
+ signedIn: refused2 === void 0,
13799
+ version: null,
13800
+ models: "refused" in found ? null : [found.by],
13801
+ problem: refused2 === void 0 ? null : problemOf(refused2)
13802
+ };
13803
+ }, "probe"),
13804
+ read: /* @__PURE__ */ __name(async (context, { system, prompt }) => {
13805
+ const found = reader(context);
13806
+ if ("refused" in found)
13807
+ throw new CliError("configuration_error", problemOf(found.refused), {
13808
+ reason: found.refused === "ai.not-set" ? "reader.ai-not-set" : "reader.no-key"
13809
+ });
13810
+ try {
13811
+ return await found.complete({ purpose: "sources", system, prompt, maxTokens: 4096 });
13812
+ } catch (error) {
13813
+ if (isCliError(error) && error.code === "rate_limited")
13814
+ throw new CliError("rate_limited", `${found.by} says the limit is reached; try later`, {
13815
+ reason: "reader.limit"
13816
+ });
13817
+ throw new CliError("invalid_response", `${found.by} failed: memo models ai check names the cause (key, model, credit or address)`, { reason: "reader.failed" });
13818
+ }
13819
+ }, "read")
13820
+ };
13821
+
13711
13822
  // dist/sources/readers/keys.js
13712
13823
  var providerKeys = /* @__PURE__ */ __name(({ env, keyring }) => {
13713
13824
  const where = { appName: APP.appName, prefix: APP.envPrefix, env };
@@ -13715,9 +13826,10 @@ var providerKeys = /* @__PURE__ */ __name(({ env, keyring }) => {
13715
13826
  configDir: resolvePaths(where).config,
13716
13827
  service: APP.appName,
13717
13828
  isolated: isMovedRun(where),
13718
- storage: "keyring",
13719
13829
  env,
13720
- ...keyring ? { keyring } : {}
13830
+ ...keyring ? { keyring } : {},
13831
+ warn: /* @__PURE__ */ __name((message) => process.stderr.write(`${message}
13832
+ `), "warn")
13721
13833
  });
13722
13834
  const account2 = /* @__PURE__ */ __name((provider) => `embeddings:${provider}`, "account");
13723
13835
  return {
@@ -14011,10 +14123,13 @@ var ollama = {
14011
14123
  }, "read")
14012
14124
  };
14013
14125
 
14126
+ // dist/sources/readers/types.js
14127
+ var leavesComputer = /* @__PURE__ */ __name((reader2, env) => typeof reader2.leavesComputer === "function" ? reader2.leavesComputer(env) : reader2.leavesComputer, "leavesComputer");
14128
+
14014
14129
  // dist/sources/readers/index.js
14015
- var READERS = [claudeCode, codex, ollama, openaiReader, anthropicReader];
14016
- var READER_IDS = READERS.map((reader) => reader.id);
14017
- var readerOf = /* @__PURE__ */ __name((id) => READERS.find((reader) => reader.id === id), "readerOf");
14130
+ var READERS = [aiModel, claudeCode, codex, ollama, openaiReader, anthropicReader];
14131
+ var READER_IDS = READERS.map((reader2) => reader2.id);
14132
+ var readerOf = /* @__PURE__ */ __name((id) => READERS.find((reader2) => reader2.id === id), "readerOf");
14018
14133
 
14019
14134
  // dist/sources/suggest.js
14020
14135
  import { createHash as createHash4, randomUUID as randomUUID2 } from "node:crypto";
@@ -14108,12 +14223,12 @@ var knownFacts = /* @__PURE__ */ __name(async (store, ref) => {
14108
14223
  return known2;
14109
14224
  }, "knownFacts");
14110
14225
  var suggestFacts = /* @__PURE__ */ __name(async (store, context, input) => {
14111
- const { record: record2, reader, model, subject } = input;
14112
- const key = batchKey({ fingerprint: record2.fingerprint, reader: reader.id, model, subject, again: input.again });
14226
+ const { record: record2, reader: reader2, model, subject } = input;
14227
+ const key = batchKey({ fingerprint: record2.fingerprint, reader: reader2.id, model, subject, again: input.again });
14113
14228
  const held = await stagedUnder(store, key);
14114
14229
  if (held)
14115
14230
  return { key, reused: true, batch: held, dropped: [] };
14116
- const answer = await reader.read(context, { system: SYSTEM, prompt: promptFor(record2), model });
14231
+ const answer = await reader2.read(context, { system: SYSTEM, prompt: promptFor(record2), model });
14117
14232
  const { facts, dropped } = factsIn(answer, record2.text);
14118
14233
  const known2 = await knownFacts(store, record2.reference);
14119
14234
  const fresh = facts.filter((fact) => {
@@ -14137,7 +14252,7 @@ var suggestFacts = /* @__PURE__ */ __name(async (store, context, input) => {
14137
14252
  evidence: [{ reference: record2.reference, fingerprint: record2.fingerprint, quote: fact.quote }]
14138
14253
  }))
14139
14254
  };
14140
- const batch = await store.evidenceFindings.stage(findings, { bot: READER_BOT, model: `${reader.id}/${model ?? "default"}` }, { ownerOnly: true });
14255
+ const batch = await store.evidenceFindings.stage(findings, { bot: READER_BOT, model: `${reader2.id}/${model ?? "default"}` }, { ownerOnly: true });
14141
14256
  return { key, reused: false, batch, dropped };
14142
14257
  }, "suggestFacts");
14143
14258
 
@@ -14160,7 +14275,11 @@ var unknownReader = /* @__PURE__ */ __name((id) => {
14160
14275
  readers: READER_IDS
14161
14276
  });
14162
14277
  }, "unknownReader");
14163
- var chosen = /* @__PURE__ */ __name((env, who, given2) => {
14278
+ var fixedModel = /* @__PURE__ */ __name((reader2) => new CliError("validation_error", `${reader2.title} reads with the model memo models ai set chose; --model is not taken`, {
14279
+ reason: "input.invalid",
14280
+ param: "model"
14281
+ }), "fixedModel");
14282
+ var chosen2 = /* @__PURE__ */ __name((env, who, given2) => {
14164
14283
  if (who !== "owner" && (given2.reader !== void 0 || given2.model !== void 0))
14165
14284
  throw new CliError("permission_error", "only the owner picks the reader; an agent uses the one the owner chose", {
14166
14285
  reason: "reader.owner-picks"
@@ -14169,11 +14288,16 @@ var chosen = /* @__PURE__ */ __name((env, who, given2) => {
14169
14288
  const id = given2.reader ?? config?.reader;
14170
14289
  if (id === void 0)
14171
14290
  throw new CliError("configuration_error", `no reader is chosen for sources; the owner picks one of ${READER_IDS.join(", ")} with memo sources readers set <reader>, or names it with --provider`, { reason: "reader.none-chosen", readers: READER_IDS });
14172
- const reader = readerOf(id) ?? unknownReader(id);
14291
+ const reader2 = readerOf(id) ?? unknownReader(id);
14292
+ if (reader2.modelOf) {
14293
+ if (given2.model !== void 0)
14294
+ throw fixedModel(reader2);
14295
+ return { reader: reader2, model: reader2.modelOf(env) };
14296
+ }
14173
14297
  const model = given2.model ?? (given2.reader === void 0 || given2.reader === config?.reader ? config?.model : void 0);
14174
- if (reader.needsModel && !model)
14175
- throw new CliError("configuration_error", `${reader.title} reads only with a model the owner names: memo sources readers set ${reader.id} --model <model>`, { reason: "reader.model-missing" });
14176
- return { reader, model: model ?? null };
14298
+ if (reader2.needsModel && !model)
14299
+ throw new CliError("configuration_error", `${reader2.title} reads only with a model the owner names: memo sources readers set ${reader2.id} --model <model>`, { reason: "reader.model-missing" });
14300
+ return { reader: reader2, model: model ?? null };
14177
14301
  }, "chosen");
14178
14302
  var documentRef = /* @__PURE__ */ __name(async (store, reference2) => {
14179
14303
  await refuseBareNumber(store, reference2, ["document", "note"]);
@@ -14195,7 +14319,7 @@ var readerCommands = /* @__PURE__ */ __name((program, sources, streams, env, dep
14195
14319
  if (isAgentServer(command, env))
14196
14320
  throw new CliError("permission_error", "over MCP an agent cannot send a source's text to a reader");
14197
14321
  const who = await whoRuns(command, env, { asOwner: options.asOwner, question: "read this source as you?" });
14198
- const { reader, model } = chosen(env, who, { reader: options.provider, model: options.model });
14322
+ const { reader: reader2, model } = chosen2(env, who, { reader: options.provider, model: options.model });
14199
14323
  const item = await withStore(env, async (store) => {
14200
14324
  const ref = await documentRef(store, reference2);
14201
14325
  const subject = options.subject === void 0 ? null : (await subjectOf(store, options.subject)).ref;
@@ -14209,16 +14333,16 @@ var readerCommands = /* @__PURE__ */ __name((program, sources, streams, env, dep
14209
14333
  throw new CliError("not_found", `${ref} is not stored`, { reason: "input.invalid" });
14210
14334
  const done = await suggestFacts(store, context(), {
14211
14335
  record: record2,
14212
- reader,
14336
+ reader: reader2,
14213
14337
  model,
14214
14338
  subject,
14215
14339
  again: options.rescan === true
14216
14340
  });
14217
14341
  return {
14218
14342
  ref,
14219
- reader: reader.id,
14343
+ reader: reader2.id,
14220
14344
  model,
14221
- leavesComputer: reader.leavesComputer,
14345
+ leavesComputer: leavesComputer(reader2, env),
14222
14346
  reused: done.reused,
14223
14347
  batch: done.batch?.id ?? null,
14224
14348
  fingerprint: done.batch?.fingerprint ?? null,
@@ -14235,7 +14359,7 @@ var readerCommands = /* @__PURE__ */ __name((program, sources, streams, env, dep
14235
14359
  };
14236
14360
  });
14237
14361
  print(options.json, itemAnswer(item), [
14238
- item.batch === null ? `${item.ref} ${reader.title} found no fact the text supports` : `${item.ref} ${item.facts.length} fact${item.facts.length === 1 ? "" : "s"} waiting for you in batch ${item.batch}${item.reused ? " (read before; the reader was not asked again)" : ""}`,
14362
+ item.batch === null ? `${item.ref} ${reader2.title} found no fact the text supports` : `${item.ref} ${item.facts.length} fact${item.facts.length === 1 ? "" : "s"} waiting for you in batch ${item.batch}${item.reused ? " (read before; the reader was not asked again)" : ""}`,
14239
14363
  ...item.facts.map((fact) => ` ${fact.id} ${fact.statement}
14240
14364
  "${fact.quote}"`),
14241
14365
  ...item.dropped.length ? [` dropped ${item.dropped.length}: ${item.dropped.map((d) => d.why).join(", ")}`] : [],
@@ -14250,21 +14374,21 @@ var readerCommands = /* @__PURE__ */ __name((program, sources, streams, env, dep
14250
14374
  const terms2 = nativeTerms(listQuery(typedQuery(words), READERS_QUERY, "sources readers list"), "sources readers list");
14251
14375
  const config = loadConfig(env).sources;
14252
14376
  const wanted = terms2.get("id")?.value;
14253
- const all = await Promise.all(READERS.filter((reader) => wanted === void 0 || reader.id === wanted).map(async (reader) => {
14254
- const probe = await reader.probe(context());
14255
- const picked = config?.reader === reader.id;
14377
+ const all = await Promise.all(READERS.filter((reader2) => wanted === void 0 || reader2.id === wanted).map(async (reader2) => {
14378
+ const probe = await reader2.probe(context());
14379
+ const picked = config?.reader === reader2.id;
14256
14380
  return {
14257
- id: reader.id,
14258
- title: reader.title,
14259
- provider: reader.provider,
14381
+ id: reader2.id,
14382
+ title: reader2.title,
14383
+ provider: reader2.provider,
14260
14384
  available: probe.available,
14261
14385
  signedIn: probe.signedIn,
14262
14386
  version: probe.version,
14263
- model: picked ? config?.model ?? null : null,
14387
+ model: reader2.modelOf ? reader2.modelOf(env) : picked ? config?.model ?? null : null,
14264
14388
  models: probe.models,
14265
- needsModel: reader.needsModel,
14266
- leavesComputer: reader.leavesComputer,
14267
- readsFiles: reader.readsFiles,
14389
+ needsModel: reader2.needsModel,
14390
+ leavesComputer: leavesComputer(reader2, env),
14391
+ readsFiles: reader2.readsFiles,
14268
14392
  chosen: picked,
14269
14393
  problem: probe.problem
14270
14394
  };
@@ -14281,20 +14405,22 @@ var readerCommands = /* @__PURE__ */ __name((program, sources, streams, env, dep
14281
14405
  throw new CliError("permission_error", "only the owner picks the reader that reads a source", {
14282
14406
  reason: "reader.owner-picks"
14283
14407
  });
14284
- const reader = readerOf(id) ?? unknownReader(id);
14285
- if (reader.needsModel && !options.model?.trim())
14286
- throw new CliError("validation_error", `${reader.title} needs --model <model>`, {
14408
+ const reader2 = readerOf(id) ?? unknownReader(id);
14409
+ if (reader2.modelOf && options.model !== void 0)
14410
+ throw fixedModel(reader2);
14411
+ if (reader2.needsModel && !options.model?.trim())
14412
+ throw new CliError("validation_error", `${reader2.title} needs --model <model>`, {
14287
14413
  reason: "reader.model-missing",
14288
14414
  param: "model"
14289
14415
  });
14290
14416
  const model = options.model?.trim() || void 0;
14291
- updateConfig((config) => ({ ...config, sources: { reader: reader.id, ...model ? { model } : {} } }), env);
14417
+ updateConfig((config) => ({ ...config, sources: { reader: reader2.id, ...model ? { model } : {} } }), env);
14292
14418
  print(options.json, itemAnswer({
14293
- reader: reader.id,
14419
+ reader: reader2.id,
14294
14420
  model: model ?? null,
14295
- leavesComputer: reader.leavesComputer,
14296
- readsFiles: reader.readsFiles
14297
- }), `sources are read with ${reader.title}${model ? ` (${model})` : ""}`);
14421
+ leavesComputer: leavesComputer(reader2, env),
14422
+ readsFiles: reader2.readsFiles
14423
+ }), `sources are read with ${reader2.title}${model ? ` (${model})` : ""}`);
14298
14424
  });
14299
14425
  }, "readerCommands");
14300
14426
 
@@ -14345,6 +14471,16 @@ var citing = /* @__PURE__ */ __name(async (store, ref) => {
14345
14471
  const of = /* @__PURE__ */ __name((type) => [...new Set(links.flatMap(({ from }) => from.startsWith(`${type}:`) ? [from] : []))], "of");
14346
14472
  return { facts: of("fact"), memories: of("memory") };
14347
14473
  }, "citing");
14474
+ var IMAGE_WHY = {
14475
+ "ai.not-set": "kept by its name: no AI model is chosen (memo models ai set)",
14476
+ "ai.images-not-allowed": "kept by its name: images may not go to your AI model (memo models ai set \u2026 --allow-remote)",
14477
+ "ai.key-missing": "kept by its name: no key is stored for your AI model (memo models ai set \u2026 --secret-stdin)",
14478
+ "ai.owner-only": "kept by its name: only your own add sends an image to your AI model, not an agent's",
14479
+ "ai.setting-invalid": "kept by its name: the ai section of the WireCat config is not one memo can read (memo models ai set)",
14480
+ "image.unsupported": "kept by its name: the model reads PNG, JPEG and WebP up to 4 MB",
14481
+ "ai.failed": "kept by its name: your AI model could not read it (memo models ai check)"
14482
+ };
14483
+ var imageLine = /* @__PURE__ */ __name((image) => image.read_by ? `read by ${image.read_by}` : IMAGE_WHY[image.reason ?? "ai.failed"], "imageLine");
14348
14484
  var sourcesCommand = /* @__PURE__ */ __name((program, streams, env, { fetch: fetch2, readers = {} } = {}) => {
14349
14485
  const { print, run } = answers(program, streams, env);
14350
14486
  const sources = program.command("sources").summary("files, web pages and text you add by hand").description("sources you add by hand: pasted text, a file or a web page, kept as searchable documents");
@@ -14360,7 +14496,19 @@ var sourcesCommand = /* @__PURE__ */ __name((program, streams, env, { fetch: fet
14360
14496
  const maxChars = options.maxChars ?? SOURCE_TEXT_CHARS;
14361
14497
  const who = await whoRuns(command, env, { asOwner: options.asOwner, question: "add this source as yours?" });
14362
14498
  const by = who === "owner" ? "owner" : { bot: who.bot, reason: options.reason?.trim() || "memo sources add" };
14363
- const read = await (kind === "text" ? readText(environmentOf(command).stdin ?? process.stdin, { maxChars }) : kind === "url" ? readPage2(given2, { maxChars, ...fetch2 ? { fetch: fetch2 } : {} }) : readFile2(given2, { maxChars })).catch((error) => {
14499
+ const read = await (kind === "text" ? readText(environmentOf(command).stdin ?? process.stdin, { maxChars }) : kind === "url" ? readPage2(given2, { maxChars, ...fetch2 ? { fetch: fetch2 } : {} }) : readFile2(given2, {
14500
+ maxChars,
14501
+ // An agent's add never sends the owner's image off this computer; the consent was for the owner's own adds.
14502
+ image: /* @__PURE__ */ __name(() => {
14503
+ if (who !== "owner")
14504
+ return { refused: "ai.owner-only" };
14505
+ try {
14506
+ return aiImageReader({ app: APP, env, keyring: readers.keyring, fetch: readers.fetch });
14507
+ } catch {
14508
+ return { refused: "ai.setting-invalid" };
14509
+ }
14510
+ }, "image")
14511
+ })).catch((error) => {
14364
14512
  throw withNextStep(error);
14365
14513
  });
14366
14514
  const content = {
@@ -14416,7 +14564,8 @@ var sourcesCommand = /* @__PURE__ */ __name((program, streams, env, { fetch: fet
14416
14564
  words: text3,
14417
14565
  meaning: text3 && searchModelPresent(env) && loadConfig(env).notes?.embed !== false
14418
14566
  },
14419
- subjects: saved.subjects
14567
+ subjects: saved.subjects,
14568
+ ...read.image ? { image: read.image } : {}
14420
14569
  };
14421
14570
  });
14422
14571
  print(options.json, itemAnswer(item), [
@@ -14424,6 +14573,7 @@ var sourcesCommand = /* @__PURE__ */ __name((program, streams, env, { fetch: fet
14424
14573
  ` ${item.title ?? ""} ${item.kind}${item.mime ? ` \xB7 ${item.mime}` : ""} \xB7 ${item.chars} characters${item.truncated === true ? " (only the first part is kept)" : ""}`,
14425
14574
  ` kept: ${item.kept === "copy" ? "its text and a copy of the file" : item.kept === "text" ? "its text" : "nothing new"}`,
14426
14575
  ` search: ${item.searchable.words ? "by words" : "by its title and subjects only"}${item.searchable.meaning ? " and by meaning after memo sync" : ""}`,
14576
+ ...item.image ? [` image: ${imageLine(item.image)}`] : [],
14427
14577
  ...item.subjects.length ? [` about: ${item.subjects.join(", ")}`] : []
14428
14578
  ].join("\n"));
14429
14579
  });