Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
434 changes: 217 additions & 217 deletions .aiwg/reports/g-icm-01-interface-inventory.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ npx -y @agentmemory/mcp
| Port conflict | `netstat -ano \| findstr :3111` to see what's bound, then kill it or use `--port <N>` |
| Docker fallback skipped even though Docker is installed | Make sure Docker Desktop is actually running (system tray icon) |

> Note: the iii **engine** is a prebuilt binary, not a cargo crate — don't try to `cargo install` it. (The iii **SDKs** are published on crates.io, npm, and PyPI, but agentmemory doesn't need them.) Supported engine install methods, all pinned to v0.11.2: the prebuilt v0.11.2 binary above, the upstream sh install script **with the version pin** `curl -fsSL https://install.iii.dev/iii/main/install.sh | VERSION=0.11.2 sh` (macOS/Linux), and the Docker image `iiidev/iii:0.11.2`. A bare `install.sh | sh` installs the **latest** engine, which agentmemory does not support — always pass `VERSION=0.11.2`. Easiest of all: just run `npx @agentmemory/agentmemory`, which fetches the pinned engine into `~/.agentmemory/bin` for you.
> Note: the iii **engine** is a prebuilt binary, not a cargo crate — don't try to `cargo install` it. (The iii **SDKs** are published on crates.io, npm, and PyPI, but agentmemory doesn't need them.) Easiest install: `npx -y @agentmemory/agentmemory@latest`, which fetches the pinned engine into `~/.agentmemory/bin` for you. If you'd rather manage the engine yourself, the supported methods are all pinned to v0.11.2: the prebuilt v0.11.2 binary above, the upstream iii-installer script **with the version pin** — download `https://install.iii.dev/iii/main/install.sh`, inspect it, then run `VERSION=0.11.2 sh install.sh` (macOS/Linux) instead of piping it into a shell — and the Docker image `iiidev/iii:0.11.2`. A bare `install.sh | sh` installs the **latest** engine, which agentmemory does not support — always pass `VERSION=0.11.2`.

---

