@amoree-code/ocean 2.4.0 → 2.6.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.
- package/dist/interfaces/cli/help-command.js +1 -1
- package/dist/interfaces/cli/memory-command.js +45 -2
- package/node_modules/@ocean/brain/dist/memory/memory-audit.js +38 -0
- package/node_modules/@ocean/brain/package.json +1 -1
- package/node_modules/@ocean/context/dist/context/resource-injection.js +5 -1
- package/node_modules/@ocean/context/package.json +1 -1
- package/node_modules/@ocean/core/dist/domain/mcp/memory-contract.js +2 -1
- package/node_modules/@ocean/core/dist/shared/context-ack.js +51 -0
- package/node_modules/@ocean/core/package.json +1 -1
- package/node_modules/@ocean/loop/dist/hooks/session-start-hook.js +5 -1
- package/node_modules/@ocean/loop/package.json +1 -1
- package/node_modules/@ocean/market/package.json +1 -1
- package/node_modules/@ocean/services/dist/infrastructure/mcp/ocean-server.js +38 -4
- package/node_modules/@ocean/services/package.json +1 -1
- package/ocean-marketplace.json +34 -34
- package/package.json +7 -7
|
@@ -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,3 +1,4 @@
|
|
|
1
|
+
import { contextAck } from "@ocean/core/shared/context-ack.js";
|
|
1
2
|
import { oceanEnvPair } from "@ocean/core/shared/paths.js";
|
|
2
3
|
// This module used to read Ocean files (memory, knowledge, inbox, README, governance rules)
|
|
3
4
|
// and inject their full content into every provider launch. That bulk injection is removed
|
|
@@ -15,13 +16,16 @@ function projectTag(project) {
|
|
|
15
16
|
// absence), and names the on-demand operations a client can call. Never Ocean file content.
|
|
16
17
|
export function buildOceanBootstrap(project, extra = {}) {
|
|
17
18
|
const rules = extra.rules && extra.rules > 0 ? ` rules=${extra.rules}` : "";
|
|
18
|
-
const
|
|
19
|
+
const line = `ocean=1 project=${projectTag(project)} confidence=${project.confidence}${rules} ops=${SUPPORTED_OPERATIONS}`;
|
|
20
|
+
const ack = contextAck(line);
|
|
21
|
+
const content = `${line} ack=${ack}`;
|
|
19
22
|
const bytes = Buffer.byteLength(content, "utf8");
|
|
20
23
|
if (bytes > OCEAN_BOOTSTRAP_MAX_BYTES) {
|
|
21
24
|
throw new Error(`Ocean bootstrap exceeds the ${OCEAN_BOOTSTRAP_MAX_BYTES}-byte budget (${bytes} bytes): ${content}`);
|
|
22
25
|
}
|
|
23
26
|
return {
|
|
24
27
|
content,
|
|
28
|
+
ack,
|
|
25
29
|
manifest: { bytes, source: "ocean", transport: "bootstrap-env" },
|
|
26
30
|
};
|
|
27
31
|
}
|
|
@@ -12,7 +12,8 @@ export const MEMORY_INSTRUCTIONS = [
|
|
|
12
12
|
"Facts you infer yourself, and anything imported from another tool's memory, go to memory_propose for the user's review, never to memory_write.",
|
|
13
13
|
"Never store secrets, credentials or temporary state. If a new fact contradicts a record, tell the user instead of overwriting it.",
|
|
14
14
|
"memory_delete is a soft delete; memory_history and memory_restore undo changes.",
|
|
15
|
-
|
|
15
|
+
// The handoff rule lives in ocean_handoff_create's own description; the ack line is T-319.
|
|
16
|
+
"Without a session-start hook, call ocean_context once. Pass the start line's ack=<hash> as contextAck on your first Ocean call.",
|
|
16
17
|
].join(" ");
|
|
17
18
|
export const MEMORY_ERROR_CODES = [
|
|
18
19
|
"EXISTS",
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { withFileLock } from "./fs-utils.js";
|
|
5
|
+
import { oceanPath, SYSTEM_DIR } from "./paths.js";
|
|
6
|
+
// CONTEXT-ACK (T-319, borrowed from forge): the Ocean start line carries a short hash of itself,
|
|
7
|
+
// and a client echoes it as `contextAck` on its first Ocean tool call. An echo of a hash Ocean
|
|
8
|
+
// actually handed out is the recorded answer to "did this client load Ocean?". The issued file
|
|
9
|
+
// holds only hashes and when each was last handed out — never the line itself.
|
|
10
|
+
const ISSUED_RETENTION_DAYS = 30;
|
|
11
|
+
const DAY_MS = 86_400_000;
|
|
12
|
+
const ACK = /^[0-9a-f]{8}$/;
|
|
13
|
+
export function contextAck(content) {
|
|
14
|
+
return createHash("sha256").update(content).digest("hex").slice(0, 8);
|
|
15
|
+
}
|
|
16
|
+
export function contextAckFile() {
|
|
17
|
+
return oceanPath(SYSTEM_DIR, "state", "mcp", "context-acks.json");
|
|
18
|
+
}
|
|
19
|
+
async function readIssued() {
|
|
20
|
+
try {
|
|
21
|
+
const value = JSON.parse(await readFile(contextAckFile(), "utf8"));
|
|
22
|
+
return value && typeof value === "object" && !Array.isArray(value)
|
|
23
|
+
? value
|
|
24
|
+
: {};
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return {};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
// Never throws: a start line is delivered whether or not its hash could be noted.
|
|
31
|
+
export async function recordIssuedAck(ack, now = new Date()) {
|
|
32
|
+
if (!ACK.test(ack))
|
|
33
|
+
return;
|
|
34
|
+
const file = contextAckFile();
|
|
35
|
+
try {
|
|
36
|
+
await mkdir(path.dirname(file), { recursive: true, mode: 0o700 });
|
|
37
|
+
await withFileLock(file, async () => {
|
|
38
|
+
const cutoff = now.getTime() - ISSUED_RETENTION_DAYS * DAY_MS;
|
|
39
|
+
const issued = Object.fromEntries(Object.entries(await readIssued()).filter(([hash, ts]) => ACK.test(hash) && Date.parse(ts) >= cutoff));
|
|
40
|
+
issued[ack] = now.toISOString();
|
|
41
|
+
await writeFile(file, `${JSON.stringify(issued)}\n`, { mode: 0o600 });
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
// Best effort only.
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export async function ackIssued(ack) {
|
|
49
|
+
return (typeof ack === "string" && ACK.test(ack) && ack in (await readIssued()));
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=context-ack.js.map
|
|
@@ -2,6 +2,7 @@ import { readFile, realpath } from "node:fs/promises";
|
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { buildOceanBootstrap } from "@ocean/context/context/resource-injection.js";
|
|
5
|
+
import { recordIssuedAck } from "@ocean/core/shared/context-ack.js";
|
|
5
6
|
import { truncateUtf8 } from "@ocean/core/shared/fs-utils.js";
|
|
6
7
|
import { oceanRoot, SYSTEM_DIR } from "@ocean/core/shared/paths.js";
|
|
7
8
|
import { autoRegisterProject, gitChangedFiles, projectRules, readProjectManifest, resolveProject, scanProjectManifests, } from "@ocean/core/shared/project-resolution.js";
|
|
@@ -122,6 +123,7 @@ export async function claudeSessionStartHook(payload) {
|
|
|
122
123
|
rulesProblem = error instanceof Error ? error.message : String(error);
|
|
123
124
|
}
|
|
124
125
|
const bootstrap = buildOceanBootstrap(project, { rules: rules.length });
|
|
126
|
+
await recordIssuedAck(bootstrap.ack);
|
|
125
127
|
const parts = [bootstrap.content];
|
|
126
128
|
if (project.status === "bound" && rules.length)
|
|
127
129
|
parts.push(projectRulesBlock(project.projectId, rules));
|
|
@@ -151,7 +153,9 @@ export async function oceanContext(cwd) {
|
|
|
151
153
|
gitRoot: null,
|
|
152
154
|
confidence: "none",
|
|
153
155
|
}));
|
|
154
|
-
|
|
156
|
+
const bootstrap = buildOceanBootstrap(project);
|
|
157
|
+
await recordIssuedAck(bootstrap.ack);
|
|
158
|
+
return bootstrap.content;
|
|
155
159
|
}
|
|
156
160
|
// Clients that take the bootstrap through their own hooks instead of a same-name shim (T-266).
|
|
157
161
|
// Codex and Gemini CLI (0.58: fireSessionStartEvent → getAdditionalContext, T-296) read Claude
|
|
@@ -11,6 +11,7 @@ import { isValidProjectId } from "@ocean/core/domain/context/project-id.js";
|
|
|
11
11
|
import { actionFingerprint, mcpApprovalSchema, } from "@ocean/core/domain/mcp/mcp-contract.js";
|
|
12
12
|
import { MEMORY_CONTRACT_VERSION, MEMORY_INSTRUCTIONS, MemoryContractError, } from "@ocean/core/domain/mcp/memory-contract.js";
|
|
13
13
|
import { redactSecrets } from "@ocean/core/domain/redaction/redaction.js";
|
|
14
|
+
import { ackIssued } from "@ocean/core/shared/context-ack.js";
|
|
14
15
|
import { oceanPath, oceanRoot, SYSTEM_DIR } from "@ocean/core/shared/paths.js";
|
|
15
16
|
import { findProject, folderProject, scanProjectManifests, } from "@ocean/core/shared/project-resolution.js";
|
|
16
17
|
import { createHandoff, getHandoff, getTask, listHandoffs, } from "@ocean/loop/handoff/handoff-service.js";
|
|
@@ -21,7 +22,27 @@ import { hasFailures, workspaceReport } from "../../doctor/workspace-doctor.js";
|
|
|
21
22
|
import { recordMcpCall } from "./call-ledger.js";
|
|
22
23
|
import { installedVersion, serverVersion } from "./server-version.js";
|
|
23
24
|
import { McpToolRegistry } from "./tool-registry.js";
|
|
24
|
-
|
|
25
|
+
// Every tool takes an optional contextAck: the ack=<hash> from the Ocean start line, echoed on a
|
|
26
|
+
// client's first Ocean call (T-319 CONTEXT-ACK). The server takes it off before the tool runs.
|
|
27
|
+
function withContextAck(list) {
|
|
28
|
+
return list.map((tool) => {
|
|
29
|
+
const schema = tool.inputSchema;
|
|
30
|
+
return {
|
|
31
|
+
...tool,
|
|
32
|
+
inputSchema: {
|
|
33
|
+
...schema,
|
|
34
|
+
properties: {
|
|
35
|
+
...schema?.properties,
|
|
36
|
+
contextAck: {
|
|
37
|
+
type: "string",
|
|
38
|
+
description: "The ack=<hash> value from the Ocean start line; pass it on your first Ocean call.",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
const tools = new McpToolRegistry(withContextAck([
|
|
25
46
|
{
|
|
26
47
|
name: "ocean_status",
|
|
27
48
|
description: "Return the Ocean runtime and workspace status.",
|
|
@@ -309,7 +330,10 @@ const tools = new McpToolRegistry([
|
|
|
309
330
|
annotations: { readOnlyHint: false, destructiveHint: true },
|
|
310
331
|
inputSchema: {
|
|
311
332
|
type: "object",
|
|
312
|
-
properties: {
|
|
333
|
+
properties: {
|
|
334
|
+
id: { type: "string" },
|
|
335
|
+
expectedHash: { type: "string" },
|
|
336
|
+
},
|
|
313
337
|
required: ["id"],
|
|
314
338
|
additionalProperties: false,
|
|
315
339
|
},
|
|
@@ -362,7 +386,7 @@ const tools = new McpToolRegistry([
|
|
|
362
386
|
additionalProperties: false,
|
|
363
387
|
},
|
|
364
388
|
},
|
|
365
|
-
]);
|
|
389
|
+
]));
|
|
366
390
|
// What one MCP handoff may hold, summed over its texts (T-307).
|
|
367
391
|
export const HANDOFF_MAX_BYTES = 4096;
|
|
368
392
|
const resources = [
|
|
@@ -435,6 +459,10 @@ const MUTATING_TOOLS = new Set([
|
|
|
435
459
|
// The connected client's name from `initialize` (one stdio server per client), recorded as the
|
|
436
460
|
// source of every memory change it makes.
|
|
437
461
|
let clientName = "unknown";
|
|
462
|
+
// Whether this connection's first tool call (ocean_context aside) has been checked for the
|
|
463
|
+
// start line's hash: one `context_ack` ledger line per connection, ok when it echoed a hash
|
|
464
|
+
// Ocean handed out.
|
|
465
|
+
let contextAckChecked = false;
|
|
438
466
|
async function callTool(name, args, ports) {
|
|
439
467
|
if (name === "ocean_status") {
|
|
440
468
|
const version = await serverVersion();
|
|
@@ -783,6 +811,7 @@ export async function handleOceanMcpRequest(request, ports) {
|
|
|
783
811
|
const info = request.params?.clientInfo;
|
|
784
812
|
if (typeof info?.name === "string" && /^[\w .@/-]{1,64}$/.test(info.name))
|
|
785
813
|
clientName = info.name;
|
|
814
|
+
contextAckChecked = false;
|
|
786
815
|
return {
|
|
787
816
|
jsonrpc: "2.0",
|
|
788
817
|
id: request.id,
|
|
@@ -857,9 +886,14 @@ export async function handleOceanMcpRequest(request, ports) {
|
|
|
857
886
|
error: { code: -32602, message: "Unknown MCP tool" },
|
|
858
887
|
};
|
|
859
888
|
}
|
|
889
|
+
const { contextAck, ...args } = (request.params?.arguments ?? {});
|
|
890
|
+
if (!contextAckChecked && name !== "ocean_context") {
|
|
891
|
+
contextAckChecked = true;
|
|
892
|
+
await recordMcpCall(clientName, "context_ack", await ackIssued(contextAck));
|
|
893
|
+
}
|
|
860
894
|
await ports.mcpSessions?.open(clientName);
|
|
861
895
|
try {
|
|
862
|
-
const result = textResult(await callTool(name,
|
|
896
|
+
const result = textResult(await callTool(name, args, ports));
|
|
863
897
|
await recordMcpCall(clientName, name, true);
|
|
864
898
|
await ports.mcpSessions?.toolCall(clientName, name, true);
|
|
865
899
|
return { jsonrpc: "2.0", id: request.id, result };
|
package/ocean-marketplace.json
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
{
|
|
6
6
|
"kind": "skill",
|
|
7
7
|
"name": "dev.ocean.skills.business-logic",
|
|
8
|
-
"version": "2.
|
|
8
|
+
"version": "2.6.0",
|
|
9
9
|
"engines": {
|
|
10
|
-
"ocean": ">=2.
|
|
10
|
+
"ocean": ">=2.6.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.
|
|
26
|
+
"version": "2.6.0",
|
|
27
27
|
"engines": {
|
|
28
|
-
"ocean": ">=2.
|
|
28
|
+
"ocean": ">=2.6.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.
|
|
44
|
+
"version": "2.6.0",
|
|
45
45
|
"engines": {
|
|
46
|
-
"ocean": ">=2.
|
|
46
|
+
"ocean": ">=2.6.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.
|
|
62
|
+
"version": "2.6.0",
|
|
63
63
|
"engines": {
|
|
64
|
-
"ocean": ">=2.
|
|
64
|
+
"ocean": ">=2.6.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.
|
|
80
|
+
"version": "2.6.0",
|
|
81
81
|
"engines": {
|
|
82
|
-
"ocean": ">=2.
|
|
82
|
+
"ocean": ">=2.6.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.
|
|
98
|
+
"version": "2.6.0",
|
|
99
99
|
"engines": {
|
|
100
|
-
"ocean": ">=2.
|
|
100
|
+
"ocean": ">=2.6.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.
|
|
116
|
+
"version": "2.6.0",
|
|
117
117
|
"engines": {
|
|
118
|
-
"ocean": ">=2.
|
|
118
|
+
"ocean": ">=2.6.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.
|
|
134
|
+
"version": "2.6.0",
|
|
135
135
|
"engines": {
|
|
136
|
-
"ocean": ">=2.
|
|
136
|
+
"ocean": ">=2.6.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.
|
|
152
|
+
"version": "2.6.0",
|
|
153
153
|
"engines": {
|
|
154
|
-
"ocean": ">=2.
|
|
154
|
+
"ocean": ">=2.6.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.
|
|
170
|
+
"version": "2.6.0",
|
|
171
171
|
"engines": {
|
|
172
|
-
"ocean": ">=2.
|
|
172
|
+
"ocean": ">=2.6.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.
|
|
188
|
+
"version": "2.6.0",
|
|
189
189
|
"engines": {
|
|
190
|
-
"ocean": ">=2.
|
|
190
|
+
"ocean": ">=2.6.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.
|
|
206
|
+
"version": "2.6.0",
|
|
207
207
|
"engines": {
|
|
208
|
-
"ocean": ">=2.
|
|
208
|
+
"ocean": ">=2.6.0"
|
|
209
209
|
},
|
|
210
210
|
"source": {
|
|
211
211
|
"type": "path",
|
|
@@ -247,9 +247,9 @@
|
|
|
247
247
|
"npx"
|
|
248
248
|
]
|
|
249
249
|
},
|
|
250
|
-
"version": "2.
|
|
250
|
+
"version": "2.6.0",
|
|
251
251
|
"engines": {
|
|
252
|
-
"ocean": ">=2.
|
|
252
|
+
"ocean": ">=2.6.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.
|
|
302
|
+
"version": "2.6.0",
|
|
303
303
|
"engines": {
|
|
304
|
-
"ocean": ">=2.
|
|
304
|
+
"ocean": ">=2.6.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.
|
|
346
|
+
"version": "2.6.0",
|
|
347
347
|
"engines": {
|
|
348
|
-
"ocean": ">=2.
|
|
348
|
+
"ocean": ">=2.6.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.
|
|
390
|
+
"version": "2.6.0",
|
|
391
391
|
"engines": {
|
|
392
|
-
"ocean": ">=2.
|
|
392
|
+
"ocean": ">=2.6.0"
|
|
393
393
|
},
|
|
394
394
|
"source": {
|
|
395
395
|
"type": "path",
|
|
@@ -441,9 +441,9 @@
|
|
|
441
441
|
"npx"
|
|
442
442
|
]
|
|
443
443
|
},
|
|
444
|
-
"version": "2.
|
|
444
|
+
"version": "2.6.0",
|
|
445
445
|
"engines": {
|
|
446
|
-
"ocean": ">=2.
|
|
446
|
+
"ocean": ">=2.6.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
|
+
"version": "2.6.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.
|
|
57
|
-
"@ocean/context": "2.
|
|
58
|
-
"@ocean/core": "2.
|
|
59
|
-
"@ocean/loop": "2.
|
|
60
|
-
"@ocean/market": "2.
|
|
61
|
-
"@ocean/services": "2.
|
|
56
|
+
"@ocean/brain": "2.6.0",
|
|
57
|
+
"@ocean/context": "2.6.0",
|
|
58
|
+
"@ocean/core": "2.6.0",
|
|
59
|
+
"@ocean/loop": "2.6.0",
|
|
60
|
+
"@ocean/market": "2.6.0",
|
|
61
|
+
"@ocean/services": "2.6.0",
|
|
62
62
|
"playwright-core": "^1.48.0",
|
|
63
63
|
"sqlite-vec": "0.1.9",
|
|
64
64
|
"zod": "^4.6.5"
|