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