@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
@@ -0,0 +1,5 @@
1
+ import { runBrowserCommand } from "../browser-command.js";
2
+ export async function commandBrowser() {
3
+ await runBrowserCommand(process.argv[3] ?? "", process.argv.slice(4));
4
+ }
5
+ //# sourceMappingURL=browser.js.map
@@ -0,0 +1,19 @@
1
+ import { runCaptureCommand } from "../capture-command.js";
2
+ import { runDesktopCommand } from "../desktop-command.js";
3
+ import { runNoteCommand } from "../note-command.js";
4
+ import { runPullCommand } from "../pull-command.js";
5
+ import { router } from "./dispatch.js";
6
+ import { commandIdea } from "./idea.js";
7
+ import { commandObserve } from "./observe.js";
8
+ // One inbox: `capture add|scan|list|promote|discard` as before, plus note, idea, observe,
9
+ // import (was `pull`) and desktop.
10
+ export const commandCapture = router({
11
+ note: { drop: () => runNoteCommand(process.argv.slice(3)) },
12
+ idea: { drop: commandIdea },
13
+ observe: { drop: commandObserve },
14
+ import: { drop: () => runPullCommand(process.argv.slice(3)) },
15
+ desktop: { drop: () => runDesktopCommand(process.argv.slice(3)) },
16
+ }, async () => {
17
+ await runCaptureCommand(process.argv[3] ?? "", process.argv.slice(4));
18
+ });
19
+ //# sourceMappingURL=capture.js.map
@@ -0,0 +1,9 @@
1
+ import { installPlan, listInstallSpecs, } from "../../../application/install/provider-installer.js";
2
+ export async function commandCatalog() {
3
+ console.log(JSON.stringify(listInstallSpecs().map((spec) => ({
4
+ id: spec.provider.id,
5
+ command: spec.provider.command,
6
+ installer: installPlan(spec.provider.id),
7
+ })), null, 2));
8
+ }
9
+ //# sourceMappingURL=catalog.js.map
@@ -0,0 +1,135 @@
1
+ import { recordSynced } from "@ocean/core/shared/visibility.js";
2
+ import { repairClients } from "../../../application/clients/clients.js";
3
+ import { syncCharterCopies } from "../../../application/integrations/charter-copies.js";
4
+ import { configureClaudeCodeWrapper } from "../../../application/integrations/claude-vscode.js";
5
+ import { repairEngineEntries } from "../../../application/integrations/engine-entry-repair.js";
6
+ import { autoSyncSkills } from "../../../application/integrations/skill-auto-sync.js";
7
+ import { syncSkillFilter } from "../../../application/integrations/skill-filter.js";
8
+ import { defaultWrapperManager } from "../../../composition/runtime.js";
9
+ import { ensureService, restartService, } from "../../../infrastructure/process/service.js";
10
+ import { loadProviderRegistry } from "../../../infrastructure/providers/provider-registry.js";
11
+ import { registerProvider, setProviderEnabled, syncProviderWrappers, wrapperDoctor, wrapperStatus, } from "../../../infrastructure/wrappers/wrapper-manager.js";
12
+ import { runClientTestCommand } from "../client-test-command.js";
13
+ import { intercept } from "../intercept-command.js";
14
+ import { manageClients } from "../onboard-command.js";
15
+ export async function commandClient() {
16
+ const action = process.argv[3] ?? "list";
17
+ if (action === "list") {
18
+ console.log(JSON.stringify(loadProviderRegistry(), null, 2));
19
+ }
20
+ else if (action === "open") {
21
+ const provider = process.argv[4];
22
+ if (!provider) {
23
+ console.error("Usage: ocean client open <provider> [provider-args]");
24
+ process.exitCode = 1;
25
+ }
26
+ else {
27
+ // After `--`, arguments go to the provider untouched (a help flag before it is Ocean's).
28
+ const rest = process.argv.slice(5);
29
+ const separator = rest.indexOf("--");
30
+ const providerArgs = separator >= 0 ? rest.slice(0, separator) : rest;
31
+ const passed = separator >= 0 ? rest.slice(separator + 1) : [];
32
+ const taskIndex = providerArgs.indexOf("--task");
33
+ const handoffIndex = providerArgs.indexOf("--handoff");
34
+ const taskId = taskIndex >= 0 ? providerArgs[taskIndex + 1] : undefined;
35
+ const handoffId = handoffIndex >= 0 ? providerArgs[handoffIndex + 1] : undefined;
36
+ const metadataFlags = new Set();
37
+ if (taskIndex >= 0) {
38
+ metadataFlags.add(taskIndex);
39
+ metadataFlags.add(taskIndex + 1);
40
+ }
41
+ if (handoffIndex >= 0) {
42
+ metadataFlags.add(handoffIndex);
43
+ metadataFlags.add(handoffIndex + 1);
44
+ }
45
+ process.exitCode = await intercept(provider, [
46
+ ...providerArgs.filter((_, index) => !metadataFlags.has(index)),
47
+ ...passed,
48
+ ], {
49
+ entryPoint: "interactive-managed",
50
+ controlLevel: "managed-partial",
51
+ taskId,
52
+ handoffId,
53
+ });
54
+ }
55
+ }
56
+ else if (action === "sync") {
57
+ const result = await syncProviderWrappers();
58
+ // Runs at every session start (the SessionStart hook calls `client sync`), so an edit
59
+ // to core.md reaches the clients that carry a copy without a manual step.
60
+ const charter = await syncCharterCopies();
61
+ const skillFilter = await syncSkillFilter();
62
+ // A skill made or installed reaches every client at the next session start.
63
+ const skills = await autoSyncSkills();
64
+ const engineEntries = await repairEngineEntries();
65
+ // T-305: a repointed service start file only takes effect once the service restarts.
66
+ const service = engineEntries.some((repair) => repair.kind === "service" && repair.status === "updated")
67
+ ? await restartService()
68
+ : await ensureService();
69
+ // T-296: re-applies the `ocean` entry only for clients the owner approved with
70
+ // `ocean clients apply --yes`; never a client that was not approved.
71
+ const clients = await repairClients().catch((error) => ({
72
+ error: error instanceof Error ? error.message : String(error),
73
+ }));
74
+ // T-328 phase 3: status lines show `synced <age>` from this stamp.
75
+ await recordSynced();
76
+ console.log(JSON.stringify({
77
+ directory: result.directory,
78
+ providers: result.providers,
79
+ charter,
80
+ skillFilter,
81
+ skills,
82
+ engineEntries,
83
+ service,
84
+ clients,
85
+ }, null, 2));
86
+ }
87
+ else if (action === "register") {
88
+ const id = process.argv[4];
89
+ const provider = await registerProvider(id ?? "", process.argv[5] ?? id ?? "");
90
+ console.log(JSON.stringify(provider, null, 2));
91
+ }
92
+ else if (action === "enable" || action === "disable") {
93
+ const id = process.argv[4];
94
+ if (!id) {
95
+ console.error(`Usage: ocean client ${action} <provider>`);
96
+ process.exitCode = 1;
97
+ }
98
+ else {
99
+ const provider = await setProviderEnabled(id, action === "enable");
100
+ console.log(JSON.stringify(provider, null, 2));
101
+ }
102
+ }
103
+ else if (action === "manage") {
104
+ await manageClients();
105
+ }
106
+ else if (action === "doctor") {
107
+ const findings = await wrapperDoctor(process.argv[4]);
108
+ if (findings.length) {
109
+ findings.forEach((finding) => {
110
+ console.error(`NOT READY: ${finding}`);
111
+ });
112
+ process.exitCode = 1;
113
+ }
114
+ else {
115
+ console.log("PROVEN: Ocean wrappers are configured and provider binaries resolve outside the shim directory.");
116
+ }
117
+ }
118
+ else if (action === "status") {
119
+ console.log(JSON.stringify(await wrapperStatus(), null, 2));
120
+ }
121
+ else if (action === "vscode-wrapper") {
122
+ const settingsIndex = process.argv.indexOf("--settings");
123
+ const settingsPath = settingsIndex >= 0 ? process.argv[settingsIndex + 1] : undefined;
124
+ console.log(JSON.stringify(await configureClaudeCodeWrapper(defaultWrapperManager, settingsPath, process.argv.includes("--apply")), null, 2));
125
+ }
126
+ else if (action === "test") {
127
+ const provider = process.argv[4] === "--json" ? "" : (process.argv[4] ?? "");
128
+ await runClientTestCommand(provider, process.argv.includes("--json"));
129
+ }
130
+ else {
131
+ console.error("Usage: ocean client list|status|test [provider] [--json]|open <provider> [provider-args]|vscode-wrapper [--settings <path>] [--apply]|sync|register <id> [command]|enable <id>|disable <id>|manage|doctor [absolute-provider-path]");
132
+ process.exitCode = 1;
133
+ }
134
+ }
135
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1,33 @@
1
+ import { runAuthCommand } from "../auth-command.js";
2
+ import { runClientsCommand } from "../clients-command.js";
3
+ import { commandCatalog } from "./catalog.js";
4
+ import { commandClient } from "./client.js";
5
+ import { router } from "./dispatch.js";
6
+ import { commandInstall } from "./install.js";
7
+ import { commandUpdateOrRemove } from "./update-remove.js";
8
+ // One noun for AI apps. Connecting them to Ocean is `clients status|detect|plan|apply|...`; the
9
+ // installed shims and CLIs are `clients list|open|sync|register|enable|disable|manage|doctor|
10
+ // vscode-wrapper|test|wrappers` (was `client`; `wrappers` was `client status`), and
11
+ // `clients install|update|remove|catalog|auth` (were install, update, remove, catalog, auth).
12
+ const keepClient = { keep: commandClient };
13
+ export const commandClients = router({
14
+ list: keepClient,
15
+ open: keepClient,
16
+ sync: keepClient,
17
+ register: keepClient,
18
+ enable: keepClient,
19
+ disable: keepClient,
20
+ manage: keepClient,
21
+ doctor: keepClient,
22
+ "vscode-wrapper": keepClient,
23
+ test: keepClient,
24
+ wrappers: { as: "status", run: commandClient },
25
+ install: { drop: commandInstall },
26
+ update: { drop: () => commandUpdateOrRemove("update") },
27
+ remove: { drop: () => commandUpdateOrRemove("remove") },
28
+ catalog: { drop: commandCatalog },
29
+ auth: {
30
+ drop: () => runAuthCommand(process.argv[3] ?? "", process.argv[4] ?? ""),
31
+ },
32
+ }, () => runClientsCommand(process.argv.slice(3)));
33
+ //# sourceMappingURL=clients.js.map
@@ -0,0 +1,14 @@
1
+ import { runConnectorsCommand, runScoutCommand, } from "../connectors-command.js";
2
+ import { router } from "./dispatch.js";
3
+ import { commandMarket } from "./market.js";
4
+ // One noun for outside apps and tools: `connectors list|doctor|add|remove|auth`, `market ...`
5
+ // (was `market`) and `scout <profile>` (was `scout`).
6
+ export const commandConnectors = router({
7
+ market: { drop: commandMarket },
8
+ scout: {
9
+ drop: async () => {
10
+ await runScoutCommand(process.argv.slice(3));
11
+ },
12
+ },
13
+ }, () => runConnectorsCommand(process.argv.slice(3)));
14
+ //# sourceMappingURL=connectors.js.map
@@ -0,0 +1,9 @@
1
+ import { runContextCommand, runContextCostCommand, } from "../context-command.js";
2
+ export async function commandContext() {
3
+ if (process.argv[3] === "cost") {
4
+ await runContextCostCommand(process.argv.slice(4));
5
+ return;
6
+ }
7
+ await runContextCommand(process.argv.includes("--json"));
8
+ }
9
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1,15 @@
1
+ import { runCostCommand } from "../cost-command.js";
2
+ import { runSessionsCommand } from "../sessions-command.js";
3
+ // `cost` is Claude use at list price; `cost --source extraction` is what session capture's
4
+ // extraction calls cost (was `sessions cost`, which still works).
5
+ export async function commandCost() {
6
+ const args = process.argv.slice(3);
7
+ const at = args.indexOf("--source");
8
+ if (at >= 0 && args[at + 1] === "extraction")
9
+ return runSessionsCommand([
10
+ "cost",
11
+ ...args.filter((_, index) => index !== at && index !== at + 1),
12
+ ]);
13
+ return runCostCommand(args);
14
+ }
15
+ //# sourceMappingURL=cost.js.map
@@ -0,0 +1,11 @@
1
+ import { runDailyCommand } from "../daily-command.js";
2
+ export async function commandDaily() {
3
+ try {
4
+ await runDailyCommand(process.argv[3] ?? "start", process.argv.slice(4));
5
+ }
6
+ catch (error) {
7
+ console.error(error instanceof Error ? error.message : String(error));
8
+ process.exitCode = 1;
9
+ }
10
+ }
11
+ //# sourceMappingURL=daily.js.map
@@ -0,0 +1,25 @@
1
+ import { runBriefCommand } from "../brief-command.js";
2
+ import { runDistillCommand } from "../distill-command.js";
3
+ import { runExpressCommand } from "../express-command.js";
4
+ import { runHarvestCommand } from "../harvest-command.js";
5
+ import { runInterestsCommand } from "../interests-command.js";
6
+ import { runRhythmCommand } from "../rhythm-command.js";
7
+ import { commandDaily } from "./daily.js";
8
+ import { router } from "./dispatch.js";
9
+ const rest = () => process.argv.slice(3);
10
+ // A flag the distill command takes first, kept as its own word: `day week`, `day month`.
11
+ const distill = (flag) => () => runDistillCommand([flag, ...rest()]);
12
+ // One daily pipeline: `day start [--apply]` (was `daily start`), `day end` (was `harvest`),
13
+ // `day week` / `day month` (was `distill --week|--month`), `day brief`, `day interests`,
14
+ // `day express`, `day auto` (was `rhythm`, run once a period by the service).
15
+ export const commandDay = router({
16
+ start: { keep: commandDaily },
17
+ end: { drop: () => runHarvestCommand(rest()) },
18
+ week: { drop: distill("--week") },
19
+ month: { drop: distill("--month") },
20
+ brief: { drop: () => runBriefCommand(rest()) },
21
+ interests: { drop: () => runInterestsCommand(rest()) },
22
+ express: { drop: () => runExpressCommand(rest()) },
23
+ auto: { drop: () => runRhythmCommand(rest()) },
24
+ }, commandDaily);
25
+ //# sourceMappingURL=day.js.map
@@ -0,0 +1,31 @@
1
+ // Handlers read their arguments from process.argv ([node, main.js, command, ...args]). A merged
2
+ // command passes the rest of the line to the handler that used to be a command of its own by
3
+ // running it with a rewritten argv, so every handler works unchanged.
4
+ export async function withArgs(args, handler) {
5
+ const saved = process.argv;
6
+ process.argv = [...saved.slice(0, 3), ...args];
7
+ try {
8
+ await handler();
9
+ }
10
+ finally {
11
+ process.argv = saved;
12
+ }
13
+ }
14
+ // The words after the command name.
15
+ function commandArgs() {
16
+ return process.argv.slice(3);
17
+ }
18
+ export function router(routes, fallback) {
19
+ return async () => {
20
+ const [sub, ...rest] = commandArgs();
21
+ const route = sub !== undefined && Object.hasOwn(routes, sub) ? routes[sub] : undefined;
22
+ if (!route)
23
+ return fallback();
24
+ if ("keep" in route)
25
+ return route.keep();
26
+ if ("drop" in route)
27
+ return withArgs(rest, route.drop);
28
+ return withArgs([route.as, ...rest], route.run);
29
+ };
30
+ }
31
+ //# sourceMappingURL=dispatch.js.map
@@ -0,0 +1,60 @@
1
+ import { hasFailures, workspaceReport, } from "@ocean/services/health/workspace-doctor.js";
2
+ import { clientDetectFindings } from "../../../application/clients/client-detect.js";
3
+ import { clientFindings, clientLiveFindings, } from "../../../application/clients/clients.js";
4
+ import { desktopWatcherFindings } from "../../../application/clients/desktop-watcher.js";
5
+ import { hookTrustFindings } from "../../../application/clients/hook-trust.js";
6
+ import { nativeFindings } from "../../../application/clients/native.js";
7
+ import { defaultWrapperManager } from "../../../composition/runtime.js";
8
+ import { browserFindings } from "../browser-findings.js";
9
+ import { runConnectorsCommand } from "../connectors-command.js";
10
+ import { gatewayFindings } from "../gateway-findings.js";
11
+ import { runProfilesCommand } from "../profiles-command.js";
12
+ import { runningServerFindings } from "../running-server-findings.js";
13
+ import { commandClient } from "./client.js";
14
+ import { withArgs } from "./dispatch.js";
15
+ import { commandMemory } from "./memory.js";
16
+ import { commandProject } from "./project.js";
17
+ import { commandRepair } from "./repair.js";
18
+ import { commandSession } from "./session.js";
19
+ import { commandSkill } from "./skill.js";
20
+ import { commandTasks } from "./tasks.js";
21
+ // `doctor <area>` runs one area's check, the same as that command's own `doctor` (each area's
22
+ // word is also its command): `doctor tasks`, `doctor sessions`, ... `doctor --fix` and
23
+ // `doctor repair [--apply]` show or apply what doctor can fix (was `repair`).
24
+ const DOCTOR_AREAS = {
25
+ tasks: commandTasks,
26
+ sessions: commandSession,
27
+ profiles: () => runProfilesCommand(process.argv.slice(3)),
28
+ connectors: () => runConnectorsCommand(process.argv.slice(3)),
29
+ clients: commandClient,
30
+ memory: commandMemory,
31
+ project: commandProject,
32
+ skills: commandSkill,
33
+ };
34
+ export async function commandDoctor() {
35
+ const [area, ...rest] = process.argv.slice(3);
36
+ if (area === "repair")
37
+ return withArgs(rest, commandRepair);
38
+ if (process.argv.includes("--fix"))
39
+ return withArgs(process.argv.slice(3).map((arg) => (arg === "--fix" ? "--apply" : arg)), commandRepair);
40
+ if (area && !area.startsWith("-")) {
41
+ if (!Object.hasOwn(DOCTOR_AREAS, area)) {
42
+ console.error(`Unknown doctor area: ${area}. Areas: repair, ${Object.keys(DOCTOR_AREAS).join(", ")}`);
43
+ process.exitCode = 1;
44
+ return;
45
+ }
46
+ return withArgs(["doctor", ...rest], DOCTOR_AREAS[area]);
47
+ }
48
+ const report = await workspaceReport(defaultWrapperManager);
49
+ // T-296: every installed AI client's `ocean` entry (supported fail, unknown warn).
50
+ report.findings.push(...(await clientFindings()), ...(await clientLiveFindings()), ...(await desktopWatcherFindings()), ...(await clientDetectFindings()), ...(await nativeFindings()), ...(await hookTrustFindings()), ...(await browserFindings()), ...(await gatewayFindings()), ...(await runningServerFindings()));
51
+ if (process.argv.includes("--json"))
52
+ console.log(JSON.stringify(report, null, 2));
53
+ else
54
+ report.findings.forEach((finding) => {
55
+ console.log(`${finding.severity}: ${finding.code} — ${finding.message}`);
56
+ });
57
+ if (hasFailures(report.findings))
58
+ process.exitCode = 1;
59
+ }
60
+ //# sourceMappingURL=doctor.js.map
@@ -0,0 +1,5 @@
1
+ import { installShellPath } from "../../../infrastructure/wrappers/wrapper-manager.js";
2
+ export async function commandEnv() {
3
+ console.log(await installShellPath());
4
+ }
5
+ //# sourceMappingURL=env.js.map
@@ -0,0 +1,16 @@
1
+ import { oceanEnv, oceanRoot } from "@ocean/core/shared/paths.js";
2
+ import { createWebhookGateway } from "../../../application/gateway/webhook-gateway.js";
3
+ import { defaultAgentRuntime } from "../../../composition/runtime.js";
4
+ export async function commandGateway() {
5
+ const port = Number(oceanEnv("GATEWAY_PORT") ?? 8787);
6
+ const token = oceanEnv("GATEWAY_TOKEN");
7
+ if (!token) {
8
+ console.error("OCEAN_GATEWAY_TOKEN is required");
9
+ process.exitCode = 1;
10
+ }
11
+ else {
12
+ const server = createWebhookGateway(oceanRoot(), token, defaultAgentRuntime);
13
+ server.listen(port, "127.0.0.1", () => console.log(`Ocean webhook gateway listening on 127.0.0.1:${port}`));
14
+ }
15
+ }
16
+ //# sourceMappingURL=gateway.js.map
@@ -0,0 +1,11 @@
1
+ import { runHandoffCommand } from "../handoff-command.js";
2
+ export async function commandHandoff() {
3
+ try {
4
+ await runHandoffCommand(process.argv[3] ?? "list", process.argv.slice(4));
5
+ }
6
+ catch (error) {
7
+ console.error(error instanceof Error ? error.message : String(error));
8
+ process.exitCode = 1;
9
+ }
10
+ }
11
+ //# sourceMappingURL=handoff.js.map
@@ -0,0 +1,17 @@
1
+ import { runCuratorCommand } from "../curator-command.js";
2
+ import { runFailuresCommand } from "../failures-command.js";
3
+ import { runScorecardCommand } from "../scorecard-command.js";
4
+ import { runTelemetryCommand } from "../telemetry-command.js";
5
+ import { runUpkeepCommand } from "../upkeep-command.js";
6
+ import { router } from "./dispatch.js";
7
+ const rest = () => process.argv.slice(3);
8
+ // What Ocean knows about its own state, one noun: `health` (the scorecard), `health failures`,
9
+ // `health telemetry`, `health curator`, `health nightly` (was `upkeep`) and `health scorecard`.
10
+ export const commandHealth = router({
11
+ failures: { drop: () => runFailuresCommand(rest()) },
12
+ telemetry: { drop: () => runTelemetryCommand(rest()) },
13
+ curator: { drop: () => runCuratorCommand(rest()) },
14
+ nightly: { drop: () => runUpkeepCommand(rest()) },
15
+ scorecard: { drop: () => runScorecardCommand(rest()) },
16
+ }, () => runScorecardCommand(rest()));
17
+ //# sourceMappingURL=health.js.map
@@ -0,0 +1,142 @@
1
+ import { spawn } from "node:child_process";
2
+ import { claudeSessionEndHook, isSessionEndClient, SESSION_END_CLIENTS, } from "@ocean/work/sessions/hooks/session-end-hook.js";
3
+ import { isSessionStartClient, readBoundedStdin, SESSION_START_CLIENTS, sessionStartHookForClient, } from "@ocean/work/sessions/hooks/session-start-hook.js";
4
+ import { PROMPT_HOOK_CLIENTS, skillRouterHook, } from "../../../application/integrations/skill-router.js";
5
+ import { defaultSessionStoreFactory } from "../../../composition/runtime.js";
6
+ import { startBackgroundPull, startBackgroundRhythm, startBackgroundTaskSync, } from "../../../infrastructure/process/service.js";
7
+ import { insideFactsCall, runSessionFactsCommand, startSessionFacts, } from "../session-facts-command.js";
8
+ // `--repair` (the hook entries `ocean clients` writes, T-296): `client sync` in the background,
9
+ // as the Claude Code bootstrap script does; it never delays or fails the session.
10
+ function startBackgroundSync() {
11
+ try {
12
+ spawn(process.execPath, [process.argv[1], "client", "sync"], {
13
+ detached: true,
14
+ stdio: "ignore",
15
+ })
16
+ .on("error", () => { })
17
+ .unref();
18
+ }
19
+ catch {
20
+ // no repair this time; the next session start tries again
21
+ }
22
+ }
23
+ export async function commandHook() {
24
+ const action = process.argv[3] ?? "";
25
+ // The model call fact capture makes is a client session too: its hooks do nothing (T-313).
26
+ if (insideFactsCall())
27
+ return;
28
+ if (action === "session-facts") {
29
+ await runSessionFactsCommand(process.argv.slice(4));
30
+ return;
31
+ }
32
+ if (action === "pre-compact") {
33
+ // Claude Code's PreCompact: capture the turns about to be compacted, in the background.
34
+ try {
35
+ const raw = await readBoundedStdin();
36
+ const payload = raw.trim() ? JSON.parse(raw) : {};
37
+ await startSessionFacts(payload, "claude");
38
+ }
39
+ catch (error) {
40
+ console.error(error instanceof Error ? error.message : String(error));
41
+ process.exitCode = 1;
42
+ }
43
+ return;
44
+ }
45
+ if (action === "prompt") {
46
+ // Per-prompt skill router (T-325): names the skill the message calls for, or prints nothing.
47
+ // A failure is silent and exits 0, so a broken index never blocks the owner's prompt.
48
+ const flags = process.argv.slice(4);
49
+ const inline = flags.find((arg) => arg.startsWith("--client="));
50
+ const clientIndex = flags.indexOf("--client");
51
+ const client = inline
52
+ ? inline.slice("--client=".length)
53
+ : clientIndex >= 0
54
+ ? (flags[clientIndex + 1] ?? "")
55
+ : "claude";
56
+ if (!PROMPT_HOOK_CLIENTS.includes(client)) {
57
+ console.error(promptUsage);
58
+ process.exitCode = 1;
59
+ return;
60
+ }
61
+ try {
62
+ const raw = await readBoundedStdin();
63
+ const parsed = raw.trim() ? JSON.parse(raw) : {};
64
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
65
+ const output = await skillRouterHook(parsed, client);
66
+ if (output)
67
+ console.log(JSON.stringify(output));
68
+ }
69
+ }
70
+ catch (error) {
71
+ console.error(error instanceof Error ? error.message : String(error));
72
+ }
73
+ return;
74
+ }
75
+ if (action === "session-start") {
76
+ const flags = process.argv.slice(4);
77
+ if (flags.includes("--repair"))
78
+ startBackgroundSync();
79
+ startBackgroundPull();
80
+ startBackgroundRhythm();
81
+ startBackgroundTaskSync();
82
+ const inline = flags.find((arg) => arg.startsWith("--client="));
83
+ const clientIndex = flags.indexOf("--client");
84
+ const client = inline
85
+ ? inline.slice("--client=".length)
86
+ : clientIndex >= 0
87
+ ? (flags[clientIndex + 1] ?? "")
88
+ : "claude";
89
+ if (!isSessionStartClient(client)) {
90
+ console.error(sessionStartUsage);
91
+ process.exitCode = 1;
92
+ return;
93
+ }
94
+ try {
95
+ const raw = await readBoundedStdin();
96
+ const parsed = raw.trim() ? JSON.parse(raw) : {};
97
+ const payload = parsed && typeof parsed === "object" && !Array.isArray(parsed)
98
+ ? parsed
99
+ : {};
100
+ console.log(JSON.stringify(await sessionStartHookForClient(client, payload)));
101
+ }
102
+ catch (error) {
103
+ console.error(error instanceof Error ? error.message : String(error));
104
+ process.exitCode = 1;
105
+ }
106
+ }
107
+ else if (action === "session-end") {
108
+ const flags = process.argv.slice(4);
109
+ const inline = flags.find((arg) => arg.startsWith("--client="));
110
+ const clientIndex = flags.indexOf("--client");
111
+ const client = inline
112
+ ? inline.slice("--client=".length)
113
+ : clientIndex >= 0
114
+ ? (flags[clientIndex + 1] ?? "")
115
+ : "claude";
116
+ if (!isSessionEndClient(client)) {
117
+ console.error(sessionEndUsage);
118
+ process.exitCode = 1;
119
+ return;
120
+ }
121
+ try {
122
+ const raw = await readBoundedStdin();
123
+ const payload = raw.trim() ? JSON.parse(raw) : {};
124
+ await claudeSessionEndHook(payload, defaultSessionStoreFactory, client);
125
+ await startSessionFacts(payload, client);
126
+ // The day's account picks up the session just closed (T-314), in the background.
127
+ startBackgroundRhythm();
128
+ }
129
+ catch (error) {
130
+ console.error(error instanceof Error ? error.message : String(error));
131
+ process.exitCode = 1;
132
+ }
133
+ }
134
+ else {
135
+ console.error(`${sessionStartUsage}|${sessionEndUsage.slice("Usage: ocean hook ".length)}`);
136
+ process.exitCode = 1;
137
+ }
138
+ }
139
+ const promptUsage = `Usage: ocean hook prompt [--client ${PROMPT_HOOK_CLIENTS.join("|")}] (reads a hook payload from stdin)`;
140
+ const sessionEndUsage = `Usage: ocean hook session-end [--client ${SESSION_END_CLIENTS.join("|")}] (reads a hook payload from stdin)`;
141
+ const sessionStartUsage = `Usage: ocean hook session-start [--client ${SESSION_START_CLIENTS.join("|")}] [--repair]|pre-compact (reads a hook payload from stdin)|session-facts --client claude|codex --session <id> --transcript <path>`;
142
+ //# sourceMappingURL=hook.js.map
@@ -0,0 +1,11 @@
1
+ import { runIdeaCommand } from "../idea-command.js";
2
+ export async function commandIdea() {
3
+ try {
4
+ await runIdeaCommand(process.argv[3] ?? "list", process.argv.slice(4));
5
+ }
6
+ catch (error) {
7
+ console.error(error instanceof Error ? error.message : String(error));
8
+ process.exitCode = 1;
9
+ }
10
+ }
11
+ //# sourceMappingURL=idea.js.map
@@ -0,0 +1,31 @@
1
+ import { findInstallSpec, installPlan, installProvider, } from "../../../application/install/provider-installer.js";
2
+ import { defaultProviderRegistry, defaultWrapperManager, } from "../../../composition/runtime.js";
3
+ export async function commandInstall() {
4
+ const id = process.argv[3];
5
+ if (!id) {
6
+ console.error("Usage: ocean install <client> [--yes]");
7
+ process.exitCode = 1;
8
+ }
9
+ else {
10
+ try {
11
+ const spec = findInstallSpec(id);
12
+ if (!process.argv.includes("--yes")) {
13
+ console.log(JSON.stringify({ approvalRequired: true, plan: installPlan(spec.provider.id) }, null, 2));
14
+ process.exitCode = 2;
15
+ }
16
+ else {
17
+ const result = await installProvider(spec.provider.id, true, defaultWrapperManager, defaultProviderRegistry);
18
+ console.log(JSON.stringify({
19
+ installed: true,
20
+ provider: result.provider,
21
+ executable: result.executable,
22
+ }, null, 2));
23
+ }
24
+ }
25
+ catch (error) {
26
+ console.error(error instanceof Error ? error.message : String(error));
27
+ process.exitCode = 1;
28
+ }
29
+ }
30
+ }
31
+ //# sourceMappingURL=install.js.map
@@ -0,0 +1,14 @@
1
+ import { classifyIntent } from "@ocean/context/intent-router.js";
2
+ import { knownTaskPrefixes } from "@ocean/core/shared/project-resolution.js";
3
+ export async function commandIntent() {
4
+ const action = process.argv[3] ?? "classify";
5
+ if (action !== "classify") {
6
+ console.error("Usage: ocean intent classify <text>");
7
+ process.exitCode = 1;
8
+ }
9
+ else {
10
+ const text = process.argv.slice(4).join(" ");
11
+ console.log(JSON.stringify(classifyIntent(text, await knownTaskPrefixes())));
12
+ }
13
+ }
14
+ //# sourceMappingURL=intent.js.map