@aman_asmuei/aman-agent 0.33.7 → 0.33.9

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 CHANGED
@@ -830,11 +830,25 @@ async function buildContext2(stack, opts) {
830
830
  const dbPath = process.env.AMEM_DB ?? path25.join(amemDir, "memory.db");
831
831
  if (!process.env.AMEM_DB && !fs25.existsSync(dbPath)) throw new Error("no db");
832
832
  const db2 = createDatabase2(dbPath);
833
- const query = [stack.projectName, ...stack.languages, ...stack.frameworks].join(" ");
834
- const result = await recall2(db2, { query, limit: 20, compact: false, rerank: false });
833
+ const queryParts = [stack.projectName, ...stack.languages, ...stack.frameworks];
834
+ const query = queryParts.join(" ");
835
+ const relevanceKeywords = queryParts.map((k) => k.toLowerCase()).filter(Boolean);
836
+ const result = await recall2(db2, { query, limit: 40, compact: false, rerank: false });
837
+ const MAX_CONTENT_LENGTH = 500;
835
838
  for (const mem of result.memories) {
836
- const content = mem.content;
839
+ let content = mem.content;
837
840
  if (typeof content !== "string" || !content) continue;
841
+ const contentLower = content.toLowerCase();
842
+ const isRelevant = relevanceKeywords.length === 0 || relevanceKeywords.some((kw) => {
843
+ if (kw.length <= 3) {
844
+ return new RegExp(`\\b${kw}\\b`, "i").test(contentLower);
845
+ }
846
+ return contentLower.includes(kw);
847
+ });
848
+ if (!isRelevant) continue;
849
+ if (content.length > MAX_CONTENT_LENGTH) {
850
+ content = content.slice(0, MAX_CONTENT_LENGTH).trimEnd() + "...";
851
+ }
838
852
  switch (mem.type) {
839
853
  case "pattern":
840
854
  if (!conventions.includes(content)) conventions.push(content);
@@ -1109,10 +1123,18 @@ async function runDev(projectPath, flags = {}, precomputedStack) {
1109
1123
  context: ctx2
1110
1124
  };
1111
1125
  }
1112
- if (!flags.force) {
1126
+ if (!flags.force && !flags.smart) {
1113
1127
  const staleness = checkStaleness(resolved);
1114
1128
  if (staleness.status === "fresh") {
1115
- return { success: true, generated: false, skippedReason: "fresh" };
1129
+ if (staleness.generatedAt) {
1130
+ const ageMs = Date.now() - staleness.generatedAt.getTime();
1131
+ const ONE_HOUR = 60 * 60 * 1e3;
1132
+ if (ageMs < ONE_HOUR) {
1133
+ return { success: true, generated: false, skippedReason: "fresh" };
1134
+ }
1135
+ } else {
1136
+ return { success: true, generated: false, skippedReason: "fresh" };
1137
+ }
1116
1138
  }
1117
1139
  }
1118
1140
  const ctx = await buildContext2(stack, { smart: flags.smart });
@@ -7085,7 +7107,7 @@ function handleReset(action) {
7085
7107
  function handleUpdate() {
7086
7108
  try {
7087
7109
  const current = execFileSync3("npm", ["view", "@aman_asmuei/aman-agent", "version"], { encoding: "utf-8" }).trim();
7088
- const local = true ? "0.33.7" : "unknown";
7110
+ const local = true ? "0.33.9" : "unknown";
7089
7111
  if (current === local) {
7090
7112
  return { handled: true, output: `${pc6.green("Up to date")} \u2014 v${local}` };
7091
7113
  }
@@ -10069,7 +10091,7 @@ var Inbox = class {
10069
10091
  // package.json
10070
10092
  var package_default = {
10071
10093
  name: "@aman_asmuei/aman-agent",
10072
- version: "0.33.7",
10094
+ version: "0.33.9",
10073
10095
  description: "Your AI companion, running locally \u2014 powered by the aman ecosystem",
10074
10096
  type: "module",
10075
10097
  engines: {
@@ -10436,7 +10458,7 @@ function bootstrapEcosystem() {
10436
10458
  return true;
10437
10459
  }
10438
10460
  var program = new Command();
10439
- program.name("aman-agent").description("Your AI companion, running locally").version("0.33.7").option("--model <model>", "Override LLM model").option("--budget <tokens>", "Token budget for system prompt (default: 8000)", parseInt).option("--profile <name>", "Use a specific agent profile (e.g., coder, writer, researcher)").action(async (options) => {
10461
+ program.name("aman-agent").description("Your AI companion, running locally").version("0.33.9").option("--model <model>", "Override LLM model").option("--budget <tokens>", "Token budget for system prompt (default: 8000)", parseInt).option("--profile <name>", "Use a specific agent profile (e.g., coder, writer, researcher)").action(async (options) => {
10440
10462
  p4.intro(pc9.bold("aman agent") + pc9.dim(" \u2014 your AI companion"));
10441
10463
  let config = loadConfig();
10442
10464
  if (!config) {