@wirecat/cli-memo 0.131.30 → 0.131.31

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 (117) hide show
  1. package/dist/bin/memo.js +2 -2
  2. package/dist/bundle/{all-profiles-4XCG2A54.js → all-profiles-PFCNICOF.js} +5 -5
  3. package/dist/bundle/{anthropic-MAVIW4DJ.js → anthropic-QLGMYWVZ.js} +3 -3
  4. package/dist/bundle/{app-server-LGSYLIB3.js → app-server-QD67I7V2.js} +35 -35
  5. package/dist/bundle/auto-MCSKUSPU.js +86 -0
  6. package/dist/bundle/{bun-XWUEHWDW.js → bun-JRTUGKIJ.js} +2 -2
  7. package/dist/bundle/{bun-sqlite-OSAC45TI.js → bun-sqlite-HCZP2CNO.js} +2 -2
  8. package/dist/bundle/{chunk-3V5JXPGK.js → chunk-2N74ZVI6.js} +1 -1
  9. package/dist/bundle/{chunk-Q3XFJOAY.js → chunk-2XBDA3XF.js} +1 -1
  10. package/dist/bundle/{chunk-SIY75R4D.js → chunk-3G44GDIZ.js} +5 -5
  11. package/dist/bundle/{chunk-XDQIJSJE.js → chunk-3OH5DJ6X.js} +1 -1
  12. package/dist/bundle/{chunk-TIU2N2SP.js → chunk-42I4XE3O.js} +20 -20
  13. package/dist/bundle/{chunk-RCPP2Q5O.js → chunk-4D6BG353.js} +6 -6
  14. package/dist/bundle/{chunk-IIXZMACE.js → chunk-54DA525P.js} +9 -9
  15. package/dist/bundle/{chunk-2NEXX3EI.js → chunk-5BVGJBZX.js} +1 -1
  16. package/dist/bundle/{chunk-5CKE7LAP.js → chunk-5JTW3LNF.js} +1 -1
  17. package/dist/bundle/{chunk-XV7YW65Y.js → chunk-5YVU6PXP.js} +4 -4
  18. package/dist/bundle/{chunk-RUWY43XR.js → chunk-63JF4E76.js} +480 -256
  19. package/dist/bundle/{chunk-UGV57SZH.js → chunk-7AMJFTJM.js} +1 -1
  20. package/dist/bundle/{chunk-MLDBSKW6.js → chunk-7JWW4YEK.js} +8 -8
  21. package/dist/bundle/{chunk-UVO7UNYH.js → chunk-7MKROF5R.js} +1 -1
  22. package/dist/bundle/{chunk-YJSCSLAT.js → chunk-A56GDMFH.js} +3 -3
  23. package/dist/bundle/{chunk-CYUP7HQG.js → chunk-ARVXP2UJ.js} +258 -258
  24. package/dist/bundle/{chunk-TIQUMRSO.js → chunk-AZGQ7ABE.js} +150 -150
  25. package/dist/bundle/{chunk-DYNSZDXG.js → chunk-CGI5EIIA.js} +20 -20
  26. package/dist/bundle/{chunk-76MMXZ3W.js → chunk-CWHGN6HC.js} +4 -4
  27. package/dist/bundle/{chunk-EJZKYJKO.js → chunk-FE2SLKUO.js} +2 -2
  28. package/dist/bundle/{chunk-HWJHWNBW.js → chunk-FGJKBQCP.js} +3 -3
  29. package/dist/bundle/{chunk-KJE2KFYH.js → chunk-GKZ65EOY.js} +54 -54
  30. package/dist/bundle/{chunk-PJM4QQBT.js → chunk-GNY5YLNY.js} +2 -2
  31. package/dist/bundle/{chunk-GW2KCP4G.js → chunk-H24AL555.js} +27 -27
  32. package/dist/bundle/{program-4UU6HJQM.js → chunk-HGXTDMKN.js} +1498 -10061
  33. package/dist/bundle/{chunk-6ZVN4S36.js → chunk-HLJ6IUVF.js} +2 -2
  34. package/dist/bundle/{chunk-VDGKBAS2.js → chunk-JTSYAO5V.js} +274 -274
  35. package/dist/bundle/{chunk-MHHLYRRD.js → chunk-K3CJHSLS.js} +1 -1
  36. package/dist/bundle/{chunk-QQBRNKHQ.js → chunk-K3TUIQZ4.js} +43 -43
  37. package/dist/bundle/{chunk-5R3OXHIN.js → chunk-K6ZWFP2X.js} +1 -1
  38. package/dist/bundle/{chunk-7VJZKUN3.js → chunk-L34KLQIU.js} +9 -9
  39. package/dist/bundle/{chunk-N4AWIP4D.js → chunk-MVFINUJS.js} +5 -5
  40. package/dist/bundle/{chunk-CNAOMV43.js → chunk-NDJUEFV2.js} +1 -1
  41. package/dist/bundle/{chunk-6SE6ZDBF.js → chunk-NG26I3JV.js} +1 -1
  42. package/dist/bundle/{chunk-U6NL7SAX.js → chunk-OS55OQ74.js} +5 -5
  43. package/dist/bundle/{chunk-M3REIIOH.js → chunk-PG4KORTB.js} +1 -1
  44. package/dist/bundle/{chunk-H52RNBPU.js → chunk-Q2ZIIXA2.js} +2 -2
  45. package/dist/bundle/{chunk-JHLGFPMK.js → chunk-Q3ZB4JGL.js} +2 -2
  46. package/dist/bundle/{chunk-GN3U74DV.js → chunk-QUQOKNAX.js} +12 -12
  47. package/dist/bundle/{chunk-GSCFCNGO.js → chunk-QWA3MTHH.js} +7 -7
  48. package/dist/bundle/{chunk-S34FLB7K.js → chunk-REUXOW2O.js} +2 -2
  49. package/dist/bundle/{chunk-EEKOBGQ7.js → chunk-RO4YPDGF.js} +1 -1
  50. package/dist/bundle/{chunk-UXGQXP5U.js → chunk-ROT4V3ZT.js} +3 -3
  51. package/dist/bundle/{chunk-DIQAOLWH.js → chunk-RRDXT63A.js} +1 -1
  52. package/dist/bundle/{chunk-WUV5O5HN.js → chunk-S3FQQRUM.js} +4 -4
  53. package/dist/bundle/{chunk-DIT5NA73.js → chunk-TFEXCHMC.js} +5 -5
  54. package/dist/bundle/{chunk-UBYCWQSV.js → chunk-URPBRYVA.js} +4 -4
  55. package/dist/bundle/{chunk-B6S42B6J.js → chunk-USMKR34T.js} +11 -11
  56. package/dist/bundle/{chunk-D6BK3H4D.js → chunk-UXA37BVT.js} +4 -4
  57. package/dist/bundle/{chunk-SQHIXN2N.js → chunk-W4GV42D5.js} +2 -2
  58. package/dist/bundle/{chunk-USLIHXWA.js → chunk-WGX6AEUP.js} +3 -3
  59. package/dist/bundle/{chunk-K6Z6B2CW.js → chunk-WP3J2FNH.js} +10 -10
  60. package/dist/bundle/{chunk-3DXTHN5C.js → chunk-X6HXGL5E.js} +7 -7
  61. package/dist/bundle/{chunk-NUEIRBKY.js → chunk-XUMYVRBZ.js} +1 -1
  62. package/dist/bundle/{chunk-Z7J7SVZJ.js → chunk-XWIRWBB5.js} +1 -1
  63. package/dist/bundle/{chunk-U5PEYBQT.js → chunk-ZB5ZZWFR.js} +4 -4
  64. package/dist/bundle/{chunk-YUEAM6ZP.js → chunk-ZHDOELM7.js} +7 -7
  65. package/dist/bundle/{command-contract-ZLDRM6DG.js → command-contract-DFXPO5Q7.js} +11 -11
  66. package/dist/bundle/{decode-Y2DWOSOW.js → decode-7NGILAKQ.js} +2 -2
  67. package/dist/bundle/{echarts-2ZHQHZ4R.js → echarts-JERQI2HW.js} +2 -2
  68. package/dist/bundle/{embed-JEER47U6.js → embed-3AO7KZXC.js} +3 -3
  69. package/dist/bundle/{embedder-BJQEGCE5.js → embedder-WRQ7TDDB.js} +6 -6
  70. package/dist/bundle/{entry-YKH7GAX7.js → entry-IBRPU7NO.js} +4 -4
  71. package/dist/bundle/failure-QBQMSEYX.js +66 -0
  72. package/dist/bundle/{first-run-ESH5B55J.js → first-run-IJOREEQM.js} +5 -5
  73. package/dist/bundle/{first-screen-RTATNK4S.js → first-screen-KYNY6ELY.js} +12 -12
  74. package/dist/bundle/{instructions-NJYYRMYK.js → instructions-BET2PLGV.js} +1 -1
  75. package/dist/bundle/{mcp-ZRKYZLNM.js → mcp-NUBFFPGF.js} +35 -35
  76. package/dist/bundle/memo.js +6 -6
  77. package/dist/bundle/{node-DBNZMTJO.js → node-NCSG7QX5.js} +2 -2
  78. package/dist/bundle/{node-sqlite-CCNVCZSG.js → node-sqlite-QL4M5RIK.js} +3 -3
  79. package/dist/bundle/{oauth-UV7KBQFP.js → oauth-BGMMED35.js} +4 -4
  80. package/dist/bundle/{open-VTOLLLS4.js → open-YN3KJMMQ.js} +2 -2
  81. package/dist/bundle/{openai-RTJNHBCG.js → openai-CTZUSKUS.js} +7 -7
  82. package/dist/bundle/{process-TAFRBB53.js → process-DW237TK4.js} +1 -1
  83. package/dist/bundle/program-Q7VXEIJ7.js +9171 -0
  84. package/dist/bundle/{prompt-ESMCTEJI.js → prompt-EZCCUYCS.js} +2 -2
  85. package/dist/bundle/{recognize-V53GEY6R.js → recognize-XP3LHQD6.js} +1 -1
  86. package/dist/bundle/{remote-KGKRAGA6.js → remote-RLR5ZKKT.js} +4 -4
  87. package/dist/bundle/{rerank-DTD24I7Y.js → rerank-P7LE52AC.js} +4 -4
  88. package/dist/bundle/{serve-2DVSIKM7.js → serve-UA7RQDNK.js} +6 -6
  89. package/dist/bundle/server-N6L3LGQO.js +48 -0
  90. package/dist/bundle/{server-UBMV5OI7.js → server-NWCYWOPZ.js} +50 -50
  91. package/dist/bundle/server-XU362INX.js +61 -0
  92. package/dist/bundle/{state-ONT6T6PY.js → state-72Y55LBR.js} +3 -3
  93. package/dist/bundle/{store-TOYBDMML.js → store-PED4JCBB.js} +9 -9
  94. package/dist/bundle/store-maintenance-command-B364Q2O4.js +48 -0
  95. package/dist/bundle/update-X2A5CW5A.js +69 -0
  96. package/dist/config.d.ts +11 -0
  97. package/dist/config.d.ts.map +1 -1
  98. package/dist/config.js +19 -0
  99. package/dist/config.js.map +1 -1
  100. package/dist/mail/review-command.d.ts.map +1 -1
  101. package/dist/mail/review-command.js +2 -0
  102. package/dist/mail/review-command.js.map +1 -1
  103. package/dist/schedule/command.d.ts.map +1 -1
  104. package/dist/schedule/command.js +4 -3
  105. package/dist/schedule/command.js.map +1 -1
  106. package/dist/version.d.ts +1 -1
  107. package/dist/version.js +1 -1
  108. package/package.json +2 -2
  109. package/skills/mail-triage/SKILL.md +10 -2
  110. package/dist/bundle/auto-72Y6UJWK.js +0 -86
  111. package/dist/bundle/chunk-GACW4GZZ.js +0 -452
  112. package/dist/bundle/failure-JE2JCLGO.js +0 -66
  113. package/dist/bundle/server-ODWZJIRX.js +0 -48
  114. package/dist/bundle/server-V5YRZZID.js +0 -61
  115. package/dist/bundle/store-maintenance-command-HIMIMWFU.js +0 -48
  116. package/dist/bundle/update-AO5UWEBY.js +0 -69
  117. /package/dist/bundle/{chunk-G6I5A2N3.js → chunk-QPPNLE7G.js} +0 -0
