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
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { dedupeSkillSummariesByName, skillIndexContexts } from './personal-skills.js';
|
|
2
|
+
export class SkillStatusService {
|
|
3
|
+
skills;
|
|
4
|
+
agents;
|
|
5
|
+
constructor(skills, agents) {
|
|
6
|
+
this.skills = skills;
|
|
7
|
+
this.agents = agents;
|
|
8
|
+
}
|
|
9
|
+
getStatus(input) {
|
|
10
|
+
const scope = input.scope ?? 'project';
|
|
11
|
+
const provider = input.provider ?? 'opencode';
|
|
12
|
+
const modes = input.mode === undefined ? ['agent', 'subagent'] : [input.mode];
|
|
13
|
+
const diagnostics = [];
|
|
14
|
+
const registry = this.skillRegistry(input.project, scope);
|
|
15
|
+
if (!registry.ok)
|
|
16
|
+
return registry;
|
|
17
|
+
const selectedAgents = this.selectAgents(input.project, scope, modes, input.agent, diagnostics);
|
|
18
|
+
if (!selectedAgents.ok)
|
|
19
|
+
return selectedAgents;
|
|
20
|
+
const agentItems = [];
|
|
21
|
+
for (const agent of selectedAgents.value) {
|
|
22
|
+
const resolved = this.skills.resolveSkills({ agentId: agent.id, project: input.project, scope, providerAdapter: provider });
|
|
23
|
+
if (!resolved.ok)
|
|
24
|
+
return resolved;
|
|
25
|
+
const resolvedNames = resolved.value.skills.map((skill) => skill.name).sort(compareStrings);
|
|
26
|
+
const declared = [...agent.skills].sort(compareStrings);
|
|
27
|
+
const missing = declared.filter((name) => !resolvedNames.includes(name));
|
|
28
|
+
agentItems.push({
|
|
29
|
+
id: agent.id,
|
|
30
|
+
name: agent.name,
|
|
31
|
+
mode: agent.mode,
|
|
32
|
+
declaredSkills: declared,
|
|
33
|
+
resolvedSkills: resolvedNames,
|
|
34
|
+
missingSkills: missing,
|
|
35
|
+
diagnostics: resolved.value.skillDiagnostics.diagnostics,
|
|
36
|
+
});
|
|
37
|
+
diagnostics.push(...resolved.value.skillDiagnostics.diagnostics);
|
|
38
|
+
}
|
|
39
|
+
const declared = agentItems.reduce((sum, item) => sum + item.declaredSkills.length, 0);
|
|
40
|
+
const resolved = agentItems.reduce((sum, item) => sum + item.resolvedSkills.length, 0);
|
|
41
|
+
const missing = agentItems.reduce((sum, item) => sum + item.missingSkills.length, 0);
|
|
42
|
+
const v2Counts = this.skills.skills.getV2Counts(input.project, scope);
|
|
43
|
+
if (!v2Counts.ok)
|
|
44
|
+
return v2Counts;
|
|
45
|
+
return ok({
|
|
46
|
+
kind: 'skills-status',
|
|
47
|
+
version: 1,
|
|
48
|
+
project: input.project,
|
|
49
|
+
scope,
|
|
50
|
+
provider,
|
|
51
|
+
providerMode: 'preview-only',
|
|
52
|
+
providerState: 'preview-only',
|
|
53
|
+
mode: input.mode ?? 'all',
|
|
54
|
+
agent: input.agent ?? null,
|
|
55
|
+
context: {
|
|
56
|
+
project: input.project,
|
|
57
|
+
scope,
|
|
58
|
+
provider,
|
|
59
|
+
providerMode: 'preview-only',
|
|
60
|
+
providerState: 'preview-only',
|
|
61
|
+
...(input.mode !== undefined ? { mode: input.mode } : {}),
|
|
62
|
+
...(input.agent !== undefined ? { agent: input.agent } : {}),
|
|
63
|
+
},
|
|
64
|
+
skills: registry.value.items.map((skill) => ({
|
|
65
|
+
...skill,
|
|
66
|
+
registered: true,
|
|
67
|
+
active: skill.status === 'active',
|
|
68
|
+
current: skill.currentVersionId !== null && skill.currentVersion !== null,
|
|
69
|
+
providerAvailable: false,
|
|
70
|
+
})),
|
|
71
|
+
registry: { skills: registry.value, v2: v2Counts.value },
|
|
72
|
+
agents: { modes, declared, resolved, missing, items: agentItems },
|
|
73
|
+
diagnostics,
|
|
74
|
+
safety: {
|
|
75
|
+
readOnly: true,
|
|
76
|
+
previewOnly: true,
|
|
77
|
+
providerWrites: false,
|
|
78
|
+
usageRecorded: false,
|
|
79
|
+
repairAttempted: false,
|
|
80
|
+
installAttempted: false,
|
|
81
|
+
providerRepair: false,
|
|
82
|
+
providerInstall: false,
|
|
83
|
+
usageRecording: false,
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
skillRegistry(project, scope) {
|
|
88
|
+
const listedSkills = [];
|
|
89
|
+
for (const context of skillIndexContexts(project, scope)) {
|
|
90
|
+
const listed = this.skills.listSkills({ project: context.project, scope: context.scope });
|
|
91
|
+
if (!listed.ok)
|
|
92
|
+
return listed;
|
|
93
|
+
listedSkills.push(...listed.value);
|
|
94
|
+
}
|
|
95
|
+
const summaries = dedupeSkillSummariesByName(listedSkills);
|
|
96
|
+
const items = [];
|
|
97
|
+
for (const skill of summaries) {
|
|
98
|
+
const details = this.skills.getSkillDetails(skill.id);
|
|
99
|
+
if (!details.ok)
|
|
100
|
+
return details;
|
|
101
|
+
const currentVersion = details.value.currentVersion;
|
|
102
|
+
items.push({
|
|
103
|
+
id: skill.id,
|
|
104
|
+
name: skill.name,
|
|
105
|
+
description: skill.description,
|
|
106
|
+
source: currentVersion?.source ?? null,
|
|
107
|
+
currentVersionId: skill.currentVersionId ?? null,
|
|
108
|
+
currentVersion: currentVersion?.version ?? null,
|
|
109
|
+
status: currentVersion?.status ?? (skill.currentVersionId === undefined ? 'missing-current-version' : 'missing-current-version-record'),
|
|
110
|
+
attachments: details.value.attachments.length,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
const active = items.filter((item) => item.status === 'active').length;
|
|
114
|
+
return ok({ total: items.length, active, inactive: items.length - active, items });
|
|
115
|
+
}
|
|
116
|
+
selectAgents(project, scope, modes, agentQuery, diagnostics) {
|
|
117
|
+
const selected = [];
|
|
118
|
+
for (const mode of modes) {
|
|
119
|
+
const listed = this.agents.listAgents({ project, scope, mode });
|
|
120
|
+
if (!listed.ok)
|
|
121
|
+
return listed;
|
|
122
|
+
for (const summary of listed.value) {
|
|
123
|
+
if (agentQuery !== undefined && summary.id !== agentQuery && summary.name !== agentQuery)
|
|
124
|
+
continue;
|
|
125
|
+
const agent = this.agents.getAgent(summary.id);
|
|
126
|
+
if (!agent.ok)
|
|
127
|
+
return agent;
|
|
128
|
+
selected.push(agent.value);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (agentQuery !== undefined && selected.length === 0) {
|
|
132
|
+
diagnostics.push({
|
|
133
|
+
code: 'SKILL_ATTACHMENT_MISSING',
|
|
134
|
+
severity: 'warning',
|
|
135
|
+
message: `No agent or subagent matched ${agentQuery} in ${project}/${scope}.`,
|
|
136
|
+
details: { agent: agentQuery, modes },
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
return ok(selected.sort((a, b) => compareStrings(`${a.mode}:${a.name}:${a.id}`, `${b.mode}:${b.name}:${b.id}`)));
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
function compareStrings(a, b) {
|
|
143
|
+
return a.localeCompare(b);
|
|
144
|
+
}
|
|
145
|
+
function ok(value) {
|
|
146
|
+
return { ok: true, value };
|
|
147
|
+
}
|
package/dist/cli/bun-bin.js
CHANGED
|
File without changes
|
package/dist/cli/cli-flags.js
CHANGED
|
@@ -1,387 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { permissionCategories } from '../permissions/policy-evaluator.js';
|
|
3
|
-
import { parseOperationRetryPolicy } from '../runs/operation-retry.js';
|
|
4
|
-
import { vgxnessSetupDefaults } from '../setup/setup-defaults.js';
|
|
5
|
-
import { validationFailure } from './cli-help.js';
|
|
6
|
-
function parseArgs(argv) {
|
|
7
|
-
const positionals = [];
|
|
8
|
-
const flags = {};
|
|
9
|
-
for (let index = 0; index < argv.length; index += 1) {
|
|
10
|
-
const current = argv[index];
|
|
11
|
-
if (current === undefined)
|
|
12
|
-
continue;
|
|
13
|
-
if (!current.startsWith('--')) {
|
|
14
|
-
positionals.push(current);
|
|
15
|
-
continue;
|
|
16
|
-
}
|
|
17
|
-
const [rawKey, inlineValue] = current.slice(2).split('=', 2);
|
|
18
|
-
if (!rawKey)
|
|
19
|
-
continue;
|
|
20
|
-
if (inlineValue !== undefined) {
|
|
21
|
-
flags[rawKey] = inlineValue;
|
|
22
|
-
continue;
|
|
23
|
-
}
|
|
24
|
-
const next = argv[index + 1];
|
|
25
|
-
if (next !== undefined && !next.startsWith('--')) {
|
|
26
|
-
flags[rawKey] = next;
|
|
27
|
-
index += 1;
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
flags[rawKey] = true;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return { positionals, flags };
|
|
34
|
-
}
|
|
35
|
-
function databasePathFor(flags, environment) {
|
|
36
|
-
const resolved = databasePathSelectionFor(flags, environment);
|
|
37
|
-
return resolved.ok ? { ok: true, value: resolved.value.path } : resolved;
|
|
38
|
-
}
|
|
39
|
-
function databasePathSelectionFor(flags, environment) {
|
|
40
|
-
const flagPath = flags.db !== undefined ? requiredFlag(flags, 'db') : { ok: true, value: undefined };
|
|
41
|
-
if (!flagPath.ok)
|
|
42
|
-
return flagPath;
|
|
43
|
-
return resolveMemoryDatabasePath({ cwd: environment.cwd, env: environment.env, explicitPath: flagPath.value });
|
|
44
|
-
}
|
|
45
|
-
function requiredFlag(flags, name) {
|
|
46
|
-
const value = flags[name];
|
|
47
|
-
return typeof value === 'string' && value.trim() ? { ok: true, value } : validationFailure(`Missing required --${name}`);
|
|
48
|
-
}
|
|
49
|
-
function requiredTrimmedFlag(flags, name) {
|
|
50
|
-
const value = requiredFlag(flags, name);
|
|
51
|
-
return value.ok ? { ok: true, value: value.value.trim() } : value;
|
|
52
|
-
}
|
|
53
|
-
function optionalStringFlag(flags, name) {
|
|
54
|
-
const value = flags[name];
|
|
55
|
-
return typeof value === 'string' && value.trim() ? value : undefined;
|
|
56
|
-
}
|
|
57
|
-
function optionalTrimmedFlag(flags, name) {
|
|
58
|
-
const value = flags[name];
|
|
59
|
-
if (value === undefined)
|
|
60
|
-
return { ok: true, value: undefined };
|
|
61
|
-
if (typeof value !== 'string' || value.trim().length === 0)
|
|
62
|
-
return validationFailure(`--${name} must not be empty`);
|
|
63
|
-
return { ok: true, value: value.trim() };
|
|
64
|
-
}
|
|
65
|
-
function acceptedAtFlag(flags) {
|
|
66
|
-
const value = optionalTrimmedFlag(flags, 'accepted-at');
|
|
67
|
-
if (!value.ok)
|
|
68
|
-
return value;
|
|
69
|
-
if (value.value === undefined)
|
|
70
|
-
return { ok: true, value: new Date().toISOString() };
|
|
71
|
-
const isoDateTimeWithTimezone = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:Z|[+-]\d{2}:?\d{2})$/;
|
|
72
|
-
if (!isoDateTimeWithTimezone.test(value.value))
|
|
73
|
-
return validationFailure('--accepted-at must be an ISO date-time with explicit timezone');
|
|
74
|
-
const parsed = new Date(value.value);
|
|
75
|
-
if (!Number.isFinite(parsed.getTime()))
|
|
76
|
-
return validationFailure('--accepted-at must be a valid ISO date-time');
|
|
77
|
-
return { ok: true, value: parsed.toISOString() };
|
|
78
|
-
}
|
|
79
|
-
function codeApprovalPolicyFlag(flags) {
|
|
80
|
-
const value = optionalStringFlag(flags, 'approval-policy');
|
|
81
|
-
if (value === undefined)
|
|
82
|
-
return { ok: true, value: undefined };
|
|
83
|
-
return value === 'ask' || value === 'allow' || value === 'deny' ? { ok: true, value } : validationFailure('--approval-policy must be ask, allow, or deny');
|
|
84
|
-
}
|
|
85
|
-
function codeVerificationModeFlag(flags) {
|
|
86
|
-
const value = optionalStringFlag(flags, 'verification');
|
|
87
|
-
if (value === undefined)
|
|
88
|
-
return { ok: true, value: undefined };
|
|
89
|
-
return value === 'none' || value === 'suggest' || value === 'run' || value === 'repair'
|
|
90
|
-
? { ok: true, value }
|
|
91
|
-
: validationFailure('--verification must be none, suggest, run, or repair');
|
|
92
|
-
}
|
|
93
|
-
function codeTranscriptModeFlag(flags) {
|
|
94
|
-
const value = optionalStringFlag(flags, 'transcript');
|
|
95
|
-
if (value === undefined)
|
|
96
|
-
return { ok: true, value: undefined };
|
|
97
|
-
return value === 'off' || value === 'summary' || value === 'full' ? { ok: true, value } : validationFailure('--transcript must be off, summary, or full');
|
|
98
|
-
}
|
|
99
|
-
function codeMemoryPolicyFlag(flags) {
|
|
100
|
-
const value = optionalStringFlag(flags, 'memory');
|
|
101
|
-
if (value === undefined)
|
|
102
|
-
return { ok: true, value: undefined };
|
|
103
|
-
return value === 'off' || value === 'ask' || value === 'auto' ? { ok: true, value } : validationFailure('--memory must be off, ask, or auto');
|
|
104
|
-
}
|
|
105
|
-
function scopeFlag(flags, name, fallback) {
|
|
106
|
-
const value = optionalStringFlag(flags, name) ?? fallback;
|
|
107
|
-
return value === 'project' || value === 'personal' ? { ok: true, value } : validationFailure(`--${name} must be project or personal`);
|
|
108
|
-
}
|
|
109
|
-
function optionalScopeFlag(flags, name) {
|
|
110
|
-
const value = optionalStringFlag(flags, name);
|
|
111
|
-
if (value === undefined)
|
|
112
|
-
return { ok: true, value: undefined };
|
|
113
|
-
return value === 'project' || value === 'personal' ? { ok: true, value } : validationFailure(`--${name} must be project or personal`);
|
|
114
|
-
}
|
|
115
|
-
const providerUserGlobalOnlyMigrationMessage = 'VGX-managed provider configuration is user-global only for OpenCode and Claude. Project/local provider files are treated as external/manual diagnostics and will not be written by VGXNESS. Re-run without the project/local install scope.';
|
|
116
|
-
function opencodeInstallScopeFlag(flags, name) {
|
|
117
|
-
const value = optionalStringFlag(flags, name) ?? vgxnessSetupDefaults.defaultOpenCodeScope;
|
|
118
|
-
if (value === 'user' || value === 'global' || value === 'personal')
|
|
119
|
-
return { ok: true, value: 'user' };
|
|
120
|
-
if (value === 'project' || value === 'local')
|
|
121
|
-
return validationFailure(providerUserGlobalOnlyMigrationMessage);
|
|
122
|
-
return validationFailure(`--${name} must be user, global, or personal`);
|
|
123
|
-
}
|
|
124
|
-
function opencodeDiagnosticScopeFlag(flags, name) {
|
|
125
|
-
const value = optionalStringFlag(flags, name) ?? vgxnessSetupDefaults.defaultOpenCodeScope;
|
|
126
|
-
if (value === 'user' || value === 'global' || value === 'personal')
|
|
127
|
-
return { ok: true, value: 'user' };
|
|
128
|
-
if (value === 'project')
|
|
129
|
-
return { ok: true, value };
|
|
130
|
-
return validationFailure(`--${name} must be user, global, personal, or project`);
|
|
131
|
-
}
|
|
132
|
-
function optionalModeFlag(flags, name) {
|
|
133
|
-
const value = optionalStringFlag(flags, name);
|
|
134
|
-
if (value === undefined)
|
|
135
|
-
return { ok: true, value: undefined };
|
|
136
|
-
return value === 'agent' || value === 'subagent' ? { ok: true, value } : validationFailure(`--${name} must be agent or subagent`);
|
|
137
|
-
}
|
|
138
|
-
function permissionCategoryFlag(flags, name) {
|
|
139
|
-
const value = requiredFlag(flags, name);
|
|
140
|
-
if (!value.ok)
|
|
141
|
-
return value;
|
|
142
|
-
return permissionCategories.includes(value.value)
|
|
143
|
-
? { ok: true, value: value.value }
|
|
144
|
-
: validationFailure(`--${name} must be one of ${permissionCategories.join(', ')}`);
|
|
145
|
-
}
|
|
146
|
-
function skillSourceFromFlags(flags) {
|
|
147
|
-
const kind = skillSourceKindFlag(flags, 'source-kind');
|
|
148
|
-
if (!kind.ok)
|
|
149
|
-
return kind;
|
|
150
|
-
if (kind.value === 'path') {
|
|
151
|
-
const path = requiredFlag(flags, 'source-path');
|
|
152
|
-
return path.ok ? { ok: true, value: { kind: 'path', path: path.value } } : path;
|
|
153
|
-
}
|
|
154
|
-
if (kind.value === 'url') {
|
|
155
|
-
const url = requiredFlag(flags, 'source-url');
|
|
156
|
-
return url.ok ? { ok: true, value: { kind: 'url', url: url.value } } : url;
|
|
157
|
-
}
|
|
158
|
-
const inlineMetadata = jsonFlag(flags, 'inline-metadata', {});
|
|
159
|
-
return inlineMetadata.ok ? { ok: true, value: { kind: 'inline', inlineMetadata: inlineMetadata.value } } : inlineMetadata;
|
|
160
|
-
}
|
|
161
|
-
function skillSourceKindFlag(flags, name) {
|
|
162
|
-
const value = requiredFlag(flags, name);
|
|
163
|
-
if (!value.ok)
|
|
164
|
-
return value;
|
|
165
|
-
return value.value === 'path' || value.value === 'url' || value.value === 'inline'
|
|
166
|
-
? { ok: true, value: value.value }
|
|
167
|
-
: validationFailure(`--${name} must be path, url, or inline`);
|
|
168
|
-
}
|
|
169
|
-
function optionalSkillVersionStatusFlag(flags, name) {
|
|
170
|
-
const value = optionalStringFlag(flags, name);
|
|
171
|
-
if (value === undefined)
|
|
172
|
-
return { ok: true, value: undefined };
|
|
173
|
-
return value === 'draft' || value === 'active' || value === 'deprecated' || value === 'archived'
|
|
174
|
-
? { ok: true, value }
|
|
175
|
-
: validationFailure(`--${name} must be draft, active, deprecated, or archived`);
|
|
176
|
-
}
|
|
177
|
-
function skillTargetTypeFlag(flags, name) {
|
|
178
|
-
const value = requiredFlag(flags, name);
|
|
179
|
-
if (!value.ok)
|
|
180
|
-
return value;
|
|
181
|
-
return isSkillTargetType(value.value)
|
|
182
|
-
? { ok: true, value: value.value }
|
|
183
|
-
: validationFailure(`--${name} must be agent, subagent, workflow-phase, provider-adapter, or intent-signal`);
|
|
184
|
-
}
|
|
185
|
-
function optionalSkillTargetTypeFlag(flags, name) {
|
|
186
|
-
const value = optionalStringFlag(flags, name);
|
|
187
|
-
if (value === undefined)
|
|
188
|
-
return { ok: true, value: undefined };
|
|
189
|
-
return isSkillTargetType(value) ? { ok: true, value } : validationFailure(`--${name} must be agent, subagent, workflow-phase, provider-adapter, or intent-signal`);
|
|
190
|
-
}
|
|
191
|
-
function skillUsageOutcomeFlag(flags, name) {
|
|
192
|
-
const value = requiredFlag(flags, name);
|
|
193
|
-
if (!value.ok)
|
|
194
|
-
return value;
|
|
195
|
-
return value.value === 'selected' || value.value === 'injected' || value.value === 'helped' || value.value === 'failed' || value.value === 'neutral'
|
|
196
|
-
? { ok: true, value: value.value }
|
|
197
|
-
: validationFailure(`--${name} must be selected, injected, helped, failed, or neutral`);
|
|
198
|
-
}
|
|
199
|
-
function optionalSkillResolutionUsageFlag(flags, name) {
|
|
200
|
-
const value = optionalStringFlag(flags, name);
|
|
201
|
-
if (value === undefined)
|
|
202
|
-
return { ok: true, value: undefined };
|
|
203
|
-
return value === 'selected' || value === 'injected' ? { ok: true, value } : validationFailure(`--${name} must be selected or injected`);
|
|
204
|
-
}
|
|
205
|
-
function optionalSkillImprovementProposalStatusFlag(flags, name) {
|
|
206
|
-
const value = optionalStringFlag(flags, name);
|
|
207
|
-
if (value === undefined)
|
|
208
|
-
return { ok: true, value: undefined };
|
|
209
|
-
return value === 'draft' || value === 'pending-approval' || value === 'approved' || value === 'rejected' || value === 'cancelled' || value === 'applied'
|
|
210
|
-
? { ok: true, value }
|
|
211
|
-
: validationFailure(`--${name} must be draft, pending-approval, approved, rejected, cancelled, or applied`);
|
|
212
|
-
}
|
|
213
|
-
function skillEvaluationResultStatusFlag(flags, name) {
|
|
214
|
-
const value = requiredFlag(flags, name);
|
|
215
|
-
if (!value.ok)
|
|
216
|
-
return value;
|
|
217
|
-
return isSkillEvaluationResultStatus(value.value)
|
|
218
|
-
? { ok: true, value: value.value }
|
|
219
|
-
: validationFailure(`--${name} must be passed, failed, needs-review, or not-applicable`);
|
|
220
|
-
}
|
|
221
|
-
function optionalSkillEvaluationResultStatusFlag(flags, name) {
|
|
222
|
-
const value = optionalStringFlag(flags, name);
|
|
223
|
-
if (value === undefined)
|
|
224
|
-
return { ok: true, value: undefined };
|
|
225
|
-
return isSkillEvaluationResultStatus(value) ? { ok: true, value } : validationFailure(`--${name} must be passed, failed, needs-review, or not-applicable`);
|
|
226
|
-
}
|
|
227
|
-
function isSkillEvaluationResultStatus(value) {
|
|
228
|
-
return value === 'passed' || value === 'failed' || value === 'needs-review' || value === 'not-applicable';
|
|
229
|
-
}
|
|
230
|
-
function isSkillTargetType(value) {
|
|
231
|
-
return value === 'agent' || value === 'subagent' || value === 'workflow-phase' || value === 'provider-adapter' || value === 'intent-signal';
|
|
232
|
-
}
|
|
233
|
-
function instructionKindFlag(flags) {
|
|
234
|
-
const value = optionalStringFlag(flags, 'instructions-kind') ?? 'inline';
|
|
235
|
-
return value === 'inline' || value === 'path' ? { ok: true, value } : validationFailure('--instructions-kind must be inline or path');
|
|
236
|
-
}
|
|
237
|
-
function optionalNumberFlag(flags, name) {
|
|
238
|
-
const value = optionalStringFlag(flags, name);
|
|
239
|
-
if (value === undefined)
|
|
240
|
-
return { ok: true, value: undefined };
|
|
241
|
-
const parsed = Number(value);
|
|
242
|
-
return Number.isInteger(parsed) && parsed > 0 ? { ok: true, value: parsed } : validationFailure(`--${name} must be a positive integer`);
|
|
243
|
-
}
|
|
244
|
-
function requiredPositiveIntegerFlag(flags, name) {
|
|
245
|
-
const value = requiredFlag(flags, name);
|
|
246
|
-
if (!value.ok)
|
|
247
|
-
return value;
|
|
248
|
-
const parsed = Number(value.value);
|
|
249
|
-
return Number.isSafeInteger(parsed) && parsed > 0 ? { ok: true, value: parsed } : validationFailure(`--${name} must be a positive integer`);
|
|
250
|
-
}
|
|
251
|
-
function taskGrantCategoryFlag(flags, name) {
|
|
252
|
-
const value = requiredFlag(flags, name);
|
|
253
|
-
if (!value.ok)
|
|
254
|
-
return value;
|
|
255
|
-
return value.value === 'shell' || value.value === 'test-run' || value.value === 'git'
|
|
256
|
-
? { ok: true, value: value.value }
|
|
257
|
-
: validationFailure(`--${name} must be shell, test-run, or git`);
|
|
258
|
-
}
|
|
259
|
-
function optionalTaskGrantStatusFlag(flags, name) {
|
|
260
|
-
const value = optionalStringFlag(flags, name);
|
|
261
|
-
if (value === undefined)
|
|
262
|
-
return { ok: true, value: undefined };
|
|
263
|
-
return value === 'active' || value === 'revoked' || value === 'expired' || value === 'exhausted'
|
|
264
|
-
? { ok: true, value }
|
|
265
|
-
: validationFailure(`--${name} must be active, revoked, expired, or exhausted`);
|
|
266
|
-
}
|
|
267
|
-
function taskGrantExpirationFlag(flags) {
|
|
268
|
-
const expiresAt = optionalStringFlag(flags, 'expires-at');
|
|
269
|
-
const ttl = optionalStringFlag(flags, 'ttl');
|
|
270
|
-
if ((expiresAt === undefined) === (ttl === undefined))
|
|
271
|
-
return validationFailure('Pass exactly one of --expires-at or --ttl');
|
|
272
|
-
if (expiresAt !== undefined) {
|
|
273
|
-
const timestamp = Date.parse(expiresAt);
|
|
274
|
-
if (!Number.isFinite(timestamp) || new Date(timestamp).toISOString() !== expiresAt)
|
|
275
|
-
return validationFailure('--expires-at must be a valid ISO date-time');
|
|
276
|
-
return timestamp > Date.now() ? { ok: true, value: expiresAt } : validationFailure('--expires-at must be in the future');
|
|
277
|
-
}
|
|
278
|
-
if (ttl === undefined)
|
|
279
|
-
return validationFailure('Pass exactly one of --expires-at or --ttl');
|
|
280
|
-
const match = /^(\d+)(ms|s|m|h|d)$/.exec(ttl);
|
|
281
|
-
if (match === null)
|
|
282
|
-
return validationFailure('--ttl must be a positive duration like 30s, 15m, 2h, or 1d');
|
|
283
|
-
const amount = Number(match[1]);
|
|
284
|
-
if (!Number.isSafeInteger(amount) || amount <= 0)
|
|
285
|
-
return validationFailure('--ttl must be a positive duration like 30s, 15m, 2h, or 1d');
|
|
286
|
-
const unit = match[2];
|
|
287
|
-
const multiplier = unit === 'ms' ? 1 : unit === 's' ? 1_000 : unit === 'm' ? 60_000 : unit === 'h' ? 3_600_000 : 86_400_000;
|
|
288
|
-
return { ok: true, value: new Date(Date.now() + amount * multiplier).toISOString() };
|
|
289
|
-
}
|
|
290
|
-
function optionalRunStatusFlag(flags, name) {
|
|
291
|
-
const value = optionalStringFlag(flags, name);
|
|
292
|
-
if (value === undefined)
|
|
293
|
-
return { ok: true, value: undefined };
|
|
294
|
-
return isRunStatus(value) ? { ok: true, value } : validationFailure(`--${name} must be a valid run status`);
|
|
295
|
-
}
|
|
296
|
-
function finalRunStatusFlag(flags, name) {
|
|
297
|
-
const value = requiredFlag(flags, name);
|
|
298
|
-
if (!value.ok)
|
|
299
|
-
return value;
|
|
300
|
-
return value.value === 'completed' || value.value === 'failed' || value.value === 'blocked' || value.value === 'cancelled'
|
|
301
|
-
? { ok: true, value: value.value }
|
|
302
|
-
: validationFailure(`--${name} must be completed, failed, blocked, or cancelled`);
|
|
303
|
-
}
|
|
304
|
-
function runOutcomeFlag(flags, name) {
|
|
305
|
-
const value = requiredFlag(flags, name);
|
|
306
|
-
if (!value.ok)
|
|
307
|
-
return value;
|
|
308
|
-
return value.value === 'success' || value.value === 'partial' || value.value === 'failure' || value.value === 'blocked' || value.value === 'cancelled'
|
|
309
|
-
? { ok: true, value: value.value }
|
|
310
|
-
: validationFailure(`--${name} must be success, partial, failure, blocked, or cancelled`);
|
|
311
|
-
}
|
|
312
|
-
function jsonFlag(flags, name, fallback) {
|
|
313
|
-
const value = optionalStringFlag(flags, name);
|
|
314
|
-
if (value === undefined)
|
|
315
|
-
return { ok: true, value: fallback };
|
|
316
|
-
try {
|
|
317
|
-
return { ok: true, value: JSON.parse(value) };
|
|
318
|
-
}
|
|
319
|
-
catch (cause) {
|
|
320
|
-
return { ok: false, error: { code: 'validation_failed', message: `--${name} must be valid JSON`, cause } };
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
function optionalJsonFlag(flags, name) {
|
|
324
|
-
const value = optionalStringFlag(flags, name);
|
|
325
|
-
if (value === undefined)
|
|
326
|
-
return { ok: true, value: undefined };
|
|
327
|
-
try {
|
|
328
|
-
return { ok: true, value: JSON.parse(value) };
|
|
329
|
-
}
|
|
330
|
-
catch (cause) {
|
|
331
|
-
return { ok: false, error: { code: 'validation_failed', message: `--${name} must be valid JSON`, cause } };
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
function retryPolicyFlag(flags) {
|
|
335
|
-
const value = optionalStringFlag(flags, 'policy');
|
|
336
|
-
if (value === undefined)
|
|
337
|
-
return { ok: true, value: undefined };
|
|
338
|
-
let parsed;
|
|
339
|
-
try {
|
|
340
|
-
parsed = JSON.parse(value);
|
|
341
|
-
}
|
|
342
|
-
catch (cause) {
|
|
343
|
-
return { ok: false, error: { code: 'validation_failed', message: '--policy must be valid JSON', cause } };
|
|
344
|
-
}
|
|
345
|
-
const policy = parseOperationRetryPolicy(parsed);
|
|
346
|
-
return policy.ok ? { ok: true, value: policy.policy } : validationFailure(`Invalid --policy: ${policy.errors.join('; ')}`);
|
|
347
|
-
}
|
|
348
|
-
function isRunStatus(value) {
|
|
349
|
-
return (value === 'created' ||
|
|
350
|
-
value === 'planned' ||
|
|
351
|
-
value === 'running' ||
|
|
352
|
-
value === 'needs-human' ||
|
|
353
|
-
value === 'completed' ||
|
|
354
|
-
value === 'failed' ||
|
|
355
|
-
value === 'blocked' ||
|
|
356
|
-
value === 'cancelled');
|
|
357
|
-
}
|
|
358
|
-
function csvFlag(flags, name) {
|
|
359
|
-
return (optionalStringFlag(flags, name)
|
|
360
|
-
?.split(',')
|
|
361
|
-
.map((value) => value.trim())
|
|
362
|
-
.filter(Boolean) ?? []);
|
|
363
|
-
}
|
|
364
|
-
function setupDatabaseFlags(flags) {
|
|
365
|
-
const dbValue = optionalStringFlag(flags, 'db');
|
|
366
|
-
const dbPath = optionalStringFlag(flags, 'db-path');
|
|
367
|
-
if (dbValue === undefined)
|
|
368
|
-
return { ok: true, value: { mode: vgxnessSetupDefaults.defaultDatabaseMode } };
|
|
369
|
-
if (dbValue === 'global' || dbValue === 'project-local')
|
|
370
|
-
return { ok: true, value: { mode: dbValue } };
|
|
371
|
-
if (dbValue === 'custom')
|
|
372
|
-
return dbPath === undefined ? validationFailure('--db custom requires --db-path <path>') : { ok: true, value: { mode: 'custom', path: dbPath } };
|
|
373
|
-
return { ok: true, value: { mode: 'custom', path: dbValue } };
|
|
374
|
-
}
|
|
375
|
-
function setupProviderFlag(flags) {
|
|
376
|
-
const value = optionalStringFlag(flags, 'provider') ?? vgxnessSetupDefaults.defaultProvider;
|
|
377
|
-
return value === 'opencode' || value === 'claude' || value === 'none' ? { ok: true, value } : validationFailure('--provider must be opencode, claude, or none');
|
|
378
|
-
}
|
|
379
|
-
function setupInstallModeFlag(flags) {
|
|
380
|
-
const value = optionalStringFlag(flags, 'mode');
|
|
381
|
-
if (value !== undefined)
|
|
382
|
-
return value === 'mcp-only' || value === 'mcp-plus-agents' ? { ok: true, value } : validationFailure('--mode must be mcp-only or mcp-plus-agents');
|
|
383
|
-
if (flags['mcp-only'] === true || flags['no-agents'] === true)
|
|
384
|
-
return { ok: true, value: 'mcp-only' };
|
|
385
|
-
return { ok: true, value: vgxnessSetupDefaults.defaultInstallMode };
|
|
386
|
-
}
|
|
387
|
-
export { acceptedAtFlag, codeApprovalPolicyFlag, codeMemoryPolicyFlag, codeTranscriptModeFlag, codeVerificationModeFlag, csvFlag, databasePathFor, databasePathSelectionFor, finalRunStatusFlag, instructionKindFlag, isRunStatus, isSkillEvaluationResultStatus, isSkillTargetType, jsonFlag, providerUserGlobalOnlyMigrationMessage, opencodeDiagnosticScopeFlag, opencodeInstallScopeFlag, optionalJsonFlag, optionalModeFlag, optionalNumberFlag, optionalRunStatusFlag, optionalScopeFlag, optionalSkillEvaluationResultStatusFlag, optionalSkillImprovementProposalStatusFlag, optionalSkillResolutionUsageFlag, optionalSkillTargetTypeFlag, optionalSkillVersionStatusFlag, optionalTaskGrantStatusFlag, optionalStringFlag, optionalTrimmedFlag, parseArgs, permissionCategoryFlag, requiredPositiveIntegerFlag, requiredFlag, requiredTrimmedFlag, retryPolicyFlag, runOutcomeFlag, scopeFlag, setupDatabaseFlags, setupInstallModeFlag, setupProviderFlag, skillEvaluationResultStatusFlag, skillSourceFromFlags, skillSourceKindFlag, skillTargetTypeFlag, skillUsageOutcomeFlag, taskGrantCategoryFlag, taskGrantExpirationFlag, };
|
|
1
|
+
export * from '../interfaces/cli/cli-flags.js';
|