@amoree-code/ocean 1.4.0 → 1.5.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.
Files changed (27) hide show
  1. package/dist/application/clients/clients.js +122 -6
  2. package/dist/infrastructure/mcp/remote-mcp-client.js +81 -0
  3. package/dist/interfaces/cli/clients-command.js +39 -2
  4. package/dist/interfaces/cli/command-registry.js +7 -3
  5. package/dist/interfaces/cli/gateway-findings.js +32 -0
  6. package/dist/interfaces/cli/help-command.js +3 -3
  7. package/dist/interfaces/cli/market-command.js +142 -5
  8. package/dist/interfaces/cli/mcp-gateway-command.js +36 -11
  9. package/dist/interfaces/cli/mcp-status-command.js +135 -0
  10. package/dist/interfaces/cli/onboard-command.js +6 -2
  11. package/node_modules/@ocean/brain/package.json +1 -1
  12. package/node_modules/@ocean/context/package.json +1 -1
  13. package/node_modules/@ocean/core/package.json +1 -1
  14. package/node_modules/@ocean/loop/package.json +1 -1
  15. package/node_modules/@ocean/market/dist/adapters/mcp-adapter.js +13 -2
  16. package/node_modules/@ocean/market/dist/install/default-marketplace.js +1 -0
  17. package/node_modules/@ocean/market/dist/install/own-server.js +110 -0
  18. package/node_modules/@ocean/market/dist/mcp/mcp-gateway.js +240 -24
  19. package/node_modules/@ocean/market/dist/mcp/mcp-launch.js +167 -23
  20. package/node_modules/@ocean/market/dist/mcp/mcp-runner.js +6 -1
  21. package/node_modules/@ocean/market/dist/registry/official-registry.js +76 -0
  22. package/node_modules/@ocean/market/dist/security/secrets.js +66 -0
  23. package/node_modules/@ocean/market/package.json +1 -1
  24. package/node_modules/@ocean/services/dist/infrastructure/mcp/mcp-client.js +27 -2
  25. package/node_modules/@ocean/services/package.json +1 -1
  26. package/ocean-marketplace.json +28 -28
  27. package/package.json +7 -7
