memoryrouter-codex 1.8.0 → 1.8.1
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/lib/installer.cjs +14 -4
- package/lib/managed.cjs +2 -2
- package/package.json +1 -1
- package/runtime/constants.cjs +1 -1
package/lib/installer.cjs
CHANGED
|
@@ -117,10 +117,19 @@ function init(options = {}) {
|
|
|
117
117
|
agentsFile: options.agents === false ? null : layout.agentsFile,
|
|
118
118
|
runtimeDir: layout.runtimeDir,
|
|
119
119
|
};
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
// The manifest is bookkeeping only (nothing reads it to run hooks). Inside
|
|
121
|
+
// the Codex app's sandbox, writes outside CODEX_HOME need an extra approval,
|
|
122
|
+
// so a blocked write must never fail an otherwise complete install.
|
|
123
|
+
let manifestWritten = true;
|
|
124
|
+
try {
|
|
125
|
+
const manifestDir = path.join(dataHome(options.env), 'installations');
|
|
126
|
+
fs.mkdirSync(manifestDir, { recursive: true, mode: 0o700 });
|
|
127
|
+
const manifestName = Buffer.from(`${layout.scope}:${layout.root}`).toString('base64url');
|
|
128
|
+
fs.writeFileSync(path.join(manifestDir, `${manifestName}.json`), `${JSON.stringify(manifest, null, 2)}\n`, { mode: 0o600 });
|
|
129
|
+
} catch (error) {
|
|
130
|
+
if (options.apiKey) throw error;
|
|
131
|
+
manifestWritten = false;
|
|
132
|
+
}
|
|
124
133
|
return {
|
|
125
134
|
layout,
|
|
126
135
|
auth,
|
|
@@ -128,6 +137,7 @@ function init(options = {}) {
|
|
|
128
137
|
serverName,
|
|
129
138
|
adoptedServer,
|
|
130
139
|
results,
|
|
140
|
+
manifestWritten,
|
|
131
141
|
automaticMemory: options.hooks !== false && (hookMode === 'mcp' || Boolean(options.apiKey || getApiKey(env, loadConfig(options.env)))),
|
|
132
142
|
keySource: options.apiKey ? 'codex-config' : apiKeySource(env, loadConfig(options.env)),
|
|
133
143
|
};
|
package/lib/managed.cjs
CHANGED
|
@@ -151,9 +151,9 @@ function uninstallToml(file) {
|
|
|
151
151
|
|
|
152
152
|
function agentsBlock(options = {}) {
|
|
153
153
|
const automatic = options.hookMode === 'mcp'
|
|
154
|
-
? '- Automatic hooks (over the signed-in MemoryRouter connection) search the vault before each prompt and add what they find as context, then save each completed turn: the user\'s message and your final response only, never tool calls, tool output or intermediate steps.\n'
|
|
154
|
+
? '- Automatic hooks (over the signed-in MemoryRouter connection) search the vault before each prompt and add what they find as context ("MemoryRouter recalled this for the current message"), then save each completed turn: the user\'s message and your final response only, never tool calls, tool output or intermediate steps.\n'
|
|
155
155
|
: '- Automatic hooks search the vault before each prompt and save each completed turn (the user\'s message and your final response only) when a MemoryRouter API key is configured.\n';
|
|
156
|
-
return `## MemoryRouter memory\n\n- MemoryRouter is the durable cross-machine, cross-tool, and team/auditable memory layer. Codex native Memories may remain enabled as the local personal recall layer.\n${automatic}-
|
|
156
|
+
return `## MemoryRouter memory\n\n- MemoryRouter is the durable cross-machine, cross-tool, and team/auditable memory layer. Codex native Memories may remain enabled as the local personal recall layer.\n${automatic}- If the recalled context already answers the question, answer from it directly; do not search again. Call MemoryRouter search only when nothing relevant was recalled or you need more detail about prior decisions, preferences, incidents, or unfinished work. Depending on auth mode, the tool is named \`search_memories\` or \`memory_search\`.\n- Store only concise, durable decisions, preferences, facts, and incident outcomes. Depending on auth mode, use \`store_memory\` or \`memory_store\`. Do not duplicate a completed turn that hooks already captured.\n- Keep and cite returned \`mrh_...\` handles when a specific memory must be referenced later.\n- Project scope is derived from the canonical git remote when available, so worktrees and machines share identity without uploading local paths. It is the same project memory Claude Code uses through memoryrouter-claude, so decisions made in either agent are available in both.\n- If MemoryRouter is offline, continue the task without memory; never block work on recall or capture.`;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
function installAgents(file, options = {}) {
|
package/package.json
CHANGED
package/runtime/constants.cjs
CHANGED