@amoree-code/ocean 2.23.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 (380) hide show
  1. package/README.md +46 -53
  2. package/dist/application/clients/bundles.js +1 -1
  3. package/dist/application/clients/client-detect.js +291 -0
  4. package/dist/application/clients/clients.js +104 -25
  5. package/dist/application/clients/desktop-link.js +40 -0
  6. package/dist/application/clients/desktop-watcher.js +6 -4
  7. package/dist/application/clients/hook-trust.js +106 -0
  8. package/dist/application/clients/hooks.js +7 -1
  9. package/dist/application/clients/mcp-schema-cost.js +74 -0
  10. package/dist/application/clients/native.js +38 -2
  11. package/dist/application/clients/registry.js +51 -9
  12. package/dist/application/clients/status.js +7 -2
  13. package/dist/application/gateway/webhook-gateway.js +1 -1
  14. package/dist/application/integrations/charter-copies.js +1 -1
  15. package/dist/application/integrations/engine-entry-repair.js +4 -3
  16. package/dist/application/integrations/skill-auto-sync.js +2 -2
  17. package/dist/application/integrations/skill-filter.js +1 -1
  18. package/dist/application/integrations/skill-router.js +134 -90
  19. package/dist/application/layout/layout-apply.js +1 -1
  20. package/dist/application/layout/workspace-template.js +1 -1
  21. package/dist/application/onboarding/steps.js +121 -30
  22. package/dist/application/profiles/profile-doctor.js +118 -0
  23. package/dist/application/profiles/profile-migration-service.js +208 -0
  24. package/dist/application/profiles/profile-suggestion.js +3 -7
  25. package/dist/application/profiles/profile-upgrade-service.js +98 -86
  26. package/dist/application/pull/history-index.js +1 -1
  27. package/dist/application/pull/project-match.js +3 -3
  28. package/dist/application/pull/pull.js +1 -1
  29. package/dist/application/pull/server-capture.js +92 -9
  30. package/dist/application/scheduler/local-scheduler.js +2 -2
  31. package/dist/application/spend/claude-prices.js +55 -0
  32. package/dist/application/spend/claude-spend.js +365 -0
  33. package/dist/application/uninstall/uninstall.js +25 -3
  34. package/dist/application/upkeep/nightly-upkeep.js +4 -4
  35. package/dist/composition/runtime.js +2 -2
  36. package/dist/infrastructure/desktop/claude-export.js +1 -1
  37. package/dist/infrastructure/desktop/desktop-chat.js +60 -13
  38. package/dist/infrastructure/desktop/indexeddb.js +4 -4
  39. package/dist/infrastructure/desktop/leveldb.js +2 -2
  40. package/dist/infrastructure/filesystem/profile-loader.js +3 -45
  41. package/dist/infrastructure/filesystem/runtime-config-loader.js +1 -1
  42. package/dist/infrastructure/observability/runtime-logger.js +1 -1
  43. package/dist/infrastructure/process/agent-tool-executor.js +3 -3
  44. package/dist/infrastructure/process/process-supervisor.js +1 -1
  45. package/dist/infrastructure/process/service.js +8 -8
  46. package/dist/infrastructure/providers/openai-compatible.js +2 -2
  47. package/dist/infrastructure/providers/provider-invocation.js +1 -1
  48. package/dist/infrastructure/providers/session-facts-completer.js +78 -5
  49. package/dist/interfaces/cli/auth-command.js +2 -2
  50. package/dist/interfaces/cli/brief-command.js +1 -1
  51. package/dist/interfaces/cli/browser-command.js +6 -6
  52. package/dist/interfaces/cli/browser-findings.js +6 -9
  53. package/dist/interfaces/cli/browser-settings.js +10 -10
  54. package/dist/interfaces/cli/capture-command.js +6 -6
  55. package/dist/interfaces/cli/client-test-command.js +3 -3
  56. package/dist/interfaces/cli/clients-command.js +33 -6
  57. package/dist/interfaces/cli/command-aliases.js +56 -0
  58. package/dist/interfaces/cli/command-registry.js +48 -1414
  59. package/dist/interfaces/cli/commands/browser.js +5 -0
  60. package/dist/interfaces/cli/commands/capture.js +19 -0
  61. package/dist/interfaces/cli/commands/catalog.js +9 -0
  62. package/dist/interfaces/cli/commands/client.js +135 -0
  63. package/dist/interfaces/cli/commands/clients.js +33 -0
  64. package/dist/interfaces/cli/commands/connectors.js +14 -0
  65. package/dist/interfaces/cli/commands/context.js +9 -0
  66. package/dist/interfaces/cli/commands/cost.js +15 -0
  67. package/dist/interfaces/cli/commands/daily.js +11 -0
  68. package/dist/interfaces/cli/commands/day.js +25 -0
  69. package/dist/interfaces/cli/commands/dispatch.js +31 -0
  70. package/dist/interfaces/cli/commands/doctor.js +60 -0
  71. package/dist/interfaces/cli/commands/env.js +5 -0
  72. package/dist/interfaces/cli/commands/gateway.js +16 -0
  73. package/dist/interfaces/cli/commands/handoff.js +11 -0
  74. package/dist/interfaces/cli/commands/health.js +17 -0
  75. package/dist/interfaces/cli/commands/hook.js +142 -0
  76. package/dist/interfaces/cli/commands/idea.js +11 -0
  77. package/dist/interfaces/cli/commands/install.js +31 -0
  78. package/dist/interfaces/cli/commands/intent.js +14 -0
  79. package/dist/interfaces/cli/commands/intercept.js +22 -0
  80. package/dist/interfaces/cli/commands/layout.js +11 -0
  81. package/dist/interfaces/cli/commands/lifecycle.js +5 -0
  82. package/dist/interfaces/cli/commands/loop.js +73 -0
  83. package/dist/interfaces/cli/commands/market.js +11 -0
  84. package/dist/interfaces/cli/commands/mcp.js +57 -0
  85. package/dist/interfaces/cli/commands/memory.js +5 -0
  86. package/dist/interfaces/cli/commands/migrate.js +5 -0
  87. package/dist/interfaces/cli/commands/observe.js +11 -0
  88. package/dist/interfaces/cli/commands/obsidian.js +111 -0
  89. package/dist/interfaces/cli/commands/operate.js +7 -0
  90. package/dist/interfaces/cli/commands/policy.js +16 -0
  91. package/dist/interfaces/cli/commands/project.js +207 -0
  92. package/dist/interfaces/cli/commands/repair.js +20 -0
  93. package/dist/interfaces/cli/commands/run.js +52 -0
  94. package/dist/interfaces/cli/commands/schedule.js +58 -0
  95. package/dist/interfaces/cli/commands/service.js +21 -0
  96. package/dist/interfaces/cli/commands/session.js +182 -0
  97. package/dist/interfaces/cli/commands/sessions.js +12 -0
  98. package/dist/interfaces/cli/commands/setup.js +21 -0
  99. package/dist/interfaces/cli/commands/skill.js +159 -0
  100. package/dist/interfaces/cli/commands/tasks.js +10 -0
  101. package/dist/interfaces/cli/commands/update-remove.js +25 -0
  102. package/dist/interfaces/cli/connectors-command.js +150 -0
  103. package/dist/interfaces/cli/context-command.js +39 -3
  104. package/dist/interfaces/cli/cost-command.js +104 -0
  105. package/dist/interfaces/cli/curator-command.js +1 -1
  106. package/dist/interfaces/cli/daily-command.js +7 -1
  107. package/dist/interfaces/cli/desktop-command.js +43 -7
  108. package/dist/interfaces/cli/distill-command.js +7 -2
  109. package/dist/interfaces/cli/express-command.js +1 -1
  110. package/dist/interfaces/cli/failures-command.js +4 -4
  111. package/dist/interfaces/cli/gateway-findings.js +2 -2
  112. package/dist/interfaces/cli/governance-command.js +23 -16
  113. package/dist/interfaces/cli/handoff-command.js +1 -1
  114. package/dist/interfaces/cli/harvest-command.js +2 -2
  115. package/dist/interfaces/cli/help-command.js +53 -169
  116. package/dist/interfaces/cli/hygiene-command.js +1 -1
  117. package/dist/interfaces/cli/idea-command.js +1 -1
  118. package/dist/interfaces/cli/intercept-command.js +8 -7
  119. package/dist/interfaces/cli/interests-command.js +1 -1
  120. package/dist/interfaces/cli/layout-command.js +2 -0
  121. package/dist/interfaces/cli/market-command.js +9 -9
  122. package/dist/interfaces/cli/mcp-gateway-command.js +124 -7
  123. package/dist/interfaces/cli/mcp-probe-command.js +186 -0
  124. package/dist/interfaces/cli/mcp-status-command.js +5 -5
  125. package/dist/interfaces/cli/memory-command.js +41 -7
  126. package/dist/interfaces/cli/migrate-command.js +2 -2
  127. package/dist/interfaces/cli/note-command.js +1 -1
  128. package/dist/interfaces/cli/onboard-command.js +14 -0
  129. package/dist/interfaces/cli/operate-command.js +5 -5
  130. package/dist/interfaces/cli/profiles-command.js +61 -1
  131. package/dist/interfaces/cli/rhythm-command.js +11 -5
  132. package/dist/interfaces/cli/running-server-findings.js +1 -1
  133. package/dist/interfaces/cli/scorecard-command.js +8 -8
  134. package/dist/interfaces/cli/session-facts-command.js +2 -2
  135. package/dist/interfaces/cli/sessions-command.js +145 -0
  136. package/dist/interfaces/cli/setup-command.js +15 -2
  137. package/dist/interfaces/cli/tasks-command.js +63 -13
  138. package/dist/interfaces/cli/telemetry-command.js +4 -4
  139. package/dist/interfaces/cli/uninstall-command.js +1 -1
  140. package/dist/interfaces/cli/week-failures.js +32 -0
  141. package/dist/main.js +12 -0
  142. package/node_modules/@ocean/brain/dist/{infrastructure/brain/brain-index.js → brain-index.js} +2 -2
  143. package/node_modules/@ocean/brain/dist/{brain/brain-markdown.js → brain-markdown.js} +1 -1
  144. package/node_modules/@ocean/brain/dist/{brain/brain-service.js → brain-service.js} +12 -2
  145. package/node_modules/@ocean/brain/dist/memory/brain-dump.js +92 -16
  146. package/node_modules/@ocean/brain/dist/memory/extraction-log.js +125 -0
  147. package/node_modules/@ocean/brain/dist/memory/extraction-retry.js +54 -0
  148. package/node_modules/@ocean/brain/dist/memory/fact-routing.js +44 -1
  149. package/node_modules/@ocean/brain/dist/memory/lesson-activation.js +2 -2
  150. package/node_modules/@ocean/brain/dist/memory/lesson-learning.js +2 -2
  151. package/node_modules/@ocean/brain/dist/memory/lessons.js +1 -1
  152. package/node_modules/@ocean/brain/dist/memory/memory-audit.js +2 -2
  153. package/node_modules/@ocean/brain/dist/memory/memory-harvest.js +1 -1
  154. package/node_modules/@ocean/brain/dist/memory/memory-paths.js +8 -0
  155. package/node_modules/@ocean/brain/dist/memory/memory-review.js +31 -3
  156. package/node_modules/@ocean/brain/dist/memory/memory-trash.js +29 -0
  157. package/node_modules/@ocean/brain/dist/memory/memory-write.js +4 -2
  158. package/node_modules/@ocean/brain/dist/memory/model-narrative.js +2 -2
  159. package/node_modules/@ocean/brain/dist/memory/profile-facts.js +1 -1
  160. package/node_modules/@ocean/brain/dist/memory/routing.json +6 -6
  161. package/node_modules/@ocean/{market/dist/skills → brain/dist/memory}/signal-detection.js +1 -1
  162. package/node_modules/@ocean/brain/dist/{memory → people}/people.js +1 -1
  163. package/node_modules/@ocean/brain/dist/sessions-capture/session-facts.js +625 -0
  164. package/node_modules/@ocean/brain/dist/{memory → sessions-capture}/session-promotion.js +7 -15
  165. package/node_modules/@ocean/brain/dist/{memory → sessions-capture}/session-summary.js +1 -1
  166. package/node_modules/@ocean/brain/dist/sessions-capture/session-triage.js +52 -0
  167. package/node_modules/@ocean/brain/package.json +1 -1
  168. package/node_modules/@ocean/connect/dist/connectors/connector-hub.js +173 -0
  169. package/node_modules/@ocean/{market → connect}/dist/install/default-marketplace.js +6 -2
  170. package/node_modules/@ocean/{market → connect}/dist/install/marketplace-service.js +1 -1
  171. package/node_modules/@ocean/connect/dist/mcp/mcp-gateway.js +987 -0
  172. package/node_modules/@ocean/{market → connect}/dist/mcp/mcp-launch.js +102 -5
  173. package/node_modules/@ocean/{market → connect}/dist/registry/official-registry.js +1 -1
  174. package/node_modules/@ocean/{market → connect}/dist/security/permissions.js +1 -1
  175. package/node_modules/@ocean/{market → connect}/dist/skills/skill-hub.js +104 -6
  176. package/node_modules/@ocean/{market → connect}/package.json +2 -2
  177. package/node_modules/@ocean/context/dist/{context/context-ladder.js → context-ladder.js} +3 -3
  178. package/node_modules/@ocean/context/dist/{context/context-references.js → context-references.js} +5 -4
  179. package/node_modules/@ocean/context/dist/{context/context-cost.js → context-size.js} +6 -6
  180. package/node_modules/@ocean/context/dist/{context/intent-router.js → intent-router.js} +1 -1
  181. package/node_modules/@ocean/context/dist/{context/resource-injection.js → resource-injection.js} +3 -1
  182. package/node_modules/@ocean/context/package.json +1 -1
  183. package/node_modules/@ocean/core/dist/domain/brain/brain-record.js +1 -1
  184. package/node_modules/@ocean/core/dist/domain/capabilities/capability-manifest.js +5 -5
  185. package/node_modules/@ocean/core/dist/domain/connector-entry.js +86 -0
  186. package/node_modules/@ocean/core/dist/domain/context/context.js +1 -1
  187. package/node_modules/@ocean/core/dist/domain/context/project-id.js +8 -2
  188. package/node_modules/@ocean/core/dist/domain/{evidence/evidence.js → evidence.js} +1 -1
  189. package/node_modules/@ocean/core/dist/domain/mcp/memory-contract.js +4 -1
  190. package/node_modules/@ocean/core/dist/domain/ports/brain-index-port.js +1 -1
  191. package/node_modules/@ocean/core/dist/domain/profiles/profile-markdown.js +40 -0
  192. package/node_modules/@ocean/core/dist/domain/profiles/profile-resolution.js +276 -0
  193. package/node_modules/@ocean/core/dist/domain/profiles/profile-selection.js +23 -60
  194. package/node_modules/@ocean/core/dist/domain/profiles/profile-upgrade.js +2 -2
  195. package/node_modules/@ocean/core/dist/domain/profiles/profile.js +66 -6
  196. package/node_modules/@ocean/core/dist/domain/profiles/runtime-config.js +1 -1
  197. package/node_modules/@ocean/core/dist/domain/runs/agent-tools.js +2 -2
  198. package/node_modules/@ocean/core/dist/domain/sessions/session-identity.js +53 -0
  199. package/node_modules/@ocean/core/dist/domain/sessions/session-metadata.js +208 -0
  200. package/node_modules/@ocean/core/dist/domain/{tasks/task-id.js → task-id.js} +2 -2
  201. package/node_modules/@ocean/core/dist/profiles/profile-files.js +57 -0
  202. package/node_modules/@ocean/core/dist/profiles/profile-loader.js +97 -0
  203. package/node_modules/@ocean/core/dist/profiles/project-profile-fill.js +33 -0
  204. package/node_modules/@ocean/core/dist/profiles/session-profile.js +158 -0
  205. package/node_modules/@ocean/core/dist/shared/charter.js +110 -0
  206. package/node_modules/@ocean/core/dist/shared/context-ack.js +1 -1
  207. package/node_modules/@ocean/core/dist/shared/context-triggers.js +67 -0
  208. package/node_modules/@ocean/core/dist/shared/paths.js +6 -6
  209. package/node_modules/@ocean/core/dist/shared/project-legacy.js +232 -0
  210. package/node_modules/@ocean/core/dist/shared/project-manifest.js +308 -0
  211. package/node_modules/@ocean/core/dist/shared/project-names.js +87 -0
  212. package/node_modules/@ocean/core/dist/shared/project-register.js +560 -0
  213. package/node_modules/@ocean/core/dist/shared/project-resolution.js +83 -861
  214. package/node_modules/@ocean/core/dist/shared/repo-signals.js +45 -0
  215. package/node_modules/@ocean/core/dist/shared/task-reference.js +1 -1
  216. package/node_modules/@ocean/core/dist/shared/text-tokens.js +37 -0
  217. package/node_modules/@ocean/core/dist/shared/tool-groups.js +224 -0
  218. package/node_modules/@ocean/core/package.json +4 -1
  219. package/node_modules/@ocean/services/dist/day/day.js +45 -3
  220. package/node_modules/@ocean/services/dist/{distill → day}/distill.js +29 -3
  221. package/node_modules/@ocean/services/dist/{harvest → day}/harvest.js +54 -14
  222. package/node_modules/@ocean/services/dist/{brief → day}/interest-discovery.js +3 -3
  223. package/node_modules/@ocean/services/dist/day/note.js +2 -2
  224. package/node_modules/@ocean/services/dist/{onboarding → day}/onboarding.js +1 -1
  225. package/node_modules/@ocean/services/dist/day/patterns.js +68 -0
  226. package/node_modules/@ocean/services/dist/{curator → health}/curator.js +5 -5
  227. package/node_modules/@ocean/services/dist/{journey → health}/failures.js +7 -5
  228. package/node_modules/@ocean/services/dist/{hygiene → health}/hygiene.js +2 -2
  229. package/node_modules/@ocean/services/dist/{journey → health}/lesson-effect.js +1 -1
  230. package/node_modules/@ocean/services/dist/{scorecard → health}/scorecard.js +3 -3
  231. package/node_modules/@ocean/services/dist/{upkeep → health}/upkeep.js +2 -2
  232. package/node_modules/@ocean/services/dist/{doctor → health}/workspace-doctor.js +57 -17
  233. package/node_modules/@ocean/services/dist/{browser → integrations/browser}/browser-session.js +1 -1
  234. package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/call-ledger.js +3 -0
  235. package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/mcp-client.js +19 -3
  236. package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/obsidian-server.js +4 -4
  237. package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/ocean-server.js +423 -34
  238. package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/conflict-log.js +1 -1
  239. package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/folder-templates.js +8 -5
  240. package/node_modules/@ocean/services/dist/projects/project-doctor.js +173 -0
  241. package/node_modules/@ocean/services/dist/projects/project-snippet.js +9 -0
  242. package/node_modules/@ocean/services/dist/projects/projects-overview.js +2 -2
  243. package/node_modules/@ocean/services/package.json +1 -1
  244. package/node_modules/@ocean/{loop/dist/loops → work/dist/runs}/guard-runtime.js +3 -3
  245. package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/memory-knowledge-operations.js +4 -12
  246. package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/operation-contract.js +2 -2
  247. package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/project-operations.js +2 -1
  248. package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/task-operations.js +4 -4
  249. package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/write-guard.js +1 -1
  250. package/node_modules/@ocean/{loop → work}/dist/runs/prompt-assembly.js +2 -2
  251. package/node_modules/@ocean/{loop → work}/dist/runs/run-agent.js +4 -4
  252. package/node_modules/@ocean/{loop → work}/dist/runs/tool-loop.js +4 -4
  253. package/node_modules/@ocean/work/dist/sessions/hooks/desktop-facts.js +309 -0
  254. package/node_modules/@ocean/{loop/dist → work/dist/sessions}/hooks/session-end-hook.js +36 -5
  255. package/node_modules/@ocean/{loop/dist → work/dist/sessions}/hooks/session-facts-hook.js +144 -14
  256. package/node_modules/@ocean/{loop/dist → work/dist/sessions}/hooks/session-start-hook.js +129 -12
  257. package/node_modules/@ocean/work/dist/sessions/hooks/start-brief.js +110 -0
  258. package/node_modules/@ocean/work/dist/sessions/hooks/unlinked-warning.js +68 -0
  259. package/node_modules/@ocean/{loop → work}/dist/sessions/session-closeout.js +4 -4
  260. package/node_modules/@ocean/{loop → work}/dist/sessions/session-projects.js +13 -3
  261. package/node_modules/@ocean/work/dist/sessions/session-relink.js +300 -0
  262. package/node_modules/@ocean/{loop → work}/dist/sessions/session-retention.js +1 -1
  263. package/node_modules/@ocean/{loop → work}/dist/tasks/list-tasks.js +7 -2
  264. package/node_modules/@ocean/{loop → work}/dist/tasks/renumber-tasks.js +4 -2
  265. package/node_modules/@ocean/{loop → work}/dist/tasks/session-task.js +2 -2
  266. package/node_modules/@ocean/{loop → work}/dist/tasks/sync-task-prs.js +77 -7
  267. package/node_modules/@ocean/work/dist/tasks/task-git.js +63 -0
  268. package/node_modules/@ocean/{loop/dist/loops → work/dist/tasks}/task-loop.js +4 -4
  269. package/node_modules/@ocean/{loop → work}/dist/tasks/verification-readiness.js +1 -1
  270. package/node_modules/@ocean/{loop → work}/dist/tasks/verify-task.js +1 -1
  271. package/node_modules/@ocean/{loop → work}/package.json +2 -2
  272. package/ocean-marketplace.json +41 -41
  273. package/package.json +12 -11
  274. package/skills/core/daily-harvest/SKILL.md +1 -1
  275. package/skills/core/ocean-memory/SKILL.md +4 -0
  276. package/skills/core/use-browser/SKILL.md +30 -7
  277. package/skills/index.json +1 -1
  278. package/templates/profiles/default.md +44 -0
  279. package/templates/profiles/developer.md +45 -0
  280. package/templates/profiles/reviewer.md +44 -0
  281. package/templates/profiles/strategist.md +44 -0
  282. package/templates/profiles-v3/analysis.md +16 -0
  283. package/templates/profiles-v3/backend.md +16 -0
  284. package/templates/profiles-v3/base.md +57 -0
  285. package/templates/profiles-v3/code-review.md +16 -0
  286. package/templates/profiles-v3/devops.md +16 -0
  287. package/templates/profiles-v3/docs-office.md +16 -0
  288. package/templates/profiles-v3/frontend.md +16 -0
  289. package/templates/profiles-v3/learning.md +16 -0
  290. package/templates/profiles-v3/marketing-ads.md +16 -0
  291. package/templates/profiles-v3/marketing-content-seo.md +16 -0
  292. package/templates/profiles-v3/ocean-ops.md +16 -0
  293. package/templates/profiles-v3/product-strategy.md +16 -0
  294. package/templates/profiles-v3/qa-testing.md +16 -0
  295. package/templates/profiles-v3/security.md +16 -0
  296. package/templates/workspace/MANIFEST.json +1 -0
  297. package/templates/workspace/charter/core.md +22 -90
  298. package/templates/workspace/charter/policies/README.md +7 -1
  299. package/templates/workspace/charter/policies/claude-code-context.md +6 -1
  300. package/templates/workspace/charter/policies/concise-output.md +5 -0
  301. package/templates/workspace/charter/policies/context.md +5 -0
  302. package/templates/workspace/charter/policies/contracts/task.md +2 -2
  303. package/templates/workspace/charter/policies/git.md +5 -0
  304. package/templates/workspace/charter/policies/graph.md +6 -1
  305. package/templates/workspace/charter/policies/knowledge.md +11 -4
  306. package/templates/workspace/charter/policies/layout.md +23 -0
  307. package/templates/workspace/charter/policies/lifecycle.md +5 -0
  308. package/templates/workspace/charter/policies/memory.md +5 -0
  309. package/templates/workspace/charter/policies/minimal-change.md +5 -0
  310. package/templates/workspace/charter/policies/models.md +5 -0
  311. package/templates/workspace/charter/policies/response.md +5 -0
  312. package/templates/workspace/charter/policies/skill-observer.md +12 -0
  313. package/templates/workspace/charter/policies/stack.md +5 -0
  314. package/templates/workspace/charter/policies/task.md +17 -3
  315. package/templates/workspace/charter/policies/verification.md +5 -0
  316. package/node_modules/@ocean/brain/dist/evidence/verification-report.js +0 -13
  317. package/node_modules/@ocean/brain/dist/memory/daily-narrative.js +0 -142
  318. package/node_modules/@ocean/brain/dist/memory/session-facts.js +0 -283
  319. package/node_modules/@ocean/context/dist/context/context-compression.js +0 -66
  320. package/node_modules/@ocean/loop/dist/hooks/desktop-facts.js +0 -174
  321. package/node_modules/@ocean/loop/dist/operations/task-linker.js +0 -40
  322. package/node_modules/@ocean/loop/dist/sessions/session-pointer.js +0 -133
  323. package/node_modules/@ocean/loop/dist/tasks/task-git.js +0 -28
  324. package/node_modules/@ocean/market/dist/mcp/mcp-gateway.js +0 -533
  325. package/templates/profiles/default.json +0 -51
  326. package/templates/profiles/developer.json +0 -51
  327. package/templates/profiles/reviewer.json +0 -51
  328. package/templates/profiles/strategist.json +0 -51
  329. /package/node_modules/@ocean/brain/dist/{brain/brain-eval.js → brain-eval.js} +0 -0
  330. /package/node_modules/@ocean/brain/dist/{brain/brain-reindex.js → brain-reindex.js} +0 -0
  331. /package/node_modules/@ocean/brain/dist/{capture → sessions-capture}/inbox-sync.js +0 -0
  332. /package/node_modules/@ocean/{market → connect}/dist/adapters/mcp-adapter.js +0 -0
  333. /package/node_modules/@ocean/{market → connect}/dist/adapters/owned-directory.js +0 -0
  334. /package/node_modules/@ocean/{market → connect}/dist/adapters/plugin-adapter.js +0 -0
  335. /package/node_modules/@ocean/{market → connect}/dist/adapters/skill-adapter.js +0 -0
  336. /package/node_modules/@ocean/{market → connect}/dist/capability/adapter.js +0 -0
  337. /package/node_modules/@ocean/{market → connect}/dist/capability/catalog.js +0 -0
  338. /package/node_modules/@ocean/{market → connect}/dist/capability/content-digest.js +0 -0
  339. /package/node_modules/@ocean/{market → connect}/dist/capability/registry.js +0 -0
  340. /package/node_modules/@ocean/{market → connect}/dist/install/lock.js +0 -0
  341. /package/node_modules/@ocean/{market → connect}/dist/install/own-server.js +0 -0
  342. /package/node_modules/@ocean/{market → connect}/dist/mcp/chrome-debugging.js +0 -0
  343. /package/node_modules/@ocean/{market → connect}/dist/mcp/mcp-connection.js +0 -0
  344. /package/node_modules/@ocean/{market → connect}/dist/mcp/mcp-runner.js +0 -0
  345. /package/node_modules/@ocean/{market → connect}/dist/security/description-scan.js +0 -0
  346. /package/node_modules/@ocean/{market → connect}/dist/security/secrets.js +0 -0
  347. /package/node_modules/@ocean/{market → connect}/dist/skills/core-skill-sync.js +0 -0
  348. /package/node_modules/@ocean/context/dist/{context/context-packet.js → context-packet.js} +0 -0
  349. /package/node_modules/@ocean/core/dist/domain/{process/process-events.js → process-events.js} +0 -0
  350. /package/node_modules/@ocean/core/dist/domain/{redaction/redaction.js → redaction.js} +0 -0
  351. /package/node_modules/@ocean/services/dist/{brief → day}/brief.js +0 -0
  352. /package/node_modules/@ocean/services/dist/{express → day}/express.js +0 -0
  353. /package/node_modules/@ocean/services/dist/{brief → day}/source-registry.json +0 -0
  354. /package/node_modules/@ocean/services/dist/{journey → health}/telemetry.js +0 -0
  355. /package/node_modules/@ocean/services/dist/{browser → integrations/browser}/browser-service.js +0 -0
  356. /package/node_modules/@ocean/services/dist/{browser → integrations/browser}/browser-task-runner.js +0 -0
  357. /package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/mcp-session.js +0 -0
  358. /package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/server-version.js +0 -0
  359. /package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/tool-registry.js +0 -0
  360. /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/inbox-promotion.js +0 -0
  361. /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/vault-discovery.js +0 -0
  362. /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/vault-ingestion.js +0 -0
  363. /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/vault-sync.js +0 -0
  364. /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/vault-writer.js +0 -0
  365. /package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/operation-scope.js +0 -0
  366. /package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/record-io.js +0 -0
  367. /package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/record-operations.js +0 -0
  368. /package/node_modules/@ocean/{loop → work}/dist/runs/run-authorization.js +0 -0
  369. /package/node_modules/@ocean/{loop → work}/dist/runs/session-tokens.js +0 -0
  370. /package/node_modules/@ocean/{loop/dist/handoff → work/dist/sessions}/handoff-service.js +0 -0
  371. /package/node_modules/@ocean/{loop/dist → work/dist/sessions}/hooks/lifecycle-hooks.js +0 -0
  372. /package/node_modules/@ocean/{loop/dist/infrastructure/persistence → work/dist/sessions}/session-store.js +0 -0
  373. /package/node_modules/@ocean/{loop/dist/infrastructure/persistence → work/dist/sessions}/session-validator.js +0 -0
  374. /package/node_modules/@ocean/{loop → work}/dist/tasks/archive-tasks.js +0 -0
  375. /package/node_modules/@ocean/{loop → work}/dist/tasks/checkpoint-task.js +0 -0
  376. /package/node_modules/@ocean/{loop → work}/dist/tasks/claim-task.js +0 -0
  377. /package/node_modules/@ocean/{loop/dist/loops → work/dist/tasks}/iteration-graph.js +0 -0
  378. /package/node_modules/@ocean/{loop → work}/dist/tasks/new-task.js +0 -0
  379. /package/node_modules/@ocean/{loop/dist/loops → work/dist/tasks}/task-loop-record.js +0 -0
  380. /package/node_modules/@ocean/{loop → work}/dist/tasks/task-verification.js +0 -0