@@ -3,6 +3,7 @@ import { overrideSharedContract } from "@wirecat/cli-core/cli";
3
3
  import { mailReadCommands } from "@wirecat/cli-core/mail/cli";
4
4
  import { withStore } from "../answer.js";
5
5
  import { APP } from "../app.js";
6
+ import { bulkTriage } from "../config.js";
6
7
  import { MAIL_SOURCES, oneAccountOf } from "../store/source-list.js";
7
8
  export const MAILBOX_HELP = `the one mailbox: ${MAIL_SOURCES}; may be left out when the store holds one mailbox`;
8
9
  /** cli-core's mail commands read one mailbox per call; memo holds several, so the caller names it. */
@@ -27,6 +28,7 @@ export const mailReviewCommands = (mail, messages, env) => {
27
28
  const reads = {
28
29
  app: APP,
29
30
  read: (command, work) => withStore(env, async (store) => work(store, await oneMailboxOf(store, env, command.opts().source))),
31
+ bulkTriage: () => bulkTriage(env),
30
32
  mount: {
31
33
  review: "mail review",
32
34
  acknowledge: "messages acknowledge",
@@ -1 +1 @@
1
- {"version":3,"file":"review-command.js","sourceRoot":"","sources":["../../src/mail/review-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,EAAkB,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAG7E,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAEpE,MAAM,CAAC,MAAM,YAAY,GAAG,oBAAoB,YAAY,oDAAoD,CAAA;AAEhH,sGAAsG;AACtG,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAC/B,KAAmB,EACnB,GAAsB,EACtB,MAA0B,EACL,EAAE;IACvB,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,IAAI,OAAO,CAAC,CAAA;IAC7D,IAAI,GAAG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,MAAM,MAAM,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAA;IACtC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IACtC,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAA;IAC5E,KAAK,MAAM,OAAO,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC;QACzC,sBAAsB,CACpB,OAAO,EACP,4GAA4G,EAC5G,CAAC,GAAG,EAAE,EAAE;YACN,GAAG;iBACA,MAAM,CAAC,qBAAqB,EAAE,YAAY,CAAC;iBAC3C,MAAM,CAAC,QAAQ,EAAE,qDAAqD,CAAC,CAAA;QAC5E,CAAC,CACF,CAAA;IACH,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;IACvB,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,CAAA;AAClC,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/schedule/command.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKxC;;;;;GAKG;AACH,eAAO,MAAM,eAAe,QAAS,MAAM,CAAC,UAAU,KAAG,OA4BxD,CAAA"}
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/schedule/command.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKxC;;;;;GAKG;AACH,eAAO,MAAM,eAAe,QAAS,MAAM,CAAC,UAAU,KAAG,OA6BxD,CAAA"}
@@ -3,7 +3,7 @@ import { LOCAL_WRITE, outputFor, overrideSharedContract, scheduleCommandFor } fr
3
3
  import { advancePastSkipped, mailWaiting } from "@wirecat/cli-core/mail";
4
4
  import { withStore } from "../answer.js";
5
5
  import { APP } from "../app.js";
6
- import { scheduleLimits } from "../config.js";
6
+ import { bulkTriage, scheduleLimits } from "../config.js";
7
7
  /**
8
8
  * cli-core's `schedule`: a memo command or an agent on a timer. memo has no profiles, and its `--json` is per
9
9
  * command, as on `runs`. An agent's run is allowed `Bash(memo:*)` under MEMO_READ_ONLY. `--on-new-mail <holder>`
@@ -15,8 +15,9 @@ export const scheduleCommand = (env) => {
15
15
  app: APP,
16
16
  context: (command) => ({ ...outputFor(command), env, profile: "" }),
17
17
  newMail: (_command, holder) => withStore(env, async (store) => {
18
- await advancePastSkipped(store, holder);
19
- return mailWaiting(store, holder);
18
+ const triage = bulkTriage(env);
19
+ await advancePastSkipped(store, holder, Date.now(), triage);
20
+ return mailWaiting(store, holder, Date.now(), triage);
20
21
  }),
21
22
  limits: () => scheduleLimits(env),
22
23
  });
@@ -1 +1 @@
1
- {"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/schedule/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1G,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAExE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAsB,EAAW,EAAE;IACjE,MAAM,QAAQ,GAAG,kBAAkB,CAAC;QAClC,GAAG,EAAE,GAAG;QACR,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,SAAS,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;QACnE,OAAO,EAAE,CAAC,QAAQ,E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AsB,CACpB,GAAG,EACH,mHAAmH,EACnH,CAAC,OAAO,EAAE,EAAE;YACV,QAAQ,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAA;QAC7C,CAAC,CACF,CAAA;IACH,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.131.30";
1
+ export declare const VERSION = "0.131.31";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = "0.131.30";
1
+ export const VERSION = "0.131.31";
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirecat/cli-memo",
3
- "version": "0.131.30",
3
+ "version": "0.131.31",
4
4
  "description": "Context about people across messengers, notes and mail, from a local store",
5
5
  "mcpName": "dev.wirecat/cli-memo",
6
6
  "license": "Apache-2.0",
@@ -61,7 +61,7 @@
61
61
  "dependencies": {
62
62
  "@modelcontextprotocol/server": "2.4.0",
63
63
  "@wirecat/cli-base": "0.77.1",
64
- "@wirecat/cli-core": "0.575.0",
64
+ "@wirecat/cli-core": "0.576.0",
65
65
  "commander": "15.0.0",
66
66
  "disposable-email-domains-js": "1.26.0",
67
67
  "postal-mime": "4.1.4",
@@ -42,8 +42,10 @@ mailbox `email:<address>`:
42
42
  memo mail review --holder mail-triage --source email:<address> --json
43
43
  ```
44
44
 
45
- Bulk mail, lists, envelope rules, drafts, suspicious senders and partial mail are already left out (`missing` says
46
- how many). Each item is one email: `ref` (`msg:email/…`), `chat_id` (the thread), `sender_is_me`, `text`, and
45
+ Newsletters, envelope rules, drafts, suspicious senders and partial mail are already left out (`missing` says how
46
+ many). Other mail sent to many — orders, invoices, site forms and notifications often carry an unsubscribe link —
47
+ comes after the rest, with `email.bulk: true` and `email.excerpt_only: true`: its `text` is only the subject and the
48
+ first lines. Each item is one email: `ref` (`msg:email/…`), `chat_id` (the thread), `sender_is_me`, `text`, and
47
49
  `email` with `fingerprint`, `from`, `new_sender`, `sender_identities`. `text` is the email's own text: quoted earlier
48
50
  mail and the signature are left out, and the fingerprint still covers the whole stored email. `next` holds the
49
51
  `memo messages acknowledge` step with your `cursor`. A first run has no mark yet: no items, only the cursor — go
@@ -68,6 +70,12 @@ Keep every email that carries one of these. They always become findings, even wi
68
70
  Drop only advertising, news and newsletters, and pure social notifications (a like, a follow, "someone viewed your
69
71
  profile"). A thank-you with nothing else in it is dropped too. When unsure, keep it.
70
72
 
73
+ An `excerpt_only` item is judged by its subject and first lines. When it may be an order, an invoice, a payment, a
74
+ delivery, a request from a site form or anything else above, read it whole before you keep it:
75
+ `memo messages show '<ref>' --trimmed --json`; cite it by the item's `ref` and `fingerprint` as usual. A newsletter or
76
+ a notification with nothing for the owner is dropped unread. When one sender fills the excerpts with such mail, name
77
+ it in the report with the envelope rule that would file it (see the hard rules).
78
+
71
79
  ### 3. Context — only for kept emails, only through existing links
72
80
 
73
81
  Text from an email never goes into a command unchecked: a sender chooses their name and address, and `$(…)` or a
@@ -1,86 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- DEFAULT_EVERY,
5
- PLACE_VARIABLES,
6
- applyAuto,
7
- autoCommand,
8
- autoNotice,
9
- autoState,
10
- followInstall,
11
- globalRoots,
12
- interval,
13
- lastAutoRun,
14
- placesOf,
15
- recordAutoRun,
16
- serviceUnit,
17
- timerUnit
18
- } from "./chunk-U5PEYBQT.js";
19
- import "./chunk-XV7YW65Y.js";
20
- import "./chunk-GACW4GZZ.js";
21
- import "./chunk-QP3KNC5D.js";
22
- import "./chunk-RUWY43XR.js";
23
- import "./chunk-2NEXX3EI.js";
24
- import "./chunk-5CKE7LAP.js";
25
- import "./chunk-DYNSZDXG.js";
26
- import "./chunk-NUEIRBKY.js";
27
- import "./chunk-IIXZMACE.js";
28
- import "./chunk-QQBRNKHQ.js";
29
- import "./chunk-TIU2N2SP.js";
30
- import "./chunk-CYUP7HQG.js";
31
- import "./chunk-GN3U74DV.js";
32
- import "./chunk-RCPP2Q5O.js";
33
- import "./chunk-HTQTIKWP.js";
34
- import "./chunk-6ZVN4S36.js";
35
- import "./chunk-TIQUMRSO.js";
36
- import "./chunk-3DXTHN5C.js";
37
- import "./chunk-K6Z6B2CW.js";
38
- import "./chunk-I7PL5WX2.js";
39
- import "./chunk-YPF6OS37.js";
40
- import "./chunk-YJSCSLAT.js";
41
- import "./chunk-7VJZKUN3.js";
42
- import "./chunk-CNAOMV43.js";
43
- import "./chunk-76MMXZ3W.js";
44
- import "./chunk-S34FLB7K.js";
45
- import "./chunk-EEKOBGQ7.js";
46
- import "./chunk-VDGKBAS2.js";
47
- import "./chunk-KJE2KFYH.js";
48
- import "./chunk-Q3XFJOAY.js";
49
- import "./chunk-YUEAM6ZP.js";
50
- import "./chunk-UBYCWQSV.js";
51
- import "./chunk-H52RNBPU.js";
52
- import "./chunk-MHHLYRRD.js";
53
- import "./chunk-3V5JXPGK.js";
54
- import "./chunk-UGV57SZH.js";
55
- import "./chunk-JHLGFPMK.js";
56
- import "./chunk-DIT5NA73.js";
57
- import "./chunk-HWJHWNBW.js";
58
- import "./chunk-DIQAOLWH.js";
59
- import "./chunk-XDQIJSJE.js";
60
- import "./chunk-KV4267S4.js";
61
- import "./chunk-LU3WKZBA.js";
62
- import "./chunk-D72URWJE.js";
63
- import "./chunk-SIY75R4D.js";
64
- import "./chunk-6SE6ZDBF.js";
65
- import "./chunk-TZ7WDQPD.js";
66
- import "./chunk-G2BB5WY5.js";
67
- import "./chunk-Y5E2WNWB.js";
68
- import "./chunk-EB2IULWB.js";
69
- import "./chunk-5R3OXHIN.js";
70
- import "./chunk-ZVVMGPBJ.js";
71
- export {
72
- DEFAULT_EVERY,
73
- PLACE_VARIABLES,
74
- applyAuto,
75
- autoCommand,
76
- autoNotice,
77
- autoState,
78
- followInstall,
79
- globalRoots,
80
- interval,
81
- lastAutoRun,
82
- placesOf,
83
- recordAutoRun,
84
- serviceUnit,
85
- timerUnit
86
- };
@@ -1,452 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- require_dist
5
- } from "./chunk-QP3KNC5D.js";
6
- import {
7
- SCHEDULE_SETTINGS,
8
- scheduleLimitsOf
9
- } from "./chunk-RUWY43XR.js";
10
- import {
11
- knownPermissionKeys
12
- } from "./chunk-TIU2N2SP.js";
13
- import {
14
- KEEP_RUNS_FOR_DAYS,
15
- KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
16
- RUNS_SIZE_LIMIT_MB,
17
- checkConfigText,
18
- issueMessage,
19
- readConfigFile,
20
- readConfigText,
21
- settingPathOf,
22
- withSettingDefaults,
23
- withoutSetting
24
- } from "./chunk-TIQUMRSO.js";
25
- import {
26
- DEFAULT_DECISION_POLICY
27
- } from "./chunk-VDGKBAS2.js";
28
- import {
29
- configFilePath,
30
- resolvePaths,
31
- saveConfigFile
32
- } from "./chunk-TZ7WDQPD.js";
33
- import {
34
- array,
35
- boolean,
36
- integer,
37
- literal,
38
- minLength,
39
- minValue,
40
- number,
41
- optional,
42
- picklist,
43
- pipe,
44
- record,
45
- regex,
46
- strictObject,
47
- string,
48
- union,
49
- unknown
50
- } from "./chunk-G2BB5WY5.js";
51
- import {
52
- CliError
53
- } from "./chunk-EB2IULWB.js";
54
- import {
55
- __name,
56
- __toESM
57
- } from "./chunk-ZVVMGPBJ.js";
58
-
59
- // dist/config-issues.js
60
- var pathOf = /* @__PURE__ */ __name((command) => {
61
- const words = [];
62
- for (let at = command; at.parent; at = at.parent)
63
- words.unshift(at.name());
64
- return words;
65
- }, "pathOf");
66
- var permissionKeyOf = /* @__PURE__ */ __name((command) => pathOf(command).join(".") || null, "permissionKeyOf");
67
- var memoPermissionKeys = /* @__PURE__ */ __name((program) => knownPermissionKeys(program, permissionKeyOf, ["mcp.authority"]), "memoPermissionKeys");
68
-
69
- // dist/notes/files.js
70
- import { closeSync, openSync, readdirSync, readSync } from "node:fs";
71
- import { join, relative, sep } from "node:path";
72
- var NOTE_EXTENSIONS = [
73
- ".md",
74
- ".markdown",
75
- ".txt",
76
- ".csv",
77
- ".tsv",
78
- ".pdf",
79
- ".docx",
80
- ".xlsx",
81
- ".odt",
82
- ".ods",
83
- ".pptx",
84
- ".epub",
85
- ".doc",
86
- ".xls"
87
- ];
88
- var MEMO_ID = /^---\r?\n(?:[^\n]*\n)*?memo-id:[ \t]*["']?([^"'\s]+)/;
89
- var HEAD = 1024;
90
- var readMemoId = /* @__PURE__ */ __name((path) => {
91
- const buffer = Buffer.alloc(HEAD);
92
- const descriptor = openSync(path, "r");
93
- try {
94
- const head = buffer.subarray(0, readSync(descriptor, buffer, 0, HEAD, 0)).toString("utf8");
95
- const end = head.indexOf("\n---", 3);
96
- return MEMO_ID.exec(end < 0 ? head : head.slice(0, end + 1))?.[1] ?? null;
97
- } finally {
98
- closeSync(descriptor);
99
- }
100
- }, "readMemoId");
101
- var TEXT_NOTE = /\.(md|markdown)$/i;
102
- var isExported = /* @__PURE__ */ __name((path) => TEXT_NOTE.test(path) && readMemoId(path) !== null, "isExported");
103
- var pattern = /* @__PURE__ */ __name((rule) => {
104
- const glob = rule.replace(/\\/g, "/").replace(/^\/+|\/+$/g, "");
105
- const body = glob.split(/(\*\*\/?|\*|\?)/).map((part) => part === "**/" || part === "**" ? ".*" : part === "*" ? "[^/]*" : part === "?" ? "[^/]" : part.replace(/[.+^${}()|[\]\\]/g, "\\$&")).join("");
106
- return new RegExp(`^${body}(/.*)?$`, "i");
107
- }, "pattern");
108
- var matcher = /* @__PURE__ */ __name((rules) => {
109
- const patterns = rules.map(pattern);
110
- return (inside) => patterns.some((rule) => rule.test(inside));
111
- }, "matcher");
112
- var noteFiles = /* @__PURE__ */ __name((folder, ignore = [], extensions = NOTE_EXTENSIONS, { skipExported = true } = {}) => {
113
- const matches = matcher(ignore);
114
- const ignored = /* @__PURE__ */ __name((path) => matches(relative(folder, path).split(sep).join("/")), "ignored");
115
- const walk = /* @__PURE__ */ __name((dir) => readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
116
- if (entry.name.startsWith("."))
117
- return [];
118
- const path = join(dir, entry.name);
119
- if (ignored(path))
120
- return [];
121
- if (entry.isDirectory())
122
- return walk(path);
123
- if (!entry.isFile() || !extensions.some((ext) => entry.name.toLowerCase().endsWith(ext)))
124
- return [];
125
- return skipExported && isExported(path) ? [] : [path];
126
- }), "walk");
127
- return walk(folder);
128
- }, "noteFiles");
129
-
130
- // dist/notes/dialects/common.js
131
- var import_yaml = __toESM(require_dist(), 1);
132
- import { posix } from "node:path";
133
- var FRONT_MATTER = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/;
134
- var REFERENCE = /^(msg|note|document|person|organization|project|task|chat|contact):\S+$/;
135
- var BARE_REFERENCE = /(?<![\w/:])((?:msg|note|document|person|organization|project|task|chat|contact):[^\s<>()[\]"'`]+)/g;
136
- var MAX_LINKS = 200;
137
- var isReference = /* @__PURE__ */ __name((target) => REFERENCE.test(target), "isReference");
138
- var splitFrontMatter = /* @__PURE__ */ __name((text) => {
139
- const match = FRONT_MATTER.exec(text);
140
- if (!match)
141
- return { frontMatter: {}, body: text };
142
- let data;
143
- try {
144
- data = (0, import_yaml.parse)(match[1] ?? "");
145
- } catch {
146
- data = null;
147
- }
148
- const frontMatter = data !== null && typeof data === "object" && !Array.isArray(data) ? data : {};
149
- return { frontMatter, body: text.slice(match[0].length) };
150
- }, "splitFrontMatter");
151
- var strings = /* @__PURE__ */ __name((value) => typeof value === "string" ? value.split(/[,\s]+/).map((item) => item.trim()).filter(Boolean) : Array.isArray(value) ? value.filter((item) => typeof item === "string").map((item) => item.trim()) : [], "strings");
152
- var frontMatterAliases = /* @__PURE__ */ __name((frontMatter) => {
153
- const value = frontMatter.aliases ?? frontMatter.alias;
154
- return typeof value === "string" ? [value.trim()] : strings(value);
155
- }, "frontMatterAliases");
156
- var frontMatterTags = /* @__PURE__ */ __name((frontMatter) => strings(frontMatter.tags ?? frontMatter.tag).map((tag) => tag.replace(/^#/, "")), "frontMatterTags");
157
- var withoutCode = /* @__PURE__ */ __name((body) => body.replace(/^(```|~~~)[^\n]*\n[\s\S]*?^\1[^\n]*$/gm, "").replace(/`[^`\n]*`/g, ""), "withoutCode");
158
- var titleOf = /* @__PURE__ */ __name((frontMatter, body, path) => {
159
- if (typeof frontMatter.title === "string" && frontMatter.title.trim())
160
- return frontMatter.title.trim();
161
- const heading = /^#\s+(.+?)\s*#*\s*$/m.exec(withoutCode(body))?.[1];
162
- return heading ?? posix.basename(path.replace(/\\/g, "/")).replace(/\.[^./]+$/, "");
163
- }, "titleOf");
164
- var dropNoteExtension = /* @__PURE__ */ __name((target) => target.replace(/\.(md|markdown)$/i, ""), "dropNoteExtension");
165
- var bareReferences = /* @__PURE__ */ __name((body) => [...body.matchAll(BARE_REFERENCE)].map((match) => ({
166
- target: (match[1] ?? "").replace(/[.,;:!?]+$/, ""),
167
- anchor: null,
168
- label: null
169
- })), "bareReferences");
170
- var dedupe = /* @__PURE__ */ __name((links) => {
171
- const seen = /* @__PURE__ */ new Set();
172
- return links.filter((link) => {
173
- const key = `${link.target}\0${link.anchor ?? ""}\0${link.label ?? ""}`;
174
- if (seen.has(key))
175
- return false;
176
- seen.add(key);
177
- return true;
178
- }).slice(0, MAX_LINKS);
179
- }, "dedupe");
180
- var parsedNote = /* @__PURE__ */ __name((frontMatter, body, path, links, inlineTags2 = []) => ({
181
- title: titleOf(frontMatter, body, path),
182
- aliases: frontMatterAliases(frontMatter),
183
- tags: [.../* @__PURE__ */ new Set([...frontMatterTags(frontMatter), ...inlineTags2])],
184
- links: dedupe(links),
185
- frontMatter
186
- }), "parsedNote");
187
- var renderNote = /* @__PURE__ */ __name((note, link) => {
188
- const frontMatter = {
189
- ...note.frontMatter,
190
- ...note.aliases.length ? { aliases: note.aliases } : {},
191
- ...note.tags.length ? { tags: note.tags } : {}
192
- };
193
- const head = Object.keys(frontMatter).length ? `---
194
- ${(0, import_yaml.stringify)(frontMatter).trimEnd()}
195
- ---
196
- ` : "";
197
- const links = note.links.length ? `
198
-
199
- ${note.links.map((item) => `- ${link(item)}`).join("\n")}` : "";
200
- return `${head}# ${note.title}
201
-
202
- ${note.text.trimEnd()}${links}
203
- `;
204
- }, "renderNote");
205
-
206
- // dist/notes/dialects/markdown.js
207
- var LINK = /(?<!!)\[([^\]\n]*)\]\(\s*(<[^>\n]+>|[^)\s]+)(?:\s+"[^"\n]*")?\s*\)/g;
208
- var SCHEME = /^[a-z][a-z0-9+.-]*:/i;
209
- var decode = /* @__PURE__ */ __name((value) => {
210
- try {
211
- return decodeURIComponent(value);
212
- } catch {
213
- return value;
214
- }
215
- }, "decode");
216
- var linkOf = /* @__PURE__ */ __name((label, destination) => {
217
- const angled = destination.startsWith("<") && destination.endsWith(">");
218
- const raw = angled ? destination.slice(1, -1) : destination;
219
- if (isReference(raw))
220
- return { target: raw, anchor: null, label: label.trim() || null };
221
- if (SCHEME.test(raw))
222
- return null;
223
- const hash = raw.indexOf("#");
224
- const path = hash < 0 ? raw : raw.slice(0, hash);
225
- const fragment = hash < 0 ? null : raw.slice(hash + 1);
226
- return {
227
- target: dropNoteExtension(angled ? path : decode(path)).trim(),
228
- anchor: fragment === null ? null : `#${angled ? fragment : decode(fragment)}`,
229
- label: label.trim() || null
230
- };
231
- }, "linkOf");
232
- var markdownLinks = /* @__PURE__ */ __name((body) => [...withoutCode(body).matchAll(LINK)].map((match) => linkOf(match[1] ?? "", match[2] ?? "")).filter((link) => link !== null), "markdownLinks");
233
- var stripMarkdownLinks = /* @__PURE__ */ __name((body) => body.replace(LINK, " "), "stripMarkdownLinks");
234
- var hasOwnExtension = /* @__PURE__ */ __name((target) => NOTE_EXTENSIONS.some((extension) => target.toLowerCase().endsWith(extension)), "hasOwnExtension");
235
- var markdownLink = /* @__PURE__ */ __name((link) => {
236
- if (isReference(link.target))
237
- return `[${link.label ?? link.target}](${link.target})`;
238
- const file = hasOwnExtension(link.target) ? link.target : `${link.target}.md`;
239
- const label = link.label ?? link.target.split("/").pop() ?? link.target;
240
- return `[${label}](<${file}${link.anchor ?? ""}>)`;
241
- }, "markdownLink");
242
- var markdown = {
243
- name: "markdown",
244
- parse(text, path) {
245
- const { frontMatter, body } = splitFrontMatter(text);
246
- const links = markdownLinks(body);
247
- return parsedNote(frontMatter, body, path, [...links, ...bareReferences(withoutCode(stripMarkdownLinks(body)))]);
248
- },
249
- render: /* @__PURE__ */ __name((note) => renderNote(note, markdownLink), "render")
250
- };
251
-
252
- // dist/notes/dialects/obsidian.js
253
- var WIKI = /!?\[\[([^\]|\n]+)(?:\|([^\]\n]*))?\]\]/g;
254
- var TAG = /(?<![\p{L}\p{N}_#&/])#([\p{L}_][\p{L}\p{N}_/-]*)/gu;
255
- var wikiLinks = /* @__PURE__ */ __name((body) => [...withoutCode(body).matchAll(WIKI)].map((match) => {
256
- const raw = (match[1] ?? "").trim();
257
- const label = match[2]?.trim() || null;
258
- if (isReference(raw))
259
- return { target: raw, anchor: null, label };
260
- const split = raw.search(/[#^]/);
261
- return {
262
- target: dropNoteExtension(split < 0 ? raw : raw.slice(0, split)).trim(),
263
- anchor: split < 0 ? null : raw.slice(split),
264
- label
265
- };
266
- }), "wikiLinks");
267
- var inlineTags = /* @__PURE__ */ __name((body) => [
268
- ...new Set([...stripMarkdownLinks(withoutCode(body).replace(WIKI, " ")).matchAll(TAG)].map((match) => match[1] ?? ""))
269
- ], "inlineTags");
270
- var wikiLink = /* @__PURE__ */ __name((link) => isReference(link.target) ? markdownLink(link) : `[[${link.target}${link.anchor ?? ""}${link.label ? `|${link.label}` : ""}]]`, "wikiLink");
271
- var obsidian = {
272
- name: "obsidian",
273
- parse(text, path) {
274
- const { frontMatter, body } = splitFrontMatter(text);
275
- const rest = stripMarkdownLinks(withoutCode(body).replace(WIKI, " "));
276
- return parsedNote(frontMatter, body, path, [...wikiLinks(body), ...markdownLinks(body), ...bareReferences(rest)], inlineTags(body));
277
- },
278
- render: /* @__PURE__ */ __name((note) => renderNote(note, wikiLink), "render")
279
- };
280
-
281
- // dist/notes/dialects/types.js
282
- var DIALECTS = ["obsidian", "markdown"];
283
-
284
- // dist/notes/dialects/index.js
285
- var BY_NAME = { obsidian, markdown };
286
- var dialectOf = /* @__PURE__ */ __name((name = "obsidian") => BY_NAME[name], "dialectOf");
287
-
288
- // dist/config.js
289
- var ConfigSchema = strictObject({
290
- permissions: optional(record(string(), picklist(["deny", "readonly", "ask", "allow"]))),
291
- notes: optional(strictObject({
292
- /** A bare path is the form before folder ids; `memo folders add` turns it into an entry. */
293
- folders: array(union([
294
- string(),
295
- strictObject({
296
- id: pipe(string(), minLength(1)),
297
- path: pipe(string(), minLength(1)),
298
- format: optional(picklist(DIALECTS))
299
- })
300
- ])),
301
- ignore: optional(array(string())),
302
- /** `false` keeps notes out of search by meaning: `memo sync` does not embed them. */
303
- embed: optional(boolean()),
304
- /** Where `memo notes export` and `--export` write internal notes when no folder is given. */
305
- export: optional(strictObject({ dir: pipe(string(), minLength(1)), format: optional(picklist(DIALECTS)) }))
306
- })),
307
- auto: optional(strictObject({
308
- enabled: optional(boolean()),
309
- every: optional(string()),
310
- /** MEMO_CONFIG_DIR, MESSAGING_STORE… as they were at `memo jobs start`, passed to every timer run. */
311
- places: optional(record(string(), string()))
312
- })),
313
- /** `false` keeps only failed runs in `memo runs list`. `--record` and `--no-record` win. */
314
- record: optional(boolean()),
315
- keep_runs_for_days: optional(pipe(number(), integer(), minValue(1))),
316
- keep_successful_runs_for_days: optional(pipe(number(), integer(), minValue(1))),
317
- runs_size_limit_mb: optional(pipe(number(), integer(), minValue(1))),
318
- /** `false` leaves what was typed out of a run's command line, `"failed"` out of a successful one; secrets always. */
319
- record_input: optional(union([boolean(), literal("failed")])),
320
- /** `false` stops the once-a-day check for a newer memo. */
321
- update_check: optional(boolean()),
322
- /** `false` stops an agent deciding proposals for you: `projects actions confirm` and `reject` then need you. */
323
- agent_decisions: optional(boolean()),
324
- /** An agent gated on new mail starts once the oldest waiting email waited this long (`30m`), or this many wait. */
325
- schedule_mail_wait: optional(pipe(string(), regex(/^\d+[mhd]$/, "has to be a duration such as 30m or 2h"))),
326
- schedule_mail_batch: optional(pipe(number(), integer(), minValue(1))),
327
- /** US dollars a day of an agent schedule's runs may cost; 0 turns the cap off. */
328
- schedule_max_cost_per_day: optional(pipe(number(), minValue(0))),
329
- /** The model a new agent schedule runs on unless `--model` names one; empty for the harness's own default. */
330
- schedule_model_claude: optional(string()),
331
- schedule_model_codex: optional(string()),
332
- /** `false` lets a new claude agent schedule load your MCP servers, skills, settings and CLAUDE.md. */
333
- schedule_lean_start: optional(boolean()),
334
- /** Retired: memo no longer imports mail, the `mail` CLI does. Still loads so an old config works; doctor names it. */
335
- mail: optional(unknown())
336
- });
337
- var MEMO_SETTINGS = [
338
- {
339
- key: "agent_decisions",
340
- default: DEFAULT_DECISION_POLICY.agentDecisions,
341
- description: "true lets an agent confirm or reject proposals for you; false keeps every decision yours"
342
- },
343
- { key: "update_check", default: true, description: "check once a day for a newer memo" },
344
- { key: "record", default: true, description: "keep every run in memo runs list; false keeps failed runs only" },
345
- {
346
- key: "record_input",
347
- default: true,
348
- description: `keep what was typed in a run's command line: true, false, or "failed" for failed runs only`
349
- },
350
- { key: "keep_runs_for_days", default: KEEP_RUNS_FOR_DAYS, description: "days a run is kept" },
351
- {
352
- key: "keep_successful_runs_for_days",
353
- default: KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
354
- description: "days a successful run is kept"
355
- },
356
- { key: "runs_size_limit_mb", default: RUNS_SIZE_LIMIT_MB, description: "the most megabytes all runs may take" },
357
- { key: "notes.embed", default: true, description: "false keeps notes out of search by meaning" },
358
- ...SCHEDULE_SETTINGS
359
- ];
360
- var configPath = /* @__PURE__ */ __name((env = process.env) => configFilePath(resolvePaths({ appName: "cli-memo", prefix: "MEMO", env }).config), "configPath");
361
- var loadConfig = /* @__PURE__ */ __name((env = process.env) => {
362
- const path = configPath(env);
363
- const read = readConfigText(path);
364
- if ("issue" in read)
365
- throw new CliError("configuration_error", issueMessage([read.issue], "memo doctor"));
366
- if (read.text === void 0)
367
- return {};
368
- const { issues, config } = checkConfigText(read.text, { file: path, tool: "memo", schema: ConfigSchema });
369
- if (issues.length > 0 || config === void 0)
370
- throw new CliError("configuration_error", issueMessage(issues, "memo doctor"));
371
- return config;
372
- }, "loadConfig");
373
- var decisionPolicy = /* @__PURE__ */ __name((env) => {
374
- let agentDecisions = false;
375
- try {
376
- agentDecisions = loadConfig(env).agent_decisions === true;
377
- } catch {
378
- }
379
- return { ...DEFAULT_DECISION_POLICY, agentDecisions };
380
- }, "decisionPolicy");
381
- var scheduleLimits = /* @__PURE__ */ __name((env) => {
382
- try {
383
- return scheduleLimitsOf(loadConfig(env));
384
- } catch {
385
- return {};
386
- }
387
- }, "scheduleLimits");
388
- var inspectConfig = /* @__PURE__ */ __name((env, program) => {
389
- const path = configPath(env);
390
- const read = readConfigText(path);
391
- if ("issue" in read)
392
- return { path, found: true, issues: [read.issue], config: {} };
393
- if (read.text === void 0)
394
- return { path, found: false, issues: [], config: {} };
395
- const { issues, config } = checkConfigText(read.text, {
396
- file: path,
397
- tool: "memo",
398
- schema: ConfigSchema,
399
- knownPermissions: memoPermissionKeys(program)
400
- });
401
- return { path, found: true, issues, config: config ?? {} };
402
- }, "inspectConfig");
403
- var unsetConfigKey = /* @__PURE__ */ __name((key, env = process.env) => {
404
- if (settingPathOf(key).some((part) => part === ""))
405
- throw new CliError("validation_error", `${key} is not a setting path`);
406
- const path = configPath(env);
407
- const read = readConfigFile(path);
408
- if ("issue" in read)
409
- throw new CliError("configuration_error", issueMessage([read.issue], "memo doctor"));
410
- const { config, removed } = withoutSetting(read.raw, key);
411
- if (removed)
412
- saveConfigFile(path, config);
413
- return removed;
414
- }, "unsetConfigKey");
415
- var updateConfig = /* @__PURE__ */ __name((change, env = process.env) => {
416
- const next = change(loadConfig(env));
417
- saveConfigFile(configPath(env), withSettingDefaults(next, MEMO_SETTINGS).config);
418
- return next;
419
- }, "updateConfig");
420
- var rawConfig = /* @__PURE__ */ __name((env = process.env) => {
421
- const read = readConfigFile(configPath(env));
422
- if ("issue" in read)
423
- throw new CliError("configuration_error", issueMessage([read.issue], "memo doctor"));
424
- return read.raw;
425
- }, "rawConfig");
426
- var migrateConfig = /* @__PURE__ */ __name((env = process.env) => {
427
- const { config, added } = withSettingDefaults(rawConfig(env), MEMO_SETTINGS);
428
- if (added.length > 0)
429
- saveConfigFile(configPath(env), config);
430
- return added;
431
- }, "migrateConfig");
432
-
433
- export {
434
- memoPermissionKeys,
435
- NOTE_EXTENSIONS,
436
- readMemoId,
437
- matcher,
438
- noteFiles,
439
- isReference,
440
- DIALECTS,
441
- dialectOf,
442
- MEMO_SETTINGS,
443
- configPath,
444
- loadConfig,
445
- decisionPolicy,
446
- scheduleLimits,
447
- inspectConfig,
448
- unsetConfigKey,
449
- updateConfig,
450
- rawConfig,
451
- migrateConfig
452
- };