@staix/agent-mem 0.20.1 → 0.20.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/.claude-plugin/plugin.json +1 -1
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/cli.ts +2 -0
- package/src/setup-paths.ts +4 -1
- package/src/setup.ts +5 -0
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Curated memory with append-only JSONL logs, a derived SQLite index, short- and long-term tiers, a typed graph, goals with leases, and git sync between machines. Extracted from [agent-hub](https://github.com/STAIxBWLB/agent-hub), with compatible storage and entry IDs.
|
|
4
4
|
|
|
5
|
-
Version: 0.20.
|
|
5
|
+
Version: 0.20.2. Requires Bun 1.4.2 or later; no runtime dependencies.
|
|
6
6
|
|
|
7
7
|
## Quick start
|
|
8
8
|
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -248,6 +248,8 @@ function markedSetupApplyError(parsed: ReturnType<typeof parseCommand>, error: u
|
|
|
248
248
|
cause = "native_result_mismatch"; next = "Review the installed client's configuration format and version, then rerun setup preview."; partial = false;
|
|
249
249
|
} else if (text === "setup receipt version is unsupported; run setup or undo with the release that wrote it") {
|
|
250
250
|
cause = "setup_receipt_version_unsupported"; next = "Run setup or undo with the amem release that wrote the receipt."; partial = false;
|
|
251
|
+
} else if (text === "setup receipt was written from an Orca Claude profile; rerun setup from that Orca profile") {
|
|
252
|
+
cause = "setup_receipt_orca_profile"; next = "The receipt was written from an Orca Claude profile; rerun setup from that Orca profile."; partial = false;
|
|
251
253
|
} else if (/^setup-owned .+ changed; refusing to overwrite it$/.test(text) || text === "Pi amem-session extension already exists and is not this setup's file"
|
|
252
254
|
|| text === "previous-runtime hook settings are customized; review hook configuration before retrying setup"
|
|
253
255
|
|| /^setup receipt (?:does not match this installation|target mismatch|invalid|directory ownership invalid)$/.test(text)) {
|
package/src/setup-paths.ts
CHANGED
|
@@ -67,7 +67,10 @@ export function resolveSetupPaths(env: SetupEnvironment = process.env, givenHome
|
|
|
67
67
|
paths[target][index] = to;
|
|
68
68
|
redirects.push({ target, from, to, reason: "Orca re-syncs this managed file from the personal source" });
|
|
69
69
|
};
|
|
70
|
-
if (orcaHome(claude, "claude", env, home))
|
|
70
|
+
if (orcaHome(claude, "claude", env, home)) {
|
|
71
|
+
redirect("claude", 0, join(home, ".claude.json"));
|
|
72
|
+
redirect("claude", 1, join(home, ".claude", "settings.json"));
|
|
73
|
+
}
|
|
71
74
|
if (orcaHome(codex, "codex", env, home)) {
|
|
72
75
|
redirect("codex", 0, join(home, ".codex", "config.toml"));
|
|
73
76
|
redirect("codex", 1, join(home, ".codex", "hooks.json"));
|
package/src/setup.ts
CHANGED
|
@@ -214,6 +214,9 @@ function receipt(c: ReturnType<typeof context>, target: SetupTarget, requireRunt
|
|
|
214
214
|
if (value.target !== target || typeof value.intent !== "string" || !/^[a-f0-9]{64}$/.test(value.intent) || requireRuntime && value.intent !== intent(c, target) || !["prepared", "applied"].includes(String(value.phase)) || !Array.isArray(value.changes) || value.changes.length !== c.paths[target].length && !(target === "jcode" && value.changes.length === 1)) throw Error("setup receipt does not match this installation");
|
|
215
215
|
for (let i = 0; i < value.changes.length; i++) {
|
|
216
216
|
const change = record(value.changes[i]); const currentPath = c.paths[target][i], legacyRedirect = c.redirects.some(row => row.target === target && row.from === change.path && row.to === currentPath);
|
|
217
|
+
if (target === "claude" && i === 0 && typeof change.path === "string" && change.path !== currentPath && !legacyRedirect
|
|
218
|
+
&& resolveSetupPaths({ ...c.env, CLAUDE_CONFIG_DIR: dirname(change.path) }, c.home).redirects.some(row => row.from === change.path && row.to === currentPath))
|
|
219
|
+
throw Error("setup receipt was written from an Orca Claude profile; rerun setup from that Orca profile");
|
|
217
220
|
if (change.path !== currentPath && !legacyRedirect || change.key !== `${target}:${i}`) throw Error("setup receipt target mismatch");
|
|
218
221
|
for (const key of ["before", "after", ...(change.start !== undefined ? ["start"] : [])]) {
|
|
219
222
|
const v = record(change[key]);
|
|
@@ -418,6 +421,8 @@ function prepare(c: ReturnType<typeof context>, target: SetupTarget, options: Se
|
|
|
418
421
|
// Only a same-file before-image can restore a target. A newly authoritative personal source owns its current bytes.
|
|
419
422
|
// Mapped per current path: a pre-#203 jcode receipt covers mcp.json only, so config.toml starts from its live image.
|
|
420
423
|
const restored = c.paths[target].map((path, index) => { const change = prior?.changes[index];
|
|
424
|
+
// Validate ownership at the historical path before adopting a new source, without publishing to the copy.
|
|
425
|
+
if (prior && change && change.path !== path) restoreChange(prior, change, index, read(change.path));
|
|
421
426
|
return prior && change && change.path === path ? restoreChange(prior, change, index, expected[index]!) : expected[index]!; });
|
|
422
427
|
if (prior?.phase === "applied" && prior.intent === intent(c, target) && prior.changes.every((change, index) => managedAfter(target, index, change.before, change.after, expected[index]!))) return { value: prior, expected, unchanged: true };
|
|
423
428
|
const changes: Change[] = c.paths[target].map((path, i) => ({ key: `${target}:${i}`, path, before: restored[i]!, after: restored[i]!, start: expected[i]! }));
|