Expand Down
6 changes: 3 additions & 3 deletions ci/r13-test-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"count": 168,
"sha256": "b35ad81c97bf698167b70254a4b8c19df914a7526043e1744b8009abc36f6ec7",
"content_sha256": "e4b93bad47233b674013dc7d58161e41c8c555ab7487bf746400d86b3d2a9da2"
"count": 171,
"sha256": "dfb0a43ae58136529042da617518eddb884a379233b038ca6970aa46d993ac8f",
"content_sha256": "4a9a6cfa26b4796eadf14ec294559de28dfdfba7f7083c65fc7bbd479c6326b8"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6826,6 +6826,7 @@ function normalizeGitRemote(remote) {
return;
}
}
let warnedUnnormalizableRemote = false;
function inferProjectId(root) {
const remote = git(root, [
"remote",
Expand All @@ -6838,7 +6839,12 @@ function inferProjectId(root) {
"upstream"
]);
const normalizedRemote = remote ? normalizeGitRemote(remote) : void 0;
if (remote && !normalizedRemote) throw new Error("configured Git remote cannot be normalized safely");
if (remote && !normalizedRemote) {
if (!warnedUnnormalizableRemote) {
warnedUnnormalizableRemote = true;
process.stderr.write(`[agentmemory] Git remote "${remote}" cannot be normalized to a canonical project id; using local/${projectPathHash(root)} for this checkout\n`);
}
}
return normalizedRemote ?? `local/${projectPathHash(root)}`;
}
function readConfigFile(path) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { a as normalizedProjectPath, r as isProjectPathExcluded } from "./_auth-dmt9vymH.mjs";
import { a as normalizedProjectPath, r as isProjectPathExcluded } from "./_auth-8LRLcG2I.mjs";
import { resolve } from "node:path";
import { createHash } from "node:crypto";
import { execFileSync } from "node:child_process";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { n as projectAuthHeaders } from "./_auth-dmt9vymH.mjs";
import { n as projectAuthHeaders } from "./_auth-8LRLcG2I.mjs";
//#region src/hooks/_delivery.ts
var HookDeliveryError = class extends Error {
retryable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { n as projectAuthHeaders } from "./_auth-dmt9vymH.mjs";
import { n as projectAuthHeaders } from "./_auth-8LRLcG2I.mjs";
//#region src/hooks/_observe-delivery.ts
const MAX_ATTEMPTS = 2;
const REQUEST_TIMEOUT_MS = 250;
Expand Down
8 changes: 0 additions & 8 deletions plugin/scripts/_project-CXCTta9T.mjs

This file was deleted.

17 changes: 17 additions & 0 deletions plugin/scripts/_project-VjQrnNqc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { i as loadAgentmemoryEnvironment, o as resolveProjectConfig } from "./_auth-8LRLcG2I.mjs";
//#region src/hooks/_project.ts
loadAgentmemoryEnvironment();
/**
* Resolve the canonical project id for a hook payload.
*
* @param cwd Working directory the hook observed, when the host provides one.
* @returns The project id in strict precedence order: AGENTMEMORY_PROJECT_NAME
* (or AGENTMEMORY_PROJECT_ID) environment override first, then configured
* manifest/user layers, then the canonical remote-derived identity for the
* directory — never a path basename.
*/
function resolveProject(cwd) {
return resolveProjectConfig(typeof cwd === "string" && cwd.trim() ? cwd : process.cwd()).project_id;
}
//#endregion
export { resolveProject as t };
4 changes: 2 additions & 2 deletions plugin/scripts/notification.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import { t as resolveProject } from "./_project-CXCTta9T.mjs";
import { n as reportObservationDeliveryFailure, t as deliverObservation } from "./_observe-delivery-Bt5vTi-C.mjs";
import { t as resolveProject } from "./_project-VjQrnNqc.mjs";
import { n as reportObservationDeliveryFailure, t as deliverObservation } from "./_observe-delivery-BYrh4Ekr.mjs";
//#region src/hooks/notification.ts
function isSdkChildContext(payload) {
if (process.env["AGENTMEMORY_SDK_CHILD"] === "1") return true;
Expand Down
6 changes: 3 additions & 3 deletions plugin/scripts/post-commit.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node
import { t as resolveProject } from "./_project-CXCTta9T.mjs";
import { n as reportHookDeliveryFailure, t as deliverProjectRequest } from "./_delivery-BtSVOGKV.mjs";
import { n as credentialFreeWorktreeId, r as parseCommitTransitions } from "./_capture-KP8LxcSz.mjs";
import { t as resolveProject } from "./_project-VjQrnNqc.mjs";
import { n as reportHookDeliveryFailure, t as deliverProjectRequest } from "./_delivery-C1jg9u5N.mjs";
import { n as credentialFreeWorktreeId, r as parseCommitTransitions } from "./_capture-CdxWrCwc.mjs";
import { resolve } from "node:path";
import { execFile } from "node:child_process";
import { pathToFileURL } from "node:url";
Expand Down
6 changes: 3 additions & 3 deletions plugin/scripts/post-tool-failure.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node
import { o as resolveProjectConfig } from "./_auth-dmt9vymH.mjs";
import { n as reportObservationDeliveryFailure, t as deliverObservation } from "./_observe-delivery-Bt5vTi-C.mjs";
import { t as captureToolEvent } from "./_capture-KP8LxcSz.mjs";
import { o as resolveProjectConfig } from "./_auth-8LRLcG2I.mjs";
import { n as reportObservationDeliveryFailure, t as deliverObservation } from "./_observe-delivery-BYrh4Ekr.mjs";
import { t as captureToolEvent } from "./_capture-CdxWrCwc.mjs";
//#region src/hooks/post-tool-failure.ts
function isSdkChildContext(payload) {
if (process.env["AGENTMEMORY_SDK_CHILD"] === "1") return true;
Expand Down
6 changes: 3 additions & 3 deletions plugin/scripts/post-tool-use.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node
import { o as resolveProjectConfig } from "./_auth-dmt9vymH.mjs";
import { n as reportObservationDeliveryFailure, t as deliverObservation } from "./_observe-delivery-Bt5vTi-C.mjs";
import { t as captureToolEvent } from "./_capture-KP8LxcSz.mjs";
import { o as resolveProjectConfig } from "./_auth-8LRLcG2I.mjs";
import { n as reportObservationDeliveryFailure, t as deliverObservation } from "./_observe-delivery-BYrh4Ekr.mjs";
import { t as captureToolEvent } from "./_capture-CdxWrCwc.mjs";
//#region src/hooks/post-tool-use.ts
function isSdkChildContext(payload) {
if (process.env["AGENTMEMORY_SDK_CHILD"] === "1") return true;
Expand Down
4 changes: 2 additions & 2 deletions plugin/scripts/pre-compact.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import { i as loadAgentmemoryEnvironment, n as projectAuthHeaders, t as contextAcknowledgementSecret } from "./_auth-dmt9vymH.mjs";
import { t as resolveProject } from "./_project-CXCTta9T.mjs";
import { i as loadAgentmemoryEnvironment, n as projectAuthHeaders, t as contextAcknowledgementSecret } from "./_auth-8LRLcG2I.mjs";
import { t as resolveProject } from "./_project-VjQrnNqc.mjs";
import { createHash, createHmac, randomUUID } from "node:crypto";
//#region src/hooks/pre-compact.ts
function isSdkChildContext(payload) {
Expand Down
4 changes: 2 additions & 2 deletions plugin/scripts/pre-tool-use.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import { i as loadAgentmemoryEnvironment, n as projectAuthHeaders } from "./_auth-dmt9vymH.mjs";
import { t as resolveProject } from "./_project-CXCTta9T.mjs";
import { i as loadAgentmemoryEnvironment, n as projectAuthHeaders } from "./_auth-8LRLcG2I.mjs";
import { t as resolveProject } from "./_project-VjQrnNqc.mjs";
//#region src/hooks/pre-tool-use.ts
function isSdkChildContext(payload) {
if (process.env["AGENTMEMORY_SDK_CHILD"] === "1") return true;
Expand Down
4 changes: 2 additions & 2 deletions plugin/scripts/prompt-submit.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import { t as resolveProject } from "./_project-CXCTta9T.mjs";
import { n as reportObservationDeliveryFailure, t as deliverObservation } from "./_observe-delivery-Bt5vTi-C.mjs";
import { t as resolveProject } from "./_project-VjQrnNqc.mjs";
import { n as reportObservationDeliveryFailure, t as deliverObservation } from "./_observe-delivery-BYrh4Ekr.mjs";
//#region src/hooks/prompt-submit.ts
function isSdkChildContext(payload) {
if (process.env["AGENTMEMORY_SDK_CHILD"] === "1") return true;
Expand Down
4 changes: 2 additions & 2 deletions plugin/scripts/session-end.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import { t as resolveProject } from "./_project-CXCTta9T.mjs";
import { n as reportHookDeliveryFailure, t as deliverProjectRequest } from "./_delivery-BtSVOGKV.mjs";
import { t as resolveProject } from "./_project-VjQrnNqc.mjs";
import { n as reportHookDeliveryFailure, t as deliverProjectRequest } from "./_delivery-C1jg9u5N.mjs";
//#region src/hooks/session-end.ts
function isSdkChildContext(payload) {
if (process.env["AGENTMEMORY_SDK_CHILD"] === "1") return true;
Expand Down
6 changes: 3 additions & 3 deletions plugin/scripts/session-start.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node
import { o as resolveProjectConfig } from "./_auth-dmt9vymH.mjs";
import "./_project-CXCTta9T.mjs";
import { n as reportHookDeliveryFailure, t as deliverProjectRequest } from "./_delivery-BtSVOGKV.mjs";
import { o as resolveProjectConfig } from "./_auth-8LRLcG2I.mjs";
import "./_project-VjQrnNqc.mjs";
import { n as reportHookDeliveryFailure, t as deliverProjectRequest } from "./_delivery-C1jg9u5N.mjs";
//#region src/hooks/session-start.ts
function isSdkChildContext(payload) {
if (process.env["AGENTMEMORY_SDK_CHILD"] === "1") return true;
Expand Down
57 changes: 45 additions & 12 deletions plugin/scripts/standalone.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,20 @@ const CORE_TOOLS = [
},
{
name: "memory_export",
description: "Export all memory data as JSON.",
description: "Export memory data as JSON for one project (or all with admin global scope).",
inputSchema: {
type: "object",
properties: {}
properties: {
project: {
type: "string",
description: "Canonical project ID. Required unless scope is explicitly global."
},
scope: {
type: "string",
enum: ["global"],
description: "Set to 'global' only for an explicit administrative cross-project export; otherwise provide project."
}
}
}
},
{
Expand Down Expand Up @@ -702,7 +712,7 @@ const V040_TOOLS = [
},
{
name: "memory_audit",
description: "View the audit trail of memory operations.",
description: "View the audit trail of memory operations for one project (or all with admin global scope).",
inputSchema: {
type: "object",
properties: {
Expand All @@ -713,6 +723,15 @@ const V040_TOOLS = [
limit: {
type: "number",
description: "Max entries (default 50)"
},
project: {
type: "string",
description: "Canonical project ID. Required unless scope is explicitly global."
},
scope: {
type: "string",
enum: ["global"],
description: "Set to 'global' only for an explicit administrative cross-project query; otherwise provide project."
}
}
}
Expand Down Expand Up @@ -2181,9 +2200,12 @@ function validate(toolName, args) {
applyProjectScope(v, args);
return v;
}
case "memory_export": return v;
case "memory_export":
applyProjectScope(v, args);
return v;
case "memory_audit":
v.limit = parseLimit(args["limit"], 50);
applyProjectScope(v, args);
return v;
default: throw new Error(`Unknown tool: ${toolName}`);
}
Expand Down Expand Up @@ -2241,8 +2263,14 @@ async function handleProxy(v, handle) {
...v.scope === "global" ? { scope: "global" } : { project: v.project }
})
}));
case "memory_export": return textResponse(await handle.call("/agentmemory/export", { method: "GET" }), true);
case "memory_audit": return textResponse(await handle.call(`/agentmemory/audit?limit=${v.limit}`, { method: "GET" }), true);
case "memory_export": {
const qs = v.scope === "global" ? "?scope=global" : `?project=${encodeURIComponent(v.project ?? "")}`;
return textResponse(await handle.call(`/agentmemory/export${qs}`, { method: "GET" }), true);
}
case "memory_audit": {
const scopeQs = v.scope === "global" ? "&scope=global" : `&project=${encodeURIComponent(v.project ?? "")}`;
return textResponse(await handle.call(`/agentmemory/audit?limit=${v.limit}${scopeQs}`, { method: "GET" }), true);
}
default: throw new Error(`Unknown tool: ${v.tool}`);
}
}
Expand Down Expand Up @@ -2323,13 +2351,18 @@ async function handleLocal(v, kvInstance) {
reason: v.reason
});
}
case "memory_export": return textResponse({
version: VERSION,
memories: await kvInstance.list("mem:memories"),
sessions: await kvInstance.list("mem:sessions")
}, true);
case "memory_export": {
const allMemories = await kvInstance.list("mem:memories");
const allSessions = await kvInstance.list("mem:sessions");
return textResponse({
version: VERSION,
memories: v.scope === "global" ? allMemories : allMemories.filter((m) => m["project"] === v.project),
sessions: v.scope === "global" ? allSessions : allSessions.filter((s) => s["project"] === v.project)
}, true);
}
case "memory_audit": {
const entries = await kvInstance.list("mem:audit");
const allEntries = await kvInstance.list("mem:audit");
const entries = v.scope === "global" ? allEntries : allEntries.filter((e) => typeof e["details"] === "object" && e["details"] !== null && e["details"]["project"] === v.project);
const limit = v.limit ?? 50;
return textResponse({ entries: entries.slice(0, limit) }, true);
}
Expand Down
4 changes: 2 additions & 2 deletions plugin/scripts/stop.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import { t as resolveProject } from "./_project-CXCTta9T.mjs";
import { n as reportHookDeliveryFailure, t as deliverProjectRequest } from "./_delivery-BtSVOGKV.mjs";
import { t as resolveProject } from "./_project-VjQrnNqc.mjs";
import { n as reportHookDeliveryFailure, t as deliverProjectRequest } from "./_delivery-C1jg9u5N.mjs";
//#region src/hooks/stop.ts
function isSdkChildContext(payload) {
if (process.env["AGENTMEMORY_SDK_CHILD"] === "1") return true;
Expand Down
4 changes: 2 additions & 2 deletions plugin/scripts/subagent-start.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import { t as resolveProject } from "./_project-CXCTta9T.mjs";
import { n as reportObservationDeliveryFailure, t as deliverObservation } from "./_observe-delivery-Bt5vTi-C.mjs";
import { t as resolveProject } from "./_project-VjQrnNqc.mjs";
import { n as reportObservationDeliveryFailure, t as deliverObservation } from "./_observe-delivery-BYrh4Ekr.mjs";
//#region src/hooks/subagent-start.ts
function isSdkChildContext(payload) {
if (process.env["AGENTMEMORY_SDK_CHILD"] === "1") return true;
Expand Down
4 changes: 2 additions & 2 deletions plugin/scripts/subagent-stop.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import { t as resolveProject } from "./_project-CXCTta9T.mjs";
import { n as reportObservationDeliveryFailure, t as deliverObservation } from "./_observe-delivery-Bt5vTi-C.mjs";
import { t as resolveProject } from "./_project-VjQrnNqc.mjs";
import { n as reportObservationDeliveryFailure, t as deliverObservation } from "./_observe-delivery-BYrh4Ekr.mjs";
//#region src/hooks/subagent-stop.ts
function isSdkChildContext(payload) {
if (process.env["AGENTMEMORY_SDK_CHILD"] === "1") return true;
Expand Down
4 changes: 2 additions & 2 deletions plugin/scripts/task-completed.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import { t as resolveProject } from "./_project-CXCTta9T.mjs";
import { n as reportObservationDeliveryFailure, t as deliverObservation } from "./_observe-delivery-Bt5vTi-C.mjs";
import { t as resolveProject } from "./_project-VjQrnNqc.mjs";
import { n as reportObservationDeliveryFailure, t as deliverObservation } from "./_observe-delivery-BYrh4Ekr.mjs";
//#region src/hooks/task-completed.ts
function isSdkChildContext(payload) {
if (process.env["AGENTMEMORY_SDK_CHILD"] === "1") return true;
Expand Down
3 changes: 2 additions & 1 deletion plugin/skills/agentmemory-config/REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Generated by scanning `src/` for `AGENTMEMORY_*` usage. Do not edit the block below by hand; run `npm run skills:gen` after adding or removing a variable. Internal markers ending in two underscores are excluded.

<!-- AUTOGEN:env START - generated by scripts/skills/generate.ts, do not edit by hand -->
Configuration is read from the environment and from `~/.agentmemory/.env` (no `export` prefix). 66 recognized variables:
Configuration is read from the environment and from `~/.agentmemory/.env` (no `export` prefix). 67 recognized variables:

- `AGENTMEMORY_ADMIN_SECRET`
- `AGENTMEMORY_ADMIN_SECRET_FILE`
Expand Down Expand Up @@ -58,6 +58,7 @@ Configuration is read from the environment and from `~/.agentmemory/.env` (no `e
- `AGENTMEMORY_SESSION_ID`
- `AGENTMEMORY_SLOTS`
- `AGENTMEMORY_SOURCE_ROOTS`
- `AGENTMEMORY_STALE_SESSION_SWEEP_MS`
- `AGENTMEMORY_STARTUP_AUDIT_GAP_MAX_ENTRIES`
- `AGENTMEMORY_STARTUP_GOVERNANCE_MAX_AUDIT_ENTRIES`
- `AGENTMEMORY_STARTUP_RECONCILE_MAX_ENTRIES`
Expand Down
Loading
Loading