opencode-codex-memory 0.4.8 → 0.4.9
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/README.md +3 -3
- package/dist/src/redact.js +5 -2
- package/dist/tools/memory.js +11 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ If you want the mental model before the details, jump to
|
|
|
52
52
|
|
|
53
53
|
```json
|
|
54
54
|
{
|
|
55
|
-
"plugin": ["opencode-codex-memory@0.4.
|
|
55
|
+
"plugin": ["opencode-codex-memory@0.4.9"]
|
|
56
56
|
}
|
|
57
57
|
```
|
|
58
58
|
|
|
@@ -239,7 +239,7 @@ To set options, turn the plugin entry into a `[name, options]` pair:
|
|
|
239
239
|
```json
|
|
240
240
|
{
|
|
241
241
|
"plugin": [
|
|
242
|
-
["opencode-codex-memory@0.4.
|
|
242
|
+
["opencode-codex-memory@0.4.9", { "disable_on_external_context": true, "min_rollout_idle_hours": 2 }]
|
|
243
243
|
]
|
|
244
244
|
}
|
|
245
245
|
```
|
|
@@ -298,7 +298,7 @@ directions:
|
|
|
298
298
|
```json
|
|
299
299
|
{
|
|
300
300
|
"plugin": [
|
|
301
|
-
["opencode-codex-memory@0.4.
|
|
301
|
+
["opencode-codex-memory@0.4.9", { "codex_interop": { "import": true, "export": true } }]
|
|
302
302
|
]
|
|
303
303
|
}
|
|
304
304
|
```
|
package/dist/src/redact.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
const REDACTIONS = [
|
|
2
|
+
// Bearer before key patterns (codex sanitizer order): a `Bearer sk-…` line
|
|
3
|
+
// redacts as one token instead of leaving a bare "Bearer " prefix.
|
|
4
|
+
// Word-boundary + space/tab only (not \s) avoids newline false positives;
|
|
5
|
+
// trailing =* covers base64 padding outside the 16-char body.
|
|
6
|
+
{ re: /\bBearer[ \t]+[A-Za-z0-9._~+/-]{16,}=*/gi, replacement: "Bearer [REDACTED]" },
|
|
2
7
|
{ re: /sk-ant-[A-Za-z0-9_\-]{20,}/g, replacement: "[REDACTED:anthropic-key]" },
|
|
3
8
|
{ re: /sk-[A-Za-z0-9]{20,}/g, replacement: "[REDACTED:openai-key]" },
|
|
4
9
|
{ re: /AKIA[0-9A-Z]{16}/g, replacement: "[REDACTED:aws-key]" },
|
|
5
10
|
{ re: /gh[pousr]_[A-Za-z0-9]{36,}/g, replacement: "[REDACTED:github-token]" },
|
|
6
11
|
{ re: /xox[baprs]-[A-Za-z0-9\-]{10,}/g, replacement: "[REDACTED:slack-token]" },
|
|
7
|
-
// Case-insensitive with a 16-char floor, matching codex's sanitizer.
|
|
8
|
-
{ re: /bearer\s+[A-Za-z0-9\-\._~+\/=]{16,}/gi, replacement: "Bearer [REDACTED]" },
|
|
9
12
|
{
|
|
10
13
|
re: /-----BEGIN [A-Z]+ PRIVATE KEY-----[\s\S]*?-----END [A-Z]+ PRIVATE KEY-----/g,
|
|
11
14
|
replacement: "[REDACTED:private-key]",
|
package/dist/tools/memory.js
CHANGED
|
@@ -69,27 +69,25 @@ export const memory_read = tool({
|
|
|
69
69
|
});
|
|
70
70
|
/** Skip hidden entries and symlinks, mirroring codex local/list.rs + local/search.rs walkers. */
|
|
71
71
|
function visibleEntries(dir) {
|
|
72
|
-
|
|
72
|
+
// Dirent file types (readdir withFileTypes) — codex read_sorted_dir_entries
|
|
73
|
+
// uses entry.file_type() so listing never follows symlinks.
|
|
74
|
+
let ents;
|
|
73
75
|
try {
|
|
74
|
-
|
|
76
|
+
ents = fs.readdirSync(dir, { withFileTypes: true });
|
|
75
77
|
}
|
|
76
78
|
catch {
|
|
77
79
|
return [];
|
|
78
80
|
}
|
|
79
81
|
const out = [];
|
|
80
|
-
for (const
|
|
81
|
-
if (name.startsWith("."))
|
|
82
|
+
for (const ent of ents) {
|
|
83
|
+
if (ent.name.startsWith("."))
|
|
82
84
|
continue;
|
|
83
|
-
|
|
84
|
-
try {
|
|
85
|
-
st = fs.lstatSync(path.join(dir, name));
|
|
86
|
-
}
|
|
87
|
-
catch {
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
if (st.isSymbolicLink())
|
|
85
|
+
if (ent.isSymbolicLink())
|
|
91
86
|
continue;
|
|
92
|
-
|
|
87
|
+
if (ent.isDirectory())
|
|
88
|
+
out.push({ name: ent.name, isDir: true });
|
|
89
|
+
else if (ent.isFile())
|
|
90
|
+
out.push({ name: ent.name, isDir: false });
|
|
93
91
|
}
|
|
94
92
|
return out;
|
|
95
93
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-codex-memory",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.9",
|
|
4
4
|
"description": "Persistent memory plugin for opencode — ports codex's two-phase memory system (extraction → consolidation → injection → citation feedback)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/src/index.js",
|