@aman_asmuei/aman-agent 0.33.3 → 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/README.md CHANGED
@@ -122,6 +122,7 @@ $ aman-agent dev ~/projects/amantrade
122
122
  | Flag | What it does |
123
123
  |:---|:---|
124
124
  | `--smart` | Use your configured LLM to synthesize a smarter CLAUDE.md |
125
+ | `--yolo` | Launch Claude Code with `--dangerously-skip-permissions` (full autonomous mode) |
125
126
  | `--no-launch` | Generate CLAUDE.md only, don't start Claude Code |
126
127
  | `--diff` | Preview what would change without writing |
127
128
  | `--force` | Regenerate even if CLAUDE.md is fresh |
@@ -406,6 +407,15 @@ aman-agent dev --smart
406
407
 
407
408
  The LLM merges related corrections into single convention statements and removes redundancy. Falls back to template mode automatically if the LLM call fails.
408
409
 
410
+ **Yolo mode** — Full autonomous, no permission prompts:
411
+
412
+ ```bash
413
+ aman-agent dev --yolo # skip permissions
414
+ aman-agent dev --yolo --smart # skip permissions + LLM-generated CLAUDE.md
415
+ ```
416
+
417
+ Launches Claude Code with `--dangerously-skip-permissions`. Use when you trust the project and want zero friction.
418
+
409
419
  **Multi-project workflow** — Each terminal is independent:
410
420
 
