@amoree-code/ocean 0.0.0-stage → 1.2.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 (300) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +284 -2
  3. package/dist/application/auth/auth-orchestrator.js +77 -0
  4. package/dist/application/clients/clients.js +646 -0
  5. package/dist/application/clients/editors.js +398 -0
  6. package/dist/application/clients/hooks.js +335 -0
  7. package/dist/application/clients/native.js +410 -0
  8. package/dist/application/clients/opencode-plugin.js +158 -0
  9. package/dist/application/clients/registry.js +188 -0
  10. package/dist/application/gateway/webhook-gateway.js +137 -0
  11. package/dist/application/install/provider-installer.js +184 -0
  12. package/dist/application/integrations/charter-copies.js +76 -0
  13. package/dist/application/integrations/claude-vscode.js +106 -0
  14. package/dist/application/integrations/engine-entry-repair.js +105 -0
  15. package/dist/application/integrations/skill-filter.js +254 -0
  16. package/dist/application/layout/layout-apply.js +443 -0
  17. package/dist/application/layout/layout-plan.js +236 -0
  18. package/dist/application/layout/workspace-template.js +34 -0
  19. package/dist/application/onboarding/state.js +23 -0
  20. package/dist/application/onboarding/steps.js +249 -0
  21. package/dist/application/profiles/profile-distribution.js +53 -0
  22. package/dist/application/profiles/profile-suggestion.js +39 -0
  23. package/dist/application/profiles/profile-upgrade-service.js +208 -0
  24. package/dist/application/pull/history-index.js +476 -0
  25. package/dist/application/pull/project-match.js +132 -0
  26. package/dist/application/pull/pull.js +202 -0
  27. package/dist/application/pull/server-capture.js +307 -0
  28. package/dist/application/scheduler/local-scheduler.js +210 -0
  29. package/dist/composition/runtime.js +64 -0
  30. package/dist/engine-root.js +9 -0
  31. package/dist/infrastructure/filesystem/profile-loader.js +46 -0
  32. package/dist/infrastructure/filesystem/runtime-config-loader.js +29 -0
  33. package/dist/infrastructure/filesystem/skill-loader.js +84 -0
  34. package/dist/infrastructure/filesystem/workspace-capability.js +37 -0
  35. package/dist/infrastructure/observability/runtime-logger.js +16 -0
  36. package/dist/infrastructure/process/agent-tool-executor.js +99 -0
  37. package/dist/infrastructure/process/cli-process.js +49 -0
  38. package/dist/infrastructure/process/interactive-process.js +145 -0
  39. package/dist/infrastructure/process/process-supervisor.js +194 -0
  40. package/dist/infrastructure/process/service.js +252 -0
  41. package/dist/infrastructure/providers/browser-provider.js +2 -0
  42. package/dist/infrastructure/providers/claude-sdk.js +137 -0
  43. package/dist/infrastructure/providers/client-home.js +14 -0
  44. package/dist/infrastructure/providers/fake-browser-provider.js +146 -0
  45. package/dist/infrastructure/providers/ollama-embedder.js +74 -0
  46. package/dist/infrastructure/providers/openai-compatible.js +268 -0
  47. package/dist/infrastructure/providers/playwright-browser-provider.js +380 -0
  48. package/dist/infrastructure/providers/provider-capabilities.js +50 -0
  49. package/dist/infrastructure/providers/provider-invocation.js +184 -0
  50. package/dist/infrastructure/providers/provider-registry.js +77 -0
  51. package/dist/infrastructure/providers/providers.js +134 -0
  52. package/dist/infrastructure/wrappers/wrapper-manager.js +374 -0
  53. package/dist/interfaces/cli/auth-command.js +54 -0
  54. package/dist/interfaces/cli/browser-bridge-command.js +93 -0
  55. package/dist/interfaces/cli/browser-command.js +119 -0
  56. package/dist/interfaces/cli/capture-command.js +125 -0
  57. package/dist/interfaces/cli/client-test-command.js +133 -0
  58. package/dist/interfaces/cli/clients-command.js +129 -0
  59. package/dist/interfaces/cli/command-registry.js +1211 -0
  60. package/dist/interfaces/cli/context-command.js +172 -0
  61. package/dist/interfaces/cli/daily-command.js +131 -0
  62. package/dist/interfaces/cli/governance-command.js +55 -0
  63. package/dist/interfaces/cli/handoff-command.js +35 -0
  64. package/dist/interfaces/cli/help-command.js +207 -0
  65. package/dist/interfaces/cli/idea-command.js +47 -0
  66. package/dist/interfaces/cli/intercept-command.js +317 -0
  67. package/dist/interfaces/cli/layout-command.js +27 -0
  68. package/dist/interfaces/cli/market-command.js +52 -0
  69. package/dist/interfaces/cli/mcp-gateway-command.js +30 -0
  70. package/dist/interfaces/cli/memory-command.js +317 -0
  71. package/dist/interfaces/cli/migrate-command.js +26 -0
  72. package/dist/interfaces/cli/observe-command.js +78 -0
  73. package/dist/interfaces/cli/onboard-command.js +123 -0
  74. package/dist/interfaces/cli/operate-command.js +59 -0
  75. package/dist/interfaces/cli/profiles-command.js +70 -0
  76. package/dist/interfaces/cli/pull-command.js +54 -0
  77. package/dist/interfaces/cli/setup-command.js +143 -0
  78. package/dist/interfaces/cli/tasks-command.js +249 -0
  79. package/dist/main.js +49 -0
  80. package/dist/node-warnings.js +17 -0
  81. package/dist/version.js +8 -0
  82. package/market/mcp/chrome-devtools/ocean.capability.json +28 -0
  83. package/market/mcp/gateway/ocean.capability.json +21 -0
  84. package/market/mcp/obsidian/ocean.capability.json +21 -0
  85. package/market/mcp/ocean/ocean.capability.json +21 -0
  86. package/market/mcp/playwright/ocean.capability.json +23 -0
  87. package/node_modules/@ocean/brain/dist/brain/brain-eval.js +29 -0
  88. package/node_modules/@ocean/brain/dist/brain/brain-markdown.js +226 -0
  89. package/node_modules/@ocean/brain/dist/brain/brain-reindex.js +247 -0
  90. package/node_modules/@ocean/brain/dist/brain/brain-service.js +320 -0
  91. package/node_modules/@ocean/brain/dist/capture/inbox-sync.js +22 -0
  92. package/node_modules/@ocean/brain/dist/evidence/verification-report.js +13 -0
  93. package/node_modules/@ocean/brain/dist/infrastructure/brain/brain-index.js +285 -0
  94. package/node_modules/@ocean/brain/dist/memory/brain-dump.js +145 -0
  95. package/node_modules/@ocean/brain/dist/memory/daily-narrative.js +142 -0
  96. package/node_modules/@ocean/brain/dist/memory/index-sync.js +124 -0
  97. package/node_modules/@ocean/brain/dist/memory/lesson-activation.js +93 -0
  98. package/node_modules/@ocean/brain/dist/memory/lesson-learning.js +188 -0
  99. package/node_modules/@ocean/brain/dist/memory/lessons.js +321 -0
  100. package/node_modules/@ocean/brain/dist/memory/memory-audit.js +100 -0
  101. package/node_modules/@ocean/brain/dist/memory/memory-digest.js +49 -0
  102. package/node_modules/@ocean/brain/dist/memory/memory-harvest.js +345 -0
  103. package/node_modules/@ocean/brain/dist/memory/memory-paths.js +174 -0
  104. package/node_modules/@ocean/brain/dist/memory/memory-review.js +278 -0
  105. package/node_modules/@ocean/brain/dist/memory/memory-trash.js +152 -0
  106. package/node_modules/@ocean/brain/dist/memory/memory-write.js +216 -0
  107. package/node_modules/@ocean/brain/dist/memory/model-narrative.js +129 -0
  108. package/node_modules/@ocean/brain/dist/memory/profile-facts.js +103 -0
  109. package/node_modules/@ocean/brain/dist/memory/session-promotion.js +61 -0
  110. package/node_modules/@ocean/brain/dist/memory/session-summary.js +113 -0
  111. package/node_modules/@ocean/brain/package.json +11 -0
  112. package/node_modules/@ocean/context/dist/context/context-compression.js +66 -0
  113. package/node_modules/@ocean/context/dist/context/context-cost.js +587 -0
  114. package/node_modules/@ocean/context/dist/context/context-ladder.js +363 -0
  115. package/node_modules/@ocean/context/dist/context/context-packet.js +213 -0
  116. package/node_modules/@ocean/context/dist/context/context-references.js +255 -0
  117. package/node_modules/@ocean/context/dist/context/intent-router.js +259 -0
  118. package/node_modules/@ocean/context/dist/context/resource-injection.js +36 -0
  119. package/node_modules/@ocean/context/package.json +11 -0
  120. package/node_modules/@ocean/core/dist/domain/brain/brain-record.js +22 -0
  121. package/node_modules/@ocean/core/dist/domain/brain/record-scope.js +22 -0
  122. package/node_modules/@ocean/core/dist/domain/capabilities/browser-contract.js +64 -0
  123. package/node_modules/@ocean/core/dist/domain/capabilities/capability-contract.js +16 -0
  124. package/node_modules/@ocean/core/dist/domain/capabilities/capability-manifest.js +72 -0
  125. package/node_modules/@ocean/core/dist/domain/context/context-validator.js +5 -0
  126. package/node_modules/@ocean/core/dist/domain/context/context.js +34 -0
  127. package/node_modules/@ocean/core/dist/domain/context/project-id.js +30 -0
  128. package/node_modules/@ocean/core/dist/domain/evidence/evidence.js +16 -0
  129. package/node_modules/@ocean/core/dist/domain/mcp/mcp-contract.js +36 -0
  130. package/node_modules/@ocean/core/dist/domain/mcp/memory-contract.js +41 -0
  131. package/node_modules/@ocean/core/dist/domain/ports/brain-index-port.js +7 -0
  132. package/node_modules/@ocean/core/dist/domain/ports/browser-port.js +8 -0
  133. package/node_modules/@ocean/core/dist/domain/ports/embedder-port.js +2 -0
  134. package/node_modules/@ocean/core/dist/domain/ports/platform-ports.js +2 -0
  135. package/node_modules/@ocean/core/dist/domain/ports/runtime-ports.js +2 -0
  136. package/node_modules/@ocean/core/dist/domain/ports/session-store-port.js +2 -0
  137. package/node_modules/@ocean/core/dist/domain/process/process-events.js +5 -0
  138. package/node_modules/@ocean/core/dist/domain/profiles/profile-distribution.js +19 -0
  139. package/node_modules/@ocean/core/dist/domain/profiles/profile-policy.js +34 -0
  140. package/node_modules/@ocean/core/dist/domain/profiles/profile-selection.js +73 -0
  141. package/node_modules/@ocean/core/dist/domain/profiles/profile-upgrade.js +123 -0
  142. package/node_modules/@ocean/core/dist/domain/profiles/profile-validator.js +5 -0
  143. package/node_modules/@ocean/core/dist/domain/profiles/profile.js +218 -0
  144. package/node_modules/@ocean/core/dist/domain/profiles/runtime-config.js +30 -0
  145. package/node_modules/@ocean/core/dist/domain/providers/provider-capability.js +28 -0
  146. package/node_modules/@ocean/core/dist/domain/providers/provider.js +2 -0
  147. package/node_modules/@ocean/core/dist/domain/redaction/redaction.js +86 -0
  148. package/node_modules/@ocean/core/dist/domain/runs/agent-tools.js +92 -0
  149. package/node_modules/@ocean/core/dist/domain/runs/execution-plan.js +71 -0
  150. package/node_modules/@ocean/core/dist/domain/runs/run-contract.js +38 -0
  151. package/node_modules/@ocean/core/dist/domain/sessions/entry-contract.js +31 -0
  152. package/node_modules/@ocean/core/dist/domain/sessions/handoff.js +78 -0
  153. package/node_modules/@ocean/core/dist/domain/sessions/session.js +58 -0
  154. package/node_modules/@ocean/core/dist/domain/skills/default-skills.js +29 -0
  155. package/node_modules/@ocean/core/dist/domain/skills/skill-validator.js +5 -0
  156. package/node_modules/@ocean/core/dist/domain/skills/skill.js +11 -0
  157. package/node_modules/@ocean/core/dist/domain/tasks/task-id.js +85 -0
  158. package/node_modules/@ocean/core/dist/shared/fs-utils.js +212 -0
  159. package/node_modules/@ocean/core/dist/shared/local-date.js +16 -0
  160. package/node_modules/@ocean/core/dist/shared/paths.js +324 -0
  161. package/node_modules/@ocean/core/dist/shared/project-resolution.js +1065 -0
  162. package/node_modules/@ocean/core/dist/shared/task-reference.js +133 -0
  163. package/node_modules/@ocean/core/package.json +14 -0
  164. package/node_modules/@ocean/loop/dist/handoff/handoff-service.js +133 -0
  165. package/node_modules/@ocean/loop/dist/hooks/lifecycle-hooks.js +15 -0
  166. package/node_modules/@ocean/loop/dist/hooks/session-end-hook.js +183 -0
  167. package/node_modules/@ocean/loop/dist/hooks/session-start-hook.js +237 -0
  168. package/node_modules/@ocean/loop/dist/infrastructure/persistence/session-store.js +690 -0
  169. package/node_modules/@ocean/loop/dist/infrastructure/persistence/session-validator.js +5 -0
  170. package/node_modules/@ocean/loop/dist/loops/iteration-graph.js +147 -0
  171. package/node_modules/@ocean/loop/dist/loops/task-loop-record.js +2 -0
  172. package/node_modules/@ocean/loop/dist/loops/task-loop.js +281 -0
  173. package/node_modules/@ocean/loop/dist/operations/memory-knowledge-operations.js +263 -0
  174. package/node_modules/@ocean/loop/dist/operations/operation-contract.js +227 -0
  175. package/node_modules/@ocean/loop/dist/operations/operation-scope.js +28 -0
  176. package/node_modules/@ocean/loop/dist/operations/project-operations.js +93 -0
  177. package/node_modules/@ocean/loop/dist/operations/record-io.js +65 -0
  178. package/node_modules/@ocean/loop/dist/operations/record-operations.js +45 -0
  179. package/node_modules/@ocean/loop/dist/operations/task-linker.js +40 -0
  180. package/node_modules/@ocean/loop/dist/operations/task-operations.js +279 -0
  181. package/node_modules/@ocean/loop/dist/operations/write-guard.js +157 -0
  182. package/node_modules/@ocean/loop/dist/runs/prompt-assembly.js +112 -0
  183. package/node_modules/@ocean/loop/dist/runs/run-agent.js +425 -0
  184. package/node_modules/@ocean/loop/dist/runs/run-authorization.js +24 -0
  185. package/node_modules/@ocean/loop/dist/runs/tool-loop.js +173 -0
  186. package/node_modules/@ocean/loop/dist/sessions/session-closeout.js +150 -0
  187. package/node_modules/@ocean/loop/dist/sessions/session-pointer.js +133 -0
  188. package/node_modules/@ocean/loop/dist/sessions/session-projects.js +26 -0
  189. package/node_modules/@ocean/loop/dist/sessions/session-retention.js +132 -0
  190. package/node_modules/@ocean/loop/dist/tasks/archive-tasks.js +210 -0
  191. package/node_modules/@ocean/loop/dist/tasks/checkpoint-task.js +31 -0
  192. package/node_modules/@ocean/loop/dist/tasks/claim-task.js +126 -0
  193. package/node_modules/@ocean/loop/dist/tasks/list-tasks.js +113 -0
  194. package/node_modules/@ocean/loop/dist/tasks/new-task.js +42 -0
  195. package/node_modules/@ocean/loop/dist/tasks/renumber-tasks.js +134 -0
  196. package/node_modules/@ocean/loop/dist/tasks/verification-readiness.js +78 -0
  197. package/node_modules/@ocean/loop/dist/tasks/verify-task.js +234 -0
  198. package/node_modules/@ocean/loop/package.json +11 -0
  199. package/node_modules/@ocean/market/dist/adapters/mcp-adapter.js +64 -0
  200. package/node_modules/@ocean/market/dist/adapters/owned-directory.js +89 -0
  201. package/node_modules/@ocean/market/dist/adapters/plugin-adapter.js +39 -0
  202. package/node_modules/@ocean/market/dist/adapters/skill-adapter.js +32 -0
  203. package/node_modules/@ocean/market/dist/capability/adapter.js +2 -0
  204. package/node_modules/@ocean/market/dist/capability/catalog.js +63 -0
  205. package/node_modules/@ocean/market/dist/capability/content-digest.js +40 -0
  206. package/node_modules/@ocean/market/dist/capability/registry.js +81 -0
  207. package/node_modules/@ocean/market/dist/install/default-marketplace.js +47 -0
  208. package/node_modules/@ocean/market/dist/install/lock.js +34 -0
  209. package/node_modules/@ocean/market/dist/install/marketplace-service.js +165 -0
  210. package/node_modules/@ocean/market/dist/mcp/browser-bridge.js +263 -0
  211. package/node_modules/@ocean/market/dist/mcp/mcp-connection.js +67 -0
  212. package/node_modules/@ocean/market/dist/mcp/mcp-gateway.js +317 -0
  213. package/node_modules/@ocean/market/dist/mcp/mcp-launch.js +102 -0
  214. package/node_modules/@ocean/market/dist/mcp/mcp-runner.js +32 -0
  215. package/node_modules/@ocean/market/dist/security/description-scan.js +45 -0
  216. package/node_modules/@ocean/market/dist/security/permissions.js +57 -0
  217. package/node_modules/@ocean/market/dist/skills/core-skill-sync.js +113 -0
  218. package/node_modules/@ocean/market/dist/skills/signal-detection.js +84 -0
  219. package/node_modules/@ocean/market/dist/skills/skill-hub.js +220 -0
  220. package/node_modules/@ocean/market/package.json +11 -0
  221. package/node_modules/@ocean/services/dist/browser/browser-service.js +124 -0
  222. package/node_modules/@ocean/services/dist/browser/browser-session.js +287 -0
  223. package/node_modules/@ocean/services/dist/browser/browser-task-runner.js +70 -0
  224. package/node_modules/@ocean/services/dist/doctor/workspace-doctor.js +547 -0
  225. package/node_modules/@ocean/services/dist/infrastructure/mcp/call-ledger.js +114 -0
  226. package/node_modules/@ocean/services/dist/infrastructure/mcp/mcp-client.js +162 -0
  227. package/node_modules/@ocean/services/dist/infrastructure/mcp/obsidian-server.js +251 -0
  228. package/node_modules/@ocean/services/dist/infrastructure/mcp/ocean-server.js +880 -0
  229. package/node_modules/@ocean/services/dist/infrastructure/mcp/server-version.js +20 -0
  230. package/node_modules/@ocean/services/dist/infrastructure/mcp/tool-registry.js +29 -0
  231. package/node_modules/@ocean/services/dist/obsidian/conflict-log.js +68 -0
  232. package/node_modules/@ocean/services/dist/obsidian/inbox-promotion.js +80 -0
  233. package/node_modules/@ocean/services/dist/obsidian/vault-discovery.js +113 -0
  234. package/node_modules/@ocean/services/dist/obsidian/vault-ingestion.js +77 -0
  235. package/node_modules/@ocean/services/dist/obsidian/vault-sync.js +73 -0
  236. package/node_modules/@ocean/services/dist/obsidian/vault-writer.js +75 -0
  237. package/node_modules/@ocean/services/package.json +11 -0
  238. package/ocean-marketplace.json +415 -0
  239. package/package.json +67 -4
  240. package/skills/core/business-logic/SKILL.md +22 -0
  241. package/skills/core/catch-up/SKILL.md +17 -0
  242. package/skills/core/core-thinking/SKILL.md +11 -0
  243. package/skills/core/design-thinking/SKILL.md +19 -0
  244. package/skills/core/graft/SKILL.md +156 -0
  245. package/skills/core/loop/SKILL.md +20 -0
  246. package/skills/core/session-handoff/SKILL.md +15 -0
  247. package/skills/core/use-browser/SKILL.md +69 -0
  248. package/skills/core/verification/SKILL.md +11 -0
  249. package/skills/index.json +56 -0
  250. package/templates/README.md +4 -0
  251. package/templates/profiles/default.json +51 -0
  252. package/templates/profiles/developer.json +51 -0
  253. package/templates/profiles/reviewer.json +51 -0
  254. package/templates/profiles/strategist.json +51 -0
  255. package/templates/workspace/00-inbox/INBOX.md +7 -0
  256. package/templates/workspace/00-inbox/candidates/.gitkeep +0 -0
  257. package/templates/workspace/00-inbox/native/.gitkeep +0 -0
  258. package/templates/workspace/01-daily/.gitkeep +0 -0
  259. package/templates/workspace/02-personal/CONFLICTS.md +7 -0
  260. package/templates/workspace/02-personal/MEMORY.md +15 -0
  261. package/templates/workspace/02-personal/goals/.gitkeep +0 -0
  262. package/templates/workspace/02-personal/identity/.gitkeep +0 -0
  263. package/templates/workspace/02-personal/preferences/.gitkeep +0 -0
  264. package/templates/workspace/03-professional/.gitkeep +0 -0
  265. package/templates/workspace/04-projects/PROJECTS.md +5 -0
  266. package/templates/workspace/04-projects/_template/docs/.gitkeep +0 -0
  267. package/templates/workspace/04-projects/_template/memory/.gitkeep +0 -0
  268. package/templates/workspace/04-projects/_template/tasks/.gitkeep +0 -0
  269. package/templates/workspace/05-knowledge/KNOWLEDGE.md +8 -0
  270. package/templates/workspace/05-knowledge/decisions/.gitkeep +0 -0
  271. package/templates/workspace/05-knowledge/lessons/.gitkeep +0 -0
  272. package/templates/workspace/06-templates/TEMPLATES.md +25 -0
  273. package/templates/workspace/06-templates/decision.md +8 -0
  274. package/templates/workspace/06-templates/intelligence.md +32 -0
  275. package/templates/workspace/06-templates/project-claude.md +48 -0
  276. package/templates/workspace/06-templates/session.md +38 -0
  277. package/templates/workspace/06-templates/task.md +42 -0
  278. package/templates/workspace/MANIFEST.json +51 -0
  279. package/templates/workspace/bridge/config/CONFIG.md +21 -0
  280. package/templates/workspace/bridge/config/runtime.json +4 -0
  281. package/templates/workspace/charter/core.md +104 -0
  282. package/templates/workspace/charter/policies/README.md +31 -0
  283. package/templates/workspace/charter/policies/claude-code-context.md +90 -0
  284. package/templates/workspace/charter/policies/concise-output.md +29 -0
  285. package/templates/workspace/charter/policies/context.md +91 -0
  286. package/templates/workspace/charter/policies/contracts/task.md +189 -0
  287. package/templates/workspace/charter/policies/git.md +60 -0
  288. package/templates/workspace/charter/policies/graph.md +47 -0
  289. package/templates/workspace/charter/policies/knowledge.md +33 -0
  290. package/templates/workspace/charter/policies/lifecycle.md +119 -0
  291. package/templates/workspace/charter/policies/memory.md +67 -0
  292. package/templates/workspace/charter/policies/minimal-change.md +43 -0
  293. package/templates/workspace/charter/policies/models.md +57 -0
  294. package/templates/workspace/charter/policies/privacy-terms.txt +3 -0
  295. package/templates/workspace/charter/policies/response.md +39 -0
  296. package/templates/workspace/charter/policies/skill-observer.md +44 -0
  297. package/templates/workspace/charter/policies/stack.md +23 -0
  298. package/templates/workspace/charter/policies/task.md +139 -0
  299. package/templates/workspace/charter/policies/verification.md +29 -0
  300. package/templates/workspace/sessions/.gitkeep +0 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AMEER ABDULKAREEM JABBAR LAMI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,285 @@
