@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
@@ -1,42 +1,40 @@
1
1
  const commandGroups = [
2
2
  [
3
3
  "Workspace",
4
- "setup, uninstall, onboard, context, project, tasks, loop, policy, lifecycle, doctor, repair",
4
+ "setup, uninstall, doctor, policy, context, project, tasks, sessions",
5
5
  ],
6
+ ["Execution", "run, profiles, schedule, service, cost"],
7
+ ["Providers", "clients, connectors, mcp, skills, browser"],
8
+ ["Knowledge", "memory, capture, day, health, obsidian"],
6
9
  [
7
- "Execution",
8
- "run, profiles, session, service, intercept, operate, intent, gateway, schedule",
10
+ "Internal",
11
+ "hook, migrate, intercept, layout (clients, shims and migrations call these)",
9
12
  ],
10
- [
11
- "Providers",
12
- "client, clients, install, update, remove, auth, mcp, market, browser",
13
- ],
14
- [
15
- "Knowledge",
16
- "memory, pull, desktop, observe, capture, note, brief, interests, distill, harvest, rhythm, upkeep, curator, telemetry, failures, scorecard, express, handoff, idea, daily, skill, catalog",
17
- ],
18
- ["Integrations", "obsidian, hook, migrate, layout, env"],
19
13
  ];
20
14
  export function renderHelp() {
21
15
  const groups = commandGroups
22
16
  .map(([label, commands]) => ` ${label.padEnd(12)} ${commands}`)
23
17
  .join("\n");
24
- return `Usage: ocean <command> [options]\n\nCommands:\n${groups}\n\nGlobal options:\n -h, --help Show this help\n -v, --version Show the installed version\n\nRun \`ocean <command> --help\` for one command's usage.`;
18
+ return `Usage: ocean <command> [options]\n\nCommands:\n${groups}\n\nGlobal options:\n -h, --help Show this help\n -v, --version Show the installed version\n\nRun \`ocean <command> --help\` for one command's usage. Older command names still work and say what they became.`;
25
19
  }
26
20
  // One entry per command in commandRegistry (a test keeps the two in step): what it does, and
27
21
  // its usage line as the command itself prints it on a bad argument.
