@memo-code/memo 0.8.6 → 0.8.8
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/index.js +75 -75
- package/dist/web/server/main.cjs +26 -10
- package/package.json +1 -1
package/dist/web/server/main.cjs
CHANGED
|
@@ -117437,6 +117437,7 @@ var require_dist5 = __commonJS({
|
|
|
117437
117437
|
module2.exports = __toCommonJS2(index_exports);
|
|
117438
117438
|
var import_node_os2 = __toESM2(require("os"), 1);
|
|
117439
117439
|
var import_promises2 = require("fs/promises");
|
|
117440
|
+
var import_node_fs2 = require("fs");
|
|
117440
117441
|
var import_node_path2 = require("path");
|
|
117441
117442
|
var import_node_url = require("url");
|
|
117442
117443
|
var import_promises = require("fs/promises");
|
|
@@ -117753,9 +117754,25 @@ ${skillsSection}`;
|
|
|
117753
117754
|
}
|
|
117754
117755
|
return (0, import_node_path2.dirname)((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
117755
117756
|
}
|
|
117757
|
+
function resolvePromptPath(explicitPath) {
|
|
117758
|
+
const moduleDir = resolveModuleDir();
|
|
117759
|
+
const candidates = [
|
|
117760
|
+
explicitPath,
|
|
117761
|
+
process.env.MEMO_SYSTEM_PROMPT_PATH,
|
|
117762
|
+
(0, import_node_path2.join)(moduleDir, "prompt.md"),
|
|
117763
|
+
(0, import_node_path2.join)(moduleDir, "../prompt.md"),
|
|
117764
|
+
(0, import_node_path2.join)(moduleDir, "../../prompt.md")
|
|
117765
|
+
].filter((item) => Boolean(item)).map((item) => (0, import_node_path2.resolve)(item));
|
|
117766
|
+
for (const candidate of candidates) {
|
|
117767
|
+
if ((0, import_node_fs2.existsSync)(candidate)) {
|
|
117768
|
+
return candidate;
|
|
117769
|
+
}
|
|
117770
|
+
}
|
|
117771
|
+
return (0, import_node_path2.join)(moduleDir, "prompt.md");
|
|
117772
|
+
}
|
|
117756
117773
|
async function loadSystemPrompt(options = {}) {
|
|
117757
117774
|
const startupRoot = options.cwd ?? process.cwd();
|
|
117758
|
-
const promptPath = (
|
|
117775
|
+
const promptPath = resolvePromptPath(options.promptPath);
|
|
117759
117776
|
const prompt = await (0, import_promises2.readFile)(promptPath, "utf-8");
|
|
117760
117777
|
const vars = {
|
|
117761
117778
|
date: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -118462,7 +118479,7 @@ ${skillsSection}`;
|
|
|
118462
118479
|
}
|
|
118463
118480
|
return usageByTool;
|
|
118464
118481
|
}
|
|
118465
|
-
var
|
|
118482
|
+
var import_node_fs3 = require("fs");
|
|
118466
118483
|
var import_promises5 = require("fs/promises");
|
|
118467
118484
|
var import_node_path7 = require("path");
|
|
118468
118485
|
var import_ignore = __toESM2(require_ignore(), 1);
|
|
@@ -118545,7 +118562,7 @@ ${skillsSection}`;
|
|
|
118545
118562
|
if (cached) return cached;
|
|
118546
118563
|
let dir = resolvedStart;
|
|
118547
118564
|
try {
|
|
118548
|
-
if ((0,
|
|
118565
|
+
if ((0, import_node_fs3.statSync)(dir).isFile()) {
|
|
118549
118566
|
dir = (0, import_node_path7.dirname)(dir);
|
|
118550
118567
|
}
|
|
118551
118568
|
} catch {
|
|
@@ -118555,7 +118572,7 @@ ${skillsSection}`;
|
|
|
118555
118572
|
const visited = [];
|
|
118556
118573
|
while (true) {
|
|
118557
118574
|
visited.push(dir);
|
|
118558
|
-
if ((0,
|
|
118575
|
+
if ((0, import_node_fs3.existsSync)((0, import_node_path7.join)(dir, ".gitignore")) || (0, import_node_fs3.existsSync)((0, import_node_path7.join)(dir, ".git"))) {
|
|
118559
118576
|
for (const item of visited) {
|
|
118560
118577
|
rememberIgnoreRoot(item, dir);
|
|
118561
118578
|
}
|
|
@@ -123573,7 +123590,7 @@ ${filePath}`.toLowerCase();
|
|
|
123573
123590
|
var import_zod5 = require_zod();
|
|
123574
123591
|
var import_node_path14 = require("path");
|
|
123575
123592
|
var import_node_os6 = require("os");
|
|
123576
|
-
var
|
|
123593
|
+
var import_node_fs4 = require("fs");
|
|
123577
123594
|
var import_promises9 = require("fs/promises");
|
|
123578
123595
|
var import_ignore2 = __toESM2(require_ignore(), 1);
|
|
123579
123596
|
var DEFAULT_MAX_TOOL_RESULT_CHARS = 2e4;
|
|
@@ -123602,7 +123619,7 @@ ${filePath}`.toLowerCase();
|
|
|
123602
123619
|
function canonicalizePath(absPath) {
|
|
123603
123620
|
const normalized = normalizePath3(absPath);
|
|
123604
123621
|
try {
|
|
123605
|
-
return normalizePath3((0,
|
|
123622
|
+
return normalizePath3((0, import_node_fs4.realpathSync)(normalized));
|
|
123606
123623
|
} catch {
|
|
123607
123624
|
return normalized;
|
|
123608
123625
|
}
|
|
@@ -124852,7 +124869,7 @@ Replacements: ${replacementCount}`
|
|
|
124852
124869
|
}
|
|
124853
124870
|
});
|
|
124854
124871
|
var import_node_child_process4 = require("child_process");
|
|
124855
|
-
var
|
|
124872
|
+
var import_node_fs5 = require("fs");
|
|
124856
124873
|
var import_node_path19 = require("path");
|
|
124857
124874
|
var import_zod13 = require_zod();
|
|
124858
124875
|
var DEFAULT_WAIT_TIMEOUT_MS = 3e4;
|
|
@@ -124905,7 +124922,7 @@ Replacements: ${replacementCount}`
|
|
|
124905
124922
|
const explicit = process.env.MEMO_SUBAGENT_COMMAND?.trim();
|
|
124906
124923
|
if (explicit) return explicit;
|
|
124907
124924
|
const distEntry = (0, import_node_path19.resolve)(getRuntimeCwd(), "dist/index.js");
|
|
124908
|
-
if ((0,
|
|
124925
|
+
if ((0, import_node_fs5.existsSync)(distEntry)) {
|
|
124909
124926
|
return `node ${JSON.stringify(distEntry)} --dangerous`;
|
|
124910
124927
|
}
|
|
124911
124928
|
return "memo --dangerous";
|
|
@@ -145270,9 +145287,8 @@ var require_server = __commonJS({
|
|
|
145270
145287
|
}
|
|
145271
145288
|
app.useStaticAssets(staticDir, { index: false });
|
|
145272
145289
|
const expressApp = app.getHttpAdapter().getInstance();
|
|
145273
|
-
const indexPath = (0, node_path_1.join)(staticDir, "index.html");
|
|
145274
145290
|
expressApp.get(/^\/(?!api(?:\/|$)|healthz$).*/, (_req, res) => {
|
|
145275
|
-
res.sendFile(
|
|
145291
|
+
res.sendFile("index.html", { root: staticDir });
|
|
145276
145292
|
});
|
|
145277
145293
|
logger.log(`Serving web-ui static files from ${staticDir}`);
|
|
145278
145294
|
}
|