@amoree-code/ocean 2.3.0 → 2.4.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/application/clients/registry.js +5 -0
- package/dist/interfaces/cli/command-registry.js +9 -0
- package/node_modules/@ocean/brain/package.json +1 -1
- package/node_modules/@ocean/context/package.json +1 -1
- package/node_modules/@ocean/core/package.json +1 -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/mcp-session.js +66 -0
- package/node_modules/@ocean/services/dist/infrastructure/mcp/ocean-server.js +14 -2
- package/node_modules/@ocean/services/package.json +1 -1
- package/ocean-marketplace.json +34 -34
- package/package.json +7 -7
|
@@ -196,6 +196,11 @@ export const CLIENT_ADAPTERS = [
|
|
|
196
196
|
fallback: "use Ocean from a supported client or the `ocean` CLI",
|
|
197
197
|
},
|
|
198
198
|
];
|
|
199
|
+
// Clients whose only trace in Ocean is their MCP connection: no CLI to intercept and no session
|
|
200
|
+
// hook. The MCP server records a light session per connection for these (T-319).
|
|
201
|
+
export const MCP_ONLY_CLIENTS = new Set([
|
|
202
|
+
"claude-desktop",
|
|
203
|
+
]);
|
|
199
204
|
// Which client, and which of its modes, a call-ledger name belongs to; undefined when unknown.
|
|
200
205
|
export function mcpClientOf(name) {
|
|
201
206
|
for (const adapter of CLIENT_ADAPTERS) {
|
|
@@ -19,6 +19,7 @@ import { GATEWAY_CAPABILITY } from "@ocean/market/mcp/mcp-gateway.js";
|
|
|
19
19
|
import { coreSkillReports, syncCoreSkills, } from "@ocean/market/skills/core-skill-sync.js";
|
|
20
20
|
import { copyClientSkills, linkClientSkills, populateSkillHub, } from "@ocean/market/skills/skill-hub.js";
|
|
21
21
|
import { hasFailures, repairWorkspace, workspaceReport, } from "@ocean/services/doctor/workspace-doctor.js";
|
|
22
|
+
import { createMcpSessionRecorder } from "@ocean/services/infrastructure/mcp/mcp-session.js";
|
|
22
23
|
import { runObsidianMcpServer } from "@ocean/services/infrastructure/mcp/obsidian-server.js";
|
|
23
24
|
import { runOceanMcpServer } from "@ocean/services/infrastructure/mcp/ocean-server.js";
|
|
24
25
|
import { parseConflictSide, resolveConflict, } from "@ocean/services/obsidian/conflict-log.js";
|
|
@@ -31,6 +32,7 @@ import { overviewTable, projectsOverview, writeRegistryBlock, } from "@ocean/ser
|
|
|
31
32
|
import { clientFindings, repairClients, } from "../../application/clients/clients.js";
|
|
32
33
|
import { desktopWatcherFindings } from "../../application/clients/desktop-watcher.js";
|
|
33
34
|
import { nativeFindings } from "../../application/clients/native.js";
|
|
35
|
+
import { MCP_ONLY_CLIENTS, mcpClientOf, } from "../../application/clients/registry.js";
|
|
34
36
|
import { createWebhookGateway } from "../../application/gateway/webhook-gateway.js";
|
|
35
37
|
import { findInstallSpec, installPlan, installProvider, listInstallSpecs, removeInstalledProvider, updateProvider, } from "../../application/install/provider-installer.js";
|
|
36
38
|
import { syncCharterCopies } from "../../application/integrations/charter-copies.js";
|
|
@@ -352,6 +354,13 @@ async function commandMcp() {
|
|
|
352
354
|
sessionStoreFactory: defaultSessionStoreFactory,
|
|
353
355
|
wrapperManager: defaultWrapperManager,
|
|
354
356
|
embedder: mcpEmbedder(),
|
|
357
|
+
mcpSessions: createMcpSessionRecorder({
|
|
358
|
+
openStore: defaultSessionStoreFactory,
|
|
359
|
+
providerOf: (name) => {
|
|
360
|
+
const id = mcpClientOf(name)?.id;
|
|
361
|
+
return id && MCP_ONLY_CLIENTS.has(id) ? id : null;
|
|
362
|
+
},
|
|
363
|
+
}),
|
|
355
364
|
});
|
|
356
365
|
else if (action === "gateway")
|
|
357
366
|
await runMcpGatewayCommand(process.argv.slice(4));
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
export function createMcpSessionRecorder(options) {
|
|
3
|
+
const env = options.env ?? process.env;
|
|
4
|
+
let sessionId = null;
|
|
5
|
+
async function withStore(run) {
|
|
6
|
+
try {
|
|
7
|
+
const store = await options.openStore();
|
|
8
|
+
try {
|
|
9
|
+
run(store);
|
|
10
|
+
}
|
|
11
|
+
finally {
|
|
12
|
+
store.close();
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
// The session store is a record, not a dependency of the tool call.
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
// Creates the connection's session once.
|
|
20
|
+
function ensure(store, clientName, provider) {
|
|
21
|
+
if (!sessionId) {
|
|
22
|
+
const id = randomUUID();
|
|
23
|
+
store.create({
|
|
24
|
+
sessionId: id,
|
|
25
|
+
title: `${provider} over MCP`,
|
|
26
|
+
provider,
|
|
27
|
+
providerSessionId: null,
|
|
28
|
+
parentSessionId: null,
|
|
29
|
+
profile: `mcp:${provider}`,
|
|
30
|
+
profileIdentity: "",
|
|
31
|
+
workingDirectory: options.cwd ?? process.cwd(),
|
|
32
|
+
resumeData: null,
|
|
33
|
+
});
|
|
34
|
+
store.updateStatus(id, "running");
|
|
35
|
+
store.appendEvent(id, "mcp_connection", JSON.stringify({ client: clientName }));
|
|
36
|
+
sessionId = id;
|
|
37
|
+
// A session id the client itself set is kept.
|
|
38
|
+
if (!env.OCEAN_SESSION_ID)
|
|
39
|
+
env.OCEAN_SESSION_ID = id;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
async open(clientName) {
|
|
44
|
+
const provider = options.providerOf(clientName);
|
|
45
|
+
if (!provider || sessionId)
|
|
46
|
+
return;
|
|
47
|
+
await withStore((store) => ensure(store, clientName, provider));
|
|
48
|
+
},
|
|
49
|
+
async toolCall(clientName, tool, ok) {
|
|
50
|
+
const provider = options.providerOf(clientName);
|
|
51
|
+
if (!provider)
|
|
52
|
+
return;
|
|
53
|
+
await withStore((store) => {
|
|
54
|
+
ensure(store, clientName, provider);
|
|
55
|
+
store.appendEvent(sessionId, "mcp_tool_call", JSON.stringify({ tool, ok }));
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
async close() {
|
|
59
|
+
const id = sessionId;
|
|
60
|
+
if (!id)
|
|
61
|
+
return;
|
|
62
|
+
await withStore((store) => store.updateStatus(id, "completed"));
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=mcp-session.js.map
|
|
@@ -857,13 +857,16 @@ export async function handleOceanMcpRequest(request, ports) {
|
|
|
857
857
|
error: { code: -32602, message: "Unknown MCP tool" },
|
|
858
858
|
};
|
|
859
859
|
}
|
|
860
|
+
await ports.mcpSessions?.open(clientName);
|
|
860
861
|
try {
|
|
861
862
|
const result = textResult(await callTool(name, (request.params?.arguments ?? {}), ports));
|
|
862
863
|
await recordMcpCall(clientName, name, true);
|
|
864
|
+
await ports.mcpSessions?.toolCall(clientName, name, true);
|
|
863
865
|
return { jsonrpc: "2.0", id: request.id, result };
|
|
864
866
|
}
|
|
865
867
|
catch (error) {
|
|
866
868
|
await recordMcpCall(clientName, name, false);
|
|
869
|
+
await ports.mcpSessions?.toolCall(clientName, name, false);
|
|
867
870
|
return {
|
|
868
871
|
jsonrpc: "2.0",
|
|
869
872
|
id: request.id,
|
|
@@ -879,8 +882,15 @@ export async function handleOceanMcpRequest(request, ports) {
|
|
|
879
882
|
}
|
|
880
883
|
export async function runOceanMcpServer(ports) {
|
|
881
884
|
let buffer = "";
|
|
885
|
+
// Requests still being answered when stdin ends: the connection's session closes after them.
|
|
886
|
+
const inFlight = new Set();
|
|
882
887
|
process.stdin.setEncoding("utf8");
|
|
883
|
-
process.stdin.on("data",
|
|
888
|
+
process.stdin.on("data", (chunk) => {
|
|
889
|
+
const work = handleChunk(chunk);
|
|
890
|
+
inFlight.add(work);
|
|
891
|
+
work.finally(() => inFlight.delete(work)).catch(() => { });
|
|
892
|
+
});
|
|
893
|
+
async function handleChunk(chunk) {
|
|
884
894
|
buffer += chunk;
|
|
885
895
|
while (true) {
|
|
886
896
|
const newline = buffer.indexOf("\n");
|
|
@@ -896,7 +906,9 @@ export async function runOceanMcpServer(ports) {
|
|
|
896
906
|
continue;
|
|
897
907
|
process.stdout.write(`${JSON.stringify(response)}\n`);
|
|
898
908
|
}
|
|
899
|
-
}
|
|
909
|
+
}
|
|
900
910
|
await new Promise((resolve) => process.stdin.once("end", resolve));
|
|
911
|
+
await Promise.allSettled([...inFlight]);
|
|
912
|
+
await ports.mcpSessions?.close();
|
|
901
913
|
}
|
|
902
914
|
//# sourceMappingURL=ocean-server.js.map
|
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.4.0",
|
|
9
9
|
"engines": {
|
|
10
|
-
"ocean": ">=2.
|
|
10
|
+
"ocean": ">=2.4.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.4.0",
|
|
27
27
|
"engines": {
|
|
28
|
-
"ocean": ">=2.
|
|
28
|
+
"ocean": ">=2.4.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.4.0",
|
|
45
45
|
"engines": {
|
|
46
|
-
"ocean": ">=2.
|
|
46
|
+
"ocean": ">=2.4.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.4.0",
|
|
63
63
|
"engines": {
|
|
64
|
-
"ocean": ">=2.
|
|
64
|
+
"ocean": ">=2.4.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.4.0",
|
|
81
81
|
"engines": {
|
|
82
|
-
"ocean": ">=2.
|
|
82
|
+
"ocean": ">=2.4.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.4.0",
|
|
99
99
|
"engines": {
|
|
100
|
-
"ocean": ">=2.
|
|
100
|
+
"ocean": ">=2.4.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.4.0",
|
|
117
117
|
"engines": {
|
|
118
|
-
"ocean": ">=2.
|
|
118
|
+
"ocean": ">=2.4.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.4.0",
|
|
135
135
|
"engines": {
|
|
136
|
-
"ocean": ">=2.
|
|
136
|
+
"ocean": ">=2.4.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.4.0",
|
|
153
153
|
"engines": {
|
|
154
|
-
"ocean": ">=2.
|
|
154
|
+
"ocean": ">=2.4.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.4.0",
|
|
171
171
|
"engines": {
|
|
172
|
-
"ocean": ">=2.
|
|
172
|
+
"ocean": ">=2.4.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.4.0",
|
|
189
189
|
"engines": {
|
|
190
|
-
"ocean": ">=2.
|
|
190
|
+
"ocean": ">=2.4.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.4.0",
|
|
207
207
|
"engines": {
|
|
208
|
-
"ocean": ">=2.
|
|
208
|
+
"ocean": ">=2.4.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.4.0",
|
|
251
251
|
"engines": {
|
|
252
|
-
"ocean": ">=2.
|
|
252
|
+
"ocean": ">=2.4.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.4.0",
|
|
303
303
|
"engines": {
|
|
304
|
-
"ocean": ">=2.
|
|
304
|
+
"ocean": ">=2.4.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.4.0",
|
|
347
347
|
"engines": {
|
|
348
|
-
"ocean": ">=2.
|
|
348
|
+
"ocean": ">=2.4.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.4.0",
|
|
391
391
|
"engines": {
|
|
392
|
-
"ocean": ">=2.
|
|
392
|
+
"ocean": ">=2.4.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.4.0",
|
|
445
445
|
"engines": {
|
|
446
|
-
"ocean": ">=2.
|
|
446
|
+
"ocean": ">=2.4.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.4.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.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",
|
|
62
62
|
"playwright-core": "^1.48.0",
|
|
63
63
|
"sqlite-vec": "0.1.9",
|
|
64
64
|
"zod": "^4.6.5"
|