vgxness 1.20.4 → 1.20.6
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 -245
- 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 +355 -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/governance/risk-classifier.js +2 -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 -1072
- package/dist/mcp/stdio-server.js +1 -116
- package/dist/mcp/validation.js +1 -2239
- 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/explicit-request-authorization.js +126 -0
- package/dist/permissions/policy-evaluator.js +54 -14
- 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 -1439
- 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 -216
- 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/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,6 +1,6 @@
|
|
|
1
|
-
import { planClaudeCodeMcpInstall } from '../../
|
|
1
|
+
import { planClaudeCodeMcpInstall } from '../../adapters/claude/install/client-install-claude-code-contract.js';
|
|
2
2
|
import { createMcpClientSetupPreview } from '../../mcp/client-setup-preview.js';
|
|
3
|
-
import { externalProviderWriteSafety, noWriteActionSafety } from './provider-setup-adapter.js';
|
|
3
|
+
import { externalProviderWriteSafety, noWriteActionSafety, } from './provider-setup-adapter.js';
|
|
4
4
|
export const claudeSetupAdapter = {
|
|
5
5
|
id: 'claude',
|
|
6
6
|
displayName: 'Claude',
|
|
@@ -10,7 +10,12 @@ export const claudeSetupAdapter = {
|
|
|
10
10
|
{ kind: 'user-config', label: 'Managed user-global Claude MCP config', path: '~/.claude.json', writableBySetup: false },
|
|
11
11
|
{ kind: 'user-config', label: 'Managed user-global Claude agents', path: '~/.claude/agents/*.md', writableBySetup: false },
|
|
12
12
|
{ kind: 'user-config', label: 'Managed user-global Claude memory', path: '~/.claude/CLAUDE.md', writableBySetup: false },
|
|
13
|
-
{
|
|
13
|
+
{
|
|
14
|
+
kind: 'project-config',
|
|
15
|
+
label: 'Project Claude files (external/manual diagnostic only)',
|
|
16
|
+
path: '.mcp.json, .claude/agents/*.md, CLAUDE.md',
|
|
17
|
+
writableBySetup: false,
|
|
18
|
+
},
|
|
14
19
|
],
|
|
15
20
|
getStatus(context) {
|
|
16
21
|
const plan = this.getInstallPlan?.(context);
|
|
@@ -21,7 +26,9 @@ export const claudeSetupAdapter = {
|
|
|
21
26
|
evidence: context.databasePath !== undefined
|
|
22
27
|
? ['Claude MCP preview can be generated from the selected database path.']
|
|
23
28
|
: ['Claude MCP preview uses a placeholder until a database path is selected.'],
|
|
24
|
-
guidance: [
|
|
29
|
+
guidance: [
|
|
30
|
+
'VGXNESS will manage user-global provider configuration. Use `vgxness mcp install claude --yes --run-id <id>` for explicit guarded apply. Project-local provider files are external/manual diagnostics and will not be modified. Read-only setup/status surfaces do not execute Claude Code.',
|
|
31
|
+
],
|
|
25
32
|
actions: [
|
|
26
33
|
{
|
|
27
34
|
id: 'claude-manual-guidance',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { planOpenCodeMcpInstall } from '../../
|
|
1
|
+
import { planOpenCodeMcpInstall } from '../../adapters/opencode/install/client-install-opencode-contract.js';
|
|
2
|
+
import { createOpenCodeMcpVisibilityReport } from '../../adapters/opencode/install/opencode-visibility.js';
|
|
2
3
|
import { createMcpClientSetupPreview } from '../../mcp/client-setup-preview.js';
|
|
3
|
-
import { createOpenCodeMcpVisibilityReport } from '../../mcp/opencode-visibility.js';
|
|
4
4
|
import { externalProviderWriteSafety, noWriteActionSafety, } from './provider-setup-adapter.js';
|
|
5
5
|
export const openCodeSetupAdapter = {
|
|
6
6
|
id: 'opencode',
|
|
@@ -17,11 +17,11 @@ export const openCodeSetupAdapter = {
|
|
|
17
17
|
return {
|
|
18
18
|
providerId: 'opencode',
|
|
19
19
|
status: visibility?.ready === true ? 'ready' : 'available',
|
|
20
|
-
summary: visibility?.ready === true
|
|
21
|
-
? 'OpenCode MCP visibility is ready.'
|
|
22
|
-
: 'OpenCode provider setup is available; install/apply remains external and explicit.',
|
|
20
|
+
summary: visibility?.ready === true ? 'OpenCode MCP visibility is ready.' : 'OpenCode provider setup is available; install/apply remains external and explicit.',
|
|
23
21
|
evidence: visibility?.evidence ?? ['OpenCode setup preview and install planning are available.'],
|
|
24
|
-
guidance: visibility?.guidance ?? [
|
|
22
|
+
guidance: visibility?.guidance ?? [
|
|
23
|
+
'VGXNESS will manage user-global provider configuration. Project-local provider files are external/manual diagnostics and will not be modified.',
|
|
24
|
+
],
|
|
25
25
|
actions: plan?.actions ?? [],
|
|
26
26
|
...previewField(openCodePlanPreview(visibility, plan)),
|
|
27
27
|
};
|
|
@@ -122,7 +122,10 @@ function openCodePlanPreview(visibility, plan) {
|
|
|
122
122
|
targetPath: source.targetPath,
|
|
123
123
|
backupRequired: source.backupRequired,
|
|
124
124
|
confirmationRequired: Boolean(plan?.actions.some((candidate) => candidate.safety.requiresExplicitConfirmation)),
|
|
125
|
-
risks: [
|
|
125
|
+
risks: [
|
|
126
|
+
...(source.overwriteVgxness ? overwriteInstallRisks(source.installsAgents) : source.action === 'create' ? createInstallRisks() : mergeInstallRisks()),
|
|
127
|
+
...bashPermissionRisks(source.bashPermissionPolicy),
|
|
128
|
+
],
|
|
126
129
|
warnings: source.warnings,
|
|
127
130
|
};
|
|
128
131
|
}
|
package/dist/setup/setup-plan.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { join, resolve } from 'node:path';
|
|
2
|
-
import { planClaudeCodeMcpInstall } from '../
|
|
3
|
-
import { planOpenCodeMcpInstall } from '../
|
|
2
|
+
import { planClaudeCodeMcpInstall } from '../adapters/claude/install/client-install-claude-code-contract.js';
|
|
3
|
+
import { planOpenCodeMcpInstall, } from '../adapters/opencode/install/client-install-opencode-contract.js';
|
|
4
4
|
import { resolveMemoryDatabasePath } from '../memory/storage-paths.js';
|
|
5
5
|
import { vgxnessSetupDefaults } from './setup-defaults.js';
|
|
6
6
|
export function createSetupPlan(input) {
|
|
@@ -69,7 +69,9 @@ export function createSetupPlan(input) {
|
|
|
69
69
|
severity: 'blocking',
|
|
70
70
|
message: claude.message,
|
|
71
71
|
targetPath,
|
|
72
|
-
recovery: claude.reason === 'malformed_claude_project_memory' || claude.reason === 'conflicting_claude_project_memory'
|
|
72
|
+
recovery: claude.reason === 'malformed_claude_project_memory' || claude.reason === 'conflicting_claude_project_memory'
|
|
73
|
+
? 'Manually reconcile the VGXNESS markers in user-global ~/.claude/CLAUDE.md, then rerun `vgxness setup plan --provider claude`.'
|
|
74
|
+
: 'Inspect the Claude user-global config, resolve the conflict, then rerun `vgxness setup plan --provider claude`.',
|
|
73
75
|
},
|
|
74
76
|
],
|
|
75
77
|
backupsPlanned: [],
|
|
@@ -95,12 +97,19 @@ export function createSetupPlan(input) {
|
|
|
95
97
|
],
|
|
96
98
|
conflicts: [],
|
|
97
99
|
backupsPlanned: claude.targets
|
|
98
|
-
.filter((target) => target.kind !== 'cli-mcp-registration' &&
|
|
100
|
+
.filter((target) => target.kind !== 'cli-mcp-registration' &&
|
|
101
|
+
((target.kind === 'user-memory' && target.backupRequired) || target.action === 'merge' || target.action === 'update-vgxness'))
|
|
99
102
|
.map((target) => ({
|
|
100
103
|
targetPath: target.path,
|
|
101
|
-
reason: target.kind === 'user-memory'
|
|
104
|
+
reason: target.kind === 'user-memory'
|
|
105
|
+
? 'A future guarded Claude apply would create a managed VGXNESS backup before appending or updating the user-global ~/.claude/CLAUDE.md managed block.'
|
|
106
|
+
: 'A future guarded Claude apply would create a managed VGXNESS backup before merging or updating Claude user-global configuration.',
|
|
102
107
|
})),
|
|
103
|
-
nextCommands: [
|
|
108
|
+
nextCommands: [
|
|
109
|
+
'vgxness mcp install claude --plan',
|
|
110
|
+
'vgxness mcp install claude --yes --run-id <id>',
|
|
111
|
+
'OpenCode remains the default guided setup provider.',
|
|
112
|
+
],
|
|
104
113
|
},
|
|
105
114
|
};
|
|
106
115
|
}
|
|
@@ -183,7 +192,11 @@ function setupPlanFromOpenCode(input) {
|
|
|
183
192
|
},
|
|
184
193
|
]
|
|
185
194
|
: [],
|
|
186
|
-
nextCommands: [
|
|
195
|
+
nextCommands: [
|
|
196
|
+
input.opencode.overwriteVgxness ? 'vgxness setup reinstall --yes' : 'vgxness setup apply --yes',
|
|
197
|
+
'vgxness doctor',
|
|
198
|
+
'Restart OpenCode and verify the vgxness MCP server is visible.',
|
|
199
|
+
],
|
|
187
200
|
};
|
|
188
201
|
}
|
|
189
202
|
function bashPermissionDescription(policy) {
|
package/dist/skills/boot-seed.js
CHANGED
|
@@ -1,42 +1 @@
|
|
|
1
|
-
|
|
2
|
-
const skipEnvVar = 'VGXNESS_SKIP_SKILL_SEED_AUTO_UPGRADE';
|
|
3
|
-
export function runBootSkillSeed(database, env = process.env) {
|
|
4
|
-
if (isOptOut(env))
|
|
5
|
-
return okFromSeedResult({ skipped: true });
|
|
6
|
-
const seeded = new SkillSeedService(database).seedFromDefaultManifest();
|
|
7
|
-
if (!seeded.ok)
|
|
8
|
-
return seeded;
|
|
9
|
-
return okFromSeedResult({ skipped: false, seed: seeded.value });
|
|
10
|
-
}
|
|
11
|
-
function isOptOut(env) {
|
|
12
|
-
const value = env[skipEnvVar];
|
|
13
|
-
return value === '1' || value === 'true';
|
|
14
|
-
}
|
|
15
|
-
function okFromSeedResult(input) {
|
|
16
|
-
if (input.skipped) {
|
|
17
|
-
return {
|
|
18
|
-
ok: true,
|
|
19
|
-
value: {
|
|
20
|
-
skipped: true,
|
|
21
|
-
skillsCreated: 0,
|
|
22
|
-
skillsUpdated: 0,
|
|
23
|
-
versionsCreated: 0,
|
|
24
|
-
versionsSkipped: 0,
|
|
25
|
-
attachmentsCreated: 0,
|
|
26
|
-
attachmentsSkipped: 0,
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
ok: true,
|
|
32
|
-
value: {
|
|
33
|
-
skipped: false,
|
|
34
|
-
skillsCreated: input.seed.skillsCreated,
|
|
35
|
-
skillsUpdated: input.seed.skillsUpdated,
|
|
36
|
-
versionsCreated: input.seed.versionsCreated,
|
|
37
|
-
versionsSkipped: input.seed.versionsSkipped,
|
|
38
|
-
attachmentsCreated: input.seed.attachmentsCreated,
|
|
39
|
-
attachmentsSkipped: input.seed.attachmentsSkipped,
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
}
|
|
1
|
+
export * from '../application/skills/boot-seed.js';
|
|
@@ -1,41 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export const GLOBAL_VGXNESS_SKILLS_PROJECT = '__vgxness__';
|
|
3
|
-
export const skillLookupContexts = (project, scope) => {
|
|
4
|
-
const contexts = [{ project, scope }];
|
|
5
|
-
if (scope !== 'personal')
|
|
6
|
-
contexts.push({ project, scope: 'personal' });
|
|
7
|
-
if (project !== GLOBAL_PERSONAL_SKILLS_PROJECT)
|
|
8
|
-
contexts.push({
|
|
9
|
-
project: GLOBAL_PERSONAL_SKILLS_PROJECT,
|
|
10
|
-
scope: 'personal',
|
|
11
|
-
});
|
|
12
|
-
if (project !== GLOBAL_VGXNESS_SKILLS_PROJECT)
|
|
13
|
-
contexts.push({ project: GLOBAL_VGXNESS_SKILLS_PROJECT, scope: 'project' });
|
|
14
|
-
return dedupeContexts(contexts);
|
|
15
|
-
};
|
|
16
|
-
export const skillIndexContexts = (project, scope) => {
|
|
17
|
-
if (scope === 'personal')
|
|
18
|
-
return skillLookupContexts(project, 'personal');
|
|
19
|
-
return skillLookupContexts(project, scope);
|
|
20
|
-
};
|
|
21
|
-
export const dedupeSkillSummariesByName = (skills) => {
|
|
22
|
-
const seen = new Set();
|
|
23
|
-
const deduped = [];
|
|
24
|
-
for (const skill of skills) {
|
|
25
|
-
if (seen.has(skill.name))
|
|
26
|
-
continue;
|
|
27
|
-
seen.add(skill.name);
|
|
28
|
-
deduped.push(skill);
|
|
29
|
-
}
|
|
30
|
-
return deduped;
|
|
31
|
-
};
|
|
32
|
-
export const dedupeContexts = (contexts) => {
|
|
33
|
-
const seen = new Set();
|
|
34
|
-
return contexts.filter((context) => {
|
|
35
|
-
const key = `${context.project}:${context.scope}`;
|
|
36
|
-
if (seen.has(key))
|
|
37
|
-
return false;
|
|
38
|
-
seen.add(key);
|
|
39
|
-
return true;
|
|
40
|
-
});
|
|
41
|
-
};
|
|
1
|
+
export * from '../application/skills/personal-skills.js';
|
|
@@ -1,190 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export class SkillEvaluationRequestRepository {
|
|
3
|
-
db;
|
|
4
|
-
constructor(db) {
|
|
5
|
-
this.db = db;
|
|
6
|
-
}
|
|
7
|
-
create(input) {
|
|
8
|
-
const validation = validateCreateInput(input);
|
|
9
|
-
if (!validation.ok)
|
|
10
|
-
return validation;
|
|
11
|
-
const result = this.db.transaction(() => {
|
|
12
|
-
assertSkillInScope(this.db, input.skillId, input.project, input.scope);
|
|
13
|
-
if (input.versionId !== undefined)
|
|
14
|
-
assertVersionBelongsToSkill(this.db, input.versionId, input.skillId);
|
|
15
|
-
if (input.scenarioId !== undefined)
|
|
16
|
-
assertScenarioBelongsToSkill(this.db, input.scenarioId, input.skillId);
|
|
17
|
-
if (input.proposalId !== undefined)
|
|
18
|
-
assertProposalBelongsToSkill(this.db, input.proposalId, input.skillId);
|
|
19
|
-
const now = new Date().toISOString();
|
|
20
|
-
const id = randomUUID();
|
|
21
|
-
this.db.connection
|
|
22
|
-
.prepare(`
|
|
23
|
-
INSERT INTO skill_evaluation_requests(
|
|
24
|
-
id, project, scope, skill_id, version_id, scenario_id, proposal_id,
|
|
25
|
-
status, requested_by, run_id, agent_id, workflow, phase, provider_adapter,
|
|
26
|
-
risk_json, preflight_json, created_at, updated_at
|
|
27
|
-
) VALUES (
|
|
28
|
-
@id, @project, @scope, @skillId, @versionId, @scenarioId, @proposalId,
|
|
29
|
-
'requested', @requestedBy, @runId, @agentId, @workflow, @phase, @providerAdapter,
|
|
30
|
-
@riskJson, @preflightJson, @createdAt, @updatedAt
|
|
31
|
-
)
|
|
32
|
-
`)
|
|
33
|
-
.run({
|
|
34
|
-
id,
|
|
35
|
-
project: input.project,
|
|
36
|
-
scope: input.scope,
|
|
37
|
-
skillId: input.skillId,
|
|
38
|
-
versionId: input.versionId ?? null,
|
|
39
|
-
scenarioId: input.scenarioId ?? null,
|
|
40
|
-
proposalId: input.proposalId ?? null,
|
|
41
|
-
requestedBy: input.requestedBy.trim(),
|
|
42
|
-
runId: input.runId ?? null,
|
|
43
|
-
agentId: input.agentId ?? null,
|
|
44
|
-
workflow: input.workflow ?? null,
|
|
45
|
-
phase: input.phase ?? null,
|
|
46
|
-
providerAdapter: input.providerAdapter ?? null,
|
|
47
|
-
riskJson: input.risk === undefined ? null : JSON.stringify(input.risk),
|
|
48
|
-
preflightJson: input.preflight === undefined ? null : JSON.stringify(input.preflight),
|
|
49
|
-
createdAt: now,
|
|
50
|
-
updatedAt: now,
|
|
51
|
-
});
|
|
52
|
-
const read = this.getById(id);
|
|
53
|
-
if (!read.ok)
|
|
54
|
-
throw new Error(read.error.message);
|
|
55
|
-
return read.value;
|
|
56
|
-
});
|
|
57
|
-
if (!result.ok && result.error.cause instanceof SkillEvaluationRequestValidationError)
|
|
58
|
-
return validationFailure(result.error.cause.message);
|
|
59
|
-
return result;
|
|
60
|
-
}
|
|
61
|
-
list(filters) {
|
|
62
|
-
try {
|
|
63
|
-
const where = ['project=@project', 'scope=@scope'];
|
|
64
|
-
const parameters = { project: filters.project, scope: filters.scope, limit: filters.limit ?? 25 };
|
|
65
|
-
addOptionalFilter(where, parameters, 'skill_id', 'skillId', filters.skillId);
|
|
66
|
-
addOptionalFilter(where, parameters, 'version_id', 'versionId', filters.versionId);
|
|
67
|
-
addOptionalFilter(where, parameters, 'scenario_id', 'scenarioId', filters.scenarioId);
|
|
68
|
-
addOptionalFilter(where, parameters, 'proposal_id', 'proposalId', filters.proposalId);
|
|
69
|
-
addOptionalFilter(where, parameters, 'status', 'status', filters.status);
|
|
70
|
-
addOptionalFilter(where, parameters, 'run_id', 'runId', filters.runId);
|
|
71
|
-
addOptionalFilter(where, parameters, 'agent_id', 'agentId', filters.agentId);
|
|
72
|
-
const rows = this.db.connection
|
|
73
|
-
.prepare(`
|
|
74
|
-
SELECT * FROM skill_evaluation_requests
|
|
75
|
-
WHERE ${where.join(' AND ')}
|
|
76
|
-
ORDER BY created_at DESC, rowid DESC
|
|
77
|
-
LIMIT @limit
|
|
78
|
-
`)
|
|
79
|
-
.all(parameters);
|
|
80
|
-
return ok(rows.map(mapRequest));
|
|
81
|
-
}
|
|
82
|
-
catch (cause) {
|
|
83
|
-
return fail('Failed to list skill evaluation requests', cause);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
getById(id) {
|
|
87
|
-
try {
|
|
88
|
-
const row = this.db.connection.prepare('SELECT * FROM skill_evaluation_requests WHERE id=?').get(id);
|
|
89
|
-
return row ? ok(mapRequest(row)) : missing(`Skill evaluation request not found: ${id}`);
|
|
90
|
-
}
|
|
91
|
-
catch (cause) {
|
|
92
|
-
return fail('Failed to read skill evaluation request', cause);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
function validateCreateInput(input) {
|
|
97
|
-
if (!input.project.trim())
|
|
98
|
-
return validationFailure('Project is required');
|
|
99
|
-
if (input.scope !== 'project' && input.scope !== 'personal')
|
|
100
|
-
return validationFailure('Scope must be project or personal');
|
|
101
|
-
if (!input.skillId.trim())
|
|
102
|
-
return validationFailure('Skill id is required');
|
|
103
|
-
if (!input.requestedBy.trim())
|
|
104
|
-
return validationFailure('Skill evaluation requester is required');
|
|
105
|
-
return ok(undefined);
|
|
106
|
-
}
|
|
107
|
-
function addOptionalFilter(where, parameters, column, key, value) {
|
|
108
|
-
if (value === undefined)
|
|
109
|
-
return;
|
|
110
|
-
where.push(`${column}=@${key}`);
|
|
111
|
-
parameters[key] = value;
|
|
112
|
-
}
|
|
113
|
-
function assertSkillInScope(db, skillId, project, scope) {
|
|
114
|
-
const row = db.connection.prepare('SELECT project, scope FROM skills WHERE id=?').get(skillId);
|
|
115
|
-
if (row === undefined)
|
|
116
|
-
throw new SkillEvaluationRequestValidationError(`Skill not found: ${skillId}`);
|
|
117
|
-
if (row.project !== project || row.scope !== scope)
|
|
118
|
-
throw new SkillEvaluationRequestValidationError('Skill does not belong to the requested project/scope');
|
|
119
|
-
}
|
|
120
|
-
function assertVersionBelongsToSkill(db, versionId, skillId) {
|
|
121
|
-
const row = db.connection.prepare('SELECT skill_id FROM skill_versions WHERE id=?').get(versionId);
|
|
122
|
-
if (row === undefined)
|
|
123
|
-
throw new SkillEvaluationRequestValidationError(`Skill version not found: ${versionId}`);
|
|
124
|
-
if (row.skill_id !== skillId)
|
|
125
|
-
throw new SkillEvaluationRequestValidationError('Skill version must belong to the evaluated skill');
|
|
126
|
-
}
|
|
127
|
-
function assertScenarioBelongsToSkill(db, scenarioId, skillId) {
|
|
128
|
-
const row = db.connection.prepare('SELECT skill_id FROM skill_evaluation_scenarios WHERE id=?').get(scenarioId);
|
|
129
|
-
if (row === undefined)
|
|
130
|
-
throw new SkillEvaluationRequestValidationError(`Skill evaluation scenario not found: ${scenarioId}`);
|
|
131
|
-
if (row.skill_id !== skillId)
|
|
132
|
-
throw new SkillEvaluationRequestValidationError('Skill evaluation scenario must belong to the evaluated skill');
|
|
133
|
-
}
|
|
134
|
-
function assertProposalBelongsToSkill(db, proposalId, skillId) {
|
|
135
|
-
const row = db.connection.prepare('SELECT skill_id FROM skill_improvement_proposals WHERE id=?').get(proposalId);
|
|
136
|
-
if (row === undefined)
|
|
137
|
-
throw new SkillEvaluationRequestValidationError(`Skill improvement proposal not found: ${proposalId}`);
|
|
138
|
-
if (row.skill_id !== skillId)
|
|
139
|
-
throw new SkillEvaluationRequestValidationError('Skill improvement proposal must belong to the evaluated skill');
|
|
140
|
-
}
|
|
141
|
-
function mapRequest(row) {
|
|
142
|
-
const request = {
|
|
143
|
-
id: row.id,
|
|
144
|
-
project: row.project,
|
|
145
|
-
scope: row.scope,
|
|
146
|
-
skillId: row.skill_id,
|
|
147
|
-
status: row.status,
|
|
148
|
-
requestedBy: row.requested_by,
|
|
149
|
-
createdAt: row.created_at,
|
|
150
|
-
updatedAt: row.updated_at,
|
|
151
|
-
};
|
|
152
|
-
if (row.version_id !== null)
|
|
153
|
-
request.versionId = row.version_id;
|
|
154
|
-
if (row.scenario_id !== null)
|
|
155
|
-
request.scenarioId = row.scenario_id;
|
|
156
|
-
if (row.proposal_id !== null)
|
|
157
|
-
request.proposalId = row.proposal_id;
|
|
158
|
-
if (row.run_id !== null)
|
|
159
|
-
request.runId = row.run_id;
|
|
160
|
-
if (row.agent_id !== null)
|
|
161
|
-
request.agentId = row.agent_id;
|
|
162
|
-
if (row.workflow !== null)
|
|
163
|
-
request.workflow = row.workflow;
|
|
164
|
-
if (row.phase !== null)
|
|
165
|
-
request.phase = row.phase;
|
|
166
|
-
if (row.provider_adapter !== null)
|
|
167
|
-
request.providerAdapter = row.provider_adapter;
|
|
168
|
-
if (row.risk_json !== null)
|
|
169
|
-
request.risk = JSON.parse(row.risk_json);
|
|
170
|
-
if (row.preflight_json !== null)
|
|
171
|
-
request.preflight = JSON.parse(row.preflight_json);
|
|
172
|
-
return request;
|
|
173
|
-
}
|
|
174
|
-
function ok(value) {
|
|
175
|
-
return { ok: true, value };
|
|
176
|
-
}
|
|
177
|
-
function missing(message) {
|
|
178
|
-
return { ok: false, error: { code: 'not_found', message } };
|
|
179
|
-
}
|
|
180
|
-
function validationFailure(message) {
|
|
181
|
-
return { ok: false, error: { code: 'validation_failed', message } };
|
|
182
|
-
}
|
|
183
|
-
function fail(message, cause) {
|
|
184
|
-
const error = { code: 'validation_failed', message };
|
|
185
|
-
if (cause !== undefined)
|
|
186
|
-
error.cause = cause;
|
|
187
|
-
return { ok: false, error };
|
|
188
|
-
}
|
|
189
|
-
class SkillEvaluationRequestValidationError extends Error {
|
|
190
|
-
}
|
|
1
|
+
export * from '../../storage/skills/repositories/skill-evaluation-requests.js';
|