@hasna/mementos 0.4.34 → 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.
Files changed (2) hide show
  1. package/dist/cli/index.js +19 -1
  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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/mementos",
3
- "version": "0.4.34",
3
+ "version": "0.4.35",
4
4
  "description": "Universal memory system for AI agents - CLI + MCP server + library API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",