411
421
  ```bash
@@ -1357,7 +1367,7 @@ sequenceDiagram
1357
1367
  | Command | Description |
1358
1368
  |:---|:---|
1359
1369
  | `aman-agent` | Start interactive chat session |
1360
- | `aman-agent dev [path]` | Scan project, generate CLAUDE.md, launch Claude Code `[--smart\|--no-launch\|--force\|--diff]` |
1370
+ | `aman-agent dev [path]` | Scan project, generate CLAUDE.md, launch Claude Code `[--smart\|--yolo\|--no-launch\|--force\|--diff]` |
1361
1371
  | `aman-agent init` | Set up your AI companion with a guided wizard |
1362
1372
  | `aman-agent serve` | Run as a local MCP server for agent delegation `[--name\|--profile]` |
1363
1373
  | `aman-agent setup` | Full reconfiguration wizard |
package/dist/index.js CHANGED
@@ -796,6 +796,7 @@ var init_stack_detector = __esm({
796
796
  });
797
797
 
798
798
  // src/dev/context-builder.ts
799
+ import fs25 from "fs";
799
800
  import path25 from "path";
800
801
  import os22 from "os";
801
802
  import { createDatabase as createDatabase2, recall as recall2 } from "@aman_asmuei/amem-core";
@@ -827,12 +828,27 @@ async function buildContext2(stack, opts) {
827
828
  try {
828
829
  const amemDir = process.env.AMEM_DIR ?? path25.join(os22.homedir(), ".amem");
829
830
  const dbPath = process.env.AMEM_DB ?? path25.join(amemDir, "memory.db");
831
+ if (!process.env.AMEM_DB && !fs25.existsSync(dbPath)) throw new Error("no db");
830
832
  const db2 = createDatabase2(dbPath);
831
- const query = [stack.projectName, ...stack.languages, ...stack.frameworks].join(" ");
832
- const result = await recall2(db2, { query, limit: 20 });
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;
833
838
  for (const mem of result.memories) {
834
- const content = mem.content;
839
+ let content = mem.content;
835
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
+ }
836
852
  switch (mem.type) {
837
853
  case "pattern":
838
854
  if (!conventions.includes(content)) conventions.push(content);
@@ -959,7 +975,7 @@ var init_context_builder = __esm({
959
975
  });
960
976
 
961
977
  // src/dev/claude-md-writer.ts
962
- import fs25 from "fs";
978
+ import fs26 from "fs";
963
979
  import path26 from "path";
964
980
  function formatStack(stack) {
965
981
  const parts = [];
@@ -1044,10 +1060,10 @@ function parseMarker(content) {
1044
1060
  }
1045
1061
  function checkStaleness(projectPath) {
1046
1062
  const claudeMdPath = path26.join(projectPath, "CLAUDE.md");
1047
- if (!fs25.existsSync(claudeMdPath)) {
1063
+ if (!fs26.existsSync(claudeMdPath)) {
1048
1064
  return { status: "missing" };
1049
1065
  }
1050
- const content = fs25.readFileSync(claudeMdPath, "utf-8");
1066
+ const content = fs26.readFileSync(claudeMdPath, "utf-8");
1051
1067
  const marker = parseMarker(content);
1052
1068
  if (!marker) {
1053
1069
  return { status: "no-marker" };
@@ -1057,16 +1073,16 @@ function checkStaleness(projectPath) {
1057
1073
  function writeClaudeMd(ctx, projectPath) {
1058
1074
  const claudeMdPath = path26.join(projectPath, "CLAUDE.md");
1059
1075
  let backedUp = false;
1060
- if (fs25.existsSync(claudeMdPath)) {
1061
- const content = fs25.readFileSync(claudeMdPath, "utf-8");
1076
+ if (fs26.existsSync(claudeMdPath)) {
1077
+ const content = fs26.readFileSync(claudeMdPath, "utf-8");
1062
1078
  const marker = parseMarker(content);
1063
1079
  if (!marker) {
1064
- fs25.copyFileSync(claudeMdPath, `${claudeMdPath}.bak`);
1080
+ fs26.copyFileSync(claudeMdPath, `${claudeMdPath}.bak`);
1065
1081
  backedUp = true;
1066
1082
  }
1067
1083
  }
1068
1084
  const md = renderToString(ctx);
1069
- fs25.writeFileSync(claudeMdPath, md, "utf-8");
1085
+ fs26.writeFileSync(claudeMdPath, md, "utf-8");
1070
1086
  return { written: true, backedUp, path: claudeMdPath };
1071
1087
  }
1072
1088
  var init_claude_md_writer = __esm({
@@ -1080,18 +1096,18 @@ var dev_command_exports = {};
1080
1096
  __export(dev_command_exports, {
1081
1097
  runDev: () => runDev
1082
1098
  });
1083
- import fs26 from "fs";
1099
+ import fs27 from "fs";
1084
1100
  import path27 from "path";
1085
1101
  function ensureGitignore(projectPath) {
1086
1102
  const gitignorePath = path27.join(projectPath, ".gitignore");
1087
- if (!fs26.existsSync(gitignorePath)) return;
1088
- const content = fs26.readFileSync(gitignorePath, "utf-8");
1103
+ if (!fs27.existsSync(gitignorePath)) return;
1104
+ const content = fs27.readFileSync(gitignorePath, "utf-8");
1089
1105
  if (content.includes("CLAUDE.md")) return;
1090
- fs26.appendFileSync(gitignorePath, "\n# Generated by aman-agent dev\nCLAUDE.md\n");
1106
+ fs27.appendFileSync(gitignorePath, "\n# Generated by aman-agent dev\nCLAUDE.md\n");
1091
1107
  }
1092
1108
  async function runDev(projectPath, flags = {}, precomputedStack) {
1093
1109
  const resolved = path27.resolve(projectPath);
1094
- if (!fs26.existsSync(resolved)) {
1110
+ if (!fs27.existsSync(resolved)) {
1095
1111
  return { success: false, generated: false, error: `Directory not found: ${resolved}` };
1096
1112
  }
1097
1113
  const stack = precomputedStack ?? scanStack(resolved);
@@ -1099,7 +1115,7 @@ async function runDev(projectPath, flags = {}, precomputedStack) {
1099
1115
  const ctx2 = await buildContext2(stack, { smart: flags.smart });
1100
1116
  const newContent = renderToString(ctx2);
1101
1117
  const existingPath = path27.join(resolved, "CLAUDE.md");
1102
- const existing = fs26.existsSync(existingPath) ? fs26.readFileSync(existingPath, "utf-8") : "";
1118
+ const existing = fs27.existsSync(existingPath) ? fs27.readFileSync(existingPath, "utf-8") : "";
1103
1119
  return {
1104
1120
  success: true,
1105
1121
  generated: false,
@@ -7083,7 +7099,7 @@ function handleReset(action) {
7083
7099
  function handleUpdate() {
7084
7100
  try {
7085
7101
  const current = execFileSync3("npm", ["view", "@aman_asmuei/aman-agent", "version"], { encoding: "utf-8" }).trim();
7086
- const local = true ? "0.33.3" : "unknown";
7102
+ const local = true ? "0.33.8" : "unknown";
7087
7103
  if (current === local) {
7088
7104
  return { handled: true, output: `${pc6.green("Up to date")} \u2014 v${local}` };
7089
7105
  }
@@ -9852,7 +9868,7 @@ async function saveConversationToMemory(messages, sessionId) {
9852
9868
  }
9853
9869
 
9854
9870
  // src/index.ts
9855
- import fs27 from "fs";
9871
+ import fs28 from "fs";
9856
9872
  import path28 from "path";
9857
9873
 
9858
9874
  // src/presets.ts
@@ -10067,7 +10083,7 @@ var Inbox = class {
10067
10083
  // package.json
10068
10084
  var package_default = {
10069
10085
  name: "@aman_asmuei/aman-agent",
10070
- version: "0.33.3",
10086
+ version: "0.33.8",
10071
10087
  description: "Your AI companion, running locally \u2014 powered by the aman ecosystem",
10072
10088
  type: "module",
10073
10089
  engines: {
@@ -10361,8 +10377,8 @@ async function runServe(opts) {
10361
10377
  // src/index.ts
10362
10378
  async function autoDetectConfig() {
10363
10379
  const reconfigMarker = path28.join(homeDir(), ".reconfig");
10364
- if (fs27.existsSync(reconfigMarker)) {
10365
- fs27.unlinkSync(reconfigMarker);
10380
+ if (fs28.existsSync(reconfigMarker)) {
10381
+ fs28.unlinkSync(reconfigMarker);
10366
10382
  return null;
10367
10383
  }
10368
10384
  const anthropicKey = process.env.ANTHROPIC_API_KEY;
@@ -10392,9 +10408,9 @@ async function autoDetectConfig() {
10392
10408
  }
10393
10409
  function bootstrapEcosystem() {
10394
10410
  const corePath = path28.join(identityDir(), "core.md");
10395
- if (fs27.existsSync(corePath)) return false;
10396
- fs27.mkdirSync(identityDir(), { recursive: true });
10397
- fs27.writeFileSync(corePath, [
10411
+ if (fs28.existsSync(corePath)) return false;
10412
+ fs28.mkdirSync(identityDir(), { recursive: true });
10413
+ fs28.writeFileSync(corePath, [
10398
10414
  "# Aman",
10399
10415
  "",
10400
10416
  "## Personality",
@@ -10407,9 +10423,9 @@ function bootstrapEcosystem() {
10407
10423
  "_New companion \u2014 no prior sessions._"
10408
10424
  ].join("\n"), "utf-8");
10409
10425
  const rulesPath = path28.join(rulesDir(), "rules.md");
10410
- if (!fs27.existsSync(rulesPath)) {
10411
- fs27.mkdirSync(rulesDir(), { recursive: true });
10412
- fs27.writeFileSync(rulesPath, [
10426
+ if (!fs28.existsSync(rulesPath)) {
10427
+ fs28.mkdirSync(rulesDir(), { recursive: true });
10428
+ fs28.writeFileSync(rulesPath, [
10413
10429
  "# Guardrails",
10414
10430
  "",
10415
10431
  "## safety",
@@ -10422,19 +10438,19 @@ function bootstrapEcosystem() {
10422
10438
  ].join("\n"), "utf-8");
10423
10439
  }
10424
10440
  const flowPath = path28.join(workflowsDir(), "flow.md");
10425
- if (!fs27.existsSync(flowPath)) {
10426
- fs27.mkdirSync(workflowsDir(), { recursive: true });
10427
- fs27.writeFileSync(flowPath, "# Workflows\n\n_No workflows defined yet. Use /workflows add to create one._\n", "utf-8");
10441
+ if (!fs28.existsSync(flowPath)) {
10442
+ fs28.mkdirSync(workflowsDir(), { recursive: true });
10443
+ fs28.writeFileSync(flowPath, "# Workflows\n\n_No workflows defined yet. Use /workflows add to create one._\n", "utf-8");
10428
10444
  }
10429
10445
  const skillPath = path28.join(skillsDir(), "skills.md");
10430
- if (!fs27.existsSync(skillPath)) {
10431
- fs27.mkdirSync(skillsDir(), { recursive: true });
10432
- fs27.writeFileSync(skillPath, "# Skills\n\n_No skills installed yet. Use /skills install to add domain expertise._\n", "utf-8");
10446
+ if (!fs28.existsSync(skillPath)) {
10447
+ fs28.mkdirSync(skillsDir(), { recursive: true });
10448
+ fs28.writeFileSync(skillPath, "# Skills\n\n_No skills installed yet. Use /skills install to add domain expertise._\n", "utf-8");
10433
10449
  }
10434
10450
  return true;
10435
10451
  }
10436
10452
  var program = new Command();
10437
- program.name("aman-agent").description("Your AI companion, running locally").version("0.33.3").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) => {
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) => {
10438
10454
  p4.intro(pc9.bold("aman agent") + pc9.dim(" \u2014 your AI companion"));
10439
10455
  let config = loadConfig();
10440
10456
  if (!config) {
@@ -10789,18 +10805,18 @@ program.command("init").description("Set up your AI companion with a guided wiza
10789
10805
  });
10790
10806
  if (p4.isCancel(preset)) process.exit(0);
10791
10807
  const result = applyPreset(preset, name || "Aman");
10792
- fs27.mkdirSync(identityDir(), { recursive: true });
10793
- fs27.writeFileSync(path28.join(identityDir(), "core.md"), result.coreMd, "utf-8");
10808
+ fs28.mkdirSync(identityDir(), { recursive: true });
10809
+ fs28.writeFileSync(path28.join(identityDir(), "core.md"), result.coreMd, "utf-8");
10794
10810
  p4.log.success(`Identity created \u2014 ${PRESETS[preset].identity.personality.split(".")[0].toLowerCase()}`);
10795
10811
  if (result.rulesMd) {
10796
- fs27.mkdirSync(rulesDir(), { recursive: true });
10797
- fs27.writeFileSync(path28.join(rulesDir(), "rules.md"), result.rulesMd, "utf-8");
10812
+ fs28.mkdirSync(rulesDir(), { recursive: true });
10813
+ fs28.writeFileSync(path28.join(rulesDir(), "rules.md"), result.rulesMd, "utf-8");
10798
10814
  const ruleCount = (result.rulesMd.match(/^- /gm) || []).length;
10799
10815
  p4.log.success(`${ruleCount} rules set`);
10800
10816
  }
10801
10817
  if (result.flowMd) {
10802
- fs27.mkdirSync(workflowsDir(), { recursive: true });
10803
- fs27.writeFileSync(path28.join(workflowsDir(), "flow.md"), result.flowMd, "utf-8");
10818
+ fs28.mkdirSync(workflowsDir(), { recursive: true });
10819
+ fs28.writeFileSync(path28.join(workflowsDir(), "flow.md"), result.flowMd, "utf-8");
10804
10820
  const wfCount = (result.flowMd.match(/^## /gm) || []).length;
10805
10821
  p4.log.success(`${wfCount} workflow${wfCount > 1 ? "s" : ""} added`);
10806
10822
  }
@@ -10829,7 +10845,7 @@ program.command("serve").description("Run aman-agent as a local MCP server other
10829
10845
  process.exit(1);
10830
10846
  }
10831
10847
  });
10832
- program.command("dev [path]").description("Set up project context and start Claude Code").option("--smart", "Use LLM to generate CLAUDE.md").option("--no-launch", "Generate CLAUDE.md only, don't start claude").option("--force", "Regenerate even if CLAUDE.md is fresh").option("--diff", "Show what would change without writing").action(async (projectPath, opts) => {
10848
+ program.command("dev [path]").description("Set up project context and start Claude Code").option("--smart", "Use LLM to generate CLAUDE.md").option("--no-launch", "Generate CLAUDE.md only, don't start claude").option("--force", "Regenerate even if CLAUDE.md is fresh").option("--diff", "Show what would change without writing").option("--yolo", "Launch Claude Code with --dangerously-skip-permissions").action(async (projectPath, opts) => {
10833
10849
  const { runDev: runDev2 } = await Promise.resolve().then(() => (init_dev_command(), dev_command_exports));
10834
10850
  const { scanStack: scanStack2 } = await Promise.resolve().then(() => (init_stack_detector(), stack_detector_exports));
10835
10851
  const targetPath = projectPath ?? process.cwd();
@@ -10884,16 +10900,23 @@ ${result.diff}`);
10884
10900
  console.log(` ${pc9.yellow("Claude Code not found.")} Install: npm install -g @anthropic-ai/claude-code`);
