@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
@@ -0,0 +1,173 @@
1
+ import { readdir, readFile } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { DAILY_DIR, oceanPath } from "@ocean/core/shared/paths.js";
4
+ import { readClaudeProjects } from "@ocean/core/shared/project-legacy.js";
5
+ import { listProjectManifests, matchProject, projectAliases, suggestProjects, } from "@ocean/core/shared/project-manifest.js";
6
+ import { nameTypos, nearName, normalizeName, } from "@ocean/core/shared/project-names.js";
7
+ const quote = (value) => JSON.stringify(value);
8
+ // The id to put in a fix: the one suggestion when there is exactly one, else a placeholder.
9
+ function fixTarget(manifests, name) {
10
+ const ids = [...new Set(suggestProjects(manifests, name).map((s) => s.id))];
11
+ return ids.length === 1 ? ids[0] : "<id>";
12
+ }
13
+ function linkFix(manifests, name) {
14
+ const target = fixTarget(manifests, name);
15
+ const link = `ocean project link ${quote(name.trim())} ${target}`;
16
+ return target === "<id>"
17
+ ? `${link}, or ocean project link ${quote(name.trim())} --new <category>`
18
+ : link;
19
+ }
20
+ function claudeNameWarnings(manifests, names) {
21
+ const warnings = [];
22
+ const unlinked = new Set();
23
+ for (const name of names) {
24
+ const tidy = name.trim().replace(/\s+/g, " ");
25
+ if (tidy !== name)
26
+ warnings.push({
27
+ code: "NAME_SPACING",
28
+ subject: name,
29
+ message: `Claude project ${quote(name)} has extra spaces`,
30
+ fix: `rename it in Claude to ${quote(tidy)}`,
31
+ });
32
+ for (const [written, meant] of nameTypos(name))
33
+ warnings.push({
34
+ code: "NAME_TYPO",
35
+ subject: name,
36
+ message: `Claude project ${quote(tidy)}: "${written}" looks like "${meant}"`,
37
+ fix: `rename it in Claude (${written} → ${meant})`,
38
+ });
39
+ // One unlinked warning per name: an exact repeat is the duplicate warning's job.
40
+ if (!matchProject(manifests, name) && !unlinked.has(normalizeName(name))) {
41
+ unlinked.add(normalizeName(name));
42
+ warnings.push({
43
+ code: "UNLINKED_CLAUDE_PROJECT",
44
+ subject: name,
45
+ message: `Claude project ${quote(tidy)} is linked to no Ocean project`,
46
+ fix: linkFix(manifests, name),
47
+ });
48
+ }
49
+ }
50
+ for (let i = 0; i < names.length; i++)
51
+ for (let j = i + 1; j < names.length; j++) {
52
+ const [a, b] = [names[i], names[j]];
53
+ if (normalizeName(a) !== normalizeName(b) && !nearName(a, b))
54
+ continue;
55
+ const owner = matchProject(manifests, a) ?? matchProject(manifests, b);
56
+ warnings.push({
57
+ code: "NAME_DUPLICATE",
58
+ subject: `${a.trim()} / ${b.trim()}`,
59
+ message: `Claude projects ${quote(a.trim())} and ${quote(b.trim())} look like one project`,
60
+ fix: `keep one in Claude, and link both: ocean project link ${quote(b.trim())} ${owner ?? "<id>"}`,
61
+ });
62
+ }
63
+ return warnings;
64
+ }
65
+ async function markdownIn(dir) {
66
+ const entries = await readdir(dir, { withFileTypes: true }).catch(() => []);
67
+ const files = [];
68
+ for (const entry of entries) {
69
+ if (entry.name.startsWith("."))
70
+ continue;
71
+ const file = path.join(dir, entry.name);
72
+ if (entry.isDirectory())
73
+ files.push(...(await markdownIn(file)));
74
+ else if (entry.name.endsWith(".md"))
75
+ files.push(file);
76
+ }
77
+ return files;
78
+ }
79
+ // Each session record's `project`, counted: a value no project answers to is a record the start
80
+ // brief and the weekly patterns never connect to its project.
81
+ async function recordProjects() {
82
+ const counts = new Map();
83
+ for (const file of await markdownIn(oceanPath(DAILY_DIR, "sessions"))) {
84
+ const head = (await readFile(file, "utf8").catch(() => "")).slice(0, 2000);
85
+ if (!/^---\n[\s\S]*?^type: session$/m.test(head))
86
+ continue;
87
+ const raw = /^project: (.*)$/m.exec(head)?.[1]?.trim() ?? "";
88
+ let value = raw;
89
+ try {
90
+ value = raw.startsWith('"') ? JSON.parse(raw) : raw;
91
+ }
92
+ catch {
93
+ /* kept as written */
94
+ }
95
+ if (value)
96
+ counts.set(value, (counts.get(value) ?? 0) + 1);
97
+ }
98
+ return counts;
99
+ }
100
+ const RELINK = "the records need relinking (ocean sessions relink, T-337)";
101
+ // A value that is another name for a project (an old folder name) is linked; one that names no
102
+ // project at all (a scratch folder, `kernel`) is fixed in the records, never made an alias.
103
+ function recordWarnings(manifests, counts) {
104
+ const warnings = [];
105
+ let scratch = 0;
106
+ for (const [value, count] of counts) {
107
+ if (matchProject(manifests, value))
108
+ continue;
109
+ if (/^scratch-/.test(value)) {
110
+ scratch += count;
111
+ continue;
112
+ }
113
+ const target = fixTarget(manifests, value);
114
+ warnings.push({
115
+ code: "UNKNOWN_RECORD_PROJECT",
116
+ subject: value,
117
+ message: `${count} session record(s) say project ${quote(value)}, which no project knows`,
118
+ fix: target === "<id>"
119
+ ? `ocean project link ${quote(value)} <id> if it names a project, else ${RELINK}`
120
+ : `ocean project link ${quote(value)} ${target}`,
121
+ });
122
+ }
123
+ if (scratch)
124
+ warnings.push({
125
+ code: "UNKNOWN_RECORD_PROJECT",
126
+ subject: "scratch-*",
127
+ message: `${scratch} session record(s) give a scratch folder as their project`,
128
+ fix: RELINK,
129
+ });
130
+ return warnings;
131
+ }
132
+ // A project with no path, no alias and no Claude project of its name: no session, CLI or
133
+ // Desktop, ever reaches it except from inside its own folder.
134
+ function unreachableWarnings(manifests, claudeNames) {
135
+ const named = new Set(claudeNames
136
+ .map((name) => matchProject(manifests, name))
137
+ .filter((id) => Boolean(id)));
138
+ return manifests
139
+ .filter((manifest) => {
140
+ if (manifest.paths.length || named.has(manifest.id))
141
+ return false;
142
+ try {
143
+ return projectAliases(manifest).length === 0;
144
+ }
145
+ catch {
146
+ return true;
147
+ }
148
+ })
149
+ .map((manifest) => ({
150
+ code: "PROJECT_UNREACHABLE",
151
+ subject: manifest.id,
152
+ message: `project '${manifest.id}' has no paths and no alias, so no session reaches it`,
153
+ fix: `ocean project link "<Claude project name>" ${manifest.id}, or ocean project bind ${manifest.id} <path> --add`,
154
+ }));
155
+ }
156
+ export async function projectDoctor() {
157
+ const manifests = await listProjectManifests();
158
+ const claudeNames = await readClaudeProjects();
159
+ return [
160
+ ...claudeNameWarnings(manifests, claudeNames),
161
+ ...recordWarnings(manifests, await recordProjects()),
162
+ ...unreachableWarnings(manifests, claudeNames),
163
+ ];
164
+ }
165
+ export function formatNameWarnings(warnings) {
166
+ if (!warnings.length)
167
+ return "project names: clean";
168
+ return [
169
+ `project names: ${warnings.length} warning(s)`,
170
+ ...warnings.map((warning) => `- ${warning.code}: ${warning.message}\n fix: ${warning.fix}`),
171
+ ].join("\n");
172
+ }
173
+ //# sourceMappingURL=project-doctor.js.map
@@ -0,0 +1,9 @@
1
+ // `ocean project snippet <id>` (T-333): the two lines to paste into a Claude Desktop project's
2
+ // instructions, so every chat in it starts from that project's brief and is saved under it.
3
+ export function projectSnippet(id) {
4
+ return [
5
+ `At the start of each chat, call the ocean_context tool with project "${id}".`,
6
+ `When saving this chat to Ocean, call ocean_session_save with project "${id}".`,
7
+ ].join("\n");
8
+ }
9
+ //# sourceMappingURL=project-snippet.js.map
@@ -5,8 +5,8 @@ import { promisify } from "node:util";
5
5
  import { atomicWrite, parseFrontmatter } from "@ocean/core/shared/fs-utils.js";
