@amoree-code/ocean 2.22.0 → 3.0.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.
Files changed (382) hide show
  1. package/README.md +46 -53
  2. package/dist/application/clients/bundles.js +220 -0
  3. package/dist/application/clients/chat-plugin.js +4 -42
  4. package/dist/application/clients/client-detect.js +291 -0
  5. package/dist/application/clients/clients.js +104 -25
  6. package/dist/application/clients/desktop-link.js +40 -0
  7. package/dist/application/clients/desktop-watcher.js +6 -4
  8. package/dist/application/clients/hook-trust.js +106 -0
  9. package/dist/application/clients/hooks.js +7 -1
  10. package/dist/application/clients/mcp-schema-cost.js +74 -0
  11. package/dist/application/clients/native.js +38 -2
  12. package/dist/application/clients/registry.js +51 -9
  13. package/dist/application/clients/status.js +7 -2
  14. package/dist/application/clients/zip.js +44 -0
  15. package/dist/application/gateway/webhook-gateway.js +1 -1
  16. package/dist/application/integrations/charter-copies.js +1 -1
  17. package/dist/application/integrations/engine-entry-repair.js +4 -3
  18. package/dist/application/integrations/skill-auto-sync.js +2 -2
  19. package/dist/application/integrations/skill-filter.js +1 -1
  20. package/dist/application/integrations/skill-router.js +134 -90
  21. package/dist/application/layout/layout-apply.js +1 -1
  22. package/dist/application/layout/workspace-template.js +1 -1
  23. package/dist/application/onboarding/steps.js +121 -30
  24. package/dist/application/profiles/profile-doctor.js +118 -0
  25. package/dist/application/profiles/profile-migration-service.js +208 -0
  26. package/dist/application/profiles/profile-suggestion.js +3 -7
  27. package/dist/application/profiles/profile-upgrade-service.js +98 -86
  28. package/dist/application/pull/history-index.js +1 -1
  29. package/dist/application/pull/project-match.js +3 -3
  30. package/dist/application/pull/pull.js +1 -1
  31. package/dist/application/pull/server-capture.js +92 -9
  32. package/dist/application/scheduler/local-scheduler.js +2 -2
  33. package/dist/application/spend/claude-prices.js +55 -0
  34. package/dist/application/spend/claude-spend.js +365 -0
  35. package/dist/application/uninstall/uninstall.js +25 -3
  36. package/dist/application/upkeep/nightly-upkeep.js +4 -4
  37. package/dist/composition/runtime.js +2 -2
  38. package/dist/infrastructure/desktop/claude-export.js +1 -1
  39. package/dist/infrastructure/desktop/desktop-chat.js +60 -13
  40. package/dist/infrastructure/desktop/indexeddb.js +4 -4
  41. package/dist/infrastructure/desktop/leveldb.js +2 -2
  42. package/dist/infrastructure/filesystem/profile-loader.js +3 -45
  43. package/dist/infrastructure/filesystem/runtime-config-loader.js +1 -1
  44. package/dist/infrastructure/observability/runtime-logger.js +1 -1
  45. package/dist/infrastructure/process/agent-tool-executor.js +3 -3
  46. package/dist/infrastructure/process/process-supervisor.js +1 -1
  47. package/dist/infrastructure/process/service.js +8 -8
  48. package/dist/infrastructure/providers/openai-compatible.js +2 -2
  49. package/dist/infrastructure/providers/provider-invocation.js +1 -1
  50. package/dist/infrastructure/providers/session-facts-completer.js +78 -5
  51. package/dist/interfaces/cli/auth-command.js +2 -2
  52. package/dist/interfaces/cli/brief-command.js +1 -1
  53. package/dist/interfaces/cli/browser-command.js +6 -6
  54. package/dist/interfaces/cli/browser-findings.js +6 -9
  55. package/dist/interfaces/cli/browser-settings.js +10 -10
  56. package/dist/interfaces/cli/capture-command.js +6 -6
  57. package/dist/interfaces/cli/client-test-command.js +3 -3
  58. package/dist/interfaces/cli/clients-command.js +55 -6
  59. package/dist/interfaces/cli/command-aliases.js +56 -0
  60. package/dist/interfaces/cli/command-registry.js +48 -1414
  61. package/dist/interfaces/cli/commands/browser.js +5 -0
  62. package/dist/interfaces/cli/commands/capture.js +19 -0
  63. package/dist/interfaces/cli/commands/catalog.js +9 -0
  64. package/dist/interfaces/cli/commands/client.js +135 -0
  65. package/dist/interfaces/cli/commands/clients.js +33 -0
  66. package/dist/interfaces/cli/commands/connectors.js +14 -0
  67. package/dist/interfaces/cli/commands/context.js +9 -0
  68. package/dist/interfaces/cli/commands/cost.js +15 -0
  69. package/dist/interfaces/cli/commands/daily.js +11 -0
  70. package/dist/interfaces/cli/commands/day.js +25 -0
  71. package/dist/interfaces/cli/commands/dispatch.js +31 -0
  72. package/dist/interfaces/cli/commands/doctor.js +60 -0
  73. package/dist/interfaces/cli/commands/env.js +5 -0
  74. package/dist/interfaces/cli/commands/gateway.js +16 -0
  75. package/dist/interfaces/cli/commands/handoff.js +11 -0
  76. package/dist/interfaces/cli/commands/health.js +17 -0
  77. package/dist/interfaces/cli/commands/hook.js +142 -0
  78. package/dist/interfaces/cli/commands/idea.js +11 -0
  79. package/dist/interfaces/cli/commands/install.js +31 -0
  80. package/dist/interfaces/cli/commands/intent.js +14 -0
  81. package/dist/interfaces/cli/commands/intercept.js +22 -0
  82. package/dist/interfaces/cli/commands/layout.js +11 -0
  83. package/dist/interfaces/cli/commands/lifecycle.js +5 -0
  84. package/dist/interfaces/cli/commands/loop.js +73 -0
  85. package/dist/interfaces/cli/commands/market.js +11 -0
  86. package/dist/interfaces/cli/commands/mcp.js +57 -0
  87. package/dist/interfaces/cli/commands/memory.js +5 -0
  88. package/dist/interfaces/cli/commands/migrate.js +5 -0
  89. package/dist/interfaces/cli/commands/observe.js +11 -0
  90. package/dist/interfaces/cli/commands/obsidian.js +111 -0
  91. package/dist/interfaces/cli/commands/operate.js +7 -0
  92. package/dist/interfaces/cli/commands/policy.js +16 -0
  93. package/dist/interfaces/cli/commands/project.js +207 -0
  94. package/dist/interfaces/cli/commands/repair.js +20 -0
  95. package/dist/interfaces/cli/commands/run.js +52 -0
  96. package/dist/interfaces/cli/commands/schedule.js +58 -0
  97. package/dist/interfaces/cli/commands/service.js +21 -0
  98. package/dist/interfaces/cli/commands/session.js +182 -0
  99. package/dist/interfaces/cli/commands/sessions.js +12 -0
  100. package/dist/interfaces/cli/commands/setup.js +21 -0
  101. package/dist/interfaces/cli/commands/skill.js +159 -0
  102. package/dist/interfaces/cli/commands/tasks.js +10 -0
  103. package/dist/interfaces/cli/commands/update-remove.js +25 -0
  104. package/dist/interfaces/cli/connectors-command.js +150 -0
  105. package/dist/interfaces/cli/context-command.js +39 -3
  106. package/dist/interfaces/cli/cost-command.js +104 -0
  107. package/dist/interfaces/cli/curator-command.js +1 -1
  108. package/dist/interfaces/cli/daily-command.js +7 -1
  109. package/dist/interfaces/cli/desktop-command.js +43 -7
  110. package/dist/interfaces/cli/distill-command.js +7 -2
  111. package/dist/interfaces/cli/express-command.js +1 -1
  112. package/dist/interfaces/cli/failures-command.js +4 -4
  113. package/dist/interfaces/cli/gateway-findings.js +2 -2
  114. package/dist/interfaces/cli/governance-command.js +23 -16
  115. package/dist/interfaces/cli/handoff-command.js +1 -1
  116. package/dist/interfaces/cli/harvest-command.js +2 -2
  117. package/dist/interfaces/cli/help-command.js +53 -169
  118. package/dist/interfaces/cli/hygiene-command.js +1 -1
  119. package/dist/interfaces/cli/idea-command.js +1 -1
  120. package/dist/interfaces/cli/intercept-command.js +8 -7
  121. package/dist/interfaces/cli/interests-command.js +1 -1
  122. package/dist/interfaces/cli/layout-command.js +2 -0
  123. package/dist/interfaces/cli/market-command.js +9 -9
  124. package/dist/interfaces/cli/mcp-gateway-command.js +124 -7
  125. package/dist/interfaces/cli/mcp-probe-command.js +186 -0
  126. package/dist/interfaces/cli/mcp-status-command.js +5 -5
  127. package/dist/interfaces/cli/memory-command.js +41 -7
  128. package/dist/interfaces/cli/migrate-command.js +2 -2
  129. package/dist/interfaces/cli/note-command.js +1 -1
  130. package/dist/interfaces/cli/onboard-command.js +14 -0
  131. package/dist/interfaces/cli/operate-command.js +5 -5
  132. package/dist/interfaces/cli/profiles-command.js +61 -1
  133. package/dist/interfaces/cli/rhythm-command.js +11 -5
  134. package/dist/interfaces/cli/running-server-findings.js +1 -1
  135. package/dist/interfaces/cli/scorecard-command.js +8 -8
  136. package/dist/interfaces/cli/session-facts-command.js +2 -2
  137. package/dist/interfaces/cli/sessions-command.js +145 -0
  138. package/dist/interfaces/cli/setup-command.js +15 -2
  139. package/dist/interfaces/cli/tasks-command.js +63 -13
  140. package/dist/interfaces/cli/telemetry-command.js +4 -4
  141. package/dist/interfaces/cli/uninstall-command.js +1 -1
  142. package/dist/interfaces/cli/week-failures.js +32 -0
  143. package/dist/main.js +12 -0
  144. package/node_modules/@ocean/brain/dist/{infrastructure/brain/brain-index.js → brain-index.js} +2 -2
  145. package/node_modules/@ocean/brain/dist/{brain/brain-markdown.js → brain-markdown.js} +1 -1
  146. package/node_modules/@ocean/brain/dist/{brain/brain-service.js → brain-service.js} +12 -2
  147. package/node_modules/@ocean/brain/dist/memory/brain-dump.js +92 -16
  148. package/node_modules/@ocean/brain/dist/memory/extraction-log.js +125 -0
  149. package/node_modules/@ocean/brain/dist/memory/extraction-retry.js +54 -0
  150. package/node_modules/@ocean/brain/dist/memory/fact-routing.js +44 -1
  151. package/node_modules/@ocean/brain/dist/memory/lesson-activation.js +2 -2
  152. package/node_modules/@ocean/brain/dist/memory/lesson-learning.js +2 -2
  153. package/node_modules/@ocean/brain/dist/memory/lessons.js +1 -1
  154. package/node_modules/@ocean/brain/dist/memory/memory-audit.js +2 -2
  155. package/node_modules/@ocean/brain/dist/memory/memory-harvest.js +1 -1
  156. package/node_modules/@ocean/brain/dist/memory/memory-paths.js +8 -0
  157. package/node_modules/@ocean/brain/dist/memory/memory-review.js +31 -3
  158. package/node_modules/@ocean/brain/dist/memory/memory-trash.js +29 -0
  159. package/node_modules/@ocean/brain/dist/memory/memory-write.js +4 -2
  160. package/node_modules/@ocean/brain/dist/memory/model-narrative.js +2 -2
  161. package/node_modules/@ocean/brain/dist/memory/profile-facts.js +1 -1
  162. package/node_modules/@ocean/brain/dist/memory/routing.json +6 -6
  163. package/node_modules/@ocean/{market/dist/skills → brain/dist/memory}/signal-detection.js +1 -1
  164. package/node_modules/@ocean/brain/dist/{memory → people}/people.js +1 -1
  165. package/node_modules/@ocean/brain/dist/sessions-capture/session-facts.js +625 -0
  166. package/node_modules/@ocean/brain/dist/{memory → sessions-capture}/session-promotion.js +7 -15
  167. package/node_modules/@ocean/brain/dist/{memory → sessions-capture}/session-summary.js +1 -1
  168. package/node_modules/@ocean/brain/dist/sessions-capture/session-triage.js +52 -0
  169. package/node_modules/@ocean/brain/package.json +1 -1
  170. package/node_modules/@ocean/connect/dist/connectors/connector-hub.js +173 -0
  171. package/node_modules/@ocean/{market → connect}/dist/install/default-marketplace.js +6 -2
  172. package/node_modules/@ocean/{market → connect}/dist/install/marketplace-service.js +1 -1
  173. package/node_modules/@ocean/connect/dist/mcp/mcp-gateway.js +987 -0
  174. package/node_modules/@ocean/{market → connect}/dist/mcp/mcp-launch.js +102 -5
  175. package/node_modules/@ocean/{market → connect}/dist/registry/official-registry.js +1 -1
  176. package/node_modules/@ocean/{market → connect}/dist/security/permissions.js +1 -1
  177. package/node_modules/@ocean/{market → connect}/dist/skills/skill-hub.js +104 -6
  178. package/node_modules/@ocean/{market → connect}/package.json +2 -2
  179. package/node_modules/@ocean/context/dist/{context/context-ladder.js → context-ladder.js} +3 -3
  180. package/node_modules/@ocean/context/dist/{context/context-references.js → context-references.js} +5 -4
  181. package/node_modules/@ocean/context/dist/{context/context-cost.js → context-size.js} +6 -6
  182. package/node_modules/@ocean/context/dist/{context/intent-router.js → intent-router.js} +1 -1
  183. package/node_modules/@ocean/context/dist/{context/resource-injection.js → resource-injection.js} +3 -1
  184. package/node_modules/@ocean/context/package.json +1 -1
  185. package/node_modules/@ocean/core/dist/domain/brain/brain-record.js +1 -1
  186. package/node_modules/@ocean/core/dist/domain/capabilities/capability-manifest.js +5 -5
  187. package/node_modules/@ocean/core/dist/domain/connector-entry.js +86 -0
  188. package/node_modules/@ocean/core/dist/domain/context/context.js +1 -1
  189. package/node_modules/@ocean/core/dist/domain/context/project-id.js +8 -2
  190. package/node_modules/@ocean/core/dist/domain/{evidence/evidence.js → evidence.js} +1 -1
  191. package/node_modules/@ocean/core/dist/domain/mcp/memory-contract.js +4 -1
  192. package/node_modules/@ocean/core/dist/domain/ports/brain-index-port.js +1 -1
  193. package/node_modules/@ocean/core/dist/domain/profiles/profile-markdown.js +40 -0
  194. package/node_modules/@ocean/core/dist/domain/profiles/profile-resolution.js +276 -0
  195. package/node_modules/@ocean/core/dist/domain/profiles/profile-selection.js +23 -60
  196. package/node_modules/@ocean/core/dist/domain/profiles/profile-upgrade.js +2 -2
  197. package/node_modules/@ocean/core/dist/domain/profiles/profile.js +66 -6
  198. package/node_modules/@ocean/core/dist/domain/profiles/runtime-config.js +1 -1
  199. package/node_modules/@ocean/core/dist/domain/runs/agent-tools.js +2 -2
  200. package/node_modules/@ocean/core/dist/domain/sessions/session-identity.js +53 -0
  201. package/node_modules/@ocean/core/dist/domain/sessions/session-metadata.js +208 -0
  202. package/node_modules/@ocean/core/dist/domain/{tasks/task-id.js → task-id.js} +2 -2
  203. package/node_modules/@ocean/core/dist/profiles/profile-files.js +57 -0
  204. package/node_modules/@ocean/core/dist/profiles/profile-loader.js +97 -0
  205. package/node_modules/@ocean/core/dist/profiles/project-profile-fill.js +33 -0
  206. package/node_modules/@ocean/core/dist/profiles/session-profile.js +158 -0
  207. package/node_modules/@ocean/core/dist/shared/charter.js +110 -0
  208. package/node_modules/@ocean/core/dist/shared/context-ack.js +1 -1
  209. package/node_modules/@ocean/core/dist/shared/context-triggers.js +67 -0
  210. package/node_modules/@ocean/core/dist/shared/paths.js +6 -6
  211. package/node_modules/@ocean/core/dist/shared/project-legacy.js +232 -0
  212. package/node_modules/@ocean/core/dist/shared/project-manifest.js +308 -0
  213. package/node_modules/@ocean/core/dist/shared/project-names.js +87 -0
  214. package/node_modules/@ocean/core/dist/shared/project-register.js +560 -0
  215. package/node_modules/@ocean/core/dist/shared/project-resolution.js +83 -861
  216. package/node_modules/@ocean/core/dist/shared/repo-signals.js +45 -0
  217. package/node_modules/@ocean/core/dist/shared/task-reference.js +1 -1
  218. package/node_modules/@ocean/core/dist/shared/text-tokens.js +37 -0
  219. package/node_modules/@ocean/core/dist/shared/tool-groups.js +224 -0
  220. package/node_modules/@ocean/core/package.json +4 -1
  221. package/node_modules/@ocean/services/dist/day/day.js +45 -3
  222. package/node_modules/@ocean/services/dist/{distill → day}/distill.js +29 -3
  223. package/node_modules/@ocean/services/dist/{harvest → day}/harvest.js +54 -14
  224. package/node_modules/@ocean/services/dist/{brief → day}/interest-discovery.js +3 -3
  225. package/node_modules/@ocean/services/dist/day/note.js +2 -2
  226. package/node_modules/@ocean/services/dist/{onboarding → day}/onboarding.js +1 -1
  227. package/node_modules/@ocean/services/dist/day/patterns.js +68 -0
  228. package/node_modules/@ocean/services/dist/{curator → health}/curator.js +5 -5
  229. package/node_modules/@ocean/services/dist/{journey → health}/failures.js +7 -5
  230. package/node_modules/@ocean/services/dist/{hygiene → health}/hygiene.js +2 -2
  231. package/node_modules/@ocean/services/dist/{journey → health}/lesson-effect.js +1 -1
  232. package/node_modules/@ocean/services/dist/{scorecard → health}/scorecard.js +3 -3
  233. package/node_modules/@ocean/services/dist/{upkeep → health}/upkeep.js +2 -2
  234. package/node_modules/@ocean/services/dist/{doctor → health}/workspace-doctor.js +57 -17
  235. package/node_modules/@ocean/services/dist/{browser → integrations/browser}/browser-session.js +1 -1
  236. package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/call-ledger.js +3 -0
  237. package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/mcp-client.js +19 -3
  238. package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/obsidian-server.js +4 -4
  239. package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/ocean-server.js +423 -34
  240. package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/conflict-log.js +1 -1
  241. package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/folder-templates.js +8 -5
  242. package/node_modules/@ocean/services/dist/projects/project-doctor.js +173 -0
  243. package/node_modules/@ocean/services/dist/projects/project-snippet.js +9 -0
  244. package/node_modules/@ocean/services/dist/projects/projects-overview.js +2 -2
  245. package/node_modules/@ocean/services/package.json +1 -1
  246. package/node_modules/@ocean/{loop/dist/loops → work/dist/runs}/guard-runtime.js +3 -3
  247. package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/memory-knowledge-operations.js +4 -12
  248. package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/operation-contract.js +2 -2
  249. package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/project-operations.js +2 -1
  250. package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/task-operations.js +4 -4
  251. package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/write-guard.js +1 -1
  252. package/node_modules/@ocean/{loop → work}/dist/runs/prompt-assembly.js +2 -2
  253. package/node_modules/@ocean/{loop → work}/dist/runs/run-agent.js +4 -4
  254. package/node_modules/@ocean/{loop → work}/dist/runs/tool-loop.js +4 -4
  255. package/node_modules/@ocean/work/dist/sessions/hooks/desktop-facts.js +309 -0
  256. package/node_modules/@ocean/{loop/dist → work/dist/sessions}/hooks/session-end-hook.js +36 -5
  257. package/node_modules/@ocean/{loop/dist → work/dist/sessions}/hooks/session-facts-hook.js +144 -14
  258. package/node_modules/@ocean/{loop/dist → work/dist/sessions}/hooks/session-start-hook.js +129 -12
  259. package/node_modules/@ocean/work/dist/sessions/hooks/start-brief.js +110 -0
  260. package/node_modules/@ocean/work/dist/sessions/hooks/unlinked-warning.js +68 -0
  261. package/node_modules/@ocean/{loop → work}/dist/sessions/session-closeout.js +4 -4
  262. package/node_modules/@ocean/{loop → work}/dist/sessions/session-projects.js +13 -3
  263. package/node_modules/@ocean/work/dist/sessions/session-relink.js +300 -0
  264. package/node_modules/@ocean/{loop → work}/dist/sessions/session-retention.js +1 -1
  265. package/node_modules/@ocean/{loop → work}/dist/tasks/list-tasks.js +7 -2
  266. package/node_modules/@ocean/{loop → work}/dist/tasks/renumber-tasks.js +4 -2
  267. package/node_modules/@ocean/{loop → work}/dist/tasks/session-task.js +2 -2
  268. package/node_modules/@ocean/{loop → work}/dist/tasks/sync-task-prs.js +77 -7
  269. package/node_modules/@ocean/work/dist/tasks/task-git.js +63 -0
  270. package/node_modules/@ocean/{loop/dist/loops → work/dist/tasks}/task-loop.js +4 -4
  271. package/node_modules/@ocean/{loop → work}/dist/tasks/verification-readiness.js +1 -1
  272. package/node_modules/@ocean/{loop → work}/dist/tasks/verify-task.js +1 -1
  273. package/node_modules/@ocean/{loop → work}/package.json +2 -2
  274. package/ocean-marketplace.json +41 -41
  275. package/package.json +12 -11
  276. package/skills/core/daily-harvest/SKILL.md +1 -1
  277. package/skills/core/ocean-memory/SKILL.md +4 -0
  278. package/skills/core/use-browser/SKILL.md +30 -7
  279. package/skills/index.json +1 -1
  280. package/templates/profiles/default.md +44 -0
  281. package/templates/profiles/developer.md +45 -0
  282. package/templates/profiles/reviewer.md +44 -0
  283. package/templates/profiles/strategist.md +44 -0
  284. package/templates/profiles-v3/analysis.md +16 -0
  285. package/templates/profiles-v3/backend.md +16 -0
  286. package/templates/profiles-v3/base.md +57 -0
  287. package/templates/profiles-v3/code-review.md +16 -0
  288. package/templates/profiles-v3/devops.md +16 -0
  289. package/templates/profiles-v3/docs-office.md +16 -0
  290. package/templates/profiles-v3/frontend.md +16 -0
  291. package/templates/profiles-v3/learning.md +16 -0
  292. package/templates/profiles-v3/marketing-ads.md +16 -0
  293. package/templates/profiles-v3/marketing-content-seo.md +16 -0
  294. package/templates/profiles-v3/ocean-ops.md +16 -0
  295. package/templates/profiles-v3/product-strategy.md +16 -0
  296. package/templates/profiles-v3/qa-testing.md +16 -0
  297. package/templates/profiles-v3/security.md +16 -0
  298. package/templates/workspace/MANIFEST.json +1 -0
  299. package/templates/workspace/charter/core.md +22 -90
  300. package/templates/workspace/charter/policies/README.md +7 -1
  301. package/templates/workspace/charter/policies/claude-code-context.md +6 -1
  302. package/templates/workspace/charter/policies/concise-output.md +5 -0
  303. package/templates/workspace/charter/policies/context.md +5 -0
  304. package/templates/workspace/charter/policies/contracts/task.md +2 -2
  305. package/templates/workspace/charter/policies/git.md +5 -0
  306. package/templates/workspace/charter/policies/graph.md +6 -1
  307. package/templates/workspace/charter/policies/knowledge.md +11 -4
  308. package/templates/workspace/charter/policies/layout.md +23 -0
  309. package/templates/workspace/charter/policies/lifecycle.md +5 -0
  310. package/templates/workspace/charter/policies/memory.md +5 -0
  311. package/templates/workspace/charter/policies/minimal-change.md +5 -0
  312. package/templates/workspace/charter/policies/models.md +5 -0
  313. package/templates/workspace/charter/policies/response.md +5 -0
  314. package/templates/workspace/charter/policies/skill-observer.md +12 -0
  315. package/templates/workspace/charter/policies/stack.md +5 -0
  316. package/templates/workspace/charter/policies/task.md +17 -3
  317. package/templates/workspace/charter/policies/verification.md +5 -0
  318. package/node_modules/@ocean/brain/dist/evidence/verification-report.js +0 -13
  319. package/node_modules/@ocean/brain/dist/memory/daily-narrative.js +0 -142
  320. package/node_modules/@ocean/brain/dist/memory/session-facts.js +0 -283
  321. package/node_modules/@ocean/context/dist/context/context-compression.js +0 -66
  322. package/node_modules/@ocean/loop/dist/hooks/desktop-facts.js +0 -174
  323. package/node_modules/@ocean/loop/dist/operations/task-linker.js +0 -40
  324. package/node_modules/@ocean/loop/dist/sessions/session-pointer.js +0 -133
  325. package/node_modules/@ocean/loop/dist/tasks/task-git.js +0 -28
  326. package/node_modules/@ocean/market/dist/mcp/mcp-gateway.js +0 -533
  327. package/templates/profiles/default.json +0 -51
  328. package/templates/profiles/developer.json +0 -51
  329. package/templates/profiles/reviewer.json +0 -51
  330. package/templates/profiles/strategist.json +0 -51
  331. /package/node_modules/@ocean/brain/dist/{brain/brain-eval.js → brain-eval.js} +0 -0
  332. /package/node_modules/@ocean/brain/dist/{brain/brain-reindex.js → brain-reindex.js} +0 -0
  333. /package/node_modules/@ocean/brain/dist/{capture → sessions-capture}/inbox-sync.js +0 -0
  334. /package/node_modules/@ocean/{market → connect}/dist/adapters/mcp-adapter.js +0 -0
  335. /package/node_modules/@ocean/{market → connect}/dist/adapters/owned-directory.js +0 -0
  336. /package/node_modules/@ocean/{market → connect}/dist/adapters/plugin-adapter.js +0 -0
  337. /package/node_modules/@ocean/{market → connect}/dist/adapters/skill-adapter.js +0 -0
  338. /package/node_modules/@ocean/{market → connect}/dist/capability/adapter.js +0 -0
  339. /package/node_modules/@ocean/{market → connect}/dist/capability/catalog.js +0 -0
  340. /package/node_modules/@ocean/{market → connect}/dist/capability/content-digest.js +0 -0
  341. /package/node_modules/@ocean/{market → connect}/dist/capability/registry.js +0 -0
  342. /package/node_modules/@ocean/{market → connect}/dist/install/lock.js +0 -0
  343. /package/node_modules/@ocean/{market → connect}/dist/install/own-server.js +0 -0
  344. /package/node_modules/@ocean/{market → connect}/dist/mcp/chrome-debugging.js +0 -0
  345. /package/node_modules/@ocean/{market → connect}/dist/mcp/mcp-connection.js +0 -0
  346. /package/node_modules/@ocean/{market → connect}/dist/mcp/mcp-runner.js +0 -0
  347. /package/node_modules/@ocean/{market → connect}/dist/security/description-scan.js +0 -0
  348. /package/node_modules/@ocean/{market → connect}/dist/security/secrets.js +0 -0
  349. /package/node_modules/@ocean/{market → connect}/dist/skills/core-skill-sync.js +0 -0
  350. /package/node_modules/@ocean/context/dist/{context/context-packet.js → context-packet.js} +0 -0
  351. /package/node_modules/@ocean/core/dist/domain/{process/process-events.js → process-events.js} +0 -0
  352. /package/node_modules/@ocean/core/dist/domain/{redaction/redaction.js → redaction.js} +0 -0
  353. /package/node_modules/@ocean/services/dist/{brief → day}/brief.js +0 -0
  354. /package/node_modules/@ocean/services/dist/{express → day}/express.js +0 -0
  355. /package/node_modules/@ocean/services/dist/{brief → day}/source-registry.json +0 -0
  356. /package/node_modules/@ocean/services/dist/{journey → health}/telemetry.js +0 -0
  357. /package/node_modules/@ocean/services/dist/{browser → integrations/browser}/browser-service.js +0 -0
  358. /package/node_modules/@ocean/services/dist/{browser → integrations/browser}/browser-task-runner.js +0 -0
  359. /package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/mcp-session.js +0 -0
  360. /package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/server-version.js +0 -0
  361. /package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/tool-registry.js +0 -0
  362. /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/inbox-promotion.js +0 -0
  363. /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/vault-discovery.js +0 -0
  364. /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/vault-ingestion.js +0 -0
  365. /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/vault-sync.js +0 -0
  366. /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/vault-writer.js +0 -0
  367. /package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/operation-scope.js +0 -0
  368. /package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/record-io.js +0 -0
  369. /package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/record-operations.js +0 -0
  370. /package/node_modules/@ocean/{loop → work}/dist/runs/run-authorization.js +0 -0
  371. /package/node_modules/@ocean/{loop → work}/dist/runs/session-tokens.js +0 -0
  372. /package/node_modules/@ocean/{loop/dist/handoff → work/dist/sessions}/handoff-service.js +0 -0
  373. /package/node_modules/@ocean/{loop/dist → work/dist/sessions}/hooks/lifecycle-hooks.js +0 -0
  374. /package/node_modules/@ocean/{loop/dist/infrastructure/persistence → work/dist/sessions}/session-store.js +0 -0
  375. /package/node_modules/@ocean/{loop/dist/infrastructure/persistence → work/dist/sessions}/session-validator.js +0 -0
  376. /package/node_modules/@ocean/{loop → work}/dist/tasks/archive-tasks.js +0 -0
  377. /package/node_modules/@ocean/{loop → work}/dist/tasks/checkpoint-task.js +0 -0
  378. /package/node_modules/@ocean/{loop → work}/dist/tasks/claim-task.js +0 -0
  379. /package/node_modules/@ocean/{loop/dist/loops → work/dist/tasks}/iteration-graph.js +0 -0
  380. /package/node_modules/@ocean/{loop → work}/dist/tasks/new-task.js +0 -0
  381. /package/node_modules/@ocean/{loop/dist/loops → work/dist/tasks}/task-loop-record.js +0 -0
  382. /package/node_modules/@ocean/{loop → work}/dist/tasks/task-verification.js +0 -0