@@ -1,3 +1,6 @@
1
+ import { execFile } from "node:child_process";
2
+ import { existsSync, readFileSync } from "node:fs";
3
+ import { mkdir, mkdtemp, rename, rm } from "node:fs/promises";
1
4
  import os from "node:os";
2
5
  import path from "node:path";
3
6
  import { remoteUrlAllowed, } from "../adapters/mcp-adapter.js";
@@ -240,16 +243,110 @@ export function planMcpLaunch(installed, options) {
240
243
  else if (variable.isRequired === true)
241
244
  throw missing(capability, variable.name);
242
245
  }
243
- const args = [
244
- ...base.args,
245
- ...resolveArguments(stdio.packageArguments, "packageArguments"),
246
- ];
246
+ const packageArgs = resolveArguments(stdio.packageArguments, "packageArguments");
247
+ // An exact npm version with no runtime arguments can run from a pinned copy: node starts the
248
+ // package's bin directly, with no npx resolving and no registry round trip on each start.
249
+ const identifier = String(stdio.identifier);
250
+ const version = typeof stdio.version === "string" ? stdio.version : "";
251
+ const pinnable = registryType === "npm" &&
252
+ EXACT_VERSION.test(version) &&
253
+ !asList(stdio.runtimeArguments).length;
254
+ if (pinnable && options.packagesRoot) {
255
+ const bin = pinnedBin(options.packagesRoot, identifier, version);
256
+ if (bin)
257
+ return {
258
+ transport: "stdio",
259
+ command: options.execPath ?? process.execPath,
260
+ args: [bin, ...packageArgs],
261
+ env,
262
+ cwd: options.stateDir,
263
+ };
264
+ }
247
265
  return {
248
266
  transport: "stdio",
249
267
  command: base.command,
250
- args,
268
+ args: [...base.args, ...packageArgs],
251
269
  env,
252
270
  cwd: options.stateDir,
271
+ ...(pinnable && options.packagesRoot
272
+ ? { pin: { identifier, version } }
273
+ : {}),
253
274
  };