6
6
  import { localDate } from "@ocean/core/shared/local-date.js";
7
7
  import { DAILY_DIR, oceanPath, PROJECTS_DIR, projectSubdir, } from "@ocean/core/shared/paths.js";
8
- import { expandHome, listProjectManifests, } from "@ocean/core/shared/project-resolution.js";
9
- import { listTasks } from "@ocean/loop/tasks/list-tasks.js";
8
+ import { expandHome, listProjectManifests, } from "@ocean/core/shared/project-manifest.js";
9
+ import { listTasks } from "@ocean/work/tasks/list-tasks.js";
10
10
  const execFile = promisify(execFileCallback);
11
11
  const ACTIVE_DAYS = 60;
12
12
  const WARM_DAYS = 365;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ocean/services",
3
- "version": "2.23.0",
3
+ "version": "3.0.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -4,17 +4,17 @@ import path from "node:path";
4
4
  import { guardStop, } from "@ocean/core/domain/runs/loop-guard.js";
5
5
  import { localDate } from "@ocean/core/shared/local-date.js";
6
6
  import { INBOX_DIR, oceanPath } from "@ocean/core/shared/paths.js";
7
- import { sessionTokens } from "../runs/session-tokens.js";
7
+ import { sessionTokens } from "./session-tokens.js";
8
8
  // Enforcing a LoopGuard after each run (T-322, C2), shared by scheduled jobs and task loops:
9
9
  // count the run and its tokens, run the verifier, and — when a limit trips — say why and leave a
10
10
  // note for the owner in 00-inbox/escalations/.
11
11
  const VERIFY_TIMEOUT_MS = 5 * 60_000;
12
- export function verifyPasses(command, cwd) {
12
+ function verifyPasses(command, cwd) {
13
13
  return new Promise((resolve) => {
14
14
  execFile("sh", ["-c", command], { cwd, timeout: VERIFY_TIMEOUT_MS }, (error) => resolve(!error));
15
15
  });
16
16
  }
17
- export async function tokensOfSession(sessionId, openStore) {
17
+ async function tokensOfSession(sessionId, openStore) {
18
18
  try {
19
19
  const store = await openStore();
20
20
  try {
@@ -1,7 +1,7 @@
1
1
  import { mkdir, stat } from "node:fs/promises";
2
2
  import path from "node:path";
3
- import { brainIndexPath } from "@ocean/brain/brain/brain-reindex.js";
4
- import { BrainIndexStaleError, brainSearch, } from "@ocean/brain/brain/brain-service.js";
3
+ import { brainIndexPath } from "@ocean/brain/brain-reindex.js";
4
+ import { BrainIndexStaleError, brainSearch, } from "@ocean/brain/brain-service.js";
5
5
  import { normalizeScope, scopeVisible, } from "@ocean/core/domain/brain/record-scope.js";
6
6
  import { atomicWrite, FRONTMATTER_READ_BYTES, } from "@ocean/core/shared/fs-utils.js";
7
7
  import { localDate } from "@ocean/core/shared/local-date.js";
@@ -9,16 +9,8 @@ import { KNOWLEDGE_DIR, oceanRoot, PERSONAL_DIR, resolveWithin, STORE_DIR, } fro
9
9
  import { resolveProject } from "@ocean/core/shared/project-resolution.js";
10
10
  import { approvalMatchesTarget, operationResult, selectFields, shapeRecords, validateSlug, validateWriteTarget, } from "./operation-contract.js";
11
11
  import { freshnessFor, listRecordFiles, readFrontmatterFile, relativeToOcean, requireAbsentTarget, } from "./record-io.js";
12
- const KNOWLEDGE_KINDS = [
13
- "architecture",
14
- "decisions",
15
- "discoveries",
16
- "failures",
17
- "references",
18
- "research",
19
- "results",
20
- "solutions",
21
- ];
12
+ // 05-knowledge holds two folders (T-329 phase 4).
13
+ const KNOWLEDGE_KINDS = ["decisions", "lessons"];
22
14
  const RECORD_FIELDS = [
23
15
  "name",
24
16
  "description",
@@ -1,6 +1,6 @@
1
1
  import path from "node:path";
2
- import { validateBudget } from "@ocean/context/context/context-ladder.js";
3
- import { TASK_ID } from "@ocean/core/domain/tasks/task-id.js";
2
+ import { validateBudget } from "@ocean/context/context-ladder.js";
3
+ import { TASK_ID } from "@ocean/core/domain/task-id.js";
4
4
  import { engineRoot, oceanRoot, resolveWithin, } from "@ocean/core/shared/paths.js";
5
5
  export const OPERATION_KIND = {
6
6
  "task.get": "read",
@@ -1,7 +1,8 @@
1
1
  import { mkdir } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import { oceanPath, PROJECTS_DIR, projectDir, projectSubdir, } from "@ocean/core/shared/paths.js";
4
- import { bindProject, projectConfirmationQuestion, resolveProject, } from "@ocean/core/shared/project-resolution.js";
4
+ import { bindProject } from "@ocean/core/shared/project-register.js";
5
+ import { projectConfirmationQuestion, resolveProject, } from "@ocean/core/shared/project-resolution.js";
5
6
  import { approvalMatchesTarget, operationResult, validateSlug, validateWriteTarget, } from "./operation-contract.js";
6
7
  import { crossProjectGuard } from "./operation-scope.js";
7
8
  import { relativeToOcean } from "./record-io.js";
@@ -1,14 +1,14 @@
1
1
  import { mkdir, readdir, readFile } from "node:fs/promises";
2
2
  import path from "node:path";
3
- import { TASK_ID } from "@ocean/core/domain/tasks/task-id.js";
3
+ import { TASK_ID } from "@ocean/core/domain/task-id.js";
4
4
  import { atomicWrite, FRONTMATTER_READ_BYTES, } from "@ocean/core/shared/fs-utils.js";
5
5
  import { localDate } from "@ocean/core/shared/local-date.js";
6
6
  import { oceanPath, PROJECTS_DIR, projectSubdir, } from "@ocean/core/shared/paths.js";
7
7
  import { withNextTaskId } from "@ocean/core/shared/project-resolution.js";
8
8
  import { resolveTaskReference, } from "@ocean/core/shared/task-reference.js";
9
- import { completeTask } from "../tasks/archive-tasks.js";
10
- import { taskRecord, validTaskTitle } from "../tasks/new-task.js";
11
- import { verifyAndRecord } from "../tasks/task-verification.js";
9
+ import { completeTask } from "../../tasks/archive-tasks.js";
10
+ import { taskRecord, validTaskTitle } from "../../tasks/new-task.js";
11
+ import { verifyAndRecord } from "../../tasks/task-verification.js";
12
12
  import { approvalMatchesTarget, operationResult, selectFields, shapeRecords, validateTaskIdentifier, validateWriteTarget, } from "./operation-contract.js";
13
13
  import { crossProjectGuard, taskRoot, } from "./operation-scope.js";
14
14
  import { freshnessFor, readFrontmatterFile, relativeToOcean, requireAbsentTarget, } from "./record-io.js";
@@ -1,6 +1,6 @@
1
1
  import { createHash, randomUUID } from "node:crypto";
2
2
  import path from "node:path";
3
- import { validateBudget } from "@ocean/context/context/context-ladder.js";
3
+ import { validateBudget } from "@ocean/context/context-ladder.js";
4
4
  import { engineRoot, oceanRoot, resolveWithin, } from "@ocean/core/shared/paths.js";
5
5
  import { OPERATION_KIND, } from "./operation-contract.js";
6
6
  const DEFAULT_GRANT_TTL_MS = 15 * 60 * 1000;
@@ -1,5 +1,5 @@
1
1
  import path from "node:path";
2
- import { redactRuntimeText } from "@ocean/core/domain/redaction/redaction.js";
2
+ import { redactRuntimeText } from "@ocean/core/domain/redaction.js";
3
3
  import { truncateUtf8 } from "@ocean/core/shared/fs-utils.js";
4
4
  // Pure formatting for the headless runAgent prompt: every section is text built from data
5
5
  // the caller already loaded, and each section's byte size is measured so the context_cost
@@ -14,7 +14,7 @@ export const PROMPT_SECTIONS = [
14
14
  "context",
15
15
  ];
16
16
  export const PROMOTED_SKILL_MAX_BYTES = 4_096;
17
- export const SKILL_DESCRIPTION_MAX_BYTES = 300;
17
+ const SKILL_DESCRIPTION_MAX_BYTES = 300;
18
18
  const SEPARATOR = "\n\n";
19
19
  // Joins the non-empty sections in PROMPT_SECTIONS order. `separators` counts the join bytes,
20
20
  // so the breakdown always sums exactly to `bytes`.
@@ -1,14 +1,14 @@
1
1
  import { createHash, randomUUID } from "node:crypto";
2
2
  import { buildProfileFactsDigest, profileFactsFile, readProfileFacts, } from "@ocean/brain/memory/profile-facts.js";
3
- import { buildContextReferences, referenceReadDirectories, } from "@ocean/context/context/context-references.js";
3
+ import { buildContextReferences, referenceReadDirectories, } from "@ocean/context/context-references.js";
4
4
  import { validateContextManifest } from "@ocean/core/domain/context/context-validator.js";
5
5
  import { isApiClient, profileIdentity, selectProfileClient, } from "@ocean/core/domain/profiles/profile.js";
6
6
  import { executionPolicy } from "@ocean/core/domain/profiles/profile-policy.js";
7
- import { redactRuntimeText } from "@ocean/core/domain/redaction/redaction.js";
7
+ import { redactRuntimeText } from "@ocean/core/domain/redaction.js";
8
8
  import { buildExecutionPlan, executionPlanIdentity, usesToolLoop, } from "@ocean/core/domain/runs/execution-plan.js";
9
9
  import { validateSessionEntryContract } from "@ocean/core/domain/sessions/entry-contract.js";
10
- import { getHandoff } from "../handoff/handoff-service.js";
11
- import { emitHook } from "../hooks/lifecycle-hooks.js";
10
+ import { getHandoff } from "../sessions/handoff-service.js";
11
+ import { emitHook } from "../sessions/hooks/lifecycle-hooks.js";
12
12
  import { finalizeSession } from "../sessions/session-closeout.js";
13
13
  import { sessionProjectId } from "../sessions/session-projects.js";
14
14
  import { resolveSessionTask } from "../tasks/session-task.js";
@@ -1,11 +1,11 @@
1
- import { redactRuntimeText } from "@ocean/core/domain/redaction/redaction.js";
1
+ import { redactRuntimeText } from "@ocean/core/domain/redaction.js";
2
2
  import { decideToolCall, toolDefinitions, } from "@ocean/core/domain/runs/agent-tools.js";
3
3
  // A completion client working through Ocean's tools, bounded on every axis (T-245 Phase 6):
4
4
  // iterations, tool calls, one wall-clock deadline, total tool output, repeated calls, and
5
5
  // cancellation. Every tool call is decided against the execution plan before it runs.
6
- export const MAX_ITERATIONS = 20;
7
- export const MAX_TOOL_CALLS = 50;
8
- export const MAX_REPEATS = 3;
6
+ const MAX_ITERATIONS = 20;
7
+ const MAX_TOOL_CALLS = 50;
8
+ const MAX_REPEATS = 3;
9
9
  const DEFAULT_TIMEOUT_MS = 10 * 60_000;
10
10
  const DEFAULT_MAX_OUTPUT_BYTES = 1024 * 1024;
11
11
  class LoopStop extends Error {