package/README.md CHANGED
@@ -77,7 +77,7 @@ stops at 1.1.0 and points here.
77
77
  Windows) that keeps the local runtime running.
78
78
 
79
79
  It never writes inside the installed package. `ocean setup --help` shows its options. Running
80
- `ocean` with no command starts a short first-run guide; `ocean onboard --status` shows its
80
+ `ocean` with no command starts a short first-run guide; `ocean setup onboard --status` shows its
81
81
  steps without running them.
82
82
 
83
83
  ## First useful workflow
@@ -122,65 +122,58 @@ folder name; it refuses a workspace that is a git checkout or holds the running
122
122
 
123
123
  `ocean --help` lists every command; `ocean <command> --help` (or `-h`, anywhere before `--`)
124
124
  prints its usage and never runs it. To hand `--help` to a wrapped client, put it after `--`:
125
- `ocean client open claude -- --help`. **Reads** only reads. **Writes** changes the workspace, or files outside it where noted.
125
+ `ocean clients open claude -- --help`. **Reads** only reads. **Writes** changes the workspace, or files outside it where noted.
126
126
  **Runs** starts a process: an agent, a provider CLI, a browser, a server or an installer.
127
127
  **Approval** is the flag a command needs before it acts; without it, the command previews.
128
128
 
129
129
  | Command | What it does | Kind |
