@amoree-code/ocean 2.4.0 → 2.5.0

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.
@@ -138,7 +138,7 @@ export const commandHelp = {
138
138
  ],
139
139
  memory: [
140
140
  "Search, read, review and maintain memory records and the brain index.",
141
- "ocean memory doctor|sync [--apply]|review [list|approve <id> [--to <path>]|reject <id>]|eval <questions.json> [--k N] [--min R]|digest|harvest [--source <id>] [--yes]|import-claude <export-dir> [--yes]|history [path] [--limit N]|restore <id> [--hash <sha256>]|delete <path> --hash <sha256>|purge [--days N] [--yes]|facts <profile> [key] [value]|facts <profile> delete <key>|reindex [--no-vectors]|search <q> [--project <id>|--all] [--json]|read <id|path>|neighbors <id|path> [--depth N] [--project <id>|--all]",
141
+ "ocean memory doctor|sync [--apply]|review [list|approve <id> [--to <path>]|reject <id>]|eval <questions.json> [--k N] [--min R]|digest|harvest [--source <id>] [--yes]|import-claude <export-dir> [--yes]|history [path] [--limit N]|audit [--client <name>] [--days N] [--limit N] [--json]|restore <id> [--hash <sha256>]|delete <path> --hash <sha256>|purge [--days N] [--yes]|facts <profile> [key] [value]|facts <profile> delete <key>|reindex [--no-vectors]|search <q> [--project <id>|--all] [--json]|read <id|path>|neighbors <id|path> [--depth N] [--project <id>|--all]",
142
142
  ],
143
143
  pull: [
144
144
  "Pull what AI clients hold into Ocean as review candidates; a dry run until --yes.",
@@ -6,7 +6,7 @@ import { migrateBrainDumps } from "@ocean/brain/memory/brain-dump.js";
6
6
  import { flattenWorkspace } from "@ocean/brain/memory/frontmatter-flatten.js";
7
7
  import { doctorMemoryIndexes, syncMemoryIndexes, } from "@ocean/brain/memory/index-sync.js";
8
8
  import { archiveRetiredLessons } from "@ocean/brain/memory/lessons.js";
9
- import { memorySettings, sessionFactsEnabled, setSessionFacts, } from "@ocean/brain/memory/memory-audit.js";
9
+ import { auditSummary, memorySettings, sessionFactsEnabled, setSessionFacts, } from "@ocean/brain/memory/memory-audit.js";
10
10
  import { memoryDigest } from "@ocean/brain/memory/memory-digest.js";
11
11
  import { HARVEST_SOURCES, harvestMemory, importClaudeExport, } from "@ocean/brain/memory/memory-harvest.js";
12
12
  import { approveCandidate, listCandidates, rejectCandidate, } from "@ocean/brain/memory/memory-review.js";
@@ -190,6 +190,47 @@ async function runRecordCommand(action, args) {
190
190
  }
191
191
  console.log(JSON.stringify(result, null, 2));
192
192
  }
193
+ // Who wrote, changed or deleted what (T-319), from the memory audit log.
194
+ async function runAudit(args) {
195
+ const usage = "Usage: ocean memory audit [--client <name>] [--days N] [--limit N] [--json]";
196
+ const number = (flag) => {
197
+ const value = flagValue(args, flag);
198
+ if (value === undefined)
199
+ return undefined;
200
+ const parsed = Number(value);
201
+ if (!Number.isInteger(parsed) || parsed < 0)
202
+ throw new Error(usage);
203
+ return parsed;
204
+ };
205
+ const client = flagValue(args, "--client");
206
+ if (args.includes("--client") && (!client || client.startsWith("--")))
207
+ throw new Error(usage);
208
+ const summary = await auditSummary({
209
+ client,
210
+ days: number("--days"),
211
+ limit: number("--limit"),
212
+ });
213
+ if (args.includes("--json")) {
214
+ console.log(JSON.stringify(summary, null, 2));
215
+ return;
216
+ }
217
+ const window = summary.since
218
+ ? `since ${summary.since.slice(0, 16).replace("T", " ")}`
219
+ : "all time";
220
+ console.log(`Memory changes, ${window}${client ? `, client ${client}` : ""}: ${summary.total} (${summary.unknown} unknown)`);
221
+ const width = Math.max(6, ...summary.clients.map((row) => row.client.length));
222
+ for (const row of summary.clients) {
223
+ const actions = Object.entries(row.actions)
224
+ .sort(([a], [b]) => a.localeCompare(b))
225
+ .map(([action, count]) => `${action} ${count}`)
226
+ .join(" ");
227
+ console.log(` ${row.client.padEnd(width)} ${String(row.total).padStart(4)} ${actions}`);
228
+ }
229
+ if (summary.entries.length)
230
+ console.log("\nLatest:");
231
+ for (const entry of summary.entries)
232
+ console.log(` ${entry.ts.slice(0, 16).replace("T", " ")} ${entry.action.padEnd(7)} ${entry.source}${entry.session ? ` (session ${entry.session})` : ""} ${entry.path}`);
233
+ }
193
234
  // Candidate review (T-296 P5): list, approve into a record, or reject. Edit = edit the candidate