254
275
  }
276
+ const EXACT_VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
277
+ const pinnedDir = (root, identifier, version) => path.join(root, `${identifier.replace(/[\\/]/g, "__")}@${version}`);
278
+ // The pinned copy's bin script, or undefined when it is not installed (or names no bin).
279
+ function pinnedBin(root, identifier, version) {
280
+ const packageDir = path.join(pinnedDir(root, identifier, version), "node_modules", ...identifier.split("/"));
281
+ const manifest = path.join(packageDir, "package.json");
282
+ if (!existsSync(manifest))
283
+ return undefined;
284
+ try {
285
+ const json = JSON.parse(readFileSync(manifest, "utf8"));
286
+ if (json.version !== version)
287
+ return undefined;
288
+ const unscoped = identifier.split("/").pop() ?? identifier;
289
+ const bin = typeof json.bin === "string"
290
+ ? json.bin
291
+ : json.bin && typeof json.bin === "object"
292
+ ? (json.bin[unscoped] ??
293
+ (Object.values(json.bin).length === 1
294
+ ? Object.values(json.bin)[0]
295
+ : undefined))
296
+ : undefined;
297
+ if (typeof bin !== "string")
298
+ return undefined;
299
+ const file = path.join(packageDir, bin);
300
+ return existsSync(file) ? file : undefined;
301
+ }
302
+ catch {
303
+ return undefined;
304
+ }
305
+ }
306
+ // Installs one exact npm version under `root` with the npm beside the running node. Built in a
307
+ // temporary folder and renamed into place, so a start that races it sees all of it or none.
308
+ export async function pinNpmPackage(root, identifier, version, options = {}) {
309
+ const target = pinnedDir(root, identifier, version);
310
+ const existing = pinnedBin(root, identifier, version);
311
+ if (existing)
312
+ return existing;
313
+ await mkdir(root, { recursive: true });
314
+ const temp = await mkdtemp(path.join(root, ".pin-"));
315
+ const nodeDir = path.dirname(options.execPath ?? process.execPath);
316
+ const windows = process.platform === "win32";
317
+ try {
318
+ await new Promise((resolve, reject) => {
319
+ execFile(windows ? "npm.cmd" : "npm", [
320
+ "install",
321
+ "--prefix",
322
+ temp,
323
+ "--no-save",
324
+ "--no-audit",
325
+ "--no-fund",
326
+ // Install scripts stay off, as an extra layer: the servers pinned so far need none.
327
+ "--ignore-scripts",
328
+ `${identifier}@${version}`,
329
+ ], {
330
+ env: {
331
+ ...(options.env ?? process.env),
332
+ PATH: [nodeDir, (options.env ?? process.env).PATH ?? ""].join(path.delimiter),
333
+ },
334
+ shell: windows,
335
+ timeout: 300_000,
336
+ }, (error) => (error ? reject(error) : resolve()));
337
+ });
338
+ await rename(temp, target).catch(async (error) => {
339
+ // Another gateway pinned it first.
340
+ if (error.code !== "EEXIST" && error.code !== "ENOTEMPTY")
341
+ throw error;
342
+ });
343
+ }
344
+ finally {
345
+ await rm(temp, { recursive: true, force: true });
346
+ }
347
+ const bin = pinnedBin(root, identifier, version);
348
+ if (!bin)
349
+ throw new Error(`${identifier}@${version} installed but names no bin`);
350
+ return bin;
351
+ }
255
352
  //# sourceMappingURL=mcp-launch.js.map