130
130
  | --- | --- | --- |
131
- | `ocean setup` | create the workspace, shims, shell line and login service | Writes (also outside: shell profile, login service) |
131
+ | `ocean setup` | create the workspace, shims, shell line and login service; `onboard` runs the pending first-run steps (`--status` reads); `path` prints the shell line that puts the shims on `PATH` | Writes (also outside: shell profile, login service); `path`, `onboard --status` read |
132
132
  | `ocean uninstall` | undo `setup` and `clients apply` outside the workspace; `--purge` also deletes the workspace | Reads; `--yes` writes (also outside: client configs, shell profile, login service) |
133
- | `ocean onboard` | run the pending first-run steps | Writes; `--status` reads |
133
+ | `ocean doctor` | health check of workspace, clients and integrations; an area (`tasks`, `sessions`, `profiles`, `connectors`, `clients`, `memory`, `project`, `skills`) narrows it; `repair` shows what it can fix | Reads; `repair --fix` writes |
134
+ | `ocean policy` | list the charter's policies or print one; `checkpoint` decides whether work should checkpoint now | Reads |
134
135
  | `ocean context` | the workspace context for this folder; `cost` measures each client's always-on context | Reads |
135
136
  | `ocean project` | resolve, bind, register, rename, move and index projects; `status`: each one's git state, open tasks, last session and next action | Reads; `bind`, `register`, `rename`, `unbind`, `--write` write |