@@ -0,0 +1,76 @@
1
+ import { remoteUrlAllowed, } from "../adapters/mcp-adapter.js";
2
+ import { launchInputs, stdioPackage } from "../mcp/mcp-launch.js";
3
+ // The official MCP registry (registry.modelcontextprotocol.io): the public list of MCP servers in
4
+ // the `server.json` format Ocean installs. Read-only; nothing about the owner is sent but the
5
+ // search term. `OCEAN_MCP_REGISTRY` points at another registry with the same API (a mirror, a
6
+ // test server): https, or http on loopback.
7
+ export const OFFICIAL_REGISTRY = "https://registry.modelcontextprotocol.io";
8
+ export function registryBase(env = process.env) {
9
+ const base = new URL(env.OCEAN_MCP_REGISTRY || OFFICIAL_REGISTRY);
10
+ if (!remoteUrlAllowed(base))
11
+ throw new Error(`OCEAN_MCP_REGISTRY ${base.href} must be https (or http on loopback)`);
12
+ return base;
13
+ }
14
+ const status = (entry) => String(entry._meta?.["io.modelcontextprotocol.registry/official"]?.status ??
15
+ "active");
16
+ // How the server would run here: its stdio package's registry, or its remote's transport.
17
+ function runs(server) {
18
+ const stdio = stdioPackage(server);
19
+ if (stdio)
20
+ return String(stdio.registryType);
21
+ const remote = server.remotes?.[0];
22
+ return remote ? `remote ${String(remote.type ?? "streamable-http")}` : "?";
23
+ }
24
+ async function getJson(url, fetchImpl, timeoutMs) {
25
+ const response = await fetchImpl(url, {
26
+ headers: { accept: "application/json" },
27
+ redirect: "error",
28
+ signal: AbortSignal.timeout(timeoutMs),
29
+ });
30
+ if (response.status === 404)
31
+ return undefined;
32
+ if (!response.ok)
33
+ throw new Error(`MCP registry answered ${response.status} for ${url.href}`);
34
+ return response.json();
35
+ }
36
+ export async function searchRegistry(term, options = {}) {
37
+ const url = new URL("v0/servers", registryBase(options.env));
38
+ url.searchParams.set("search", term);
39
+ url.searchParams.set("limit", String(options.limit ?? 20));
40
+ const body = (await getJson(url, options.fetch ?? fetch, options.timeoutMs ?? 20_000));
41
+ const seen = new Set();
42
+ const hits = [];
43
+ for (const entry of body?.servers ?? []) {
44
+ const server = entry.server;
45
+ if (!server || typeof server.name !== "string" || seen.has(server.name))
46
+ continue;
47
+ if (status(entry) === "deleted")
48
+ continue;
49
+ seen.add(server.name);
50
+ hits.push({
51
+ name: server.name,
52
+ version: String(server.version ?? ""),
53
+ description: String(server.description ?? "").slice(0, 200),
54
+ status: status(entry),
55
+ runs: runs(server),
56
+ needs: launchInputs(server)
57
+ .filter((input) => input.required)
58
+ .map((input) => input.name),
59
+ });
60
+ }
61
+ return hits;
62
+ }
63
+ // One server's `server.json`, the latest version or an exact one. A deleted entry is refused;
64
+ // a deprecated one is returned with its status so the caller can say so.
65
+ export async function fetchRegistryServer(name, options = {}) {
66
+ const url = new URL(`v0/servers/${encodeURIComponent(name)}/versions/${encodeURIComponent(options.version ?? "latest")}`, registryBase(options.env));
67
+ const entry = (await getJson(url, options.fetch ?? fetch, options.timeoutMs ?? 20_000));
68
+ if (!entry?.server)
69
+ throw new Error(`${name}${options.version ? `@${options.version}` : ""} is not in the MCP registry`);
70
+ if (entry.server.name !== name)
71
+ throw new Error(`the MCP registry answered ${String(entry.server.name)} for ${name}`);
72
+ if (status(entry) === "deleted")
73
+ throw new Error(`${name} was deleted from the MCP registry`);
74
+ return { server: entry.server, status: status(entry) };
75
+ }
76
+ //# sourceMappingURL=official-registry.js.map
@@ -0,0 +1,66 @@
1
+ import { spawnSync } from "node:child_process";
2
+ const SERVICE = "ocean-mcp";
3
+ const account = (capability, name) => `${capability}:${name}`;
4
+ const run = (command, args, input) => {
5
+ const result = spawnSync(command, args, {
6
+ encoding: "utf8",
7
+ input,
8
+ stdio: ["pipe", "pipe", "pipe"],
9
+ });
10
+ return { status: result.status, stdout: result.stdout ?? "" };
11
+ };
12
+ // `security -i` reads its commands from stdin, so the value never appears in a process list.
13
+ const quote = (value) => `"${value.replace(/["\\]/g, "\\$&")}"`;
14
+ export function keychainStore(platform = process.platform, runner = run) {
15
+ if (platform !== "darwin")
16
+ return {
17
+ name: "none",
18
+ get: () => undefined,
19
+ set: () => {
20
+ throw new Error(`no secret store on ${platform} yet; set the variable in the environment of the client instead`);
21
+ },
22
+ remove: () => false,
23
+ };
24
+ return {
25
+ name: "macOS keychain",
26
+ get(capability, name) {
27
+ const result = runner("security", [
28
+ "find-generic-password",
29
+ "-s",
30
+ SERVICE,
31
+ "-a",
32
+ account(capability, name),
33
+ "-w",
34
+ ]);
35
+ return result.status === 0 ? result.stdout.replace(/\n$/, "") : undefined;
36
+ },
37
+ set(capability, name, value) {
38
+ if (/[\r\n]/.test(value))
39
+ throw new Error("a secret value cannot contain a line break");
40
+ const result = runner("security", ["-i"], `add-generic-password -U -s ${quote(SERVICE)} -a ${quote(account(capability, name))} -w ${quote(value)}\n`);
41
+ if (result.status !== 0)
42
+ throw new Error(`the keychain refused to store ${name}`);
43
+ },
44
+ remove(capability, name) {
45
+ return (runner("security", [
46
+ "delete-generic-password",
47
+ "-s",
48
+ SERVICE,
49
+ "-a",
50
+ account(capability, name),
51
+ ]).status === 0);
52
+ },
53
+ };
54
+ }
55
+ // For tests and callers that pass values another way.
56
+ export function memoryStore(values = {}) {
57
+ return {
58
+ name: "memory",
59
+ get: (capability, name) => values[account(capability, name)],
60
+ set: (capability, name, value) => {
61
+ values[account(capability, name)] = value;
62
+ },
63
+ remove: (capability, name) => delete values[account(capability, name)],
64
+ };
65
+ }
66
+ //# sourceMappingURL=secrets.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ocean/market",
3
- "version": "1.4.0",
3
+ "version": "1.5.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -7,6 +7,8 @@ export class McpClient {
7
7
  pending = new Map();
