@aman_asmuei/aman-agent 0.33.0 → 0.33.2

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
@@ -809,6 +809,7 @@ function trimToTokenBudget(items, maxTokens) {
809
809
  const result = [];
810
810
  let total = 0;
811
811
  for (const item of items) {
812
+ if (typeof item !== "string" || !item) continue;
812
813
  const tokens = estimateTokens(item);
813
814
  if (total + tokens > maxTokens) break;
814
815
  result.push(item);
@@ -830,18 +831,20 @@ async function buildContext2(stack, opts) {
830
831
  const query = [stack.projectName, ...stack.languages, ...stack.frameworks].join(" ");
831
832
  const result = await recall2(db2, { query, limit: 20 });
832
833
  for (const mem of result.memories) {
834
+ const content = mem.content;
835
+ if (typeof content !== "string" || !content) continue;
833
836
  switch (mem.type) {
834
837
  case "pattern":
835
- conventions.push(mem.content);
838
+ if (!conventions.includes(content)) conventions.push(content);
836
839
  break;
837
840
  case "decision":
838
- decisions.push(mem.content);
841
+ if (!decisions.includes(content)) decisions.push(content);
839
842
  break;
840
843
  case "correction":
841
- corrections.push(mem.content);
844
+ if (!corrections.includes(content)) corrections.push(content);
842
845
  break;
843
846
  case "preference":
844
- preferences.push(mem.content);
847
+ if (!preferences.includes(content)) preferences.push(content);
845
848
  break;
846
849
  }
847
850
  memoriesUsed++;
@@ -865,7 +868,9 @@ async function buildContext2(stack, opts) {
865
868
  const categories = await arulesListCategories2(AGENT_SCOPE2);
866
869
  for (const cat of categories) {
867
870
  for (const ruleText of cat.rules) {
868
- rules.push(ruleText);
871
+ if (typeof ruleText === "string" && ruleText && !rules.includes(ruleText)) {
872
+ rules.push(ruleText);
873
+ }
869
874
  }
870
875
  }
871
876
  } catch {
@@ -7078,7 +7083,7 @@ function handleReset(action) {
7078
7083
  function handleUpdate() {
7079
7084
  try {
7080
7085
  const current = execFileSync3("npm", ["view", "@aman_asmuei/aman-agent", "version"], { encoding: "utf-8" }).trim();
7081
- const local = true ? "0.33.0" : "unknown";
7086
+ const local = true ? "0.33.2" : "unknown";
7082
7087
  if (current === local) {
7083
7088
  return { handled: true, output: `${pc6.green("Up to date")} \u2014 v${local}` };
7084
7089
  }
@@ -10062,7 +10067,7 @@ var Inbox = class {
10062
10067
  // package.json
10063
10068
  var package_default = {
10064
10069
  name: "@aman_asmuei/aman-agent",
10065
- version: "0.33.0",
10070
+ version: "0.33.2",
10066
10071
  description: "Your AI companion, running locally \u2014 powered by the aman ecosystem",
10067
10072
  type: "module",
10068
10073
  engines: {
@@ -10429,7 +10434,7 @@ function bootstrapEcosystem() {
10429
10434
  return true;
10430
10435
  }
10431
10436
  var program = new Command();
10432
- program.name("aman-agent").description("Your AI companion, running locally").version("0.33.0").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) => {
10437
+ program.name("aman-agent").description("Your AI companion, running locally").version("0.33.2").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) => {
10433
10438
  p4.intro(pc9.bold("aman agent") + pc9.dim(" \u2014 your AI companion"));
10434
10439
  let config = loadConfig();
10435
10440
  if (!config) {