136
- | `ocean tasks` | list, create, claim, checkpoint, verify and complete tasks | Reads; `new`, `claim`, `checkpoint`, `complete`, `archive --apply` write |
137
- | `ocean loop` | repeated agent runs on one task, each loop with a guard (verifier, run cap, token budget, no-progress exit, escalation) | Runs; `start` needs `--approve` and the guard |
138
- | `ocean policy` | list the charter's policies or print one | Reads |
139
- | `ocean lifecycle` | decide whether work should checkpoint now | Reads |
140
- | `ocean doctor` | health check of workspace, clients and integrations | Reads |
141
- | `ocean repair` | what `doctor` can fix | Reads; `--apply` writes |
142
- | `ocean run` | run a headless agent with a profile | Runs |
137
+ | `ocean tasks` | list, create, claim, checkpoint, verify and complete tasks; `loop`: repeated agent runs on one task, each loop with a guard (verifier, run cap, token budget, no-progress exit, escalation) | Reads; `new`, `claim`, `checkpoint`, `complete`, `archive --apply` write; `loop start` runs and needs `--approve` and the guard |
138
+ | `ocean sessions` | list, show, resume, promote and compact sessions; `handoff` hands work from one session or client to another; `cost`: what session capture's extraction calls cost per day and week, from `bridge/state/extraction-log.jsonl` | Reads; `resume` runs; `promote` needs `--approve`; `compact --apply`, `handoff create` write |
139
+ | `ocean run` | run a headless agent with a profile; `--op <text>` classifies a plain-language request and runs the matching operation (`--dry` only classifies) | Runs |
143
140
  | `ocean profiles` | validate, upgrade or suggest agent profiles | Reads; `upgrade --apply` writes |