1
- # Temporary Holding Version
1
+ # Ocean
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **One workspace for every AI agent you use.** Ocean is a local-first layer that gives Claude,
4
+ Codex, Gemini, Qwen, Cursor, OpenCode and other AI clients the same projects, tasks, memory
5
+ and knowledge — on your machine, without a hosted service.
6
+
7
+ ## The idea
8
+
9
+ Every AI client keeps its own memory, its own history, and its own idea of what you were
10
+ doing. Switch from one to another and the context is gone; come back next week and the
11
+ decisions are buried in a chat log nobody will reread.
12
+
13
+ Ocean moves that state out of the clients and into one place you own. Projects, tasks,
14
+ decisions, sessions, and evidence live as plain files in a private workspace on your disk.
15
+ Every client — whichever model, whichever vendor — reads from and writes to that same
16
+ workspace through one runtime. The client becomes the hands; Ocean is the memory and the
17
+ rules.
18
+
19
+ Like an ocean connects every shore, Ocean connects every agent to the same body of work: a
20
+ task started in Claude can be continued in Codex, reviewed in Gemini, and closed from the
21
+ terminal, with nothing re-explained.
22
+
23
+ ## Philosophy
24
+
25
+ - **Local-first.** Your records are files on your machine. No account, no server, no sync
26
+ service in the middle. Ocean works offline and never needs to phone home.
27
+ - **The record is the truth.** A task declares its own status in its own file. Boards,
28
+ indexes, and summaries are generated from the records and checked for drift — never
29
+ hand-edited, never authoritative.
30
+ - **Storage is not context.** An agent receives a small, bounded packet of what the work
31
+ needs, loaded in layers, not the whole workspace. Less noise, lower cost, better answers.
32
+ - **Provider-neutral.** No model is special. Providers are entry points that can be added,
33
+ swapped, or removed; the workspace outlives any of them.
34
+ - **Explicit authority.** Reads are free. Writes outside the workspace, promotions and
35
+ installs show a preview and need an explicit flag (`--yes`, `--apply`, `--approve`).
36
+ Nothing is promoted or published implicitly.
37
+ - **Verified, not claimed.** A provider saying "done" is not evidence. Completion is an
38
+ independent check passing, and the result records what was verified versus assumed.
39
+ - **Public engine, private life.** The engine holds code, tests, and templates only. Your
40
+ records, governance, and machine state live in a separate private workspace and never
41
+ enter it. Ocean never stores provider credentials.
42
+
43
+ ## Requirements
44
+
45
+ - **Node.js 22.16 or newer** (Ocean uses the built-in `node:sqlite`).
46
+ - macOS or Linux. Windows runs the engine and its tests; the layout move and some
47
+ integrations are untested there.
48
+ - On Linux, recording a provider's terminal session needs `node-pty`, which has no Linux
49
+ prebuild: npm compiles it when `python3`, `make` and a C++ compiler are present
50
+ (`sudo apt install -y python3 make g++`) and skips it otherwise. Ocean installs and runs either
51
+ way; without it, providers run attached to your terminal and their output is not recorded.
52
+ An npm that blocks install scripts (it prints `npm warn install-scripts`) skips that compile
53
+ even with a toolchain: install with `npm install --global --allow-scripts=node-pty
54
+ @amoree-code/ocean`. macOS needs neither: node-pty ships a prebuild there.
55
+ - The AI clients you want to connect, installed and signed in the usual way. Ocean does not
56
+ install credentials and does not need an API key of its own.
57
+
58
+ ## Install
59
+
60
+ ```bash
61
+ npm install --global @amoree-code/ocean
62
+ ocean setup
63
+ ```
64
+
65
+ The npm package is `@amoree-code/ocean` (the name `ocean` belongs to another project); the
66
+ command is `ocean`.
67
+
68
+ The same package and name are on GitHub Packages. The earlier name `@ameer.abdulkareem/ocean`
69
+ stops at 1.1.0 and points here.
70
+
71
+ `ocean setup` creates the private workspace and connects your shell:
72
+
73
+ - the workspace at **`~/ocean`** — or the directory in `OCEAN_ROOT`, if set;
74
+ - shims for the AI CLIs on your `PATH`, so their sessions are recorded;
75
+ - a line in your shell profile (`~/.zshrc`, `~/.bashrc` or the fish config);
76
+ - a login service (a LaunchAgent on macOS, a systemd user unit on Linux, a startup script on
77
+ Windows) that keeps the local runtime running.
78
+
79
+ It never writes inside the installed package. `ocean setup --help` shows its options. Running
80
+ `ocean` with no command starts a short first-run guide; `ocean onboard --status` shows its
81
+ steps without running them.
82
+
83
+ ## First useful workflow
84
+
85
+ ```bash
86
+ ocean clients plan # which installed AI clients Ocean can connect, and what changes
87
+ ocean clients apply --yes # add Ocean's MCP server and session hooks to them (journaled)
88
+ ocean doctor # read-only health check; FAIL lines name the fix
89
+ ```
90
+
91
+ Make a folder an Ocean project, then work in it from any connected client or the terminal:
92
+
93
+ ```bash
94
+ cd ~/code/acme
95
+ ocean project bind acme "$PWD" # this folder is the project "acme" (records in ~/ocean/04-projects/uncategorized/acme)
96
+ ocean project move acme company --write # file it under ~/ocean/04-projects/company/acme
97
+ ocean context # what Ocean knows here: project, memory, active tasks
98
+ ocean tasks new "Ship the login page"
99
+ ocean memory reindex # build the search index (the background service keeps it current)
100
+ ocean memory search "login"
101
+ ```
102
+
103
+ A connected client opened in that folder starts with a bounded Ocean context line, can search
104
+ and read your records over MCP, and proposes facts worth keeping. `ocean memory review`
105
+ approves or rejects them; `ocean clients restore` undoes the last `clients apply`.
106
+
107
+ ## Commands
108
+
109
+ `ocean --help` lists every command; `ocean <command> --help` (or `-h`, anywhere before `--`)
110
+ prints its usage and never runs it. To hand `--help` to a wrapped client, put it after `--`:
111
+ `ocean client open claude -- --help`. **Reads** only reads. **Writes** changes the workspace, or files outside it where noted.
112
+ **Runs** starts a process: an agent, a provider CLI, a browser, a server or an installer.
113
+ **Approval** is the flag a command needs before it acts; without it, the command previews.
114
+
115
+ | Command | What it does | Kind |
116
+ | --- | --- | --- |
117
+ | `ocean setup` | create the workspace, shims, shell line and login service | Writes (also outside: shell profile, login service) |
118
+ | `ocean onboard` | run the pending first-run steps | Writes; `--status` reads |
119
+ | `ocean context` | the workspace context for this folder; `cost` measures each client's always-on context | Reads |
120
+ | `ocean project` | resolve, bind, register, rename, move and index projects | Reads; `bind`, `register`, `rename`, `unbind`, `--write` write |
121
+ | `ocean tasks` | list, create, claim, checkpoint, verify and complete tasks | Reads; `new`, `claim`, `checkpoint`, `complete`, `archive --apply` write |
122
+ | `ocean loop` | repeated agent runs on one task | Runs; `start` needs `--approve` |
123
+ | `ocean policy` | list the charter's policies or print one | Reads |
124
+ | `ocean lifecycle` | decide whether work should checkpoint now | Reads |
125
+ | `ocean doctor` | health check of workspace, clients and integrations | Reads |
126
+ | `ocean repair` | what `doctor` can fix | Reads; `--apply` writes |
127
+ | `ocean run` | run a headless agent with a profile | Runs |
128
+ | `ocean profiles` | validate, upgrade or suggest agent profiles | Reads; `upgrade --apply` writes |
129
+ | `ocean session` | list, show, resume, promote and compact sessions | Reads; `resume` runs; `promote` needs `--approve`; `compact --apply` writes |
130
+ | `ocean service` | the background runtime (the login service starts it) | Runs |
131
+ | `ocean intercept` | run an AI CLI with session capture (the shims call it) | Runs |
132
+ | `ocean operate` | classify a plain-language request and run the matching operation | Runs |
133
+ | `ocean intent` | classify a plain-language request | Reads |
134
+ | `ocean gateway` | local webhook gateway on 127.0.0.1 (needs `OCEAN_GATEWAY_TOKEN`) | Runs |
135
+ | `ocean schedule` | scheduled agent runs | Writes; `run-now`, `worker` run |
136
+ | `ocean client` | inspect, open, register and sync AI clients | Reads; `open` runs; `sync`, `register`, `enable`, `disable` write |
137
+ | `ocean clients` | connect installed AI clients to Ocean | Reads; `apply` needs `--yes` and writes client config outside the workspace |
138
+ | `ocean install` / `update` / `remove` | install, update or remove an AI client CLI | Runs an installer; needs `--yes` |
139
+ | `ocean auth` | show or start an AI client's login | Reads; `login` runs |
140
+ | `ocean mcp` | print MCP client configs, or serve Ocean's MCP server and gateway | Reads; `serve`, `gateway` run; `browser-service install` writes outside |
141
+ | `ocean market` | marketplace skills and MCP servers | Reads; `install`, `update`, `uninstall` write; `exec` runs; permissions need `--yes` |
142
+ | `ocean browser` | drive a browser session | Runs; `upload`, `submit` need `--approve` |
143
+ | `ocean memory` | search, read, review and maintain memory | Reads; `approve`, `delete`, `restore`, `reindex`, `sync --apply`, `purge --yes` write |
144
+ | `ocean pull` | pull what AI clients hold into Ocean as review candidates | Reads (dry run); `--yes` writes |
145
+ | `ocean observe` | run a command and record its output | Runs |
146
+ | `ocean capture` / `idea` | capture ideas, then promote or discard them | Writes |
147
+ | `ocean handoff` | hand work from one session or client to another | Reads; `create` writes |
148
+ | `ocean daily` | prepare today's note | Reads; `--apply` writes |
149
+ | `ocean skill` | sync, add, review and learn skills | Reads; `add`, `review`, `learn`, `sync` write |
150
+ | `ocean catalog` | the AI clients Ocean can install | Reads |
151
+ | `ocean obsidian` | connect, sync and write to an Obsidian vault | Writes; vault writes need `--read-write` and `--apply` |
152
+ | `ocean hook` | session hooks the AI clients call | Writes session records |
153
+ | `ocean migrate` | migrate the session store | Reads (dry run); `--apply` writes |
154
+ | `ocean layout` | move the workspace to the current layout | Reads (`plan`); `apply --yes`, `rollback --yes` write outside |
155
+ | `ocean env` | print the shell line that puts the shims on `PATH` | Reads |
156
+
157
+ No `ocean` command publishes anything. Publishing the engine (`scripts/publish.mjs`) and the
158
+ npm package are maintainer steps, each with its own confirmation ([publishing](docs/publishing.md),
159
+ [release](docs/release.md)).
160
+
161
+ ## MCP
162
+
163
+ `ocean clients apply --yes` adds Ocean's MCP server to each supported client; `ocean mcp
164
+ config` prints the entry for a client you configure by hand. The server is local `stdio`
165
+ only and receives no provider credentials. It offers:
166
+
167
+ - **reads** — `brain_search`, `brain_read`, `brain_neighbors`, `memory_read`,
168
+ `memory_history`, tasks, sessions, handoffs, projects, profiles, `ocean_context`,
169
+ `ocean_status` and `ocean_doctor`;
170
+ - **writes** — `memory_write` (only when you ask a client to remember or change something;
171
+ an update must name the record's current hash), `memory_propose` (a candidate for your
172
+ review), `memory_delete` (soft, undone by `memory_restore`), `ocean_handoff_create`, and
173
+ `ocean_session_promote`.
174
+
175
+ Every call is logged as `{ts, client, tool, ok}` only — never the question or the content —
176
+ in `bridge/state/mcp/calls.jsonl`; `ocean clients ledger` summarizes it. See [MCP](docs/mcp.md).
177
+
178
+ ## Agent skills
179
+
180
+ Ocean ships provider-neutral Agent Skills under `packages/harness/skills/core/`, invoked
181
+ by name from any registered client. The core loop:
182
+
183
+ - `catch-up` — reconstruct project state, completed work, blockers, and the next action.
184
+ - `core-thinking` — separate facts from assumptions and choose the smallest valid
185
+ solution before executing.
186
+ - `verification` — turn an implementation claim into a focused, repeatable check.
187
+ - `session-handoff` — produce a compact continuation packet for the next session.
188
+
189
+ Alongside them: `business-logic`, `design-thinking`, `graft`, `loop`, and `use-browser`.
190
+ See [skills/index.json](packages/harness/skills/index.json) for the current catalog.
191
+ `ocean skill learn <completed-session-id>` extracts a candidate skill from a finished
192
+ session, and `ocean skill review <candidate-id> promoted` activates it.
193
+
194
+ ## Public engine, private workspace, machine state
195
+
196
+ ```text
197
+ ~/ocean/ private workspace (OCEAN_ROOT) — local only, never published
198
+ ├── 00-inbox/ … 06-templates/ your records: inbox, daily, personal, professional,
199
+ │ projects, knowledge, templates
200
+ ├── charter/ your rules and the policies they route to
201
+ └── bridge/ machine state: sessions, config, client integrations, shims
202
+
203
+ <npm prefix>/lib/node_modules/@amoree-code/ocean/
204
+ the engine: code, the empty workspace template, skills
205
+ ```
206
+
207
+ Three things are kept apart:
208
+
209
+ - **The engine** is public and read-only at runtime. It holds no record of yours.
210
+ - **The private workspace** holds everything that is yours. `ocean setup` seeds it from an
211
+ empty template; nothing in it is ever copied back into the engine.
212
+ - **Machine state** (`bridge/`) is specific to one computer: sessions, client wiring, shims.
213
+
214
+ Two release gates enforce the boundary. The npm tarball is built by `pnpm release:pack`,
215
+ which refuses any workspace folder, machine-local config, credential file, source, test or
216
+ source map, any template file beyond its approved empty placeholders, and anything the
217
+ privacy scan flags (home paths, e-mail addresses, credential shapes). The source export
218
+ (`scripts/publish.mjs`) uses the same deny list. See [Security](docs/security.md).
219
+
220
+ ## Security
221
+
222
+ - Ocean never stores provider credentials; each client keeps its own login.
223
+ - `bridge/` is created owner-only. Secrets do not belong in any Ocean file.
224
+ - Text Ocean keeps from a session — summaries, promoted results, handoffs — passes through
225
+ redaction of secret shapes and your home-directory paths first.
226
+ - The MCP server is local `stdio` only; nothing listens on the network unless you start
227
+ `ocean gateway` (127.0.0.1, token required).
228
+
229
+ See [Security](docs/security.md) for the workspace boundary and access control.
230
+
231
+ ## Troubleshooting
232
+
233
+ - **`ocean: command not found` after install** — npm's global `bin` is not on `PATH`:
234
+ `npm prefix --global` shows the prefix; add its `bin` to `PATH`.
235
+ - **`EBADENGINE`, `No such built-in module: node:sqlite` or `does not provide an export named
236
+ 'backup'`** — Node is older than 22.16;
237
+ upgrade it and reinstall.
238
+ - **The workspace is in the wrong place** — set `OCEAN_ROOT` and run `ocean setup` again.
239
+ - **A client does not see Ocean** — run `ocean doctor`, then `ocean clients apply --yes`,
240
+ and restart the client.
241
+
242
+ More in [Troubleshooting](docs/troubleshooting.md).
243
+
244
+ ## Development
245
+
246
+ ```bash
247
+ git clone https://github.com/amoree-code/ocean.git ~/ocean/kernel
248
+ cd ~/ocean/kernel
249
+ pnpm install
250
+ pnpm build
251
+ node packages/harness/dist/main.js setup
252
+ pnpm test
253
+ pnpm check
254
+ ```
255
+
256
+ A checkout inside a workspace (`~/ocean/kernel`) serves that workspace (`~/ocean`); elsewhere
257
+ it uses `~/ocean` like an installed package. The test suite uses temporary workspaces and
258
+ SQLite databases; it never invokes a real provider or needs an API key. `docker build -t
259
+ ocean-test . && docker run --rm ocean-test` runs it in an isolated image.
260
+
261
+ Ocean is versioned as one unit; every package shares the version in its `package.json`.
262
+ Every pull request adds a line under **Unreleased** in the [changelog](CHANGELOG.md).
263
+
264
+ ## Documentation
265
+
266
+ - [Operating model](docs/operating-model.md) — ownership, request flow, and the provider boundary
267
+ - [Architecture](docs/architecture.md) — packages, layers, and the public/private boundary
268
+ - [Workspace](docs/workspace.md) — layout, path resolution, and `ocean setup`
269
+ - [Entry points](docs/entry-points.md) — `ocean run`, the shims and the managed PTY
270
+ - [Profiles](docs/profiles.md) — schema, loading, and the default profile
271
+ - [Sessions](docs/sessions.md) — storage, status lifecycle, and CLI usage
272
+ - [Providers](docs/providers.md) — supported providers and how they are invoked
273
+ - [Context](docs/context.md) — how the prompt context is assembled and bounded
274
+ - [MCP](docs/mcp.md) — the MCP servers, client wiring and the gateway
275
+ - [Browser](docs/browser.md) — the browser capability and its approvals
276
+ - [Security](docs/security.md) — credentials, the workspace boundary, and access control
277
+ - [Publishing](docs/publishing.md) — how the public source export is checked and pushed
278
+ - [Release](docs/release.md) — building, checking and publishing the npm package
279
+ - [Troubleshooting](docs/troubleshooting.md) — common errors and how to resolve them
280
+ - [Migration](docs/migration.md) — what changes between versions and how to move a workspace
281
+ - [Changelog](CHANGELOG.md) — what changed, per release
282
+
283
+ ## License
284
+
285
+ Ocean is open source under the [MIT License](LICENSE).
@@ -0,0 +1,77 @@
1
+ const adapters = [
2
+ {
3
+ provider: "claude",
4
+ command: "claude",
5
+ statusArgs: ["auth", "status", "--json"],
6
+ loginArgs: ["auth", "login", "--claudeai"],
7
+ authenticated: (output, exitCode) => exitCode === 0 && /"loggedIn"\s*:\s*true/i.test(output),
8
+ },
9
+ {
10
+ provider: "codex",
11
+ command: "codex",
12
+ statusArgs: ["login", "status"],
13
+ loginArgs: ["login", "--device-auth"],
14
+ authenticated: (output, exitCode) => exitCode === 0 && /logged in/i.test(output),
15
+ },
16
+ {
17
+ provider: "kilo",
18
+ command: "kilo",
19
+ statusArgs: ["auth", "list"],
20
+ loginArgs: ["auth", "login"],
21
+ authenticated: (output, exitCode) => exitCode === 0 && !/sign in|not logged|login required/i.test(output),
22
+ },
23
+ ];
24
+ export function authAdapter(provider) {
25
+ return adapters.find((adapter) => adapter.provider === provider);
26
+ }
27
+ export async function authStatus(provider, deps) {
28
+ const adapter = authAdapter(provider);
29
+ if (!adapter)
30
+ return "not_supported";
31
+ try {
32
+ const executable = deps.registry.resolveOriginalExecutable(adapter.command);
33
+ const result = await deps.runHeadless({
34
+ command: executable,
35
+ args: adapter.statusArgs,
36
+ cwd: process.cwd(),
37
+ timeoutMs: 15_000,
38
+ maxOutputBytes: 8_000,
39
+ });
40
+ return adapter.authenticated(result.events
41
+ .map((event) => typeof event.data === "string"
42
+ ? event.data
43
+ : JSON.stringify(event.data))
44
+ .concat(result.stderr)
45
+ .join("\n"), result.exitCode)
46
+ ? "authenticated"
47
+ : result.exitCode === 0
48
+ ? "login_required"
49
+ : "failed";
50
+ }
51
+ catch {
52
+ return "failed";
53
+ }
54
+ }
55
+ export async function authLogin(provider, deps, options = {}) {
56
+ const adapter = authAdapter(provider);
57
+ if (!adapter)
58
+ return "not_supported";
59
+ try {
60
+ const executable = deps.registry.resolveOriginalExecutable(adapter.command);
61
+ const result = await deps.runInteractive({
62
+ command: executable,
63
+ args: adapter.loginArgs,
64
+ cwd: process.cwd(),
65
+ ...options,
66
+ });
67
+ if (result.cancelled || result.timedOut)
68
+ return "cancelled";
69
+ if (result.exitCode !== 0)
70
+ return "failed";
71
+ return await authStatus(provider, deps);
72
+ }
73
+ catch {
74
+ return "failed";
75
+ }
76
+ }
77
+ //# sourceMappingURL=auth-orchestrator.js.map