@agentprojectcontext/apx 1.31.0 → 1.31.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.
Files changed (49) hide show
  1. package/README.md +0 -1
  2. package/package.json +1 -1
  3. package/skills/apc-context/SKILL.md +0 -1
  4. package/skills/apx-agency-agents/SKILL.md +1 -1
  5. package/skills/apx-agent/SKILL.md +6 -6
  6. package/skills/apx-project/SKILL.md +1 -2
  7. package/src/core/agent/self-memory.js +1 -1
  8. package/src/core/agent-memory.js +64 -0
  9. package/src/core/agent-system.js +3 -2
  10. package/src/core/confirmation/adapters/code.js +41 -0
  11. package/src/core/confirmation/adapters/telegram.js +134 -0
  12. package/src/core/confirmation/adapters/terminal.js +35 -0
  13. package/src/core/confirmation/adapters/web.js +53 -0
  14. package/src/core/confirmation/index.js +44 -0
  15. package/src/core/confirmation/pending-store.js +68 -0
  16. package/src/core/scaffold.js +43 -18
  17. package/src/core/tools/registry.js +7 -7
  18. package/src/host/daemon/api/agents.js +19 -21
  19. package/src/host/daemon/api/code.js +2 -0
  20. package/src/host/daemon/api/confirm.js +30 -0
  21. package/src/host/daemon/api/sessions-search.js +1 -1
  22. package/src/host/daemon/api/shared.js +5 -8
  23. package/src/host/daemon/api/super-agent.js +12 -4
  24. package/src/host/daemon/api.js +2 -0
  25. package/src/host/daemon/plugins/telegram.js +28 -0
  26. package/src/host/daemon/super-agent-tools/helpers.js +27 -6
  27. package/src/host/daemon/super-agent-tools/index.js +1 -0
  28. package/src/host/daemon/super-agent-tools/tools/add-project.js +2 -2
  29. package/src/host/daemon/super-agent-tools/tools/call-mcp.js +1 -1
  30. package/src/host/daemon/super-agent-tools/tools/call-runtime.js +1 -1
  31. package/src/host/daemon/super-agent-tools/tools/edit-file.js +2 -2
  32. package/src/host/daemon/super-agent-tools/tools/import-agent.js +4 -2
  33. package/src/host/daemon/super-agent-tools/tools/read-agent-memory.js +5 -4
  34. package/src/host/daemon/super-agent-tools/tools/run-shell.js +1 -1
  35. package/src/host/daemon/super-agent-tools/tools/search-files.js +1 -4
  36. package/src/host/daemon/super-agent-tools/tools/send-telegram.js +1 -1
  37. package/src/host/daemon/super-agent-tools/tools/set-identity.js +2 -2
  38. package/src/host/daemon/super-agent-tools/tools/set-permission-mode.js +2 -2
  39. package/src/host/daemon/super-agent-tools/tools/write-file.js +2 -2
  40. package/src/host/daemon/super-agent.js +5 -1
  41. package/src/interfaces/cli/commands/agent.js +4 -1
  42. package/src/interfaces/cli/commands/memory.js +9 -10
  43. package/src/interfaces/web/dist/assets/{index-CfWyjPBa.js → index-BV615I9p.js} +5 -5
  44. package/src/interfaces/web/dist/assets/{index-CfWyjPBa.js.map → index-BV615I9p.js.map} +1 -1
  45. package/src/interfaces/web/dist/index.html +1 -1
  46. package/src/interfaces/web/package-lock.json +3 -3
  47. package/src/interfaces/web/src/i18n/en.ts +6 -6
  48. package/src/interfaces/web/src/i18n/es.ts +6 -6
  49. package/src/interfaces/web/src/screens/project/AgentDetailScreen.tsx +1 -1
@@ -1,7 +1,6 @@
1
1
  import fs from "node:fs";
2
- import path from "node:path";
3
2
  import { findApfRoot } from "../../../core/parser.js";
4
- import { ensureAgentDir } from "../../../core/scaffold.js";
3
+ import { agentMemoryPath, readAgentMemory, writeAgentMemory, ensureAgentRuntimeDir } from "../../../core/agent-memory.js";
5
4
  import { http } from "../http.js";
6
5
 
7
6
  function requireRoot() {
@@ -23,12 +22,11 @@ export async function cmdMemory(args) {
23
22
  const slug = args._[0];
24
23
  if (!slug) throw new Error("apx memory: missing <agent-slug>");
25
24
  const root = requireRoot();
26
- const memPath = path.join(root, ".apc", "agents", slug, "memory.md");
25
+ const memPath = agentMemoryPath(root, slug);
27
26
 
28
27
  if (args.flags.replace) {
29
28
  const newBody = readStdinSync();
30
- ensureAgentDir(root, slug);
31
- fs.writeFileSync(memPath, newBody);
29
+ writeAgentMemory(root, slug, newBody);
32
30
  await nudgeDaemon(root);
33
31
  console.log(`replaced memory for ${slug} (${Buffer.byteLength(newBody)} bytes)`);
34
32
  return;
@@ -36,23 +34,24 @@ export async function cmdMemory(args) {
36
34
 
37
35
  if (args.flags.append && args.flags.append !== true) {
38
36
  const note = String(args.flags.append);
39
- ensureAgentDir(root, slug);
40
- let body = fs.existsSync(memPath) ? fs.readFileSync(memPath, "utf8") : "";
37
+ ensureAgentRuntimeDir(root, slug);
38
+ let body = readAgentMemory(root, slug);
41
39
  if (!/##\s+Recent context/i.test(body)) {
42
40
  body += body.endsWith("\n") ? "\n## Recent context\n" : "\n\n## Recent context\n";
43
41
  }
44
42
  const today = new Date().toISOString().slice(0, 10);
45
43
  body = body.replace(/(##\s+Recent context\s*\n)/i, `$1- ${today}: ${note}\n`);
46
- fs.writeFileSync(memPath, body);
44
+ writeAgentMemory(root, slug, body);
47
45
  await nudgeDaemon(root);
48
46
  console.log(`appended to ${slug} memory: ${note}`);
49
47
  return;
50
48
  }
51
49
 
52
- if (!fs.existsSync(memPath)) {
50
+ const body = readAgentMemory(root, slug);
51
+ if (!body && !fs.existsSync(memPath)) {
53
52
  throw new Error(`no memory for "${slug}" — agent dir not yet created`);
54
53
  }
55
- process.stdout.write(fs.readFileSync(memPath, "utf8"));
54
+ process.stdout.write(body);
56
55
  }
57
56
 
58
57
  function readStdinSync() {