@memfork/cli 0.1.51 → 0.1.53
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/commands/install.js
CHANGED
|
@@ -200,9 +200,12 @@ network_access = true
|
|
|
200
200
|
// ── Summary (Codex) ────────────────────────────────────────────────────────
|
|
201
201
|
console.log("");
|
|
202
202
|
console.log(tip("The agent now has:"));
|
|
203
|
-
console.log(dim(" memwal_recall
|
|
204
|
-
console.log(dim("
|
|
205
|
-
console.log(
|
|
203
|
+
console.log(dim(" memwal_recall — semantic memory recall via MemWal MCP"));
|
|
204
|
+
console.log(dim(" memfork commit / merge — the only write path: MemWal + on-chain anchor"));
|
|
205
|
+
console.log("");
|
|
206
|
+
console.log(dim(" Raw MemWal writes (remember / remember_bulk / analyze) are disabled"));
|
|
207
|
+
console.log(dim(" so every saved memory is anchored on Sui. Want raw, unanchored notes?"));
|
|
208
|
+
console.log(dim(" Install the standalone MemWal plugin alongside MemForks."));
|
|
206
209
|
console.log("");
|
|
207
210
|
console.log(tip("memfork doctor — verify the full setup"));
|
|
208
211
|
console.log("");
|
|
@@ -216,14 +219,23 @@ function upsertCodexMcp(tomlPath, creds) {
|
|
|
216
219
|
if (fs.existsSync(tomlPath)) {
|
|
217
220
|
existing = fs.readFileSync(tomlPath, "utf8");
|
|
218
221
|
}
|
|
222
|
+
// `disabled_tools` denies the raw MemWal write tools so the agent cannot
|
|
223
|
+
// bypass the on-chain DAG. All persistence is forced through `memfork commit`
|
|
224
|
+
// (which writes MemWal *and* anchors on Sui). Recall + health + restore stay
|
|
225
|
+
// enabled. Users who want raw, unanchored memory can install the standalone
|
|
226
|
+
// MemWal plugin instead.
|
|
219
227
|
const block = `
|
|
220
228
|
[mcp_servers.memwal]
|
|
221
229
|
url = "${creds.relayerUrl}"
|
|
222
230
|
http_headers = { Authorization = "Bearer ${creds.delegateKey}", x-memwal-account-id = "${creds.accountId}" }
|
|
231
|
+
disabled_tools = ["memwal_remember", "memwal_remember_bulk", "memwal_analyze"]
|
|
223
232
|
`;
|
|
224
233
|
if (existing.includes("[mcp_servers.memwal]")) {
|
|
225
|
-
// Replace the existing block —
|
|
226
|
-
|
|
234
|
+
// Replace the existing block — from the header through every following line
|
|
235
|
+
// that is NOT a new TOML table header (`[...]` at line start). This keeps
|
|
236
|
+
// inline arrays like `disabled_tools = [...]` intact instead of truncating
|
|
237
|
+
// at the first `[`.
|
|
238
|
+
existing = existing.replace(/^\[mcp_servers\.memwal\]\n(?:(?!\[)[^\n]*\n?)*/m, block.trimStart());
|
|
227
239
|
}
|
|
228
240
|
else {
|
|
229
241
|
existing = existing.trimEnd() + "\n" + block;
|
package/dist/commands/ops.js
CHANGED
|
@@ -161,25 +161,26 @@ export async function cmdCommit(opts) {
|
|
|
161
161
|
...(artifacts.length > 0 ? { artifacts } : {}),
|
|
162
162
|
});
|
|
163
163
|
const out = { blobId, branch, artifacts: refs };
|
|
164
|
-
|
|
164
|
+
// Always print the human-readable confirmation so agents and CI can recognise
|
|
165
|
+
// success without parsing JSON. In non-TTY contexts (subprocesses, pipes) we
|
|
166
|
+
// additionally emit the JSON on the following line for machine consumption.
|
|
167
|
+
console.log("");
|
|
168
|
+
console.log(chalk.green("✓") + " Committed to " + chalk.bold(branch));
|
|
169
|
+
console.log(chalk.dim(` blob: ${blobId}`));
|
|
170
|
+
if (refs.length > 0) {
|
|
165
171
|
console.log("");
|
|
166
|
-
console.log(chalk.
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
chalk.dim(`blob: ${ref.blobId.slice(0, 16)}… `) +
|
|
175
|
-
chalk.dim(`sha256: ${ref.sha256.slice(0, 16)}…`));
|
|
176
|
-
console.log(chalk.dim(` Retrieve with: `) +
|
|
177
|
-
chalk.white(`memfork cat ${ref.blobId} --output ${ref.path} --sha256 ${ref.sha256}`));
|
|
178
|
-
}
|
|
172
|
+
console.log(chalk.bold(" Artifacts:"));
|
|
173
|
+
for (const ref of refs) {
|
|
174
|
+
console.log(` ${chalk.cyan(ref.path)} ` +
|
|
175
|
+
chalk.dim(`${(ref.size / 1024).toFixed(1)} KiB `) +
|
|
176
|
+
chalk.dim(`blob: ${ref.blobId.slice(0, 16)}… `) +
|
|
177
|
+
chalk.dim(`sha256: ${ref.sha256.slice(0, 16)}…`));
|
|
178
|
+
console.log(chalk.dim(` Retrieve with: `) +
|
|
179
|
+
chalk.white(`memfork cat ${ref.blobId} --output ${ref.path} --sha256 ${ref.sha256}`));
|
|
179
180
|
}
|
|
180
|
-
console.log("");
|
|
181
181
|
}
|
|
182
|
-
|
|
182
|
+
console.log("");
|
|
183
|
+
if (!process.stdout.isTTY) {
|
|
183
184
|
console.log(JSON.stringify(out));
|
|
184
185
|
}
|
|
185
186
|
}
|
|
@@ -695,12 +696,29 @@ export async function cmdBranch(name, opts = {}) {
|
|
|
695
696
|
const { client, cfg } = await getClient();
|
|
696
697
|
const from = resolveBranch({ explicit: opts.from, configDefault: cfg.defaultBranch });
|
|
697
698
|
process.stdout.write(chalk.dim(`Creating branch ${chalk.green(name)} from ${chalk.green(from)} … `));
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
699
|
+
try {
|
|
700
|
+
const digest = await client.branch(name, { from });
|
|
701
|
+
console.log(chalk.green("done"));
|
|
702
|
+
console.log("");
|
|
703
|
+
console.log(chalk.dim(` tx: ${digest}`));
|
|
704
|
+
console.log(chalk.dim(` Run ${chalk.white("memfork checkout " + name)} to switch to it.`));
|
|
705
|
+
console.log("");
|
|
706
|
+
}
|
|
707
|
+
catch (err) {
|
|
708
|
+
// E_BRANCH_EXISTS (Move abort code 7) — treat as success so `memfork branch`
|
|
709
|
+
// is safe to run idempotently in scripts and runbooks.
|
|
710
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
711
|
+
if (msg.includes("MoveAbort") && msg.match(/,\s*7\)/)) {
|
|
712
|
+
console.log(chalk.dim("already exists"));
|
|
713
|
+
console.log("");
|
|
714
|
+
console.log(chalk.dim(` Branch "${name}" is already on this tree — no action needed.`));
|
|
715
|
+
console.log(chalk.dim(` Run ${chalk.white("memfork checkout " + name)} to switch to it.`));
|
|
716
|
+
console.log("");
|
|
717
|
+
}
|
|
718
|
+
else {
|
|
719
|
+
throw err;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
704
722
|
}
|
|
705
723
|
// ─── checkout ─────────────────────────────────────────────────────────────────
|
|
706
724
|
export async function cmdCheckout(name, opts = {}) {
|
package/package.json
CHANGED
|
@@ -17,9 +17,11 @@ finding — **always use `memfork commit --facts`**, not `memwal_remember`.
|
|
|
17
17
|
1. Indexes the facts in MemWal for semantic recall (same as `memwal_remember`)
|
|
18
18
|
2. Anchors them on-chain on Sui, tagged to the current Git branch
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
The raw MemWal write tools (`memwal_remember`, `memwal_remember_bulk`,
|
|
21
|
+
`memwal_analyze`) are **disabled** under MemForks — they save to
|
|
22
|
+
`namespace=default` with no branch scoping and no on-chain anchor, which
|
|
23
|
+
defeats the purpose of a version-controlled memory DAG. `memfork commit` is
|
|
24
|
+
the only write path, so every saved memory is provably anchored on Sui.
|
|
23
25
|
|
|
24
26
|
## Procedure
|
|
25
27
|
|
|
@@ -63,7 +65,8 @@ Do not print the full CLI output. One line is enough.
|
|
|
63
65
|
|
|
64
66
|
## Rules
|
|
65
67
|
|
|
66
|
-
-
|
|
68
|
+
- The raw `memwal_remember*` / `memwal_analyze` tools are disabled — `memfork
|
|
69
|
+
commit` is the only way to persist memory. Never look for a workaround.
|
|
67
70
|
- Never commit task state, in-progress work, or temporary findings.
|
|
68
71
|
- If `memfork commit` fails (e.g. no tree initialised), tell the user to
|
|
69
72
|
run `memfork init` first and offer to retry.
|
|
@@ -55,8 +55,10 @@ a different branch.
|
|
|
55
55
|
Use this after any significant turn: architectural decisions, resolved problems,
|
|
56
56
|
project conventions, key constraints.
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
Always persist memory with `memfork commit` — never `memwal_remember`. The raw
|
|
59
|
+
MemWal write tools save to `namespace=default` with no branch scoping and no
|
|
60
|
+
on-chain anchor, which bypasses the DAG. `memfork commit` indexes the same
|
|
61
|
+
facts in MemWal *and* anchors them on Sui, so every memory is verifiable.
|
|
60
62
|
|
|
61
63
|
Do **not** save: current task state, in-progress work, temporary findings.
|
|
62
64
|
|