@amoree-code/ocean 1.1.0 → 1.3.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/README.md +1 -1
- package/dist/application/clients/clients.js +70 -8
- package/dist/application/clients/editors.js +8 -1
- package/dist/application/clients/registry.js +28 -0
- package/dist/application/integrations/engine-entry-repair.js +2 -0
- package/dist/interfaces/cli/browser-findings.js +24 -0
- package/dist/interfaces/cli/browser-service-command.js +28 -0
- package/dist/interfaces/cli/command-registry.js +4 -8
- package/dist/interfaces/cli/help-command.js +1 -1
- 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/dist/mcp/chrome-debugging.js +43 -0
- package/node_modules/@ocean/market/dist/mcp/mcp-launch.js +7 -1
- package/node_modules/@ocean/market/package.json +1 -1
- package/node_modules/@ocean/services/package.json +1 -1
- package/ocean-marketplace.json +29 -29
- package/package.json +7 -7
- package/skills/core/use-browser/SKILL.md +2 -2
- package/dist/interfaces/cli/browser-bridge-command.js +0 -93
- package/node_modules/@ocean/brain/dist/memory/signal-detection.js +0 -66
- package/node_modules/@ocean/market/dist/mcp/browser-bridge.js +0 -263
- package/node_modules/@ocean/market/dist/security/sandbox.js +0 -74
- package/node_modules/@ocean/market/dist/skills/skill-curation.js +0 -123
- package/node_modules/@ocean/market/dist/skills/task-observer.js +0 -165
package/README.md
CHANGED
|
@@ -137,7 +137,7 @@ prints its usage and never runs it. To hand `--help` to a wrapped client, put it
|
|
|
137
137
|
| `ocean clients` | connect installed AI clients to Ocean | Reads; `apply` needs `--yes` and writes client config outside the workspace |
|
|
138
138
|
| `ocean install` / `update` / `remove` | install, update or remove an AI client CLI | Runs an installer; needs `--yes` |
|
|
139
139
|
| `ocean auth` | show or start an AI client's login | Reads; `login` runs |
|
|
140
|
-
| `ocean mcp` | print MCP client configs, or serve Ocean's MCP server and gateway | Reads; `serve`, `gateway` run; `browser-service
|
|
140
|
+
| `ocean mcp` | print MCP client configs, or serve Ocean's MCP server and gateway | Reads; `serve`, `gateway` run; `browser-service uninstall` removes the retired browser bridge's service |
|
|
141
141
|
| `ocean market` | marketplace skills and MCP servers | Reads; `install`, `update`, `uninstall` write; `exec` runs; permissions need `--yes` |
|
|
142
142
|
| `ocean browser` | drive a browser session | Runs; `upload`, `submit` need `--approve` |
|
|
143
143
|
| `ocean memory` | search, read, review and maintain memory | Reads; `approve`, `delete`, `restore`, `reindex`, `sync --apply`, `purge --yes` write |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
2
|
import { createHash, randomBytes } from "node:crypto";
|
|
3
|
-
import { accessSync, constants, existsSync, realpathSync } from "node:fs";
|
|
3
|
+
import { accessSync, constants, existsSync, readdirSync, readFileSync, realpathSync, } from "node:fs";
|
|
4
4
|
import { appendFile, mkdir, readFile } from "node:fs/promises";
|
|
5
5
|
import os from "node:os";
|
|
6
6
|
import path from "node:path";
|
|
@@ -8,8 +8,11 @@ import { clientJournalFile } from "@ocean/brain/memory/memory-paths.js";
|
|
|
8
8
|
import { containsKnownSecret } from "@ocean/core/domain/redaction/redaction.js";
|
|
9
9
|
import { atomicWrite, withFileLock } from "@ocean/core/shared/fs-utils.js";
|
|
10
10
|
import { liveEngineEntry, oceanPath, SYSTEM_DIR, } from "@ocean/core/shared/paths.js";
|
|
11
|
+
import { marketplacePaths } from "@ocean/market/install/default-marketplace.js";
|
|
11
12
|
import { ENTRY_KEYS, ManualEdit, } from "./editors.js";
|
|
12
13
|
import { CLIENT_ADAPTERS, mcpClientOf, } from "./registry.js";
|
|
14
|
+
// Keys Ocean already manages for its own servers; a marketplace server never takes one.
|
|
15
|
+
const RESERVED_KEYS = new Set(["ocean", "ocean-obsidian"]);
|
|
13
16
|
// A node inside a version manager's tree disappears when that version is removed (T-307).
|
|
14
17
|
const VERSIONED_NODE = /[\\/](?:node-versions|\.nvm[\\/]versions[\\/]node|\.volta[\\/]tools[\\/]image[\\/]node|\.asdf[\\/]installs[\\/]nodejs|mise[\\/]installs[\\/]node|n[\\/]versions[\\/]node)[\\/]/;
|
|
15
18
|
export function isVersionedNode(execPath) {
|
|
@@ -18,17 +21,52 @@ export function isVersionedNode(execPath) {
|
|
|
18
21
|
// The `ocean` MCP entry. With a version-managed node it launches through the `ocean` shim, which
|
|
19
22
|
// falls back to another node when that version is gone; a temporary engine keeps the direct form
|
|
20
23
|
// so `temporaryEntryProblem` still refuses it.
|
|
21
|
-
export function oceanServerEntry(execPath = process.execPath, engine = liveEngineEntry(), platform = process.platform) {
|
|
22
|
-
const direct = { command: execPath, args: [engine,
|
|
24
|
+
export function oceanServerEntry(execPath = process.execPath, engine = liveEngineEntry(), platform = process.platform, command = ["mcp", "serve"]) {
|
|
25
|
+
const direct = { command: execPath, args: [engine, ...command] };
|
|
23
26
|
if (platform === "win32" ||
|
|
24
27
|
!isVersionedNode(execPath) ||
|
|
25
28
|
temporaryEntryProblem(direct))
|
|
26
29
|
return direct;
|
|
27
30
|
return {
|
|
28
31
|
command: oceanPath(SYSTEM_DIR, "runtime", "shims", "ocean"),
|
|
29
|
-
args:
|
|
32
|
+
args: command,
|
|
30
33
|
};
|
|
31
34
|
}
|
|
35
|
+
// One client entry per MCP server installed from the marketplace, keyed by its declared
|
|
36
|
+
// `clientKey` and started through `ocean market exec`, so every client launches it the same
|
|
37
|
+
// checked way. Remote-only servers are left out: a client connects to those by url.
|
|
38
|
+
export function marketServerEntries(serversRoot, entryFor = (command) => oceanServerEntry(undefined, undefined, undefined, command)) {
|
|
39
|
+
const entries = new Map();
|
|
40
|
+
let files = [];
|
|
41
|
+
try {
|
|
42
|
+
files = readdirSync(serversRoot)
|
|
43
|
+
.filter((file) => file.endsWith(".json"))
|
|
44
|
+
.sort();
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return entries;
|
|
48
|
+
}
|
|
49
|
+
for (const file of files) {
|
|
50
|
+
let installed;
|
|
51
|
+
try {
|
|
52
|
+
installed = JSON.parse(readFileSync(path.join(serversRoot, file), "utf8"));
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
const name = installed.capability;
|
|
58
|
+
if (typeof name !== "string" || !installed.server?.packages?.length)
|
|
59
|
+
continue;
|
|
60
|
+
const meta = installed.server._meta?.["dev.ocean"];
|
|
61
|
+
const key = typeof meta?.clientKey === "string"
|
|
62
|
+
? meta.clientKey
|
|
63
|
+
: (name.split("/").at(-1) ?? name);
|
|
64
|
+
if (RESERVED_KEYS.has(key) || entries.has(key))
|
|
65
|
+
continue;
|
|
66
|
+
entries.set(key, entryFor(["market", "exec", name]));
|
|
67
|
+
}
|
|
68
|
+
return entries;
|
|
69
|
+
}
|
|
32
70
|
export function defaultClientEnv() {
|
|
33
71
|
const home = os.homedir();
|
|
34
72
|
return {
|
|
@@ -38,6 +76,7 @@ export function defaultClientEnv() {
|
|
|
38
76
|
? ["/Applications", path.join(home, "Applications")]
|
|
39
77
|
: [],
|
|
40
78
|
entry: oceanServerEntry(),
|
|
79
|
+
market: marketServerEntries(marketplacePaths().mcpServers),
|
|
41
80
|
};
|
|
42
81
|
}
|
|
43
82
|
const sha = (value) => createHash("sha256").update(value).digest("hex");
|
|
@@ -128,7 +167,7 @@ async function readText(file) {
|
|
|
128
167
|
}
|
|
129
168
|
}
|
|
130
169
|
// The ops that bring one config text to the desired state, or why it needs a hand edit.
|
|
131
|
-
function opsFor(adapter, text, entry) {
|
|
170
|
+
function opsFor(adapter, text, entry, market) {
|
|
132
171
|
const editor = adapter.config?.editor;
|
|
133
172
|
const servers = editor?.servers(text);
|
|
134
173
|
if (!editor || !servers)
|
|
@@ -161,8 +200,28 @@ function opsFor(adapter, text, entry) {
|
|
|
161
200
|
};
|
|
162
201
|
else if (!sameEntry(ocean, entry))
|
|
163
202
|
ops.push({ kind: "set", key: "ocean", value: entry });
|
|
203
|
+
// Marketplace servers: added, kept current, and removed once uninstalled. A key holding the
|
|
204
|
+
// owner's own server (not an `ocean market exec` entry) is left alone. Without a market list
|
|
205
|
+
// (a caller's own env) they are not managed at all, never all removed.
|
|
206
|
+
if (!market)
|
|
207
|
+
return { ops };
|
|
208
|
+
for (const [key, value] of servers)
|
|
209
|
+
if (isMarketExec(value) && !market.has(key))
|
|
210
|
+
ops.push({ kind: "remove", key });
|
|
211
|
+
for (const [key, want] of market) {
|
|
212
|
+
const have = servers.get(key);
|
|
213
|
+
if (!have || (isMarketExec(have) && !sameEntry(have, want)))
|
|
214
|
+
ops.push({ kind: "set", key, value: want });
|
|
215
|
+
}
|
|
164
216
|
return { ops };
|
|
165
217
|
}
|
|
218
|
+
// An Ocean-managed entry that starts an installed marketplace server.
|
|
219
|
+
function isMarketExec(value) {
|
|
220
|
+
if (!isOceanShaped(value) || !Array.isArray(value.args))
|
|
221
|
+
return false;
|
|
222
|
+
const at = value.args.indexOf("market");
|
|
223
|
+
return at >= 0 && value.args[at + 1] === "exec";
|
|
224
|
+
}
|
|
166
225
|
export async function planClients(env = defaultClientEnv()) {
|
|
167
226
|
const plans = [];
|
|
168
227
|
for (const adapter of CLIENT_ADAPTERS) {
|
|
@@ -186,7 +245,7 @@ export async function planClients(env = defaultClientEnv()) {
|
|
|
186
245
|
plan.status = adapter.tier === "supported" ? "unknown" : adapter.tier;
|
|
187
246
|
else {
|
|
188
247
|
const text = (await readText(path.join(env.home, adapter.config.file))) ?? "";
|
|
189
|
-
const { ops, manual } = opsFor(adapter, text, env.entry);
|
|
248
|
+
const { ops, manual } = opsFor(adapter, text, env.entry, env.market);
|
|
190
249
|
plan.ops = ops;
|
|
191
250
|
plan.status = ops.length ? "change" : "current";
|
|
192
251
|
if (!manual && ops.length)
|
|
@@ -204,7 +263,10 @@ export async function planClients(env = defaultClientEnv()) {
|
|
|
204
263
|
plan.status = "manual";
|
|
205
264
|
}
|
|
206
265
|
if (plan.status === "manual")
|
|
207
|
-
plan.snippet = JSON.stringify({
|
|
266
|
+
plan.snippet = JSON.stringify({
|
|
267
|
+
ocean: env.entry,
|
|
268
|
+
...Object.fromEntries(env.market ?? []),
|
|
269
|
+
});
|
|
208
270
|
}
|
|
209
271
|
plans.push(plan);
|
|
210
272
|
}
|
|
@@ -384,7 +446,7 @@ export async function applyClients(options = {}) {
|
|
|
384
446
|
const config = adapter.config;
|
|
385
447
|
const file = path.join(env.home, config.file);
|
|
386
448
|
const result = await edit(file, (text) => {
|
|
387
|
-
const { ops, manual } = opsFor(adapter, text, env.entry);
|
|
449
|
+
const { ops, manual } = opsFor(adapter, text, env.entry, env.market);
|
|
388
450
|
if (manual || !ops.length)
|
|
389
451
|
return null;
|
|
390
452
|
// Each op's "before" is the table as the earlier ops of this batch left it.
|
|
@@ -5,7 +5,14 @@
|
|
|
5
5
|
// written: the change becomes a manual step instead of a rewrite.
|
|
6
6
|
// The keys an Ocean-managed entry may carry. An entry with any other key (env, headers…) is the
|
|
7
7
|
// user's and is never rewritten.
|
|
8
|
-
export const ENTRY_KEYS = [
|
|
8
|
+
export const ENTRY_KEYS = [
|
|
9
|
+
"command",
|
|
10
|
+
"args",
|
|
11
|
+
"cwd",
|
|
12
|
+
"type",
|
|
13
|
+
"enabled",
|
|
14
|
+
"disabled",
|
|
15
|
+
];
|
|
9
16
|
export class ManualEdit extends Error {
|
|
10
17
|
}
|
|
11
18
|
// --- JSON: parse and re-serialize, only when the file is already in that exact form ----------
|
|
@@ -78,6 +78,18 @@ export const CLIENT_ADAPTERS = [
|
|
|
78
78
|
},
|
|
79
79
|
nativeMemory: "harvest",
|
|
80
80
|
},
|
|
81
|
+
{
|
|
82
|
+
// The current `agy` CLI reads its own table (`agy mcp list`), not the app's file above (T-298).
|
|
83
|
+
id: "antigravity-cli",
|
|
84
|
+
label: "Antigravity CLI (agy)",
|
|
85
|
+
tier: "supported",
|
|
86
|
+
detect: { binaries: ["agy"], paths: [".gemini/config/mcp_config.json"] },
|
|
87
|
+
config: {
|
|
88
|
+
file: ".gemini/config/mcp_config.json",
|
|
89
|
+
editor: jsonEditor(["mcpServers"]),
|
|
90
|
+
},
|
|
91
|
+
nativeMemory: "harvest",
|
|
92
|
+
},
|
|
81
93
|
{
|
|
82
94
|
id: "cursor",
|
|
83
95
|
label: "Cursor",
|
|
@@ -90,6 +102,22 @@ export const CLIENT_ADAPTERS = [
|
|
|
90
102
|
config: { file: ".cursor/mcp.json", editor: jsonEditor(["mcpServers"]) },
|
|
91
103
|
nativeMemory: "uncaptured",
|
|
92
104
|
},
|
|
105
|
+
{
|
|
106
|
+
// VS Code's own MCP support (Copilot agent mode): `servers`, each with a `type`.
|
|
107
|
+
id: "vscode",
|
|
108
|
+
label: "VS Code",
|
|
109
|
+
tier: "supported",
|
|
110
|
+
detect: {
|
|
111
|
+
binaries: ["code"],
|
|
112
|
+
apps: ["Visual Studio Code.app"],
|
|
113
|
+
paths: ["Library/Application Support/Code/User"],
|
|
114
|
+
},
|
|
115
|
+
config: {
|
|
116
|
+
file: "Library/Application Support/Code/User/mcp.json",
|
|
117
|
+
editor: jsonEditor(["servers"], (value) => ({ type: "stdio", ...value })),
|
|
118
|
+
},
|
|
119
|
+
nativeMemory: "unknown",
|
|
120
|
+
},
|
|
93
121
|
{
|
|
94
122
|
id: "hermes",
|
|
95
123
|
label: "Hermes",
|
|
@@ -20,6 +20,8 @@ const CLIENT_CONFIGS = [
|
|
|
20
20
|
".claude.json",
|
|
21
21
|
".cursor/mcp.json",
|
|
22
22
|
".gemini/antigravity/mcp_config.json",
|
|
23
|
+
".gemini/config/mcp_config.json",
|
|
24
|
+
"Library/Application Support/Code/User/mcp.json",
|
|
23
25
|
// Claude Desktop: macOS, then Windows.
|
|
24
26
|
"Library/Application Support/Claude/claude_desktop_config.json",
|
|
25
27
|
"AppData/Roaming/Claude/claude_desktop_config.json",
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { mcpServerFile } from "@ocean/market/adapters/mcp-adapter.js";
|
|
3
|
+
import { marketplacePaths } from "@ocean/market/install/default-marketplace.js";
|
|
4
|
+
import { chromeDebuggingListening } from "@ocean/market/mcp/chrome-debugging.js";
|
|
5
|
+
// Marketplace capabilities that attach to the owner's running Chrome (T-298).
|
|
6
|
+
export const BROWSER_CAPABILITIES = [
|
|
7
|
+
"dev.ocean/chrome-devtools",
|
|
8
|
+
"dev.ocean/browser",
|
|
9
|
+
];
|
|
10
|
+
// `ocean doctor`: once a browser capability is installed, whether Chrome is there to attach to.
|
|
11
|
+
// Nothing installed is nothing to report.
|
|
12
|
+
export async function browserFindings(options = {}) {
|
|
13
|
+
const serversRoot = options.serversRoot ?? marketplacePaths().mcpServers;
|
|
14
|
+
const installed = BROWSER_CAPABILITIES.filter((name) => existsSync(mcpServerFile(serversRoot, name)));
|
|
15
|
+
if (!installed.length)
|
|
16
|
+
return [];
|
|
17
|
+
const finding = (severity, message) => [
|
|
18
|
+
{ code: "BROWSER", severity, message, fixable: false },
|
|
19
|
+
];
|
|
20
|
+
return (await (options.listening ?? chromeDebuggingListening)())
|
|
21
|
+
? finding("OK", `${installed.join(", ")} installed and Chrome debugging is listening`)
|
|
22
|
+
: finding("WARN", `${installed.join(", ")} installed, but Chrome is closed or chrome://inspect/#remote-debugging is off (a sandboxed shell that blocks loopback also sees this)`);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=browser-findings.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { rm } from "node:fs/promises";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { promisify } from "node:util";
|
|
6
|
+
// The loopback browser bridge (T-298, v1.1–v1.2) was replaced by the marketplace capability
|
|
7
|
+
// `dev.ocean/chrome-devtools`, which every client starts over stdio. Only the cleanup of its
|
|
8
|
+
// launchd service is left, for machines that installed it.
|
|
9
|
+
const LABEL = "com.ocean.browser-bridge";
|
|
10
|
+
const run = promisify(execFile);
|
|
11
|
+
export async function runBrowserServiceCommand(action) {
|
|
12
|
+
if (action !== "uninstall") {
|
|
13
|
+
console.error("Usage: ocean mcp browser-service uninstall — the browser bridge is retired; install dev.ocean/chrome-devtools with `ocean market install` and run `ocean clients apply`.");
|
|
14
|
+
process.exitCode = 1;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (process.platform !== "darwin") {
|
|
18
|
+
console.log("nothing to remove: the browser service was macOS only");
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
await run("launchctl", [
|
|
22
|
+
"bootout",
|
|
23
|
+
`gui/${process.getuid?.() ?? ""}/${LABEL}`,
|
|
24
|
+
]).catch(() => { });
|
|
25
|
+
await rm(path.join(os.homedir(), "Library", "LaunchAgents", `${LABEL}.plist`), { force: true });
|
|
26
|
+
console.log(`removed ${LABEL}`);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=browser-service-command.js.map
|
|
@@ -14,7 +14,6 @@ import { openSessionStore } from "@ocean/loop/infrastructure/persistence/session
|
|
|
14
14
|
import { listTaskLoops, runTaskLoopsOnce, runTaskLoopWorker, startTaskLoop, stopTaskLoop, } from "@ocean/loop/loops/task-loop.js";
|
|
15
15
|
import { resumeAgent, runAgent } from "@ocean/loop/runs/run-agent.js";
|
|
16
16
|
import { applyRetention, DEFAULT_KEEP_DAYS, planRetention, simulateRetention, } from "@ocean/loop/sessions/session-retention.js";
|
|
17
|
-
import { browserBridgeConfig } from "@ocean/market/mcp/browser-bridge.js";
|
|
18
17
|
import { mcpClientConfig, oceanMcpConfig, playwrightMcpConfig, } from "@ocean/market/mcp/mcp-connection.js";
|
|
19
18
|
import { GATEWAY_CAPABILITY } from "@ocean/market/mcp/mcp-gateway.js";
|
|
20
19
|
import { coreSkillReports, syncCoreSkills, } from "@ocean/market/skills/core-skill-sync.js";
|
|
@@ -44,8 +43,9 @@ import { createOllamaEmbedder } from "../../infrastructure/providers/ollama-embe
|
|
|
44
43
|
import { loadProviderRegistry } from "../../infrastructure/providers/provider-registry.js";
|
|
45
44
|
import { installShellPath, registerProvider, setProviderEnabled, syncProviderWrappers, wrapperDoctor, wrapperStatus, } from "../../infrastructure/wrappers/wrapper-manager.js";
|
|
46
45
|
import { runAuthCommand } from "./auth-command.js";
|
|
47
|
-
import { browserBridgeFindings, runBrowserBridgeCommand, runBrowserServiceCommand, } from "./browser-bridge-command.js";
|
|
48
46
|
import { runBrowserCommand } from "./browser-command.js";
|
|
47
|
+
import { browserFindings } from "./browser-findings.js";
|
|
48
|
+
import { runBrowserServiceCommand } from "./browser-service-command.js";
|
|
49
49
|
import { runCaptureCommand } from "./capture-command.js";
|
|
50
50
|
import { runClientTestCommand } from "./client-test-command.js";
|
|
51
51
|
import { runClientsCommand } from "./clients-command.js";
|
|
@@ -333,14 +333,10 @@ async function commandMcp() {
|
|
|
333
333
|
});
|
|
334
334
|
else if (action === "gateway")
|
|
335
335
|
await runMcpGatewayCommand();
|
|
336
|
-
else if (action === "browser-config")
|
|
337
|
-
console.log(JSON.stringify(browserBridgeConfig(), null, 2));
|
|
338
|
-
else if (action === "browser-bridge")
|
|
339
|
-
await runBrowserBridgeCommand();
|
|
340
336
|
else if (action === "browser-service")
|
|
341
337
|
await runBrowserServiceCommand(process.argv[4] ?? "");
|
|
342
338
|
else {
|
|
343
|
-
console.error("Usage: ocean mcp config|playwright-config|gateway-config|
|
|
339
|
+
console.error("Usage: ocean mcp config|playwright-config|gateway-config|serve|gateway|browser-service uninstall");
|
|
344
340
|
process.exitCode = 1;
|
|
345
341
|
}
|
|
346
342
|
}
|
|
@@ -927,7 +923,7 @@ async function commandUpdateOrRemove(command) {
|
|
|
927
923
|
async function commandDoctor() {
|
|
928
924
|
const report = await workspaceReport(defaultWrapperManager);
|
|
929
925
|
// T-296: every installed AI client's `ocean` entry (supported fail, unknown warn).
|
|
930
|
-
report.findings.push(...(await clientFindings()), ...(await nativeFindings()), ...(await
|
|
926
|
+
report.findings.push(...(await clientFindings()), ...(await nativeFindings()), ...(await browserFindings()));
|
|
931
927
|
if (process.argv.includes("--json"))
|
|
932
928
|
console.log(JSON.stringify(report, null, 2));
|
|
933
929
|
else
|
|
@@ -122,7 +122,7 @@ export const commandHelp = {
|
|
|
122
122
|
],
|
|
123
123
|
mcp: [
|
|
124
124
|
"Print MCP client configs, or serve Ocean's MCP server and gateway.",
|
|
125
|
-
"ocean mcp config|playwright-config|gateway-config|
|
|
125
|
+
"ocean mcp config|playwright-config|gateway-config|serve|gateway|browser-service uninstall",
|
|
126
126
|
],
|
|
127
127
|
market: [
|
|
128
128
|
"List, install, update and run marketplace packages; permissions need --yes.",
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { connect } from "node:net";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
// Chrome writes the port of its debugging server here while chrome://inspect/#remote-debugging is
|
|
6
|
+
// on; `chrome-devtools-mcp --autoConnect` reads the same file to attach to the running browser.
|
|
7
|
+
export function devToolsPortFile(home = os.homedir(), platform = process.platform, env = process.env) {
|
|
8
|
+
const parts = platform === "darwin"
|
|
9
|
+
? [home, "Library", "Application Support", "Google", "Chrome"]
|
|
10
|
+
: platform === "win32"
|
|
11
|
+
? [
|
|
12
|
+
env.LOCALAPPDATA ?? path.join(home, "AppData", "Local"),
|
|
13
|
+
"Google",
|
|
14
|
+
"Chrome",
|
|
15
|
+
"User Data",
|
|
16
|
+
]
|
|
17
|
+
: [home, ".config", "google-chrome"];
|
|
18
|
+
return path.join(...parts, "DevToolsActivePort");
|
|
19
|
+
}
|
|
20
|
+
// A plain TCP connect: it tells whether Chrome's debugging server is up without opening a DevTools
|
|
21
|
+
// session, so it never raises Chrome's permission prompt.
|
|
22
|
+
export async function chromeDebuggingListening(file = devToolsPortFile()) {
|
|
23
|
+
let port;
|
|
24
|
+
try {
|
|
25
|
+
port = Number((await readFile(file, "utf8")).split("\n")[0]);
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
if (!Number.isInteger(port) || port <= 0 || port >= 65536)
|
|
31
|
+
return false;
|
|
32
|
+
return new Promise((resolve) => {
|
|
33
|
+
const socket = connect({ host: "127.0.0.1", port, timeout: 1000 });
|
|
34
|
+
const finish = (listening) => {
|
|
35
|
+
socket.destroy();
|
|
36
|
+
resolve(listening);
|
|
37
|
+
};
|
|
38
|
+
socket.once("connect", () => finish(true));
|
|
39
|
+
socket.once("timeout", () => finish(false));
|
|
40
|
+
socket.once("error", () => finish(false));
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=chrome-debugging.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import os from "node:os";
|
|
2
|
+
import path from "node:path";
|
|
2
3
|
import { PermissionPolicy } from "../security/permissions.js";
|
|
3
4
|
// Where each runner takes its own (runtime) arguments: before the package for npx and uvx,
|
|
4
5
|
// after `run` for docker, so container flags such as `-e` or `-v` reach `docker run`.
|
|
@@ -69,8 +70,13 @@ export function planMcpLaunch(installed, options) {
|
|
|
69
70
|
throw new Error(`${installed.capability}: registry type ${registryType} is not supported`);
|
|
70
71
|
const base = runner(String(stdio.identifier), typeof stdio.version === "string" ? stdio.version : undefined, literalArguments(stdio.runtimeArguments, "runtimeArguments"));
|
|
71
72
|
policy.require({ type: "exec", target: base.command });
|
|
73
|
+
// The node running Ocean comes first, so its npx resolves even when a GUI client (Claude
|
|
74
|
+
// Desktop, VS Code) starts this with the login PATH, which lacks a version-managed node.
|
|
72
75
|
const env = {
|
|
73
|
-
PATH:
|
|
76
|
+
PATH: [
|
|
77
|
+
path.dirname(options.execPath ?? process.execPath),
|
|
78
|
+
hostEnv.PATH ?? "/usr/bin:/bin",
|
|
79
|
+
].join(path.delimiter),
|
|
74
80
|
HOME: home,
|
|
75
81
|
};
|
|
76
82
|
const declaredVariables = Array.isArray(stdio.environmentVariables)
|
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": "1.
|
|
8
|
+
"version": "1.3.0",
|
|
9
9
|
"engines": {
|
|
10
|
-
"ocean": ">=1.
|
|
10
|
+
"ocean": ">=1.3.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": "1.
|
|
26
|
+
"version": "1.3.0",
|
|
27
27
|
"engines": {
|
|
28
|
-
"ocean": ">=1.
|
|
28
|
+
"ocean": ">=1.3.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": "1.
|
|
44
|
+
"version": "1.3.0",
|
|
45
45
|
"engines": {
|
|
46
|
-
"ocean": ">=1.
|
|
46
|
+
"ocean": ">=1.3.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.design-thinking",
|
|
62
|
-
"version": "1.
|
|
62
|
+
"version": "1.3.0",
|
|
63
63
|
"engines": {
|
|
64
|
-
"ocean": ">=1.
|
|
64
|
+
"ocean": ">=1.3.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.graft",
|
|
80
|
-
"version": "1.
|
|
80
|
+
"version": "1.3.0",
|
|
81
81
|
"engines": {
|
|
82
|
-
"ocean": ">=1.
|
|
82
|
+
"ocean": ">=1.3.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.loop",
|
|
98
|
-
"version": "1.
|
|
98
|
+
"version": "1.3.0",
|
|
99
99
|
"engines": {
|
|
100
|
-
"ocean": ">=1.
|
|
100
|
+
"ocean": ">=1.3.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.session-handoff",
|
|
116
|
-
"version": "1.
|
|
116
|
+
"version": "1.3.0",
|
|
117
117
|
"engines": {
|
|
118
|
-
"ocean": ">=1.
|
|
118
|
+
"ocean": ">=1.3.0"
|
|
119
119
|
},
|
|
120
120
|
"source": {
|
|
121
121
|
"type": "path",
|
|
@@ -131,16 +131,16 @@
|
|
|
131
131
|
{
|
|
132
132
|
"kind": "skill",
|
|
133
133
|
"name": "dev.ocean.skills.use-browser",
|
|
134
|
-
"version": "1.
|
|
134
|
+
"version": "1.3.0",
|
|
135
135
|
"engines": {
|
|
136
|
-
"ocean": ">=1.
|
|
136
|
+
"ocean": ">=1.3.0"
|
|
137
137
|
},
|
|
138
138
|
"source": {
|
|
139
139
|
"type": "path",
|
|
140
140
|
"path": "skills/core/use-browser"
|
|
141
141
|
},
|
|
142
142
|
"integrity": {
|
|
143
|
-
"sha256": "
|
|
143
|
+
"sha256": "460fdc789084cbb07d320e12a9e96e803f02ee101f533c913530b71538d05b5b"
|
|
144
144
|
},
|
|
145
145
|
"spec": {
|
|
146
146
|
"directory": "use-browser"
|
|
@@ -149,9 +149,9 @@
|
|
|
149
149
|
{
|
|
150
150
|
"kind": "skill",
|
|
151
151
|
"name": "dev.ocean.skills.verification",
|
|
152
|
-
"version": "1.
|
|
152
|
+
"version": "1.3.0",
|
|
153
153
|
"engines": {
|
|
154
|
-
"ocean": ">=1.
|
|
154
|
+
"ocean": ">=1.3.0"
|
|
155
155
|
},
|
|
156
156
|
"source": {
|
|
157
157
|
"type": "path",
|
|
@@ -183,9 +183,9 @@
|
|
|
183
183
|
"npx"
|
|
184
184
|
]
|
|
185
185
|
},
|
|
186
|
-
"version": "1.
|
|
186
|
+
"version": "1.3.0",
|
|
187
187
|
"engines": {
|
|
188
|
-
"ocean": ">=1.
|
|
188
|
+
"ocean": ">=1.3.0"
|
|
189
189
|
},
|
|
190
190
|
"source": {
|
|
191
191
|
"type": "path",
|
|
@@ -232,9 +232,9 @@
|
|
|
232
232
|
"kind": "mcp",
|
|
233
233
|
"name": "dev.ocean/mcp-gateway",
|
|
234
234
|
"description": "One MCP endpoint for every registered server: Ocean's own and those installed from the marketplace.",
|
|
235
|
-
"version": "1.
|
|
235
|
+
"version": "1.3.0",
|
|
236
236
|
"engines": {
|
|
237
|
-
"ocean": ">=1.
|
|
237
|
+
"ocean": ">=1.3.0"
|
|
238
238
|
},
|
|
239
239
|
"source": {
|
|
240
240
|
"type": "path",
|
|
@@ -276,9 +276,9 @@
|
|
|
276
276
|
"kind": "mcp",
|
|
277
277
|
"name": "dev.ocean/obsidian",
|
|
278
278
|
"description": "Ocean's Obsidian vault bridge over MCP.",
|
|
279
|
-
"version": "1.
|
|
279
|
+
"version": "1.3.0",
|
|
280
280
|
"engines": {
|
|
281
|
-
"ocean": ">=1.
|
|
281
|
+
"ocean": ">=1.3.0"
|
|
282
282
|
},
|
|
283
283
|
"source": {
|
|
284
284
|
"type": "path",
|
|
@@ -320,9 +320,9 @@
|
|
|
320
320
|
"kind": "mcp",
|
|
321
321
|
"name": "dev.ocean/ocean",
|
|
322
322
|
"description": "Ocean's own MCP server: workspace status, tasks, handoffs, sessions and the brain.",
|
|
323
|
-
"version": "1.
|
|
323
|
+
"version": "1.3.0",
|
|
324
324
|
"engines": {
|
|
325
|
-
"ocean": ">=1.
|
|
325
|
+
"ocean": ">=1.3.0"
|
|
326
326
|
},
|
|
327
327
|
"source": {
|
|
328
328
|
"type": "path",
|
|
@@ -374,9 +374,9 @@
|
|
|
374
374
|
"npx"
|
|
375
375
|
]
|
|
376
376
|
},
|
|
377
|
-
"version": "1.
|
|
377
|
+
"version": "1.3.0",
|
|
378
378
|
"engines": {
|
|
379
|
-
"ocean": ">=1.
|
|
379
|
+
"ocean": ">=1.3.0"
|
|
380
380
|
},
|
|
381
381
|
"source": {
|
|
382
382
|
"type": "path",
|