@wirecat/cli-memo 0.131.76 → 0.131.78
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.
- package/dist/bin/memo.js +2 -2
- package/dist/bin/memo.js.map +1 -1
- package/dist/bundle/{all-profiles-CGQTLFDM.js → all-profiles-ZEUEPNFD.js} +10 -8
- package/dist/bundle/{anthropic-C744EPRR.js → anthropic-VF75LSDZ.js} +7 -5
- package/dist/bundle/{app-server-LOH7WXAB.js → app-server-Z4TY5VP5.js} +42 -40
- package/dist/bundle/auto-SA667UAT.js +91 -0
- package/dist/bundle/{bun-SQWZDSWT.js → bun-OUR5UZAI.js} +2 -2
- package/dist/bundle/{bun-sqlite-YVBFXNWB.js → bun-sqlite-26ZGEVH3.js} +7 -5
- package/dist/bundle/{chunk-2KGYREGD.js → chunk-22RYCAAO.js} +1604 -1114
- package/dist/bundle/{chunk-W46O6RJ5.js → chunk-2IQWMWMC.js} +42 -130
- package/dist/bundle/{chunk-4O2MYFYC.js → chunk-3EPBPSP6.js} +1 -1
- package/dist/bundle/{chunk-KEBL3PY4.js → chunk-3QBRLN6T.js} +2 -2
- package/dist/bundle/{chunk-Y7YXXWQI.js → chunk-3QV5JWFN.js} +3 -3
- package/dist/bundle/{chunk-LLBZDBPT.js → chunk-4LZLU2V3.js} +4 -4
- package/dist/bundle/{chunk-6RPLAGAL.js → chunk-5NBQOU5V.js} +22 -22
- package/dist/bundle/{chunk-AUCXJVUI.js → chunk-5PCPPT43.js} +34 -32
- package/dist/bundle/{chunk-VYCLOFPC.js → chunk-6A37YXAL.js} +6 -184
- package/dist/bundle/{chunk-3PLYUZAR.js → chunk-6ABWVQ4T.js} +1 -1
- package/dist/bundle/{chunk-NM4QMIOQ.js → chunk-6GHBGGN7.js} +3 -3
- package/dist/bundle/{chunk-RTSRESGX.js → chunk-7DKS4GIW.js} +6 -6
- package/dist/bundle/{chunk-RLRKBPLJ.js → chunk-7ENXMVT5.js} +25 -13
- package/dist/bundle/{chunk-KA5MDFLU.js → chunk-A3QZXQI3.js} +1 -1
- package/dist/bundle/{chunk-ZHAHSVQO.js → chunk-AZIXZIXT.js} +7 -7
- package/dist/bundle/{chunk-NE3UIK5P.js → chunk-B2ZAEF5Z.js} +2 -2
- package/dist/bundle/{chunk-2EZFUIL4.js → chunk-BA6GHX5B.js} +27 -27
- package/dist/bundle/{chunk-V6CRCAWN.js → chunk-D67YDJ35.js} +505 -305
- package/dist/bundle/{chunk-C7OOLF5J.js → chunk-DAEPTQ6N.js} +6 -6
- package/dist/bundle/{chunk-MODHP5VA.js → chunk-DDPZY27T.js} +22 -18
- package/dist/bundle/{chunk-YSOTOUHJ.js → chunk-E5JVYVRX.js} +15 -15
- package/dist/bundle/{chunk-HAMGOLFU.js → chunk-EF33DKMR.js} +1 -1
- package/dist/bundle/{chunk-N2FIIVJV.js → chunk-EI7LYQQA.js} +4 -4
- package/dist/bundle/{chunk-4DTJF6E7.js → chunk-EIQ6HCIB.js} +8 -8
- package/dist/bundle/{chunk-OEH5JUAL.js → chunk-ELKRFQ5Y.js} +13 -13
- package/dist/bundle/chunk-EXFRC4OT.js +106 -0
- package/dist/bundle/{chunk-EVLOYNXC.js → chunk-F7MKFYYP.js} +4 -4
- package/dist/bundle/{chunk-YRJ2576I.js → chunk-GXHPPHGB.js} +11 -11
- package/dist/bundle/{chunk-YNXQAB4X.js → chunk-H2AQV772.js} +11 -11
- package/dist/bundle/{chunk-KYLKZKQ7.js → chunk-I6CZU7X7.js} +2 -2
- package/dist/bundle/{chunk-TGURQ4YH.js → chunk-IFANDP3T.js} +8 -2
- package/dist/bundle/{chunk-MFQTOOHR.js → chunk-JHW2ARPA.js} +35 -35
- package/dist/bundle/{chunk-DUON3SRD.js → chunk-KUY35N7Q.js} +8 -8
- package/dist/bundle/{chunk-SF2OLWBU.js → chunk-LJRXD44C.js} +7 -7
- package/dist/bundle/{chunk-VFJAGY3L.js → chunk-MUFU4LNS.js} +3 -3
- package/dist/bundle/{chunk-3NCRQMEN.js → chunk-MW6IAMUI.js} +1 -1
- package/dist/bundle/{chunk-PFNEOHCY.js → chunk-N7CHOWDF.js} +3 -3
- package/dist/bundle/{chunk-S54Z74G2.js → chunk-NGWKI3E6.js} +2 -2
- package/dist/bundle/{chunk-ODCHYVTW.js → chunk-NXQFVHG4.js} +163 -154
- package/dist/bundle/{chunk-AI6PMW7L.js → chunk-OHMF7LWW.js} +6 -6
- package/dist/bundle/{chunk-XGPSFPLH.js → chunk-OMCET4QP.js} +48 -48
- package/dist/bundle/{chunk-YU7KZW5I.js → chunk-OMGNXKSH.js} +5 -5
- package/dist/bundle/{chunk-4IWOPJL4.js → chunk-OUATPEPP.js} +7 -7
- package/dist/bundle/{chunk-5NY7U6CM.js → chunk-P3UQGKGY.js} +12 -10
- package/dist/bundle/{chunk-DDSKTPU7.js → chunk-PTKJIA7M.js} +4 -4
- package/dist/bundle/{chunk-TD4HM7XL.js → chunk-Q2CQNT3A.js} +1 -1
- package/dist/bundle/{chunk-GB64N6DP.js → chunk-QEJHNTCX.js} +298 -297
- package/dist/bundle/{chunk-FUATAPSB.js → chunk-QU7UPCW2.js} +83 -81
- package/dist/bundle/{chunk-TPWAXJUQ.js → chunk-T37LLOZR.js} +1 -1
- package/dist/bundle/{chunk-OJU774SG.js → chunk-T6LXUBXY.js} +4 -4
- package/dist/bundle/{chunk-TXVXEE7L.js → chunk-TT5RMHM6.js} +6 -6
- package/dist/bundle/{chunk-Z3NRIW4M.js → chunk-TWWYDJBW.js} +1 -1
- package/dist/bundle/{chunk-ZIA7AU7L.js → chunk-UIJBGS6K.js} +2 -2
- package/dist/bundle/{chunk-7PSGKP3R.js → chunk-UWF6WXM7.js} +8 -8
- package/dist/bundle/{chunk-FH753LZS.js → chunk-VHA3LJQT.js} +2 -2
- package/dist/bundle/{chunk-GBU4U55M.js → chunk-VJLJFLKZ.js} +1 -1
- package/dist/bundle/{chunk-H3WELZYK.js → chunk-WETWQO6X.js} +3 -3
- package/dist/bundle/{chunk-7OZEQIK7.js → chunk-WHMKYJZR.js} +1 -1
- package/dist/bundle/{chunk-7XFJRX6F.js → chunk-WHZJHUK6.js} +3 -3
- package/dist/bundle/{chunk-W5ARY4U2.js → chunk-WYSFOL74.js} +4 -4
- package/dist/bundle/chunk-X2SA73EE.js +200 -0
- package/dist/bundle/{chunk-47WS4BML.js → chunk-XC26CUGL.js} +12 -10
- package/dist/bundle/{chunk-6YRVBXFH.js → chunk-XTCN3VUP.js} +10 -10
- package/dist/bundle/{chunk-O3KNZVDZ.js → chunk-Y2J52Y3A.js} +4 -4
- package/dist/bundle/{chunk-42UNPXTC.js → chunk-YOM4PA3A.js} +2 -2
- package/dist/bundle/{chunk-YD7XTYEC.js → chunk-Z4TPRASF.js} +6 -6
- package/dist/bundle/{chunk-5AQIET5P.js → chunk-ZKCAR2OL.js} +2 -2
- package/dist/bundle/command-contract-L5GTW74N.js +34 -0
- package/dist/bundle/{command-server-entry-472XWNSN.js → command-server-entry-A7ZCZWHH.js} +22 -20
- package/dist/bundle/{decode-SFZ67QJN.js → decode-FO2ELPW6.js} +7 -5
- package/dist/bundle/{dispatch-PHB2Y6ZL.js → dispatch-N73TJNYM.js} +3 -3
- package/dist/bundle/{echarts-3U34KH7O.js → echarts-HTY3OB2X.js} +2 -2
- package/dist/bundle/{embed-ZEZXJ45Q.js → embed-2DTGMR7Z.js} +8 -6
- package/dist/bundle/{embedder-AASO2I4Z.js → embedder-N3IGQ2M6.js} +11 -9
- package/dist/bundle/entry-Q7CIJ3TU.js +23 -0
- package/dist/bundle/entry-YDEKGRCA.js +78 -0
- package/dist/bundle/{failure-OBT7CUVW.js → failure-IPHFR3KW.js} +3 -2
- package/dist/bundle/failure-QL3RJILP.js +71 -0
- package/dist/bundle/{first-run-YL3TIUU3.js → first-run-SAADMYEA.js} +11 -9
- package/dist/bundle/first-screen-WXKAIMY6.js +32 -0
- package/dist/bundle/{instructions-HG2ZZ7AP.js → instructions-XB5Y5DFA.js} +1 -1
- package/dist/bundle/mcp-IRJS472M.js +92 -0
- package/dist/bundle/memo.js +9 -56
- package/dist/bundle/{node-7AQN6OTR.js → node-4ZOD7X75.js} +2 -2
- package/dist/bundle/{node-sqlite-55KMFPGI.js → node-sqlite-DWXKYFW6.js} +8 -6
- package/dist/bundle/{oauth-S2GLD4PY.js → oauth-GMIBNJQB.js} +9 -7
- package/dist/bundle/{open-6R4UPST5.js → open-3DBI3MHV.js} +7 -5
- package/dist/bundle/openai-HFJAR7W5.js +26 -0
- package/dist/bundle/{process-C7J3IT7Q.js → process-2H5HNPHH.js} +1 -1
- package/dist/bundle/{program-KWI6M5IB.js → program-VXKN6DLP.js} +300 -149
- package/dist/bundle/{prompt-EEFKVWSA.js → prompt-WETKFAQS.js} +7 -5
- package/dist/bundle/{recognize-STYHVWQ6.js → recognize-5LC3DQ2W.js} +6 -4
- package/dist/bundle/{remote-6MXZXHYY.js → remote-FURTWZ25.js} +9 -7
- package/dist/bundle/{rerank-IMX2ONZG.js → rerank-CMQWT3WC.js} +9 -7
- package/dist/bundle/serve-LEF3PX34.js +24 -0
- package/dist/bundle/server-C2EVLJLW.js +64 -0
- package/dist/bundle/{server-L6OS2MJ5.js → server-GYLFN6Y7.js} +62 -59
- package/dist/bundle/server-L7GHFXJF.js +50 -0
- package/dist/bundle/{state-7MP4KKPG.js → state-OVZT24JF.js} +8 -6
- package/dist/bundle/{store-EMAKEEYI.js → store-SV46T732.js} +14 -12
- package/dist/bundle/store-maintenance-command-TZYC5HVL.js +49 -0
- package/dist/bundle/update-PRBIV3RG.js +74 -0
- package/dist/people/command.d.ts.map +1 -1
- package/dist/people/command.js +3 -2
- package/dist/people/command.js.map +1 -1
- package/dist/people/identities-command.d.ts.map +1 -1
- package/dist/people/identities-command.js +2 -0
- package/dist/people/identities-command.js.map +1 -1
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +6 -0
- package/dist/reasons.js.map +1 -1
- package/dist/run/entry.d.ts +7 -0
- package/dist/run/entry.d.ts.map +1 -0
- package/dist/run/entry.js +62 -0
- package/dist/run/entry.js.map +1 -0
- package/dist/sources/command.d.ts.map +1 -1
- package/dist/sources/command.js +29 -3
- package/dist/sources/command.js.map +1 -1
- package/dist/sources/read.d.ts +16 -2
- package/dist/sources/read.d.ts.map +1 -1
- package/dist/sources/read.js +40 -4
- package/dist/sources/read.js.map +1 -1
- package/dist/sources/readers/ai-model.d.ts +4 -0
- package/dist/sources/readers/ai-model.d.ts.map +1 -0
- package/dist/sources/readers/ai-model.js +74 -0
- package/dist/sources/readers/ai-model.js.map +1 -0
- package/dist/sources/readers/index.d.ts +1 -0
- package/dist/sources/readers/index.d.ts.map +1 -1
- package/dist/sources/readers/index.js +3 -1
- package/dist/sources/readers/index.js.map +1 -1
- package/dist/sources/readers/keys.js +1 -1
- package/dist/sources/readers/keys.js.map +1 -1
- package/dist/sources/readers/types.d.ts +5 -2
- package/dist/sources/readers/types.d.ts.map +1 -1
- package/dist/sources/readers/types.js +1 -1
- package/dist/sources/readers/types.js.map +1 -1
- package/dist/sources/suggest-command.d.ts.map +1 -1
- package/dist/sources/suggest-command.js +16 -5
- package/dist/sources/suggest-command.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/dist/bundle/auto-R3ABUML7.js +0 -89
- package/dist/bundle/command-contract-IEUSFI3B.js +0 -32
- package/dist/bundle/entry-7VHMR3LD.js +0 -21
- package/dist/bundle/failure-DJSK3LGN.js +0 -69
- package/dist/bundle/first-screen-OQVOWRYM.js +0 -30
- package/dist/bundle/mcp-EUFDOVMI.js +0 -90
- package/dist/bundle/openai-JK5GCSDK.js +0 -24
- package/dist/bundle/serve-ZNN464BH.js +0 -22
- package/dist/bundle/server-4CHUUMVI.js +0 -48
- package/dist/bundle/server-VCZCAQOB.js +0 -62
- package/dist/bundle/store-maintenance-command-LWN6OUFA.js +0 -47
- package/dist/bundle/update-I4X2UO6J.js +0 -72
- /package/dist/bundle/{chunk-IKIYW7FW.js → chunk-DK3W4FPW.js} +0 -0
|
@@ -6,18 +6,18 @@ import {
|
|
|
6
6
|
autoState,
|
|
7
7
|
lastAutoRun,
|
|
8
8
|
recordAutoRun
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OHMF7LWW.js";
|
|
10
10
|
import {
|
|
11
11
|
installer,
|
|
12
12
|
latest,
|
|
13
13
|
upgradeCommand
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-AZIXZIXT.js";
|
|
15
15
|
import {
|
|
16
16
|
mcpOwnerAllowed,
|
|
17
17
|
memoLevels,
|
|
18
18
|
readOnlyAvailability,
|
|
19
19
|
refuseWritesUnderLock
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-7DKS4GIW.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-
|
|
32
|
+
} from "./chunk-EIQ6HCIB.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-
|
|
69
|
+
} from "./chunk-JHW2ARPA.js";
|
|
70
70
|
import "./chunk-QP3KNC5D.js";
|
|
71
|
-
import "./chunk-
|
|
72
|
-
import "./chunk-
|
|
73
|
-
import "./chunk-
|
|
71
|
+
import "./chunk-MUFU4LNS.js";
|
|
72
|
+
import "./chunk-XTCN3VUP.js";
|
|
73
|
+
import "./chunk-PTKJIA7M.js";
|
|
74
74
|
import {
|
|
75
75
|
errorObject,
|
|
76
76
|
recognisable
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-XC26CUGL.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-
|
|
146
|
-
import "./chunk-
|
|
147
|
-
import "./chunk-
|
|
148
|
-
import "./chunk-
|
|
154
|
+
} from "./chunk-D67YDJ35.js";
|
|
155
|
+
import "./chunk-T37LLOZR.js";
|
|
156
|
+
import "./chunk-A3QZXQI3.js";
|
|
157
|
+
import "./chunk-6ABWVQ4T.js";
|
|
149
158
|
import {
|
|
150
159
|
allHitItem,
|
|
151
160
|
coverageGaps,
|
|
152
161
|
messageHitItem,
|
|
153
162
|
noteHitItem,
|
|
154
163
|
shownOf
|
|
155
|
-
} from "./chunk-
|
|
156
|
-
import "./chunk-
|
|
164
|
+
} from "./chunk-5NBQOU5V.js";
|
|
165
|
+
import "./chunk-YOM4PA3A.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-
|
|
164
|
-
import "./chunk-
|
|
172
|
+
} from "./chunk-7ENXMVT5.js";
|
|
173
|
+
import "./chunk-EI7LYQQA.js";
|
|
165
174
|
import {
|
|
166
175
|
recoveryNotes,
|
|
167
176
|
storeInfo,
|
|
168
177
|
storeRecoveryCheck,
|
|
169
178
|
storeRecoveryRun,
|
|
170
179
|
storeSummary
|
|
171
|
-
} from "./chunk-
|
|
172
|
-
import "./chunk-
|
|
180
|
+
} from "./chunk-OMCET4QP.js";
|
|
181
|
+
import "./chunk-E5JVYVRX.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-
|
|
258
|
+
} from "./chunk-QEJHNTCX.js";
|
|
249
259
|
import {
|
|
250
260
|
readBoundedUtf8File,
|
|
251
261
|
writeFileAtomic
|
|
252
|
-
} from "./chunk-
|
|
262
|
+
} from "./chunk-ELKRFQ5Y.js";
|
|
253
263
|
import {
|
|
254
264
|
releaseLock,
|
|
255
265
|
servingProfiles,
|
|
256
266
|
takeLock
|
|
257
|
-
} from "./chunk-
|
|
258
|
-
import "./chunk-
|
|
267
|
+
} from "./chunk-N7CHOWDF.js";
|
|
268
|
+
import "./chunk-6GHBGGN7.js";
|
|
259
269
|
import {
|
|
260
270
|
commandsText,
|
|
261
271
|
inSection,
|
|
262
272
|
installHelp
|
|
263
|
-
} from "./chunk-
|
|
273
|
+
} from "./chunk-UWF6WXM7.js";
|
|
264
274
|
import "./chunk-HTQTIKWP.js";
|
|
265
|
-
import "./chunk-
|
|
275
|
+
import "./chunk-GXHPPHGB.js";
|
|
266
276
|
import {
|
|
267
277
|
isNewer
|
|
268
|
-
} from "./chunk-
|
|
278
|
+
} from "./chunk-3QBRLN6T.js";
|
|
269
279
|
import "./chunk-OYKQX4H3.js";
|
|
270
|
-
import "./chunk-
|
|
271
|
-
import "./chunk-
|
|
272
|
-
import "./chunk-
|
|
280
|
+
import "./chunk-H2AQV772.js";
|
|
281
|
+
import "./chunk-WETWQO6X.js";
|
|
282
|
+
import "./chunk-ZKCAR2OL.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-
|
|
313
|
-
import "./chunk-
|
|
314
|
-
import "./chunk-
|
|
315
|
-
import "./chunk-
|
|
316
|
-
import "./chunk-
|
|
317
|
-
import {
|
|
318
|
-
provideTerminal,
|
|
319
|
-
terminalOf
|
|
320
|
-
} from "./chunk-BPGYTJNB.js";
|
|
322
|
+
} from "./chunk-22RYCAAO.js";
|
|
323
|
+
import "./chunk-KUY35N7Q.js";
|
|
324
|
+
import "./chunk-VJLJFLKZ.js";
|
|
325
|
+
import "./chunk-4LZLU2V3.js";
|
|
326
|
+
import "./chunk-Z4TPRASF.js";
|
|
321
327
|
import {
|
|
322
328
|
APP,
|
|
323
329
|
REASONS,
|
|
324
330
|
STORE_CLIENT,
|
|
325
331
|
VERSION
|
|
326
|
-
} from "./chunk-
|
|
332
|
+
} from "./chunk-IFANDP3T.js";
|
|
327
333
|
import "./chunk-NT5IOEEK.js";
|
|
328
334
|
import "./chunk-D72URWJE.js";
|
|
329
|
-
import "./chunk-
|
|
330
|
-
import "./chunk-
|
|
331
|
-
import "./chunk-
|
|
332
|
-
import "./chunk-
|
|
333
|
-
import "./chunk-
|
|
334
|
-
import "./chunk-
|
|
335
|
+
import "./chunk-OUATPEPP.js";
|
|
336
|
+
import "./chunk-EF33DKMR.js";
|
|
337
|
+
import "./chunk-3QV5JWFN.js";
|
|
338
|
+
import "./chunk-DAEPTQ6N.js";
|
|
339
|
+
import "./chunk-MW6IAMUI.js";
|
|
340
|
+
import "./chunk-Y2J52Y3A.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-
|
|
375
|
-
import "./chunk-
|
|
376
|
-
import "./chunk-
|
|
377
|
-
import "./chunk-
|
|
378
|
-
import "./chunk-
|
|
380
|
+
} from "./chunk-NXQFVHG4.js";
|
|
381
|
+
import "./chunk-LJRXD44C.js";
|
|
382
|
+
import "./chunk-Q2CQNT3A.js";
|
|
383
|
+
import "./chunk-F7MKFYYP.js";
|
|
384
|
+
import "./chunk-NGWKI3E6.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-
|
|
452
|
-
import "./chunk-
|
|
453
|
-
import "./chunk-
|
|
457
|
+
} from "./chunk-QU7UPCW2.js";
|
|
458
|
+
import "./chunk-WHZJHUK6.js";
|
|
459
|
+
import "./chunk-TT5RMHM6.js";
|
|
454
460
|
import {
|
|
455
461
|
sharedModelsDirectory
|
|
456
|
-
} from "./chunk-
|
|
462
|
+
} from "./chunk-T6LXUBXY.js";
|
|
457
463
|
import {
|
|
458
464
|
storePath
|
|
459
|
-
} from "./chunk-
|
|
465
|
+
} from "./chunk-VHA3LJQT.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-
|
|
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-
|
|
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-
|
|
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
|
|
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
|
-
|
|
529
|
-
|
|
530
|
-
|
|
536
|
+
reader2.once("SIGINT", cancel);
|
|
537
|
+
reader2.once("close", cancel);
|
|
538
|
+
reader2.question(question, resolve6);
|
|
531
539
|
});
|
|
532
540
|
} finally {
|
|
533
|
-
|
|
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.
|
|
890
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_1b546a322b3713cdbc9690b4e675a304/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.
|
|
906
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_1b546a322b3713cdbc9690b4e675a304/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.
|
|
2351
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_1b546a322b3713cdbc9690b4e675a304/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.
|
|
2359
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_1b546a322b3713cdbc9690b4e675a304/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.
|
|
2362
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_1b546a322b3713cdbc9690b4e675a304/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.
|
|
2365
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_1b546a322b3713cdbc9690b4e675a304/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.
|
|
2436
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_1b546a322b3713cdbc9690b4e675a304/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,
|
|
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 =
|
|
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:
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
5448
|
+
chatCommand(chat, `messages sync ${chat.chat} --since-time ${since}`, env, chosen3)
|
|
5441
5449
|
), "chatSync");
|
|
5442
|
-
var chatRead = /* @__PURE__ */ __name((chat, since, env,
|
|
5443
|
-
var syncHint = /* @__PURE__ */ __name((chat, since, env,
|
|
5444
|
-
const sync = chatSync(chat, since, env,
|
|
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.
|
|
6971
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_1b546a322b3713cdbc9690b4e675a304/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.
|
|
7051
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_1b546a322b3713cdbc9690b4e675a304/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.
|
|
7054
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_1b546a322b3713cdbc9690b4e675a304/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.
|
|
7131
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_1b546a322b3713cdbc9690b4e675a304/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
|
|
7190
|
-
if (
|
|
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
|
|
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
|
|
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:
|
|
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,
|
|
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,
|
|
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
|
|
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,
|
|
9934
|
-
read: /* @__PURE__ */ __name((chat, since) => step("messages.list", chatRead(linked(chat), since, env,
|
|
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-
|
|
10867
|
+
const { createMemoServer } = await import("./server-GYLFN6Y7.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-
|
|
10870
|
+
const { httpLockFile, mcpUrlOf, portOf, publicUrlOf, serveOverHttp } = await import("./mcp-IRJS472M.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-
|
|
10922
|
+
const { revokeAll } = await import("./mcp-IRJS472M.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
|
|
11336
|
-
if (
|
|
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(
|
|
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 = [];
|
|
@@ -11723,6 +11731,8 @@ var personAnswer = /* @__PURE__ */ __name((person) => ({
|
|
|
11723
11731
|
identity: `${identity.provider}:${identity.id}`,
|
|
11724
11732
|
name: identity.name,
|
|
11725
11733
|
username: identity.username,
|
|
11734
|
+
phone: identity.phone ?? null,
|
|
11735
|
+
email: identity.email ?? null,
|
|
11726
11736
|
seenIn: identity.seenIn,
|
|
11727
11737
|
method: identity.method,
|
|
11728
11738
|
linkedBy: identity.linkedBy,
|
|
@@ -11820,16 +11830,16 @@ var identitiesCommands = /* @__PURE__ */ __name((people, program, streams, env)
|
|
|
11820
11830
|
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
11831
|
await asOwner(command, env, `unlink ${refs.join(" ")}?`);
|
|
11822
11832
|
const person = await withStore(env, async (store) => {
|
|
11823
|
-
const
|
|
11833
|
+
const chosen3 = [];
|
|
11824
11834
|
for (const ref of refs)
|
|
11825
|
-
|
|
11826
|
-
const [first] =
|
|
11827
|
-
if (
|
|
11835
|
+
chosen3.push(await exactIdentityOf(store, ref));
|
|
11836
|
+
const [first] = chosen3;
|
|
11837
|
+
if (chosen3.length === 1)
|
|
11828
11838
|
return store.people.unlinkIdentity(first, { method: "unlink", by: "owner" });
|
|
11829
11839
|
const held = await store.people.personOf(first);
|
|
11830
11840
|
if (held === void 0)
|
|
11831
11841
|
throw new CliError("not_found", `the store has no person for "${refs[0]}"`, { reason: "person.not-found" });
|
|
11832
|
-
return store.people.split(held.uid,
|
|
11842
|
+
return store.people.split(held.uid, chosen3, "owner");
|
|
11833
11843
|
});
|
|
11834
11844
|
print(options.json, itemAnswer(personAnswer(person)), `person:${person.uid}`);
|
|
11835
11845
|
});
|
|
@@ -11914,6 +11924,7 @@ var personRow = /* @__PURE__ */ __name((person) => ({
|
|
|
11914
11924
|
phone: person.phone,
|
|
11915
11925
|
email: person.email,
|
|
11916
11926
|
username: person.username,
|
|
11927
|
+
username_source: person.usernameSource,
|
|
11917
11928
|
messages_from: person.messagesFrom,
|
|
11918
11929
|
last_contact: person.lastContact,
|
|
11919
11930
|
ties: person.ties
|
|
@@ -11962,7 +11973,7 @@ var peopleCommand = /* @__PURE__ */ __name((program, streams, env) => {
|
|
|
11962
11973
|
termField("kind", "enum", "kind:organization", { values: [...PERSON_KINDS, "all"] })
|
|
11963
11974
|
]
|
|
11964
11975
|
};
|
|
11965
|
-
withQuery(annotate(people.command("list"), { effects: LOCAL_READ }).summary("people of one kind, most messages first: person by default").description("people of one kind: person (the default: the owner, people added by hand or assigned a task, and named people with a tie to you, such as a one-to-one chat, a group of at most 10, mail you wrote, a meeting, a CRM or your address book), organization, automated (bots, newsletters, notifications),
|
|
11976
|
+
withQuery(annotate(people.command("list"), { effects: LOCAL_READ }).summary("people of one kind, most messages first: person by default").description("people of one kind: person (the default: the owner, people added by hand or assigned a task, and named people with a tie to you, such as a one-to-one chat, a group of at most 10, mail you wrote, a meeting, a CRM deal of yours or your address book), organization, automated (bots, newsletters, notifications), stranger (no tie), unsorted (no name) or all. The owner first, then by the messages and mail they sent"), query).option("--sort <field>", `${PEOPLE_SORTS.join(", ")} (default interactions)`, oneOf(PEOPLE_SORTS), "interactions").option("--limit <n>", "most people on a page, up to 5000", positive, 500).option("--page <n>", "which page, from 1", positive, 1).option("--json", "print JSON; --json=id,title keeps only those fields").action(async (words, { json: json5, ...options }) => {
|
|
11966
11977
|
const terms2 = queryTerms(words, query, "people list");
|
|
11967
11978
|
const name2 = terms2.get("name");
|
|
11968
11979
|
const kind = terms2.get("kind") ?? "person";
|
|
@@ -13624,7 +13635,7 @@ var readText = /* @__PURE__ */ __name(async (stdin, { maxChars }) => {
|
|
|
13624
13635
|
title: firstLine2(text3)
|
|
13625
13636
|
};
|
|
13626
13637
|
}, "readText");
|
|
13627
|
-
var readFile2 = /* @__PURE__ */ __name(async (path, { maxChars, load = importEngine }) => {
|
|
13638
|
+
var readFile2 = /* @__PURE__ */ __name(async (path, { maxChars, load = importEngine, image }) => {
|
|
13628
13639
|
const stat = statSync5(path, { throwIfNoEntry: false });
|
|
13629
13640
|
const name2 = basename4(path);
|
|
13630
13641
|
if (!stat)
|
|
@@ -13645,6 +13656,42 @@ var readFile2 = /* @__PURE__ */ __name(async (path, { maxChars, load = importEng
|
|
|
13645
13656
|
bytes,
|
|
13646
13657
|
size: bytes.byteLength
|
|
13647
13658
|
};
|
|
13659
|
+
const byName = name2.replace(/\.[^.]+$/, "") || name2;
|
|
13660
|
+
if (found.status === "needs-agent" && mime?.startsWith("image/") && image) {
|
|
13661
|
+
const reader2 = image();
|
|
13662
|
+
if ("refused" in reader2)
|
|
13663
|
+
return {
|
|
13664
|
+
...base,
|
|
13665
|
+
text: "",
|
|
13666
|
+
read: "no-text",
|
|
13667
|
+
extractor: found.extractor ?? null,
|
|
13668
|
+
truncated: false,
|
|
13669
|
+
title: byName,
|
|
13670
|
+
image: { read_by: null, reason: reader2.refused }
|
|
13671
|
+
};
|
|
13672
|
+
const seen = await ocrImage(bytes, reader2.pipeline);
|
|
13673
|
+
if (seen.status === "extracted") {
|
|
13674
|
+
const { text: text4, cut: cut3 } = bounded(seen.text, maxChars);
|
|
13675
|
+
return {
|
|
13676
|
+
...base,
|
|
13677
|
+
text: text4,
|
|
13678
|
+
read: "extracted",
|
|
13679
|
+
extractor: seen.extractor,
|
|
13680
|
+
truncated: cut3,
|
|
13681
|
+
title: byName,
|
|
13682
|
+
image: { read_by: reader2.by, reason: null }
|
|
13683
|
+
};
|
|
13684
|
+
}
|
|
13685
|
+
return {
|
|
13686
|
+
...base,
|
|
13687
|
+
text: "",
|
|
13688
|
+
read: "no-text",
|
|
13689
|
+
extractor: reader2.pipeline.extractor,
|
|
13690
|
+
truncated: false,
|
|
13691
|
+
title: byName,
|
|
13692
|
+
image: { read_by: null, reason: seen.status === "needs-agent" ? "image.unsupported" : "ai.failed" }
|
|
13693
|
+
};
|
|
13694
|
+
}
|
|
13648
13695
|
if (found.status === "needs-agent")
|
|
13649
13696
|
return {
|
|
13650
13697
|
...base,
|
|
@@ -13652,7 +13699,7 @@ var readFile2 = /* @__PURE__ */ __name(async (path, { maxChars, load = importEng
|
|
|
13652
13699
|
read: "no-text",
|
|
13653
13700
|
extractor: found.extractor ?? null,
|
|
13654
13701
|
truncated: false,
|
|
13655
|
-
title:
|
|
13702
|
+
title: byName
|
|
13656
13703
|
};
|
|
13657
13704
|
if (found.status !== "extracted")
|
|
13658
13705
|
throw refusal(found, name2);
|
|
@@ -13665,7 +13712,7 @@ var readFile2 = /* @__PURE__ */ __name(async (path, { maxChars, load = importEng
|
|
|
13665
13712
|
read: "extracted",
|
|
13666
13713
|
extractor: found.extractor,
|
|
13667
13714
|
truncated: cut2 || found.truncated === true,
|
|
13668
|
-
title: titleIn(found.metadata) ??
|
|
13715
|
+
title: titleIn(found.metadata) ?? byName,
|
|
13669
13716
|
...found.metadata ? { metadata: found.metadata } : {},
|
|
13670
13717
|
...found.sections ? { sections: found.sections } : {}
|
|
13671
13718
|
};
|
|
@@ -13708,6 +13755,71 @@ var previewOf = /* @__PURE__ */ __name((read) => {
|
|
|
13708
13755
|
};
|
|
13709
13756
|
}, "previewOf");
|
|
13710
13757
|
|
|
13758
|
+
// dist/sources/readers/ai-model.js
|
|
13759
|
+
var SET = "memo models ai set";
|
|
13760
|
+
var chosen = /* @__PURE__ */ __name((context) => aiTextReader({
|
|
13761
|
+
app: APP,
|
|
13762
|
+
env: context.env,
|
|
13763
|
+
fetch: context.fetch,
|
|
13764
|
+
...context.keyring ? { keyring: context.keyring } : {},
|
|
13765
|
+
...context.signal ? { signal: context.signal } : {}
|
|
13766
|
+
}), "chosen");
|
|
13767
|
+
var setting = /* @__PURE__ */ __name((env) => {
|
|
13768
|
+
try {
|
|
13769
|
+
return readAiSetting(aiSettingPath(env));
|
|
13770
|
+
} catch {
|
|
13771
|
+
return void 0;
|
|
13772
|
+
}
|
|
13773
|
+
}, "setting");
|
|
13774
|
+
var reader = /* @__PURE__ */ __name((context) => {
|
|
13775
|
+
try {
|
|
13776
|
+
return chosen(context);
|
|
13777
|
+
} catch {
|
|
13778
|
+
return { refused: "ai.not-set" };
|
|
13779
|
+
}
|
|
13780
|
+
}, "reader");
|
|
13781
|
+
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");
|
|
13782
|
+
var aiModel = {
|
|
13783
|
+
id: "ai-model",
|
|
13784
|
+
title: "AI model",
|
|
13785
|
+
provider: "ai-model",
|
|
13786
|
+
leavesComputer: /* @__PURE__ */ __name((env) => {
|
|
13787
|
+
const found = setting(env);
|
|
13788
|
+
return found === void 0 || aiLeavesComputer(found);
|
|
13789
|
+
}, "leavesComputer"),
|
|
13790
|
+
modelOf: /* @__PURE__ */ __name((env) => {
|
|
13791
|
+
const found = setting(env);
|
|
13792
|
+
return found ? `${found.provider}/${found.model}` : null;
|
|
13793
|
+
}, "modelOf"),
|
|
13794
|
+
readsFiles: false,
|
|
13795
|
+
needsModel: false,
|
|
13796
|
+
probe: /* @__PURE__ */ __name(async (context) => {
|
|
13797
|
+
const found = reader(context);
|
|
13798
|
+
const refused2 = "refused" in found ? found.refused : void 0;
|
|
13799
|
+
return {
|
|
13800
|
+
available: refused2 !== "ai.not-set",
|
|
13801
|
+
signedIn: refused2 === void 0,
|
|
13802
|
+
version: null,
|
|
13803
|
+
models: "refused" in found ? null : [found.by],
|
|
13804
|
+
problem: refused2 === void 0 ? null : problemOf(refused2)
|
|
13805
|
+
};
|
|
13806
|
+
}, "probe"),
|
|
13807
|
+
read: /* @__PURE__ */ __name(async (context, { system, prompt }) => {
|
|
13808
|
+
const found = reader(context);
|
|
13809
|
+
if ("refused" in found)
|
|
13810
|
+
throw found.refused === "ai.not-set" ? new CliError("configuration_error", problemOf(found.refused), { reason: "reader.ai-not-set" }) : new CliError("authentication_error", problemOf(found.refused), { reason: "reader.no-key" });
|
|
13811
|
+
try {
|
|
13812
|
+
return await found.complete({ purpose: "sources", system, prompt, maxTokens: 4096 });
|
|
13813
|
+
} catch (error) {
|
|
13814
|
+
if (isCliError(error) && error.code === "rate_limited")
|
|
13815
|
+
throw new CliError("rate_limited", `${found.by} says the limit is reached; try later`, {
|
|
13816
|
+
reason: "reader.limit"
|
|
13817
|
+
});
|
|
13818
|
+
throw new CliError("invalid_response", `${found.by} failed: memo models ai check names the cause (key, model, credit or address)`, { reason: "reader.failed" });
|
|
13819
|
+
}
|
|
13820
|
+
}, "read")
|
|
13821
|
+
};
|
|
13822
|
+
|
|
13711
13823
|
// dist/sources/readers/keys.js
|
|
13712
13824
|
var providerKeys = /* @__PURE__ */ __name(({ env, keyring }) => {
|
|
13713
13825
|
const where = { appName: APP.appName, prefix: APP.envPrefix, env };
|
|
@@ -13715,9 +13827,10 @@ var providerKeys = /* @__PURE__ */ __name(({ env, keyring }) => {
|
|
|
13715
13827
|
configDir: resolvePaths(where).config,
|
|
13716
13828
|
service: APP.appName,
|
|
13717
13829
|
isolated: isMovedRun(where),
|
|
13718
|
-
storage: "keyring",
|
|
13719
13830
|
env,
|
|
13720
|
-
...keyring ? { keyring } : {}
|
|
13831
|
+
...keyring ? { keyring } : {},
|
|
13832
|
+
warn: /* @__PURE__ */ __name((message) => process.stderr.write(`${message}
|
|
13833
|
+
`), "warn")
|
|
13721
13834
|
});
|
|
13722
13835
|
const account2 = /* @__PURE__ */ __name((provider) => `embeddings:${provider}`, "account");
|
|
13723
13836
|
return {
|
|
@@ -14011,10 +14124,13 @@ var ollama = {
|
|
|
14011
14124
|
}, "read")
|
|
14012
14125
|
};
|
|
14013
14126
|
|
|
14127
|
+
// dist/sources/readers/types.js
|
|
14128
|
+
var leavesComputer = /* @__PURE__ */ __name((reader2, env) => typeof reader2.leavesComputer === "function" ? reader2.leavesComputer(env) : reader2.leavesComputer, "leavesComputer");
|
|
14129
|
+
|
|
14014
14130
|
// dist/sources/readers/index.js
|
|
14015
|
-
var READERS = [claudeCode, codex, ollama, openaiReader, anthropicReader];
|
|
14016
|
-
var READER_IDS = READERS.map((
|
|
14017
|
-
var readerOf = /* @__PURE__ */ __name((id) => READERS.find((
|
|
14131
|
+
var READERS = [aiModel, claudeCode, codex, ollama, openaiReader, anthropicReader];
|
|
14132
|
+
var READER_IDS = READERS.map((reader2) => reader2.id);
|
|
14133
|
+
var readerOf = /* @__PURE__ */ __name((id) => READERS.find((reader2) => reader2.id === id), "readerOf");
|
|
14018
14134
|
|
|
14019
14135
|
// dist/sources/suggest.js
|
|
14020
14136
|
import { createHash as createHash4, randomUUID as randomUUID2 } from "node:crypto";
|
|
@@ -14108,12 +14224,12 @@ var knownFacts = /* @__PURE__ */ __name(async (store, ref) => {
|
|
|
14108
14224
|
return known2;
|
|
14109
14225
|
}, "knownFacts");
|
|
14110
14226
|
var suggestFacts = /* @__PURE__ */ __name(async (store, context, input) => {
|
|
14111
|
-
const { record: record2, reader, model, subject } = input;
|
|
14112
|
-
const key = batchKey({ fingerprint: record2.fingerprint, reader:
|
|
14227
|
+
const { record: record2, reader: reader2, model, subject } = input;
|
|
14228
|
+
const key = batchKey({ fingerprint: record2.fingerprint, reader: reader2.id, model, subject, again: input.again });
|
|
14113
14229
|
const held = await stagedUnder(store, key);
|
|
14114
14230
|
if (held)
|
|
14115
14231
|
return { key, reused: true, batch: held, dropped: [] };
|
|
14116
|
-
const answer = await
|
|
14232
|
+
const answer = await reader2.read(context, { system: SYSTEM, prompt: promptFor(record2), model });
|
|
14117
14233
|
const { facts, dropped } = factsIn(answer, record2.text);
|
|
14118
14234
|
const known2 = await knownFacts(store, record2.reference);
|
|
14119
14235
|
const fresh = facts.filter((fact) => {
|
|
@@ -14137,7 +14253,7 @@ var suggestFacts = /* @__PURE__ */ __name(async (store, context, input) => {
|
|
|
14137
14253
|
evidence: [{ reference: record2.reference, fingerprint: record2.fingerprint, quote: fact.quote }]
|
|
14138
14254
|
}))
|
|
14139
14255
|
};
|
|
14140
|
-
const batch = await store.evidenceFindings.stage(findings, { bot: READER_BOT, model: `${
|
|
14256
|
+
const batch = await store.evidenceFindings.stage(findings, { bot: READER_BOT, model: `${reader2.id}/${model ?? "default"}` }, { ownerOnly: true });
|
|
14141
14257
|
return { key, reused: false, batch, dropped };
|
|
14142
14258
|
}, "suggestFacts");
|
|
14143
14259
|
|
|
@@ -14160,7 +14276,11 @@ var unknownReader = /* @__PURE__ */ __name((id) => {
|
|
|
14160
14276
|
readers: READER_IDS
|
|
14161
14277
|
});
|
|
14162
14278
|
}, "unknownReader");
|
|
14163
|
-
var
|
|
14279
|
+
var fixedModel = /* @__PURE__ */ __name((reader2) => new CliError("validation_error", `${reader2.title} reads with the model memo models ai set chose; --model is not taken`, {
|
|
14280
|
+
reason: "input.invalid",
|
|
14281
|
+
param: "model"
|
|
14282
|
+
}), "fixedModel");
|
|
14283
|
+
var chosen2 = /* @__PURE__ */ __name((env, who, given2) => {
|
|
14164
14284
|
if (who !== "owner" && (given2.reader !== void 0 || given2.model !== void 0))
|
|
14165
14285
|
throw new CliError("permission_error", "only the owner picks the reader; an agent uses the one the owner chose", {
|
|
14166
14286
|
reason: "reader.owner-picks"
|
|
@@ -14169,11 +14289,16 @@ var chosen = /* @__PURE__ */ __name((env, who, given2) => {
|
|
|
14169
14289
|
const id = given2.reader ?? config?.reader;
|
|
14170
14290
|
if (id === void 0)
|
|
14171
14291
|
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
|
|
14292
|
+
const reader2 = readerOf(id) ?? unknownReader(id);
|
|
14293
|
+
if (reader2.modelOf) {
|
|
14294
|
+
if (given2.model !== void 0)
|
|
14295
|
+
throw fixedModel(reader2);
|
|
14296
|
+
return { reader: reader2, model: reader2.modelOf(env) };
|
|
14297
|
+
}
|
|
14173
14298
|
const model = given2.model ?? (given2.reader === void 0 || given2.reader === config?.reader ? config?.model : void 0);
|
|
14174
|
-
if (
|
|
14175
|
-
throw new CliError("configuration_error", `${
|
|
14176
|
-
return { reader, model: model ?? null };
|
|
14299
|
+
if (reader2.needsModel && !model)
|
|
14300
|
+
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" });
|
|
14301
|
+
return { reader: reader2, model: model ?? null };
|
|
14177
14302
|
}, "chosen");
|
|
14178
14303
|
var documentRef = /* @__PURE__ */ __name(async (store, reference2) => {
|
|
14179
14304
|
await refuseBareNumber(store, reference2, ["document", "note"]);
|
|
@@ -14195,7 +14320,7 @@ var readerCommands = /* @__PURE__ */ __name((program, sources, streams, env, dep
|
|
|
14195
14320
|
if (isAgentServer(command, env))
|
|
14196
14321
|
throw new CliError("permission_error", "over MCP an agent cannot send a source's text to a reader");
|
|
14197
14322
|
const who = await whoRuns(command, env, { asOwner: options.asOwner, question: "read this source as you?" });
|
|
14198
|
-
const { reader, model } =
|
|
14323
|
+
const { reader: reader2, model } = chosen2(env, who, { reader: options.provider, model: options.model });
|
|
14199
14324
|
const item = await withStore(env, async (store) => {
|
|
14200
14325
|
const ref = await documentRef(store, reference2);
|
|
14201
14326
|
const subject = options.subject === void 0 ? null : (await subjectOf(store, options.subject)).ref;
|
|
@@ -14209,16 +14334,16 @@ var readerCommands = /* @__PURE__ */ __name((program, sources, streams, env, dep
|
|
|
14209
14334
|
throw new CliError("not_found", `${ref} is not stored`, { reason: "input.invalid" });
|
|
14210
14335
|
const done = await suggestFacts(store, context(), {
|
|
14211
14336
|
record: record2,
|
|
14212
|
-
reader,
|
|
14337
|
+
reader: reader2,
|
|
14213
14338
|
model,
|
|
14214
14339
|
subject,
|
|
14215
14340
|
again: options.rescan === true
|
|
14216
14341
|
});
|
|
14217
14342
|
return {
|
|
14218
14343
|
ref,
|
|
14219
|
-
reader:
|
|
14344
|
+
reader: reader2.id,
|
|
14220
14345
|
model,
|
|
14221
|
-
leavesComputer:
|
|
14346
|
+
leavesComputer: leavesComputer(reader2, env),
|
|
14222
14347
|
reused: done.reused,
|
|
14223
14348
|
batch: done.batch?.id ?? null,
|
|
14224
14349
|
fingerprint: done.batch?.fingerprint ?? null,
|
|
@@ -14235,7 +14360,7 @@ var readerCommands = /* @__PURE__ */ __name((program, sources, streams, env, dep
|
|
|
14235
14360
|
};
|
|
14236
14361
|
});
|
|
14237
14362
|
print(options.json, itemAnswer(item), [
|
|
14238
|
-
item.batch === null ? `${item.ref} ${
|
|
14363
|
+
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
14364
|
...item.facts.map((fact) => ` ${fact.id} ${fact.statement}
|
|
14240
14365
|
"${fact.quote}"`),
|
|
14241
14366
|
...item.dropped.length ? [` dropped ${item.dropped.length}: ${item.dropped.map((d) => d.why).join(", ")}`] : [],
|
|
@@ -14250,21 +14375,21 @@ var readerCommands = /* @__PURE__ */ __name((program, sources, streams, env, dep
|
|
|
14250
14375
|
const terms2 = nativeTerms(listQuery(typedQuery(words), READERS_QUERY, "sources readers list"), "sources readers list");
|
|
14251
14376
|
const config = loadConfig(env).sources;
|
|
14252
14377
|
const wanted = terms2.get("id")?.value;
|
|
14253
|
-
const all = await Promise.all(READERS.filter((
|
|
14254
|
-
const probe = await
|
|
14255
|
-
const picked = config?.reader ===
|
|
14378
|
+
const all = await Promise.all(READERS.filter((reader2) => wanted === void 0 || reader2.id === wanted).map(async (reader2) => {
|
|
14379
|
+
const probe = await reader2.probe(context());
|
|
14380
|
+
const picked = config?.reader === reader2.id;
|
|
14256
14381
|
return {
|
|
14257
|
-
id:
|
|
14258
|
-
title:
|
|
14259
|
-
provider:
|
|
14382
|
+
id: reader2.id,
|
|
14383
|
+
title: reader2.title,
|
|
14384
|
+
provider: reader2.provider,
|
|
14260
14385
|
available: probe.available,
|
|
14261
14386
|
signedIn: probe.signedIn,
|
|
14262
14387
|
version: probe.version,
|
|
14263
|
-
model: picked ? config?.model ?? null : null,
|
|
14388
|
+
model: reader2.modelOf ? reader2.modelOf(env) : picked ? config?.model ?? null : null,
|
|
14264
14389
|
models: probe.models,
|
|
14265
|
-
needsModel:
|
|
14266
|
-
leavesComputer:
|
|
14267
|
-
readsFiles:
|
|
14390
|
+
needsModel: reader2.needsModel,
|
|
14391
|
+
leavesComputer: leavesComputer(reader2, env),
|
|
14392
|
+
readsFiles: reader2.readsFiles,
|
|
14268
14393
|
chosen: picked,
|
|
14269
14394
|
problem: probe.problem
|
|
14270
14395
|
};
|
|
@@ -14281,20 +14406,22 @@ var readerCommands = /* @__PURE__ */ __name((program, sources, streams, env, dep
|
|
|
14281
14406
|
throw new CliError("permission_error", "only the owner picks the reader that reads a source", {
|
|
14282
14407
|
reason: "reader.owner-picks"
|
|
14283
14408
|
});
|
|
14284
|
-
const
|
|
14285
|
-
if (
|
|
14286
|
-
throw
|
|
14409
|
+
const reader2 = readerOf(id) ?? unknownReader(id);
|
|
14410
|
+
if (reader2.modelOf && options.model !== void 0)
|
|
14411
|
+
throw fixedModel(reader2);
|
|
14412
|
+
if (reader2.needsModel && !options.model?.trim())
|
|
14413
|
+
throw new CliError("validation_error", `${reader2.title} needs --model <model>`, {
|
|
14287
14414
|
reason: "reader.model-missing",
|
|
14288
14415
|
param: "model"
|
|
14289
14416
|
});
|
|
14290
14417
|
const model = options.model?.trim() || void 0;
|
|
14291
|
-
updateConfig((config) => ({ ...config, sources: { reader:
|
|
14418
|
+
updateConfig((config) => ({ ...config, sources: { reader: reader2.id, ...model ? { model } : {} } }), env);
|
|
14292
14419
|
print(options.json, itemAnswer({
|
|
14293
|
-
reader:
|
|
14420
|
+
reader: reader2.id,
|
|
14294
14421
|
model: model ?? null,
|
|
14295
|
-
leavesComputer:
|
|
14296
|
-
readsFiles:
|
|
14297
|
-
}), `sources are read with ${
|
|
14422
|
+
leavesComputer: leavesComputer(reader2, env),
|
|
14423
|
+
readsFiles: reader2.readsFiles
|
|
14424
|
+
}), `sources are read with ${reader2.title}${model ? ` (${model})` : ""}`);
|
|
14298
14425
|
});
|
|
14299
14426
|
}, "readerCommands");
|
|
14300
14427
|
|
|
@@ -14345,6 +14472,16 @@ var citing = /* @__PURE__ */ __name(async (store, ref) => {
|
|
|
14345
14472
|
const of = /* @__PURE__ */ __name((type) => [...new Set(links.flatMap(({ from }) => from.startsWith(`${type}:`) ? [from] : []))], "of");
|
|
14346
14473
|
return { facts: of("fact"), memories: of("memory") };
|
|
14347
14474
|
}, "citing");
|
|
14475
|
+
var IMAGE_WHY = {
|
|
14476
|
+
"ai.not-set": "kept by its name: no AI model is chosen (memo models ai set)",
|
|
14477
|
+
"ai.images-not-allowed": "kept by its name: images may not go to your AI model (memo models ai set \u2026 --allow-remote)",
|
|
14478
|
+
"ai.key-missing": "kept by its name: no key is stored for your AI model (memo models ai set \u2026 --secret-stdin)",
|
|
14479
|
+
"ai.owner-only": "kept by its name: only your own add sends an image to your AI model, not an agent's",
|
|
14480
|
+
"ai.setting-invalid": "kept by its name: the ai section of the WireCat config is not one memo can read (memo models ai set)",
|
|
14481
|
+
"image.unsupported": "kept by its name: the model reads PNG, JPEG and WebP up to 4 MB",
|
|
14482
|
+
"ai.failed": "kept by its name: your AI model could not read it (memo models ai check)"
|
|
14483
|
+
};
|
|
14484
|
+
var imageLine = /* @__PURE__ */ __name((image) => image.read_by ? `read by ${image.read_by}` : IMAGE_WHY[image.reason ?? "ai.failed"], "imageLine");
|
|
14348
14485
|
var sourcesCommand = /* @__PURE__ */ __name((program, streams, env, { fetch: fetch2, readers = {} } = {}) => {
|
|
14349
14486
|
const { print, run } = answers(program, streams, env);
|
|
14350
14487
|
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 +14497,19 @@ var sourcesCommand = /* @__PURE__ */ __name((program, streams, env, { fetch: fet
|
|
|
14360
14497
|
const maxChars = options.maxChars ?? SOURCE_TEXT_CHARS;
|
|
14361
14498
|
const who = await whoRuns(command, env, { asOwner: options.asOwner, question: "add this source as yours?" });
|
|
14362
14499
|
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, {
|
|
14500
|
+
const read = await (kind === "text" ? readText(environmentOf(command).stdin ?? process.stdin, { maxChars }) : kind === "url" ? readPage2(given2, { maxChars, ...fetch2 ? { fetch: fetch2 } : {} }) : readFile2(given2, {
|
|
14501
|
+
maxChars,
|
|
14502
|
+
// An agent's add never sends the owner's image off this computer; the consent was for the owner's own adds.
|
|
14503
|
+
image: /* @__PURE__ */ __name(() => {
|
|
14504
|
+
if (who !== "owner")
|
|
14505
|
+
return { refused: "ai.owner-only" };
|
|
14506
|
+
try {
|
|
14507
|
+
return aiImageReader({ app: APP, env, keyring: readers.keyring, fetch: readers.fetch });
|
|
14508
|
+
} catch {
|
|
14509
|
+
return { refused: "ai.setting-invalid" };
|
|
14510
|
+
}
|
|
14511
|
+
}, "image")
|
|
14512
|
+
})).catch((error) => {
|
|
14364
14513
|
throw withNextStep(error);
|
|
14365
14514
|
});
|
|
14366
14515
|
const content = {
|
|
@@ -14416,7 +14565,8 @@ var sourcesCommand = /* @__PURE__ */ __name((program, streams, env, { fetch: fet
|
|
|
14416
14565
|
words: text3,
|
|
14417
14566
|
meaning: text3 && searchModelPresent(env) && loadConfig(env).notes?.embed !== false
|
|
14418
14567
|
},
|
|
14419
|
-
subjects: saved.subjects
|
|
14568
|
+
subjects: saved.subjects,
|
|
14569
|
+
...read.image ? { image: read.image } : {}
|
|
14420
14570
|
};
|
|
14421
14571
|
});
|
|
14422
14572
|
print(options.json, itemAnswer(item), [
|
|
@@ -14424,6 +14574,7 @@ var sourcesCommand = /* @__PURE__ */ __name((program, streams, env, { fetch: fet
|
|
|
14424
14574
|
` ${item.title ?? ""} ${item.kind}${item.mime ? ` \xB7 ${item.mime}` : ""} \xB7 ${item.chars} characters${item.truncated === true ? " (only the first part is kept)" : ""}`,
|
|
14425
14575
|
` kept: ${item.kept === "copy" ? "its text and a copy of the file" : item.kept === "text" ? "its text" : "nothing new"}`,
|
|
14426
14576
|
` search: ${item.searchable.words ? "by words" : "by its title and subjects only"}${item.searchable.meaning ? " and by meaning after memo sync" : ""}`,
|
|
14577
|
+
...item.image ? [` image: ${imageLine(item.image)}`] : [],
|
|
14427
14578
|
...item.subjects.length ? [` about: ${item.subjects.join(", ")}`] : []
|
|
14428
14579
|
].join("\n"));
|
|
14429
14580
|
});
|