@wirecat/cli-memo 0.131.24 → 0.131.25
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/README.md +9 -12
- package/dist/app.d.ts +1 -1
- package/dist/bin/memo.js +2 -2
- package/dist/bundle/{all-profiles-ZCJTYGOL.js → all-profiles-L2T7PQ7S.js} +9 -9
- package/dist/bundle/{anthropic-7WVLAKTX.js → anthropic-KWI2B4O2.js} +6 -6
- package/dist/bundle/{app-server-6G3SXEHO.js → app-server-GLDIS3HE.js} +42 -42
- package/dist/bundle/auto-QFG57LR6.js +86 -0
- package/dist/bundle/{bun-JVBDJKBB.js → bun-SMKYTOGI.js} +2 -2
- package/dist/bundle/{bun-sqlite-P4I7NVMQ.js → bun-sqlite-PKY3JXMR.js} +5 -5
- package/dist/bundle/{chunk-IC2TL7RW.js → chunk-47EZNSMD.js} +2 -2
- package/dist/bundle/{chunk-LNXFM4FD.js → chunk-4AONXXP2.js} +45 -26
- package/dist/bundle/{chunk-UY2VH3QK.js → chunk-5ANNUWNM.js} +2 -2
- package/dist/bundle/{chunk-3U7OUQV2.js → chunk-5GMOYTJQ.js} +1 -1
- package/dist/bundle/{chunk-EKTZEF3Q.js → chunk-5JYB6QKS.js} +3 -15
- package/dist/bundle/{chunk-GQOXFZBX.js → chunk-5SKYUS4U.js} +278 -279
- package/dist/bundle/{chunk-ALGIPJ6L.js → chunk-6OP743NB.js} +2 -2
- package/dist/bundle/{chunk-VVEFQEWP.js → chunk-7Y6O4UQB.js} +22 -22
- package/dist/bundle/{chunk-Q6MFBH6Q.js → chunk-BNF2ZUNS.js} +9 -9
- package/dist/bundle/{chunk-AIVUS6WA.js → chunk-BX7DVBWD.js} +15 -12
- package/dist/bundle/{chunk-LWIMGWKB.js → chunk-D5ZV7PRP.js} +3 -3
- package/dist/bundle/{chunk-OQK2IKPB.js → chunk-E2WPSRCI.js} +1 -1
- package/dist/bundle/{chunk-CCHHEMPM.js → chunk-EB2IULWB.js} +3 -2
- package/dist/bundle/{chunk-ND3GBFEY.js → chunk-EEVUVWHW.js} +2 -2
- package/dist/bundle/{chunk-UVR6U55E.js → chunk-EFTJ4RTT.js} +6 -6
- package/dist/bundle/{chunk-ZOYGY2PN.js → chunk-ENU2556X.js} +3 -3
- package/dist/bundle/{chunk-EB7LKK4K.js → chunk-ERQHZZNF.js} +1 -1
- package/dist/bundle/{chunk-AWGV4VOA.js → chunk-FS3ABWVX.js} +12 -12
- package/dist/bundle/{chunk-JY4LVWGZ.js → chunk-G2BB5WY5.js} +15 -8
- package/dist/bundle/{chunk-ZLZE5P6M.js → chunk-H5QHU5LZ.js} +8 -8
- package/dist/bundle/{chunk-CM2H7NRC.js → chunk-I5LIEFQR.js} +4 -4
- package/dist/bundle/{chunk-JCCL7RGH.js → chunk-I7PL5WX2.js} +4 -4
- package/dist/bundle/{chunk-JDDVGGUV.js → chunk-IE27DJP3.js} +10 -10
- package/dist/bundle/{chunk-AIGMYGEL.js → chunk-ILUTSRU3.js} +1 -1
- package/dist/bundle/{chunk-UXCDBNAY.js → chunk-INA5WGY7.js} +2 -2
- package/dist/bundle/{chunk-RTESJ5O2.js → chunk-J7T6RSR5.js} +4 -4
- package/dist/bundle/{chunk-F2ED6KG6.js → chunk-JDDLDKC7.js} +3 -3
- package/dist/bundle/{chunk-EACY2ULS.js → chunk-JLBKAIVT.js} +306 -187
- package/dist/bundle/{chunk-5YCNCXL5.js → chunk-JVNSHN2J.js} +1 -1
- package/dist/bundle/{chunk-NAH473ZR.js → chunk-KFZGI7BU.js} +1 -1
- package/dist/bundle/{chunk-ILHTNOIV.js → chunk-KV4267S4.js} +1 -1
- package/dist/bundle/{chunk-MPVW7BQZ.js → chunk-LFNJ6CG6.js} +6 -6
- package/dist/bundle/chunk-MAUKGKRA.js +428 -0
- package/dist/bundle/{chunk-ZDOVR4PA.js → chunk-MWX7UJCL.js} +7 -7
- package/dist/bundle/{chunk-3KNXQZMO.js → chunk-MZS3LIMW.js} +29 -29
- package/dist/bundle/{chunk-UA2C4BCH.js → chunk-NFTWNCEL.js} +9 -9
- package/dist/bundle/{chunk-R2LJDDZP.js → chunk-OGMTUMB7.js} +4 -4
- package/dist/bundle/{chunk-CPJEQK4V.js → chunk-ON5SHKHB.js} +46 -46
- package/dist/bundle/{chunk-DIMX5AEE.js → chunk-PCT2CIYR.js} +5 -5
- package/dist/bundle/{chunk-GSEDSGJF.js → chunk-POXCMAM7.js} +403 -503
- package/dist/bundle/{chunk-GRXVN2X7.js → chunk-QA674BMY.js} +1 -1
- package/dist/bundle/{chunk-ITQBXFMC.js → chunk-QJJSMLBR.js} +3 -3
- package/dist/bundle/{chunk-BTQSFPIM.js → chunk-QOWGFGG3.js} +5 -5
- package/dist/bundle/{chunk-N5H6I7WQ.js → chunk-QYDCVWD4.js} +6 -6
- package/dist/bundle/{chunk-INTF3YPV.js → chunk-RKLZQVKL.js} +2 -2
- package/dist/bundle/{chunk-XF3LZ32F.js → chunk-RTII6JWI.js} +3 -3
- package/dist/bundle/{chunk-M43DAAZ7.js → chunk-SBMBBVXF.js} +1 -1
- package/dist/bundle/{chunk-SKTGBVYC.js → chunk-SW5YJCHC.js} +4 -4
- package/dist/bundle/{chunk-EGG3PGCM.js → chunk-T3R6QHD2.js} +2 -2
- package/dist/bundle/{chunk-T4LW6UYQ.js → chunk-TZ7WDQPD.js} +40 -34
- package/dist/bundle/{chunk-3MER7NE6.js → chunk-UQS6Y2A7.js} +4 -4
- package/dist/bundle/{chunk-ELKYINWL.js → chunk-UWUP3A5H.js} +13 -13
- package/dist/bundle/{chunk-KQSHIQSV.js → chunk-VGYXKQJE.js} +73 -74
- package/dist/bundle/{chunk-FXHN2UZW.js → chunk-VZ3K7IYC.js} +30 -17
- package/dist/bundle/{chunk-IJC6MFLP.js → chunk-WGHQXJHL.js} +10 -10
- package/dist/bundle/{chunk-R3LNQ3I4.js → chunk-WHVH72AD.js} +2 -2
- package/dist/bundle/{chunk-EW3XTUPB.js → chunk-XBIPSSKI.js} +4 -4
- package/dist/bundle/{chunk-2IRCJT4O.js → chunk-XFDE6AL4.js} +8 -8
- package/dist/bundle/{chunk-J6D34BFP.js → chunk-YMAS7U5X.js} +260 -262
- package/dist/bundle/{chunk-PQLBPYJR.js → chunk-YPF6OS37.js} +1 -1
- package/dist/bundle/{chunk-XSI5NYGB.js → chunk-ZKZT6PCF.js} +8 -8
- package/dist/bundle/{chunk-UPXUE27A.js → chunk-ZLB2CM7Z.js} +6 -6
- package/dist/bundle/{chunk-MROFZXAB.js → chunk-ZUV337F2.js} +22 -22
- package/dist/bundle/{chunk-VLPMB3UU.js → chunk-ZVEGLXYB.js} +4 -4
- package/dist/bundle/command-contract-47EKA67S.js +32 -0
- package/dist/bundle/{decode-YHX3DQG2.js → decode-EEDEXCHR.js} +5 -5
- package/dist/bundle/{dispatch-MELZFYOS.js → dispatch-CU5KGRQL.js} +8 -8
- package/dist/bundle/{echarts-FBVAP7BR.js → echarts-36MD3UZF.js} +2 -2
- package/dist/bundle/{embed-CQJ42S5C.js → embed-R6JZ4CDW.js} +6 -6
- package/dist/bundle/{embedder-EDXLEJ27.js → embedder-XUIOKCH6.js} +9 -9
- package/dist/bundle/{entry-HZEA7QFK.js → entry-WOAZRQ5F.js} +7 -7
- package/dist/bundle/failure-BHRE5S75.js +66 -0
- package/dist/bundle/{failure-RBNZBCZJ.js → failure-TUXXI6JT.js} +2 -2
- package/dist/bundle/{first-run-JZQN7R6M.js → first-run-3ZUSIFQJ.js} +11 -11
- package/dist/bundle/first-screen-WQ2IDXDP.js +30 -0
- package/dist/bundle/{instructions-NYVYNWVU.js → instructions-7VMPJMUM.js} +1 -1
- package/dist/bundle/mcp-I7LL7AJG.js +90 -0
- package/dist/bundle/{mcp-MNI62HHE.js → mcp-PPVOM4SE.js} +2 -2
- package/dist/bundle/memo.js +16 -16
- package/dist/bundle/{node-2QE6UPGS.js → node-SBHCG4ZC.js} +2 -2
- package/dist/bundle/{node-sqlite-SDHZJNY7.js → node-sqlite-EMKROM5U.js} +6 -6
- package/dist/bundle/{oauth-FFUJREKS.js → oauth-OJPTUA5K.js} +7 -7
- package/dist/bundle/{open-NT2GYX6N.js → open-XI2AVS5B.js} +5 -5
- package/dist/bundle/{openai-IQA2XR6Z.js → openai-NCYTRZB6.js} +10 -10
- package/dist/bundle/{process-HIEJXYW6.js → process-373B2EBA.js} +1 -1
- package/dist/bundle/{chunk-DMQ3342A.js → program-VW7IJ755.js} +9892 -2082
- package/dist/bundle/{prompt-IOZAME2R.js → prompt-L3KQBPNH.js} +5 -5
- package/dist/bundle/{recognize-2XOAZJ5N.js → recognize-GFWZX4F6.js} +4 -4
- package/dist/bundle/{remote-2LE7OTDA.js → remote-5IGAYQBB.js} +7 -7
- package/dist/bundle/{rerank-UKOVVZM6.js → rerank-6HWHGDFX.js} +7 -7
- package/dist/bundle/{serve-S2UHPEBP.js → serve-AA7RKEOM.js} +9 -9
- package/dist/bundle/server-MWUCYBJF.js +61 -0
- package/dist/bundle/server-XEY5AKKG.js +48 -0
- package/dist/bundle/{server-BG4WWQHY.js → server-Z6L4U6HO.js} +57 -57
- package/dist/bundle/{state-F5KT3CBD.js → state-3WTPOBXR.js} +6 -6
- package/dist/bundle/{store-WBUUS7FO.js → store-LNP5BXUL.js} +13 -13
- package/dist/bundle/store-maintenance-command-6HEGTKPL.js +48 -0
- package/dist/bundle/update-6GWVILUX.js +69 -0
- package/dist/config.d.ts +2 -28
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -35
- package/dist/config.js.map +1 -1
- package/dist/doctor/command.d.ts +0 -12
- package/dist/doctor/command.d.ts.map +1 -1
- package/dist/doctor/command.js +19 -24
- package/dist/doctor/command.js.map +1 -1
- package/dist/examples.d.ts.map +1 -1
- package/dist/examples.js +1 -8
- package/dist/examples.js.map +1 -1
- package/dist/failure.d.ts +2 -2
- package/dist/mail/command.d.ts.map +1 -1
- package/dist/mail/command.js +2 -87
- package/dist/mail/command.js.map +1 -1
- package/dist/mail/findings-command.d.ts.map +1 -1
- package/dist/mail/findings-command.js +1 -1
- package/dist/mail/findings-command.js.map +1 -1
- package/dist/mail/moved.d.ts +1 -1
- package/dist/mail/moved.d.ts.map +1 -1
- package/dist/mail/moved.js +3 -0
- package/dist/mail/moved.js.map +1 -1
- package/dist/mail/review-command.d.ts +1 -1
- package/dist/mail/review-command.d.ts.map +1 -1
- package/dist/program.js +1 -1
- package/dist/program.js.map +1 -1
- package/dist/read-only.d.ts +1 -1
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +1 -13
- package/dist/reasons.js.map +1 -1
- package/dist/run/auto.js +3 -3
- package/dist/run/auto.js.map +1 -1
- package/dist/run/import.d.ts +2 -2
- package/dist/run/import.d.ts.map +1 -1
- package/dist/run/import.js +24 -121
- package/dist/run/import.js.map +1 -1
- package/dist/search/command.js +1 -1
- package/dist/store/source-list.d.ts +1 -6
- package/dist/store/source-list.d.ts.map +1 -1
- package/dist/store/source-list.js +11 -46
- package/dist/store/source-list.js.map +1 -1
- package/dist/tasks/command.js +1 -1
- package/dist/tasks/command.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/scenarios/set-up.md +3 -3
- package/skills/cli-memo/SKILL.md +13 -21
- package/skills/mail-triage/SKILL.md +9 -5
- package/dist/bundle/auto-JWPM5654.js +0 -86
- package/dist/bundle/chunk-MLMSQK76.js +0 -103
- package/dist/bundle/command-contract-543RRFNU.js +0 -32
- package/dist/bundle/failure-62G7QSPX.js +0 -66
- package/dist/bundle/first-screen-56V3UOQE.js +0 -30
- package/dist/bundle/mcp-Y6IPYDS2.js +0 -90
- package/dist/bundle/program-DEMRKCZY.js +0 -10972
- package/dist/bundle/server-3YNOEPWU.js +0 -61
- package/dist/bundle/server-EZWQ5KP4.js +0 -48
- package/dist/bundle/setup-2X7ADKFH.js +0 -973
- package/dist/bundle/store-maintenance-command-KLST56XF.js +0 -48
- package/dist/bundle/update-WH4CGJGP.js +0 -69
- package/dist/mail/accounts.d.ts +0 -7
- package/dist/mail/accounts.d.ts.map +0 -1
- package/dist/mail/accounts.js +0 -28
- package/dist/mail/accounts.js.map +0 -1
- package/dist/mail/backfill-headers.d.ts +0 -11
- package/dist/mail/backfill-headers.d.ts.map +0 -1
- package/dist/mail/backfill-headers.js +0 -84
- package/dist/mail/backfill-headers.js.map +0 -1
- package/dist/mail/domain-age.d.ts +0 -26
- package/dist/mail/domain-age.d.ts.map +0 -1
- package/dist/mail/domain-age.js +0 -151
- package/dist/mail/domain-age.js.map +0 -1
- package/dist/mail/gmail.d.ts +0 -39
- package/dist/mail/gmail.d.ts.map +0 -1
- package/dist/mail/gmail.js +0 -325
- package/dist/mail/gmail.js.map +0 -1
- package/dist/mail/himalaya.d.ts +0 -22
- package/dist/mail/himalaya.d.ts.map +0 -1
- package/dist/mail/himalaya.js +0 -113
- package/dist/mail/himalaya.js.map +0 -1
- package/dist/mail/mbox.d.ts +0 -9
- package/dist/mail/mbox.d.ts.map +0 -1
- package/dist/mail/mbox.js +0 -230
- package/dist/mail/mbox.js.map +0 -1
- package/dist/mail/repair.d.ts +0 -7
- package/dist/mail/repair.d.ts.map +0 -1
- package/dist/mail/repair.js +0 -54
- package/dist/mail/repair.js.map +0 -1
- package/dist/mail/rule-store.d.ts +0 -12
- package/dist/mail/rule-store.d.ts.map +0 -1
- package/dist/mail/rule-store.js +0 -83
- package/dist/mail/rule-store.js.map +0 -1
- package/dist/mail/setup-command.d.ts +0 -4
- package/dist/mail/setup-command.d.ts.map +0 -1
- package/dist/mail/setup-command.js +0 -41
- package/dist/mail/setup-command.js.map +0 -1
- package/dist/mail/setup.d.ts +0 -19
- package/dist/mail/setup.d.ts.map +0 -1
- package/dist/mail/setup.js +0 -95
- package/dist/mail/setup.js.map +0 -1
- package/dist/mail/slices.d.ts +0 -6
- package/dist/mail/slices.d.ts.map +0 -1
- package/dist/mail/slices.js +0 -7
- package/dist/mail/slices.js.map +0 -1
- package/dist/mail/source.d.ts +0 -7
- package/dist/mail/source.d.ts.map +0 -1
- package/dist/mail/source.js +0 -119
- package/dist/mail/source.js.map +0 -1
- package/dist/mail/sync.d.ts +0 -21
- package/dist/mail/sync.d.ts.map +0 -1
- package/dist/mail/sync.js +0 -24
- package/dist/mail/sync.js.map +0 -1
- /package/dist/bundle/{chunk-CWOKGEL3.js → chunk-LU3WKZBA.js} +0 -0
- /package/dist/bundle/{chunk-NUN6OGOV.js → chunk-MNDLWYNQ.js} +0 -0
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
__name
|
|
5
5
|
} from "./chunk-ZVVMGPBJ.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.567.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_90104be51d88dd1f434885448f73ba7c/node_modules/@wirecat/cli-core/dist/background/processes.js
|
|
8
8
|
import { execFileSync } from "node:child_process";
|
|
9
9
|
import { readdirSync, readFileSync, readlinkSync } from "node:fs";
|
|
10
10
|
var alive = /* @__PURE__ */ __name((pid) => {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
__name
|
|
5
5
|
} from "./chunk-ZVVMGPBJ.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.567.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_90104be51d88dd1f434885448f73ba7c/node_modules/@wirecat/cli-core/dist/mcp/instructions.js
|
|
8
8
|
var instructions = /* @__PURE__ */ __name(({ command, name, profile, writes, skill }) => {
|
|
9
9
|
const all = typeof profile !== "string";
|
|
10
10
|
const offers = /* @__PURE__ */ __name((key) => all || writes.includes(key), "offers");
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
__name
|
|
5
5
|
} from "./chunk-ZVVMGPBJ.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
7
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/installer.js
|
|
8
8
|
var installerOf = /* @__PURE__ */ __name((scriptPath) => {
|
|
9
9
|
const path = scriptPath.replaceAll("\\", "/");
|
|
10
10
|
if (path.includes("/_npx/"))
|
|
@@ -5,23 +5,23 @@ import {
|
|
|
5
5
|
installFiles,
|
|
6
6
|
megabytes,
|
|
7
7
|
sharedModelsDirectory
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-J7T6RSR5.js";
|
|
9
9
|
import {
|
|
10
10
|
importFrom
|
|
11
11
|
} from "./chunk-Y5E2WNWB.js";
|
|
12
12
|
import {
|
|
13
13
|
CliError
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-EB2IULWB.js";
|
|
15
15
|
import {
|
|
16
16
|
__name
|
|
17
17
|
} from "./chunk-ZVVMGPBJ.js";
|
|
18
18
|
|
|
19
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.567.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_90104be51d88dd1f434885448f73ba7c/node_modules/@wirecat/cli-core/dist/embeddings/embed.js
|
|
20
20
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
21
21
|
import { availableParallelism } from "node:os";
|
|
22
22
|
import { basename, join as join2 } from "node:path";
|
|
23
23
|
|
|
24
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.567.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_90104be51d88dd1f434885448f73ba7c/node_modules/@wirecat/cli-core/dist/embeddings/onnx-runtime.js
|
|
25
25
|
import { createHash } from "node:crypto";
|
|
26
26
|
import { copyFileSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
27
27
|
import { join } from "node:path";
|
|
@@ -678,7 +678,7 @@ var Unzip = /* @__PURE__ */ (function() {
|
|
|
678
678
|
return Unzip2;
|
|
679
679
|
})();
|
|
680
680
|
|
|
681
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
681
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.567.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_90104be51d88dd1f434885448f73ba7c/node_modules/@wirecat/cli-core/dist/embeddings/onnx-runtime.js
|
|
682
682
|
var ONNX_RUNTIME_VERSION = "1.30.0";
|
|
683
683
|
var release = /* @__PURE__ */ __name((name, sha256, bytes) => ({
|
|
684
684
|
name,
|
|
@@ -858,7 +858,7 @@ var openSession = /* @__PURE__ */ __name(async (bytes, threads, options = {}) =>
|
|
|
858
858
|
return { ort, session: await ort.InferenceSession.create(bytes, options) };
|
|
859
859
|
}, "openSession");
|
|
860
860
|
|
|
861
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
861
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.567.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_90104be51d88dd1f434885448f73ba7c/node_modules/@wirecat/cli-core/dist/embeddings/embed.js
|
|
862
862
|
var textModelsDirectory = /* @__PURE__ */ __name((env = process.env) => sharedModelsDirectory("text", env), "textModelsDirectory");
|
|
863
863
|
var placedText = /* @__PURE__ */ __name((model, directory) => model.files.map((file) => [file, join2(directory, model.id, file.name)]), "placedText");
|
|
864
864
|
var isTextModelInstalled = /* @__PURE__ */ __name((model, directory) => filesPresent(placedText(model, directory)), "isTextModelInstalled");
|
|
@@ -0,0 +1,428 @@
|
|
|
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
|
+
knownPermissionKeys
|
|
8
|
+
} from "./chunk-7Y6O4UQB.js";
|
|
9
|
+
import {
|
|
10
|
+
KEEP_RUNS_FOR_DAYS,
|
|
11
|
+
KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
|
|
12
|
+
RUNS_SIZE_LIMIT_MB,
|
|
13
|
+
checkConfigText,
|
|
14
|
+
issueMessage,
|
|
15
|
+
readConfigFile,
|
|
16
|
+
readConfigText,
|
|
17
|
+
settingPathOf,
|
|
18
|
+
withSettingDefaults,
|
|
19
|
+
withoutSetting
|
|
20
|
+
} from "./chunk-JLBKAIVT.js";
|
|
21
|
+
import {
|
|
22
|
+
DEFAULT_DECISION_POLICY
|
|
23
|
+
} from "./chunk-5SKYUS4U.js";
|
|
24
|
+
import {
|
|
25
|
+
configFilePath,
|
|
26
|
+
resolvePaths,
|
|
27
|
+
saveConfigFile
|
|
28
|
+
} from "./chunk-TZ7WDQPD.js";
|
|
29
|
+
import {
|
|
30
|
+
array,
|
|
31
|
+
boolean,
|
|
32
|
+
integer,
|
|
33
|
+
literal,
|
|
34
|
+
minLength,
|
|
35
|
+
minValue,
|
|
36
|
+
number,
|
|
37
|
+
optional,
|
|
38
|
+
picklist,
|
|
39
|
+
pipe,
|
|
40
|
+
record,
|
|
41
|
+
strictObject,
|
|
42
|
+
string,
|
|
43
|
+
union,
|
|
44
|
+
unknown
|
|
45
|
+
} from "./chunk-G2BB5WY5.js";
|
|
46
|
+
import {
|
|
47
|
+
CliError
|
|
48
|
+
} from "./chunk-EB2IULWB.js";
|
|
49
|
+
import {
|
|
50
|
+
__name,
|
|
51
|
+
__toESM
|
|
52
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
53
|
+
|
|
54
|
+
// dist/config-issues.js
|
|
55
|
+
var pathOf = /* @__PURE__ */ __name((command) => {
|
|
56
|
+
const words = [];
|
|
57
|
+
for (let at = command; at.parent; at = at.parent)
|
|
58
|
+
words.unshift(at.name());
|
|
59
|
+
return words;
|
|
60
|
+
}, "pathOf");
|
|
61
|
+
var permissionKeyOf = /* @__PURE__ */ __name((command) => pathOf(command).join(".") || null, "permissionKeyOf");
|
|
62
|
+
var memoPermissionKeys = /* @__PURE__ */ __name((program) => knownPermissionKeys(program, permissionKeyOf, ["mcp.authority"]), "memoPermissionKeys");
|
|
63
|
+
|
|
64
|
+
// dist/notes/files.js
|
|
65
|
+
import { closeSync, openSync, readdirSync, readSync } from "node:fs";
|
|
66
|
+
import { join, relative, sep } from "node:path";
|
|
67
|
+
var NOTE_EXTENSIONS = [
|
|
68
|
+
".md",
|
|
69
|
+
".markdown",
|
|
70
|
+
".txt",
|
|
71
|
+
".csv",
|
|
72
|
+
".tsv",
|
|
73
|
+
".pdf",
|
|
74
|
+
".docx",
|
|
75
|
+
".xlsx",
|
|
76
|
+
".odt",
|
|
77
|
+
".ods",
|
|
78
|
+
".pptx",
|
|
79
|
+
".epub",
|
|
80
|
+
".doc",
|
|
81
|
+
".xls"
|
|
82
|
+
];
|
|
83
|
+
var MEMO_ID = /^---\r?\n(?:[^\n]*\n)*?memo-id:[ \t]*["']?([^"'\s]+)/;
|
|
84
|
+
var HEAD = 1024;
|
|
85
|
+
var readMemoId = /* @__PURE__ */ __name((path) => {
|
|
86
|
+
const buffer = Buffer.alloc(HEAD);
|
|
87
|
+
const descriptor = openSync(path, "r");
|
|
88
|
+
try {
|
|
89
|
+
const head = buffer.subarray(0, readSync(descriptor, buffer, 0, HEAD, 0)).toString("utf8");
|
|
90
|
+
const end = head.indexOf("\n---", 3);
|
|
91
|
+
return MEMO_ID.exec(end < 0 ? head : head.slice(0, end + 1))?.[1] ?? null;
|
|
92
|
+
} finally {
|
|
93
|
+
closeSync(descriptor);
|
|
94
|
+
}
|
|
95
|
+
}, "readMemoId");
|
|
96
|
+
var TEXT_NOTE = /\.(md|markdown)$/i;
|
|
97
|
+
var isExported = /* @__PURE__ */ __name((path) => TEXT_NOTE.test(path) && readMemoId(path) !== null, "isExported");
|
|
98
|
+
var pattern = /* @__PURE__ */ __name((rule) => {
|
|
99
|
+
const glob = rule.replace(/\\/g, "/").replace(/^\/+|\/+$/g, "");
|
|
100
|
+
const body = glob.split(/(\*\*\/?|\*|\?)/).map((part) => part === "**/" || part === "**" ? ".*" : part === "*" ? "[^/]*" : part === "?" ? "[^/]" : part.replace(/[.+^${}()|[\]\\]/g, "\\$&")).join("");
|
|
101
|
+
return new RegExp(`^${body}(/.*)?$`, "i");
|
|
102
|
+
}, "pattern");
|
|
103
|
+
var matcher = /* @__PURE__ */ __name((rules) => {
|
|
104
|
+
const patterns = rules.map(pattern);
|
|
105
|
+
return (inside) => patterns.some((rule) => rule.test(inside));
|
|
106
|
+
}, "matcher");
|
|
107
|
+
var noteFiles = /* @__PURE__ */ __name((folder, ignore = [], extensions = NOTE_EXTENSIONS, { skipExported = true } = {}) => {
|
|
108
|
+
const matches = matcher(ignore);
|
|
109
|
+
const ignored = /* @__PURE__ */ __name((path) => matches(relative(folder, path).split(sep).join("/")), "ignored");
|
|
110
|
+
const walk = /* @__PURE__ */ __name((dir) => readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
|
|
111
|
+
if (entry.name.startsWith("."))
|
|
112
|
+
return [];
|
|
113
|
+
const path = join(dir, entry.name);
|
|
114
|
+
if (ignored(path))
|
|
115
|
+
return [];
|
|
116
|
+
if (entry.isDirectory())
|
|
117
|
+
return walk(path);
|
|
118
|
+
if (!entry.isFile() || !extensions.some((ext) => entry.name.toLowerCase().endsWith(ext)))
|
|
119
|
+
return [];
|
|
120
|
+
return skipExported && isExported(path) ? [] : [path];
|
|
121
|
+
}), "walk");
|
|
122
|
+
return walk(folder);
|
|
123
|
+
}, "noteFiles");
|
|
124
|
+
|
|
125
|
+
// dist/notes/dialects/common.js
|
|
126
|
+
var import_yaml = __toESM(require_dist(), 1);
|
|
127
|
+
import { posix } from "node:path";
|
|
128
|
+
var FRONT_MATTER = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/;
|
|
129
|
+
var REFERENCE = /^(msg|note|document|person|organization|project|task|chat|contact):\S+$/;
|
|
130
|
+
var BARE_REFERENCE = /(?<![\w/:])((?:msg|note|document|person|organization|project|task|chat|contact):[^\s<>()[\]"'`]+)/g;
|
|
131
|
+
var MAX_LINKS = 200;
|
|
132
|
+
var isReference = /* @__PURE__ */ __name((target) => REFERENCE.test(target), "isReference");
|
|
133
|
+
var splitFrontMatter = /* @__PURE__ */ __name((text) => {
|
|
134
|
+
const match = FRONT_MATTER.exec(text);
|
|
135
|
+
if (!match)
|
|
136
|
+
return { frontMatter: {}, body: text };
|
|
137
|
+
let data;
|
|
138
|
+
try {
|
|
139
|
+
data = (0, import_yaml.parse)(match[1] ?? "");
|
|
140
|
+
} catch {
|
|
141
|
+
data = null;
|
|
142
|
+
}
|
|
143
|
+
const frontMatter = data !== null && typeof data === "object" && !Array.isArray(data) ? data : {};
|
|
144
|
+
return { frontMatter, body: text.slice(match[0].length) };
|
|
145
|
+
}, "splitFrontMatter");
|
|
146
|
+
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");
|
|
147
|
+
var frontMatterAliases = /* @__PURE__ */ __name((frontMatter) => {
|
|
148
|
+
const value = frontMatter.aliases ?? frontMatter.alias;
|
|
149
|
+
return typeof value === "string" ? [value.trim()] : strings(value);
|
|
150
|
+
}, "frontMatterAliases");
|
|
151
|
+
var frontMatterTags = /* @__PURE__ */ __name((frontMatter) => strings(frontMatter.tags ?? frontMatter.tag).map((tag) => tag.replace(/^#/, "")), "frontMatterTags");
|
|
152
|
+
var withoutCode = /* @__PURE__ */ __name((body) => body.replace(/^(```|~~~)[^\n]*\n[\s\S]*?^\1[^\n]*$/gm, "").replace(/`[^`\n]*`/g, ""), "withoutCode");
|
|
153
|
+
var titleOf = /* @__PURE__ */ __name((frontMatter, body, path) => {
|
|
154
|
+
if (typeof frontMatter.title === "string" && frontMatter.title.trim())
|
|
155
|
+
return frontMatter.title.trim();
|
|
156
|
+
const heading = /^#\s+(.+?)\s*#*\s*$/m.exec(withoutCode(body))?.[1];
|
|
157
|
+
return heading ?? posix.basename(path.replace(/\\/g, "/")).replace(/\.[^./]+$/, "");
|
|
158
|
+
}, "titleOf");
|
|
159
|
+
var dropNoteExtension = /* @__PURE__ */ __name((target) => target.replace(/\.(md|markdown)$/i, ""), "dropNoteExtension");
|
|
160
|
+
var bareReferences = /* @__PURE__ */ __name((body) => [...body.matchAll(BARE_REFERENCE)].map((match) => ({
|
|
161
|
+
target: (match[1] ?? "").replace(/[.,;:!?]+$/, ""),
|
|
162
|
+
anchor: null,
|
|
163
|
+
label: null
|
|
164
|
+
})), "bareReferences");
|
|
165
|
+
var dedupe = /* @__PURE__ */ __name((links) => {
|
|
166
|
+
const seen = /* @__PURE__ */ new Set();
|
|
167
|
+
return links.filter((link) => {
|
|
168
|
+
const key = `${link.target}\0${link.anchor ?? ""}\0${link.label ?? ""}`;
|
|
169
|
+
if (seen.has(key))
|
|
170
|
+
return false;
|
|
171
|
+
seen.add(key);
|
|
172
|
+
return true;
|
|
173
|
+
}).slice(0, MAX_LINKS);
|
|
174
|
+
}, "dedupe");
|
|
175
|
+
var parsedNote = /* @__PURE__ */ __name((frontMatter, body, path, links, inlineTags2 = []) => ({
|
|
176
|
+
title: titleOf(frontMatter, body, path),
|
|
177
|
+
aliases: frontMatterAliases(frontMatter),
|
|
178
|
+
tags: [.../* @__PURE__ */ new Set([...frontMatterTags(frontMatter), ...inlineTags2])],
|
|
179
|
+
links: dedupe(links),
|
|
180
|
+
frontMatter
|
|
181
|
+
}), "parsedNote");
|
|
182
|
+
var renderNote = /* @__PURE__ */ __name((note, link) => {
|
|
183
|
+
const frontMatter = {
|
|
184
|
+
...note.frontMatter,
|
|
185
|
+
...note.aliases.length ? { aliases: note.aliases } : {},
|
|
186
|
+
...note.tags.length ? { tags: note.tags } : {}
|
|
187
|
+
};
|
|
188
|
+
const head = Object.keys(frontMatter).length ? `---
|
|
189
|
+
${(0, import_yaml.stringify)(frontMatter).trimEnd()}
|
|
190
|
+
---
|
|
191
|
+
` : "";
|
|
192
|
+
const links = note.links.length ? `
|
|
193
|
+
|
|
194
|
+
${note.links.map((item) => `- ${link(item)}`).join("\n")}` : "";
|
|
195
|
+
return `${head}# ${note.title}
|
|
196
|
+
|
|
197
|
+
${note.text.trimEnd()}${links}
|
|
198
|
+
`;
|
|
199
|
+
}, "renderNote");
|
|
200
|
+
|
|
201
|
+
// dist/notes/dialects/markdown.js
|
|
202
|
+
var LINK = /(?<!!)\[([^\]\n]*)\]\(\s*(<[^>\n]+>|[^)\s]+)(?:\s+"[^"\n]*")?\s*\)/g;
|
|
203
|
+
var SCHEME = /^[a-z][a-z0-9+.-]*:/i;
|
|
204
|
+
var decode = /* @__PURE__ */ __name((value) => {
|
|
205
|
+
try {
|
|
206
|
+
return decodeURIComponent(value);
|
|
207
|
+
} catch {
|
|
208
|
+
return value;
|
|
209
|
+
}
|
|
210
|
+
}, "decode");
|
|
211
|
+
var linkOf = /* @__PURE__ */ __name((label, destination) => {
|
|
212
|
+
const angled = destination.startsWith("<") && destination.endsWith(">");
|
|
213
|
+
const raw = angled ? destination.slice(1, -1) : destination;
|
|
214
|
+
if (isReference(raw))
|
|
215
|
+
return { target: raw, anchor: null, label: label.trim() || null };
|
|
216
|
+
if (SCHEME.test(raw))
|
|
217
|
+
return null;
|
|
218
|
+
const hash = raw.indexOf("#");
|
|
219
|
+
const path = hash < 0 ? raw : raw.slice(0, hash);
|
|
220
|
+
const fragment = hash < 0 ? null : raw.slice(hash + 1);
|
|
221
|
+
return {
|
|
222
|
+
target: dropNoteExtension(angled ? path : decode(path)).trim(),
|
|
223
|
+
anchor: fragment === null ? null : `#${angled ? fragment : decode(fragment)}`,
|
|
224
|
+
label: label.trim() || null
|
|
225
|
+
};
|
|
226
|
+
}, "linkOf");
|
|
227
|
+
var markdownLinks = /* @__PURE__ */ __name((body) => [...withoutCode(body).matchAll(LINK)].map((match) => linkOf(match[1] ?? "", match[2] ?? "")).filter((link) => link !== null), "markdownLinks");
|
|
228
|
+
var stripMarkdownLinks = /* @__PURE__ */ __name((body) => body.replace(LINK, " "), "stripMarkdownLinks");
|
|
229
|
+
var hasOwnExtension = /* @__PURE__ */ __name((target) => NOTE_EXTENSIONS.some((extension) => target.toLowerCase().endsWith(extension)), "hasOwnExtension");
|
|
230
|
+
var markdownLink = /* @__PURE__ */ __name((link) => {
|
|
231
|
+
if (isReference(link.target))
|
|
232
|
+
return `[${link.label ?? link.target}](${link.target})`;
|
|
233
|
+
const file = hasOwnExtension(link.target) ? link.target : `${link.target}.md`;
|
|
234
|
+
const label = link.label ?? link.target.split("/").pop() ?? link.target;
|
|
235
|
+
return `[${label}](<${file}${link.anchor ?? ""}>)`;
|
|
236
|
+
}, "markdownLink");
|
|
237
|
+
var markdown = {
|
|
238
|
+
name: "markdown",
|
|
239
|
+
parse(text, path) {
|
|
240
|
+
const { frontMatter, body } = splitFrontMatter(text);
|
|
241
|
+
const links = markdownLinks(body);
|
|
242
|
+
return parsedNote(frontMatter, body, path, [...links, ...bareReferences(withoutCode(stripMarkdownLinks(body)))]);
|
|
243
|
+
},
|
|
244
|
+
render: /* @__PURE__ */ __name((note) => renderNote(note, markdownLink), "render")
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
// dist/notes/dialects/obsidian.js
|
|
248
|
+
var WIKI = /!?\[\[([^\]|\n]+)(?:\|([^\]\n]*))?\]\]/g;
|
|
249
|
+
var TAG = /(?<![\p{L}\p{N}_#&/])#([\p{L}_][\p{L}\p{N}_/-]*)/gu;
|
|
250
|
+
var wikiLinks = /* @__PURE__ */ __name((body) => [...withoutCode(body).matchAll(WIKI)].map((match) => {
|
|
251
|
+
const raw = (match[1] ?? "").trim();
|
|
252
|
+
const label = match[2]?.trim() || null;
|
|
253
|
+
if (isReference(raw))
|
|
254
|
+
return { target: raw, anchor: null, label };
|
|
255
|
+
const split = raw.search(/[#^]/);
|
|
256
|
+
return {
|
|
257
|
+
target: dropNoteExtension(split < 0 ? raw : raw.slice(0, split)).trim(),
|
|
258
|
+
anchor: split < 0 ? null : raw.slice(split),
|
|
259
|
+
label
|
|
260
|
+
};
|
|
261
|
+
}), "wikiLinks");
|
|
262
|
+
var inlineTags = /* @__PURE__ */ __name((body) => [
|
|
263
|
+
...new Set([...stripMarkdownLinks(withoutCode(body).replace(WIKI, " ")).matchAll(TAG)].map((match) => match[1] ?? ""))
|
|
264
|
+
], "inlineTags");
|
|
265
|
+
var wikiLink = /* @__PURE__ */ __name((link) => isReference(link.target) ? markdownLink(link) : `[[${link.target}${link.anchor ?? ""}${link.label ? `|${link.label}` : ""}]]`, "wikiLink");
|
|
266
|
+
var obsidian = {
|
|
267
|
+
name: "obsidian",
|
|
268
|
+
parse(text, path) {
|
|
269
|
+
const { frontMatter, body } = splitFrontMatter(text);
|
|
270
|
+
const rest = stripMarkdownLinks(withoutCode(body).replace(WIKI, " "));
|
|
271
|
+
return parsedNote(frontMatter, body, path, [...wikiLinks(body), ...markdownLinks(body), ...bareReferences(rest)], inlineTags(body));
|
|
272
|
+
},
|
|
273
|
+
render: /* @__PURE__ */ __name((note) => renderNote(note, wikiLink), "render")
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
// dist/notes/dialects/types.js
|
|
277
|
+
var DIALECTS = ["obsidian", "markdown"];
|
|
278
|
+
|
|
279
|
+
// dist/notes/dialects/index.js
|
|
280
|
+
var BY_NAME = { obsidian, markdown };
|
|
281
|
+
var dialectOf = /* @__PURE__ */ __name((name = "obsidian") => BY_NAME[name], "dialectOf");
|
|
282
|
+
|
|
283
|
+
// dist/config.js
|
|
284
|
+
var ConfigSchema = strictObject({
|
|
285
|
+
permissions: optional(record(string(), picklist(["deny", "readonly", "ask", "allow"]))),
|
|
286
|
+
notes: optional(strictObject({
|
|
287
|
+
/** A bare path is the form before folder ids; `memo folders add` turns it into an entry. */
|
|
288
|
+
folders: array(union([
|
|
289
|
+
string(),
|
|
290
|
+
strictObject({
|
|
291
|
+
id: pipe(string(), minLength(1)),
|
|
292
|
+
path: pipe(string(), minLength(1)),
|
|
293
|
+
format: optional(picklist(DIALECTS))
|
|
294
|
+
})
|
|
295
|
+
])),
|
|
296
|
+
ignore: optional(array(string())),
|
|
297
|
+
/** `false` keeps notes out of search by meaning: `memo sync` does not embed them. */
|
|
298
|
+
embed: optional(boolean()),
|
|
299
|
+
/** Where `memo notes export` and `--export` write internal notes when no folder is given. */
|
|
300
|
+
export: optional(strictObject({ dir: pipe(string(), minLength(1)), format: optional(picklist(DIALECTS)) }))
|
|
301
|
+
})),
|
|
302
|
+
auto: optional(strictObject({
|
|
303
|
+
enabled: optional(boolean()),
|
|
304
|
+
every: optional(string()),
|
|
305
|
+
/** MEMO_CONFIG_DIR, MESSAGING_STORE… as they were at `memo jobs start`, passed to every timer run. */
|
|
306
|
+
places: optional(record(string(), string()))
|
|
307
|
+
})),
|
|
308
|
+
/** `false` keeps only failed runs in `memo runs list`. `--record` and `--no-record` win. */
|
|
309
|
+
record: optional(boolean()),
|
|
310
|
+
keep_runs_for_days: optional(pipe(number(), integer(), minValue(1))),
|
|
311
|
+
keep_successful_runs_for_days: optional(pipe(number(), integer(), minValue(1))),
|
|
312
|
+
runs_size_limit_mb: optional(pipe(number(), integer(), minValue(1))),
|
|
313
|
+
/** `false` leaves what was typed out of a run's command line, `"failed"` out of a successful one; secrets always. */
|
|
314
|
+
record_input: optional(union([boolean(), literal("failed")])),
|
|
315
|
+
/** `false` stops the once-a-day check for a newer memo. */
|
|
316
|
+
update_check: optional(boolean()),
|
|
317
|
+
/** `false` stops an agent deciding proposals for you: `projects actions confirm` and `reject` then need you. */
|
|
318
|
+
agent_decisions: optional(boolean()),
|
|
319
|
+
/** Retired: memo no longer imports mail, the `mail` CLI does. Still loads so an old config works; doctor names it. */
|
|
320
|
+
mail: optional(unknown())
|
|
321
|
+
});
|
|
322
|
+
var MEMO_SETTINGS = [
|
|
323
|
+
{
|
|
324
|
+
key: "agent_decisions",
|
|
325
|
+
default: DEFAULT_DECISION_POLICY.agentDecisions,
|
|
326
|
+
description: "true lets an agent confirm or reject proposals for you; false keeps every decision yours"
|
|
327
|
+
},
|
|
328
|
+
{ key: "update_check", default: true, description: "check once a day for a newer memo" },
|
|
329
|
+
{ key: "record", default: true, description: "keep every run in memo runs list; false keeps failed runs only" },
|
|
330
|
+
{
|
|
331
|
+
key: "record_input",
|
|
332
|
+
default: true,
|
|
333
|
+
description: `keep what was typed in a run's command line: true, false, or "failed" for failed runs only`
|
|
334
|
+
},
|
|
335
|
+
{ key: "keep_runs_for_days", default: KEEP_RUNS_FOR_DAYS, description: "days a run is kept" },
|
|
336
|
+
{
|
|
337
|
+
key: "keep_successful_runs_for_days",
|
|
338
|
+
default: KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
|
|
339
|
+
description: "days a successful run is kept"
|
|
340
|
+
},
|
|
341
|
+
{ key: "runs_size_limit_mb", default: RUNS_SIZE_LIMIT_MB, description: "the most megabytes all runs may take" },
|
|
342
|
+
{ key: "notes.embed", default: true, description: "false keeps notes out of search by meaning" }
|
|
343
|
+
];
|
|
344
|
+
var configPath = /* @__PURE__ */ __name((env = process.env) => configFilePath(resolvePaths({ appName: "cli-memo", prefix: "MEMO", env }).config), "configPath");
|
|
345
|
+
var loadConfig = /* @__PURE__ */ __name((env = process.env) => {
|
|
346
|
+
const path = configPath(env);
|
|
347
|
+
const read = readConfigText(path);
|
|
348
|
+
if ("issue" in read)
|
|
349
|
+
throw new CliError("configuration_error", issueMessage([read.issue], "memo doctor"));
|
|
350
|
+
if (read.text === void 0)
|
|
351
|
+
return {};
|
|
352
|
+
const { issues, config } = checkConfigText(read.text, { file: path, tool: "memo", schema: ConfigSchema });
|
|
353
|
+
if (issues.length > 0 || config === void 0)
|
|
354
|
+
throw new CliError("configuration_error", issueMessage(issues, "memo doctor"));
|
|
355
|
+
return config;
|
|
356
|
+
}, "loadConfig");
|
|
357
|
+
var decisionPolicy = /* @__PURE__ */ __name((env) => {
|
|
358
|
+
let agentDecisions = false;
|
|
359
|
+
try {
|
|
360
|
+
agentDecisions = loadConfig(env).agent_decisions === true;
|
|
361
|
+
} catch {
|
|
362
|
+
}
|
|
363
|
+
return { ...DEFAULT_DECISION_POLICY, agentDecisions };
|
|
364
|
+
}, "decisionPolicy");
|
|
365
|
+
var inspectConfig = /* @__PURE__ */ __name((env, program) => {
|
|
366
|
+
const path = configPath(env);
|
|
367
|
+
const read = readConfigText(path);
|
|
368
|
+
if ("issue" in read)
|
|
369
|
+
return { path, found: true, issues: [read.issue], config: {} };
|
|
370
|
+
if (read.text === void 0)
|
|
371
|
+
return { path, found: false, issues: [], config: {} };
|
|
372
|
+
const { issues, config } = checkConfigText(read.text, {
|
|
373
|
+
file: path,
|
|
374
|
+
tool: "memo",
|
|
375
|
+
schema: ConfigSchema,
|
|
376
|
+
knownPermissions: memoPermissionKeys(program)
|
|
377
|
+
});
|
|
378
|
+
return { path, found: true, issues, config: config ?? {} };
|
|
379
|
+
}, "inspectConfig");
|
|
380
|
+
var unsetConfigKey = /* @__PURE__ */ __name((key, env = process.env) => {
|
|
381
|
+
if (settingPathOf(key).some((part) => part === ""))
|
|
382
|
+
throw new CliError("validation_error", `${key} is not a setting path`);
|
|
383
|
+
const path = configPath(env);
|
|
384
|
+
const read = readConfigFile(path);
|
|
385
|
+
if ("issue" in read)
|
|
386
|
+
throw new CliError("configuration_error", issueMessage([read.issue], "memo doctor"));
|
|
387
|
+
const { config, removed } = withoutSetting(read.raw, key);
|
|
388
|
+
if (removed)
|
|
389
|
+
saveConfigFile(path, config);
|
|
390
|
+
return removed;
|
|
391
|
+
}, "unsetConfigKey");
|
|
392
|
+
var updateConfig = /* @__PURE__ */ __name((change, env = process.env) => {
|
|
393
|
+
const next = change(loadConfig(env));
|
|
394
|
+
saveConfigFile(configPath(env), withSettingDefaults(next, MEMO_SETTINGS).config);
|
|
395
|
+
return next;
|
|
396
|
+
}, "updateConfig");
|
|
397
|
+
var rawConfig = /* @__PURE__ */ __name((env = process.env) => {
|
|
398
|
+
const read = readConfigFile(configPath(env));
|
|
399
|
+
if ("issue" in read)
|
|
400
|
+
throw new CliError("configuration_error", issueMessage([read.issue], "memo doctor"));
|
|
401
|
+
return read.raw;
|
|
402
|
+
}, "rawConfig");
|
|
403
|
+
var migrateConfig = /* @__PURE__ */ __name((env = process.env) => {
|
|
404
|
+
const { config, added } = withSettingDefaults(rawConfig(env), MEMO_SETTINGS);
|
|
405
|
+
if (added.length > 0)
|
|
406
|
+
saveConfigFile(configPath(env), config);
|
|
407
|
+
return added;
|
|
408
|
+
}, "migrateConfig");
|
|
409
|
+
|
|
410
|
+
export {
|
|
411
|
+
memoPermissionKeys,
|
|
412
|
+
NOTE_EXTENSIONS,
|
|
413
|
+
readMemoId,
|
|
414
|
+
matcher,
|
|
415
|
+
noteFiles,
|
|
416
|
+
isReference,
|
|
417
|
+
DIALECTS,
|
|
418
|
+
dialectOf,
|
|
419
|
+
MEMO_SETTINGS,
|
|
420
|
+
configPath,
|
|
421
|
+
loadConfig,
|
|
422
|
+
decisionPolicy,
|
|
423
|
+
inspectConfig,
|
|
424
|
+
unsetConfigKey,
|
|
425
|
+
updateConfig,
|
|
426
|
+
rawConfig,
|
|
427
|
+
migrateConfig
|
|
428
|
+
};
|
|
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
decisionPolicy
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MAUKGKRA.js";
|
|
6
6
|
import {
|
|
7
7
|
compactText,
|
|
8
8
|
currentRun,
|
|
@@ -15,22 +15,22 @@ import {
|
|
|
15
15
|
rowsOfEntity,
|
|
16
16
|
sealed,
|
|
17
17
|
snakeKeysKeeping
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-JLBKAIVT.js";
|
|
19
19
|
import {
|
|
20
20
|
openStore
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-5SKYUS4U.js";
|
|
22
22
|
import {
|
|
23
23
|
STORE_CLIENT
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-5JYB6QKS.js";
|
|
25
25
|
import {
|
|
26
26
|
createRenderer
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-TZ7WDQPD.js";
|
|
28
28
|
import {
|
|
29
29
|
COMPACT_FLAG
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-G2BB5WY5.js";
|
|
31
31
|
import {
|
|
32
32
|
CliError
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-EB2IULWB.js";
|
|
34
34
|
import {
|
|
35
35
|
__name
|
|
36
36
|
} from "./chunk-ZVVMGPBJ.js";
|