@@ -4,7 +4,7 @@ import { launchInputs, stdioPackage } from "../mcp/mcp-launch.js";
4
4
  // the `server.json` format Ocean installs. Read-only; nothing about the owner is sent but the
5
5
  // search term. `OCEAN_MCP_REGISTRY` points at another registry with the same API (a mirror, a
6
6
  // test server): https, or http on loopback.
7
- export const OFFICIAL_REGISTRY = "https://registry.modelcontextprotocol.io";
7
+ const OFFICIAL_REGISTRY = "https://registry.modelcontextprotocol.io";
8
8
  export function registryBase(env = process.env) {
9
9
  const base = new URL(env.OCEAN_MCP_REGISTRY || OFFICIAL_REGISTRY);
10
10
  if (!remoteUrlAllowed(base))
@@ -10,7 +10,7 @@ export class PermissionDeniedError extends Error {
10
10
  this.name = "PermissionDeniedError";
11
11
  }
12
12
  }
13
- export function expandHome(value, home = os.homedir()) {
13
+ function expandHome(value, home = os.homedir()) {
14
14
  return path.resolve(value === "~"
15
15
  ? home
16
16
  : value.startsWith("~/")
@@ -2,6 +2,7 @@ import { createHash } from "node:crypto";
2
2
  import { cp, lstat, mkdir, readdir, readFile, readlink, rename, rm, stat, symlink, } from "node:fs/promises";
3
3
  import os from "node:os";
4
4
  import path from "node:path";
5
+ import { profileCatalog } from "@ocean/core/profiles/session-profile.js";
5
6
  import { oceanPath, SYSTEM_DIR } from "@ocean/core/shared/paths.js";
6
7
  import { clientSkillRoots, coreSkillNames, } from "./core-skill-sync.js";
7
8
  // The hub is the one place skills live inside Ocean. Clients hold symlinks into it, so
@@ -106,12 +107,7 @@ export async function linkClientSkills(options) {
106
107
  }
107
108
  // Clients that get the hub's skills as copies. Hermes manages its own bundle and curator,
108
109
  // so it is left alone unless asked for by name.
109
- export const COPY_CLIENTS = [
110
- "claude",
111
- "codex",
112
- "gemini",
113
- "hermes",
114
- ];
110
+ const COPY_CLIENTS = ["claude", "codex", "gemini", "hermes"];
115
111
  // Content hash of a whole skill directory: paths and bytes, so a changed script or reference
116
112
  // counts as drift, not only SKILL.md.
117
113
  // A symlink inside a skill is refused: copying it would either dereference into data outside
@@ -340,4 +336,106 @@ export async function skillSurfaceReport(options = {}) {
340
336
  clients,
341
337
  };
342
338
  }
339
+ // Where each skill sits under one root, nested folders included (Claude's synced/<id>/<skill>,
340
+ // hermes' <category>/<skill>), to a bounded depth.
341
+ async function skillFolders(root, depth, into, skip = []) {
342
+ const walk = async (dir, left) => {
343
+ let entries;
344
+ try {
345
+ entries = await readdir(dir, { withFileTypes: true });
346
+ }
347
+ catch {
348
+ return;
349
+ }
350
+ for (const entry of entries) {
351
+ if (entry.name.startsWith(".") || entry.name === "node_modules")
352
+ continue;
353
+ if (dir === root && skip.includes(entry.name))
354
+ continue;
355
+ const full = path.join(dir, entry.name);
356
+ const isDirectory = entry.isDirectory() ||
357
+ (entry.isSymbolicLink() &&
358
+ (await stat(full).then((s) => s.isDirectory(), () => false)));
359
+ if (!isDirectory)
360
+ continue;
361
+ if (await stat(path.join(full, "SKILL.md")).then(() => true, () => false))
362
+ into.set(entry.name, [...(into.get(entry.name) ?? []), full]);
363
+ else if (left > 1)
364
+ await walk(full, left - 1);
365
+ }
366
+ };
367
+ await walk(root, depth);
368
+ }
369
+ // Skill names any client holds, nested folders included.
370
+ async function clientHeldSkills(home = os.homedir(), depth = 4) {
371
+ const names = new Map();
372
+ for (const root of Object.values(clientSkillRoots))
373
+ await skillFolders(root(home), depth, names);
374
+ return new Set(names.keys());
375
+ }
376
+ // Skills a client loads twice: two folders under its root, or (Claude) a user skill and an
377
+ // enabled plugin's skill of the same name (T-338 P3: one ocean-memory per client).
378
+ export async function skillDuplicates(home = os.homedir(), depth = 4) {
379
+ const duplicates = [];
380
+ for (const client of Object.keys(clientSkillRoots)) {
381
+ // Claude's synced/<account>/<skill> are Desktop's per-account caches, which Claude Code
382
+ // does not load as user skills: copies there are not duplicates.
383
+ const held = new Map();
384
+ await skillFolders(clientSkillRoots[client](home), depth, held, client === "claude" ? ["synced"] : []);
385
+ if (client === "claude")
386
+ for (const [plugin, root] of await claudePluginSkillRoots(home)) {
387
+ const fromPlugin = new Map();
388
+ await skillFolders(root, 1, fromPlugin);
389
+ for (const name of fromPlugin.keys())
390
+ held.set(name, [...(held.get(name) ?? []), `plugin ${plugin}`]);
391
+ }
392
+ for (const [skill, at] of held)
393
+ if (at.length > 1)
394
+ duplicates.push({ client, skill, at });
395
+ }
396
+ return duplicates.sort((a, b) => a.client.localeCompare(b.client) || a.skill.localeCompare(b.skill));
397
+ }
398
+ // Enabled Claude Code plugins and the skills folder of each one's installed copy.
399
+ async function claudePluginSkillRoots(home) {
400
+ const readJson = async (file) => JSON.parse(await readFile(file, "utf8").catch(() => "{}"));
401
+ const settings = await readJson(path.join(home, ".claude", "settings.json"));
402
+ const installed = await readJson(path.join(home, ".claude", "plugins", "installed_plugins.json"));
403
+ const enabled = (settings.enabledPlugins ?? {});
404
+ const records = (installed.plugins ?? {});
405
+ return Object.entries(enabled)
406
+ .filter(([, on]) => on === true)
407
+ .flatMap(([plugin]) => {
408
+ const installPath = records[plugin]?.[0]?.installPath;
409
+ return installPath
410
+ ? [[plugin, path.join(installPath, "skills")]]
411
+ : [];
412
+ });
413
+ }
414
+ // Every hub skill belongs to at least one profile, and no profile names a skill nobody holds.
415
+ export async function skillProfileReport(options = {}) {
416
+ const core = new Set(await coreSkillNames());
417
+ const hub = await skillDirectories(options.hub ?? skillHubRoot()).catch(() => []);
418
+ const known = new Set([...core, ...hub]);
419
+ const catalog = await profileCatalog();
420
+ const listed = new Set();
421
+ const unknown = [];
422
+ for (const profile of catalog.profiles)
423
+ for (const skill of profile.skills) {
424
+ listed.add(skill);
425
+ if (!known.has(skill))
426
+ unknown.push({ profile: profile.name, skill });
427
+ }
428
+ const held = unknown.length
429
+ ? await clientHeldSkills(options.home)
430
+ : new Set();
431
+ const missing = unknown.filter(({ skill }) => !held.has(skill));
432
+ return {
433
+ consistent: !missing.length && !catalog.problems.length,
434
+ profiles: catalog.profiles.length,
435
+ noProfile: hub.filter((name) => !listed.has(name)).sort(),
436
+ missing,
437
+ clientOnly: unknown.filter(({ skill }) => held.has(skill)),
438
+ problems: catalog.problems,
439
+ };
440
+ }
343
441
  //# sourceMappingURL=skill-hub.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
- "name": "@ocean/market",
3
- "version": "2.23.0",
2
+ "name": "@ocean/connect",
3
+ "version": "3.0.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,11 +1,11 @@
1
1
  import { readdir, stat } from "node:fs/promises";
2
2
  import path from "node:path";
3
- import { BrainIndexStaleError, brainSearch, } from "@ocean/brain/brain/brain-service.js";
3
+ import { BrainIndexStaleError, brainSearch, } from "@ocean/brain/brain-service.js";
4
4
  import { normalizeScope, scopeVisible, } from "@ocean/core/domain/brain/record-scope.js";
5
- import { parseTaskId } from "@ocean/core/domain/tasks/task-id.js";
5
+ import { parseTaskId } from "@ocean/core/domain/task-id.js";
6
6
  import { readFrontmatterFile } from "@ocean/core/shared/fs-utils.js";
7
7
  import { KNOWLEDGE_DIR, oceanRoot, PERSONAL_DIR, projectDir, resolveStorePath, resolveWithin, storeRelativeToRoot, WORKSPACE_PROJECT_ID, } from "@ocean/core/shared/paths.js";
8
- import { projectRules, readProjectManifest, } from "@ocean/core/shared/project-resolution.js";
8
+ import { projectRules, readProjectManifest, } from "@ocean/core/shared/project-manifest.js";
9
9
  import { resolveTaskReference } from "@ocean/core/shared/task-reference.js";
10
10
  // Hard ceilings: a caller cannot request an arbitrarily large budget and call it "bounded".
11
11
  // These are generous enough for a single compact read, never for a repository scan.
@@ -2,7 +2,8 @@ import { realpath, stat } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import { validateContextManifest } from "@ocean/core/domain/context/context-validator.js";
4
4
  import { oceanRoot } from "@ocean/core/shared/paths.js";
5
- import { knownTaskPrefixes, projectRules, readProjectManifest, resolveProject, } from "@ocean/core/shared/project-resolution.js";
5
+ import { projectRules, readProjectManifest, } from "@ocean/core/shared/project-manifest.js";
6
+ import { knownTaskPrefixes, resolveProject, } from "@ocean/core/shared/project-resolution.js";
6
7
  import { resolveLadderRung } from "./context-ladder.js";
7
8
  import { buildContextPacket } from "./context-packet.js";
8
9
  import { classifyIntent } from "./intent-router.js";
@@ -14,7 +15,7 @@ import { classifyIntent } from "./intent-router.js";
14
15
  // applied, so a headless prompt never points outside the profile's allowedPaths.
15
16
  export const CONTEXT_REFERENCE_MAX_BYTES = 4_096;
16
17
  // Within the context-ladder BUDGET_CEILING; the packet itself stats, never reads.
17
- export const LEAN_PACKET_BUDGET = {
18
+ const LEAN_PACKET_BUDGET = {
18
19
  maxFiles: 5,
19
20
  maxBytes: 200_000,
20
21
  maxChars: 8_000,
@@ -83,7 +84,7 @@ export async function resolveContextSources(profile, cwd) {
83
84
  // profile's allowedPaths (resolved against cwd); a rejected one goes to `omitted`. Unknown or
84
85
  // low-confidence intents select nothing, and any error fails closed to no references, so a
85
86
  // headless run never fails on a file it would not have read before.
86
- export async function selectPacketReferences(prompt, cwd, allowedPaths) {
87
+ async function selectPacketReferences(prompt, cwd, allowedPaths) {
87
88
  const references = [];
88
89
  const omitted = [];
89
90
  try {
@@ -113,7 +114,7 @@ export async function selectPacketReferences(prompt, cwd, allowedPaths) {
113
114
  }
114
115
  }
115
116
  // The absolute file a reference points at (what the provider must be able to read).
116
- export function referenceTarget(reference, cwd) {
117
+ function referenceTarget(reference, cwd) {
117
118
  return reference.base === "cwd"
118
119
  ? path.resolve(cwd, reference.path)
119
120
  : path.join(oceanRoot(), reference.path);
@@ -1,7 +1,7 @@
1
1
  import { readdir, readFile, stat } from "node:fs/promises";
2
2
  import os from "node:os";
3
3
  import path from "node:path";
4
- import { clientSkillRoots, } from "@ocean/market/skills/core-skill-sync.js";
4
+ import { clientSkillRoots, } from "@ocean/connect/skills/core-skill-sync.js";
5
5
  // Read-only measurement of each client's always-on context: the text an interactive client
6
6
  // loads on every request before the user types anything (global rules, an auto-loaded memory
7
7
  // index, the frontmatter of every model-visible skill, and for Claude its commands, agents
@@ -67,7 +67,7 @@ const clientSources = {
67
67
  ],
68
68
  },
69
69
  };
70
- export function displayPath(abs, home) {
70
+ function displayPath(abs, home) {
71
71
  const relative = path.relative(home, abs);
72
72
  if (!relative)
73
73
  return "~";
@@ -272,7 +272,7 @@ export async function claudeHiddenSkills(home = os.homedir()) {
272
272
  }
273
273
  // The SKILL.md paths that `~/.codex/config.toml` disables with
274
274
  // `[[skills.config]] path = "..." enabled = false`.
275
- export async function codexDisabledSkillPaths(home = os.homedir()) {
275
+ async function codexDisabledSkillPaths(home = os.homedir()) {
276
276
  const disabled = new Set();
277
277
  let text;
278
278
  try {
@@ -365,7 +365,7 @@ export function readHermesDisabled(text) {
365
365
  next -= 1;
366
366
  return { names, lines, skills, disabled: [key, next], indent };
367
367
  }
368
- export async function hermesDisabledSkills(home = os.homedir()) {
368
+ async function hermesDisabledSkills(home = os.homedir()) {
369
369
  try {
370
370
  const text = await readFile(path.join(home, ".hermes", "config.yaml"), "utf8");
371
371
  return new Set(readHermesDisabled(text)?.names ?? []);
@@ -375,7 +375,7 @@ export async function hermesDisabledSkills(home = os.homedir()) {
375
375
  }
376
376
  }
377
377
  // The skill names `~/.gemini/settings.json` lists under `skills.disabled`.
378
- export async function geminiDisabledSkills(home = os.homedir()) {
378
+ async function geminiDisabledSkills(home = os.homedir()) {
379
379
  try {
380
380
  const parsed = JSON.parse(await readFile(path.join(home, ".gemini", "settings.json"), "utf8"));
381
381
  const list = parsed?.skills?.disabled;
@@ -584,4 +584,4 @@ export async function measureContextCost(options = {}) {
584
584
  clients,
585
585
  };
586
586
  }
587
- //# sourceMappingURL=context-cost.js.map
587
+ //# sourceMappingURL=context-size.js.map
@@ -2,7 +2,7 @@
2
2
  // no MCP round trip. Runs before any retrieval so a caller (CLI, shim, hook, or MCP adapter)
3
3
  // knows what Ocean operation — if any — a request maps to, without guessing an identifier or
4
4
  // a project when the request does not name one clearly. See T-198 slice 4.
5
- import { extractTaskIds, LEGACY_PREFIX, } from "@ocean/core/domain/tasks/task-id.js";
5
+ import { extractTaskIds, LEGACY_PREFIX } from "@ocean/core/domain/task-id.js";
6
6
  function matchesAny(text, patterns) {
7
7
  return patterns.some((pattern) => pattern.test(text));
8
8
  }
@@ -16,7 +16,9 @@ function projectTag(project) {
16
16
  // absence), and names the on-demand operations a client can call. Never Ocean file content.
17
17
  export function buildOceanBootstrap(project, extra = {}) {
18
18
  const rules = extra.rules && extra.rules > 0 ? ` rules=${extra.rules}` : "";
19
- const line = `ocean=1 project=${projectTag(project)} confidence=${project.confidence}${rules} ops=${SUPPORTED_OPERATIONS}`;
19
+ // The session's primary profile (T-338): a name only, its bundle is fetched on demand.
20
+ const profile = extra.profile ? ` profile=${extra.profile}` : "";
21
+ const line = `ocean=1 project=${projectTag(project)} confidence=${project.confidence}${rules}${profile} ops=${SUPPORTED_OPERATIONS}`;
20
22
  const ack = contextAck(line);
21
23
  const content = `${line} ack=${ack}`;
22
24
  const bytes = Buffer.byteLength(content, "utf8");
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ocean/context",
3
- "version": "2.23.0",
3
+ "version": "3.0.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -3,7 +3,7 @@ import { z } from "zod";
3
3
  // brain/02-personal and brain/05-knowledge normalizes into. Types + zod only, no I/O — the
4
4
  // markdown layer (application/brain/brain-markdown.ts) is what actually reads legacy
5
5
  // frontmatter and maps it onto this shape.
6
- export const brainRecordSchema = z.object({
6
+ const brainRecordSchema = z.object({
7
7
  id: z.string().min(1),
8
8
  title: z.string().min(1),
9
9
  summary: z.string().default(""),
@@ -1,12 +1,12 @@
1
1
  import { z } from "zod";
2
2
  // The `ocean.capability.json` envelope (T-229). It is kind-agnostic on purpose: `kind` is an
3
3
  // open string and `spec` is opaque here, so a new kind is added by registering an adapter in
4
- // `@ocean/market`, never by editing this file.
4
+ // `@ocean/connect`, never by editing this file.
5
5
  const sha256 = z
6
6
  .string()
7
7
  .regex(/^[0-9a-f]{64}$/, "expected a lowercase sha256 hex digest");
8
8
  export const semverPattern = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
9
- export const capabilityKindSchema = z
9
+ const capabilityKindSchema = z
10
10
  .string()
11
11
  .regex(/^[a-z][a-z0-9-]{0,31}$/, "expected a lowercase kind such as `skill` or `mcp`");
12
12
  // Reverse-DNS, optionally followed by `/<name>` the way the official MCP registry names servers
@@ -19,7 +19,7 @@ const relativePath = z
19
19
  .string()
20
20
  .min(1)
21
21
  .refine((value) => !/^([\\/]|[A-Za-z]:)/.test(value) && !value.split(/[\\/]/).includes(".."), "expected a relative path that stays inside the index");
22
- export const capabilitySourceSchema = z.discriminatedUnion("type", [
22
+ const capabilitySourceSchema = z.discriminatedUnion("type", [
23
23
  z.object({ type: z.literal("path"), path: relativePath }).strict(),
24
24
  z
25
25
  .object({ type: z.literal("url"), url: z.url({ protocol: /^https$/ }) })
@@ -27,7 +27,7 @@ export const capabilitySourceSchema = z.discriminatedUnion("type", [
27
27
  ]);
28
28
  const permissionList = z.array(z.string().min(1)).default([]);
29
29
  // Declared up front so install can ask for consent and the runtime can refuse anything else.
30
- export const capabilityPermissionsSchema = z
30
+ const capabilityPermissionsSchema = z
31
31
  .object({
32
32
  filesystem: z
33
33
  .object({ read: permissionList, write: permissionList })
@@ -61,7 +61,7 @@ export const capabilityManifestSchema = z
61
61
  })
62
62
  .strict();
63
63
  // `ocean-marketplace.json`: one index, many manifests. Several indexes (local, cached, the
64
- // official MCP registry) are merged by the catalog in `@ocean/market`.
64
+ // official MCP registry) are merged by the catalog in `@ocean/connect`.
65
65
  export const marketplaceIndexSchema = z
66
66
  .object({
67
67
  schemaVersion: z.literal(1),
@@ -0,0 +1,86 @@
1
+ import { z } from "zod";
2
+ import { containsKnownSecret } from "./redaction.js";
3
+ // T-339 P3 (plan §3.1): one entry per external service. An entry says where a connector comes
4
+ // from and how it signs in; it never carries a credential. Live copies sit under
5
+ // `bridge/connectors/<id>.json`; the built-in entries below ship with Ocean.
6
+ const CONNECTOR_KINDS = ["mcp-stdio", "mcp-remote", "composio", "cli"];
7
+ const CONNECTOR_AUTH = ["oauth", "keychain", "none"];
8
+ // An exact version: `pkg@1.2.3` or `@scope/pkg@1.2.3`. A range or a tag is never pinned.
9
+ const PINNED_PACKAGE = /^(@[a-z0-9._-]+\/)?[a-z0-9._-]+@\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
10
+ export const connectorEntrySchema = z
11
+ .object({
12
+ id: z
13
+ .string()
14
+ .regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "lowercase id, letters, digits and dashes"),
15
+ title: z.string().min(1).max(80),
16
+ kind: z.enum(CONNECTOR_KINDS),
17
+ // A pinned `package@version` (mcp-stdio, cli), an https URL (mcp-remote), or the provider's
18
+ // toolkit slug (composio: `composio:<toolkit>`).
19
+ source: z.string().min(1).max(300),
20
+ profiles: z.array(z.string().min(1)).default([]),
21
+ auth: z.object({
22
+ type: z.enum(CONNECTOR_AUTH),
23
+ // keychain: the service name the secret is filed under; oauth: the provider that holds it.
24
+ service: z.string().min(1).max(120).optional(),
25
+ provider: z.string().min(1).max(60).optional(),
26
+ }),
27
+ tools: z.array(z.string().min(1)).optional(),
28
+ risk: z.string().max(400).optional(),
29
+ })
30
+ .strict()
31
+ .superRefine((entry, context) => {
32
+ const issue = (message, path) => context.addIssue({ code: "custom", message, path });
33
+ if ((entry.kind === "mcp-stdio" || entry.kind === "cli") &&
34
+ !PINNED_PACKAGE.test(entry.source))
35
+ issue("source must be an exact package@version", ["source"]);
36
+ if (entry.kind === "mcp-remote" && !/^https:\/\/[^\s]+$/.test(entry.source))
37
+ issue("source must be an https URL", ["source"]);
38
+ if (entry.kind === "composio" &&
39
+ !/^composio:[a-z0-9_-]+$/.test(entry.source))
40
+ issue("source must be composio:<toolkit>", ["source"]);
41
+ if (entry.auth.type === "keychain" && !entry.auth.service)
42
+ issue("keychain auth names its service", ["auth", "service"]);
43
+ if (entry.auth.type === "oauth" && !entry.auth.provider)
44
+ issue("oauth auth names its provider", ["auth", "provider"]);
45
+ });
46
+ // A long opaque run of letters and digits that is neither a word nor a path: a token pasted
47
+ // where a name belongs. Known vendor shapes come from the redaction patterns.
48
+ const OPAQUE = /[A-Za-z0-9_-]{32,}/;
49
+ const opaque = (value) => {
50
+ const run = value.match(OPAQUE)?.[0];
51
+ return run !== undefined && /\d/.test(run) && /[a-z]/i.test(run);
52
+ };
53
+ // Paths (`auth.service`, `tools.2`) of every string in `value` that looks like a credential.
54
+ function tokenShapedPaths(value, at = []) {
55
+ if (typeof value === "string")
56
+ return containsKnownSecret(value) || opaque(value)
57
+ ? [at.join(".") || "(value)"]
58
+ : [];
59
+ if (Array.isArray(value))
60
+ return value.flatMap((item, index) => tokenShapedPaths(item, [...at, String(index)]));
61
+ if (value && typeof value === "object")
62
+ return Object.entries(value).flatMap(([key, item]) => tokenShapedPaths(item, [...at, key]));
63
+ return [];
64
+ }
65
+ // Validates an entry and refuses one carrying a token-shaped value. Returns the problems.
66
+ export function connectorProblems(raw) {
67
+ const leaked = tokenShapedPaths(raw).map((at) => `${at}: token-shaped value; keep secrets in the keychain or the provider`);
68
+ const parsed = connectorEntrySchema.safeParse(raw);
69
+ const invalid = parsed.success
70
+ ? []
71
+ : parsed.error.issues.map((issue) => `${issue.path.map(String).join(".") || "(entry)"}: ${issue.message}`);
72
+ return [...leaked, ...invalid];
73
+ }
74
+ // D5: Meta goes through Composio's managed toolkit, for the marketing and analysis profiles.
75
+ export const BUILTIN_CONNECTORS = [
76
+ {
77
+ id: "meta",
78
+ title: "Meta (Facebook and Instagram ads, pages)",
79
+ kind: "composio",
80
+ source: "composio:metaads",
81
+ profiles: ["marketing-ads", "analysis"],
82
+ auth: { type: "oauth", provider: "composio" },
83
+ risk: "Can change live ad spend. Writes need the owner's approval per action.",
84
+ },
85
+ ];
86
+ //# sourceMappingURL=connector-entry.js.map
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  // A file the prompt points at instead of inlining. `path` is always relative: to the run cwd
3
3
  // for a profile contextSources entry, to the Ocean root for a context-packet record.
4
- export const contextReferenceSchema = z.object({
4
+ const contextReferenceSchema = z.object({
5
5
  path: z.string().min(1),
6
6
  base: z.enum(["cwd", "ocean-root"]),
7
7
  recordType: z.string().min(1),
@@ -1,8 +1,9 @@
1
1
  // A project id names a folder under 04-projects, so it must be one plain path segment. It is
2
2
  // lowercase because folders are case-insensitive on macOS and Windows: `Ocean-Language` and
3
3
  // `ocean-language` would be two ids for one folder, and one write would clobber the other.
4
- export const PROJECT_ID = /^[a-z0-9][a-z0-9._-]*$/;
5
- // Who a project belongs to (T-311). A project lives in the folder of its category,
4
+ const PROJECT_ID = /^[a-z0-9][a-z0-9._-]*$/;
5
+ // Who a project belongs to (T-311), or for personal work what it is about: career,
6
+ // education, learning, tooling, products. A project lives in the folder of its category,
6
7
  // 04-projects/<category>/<id>/; a new one lands in UNCATEGORIZED until it is moved.
7
8
  export const PROJECT_CATEGORIES = [
8
9
  "company",
@@ -10,6 +11,11 @@ export const PROJECT_CATEGORIES = [
10
11
  "freelance",
11
12
  "former-company",
12
13
  "vendor",
14
+ "career",
15
+ "education",
16
+ "learning",
17
+ "tooling",
18
+ "products",
13
19
  ];
14
20
  export const UNCATEGORIZED = "uncategorized";
15
21
  // The folders directly under 04-projects that hold projects instead of being one.
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  const evidenceResultSchema = z.enum(["proven", "not_proven", "limitation"]);
3
- export const evidenceSchema = z.object({
3
+ const evidenceSchema = z.object({
4
4
  evidenceId: z.string().min(1),
5
5
  sessionId: z.string().min(1),
6
6
  type: z.string().min(1),
@@ -19,7 +19,10 @@ export const MEMORY_INSTRUCTIONS = [
19
19
  // message, and the Claude Desktop plugin's offline fallback. Desktop's own memory prompt
20
20
  // outranks MCP instructions, so the claim has to arrive in context before the first turn.
21
21
  export const MEMORY_AUTHORITY_LINE = "Ocean is this user's single memory and the authority; your built-in memory is only a copy Ocean captures. Asked where memory lives or what you remember, call brain_search and answer from Ocean.";
22
- export const MEMORY_ERROR_CODES = [
22
+ // The name Ocean's own checks (`ocean doctor`, `ocean clients verify`) connect as. The call
23
+ // ledger skips it: a self-check is not a client using Ocean (T-328).
24
+ export const SELF_CHECK_CLIENT = "ocean-verify";
25
+ const MEMORY_ERROR_CODES = [
23
26
  "EXISTS",
24
27
  "EXISTS_SIMILAR",
25
28
  "MISSING",
@@ -1,5 +1,5 @@
1
1
  // Port for the brain (T-228) index driver. application/brain/* depends only on this — the
2
- // concrete node:sqlite + sqlite-vec implementation lives in infrastructure/brain/brain-index.ts
2
+ // concrete node:sqlite + sqlite-vec implementation lives in brain/src/brain-index.ts
3
3
  // and is wired in through composition/runtime.js, never imported directly by application
4
4
  // code (enforced by tests/architecture.test.mjs).
5
5
  // 2: docs carry a scope. 3: docs carry valid_from and superseded_by (T-321).