144
- | `ocean session` | list, show, resume, promote and compact sessions | Reads; `resume` runs; `promote` needs `--approve`; `compact --apply` writes |
145
- | `ocean service` | the background runtime (the login service starts it) | Runs |
146
- | `ocean intercept` | run an AI CLI with session capture (the shims call it) | Runs |
147
- | `ocean operate` | classify a plain-language request and run the matching operation | Runs |
148
- | `ocean intent` | classify a plain-language request | Reads |
149
- | `ocean gateway` | local webhook gateway on 127.0.0.1 (needs `OCEAN_GATEWAY_TOKEN`) | Runs |
150
141
  | `ocean schedule` | scheduled agent runs, each with a guard (verifier, run cap, token budget, no-progress exit, escalation); `add` refuses one without it; the service runs due ones hourly | Writes; `run-now`, `worker` run |
151
- | `ocean client` | inspect, open, register and sync AI clients | Reads; `open` runs; `sync`, `register`, `enable`, `disable` write |
152
- | `ocean clients` | connect installed AI clients to Ocean | Reads; `apply` needs `--yes` and writes client config outside the workspace |
153
- | `ocean install` / `update` / `remove` | install, update or remove an AI client CLI | Runs an installer; needs `--yes` |
154
- | `ocean auth` | show or start an AI client's login | Reads; `login` runs |
155
- | `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 |
156
- | `ocean market` | marketplace skills and MCP servers | Reads; `install`, `update`, `uninstall` write; `exec` runs; permissions need `--yes` |
142
+ | `ocean service` | the background runtime (the login service starts it); `webhook` is the local gateway on 127.0.0.1 (needs `OCEAN_GATEWAY_TOKEN`) | Runs |
143
+ | `ocean cost` | what Claude use cost over the last N days at API list price, by day, hour, client, project, model, session or kind, from local transcripts, the extraction log and the Desktop app's plan meter; flags spike days, sessions over $15, capture spend while you are away, failure runs, and names what local files cannot see | Reads |
144
+ | `ocean clients` | connect installed AI clients to Ocean (`status`, `plan`, `apply`, `verify`); inspect, open, register and sync them (`list`, `open`, `sync`, `register`, `wrappers`); `install` / `update` / `remove` their CLIs; `catalog` lists what Ocean can install; `auth` shows or starts a login | Reads; `open` runs; `sync`, `register`, `enable`, `disable` write; `apply` needs `--yes` and writes client config outside the workspace; `install`, `update`, `remove` run an installer and need `--yes`; `auth login` runs |
145
+ | `ocean connectors` | connector entries: list, check, add, remove, sign-in help; `market`: marketplace skills and MCP servers; `scout <profile>`: search for servers a profile could use | Reads; `add` writes with `--approve`, `remove` deletes a live entry; `market install`, `update`, `uninstall` write and permissions need `--yes`; `market exec` runs; `scout` writes one report under `bridge/state/scout/` and installs nothing |
146
+ | `ocean mcp` | print MCP client configs, or serve Ocean's MCP server and gateway | Reads; `serve`, `gateway`, `probe-client` run; `browser-service uninstall` removes the retired browser bridge's service |
147
+ | `ocean skills` | sync, list, add, review and learn skills | Reads; `add`, `review`, `learn`, `sync` write |
157
148
  | `ocean browser` | drive a browser session | Runs; `upload`, `submit` need `--approve` |
158
149
  | `ocean memory` | search, read, review and maintain memory; `hygiene` re-checks records' paths, URLs and repos, `drift` finds records changed without an audited write | Reads; `approve`, `delete`, `restore`, `reindex`, `sync --apply`, `purge --yes`, `hygiene --yes`, `drift --yes` write |
159
- | `ocean pull` | pull what AI clients hold into Ocean as review candidates | Reads (dry run); `--yes` writes |
160
- | `ocean desktop` | capture facts from Claude Desktop's chat, read from the app's local store, as review candidates | Reads (`--dry-run`); a run writes candidates |
161
- | `ocean observe` | run a command and record its output | Runs |
162
- | `ocean capture` / `idea` | capture ideas, then promote or discard them | Writes |
163
- | `ocean note` | `ocean note "<text>"`: capture a thought into `00-inbox/captures/` with frontmatter | Writes |
164
- | `ocean brief` | write the daily or weekly brief from your interests' feeds | Writes |
165
- | `ocean interests` | propose interests from your projects or recurring session topics (as candidates), decay, keep/skip | Writes |
166
- | `ocean distill` | `--week`: a weekly digest, decisions and lessons as candidates; `--month`: last month against your goals | Writes |
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
- | `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, then the nightly upkeep (the service runs it) | Writes |
169
- | `ocean upkeep` | the nightly jobs with no model — doctor, telemetry, reindex, search eval, drift, curator, scorecard, and memory hygiene once a month — then the morning digest in `01-daily/digest/` | Writes with `--yes` |
170
- | `ocean curator` | marks lessons and skills stale after 30 days unused (or 90 unreviewed) and archives them after 90; `review` undoes a mark | Writes with `--yes` |
171
- | `ocean telemetry` | recurring session errors (each named by a signature) and failing providers, as proposed backlog lines; also proposes a guardrail climb for an absorbed failure that came back and retiring a lesson that does no better than without it | Writes |
172
- | `ocean failures` | failure records by signature in `05-knowledge/failures/`: status `open → fix-landing → absorbed → superseded-by`, guardrail ladder `lesson → doctor → test`, recurrence counted from sessions | Reads; `open`, `status`, `climb` write |
173
- | `ocean scorecard` | Ocean's health numbers from real data: clients working, sessions verified and linked to tasks, attributed memory writes, search mode, schedules, lessons applied, failures at zero | Reads; `--write` saves `01-daily/scorecard/` |
174
- | `ocean express` | draft a CV section, LinkedIn post or scholarship paragraph from milestones | Writes |
175
- | `ocean handoff` | hand work from one session or client to another | Reads; `create` writes |
176
- | `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 |
177
- | `ocean skill` | sync, add, review and learn skills | Reads; `add`, `review`, `learn`, `sync` write |
178
- | `ocean catalog` | the AI clients Ocean can install | Reads |
150
+ | `ocean capture` | put things into Ocean: `note "<text>"` (into `00-inbox/captures/` with frontmatter), `idea` (save, list, classify, discard), `observe -- <command>` (run and record output), `import` (what AI clients hold, as review candidates), `desktop` (facts from Claude Desktop's chat, from the app's local store); `add`, `scan`, `list`, `promote`, `discard` work the idea inbox | Writes; `import` reads as a dry run and `--yes` writes; `desktop --dry-run` reads; `observe` runs |
151
+ | `ocean day` | the day's notes: `start` the morning half of today's note (`--apply` writes); `end` harvests a day's sessions into knowledge (undo per day; archive after 30 days); `week` a weekly digest; `month` last month against your goals; `brief` the daily or weekly brief from your interests' feeds; `interests` propose, decay, keep, skip; `express` draft a CV section, LinkedIn post or scholarship paragraph; `auto` runs the rhythm once per period with no model (the service runs it) | Writes; `start` reads without `--apply` |
152
+ | `ocean health` | Ocean's health numbers from real data (`scorecard`, the default; `--write` saves `01-daily/scorecard/`); `failures` records by signature in `05-knowledge/lessons/` (`open → fix-landing → absorbed → superseded-by`, guardrail ladder `lesson → doctor → test`); `telemetry` recurring session errors and failing providers, as proposed backlog lines; `curator` marks lessons and skills stale after 30 days unused (or 90 unreviewed) and archives them after 90; `nightly` the nightly jobs with no model, then the morning digest in `01-daily/digest/` | Reads; `failures open`, `status`, `climb`, `telemetry`, `curator --yes`, `nightly --yes` write |
179
153
  | `ocean obsidian` | connect, sync and write to an Obsidian vault | Writes; vault writes need `--read-write` and `--apply` |
180
154
  | `ocean hook` | session hooks the AI clients call | Writes session records |
181
155
  | `ocean migrate` | migrate the session store | Reads (dry run); `--apply` writes |
156
+ | `ocean intercept` | run an AI CLI with session capture (the shims call it) | Runs |
182
157
  | `ocean layout` | move the workspace to the current layout | Reads (`plan`); `apply --yes`, `rollback --yes` write outside |
183
- | `ocean env` | print the shell line that puts the shims on `PATH` | Reads |
158
+
159
+ `hook`, `migrate`, `intercept` and `layout` are called by clients, shims and migrations; `ocean
160
+ --help` lists them last, as internal. The names that were commands of their own before the merge still
161
+ work and, on a terminal, say what they became:
162
+
163
+ | Old name | Now |
164
+ | --- | --- |
165
+ | `onboard`, `env` | `setup onboard`, `setup path` |
166
+ | `repair`, `lifecycle` | `doctor repair`, `policy checkpoint` |
167
+ | `loop` | `tasks loop` |
168
+ | `session`, `handoff` | `sessions`, `sessions handoff` |
169
+ | `operate`, `intent` | `run --op`, `run --op --dry` |
170
+ | `gateway` | `service webhook` |
171
+ | `client`, `install`, `update`, `remove`, `catalog`, `auth` | `clients` (`client status` is `clients wrappers`), `clients install`, `clients update`, `clients remove`, `clients catalog`, `clients auth` |
172
+ | `market`, `scout` | `connectors market`, `connectors scout` |
173
+ | `skill` | `skills` |
174
+ | `note`, `idea`, `observe`, `pull`, `desktop` | `capture note`, `capture idea`, `capture observe`, `capture import`, `capture desktop` |
175
+ | `daily`, `harvest`, `distill`, `brief`, `interests`, `express`, `rhythm` | `day`, `day end`, `day week` / `day month`, `day brief`, `day interests`, `day express`, `day auto` |
176
+ | `failures`, `telemetry`, `scorecard`, `curator`, `upkeep` | `health failures`, `health telemetry`, `health scorecard`, `health curator`, `health nightly` |
184
177
 
185
178
  No `ocean` command publishes anything. Publishing the engine (`scripts/publish.mjs`) and the
186
179
  npm package are maintainer steps, each with its own confirmation ([publishing](docs/publishing.md),
@@ -205,7 +198,7 @@ in `bridge/state/mcp/calls.jsonl`; `ocean clients ledger` summarizes it. See [MC
205
198
 
206
199
  ## Agent skills
207
200
 
208
- Ocean ships provider-neutral Agent Skills under `packages/harness/skills/core/`, invoked
201
+ Ocean ships provider-neutral Agent Skills under `packages/cli/skills/core/`, invoked
209
202
  by name from any registered client. The core loop:
210
203
 
211
204
  - `catch-up` — reconstruct project state, completed work, blockers, and the next action.
@@ -215,16 +208,16 @@ by name from any registered client. The core loop:
215
208
  - `session-handoff` — produce a compact continuation packet for the next session.
216
209
 
217
210
  Alongside them: `business-logic`, `design-thinking`, `graft`, `loop`, and `use-browser`.
218
- See [skills/index.json](packages/harness/skills/index.json) for the current catalog.
219
- `ocean skill learn <completed-session-id>` extracts a candidate skill from a finished
220
- session, and `ocean skill review <candidate-id> promoted` activates it.
211
+ See [skills/index.json](packages/cli/skills/index.json) for the current catalog.
212
+ `ocean skills learn <completed-session-id>` extracts a candidate skill from a finished
213
+ session, and `ocean skills review <candidate-id> promoted` activates it.
221
214
 
222
215
  Skills reach every client by themselves. At each session start Ocean copies any new or updated
223
216
  skill — the engine's core skills, and the ones in the skill hub (`bridge/skills/`, where
224
- `ocean market install` puts a skill and where you can make your own) — into Claude, Codex,
225
- Gemini and Hermes. `ocean market install|update` copies at once, and `ocean market uninstall`
217
+ `ocean connectors market install` puts a skill and where you can make your own) — into Claude, Codex,
218
+ Gemini and Hermes. `ocean connectors market install|update` copies at once, and `ocean connectors market uninstall`
226
219
  removes the copies it made. A copy you edited inside a client after Ocean's version is left as
227
- you wrote it. `ocean skill sync` still does the core skills by hand.
220
+ you wrote it. `ocean skills sync` still does the core skills by hand.
228
221
 
229
222
  ## Public engine, private workspace, machine state
230
223
 
@@ -260,7 +253,7 @@ privacy scan flags (home paths, e-mail addresses, credential shapes). The source
260
253
  - Text Ocean keeps from a session — summaries, promoted results, handoffs — passes through
261
254
  redaction of secret shapes and your home-directory paths first.
262
255
  - The MCP server is local `stdio` only; nothing listens on the network unless you start
263
- `ocean gateway` (127.0.0.1, token required).
256
+ `ocean service webhook` (127.0.0.1, token required).
264
257
 
265
258
  See [Security](docs/security.md) for the workspace boundary and access control.
266
259
 
@@ -284,7 +277,7 @@ git clone https://github.com/amoree-code/ocean.git ~/ocean/kernel
284
277
  cd ~/ocean/kernel
285
278
  pnpm install
286
279
  pnpm build
287
- node packages/harness/dist/main.js setup
280
+ node packages/cli/dist/main.js setup
288
281
  pnpm test
289
282
  pnpm check
290
283
  ```