10885
10901
  process.exit(1);
10886
10902
  }
10887
- console.log(` ${pc9.cyan("Launching Claude Code...")}
10903
+ const claudeArgs = [];
10904
+ if (opts.yolo) {
10905
+ claudeArgs.push("--dangerously-skip-permissions");
10906
+ console.log(` ${pc9.cyan("Launching Claude Code")} ${pc9.yellow("(--dangerously-skip-permissions)")}...
10888
10907
  `);
10889
- execFileSync4("claude", [], { cwd: targetPath, stdio: "inherit" });
10908
+ } else {
10909
+ console.log(` ${pc9.cyan("Launching Claude Code...")}
10910
+ `);
10911
+ }
10912
+ execFileSync4("claude", claudeArgs, { cwd: targetPath, stdio: "inherit" });
10890
10913
  }
10891
10914
  });
10892
10915
  program.command("setup").description("Run the full configuration wizard (provider, identity, presets)").action(async () => {
10893
10916
  p4.intro(pc9.bold("aman agent setup") + pc9.dim(" \u2014 full configuration wizard"));
10894
10917
  const reconfigPath = path28.join(homeDir(), ".reconfig");
10895
- fs27.mkdirSync(homeDir(), { recursive: true });
10896
- fs27.writeFileSync(reconfigPath, "", "utf-8");
10918
+ fs28.mkdirSync(homeDir(), { recursive: true });
10919
+ fs28.writeFileSync(reconfigPath, "", "utf-8");
10897
10920
  p4.log.info("Configuration reset. Restart aman-agent to complete setup.");
10898
10921
  });
10899
10922
  program.command("update").description("Update aman-agent to the latest version").action(async () => {
@@ -10928,7 +10951,7 @@ program.command("update").description("Update aman-agent to the latest version")
10928
10951
  program.command("uninstall").description("Remove aman-agent and all its data").action(async () => {
10929
10952
  const home2 = homeDir();
10930
10953
  if (!process.stdin.isTTY) {
10931
- fs27.rmSync(home2, { recursive: true, force: true });
10954
+ fs28.rmSync(home2, { recursive: true, force: true });
10932
10955
  console.log("\u2713 Removed " + home2);
10933
10956
  return;
10934
10957
  }
@@ -10939,7 +10962,7 @@ program.command("uninstall").description("Remove aman-agent and all its data").a
10939
10962
  console.log("Cancelled.");
10940
10963
  return;
10941
10964
  }
10942
- fs27.rmSync(home2, { recursive: true, force: true });
10965
+ fs28.rmSync(home2, { recursive: true, force: true });
10943
10966
  console.log("\u2713 Removed " + home2);
10944
10967
  console.log("");
10945
10968
  console.log("To complete uninstall, remove the PATH line from your shell config:");