@amoree-code/ocean 2.2.1 → 2.2.3
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 -0
- package/dist/interfaces/cli/command-registry.js +2 -0
- package/dist/interfaces/cli/help-command.js +5 -1
- package/dist/interfaces/cli/scorecard-command.js +89 -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/dist/tasks/claim-task.js +10 -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/scorecard/scorecard.js +288 -0
- package/node_modules/@ocean/services/package.json +1 -1
- package/ocean-marketplace.json +34 -34
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -167,6 +167,7 @@ prints its usage and never runs it. To hand `--help` to a wrapped client, put it
|
|
|
167
167
|
| `ocean harvest` | a day's sessions from every client into its summary; decisions, fixes and lessons filed into knowledge (undo per day); archive after 30 days | Writes |
|
|
168
168
|
| `ocean rhythm` | the day's rhythm, once per period and with no model: morning note, harvest, archive, last week's digest, last month's review (the service runs it) | Writes |
|
|
169
169
|
| `ocean telemetry` | recurring session errors and failing providers, as proposed backlog lines | Writes |
|
|
170
|
+
| `ocean scorecard` | Ocean's health numbers from real data: clients working, sessions verified and linked to tasks, attributed memory writes, search mode, schedules, lessons | Reads; `--write` saves `01-daily/scorecard/` |
|
|
170
171
|
| `ocean express` | draft a CV section, LinkedIn post or scholarship paragraph from milestones | Writes |
|
|
171
172
|
| `ocean handoff` | hand work from one session or client to another | Reads; `create` writes |
|
|
172
173
|
| `ocean daily` | the morning half of today's note: focus, coming up, open loops, your hours, what waits on you, the brief | Reads; `--apply` writes |
|
|
@@ -80,6 +80,7 @@ import { runProfilesCommand } from "./profiles-command.js";
|
|
|
80
80
|
import { runPullCommand } from "./pull-command.js";
|
|
81
81
|
import { runRhythmCommand } from "./rhythm-command.js";
|
|
82
82
|
import { runningServerFindings } from "./running-server-findings.js";
|
|
83
|
+
import { runScorecardCommand } from "./scorecard-command.js";
|
|
83
84
|
import { insideFactsCall, runSessionFactsCommand, startSessionFacts, } from "./session-facts-command.js";
|
|
84
85
|
import { parseSetupArgs, SETUP_USAGE, setup } from "./setup-command.js";
|
|
85
86
|
import { runTasksCommand } from "./tasks-command.js";
|
|
@@ -1284,6 +1285,7 @@ export const commandRegistry = {
|
|
|
1284
1285
|
harvest: () => runHarvestCommand(process.argv.slice(3)),
|
|
1285
1286
|
rhythm: () => runRhythmCommand(process.argv.slice(3)),
|
|
1286
1287
|
telemetry: () => runTelemetryCommand(process.argv.slice(3)),
|
|
1288
|
+
scorecard: () => runScorecardCommand(process.argv.slice(3)),
|
|
1287
1289
|
express: () => runExpressCommand(process.argv.slice(3)),
|
|
1288
1290
|
daily: commandDaily,
|
|
1289
1291
|
schedule: commandSchedule,
|
|
@@ -13,7 +13,7 @@ const commandGroups = [
|
|
|
13
13
|
],
|
|
14
14
|
[
|
|
15
15
|
"Knowledge",
|
|
16
|
-
"memory, pull, desktop, observe, capture, note, brief, interests, distill, harvest, rhythm, telemetry, express, handoff, idea, daily, skill, catalog",
|
|
16
|
+
"memory, pull, desktop, observe, capture, note, brief, interests, distill, harvest, rhythm, telemetry, scorecard, express, handoff, idea, daily, skill, catalog",
|
|
17
17
|
],
|
|
18
18
|
["Integrations", "obsidian, hook, migrate, layout, env"],
|
|
19
19
|
];
|
|
@@ -180,6 +180,10 @@ export const commandHelp = {
|
|
|
180
180
|
"Find recurring errors and failing providers in recent sessions; propose them as backlog lines.",
|
|
181
181
|
"ocean telemetry [--days N] [--yes]",
|
|
182
182
|
],
|
|
183
|
+
scorecard: [
|
|
184
|
+
"Print Ocean's health numbers from real data; --write saves 01-daily/scorecard/YYYY-MM-DD.md.",
|
|
185
|
+
"ocean scorecard [--json] [--write]",
|
|
186
|
+
],
|
|
183
187
|
express: [
|
|
184
188
|
"Draft a CV section, LinkedIn post or scholarship paragraph from your milestones into 00-inbox/drafts/.",
|
|
185
189
|
"ocean express cv|linkedin|scholarship [--dry-run]",
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { brainSearch, ensureIndexBuilt, } from "@ocean/brain/brain/brain-service.js";
|
|
2
|
+
import { brainIndexPort } from "@ocean/brain/infrastructure/brain/brain-index.js";
|
|
3
|
+
import { readAudit } from "@ocean/brain/memory/memory-audit.js";
|
|
4
|
+
import { localDate } from "@ocean/core/shared/local-date.js";
|
|
5
|
+
import { openSessionStoreReadOnly } from "@ocean/loop/infrastructure/persistence/session-store.js";
|
|
6
|
+
import { readLessonFrontmatter, readTaskFrontmatter, renderTable, scorecardRows, sessionTokens, writeScorecard, } from "@ocean/services/scorecard/scorecard.js";
|
|
7
|
+
import { clientFindings } from "../../application/clients/clients.js";
|
|
8
|
+
import { CLIENT_ADAPTERS } from "../../application/clients/registry.js";
|
|
9
|
+
import { listSchedules } from "../../application/scheduler/local-scheduler.js";
|
|
10
|
+
import { createOllamaEmbedder } from "../../infrastructure/providers/ollama-embedder.js";
|
|
11
|
+
// Every name a client can write under: its id, the MCP clientInfo names it sends, and Claude's
|
|
12
|
+
// web chat as `ocean pull` imports it.
|
|
13
|
+
const CLIENT_NAMES = new Set([
|
|
14
|
+
...CLIENT_ADAPTERS.flatMap((adapter) => [
|
|
15
|
+
adapter.id,
|
|
16
|
+
...(adapter.mcpClients ?? []).map((client) => client.name),
|
|
17
|
+
]),
|
|
18
|
+
"claude.ai",
|
|
19
|
+
]);
|
|
20
|
+
const USAGE = "Usage: ocean scorecard [--json] [--write]";
|
|
21
|
+
// One search the way the MCP server runs brain_search: with the local embedder when it answers.
|
|
22
|
+
async function probeSearch() {
|
|
23
|
+
const result = await brainSearch({
|
|
24
|
+
query: "ocean",
|
|
25
|
+
limit: 1,
|
|
26
|
+
indexPort: brainIndexPort,
|
|
27
|
+
embedder: await createOllamaEmbedder().catch(() => null),
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
built: true,
|
|
31
|
+
mode: result.mode,
|
|
32
|
+
stale: result.stale,
|
|
33
|
+
vector: result.vector,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
async function collect() {
|
|
37
|
+
const store = await openSessionStoreReadOnly();
|
|
38
|
+
let sessions;
|
|
39
|
+
const providers = new Map();
|
|
40
|
+
const tokens = { sessions: 0, reporting: 0, total: 0 };
|
|
41
|
+
try {
|
|
42
|
+
const all = store.list();
|
|
43
|
+
sessions = all;
|
|
44
|
+
tokens.sessions = all.length;
|
|
45
|
+
for (const session of all) {
|
|
46
|
+
providers.set(session.sessionId, session.provider);
|
|
47
|
+
const used = sessionTokens(store.listEvents(session.sessionId));
|
|
48
|
+
if (used === null)
|
|
49
|
+
continue;
|
|
50
|
+
tokens.reporting += 1;
|
|
51
|
+
tokens.total += used;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
finally {
|
|
55
|
+
store.close();
|
|
56
|
+
}
|
|
57
|
+
const search = (await ensureIndexBuilt())
|
|
58
|
+
? await probeSearch()
|
|
59
|
+
: { built: false };
|
|
60
|
+
return {
|
|
61
|
+
clients: await clientFindings(),
|
|
62
|
+
sessions,
|
|
63
|
+
memoryAudit: await readAudit(),
|
|
64
|
+
writers: {
|
|
65
|
+
clients: CLIENT_NAMES,
|
|
66
|
+
sessionProvider: (id) => providers.get(id) ?? null,
|
|
67
|
+
},
|
|
68
|
+
tasks: await readTaskFrontmatter(),
|
|
69
|
+
search,
|
|
70
|
+
searchEval: null,
|
|
71
|
+
schedules: await listSchedules(),
|
|
72
|
+
lessons: await readLessonFrontmatter(),
|
|
73
|
+
tokens,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
// `ocean scorecard [--json] [--write]` (T-318): Ocean's health numbers from real data; --write
|
|
77
|
+
// also saves 01-daily/scorecard/YYYY-MM-DD.md.
|
|
78
|
+
export async function runScorecardCommand(args) {
|
|
79
|
+
const unknown = args.filter((arg) => !["--json", "--write"].includes(arg));
|
|
80
|
+
if (unknown.length)
|
|
81
|
+
throw new Error(USAGE);
|
|
82
|
+
const rows = scorecardRows(await collect());
|
|
83
|
+
console.log(args.includes("--json")
|
|
84
|
+
? JSON.stringify({ date: localDate(), rows }, null, 2)
|
|
85
|
+
: renderTable(rows));
|
|
86
|
+
if (args.includes("--write"))
|
|
87
|
+
console.error(`Saved ${await writeScorecard(rows, localDate())}`);
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=scorecard-command.js.map
|
|
@@ -37,14 +37,23 @@ export function isStale(claim, now = new Date()) {
|
|
|
37
37
|
const claimedAt = Date.parse(claim.at);
|
|
38
38
|
return Number.isNaN(claimedAt) || now.getTime() - claimedAt > CLAIM_TTL_MS;
|
|
39
39
|
}
|
|
40
|
+
// A claim means a session is working on the task, so a waiting task becomes active.
|
|
41
|
+
const STARTS_ON_CLAIM = new Set(["todo", "paused"]);
|
|
40
42
|
// Replace the claim lines in the frontmatter (and bump `updated`), keeping every other line.
|
|
43
|
+
// Claiming also moves a `todo`/`paused` task to `active`; releasing leaves the state alone.
|
|
41
44
|
function withClaim(source, claim, today) {
|
|
42
45
|
const end = source.indexOf("\n---", 4);
|
|
43
46
|
const kept = source
|
|
44
47
|
.slice(4, end)
|
|
45
48
|
.split("\n")
|
|
46
49
|
.filter((line) => !/^claimed_(by|at|paths):/.test(line))
|
|
47
|
-
.map((line) => (/^updated:/.test(line) ? `updated: ${today}` : line))
|
|
50
|
+
.map((line) => (/^updated:/.test(line) ? `updated: ${today}` : line))
|
|
51
|
+
.map((line) => {
|
|
52
|
+
const state = line.match(/^state:\s*(.*)$/)?.[1];
|
|
53
|
+
return claim && state && STARTS_ON_CLAIM.has(unquote(state.trim()))
|
|
54
|
+
? "state: active"
|
|
55
|
+
: line;
|
|
56
|
+
});
|
|
48
57
|
if (claim) {
|
|
49
58
|
kept.push(`claimed_by: ${claim.by}`, `claimed_at: ${claim.at}`);
|
|
50
59
|
if (claim.paths.length)
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { mkdir, readdir, readFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { atomicWrite, parseFrontmatter } from "@ocean/core/shared/fs-utils.js";
|
|
4
|
+
import { DAILY_DIR, KNOWLEDGE_DIR, listProjectDirs, oceanPath, } from "@ocean/core/shared/paths.js";
|
|
5
|
+
const percent = (n, of) => of ? `${Math.round((n / of) * 1000) / 10}%` : "n/a";
|
|
6
|
+
function ratio(id, label, n, of, source) {
|
|
7
|
+
return {
|
|
8
|
+
id,
|
|
9
|
+
label,
|
|
10
|
+
value: `${n} of ${of} (${percent(n, of)})`,
|
|
11
|
+
n,
|
|
12
|
+
of,
|
|
13
|
+
source,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
const notYet = (id, label, source, pendingTask, why = "no data source yet") => ({
|
|
17
|
+
id,
|
|
18
|
+
label,
|
|
19
|
+
value: `n/a — ${why} (${pendingTask})`,
|
|
20
|
+
source,
|
|
21
|
+
pendingTask,
|
|
22
|
+
});
|
|
23
|
+
// Installed clients Ocean can wire. The engine-location warning is about the machine, and an
|
|
24
|
+
// unsupported client (no MCP) can never count as working, so neither is in the total.
|
|
25
|
+
const NOT_A_CLIENT = new Set(["CLIENT_ENGINE_TEMPORARY", "CLIENT_UNSUPPORTED"]);
|
|
26
|
+
export function clientsRow(clients) {
|
|
27
|
+
const installed = clients.filter((finding) => !NOT_A_CLIENT.has(finding.code));
|
|
28
|
+
const working = installed.filter((finding) => finding.code === "CLIENT_WIRED").length;
|
|
29
|
+
// From a temporary build every plan points at that build, so no client reads as wired.
|
|
30
|
+
const temporary = clients.some((finding) => finding.code === "CLIENT_ENGINE_TEMPORARY");
|
|
31
|
+
return {
|
|
32
|
+
id: "clients",
|
|
33
|
+
label: "Clients confirmed working",
|
|
34
|
+
value: `${working} of ${installed.length}${temporary ? " (temporary engine: run the installed ocean)" : ""}`,
|
|
35
|
+
n: working,
|
|
36
|
+
of: installed.length,
|
|
37
|
+
source: "ocean doctor (client findings)",
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
// "proven" is the only verified state the session store has.
|
|
41
|
+
export const sessionsVerifiedRow = (sessions) => ratio("sessions-verified", "Sessions verified", sessions.filter((session) => session.verificationStatus === "proven")
|
|
42
|
+
.length, sessions.length, "sessions.sqlite verification_status");
|
|
43
|
+
export const sessionsWithTaskRow = (sessions) => ratio("sessions-task", "Sessions with a task", sessions.filter((session) => Boolean(session.taskId?.trim())).length, sessions.length, "sessions.sqlite task_id");
|
|
44
|
+
// Every audit action that changes or proposes a record; owner approve/reject are reviews.
|
|
45
|
+
const WRITE_ACTIONS = new Set([
|
|
46
|
+
"create",
|
|
47
|
+
"update",
|
|
48
|
+
"delete",
|
|
49
|
+
"restore",
|
|
50
|
+
"propose",
|
|
51
|
+
]);
|
|
52
|
+
const OWNER_OR_OCEAN = new Set([
|
|
53
|
+
"owner-review",
|
|
54
|
+
"cli",
|
|
55
|
+
"instructions",
|
|
56
|
+
"session-telemetry",
|
|
57
|
+
]);
|
|
58
|
+
export function writerOf(source, lookup) {
|
|
59
|
+
const name = source?.trim() ?? "";
|
|
60
|
+
if (!name || name === "unknown")
|
|
61
|
+
return "unknown";
|
|
62
|
+
if (OWNER_OR_OCEAN.has(name) || name.startsWith("distill:"))
|
|
63
|
+
return "owner-or-ocean";
|
|
64
|
+
if (lookup.clients.has(name))
|
|
65
|
+
return "client";
|
|
66
|
+
if (name.startsWith("session:desktop:"))
|
|
67
|
+
return "client";
|
|
68
|
+
if (name.startsWith("session:"))
|
|
69
|
+
return lookup.sessionProvider(name.slice("session:".length))
|
|
70
|
+
? "client"
|
|
71
|
+
: "unknown";
|
|
72
|
+
return "unknown";
|
|
73
|
+
}
|
|
74
|
+
export function memoryWritesRow(audit, lookup) {
|
|
75
|
+
const writes = audit.filter((entry) => WRITE_ACTIONS.has(entry.action));
|
|
76
|
+
const kinds = writes.map((entry) => writerOf(entry.source, lookup));
|
|
77
|
+
const known = kinds.filter((kind) => kind === "client").length;
|
|
78
|
+
const own = kinds.filter((kind) => kind === "owner-or-ocean").length;
|
|
79
|
+
const row = ratio("memory-writes", "Memory writes with a known client", known, writes.length - own, "memory audit log source");
|
|
80
|
+
return own
|
|
81
|
+
? {
|
|
82
|
+
...row,
|
|
83
|
+
value: `${row.value}; ${own} more by the owner or Ocean's own jobs`,
|
|
84
|
+
}
|
|
85
|
+
: row;
|
|
86
|
+
}
|
|
87
|
+
// T-320 adds `verify:` / `verified:` to task frontmatter; until then every task counts as none.
|
|
88
|
+
export const tasksVerifiedRow = (tasks) => ratio("tasks-verify", "Tasks with verify evidence", tasks.filter((fields) => Boolean(fields.verify || fields.verified)).length, tasks.length, "task frontmatter verify / verified");
|
|
89
|
+
export function searchRows(search, searchEval) {
|
|
90
|
+
const mode = !search.built
|
|
91
|
+
? "no index"
|
|
92
|
+
: [
|
|
93
|
+
search.mode,
|
|
94
|
+
search.stale ? "index stale" : "",
|
|
95
|
+
search.mode === "fts" ? `vectors ${search.vector}` : "",
|
|
96
|
+
]
|
|
97
|
+
.filter(Boolean)
|
|
98
|
+
.join("; ");
|
|
99
|
+
return [
|
|
100
|
+
{
|
|
101
|
+
id: "search-mode",
|
|
102
|
+
label: "Search mode",
|
|
103
|
+
value: mode,
|
|
104
|
+
source: "probe brain_search, as over MCP",
|
|
105
|
+
},
|
|
106
|
+
searchEval
|
|
107
|
+
? {
|
|
108
|
+
id: "search-eval",
|
|
109
|
+
label: "Search hit@5 (last eval)",
|
|
110
|
+
value: `${percent(searchEval.hitAt5, 1)} on ${searchEval.at.slice(0, 10)}`,
|
|
111
|
+
source: "ocean brain eval",
|
|
112
|
+
}
|
|
113
|
+
: notYet("search-eval", "Search hit@5 (last eval)", "ocean brain eval", "T-321", "no eval set"),
|
|
114
|
+
];
|
|
115
|
+
}
|
|
116
|
+
export function schedulesRow(schedules) {
|
|
117
|
+
const enabled = schedules.filter((schedule) => schedule.enabled).length;
|
|
118
|
+
return {
|
|
119
|
+
id: "schedules",
|
|
120
|
+
label: "Scheduled jobs (enabled)",
|
|
121
|
+
value: `${enabled} of ${schedules.length}`,
|
|
122
|
+
n: enabled,
|
|
123
|
+
of: schedules.length,
|
|
124
|
+
source: "ocean schedule list",
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
// "Used" needs a hit count; lessons written before T-323 carry none, so it is not a zero.
|
|
128
|
+
export function lessonsRows(lessons) {
|
|
129
|
+
const active = lessons.filter((fields) => fields.status === "active").length;
|
|
130
|
+
const tracked = lessons.filter((fields) => fields.hits !== undefined);
|
|
131
|
+
return [
|
|
132
|
+
{
|
|
133
|
+
id: "lessons-active",
|
|
134
|
+
label: "Lessons active",
|
|
135
|
+
value: `${active} of ${lessons.length}`,
|
|
136
|
+
n: active,
|
|
137
|
+
of: lessons.length,
|
|
138
|
+
source: "05-knowledge/lessons status",
|
|
139
|
+
},
|
|
140
|
+
tracked.length
|
|
141
|
+
? ratio("lessons-used", "Lessons used", tracked.filter((fields) => Number(fields.hits) > 0).length, lessons.length, "lesson hits")
|
|
142
|
+
: notYet("lessons-used", "Lessons used", "lesson_applied events", "T-323", "no lesson records its use"),
|
|
143
|
+
];
|
|
144
|
+
}
|
|
145
|
+
export function tokensRow(tokens) {
|
|
146
|
+
// Not a missing feature: the providers that were run simply did not report usage.
|
|
147
|
+
if (!tokens.reporting)
|
|
148
|
+
return {
|
|
149
|
+
id: "tokens",
|
|
150
|
+
label: "Tokens per session",
|
|
151
|
+
value: "n/a — no captured session reports usage",
|
|
152
|
+
source: "session events (provider usage)",
|
|
153
|
+
};
|
|
154
|
+
return {
|
|
155
|
+
id: "tokens",
|
|
156
|
+
label: "Tokens per session",
|
|
157
|
+
value: `${Math.round(tokens.total / tokens.reporting).toLocaleString("en-US")} avg over ${tokens.reporting} of ${tokens.sessions} sessions that report usage`,
|
|
158
|
+
n: tokens.reporting,
|
|
159
|
+
of: tokens.sessions,
|
|
160
|
+
source: "session events (provider usage)",
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
export const hygieneRow = () => notYet("hygiene", "Records verified / drifted / unverifiable", "ocean memory hygiene", "T-322");
|
|
164
|
+
export function scorecardRows(input) {
|
|
165
|
+
return [
|
|
166
|
+
clientsRow(input.clients),
|
|
167
|
+
sessionsVerifiedRow(input.sessions),
|
|
168
|
+
sessionsWithTaskRow(input.sessions),
|
|
169
|
+
memoryWritesRow(input.memoryAudit, input.writers),
|
|
170
|
+
tasksVerifiedRow(input.tasks),
|
|
171
|
+
...searchRows(input.search, input.searchEval),
|
|
172
|
+
schedulesRow(input.schedules),
|
|
173
|
+
...lessonsRows(input.lessons),
|
|
174
|
+
tokensRow(input.tokens),
|
|
175
|
+
hygieneRow(),
|
|
176
|
+
];
|
|
177
|
+
}
|
|
178
|
+
// A provider's final `result` line (Claude's stream-json) carries the session's usage; the sum
|
|
179
|
+
// of input, cache and output tokens, or null when no event reports any.
|
|
180
|
+
export function sessionTokens(events) {
|
|
181
|
+
let total = null;
|
|
182
|
+
for (const event of events) {
|
|
183
|
+
if (event.type !== "json" || !event.data.includes('"usage"'))
|
|
184
|
+
continue;
|
|
185
|
+
let parsed;
|
|
186
|
+
try {
|
|
187
|
+
parsed = JSON.parse(event.data);
|
|
188
|
+
}
|
|
189
|
+
catch {
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
if (parsed.type !== "result" || !parsed.usage)
|
|
193
|
+
continue;
|
|
194
|
+
const usage = parsed.usage;
|
|
195
|
+
const sum = [
|
|
196
|
+
"input_tokens",
|
|
197
|
+
"cache_creation_input_tokens",
|
|
198
|
+
"cache_read_input_tokens",
|
|
199
|
+
"output_tokens",
|
|
200
|
+
].reduce((acc, key) => acc + (Number(usage[key]) || 0), 0);
|
|
201
|
+
// A zero-usage result (a synthetic or refused turn) is not a report.
|
|
202
|
+
if (sum > 0)
|
|
203
|
+
total = (total ?? 0) + sum;
|
|
204
|
+
}
|
|
205
|
+
return total;
|
|
206
|
+
}
|
|
207
|
+
export function renderTable(rows) {
|
|
208
|
+
const width = Math.max(...rows.map((row) => row.label.length));
|
|
209
|
+
return rows
|
|
210
|
+
.map((row) => `${row.label.padEnd(width)} ${row.value}`)
|
|
211
|
+
.join("\n");
|
|
212
|
+
}
|
|
213
|
+
export function renderMarkdown(rows, date) {
|
|
214
|
+
const cell = (text) => text.replace(/\|/g, "\\|");
|
|
215
|
+
return [
|
|
216
|
+
"---",
|
|
217
|
+
"type: scorecard",
|
|
218
|
+
`date: ${date}`,
|
|
219
|
+
"---",
|
|
220
|
+
"",
|
|
221
|
+
`# Ocean scorecard — ${date}`,
|
|
222
|
+
"",
|
|
223
|
+
"| Measure | Value | Source |",
|
|
224
|
+
"|---|---|---|",
|
|
225
|
+
...rows.map((row) => `| ${cell(row.label)} | ${cell(row.value)} | ${cell(row.source)} |`),
|
|
226
|
+
"",
|
|
227
|
+
].join("\n");
|
|
228
|
+
}
|
|
229
|
+
export function scorecardFile(date) {
|
|
230
|
+
return oceanPath(DAILY_DIR, "scorecard", `${date}.md`);
|
|
231
|
+
}
|
|
232
|
+
export async function writeScorecard(rows, date) {
|
|
233
|
+
const file = scorecardFile(date);
|
|
234
|
+
await mkdir(path.dirname(file), { recursive: true });
|
|
235
|
+
await atomicWrite(file, renderMarkdown(rows, date));
|
|
236
|
+
return file;
|
|
237
|
+
}
|
|
238
|
+
async function frontmatterOf(dir, name) {
|
|
239
|
+
try {
|
|
240
|
+
return parseFrontmatter(await readFile(path.join(dir, name), "utf8"));
|
|
241
|
+
}
|
|
242
|
+
catch {
|
|
243
|
+
return null;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
// Every live task in every project (archive/ excluded), as its frontmatter.
|
|
247
|
+
export async function readTaskFrontmatter() {
|
|
248
|
+
const tasks = [];
|
|
249
|
+
for (const { dir } of listProjectDirs()) {
|
|
250
|
+
const root = oceanPath(dir, "tasks");
|
|
251
|
+
let entries;
|
|
252
|
+
try {
|
|
253
|
+
entries = await readdir(root);
|
|
254
|
+
}
|
|
255
|
+
catch {
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
for (const entry of entries.sort()) {
|
|
259
|
+
if (entry === "archive")
|
|
260
|
+
continue;
|
|
261
|
+
const fields = await frontmatterOf(path.join(root, entry), "task.md");
|
|
262
|
+
if (fields)
|
|
263
|
+
tasks.push(fields);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
return tasks;
|
|
267
|
+
}
|
|
268
|
+
// Every lesson file, as its frontmatter; archive/ and CONFLICTS.md are not lessons.
|
|
269
|
+
export async function readLessonFrontmatter() {
|
|
270
|
+
const dir = oceanPath(KNOWLEDGE_DIR, "lessons");
|
|
271
|
+
let names;
|
|
272
|
+
try {
|
|
273
|
+
names = await readdir(dir);
|
|
274
|
+
}
|
|
275
|
+
catch {
|
|
276
|
+
return [];
|
|
277
|
+
}
|
|
278
|
+
const lessons = [];
|
|
279
|
+
for (const name of names.sort()) {
|
|
280
|
+
if (!name.endsWith(".md") || name === "CONFLICTS.md")
|
|
281
|
+
continue;
|
|
282
|
+
const fields = await frontmatterOf(dir, name);
|
|
283
|
+
if (fields)
|
|
284
|
+
lessons.push(fields);
|
|
285
|
+
}
|
|
286
|
+
return lessons;
|
|
287
|
+
}
|
|
288
|
+
//# sourceMappingURL=scorecard.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.2.
|
|
8
|
+
"version": "2.2.3",
|
|
9
9
|
"engines": {
|
|
10
|
-
"ocean": ">=2.2.
|
|
10
|
+
"ocean": ">=2.2.3"
|
|
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.2.
|
|
26
|
+
"version": "2.2.3",
|
|
27
27
|
"engines": {
|
|
28
|
-
"ocean": ">=2.2.
|
|
28
|
+
"ocean": ">=2.2.3"
|
|
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.2.
|
|
44
|
+
"version": "2.2.3",
|
|
45
45
|
"engines": {
|
|
46
|
-
"ocean": ">=2.2.
|
|
46
|
+
"ocean": ">=2.2.3"
|
|
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.2.
|
|
62
|
+
"version": "2.2.3",
|
|
63
63
|
"engines": {
|
|
64
|
-
"ocean": ">=2.2.
|
|
64
|
+
"ocean": ">=2.2.3"
|
|
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.2.
|
|
80
|
+
"version": "2.2.3",
|
|
81
81
|
"engines": {
|
|
82
|
-
"ocean": ">=2.2.
|
|
82
|
+
"ocean": ">=2.2.3"
|
|
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.2.
|
|
98
|
+
"version": "2.2.3",
|
|
99
99
|
"engines": {
|
|
100
|
-
"ocean": ">=2.2.
|
|
100
|
+
"ocean": ">=2.2.3"
|
|
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.2.
|
|
116
|
+
"version": "2.2.3",
|
|
117
117
|
"engines": {
|
|
118
|
-
"ocean": ">=2.2.
|
|
118
|
+
"ocean": ">=2.2.3"
|
|
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.2.
|
|
134
|
+
"version": "2.2.3",
|
|
135
135
|
"engines": {
|
|
136
|
-
"ocean": ">=2.2.
|
|
136
|
+
"ocean": ">=2.2.3"
|
|
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.2.
|
|
152
|
+
"version": "2.2.3",
|
|
153
153
|
"engines": {
|
|
154
|
-
"ocean": ">=2.2.
|
|
154
|
+
"ocean": ">=2.2.3"
|
|
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.2.
|
|
170
|
+
"version": "2.2.3",
|
|
171
171
|
"engines": {
|
|
172
|
-
"ocean": ">=2.2.
|
|
172
|
+
"ocean": ">=2.2.3"
|
|
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.2.
|
|
188
|
+
"version": "2.2.3",
|
|
189
189
|
"engines": {
|
|
190
|
-
"ocean": ">=2.2.
|
|
190
|
+
"ocean": ">=2.2.3"
|
|
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.2.
|
|
206
|
+
"version": "2.2.3",
|
|
207
207
|
"engines": {
|
|
208
|
-
"ocean": ">=2.2.
|
|
208
|
+
"ocean": ">=2.2.3"
|
|
209
209
|
},
|
|
210
210
|
"source": {
|
|
211
211
|
"type": "path",
|
|
@@ -247,9 +247,9 @@
|
|
|
247
247
|
"npx"
|
|
248
248
|
]
|
|
249
249
|
},
|
|
250
|
-
"version": "2.2.
|
|
250
|
+
"version": "2.2.3",
|
|
251
251
|
"engines": {
|
|
252
|
-
"ocean": ">=2.2.
|
|
252
|
+
"ocean": ">=2.2.3"
|
|
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.2.
|
|
302
|
+
"version": "2.2.3",
|
|
303
303
|
"engines": {
|
|
304
|
-
"ocean": ">=2.2.
|
|
304
|
+
"ocean": ">=2.2.3"
|
|
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.2.
|
|
346
|
+
"version": "2.2.3",
|
|
347
347
|
"engines": {
|
|
348
|
-
"ocean": ">=2.2.
|
|
348
|
+
"ocean": ">=2.2.3"
|
|
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.2.
|
|
390
|
+
"version": "2.2.3",
|
|
391
391
|
"engines": {
|
|
392
|
-
"ocean": ">=2.2.
|
|
392
|
+
"ocean": ">=2.2.3"
|
|
393
393
|
},
|
|
394
394
|
"source": {
|
|
395
395
|
"type": "path",
|
|
@@ -441,9 +441,9 @@
|
|
|
441
441
|
"npx"
|
|
442
442
|
]
|
|
443
443
|
},
|
|
444
|
-
"version": "2.2.
|
|
444
|
+
"version": "2.2.3",
|
|
445
445
|
"engines": {
|
|
446
|
-
"ocean": ">=2.2.
|
|
446
|
+
"ocean": ">=2.2.3"
|
|
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.2.
|
|
4
|
+
"version": "2.2.3",
|
|
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.2.
|
|
57
|
-
"@ocean/context": "2.2.
|
|
58
|
-
"@ocean/core": "2.2.
|
|
59
|
-
"@ocean/loop": "2.2.
|
|
60
|
-
"@ocean/market": "2.2.
|
|
61
|
-
"@ocean/services": "2.2.
|
|
56
|
+
"@ocean/brain": "2.2.3",
|
|
57
|
+
"@ocean/context": "2.2.3",
|
|
58
|
+
"@ocean/core": "2.2.3",
|
|
59
|
+
"@ocean/loop": "2.2.3",
|
|
60
|
+
"@ocean/market": "2.2.3",
|
|
61
|
+
"@ocean/services": "2.2.3",
|
|
62
62
|
"playwright-core": "^1.48.0",
|
|
63
63
|
"sqlite-vec": "0.1.9",
|
|
64
64
|
"zod": "^4.6.5"
|