@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.
- package/README.md +46 -53
- package/dist/application/clients/bundles.js +1 -1
- package/dist/application/clients/client-detect.js +291 -0
- package/dist/application/clients/clients.js +104 -25
- package/dist/application/clients/desktop-link.js +40 -0
- package/dist/application/clients/desktop-watcher.js +6 -4
- package/dist/application/clients/hook-trust.js +106 -0
- package/dist/application/clients/hooks.js +7 -1
- package/dist/application/clients/mcp-schema-cost.js +74 -0
- package/dist/application/clients/native.js +38 -2
- package/dist/application/clients/registry.js +51 -9
- package/dist/application/clients/status.js +7 -2
- package/dist/application/gateway/webhook-gateway.js +1 -1
- package/dist/application/integrations/charter-copies.js +1 -1
- package/dist/application/integrations/engine-entry-repair.js +4 -3
- package/dist/application/integrations/skill-auto-sync.js +2 -2
- package/dist/application/integrations/skill-filter.js +1 -1
- package/dist/application/integrations/skill-router.js +134 -90
- package/dist/application/layout/layout-apply.js +1 -1
- package/dist/application/layout/workspace-template.js +1 -1
- package/dist/application/onboarding/steps.js +121 -30
- package/dist/application/profiles/profile-doctor.js +118 -0
- package/dist/application/profiles/profile-migration-service.js +208 -0
- package/dist/application/profiles/profile-suggestion.js +3 -7
- package/dist/application/profiles/profile-upgrade-service.js +98 -86
- package/dist/application/pull/history-index.js +1 -1
- package/dist/application/pull/project-match.js +3 -3
- package/dist/application/pull/pull.js +1 -1
- package/dist/application/pull/server-capture.js +92 -9
- package/dist/application/scheduler/local-scheduler.js +2 -2
- package/dist/application/spend/claude-prices.js +55 -0
- package/dist/application/spend/claude-spend.js +365 -0
- package/dist/application/uninstall/uninstall.js +25 -3
- package/dist/application/upkeep/nightly-upkeep.js +4 -4
- package/dist/composition/runtime.js +2 -2
- package/dist/infrastructure/desktop/claude-export.js +1 -1
- package/dist/infrastructure/desktop/desktop-chat.js +60 -13
- package/dist/infrastructure/desktop/indexeddb.js +4 -4
- package/dist/infrastructure/desktop/leveldb.js +2 -2
- package/dist/infrastructure/filesystem/profile-loader.js +3 -45
- package/dist/infrastructure/filesystem/runtime-config-loader.js +1 -1
- package/dist/infrastructure/observability/runtime-logger.js +1 -1
- package/dist/infrastructure/process/agent-tool-executor.js +3 -3
- package/dist/infrastructure/process/process-supervisor.js +1 -1
- package/dist/infrastructure/process/service.js +8 -8
- package/dist/infrastructure/providers/openai-compatible.js +2 -2
- package/dist/infrastructure/providers/provider-invocation.js +1 -1
- package/dist/infrastructure/providers/session-facts-completer.js +78 -5
- package/dist/interfaces/cli/auth-command.js +2 -2
- package/dist/interfaces/cli/brief-command.js +1 -1
- package/dist/interfaces/cli/browser-command.js +6 -6
- package/dist/interfaces/cli/browser-findings.js +6 -9
- package/dist/interfaces/cli/browser-settings.js +10 -10
- package/dist/interfaces/cli/capture-command.js +6 -6
- package/dist/interfaces/cli/client-test-command.js +3 -3
- package/dist/interfaces/cli/clients-command.js +33 -6
- package/dist/interfaces/cli/command-aliases.js +56 -0
- package/dist/interfaces/cli/command-registry.js +48 -1414
- package/dist/interfaces/cli/commands/browser.js +5 -0
- package/dist/interfaces/cli/commands/capture.js +19 -0
- package/dist/interfaces/cli/commands/catalog.js +9 -0
- package/dist/interfaces/cli/commands/client.js +135 -0
- package/dist/interfaces/cli/commands/clients.js +33 -0
- package/dist/interfaces/cli/commands/connectors.js +14 -0
- package/dist/interfaces/cli/commands/context.js +9 -0
- package/dist/interfaces/cli/commands/cost.js +15 -0
- package/dist/interfaces/cli/commands/daily.js +11 -0
- package/dist/interfaces/cli/commands/day.js +25 -0
- package/dist/interfaces/cli/commands/dispatch.js +31 -0
- package/dist/interfaces/cli/commands/doctor.js +60 -0
- package/dist/interfaces/cli/commands/env.js +5 -0
- package/dist/interfaces/cli/commands/gateway.js +16 -0
- package/dist/interfaces/cli/commands/handoff.js +11 -0
- package/dist/interfaces/cli/commands/health.js +17 -0
- package/dist/interfaces/cli/commands/hook.js +142 -0
- package/dist/interfaces/cli/commands/idea.js +11 -0
- package/dist/interfaces/cli/commands/install.js +31 -0
- package/dist/interfaces/cli/commands/intent.js +14 -0
- package/dist/interfaces/cli/commands/intercept.js +22 -0
- package/dist/interfaces/cli/commands/layout.js +11 -0
- package/dist/interfaces/cli/commands/lifecycle.js +5 -0
- package/dist/interfaces/cli/commands/loop.js +73 -0
- package/dist/interfaces/cli/commands/market.js +11 -0
- package/dist/interfaces/cli/commands/mcp.js +57 -0
- package/dist/interfaces/cli/commands/memory.js +5 -0
- package/dist/interfaces/cli/commands/migrate.js +5 -0
- package/dist/interfaces/cli/commands/observe.js +11 -0
- package/dist/interfaces/cli/commands/obsidian.js +111 -0
- package/dist/interfaces/cli/commands/operate.js +7 -0
- package/dist/interfaces/cli/commands/policy.js +16 -0
- package/dist/interfaces/cli/commands/project.js +207 -0
- package/dist/interfaces/cli/commands/repair.js +20 -0
- package/dist/interfaces/cli/commands/run.js +52 -0
- package/dist/interfaces/cli/commands/schedule.js +58 -0
- package/dist/interfaces/cli/commands/service.js +21 -0
- package/dist/interfaces/cli/commands/session.js +182 -0
- package/dist/interfaces/cli/commands/sessions.js +12 -0
- package/dist/interfaces/cli/commands/setup.js +21 -0
- package/dist/interfaces/cli/commands/skill.js +159 -0
- package/dist/interfaces/cli/commands/tasks.js +10 -0
- package/dist/interfaces/cli/commands/update-remove.js +25 -0
- package/dist/interfaces/cli/connectors-command.js +150 -0
- package/dist/interfaces/cli/context-command.js +39 -3
- package/dist/interfaces/cli/cost-command.js +104 -0
- package/dist/interfaces/cli/curator-command.js +1 -1
- package/dist/interfaces/cli/daily-command.js +7 -1
- package/dist/interfaces/cli/desktop-command.js +43 -7
- package/dist/interfaces/cli/distill-command.js +7 -2
- package/dist/interfaces/cli/express-command.js +1 -1
- package/dist/interfaces/cli/failures-command.js +4 -4
- package/dist/interfaces/cli/gateway-findings.js +2 -2
- package/dist/interfaces/cli/governance-command.js +23 -16
- package/dist/interfaces/cli/handoff-command.js +1 -1
- package/dist/interfaces/cli/harvest-command.js +2 -2
- package/dist/interfaces/cli/help-command.js +53 -169
- package/dist/interfaces/cli/hygiene-command.js +1 -1
- package/dist/interfaces/cli/idea-command.js +1 -1
- package/dist/interfaces/cli/intercept-command.js +8 -7
- package/dist/interfaces/cli/interests-command.js +1 -1
- package/dist/interfaces/cli/layout-command.js +2 -0
- package/dist/interfaces/cli/market-command.js +9 -9
- package/dist/interfaces/cli/mcp-gateway-command.js +124 -7
- package/dist/interfaces/cli/mcp-probe-command.js +186 -0
- package/dist/interfaces/cli/mcp-status-command.js +5 -5
- package/dist/interfaces/cli/memory-command.js +41 -7
- package/dist/interfaces/cli/migrate-command.js +2 -2
- package/dist/interfaces/cli/note-command.js +1 -1
- package/dist/interfaces/cli/onboard-command.js +14 -0
- package/dist/interfaces/cli/operate-command.js +5 -5
- package/dist/interfaces/cli/profiles-command.js +61 -1
- package/dist/interfaces/cli/rhythm-command.js +11 -5
- package/dist/interfaces/cli/running-server-findings.js +1 -1
- package/dist/interfaces/cli/scorecard-command.js +8 -8
- package/dist/interfaces/cli/session-facts-command.js +2 -2
- package/dist/interfaces/cli/sessions-command.js +145 -0
- package/dist/interfaces/cli/setup-command.js +15 -2
- package/dist/interfaces/cli/tasks-command.js +63 -13
- package/dist/interfaces/cli/telemetry-command.js +4 -4
- package/dist/interfaces/cli/uninstall-command.js +1 -1
- package/dist/interfaces/cli/week-failures.js +32 -0
- package/dist/main.js +12 -0
- package/node_modules/@ocean/brain/dist/{infrastructure/brain/brain-index.js → brain-index.js} +2 -2
- package/node_modules/@ocean/brain/dist/{brain/brain-markdown.js → brain-markdown.js} +1 -1
- package/node_modules/@ocean/brain/dist/{brain/brain-service.js → brain-service.js} +12 -2
- package/node_modules/@ocean/brain/dist/memory/brain-dump.js +92 -16
- package/node_modules/@ocean/brain/dist/memory/extraction-log.js +125 -0
- package/node_modules/@ocean/brain/dist/memory/extraction-retry.js +54 -0
- package/node_modules/@ocean/brain/dist/memory/fact-routing.js +44 -1
- package/node_modules/@ocean/brain/dist/memory/lesson-activation.js +2 -2
- package/node_modules/@ocean/brain/dist/memory/lesson-learning.js +2 -2
- package/node_modules/@ocean/brain/dist/memory/lessons.js +1 -1
- package/node_modules/@ocean/brain/dist/memory/memory-audit.js +2 -2
- package/node_modules/@ocean/brain/dist/memory/memory-harvest.js +1 -1
- package/node_modules/@ocean/brain/dist/memory/memory-paths.js +8 -0
- package/node_modules/@ocean/brain/dist/memory/memory-review.js +31 -3
- package/node_modules/@ocean/brain/dist/memory/memory-trash.js +29 -0
- package/node_modules/@ocean/brain/dist/memory/memory-write.js +4 -2
- package/node_modules/@ocean/brain/dist/memory/model-narrative.js +2 -2
- package/node_modules/@ocean/brain/dist/memory/profile-facts.js +1 -1
- package/node_modules/@ocean/brain/dist/memory/routing.json +6 -6
- package/node_modules/@ocean/{market/dist/skills → brain/dist/memory}/signal-detection.js +1 -1
- package/node_modules/@ocean/brain/dist/{memory → people}/people.js +1 -1
- package/node_modules/@ocean/brain/dist/sessions-capture/session-facts.js +625 -0
- package/node_modules/@ocean/brain/dist/{memory → sessions-capture}/session-promotion.js +7 -15
- package/node_modules/@ocean/brain/dist/{memory → sessions-capture}/session-summary.js +1 -1
- package/node_modules/@ocean/brain/dist/sessions-capture/session-triage.js +52 -0
- package/node_modules/@ocean/brain/package.json +1 -1
- package/node_modules/@ocean/connect/dist/connectors/connector-hub.js +173 -0
- package/node_modules/@ocean/{market → connect}/dist/install/default-marketplace.js +6 -2
- package/node_modules/@ocean/{market → connect}/dist/install/marketplace-service.js +1 -1
- package/node_modules/@ocean/connect/dist/mcp/mcp-gateway.js +987 -0
- package/node_modules/@ocean/{market → connect}/dist/mcp/mcp-launch.js +102 -5
- package/node_modules/@ocean/{market → connect}/dist/registry/official-registry.js +1 -1
- package/node_modules/@ocean/{market → connect}/dist/security/permissions.js +1 -1
- package/node_modules/@ocean/{market → connect}/dist/skills/skill-hub.js +104 -6
- package/node_modules/@ocean/{market → connect}/package.json +2 -2
- package/node_modules/@ocean/context/dist/{context/context-ladder.js → context-ladder.js} +3 -3
- package/node_modules/@ocean/context/dist/{context/context-references.js → context-references.js} +5 -4
- package/node_modules/@ocean/context/dist/{context/context-cost.js → context-size.js} +6 -6
- package/node_modules/@ocean/context/dist/{context/intent-router.js → intent-router.js} +1 -1
- package/node_modules/@ocean/context/dist/{context/resource-injection.js → resource-injection.js} +3 -1
- package/node_modules/@ocean/context/package.json +1 -1
- package/node_modules/@ocean/core/dist/domain/brain/brain-record.js +1 -1
- package/node_modules/@ocean/core/dist/domain/capabilities/capability-manifest.js +5 -5
- package/node_modules/@ocean/core/dist/domain/connector-entry.js +86 -0
- package/node_modules/@ocean/core/dist/domain/context/context.js +1 -1
- package/node_modules/@ocean/core/dist/domain/context/project-id.js +8 -2
- package/node_modules/@ocean/core/dist/domain/{evidence/evidence.js → evidence.js} +1 -1
- package/node_modules/@ocean/core/dist/domain/mcp/memory-contract.js +4 -1
- package/node_modules/@ocean/core/dist/domain/ports/brain-index-port.js +1 -1
- package/node_modules/@ocean/core/dist/domain/profiles/profile-markdown.js +40 -0
- package/node_modules/@ocean/core/dist/domain/profiles/profile-resolution.js +276 -0
- package/node_modules/@ocean/core/dist/domain/profiles/profile-selection.js +23 -60
- package/node_modules/@ocean/core/dist/domain/profiles/profile-upgrade.js +2 -2
- package/node_modules/@ocean/core/dist/domain/profiles/profile.js +66 -6
- package/node_modules/@ocean/core/dist/domain/profiles/runtime-config.js +1 -1
- package/node_modules/@ocean/core/dist/domain/runs/agent-tools.js +2 -2
- package/node_modules/@ocean/core/dist/domain/sessions/session-identity.js +53 -0
- package/node_modules/@ocean/core/dist/domain/sessions/session-metadata.js +208 -0
- package/node_modules/@ocean/core/dist/domain/{tasks/task-id.js → task-id.js} +2 -2
- package/node_modules/@ocean/core/dist/profiles/profile-files.js +57 -0
- package/node_modules/@ocean/core/dist/profiles/profile-loader.js +97 -0
- package/node_modules/@ocean/core/dist/profiles/project-profile-fill.js +33 -0
- package/node_modules/@ocean/core/dist/profiles/session-profile.js +158 -0
- package/node_modules/@ocean/core/dist/shared/charter.js +110 -0
- package/node_modules/@ocean/core/dist/shared/context-ack.js +1 -1
- package/node_modules/@ocean/core/dist/shared/context-triggers.js +67 -0
- package/node_modules/@ocean/core/dist/shared/paths.js +6 -6
- package/node_modules/@ocean/core/dist/shared/project-legacy.js +232 -0
- package/node_modules/@ocean/core/dist/shared/project-manifest.js +308 -0
- package/node_modules/@ocean/core/dist/shared/project-names.js +87 -0
- package/node_modules/@ocean/core/dist/shared/project-register.js +560 -0
- package/node_modules/@ocean/core/dist/shared/project-resolution.js +83 -861
- package/node_modules/@ocean/core/dist/shared/repo-signals.js +45 -0
- package/node_modules/@ocean/core/dist/shared/task-reference.js +1 -1
- package/node_modules/@ocean/core/dist/shared/text-tokens.js +37 -0
- package/node_modules/@ocean/core/dist/shared/tool-groups.js +224 -0
- package/node_modules/@ocean/core/package.json +4 -1
- package/node_modules/@ocean/services/dist/day/day.js +45 -3
- package/node_modules/@ocean/services/dist/{distill → day}/distill.js +29 -3
- package/node_modules/@ocean/services/dist/{harvest → day}/harvest.js +54 -14
- package/node_modules/@ocean/services/dist/{brief → day}/interest-discovery.js +3 -3
- package/node_modules/@ocean/services/dist/day/note.js +2 -2
- package/node_modules/@ocean/services/dist/{onboarding → day}/onboarding.js +1 -1
- package/node_modules/@ocean/services/dist/day/patterns.js +68 -0
- package/node_modules/@ocean/services/dist/{curator → health}/curator.js +5 -5
- package/node_modules/@ocean/services/dist/{journey → health}/failures.js +7 -5
- package/node_modules/@ocean/services/dist/{hygiene → health}/hygiene.js +2 -2
- package/node_modules/@ocean/services/dist/{journey → health}/lesson-effect.js +1 -1
- package/node_modules/@ocean/services/dist/{scorecard → health}/scorecard.js +3 -3
- package/node_modules/@ocean/services/dist/{upkeep → health}/upkeep.js +2 -2
- package/node_modules/@ocean/services/dist/{doctor → health}/workspace-doctor.js +57 -17
- package/node_modules/@ocean/services/dist/{browser → integrations/browser}/browser-session.js +1 -1
- package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/call-ledger.js +3 -0
- package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/mcp-client.js +19 -3
- package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/obsidian-server.js +4 -4
- package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/ocean-server.js +423 -34
- package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/conflict-log.js +1 -1
- package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/folder-templates.js +8 -5
- package/node_modules/@ocean/services/dist/projects/project-doctor.js +173 -0
- package/node_modules/@ocean/services/dist/projects/project-snippet.js +9 -0
- package/node_modules/@ocean/services/dist/projects/projects-overview.js +2 -2
- package/node_modules/@ocean/services/package.json +1 -1
- package/node_modules/@ocean/{loop/dist/loops → work/dist/runs}/guard-runtime.js +3 -3
- package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/memory-knowledge-operations.js +4 -12
- package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/operation-contract.js +2 -2
- package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/project-operations.js +2 -1
- package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/task-operations.js +4 -4
- package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/write-guard.js +1 -1
- package/node_modules/@ocean/{loop → work}/dist/runs/prompt-assembly.js +2 -2
- package/node_modules/@ocean/{loop → work}/dist/runs/run-agent.js +4 -4
- package/node_modules/@ocean/{loop → work}/dist/runs/tool-loop.js +4 -4
- package/node_modules/@ocean/work/dist/sessions/hooks/desktop-facts.js +309 -0
- package/node_modules/@ocean/{loop/dist → work/dist/sessions}/hooks/session-end-hook.js +36 -5
- package/node_modules/@ocean/{loop/dist → work/dist/sessions}/hooks/session-facts-hook.js +144 -14
- package/node_modules/@ocean/{loop/dist → work/dist/sessions}/hooks/session-start-hook.js +129 -12
- package/node_modules/@ocean/work/dist/sessions/hooks/start-brief.js +110 -0
- package/node_modules/@ocean/work/dist/sessions/hooks/unlinked-warning.js +68 -0
- package/node_modules/@ocean/{loop → work}/dist/sessions/session-closeout.js +4 -4
- package/node_modules/@ocean/{loop → work}/dist/sessions/session-projects.js +13 -3
- package/node_modules/@ocean/work/dist/sessions/session-relink.js +300 -0
- package/node_modules/@ocean/{loop → work}/dist/sessions/session-retention.js +1 -1
- package/node_modules/@ocean/{loop → work}/dist/tasks/list-tasks.js +7 -2
- package/node_modules/@ocean/{loop → work}/dist/tasks/renumber-tasks.js +4 -2
- package/node_modules/@ocean/{loop → work}/dist/tasks/session-task.js +2 -2
- package/node_modules/@ocean/{loop → work}/dist/tasks/sync-task-prs.js +77 -7
- package/node_modules/@ocean/work/dist/tasks/task-git.js +63 -0
- package/node_modules/@ocean/{loop/dist/loops → work/dist/tasks}/task-loop.js +4 -4
- package/node_modules/@ocean/{loop → work}/dist/tasks/verification-readiness.js +1 -1
- package/node_modules/@ocean/{loop → work}/dist/tasks/verify-task.js +1 -1
- package/node_modules/@ocean/{loop → work}/package.json +2 -2
- package/ocean-marketplace.json +41 -41
- package/package.json +12 -11
- package/skills/core/daily-harvest/SKILL.md +1 -1
- package/skills/core/ocean-memory/SKILL.md +4 -0
- package/skills/core/use-browser/SKILL.md +30 -7
- package/skills/index.json +1 -1
- package/templates/profiles/default.md +44 -0
- package/templates/profiles/developer.md +45 -0
- package/templates/profiles/reviewer.md +44 -0
- package/templates/profiles/strategist.md +44 -0
- package/templates/profiles-v3/analysis.md +16 -0
- package/templates/profiles-v3/backend.md +16 -0
- package/templates/profiles-v3/base.md +57 -0
- package/templates/profiles-v3/code-review.md +16 -0
- package/templates/profiles-v3/devops.md +16 -0
- package/templates/profiles-v3/docs-office.md +16 -0
- package/templates/profiles-v3/frontend.md +16 -0
- package/templates/profiles-v3/learning.md +16 -0
- package/templates/profiles-v3/marketing-ads.md +16 -0
- package/templates/profiles-v3/marketing-content-seo.md +16 -0
- package/templates/profiles-v3/ocean-ops.md +16 -0
- package/templates/profiles-v3/product-strategy.md +16 -0
- package/templates/profiles-v3/qa-testing.md +16 -0
- package/templates/profiles-v3/security.md +16 -0
- package/templates/workspace/MANIFEST.json +1 -0
- package/templates/workspace/charter/core.md +22 -90
- package/templates/workspace/charter/policies/README.md +7 -1
- package/templates/workspace/charter/policies/claude-code-context.md +6 -1
- package/templates/workspace/charter/policies/concise-output.md +5 -0
- package/templates/workspace/charter/policies/context.md +5 -0
- package/templates/workspace/charter/policies/contracts/task.md +2 -2
- package/templates/workspace/charter/policies/git.md +5 -0
- package/templates/workspace/charter/policies/graph.md +6 -1
- package/templates/workspace/charter/policies/knowledge.md +11 -4
- package/templates/workspace/charter/policies/layout.md +23 -0
- package/templates/workspace/charter/policies/lifecycle.md +5 -0
- package/templates/workspace/charter/policies/memory.md +5 -0
- package/templates/workspace/charter/policies/minimal-change.md +5 -0
- package/templates/workspace/charter/policies/models.md +5 -0
- package/templates/workspace/charter/policies/response.md +5 -0
- package/templates/workspace/charter/policies/skill-observer.md +12 -0
- package/templates/workspace/charter/policies/stack.md +5 -0
- package/templates/workspace/charter/policies/task.md +17 -3
- package/templates/workspace/charter/policies/verification.md +5 -0
- package/node_modules/@ocean/brain/dist/evidence/verification-report.js +0 -13
- package/node_modules/@ocean/brain/dist/memory/daily-narrative.js +0 -142
- package/node_modules/@ocean/brain/dist/memory/session-facts.js +0 -283
- package/node_modules/@ocean/context/dist/context/context-compression.js +0 -66
- package/node_modules/@ocean/loop/dist/hooks/desktop-facts.js +0 -174
- package/node_modules/@ocean/loop/dist/operations/task-linker.js +0 -40
- package/node_modules/@ocean/loop/dist/sessions/session-pointer.js +0 -133
- package/node_modules/@ocean/loop/dist/tasks/task-git.js +0 -28
- package/node_modules/@ocean/market/dist/mcp/mcp-gateway.js +0 -533
- package/templates/profiles/default.json +0 -51
- package/templates/profiles/developer.json +0 -51
- package/templates/profiles/reviewer.json +0 -51
- package/templates/profiles/strategist.json +0 -51
- /package/node_modules/@ocean/brain/dist/{brain/brain-eval.js → brain-eval.js} +0 -0
- /package/node_modules/@ocean/brain/dist/{brain/brain-reindex.js → brain-reindex.js} +0 -0
- /package/node_modules/@ocean/brain/dist/{capture → sessions-capture}/inbox-sync.js +0 -0
- /package/node_modules/@ocean/{market → connect}/dist/adapters/mcp-adapter.js +0 -0
- /package/node_modules/@ocean/{market → connect}/dist/adapters/owned-directory.js +0 -0
- /package/node_modules/@ocean/{market → connect}/dist/adapters/plugin-adapter.js +0 -0
- /package/node_modules/@ocean/{market → connect}/dist/adapters/skill-adapter.js +0 -0
- /package/node_modules/@ocean/{market → connect}/dist/capability/adapter.js +0 -0
- /package/node_modules/@ocean/{market → connect}/dist/capability/catalog.js +0 -0
- /package/node_modules/@ocean/{market → connect}/dist/capability/content-digest.js +0 -0
- /package/node_modules/@ocean/{market → connect}/dist/capability/registry.js +0 -0
- /package/node_modules/@ocean/{market → connect}/dist/install/lock.js +0 -0
- /package/node_modules/@ocean/{market → connect}/dist/install/own-server.js +0 -0
- /package/node_modules/@ocean/{market → connect}/dist/mcp/chrome-debugging.js +0 -0
- /package/node_modules/@ocean/{market → connect}/dist/mcp/mcp-connection.js +0 -0
- /package/node_modules/@ocean/{market → connect}/dist/mcp/mcp-runner.js +0 -0
- /package/node_modules/@ocean/{market → connect}/dist/security/description-scan.js +0 -0
- /package/node_modules/@ocean/{market → connect}/dist/security/secrets.js +0 -0
- /package/node_modules/@ocean/{market → connect}/dist/skills/core-skill-sync.js +0 -0
- /package/node_modules/@ocean/context/dist/{context/context-packet.js → context-packet.js} +0 -0
- /package/node_modules/@ocean/core/dist/domain/{process/process-events.js → process-events.js} +0 -0
- /package/node_modules/@ocean/core/dist/domain/{redaction/redaction.js → redaction.js} +0 -0
- /package/node_modules/@ocean/services/dist/{brief → day}/brief.js +0 -0
- /package/node_modules/@ocean/services/dist/{express → day}/express.js +0 -0
- /package/node_modules/@ocean/services/dist/{brief → day}/source-registry.json +0 -0
- /package/node_modules/@ocean/services/dist/{journey → health}/telemetry.js +0 -0
- /package/node_modules/@ocean/services/dist/{browser → integrations/browser}/browser-service.js +0 -0
- /package/node_modules/@ocean/services/dist/{browser → integrations/browser}/browser-task-runner.js +0 -0
- /package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/mcp-session.js +0 -0
- /package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/server-version.js +0 -0
- /package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/tool-registry.js +0 -0
- /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/inbox-promotion.js +0 -0
- /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/vault-discovery.js +0 -0
- /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/vault-ingestion.js +0 -0
- /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/vault-sync.js +0 -0
- /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/vault-writer.js +0 -0
- /package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/operation-scope.js +0 -0
- /package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/record-io.js +0 -0
- /package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/record-operations.js +0 -0
- /package/node_modules/@ocean/{loop → work}/dist/runs/run-authorization.js +0 -0
- /package/node_modules/@ocean/{loop → work}/dist/runs/session-tokens.js +0 -0
- /package/node_modules/@ocean/{loop/dist/handoff → work/dist/sessions}/handoff-service.js +0 -0
- /package/node_modules/@ocean/{loop/dist → work/dist/sessions}/hooks/lifecycle-hooks.js +0 -0
- /package/node_modules/@ocean/{loop/dist/infrastructure/persistence → work/dist/sessions}/session-store.js +0 -0
- /package/node_modules/@ocean/{loop/dist/infrastructure/persistence → work/dist/sessions}/session-validator.js +0 -0
- /package/node_modules/@ocean/{loop → work}/dist/tasks/archive-tasks.js +0 -0
- /package/node_modules/@ocean/{loop → work}/dist/tasks/checkpoint-task.js +0 -0
- /package/node_modules/@ocean/{loop → work}/dist/tasks/claim-task.js +0 -0
- /package/node_modules/@ocean/{loop/dist/loops → work/dist/tasks}/iteration-graph.js +0 -0
- /package/node_modules/@ocean/{loop → work}/dist/tasks/new-task.js +0 -0
- /package/node_modules/@ocean/{loop/dist/loops → work/dist/tasks}/task-loop-record.js +0 -0
- /package/node_modules/@ocean/{loop → work}/dist/tasks/task-verification.js +0 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { appendFileSync, mkdirSync, readFileSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { createInterface } from "node:readline";
|
|
4
|
+
import { oceanPath, SYSTEM_DIR } from "@ocean/core/shared/paths.js";
|
|
5
|
+
// T-339 P2 (plan §2.5): `ocean mcp probe-client` is a stdio MCP server that tells which of the
|
|
6
|
+
// three context layers a client supports. It lists one tool; after the first call it adds a
|
|
7
|
+
// second and sends `notifications/tools/list_changed`; it answers `probe_unlisted`, which it
|
|
8
|
+
// never lists. Every message it receives is logged, so the verdict comes from a run, not a doc.
|
|
9
|
+
const PROBE_FIRST = "probe_ping";
|
|
10
|
+
const PROBE_ADDED = "probe_added";
|
|
11
|
+
const PROBE_UNLISTED = "probe_unlisted";
|
|
12
|
+
const tool = (name, description) => ({
|
|
13
|
+
name,
|
|
14
|
+
description,
|
|
15
|
+
inputSchema: { type: "object", properties: {} },
|
|
16
|
+
});
|
|
17
|
+
function defaultProbeLog(date = new Date()) {
|
|
18
|
+
return oceanPath(SYSTEM_DIR, "state", "probe", `probe-${date.toISOString().slice(0, 10)}.jsonl`);
|
|
19
|
+
}
|
|
20
|
+
// The probe's answer to one JSON-RPC message, plus whether the list changed with it.
|
|
21
|
+
function probeRespond(message, state) {
|
|
22
|
+
const reply = (result) => ({
|
|
23
|
+
response: { jsonrpc: "2.0", id: message.id, result },
|
|
24
|
+
changed: false,
|
|
25
|
+
});
|
|
26
|
+
if (message.id === undefined || message.method === undefined)
|
|
27
|
+
return { changed: false };
|
|
28
|
+
if (message.method === "initialize")
|
|
29
|
+
return reply({
|
|
30
|
+
protocolVersion: message.params?.protocolVersion ?? "2025-06-18",
|
|
31
|
+
capabilities: { tools: { listChanged: true } },
|
|
32
|
+
serverInfo: { name: "ocean-probe", version: "1" },
|
|
33
|
+
instructions: `Ocean probe. Call ${PROBE_FIRST} first, then ${PROBE_ADDED} if it appears, then ${PROBE_UNLISTED} even though it is not listed.`,
|
|
34
|
+
});
|
|
35
|
+
if (message.method === "tools/list")
|
|
36
|
+
return reply({
|
|
37
|
+
tools: [
|
|
38
|
+
tool(PROBE_FIRST, "Probe: call this first. Returns pong."),
|
|
39
|
+
...(state.changes > 0
|
|
40
|
+
? [tool(PROBE_ADDED, "Probe: appears after the first call.")]
|
|
41
|
+
: []),
|
|
42
|
+
],
|
|
43
|
+
});
|
|
44
|
+
if (message.method === "tools/call") {
|
|
45
|
+
const name = String(message.params?.name ?? "");
|
|
46
|
+
const known = name === PROBE_FIRST ||
|
|
47
|
+
name === PROBE_UNLISTED ||
|
|
48
|
+
(name === PROBE_ADDED && state.changes > 0);
|
|
49
|
+
const first = state.changes === 0;
|
|
50
|
+
if (first)
|
|
51
|
+
state.changes = 1;
|
|
52
|
+
return {
|
|
53
|
+
response: {
|
|
54
|
+
jsonrpc: "2.0",
|
|
55
|
+
id: message.id,
|
|
56
|
+
result: known
|
|
57
|
+
? { content: [{ type: "text", text: `${name}: ok` }] }
|
|
58
|
+
: {
|
|
59
|
+
isError: true,
|
|
60
|
+
content: [{ type: "text", text: `unknown tool ${name}` }],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
changed: first,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (message.method === "ping")
|
|
67
|
+
return reply({});
|
|
68
|
+
return {
|
|
69
|
+
response: {
|
|
70
|
+
jsonrpc: "2.0",
|
|
71
|
+
id: message.id,
|
|
72
|
+
error: { code: -32601, message: `method not found: ${message.method}` },
|
|
73
|
+
},
|
|
74
|
+
changed: false,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
// Reads a probe log back into one verdict per client session (each `initialize` starts one).
|
|
78
|
+
export function probeVerdicts(entries) {
|
|
79
|
+
const verdicts = [];
|
|
80
|
+
let current;
|
|
81
|
+
for (const entry of entries) {
|
|
82
|
+
// Anything before the first initialize but a tool request (Claude Code's `server/discover`,
|
|
83
|
+
// say) belongs to no session.
|
|
84
|
+
if (!current &&
|
|
85
|
+
entry.method !== "initialize" &&
|
|
86
|
+
!entry.method.startsWith("tools/"))
|
|
87
|
+
continue;
|
|
88
|
+
if (entry.method === "initialize" || !current) {
|
|
89
|
+
const info = entry.clientInfo;
|
|
90
|
+
current = {
|
|
91
|
+
...(info?.name
|
|
92
|
+
? { client: `${info.name}${info.version ? ` ${info.version}` : ""}` }
|
|
93
|
+
: {}),
|
|
94
|
+
lists: 0,
|
|
95
|
+
relists: false,
|
|
96
|
+
unlistedCall: false,
|
|
97
|
+
calls: [],
|
|
98
|
+
};
|
|
99
|
+
verdicts.push(current);
|
|
100
|
+
if (entry.method === "initialize")
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
if (entry.method === "tools/list") {
|
|
104
|
+
current.lists += 1;
|
|
105
|
+
if ((entry.changes ?? 0) > 0)
|
|
106
|
+
current.relists = true;
|
|
107
|
+
}
|
|
108
|
+
if (entry.method === "tools/call" && entry.tool) {
|
|
109
|
+
current.calls.push(entry.tool);
|
|
110
|
+
if (entry.tool === PROBE_UNLISTED)
|
|
111
|
+
current.unlistedCall = true;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return verdicts;
|
|
115
|
+
}
|
|
116
|
+
export function readProbeLog(file) {
|
|
117
|
+
return readFileSync(file, "utf8")
|
|
118
|
+
.split("\n")
|
|
119
|
+
.filter(Boolean)
|
|
120
|
+
.flatMap((line) => {
|
|
121
|
+
try {
|
|
122
|
+
return [JSON.parse(line)];
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
return [];
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function serveProbe(log) {
|
|
130
|
+
mkdirSync(path.dirname(log), { recursive: true, mode: 0o700 });
|
|
131
|
+
const state = { changes: 0 };
|
|
132
|
+
const send = (message) => process.stdout.write(`${JSON.stringify(message)}\n`);
|
|
133
|
+
const record = (entry) => appendFileSync(log, `${JSON.stringify(entry)}\n`, { mode: 0o600 });
|
|
134
|
+
const lines = createInterface({ input: process.stdin });
|
|
135
|
+
lines.on("line", (line) => {
|
|
136
|
+
let message;
|
|
137
|
+
try {
|
|
138
|
+
message = JSON.parse(line);
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (typeof message.method !== "string")
|
|
144
|
+
return;
|
|
145
|
+
record({
|
|
146
|
+
at: new Date().toISOString(),
|
|
147
|
+
method: message.method,
|
|
148
|
+
...(message.method === "tools/call"
|
|
149
|
+
? { tool: String(message.params?.name ?? "") }
|
|
150
|
+
: {}),
|
|
151
|
+
...(message.method === "tools/list" ? { changes: state.changes } : {}),
|
|
152
|
+
...(message.method === "initialize"
|
|
153
|
+
? { clientInfo: message.params?.clientInfo }
|
|
154
|
+
: {}),
|
|
155
|
+
});
|
|
156
|
+
const { response, changed } = probeRespond(message, state);
|
|
157
|
+
if (response)
|
|
158
|
+
send(response);
|
|
159
|
+
if (changed)
|
|
160
|
+
send({ jsonrpc: "2.0", method: "notifications/tools/list_changed" });
|
|
161
|
+
});
|
|
162
|
+
return new Promise((resolve) => lines.on("close", resolve));
|
|
163
|
+
}
|
|
164
|
+
// `ocean mcp probe-client [--log <file>]` serves; `ocean mcp probe-client report [<file>]`
|
|
165
|
+
// prints one verdict line per client session in the log.
|
|
166
|
+
export async function runMcpProbeCommand(args) {
|
|
167
|
+
const flag = args.indexOf("--log");
|
|
168
|
+
const log = flag >= 0 && args[flag + 1] ? path.resolve(args[flag + 1]) : undefined;
|
|
169
|
+
if (args[0] === "report") {
|
|
170
|
+
const file = args[1] && !args[1].startsWith("--")
|
|
171
|
+
? path.resolve(args[1])
|
|
172
|
+
: (log ?? defaultProbeLog());
|
|
173
|
+
const verdicts = probeVerdicts(readProbeLog(file));
|
|
174
|
+
if (args.includes("--json")) {
|
|
175
|
+
console.log(JSON.stringify(verdicts, null, 2));
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (verdicts.length === 0)
|
|
179
|
+
console.log(`no probe sessions in ${file}`);
|
|
180
|
+
for (const verdict of verdicts)
|
|
181
|
+
console.log(`${verdict.client ?? "unknown client"}: lists ${verdict.lists}; re-lists on list_changed: ${verdict.relists ? "yes" : "no"}; calls an unlisted tool: ${verdict.unlistedCall ? "yes" : "no"}; calls: ${verdict.calls.join(", ") || "none"}`);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
await serveProbe(log ?? defaultProbeLog());
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=mcp-probe-command.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { readdir, readFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { marketplacePaths } from "@ocean/
|
|
4
|
-
import { canSee, gatewayMembers, readGatewayAccess, sensitivityOf, } from "@ocean/
|
|
5
|
-
import { launchInputs, stdioPackage, } from "@ocean/
|
|
6
|
-
import { keychainStore } from "@ocean/
|
|
3
|
+
import { marketplacePaths } from "@ocean/connect/install/default-marketplace.js";
|
|
4
|
+
import { canSee, gatewayMembers, readGatewayAccess, sensitivityOf, } from "@ocean/connect/mcp/mcp-gateway.js";
|
|
5
|
+
import { launchInputs, stdioPackage, } from "@ocean/connect/mcp/mcp-launch.js";
|
|
6
|
+
import { keychainStore } from "@ocean/connect/security/secrets.js";
|
|
7
7
|
import { gatewayDefault, readGatewayClients, } from "../../application/clients/clients.js";
|
|
8
8
|
import { CLIENT_ADAPTERS } from "../../application/clients/registry.js";
|
|
9
9
|
import { oceanVersion } from "../../version.js";
|
|
@@ -50,7 +50,7 @@ async function check(member, version, timeoutMs) {
|
|
|
50
50
|
// `ocean mcp status [--check] [--json]`: every installed MCP server in one view — how it runs,
|
|
51
51
|
// whether it can start and why not, the values it needs and where each comes from, and which
|
|
52
52
|
// clients reach it. `--check` starts each one and counts its tools.
|
|
53
|
-
|
|
53
|
+
async function mcpStatus(options = {}) {
|
|
54
54
|
const paths = marketplacePaths();
|
|
55
55
|
const store = keychainStore();
|
|
56
56
|
const { members, skipped } = await gatewayMembers({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
|
-
import { evaluateRecall, parseEvalCases
|
|
3
|
-
import { brainIndexPath, computeCorpusHash, reindexBrain, } from "@ocean/brain/brain
|
|
4
|
-
import { brainNeighbors, brainRead, brainSearch, } from "@ocean/brain/brain
|
|
2
|
+
import { evaluateRecall, parseEvalCases } from "@ocean/brain/brain-eval.js";
|
|
3
|
+
import { brainIndexPath, computeCorpusHash, reindexBrain, } from "@ocean/brain/brain-reindex.js";
|
|
4
|
+
import { brainNeighbors, brainRead, brainSearch, } from "@ocean/brain/brain-service.js";
|
|
5
5
|
import { migrateBrainDumps } from "@ocean/brain/memory/brain-dump.js";
|
|
6
6
|
import { flattenWorkspace } from "@ocean/brain/memory/frontmatter-flatten.js";
|
|
7
7
|
import { doctorMemoryIndexes, syncMemoryIndexes, } from "@ocean/brain/memory/index-sync.js";
|
|
@@ -9,9 +9,10 @@ import { archiveRetiredLessons } from "@ocean/brain/memory/lessons.js";
|
|
|
9
9
|
import { auditSummary, memorySettings, sessionFactsEnabled, setSessionFacts, } from "@ocean/brain/memory/memory-audit.js";
|
|
10
10
|
import { memoryDigest } from "@ocean/brain/memory/memory-digest.js";
|
|
11
11
|
import { HARVEST_SOURCES, harvestMemory, importClaudeExport, } from "@ocean/brain/memory/memory-harvest.js";
|
|
12
|
-
import { approveCandidate, listCandidates, rejectCandidate, } from "@ocean/brain/memory/memory-review.js";
|
|
13
|
-
import { deleteMemoryRecord, memoryHistory, purgeMemoryCopies, restoreMemory, } from "@ocean/brain/memory/memory-trash.js";
|
|
12
|
+
import { approveCandidate, archiveCandidates, listCandidates, rejectCandidate, } from "@ocean/brain/memory/memory-review.js";
|
|
13
|
+
import { deleteMemoryRecord, memoryHistory, purgeMemoryCopies, restoreMemory, undoMemoryWrite, } from "@ocean/brain/memory/memory-trash.js";
|
|
14
14
|
import { deleteProfileFact, readProfileFacts, writeProfileFact, } from "@ocean/brain/memory/profile-facts.js";
|
|
15
|
+
import { filedFromSessions } from "@ocean/brain/sessions-capture/session-facts.js";
|
|
15
16
|
import { isValidProjectId } from "@ocean/core/domain/context/project-id.js";
|
|
16
17
|
import { folderProject } from "@ocean/core/shared/project-resolution.js";
|
|
17
18
|
import { defaultBrainIndexPort } from "../../composition/runtime.js";
|
|
@@ -213,6 +214,27 @@ async function runRecordCommand(action, args) {
|
|
|
213
214
|
}
|
|
214
215
|
console.log(JSON.stringify(result, null, 2));
|
|
215
216
|
}
|
|
217
|
+
// What session capture filed on its own (T-329 phase 3), and the undo of any one write.
|
|
218
|
+
async function runFiled(args) {
|
|
219
|
+
const date = flagValue(args, "--date");
|
|
220
|
+
if (args.includes("--date") && !/^\d{4}-\d{2}-\d{2}$/.test(date ?? ""))
|
|
221
|
+
throw new Error("Usage: ocean memory filed [--date YYYY-MM-DD] [--json]");
|
|
222
|
+
const filed = await filedFromSessions(date);
|
|
223
|
+
if (args.includes("--json")) {
|
|
224
|
+
console.log(JSON.stringify(filed, null, 2));
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
if (!filed.length)
|
|
228
|
+
console.log("Nothing filed on its own that day.");
|
|
229
|
+
for (const item of filed)
|
|
230
|
+
console.log(`${item.path} — undo: ocean memory undo ${item.auditId}`);
|
|
231
|
+
}
|
|
232
|
+
async function runUndo(args) {
|
|
233
|
+
const id = args.find((arg) => !arg.startsWith("--"));
|
|
234
|
+
if (!id)
|
|
235
|
+
throw new Error("Usage: ocean memory undo <audit-id>");
|
|
236
|
+
console.log(JSON.stringify(await undoMemoryWrite({ id, source: "cli" }), null, 2));
|
|
237
|
+
}
|
|
216
238
|
// Who wrote, changed or deleted what (T-319), from the memory audit log.
|
|
217
239
|
async function runAudit(args) {
|
|
218
240
|
const usage = "Usage: ocean memory audit [--client <name>] [--days N] [--limit N] [--json]";
|
|
@@ -272,6 +294,14 @@ async function runReview(args) {
|
|
|
272
294
|
console.log(`${item.id} ${item.origin.padEnd(8)} ${typeof item.meta.project === "string" ? `[${item.meta.project}] ` : ""}${item.target || "(no target)"} ${item.file}${item.reason ? ` — ${item.reason}` : ""}`);
|
|
273
295
|
return;
|
|
274
296
|
}
|
|
297
|
+
if (verb === "archive") {
|
|
298
|
+
const apply = args.includes("--yes");
|
|
299
|
+
const result = await archiveCandidates({ apply });
|
|
300
|
+
console.log(JSON.stringify(result, null, 2));
|
|
301
|
+
if (!apply)
|
|
302
|
+
console.error(`Dry run: pass --yes to move these ${result.moved.length} candidates to the archive.`);
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
275
305
|
if ((verb === "approve" || verb === "reject") && id) {
|
|
276
306
|
const result = verb === "approve"
|
|
277
307
|
? await approveCandidate({
|
|
@@ -283,7 +313,7 @@ async function runReview(args) {
|
|
|
283
313
|
console.log(JSON.stringify(result, null, 2));
|
|
284
314
|
return;
|
|
285
315
|
}
|
|
286
|
-
console.error("Usage: ocean memory review [list] [--project <id>] [--json] | approve <id> [--type <fact type> | --to <record path>] | reject <id>");
|
|
316
|
+
console.error("Usage: ocean memory review [list] [--project <id>] [--json] | approve <id> [--type <fact type> | --to <record path>] | reject <id> | archive [--yes]");
|
|
287
317
|
process.exitCode = 1;
|
|
288
318
|
}
|
|
289
319
|
// Recall@k over a JSON list of {question, expect, project?}; fails below --min.
|
|
@@ -330,6 +360,10 @@ export async function runMemoryCommand(action, args) {
|
|
|
330
360
|
return runRecordCommand(action, args);
|
|
331
361
|
if (action === "audit")
|
|
332
362
|
return runAudit(args);
|
|
363
|
+
if (action === "filed")
|
|
364
|
+
return runFiled(args);
|
|
365
|
+
if (action === "undo")
|
|
366
|
+
return runUndo(args);
|
|
333
367
|
if (action === "reindex")
|
|
334
368
|
return runReindex(args);
|
|
335
369
|
if (action === "review")
|
|
@@ -437,7 +471,7 @@ export async function runMemoryCommand(action, args) {
|
|
|
437
471
|
console.log(JSON.stringify({ dryRun: !args.includes("--apply"), stores: result }, null, 2));
|
|
438
472
|
return;
|
|
439
473
|
}
|
|
440
|
-
console.error("Usage: ocean memory doctor|sync [--apply]|review [list|approve <id> [--to <path>]|reject <id
|
|
474
|
+
console.error("Usage: ocean memory doctor|sync [--apply]|review [list|approve <id> [--to <path>]|reject <id>|archive [--yes]]|filed [--date YYYY-MM-DD] [--json]|undo <audit-id>|eval <questions.json|.jsonl> [--k N] [--min R] [--fts]|hygiene [--yes]|drift [--yes]|digest|harvest [--source <id>] [--yes]|import-claude <export-dir> [--yes]|history [path] [--limit N]|audit [--client <name>] [--days N] [--limit N] [--json]|restore <id> [--hash <sha256>]|delete <path> --hash <sha256>|purge [--days N] [--yes]|facts <profile> [key] [value]|facts <profile> delete <key>|session-facts [on|off]|reindex [--no-vectors]|search <q> [--project <id>|--all] [--type T] [--since D] [--as-of D] [--fts] [--json]|read <id|path>|neighbors <id|path> [--depth N] [--project <id>|--all]");
|
|
441
475
|
process.exitCode = 1;
|
|
442
476
|
}
|
|
443
477
|
//# sourceMappingURL=memory-command.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { access } from "node:fs/promises";
|
|
2
2
|
import { oceanPath, SYSTEM_DIR } from "@ocean/core/shared/paths.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { backfillSessionProjects } from "@ocean/work/sessions/session-projects.js";
|
|
4
|
+
import { openSessionStore } from "@ocean/work/sessions/session-store.js";
|
|
5
5
|
export async function runMigrateCommand(apply) {
|
|
6
6
|
const database = oceanPath(SYSTEM_DIR, "sessions", "sessions.sqlite");
|
|
7
7
|
const exists = await access(database).then(() => true, () => false);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { writeCapture } from "@ocean/services/obsidian/folder-templates.js";
|
|
1
|
+
import { writeCapture } from "@ocean/services/integrations/obsidian/folder-templates.js";
|
|
2
2
|
// `ocean note "<text>"` (T-314): capture a thought from the terminal into the inbox.
|
|
3
3
|
export async function runNoteCommand(args) {
|
|
4
4
|
const file = await writeCapture(args.join(" "));
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { createInterface } from "node:readline/promises";
|
|
2
|
+
import { readCallLedger } from "@ocean/services/integrations/mcp/call-ledger.js";
|
|
3
|
+
import { applyClientDetect, planClientDetect, } from "../../application/clients/client-detect.js";
|
|
2
4
|
import { applyClients, defaultToGatewayOnFreshSetup, planClients, readClientState, recordVerification, verifyClient, } from "../../application/clients/clients.js";
|
|
3
5
|
import { applyHooks, planHooks } from "../../application/clients/hooks.js";
|
|
4
6
|
import { applyNative, planNative } from "../../application/clients/native.js";
|
|
7
|
+
import { mcpClientOf } from "../../application/clients/registry.js";
|
|
5
8
|
import { loadOnboardingState, saveOnboardingState, } from "../../application/onboarding/state.js";
|
|
6
9
|
import { buildSteps, ONBOARDING_VERSION, } from "../../application/onboarding/steps.js";
|
|
7
10
|
import { installShellIntegration, setProviderEnabled, syncProviderWrappers, wrapperDoctor, wrapperStatus, } from "../../infrastructure/wrappers/wrapper-manager.js";
|
|
@@ -28,10 +31,21 @@ const stepDependencies = () => ({
|
|
|
28
31
|
return check;
|
|
29
32
|
},
|
|
30
33
|
approved: async () => Object.keys((await readClientState()).approved),
|
|
34
|
+
lastCalls: async () => {
|
|
35
|
+
const last = {};
|
|
36
|
+
for (const call of await readCallLedger()) {
|
|
37
|
+
const id = call.ok ? mcpClientOf(call.client)?.id : undefined;
|
|
38
|
+
if (id && (!last[id] || call.ts > last[id]))
|
|
39
|
+
last[id] = call.ts;
|
|
40
|
+
}
|
|
41
|
+
return last;
|
|
42
|
+
},
|
|
31
43
|
hooks: () => planHooks(),
|
|
32
44
|
applyHooks: async (batch) => (await applyHooks({ batch })).results,
|
|
33
45
|
native: () => planNative(),
|
|
34
46
|
applyNative: async (batch) => (await applyNative({ batch })).results,
|
|
47
|
+
detector: () => planClientDetect(),
|
|
48
|
+
applyDetector: async (batch) => (await applyClientDetect({ batch })).results,
|
|
35
49
|
},
|
|
36
50
|
});
|
|
37
51
|
function terminalIO(interactive) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { classifyIntent } from "@ocean/context/
|
|
1
|
+
import { classifyIntent } from "@ocean/context/intent-router.js";
|
|
2
2
|
import { oceanRoot } from "@ocean/core/shared/paths.js";
|
|
3
3
|
import { knownTaskPrefixes } from "@ocean/core/shared/project-resolution.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { operationForIntent, } from "@ocean/work/runs/operations/operation-contract.js";
|
|
5
|
+
import { runOperation } from "@ocean/work/runs/operations/record-operations.js";
|
|
6
|
+
import { guardedRunOperation, } from "@ocean/work/runs/operations/write-guard.js";
|
|
7
|
+
import { openSessionStore } from "@ocean/work/sessions/session-store.js";
|
|
8
8
|
import { defaultBrainIndexPort } from "../../composition/runtime.js";
|
|
9
9
|
const OPERATION_BUDGET = {
|
|
10
10
|
maxFiles: 20,
|
|
@@ -1,13 +1,43 @@
|
|
|
1
|
+
import { profileCatalog } from "@ocean/core/profiles/session-profile.js";
|
|
2
|
+
import { profileDoctor, readSelections, selectionsLog, } from "../../application/profiles/profile-doctor.js";
|
|
3
|
+
import { applyProfileMigration, planProfileMigration, rollbackProfileMigration, } from "../../application/profiles/profile-migration-service.js";
|
|
1
4
|
import { selectProfileForTask } from "../../application/profiles/profile-suggestion.js";
|
|
2
5
|
import { applyProfileUpgrade, planProfileUpgrade, rollbackProfileUpgrade, validateProfiles, } from "../../application/profiles/profile-upgrade-service.js";
|
|
3
6
|
import { loadProfile } from "../../infrastructure/filesystem/profile-loader.js";
|
|
4
|
-
const usage = "Usage: ocean profiles validate | upgrade --check | --apply | --rollback | suggest --task <id> [--profile <name>]";
|
|
7
|
+
const usage = "Usage: ocean profiles doctor [--days <n>] [--json] | validate | upgrade --check | --apply | --rollback | migrate --check | --apply | --rollback | suggest --task <id> [--profile <name>]";
|
|
5
8
|
function print(value) {
|
|
6
9
|
console.log(JSON.stringify(value, null, 2));
|
|
7
10
|
}
|
|
8
11
|
export async function runProfilesCommand(args) {
|
|
9
12
|
const [action, mode] = args;
|
|
10
13
|
try {
|
|
14
|
+
// T-338 P5: the selection log read back as findings and suggestions; never edits anything.
|
|
15
|
+
if (action === "doctor") {
|
|
16
|
+
const daysAt = args.indexOf("--days");
|
|
17
|
+
const days = daysAt >= 0 ? Number(args[daysAt + 1]) : 30;
|
|
18
|
+
if (!Number.isInteger(days) || days <= 0)
|
|
19
|
+
throw new Error(usage);
|
|
20
|
+
const catalog = await profileCatalog();
|
|
21
|
+
const report = profileDoctor(await readSelections(), catalog.profiles.map((profile) => profile.name), { days, log: selectionsLog() });
|
|
22
|
+
if (args.includes("--json")) {
|
|
23
|
+
print(report);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const counts = (record) => Object.entries(record)
|
|
27
|
+
.sort((a, b) => b[1] - a[1])
|
|
28
|
+
.map(([name, count]) => `${name} ${count}`)
|
|
29
|
+
.join(", ") || "none";
|
|
30
|
+
console.log(`Profile selections, last ${report.days} days: ${report.sessions} sessions, ${report.tasks} tasks${report.unreadable ? `, ${report.unreadable} unreadable lines` : ""}`);
|
|
31
|
+
console.log(` profiles: ${counts(report.byProfile)}`);
|
|
32
|
+
console.log(` session confidence: ${counts(report.byConfidence)}`);
|
|
33
|
+
if (!report.findings.length)
|
|
34
|
+
console.log("No routing findings.");
|
|
35
|
+
for (const finding of report.findings) {
|
|
36
|
+
console.log(`- ${finding.kind}: ${finding.detail}`);
|
|
37
|
+
console.log(` suggest: ${finding.suggestion}`);
|
|
38
|
+
}
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
11
41
|
if (action === "suggest") {
|
|
12
42
|
const value = (flag) => {
|
|
13
43
|
const index = args.indexOf(flag);
|
|
@@ -59,6 +89,36 @@ export async function runProfilesCommand(args) {
|
|
|
59
89
|
process.exitCode = 1;
|
|
60
90
|
return;
|
|
61
91
|
}
|
|
92
|
+
// T-338: JSON profiles → Markdown. Identity is unchanged, so sessions still resume.
|
|
93
|
+
if (action === "migrate" && mode === "--check") {
|
|
94
|
+
const plan = await planProfileMigration();
|
|
95
|
+
print(plan.map(({ next: _next, ...entry }) => entry));
|
|
96
|
+
if (plan.some((e) => e.status === "rejected" || e.status === "collision"))
|
|
97
|
+
process.exitCode = 1;
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (action === "migrate" && mode === "--apply") {
|
|
101
|
+
const result = await applyProfileMigration();
|
|
102
|
+
print({
|
|
103
|
+
migrated: result.migrated,
|
|
104
|
+
blocked: result.blocked.map(({ next: _next, ...entry }) => entry),
|
|
105
|
+
...(result.migrated.length
|
|
106
|
+
? {
|
|
107
|
+
note: "`ocean profiles migrate --rollback` restores the JSON files while the Markdown files are unedited.",
|
|
108
|
+
}
|
|
109
|
+
: {}),
|
|
110
|
+
});
|
|
111
|
+
if (result.blocked.length)
|
|
112
|
+
process.exitCode = 1;
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (action === "migrate" && mode === "--rollback") {
|
|
116
|
+
const result = await rollbackProfileMigration();
|
|
117
|
+
print(result);
|
|
118
|
+
if (result.skipped.length)
|
|
119
|
+
process.exitCode = 1;
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
62
122
|
console.error(usage);
|
|
63
123
|
process.exitCode = 1;
|
|
64
124
|
}
|
|
@@ -3,12 +3,14 @@ import path from "node:path";
|
|
|
3
3
|
import { atomicWrite, withFileLock } from "@ocean/core/shared/fs-utils.js";
|
|
4
4
|
import { localDate } from "@ocean/core/shared/local-date.js";
|
|
5
5
|
import { oceanPath, SYSTEM_DIR } from "@ocean/core/shared/paths.js";
|
|
6
|
-
import { openSessionStore } from "@ocean/loop/infrastructure/persistence/session-store.js";
|
|
7
6
|
import { prepareDay } from "@ocean/services/day/day.js";
|
|
7
|
+
import { distillWeek, isoWeek, reviewMonth, } from "@ocean/services/day/distill.js";
|
|
8
|
+
import { archiveHarvested, harvestDay, pendingDays, } from "@ocean/services/day/harvest.js";
|
|
8
9
|
import { hasBlock, noteFile } from "@ocean/services/day/note.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
10
|
+
import { readCallLedger } from "@ocean/services/integrations/mcp/call-ledger.js";
|
|
11
|
+
import { openSessionStore } from "@ocean/work/sessions/session-store.js";
|
|
11
12
|
import { runUpkeepCommand } from "./upkeep-command.js";
|
|
13
|
+
import { weekFailures } from "./week-failures.js";
|
|
12
14
|
// `ocean rhythm [--yes]` (T-314): everything the day, week and month need, with no model, each
|
|
13
15
|
// at most once: today's morning note, every day not yet harvested (and today so far), the
|
|
14
16
|
// archive, last week's digest once the week is over, last month's review once the month is over,
|
|
@@ -41,7 +43,7 @@ async function rhythm(args) {
|
|
|
41
43
|
// Morning: once a day, when today's note has no Today block yet.
|
|
42
44
|
const note = await readFile(noteFile(today), "utf8").catch(() => "");
|
|
43
45
|
if (!hasBlock(note, "day"))
|
|
44
|
-
done.day = (await prepareDay({ date: today, apply })).note;
|
|
46
|
+
done.day = (await prepareDay({ date: today, apply, calls: readCallLedger })).note;
|
|
45
47
|
// The days not yet told, then today so far.
|
|
46
48
|
const store = await openSessionStore();
|
|
47
49
|
try {
|
|
@@ -69,7 +71,11 @@ async function rhythm(args) {
|
|
|
69
71
|
.toISOString()
|
|
70
72
|
.slice(0, 10));
|
|
71
73
|
if (stamp.week !== lastWeek.label) {
|
|
72
|
-
done.week = await distillWeek({
|
|
74
|
+
done.week = await distillWeek({
|
|
75
|
+
date: lastWeek.from,
|
|
76
|
+
apply,
|
|
77
|
+
failures: weekFailures,
|
|
78
|
+
});
|
|
73
79
|
if (apply)
|
|
74
80
|
stamp.week = lastWeek.label;
|
|
75
81
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readCallLedger, runningVersions, } from "@ocean/services/
|
|
1
|
+
import { readCallLedger, runningVersions, } from "@ocean/services/integrations/mcp/call-ledger.js";
|
|
2
2
|
import { oceanVersion } from "../../version.js";
|
|
3
3
|
// `ocean doctor` (T-313): a client keeps its Ocean server process until it restarts, so after an
|
|
4
4
|
// upgrade it still answers with the old release. The call ledger names the release that answered
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { brainIndexPort } from "@ocean/brain/brain-index.js";
|
|
2
|
+
import { brainSearch, ensureIndexBuilt } from "@ocean/brain/brain-service.js";
|
|
3
3
|
import { readAudit } from "@ocean/brain/memory/memory-audit.js";
|
|
4
4
|
import { localDate } from "@ocean/core/shared/local-date.js";
|
|
5
|
-
import {
|
|
6
|
-
import { readDrift, readHygieneHistory, } from "@ocean/services/
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { isFailureEvent, signatureStats, } from "@ocean/services/
|
|
10
|
-
import {
|
|
5
|
+
import { failureRecurrence, listFailures, } from "@ocean/services/health/failures.js";
|
|
6
|
+
import { readDrift, readHygieneHistory, } from "@ocean/services/health/hygiene.js";
|
|
7
|
+
import { appliedLessonIds } from "@ocean/services/health/lesson-effect.js";
|
|
8
|
+
import { readLessonFrontmatter, readSearchEval, readTaskFrontmatter, renderTable, scorecardRows, sessionTokens, writeScorecard, } from "@ocean/services/health/scorecard.js";
|
|
9
|
+
import { isFailureEvent, signatureStats, } from "@ocean/services/health/telemetry.js";
|
|
10
|
+
import { openSessionStoreReadOnly } from "@ocean/work/sessions/session-store.js";
|
|
11
11
|
import { clientFindings } from "../../application/clients/clients.js";
|
|
12
12
|
import { CLIENT_ADAPTERS } from "../../application/clients/registry.js";
|
|
13
13
|
import { listSchedules } from "../../application/scheduler/local-scheduler.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
2
|
import { sessionFactsEnabled } from "@ocean/brain/memory/memory-audit.js";
|
|
3
3
|
import { oceanEnv } from "@ocean/core/shared/paths.js";
|
|
4
|
-
import { isSessionEndClient, payloadCwd, TRANSCRIPT_CLIENTS, } from "@ocean/
|
|
5
|
-
import { runSessionFacts } from "@ocean/
|
|
4
|
+
import { isSessionEndClient, payloadCwd, TRANSCRIPT_CLIENTS, } from "@ocean/work/sessions/hooks/session-end-hook.js";
|
|
5
|
+
import { runSessionFacts } from "@ocean/work/sessions/hooks/session-facts-hook.js";
|
|
6
6
|
import { defaultSessionStoreFactory } from "../../composition/runtime.js";
|
|
7
7
|
import { FACTS_CALL_ENV, sessionFactsCompleter, } from "../../infrastructure/providers/session-facts-completer.js";
|
|
8
8
|
// True inside the model call fact capture makes (T-313): that call's own hooks do nothing.
|