194
235
  // file, then approve it.
195
236
  async function runReview(args) {
@@ -260,6 +301,8 @@ export async function runMemoryCommand(action, args) {
260
301
  action === "delete" ||
261
302
  action === "purge")
262
303
  return runRecordCommand(action, args);
304
+ if (action === "audit")
305
+ return runAudit(args);
263
306
  if (action === "reindex")
264
307
  return runReindex(args);
265
308
  if (action === "review")
@@ -363,7 +406,7 @@ export async function runMemoryCommand(action, args) {
363
406
  console.log(JSON.stringify({ dryRun: !args.includes("--apply"), stores: result }, null, 2));
364
407
  return;
365
408
  }
366
- console.error("Usage: ocean memory doctor|sync [--apply]|review [list|approve <id> [--to <path>]|reject <id>]|eval <questions.json> [--k N] [--min R]|digest|harvest [--source <id>] [--yes]|import-claude <export-dir> [--yes]|history [path] [--limit N]|restore <id> [--hash <sha256>]|delete <path> --hash <sha256>|purge [--days N] [--yes]|facts <profile> [key] [value]|facts <profile> delete <key>|session-facts [on|off]|reindex [--no-vectors]|search <q> [--project <id>|--all] [--json]|read <id|path>|neighbors <id|path> [--depth N] [--project <id>|--all]");
409
+ console.error("Usage: ocean memory doctor|sync [--apply]|review [list|approve <id> [--to <path>]|reject <id>]|eval <questions.json> [--k N] [--min R]|digest|harvest [--source <id>] [--yes]|import-claude <export-dir> [--yes]|history [path] [--limit N]|audit [--client <name>] [--days N] [--limit N] [--json]|restore <id> [--hash <sha256>]|delete <path> --hash <sha256>|purge [--days N] [--yes]|facts <profile> [key] [value]|facts <profile> delete <key>|session-facts [on|off]|reindex [--no-vectors]|search <q> [--project <id>|--all] [--json]|read <id|path>|neighbors <id|path> [--depth N] [--project <id>|--all]");
367
410
  process.exitCode = 1;
368
411
  }
369
412
  //# sourceMappingURL=memory-command.js.map
@@ -35,9 +35,18 @@ export async function writeDurable(file, content) {
35
35
  await handle.close();
36
36
  }
37
37
  }
