vgxness 1.20.5 → 1.20.7
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/dist/adapters/claude/agent-renderer.js +82 -0
- package/dist/{mcp → adapters/claude/install}/claude-code-agent-config.js +64 -9
- package/dist/{mcp → adapters/claude/install}/claude-code-config.js +28 -6
- package/dist/{mcp → adapters/claude/install}/claude-code-project-memory.js +35 -5
- package/dist/{mcp → adapters/claude/install}/claude-code-scope.js +12 -3
- package/dist/{mcp → adapters/claude/install}/claude-code-user-config.js +26 -5
- package/dist/{mcp → adapters/claude/install}/claude-code-user-memory.js +47 -7
- package/dist/{mcp → adapters/claude/install}/client-install-claude-code-contract.js +45 -8
- package/dist/{mcp → adapters/claude/install}/client-install-claude-code.js +98 -14
- package/dist/adapters/json/agent-renderer.js +104 -0
- package/dist/adapters/opencode/agent-renderer.js +113 -0
- package/dist/{mcp → adapters/opencode/install}/client-install-opencode-contract.js +2 -2
- package/dist/{mcp → adapters/opencode/install}/client-install-opencode.js +1 -1
- package/dist/{mcp → adapters/opencode/install}/opencode-default-agent-config.js +2 -2
- package/dist/{mcp → adapters/opencode/install}/opencode-handoff-preview.js +60 -7
- package/dist/{mcp → adapters/opencode/install}/opencode-visibility.js +1 -1
- package/dist/adapters/provider-renderer.js +6 -0
- package/dist/agents/agent-activation-service.js +1 -263
- package/dist/agents/agent-lookup-contexts.js +1 -28
- package/dist/agents/agent-registry-service.js +1 -81
- package/dist/agents/agent-resolver.js +1 -287
- package/dist/agents/agent-seed-service.js +1 -157
- package/dist/agents/agent-seed-upgrade-service.js +1 -231
- package/dist/agents/agent-selector-resolver.js +1 -28
- package/dist/agents/boot-upgrade.js +1 -59
- package/dist/agents/canonical-agent-manifest.js +1 -246
- package/dist/agents/canonical-agent-projection.js +1 -236
- package/dist/agents/manager-profile-overlay-service.js +1 -60
- package/dist/agents/profile-model-routing.js +1 -30
- package/dist/agents/renderers/claude-renderer.js +1 -82
- package/dist/agents/renderers/index.js +1 -14
- package/dist/agents/renderers/json-renderer.js +1 -104
- package/dist/agents/renderers/opencode-renderer.js +1 -113
- package/dist/agents/renderers/provider-adapter.js +1 -6
- package/dist/agents/repositories/agent-seed-history.js +1 -128
- package/dist/agents/repositories/agents.js +1 -200
- package/dist/agents/repositories/manager-profile-overlays.js +1 -90
- package/dist/agents/schema.js +1 -1
- package/dist/application/agents/agent-activation-service.js +261 -0
- package/dist/application/agents/agent-lookup-contexts.js +28 -0
- package/dist/application/agents/agent-registry-service.js +81 -0
- package/dist/application/agents/agent-resolver.js +287 -0
- package/dist/application/agents/agent-seed-service.js +157 -0
- package/dist/application/agents/agent-seed-upgrade-service.js +231 -0
- package/dist/application/agents/agent-selector-resolver.js +28 -0
- package/dist/application/agents/boot-upgrade.js +59 -0
- package/dist/application/agents/canonical-agent-projection.js +236 -0
- package/dist/application/agents/manager-profile-overlay-service.js +68 -0
- package/dist/application/agents/profile-model-routing.js +30 -0
- package/dist/application/agents/renderers/claude-renderer.js +1 -0
- package/dist/application/agents/renderers/index.js +14 -0
- package/dist/application/agents/renderers/json-renderer.js +1 -0
- package/dist/application/agents/renderers/opencode-renderer.js +1 -0
- package/dist/application/agents/renderers/provider-adapter.js +1 -0
- package/dist/application/memory/active-work-preview.js +75 -0
- package/dist/application/memory/agent-memory-capture-service.js +498 -0
- package/dist/application/memory/import/dry-run-planner.js +58 -0
- package/dist/application/memory/import/index.js +3 -0
- package/dist/application/memory/import/observation-writer.js +226 -0
- package/dist/application/memory/import/package.js +179 -0
- package/dist/application/memory/memory-service.js +202 -0
- package/dist/application/memory/search.js +11 -0
- package/dist/{mcp → application/provider-setup}/provider-change-plan.js +74 -13
- package/dist/{mcp → application/provider-setup}/provider-doctor.js +201 -31
- package/dist/{mcp → application/provider-setup}/provider-health-types.js +1 -1
- package/dist/{mcp → application/provider-setup}/provider-status.js +170 -33
- package/dist/application/runs/execution-planning.js +180 -0
- package/dist/application/runs/operation-execution.js +1 -0
- package/dist/application/runs/operation-retry.js +129 -0
- package/dist/application/runs/resume-after-approval-result.js +88 -0
- package/dist/application/runs/run-insights.js +270 -0
- package/dist/application/runs/run-service.js +1480 -0
- package/dist/application/runs/run-snapshot-export-service.js +31 -0
- package/dist/application/runs/sandbox-process-execution.js +244 -0
- package/dist/application/runs/sandbox-worktree-planning.js +59 -0
- package/dist/application/runs/task-scoped-command-grant-service.js +224 -0
- package/dist/application/sdd/artifact-portability-service.js +137 -0
- package/dist/application/sdd/cockpit-read-model.js +195 -0
- package/dist/application/sdd/sdd-continuation-plan.js +265 -0
- package/dist/application/sdd/sdd-workflow-service.js +892 -0
- package/dist/application/skills/boot-seed.js +42 -0
- package/dist/application/skills/personal-skills.js +41 -0
- package/dist/application/skills/skill-export-service.js +34 -0
- package/dist/application/skills/skill-index-service.js +126 -0
- package/dist/application/skills/skill-payload.js +186 -0
- package/dist/application/skills/skill-registry-service.js +648 -0
- package/dist/application/skills/skill-resolver.js +368 -0
- package/dist/application/skills/skill-seed-service.js +242 -0
- package/dist/application/skills/skill-status-service.js +147 -0
- package/dist/cli/bun-bin.js +0 -0
- package/dist/cli/cli-flags.js +1 -387
- package/dist/cli/cli-help.js +1 -173
- package/dist/cli/cli-helpers.js +1 -77
- package/dist/cli/cli-types.js +1 -1
- package/dist/cli/commands/agent-skill-dispatcher.js +1 -700
- package/dist/cli/commands/index.js +1 -9
- package/dist/cli/commands/interactive-entrypoint-dispatcher.js +1 -14
- package/dist/cli/commands/mcp-dispatcher.js +1 -232
- package/dist/cli/commands/memory-sdd-dispatcher.js +1 -367
- package/dist/cli/commands/run-permission-dispatcher.js +1 -455
- package/dist/cli/commands/setup-dispatcher.js +1 -496
- package/dist/cli/commands/status-dispatcher.js +1 -130
- package/dist/cli/commands/verification-dispatcher.js +1 -47
- package/dist/cli/commands/workflow-dispatcher.js +1 -566
- package/dist/cli/dispatcher.js +1 -247
- package/dist/cli/doctor-renderer.js +1 -26
- package/dist/cli/home-tui-app.js +1 -411
- package/dist/cli/home-tui-controller.js +1 -314
- package/dist/cli/mcp-start-path.js +1 -21
- package/dist/cli/product-resume-renderer.js +1 -32
- package/dist/cli/product-status-renderer.js +1 -81
- package/dist/cli/sdd-renderer.js +1 -247
- package/dist/cli/setup-plan-renderer.js +1 -79
- package/dist/cli/setup-status-renderer.js +1 -50
- package/dist/cli/setup-tui-app.js +1 -130
- package/dist/cli/setup-tui-controller.js +1 -89
- package/dist/cli/tui/focus-reducer.js +1 -0
- package/dist/cli/tui/focus-types.js +1 -0
- package/dist/cli/tui/ink/app-shell.js +1 -0
- package/dist/cli/tui/ink/components.js +1 -38
- package/dist/cli/tui/ink/help-overlay.js +1 -0
- package/dist/cli/tui/ink/state-components.js +1 -0
- package/dist/cli/tui/ink/theme.js +1 -36
- package/dist/cli/tui/key-intents.js +1 -0
- package/dist/cli/tui/keymap.js +1 -20
- package/dist/cli/tui/navigation.js +1 -10
- package/dist/cli/tui/screen-registry.js +1 -0
- package/dist/cli/tui/terminal-capabilities.js +1 -12
- package/dist/cli/tui/tui-types.js +1 -1
- package/dist/cli/tui/visual/badges.js +1 -19
- package/dist/cli/tui/visual/footer.js +1 -27
- package/dist/cli/tui/visual/index.js +1 -3
- package/dist/cli/tui/visual/viewport.js +1 -11
- package/dist/cli/tui-render-helpers.js +1 -200
- package/dist/cli/verification-plan-renderer.js +1 -25
- package/dist/cli/verification-report-renderer.js +1 -19
- package/dist/domain/agents/canonical-agent-manifest.js +364 -0
- package/dist/domain/agents/schema.js +1 -0
- package/dist/domain/memory/active-work-topics.js +64 -0
- package/dist/domain/memory/memory-capture-schema.js +1 -0
- package/dist/domain/memory/schema.js +1 -0
- package/dist/domain/runs/schema.js +5 -0
- package/dist/domain/sdd/cockpit-types.js +1 -0
- package/dist/domain/sdd/schema.js +111 -0
- package/dist/domain/skills/schema.js +1 -0
- package/dist/interfaces/cli/bun-bin.js +46 -0
- package/dist/interfaces/cli/cli-flags.js +391 -0
- package/dist/interfaces/cli/cli-help.js +173 -0
- package/dist/interfaces/cli/cli-helpers.js +77 -0
- package/dist/interfaces/cli/cli-types.js +1 -0
- package/dist/interfaces/cli/commands/agent-skill-dispatcher.js +700 -0
- package/dist/interfaces/cli/commands/index.js +9 -0
- package/dist/interfaces/cli/commands/interactive-entrypoint-dispatcher.js +14 -0
- package/dist/interfaces/cli/commands/mcp-dispatcher.js +252 -0
- package/dist/interfaces/cli/commands/memory-sdd-dispatcher.js +367 -0
- package/dist/interfaces/cli/commands/run-permission-dispatcher.js +460 -0
- package/dist/interfaces/cli/commands/setup-dispatcher.js +496 -0
- package/dist/interfaces/cli/commands/status-dispatcher.js +130 -0
- package/dist/interfaces/cli/commands/verification-dispatcher.js +47 -0
- package/dist/interfaces/cli/commands/workflow-dispatcher.js +566 -0
- package/dist/interfaces/cli/dispatcher.js +247 -0
- package/dist/interfaces/cli/doctor-renderer.js +26 -0
- package/dist/interfaces/cli/home-tui-app.js +462 -0
- package/dist/interfaces/cli/home-tui-controller.js +341 -0
- package/dist/interfaces/cli/index.js +27 -0
- package/dist/interfaces/cli/mcp-start-path.js +21 -0
- package/dist/interfaces/cli/product-resume-renderer.js +32 -0
- package/dist/interfaces/cli/product-status-renderer.js +81 -0
- package/dist/interfaces/cli/sdd-renderer.js +247 -0
- package/dist/interfaces/cli/setup-plan-renderer.js +79 -0
- package/dist/interfaces/cli/setup-status-renderer.js +50 -0
- package/dist/interfaces/cli/setup-tui-app.js +135 -0
- package/dist/interfaces/cli/setup-tui-controller.js +89 -0
- package/dist/interfaces/cli/tui/focus-reducer.js +60 -0
- package/dist/interfaces/cli/tui/focus-types.js +10 -0
- package/dist/interfaces/cli/tui/ink/app-shell.js +16 -0
- package/dist/interfaces/cli/tui/ink/components.js +38 -0
- package/dist/interfaces/cli/tui/ink/help-overlay.js +6 -0
- package/dist/interfaces/cli/tui/ink/state-components.js +22 -0
- package/dist/interfaces/cli/tui/ink/theme.js +36 -0
- package/dist/interfaces/cli/tui/key-intents.js +33 -0
- package/dist/interfaces/cli/tui/keymap.js +20 -0
- package/dist/interfaces/cli/tui/navigation.js +10 -0
- package/dist/interfaces/cli/tui/screen-registry.js +43 -0
- package/dist/interfaces/cli/tui/terminal-capabilities.js +12 -0
- package/dist/interfaces/cli/tui/tui-types.js +1 -0
- package/dist/interfaces/cli/tui/visual/badges.js +19 -0
- package/dist/interfaces/cli/tui/visual/footer.js +27 -0
- package/dist/interfaces/cli/tui/visual/index.js +3 -0
- package/dist/interfaces/cli/tui/visual/viewport.js +11 -0
- package/dist/interfaces/cli/tui-render-helpers.js +200 -0
- package/dist/interfaces/cli/verification-plan-renderer.js +25 -0
- package/dist/interfaces/cli/verification-report-renderer.js +19 -0
- package/dist/interfaces/mcp/contracts/agents.js +1 -0
- package/dist/interfaces/mcp/contracts/context.js +1 -0
- package/dist/interfaces/mcp/contracts/governance.js +1 -0
- package/dist/interfaces/mcp/contracts/index.js +1 -0
- package/dist/interfaces/mcp/contracts/memory.js +1 -0
- package/dist/interfaces/mcp/contracts/providers.js +1 -0
- package/dist/interfaces/mcp/contracts/runs.js +1 -0
- package/dist/interfaces/mcp/contracts/sdd.js +1 -0
- package/dist/interfaces/mcp/contracts/sessions.js +1 -0
- package/dist/interfaces/mcp/contracts/skills.js +1 -0
- package/dist/interfaces/mcp/contracts/verification.js +1 -0
- package/dist/interfaces/mcp/control-plane/handlers/agents.js +38 -0
- package/dist/interfaces/mcp/control-plane/handlers/context.js +12 -0
- package/dist/interfaces/mcp/control-plane/handlers/memory.js +95 -0
- package/dist/interfaces/mcp/control-plane/handlers/providers.js +19 -0
- package/dist/interfaces/mcp/control-plane/handlers/runs.js +134 -0
- package/dist/interfaces/mcp/control-plane/handlers/sdd.js +225 -0
- package/dist/interfaces/mcp/control-plane/handlers/sessions.js +39 -0
- package/dist/interfaces/mcp/control-plane/handlers/skills.js +82 -0
- package/dist/interfaces/mcp/control-plane/handlers/verification.js +11 -0
- package/dist/interfaces/mcp/control-plane/types.js +1 -0
- package/dist/interfaces/mcp/control-plane.js +235 -0
- package/dist/interfaces/mcp/schema.js +174 -0
- package/dist/interfaces/mcp/schemas/common.js +121 -0
- package/dist/interfaces/mcp/schemas/inputs/agents.js +69 -0
- package/dist/interfaces/mcp/schemas/inputs/context.js +32 -0
- package/dist/interfaces/mcp/schemas/inputs/governance.js +23 -0
- package/dist/interfaces/mcp/schemas/inputs/index.js +10 -0
- package/dist/interfaces/mcp/schemas/inputs/memory.js +50 -0
- package/dist/interfaces/mcp/schemas/inputs/providers.js +35 -0
- package/dist/interfaces/mcp/schemas/inputs/runs.js +146 -0
- package/dist/interfaces/mcp/schemas/inputs/sdd.js +102 -0
- package/dist/interfaces/mcp/schemas/inputs/sessions.js +32 -0
- package/dist/interfaces/mcp/schemas/inputs/skills.js +231 -0
- package/dist/interfaces/mcp/schemas/inputs/verification.js +9 -0
- package/dist/interfaces/mcp/schemas/outputs/index.js +2 -0
- package/dist/interfaces/mcp/schemas/outputs/providers.js +28 -0
- package/dist/interfaces/mcp/schemas/outputs/sdd.js +166 -0
- package/dist/interfaces/mcp/stdio-server.js +116 -0
- package/dist/interfaces/mcp/validation/agents.js +189 -0
- package/dist/interfaces/mcp/validation/common.js +415 -0
- package/dist/interfaces/mcp/validation/governance.js +50 -0
- package/dist/interfaces/mcp/validation/memory.js +133 -0
- package/dist/interfaces/mcp/validation/providers.js +94 -0
- package/dist/interfaces/mcp/validation/runs.js +514 -0
- package/dist/interfaces/mcp/validation/sdd.js +247 -0
- package/dist/interfaces/mcp/validation/sessions.js +51 -0
- package/dist/interfaces/mcp/validation/skills.js +685 -0
- package/dist/interfaces/mcp/validation/verification.js +24 -0
- package/dist/interfaces/mcp/validation.js +149 -0
- package/dist/mcp/control-plane-snapshot-service.js +65 -2
- package/dist/mcp/control-plane.js +1 -646
- package/dist/mcp/doctor.js +1 -1
- package/dist/mcp/index.js +17 -17
- package/dist/mcp/schema.js +1 -1132
- package/dist/mcp/stdio-server.js +1 -116
- package/dist/mcp/validation.js +1 -2383
- package/dist/memory/active-work-preview.js +1 -75
- package/dist/memory/active-work-topics.js +1 -64
- package/dist/memory/agent-memory-capture-service.js +1 -497
- package/dist/memory/import/dry-run-planner.js +1 -58
- package/dist/memory/import/index.js +1 -3
- package/dist/memory/import/observation-writer.js +1 -226
- package/dist/memory/import/package.js +1 -179
- package/dist/memory/memory-capture-schema.js +1 -1
- package/dist/memory/memory-service.js +1 -201
- package/dist/memory/repositories/artifacts.js +1 -67
- package/dist/memory/repositories/observations.js +1 -217
- package/dist/memory/repositories/sessions.js +1 -125
- package/dist/memory/repositories/traces.js +1 -78
- package/dist/memory/schema.js +1 -1
- package/dist/memory/search.js +1 -11
- package/dist/memory/sqlite/database.js +1 -228
- package/dist/memory/storage-paths.js +1 -72
- package/dist/payload/context-budget-policy.js +10 -0
- package/dist/payload/context-budget-service.js +26 -0
- package/dist/payload/payload-diagnostics.js +50 -0
- package/dist/permissions/policy-evaluator.js +12 -5
- package/dist/runs/execution-planning.js +1 -178
- package/dist/runs/operation-execution.js +1 -1
- package/dist/runs/operation-retry.js +1 -129
- package/dist/runs/repositories/runs.js +1 -676
- package/dist/runs/repositories/task-scoped-command-grants.js +1 -462
- package/dist/runs/resume-after-approval-result.js +1 -84
- package/dist/runs/run-insights.js +1 -270
- package/dist/runs/run-service.js +1 -1470
- package/dist/runs/run-snapshot-export-service.js +1 -31
- package/dist/runs/sandbox-process-execution.js +1 -240
- package/dist/runs/sandbox-worktree-planning.js +1 -59
- package/dist/runs/schema.js +1 -5
- package/dist/runs/task-scoped-command-grant-service.js +1 -217
- package/dist/sdd/artifact-portability-service.js +1 -137
- package/dist/sdd/cockpit-read-model.js +1 -195
- package/dist/sdd/cockpit-types.js +1 -1
- package/dist/sdd/schema.js +1 -111
- package/dist/sdd/sdd-continuation-plan.js +1 -265
- package/dist/sdd/sdd-workflow-service.js +1 -822
- package/dist/setup/providers/claude-setup-adapter.js +11 -4
- package/dist/setup/providers/opencode-setup-adapter.js +10 -7
- package/dist/setup/setup-plan.js +20 -7
- package/dist/skills/boot-seed.js +1 -42
- package/dist/skills/personal-skills.js +1 -41
- package/dist/skills/repositories/skill-evaluation-requests.js +1 -190
- package/dist/skills/repositories/skill-evaluation-scenarios.js +1 -305
- package/dist/skills/repositories/skill-improvement-proposals.js +1 -355
- package/dist/skills/repositories/skills.js +1 -1077
- package/dist/skills/schema.js +1 -1
- package/dist/skills/skill-export-service.js +1 -34
- package/dist/skills/skill-index-service.js +1 -126
- package/dist/skills/skill-payload.js +1 -186
- package/dist/skills/skill-registry-service.js +1 -644
- package/dist/skills/skill-resolver.js +1 -368
- package/dist/skills/skill-seed-service.js +1 -242
- package/dist/skills/skill-status-service.js +1 -147
- package/dist/storage/agents/repositories/agent-seed-history.js +128 -0
- package/dist/storage/agents/repositories/agents.js +200 -0
- package/dist/storage/agents/repositories/manager-profile-overlays.js +90 -0
- package/dist/storage/memory/repositories/artifacts.js +67 -0
- package/dist/storage/memory/repositories/observations.js +217 -0
- package/dist/storage/memory/repositories/sessions.js +125 -0
- package/dist/storage/memory/repositories/traces.js +78 -0
- package/dist/storage/memory/sqlite/database.js +228 -0
- package/dist/storage/memory/storage-paths.js +72 -0
- package/dist/storage/runs/repositories/runs.js +676 -0
- package/dist/storage/runs/repositories/task-scoped-command-grants.js +464 -0
- package/dist/storage/skills/repositories/skill-evaluation-requests.js +190 -0
- package/dist/storage/skills/repositories/skill-evaluation-scenarios.js +305 -0
- package/dist/storage/skills/repositories/skill-improvement-proposals.js +355 -0
- package/dist/storage/skills/repositories/skills.js +1084 -0
- package/docs/architecture.md +2 -2
- package/docs/glossary.md +1 -1
- package/docs/mcp.md +1 -1
- package/docs/module-boundaries.md +114 -0
- package/docs/prd.md +1 -1
- package/docs/project-health-audit-v1.10.x.md +1 -1
- package/docs/providers.md +2 -2
- package/docs/safety.md +3 -3
- package/docs/sdd/archive/2026-06-26-ambitious-structure-reorganization/apply-progress.md +122 -0
- package/docs/sdd/archive/2026-06-26-ambitious-structure-reorganization/archive-report.md +61 -0
- package/docs/sdd/archive/2026-06-26-ambitious-structure-reorganization/design.md +66 -0
- package/docs/sdd/archive/2026-06-26-ambitious-structure-reorganization/proposal.md +79 -0
- package/docs/sdd/archive/2026-06-26-ambitious-structure-reorganization/spec.md +67 -0
- package/docs/sdd/archive/2026-06-26-ambitious-structure-reorganization/tasks.md +63 -0
- package/docs/sdd/archive/2026-06-26-ambitious-structure-reorganization/verify-report.md +71 -0
- package/docs/sdd/archive/2026-06-26-legacy-facade-cleanup/apply-progress.md +68 -0
- package/docs/sdd/archive/2026-06-26-legacy-facade-cleanup/archive-report.md +61 -0
- package/docs/sdd/archive/2026-06-26-legacy-facade-cleanup/design.md +43 -0
- package/docs/sdd/archive/2026-06-26-legacy-facade-cleanup/proposal.md +61 -0
- package/docs/sdd/archive/2026-06-26-legacy-facade-cleanup/spec.md +31 -0
- package/docs/sdd/archive/2026-06-26-legacy-facade-cleanup/tasks.md +27 -0
- package/docs/sdd/archive/2026-06-26-legacy-facade-cleanup/verify-report.md +58 -0
- package/docs/sdd/archive/2026-06-26-provider-install-adapter-boundary/apply-progress.md +65 -0
- package/docs/sdd/archive/2026-06-26-provider-install-adapter-boundary/archive-report.md +53 -0
- package/docs/sdd/archive/2026-06-26-provider-install-adapter-boundary/design.md +64 -0
- package/docs/sdd/archive/2026-06-26-provider-install-adapter-boundary/proposal.md +62 -0
- package/docs/sdd/archive/2026-06-26-provider-install-adapter-boundary/spec.md +51 -0
- package/docs/sdd/archive/2026-06-26-provider-install-adapter-boundary/tasks.md +50 -0
- package/docs/sdd/archive/2026-06-26-provider-install-adapter-boundary/verify-report.md +66 -0
- package/docs/sdd/manager-prompt-autonomy/apply-progress.md +28 -0
- package/docs/sdd/manager-prompt-autonomy/design.md +63 -0
- package/docs/sdd/manager-prompt-autonomy/proposal.md +57 -0
- package/docs/sdd/manager-prompt-autonomy/tasks.md +19 -0
- package/docs/storage.md +2 -2
- package/package.json +2 -2
- /package/dist/{mcp → adapters/claude/install}/claude-code-cli.js +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/001_initial.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/002_observation_revisions.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/003_agent_registry.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/004_run_runtime.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/005_run_approvals.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/006_run_operation_attempts.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/007_abandoned_operation_attempts.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/008_run_execution_plan_events.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/009_multiple_operation_attempts.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/010_skill_registry.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/011_skill_usage_resolution_outcomes.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/012_skill_improvement_proposals.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/013_skill_evaluation_scenarios.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/014_manager_profile_overlays.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/015_artifact_metadata.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/016_agent_seed_history.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/017_intent_signal_skill_targets.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/018_skill_system_v2.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/019_task_scoped_command_grants.sql +0 -0
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import { dirname } from 'node:path';
|
|
3
|
-
import { createManagedProviderConfigBackup } from '
|
|
3
|
+
import { createManagedProviderConfigBackup } from '../../../setup/backup-rollback-service.js';
|
|
4
4
|
import { parseClaudeAgentFrontmatter } from './claude-code-agent-config.js';
|
|
5
5
|
import { runClaudeCodeCliCommand } from './claude-code-cli.js';
|
|
6
6
|
import { createClaudeCodeMcpServerConfig, inspectClaudeCodeMcpConfig, mergeClaudeCodeMcpConfig } from './claude-code-config.js';
|
|
7
7
|
import { inspectClaudeProjectMemory, mergeClaudeProjectMemory } from './claude-code-project-memory.js';
|
|
8
|
-
import { expectedClaudeCodeRenderedAgents, expectedClaudeCodeRenderedUserAgents, planClaudeCodeMcpInstall } from './client-install-claude-code-contract.js';
|
|
9
8
|
import { inspectClaudeCodeUserMcpConfig, mergeClaudeCodeUserMcpConfig } from './claude-code-user-config.js';
|
|
10
9
|
import { inspectClaudeUserMemory, mergeClaudeUserMemory } from './claude-code-user-memory.js';
|
|
10
|
+
import { expectedClaudeCodeRenderedAgents, expectedClaudeCodeRenderedUserAgents, planClaudeCodeMcpInstall, } from './client-install-claude-code-contract.js';
|
|
11
11
|
export async function installClaudeCodeMcpClient(input) {
|
|
12
12
|
const source = input.databasePathSource ?? 'flag';
|
|
13
13
|
const server = createClaudeCodeMcpServerConfig(input.databasePath, source);
|
|
14
|
-
const plan = planClaudeCodeMcpInstall({
|
|
14
|
+
const plan = planClaudeCodeMcpInstall({
|
|
15
|
+
cwd: input.cwd,
|
|
16
|
+
databasePath: input.databasePath,
|
|
17
|
+
databasePathSource: source,
|
|
18
|
+
...(input.overwriteVgxness !== undefined ? { overwriteVgxness: input.overwriteVgxness } : {}),
|
|
19
|
+
...(input.scope !== undefined ? { scope: input.scope } : {}),
|
|
20
|
+
...(input.env !== undefined ? { env: input.env } : {}),
|
|
21
|
+
});
|
|
15
22
|
if (plan.status === 'refused')
|
|
16
23
|
return refusal(plan.reason, plan.message, plan, server, [], []);
|
|
17
24
|
if (!input.confirmed)
|
|
@@ -45,7 +52,21 @@ export async function installClaudeCodeMcpClient(input) {
|
|
|
45
52
|
const cliResult = { exitCode: cli.exitCode, stdout: cli.stdout, stderr: cli.stderr, preview: cli.command.preview };
|
|
46
53
|
if (cli.exitCode !== 0)
|
|
47
54
|
return refusal('preflight_failed', `Claude CLI MCP registration failed with exit code ${cli.exitCode ?? 'unknown'}.`, plan, server, [], [], cliResult);
|
|
48
|
-
return {
|
|
55
|
+
return {
|
|
56
|
+
version: 1,
|
|
57
|
+
kind: 'mcp-client-install-claude-code',
|
|
58
|
+
status: 'installed',
|
|
59
|
+
targetPath: plan.targetPath,
|
|
60
|
+
writtenPaths: [],
|
|
61
|
+
backups: [],
|
|
62
|
+
safety: applySafety(plan),
|
|
63
|
+
server,
|
|
64
|
+
warnings: plan.warnings,
|
|
65
|
+
verificationHints: plan.verificationHints,
|
|
66
|
+
agentNames: plan.agentNames,
|
|
67
|
+
overwriteVgxness: plan.overwriteVgxness,
|
|
68
|
+
cliResult,
|
|
69
|
+
};
|
|
49
70
|
}
|
|
50
71
|
if (plan.canonicalClaudeScope === 'user')
|
|
51
72
|
return applyUserInstall(input, plan, server, writtenPaths, backups);
|
|
@@ -76,7 +97,20 @@ export async function installClaudeCodeMcpClient(input) {
|
|
|
76
97
|
return refusal('post_write_validation_failed', projectMemoryWrite.error.message, plan, server, writtenPaths, backups);
|
|
77
98
|
if (projectMemoryWrite.value !== undefined)
|
|
78
99
|
writtenPaths.push(projectMemoryWrite.value);
|
|
79
|
-
return {
|
|
100
|
+
return {
|
|
101
|
+
version: 1,
|
|
102
|
+
kind: 'mcp-client-install-claude-code',
|
|
103
|
+
status: 'installed',
|
|
104
|
+
targetPath: plan.targetPath,
|
|
105
|
+
writtenPaths,
|
|
106
|
+
backups,
|
|
107
|
+
safety: applySafety(plan),
|
|
108
|
+
server,
|
|
109
|
+
warnings: plan.warnings,
|
|
110
|
+
verificationHints: plan.verificationHints,
|
|
111
|
+
agentNames: plan.agentNames,
|
|
112
|
+
overwriteVgxness: plan.overwriteVgxness,
|
|
113
|
+
};
|
|
80
114
|
}
|
|
81
115
|
function writeMcpJson(cwd, plan, server) {
|
|
82
116
|
const state = inspectClaudeCodeMcpConfig(cwd);
|
|
@@ -88,7 +122,9 @@ function writeMcpJson(cwd, plan, server) {
|
|
|
88
122
|
mkdirSync(dirname(plan.targetPath), { recursive: true });
|
|
89
123
|
writeFileSync(plan.targetPath, `${JSON.stringify(merged, null, 2)}\n`);
|
|
90
124
|
const after = inspectClaudeCodeMcpConfig(cwd);
|
|
91
|
-
return after.status === 'configured'
|
|
125
|
+
return after.status === 'configured'
|
|
126
|
+
? { ok: true, value: plan.targetPath }
|
|
127
|
+
: { ok: false, error: { code: 'validation_failed', message: 'Claude .mcp.json did not validate after write.' } };
|
|
92
128
|
}
|
|
93
129
|
function writeUserMcpJson(env, plan, server) {
|
|
94
130
|
const target = plan.targets.find((item) => item.kind === 'user-mcp-json');
|
|
@@ -107,7 +143,9 @@ function writeUserMcpJson(env, plan, server) {
|
|
|
107
143
|
mkdirSync(dirname(target.path), { recursive: true });
|
|
108
144
|
writeFileSync(target.path, `${JSON.stringify(merged, null, 2)}\n`);
|
|
109
145
|
const after = inspectClaudeCodeUserMcpConfig(env);
|
|
110
|
-
return after.status === 'configured'
|
|
146
|
+
return after.status === 'configured'
|
|
147
|
+
? { ok: true, value: target.path }
|
|
148
|
+
: { ok: false, error: { code: 'validation_failed', message: 'Claude user ~/.claude.json did not validate after write.' } };
|
|
111
149
|
}
|
|
112
150
|
function writeProjectMemory(plan) {
|
|
113
151
|
const target = plan.targets.find((item) => item.kind === 'project-memory');
|
|
@@ -124,10 +162,13 @@ function writeProjectMemory(plan) {
|
|
|
124
162
|
mkdirSync(dirname(target.path), { recursive: true });
|
|
125
163
|
writeFileSync(target.path, merged.value.contents);
|
|
126
164
|
const after = inspectClaudeProjectMemory(dirname(target.path));
|
|
127
|
-
return after.status === 'managed-current'
|
|
165
|
+
return after.status === 'managed-current'
|
|
166
|
+
? { ok: true, value: target.path }
|
|
167
|
+
: { ok: false, error: { code: 'validation_failed', message: 'Claude project memory did not validate as managed-current after write.' } };
|
|
128
168
|
}
|
|
129
169
|
async function applyUserInstall(input, plan, server, writtenPaths, backups) {
|
|
130
|
-
const existingTargets = plan.targets.filter((target) => target.kind !== 'cli-mcp-registration' &&
|
|
170
|
+
const existingTargets = plan.targets.filter((target) => target.kind !== 'cli-mcp-registration' &&
|
|
171
|
+
(target.action === 'merge' || target.action === 'update-vgxness' || target.action === 'append-managed-block' || target.action === 'update-managed-block'));
|
|
131
172
|
for (const target of existingTargets) {
|
|
132
173
|
const backup = createBackup(target.path, target.kind === 'user-memory' ? 'user-memory' : 'config', 'user', input.env?.HOME);
|
|
133
174
|
if (!backup.ok)
|
|
@@ -154,7 +195,20 @@ async function applyUserInstall(input, plan, server, writtenPaths, backups) {
|
|
|
154
195
|
return refusal('post_write_validation_failed', memoryWrite.error.message, plan, server, writtenPaths, backups);
|
|
155
196
|
if (memoryWrite.value !== undefined)
|
|
156
197
|
writtenPaths.push(memoryWrite.value);
|
|
157
|
-
return {
|
|
198
|
+
return {
|
|
199
|
+
version: 1,
|
|
200
|
+
kind: 'mcp-client-install-claude-code',
|
|
201
|
+
status: 'installed',
|
|
202
|
+
targetPath: plan.targetPath,
|
|
203
|
+
writtenPaths,
|
|
204
|
+
backups,
|
|
205
|
+
safety: applySafety(plan),
|
|
206
|
+
server,
|
|
207
|
+
warnings: plan.warnings,
|
|
208
|
+
verificationHints: plan.verificationHints,
|
|
209
|
+
agentNames: plan.agentNames,
|
|
210
|
+
overwriteVgxness: plan.overwriteVgxness,
|
|
211
|
+
};
|
|
158
212
|
}
|
|
159
213
|
function writeUserMemory(env, plan) {
|
|
160
214
|
const target = plan.targets.find((item) => item.kind === 'user-memory');
|
|
@@ -171,7 +225,9 @@ function writeUserMemory(env, plan) {
|
|
|
171
225
|
mkdirSync(dirname(target.path), { recursive: true });
|
|
172
226
|
writeFileSync(target.path, merged.value.contents);
|
|
173
227
|
const after = inspectClaudeUserMemory(env);
|
|
174
|
-
return after.status === 'managed-current'
|
|
228
|
+
return after.status === 'managed-current'
|
|
229
|
+
? { ok: true, value: target.path }
|
|
230
|
+
: { ok: false, error: { code: 'validation_failed', message: 'Claude user memory did not validate as managed-current after write.' } };
|
|
175
231
|
}
|
|
176
232
|
function createBackup(path, kind, scope = 'project', allowedManagedHome) {
|
|
177
233
|
return createManagedProviderConfigBackup({
|
|
@@ -180,18 +236,46 @@ function createBackup(path, kind, scope = 'project', allowedManagedHome) {
|
|
|
180
236
|
scope,
|
|
181
237
|
createdByOperation: 'mcp-client-install-claude-code',
|
|
182
238
|
reason: kind === 'project-memory' ? 'pre-project-memory-update-safety' : kind === 'user-memory' ? 'pre-user-memory-update-safety' : 'pre-merge-safety',
|
|
183
|
-
description: kind === 'project-memory'
|
|
239
|
+
description: kind === 'project-memory'
|
|
240
|
+
? 'Backup existing Claude Code project memory before appending or updating the VGXNESS managed block.'
|
|
241
|
+
: kind === 'user-memory'
|
|
242
|
+
? 'Backup existing Claude Code user memory before appending or updating the VGXNESS managed block.'
|
|
243
|
+
: 'Backup existing Claude Code config before merging VGXNESS MCP or agent configuration.',
|
|
184
244
|
...(allowedManagedHome !== undefined ? { allowedManagedHome } : {}),
|
|
185
245
|
});
|
|
186
246
|
}
|
|
187
247
|
function refusal(reason, message, plan, server, writtenPaths, backups, cliResult) {
|
|
188
|
-
return {
|
|
248
|
+
return {
|
|
249
|
+
version: 1,
|
|
250
|
+
kind: 'mcp-client-install-claude-code',
|
|
251
|
+
status: 'refused',
|
|
252
|
+
reason,
|
|
253
|
+
message,
|
|
254
|
+
targetPath: plan.targetPath,
|
|
255
|
+
writtenPaths,
|
|
256
|
+
backups,
|
|
257
|
+
safety: { ...plan.safety, operation: 'apply', mutating: false, writesProviderConfig: false },
|
|
258
|
+
server,
|
|
259
|
+
warnings: plan.warnings,
|
|
260
|
+
verificationHints: plan.verificationHints,
|
|
261
|
+
agentNames: plan.agentNames,
|
|
262
|
+
overwriteVgxness: plan.overwriteVgxness,
|
|
263
|
+
...(cliResult === undefined ? {} : { cliResult }),
|
|
264
|
+
};
|
|
189
265
|
}
|
|
190
266
|
function applySafety(plan) {
|
|
191
267
|
return { ...plan.safety, operation: 'apply', mutating: true, writesProviderConfig: true };
|
|
192
268
|
}
|
|
193
269
|
function toBackupSummary(backup) {
|
|
194
|
-
return {
|
|
270
|
+
return {
|
|
271
|
+
kind: 'managed',
|
|
272
|
+
backupId: backup.backupId,
|
|
273
|
+
backupPath: backup.backupPath,
|
|
274
|
+
metadataPath: backup.metadataPath,
|
|
275
|
+
scope: backup.scope,
|
|
276
|
+
byteSize: backup.byteSize,
|
|
277
|
+
contentHash: backup.contentHash,
|
|
278
|
+
};
|
|
195
279
|
}
|
|
196
280
|
function unique(values) {
|
|
197
281
|
return [...new Set(values)];
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { ok, validationFailure, } from '../provider-renderer.js';
|
|
2
|
+
const previewSafety = {
|
|
3
|
+
executesProvider: false,
|
|
4
|
+
writesProviderConfig: false,
|
|
5
|
+
installable: false,
|
|
6
|
+
previewOnly: true,
|
|
7
|
+
};
|
|
8
|
+
const jsonCapabilities = {
|
|
9
|
+
supportedAgentFields: [
|
|
10
|
+
'id',
|
|
11
|
+
'project',
|
|
12
|
+
'scope',
|
|
13
|
+
'mode',
|
|
14
|
+
'name',
|
|
15
|
+
'description',
|
|
16
|
+
'instructions',
|
|
17
|
+
'capabilities',
|
|
18
|
+
'permissions',
|
|
19
|
+
'memory',
|
|
20
|
+
'workflows',
|
|
21
|
+
'skills',
|
|
22
|
+
'adapters',
|
|
23
|
+
'timestamps',
|
|
24
|
+
'parentAgentId',
|
|
25
|
+
],
|
|
26
|
+
skillInjectionModes: ['preserved as registry metadata in neutral export'],
|
|
27
|
+
permissionCategories: ['preserved registry permission policy metadata'],
|
|
28
|
+
memoryInjectionModes: ['preserved registry memory scope metadata'],
|
|
29
|
+
delegationModel: 'preserves registry agent/subagent relationships without provider delegation execution',
|
|
30
|
+
lifecycleHooks: ['preview render/export only'],
|
|
31
|
+
configFileLocations: [],
|
|
32
|
+
limitations: [
|
|
33
|
+
'Generic debug/export output; it is not executable provider configuration.',
|
|
34
|
+
'Does not execute providers or run lifecycle hooks.',
|
|
35
|
+
'Does not install provider tooling.',
|
|
36
|
+
'Does not write provider configuration files.',
|
|
37
|
+
],
|
|
38
|
+
render: {
|
|
39
|
+
format: 'neutral-json-export',
|
|
40
|
+
artifactContentTypes: ['application/json'],
|
|
41
|
+
installable: false,
|
|
42
|
+
previewOnly: true,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
export class JsonAgentRenderer {
|
|
46
|
+
provider = 'json';
|
|
47
|
+
capabilities = jsonCapabilities;
|
|
48
|
+
render(input) {
|
|
49
|
+
const subagents = input.subagents ?? [];
|
|
50
|
+
const basePath = `rendered/json/${pathSegment(input.agent.project)}/${input.agent.scope}/${pathSegment(input.agent.name)}`;
|
|
51
|
+
const artifacts = [
|
|
52
|
+
jsonArtifact(`${basePath}.agent.json`, renderedDefinition(input.agent, this.provider)),
|
|
53
|
+
jsonArtifact(`${basePath}.manifest.json`, {
|
|
54
|
+
provider: this.provider,
|
|
55
|
+
installable: false,
|
|
56
|
+
safety: previewSafety,
|
|
57
|
+
rootAgentId: input.agent.id,
|
|
58
|
+
rootAgentName: input.agent.name,
|
|
59
|
+
subagentIds: subagents.map((subagent) => subagent.id),
|
|
60
|
+
artifacts: [`${basePath}.agent.json`, ...subagents.map((subagent) => `${basePath}.subagents/${pathSegment(subagent.name)}.json`)],
|
|
61
|
+
}),
|
|
62
|
+
...subagents.map((subagent) => jsonArtifact(`${basePath}.subagents/${pathSegment(subagent.name)}.json`, renderedDefinition(subagent, this.provider))),
|
|
63
|
+
];
|
|
64
|
+
const duplicatePath = firstDuplicate(artifacts.map((artifact) => artifact.relativePath));
|
|
65
|
+
if (duplicatePath !== undefined)
|
|
66
|
+
return validationFailure(`Rendered artifact path collision: ${duplicatePath}`);
|
|
67
|
+
return ok({
|
|
68
|
+
provider: this.provider,
|
|
69
|
+
installable: false,
|
|
70
|
+
artifacts,
|
|
71
|
+
warnings: ['Rendering returns preview artifacts only; it does not install or write provider configuration.'],
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function renderedDefinition(agent, provider) {
|
|
76
|
+
const rendered = { agent, safety: previewSafety };
|
|
77
|
+
const selectedAdapter = agent.adapters[provider];
|
|
78
|
+
if (selectedAdapter !== undefined)
|
|
79
|
+
rendered.selectedAdapter = selectedAdapter;
|
|
80
|
+
return rendered;
|
|
81
|
+
}
|
|
82
|
+
function jsonArtifact(relativePath, value) {
|
|
83
|
+
return {
|
|
84
|
+
relativePath,
|
|
85
|
+
contentType: 'application/json',
|
|
86
|
+
contents: `${JSON.stringify(value, null, 2)}\n`,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function pathSegment(value) {
|
|
90
|
+
return (value
|
|
91
|
+
.trim()
|
|
92
|
+
.toLowerCase()
|
|
93
|
+
.replace(/[^a-z0-9._-]+/g, '-')
|
|
94
|
+
.replace(/^-+|-+$/g, '') || 'unnamed');
|
|
95
|
+
}
|
|
96
|
+
function firstDuplicate(values) {
|
|
97
|
+
const seen = new Set();
|
|
98
|
+
for (const value of values) {
|
|
99
|
+
if (seen.has(value))
|
|
100
|
+
return value;
|
|
101
|
+
seen.add(value);
|
|
102
|
+
}
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { behaviorContractProjectionMetadata } from '../../behavior/behavior-contract-manifest.js';
|
|
2
|
+
import { ok, validationFailure } from '../provider-renderer.js';
|
|
3
|
+
const openCodeSchema = 'https://opencode.ai/config.json';
|
|
4
|
+
const previewWarning = 'Rendering returns preview artifacts only; it does not install or write .opencode/, .claude/, or provider configuration.';
|
|
5
|
+
const previewSafety = {
|
|
6
|
+
executesProvider: false,
|
|
7
|
+
writesProviderConfig: false,
|
|
8
|
+
installable: false,
|
|
9
|
+
previewOnly: true,
|
|
10
|
+
};
|
|
11
|
+
const openCodeCapabilities = {
|
|
12
|
+
supportedAgentFields: [
|
|
13
|
+
'name',
|
|
14
|
+
'description',
|
|
15
|
+
'instructions',
|
|
16
|
+
'mode',
|
|
17
|
+
'adapter model',
|
|
18
|
+
'adapter config keys: variant, temperature, top_p, hidden, options, color, steps, permission, tools',
|
|
19
|
+
],
|
|
20
|
+
skillInjectionModes: ['external preview services may inject skill payloads before rendering; renderer does not resolve skills'],
|
|
21
|
+
permissionCategories: ['registry permission metadata mapped from adapter permission config'],
|
|
22
|
+
memoryInjectionModes: ['external preview services may inject memory payloads before rendering; renderer does not load memory'],
|
|
23
|
+
delegationModel: 'registry agents render as primary agents and registry subagents render as subagents without executing delegation',
|
|
24
|
+
lifecycleHooks: ['preview render/export only'],
|
|
25
|
+
configFileLocations: ['rendered/opencode/.../opencode.json'],
|
|
26
|
+
limitations: [
|
|
27
|
+
'Preview artifacts only; does not execute OpenCode or provider commands.',
|
|
28
|
+
'Does not install OpenCode or global tooling.',
|
|
29
|
+
'Does not write .opencode/, .claude/, or provider configuration.',
|
|
30
|
+
'Does not provide TUI support or sandbox/worktree enforcement.',
|
|
31
|
+
],
|
|
32
|
+
render: {
|
|
33
|
+
format: 'opencode-json-preview',
|
|
34
|
+
artifactContentTypes: ['application/json'],
|
|
35
|
+
installable: false,
|
|
36
|
+
previewOnly: true,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
export class OpenCodeAgentRenderer {
|
|
40
|
+
provider = 'opencode';
|
|
41
|
+
capabilities = openCodeCapabilities;
|
|
42
|
+
render(input) {
|
|
43
|
+
const agents = [input.agent, ...(input.subagents ?? [])];
|
|
44
|
+
const renderedAgents = {};
|
|
45
|
+
for (const agent of agents) {
|
|
46
|
+
const key = openCodeAgentKey(agent.name);
|
|
47
|
+
if (renderedAgents[key] !== undefined)
|
|
48
|
+
return validationFailure(`Rendered OpenCode agent key collision: ${key}`);
|
|
49
|
+
renderedAgents[key] = openCodeAgentConfig(agent);
|
|
50
|
+
}
|
|
51
|
+
const artifact = {
|
|
52
|
+
relativePath: `rendered/opencode/${pathSegment(input.agent.project)}/${input.agent.scope}/${pathSegment(input.agent.name)}/opencode.json`,
|
|
53
|
+
contentType: 'application/json',
|
|
54
|
+
contents: `${JSON.stringify({ $schema: openCodeSchema, behaviorContract: behaviorContractProjectionMetadata, agent: renderedAgents, safety: previewSafety }, null, 2)}\n`,
|
|
55
|
+
};
|
|
56
|
+
return ok({
|
|
57
|
+
provider: this.provider,
|
|
58
|
+
installable: false,
|
|
59
|
+
artifacts: [artifact],
|
|
60
|
+
warnings: [previewWarning, 'Top-level registry agents render as OpenCode primary agents by default; registry subagents render as OpenCode subagents.'],
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function openCodeAgentConfig(agent) {
|
|
65
|
+
const adapter = agent.adapters.opencode;
|
|
66
|
+
const config = adapter?.config ?? {};
|
|
67
|
+
const rendered = {
|
|
68
|
+
...(adapter?.model !== undefined ? { model: adapter.model } : {}),
|
|
69
|
+
description: agent.description,
|
|
70
|
+
prompt: agent.instructions.value,
|
|
71
|
+
mode: agent.mode === 'subagent' ? 'subagent' : 'primary',
|
|
72
|
+
};
|
|
73
|
+
copyString(config, rendered, 'variant');
|
|
74
|
+
copyNumber(config, rendered, 'temperature');
|
|
75
|
+
copyNumber(config, rendered, 'top_p');
|
|
76
|
+
copyBoolean(config, rendered, 'hidden');
|
|
77
|
+
copyJson(config, rendered, 'options');
|
|
78
|
+
copyString(config, rendered, 'color');
|
|
79
|
+
copyNumber(config, rendered, 'steps');
|
|
80
|
+
copyJson(config, rendered, 'permission');
|
|
81
|
+
copyJson(config, rendered, 'tools');
|
|
82
|
+
return rendered;
|
|
83
|
+
}
|
|
84
|
+
function copyString(source, target, key) {
|
|
85
|
+
const value = source[key];
|
|
86
|
+
if (typeof value === 'string')
|
|
87
|
+
target[key] = value;
|
|
88
|
+
}
|
|
89
|
+
function copyNumber(source, target, key) {
|
|
90
|
+
const value = source[key];
|
|
91
|
+
if (typeof value === 'number')
|
|
92
|
+
target[key] = value;
|
|
93
|
+
}
|
|
94
|
+
function copyBoolean(source, target, key) {
|
|
95
|
+
const value = source[key];
|
|
96
|
+
if (typeof value === 'boolean')
|
|
97
|
+
target[key] = value;
|
|
98
|
+
}
|
|
99
|
+
function copyJson(source, target, key) {
|
|
100
|
+
const value = source[key];
|
|
101
|
+
if (value !== undefined)
|
|
102
|
+
target[key] = value;
|
|
103
|
+
}
|
|
104
|
+
function openCodeAgentKey(value) {
|
|
105
|
+
return pathSegment(value);
|
|
106
|
+
}
|
|
107
|
+
function pathSegment(value) {
|
|
108
|
+
return (value
|
|
109
|
+
.trim()
|
|
110
|
+
.toLowerCase()
|
|
111
|
+
.replace(/[^a-z0-9._-]+/g, '-')
|
|
112
|
+
.replace(/^-+|-+$/g, '') || 'unnamed');
|
|
113
|
+
}
|
|
@@ -191,7 +191,7 @@ function refusal(reason, message, databasePath, source, scope, targetPath, extra
|
|
|
191
191
|
...(targetPath !== undefined ? { targetPath } : {}),
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
|
-
function warningsForScope(
|
|
194
|
+
function warningsForScope(_scope, overwriteVgxness, agentPlan, bashPermissionPolicy) {
|
|
195
195
|
const overwriteWarnings = overwriteVgxness
|
|
196
196
|
? [
|
|
197
197
|
`Reinstall/overwrite is enabled: existing VGXNESS-managed OpenCode entries will be replaced (${agentPlan.installsAgents ? 'mcp.vgxness, default_agent, instructions AGENTS.md, and known VGXNESS agents' : 'mcp.vgxness only'}); unrelated OpenCode config is preserved.`,
|
|
@@ -216,7 +216,7 @@ function createdConfigKeys(agentPlan) {
|
|
|
216
216
|
const keys = agentPlan.installsAgents ? ['$schema', 'instructions', 'default_agent', 'agent', 'mcp'] : ['$schema', 'mcp'];
|
|
217
217
|
return [...keys, 'permission'];
|
|
218
218
|
}
|
|
219
|
-
function manualTestForScope(
|
|
219
|
+
function manualTestForScope(_scope, databasePath, source) {
|
|
220
220
|
return {
|
|
221
221
|
restart: 'Restart OpenCode after the user config is installed.',
|
|
222
222
|
verify: 'Open OpenCode and verify the vgxness MCP server is available from the user OpenCode config; project config may override it.',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import { dirname } from 'node:path';
|
|
3
|
-
import { createManagedProviderConfigBackup } from '
|
|
3
|
+
import { createManagedProviderConfigBackup } from '../../../setup/backup-rollback-service.js';
|
|
4
4
|
import { findConflictingVgxnessAgents, planOpenCodeMcpInstall, } from './client-install-opencode-contract.js';
|
|
5
5
|
import { createOpenCodeDefaultAgentConfig, createOpenCodeDefaultAgentInstallPlan, vgxnessOpenCodeInstructionsPath, } from './opencode-default-agent-config.js';
|
|
6
6
|
const opencodeConfigSchema = 'https://opencode.ai/config.json';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { canonicalDefaultAgentName, canonicalPromptContractVersion, canonicalSddSubagentNames, createCanonicalOpenCodeSddMcpToolPermissions, createCanonicalOpenCodeSddTaskPermissions, } from '../../../agents/canonical-agent-manifest.js';
|
|
2
|
+
import { projectCanonicalAgentManifestToOpenCode, withEffectiveOpenCodeManagerInstructions, } from '../../../agents/canonical-agent-projection.js';
|
|
3
3
|
export const vgxnessOpenCodeDefaultAgent = canonicalDefaultAgentName;
|
|
4
4
|
export const vgxnessOpenCodePromptContractVersion = canonicalPromptContractVersion;
|
|
5
5
|
export const vgxnessOpenCodeInstructionsPath = 'AGENTS.md';
|
|
@@ -63,7 +63,10 @@ export class OpenCodeHandoffPreviewService {
|
|
|
63
63
|
const reason = 'change is required to read SDD status/readiness';
|
|
64
64
|
return { summary: { ...(input.phase === undefined ? {} : { phase: input.phase }), unavailableReason: reason }, inspection: notInspectedSdd(reason) };
|
|
65
65
|
}
|
|
66
|
-
const summary = {
|
|
66
|
+
const summary = {
|
|
67
|
+
change: input.change,
|
|
68
|
+
...(input.phase === undefined ? {} : { phase: input.phase }),
|
|
69
|
+
};
|
|
67
70
|
if (this.deps.sdd === undefined) {
|
|
68
71
|
const reason = 'SDD service is unavailable';
|
|
69
72
|
warnings.push('SDD service is unavailable; SDD status, next phase, and readiness were not queried.');
|
|
@@ -118,7 +121,14 @@ export class OpenCodeHandoffPreviewService {
|
|
|
118
121
|
warnings.push('Provider status service is unavailable; provider status was not inspected.');
|
|
119
122
|
return { ok: true, value: { inspection: { inspected: false, notInspectedReason: 'provider status service is unavailable' } } };
|
|
120
123
|
}
|
|
121
|
-
const status = this.deps.providerStatus.getStatus({
|
|
124
|
+
const status = this.deps.providerStatus.getStatus({
|
|
125
|
+
project: input.project,
|
|
126
|
+
scope,
|
|
127
|
+
providerAdapter: 'opencode',
|
|
128
|
+
workspaceRoot: input.workspaceRoot,
|
|
129
|
+
...(input.change === undefined ? {} : { change: input.change }),
|
|
130
|
+
payloadMode: 'compact',
|
|
131
|
+
});
|
|
122
132
|
if (!status.ok)
|
|
123
133
|
return status;
|
|
124
134
|
return { ok: true, value: { value: status.value, inspection: { inspected: true } } };
|
|
@@ -138,7 +148,12 @@ function continuationReadinessValue(value, phase) {
|
|
|
138
148
|
const record = asRecord(value);
|
|
139
149
|
if (record === undefined)
|
|
140
150
|
return undefined;
|
|
141
|
-
return readinessFromPhaseEntries(asRecord(record.cockpit)?.phases, phase) ??
|
|
151
|
+
return (readinessFromPhaseEntries(asRecord(record.cockpit)?.phases, phase) ??
|
|
152
|
+
readinessFromPhaseEntries(record.phases, phase) ??
|
|
153
|
+
readinessFromPhaseEntries(asRecord(record.readModel)?.phases, phase) ??
|
|
154
|
+
readinessFromReadinessMap(record.readinessByPhase, phase) ??
|
|
155
|
+
readinessFromReadinessMap(record.phaseReadiness, phase) ??
|
|
156
|
+
matchingReadiness(record.readiness, phase));
|
|
142
157
|
}
|
|
143
158
|
function readinessFromPhaseEntries(value, phase) {
|
|
144
159
|
if (!Array.isArray(value))
|
|
@@ -169,14 +184,52 @@ function asRecord(value) {
|
|
|
169
184
|
return typeof value === 'object' && value !== null ? value : undefined;
|
|
170
185
|
}
|
|
171
186
|
function managerInput(input, scope) {
|
|
172
|
-
return {
|
|
187
|
+
return {
|
|
188
|
+
project: input.project,
|
|
189
|
+
scope,
|
|
190
|
+
agentName: input.agentName ?? 'vgxness-manager',
|
|
191
|
+
...(input.agentId === undefined ? {} : { agentId: input.agentId }),
|
|
192
|
+
...(input.workspaceRoot === undefined ? {} : { workspaceRoot: input.workspaceRoot }),
|
|
193
|
+
...(input.maxSourceBytes === undefined ? {} : { maxSourceBytes: input.maxSourceBytes }),
|
|
194
|
+
payloadMode: 'compact',
|
|
195
|
+
};
|
|
173
196
|
}
|
|
174
197
|
function context(input, scope, manager) {
|
|
175
|
-
return {
|
|
198
|
+
return {
|
|
199
|
+
project: input.project,
|
|
200
|
+
scope,
|
|
201
|
+
...(input.change === undefined ? {} : { change: input.change }),
|
|
202
|
+
...(input.phase === undefined ? {} : { phase: input.phase }),
|
|
203
|
+
...(input.workspaceRoot === undefined ? {} : { workspaceRoot: input.workspaceRoot }),
|
|
204
|
+
selectedAgent: manager.selection.agent,
|
|
205
|
+
};
|
|
176
206
|
}
|
|
177
207
|
function compactManager(payload) {
|
|
178
|
-
return {
|
|
208
|
+
return {
|
|
209
|
+
version: payload.version,
|
|
210
|
+
provider: payload.provider,
|
|
211
|
+
selection: payload.selection,
|
|
212
|
+
payloadMode: payload.payloadMode,
|
|
213
|
+
providerArtifacts: payload.providerArtifacts,
|
|
214
|
+
...(payload.skillDiagnostics === undefined ? {} : { skillDiagnostics: payload.skillDiagnostics }),
|
|
215
|
+
safety: payload.safety,
|
|
216
|
+
warnings: payload.warnings,
|
|
217
|
+
};
|
|
179
218
|
}
|
|
180
219
|
function compactProvider(status) {
|
|
181
|
-
return {
|
|
220
|
+
return {
|
|
221
|
+
version: status.version,
|
|
222
|
+
kind: status.kind,
|
|
223
|
+
project: status.project,
|
|
224
|
+
providerAdapter: status.providerAdapter,
|
|
225
|
+
scope: status.scope,
|
|
226
|
+
workspaceRoot: status.workspaceRoot,
|
|
227
|
+
status: status.status,
|
|
228
|
+
overallStatus: status.overallStatus,
|
|
229
|
+
summary: status.summary,
|
|
230
|
+
nextAction: status.nextAction,
|
|
231
|
+
issueCount: status.issueCount,
|
|
232
|
+
warningCount: status.warningCount,
|
|
233
|
+
safety: status.safety,
|
|
234
|
+
};
|
|
182
235
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { dirname, join, relative, resolve } from 'node:path';
|
|
3
|
+
import { SUPPORTED_VGX_MCP_TOOL_NAMES } from '../../../mcp/schema.js';
|
|
3
4
|
import { resolveOpenCodeMcpInstallTarget } from './client-install-opencode-contract.js';
|
|
4
|
-
import { SUPPORTED_VGX_MCP_TOOL_NAMES } from './schema.js';
|
|
5
5
|
const serverName = 'vgxness';
|
|
6
6
|
const expectedToolCount = SUPPORTED_VGX_MCP_TOOL_NAMES.length;
|
|
7
7
|
export function createOpenCodeMcpVisibilityReport(options) {
|