@amoree-code/ocean 2.18.0 → 2.19.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/desktop-plugin.js +238 -0
- package/dist/application/clients/registry.js +4 -6
- package/dist/application/clients/status.js +3 -0
- package/dist/interfaces/cli/clients-command.js +21 -1
- package/node_modules/@ocean/brain/package.json +1 -1
- package/node_modules/@ocean/context/package.json +1 -1
- package/node_modules/@ocean/core/dist/domain/mcp/memory-contract.js +5 -1
- package/node_modules/@ocean/core/package.json +1 -1
- package/node_modules/@ocean/loop/dist/hooks/session-start-hook.js +3 -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 +1 -1
- package/node_modules/@ocean/services/package.json +1 -1
- package/ocean-marketplace.json +36 -36
- package/package.json +7 -7
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import { cp, mkdir, rm, writeFile } from "node:fs/promises";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { crc32 } from "node:zlib";
|
|
7
|
+
import { MEMORY_AUTHORITY_LINE } from "@ocean/core/domain/mcp/memory-contract.js";
|
|
8
|
+
import { oceanPath, SYSTEM_DIR } from "@ocean/core/shared/paths.js";
|
|
9
|
+
// Claude Desktop's chat has no hook setting Ocean can write, and its own memory prompt outranks
|
|
10
|
+
// the MCP server's instructions (T-328: asked alone "where is my memory saved?", chat named
|
|
11
|
+
// Anthropic's store). A plugin's SessionStart hook runs in chat and Cowork, so the plugin carries
|
|
12
|
+
// the authority line into context before the first turn.
|
|
13
|
+
//
|
|
14
|
+
// Installed with no user step: Desktop syncs every plugin in its organization plugins folder at
|
|
15
|
+
// launch and at each session start, and installs one whose manifest says
|
|
16
|
+
// `installationPreference: "required"` (claude.com/docs/third-party/claude-desktop/extensions).
|
|
17
|
+
// The folder is admin-only, so writing it asks for the admin password once — and again only
|
|
18
|
+
// when the plugin's content changes, since its version is a hash of that content. Hooks from
|
|
19
|
+
// that folder do not run in Code sessions, which already get Ocean's own start hook.
|
|
20
|
+
//
|
|
21
|
+
// Static on purpose: chat hooks run sandboxed (the probe's log write never landed on the host),
|
|
22
|
+
// so the hook cannot reach the `ocean` engine.
|
|
23
|
+
export const DESKTOP_PLUGIN_NAME = "ocean";
|
|
24
|
+
// Where Desktop reads organization plugins; Linux has none. OCEAN_DESKTOP_ORG_PLUGINS overrides.
|
|
25
|
+
export function desktopOrgPluginsDir(platform = process.platform) {
|
|
26
|
+
const override = process.env.OCEAN_DESKTOP_ORG_PLUGINS;
|
|
27
|
+
if (override)
|
|
28
|
+
return override;
|
|
29
|
+
if (platform === "darwin")
|
|
30
|
+
return "/Library/Application Support/Claude/org-plugins";
|
|
31
|
+
if (platform === "win32")
|
|
32
|
+
return "C:\\Program Files\\Claude\\org-plugins";
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
function desktopPluginFile() {
|
|
36
|
+
return oceanPath(SYSTEM_DIR, "state", "clients", "ocean-desktop-plugin.zip");
|
|
37
|
+
}
|
|
38
|
+
function desktopPluginStaging() {
|
|
39
|
+
return oceanPath(SYSTEM_DIR, "state", "clients", "desktop-plugin");
|
|
40
|
+
}
|
|
41
|
+
const DESKTOP_PLUGIN_UPLOAD = "Claude Desktop → Customize → Plugins → + → Upload plugin, choose this file, then quit Claude (⌘Q) and reopen it";
|
|
42
|
+
const json = (value) => `${JSON.stringify(value, null, 2)}\n`;
|
|
43
|
+
function hookFiles() {
|
|
44
|
+
return {
|
|
45
|
+
"hooks/hooks.json": json({
|
|
46
|
+
hooks: {
|
|
47
|
+
SessionStart: [
|
|
48
|
+
{
|
|
49
|
+
hooks: [
|
|
50
|
+
{
|
|
51
|
+
type: "command",
|
|
52
|
+
// biome-ignore lint/suspicious/noTemplateCurlyInString: expanded by Desktop, not JS
|
|
53
|
+
command: 'cat "${CLAUDE_PLUGIN_ROOT}/hooks/session-start.json"',
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
}),
|
|
60
|
+
"hooks/session-start.json": json({
|
|
61
|
+
hookSpecificOutput: {
|
|
62
|
+
hookEventName: "SessionStart",
|
|
63
|
+
additionalContext: MEMORY_AUTHORITY_LINE,
|
|
64
|
+
},
|
|
65
|
+
}),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
// Changes only when the hook does, so an Ocean upgrade alone never asks for the password again.
|
|
69
|
+
function contentVersion() {
|
|
70
|
+
const hash = createHash("sha256");
|
|
71
|
+
for (const [name, text] of Object.entries(hookFiles()))
|
|
72
|
+
hash.update(`${name}\0${text}\0`);
|
|
73
|
+
return `1.0.0-${hash.digest("hex").slice(0, 12)}`;
|
|
74
|
+
}
|
|
75
|
+
// The plugin's files, by path inside the plugin folder.
|
|
76
|
+
export function desktopPluginFiles(version = contentVersion()) {
|
|
77
|
+
return {
|
|
78
|
+
".claude-plugin/plugin.json": json({
|
|
79
|
+
name: DESKTOP_PLUGIN_NAME,
|
|
80
|
+
version,
|
|
81
|
+
description: "Ocean is your single memory: every Claude Desktop session starts knowing it, and asks Ocean before its own memory.",
|
|
82
|
+
author: { name: "Ocean" },
|
|
83
|
+
homepage: "https://github.com/amoree-code/ocean",
|
|
84
|
+
installationPreference: "required",
|
|
85
|
+
}),
|
|
86
|
+
"version.json": json({ version }),
|
|
87
|
+
...hookFiles(),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
// A stored (uncompressed) zip with a fixed timestamp, so the same files give the same bytes.
|
|
91
|
+
// Folder entries precede their files, as `zip` writes them.
|
|
92
|
+
export function zipStored(files) {
|
|
93
|
+
const entries = [];
|
|
94
|
+
const folders = new Set();
|
|
95
|
+
for (const [name, text] of Object.entries(files)) {
|
|
96
|
+
const parts = name.split("/");
|
|
97
|
+
for (let depth = 1; depth < parts.length; depth++) {
|
|
98
|
+
const folder = `${parts.slice(0, depth).join("/")}/`;
|
|
99
|
+
if (!folders.has(folder)) {
|
|
100
|
+
folders.add(folder);
|
|
101
|
+
entries.push([folder, Buffer.alloc(0)]);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
entries.push([name, Buffer.from(text, "utf8")]);
|
|
105
|
+
}
|
|
106
|
+
const DOS_DATE = (0 << 9) | (1 << 5) | 1; // 1980-01-01
|
|
107
|
+
const locals = [];
|
|
108
|
+
const centrals = [];
|
|
109
|
+
let offset = 0;
|
|
110
|
+
for (const [name, data] of entries) {
|
|
111
|
+
const nameBytes = Buffer.from(name, "utf8");
|
|
112
|
+
const crc = crc32(data);
|
|
113
|
+
const local = Buffer.alloc(30);
|
|
114
|
+
local.writeUInt32LE(0x04034b50, 0);
|
|
115
|
+
local.writeUInt16LE(20, 4); // version needed
|
|
116
|
+
local.writeUInt16LE(0x0800, 6); // UTF-8 names
|
|
117
|
+
local.writeUInt16LE(0, 8); // stored
|
|
118
|
+
local.writeUInt16LE(0, 10);
|
|
119
|
+
local.writeUInt16LE(DOS_DATE, 12);
|
|
120
|
+
local.writeUInt32LE(crc, 14);
|
|
121
|
+
local.writeUInt32LE(data.length, 18);
|
|
122
|
+
local.writeUInt32LE(data.length, 22);
|
|
123
|
+
local.writeUInt16LE(nameBytes.length, 26);
|
|
124
|
+
local.writeUInt16LE(0, 28);
|
|
125
|
+
const central = Buffer.alloc(46);
|
|
126
|
+
central.writeUInt32LE(0x02014b50, 0);
|
|
127
|
+
central.writeUInt16LE((3 << 8) | 20, 4); // made by: Unix
|
|
128
|
+
central.writeUInt16LE(20, 6);
|
|
129
|
+
central.writeUInt16LE(0x0800, 8);
|
|
130
|
+
central.writeUInt16LE(0, 10);
|
|
131
|
+
central.writeUInt16LE(0, 12);
|
|
132
|
+
central.writeUInt16LE(DOS_DATE, 14);
|
|
133
|
+
central.writeUInt32LE(crc, 16);
|
|
134
|
+
central.writeUInt32LE(data.length, 20);
|
|
135
|
+
central.writeUInt32LE(data.length, 24);
|
|
136
|
+
central.writeUInt16LE(nameBytes.length, 28);
|
|
137
|
+
central.writeUInt32LE(0, 30); // extra and comment lengths
|
|
138
|
+
central.writeUInt32LE(0, 34); // disk start and internal attributes
|
|
139
|
+
const mode = name.endsWith("/") ? 0o40755 : 0o100644;
|
|
140
|
+
central.writeUInt32LE((mode << 16) >>> 0, 38);
|
|
141
|
+
central.writeUInt32LE(offset, 42);
|
|
142
|
+
locals.push(local, nameBytes, data);
|
|
143
|
+
centrals.push(central, nameBytes);
|
|
144
|
+
offset += local.length + nameBytes.length + data.length;
|
|
145
|
+
}
|
|
146
|
+
const directory = Buffer.concat(centrals);
|
|
147
|
+
const end = Buffer.alloc(22);
|
|
148
|
+
end.writeUInt32LE(0x06054b50, 0);
|
|
149
|
+
end.writeUInt16LE(entries.length, 8);
|
|
150
|
+
end.writeUInt16LE(entries.length, 10);
|
|
151
|
+
end.writeUInt32LE(directory.length, 12);
|
|
152
|
+
end.writeUInt32LE(offset, 16);
|
|
153
|
+
return Buffer.concat([...locals, directory, end]);
|
|
154
|
+
}
|
|
155
|
+
// True when the folder Desktop reads holds exactly this plugin. Readable without admin rights.
|
|
156
|
+
export function desktopPluginInstalled(orgDir = desktopOrgPluginsDir()) {
|
|
157
|
+
if (!orgDir)
|
|
158
|
+
return false;
|
|
159
|
+
const target = path.join(orgDir, DESKTOP_PLUGIN_NAME);
|
|
160
|
+
try {
|
|
161
|
+
return Object.entries(desktopPluginFiles()).every(([name, text]) => readFileSync(path.join(target, name), "utf8") === text);
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
const shellQuote = (value) => `'${value.replaceAll("'", "'\\''")}'`;
|
|
168
|
+
const psQuote = (value) => `'${value.replaceAll("'", "''")}'`;
|
|
169
|
+
// Copies the staged plugin into the admin-only folder behind the system's own password prompt.
|
|
170
|
+
function elevatedCopy(staging, target, platform = process.platform) {
|
|
171
|
+
const orgDir = path.dirname(target);
|
|
172
|
+
if (platform === "darwin") {
|
|
173
|
+
const sh = `mkdir -p ${shellQuote(orgDir)} && rm -rf ${shellQuote(target)} && cp -R ${shellQuote(staging)} ${shellQuote(target)}`;
|
|
174
|
+
const escaped = sh.replaceAll("\\", "\\\\").replaceAll('"', '\\"');
|
|
175
|
+
execFileSync("osascript", [
|
|
176
|
+
"-e",
|
|
177
|
+
`do shell script "${escaped}" with prompt "Ocean installs its Claude Desktop plugin." with administrator privileges`,
|
|
178
|
+
], { stdio: "ignore" });
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (platform === "win32") {
|
|
182
|
+
const inner = `New-Item -ItemType Directory -Force -Path ${psQuote(orgDir)} | Out-Null; if (Test-Path ${psQuote(target)}) { Remove-Item -Recurse -Force ${psQuote(target)} }; Copy-Item -Recurse ${psQuote(staging)} ${psQuote(target)}`;
|
|
183
|
+
const encoded = Buffer.from(inner, "utf16le").toString("base64");
|
|
184
|
+
execFileSync("powershell", [
|
|
185
|
+
"-NoProfile",
|
|
186
|
+
"-Command",
|
|
187
|
+
`Start-Process powershell -Verb RunAs -Wait -ArgumentList '-NoProfile','-EncodedCommand','${encoded}'`,
|
|
188
|
+
], { stdio: "ignore" });
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
throw new Error(`no elevated copy on ${platform}`);
|
|
192
|
+
}
|
|
193
|
+
async function directCopy(staging, target) {
|
|
194
|
+
await mkdir(path.dirname(target), { recursive: true });
|
|
195
|
+
await rm(target, { recursive: true, force: true });
|
|
196
|
+
await cp(staging, target, { recursive: true });
|
|
197
|
+
}
|
|
198
|
+
const NEXT_SYNC = "Claude Desktop installs it at its next launch or new session; nothing to upload";
|
|
199
|
+
// Puts the plugin where Desktop installs it by itself. Only when that folder does not exist on
|
|
200
|
+
// this platform, or the admin prompt is declined, does it fall back to a zip to upload.
|
|
201
|
+
export async function installDesktopPlugin(options = {}) {
|
|
202
|
+
const orgDir = "orgDir" in options ? options.orgDir : desktopOrgPluginsDir();
|
|
203
|
+
const manual = async (reason) => {
|
|
204
|
+
const file = desktopPluginFile();
|
|
205
|
+
await mkdir(path.dirname(file), { recursive: true });
|
|
206
|
+
await writeFile(file, zipStored(desktopPluginFiles()));
|
|
207
|
+
return { status: "manual", file, reason, next: DESKTOP_PLUGIN_UPLOAD };
|
|
208
|
+
};
|
|
209
|
+
if (!orgDir)
|
|
210
|
+
return manual(`Claude Desktop reads no organization plugins folder on ${process.platform}`);
|
|
211
|
+
const target = path.join(orgDir, DESKTOP_PLUGIN_NAME);
|
|
212
|
+
if (desktopPluginInstalled(orgDir))
|
|
213
|
+
return { status: "current", dir: target, next: "" };
|
|
214
|
+
const staging = path.join(options.staging ?? desktopPluginStaging(), DESKTOP_PLUGIN_NAME);
|
|
215
|
+
await rm(staging, { recursive: true, force: true });
|
|
216
|
+
for (const [name, text] of Object.entries(desktopPluginFiles())) {
|
|
217
|
+
await mkdir(path.dirname(path.join(staging, name)), { recursive: true });
|
|
218
|
+
await writeFile(path.join(staging, name), text);
|
|
219
|
+
}
|
|
220
|
+
try {
|
|
221
|
+
await (options.copy ?? directCopy)(staging, target);
|
|
222
|
+
}
|
|
223
|
+
catch (error) {
|
|
224
|
+
const code = error.code;
|
|
225
|
+
if (code !== "EACCES" && code !== "EPERM")
|
|
226
|
+
throw error;
|
|
227
|
+
try {
|
|
228
|
+
(options.elevate ?? elevatedCopy)(staging, target);
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
return manual("the admin password prompt was declined or failed");
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
if (!desktopPluginInstalled(orgDir))
|
|
235
|
+
return manual(`the plugin did not land in ${target}`);
|
|
236
|
+
return { status: "installed", dir: target, next: NEXT_SYNC };
|
|
237
|
+
}
|
|
238
|
+
//# sourceMappingURL=desktop-plugin.js.map
|
|
@@ -37,12 +37,10 @@ export const CLIENT_ADAPTERS = [
|
|
|
37
37
|
editor: jsonEditor(["mcpServers"]),
|
|
38
38
|
},
|
|
39
39
|
nativeMemory: "capture",
|
|
40
|
-
//
|
|
41
|
-
//
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
{ name: "local-agent-mode-ocean", mode: "agent" },
|
|
45
|
-
],
|
|
40
|
+
// Older builds sent `claude-ai` from chat and `local-agent-mode-<server>` from agent mode.
|
|
41
|
+
// Current builds send the agent-mode name from plain chat too (T-328: a chat call landed as
|
|
42
|
+
// `local-agent-mode-ocean`), so the name no longer tells the modes apart: one row, no modes.
|
|
43
|
+
mcpClients: [{ name: "claude-ai" }, { name: "local-agent-mode-ocean" }],
|
|
46
44
|
},
|
|
47
45
|
{
|
|
48
46
|
id: "codex",
|
|
@@ -117,6 +117,9 @@ export function buildClientStatus(input) {
|
|
|
117
117
|
const watcher = input.watcher.find((item) => item.client === plan.client);
|
|
118
118
|
if (watcher && watcher.status !== "current")
|
|
119
119
|
notes.push(`chat watcher ${watcher.status}`);
|
|
120
|
+
if (plan.client === "claude-desktop" &&
|
|
121
|
+
input.desktopPlugin?.installed === false)
|
|
122
|
+
notes.push("start plugin not installed: run `ocean clients desktop-plugin`");
|
|
120
123
|
if (plan.tier !== "supported" && plan.reason)
|
|
121
124
|
notes.push(plan.reason);
|
|
122
125
|
clients.push({
|
|
@@ -4,12 +4,13 @@ import { marketplacePaths } from "@ocean/market/install/default-marketplace.js";
|
|
|
4
4
|
import { updateGatewayAccess } from "@ocean/market/mcp/mcp-gateway.js";
|
|
5
5
|
import { readCallLedger, summarizeCallLedger, } from "@ocean/services/infrastructure/mcp/call-ledger.js";
|
|
6
6
|
import { applyClients, attributeLedger, confirmClient, defaultClientEnv, gatewayDefault, planClients, readGatewayClients, recordVerification, repairClients, restoreClients, setGatewayClient, setGatewayDefault, temporaryEntryProblem, verifyClient, } from "../../application/clients/clients.js";
|
|
7
|
+
import { desktopPluginInstalled, installDesktopPlugin, } from "../../application/clients/desktop-plugin.js";
|
|
7
8
|
import { applyDesktopWatcher, planDesktopWatcher, restoreDesktopWatcher, } from "../../application/clients/desktop-watcher.js";
|
|
8
9
|
import { applyHooks, planHooks, restoreHooks, } from "../../application/clients/hooks.js";
|
|
9
10
|
import { applyNative, planNative, restoreNative, } from "../../application/clients/native.js";
|
|
10
11
|
import { applyOpencodePlugin, planOpencodePlugin, restoreOpencodePlugin, } from "../../application/clients/opencode-plugin.js";
|
|
11
12
|
import { buildClientStatus, formatClientStatus, } from "../../application/clients/status.js";
|
|
12
|
-
const usage = "Usage: ocean clients status [--json] [--days <n>] | detect|plan [--json] | apply [--client <id>…] [--yes] [--session-facts on|off] | verify [<id>…] | confirm <id>… --label in-app|headless|connected|blocked [--via <evidence>] [--reason <why>] | gateway [<id> on|off] [--default gateway|per-server] | allow|deny|unset <id> <server> | ledger | repair | restore [--batch <id>]";
|
|
13
|
+
const usage = "Usage: ocean clients status [--json] [--days <n>] | detect|plan [--json] | apply [--client <id>…] [--yes] [--session-facts on|off] | desktop-plugin | verify [<id>…] | confirm <id>… --label in-app|headless|connected|blocked [--via <evidence>] [--reason <why>] | gateway [<id> on|off] [--default gateway|per-server] | allow|deny|unset <id> <server> | ledger | repair | restore [--batch <id>]";
|
|
13
14
|
export const SESSION_FACTS_QUESTION = "Capture durable facts from your sessions automatically? It costs one small model call per session, run by the client the session was in. Every fact goes to your review queue; nothing is saved without your approval, even with auto-approve on. [y/N] ";
|
|
14
15
|
// The session-facts answer, asked once (T-313): `--session-facts on|off` decides; otherwise a
|
|
15
16
|
// terminal is asked; with no terminal and no saved answer it stays unset (off), and
|
|
@@ -62,6 +63,7 @@ export async function runClientsCommand(args) {
|
|
|
62
63
|
plugins: await planOpencodePlugin(),
|
|
63
64
|
native: await planNative(),
|
|
64
65
|
watcher: await planDesktopWatcher(),
|
|
66
|
+
desktopPlugin: { installed: desktopPluginInstalled() },
|
|
65
67
|
calls: await readCallLedger(),
|
|
66
68
|
days,
|
|
67
69
|
});
|
|
@@ -139,12 +141,30 @@ export async function runClientsCommand(args) {
|
|
|
139
141
|
.results,
|
|
140
142
|
sessionFacts: await sessionFactsAnswer(values("--session-facts")[0]),
|
|
141
143
|
};
|
|
144
|
+
// Claude Desktop's start plugin (T-328): written to the folder Desktop installs from by
|
|
145
|
+
// itself, behind one admin password prompt.
|
|
146
|
+
const desktop = (await planClients()).find((plan) => plan.client === "claude-desktop");
|
|
147
|
+
const desktopPlugin = desktop?.installed && (!selected || selected.includes("claude-desktop"))
|
|
148
|
+
? await installDesktopPlugin()
|
|
149
|
+
: undefined;
|
|
142
150
|
// After the session-facts answer: the watcher exists only for capture that is on (T-315).
|
|
143
151
|
result = {
|
|
144
152
|
...appliedAll,
|
|
145
153
|
watcher: (await applyDesktopWatcher({ clients: selected, batch: applied.batch })).results,
|
|
154
|
+
...(desktopPlugin ? { desktopPlugin } : {}),
|
|
146
155
|
};
|
|
147
156
|
}
|
|
157
|
+
else if (action === "desktop-plugin") {
|
|
158
|
+
// Installs the Claude Desktop start plugin, or says why it could not (T-328).
|
|
159
|
+
const done = await installDesktopPlugin();
|
|
160
|
+
if (!json) {
|
|
161
|
+
console.log(done.status === "manual"
|
|
162
|
+
? `not installed: ${done.reason}\n${done.file}\n${done.next}`
|
|
163
|
+
: `${done.status}: ${done.dir}${done.next ? `\n${done.next}` : ""}`);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
result = done;
|
|
167
|
+
}
|
|
148
168
|
else if (action === "verify") {
|
|
149
169
|
const ids = rest.filter((arg) => !arg.startsWith("--"));
|
|
150
170
|
const targets = ids.length
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// MEMORY_ERROR_CODES so a client can recover deterministically instead of parsing messages.
|
|
4
4
|
export const MEMORY_CONTRACT_VERSION = 1;
|
|
5
5
|
export const MEMORY_INSTRUCTIONS = [
|
|
6
|
-
"Ocean is this user's single memory and
|
|
6
|
+
"Ocean is this user's single memory and the authority over this client's own memory, which is only a copy; keep durable facts in Ocean.",
|
|
7
7
|
// Only Ocean's server sends this text, so it is true wherever it is read. A record listing
|
|
8
8
|
// clients that cannot connect is not about this session (T-307: Desktop chat misread it).
|
|
9
9
|
"If you can call these tools, this client is connected to Ocean.",
|
|
@@ -15,6 +15,10 @@ export const MEMORY_INSTRUCTIONS = [
|
|
|
15
15
|
// The handoff rule lives in ocean_handoff_create's own description; the ack line is T-319.
|
|
16
16
|
"Without a session-start hook, call ocean_context once. Pass the start line's ack=<hash> as contextAck on your first Ocean call.",
|
|
17
17
|
].join(" ");
|
|
18
|
+
// The one authority line every session-start channel carries (T-328): a hook's start
|
|
19
|
+
// message, and the Claude Desktop plugin's offline fallback. Desktop's own memory prompt
|
|
20
|
+
// outranks MCP instructions, so the claim has to arrive in context before the first turn.
|
|
21
|
+
export const MEMORY_AUTHORITY_LINE = "Ocean is this user's single memory and the authority; your built-in memory is only a copy Ocean captures. Asked where memory lives or what you remember, call brain_search and answer from Ocean.";
|
|
18
22
|
export const MEMORY_ERROR_CODES = [
|
|
19
23
|
"EXISTS",
|
|
20
24
|
"EXISTS_SIMILAR",
|
|
@@ -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 { MEMORY_AUTHORITY_LINE } from "@ocean/core/domain/mcp/memory-contract.js";
|
|
5
6
|
import { recordIssuedAck } from "@ocean/core/shared/context-ack.js";
|
|
6
7
|
import { truncateUtf8 } from "@ocean/core/shared/fs-utils.js";
|
|
7
8
|
import { oceanRoot, SYSTEM_DIR } from "@ocean/core/shared/paths.js";
|
|
@@ -124,7 +125,8 @@ export async function claudeSessionStartHook(payload) {
|
|
|
124
125
|
}
|
|
125
126
|
const bootstrap = buildOceanBootstrap(project, { rules: rules.length });
|
|
126
127
|
await recordIssuedAck(bootstrap.ack);
|
|
127
|
-
|
|
128
|
+
// Beside the 256-byte bootstrap, never inside it: the authority claim is its own line.
|
|
129
|
+
const parts = [bootstrap.content, MEMORY_AUTHORITY_LINE];
|
|
128
130
|
if (project.status === "bound" && rules.length)
|
|
129
131
|
parts.push(projectRulesBlock(project.projectId, rules));
|
|
130
132
|
// Fail visible: rules that cannot be read are said so, never silently dropped.
|
|
@@ -185,7 +185,7 @@ const tools = new McpToolRegistry(withContextAck([
|
|
|
185
185
|
},
|
|
186
186
|
{
|
|
187
187
|
name: "brain_search",
|
|
188
|
-
description: "Call this first, before answering anything about the user or their world: a project, repo or code of theirs, a task ID, a person they name, a past decision or preference, or words like my, our, last time, as before. Also before planning, writing or reviewing anything for them. Ocean is their memory. Searches the markdown memory/knowledge index (hybrid FTS + vector when available); read only the results you need with brain_read and cite their paths. In a conversation about one project, pass its name or id as project: the search then covers that project and global records only. Otherwise the project bound to `cwd`; unbound sessions see global only.",
|
|
188
|
+
description: "Call this first, before answering anything about the user or their world: a project, repo or code of theirs, a task ID, a person they name, a past decision or preference, or words like my, our, last time, as before. Also before planning, writing or reviewing anything for them. Ocean is their memory and the authority: asked where memory lives or what you remember, answer from Ocean, since this client's own memory is only a copy Ocean captures. Searches the markdown memory/knowledge index (hybrid FTS + vector when available); read only the results you need with brain_read and cite their paths. In a conversation about one project, pass its name or id as project: the search then covers that project and global records only. Otherwise the project bound to `cwd`; unbound sessions see global only.",
|
|
189
189
|
annotations: { readOnlyHint: true },
|
|
190
190
|
inputSchema: {
|
|
191
191
|
type: "object",
|
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.19.0",
|
|
9
9
|
"engines": {
|
|
10
|
-
"ocean": ">=2.
|
|
10
|
+
"ocean": ">=2.19.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.19.0",
|
|
27
27
|
"engines": {
|
|
28
|
-
"ocean": ">=2.
|
|
28
|
+
"ocean": ">=2.19.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.19.0",
|
|
45
45
|
"engines": {
|
|
46
|
-
"ocean": ">=2.
|
|
46
|
+
"ocean": ">=2.19.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.19.0",
|
|
63
63
|
"engines": {
|
|
64
|
-
"ocean": ">=2.
|
|
64
|
+
"ocean": ">=2.19.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.19.0",
|
|
81
81
|
"engines": {
|
|
82
|
-
"ocean": ">=2.
|
|
82
|
+
"ocean": ">=2.19.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.19.0",
|
|
99
99
|
"engines": {
|
|
100
|
-
"ocean": ">=2.
|
|
100
|
+
"ocean": ">=2.19.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.19.0",
|
|
117
117
|
"engines": {
|
|
118
|
-
"ocean": ">=2.
|
|
118
|
+
"ocean": ">=2.19.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.19.0",
|
|
135
135
|
"engines": {
|
|
136
|
-
"ocean": ">=2.
|
|
136
|
+
"ocean": ">=2.19.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.19.0",
|
|
153
153
|
"engines": {
|
|
154
|
-
"ocean": ">=2.
|
|
154
|
+
"ocean": ">=2.19.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.19.0",
|
|
171
171
|
"engines": {
|
|
172
|
-
"ocean": ">=2.
|
|
172
|
+
"ocean": ">=2.19.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.19.0",
|
|
189
189
|
"engines": {
|
|
190
|
-
"ocean": ">=2.
|
|
190
|
+
"ocean": ">=2.19.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.19.0",
|
|
207
207
|
"engines": {
|
|
208
|
-
"ocean": ">=2.
|
|
208
|
+
"ocean": ">=2.19.0"
|
|
209
209
|
},
|
|
210
210
|
"source": {
|
|
211
211
|
"type": "path",
|
|
@@ -258,9 +258,9 @@
|
|
|
258
258
|
"npx"
|
|
259
259
|
]
|
|
260
260
|
},
|
|
261
|
-
"version": "2.
|
|
261
|
+
"version": "2.19.0",
|
|
262
262
|
"engines": {
|
|
263
|
-
"ocean": ">=2.
|
|
263
|
+
"ocean": ">=2.19.0"
|
|
264
264
|
},
|
|
265
265
|
"source": {
|
|
266
266
|
"type": "path",
|
|
@@ -379,9 +379,9 @@
|
|
|
379
379
|
"npx"
|
|
380
380
|
]
|
|
381
381
|
},
|
|
382
|
-
"version": "2.
|
|
382
|
+
"version": "2.19.0",
|
|
383
383
|
"engines": {
|
|
384
|
-
"ocean": ">=2.
|
|
384
|
+
"ocean": ">=2.19.0"
|
|
385
385
|
},
|
|
386
386
|
"source": {
|
|
387
387
|
"type": "path",
|
|
@@ -445,9 +445,9 @@
|
|
|
445
445
|
"kind": "mcp",
|
|
446
446
|
"name": "dev.ocean/mcp-gateway",
|
|
447
447
|
"description": "One MCP endpoint for every registered server: Ocean's own and those installed from the marketplace.",
|
|
448
|
-
"version": "2.
|
|
448
|
+
"version": "2.19.0",
|
|
449
449
|
"engines": {
|
|
450
|
-
"ocean": ">=2.
|
|
450
|
+
"ocean": ">=2.19.0"
|
|
451
451
|
},
|
|
452
452
|
"source": {
|
|
453
453
|
"type": "path",
|
|
@@ -489,9 +489,9 @@
|
|
|
489
489
|
"kind": "mcp",
|
|
490
490
|
"name": "dev.ocean/obsidian",
|
|
491
491
|
"description": "Ocean's Obsidian vault bridge over MCP.",
|
|
492
|
-
"version": "2.
|
|
492
|
+
"version": "2.19.0",
|
|
493
493
|
"engines": {
|
|
494
|
-
"ocean": ">=2.
|
|
494
|
+
"ocean": ">=2.19.0"
|
|
495
495
|
},
|
|
496
496
|
"source": {
|
|
497
497
|
"type": "path",
|
|
@@ -533,9 +533,9 @@
|
|
|
533
533
|
"kind": "mcp",
|
|
534
534
|
"name": "dev.ocean/ocean",
|
|
535
535
|
"description": "Ocean's own MCP server: workspace status, tasks, handoffs, sessions and the brain.",
|
|
536
|
-
"version": "2.
|
|
536
|
+
"version": "2.19.0",
|
|
537
537
|
"engines": {
|
|
538
|
-
"ocean": ">=2.
|
|
538
|
+
"ocean": ">=2.19.0"
|
|
539
539
|
},
|
|
540
540
|
"source": {
|
|
541
541
|
"type": "path",
|
|
@@ -587,9 +587,9 @@
|
|
|
587
587
|
"npx"
|
|
588
588
|
]
|
|
589
589
|
},
|
|
590
|
-
"version": "2.
|
|
590
|
+
"version": "2.19.0",
|
|
591
591
|
"engines": {
|
|
592
|
-
"ocean": ">=2.
|
|
592
|
+
"ocean": ">=2.19.0"
|
|
593
593
|
},
|
|
594
594
|
"source": {
|
|
595
595
|
"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.19.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.19.0",
|
|
57
|
+
"@ocean/context": "2.19.0",
|
|
58
|
+
"@ocean/core": "2.19.0",
|
|
59
|
+
"@ocean/loop": "2.19.0",
|
|
60
|
+
"@ocean/market": "2.19.0",
|
|
61
|
+
"@ocean/services": "2.19.0",
|
|
62
62
|
"playwright-core": "^1.48.0",
|
|
63
63
|
"sqlite-vec": "0.1.9",
|
|
64
64
|
"zod": "^4.6.5"
|