38
+ // The session this process runs in: OCEAN_SESSION_ID (any client, or Ocean itself), else the
39
+ // id Claude Code gives its tools and MCP servers, which is also Ocean's id for that session.
40
+ // Anything that is not a plain id is ignored rather than written to the log.
41
+ export function currentSession(env = process.env) {
42
+ const id = oceanEnv("SESSION_ID", env) || env.CLAUDE_CODE_SESSION_ID;
43
+ return id && /^[\w.:-]{1,128}$/.test(id) ? id : undefined;
44
+ }
38
45
  export async function appendAudit(entry) {
46
+ const session = entry.session ?? currentSession();
39
47
  const full = {
40
48
  ...entry,
49
+ ...(session ? { session } : {}),
41
50
  id: entry.id ?? newId(),
42
51
  ts: new Date().toISOString(),
43
52
  };
@@ -61,6 +70,35 @@ export async function readAudit() {
61
70
  .filter(Boolean)
62
71
  .map((line) => JSON.parse(line));
63
72
  }
73
+ export function auditClient(entry) {
74
+ return entry.source.split(":")[0] || "unknown";
75
+ }
76
+ export async function auditSummary(options = {}) {
77
+ const now = options.now ?? new Date();
78
+ const since = options.days === undefined
79
+ ? null
80
+ : new Date(now.getTime() - options.days * 86_400_000);
81
+ const entries = (await readAudit()).filter((entry) => (!since || new Date(entry.ts) >= since) &&
82
+ (!options.client ||
83
+ auditClient(entry) === options.client ||
84
+ entry.source === options.client));
85
+ const clients = new Map();
86
+ for (const entry of entries) {
87
+ const name = auditClient(entry);
88
+ const row = clients.get(name) ?? { client: name, total: 0, actions: {} };
89
+ row.total += 1;
90
+ row.actions[entry.action] = (row.actions[entry.action] ?? 0) + 1;
91
+ clients.set(name, row);
92
+ }
93
+ const limit = Math.max(0, options.limit ?? 20);
94
+ return {
95
+ since: since?.toISOString() ?? null,
96
+ total: entries.length,
97
+ unknown: entries.filter((entry) => auditClient(entry) === "unknown").length,
98
+ clients: [...clients.values()].sort((a, b) => b.total - a.total || a.client.localeCompare(b.client)),
99
+ entries: limit ? entries.slice(-limit).reverse() : [],
100
+ };
101
+ }
64
102
  // bridge/config/memory.json — optional; without it MCP writes are on, copies are kept 90 days and
65
103
  // pulled memory waits for review.
66
104
  export async function memorySettings() {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ocean/brain",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ocean/context",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ocean/core",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ocean/loop",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ocean/market",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ocean/services",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -5,9 +5,9 @@
5
5
  {
6
6
  "kind": "skill",
7
7
  "name": "dev.ocean.skills.business-logic",
8
- "version": "2.4.0",
8
+ "version": "2.5.0",
9
9
  "engines": {
10
- "ocean": ">=2.4.0"
10
+ "ocean": ">=2.5.0"
11
11
  },
12
12
  "source": {
13
13
  "type": "path",
@@ -23,9 +23,9 @@
23
23
  {
24
24
  "kind": "skill",
25
25
  "name": "dev.ocean.skills.catch-up",
26
- "version": "2.4.0",
26
+ "version": "2.5.0",
27
27
  "engines": {
28
- "ocean": ">=2.4.0"
28
+ "ocean": ">=2.5.0"
29
29
  },
30
30
  "source": {
31
31
  "type": "path",
@@ -41,9 +41,9 @@
41
41
  {
42
42
  "kind": "skill",
43
43
  "name": "dev.ocean.skills.core-thinking",
44
- "version": "2.4.0",
44
+ "version": "2.5.0",
45
45
  "engines": {
46
- "ocean": ">=2.4.0"
46
+ "ocean": ">=2.5.0"
47
47
  },
48
48
  "source": {
49
49
  "type": "path",
@@ -59,9 +59,9 @@
59
59
  {
60
60
  "kind": "skill",
61
61
  "name": "dev.ocean.skills.daily-harvest",
62
- "version": "2.4.0",
62
+ "version": "2.5.0",
63
63
  "engines": {
64
- "ocean": ">=2.4.0"
64
+ "ocean": ">=2.5.0"
65
65
  },
66
66
  "source": {
67
67
  "type": "path",
@@ -77,9 +77,9 @@
77
77
  {
78
78
  "kind": "skill",
79
79
  "name": "dev.ocean.skills.design-thinking",
80
- "version": "2.4.0",
80
+ "version": "2.5.0",
81
81
  "engines": {
82
- "ocean": ">=2.4.0"
82
+ "ocean": ">=2.5.0"
83
83
  },
84
84
  "source": {
85
85
  "type": "path",
@@ -95,9 +95,9 @@
95
95
  {
96
96
  "kind": "skill",
97
97
  "name": "dev.ocean.skills.graft",
98
- "version": "2.4.0",
98
+ "version": "2.5.0",
99
99
  "engines": {
100
- "ocean": ">=2.4.0"
100
+ "ocean": ">=2.5.0"
101
101
  },
102
102
  "source": {
103
103
  "type": "path",
@@ -113,9 +113,9 @@
113
113
  {
114
114
  "kind": "skill",
115
115
  "name": "dev.ocean.skills.loop",
116
- "version": "2.4.0",
116
+ "version": "2.5.0",
117
117
  "engines": {
118
- "ocean": ">=2.4.0"
118
+ "ocean": ">=2.5.0"
119
119
  },
120
120
  "source": {
121
121
  "type": "path",
@@ -131,9 +131,9 @@
131
131
  {
132
132
  "kind": "skill",
133
133
  "name": "dev.ocean.skills.memory-review",
134
- "version": "2.4.0",
134
+ "version": "2.5.0",
135
135
  "engines": {
136
- "ocean": ">=2.4.0"
136
+ "ocean": ">=2.5.0"
137
137
  },
138
138
  "source": {
139
139
  "type": "path",
@@ -149,9 +149,9 @@
149
149
  {
150
150
  "kind": "skill",
151
151
  "name": "dev.ocean.skills.session-handoff",
152
- "version": "2.4.0",
152
+ "version": "2.5.0",
153
153
  "engines": {
154
- "ocean": ">=2.4.0"
154
+ "ocean": ">=2.5.0"
155
155
  },
156
156
  "source": {
157
157
  "type": "path",
@@ -167,9 +167,9 @@
167
167
  {
168
168
  "kind": "skill",
169
169
  "name": "dev.ocean.skills.use-browser",
170
- "version": "2.4.0",
170
+ "version": "2.5.0",
171
171
  "engines": {
172
- "ocean": ">=2.4.0"
172
+ "ocean": ">=2.5.0"
173
173
  },
174
174
  "source": {
175
175
  "type": "path",
@@ -185,9 +185,9 @@
185
185
  {
186
186
  "kind": "skill",
187
187
  "name": "dev.ocean.skills.verification",
188
- "version": "2.4.0",
188
+ "version": "2.5.0",
189
189
  "engines": {
190
- "ocean": ">=2.4.0"
190
+ "ocean": ">=2.5.0"
191
191
  },
192
192
  "source": {
193
193
  "type": "path",
@@ -203,9 +203,9 @@
203
203
  {
204
204
  "kind": "skill",
205
205
  "name": "dev.ocean.skills.weekly-review",
206
- "version": "2.4.0",
206
+ "version": "2.5.0",
207
207
  "engines": {
208
- "ocean": ">=2.4.0"
208
+ "ocean": ">=2.5.0"
209
209
  },
210
210
  "source": {
211
211
  "type": "path",
@@ -247,9 +247,9 @@
247
247
  "npx"
248
248
  ]
249
249
  },
250
- "version": "2.4.0",
250
+ "version": "2.5.0",
251
251
  "engines": {
252
- "ocean": ">=2.4.0"
252
+ "ocean": ">=2.5.0"
253
253
  },
254
254
  "source": {
255
255
  "type": "path",
@@ -299,9 +299,9 @@
299
299
  "kind": "mcp",
300
300
  "name": "dev.ocean/mcp-gateway",
301
301
  "description": "One MCP endpoint for every registered server: Ocean's own and those installed from the marketplace.",
302
- "version": "2.4.0",
302
+ "version": "2.5.0",
303
303
  "engines": {
304
- "ocean": ">=2.4.0"
304
+ "ocean": ">=2.5.0"
305
305
  },
306
306
  "source": {
307
307
  "type": "path",
@@ -343,9 +343,9 @@
343
343
  "kind": "mcp",
344
344
  "name": "dev.ocean/obsidian",
345
345
  "description": "Ocean's Obsidian vault bridge over MCP.",
346
- "version": "2.4.0",
346
+ "version": "2.5.0",
347
347
  "engines": {
348
- "ocean": ">=2.4.0"
348
+ "ocean": ">=2.5.0"
349
349
  },
350
350
  "source": {
351
351
  "type": "path",
@@ -387,9 +387,9 @@
387
387
  "kind": "mcp",
388
388
  "name": "dev.ocean/ocean",
389
389
  "description": "Ocean's own MCP server: workspace status, tasks, handoffs, sessions and the brain.",
390
- "version": "2.4.0",
390
+ "version": "2.5.0",
391
391
  "engines": {
392
- "ocean": ">=2.4.0"
392
+ "ocean": ">=2.5.0"
393
393
  },
394
394
  "source": {
395
395
  "type": "path",
@@ -441,9 +441,9 @@
441
441
  "npx"
442
442
  ]
443
443
  },
444
- "version": "2.4.0",
444
+ "version": "2.5.0",
445
445
  "engines": {
446
- "ocean": ">=2.4.0"
446
+ "ocean": ">=2.5.0"
447
447
  },
448
448
  "source": {
449
449
  "type": "path",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@amoree-code/ocean",
3
3
  "description": "Local-first memory, tasks and session capture shared by every AI coding client: one private workspace for Claude, Codex, Gemini and more.",
4
- "version": "2.4.0",
4
+ "version": "2.5.0",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "author": "AMEER ABDULKAREEM JABBAR LAMI",
@@ -53,12 +53,12 @@
53
53
  "@langchain/core": "1.2.14",
54
54
  "@langchain/langgraph": "1.4.19",
55
55
  "@modelcontextprotocol/sdk": "1.32.0",
56
- "@ocean/brain": "2.4.0",
57
- "@ocean/context": "2.4.0",
58
- "@ocean/core": "2.4.0",
59
- "@ocean/loop": "2.4.0",
60
- "@ocean/market": "2.4.0",
61
- "@ocean/services": "2.4.0",
56
+ "@ocean/brain": "2.5.0",
57
+ "@ocean/context": "2.5.0",
58
+ "@ocean/core": "2.5.0",
59
+ "@ocean/loop": "2.5.0",
60
+ "@ocean/market": "2.5.0",
61
+ "@ocean/services": "2.5.0",
62
62
  "playwright-core": "^1.48.0",
63
63
  "sqlite-vec": "0.1.9",
64
64
  "zod": "^4.6.5"