8
8
  buffer = "";
9
9
  tools = new Map();
10
+ // What the server said it offers in `initialize`; resources and prompts are asked for only then.
11
+ serverCapabilities = {};
10
12
  constructor(options) {
11
13
  this.options = options;
12
14
  }
@@ -40,11 +42,16 @@ export class McpClient {
40
42
  this.child.stdout.on("data", (chunk) => this.consume(chunk));
41
43
  this.child.once("error", (error) => this.failPending(error));
42
44
  this.child.once("close", () => this.failPending(new Error("MCP server stopped")));
43
- await this.request("initialize", {
45
+ const initialized = (await this.request("initialize", {
44
46
  protocolVersion: "2025-06-18",
45
47
  capabilities: {},
46
48
  clientInfo: { name: "ocean", version: "0.3.2" },
47
- });
49
+ }));
50
+ const capabilities = initialized?.capabilities;
51
+ this.serverCapabilities =
52
+ capabilities && typeof capabilities === "object"
53
+ ? capabilities
54
+ : {};
48
55
  this.notify("notifications/initialized", {});
49
56
  }
50
57
  async listTools() {
@@ -80,6 +87,24 @@ export class McpClient {
80
87
  throw new Error(`MCP tool is not allowed: ${name}`);
81
88
  return this.request("tools/call", { name, arguments: arguments_ });
82
89
  }
90
+ async listResources() {
91
+ if (!this.serverCapabilities.resources)
92
+ return [];
93
+ const result = (await this.request("resources/list", {}));
94
+ return result.resources ?? [];
95
+ }
96
+ readResource(uri) {
97
+ return this.request("resources/read", { uri });
98
+ }
99
+ async listPrompts() {
100
+ if (!this.serverCapabilities.prompts)
101
+ return [];
102
+ const result = (await this.request("prompts/list", {}));
103
+ return result.prompts ?? [];
104
+ }
105
+ getPrompt(name, arguments_) {
106
+ return this.request("prompts/get", { name, arguments: arguments_ });
107
+ }
83
108
  close() {
84
109
  if (this.child) {
85
110
  this.child.stdin.destroy();
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ocean/services",
3
- "version": "1.4.0",
3
+ "version": "1.5.1",
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": "1.4.0",
8
+ "version": "1.5.1",
9
9
  "engines": {
10
- "ocean": ">=1.4.0"
10
+ "ocean": ">=1.5.1"
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": "1.4.0",
26
+ "version": "1.5.1",
27
27
  "engines": {
28
- "ocean": ">=1.4.0"
28
+ "ocean": ">=1.5.1"
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": "1.4.0",
44
+ "version": "1.5.1",
45
45
  "engines": {
46
- "ocean": ">=1.4.0"
46
+ "ocean": ">=1.5.1"
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.design-thinking",
62
- "version": "1.4.0",
62
+ "version": "1.5.1",
63
63
  "engines": {
64
- "ocean": ">=1.4.0"
64
+ "ocean": ">=1.5.1"
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.graft",
80
- "version": "1.4.0",
80
+ "version": "1.5.1",
81
81
  "engines": {
82
- "ocean": ">=1.4.0"
82
+ "ocean": ">=1.5.1"
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.loop",
98
- "version": "1.4.0",
98
+ "version": "1.5.1",
99
99
  "engines": {
100
- "ocean": ">=1.4.0"
100
+ "ocean": ">=1.5.1"
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.session-handoff",
116
- "version": "1.4.0",
116
+ "version": "1.5.1",
117
117
  "engines": {
118
- "ocean": ">=1.4.0"
118
+ "ocean": ">=1.5.1"
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.use-browser",
134
- "version": "1.4.0",
134
+ "version": "1.5.1",
135
135
  "engines": {
136
- "ocean": ">=1.4.0"
136
+ "ocean": ">=1.5.1"
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.verification",
152
- "version": "1.4.0",
152
+ "version": "1.5.1",
153
153
  "engines": {
154
- "ocean": ">=1.4.0"
154
+ "ocean": ">=1.5.1"
155
155
  },
156
156
  "source": {
157
157
  "type": "path",
@@ -183,9 +183,9 @@
183
183
  "npx"
184
184
  ]
185
185
  },
186
- "version": "1.4.0",
186
+ "version": "1.5.1",
187
187
  "engines": {
188
- "ocean": ">=1.4.0"
188
+ "ocean": ">=1.5.1"
189
189
  },
190
190
  "source": {
191
191
  "type": "path",
@@ -218,9 +218,9 @@
218
218
  "kind": "mcp",
219
219
  "name": "dev.ocean/mcp-gateway",
220
220
  "description": "One MCP endpoint for every registered server: Ocean's own and those installed from the marketplace.",
221
- "version": "1.4.0",
221
+ "version": "1.5.1",
222
222
  "engines": {
223
- "ocean": ">=1.4.0"
223
+ "ocean": ">=1.5.1"
224
224
  },
225
225
  "source": {
226
226
  "type": "path",
@@ -262,9 +262,9 @@
262
262
  "kind": "mcp",
263
263
  "name": "dev.ocean/obsidian",
264
264
  "description": "Ocean's Obsidian vault bridge over MCP.",
265
- "version": "1.4.0",
265
+ "version": "1.5.1",
266
266
  "engines": {
267
- "ocean": ">=1.4.0"
267
+ "ocean": ">=1.5.1"
268
268
  },
269
269
  "source": {
270
270
  "type": "path",
@@ -306,9 +306,9 @@
306
306
  "kind": "mcp",
307
307
  "name": "dev.ocean/ocean",
308
308
  "description": "Ocean's own MCP server: workspace status, tasks, handoffs, sessions and the brain.",
309
- "version": "1.4.0",
309
+ "version": "1.5.1",
310
310
  "engines": {
311
- "ocean": ">=1.4.0"
311
+ "ocean": ">=1.5.1"
312
312
  },
313
313
  "source": {
314
314
  "type": "path",
@@ -360,9 +360,9 @@
360
360
  "npx"
361
361
  ]
362
362
  },
363
- "version": "1.4.0",
363
+ "version": "1.5.1",
364
364
  "engines": {
365
- "ocean": ">=1.4.0"
365
+ "ocean": ">=1.5.1"
366
366
  },
367
367
  "source": {
368
368
  "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": "1.4.0",
4
+ "version": "1.5.1",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "author": "AMEER ABDULKAREEM JABBAR LAMI",
@@ -45,12 +45,12 @@
45
45
  "@langchain/core": "1.2.14",
46
46
  "@langchain/langgraph": "1.4.19",
47
47
  "@modelcontextprotocol/sdk": "1.32.0",
48
- "@ocean/brain": "1.4.0",
49
- "@ocean/context": "1.4.0",
50
- "@ocean/core": "1.4.0",
51
- "@ocean/loop": "1.4.0",
52
- "@ocean/market": "1.4.0",
53
- "@ocean/services": "1.4.0",
48
+ "@ocean/brain": "1.5.1",
49
+ "@ocean/context": "1.5.1",
50
+ "@ocean/core": "1.5.1",
51
+ "@ocean/loop": "1.5.1",
52
+ "@ocean/market": "1.5.1",
53
+ "@ocean/services": "1.5.1",
54
54
  "playwright-core": "^1.48.0",
55
55
  "sqlite-vec": "0.1.9",
56
56
  "zod": "^4.6.5"