28
22
  export const commandHelp = {
29
23
  setup: [
30
- "Create the private workspace, the AI CLI shims, the shell profile entry and the login service.",
31
- "ocean setup [--obsidian <vault-path>] [--read-write]",
24
+ "Create the private workspace, the AI CLI shims, the shell profile entry and the login service; onboard runs the pending first-run steps, path prints the PATH line.",
25
+ "ocean setup [--obsidian <vault-path>] [--read-write] | onboard [--yes] [--status] [--reset <step>] | path",
32
26
  ],
33
27
  uninstall: [
34
28
  "Undo setup and clients apply outside the workspace; shows the plan until --yes, --purge also deletes the workspace.",
35
29
  "ocean uninstall [--yes] [--purge] [--json]",
36
30
  ],
37
- onboard: [
38
- "Run the pending first-run steps; --status only shows them.",
39
- "ocean onboard [--yes] [--status] [--reset <step>]",
31
+ doctor: [
32
+ "Check the workspace, clients and integrations; exits 1 on any FAIL. An area narrows it; repair shows what doctor can fix and --fix applies it.",
33
+ "ocean doctor [--json] | tasks|sessions|profiles|connectors|clients|memory|project|skills [args] | repair [--fix]",
34
+ ],
35
+ policy: [
36
+ "List the charter's policies, check them, print one, or decide whether work should checkpoint now.",
37
+ "ocean policy [list|doctor|<name>] | checkpoint [--task <id>] [--verification <result>] [--complete] [--json]",
40
38
  ],
41
39
  context: [
42
40
  "Print the workspace context for the current folder, or each client's always-on context cost.",
@@ -47,90 +45,48 @@ export const commandHelp = {
47
45
  "ocean project resolve [path]|bind <name> <path> [--add]|register [path]|unbind <path>|rename <id> <new-id>|list|status [--json] [--write]|migrate [--write]|index [--write]",
48
46
  ],
49
47
  tasks: [
50
- "List, create, claim, checkpoint, verify and complete tasks.",
51
- "ocean tasks list [state] [--project <id>] [--pretty]|new <title> [--project <id>]|doctor [--all]|index [--write]|checkpoint <id> --note <text> [--next <text>]|verify <id>|complete <id>|sync [--all] [--dry-run]|claim <id> --by <name> [--paths a,b] [--force]|release <id> [--by <name>] [--force]|archive [--apply|--auto]|renumber --project <id> --prefix <PREFIX> [--write]",
52
- ],
53
- loop: [
54
- "Start, inspect and stop task loops (repeated agent runs on one task).",
55
- "ocean loop start <task-id> <profile> --approve --verify <cmd> --max-runs N --budget-tokens N --no-progress N --escalate inbox [--interval-ms N] [--max-attempts N] --prompt <text>|status|stop <loop-id>|worker-once|worker",
56
- ],
57
- policy: [
58
- "List the charter's policies, check them, or print one.",
59
- "ocean policy [list|doctor|<name>]",
60
- ],
61
- lifecycle: [
62
- "Decide whether a unit of work should checkpoint now.",
63
- "ocean lifecycle [--task <id>] [--verification <result>] [--complete] [--json]",
64
- ],
65
- doctor: [
66
- "Check the workspace, clients and integrations; exits 1 on any FAIL.",
67
- "ocean doctor [--json]",
48
+ "List, create, claim, checkpoint, verify and complete tasks; loop runs repeated agent runs on one task.",
49
+ "ocean tasks list [state] [--project <id>] [--pretty]|new <title> [--project <id>]|doctor [--all]|index [--write]|checkpoint <id> --note <text> [--next <text>]|verify <id>|complete <id>|sync [--all] [--dry-run]|claim <id> --by <name> [--paths a,b] [--force]|release <id> [--by <name>] [--force]|archive [--apply|--auto]|renumber --project <id> --prefix <PREFIX> [--write]|loop start <task-id> <profile> --approve --verify <cmd> --max-runs N --budget-tokens N --no-progress N --escalate inbox [--interval-ms N] [--max-attempts N] --prompt <text>|loop status|loop stop <loop-id>|loop worker-once|loop worker",
68
50
  ],
69
- repair: [
70
- "Show what doctor can fix; --apply fixes it.",
71
- "ocean repair [--apply]",
51
+ sessions: [
52
+ "List, show, resume, promote and compact recorded sessions; create and show handoffs; relink; what session capture's extraction calls cost.",
53
+ "ocean sessions list|show <session-id>|summary <session-id>|events <session-id>|resume <session-id> <prompt>|promote <session-id> [knowledge/<kind>] --approve|doctor [hours] [--apply]|compact [--keep-days N] [--simulate]|compact --apply --before <iso> --plan <fingerprint>|handoff create [--task <id>] [--session <id>] [--next <action>]|handoff show <id>|handoff context <id>|handoff list [--task <id>] [--project <id>]|cost [--days N] [--weeks N] [--json]",
72
54
  ],
73
55
  run: [
74
- "Run a headless agent with a profile and record the session.",
75
- "ocean run --profile <name> [--client <client>] [--task <id>] [--handoff <id>] --prompt <text>",
56
+ "Run a headless agent with a profile and record the session; --op classifies a plain-language request and runs the matching Ocean operation (--dry only classifies).",
57
+ "ocean run --profile <name> [--client <client>] [--task <id>] [--handoff <id>] --prompt <text> | --op [--dry] <text>",
76
58
  ],
77
59
  profiles: [
78
60
  "Validate, upgrade or suggest agent profiles.",
79
- "ocean profiles validate | upgrade --check | --apply | --rollback | suggest --task <id> [--profile <name>]",
80
- ],
81
- session: [
82
- "List, show, resume, promote and compact recorded sessions.",
83
- "ocean session list|show <session-id>|summary <session-id>|events <session-id>|resume <session-id> <prompt>|promote <session-id> [knowledge/<kind>] --approve|doctor [hours] [--apply]|compact [--keep-days N] [--simulate]|compact --apply --before <iso> --plan <fingerprint>",
84
- ],
85
- service: [
86
- "Run the background service in the foreground (setup's login entry starts it).",
87
- "ocean service",
88
- ],
89
- intercept: [
90
- "Run an AI CLI through Ocean's session capture (the shims call this).",
91
- "ocean intercept --client <provider> -- [args]",
92
- ],
93
- operate: [
94
- "Classify a plain-language request and run the matching Ocean operation.",
95
- "ocean operate <text> | -- <text containing -h>",
96
- ],
97
- intent: [
98
- "Classify a plain-language request without running anything.",
99
- "ocean intent classify <text>",
100
- ],
101
- gateway: [
102
- "Serve the local webhook gateway on 127.0.0.1 (needs OCEAN_GATEWAY_TOKEN).",
103
- "ocean gateway",
61
+ "ocean profiles validate | upgrade --check | --apply | --rollback | migrate --check | --apply | --rollback | suggest --task <id> [--profile <name>]",
104
62
  ],
105
63
  schedule: [
106
64
  "Add, list and run scheduled agent runs.",
107
65
  "ocean schedule list|add <id> <profile> <interval-ms> --verify <cmd> --max-runs N --budget-tokens N --no-progress N --escalate inbox <prompt>|enable|disable|run-due|run-now|worker-once|worker",
108
66
  ],
109
- client: [
110
- "Inspect, open, register and sync AI clients.",
111
- "ocean client list|status|test [provider] [--json]|open <provider> [provider-args] [-- provider-args]|vscode-wrapper [--settings <path>] [--apply]|sync|register <id> [command]|enable <id>|disable <id>|manage|doctor [absolute-provider-path]",
67
+ service: [
68
+ "Run the background service in the foreground (setup's login entry starts it); webhook serves the local gateway on 127.0.0.1.",
69
+ "ocean service | webhook (needs OCEAN_GATEWAY_TOKEN)",
112
70
  ],
113
- clients: [
114
- "Connect installed AI clients to Ocean's MCP server and hooks; apply shows the plan until --yes.",
115
- "ocean clients status [--json] [--days <n>] | detect|plan [--json] | apply [--client <id>…] [--yes] | 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>]",
71
+ cost: [
72
+ "What Claude use cost over the last N days at API list price, from local transcripts, the extraction log and the Desktop plan meter, with anomalies flagged.",
73
+ "ocean cost [--days N] [--by day|hour|client|project|model|session|kind] [--json]",
116
74
  ],
117
- install: [
118
- "Install a supported AI client CLI.",
119
- "ocean install <client> [--yes]",
75
+ clients: [
76
+ "Connect installed AI clients to Ocean's MCP server and hooks, install and update their CLIs, inspect and open them, and sign in; apply shows the plan until --yes.",
77
+ "ocean clients status [--json] [--days <n>] | detect|plan [--json] | apply [--client <id>…] [--yes] | 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>] | list|test [provider] [--json] | open <provider> [provider-args] [-- provider-args] | wrappers [provider] [--json] | vscode-wrapper [--settings <path>] [--apply] | sync | register <id> [command] | enable <id> | disable <id> | manage | doctor [absolute-provider-path] | install <client> [--yes] | update <client> --yes | remove <client> --yes | catalog | auth status|login <client>",
120
78
  ],
121
- update: ["Update an installed AI client CLI.", "ocean update <client> --yes"],
122
- remove: ["Remove an installed AI client CLI.", "ocean remove <client> --yes"],
123
- auth: [
124
- "Show or start an AI client's login.",
125
- "ocean auth status|login <client>",
79
+ connectors: [
80
+ "List, check and add connector entries (pinned, token-free; adding needs --approve), manage marketplace packages (permissions need --yes), and search for servers a profile could use.",
81
+ "ocean connectors list [--profile <name>] [--json]|doctor|add <entry.json> --approve|remove <id>|auth <id>|scout <profile>|market list|install <name> [--version <v>]|update <name>|uninstall <name>|search <term>|add <server.json|registry name>|secret list|set|remove <name> [<value name>] [--index <file>]... [--yes] [--accept-flagged]",
126
82
  ],
127
83
  mcp: [
128
84
  "Print MCP client configs, or serve Ocean's MCP server and gateway.",
129
- "ocean mcp config|playwright-config|gateway-config|serve|gateway|status [--check] [--json]|browser-service uninstall",
85
+ "ocean mcp config|playwright-config|gateway-config|serve|gateway|status [--check] [--json]|probe-client [report] [--log <file>]|browser-service uninstall",
130
86
  ],
131
- market: [
132
- "List, install, update and run marketplace packages; permissions need --yes.",
133
- "ocean market list|install <name> [--version <v>]|update <name>|uninstall <name>|search <term>|add <server.json|registry name>|secret list|set|remove <name> [<value name>] [--index <file>]... [--yes] [--accept-flagged]",
87
+ skills: [
88
+ "Sync, list, add, review and learn skills.",
89
+ "ocean skills sync|doctor|list [status|id]|observe [session-id]|add <id> <name> <instructions>|review <id> promoted|rejected|learn <session-id>|migrate",
134
90
  ],
135
91
  browser: [
136
92
  "Drive a browser session; uploads and submits need --approve.",
@@ -140,89 +96,17 @@ export const commandHelp = {
140
96
  "Search, read, review and maintain memory records and the brain index.",
141
97
  "ocean memory doctor|sync [--apply]|review [list|approve <id> [--to <path>]|reject <id>]|eval <questions.json|.jsonl> [--k N] [--min R] [--fts]|hygiene [--yes]|drift [--yes]|digest|harvest [--source <id>] [--yes]|import-claude <export-dir> [--yes]|history [path] [--limit N]|audit [--client <name>] [--days N] [--limit N] [--json]|restore <id> [--hash <sha256>]|delete <path> --hash <sha256>|purge [--days N] [--yes]|facts <profile> [key] [value]|facts <profile> delete <key>|reindex [--no-vectors]|search <q> [--project <id>|--all] [--type T] [--since D] [--as-of D] [--fts] [--json]|read <id|path>|neighbors <id|path> [--depth N] [--project <id>|--all]",
142
98
  ],
143
- pull: [
144
- "Pull what AI clients hold into Ocean as review candidates; a dry run until --yes.",
145
- "ocean pull [--yes] [--daily] | search [words…] [--project <id>] [--client <id>] [--limit N] [--json] | report",
146
- ],
147
- desktop: [
148
- "Capture facts from Claude Desktop's chat, read from the app's local store; --export reads an unpacked claude.ai data export; --dry-run lists conversations and message counts, never text.",
149
- "ocean desktop capture [--dry-run] [--export <folder>] [--since <date>] [--quiet <minutes>] [--json]",
150
- ],
151
- observe: [
152
- "Run a command and record its output, or show a recording.",
153
- "ocean observe -- <command> [args] | show <id> [--grep <pattern>]",
154
- ],
155
99
  capture: [
156
- "Capture ideas and promote or discard them.",
157
- "ocean capture add <idea>|scan [session-id]|list [status]|promote <id> <target>|discard <id>",
158
- ],
159
- brief: [
160
- "Write today's brief from your interests' feeds to 01-daily/reports/briefs/ (high priority daily, all weekly).",
161
- "ocean brief [--weekly] [--dry-run] [--date YYYY-MM-DD]",
162
- ],
163
- interests: [
164
- "Propose interests from your projects' dependencies or topics recurring in your sessions (as candidates), decay unused ones, record keep/skip.",
165
- "ocean interests discover [--yes] | signals [--weeks N] [--yes] | decay [--weeks N] [--yes] | keep <name> | skip <name>",
166
- ],
167
- distill: [
168
- "Distill a week (digest in 01-daily/reports/weekly/, decisions and lessons as candidates), or review last month against goals.md (01-daily/reports/monthly/).",
169
- "ocean distill --week [--date YYYY-MM-DD] [--yes] | --month [--month-of YYYY-MM] [--yes]",
170
- ],
171
- harvest: [
172
- "Harvest a day's sessions from every AI client: the day's summary, decisions, fixes and lessons filed into 05-knowledge (undo per day), archive after 30 days.",
173
- "ocean harvest [--date YYYY-MM-DD | --pending] [--yes] | archive [--days N] [--yes] | undo <YYYY-MM-DD>",
174
- ],
175
- rhythm: [
176
- "Run the day's rhythm once per period, no model: morning note, harvest, archive, last week's digest, last month's review, then the nightly upkeep.",
177
- "ocean rhythm [--yes]",
178
- ],
179
- upkeep: [
180
- "Run the nightly jobs (doctor, telemetry, reindex, search eval, curator, scorecard), no model, and write the morning digest to 01-daily/reports/digest/.",
181
- "ocean upkeep [--yes] [--if-due]",
182
- ],
183
- curator: [
184
- "Mark lessons and skills stale after 30 days unused (or 90 unreviewed), archive after 90; review undoes a mark.",
185
- "ocean curator [--yes] | review <lesson:id|skill:name>",
186
- ],
187
- telemetry: [
188
- "Find recurring errors (by signature) and failing providers in recent sessions; propose them, guardrail climbs for absorbed failures that came back, and lessons that do not help, as backlog lines.",
189
- "ocean telemetry [--days N] [--yes]",
190
- ],
191
- failures: [
192
- "Failure records by signature: open -> fix-landing -> absorbed -> superseded-by; climb the guardrail ladder lesson -> doctor -> test.",
193
- "ocean failures [list] [--json] | open <id> <signature> --title <t> --mechanism <why> [--lesson <id>] [--rung <r>] | status <id> <status> [--by <mechanism>] | climb <id>",
100
+ "Put things into Ocean: a note, an idea (save, classify, discard), a command's recorded output, what AI clients hold (import; a dry run until --yes), or Claude Desktop's chats.",
101
+ 'ocean capture note "<text>" | idea save <title> <content> [--session <id>]|list [status]|classify <id> <target>|discard <id> | observe -- <command> [args]|show <id> [--grep <pattern>] | import [--yes] [--daily]|search [words…] [--project <id>] [--client <id>] [--limit N] [--json]|report | desktop capture [--dry-run] [--export <folder>] [--since <date>] [--quiet <minutes>] [--json] | add <idea>|scan [session-id]|list [status]|promote <id> <target>|discard <id>',
194
102
  ],
195
- scorecard: [
196
- "Print Ocean's health numbers from real data; --write saves 01-daily/reports/scorecard/YYYY-MM-DD.md.",
197
- "ocean scorecard [--json] [--write]",
103
+ day: [
104
+ "The day's notes: start writes the morning half of today's note, end harvests the day's sessions, week and month distill, brief and interests feed it, express drafts a CV/LinkedIn/scholarship text, auto runs the whole rhythm once per period.",
105
+ "ocean day start [--apply] [--news <bounded-news-summary>] | end [--date YYYY-MM-DD | --pending] [--yes]|archive [--days N] [--yes]|undo <YYYY-MM-DD> | week [--date YYYY-MM-DD] [--yes] | month [--month-of YYYY-MM] [--yes] | brief [--weekly] [--dry-run] [--date YYYY-MM-DD] | interests discover [--yes]|signals [--weeks N] [--yes]|decay [--weeks N] [--yes]|keep <name>|skip <name> | express cv|linkedin|scholarship [--dry-run] | auto [--yes]",
198
106
  ],
199
- express: [
200
- "Draft a CV section, LinkedIn post or scholarship paragraph from your milestones into 00-inbox/drafts/.",
201
- "ocean express cv|linkedin|scholarship [--dry-run]",
202
- ],
203
- note: [
204
- "Capture a thought into 00-inbox/captures with the capture frontmatter.",
205
- 'ocean note "<text>"',
206
- ],
207
- handoff: [
208
- "Create, show and list handoffs between sessions.",
209
- "ocean handoff create [--task <id>] [--session <id>] [--next <action>]|show <id>|context <id>|list [--task <id>] [--project <id>]",
210
- ],
211
- idea: [
212
- "Save, list, classify and discard ideas.",
213
- "ocean idea save <title> <content> [--session <id>]|list [status]|classify <id> <target>|discard <id>",
214
- ],
215
- daily: [
216
- "Write the morning half of today's note (focus, coming up, open loops, hours, waiting on you, brief); --apply writes it.",
217
- "ocean daily start [--apply] [--news <bounded-news-summary>]",
218
- ],
219
- skill: [
220
- "Sync, list, add, review and learn skills.",
221
- "ocean skill sync|doctor|list [status|id]|observe [session-id]|add <id> <name> <instructions>|review <id> promoted|rejected|learn <session-id>|migrate",
222
- ],
223
- catalog: [
224
- "List the AI clients Ocean can install, with their installers.",
225
- "ocean catalog",
107
+ health: [
108
+ "Ocean's health numbers from real data (default: scorecard), recurring errors and failure records, the lesson and skill curator, and the nightly jobs.",
109
+ "ocean health [scorecard] [--json] [--write] | failures [list] [--json]|open <id> <signature> --title <t> --mechanism <why> [--lesson <id>] [--rung <r>]|status <id> <status> [--by <mechanism>]|climb <id> | telemetry [--days N] [--yes] | curator [--yes]|review <lesson:id|skill:name> | nightly [--yes] [--if-due]",
226
110
  ],
227
111
  obsidian: [
228
112
  "Connect, sync and write to an Obsidian vault (read-only unless --read-write).",
@@ -236,14 +120,14 @@ export const commandHelp = {
236
120
  "Migrate the session store; a dry run until --apply.",
237
121
  "ocean migrate [--apply]",
238
122
  ],
123
+ intercept: [
124
+ "Run an AI CLI through Ocean's session capture (the shims call this).",
125
+ "ocean intercept --client <provider> -- [args]",
126
+ ],
239
127
  layout: [
240
- "Plan, apply or roll back the workspace layout move.",
128
+ "Deprecated (removed next major): plan, apply or roll back the workspace layout move.",
241
129
  "ocean layout plan | apply --yes | rollback --yes",
242
130
  ],
243
- env: [
244
- "Print the shell line that puts Ocean's shim folder on PATH; writes nothing.",
245
- "ocean env",
246
- ],
247
131
  };
248
132
  const HELP_FLAGS = new Set(["--help", "-h"]);
249
133
  // A help flag anywhere before `--` is Ocean's, for every command: `client sync --help` once ran the
@@ -1,5 +1,5 @@
1
1
  import { localDate } from "@ocean/core/shared/local-date.js";
2
- import { checkDrift, readHygieneHistory, renderHygieneReport, runHygiene, writeHygieneReport, } from "@ocean/services/hygiene/hygiene.js";
2
+ import { checkDrift, readHygieneHistory, renderHygieneReport, runHygiene, writeHygieneReport, } from "@ocean/services/health/hygiene.js";
3
3
  import { claimChecker } from "../../application/upkeep/claim-checkers.js";
4
4
  // `ocean memory hygiene [--yes]` and `ocean memory drift [--yes]` (T-322): argument parsing and
5
5
  // output around services/hygiene and the checkers in application/upkeep.
@@ -1,5 +1,5 @@
1
1
  import { randomUUID } from "node:crypto";
2
- import { openSessionStore } from "@ocean/loop/infrastructure/persistence/session-store.js";
2
+ import { openSessionStore } from "@ocean/work/sessions/session-store.js";
3
3
  export async function runIdeaCommand(action, args) {
4
4
  const store = await openSessionStore();
5
5
  try {
@@ -1,16 +1,17 @@
1
1
  import { randomUUID } from "node:crypto";
2
2
  import path from "node:path";
3
- import { bootstrapEnvironment, buildOceanBootstrap, } from "@ocean/context/context/resource-injection.js";
3
+ import { bootstrapEnvironment, buildOceanBootstrap, } from "@ocean/context/resource-injection.js";
4
4
  import { profileIdentity, } from "@ocean/core/domain/profiles/profile.js";
5
5
  import { validateRunContract } from "@ocean/core/domain/runs/run-contract.js";
6
6
  import { validateSessionEntryContract } from "@ocean/core/domain/sessions/entry-contract.js";
7
7
  import { oceanEnvPair } from "@ocean/core/shared/paths.js";
8
- import { projectRules, resolveProject, } from "@ocean/core/shared/project-resolution.js";
9
- import { boundProjectManifest } from "@ocean/loop/hooks/session-start-hook.js";
10
- import { openSessionStore } from "@ocean/loop/infrastructure/persistence/session-store.js";
11
- import { authorizeRun } from "@ocean/loop/runs/run-authorization.js";
12
- import { finalizeSession } from "@ocean/loop/sessions/session-closeout.js";
13
- import { resolveSessionTask } from "@ocean/loop/tasks/session-task.js";
8
+ import { projectRules } from "@ocean/core/shared/project-manifest.js";
9
+ import { resolveProject } from "@ocean/core/shared/project-resolution.js";
10
+ import { authorizeRun } from "@ocean/work/runs/run-authorization.js";
11
+ import { boundProjectManifest } from "@ocean/work/sessions/hooks/session-start-hook.js";
12
+ import { finalizeSession } from "@ocean/work/sessions/session-closeout.js";
13
+ import { openSessionStore } from "@ocean/work/sessions/session-store.js";
14
+ import { resolveSessionTask } from "@ocean/work/tasks/session-task.js";
14
15
  import { authAdapter, authLogin, authStatus, } from "../../application/auth/auth-orchestrator.js";
15
16
  import { defaultAuthDeps } from "../../composition/runtime.js";
16
17
  import { redactRuntimeText } from "../../infrastructure/observability/runtime-logger.js";
@@ -1,4 +1,4 @@
1
- import { decayInterests, interestFeedback, proposeDiscoveredInterests, proposeSignalInterests, } from "@ocean/services/brief/interest-discovery.js";
1
+ import { decayInterests, interestFeedback, proposeDiscoveredInterests, proposeSignalInterests, } from "@ocean/services/day/interest-discovery.js";
2
2
  const USAGE = "Usage: ocean interests discover [--yes] | signals [--weeks N] [--yes] | decay [--weeks N] [--yes] | keep <name> | skip <name>";
3
3
  // `ocean interests` (T-314): discover candidate interests from registered projects, decay the
4
4
  // ones with no signal, and record keep/skip feedback on brief items.
@@ -7,6 +7,8 @@ export async function runLayoutCommand(args) {
7
7
  // modes); on Windows the home folder, links and permissions behave differently and are untested.
8
8
  if (process.platform === "win32")
9
9
  throw new Error("ocean layout supports macOS and Linux only.");
10
+ // Deprecated (T-342): kept for installs that predate the T-243 layout; removed next major.
11
+ console.error("ocean layout is deprecated and will be removed in the next major release.");
10
12
  const action = args[0] ?? "plan";
11
13
  const confirmed = args.includes("--yes");
12
14
  const print = (value) => console.log(JSON.stringify(value, null, 2));
@@ -1,15 +1,15 @@
1
1
  import { existsSync, readFileSync } from "node:fs";
2
2
  import { readFile } from "node:fs/promises";
3
3
  import path from "node:path";
4
- import { mcpServerFile } from "@ocean/market/adapters/mcp-adapter.js";
5
- import { createDefaultMarketplace, marketplacePaths, } from "@ocean/market/install/default-marketplace.js";
6
- import { addOwnMcpServer } from "@ocean/market/install/own-server.js";
7
- import { sensitivityOf } from "@ocean/market/mcp/mcp-gateway.js";
8
- import { launchInputs, } from "@ocean/market/mcp/mcp-launch.js";
9
- import { runInstalledMcp } from "@ocean/market/mcp/mcp-runner.js";
10
- import { fetchRegistryServer, searchRegistry, } from "@ocean/market/registry/official-registry.js";
11
- import { keychainStore } from "@ocean/market/security/secrets.js";
12
- import { hubSkillHashes, pruneClientSkills, } from "@ocean/market/skills/skill-hub.js";
4
+ import { mcpServerFile } from "@ocean/connect/adapters/mcp-adapter.js";
5
+ import { createDefaultMarketplace, marketplacePaths, } from "@ocean/connect/install/default-marketplace.js";
6
+ import { addOwnMcpServer } from "@ocean/connect/install/own-server.js";
7
+ import { sensitivityOf } from "@ocean/connect/mcp/mcp-gateway.js";
8
+ import { launchInputs, } from "@ocean/connect/mcp/mcp-launch.js";
9
+ import { runInstalledMcp } from "@ocean/connect/mcp/mcp-runner.js";
10
+ import { fetchRegistryServer, searchRegistry, } from "@ocean/connect/registry/official-registry.js";
11
+ import { keychainStore } from "@ocean/connect/security/secrets.js";
12
+ import { hubSkillHashes, pruneClientSkills, } from "@ocean/connect/skills/skill-hub.js";
13
13
  import { autoSyncSkills } from "../../application/integrations/skill-auto-sync.js";
14
14
  import { oceanVersion } from "../../version.js";
15
15
  const usage = "Usage: ocean market list|search <term>|add <server.json|registry name> [--version <v>]|install <name> [--version <v>]|update <name>|uninstall <name>|exec <name>|secret list|set|remove <name> [<value name>] [--index <file>]... [--yes] [--accept-flagged]";
@@ -1,13 +1,22 @@
1
+ import { mkdirSync, watch } from "node:fs";
2
+ import path from "node:path";
3
+ import { pathToFileURL } from "node:url";
4
+ import { ConnectorHub, connectorsForProfile, } from "@ocean/connect/connectors/connector-hub.js";
5
+ import { marketplacePaths } from "@ocean/connect/install/default-marketplace.js";
6
+ import { gatewayManifestStore, gatewayMembers, McpGateway, readGatewayAccess, serveMcpGateway, } from "@ocean/connect/mcp/mcp-gateway.js";
7
+ import { pinNpmPackage } from "@ocean/connect/mcp/mcp-launch.js";
8
+ import { keychainStore } from "@ocean/connect/security/secrets.js";
1
9
  import { MEMORY_INSTRUCTIONS } from "@ocean/core/domain/mcp/memory-contract.js";
2
- import { marketplacePaths } from "@ocean/market/install/default-marketplace.js";
3
- import { gatewayMembers, McpGateway, readGatewayAccess, serveMcpGateway, } from "@ocean/market/mcp/mcp-gateway.js";
4
- import { keychainStore } from "@ocean/market/security/secrets.js";
5
- import { McpClient } from "@ocean/services/infrastructure/mcp/mcp-client.js";
10
+ import { profileCatalog, sessionProfile, } from "@ocean/core/profiles/session-profile.js";
11
+ import { resolveProject } from "@ocean/core/shared/project-resolution.js";
12
+ import { readToolSelection, selectionPath, } from "@ocean/core/shared/tool-groups.js";
13
+ import { McpClient } from "@ocean/services/integrations/mcp/mcp-client.js";
6
14
  import { RemoteMcpClient } from "../../infrastructure/mcp/remote-mcp-client.js";
7
15
  import { oceanVersion } from "../../version.js";
16
+ import { connectorsDir } from "./connectors-command.js";
8
17
  const OCEAN_SERVER = "dev.ocean/ocean";
9
18
  // How the gateway (and `ocean mcp status --check`) talks to one member.
10
- export function gatewayClientFor(member, version, stderrLabel = `ocean mcp gateway [${member.capability}]`) {
19
+ export function gatewayClientFor(member, version, stderrLabel = `ocean mcp gateway [${member.capability}]`, context) {
11
20
  return member.transport === "remote"
12
21
  ? new RemoteMcpClient(member, version)
13
22
  : new McpClient({
@@ -17,8 +26,65 @@ export function gatewayClientFor(member, version, stderrLabel = `ocean mcp gatew
17
26
  env: member.env,
18
27
  inheritEnv: member.inheritEnv,
19
28
  stderrLabel,
29
+ ...(context ? { roots: context.roots } : {}),
30
+ ...(context?.onListChanged
31
+ ? {
32
+ onNotification: (method) => {
33
+ if (/^notifications\/(tools|resources|prompts)\/list_changed$/.test(method))
34
+ context.onListChanged?.();
35
+ },
36
+ }
37
+ : {}),
20
38
  });
21
39
  }
40
+ // The profile this gateway gates by: `--profile <name>`, else the one Ocean resolves for the
41
+ // folder the client started it in (Claude Code: the project; Desktop: `/`, which resolves to
42
+ // base). `--profile '*'`: no gating. The active profile carries its secondary profiles' MCPs
43
+ // too, as the session does. No installed profiles: no gating.
44
+ async function gatewayProfiles(args, cwd) {
45
+ const asked = args.includes("--profile")
46
+ ? args[args.indexOf("--profile") + 1]
47
+ : undefined;
48
+ if (asked === "*")
49
+ return undefined;
50
+ const catalog = await profileCatalog();
51
+ // No profiles installed: nothing to gate by, so every member stays listed.
52
+ if (!catalog.profiles.length)
53
+ return undefined;
54
+ // An MCP connector entry joins a profile's members only where the profile uses it (T-339 P3).
55
+ const { rows } = await new ConnectorHub(connectorsDir()).list();
56
+ const available = catalog.profiles.map((profile) => ({
57
+ name: profile.name,
58
+ mcp: [
59
+ ...new Set([
60
+ ...profile.mcp,
61
+ ...connectorsForProfile(rows, profile)
62
+ .filter((entry) => entry.kind === "mcp-stdio" || entry.kind === "mcp-remote")
63
+ .map((entry) => entry.id),
64
+ ]),
65
+ ],
66
+ }));
67
+ const mcpOf = (name) => available.find((profile) => profile.name === name)?.mcp ?? [];
68
+ if (asked)
69
+ return { active: { name: asked, mcp: mcpOf(asked) }, available };
70
+ const atRoot = cwd === "/" || /^[A-Za-z]:\\?$/.test(cwd);
71
+ const project = atRoot
72
+ ? undefined
73
+ : await resolveProject(cwd).catch(() => undefined);
74
+ const session = await sessionProfile({
75
+ projectId: project?.status === "bound" ? project.projectId : undefined,
76
+ cwd: atRoot ? undefined : cwd,
77
+ catalog,
78
+ });
79
+ const names = [session.primary, ...session.secondary];
80
+ return {
81
+ active: {
82
+ name: session.primary,
83
+ mcp: [...new Set(names.flatMap(mcpOf))],
84
+ },
85
+ available,
86
+ };
87
+ }
22
88
  // `ocean mcp gateway`: one stdio MCP endpoint for every registered server. Logs go to stderr,
23
89
  // which MCP clients keep as the server's log.
24
90
  // `--installed-only`: leave out Ocean's own servers, for a client wired to them directly.
@@ -30,14 +96,35 @@ export async function runMcpGatewayCommand(args = []) {
30
96
  const { members, skipped } = await gatewayMembers({
31
97
  serversRoot: paths.mcpServers,
32
98
  stateRoot: paths.mcpState,
99
+ packagesRoot: paths.mcpPackages,
33
100
  firstParty,
34
101
  secrets: keychainStore(),
35
102
  });
103
+ // Ocean's own servers left out on purpose (`--installed-only`) are not news; anything else is.
36
104
  for (const skip of skipped)
37
- log(`${skip.capability} not routed: ${skip.reason}`);
105
+ if (!skip.uninstalled)
106
+ log(`${skip.capability} not routed: ${skip.reason}`);
38
107
  const version = await oceanVersion();
108
+ const cwd = process.cwd();
109
+ const atRoot = cwd === "/" || /^[A-Za-z]:\\?$/.test(cwd);
110
+ const profiles = await gatewayProfiles(args, cwd).catch((error) => {
111
+ log(`profiles unreadable, every member listed: ${error instanceof Error ? error.message : String(error)}`);
112
+ return undefined;
113
+ });
114
+ const pinning = new Set();
39
115
  const gateway = new McpGateway(members, {
40
- client: (member) => gatewayClientFor(member, version),
116
+ client: (member, context) => {
117
+ // A member still on npx gets a pinned copy in the background; the next start uses it.
118
+ if (member.transport !== "remote" && member.pin) {
119
+ const { identifier, version: pinned } = member.pin;
120
+ const key = `${identifier}@${pinned}`;
121
+ if (!pinning.has(key)) {
122
+ pinning.add(key);
123
+ pinNpmPackage(paths.mcpPackages, identifier, pinned).then(() => log(`${key} pinned; the next start skips npx`), (error) => log(`${key} not pinned: ${error instanceof Error ? error.message : String(error)}`));
124
+ }
125
+ }
126
+ return gatewayClientFor(member, version, `ocean mcp gateway [${member.capability}]`, context);
127
+ },
41
128
  version,
42
129
  log,
43
130
  // When Ocean's own server sits behind the gateway and this client may see it, the client
@@ -49,7 +136,37 @@ export async function runMcpGatewayCommand(args = []) {
49
136
  clientId: args.includes("--client")
50
137
  ? args[args.indexOf("--client") + 1]
51
138
  : undefined,
139
+ ...(profiles ? { profiles } : {}),
140
+ // Ocean's memory contract holds in every profile.
141
+ ungated: [OCEAN_SERVER],
142
+ manifests: gatewayManifestStore(paths.gatewayManifests, version),
143
+ ...(atRoot ? {} : { roots: [{ uri: pathToFileURL(cwd).href }] }),
52
144
  });
145
+ // A gateway started without `--profile` follows the prompt hook's selection for its folder.
146
+ if (profiles && !args.includes("--profile") && !atRoot)
147
+ followToolSelection(gateway, cwd, log);
53
148
  await serveMcpGateway(gateway);
54
149
  }
150
+ // Watches the selection file the prompt hook writes for this folder (debounced) and widens the
151
+ // gateway's profile to it. Best effort: a missing directory or a failed read changes nothing.
152
+ function followToolSelection(gateway, cwd, log) {
153
+ const file = selectionPath(cwd);
154
+ let timer;
155
+ const apply = () => void readToolSelection(cwd)
156
+ .then((selection) => selection ? gateway.followSelection(selection) : false)
157
+ .catch((error) => log(`selection not followed: ${error instanceof Error ? error.message : String(error)}`));
158
+ try {
159
+ mkdirSync(path.dirname(file), { recursive: true, mode: 0o700 });
160
+ const watcher = watch(path.dirname(file), (_event, name) => {
161
+ if (name !== path.basename(file))
162
+ return;
163
+ clearTimeout(timer);
164
+ timer = setTimeout(apply, 250);
165
+ timer.unref();
166
+ });
167
+ watcher.unref();
168
+ }
169
+ catch { }
170
+ apply();
171
+ }
55
172
  //# sourceMappingURL=mcp-gateway-command.js.map