@hasna/mementos 0.4.33 → 0.4.35
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/cli/index.js +37 -2
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -4958,7 +4958,7 @@ Use the full ID, or narrow with --scope, --agent, --project, or --all.`));
|
|
|
4958
4958
|
handleError(e);
|
|
4959
4959
|
}
|
|
4960
4960
|
});
|
|
4961
|
-
program2.command("search <query>").description("Full-text search across memories").option("-s, --scope <scope>", "Scope filter").option("-c, --category <cat>", "Category filter").option("--tags <tags>", "Comma-separated tags filter").option("--limit <n>", "Max results", parseInt).option("--format <fmt>", "Output format: compact (default), json, csv, yaml").option("--history", "Show recent search queries instead of searching").option("--popular", "Show most popular search queries").action((query, opts) => {
|
|
4961
|
+
program2.command("search <query>").description("Full-text search across memories").option("-s, --scope <scope>", "Scope filter").option("-c, --category <cat>", "Category filter").option("--tags <tags>", "Comma-separated tags filter").option("--project <path>", "Project filter (path or name)").option("--agent <name>", "Agent filter").option("--session <id>", "Session ID filter").option("--limit <n>", "Max results", parseInt).option("--format <fmt>", "Output format: compact (default), json, csv, yaml").option("--history", "Show recent search queries instead of searching").option("--popular", "Show most popular search queries").action((query, opts) => {
|
|
4962
4962
|
try {
|
|
4963
4963
|
if (opts.history) {
|
|
4964
4964
|
const history = getSearchHistory(20);
|
|
@@ -4994,10 +4994,28 @@ program2.command("search <query>").description("Full-text search across memories
|
|
|
4994
4994
|
}
|
|
4995
4995
|
return;
|
|
4996
4996
|
}
|
|
4997
|
+
const globalOpts = program2.opts();
|
|
4998
|
+
const projectPath = opts.project || globalOpts.project;
|
|
4999
|
+
let projectId;
|
|
5000
|
+
if (projectPath) {
|
|
5001
|
+
const project = getProject(resolve3(projectPath));
|
|
5002
|
+
if (project)
|
|
5003
|
+
projectId = project.id;
|
|
5004
|
+
}
|
|
5005
|
+
const agentName = opts.agent || globalOpts.agent;
|
|
5006
|
+
let agentId;
|
|
5007
|
+
if (agentName) {
|
|
5008
|
+
const agent = getAgent(agentName);
|
|
5009
|
+
if (agent)
|
|
5010
|
+
agentId = agent.id;
|
|
5011
|
+
}
|
|
4997
5012
|
const filter = {
|
|
4998
5013
|
scope: opts.scope,
|
|
4999
5014
|
category: opts.category,
|
|
5000
5015
|
tags: opts.tags ? opts.tags.split(",").map((t) => t.trim()) : undefined,
|
|
5016
|
+
project_id: projectId,
|
|
5017
|
+
agent_id: agentId,
|
|
5018
|
+
session_id: opts.session || globalOpts.session,
|
|
5001
5019
|
limit: opts.limit || 20
|
|
5002
5020
|
};
|
|
5003
5021
|
const results = searchMemories(query, filter);
|
|
@@ -5662,6 +5680,23 @@ program2.command("doctor").description("Diagnose common issues with the mementos
|
|
|
5662
5680
|
} catch (e) {
|
|
5663
5681
|
checks.push({ name: "Projects", status: "fail", detail: e instanceof Error ? e.message : String(e) });
|
|
5664
5682
|
}
|
|
5683
|
+
try {
|
|
5684
|
+
const activeProfile = getActiveProfile();
|
|
5685
|
+
const profiles = listProfiles();
|
|
5686
|
+
if (activeProfile) {
|
|
5687
|
+
checks.push({ name: "Active profile", status: "ok", detail: `${activeProfile} (${profiles.length} total)` });
|
|
5688
|
+
} else {
|
|
5689
|
+
checks.push({ name: "Active profile", status: "ok", detail: `default (~/.mementos/mementos.db) \u2014 ${profiles.length} profile(s) available` });
|
|
5690
|
+
}
|
|
5691
|
+
} catch (e) {
|
|
5692
|
+
checks.push({ name: "Active profile", status: "warn", detail: e instanceof Error ? e.message : String(e) });
|
|
5693
|
+
}
|
|
5694
|
+
try {
|
|
5695
|
+
const mementosUrl = process.env["MEMENTOS_URL"] || `http://127.0.0.1:19428`;
|
|
5696
|
+
checks.push({ name: "REST server URL", status: "ok", detail: `${mementosUrl} (use 'mementos-serve' to start)` });
|
|
5697
|
+
} catch {
|
|
5698
|
+
checks.push({ name: "REST server URL", status: "ok", detail: "http://127.0.0.1:19428" });
|
|
5699
|
+
}
|
|
5665
5700
|
outputDoctorResults(globalOpts, checks);
|
|
5666
5701
|
});
|
|
5667
5702
|
function outputDoctorResults(globalOpts, checks) {
|
|
@@ -6467,7 +6502,7 @@ function diffLines(oldText, newText) {
|
|
|
6467
6502
|
}
|
|
6468
6503
|
}
|
|
6469
6504
|
program2.command("completions <shell>").description("Output shell completion script (bash, zsh, fish)").action((shell) => {
|
|
6470
|
-
const commands = "save recall list update forget search stats export import clean inject context pin unpin doctor tail diff init agents projects bulk completions config backup restore";
|
|
6505
|
+
const commands = "save recall list update forget search stats export import clean inject context pin unpin doctor tail diff init agents projects bulk completions config backup restore report profile mcp";
|
|
6471
6506
|
const commandList = commands.split(" ");
|
|
6472
6507
|
switch (shell.toLowerCase()) {
|
|
6473
6508
|
case "bash": {
|