@aman_asmuei/aman-agent 0.33.7 → 0.33.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 +20 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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
|
|
834
|
-
const
|
|
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
|
-
|
|
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);
|
|
@@ -7085,7 +7099,7 @@ function handleReset(action) {
|
|
|
7085
7099
|
function handleUpdate() {
|
|
7086
7100
|
try {
|
|
7087
7101
|
const current = execFileSync3("npm", ["view", "@aman_asmuei/aman-agent", "version"], { encoding: "utf-8" }).trim();
|
|
7088
|
-
const local = true ? "0.33.
|
|
7102
|
+
const local = true ? "0.33.8" : "unknown";
|
|
7089
7103
|
if (current === local) {
|
|
7090
7104
|
return { handled: true, output: `${pc6.green("Up to date")} \u2014 v${local}` };
|
|
7091
7105
|
}
|
|
@@ -10069,7 +10083,7 @@ var Inbox = class {
|
|
|
10069
10083
|
// package.json
|
|
10070
10084
|
var package_default = {
|
|
10071
10085
|
name: "@aman_asmuei/aman-agent",
|
|
10072
|
-
version: "0.33.
|
|
10086
|
+
version: "0.33.8",
|
|
10073
10087
|
description: "Your AI companion, running locally \u2014 powered by the aman ecosystem",
|
|
10074
10088
|
type: "module",
|
|
10075
10089
|
engines: {
|
|
@@ -10436,7 +10450,7 @@ function bootstrapEcosystem() {
|
|
|
10436
10450
|
return true;
|
|
10437
10451
|
}
|
|
10438
10452
|
var program = new Command();
|
|
10439
|
-
program.name("aman-agent").description("Your AI companion, running locally").version("0.33.
|
|
10453
|
+
program.name("aman-agent").description("Your AI companion, running locally").version("0.33.8").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
10454
|
p4.intro(pc9.bold("aman agent") + pc9.dim(" \u2014 your AI companion"));
|
|
10441
10455
|
let config = loadConfig();
|
|
10442
10456
|
if (!config) {
|