@@ -0,0 +1,220 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { mkdir, writeFile } from "node:fs/promises";
3
+ import os from "node:os";
4
+ import path from "node:path";
5
+ import { crc32, deflateSync } from "node:zlib";
6
+ import { enginePath } from "@ocean/core/shared/paths.js";
7
+ import { oceanServerEntry } from "./clients.js";
8
+ import { storedZip } from "./zip.js";
9
+ // One-click bundles (T-328 phase 4): Ocean as a Claude Desktop Extension (`Ocean.mcpb`, the MCPB
10
+ // manifest 0.3 format: name, icon, a node server Desktop runs with its own Node) and as a Claude
11
+ // plugin (`ocean.plugin`: `.claude-plugin/plugin.json` plus the core `ocean-memory` skill) for the
12
+ // account's Customize → Plugins upload, which loads in chat, Cowork and Claude Code.
13
+ //
14
+ // Neither carries Ocean itself. The extension's server is a launcher that starts the Ocean already
15
+ // installed on this machine (`ocean mcp serve`), so the memory stays local and updates with Ocean.
16
+ // The plugin carries no connector or hook: Desktop chat and Cowork already reach Ocean through
17
+ // its config entry, Claude Code through its own, and a second copy would show every tool twice.
18
+ export const DESKTOP_EXTENSION_FILE = "Ocean.mcpb";
19
+ export const CLAUDE_PLUGIN_FILE = "ocean.plugin";
20
+ const AUTHOR = {
21
+ name: "AMEER ABDULKAREEM JABBAR LAMI",
22
+ url: "https://github.com/amoree-code",
23
+ };
24
+ const REPOSITORY = "https://github.com/amoree-code/ocean";
25
+ const DESCRIPTION = "Your local memory for every AI client: projects, tasks, decisions and preferences, kept on your computer.";
26
+ export const DESKTOP_EXTENSION_STEPS = [
27
+ `Double-click ${DESKTOP_EXTENSION_FILE}, or in Claude Desktop: Settings → Extensions → Advanced settings → Install Extension`,
28
+ "Install, then make sure Ocean's toggle is on",
29
+ ];
30
+ export const CLAUDE_PLUGIN_STEPS = [
31
+ "In Claude: Customize → Plugins → Add → Upload plugin",
32
+ `Pick ${CLAUDE_PLUGIN_FILE}; it reaches chat, Cowork and Claude Code under the name Ocean`,
33
+ "Skills need Settings → Capabilities → Code execution on",
34
+ ];
35
+ // The extension's server: starts the installed Ocean with the command baked in at build time
36
+ // and hands it stdio. Plain CommonJS so Desktop's bundled Node runs it with no package.json.
37
+ const LAUNCHER = `"use strict";
38
+ // Ocean Desktop Extension launcher: starts the Ocean installed on this computer.
39
+ const { spawn } = require("node:child_process");
40
+ const env = { ...process.env };
41
+ const command = env.OCEAN_MCPB_COMMAND || "ocean";
42
+ let args = ["mcp", "serve"];
43
+ try {
44
+ if (env.OCEAN_MCPB_ARGS) args = JSON.parse(env.OCEAN_MCPB_ARGS);
45
+ } catch {}
46
+ delete env.OCEAN_MCPB_COMMAND;
47
+ delete env.OCEAN_MCPB_ARGS;
48
+ const child = spawn(command, args, {
49
+ env,
50
+ stdio: "inherit",
51
+ shell: process.platform === "win32" && command === "ocean",
52
+ });
53
+ child.on("error", (error) => {
54
+ process.stderr.write(
55
+ "Ocean: cannot start " + command + ": " + error.message +
56
+ "\\nInstall Ocean and run \`ocean setup\`, then build the extension again with \`ocean clients bundles\`.\\n",
57
+ );
58
+ process.exit(1);
59
+ });
60
+ child.on("exit", (code, signal) => process.exit(code ?? (signal ? 1 : 0)));
61
+ for (const signal of ["SIGINT", "SIGTERM"])
62
+ process.on(signal, () => child.kill(signal));
63
+ `;
64
+ export function desktopExtensionManifest(version, entry = oceanServerEntry()) {
65
+ return {
66
+ manifest_version: "0.3",
67
+ name: "ocean",
68
+ display_name: "Ocean",
69
+ version,
70
+ description: DESCRIPTION,
71
+ long_description: "Ocean keeps one memory on your computer that every AI client shares. This extension connects Claude Desktop to the Ocean installed here: its tools search and read your notes, tasks and past decisions, and propose new facts for your review.",
72
+ author: AUTHOR,
73
+ repository: { type: "git", url: `${REPOSITORY}.git` },
74
+ homepage: REPOSITORY,
75
+ documentation: `${REPOSITORY}/blob/main/kernel/docs/mcp.md`,
76
+ support: `${REPOSITORY}/issues`,
77
+ icon: "icon.png",
78
+ server: {
79
+ type: "node",
80
+ entry_point: "server/index.js",
81
+ mcp_config: {
82
+ command: "node",
83
+ // MCPB fills ${__dirname} with the extension folder; it is not a JS template.
84
+ // biome-ignore lint/suspicious/noTemplateCurlyInString: MCPB placeholder
85
+ args: ["${__dirname}/server/index.js"],
86
+ env: {
87
+ OCEAN_MCPB_COMMAND: entry.command,
88
+ OCEAN_MCPB_ARGS: JSON.stringify(entry.args ?? []),
89
+ },
90
+ },
91
+ },
92
+ tools_generated: true,
93
+ keywords: ["memory", "knowledge", "local-first", "tasks", "notes"],
94
+ license: "MIT",
95
+ compatibility: { platforms: ["darwin", "win32", "linux"] },
96
+ };
97
+ }
98
+ function coreSkill() {
99
+ return readFileSync(path.join(enginePath("skills"), "core", "ocean-memory", "SKILL.md"));
100
+ }
101
+ const json = (value) => Buffer.from(`${JSON.stringify(value, null, 2)}\n`, "utf8");
102
+ export function desktopExtension(version, entry = oceanServerEntry()) {
103
+ return storedZip([
104
+ ["manifest.json", json(desktopExtensionManifest(version, entry))],
105
+ ["icon.png", oceanIcon()],
106
+ ["server/", Buffer.alloc(0)],
107
+ ["server/index.js", Buffer.from(LAUNCHER, "utf8")],
108
+ ]);
109
+ }
110
+ export function claudePluginManifest(version) {
111
+ return {
112
+ name: "ocean",
113
+ version,
114
+ description: DESCRIPTION,
115
+ author: AUTHOR,
116
+ homepage: REPOSITORY,
117
+ repository: REPOSITORY,
118
+ license: "MIT",
119
+ keywords: ["memory", "knowledge", "local-first"],
120
+ };
121
+ }
122
+ export function claudePlugin(version, skill = coreSkill()) {
123
+ return storedZip([
124
+ [".claude-plugin/", Buffer.alloc(0)],
125
+ [".claude-plugin/plugin.json", json(claudePluginManifest(version))],
126
+ ["skills/", Buffer.alloc(0)],
127
+ ["skills/ocean-memory/", Buffer.alloc(0)],
128
+ ["skills/ocean-memory/SKILL.md", skill],
129
+ ]);
130
+ }
131
+ export async function writeBundles(version, dir = path.join(os.homedir(), "Downloads")) {
132
+ await mkdir(dir, { recursive: true });
133
+ const extension = path.join(dir, DESKTOP_EXTENSION_FILE);
134
+ const plugin = path.join(dir, CLAUDE_PLUGIN_FILE);
135
+ await writeFile(extension, desktopExtension(version));
136
+ await writeFile(plugin, claudePlugin(version));
137
+ return { extension, plugin };
138
+ }
139
+ // True when Claude Desktop's own config already starts Ocean, so installing the extension too
140
+ // would give Desktop two Ocean servers.
141
+ export function desktopConfigHasOcean(home = os.homedir(), platform = process.platform) {
142
+ const base = platform === "darwin"
143
+ ? path.join(home, "Library", "Application Support", "Claude")
144
+ : platform === "win32"
145
+ ? path.join(process.env.APPDATA ?? path.join(home, "AppData", "Roaming"), "Claude")
146
+ : path.join(home, ".config", "Claude");
147
+ try {
148
+ const config = JSON.parse(readFileSync(path.join(base, "claude_desktop_config.json"), "utf8"));
149
+ return Boolean(config.mcpServers?.ocean);
150
+ }
151
+ catch {
152
+ return false;
153
+ }
154
+ }
155
+ // Ocean's icon, drawn here so the repository carries no binary: a rounded square in a deep-blue
156
+ // to teal gradient with two white waves, as an RGBA PNG.
157
+ export function oceanIcon(size = 512) {
158
+ const pixels = Buffer.alloc(size * size * 4);
159
+ const radius = size * 0.22;
160
+ const top = [11, 61, 145];
161
+ const bottom = [15, 163, 177];
162
+ const waves = [
163
+ { y: 0.42, amp: 0.06, len: 0.5, phase: 0, width: 0.055, alpha: 1 },
164
+ { y: 0.62, amp: 0.06, len: 0.5, phase: Math.PI, width: 0.055, alpha: 0.75 },
165
+ ];
166
+ const clamp = (v) => Math.max(0, Math.min(1, v));
167
+ for (let py = 0; py < size; py++)
168
+ for (let px = 0; px < size; px++) {
169
+ const x = px + 0.5;
170
+ const y = py + 0.5;
171
+ // Rounded-square coverage from the signed distance to its edge.
172
+ const qx = Math.abs(x - size / 2) - (size / 2 - radius);
173
+ const qy = Math.abs(y - size / 2) - (size / 2 - radius);
174
+ const outside = Math.hypot(Math.max(qx, 0), Math.max(qy, 0)) +
175
+ Math.min(Math.max(qx, qy), 0) -
176
+ radius;
177
+ const cover = clamp(0.5 - outside);
178
+ if (cover === 0)
179
+ continue;
180
+ const t = y / size;
181
+ let rgb = top.map((c, i) => c + (bottom[i] - c) * t);
182
+ for (const wave of waves) {
183
+ const k = (2 * Math.PI) / (wave.len * size);
184
+ const arg = k * x + wave.phase;
185
+ const curve = (wave.y + wave.amp * Math.sin(arg)) * size;
186
+ const slope = wave.amp * size * k * Math.cos(arg);
187
+ const distance = Math.abs(y - curve) / Math.sqrt(1 + slope * slope);
188
+ const ink = clamp((wave.width * size) / 2 - distance + 0.5) * wave.alpha;
189
+ rgb = rgb.map((c) => c + (255 - c) * ink);
190
+ }
191
+ const at = (py * size + px) * 4;
192
+ pixels[at] = Math.round(rgb[0]);
193
+ pixels[at + 1] = Math.round(rgb[1]);
194
+ pixels[at + 2] = Math.round(rgb[2]);
195
+ pixels[at + 3] = Math.round(cover * 255);
196
+ }
197
+ const rows = Buffer.alloc(size * (size * 4 + 1));
198
+ for (let row = 0; row < size; row++)
199
+ pixels.copy(rows, row * (size * 4 + 1) + 1, row * size * 4, (row + 1) * size * 4);
200
+ const chunk = (type, data) => {
201
+ const head = Buffer.alloc(8);
202
+ head.writeUInt32BE(data.length, 0);
203
+ head.write(type, 4, "ascii");
204
+ const crc = Buffer.alloc(4);
205
+ crc.writeUInt32BE(crc32(Buffer.concat([head.subarray(4), data])), 0);
206
+ return Buffer.concat([head, data, crc]);
207
+ };
208
+ const header = Buffer.alloc(13);
209
+ header.writeUInt32BE(size, 0);
210
+ header.writeUInt32BE(size, 4);
211
+ header[8] = 8; // bit depth
212
+ header[9] = 6; // RGBA
213
+ return Buffer.concat([
214
+ Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]),
215
+ chunk("IHDR", header),
216
+ chunk("IDAT", deflateSync(rows)),
217
+ chunk("IEND", Buffer.alloc(0)),
218
+ ]);
219
+ }
220
+ //# sourceMappingURL=bundles.js.map
@@ -2,8 +2,8 @@ import { execFileSync } from "node:child_process";
2
2
  import { mkdirSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
3
3
  import os from "node:os";
4
4
  import path from "node:path";
5
- import { crc32 } from "node:zlib";
6
5
  import { enginePath } from "@ocean/core/shared/paths.js";
6
+ import { storedZip } from "./zip.js";
7
7
  // Claude chat (Desktop, claude.ai, phone) runs on Anthropic's servers: it gets Ocean's tools from
8
8
  // the MCP entry Ocean writes, but it drops the server's `instructions` and runs no hooks. A skill
9
9
  // does reach it: a skill in the Claude account loads in chat, Cowork and the phone, and Claude
@@ -90,50 +90,12 @@ const run = (file, args, input) => {
90
90
  timeout: 10_000,
91
91
  });
