vgxness 1.20.5 → 1.20.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/claude/agent-renderer.js +82 -0
- package/dist/{mcp → adapters/claude/install}/claude-code-agent-config.js +64 -9
- package/dist/{mcp → adapters/claude/install}/claude-code-config.js +28 -6
- package/dist/{mcp → adapters/claude/install}/claude-code-project-memory.js +35 -5
- package/dist/{mcp → adapters/claude/install}/claude-code-scope.js +12 -3
- package/dist/{mcp → adapters/claude/install}/claude-code-user-config.js +26 -5
- package/dist/{mcp → adapters/claude/install}/claude-code-user-memory.js +47 -7
- package/dist/{mcp → adapters/claude/install}/client-install-claude-code-contract.js +45 -8
- package/dist/{mcp → adapters/claude/install}/client-install-claude-code.js +98 -14
- package/dist/adapters/json/agent-renderer.js +104 -0
- package/dist/adapters/opencode/agent-renderer.js +113 -0
- package/dist/{mcp → adapters/opencode/install}/client-install-opencode-contract.js +2 -2
- package/dist/{mcp → adapters/opencode/install}/client-install-opencode.js +1 -1
- package/dist/{mcp → adapters/opencode/install}/opencode-default-agent-config.js +2 -2
- package/dist/{mcp → adapters/opencode/install}/opencode-handoff-preview.js +60 -7
- package/dist/{mcp → adapters/opencode/install}/opencode-visibility.js +1 -1
- package/dist/adapters/provider-renderer.js +6 -0
- package/dist/agents/agent-activation-service.js +1 -263
- package/dist/agents/agent-lookup-contexts.js +1 -28
- package/dist/agents/agent-registry-service.js +1 -81
- package/dist/agents/agent-resolver.js +1 -287
- package/dist/agents/agent-seed-service.js +1 -157
- package/dist/agents/agent-seed-upgrade-service.js +1 -231
- package/dist/agents/agent-selector-resolver.js +1 -28
- package/dist/agents/boot-upgrade.js +1 -59
- package/dist/agents/canonical-agent-manifest.js +1 -246
- package/dist/agents/canonical-agent-projection.js +1 -236
- package/dist/agents/manager-profile-overlay-service.js +1 -60
- package/dist/agents/profile-model-routing.js +1 -30
- package/dist/agents/renderers/claude-renderer.js +1 -82
- package/dist/agents/renderers/index.js +1 -14
- package/dist/agents/renderers/json-renderer.js +1 -104
- package/dist/agents/renderers/opencode-renderer.js +1 -113
- package/dist/agents/renderers/provider-adapter.js +1 -6
- package/dist/agents/repositories/agent-seed-history.js +1 -128
- package/dist/agents/repositories/agents.js +1 -200
- package/dist/agents/repositories/manager-profile-overlays.js +1 -90
- package/dist/agents/schema.js +1 -1
- package/dist/application/agents/agent-activation-service.js +261 -0
- package/dist/application/agents/agent-lookup-contexts.js +28 -0
- package/dist/application/agents/agent-registry-service.js +81 -0
- package/dist/application/agents/agent-resolver.js +287 -0
- package/dist/application/agents/agent-seed-service.js +157 -0
- package/dist/application/agents/agent-seed-upgrade-service.js +231 -0
- package/dist/application/agents/agent-selector-resolver.js +28 -0
- package/dist/application/agents/boot-upgrade.js +59 -0
- package/dist/application/agents/canonical-agent-projection.js +236 -0
- package/dist/application/agents/manager-profile-overlay-service.js +68 -0
- package/dist/application/agents/profile-model-routing.js +30 -0
- package/dist/application/agents/renderers/claude-renderer.js +1 -0
- package/dist/application/agents/renderers/index.js +14 -0
- package/dist/application/agents/renderers/json-renderer.js +1 -0
- package/dist/application/agents/renderers/opencode-renderer.js +1 -0
- package/dist/application/agents/renderers/provider-adapter.js +1 -0
- package/dist/application/memory/active-work-preview.js +75 -0
- package/dist/application/memory/agent-memory-capture-service.js +498 -0
- package/dist/application/memory/import/dry-run-planner.js +58 -0
- package/dist/application/memory/import/index.js +3 -0
- package/dist/application/memory/import/observation-writer.js +226 -0
- package/dist/application/memory/import/package.js +179 -0
- package/dist/application/memory/memory-service.js +202 -0
- package/dist/application/memory/search.js +11 -0
- package/dist/{mcp → application/provider-setup}/provider-change-plan.js +74 -13
- package/dist/{mcp → application/provider-setup}/provider-doctor.js +201 -31
- package/dist/{mcp → application/provider-setup}/provider-health-types.js +1 -1
- package/dist/{mcp → application/provider-setup}/provider-status.js +170 -33
- package/dist/application/runs/execution-planning.js +180 -0
- package/dist/application/runs/operation-execution.js +1 -0
- package/dist/application/runs/operation-retry.js +129 -0
- package/dist/application/runs/resume-after-approval-result.js +88 -0
- package/dist/application/runs/run-insights.js +270 -0
- package/dist/application/runs/run-service.js +1480 -0
- package/dist/application/runs/run-snapshot-export-service.js +31 -0
- package/dist/application/runs/sandbox-process-execution.js +244 -0
- package/dist/application/runs/sandbox-worktree-planning.js +59 -0
- package/dist/application/runs/task-scoped-command-grant-service.js +224 -0
- package/dist/application/sdd/artifact-portability-service.js +137 -0
- package/dist/application/sdd/cockpit-read-model.js +195 -0
- package/dist/application/sdd/sdd-continuation-plan.js +265 -0
- package/dist/application/sdd/sdd-workflow-service.js +892 -0
- package/dist/application/skills/boot-seed.js +42 -0
- package/dist/application/skills/personal-skills.js +41 -0
- package/dist/application/skills/skill-export-service.js +34 -0
- package/dist/application/skills/skill-index-service.js +126 -0
- package/dist/application/skills/skill-payload.js +186 -0
- package/dist/application/skills/skill-registry-service.js +648 -0
- package/dist/application/skills/skill-resolver.js +368 -0
- package/dist/application/skills/skill-seed-service.js +242 -0
- package/dist/application/skills/skill-status-service.js +147 -0
- package/dist/cli/bun-bin.js +0 -0
- package/dist/cli/cli-flags.js +1 -387
- package/dist/cli/cli-help.js +1 -173
- package/dist/cli/cli-helpers.js +1 -77
- package/dist/cli/cli-types.js +1 -1
- package/dist/cli/commands/agent-skill-dispatcher.js +1 -700
- package/dist/cli/commands/index.js +1 -9
- package/dist/cli/commands/interactive-entrypoint-dispatcher.js +1 -14
- package/dist/cli/commands/mcp-dispatcher.js +1 -232
- package/dist/cli/commands/memory-sdd-dispatcher.js +1 -367
- package/dist/cli/commands/run-permission-dispatcher.js +1 -455
- package/dist/cli/commands/setup-dispatcher.js +1 -496
- package/dist/cli/commands/status-dispatcher.js +1 -130
- package/dist/cli/commands/verification-dispatcher.js +1 -47
- package/dist/cli/commands/workflow-dispatcher.js +1 -566
- package/dist/cli/dispatcher.js +1 -247
- package/dist/cli/doctor-renderer.js +1 -26
- package/dist/cli/home-tui-app.js +1 -411
- package/dist/cli/home-tui-controller.js +1 -314
- package/dist/cli/mcp-start-path.js +1 -21
- package/dist/cli/product-resume-renderer.js +1 -32
- package/dist/cli/product-status-renderer.js +1 -81
- package/dist/cli/sdd-renderer.js +1 -247
- package/dist/cli/setup-plan-renderer.js +1 -79
- package/dist/cli/setup-status-renderer.js +1 -50
- package/dist/cli/setup-tui-app.js +1 -130
- package/dist/cli/setup-tui-controller.js +1 -89
- package/dist/cli/tui/focus-reducer.js +1 -0
- package/dist/cli/tui/focus-types.js +1 -0
- package/dist/cli/tui/ink/app-shell.js +1 -0
- package/dist/cli/tui/ink/components.js +1 -38
- package/dist/cli/tui/ink/help-overlay.js +1 -0
- package/dist/cli/tui/ink/state-components.js +1 -0
- package/dist/cli/tui/ink/theme.js +1 -36
- package/dist/cli/tui/key-intents.js +1 -0
- package/dist/cli/tui/keymap.js +1 -20
- package/dist/cli/tui/navigation.js +1 -10
- package/dist/cli/tui/screen-registry.js +1 -0
- package/dist/cli/tui/terminal-capabilities.js +1 -12
- package/dist/cli/tui/tui-types.js +1 -1
- package/dist/cli/tui/visual/badges.js +1 -19
- package/dist/cli/tui/visual/footer.js +1 -27
- package/dist/cli/tui/visual/index.js +1 -3
- package/dist/cli/tui/visual/viewport.js +1 -11
- package/dist/cli/tui-render-helpers.js +1 -200
- package/dist/cli/verification-plan-renderer.js +1 -25
- package/dist/cli/verification-report-renderer.js +1 -19
- package/dist/domain/agents/canonical-agent-manifest.js +364 -0
- package/dist/domain/agents/schema.js +1 -0
- package/dist/domain/memory/active-work-topics.js +64 -0
- package/dist/domain/memory/memory-capture-schema.js +1 -0
- package/dist/domain/memory/schema.js +1 -0
- package/dist/domain/runs/schema.js +5 -0
- package/dist/domain/sdd/cockpit-types.js +1 -0
- package/dist/domain/sdd/schema.js +111 -0
- package/dist/domain/skills/schema.js +1 -0
- package/dist/interfaces/cli/bun-bin.js +46 -0
- package/dist/interfaces/cli/cli-flags.js +391 -0
- package/dist/interfaces/cli/cli-help.js +173 -0
- package/dist/interfaces/cli/cli-helpers.js +77 -0
- package/dist/interfaces/cli/cli-types.js +1 -0
- package/dist/interfaces/cli/commands/agent-skill-dispatcher.js +700 -0
- package/dist/interfaces/cli/commands/index.js +9 -0
- package/dist/interfaces/cli/commands/interactive-entrypoint-dispatcher.js +14 -0
- package/dist/interfaces/cli/commands/mcp-dispatcher.js +252 -0
- package/dist/interfaces/cli/commands/memory-sdd-dispatcher.js +367 -0
- package/dist/interfaces/cli/commands/run-permission-dispatcher.js +460 -0
- package/dist/interfaces/cli/commands/setup-dispatcher.js +496 -0
- package/dist/interfaces/cli/commands/status-dispatcher.js +130 -0
- package/dist/interfaces/cli/commands/verification-dispatcher.js +47 -0
- package/dist/interfaces/cli/commands/workflow-dispatcher.js +566 -0
- package/dist/interfaces/cli/dispatcher.js +247 -0
- package/dist/interfaces/cli/doctor-renderer.js +26 -0
- package/dist/interfaces/cli/home-tui-app.js +462 -0
- package/dist/interfaces/cli/home-tui-controller.js +341 -0
- package/dist/interfaces/cli/index.js +27 -0
- package/dist/interfaces/cli/mcp-start-path.js +21 -0
- package/dist/interfaces/cli/product-resume-renderer.js +32 -0
- package/dist/interfaces/cli/product-status-renderer.js +81 -0
- package/dist/interfaces/cli/sdd-renderer.js +247 -0
- package/dist/interfaces/cli/setup-plan-renderer.js +79 -0
- package/dist/interfaces/cli/setup-status-renderer.js +50 -0
- package/dist/interfaces/cli/setup-tui-app.js +135 -0
- package/dist/interfaces/cli/setup-tui-controller.js +89 -0
- package/dist/interfaces/cli/tui/focus-reducer.js +60 -0
- package/dist/interfaces/cli/tui/focus-types.js +10 -0
- package/dist/interfaces/cli/tui/ink/app-shell.js +16 -0
- package/dist/interfaces/cli/tui/ink/components.js +38 -0
- package/dist/interfaces/cli/tui/ink/help-overlay.js +6 -0
- package/dist/interfaces/cli/tui/ink/state-components.js +22 -0
- package/dist/interfaces/cli/tui/ink/theme.js +36 -0
- package/dist/interfaces/cli/tui/key-intents.js +33 -0
- package/dist/interfaces/cli/tui/keymap.js +20 -0
- package/dist/interfaces/cli/tui/navigation.js +10 -0
- package/dist/interfaces/cli/tui/screen-registry.js +43 -0
- package/dist/interfaces/cli/tui/terminal-capabilities.js +12 -0
- package/dist/interfaces/cli/tui/tui-types.js +1 -0
- package/dist/interfaces/cli/tui/visual/badges.js +19 -0
- package/dist/interfaces/cli/tui/visual/footer.js +27 -0
- package/dist/interfaces/cli/tui/visual/index.js +3 -0
- package/dist/interfaces/cli/tui/visual/viewport.js +11 -0
- package/dist/interfaces/cli/tui-render-helpers.js +200 -0
- package/dist/interfaces/cli/verification-plan-renderer.js +25 -0
- package/dist/interfaces/cli/verification-report-renderer.js +19 -0
- package/dist/interfaces/mcp/contracts/agents.js +1 -0
- package/dist/interfaces/mcp/contracts/context.js +1 -0
- package/dist/interfaces/mcp/contracts/governance.js +1 -0
- package/dist/interfaces/mcp/contracts/index.js +1 -0
- package/dist/interfaces/mcp/contracts/memory.js +1 -0
- package/dist/interfaces/mcp/contracts/providers.js +1 -0
- package/dist/interfaces/mcp/contracts/runs.js +1 -0
- package/dist/interfaces/mcp/contracts/sdd.js +1 -0
- package/dist/interfaces/mcp/contracts/sessions.js +1 -0
- package/dist/interfaces/mcp/contracts/skills.js +1 -0
- package/dist/interfaces/mcp/contracts/verification.js +1 -0
- package/dist/interfaces/mcp/control-plane/handlers/agents.js +38 -0
- package/dist/interfaces/mcp/control-plane/handlers/context.js +12 -0
- package/dist/interfaces/mcp/control-plane/handlers/memory.js +95 -0
- package/dist/interfaces/mcp/control-plane/handlers/providers.js +19 -0
- package/dist/interfaces/mcp/control-plane/handlers/runs.js +134 -0
- package/dist/interfaces/mcp/control-plane/handlers/sdd.js +225 -0
- package/dist/interfaces/mcp/control-plane/handlers/sessions.js +39 -0
- package/dist/interfaces/mcp/control-plane/handlers/skills.js +82 -0
- package/dist/interfaces/mcp/control-plane/handlers/verification.js +11 -0
- package/dist/interfaces/mcp/control-plane/types.js +1 -0
- package/dist/interfaces/mcp/control-plane.js +235 -0
- package/dist/interfaces/mcp/schema.js +174 -0
- package/dist/interfaces/mcp/schemas/common.js +121 -0
- package/dist/interfaces/mcp/schemas/inputs/agents.js +69 -0
- package/dist/interfaces/mcp/schemas/inputs/context.js +32 -0
- package/dist/interfaces/mcp/schemas/inputs/governance.js +23 -0
- package/dist/interfaces/mcp/schemas/inputs/index.js +10 -0
- package/dist/interfaces/mcp/schemas/inputs/memory.js +50 -0
- package/dist/interfaces/mcp/schemas/inputs/providers.js +35 -0
- package/dist/interfaces/mcp/schemas/inputs/runs.js +146 -0
- package/dist/interfaces/mcp/schemas/inputs/sdd.js +102 -0
- package/dist/interfaces/mcp/schemas/inputs/sessions.js +32 -0
- package/dist/interfaces/mcp/schemas/inputs/skills.js +231 -0
- package/dist/interfaces/mcp/schemas/inputs/verification.js +9 -0
- package/dist/interfaces/mcp/schemas/outputs/index.js +2 -0
- package/dist/interfaces/mcp/schemas/outputs/providers.js +28 -0
- package/dist/interfaces/mcp/schemas/outputs/sdd.js +166 -0
- package/dist/interfaces/mcp/stdio-server.js +116 -0
- package/dist/interfaces/mcp/validation/agents.js +189 -0
- package/dist/interfaces/mcp/validation/common.js +415 -0
- package/dist/interfaces/mcp/validation/governance.js +50 -0
- package/dist/interfaces/mcp/validation/memory.js +133 -0
- package/dist/interfaces/mcp/validation/providers.js +94 -0
- package/dist/interfaces/mcp/validation/runs.js +514 -0
- package/dist/interfaces/mcp/validation/sdd.js +247 -0
- package/dist/interfaces/mcp/validation/sessions.js +51 -0
- package/dist/interfaces/mcp/validation/skills.js +685 -0
- package/dist/interfaces/mcp/validation/verification.js +24 -0
- package/dist/interfaces/mcp/validation.js +149 -0
- package/dist/mcp/control-plane-snapshot-service.js +65 -2
- package/dist/mcp/control-plane.js +1 -646
- package/dist/mcp/doctor.js +1 -1
- package/dist/mcp/index.js +17 -17
- package/dist/mcp/schema.js +1 -1132
- package/dist/mcp/stdio-server.js +1 -116
- package/dist/mcp/validation.js +1 -2383
- package/dist/memory/active-work-preview.js +1 -75
- package/dist/memory/active-work-topics.js +1 -64
- package/dist/memory/agent-memory-capture-service.js +1 -497
- package/dist/memory/import/dry-run-planner.js +1 -58
- package/dist/memory/import/index.js +1 -3
- package/dist/memory/import/observation-writer.js +1 -226
- package/dist/memory/import/package.js +1 -179
- package/dist/memory/memory-capture-schema.js +1 -1
- package/dist/memory/memory-service.js +1 -201
- package/dist/memory/repositories/artifacts.js +1 -67
- package/dist/memory/repositories/observations.js +1 -217
- package/dist/memory/repositories/sessions.js +1 -125
- package/dist/memory/repositories/traces.js +1 -78
- package/dist/memory/schema.js +1 -1
- package/dist/memory/search.js +1 -11
- package/dist/memory/sqlite/database.js +1 -228
- package/dist/memory/storage-paths.js +1 -72
- package/dist/payload/context-budget-policy.js +10 -0
- package/dist/payload/context-budget-service.js +26 -0
- package/dist/payload/payload-diagnostics.js +50 -0
- package/dist/permissions/policy-evaluator.js +12 -5
- package/dist/runs/execution-planning.js +1 -178
- package/dist/runs/operation-execution.js +1 -1
- package/dist/runs/operation-retry.js +1 -129
- package/dist/runs/repositories/runs.js +1 -676
- package/dist/runs/repositories/task-scoped-command-grants.js +1 -462
- package/dist/runs/resume-after-approval-result.js +1 -84
- package/dist/runs/run-insights.js +1 -270
- package/dist/runs/run-service.js +1 -1470
- package/dist/runs/run-snapshot-export-service.js +1 -31
- package/dist/runs/sandbox-process-execution.js +1 -240
- package/dist/runs/sandbox-worktree-planning.js +1 -59
- package/dist/runs/schema.js +1 -5
- package/dist/runs/task-scoped-command-grant-service.js +1 -217
- package/dist/sdd/artifact-portability-service.js +1 -137
- package/dist/sdd/cockpit-read-model.js +1 -195
- package/dist/sdd/cockpit-types.js +1 -1
- package/dist/sdd/schema.js +1 -111
- package/dist/sdd/sdd-continuation-plan.js +1 -265
- package/dist/sdd/sdd-workflow-service.js +1 -822
- package/dist/setup/providers/claude-setup-adapter.js +11 -4
- package/dist/setup/providers/opencode-setup-adapter.js +10 -7
- package/dist/setup/setup-plan.js +20 -7
- package/dist/skills/boot-seed.js +1 -42
- package/dist/skills/personal-skills.js +1 -41
- package/dist/skills/repositories/skill-evaluation-requests.js +1 -190
- package/dist/skills/repositories/skill-evaluation-scenarios.js +1 -305
- package/dist/skills/repositories/skill-improvement-proposals.js +1 -355
- package/dist/skills/repositories/skills.js +1 -1077
- package/dist/skills/schema.js +1 -1
- package/dist/skills/skill-export-service.js +1 -34
- package/dist/skills/skill-index-service.js +1 -126
- package/dist/skills/skill-payload.js +1 -186
- package/dist/skills/skill-registry-service.js +1 -644
- package/dist/skills/skill-resolver.js +1 -368
- package/dist/skills/skill-seed-service.js +1 -242
- package/dist/skills/skill-status-service.js +1 -147
- package/dist/storage/agents/repositories/agent-seed-history.js +128 -0
- package/dist/storage/agents/repositories/agents.js +200 -0
- package/dist/storage/agents/repositories/manager-profile-overlays.js +90 -0
- package/dist/storage/memory/repositories/artifacts.js +67 -0
- package/dist/storage/memory/repositories/observations.js +217 -0
- package/dist/storage/memory/repositories/sessions.js +125 -0
- package/dist/storage/memory/repositories/traces.js +78 -0
- package/dist/storage/memory/sqlite/database.js +228 -0
- package/dist/storage/memory/storage-paths.js +72 -0
- package/dist/storage/runs/repositories/runs.js +676 -0
- package/dist/storage/runs/repositories/task-scoped-command-grants.js +464 -0
- package/dist/storage/skills/repositories/skill-evaluation-requests.js +190 -0
- package/dist/storage/skills/repositories/skill-evaluation-scenarios.js +305 -0
- package/dist/storage/skills/repositories/skill-improvement-proposals.js +355 -0
- package/dist/storage/skills/repositories/skills.js +1084 -0
- package/docs/architecture.md +2 -2
- package/docs/glossary.md +1 -1
- package/docs/mcp.md +1 -1
- package/docs/module-boundaries.md +114 -0
- package/docs/prd.md +1 -1
- package/docs/project-health-audit-v1.10.x.md +1 -1
- package/docs/providers.md +2 -2
- package/docs/safety.md +3 -3
- package/docs/sdd/archive/2026-06-26-ambitious-structure-reorganization/apply-progress.md +122 -0
- package/docs/sdd/archive/2026-06-26-ambitious-structure-reorganization/archive-report.md +61 -0
- package/docs/sdd/archive/2026-06-26-ambitious-structure-reorganization/design.md +66 -0
- package/docs/sdd/archive/2026-06-26-ambitious-structure-reorganization/proposal.md +79 -0
- package/docs/sdd/archive/2026-06-26-ambitious-structure-reorganization/spec.md +67 -0
- package/docs/sdd/archive/2026-06-26-ambitious-structure-reorganization/tasks.md +63 -0
- package/docs/sdd/archive/2026-06-26-ambitious-structure-reorganization/verify-report.md +71 -0
- package/docs/sdd/archive/2026-06-26-legacy-facade-cleanup/apply-progress.md +68 -0
- package/docs/sdd/archive/2026-06-26-legacy-facade-cleanup/archive-report.md +61 -0
- package/docs/sdd/archive/2026-06-26-legacy-facade-cleanup/design.md +43 -0
- package/docs/sdd/archive/2026-06-26-legacy-facade-cleanup/proposal.md +61 -0
- package/docs/sdd/archive/2026-06-26-legacy-facade-cleanup/spec.md +31 -0
- package/docs/sdd/archive/2026-06-26-legacy-facade-cleanup/tasks.md +27 -0
- package/docs/sdd/archive/2026-06-26-legacy-facade-cleanup/verify-report.md +58 -0
- package/docs/sdd/archive/2026-06-26-provider-install-adapter-boundary/apply-progress.md +65 -0
- package/docs/sdd/archive/2026-06-26-provider-install-adapter-boundary/archive-report.md +53 -0
- package/docs/sdd/archive/2026-06-26-provider-install-adapter-boundary/design.md +64 -0
- package/docs/sdd/archive/2026-06-26-provider-install-adapter-boundary/proposal.md +62 -0
- package/docs/sdd/archive/2026-06-26-provider-install-adapter-boundary/spec.md +51 -0
- package/docs/sdd/archive/2026-06-26-provider-install-adapter-boundary/tasks.md +50 -0
- package/docs/sdd/archive/2026-06-26-provider-install-adapter-boundary/verify-report.md +66 -0
- package/docs/sdd/manager-prompt-autonomy/apply-progress.md +28 -0
- package/docs/sdd/manager-prompt-autonomy/design.md +63 -0
- package/docs/sdd/manager-prompt-autonomy/proposal.md +57 -0
- package/docs/sdd/manager-prompt-autonomy/tasks.md +19 -0
- package/docs/storage.md +2 -2
- package/package.json +2 -2
- /package/dist/{mcp → adapters/claude/install}/claude-code-cli.js +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/001_initial.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/002_observation_revisions.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/003_agent_registry.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/004_run_runtime.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/005_run_approvals.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/006_run_operation_attempts.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/007_abandoned_operation_attempts.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/008_run_execution_plan_events.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/009_multiple_operation_attempts.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/010_skill_registry.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/011_skill_usage_resolution_outcomes.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/012_skill_improvement_proposals.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/013_skill_evaluation_scenarios.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/014_manager_profile_overlays.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/015_artifact_metadata.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/016_agent_seed_history.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/017_intent_signal_skill_targets.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/018_skill_system_v2.sql +0 -0
- /package/dist/{memory → storage/memory}/sqlite/migrations/019_task_scoped_command_grants.sql +0 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { render as renderInk } from 'ink';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { HomeTuiApp, homeTuiTabs, } from '../../cli/home-tui-app.js';
|
|
4
|
+
import { MemoryService } from '../../memory/memory-service.js';
|
|
5
|
+
import { openMemoryDatabase } from '../../memory/sqlite/database.js';
|
|
6
|
+
import { RunService } from '../../runs/run-service.js';
|
|
7
|
+
import { sddContinuationPlanFrom } from '../../sdd/sdd-continuation-plan.js';
|
|
8
|
+
import { SddWorkflowService } from '../../sdd/sdd-workflow-service.js';
|
|
9
|
+
import { SkillIndexService } from '../../skills/skill-index-service.js';
|
|
10
|
+
import { SkillRegistryService } from '../../skills/skill-registry-service.js';
|
|
11
|
+
import { okText } from './cli-help.js';
|
|
12
|
+
import { renderSetupPlan } from './setup-plan-renderer.js';
|
|
13
|
+
import { runSetupTuiController } from './setup-tui-controller.js';
|
|
14
|
+
import { keyIntentFromInput } from './tui/key-intents.js';
|
|
15
|
+
import { navigationIntentFromInput } from './tui/keymap.js';
|
|
16
|
+
import { nextItem } from './tui/navigation.js';
|
|
17
|
+
const enter = '\r';
|
|
18
|
+
const escapeKey = '\u001B';
|
|
19
|
+
const ctrlC = '\u0003';
|
|
20
|
+
const backspace = '\u007F';
|
|
21
|
+
const ctrlH = '\b';
|
|
22
|
+
const clearScreen = '\u001B[2J\u001B[3J\u001B[H';
|
|
23
|
+
export async function runHomeTuiController(input) {
|
|
24
|
+
const { stdin, stdout } = input.environment;
|
|
25
|
+
if (stdin === undefined || stdout === undefined)
|
|
26
|
+
return okText(renderSetupPlan(input.plan));
|
|
27
|
+
const width = tuiWidth(stdout);
|
|
28
|
+
let selectedTab = 'setup';
|
|
29
|
+
let view = 'overview';
|
|
30
|
+
let runsReadModel = { state: 'not-loaded' };
|
|
31
|
+
let skillsReadModel = { state: 'not-loaded' };
|
|
32
|
+
let sddInput = { change: '' };
|
|
33
|
+
let sddReadModel = { state: 'not-loaded' };
|
|
34
|
+
let helpOpen = false;
|
|
35
|
+
const app = renderInk(React.createElement(HomeTuiApp, { plan: input.plan, width, selectedTab, view, runsReadModel, skillsReadModel, sddInput, sddReadModel, helpOpen }), {
|
|
36
|
+
stdin: stdin,
|
|
37
|
+
stdout: stdout,
|
|
38
|
+
interactive: true,
|
|
39
|
+
patchConsole: false,
|
|
40
|
+
exitOnCtrlC: false,
|
|
41
|
+
});
|
|
42
|
+
const rerender = () => {
|
|
43
|
+
app.rerender(React.createElement(HomeTuiApp, { plan: input.plan, width, selectedTab, view, runsReadModel, skillsReadModel, sddInput, sddReadModel, helpOpen }));
|
|
44
|
+
};
|
|
45
|
+
stdin.setRawMode?.(true);
|
|
46
|
+
stdin.resume?.();
|
|
47
|
+
const action = await new Promise((resolve) => {
|
|
48
|
+
const listener = (chunk) => {
|
|
49
|
+
const value = chunk.toString();
|
|
50
|
+
const keyIntent = keyIntentFromInput(value);
|
|
51
|
+
if (keyIntent === 'toggle-help') {
|
|
52
|
+
helpOpen = !helpOpen;
|
|
53
|
+
rerender();
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (helpOpen) {
|
|
57
|
+
if (keyIntent === 'back' || value === escapeKey) {
|
|
58
|
+
helpOpen = false;
|
|
59
|
+
rerender();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (keyIntent === 'quit' || value === 'Q' || value === ctrlC) {
|
|
63
|
+
cleanup();
|
|
64
|
+
resolve('quit');
|
|
65
|
+
}
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (view === 'sdd-focus') {
|
|
69
|
+
if (value === ctrlC) {
|
|
70
|
+
cleanup();
|
|
71
|
+
resolve('quit');
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (value === escapeKey) {
|
|
75
|
+
view = 'overview';
|
|
76
|
+
helpOpen = false;
|
|
77
|
+
rerender();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (value === backspace || value === ctrlH) {
|
|
81
|
+
sddInput = { change: sddInput.change.slice(0, -1) };
|
|
82
|
+
sddReadModel = readHomeSdd(input.plan, sddInput.change);
|
|
83
|
+
rerender();
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const nextSddChange = appendSddChangeInput(sddInput.change, value);
|
|
87
|
+
if (nextSddChange !== sddInput.change) {
|
|
88
|
+
sddInput = { change: nextSddChange };
|
|
89
|
+
sddReadModel = readHomeSdd(input.plan, nextSddChange);
|
|
90
|
+
rerender();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (value === enter || value === '\n')
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const intent = navigationIntentFromInput(value);
|
|
97
|
+
if (value === 'q' || value === 'Q' || value === ctrlC) {
|
|
98
|
+
cleanup();
|
|
99
|
+
resolve('quit');
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (view !== 'overview' && (value === escapeKey || value === 'b' || value === 'B' || intent === 'back')) {
|
|
103
|
+
view = 'overview';
|
|
104
|
+
helpOpen = false;
|
|
105
|
+
rerender();
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (view === 'runs-focus' && (value === enter || value === '\n' || intent === 'select')) {
|
|
109
|
+
runsReadModel = selectFirstHomeRunDetail(runsReadModel);
|
|
110
|
+
rerender();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (intent === 'cancel') {
|
|
114
|
+
cleanup();
|
|
115
|
+
resolve('quit');
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if ((value === enter || value === '\n' || intent === 'select') && selectedTab === 'setup') {
|
|
119
|
+
cleanup();
|
|
120
|
+
resolve('open-setup');
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if ((value === enter || value === '\n' || intent === 'select') && selectedTab === 'status') {
|
|
124
|
+
view = 'status-focus';
|
|
125
|
+
helpOpen = false;
|
|
126
|
+
rerender();
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if ((value === enter || value === '\n' || intent === 'select') && selectedTab === 'runs') {
|
|
130
|
+
runsReadModel = readHomeRuns(input.plan);
|
|
131
|
+
view = 'runs-focus';
|
|
132
|
+
helpOpen = false;
|
|
133
|
+
rerender();
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
if ((value === enter || value === '\n' || intent === 'select') && selectedTab === 'sdd') {
|
|
137
|
+
sddReadModel = readHomeSdd(input.plan, sddInput.change);
|
|
138
|
+
view = 'sdd-focus';
|
|
139
|
+
helpOpen = false;
|
|
140
|
+
rerender();
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if ((value === enter || value === '\n' || intent === 'select') && selectedTab === 'skills') {
|
|
144
|
+
skillsReadModel = readHomeSkills(input.plan);
|
|
145
|
+
view = 'skills-focus';
|
|
146
|
+
helpOpen = false;
|
|
147
|
+
rerender();
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if ((value === enter || value === '\n' || intent === 'select') && selectedTab === 'provider') {
|
|
151
|
+
view = 'provider-focus';
|
|
152
|
+
helpOpen = false;
|
|
153
|
+
rerender();
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
if (value === enter || value === '\n' || intent === 'select')
|
|
157
|
+
return;
|
|
158
|
+
if (view !== 'overview')
|
|
159
|
+
return;
|
|
160
|
+
if (intent === 'next' || intent === 'down') {
|
|
161
|
+
selectedTab = nextItem(homeTuiTabs, selectedTab, 1);
|
|
162
|
+
rerender();
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (intent === 'back' || intent === 'up') {
|
|
166
|
+
selectedTab = nextItem(homeTuiTabs, selectedTab, -1);
|
|
167
|
+
rerender();
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
const cleanup = () => {
|
|
171
|
+
if (stdin.off !== undefined)
|
|
172
|
+
stdin.off('data', listener);
|
|
173
|
+
else
|
|
174
|
+
stdin.removeListener?.('data', listener);
|
|
175
|
+
stdin.setRawMode?.(false);
|
|
176
|
+
stdin.pause?.();
|
|
177
|
+
app.unmount();
|
|
178
|
+
};
|
|
179
|
+
stdin.on('data', listener);
|
|
180
|
+
});
|
|
181
|
+
await app.waitUntilExit();
|
|
182
|
+
if (action === 'open-setup') {
|
|
183
|
+
clearTerminalBeforeNestedTui(stdout);
|
|
184
|
+
return runSetupTuiController({ environment: input.environment, plan: input.plan });
|
|
185
|
+
}
|
|
186
|
+
return okText('');
|
|
187
|
+
}
|
|
188
|
+
function appendSddChangeInput(current, input) {
|
|
189
|
+
if (input.length !== 1 || current.length >= 80)
|
|
190
|
+
return current;
|
|
191
|
+
if (current.length === 0)
|
|
192
|
+
return /^[A-Za-z0-9]$/.test(input) ? input : current;
|
|
193
|
+
return /^[A-Za-z0-9._-]$/.test(input) ? `${current}${input}` : current;
|
|
194
|
+
}
|
|
195
|
+
function clearTerminalBeforeNestedTui(stdout) {
|
|
196
|
+
stdout.write(clearScreen);
|
|
197
|
+
}
|
|
198
|
+
function readHomeRuns(plan) {
|
|
199
|
+
const opened = openMemoryDatabase({ path: plan.db.path, readonly: true });
|
|
200
|
+
if (!opened.ok)
|
|
201
|
+
return { state: 'unavailable', databasePath: plan.db.path, message: opened.error.message };
|
|
202
|
+
try {
|
|
203
|
+
const service = new RunService(opened.value);
|
|
204
|
+
const recent = service.listRuns({ project: plan.project, limit: 5 });
|
|
205
|
+
if (!recent.ok)
|
|
206
|
+
return { state: 'unavailable', databasePath: plan.db.path, message: recent.error.message };
|
|
207
|
+
const interrupted = service.listRecentInterruptedRuns({ project: plan.project, limit: 5 });
|
|
208
|
+
if (!interrupted.ok)
|
|
209
|
+
return { state: 'unavailable', databasePath: plan.db.path, message: interrupted.error.message };
|
|
210
|
+
return {
|
|
211
|
+
state: 'ready',
|
|
212
|
+
databasePath: plan.db.path,
|
|
213
|
+
recent: recent.value.map(runRecordSummary),
|
|
214
|
+
interrupted: interrupted.value.map((run) => ({
|
|
215
|
+
id: run.runId,
|
|
216
|
+
status: run.status,
|
|
217
|
+
workflow: run.workflow,
|
|
218
|
+
phase: run.phase,
|
|
219
|
+
...(run.userIntent === undefined ? {} : { userIntent: run.userIntent }),
|
|
220
|
+
})),
|
|
221
|
+
details: collectRunDetails(service, [...interrupted.value.map((run) => run.runId), ...recent.value.map((run) => run.id)]),
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
finally {
|
|
225
|
+
opened.value.close();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
function collectRunDetails(service, runIds) {
|
|
229
|
+
const uniqueRunIds = [...new Set(runIds)];
|
|
230
|
+
const details = [];
|
|
231
|
+
for (const runId of uniqueRunIds) {
|
|
232
|
+
const run = service.getRun(runId);
|
|
233
|
+
if (!run.ok)
|
|
234
|
+
continue;
|
|
235
|
+
details.push(runDetailSummary(run.value));
|
|
236
|
+
}
|
|
237
|
+
return details;
|
|
238
|
+
}
|
|
239
|
+
function runDetailSummary(run) {
|
|
240
|
+
const userIntent = run.userIntent.trim();
|
|
241
|
+
const latestCheckpoint = run.checkpoints.at(-1);
|
|
242
|
+
const latestEvent = run.events.at(-1);
|
|
243
|
+
return {
|
|
244
|
+
id: run.id,
|
|
245
|
+
status: run.status,
|
|
246
|
+
workflow: run.workflow,
|
|
247
|
+
phase: run.phase,
|
|
248
|
+
...(userIntent.length === 0 ? {} : { userIntent }),
|
|
249
|
+
...(run.outcome === undefined ? {} : { outcome: run.outcome }),
|
|
250
|
+
...(run.outcomeReason === undefined ? {} : { outcomeReason: run.outcomeReason }),
|
|
251
|
+
events: run.events.length,
|
|
252
|
+
checkpoints: run.checkpoints.length,
|
|
253
|
+
approvals: run.approvals.length,
|
|
254
|
+
approvalStatusCounts: countApprovalStatuses(run.approvals.map((approval) => approval.status)),
|
|
255
|
+
attempts: run.operationAttempts.length,
|
|
256
|
+
attemptStatusCounts: countAttemptStatuses(run.operationAttempts.map((attempt) => attempt.status)),
|
|
257
|
+
...(latestCheckpoint === undefined ? {} : { latestCheckpointLabel: latestCheckpoint.label }),
|
|
258
|
+
...(latestEvent === undefined ? {} : { latestEventTitle: latestEvent.title }),
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
function countApprovalStatuses(statuses) {
|
|
262
|
+
return {
|
|
263
|
+
pending: statuses.filter((status) => status === 'pending').length,
|
|
264
|
+
approved: statuses.filter((status) => status === 'approved').length,
|
|
265
|
+
rejected: statuses.filter((status) => status === 'rejected').length,
|
|
266
|
+
cancelled: statuses.filter((status) => status === 'cancelled').length,
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
function countAttemptStatuses(statuses) {
|
|
270
|
+
return {
|
|
271
|
+
reserved: statuses.filter((status) => status === 'reserved').length,
|
|
272
|
+
succeeded: statuses.filter((status) => status === 'succeeded').length,
|
|
273
|
+
failed: statuses.filter((status) => status === 'failed').length,
|
|
274
|
+
abandoned: statuses.filter((status) => status === 'abandoned').length,
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
function selectFirstHomeRunDetail(runs) {
|
|
278
|
+
if (runs.state !== 'ready' || runs.selected !== undefined)
|
|
279
|
+
return runs;
|
|
280
|
+
const firstInterruptedId = runs.interrupted[0]?.id;
|
|
281
|
+
const firstRecentId = runs.recent[0]?.id;
|
|
282
|
+
const selectedId = firstInterruptedId ?? firstRecentId;
|
|
283
|
+
if (selectedId === undefined)
|
|
284
|
+
return runs;
|
|
285
|
+
const selected = runs.details.find((detail) => detail.id === selectedId);
|
|
286
|
+
return selected === undefined ? runs : { ...runs, selected };
|
|
287
|
+
}
|
|
288
|
+
function runRecordSummary(run) {
|
|
289
|
+
const userIntent = run.userIntent.trim();
|
|
290
|
+
return {
|
|
291
|
+
id: run.id,
|
|
292
|
+
status: run.status,
|
|
293
|
+
workflow: run.workflow,
|
|
294
|
+
phase: run.phase,
|
|
295
|
+
...(userIntent.length === 0 ? {} : { userIntent }),
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
function readHomeSkills(plan) {
|
|
299
|
+
const opened = openMemoryDatabase({ path: plan.db.path, readonly: true });
|
|
300
|
+
if (!opened.ok)
|
|
301
|
+
return { state: 'unavailable', databasePath: plan.db.path, message: opened.error.message };
|
|
302
|
+
try {
|
|
303
|
+
const registry = new SkillRegistryService(opened.value);
|
|
304
|
+
const index = new SkillIndexService(registry).getIndex({ project: plan.project, scope: 'project' });
|
|
305
|
+
if (!index.ok)
|
|
306
|
+
return { state: 'unavailable', databasePath: plan.db.path, message: index.error.message };
|
|
307
|
+
return { state: 'ready', databasePath: plan.db.path, index: index.value };
|
|
308
|
+
}
|
|
309
|
+
finally {
|
|
310
|
+
opened.value.close();
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
function readHomeSdd(plan, change) {
|
|
314
|
+
if (change.length === 0)
|
|
315
|
+
return { state: 'not-loaded' };
|
|
316
|
+
const opened = openMemoryDatabase({ path: plan.db.path, readonly: true });
|
|
317
|
+
if (!opened.ok)
|
|
318
|
+
return { state: 'unavailable', databasePath: plan.db.path, message: opened.error.message };
|
|
319
|
+
try {
|
|
320
|
+
const sdd = new SddWorkflowService(new MemoryService(opened.value));
|
|
321
|
+
const status = sdd.getStatus({ project: plan.project, change });
|
|
322
|
+
if (!status.ok)
|
|
323
|
+
return { state: 'unavailable', databasePath: plan.db.path, message: status.error.message };
|
|
324
|
+
const next = sdd.getNext({ project: plan.project, change });
|
|
325
|
+
if (!next.ok)
|
|
326
|
+
return { state: 'unavailable', databasePath: plan.db.path, message: next.error.message };
|
|
327
|
+
const cockpit = sdd.getCockpit({ project: plan.project, change });
|
|
328
|
+
if (!cockpit.ok)
|
|
329
|
+
return { state: 'unavailable', databasePath: plan.db.path, message: cockpit.error.message };
|
|
330
|
+
const continuation = sddContinuationPlanFrom({ project: plan.project, next: next.value, cockpit: cockpit.value });
|
|
331
|
+
return { state: 'ready', databasePath: plan.db.path, status: status.value, next: next.value, cockpit: cockpit.value, continuation };
|
|
332
|
+
}
|
|
333
|
+
finally {
|
|
334
|
+
opened.value.close();
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
function tuiWidth(stdout) {
|
|
338
|
+
const columns = stdout.columns;
|
|
339
|
+
const width = typeof columns === 'number' && Number.isFinite(columns) ? Math.floor(columns) : 88;
|
|
340
|
+
return Math.max(60, Math.min(width, 88));
|
|
341
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { dispatchCliAsync } from './dispatcher.js';
|
|
3
|
+
import { resolveMcpStartDatabasePath } from './mcp-start-path.js';
|
|
4
|
+
void main();
|
|
5
|
+
async function main() {
|
|
6
|
+
const argv = process.argv.slice(2);
|
|
7
|
+
if (isMcpStartCommand(argv)) {
|
|
8
|
+
const databasePath = resolveMcpStartDatabasePath(argv, process.cwd(), process.env, process.platform);
|
|
9
|
+
if (!databasePath.ok) {
|
|
10
|
+
process.stderr.write(`${databasePath.error.message}\n`);
|
|
11
|
+
process.exitCode = 1;
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const { startVgxMcpStdioServer } = await import('../../mcp/stdio-server.js');
|
|
15
|
+
await startVgxMcpStdioServer({ databasePath: databasePath.value });
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const result = await dispatchCliAsync(argv, { cwd: process.cwd(), env: process.env, stdin: process.stdin, stdout: process.stdout });
|
|
19
|
+
if (result.stdout)
|
|
20
|
+
process.stdout.write(result.stdout);
|
|
21
|
+
if (result.stderr)
|
|
22
|
+
process.stderr.write(result.stderr);
|
|
23
|
+
process.exitCode = result.exitCode;
|
|
24
|
+
}
|
|
25
|
+
function isMcpStartCommand(argv) {
|
|
26
|
+
return argv[0] === 'mcp' && argv[1] === 'start';
|
|
27
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { resolveMemoryDatabasePath } from '../../memory/storage-paths.js';
|
|
2
|
+
export function resolveMcpStartDatabasePath(argv, cwd, env, platform = process.platform) {
|
|
3
|
+
const explicit = readFlagValue(argv, 'db');
|
|
4
|
+
const resolved = resolveMemoryDatabasePath({ cwd, env, explicitPath: explicit, platform });
|
|
5
|
+
return resolved.ok ? { ok: true, value: resolved.value.path } : resolved;
|
|
6
|
+
}
|
|
7
|
+
function readFlagValue(argv, name) {
|
|
8
|
+
const prefix = `--${name}=`;
|
|
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(prefix))
|
|
14
|
+
return current.slice(prefix.length);
|
|
15
|
+
if (current === `--${name}`) {
|
|
16
|
+
const next = argv[index + 1];
|
|
17
|
+
return next !== undefined && !next.startsWith('--') ? next : undefined;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export function renderProductResume(resume) {
|
|
2
|
+
const lines = [
|
|
3
|
+
'Resume',
|
|
4
|
+
...resume.resume.map((line) => `- ${line}`),
|
|
5
|
+
'',
|
|
6
|
+
'Why',
|
|
7
|
+
...resume.why.map((line) => `- ${line}`),
|
|
8
|
+
'',
|
|
9
|
+
'Blockers',
|
|
10
|
+
...(resume.blockers.length === 0 ? ['- none'] : resume.blockers.map((line) => `- ${line}`)),
|
|
11
|
+
...(resume.candidateRuns.length === 0
|
|
12
|
+
? []
|
|
13
|
+
: [
|
|
14
|
+
'',
|
|
15
|
+
'Candidate runs',
|
|
16
|
+
...resume.candidateRuns.flatMap((run) => [
|
|
17
|
+
`- ${run.runId} [${run.status}] ${run.workflow}/${run.phase}`,
|
|
18
|
+
...(run.userIntent === undefined ? [] : [` Intent: ${run.userIntent}`]),
|
|
19
|
+
` Latest checkpoint: ${run.latestCheckpointLabel ?? 'none'}`,
|
|
20
|
+
` Resume command: ${run.command}`,
|
|
21
|
+
]),
|
|
22
|
+
]),
|
|
23
|
+
'',
|
|
24
|
+
'Command',
|
|
25
|
+
`- ${resume.command}`,
|
|
26
|
+
...(resume.manualNextCommands.length === 0 ? [] : ['', 'Related commands', ...resume.manualNextCommands.map((line) => `- ${line}`)]),
|
|
27
|
+
'',
|
|
28
|
+
'Safety',
|
|
29
|
+
...resume.safety.map((line) => `- ${line}`),
|
|
30
|
+
];
|
|
31
|
+
return `${lines.join('\n')}\n`;
|
|
32
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export function renderProductStatus(status) {
|
|
2
|
+
const commandHeading = productCommandHeading(status);
|
|
3
|
+
const lines = [
|
|
4
|
+
'Status',
|
|
5
|
+
...status.status.map((line) => `- ${line}`),
|
|
6
|
+
'',
|
|
7
|
+
'Blockers',
|
|
8
|
+
...status.blockers.map((line) => `- ${line}`),
|
|
9
|
+
'',
|
|
10
|
+
'Next',
|
|
11
|
+
...status.next.map((line) => `- ${line}`),
|
|
12
|
+
'',
|
|
13
|
+
commandHeading,
|
|
14
|
+
`- ${status.command}`,
|
|
15
|
+
'',
|
|
16
|
+
...(status.relatedRunContext === undefined ? [] : relatedRunContextLines(status.relatedRunContext, true)),
|
|
17
|
+
'Safety',
|
|
18
|
+
...status.safety.map((line) => `- ${line}`),
|
|
19
|
+
];
|
|
20
|
+
return `${lines.join('\n')}\n`;
|
|
21
|
+
}
|
|
22
|
+
export function buildProductNext(status) {
|
|
23
|
+
const blockers = status.blockers.filter((line) => line !== 'none');
|
|
24
|
+
const blocked = status.sddNextStatus === undefined ? blockers.length > 0 : status.sddNextStatus === 'blocked';
|
|
25
|
+
const visibleBlockers = blocked ? blockers : [];
|
|
26
|
+
const command = blocked ? buildBlockedNextCommand(status) : status.command;
|
|
27
|
+
return {
|
|
28
|
+
version: 1,
|
|
29
|
+
kind: 'product-next',
|
|
30
|
+
project: status.project,
|
|
31
|
+
...(status.change === undefined ? {} : { change: status.change }),
|
|
32
|
+
blocked,
|
|
33
|
+
next: status.next,
|
|
34
|
+
why: status.status,
|
|
35
|
+
blockers: visibleBlockers,
|
|
36
|
+
command,
|
|
37
|
+
...(status.relatedRunContext === undefined ? {} : { relatedRunContext: status.relatedRunContext }),
|
|
38
|
+
safety: status.safety,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function buildBlockedNextCommand(status) {
|
|
42
|
+
const change = status.change === undefined ? '<change>' : status.change;
|
|
43
|
+
const dbHint = status.command.includes('--db <path>') ? ' --db <path>' : '';
|
|
44
|
+
return `vgxness next --project ${status.project.value} --change ${change}${dbHint}`;
|
|
45
|
+
}
|
|
46
|
+
export function renderProductNext(next) {
|
|
47
|
+
const commandHeading = next.blocked ? 'Recovery/diagnostic command' : 'Continuation guidance command';
|
|
48
|
+
const lines = [
|
|
49
|
+
'Next',
|
|
50
|
+
...next.next.map((line) => `- ${line}`),
|
|
51
|
+
'',
|
|
52
|
+
'Why',
|
|
53
|
+
...next.why.map((line) => `- ${line}`),
|
|
54
|
+
...(next.blockers.length === 0 ? [] : ['', 'Blockers', ...next.blockers.map((line) => `- ${line}`)]),
|
|
55
|
+
'',
|
|
56
|
+
commandHeading,
|
|
57
|
+
`- ${next.command}`,
|
|
58
|
+
'',
|
|
59
|
+
...(next.relatedRunContext === undefined ? [] : relatedRunContextLines(next.relatedRunContext, true)),
|
|
60
|
+
'Safety',
|
|
61
|
+
...next.safety.map((line) => `- ${line}`),
|
|
62
|
+
];
|
|
63
|
+
return `${lines.join('\n')}\n`;
|
|
64
|
+
}
|
|
65
|
+
function productCommandHeading(status) {
|
|
66
|
+
if (status.sddNextStatus === 'runnable')
|
|
67
|
+
return 'Continuation guidance command';
|
|
68
|
+
return 'Recovery/diagnostic command';
|
|
69
|
+
}
|
|
70
|
+
function relatedRunContextLines(relatedRunContext, includeTrailingBlank) {
|
|
71
|
+
return [
|
|
72
|
+
'Related interrupted run:',
|
|
73
|
+
`- Run ID: ${relatedRunContext.runId}`,
|
|
74
|
+
`- Status: ${relatedRunContext.status}`,
|
|
75
|
+
`- Workflow/phase: ${relatedRunContext.workflow}/${relatedRunContext.phase}`,
|
|
76
|
+
`- Latest checkpoint: ${relatedRunContext.latestCheckpointLabel ?? 'none'}`,
|
|
77
|
+
`- Recommendation: ${relatedRunContext.recommendation}`,
|
|
78
|
+
`- Resume command: ${relatedRunContext.resumeCommand}`,
|
|
79
|
+
...(includeTrailingBlank ? [''] : []),
|
|
80
|
+
];
|
|
81
|
+
}
|