92
92
  };
93
- // A zip of one folder holding SKILL.md, the shape Claude's skill upload takes. Stored, not
94
- // deflated: the file is small and every unzip reads method 0.
93
+ // A zip of one folder holding SKILL.md, the shape Claude's skill upload takes.
95
94
  export function chatSkillZip(skill = readFileSync(path.join(enginePath("skills"), "core", "ocean-memory", "SKILL.md"))) {
96
- const entries = [
95
+ return storedZip([
97
96
  ["ocean-memory/", Buffer.alloc(0)],
98
97
  ["ocean-memory/SKILL.md", skill],
99
- ];
100
- const local = [];
101
- const central = [];
102
- let offset = 0;
103
- for (const [name, data] of entries) {
104
- const file = Buffer.from(name, "utf8");
105
- const crc = crc32(data);
106
- const head = Buffer.alloc(30);
107
- head.writeUInt32LE(0x04034b50, 0);
108
- head.writeUInt16LE(20, 4); // version needed
109
- head.writeUInt16LE(0x0800, 6); // UTF-8 names
110
- head.writeUInt32LE(crc, 14);
111
- head.writeUInt32LE(data.length, 18);
112
- head.writeUInt32LE(data.length, 22);
113
- head.writeUInt16LE(file.length, 26);
114
- const dir = Buffer.alloc(46);
115
- dir.writeUInt32LE(0x02014b50, 0);
116
- dir.writeUInt16LE(20, 4);
117
- dir.writeUInt16LE(20, 6);
118
- dir.writeUInt16LE(0x0800, 8);
119
- dir.writeUInt32LE(crc, 16);
120
- dir.writeUInt32LE(data.length, 20);
121
- dir.writeUInt32LE(data.length, 24);
122
- dir.writeUInt16LE(file.length, 28);
123
- dir.writeUInt32LE(name.endsWith("/") ? 0x10 : 0, 38);
124
- dir.writeUInt32LE(offset, 42);
125
- local.push(head, file, data);
126
- central.push(dir, file);
127
- offset += head.length + file.length + data.length;
128
- }
129
- const centralSize = central.reduce((sum, part) => sum + part.length, 0);
130
- const end = Buffer.alloc(22);
131
- end.writeUInt32LE(0x06054b50, 0);
132
- end.writeUInt16LE(entries.length, 8);
133
- end.writeUInt16LE(entries.length, 10);
134
- end.writeUInt32LE(centralSize, 12);
135
- end.writeUInt32LE(offset, 16);
136
- return Buffer.concat([...local, ...central, end]);
98
+ ]);
137
99
  }
138
100
  // Saves the skill zip to Downloads, shows it in the file manager and brings Claude up, so the
139
101
  // step is an upload and a few clicks. Any part failing leaves the printed steps.