vgxness 1.14.1 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/agent-selector-resolver.js +23 -0
- package/dist/agents/canonical-agent-manifest.js +27 -25
- package/dist/cli/cli-help.js +10 -4
- package/dist/cli/commands/agent-skill-dispatcher.js +26 -1
- package/dist/cli/commands/index.js +1 -1
- package/dist/cli/commands/interactive-entrypoint-dispatcher.js +2 -2
- package/dist/cli/commands/setup-dispatcher.js +63 -0
- package/dist/cli/dispatcher.js +16 -4
- package/dist/cli/home-tui-app.js +387 -0
- package/dist/cli/home-tui-controller.js +296 -0
- package/dist/cli/sdd-renderer.js +7 -0
- package/dist/cli/setup-plan-renderer.js +60 -36
- package/dist/cli/setup-tui-app.js +130 -0
- package/dist/cli/setup-tui-controller.js +89 -0
- package/dist/cli/tui/ink/components.js +38 -0
- package/dist/cli/tui/ink/theme.js +36 -0
- package/dist/mcp/control-plane.js +7 -0
- package/dist/mcp/opencode-handoff-preview.js +41 -14
- package/dist/mcp/schema.js +25 -0
- package/dist/mcp/stdio-server.js +4 -2
- package/dist/mcp/validation.js +14 -0
- package/dist/providers/opencode/manager-payload.js +21 -12
- package/dist/runs/execution-planning.js +67 -0
- package/dist/runs/run-service.js +10 -3
- package/dist/sdd/sdd-continuation-plan.js +46 -0
- package/dist/setup/setup-plan.js +4 -2
- package/dist/skills/skill-export-service.js +34 -0
- package/dist/skills/skill-index-service.js +115 -0
- package/dist/skills/skill-payload.js +1 -0
- package/dist/skills/skill-resolver.js +17 -13
- package/dist/workspace-strategy/diagnostics.js +34 -0
- package/dist/workspace-strategy/index.js +3 -0
- package/dist/workspace-strategy/recommendation-policy.js +196 -0
- package/dist/workspace-strategy/schema.js +1 -0
- package/docs/architecture.md +13 -2
- package/docs/cli.md +24 -4
- package/docs/glossary.md +5 -1
- package/docs/mcp.md +10 -3
- package/docs/roadmap.md +2 -2
- package/package.json +4 -1
- package/seeds/skills/skill-seed-v1.json +4 -4
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const agentSelectorNameFallbackCode = 'AGENT_SELECTOR_NAME_FALLBACK';
|
|
2
|
+
export function resolveAgentSelector(input, lookup) {
|
|
3
|
+
const byId = lookup.getById(input.selector);
|
|
4
|
+
if (byId.ok)
|
|
5
|
+
return ok({ agent: byId.value });
|
|
6
|
+
const byName = lookup.getByName(input.project, input.scope, input.selector);
|
|
7
|
+
if (byName.ok) {
|
|
8
|
+
return ok({
|
|
9
|
+
agent: byName.value,
|
|
10
|
+
warning: `${agentSelectorNameFallbackCode}: selector "${input.selector}" matched scoped agent name; using canonical agent id "${byName.value.id}" name "${byName.value.name}".`,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
ok: false,
|
|
15
|
+
error: {
|
|
16
|
+
code: 'not_found',
|
|
17
|
+
message: `Agent selector not found: "${input.selector}". Looked up registry id first, then scoped agent name for project "${input.project}" and scope "${input.scope}". Accepted forms: canonical agent id or agent name within the requested project/scope.`,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function ok(value) {
|
|
22
|
+
return { ok: true, value };
|
|
23
|
+
}
|
|
@@ -2,7 +2,7 @@ import { canonicalBehaviorContractVersion } from '../behavior/behavior-contract-
|
|
|
2
2
|
export const canonicalDefaultAgentName = 'vgxness-manager';
|
|
3
3
|
export const canonicalOpenCodeDefaultModel = 'openai/gpt-5.5';
|
|
4
4
|
export const canonicalOpenCodeManagerReasoningEffort = 'high';
|
|
5
|
-
export const canonicalPromptContractVersion =
|
|
5
|
+
export const canonicalPromptContractVersion = 12;
|
|
6
6
|
export const canonicalSddSubagentNames = [
|
|
7
7
|
'vgxness-sdd-explore',
|
|
8
8
|
'vgxness-sdd-propose',
|
|
@@ -146,50 +146,52 @@ export function createCanonicalOpenCodeSddSubagentPrompt(name) {
|
|
|
146
146
|
* This feeds the OpenCode default config and Claude generated agent files; it is
|
|
147
147
|
* intentionally separate from registry/seed instructions below.
|
|
148
148
|
*/
|
|
149
|
-
export const canonicalOpenCodeManagerPrompt = `# VGXNESS Manager
|
|
149
|
+
export const canonicalOpenCodeManagerPrompt = `# VGXNESS Manager
|
|
150
150
|
|
|
151
|
-
Bind
|
|
151
|
+
Bind to \`vgxness-manager\` only. Executors use their own prompts.
|
|
152
152
|
|
|
153
153
|
## Role
|
|
154
|
-
Coordinate SDD; keep chat thin, use VGXNESS MCP
|
|
154
|
+
Coordinate SDD; keep chat thin, use VGXNESS MCP state, delegate to exact SDD subagent. Coach while coordinating: teach briefly; explain practical tradeoffs, risk/effort/unknowns; challenge weak assumptions; keep user in control; avoid lectures.
|
|
155
155
|
|
|
156
156
|
## Non-negotiable governance
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
- Before
|
|
160
|
-
-
|
|
157
|
+
- VGXNESS uses SQLite artifacts/control-plane; OpenCode as primary provider; artifacts are not openspec files. Do not write to \`openspec/\`.
|
|
158
|
+
- SDD artifact acceptance is human-only. Artifact presence is not acceptance. Never infer or fabricate acceptance from generated output, subagent/model output, file presence, confidence, or legacy artifacts; draft/rejected/superseded/stale/unaccepted artifacts are not accepted until a human acceptance record exists.
|
|
159
|
+
- Before phase advancement, call \`vgxness_sdd_status\`/\`vgxness_sdd_next\` plus \`vgxness_sdd_ready\` or \`vgxness_sdd_get_readiness\`.
|
|
160
|
+
- Before risky VGX-managed side effects (edit, shell/tests, git, network, provider-tool, secrets, external-directory, destructive, privileged, ambiguous), call \`vgxness_run_preflight\` with runId/workflow/phase/agent when available. Stop on approval/block; never invent approval.
|
|
161
|
+
- Direct human acceptance of an exact SDD artifact via \`vgxness_sdd_accept_artifact\` is not a generic SDD write for manager routing: do not call \`vgxness_run_preflight\` solely for that acceptance; require the user explicitly accepted the exact project/change/phase artifact, \`acceptedBy.type\` is \`"human"\`, \`acceptedBy.id\` is non-empty, and status/readiness confirms the artifact is eligible. This shortcut applies only to \`vgxness_sdd_accept_artifact\` and the trusted draft autorun chain described below; excludes edits, shell/tests, git, provider config, memory writes, external paths, secrets, destructive/privileged/ambiguous operations.
|
|
161
162
|
- OpenCode native/provider tools are governance-v1 audit-only/non-hard-blocking. Report warnings; do not say native OpenCode tools are hard-blocked by config.
|
|
162
|
-
- Do not mutate provider/global OpenCode config. Do not
|
|
163
|
+
- Do not mutate provider/global OpenCode config. Do not publish packages unless explicitly requested. Never revert/overwrite unrelated user work. Preserve \`permission.task\` deny-by-default with only exact known SDD subagents.
|
|
163
164
|
- Do not change provider model/reasoning config unless explicitly requested.
|
|
164
165
|
|
|
165
166
|
## Flexible governance routing
|
|
166
|
-
Use
|
|
167
|
+
Use lightest safe path: T0-2 direct, T3 preflight, T4 formal SDD for governance, permissions, acceptance, architecture/security, or cross-surface behavior. Provider status/doctor/preview/handoff read-only/audit-only; writes gated.
|
|
167
168
|
|
|
168
169
|
## Provider-native daily flow
|
|
169
|
-
SDD happens in OpenCode via conversation, VGXNESS MCP, and SDD subagents. No terminal SDD phase commands
|
|
170
|
+
SDD happens in OpenCode via conversation, VGXNESS MCP, and SDD subagents. No terminal SDD phase commands. CLI is an escape hatch for bootstrap, doctor, recovery, setup gaps, or explicit request.
|
|
170
171
|
|
|
171
172
|
## MCP playbook
|
|
172
|
-
- For starting, resuming, or recovering context: prefer \`vgxness_context_cockpit\`; treat \`vgxness_session_restore\` as one signal, not truth. For ending, pausing, handing off, or compacting: \`vgxness_session_close\` with
|
|
173
|
-
-
|
|
174
|
-
-
|
|
175
|
-
-
|
|
176
|
-
-
|
|
177
|
-
-
|
|
178
|
-
-
|
|
179
|
-
-
|
|
173
|
+
- For starting, resuming, or recovering context: prefer \`vgxness_context_cockpit\`; treat \`vgxness_session_restore\` as one signal, not truth. For ending, pausing, handing off, or compacting: \`vgxness_session_close\` with session id and actor \`manager\`; if no id, do not invent one and summarize.
|
|
174
|
+
- Proposal clarity: if product/business clarity is missing, run a proposal question round.
|
|
175
|
+
- SDD artifacts: guide with \`vgxness_sdd_next\`/\`vgxness_sdd_cockpit\`; list/read with \`vgxness_sdd_get_artifact\`/\`vgxness_sdd_list_artifacts\`; prefer \`payloadMode: "compact"\` so primary context stays clean; use verbose only when required, preferably inside the delegated phase subagent. Save with \`vgxness_sdd_save_artifact\` after the right flow. Use \`vgxness_sdd_reopen_artifact\` only for rejected artifacts returning to draft, with explicit human actor/audit context.
|
|
176
|
+
- Trusted draft autorun: when the exact \`proposal\` artifact is already accepted, run exactly \`spec -> design -> tasks\` without extra human confirmation via exact subagents; save drafts with \`vgxness_sdd_save_artifact\`. This is draft-only planning, not acceptance or completion. Not for explore/proposal/apply-progress/verify/archive, rejected/superseded artifacts, accepted overwrites, or risky side effects (provider config, edits, shell/tests, git, secrets, external/destructive/privileged/ambiguous). Re-check status/readiness before/after; generated spec/design drafts can feed design/tasks but remain unaccepted.
|
|
177
|
+
- Acceptance/readiness: check SDD status/readiness for the exact project/change/phase; confirm explicit human acceptance; call \`vgxness_sdd_accept_artifact\` directly with audit context (\`acceptedBy.type: "human"\`, non-empty \`acceptedBy.id\`, runId, agentId); re-check status/readiness before reporting state. Do not add \`vgxness_run_preflight\` solely for that exact direct acceptance call. Ambiguous replies count only when tied to an immediate exact acceptance prompt. Use \`vgxness_governance_report\` for readiness, artifact states, preflight posture, audit warnings.
|
|
178
|
+
- Memory: \`vgxness_memory_search\`/\`vgxness_memory_get\` for prior work/unclear context; \`vgxness_memory_save\` for durable discoveries, decisions, bug fixes, config, patterns, or preferences; \`vgxness_memory_update\` only to correct/evolve a known id. Do not duplicate full SDD artifacts as memory.
|
|
179
|
+
- Agents/skills: Skill registry index-first; resolve skills by registry, exact path, and task context; read exact paths; do not invent summaries. Resolve phase with \`vgxness_agent_resolve\`. Preview mode does not execute a provider or write provider config for \`vgxness_agent_activate\`, \`vgxness_opencode_manager_payload\`, or \`vgxness_skill_payload\`. \`vgxness_manager_profile_get\` before changes; \`vgxness_manager_profile_set\` needs explicit human authorization.
|
|
180
|
+
- Runs/recovery: \`vgxness_run_start\`/\`vgxness_run_list\`/\`vgxness_run_get\`; checkpoint with \`vgxness_run_checkpoint\`, preflight with \`vgxness_run_preflight\`, close with \`vgxness_run_finalize\`. Unknown runId: \`vgxness_run_resume_candidates\`. For interrupted runs, inspect with \`vgxness_run_resume_inspect\`, then call \`vgxness_run_resume_gate\` with approvalId from pendingApprovals/inspect; never pass runId as approvalId. Follow safe \`recommendedActions[]\`.
|
|
181
|
+
- Provider diagnostics: \`vgxness_provider_status\`/\`vgxness_provider_doctor\` read-only; report \`providerEvidence.evidenceLevel\` and \`hostToolPresenceVerified\` limits.
|
|
180
182
|
|
|
181
183
|
## Minimum flows
|
|
182
|
-
- Simple answer: inline;
|
|
183
|
-
- Proposal/spec/design/tasks: status/next -> readiness ->
|
|
184
|
-
- Apply/verify:
|
|
185
|
-
- Config/provider/prompt change: inspect manager/profile
|
|
184
|
+
- Simple answer: inline; no run by default.
|
|
185
|
+
- Proposal/spec/design/tasks: status/next -> readiness -> prereqs -> exact subagent -> delegate -> persist; if proposal is accepted, spec/design/tasks may use trusted draft autorun without extra confirmation; drafts remain unaccepted.
|
|
186
|
+
- Apply/verify: prereqs -> artifacts -> exact subagent -> start/recover run -> preflight writes/shell/git/tests -> delegate -> checkpoint -> save -> finalize. Before apply/PR, review workload guard: estimate size/risk/reviewer load; recommend slicing into work units or chained PRs when large.
|
|
187
|
+
- Config/provider/prompt change: inspect manager/profile/payload first; persistence needs explicit human authorization.
|
|
186
188
|
- Recovery: MCP first. Continue: use \`vgxness_sdd_continue\`; read-only/advisory: no provider execution, run creation, artifact mutation, provider config/openspec writes, or acceptance/apply-progress bypass. CLI \`vgxness sdd continue\` is human fallback only. \`vgxness resume --project\` is for candidate runs. The removed experimental \`vgxness code\` runtime is not an SDD fallback.
|
|
187
189
|
|
|
188
190
|
## Delegation thresholds
|
|
189
|
-
Default to delegation for SDD phase-shaped work, repository exploration beyond one narrow lookup, implementation, verification, incident recovery, or multi-step analysis. Inline only conversational guidance, single-fact lookup, MCP/status/readiness checks, and trivial mechanical edits when safe. When uncertain between inline work and subagent work, delegate to the exact smallest SDD subagent. Never delegate to unknown agents; use exact
|
|
191
|
+
Default to delegation for SDD phase-shaped work, repository exploration beyond one narrow lookup, implementation, verification, incident recovery, or multi-step analysis. Inline only conversational guidance, single-fact lookup, MCP/status/readiness checks, and trivial mechanical edits when safe. When uncertain between inline work and subagent work, delegate to the exact smallest SDD subagent. Never delegate to unknown agents; use exact phase mapping.
|
|
190
192
|
|
|
191
193
|
## Output
|
|
192
|
-
Be concise
|
|
194
|
+
Be concise.`;
|
|
193
195
|
/**
|
|
194
196
|
* Registry/seed instructions for the manager agent definition.
|
|
195
197
|
* These feed the canonical manifest, checked-in seed, boot upgrade, registry
|
package/dist/cli/cli-help.js
CHANGED
|
@@ -12,6 +12,7 @@ Areas:
|
|
|
12
12
|
init [--project <name>] [--provider opencode|claude|none] [--scope user|global|personal] [--db global|project-local|custom|<path>] [--db-path <path>] [--mode mcp-only|mcp-plus-agents] [--json]
|
|
13
13
|
setup plan [--project <name>] [--provider opencode|claude|none] [--scope user|global|personal] [--db global|project-local|custom|<path>] [--db-path <path>] [--mode mcp-only|mcp-plus-agents] [--json]
|
|
14
14
|
setup apply --yes [--project <name>] [--provider opencode|claude|none] [--scope user|global|personal] [--db global|project-local|custom|<path>] [--db-path <path>] [--mode mcp-only|mcp-plus-agents]
|
|
15
|
+
setup reinstall [--yes] [--project <name>] [--scope user|global|personal] [--db global|project-local|custom|<path>] [--db-path <path>] [--mode mcp-only|mcp-plus-agents] [--json]
|
|
15
16
|
setup backup list --provider opencode [--scope project|user|global] [--target <path>] [--json]
|
|
16
17
|
setup rollback --backup <path> [--preview|--yes] [--json]
|
|
17
18
|
setup status [--project <name>] [--scope project|personal] [--db <path>] [--json]
|
|
@@ -23,7 +24,7 @@ Areas:
|
|
|
23
24
|
Next answers "what should I do now?" with a shorter next-action view.
|
|
24
25
|
Resume answers "how do I continue interrupted work?" with run inspection guidance.
|
|
25
26
|
Without --change or --run-id they stay orientation-only and do not open local memory; with --change or --run-id they read SQLite read-only. Pass --json for automation.
|
|
26
|
-
Setup plan/init default to human-readable read-only output; pass --json for automation. VGX-managed provider configuration is user-global only for OpenCode and Claude; setup apply writes provider config only with --yes and uses the global user DB plus mcp-plus-agents by default.
|
|
27
|
+
Setup plan/init default to human-readable read-only output; pass --json for automation. VGX-managed provider configuration is user-global only for OpenCode and Claude; setup apply writes provider config only with --yes and uses the global user DB plus mcp-plus-agents by default. setup reinstall is the explicit safe overwrite path: it replaces only VGXNESS-managed OpenCode entries, preserves unrelated config, and still requires --yes to write.
|
|
27
28
|
Setup status defaults to human-readable read-only output; pass --json for automation. It never writes provider config or executes providers.
|
|
28
29
|
Doctor defaults to human-readable output; pass --json for automation.
|
|
29
30
|
Verification plans are read-only recommendations only; they never execute commands, write provider config, persist results, mutate SDD artifacts, or infer acceptance.
|
|
@@ -40,8 +41,9 @@ Areas:
|
|
|
40
41
|
Seed loading writes only to the local registry; it does not install or write .opencode/, .claude/, or provider config.
|
|
41
42
|
|
|
42
43
|
opencode preview --provider opencode (--agent <name> | --agent-id <id>) --project <name> --change <id> --phase <phase> [--scope project|personal]
|
|
44
|
+
OpenCode CLI preview prints the legacy injection preview JSON for inspection; MCP opencode_handoff_preview is the read-only conversation handoff preview and can be paired with opencode_manager_payload for verbose manager payload details.
|
|
43
45
|
|
|
44
|
-
|
|
46
|
+
Interactive Home TUI opens from \`vgxness\` in a real terminal; non-TTY use prints safe guidance. Daily SDD progression should happen inside OpenCode through conversation, VGXNESS MCP, and hidden SDD subagents; use status/next/sdd continue for read-only CLI guidance.
|
|
45
47
|
|
|
46
48
|
orchestrator preview --project <name> --intent <text> [--change <id>] [--db <path>]
|
|
47
49
|
Orchestrator preview classifies natural-language requests only; it never executes providers, edits files, records runs, or writes provider config.
|
|
@@ -81,6 +83,8 @@ Areas:
|
|
|
81
83
|
skills detach (--id <id> | --project <name> --name <name>) --target-type agent|subagent|workflow-phase|provider-adapter|intent-signal --target-key <key>
|
|
82
84
|
skills record-usage (--id <id> | --project <name> --name <name>) --outcome selected|injected|helped|failed|neutral [--run-id <id>]
|
|
83
85
|
skills resolve [--agent <name> | --agent-id <id>] [--project <name>] [--workflow <name>] [--phase <name>] [--intent-signals a,b] [--provider <name>] [--run <id>] [--record-usage selected|injected]
|
|
86
|
+
skills index --project <name> --scope project|personal
|
|
87
|
+
skills export --project <name> --scope project|personal
|
|
84
88
|
skills status --project <name> [--scope project|personal] [--provider opencode] [--mode agent|subagent] [--agent <name-or-id>]
|
|
85
89
|
skills payload [--agent <name> | --agent-id <id>] [--project <name>] [--workflow <name>] [--phase <name>] [--intent-signals a,b] [--provider <name>]
|
|
86
90
|
skills propose (--id <id> | --project <name> --name <name>) --proposed-version <version> --source-kind path|url|inline --rationale <text>
|
|
@@ -91,14 +95,15 @@ Areas:
|
|
|
91
95
|
skills list-evaluation-results [--scenario <id>] [--skill-id <id>] [--proposal <id>] [--version-id <id>] [--evaluator <actor>] [--status passed|failed|needs-review|not-applicable]
|
|
92
96
|
skills get-proposal --proposal <id>
|
|
93
97
|
skills submit-proposal|approve-proposal|reject-proposal|cancel-proposal|apply-proposal --proposal <id> --actor <name> [--reason <text>]
|
|
98
|
+
Skills export returns a read-only registry manifest for inspection/automation only; it is not backup, restore, import, or provider/native skill installation.
|
|
94
99
|
|
|
95
100
|
subagents register --parent-agent-id <id> --project <name> --name <name> --description <text> --instructions <text>
|
|
96
101
|
subagents register --file <subagent.json>
|
|
97
102
|
subagents list --parent-agent-id <id>
|
|
98
103
|
subagents get --id <id> | --project <name> --name <name> [--scope project|personal]
|
|
99
104
|
|
|
100
|
-
No args prints
|
|
101
|
-
Setup
|
|
105
|
+
No args opens the read-only Home TUI in an interactive terminal; non-TTY prints safe guidance and exits 0 without writing provider config.
|
|
106
|
+
Setup can run as an interactive TUI or as CLI commands: use setup plan/status for read-only guidance, setup apply --yes for first install, and setup reinstall --yes only after reviewing the VGXNESS-managed overwrite warning.
|
|
102
107
|
Provider setup support: OpenCode first-class supported default guided install; Claude first-class supported guarded user-global install; project/local provider files are diagnostics only; Antigravity placeholder; Custom/future extension point.
|
|
103
108
|
Provider config writes/install/apply are external-only and require explicit confirmation.
|
|
104
109
|
|
|
@@ -139,6 +144,7 @@ Areas:
|
|
|
139
144
|
runs finish --run-id <id> --status completed|failed|blocked|cancelled --outcome <outcome> [--reason <text>]
|
|
140
145
|
runs permission-check --run-id <id> --category <category> --operation <name> [--path <path>] [--agent-id <id>] [--destructive] [--external] [--privileged] [--ambiguous]
|
|
141
146
|
runs preflight --run-id <id> --category <category> --operation <name> [--workspace <path>] [--path <path>] [--provider-tool <name>] [--agent-id <id>] [--destructive] [--external] [--privileged] [--ambiguous]
|
|
147
|
+
runs preflight output includes workspaceStrategy recommendation JSON and does not create branches, worktrees, or PRs.
|
|
142
148
|
runs approvals --run <run-id>
|
|
143
149
|
runs approve|reject|cancel-approval --approval <id> --actor <name> [--reason <text>]
|
|
144
150
|
runs retry-check --approval <id> [--policy <json>]
|
|
@@ -5,6 +5,8 @@ import { getProviderRenderer } from '../../agents/renderers/index.js';
|
|
|
5
5
|
import { ManagerProfileOverlayRepository } from '../../agents/repositories/manager-profile-overlays.js';
|
|
6
6
|
import { createAgentRegistryToolHandlers } from '../../harness/tools/agents.js';
|
|
7
7
|
import { runBootSkillSeed } from '../../skills/boot-seed.js';
|
|
8
|
+
import { SkillExportService } from '../../skills/skill-export-service.js';
|
|
9
|
+
import { SkillIndexService } from '../../skills/skill-index-service.js';
|
|
8
10
|
import { SkillRegistryService } from '../../skills/skill-registry-service.js';
|
|
9
11
|
import { SkillStatusService } from '../../skills/skill-status-service.js';
|
|
10
12
|
import { csvFlag, instructionKindFlag, jsonFlag, optionalJsonFlag, optionalModeFlag, optionalScopeFlag, optionalSkillEvaluationResultStatusFlag, optionalSkillImprovementProposalStatusFlag, optionalSkillResolutionUsageFlag, optionalSkillTargetTypeFlag, optionalSkillVersionStatusFlag, optionalStringFlag, requiredFlag, scopeFlag, skillEvaluationResultStatusFlag, skillSourceFromFlags, skillTargetTypeFlag, skillUsageOutcomeFlag, } from '../cli-flags.js';
|
|
@@ -88,6 +90,17 @@ function skillStatusInput(flags) {
|
|
|
88
90
|
},
|
|
89
91
|
};
|
|
90
92
|
}
|
|
93
|
+
function skillIndexInput(flags) {
|
|
94
|
+
const project = requiredFlag(flags, 'project');
|
|
95
|
+
const scope = requiredFlag(flags, 'scope');
|
|
96
|
+
if (!project.ok)
|
|
97
|
+
return project;
|
|
98
|
+
if (!scope.ok)
|
|
99
|
+
return scope;
|
|
100
|
+
if (scope.value !== 'project' && scope.value !== 'personal')
|
|
101
|
+
return validationFailure('--scope must be project or personal');
|
|
102
|
+
return { ok: true, value: { project: project.value, scope: scope.value } };
|
|
103
|
+
}
|
|
91
104
|
function skillPayloadInput(flags) {
|
|
92
105
|
if (flags['record-usage'] !== undefined)
|
|
93
106
|
return validationFailure('skills payload is read-only; use skills resolve with --record-usage for explicit usage writes');
|
|
@@ -504,6 +517,18 @@ export function runSkillCommand(command, parsed, database, environment) {
|
|
|
504
517
|
const input = resolveSkillsInput(parsed.flags);
|
|
505
518
|
return input.ok ? jsonResult(registry.resolveSkills(input.value)) : resultFailure(input);
|
|
506
519
|
}
|
|
520
|
+
if (command === 'index') {
|
|
521
|
+
const input = skillIndexInput(parsed.flags);
|
|
522
|
+
if (!input.ok)
|
|
523
|
+
return resultFailure(input);
|
|
524
|
+
return jsonResult(new SkillIndexService(registry).getIndex(input.value));
|
|
525
|
+
}
|
|
526
|
+
if (command === 'export') {
|
|
527
|
+
const input = skillIndexInput(parsed.flags);
|
|
528
|
+
if (!input.ok)
|
|
529
|
+
return resultFailure(input);
|
|
530
|
+
return jsonResult(new SkillExportService(new SkillIndexService(registry)).export(input.value));
|
|
531
|
+
}
|
|
507
532
|
if (command === 'status') {
|
|
508
533
|
const input = skillStatusInput(parsed.flags);
|
|
509
534
|
if (!input.ok)
|
|
@@ -672,4 +697,4 @@ export function runSkillCommand(command, parsed, database, environment) {
|
|
|
672
697
|
return usageFailure(`Unknown skills command: ${command}`);
|
|
673
698
|
}
|
|
674
699
|
// Re-export helpers for external use
|
|
675
|
-
export { expectAgentMode, managerProfileInput, managerProfileOverlayInput, proposalActorInput, registerPayload, resolveAgentForRender, resolveAgentsInput, resolveSkill, resolveSkillsInput, resolveSubagentsForRender, scenarioNameFlag, skillPayloadInput, skillStatusInput, validateFileInputIsComplete, };
|
|
700
|
+
export { expectAgentMode, managerProfileInput, managerProfileOverlayInput, proposalActorInput, registerPayload, resolveAgentForRender, resolveAgentsInput, resolveSkill, resolveSkillsInput, resolveSubagentsForRender, scenarioNameFlag, skillPayloadInput, skillIndexInput, skillStatusInput, validateFileInputIsComplete, };
|
|
@@ -4,6 +4,6 @@ export { runDoctorAliasCommand, runMcpDoctorCommand, runMcpDoctorOpenCodeCommand
|
|
|
4
4
|
export { runMemoryCommand, runMemoryImportCommand, runOpenCodeCommand, runOrchestratorCommand, runSddCommand } from './memory-sdd-dispatcher.js';
|
|
5
5
|
export { runApprovalsCommand, runPermissionsCommand, runRunsCommand } from './run-permission-dispatcher.js';
|
|
6
6
|
export { runProductNextCommand, runProductResumeCommand, runProductStatusCommand } from './status-dispatcher.js';
|
|
7
|
-
export { applySetupPlanInput, collectRunDetails, collectRunInsights, createSetupLifecycleService, promptSetupWizard, readSetupStatus, runInitCommand, runSetupApplyCommand, runSetupBackupCommand, runSetupLifecycleCommand, runSetupPlanCommand, runSetupRollbackCommand, setupMcpEvidence, setupPlanInputFromFlags, } from './setup-dispatcher.js';
|
|
7
|
+
export { applySetupPlanInput, collectRunDetails, collectRunInsights, createSetupLifecycleService, promptSetupWizard, readSetupStatus, runHomeTuiCommand, runInitCommand, runSetupApplyCommand, runSetupBackupCommand, runSetupLifecycleCommand, runSetupPlanCommand, runSetupReinstallApplyCommand, runSetupReinstallCommand, runSetupRollbackCommand, setupMcpEvidence, setupPlanInputFromFlags, } from './setup-dispatcher.js';
|
|
8
8
|
export { runWorkflowExecuteCommand, runWorkflowPreviewCommand, runWorkflowRunCommand } from './workflow-dispatcher.js';
|
|
9
9
|
export { runVerificationPlanCommand, runVerificationReportCommand } from './verification-dispatcher.js';
|
|
@@ -2,8 +2,8 @@ import { okText } from '../cli-help.js';
|
|
|
2
2
|
function defaultNoArgsGuidance() {
|
|
3
3
|
return ([
|
|
4
4
|
'VGXNESS no-args entrypoint is safe and deterministic; no local DB was opened and no provider config was written.',
|
|
5
|
-
'
|
|
6
|
-
'Next: use `vgxness
|
|
5
|
+
'In a real terminal, `vgxness` opens the read-only Home TUI. In non-TTY contexts, use explicit CLI commands.',
|
|
6
|
+
'Next: use `vgxness setup plan`, `vgxness init --plan`, `vgxness status`, `vgxness next`, or `vgxness --help`.',
|
|
7
7
|
].join('\n') + '\n');
|
|
8
8
|
}
|
|
9
9
|
export async function runDefaultInteractiveEntrypoint(environment) {
|
|
@@ -14,6 +14,9 @@ import { okText, usageFailure, validationFailure } from '../cli-help.js';
|
|
|
14
14
|
import { jsonResult, openCliDatabase, resultFailure } from '../cli-helpers.js';
|
|
15
15
|
import { renderSetupPlan } from '../setup-plan-renderer.js';
|
|
16
16
|
import { renderSetupStatus } from '../setup-status-renderer.js';
|
|
17
|
+
import { runHomeTuiController } from '../home-tui-controller.js';
|
|
18
|
+
import { runSetupTuiController } from '../setup-tui-controller.js';
|
|
19
|
+
import { canRunInteractiveTui } from '../tui/terminal-capabilities.js';
|
|
17
20
|
function renderSetupRollbackApply(result, parsed) {
|
|
18
21
|
if (parsed.flags.json === true)
|
|
19
22
|
return jsonResult(result);
|
|
@@ -34,6 +37,8 @@ export function runSetupLifecycleCommand(parsed, environment) {
|
|
|
34
37
|
return runSetupPlanCommand(parsed, environment);
|
|
35
38
|
if (area === 'setup' && command === 'apply')
|
|
36
39
|
return usageFailure('setup apply is available through the async CLI entrypoint; run vgxness setup apply --yes from the installed CLI.');
|
|
40
|
+
if (area === 'setup' && command === 'reinstall')
|
|
41
|
+
return runSetupReinstallCommand(parsed, environment);
|
|
37
42
|
if (area === 'setup' && command === 'backup')
|
|
38
43
|
return runSetupBackupCommand(parsed, environment);
|
|
39
44
|
if (area === 'setup' && command === 'rollback')
|
|
@@ -70,6 +75,16 @@ export function runSetupPlanCommand(parsed, environment) {
|
|
|
70
75
|
return jsonResult(plan);
|
|
71
76
|
return okText(`${renderSetupPlan(plan.value)}\n`);
|
|
72
77
|
}
|
|
78
|
+
export function runSetupReinstallCommand(parsed, environment) {
|
|
79
|
+
const reinstallParsed = withReinstallFlags(parsed);
|
|
80
|
+
const input = setupPlanInputFromFlags(reinstallParsed, environment);
|
|
81
|
+
if (!input.ok)
|
|
82
|
+
return resultFailure(input);
|
|
83
|
+
const plan = createSetupPlan(input.value);
|
|
84
|
+
if (!plan.ok || parsed.flags.json === true)
|
|
85
|
+
return jsonResult(plan);
|
|
86
|
+
return okText(`${renderSetupReinstallPreview(plan.value)}\n`);
|
|
87
|
+
}
|
|
73
88
|
export function runSetupRollbackCommand(parsed, environment) {
|
|
74
89
|
const backupPath = optionalStringFlag(parsed.flags, 'backup');
|
|
75
90
|
if (backupPath === undefined)
|
|
@@ -126,6 +141,15 @@ export async function runSetupApplyCommand(parsed, environment) {
|
|
|
126
141
|
const applied = await applySetupPlanInput(input.value, environment);
|
|
127
142
|
return applied.ok ? jsonResult({ ok: true, value: applied.value }) : resultFailure(applied);
|
|
128
143
|
}
|
|
144
|
+
export async function runSetupReinstallApplyCommand(parsed, environment) {
|
|
145
|
+
if (parsed.flags.yes !== true)
|
|
146
|
+
return usageFailure('setup reinstall rewrites VGXNESS-managed provider entries and requires explicit confirmation with --yes. Unrelated OpenCode config is preserved. No provider config was written.');
|
|
147
|
+
const input = setupPlanInputFromFlags(withReinstallFlags(parsed), environment);
|
|
148
|
+
if (!input.ok)
|
|
149
|
+
return resultFailure(input);
|
|
150
|
+
const applied = await applySetupPlanInput(input.value, environment);
|
|
151
|
+
return applied.ok ? jsonResult({ ok: true, value: applied.value }) : resultFailure(applied);
|
|
152
|
+
}
|
|
129
153
|
export async function applySetupPlanInput(input, environment) {
|
|
130
154
|
const plan = createSetupPlan(input);
|
|
131
155
|
if (!plan.ok)
|
|
@@ -208,6 +232,22 @@ export function setupPlanInputFromFlags(parsed, environment) {
|
|
|
208
232
|
},
|
|
209
233
|
};
|
|
210
234
|
}
|
|
235
|
+
function withReinstallFlags(parsed) {
|
|
236
|
+
return { ...parsed, flags: { ...parsed.flags, 'overwrite-vgxness': true, reinstall: true } };
|
|
237
|
+
}
|
|
238
|
+
function renderSetupReinstallPreview(plan) {
|
|
239
|
+
return [
|
|
240
|
+
'VGXNESS Setup Reinstall Preview',
|
|
241
|
+
'',
|
|
242
|
+
'Warning: reinstall replaces only VGXNESS-managed OpenCode entries: mcp.vgxness and known VGXNESS agents/instructions.',
|
|
243
|
+
'Unrelated OpenCode config is preserved. This is not a full opencode.json reset.',
|
|
244
|
+
'A managed backup is planned before existing user-global OpenCode config is changed.',
|
|
245
|
+
'',
|
|
246
|
+
renderSetupPlan(plan).trimEnd(),
|
|
247
|
+
'',
|
|
248
|
+
'Apply after review: vgxness setup reinstall --yes',
|
|
249
|
+
].join('\n');
|
|
250
|
+
}
|
|
211
251
|
function defaultWizardInput(environment) {
|
|
212
252
|
return {
|
|
213
253
|
project: environment.cwd
|
|
@@ -350,14 +390,37 @@ export function resolveInitDispatchMode(parsed, _environment) {
|
|
|
350
390
|
return 'setup-plan';
|
|
351
391
|
}
|
|
352
392
|
export async function runInitCommand(parsed, environment) {
|
|
393
|
+
if (shouldRunSetupTui(parsed, environment)) {
|
|
394
|
+
const input = setupPlanInputFromFlags(parsed, environment);
|
|
395
|
+
if (!input.ok)
|
|
396
|
+
return resultFailure(input);
|
|
397
|
+
const plan = createSetupPlan(input.value);
|
|
398
|
+
if (!plan.ok)
|
|
399
|
+
return resultFailure(plan);
|
|
400
|
+
return runSetupTuiController({ environment, plan: plan.value });
|
|
401
|
+
}
|
|
353
402
|
return runInitCommandWithoutSetupTui(parsed, environment);
|
|
354
403
|
}
|
|
404
|
+
export async function runHomeTuiCommand(parsed, environment) {
|
|
405
|
+
const input = setupPlanInputFromFlags(parsed, environment);
|
|
406
|
+
if (!input.ok)
|
|
407
|
+
return resultFailure(input);
|
|
408
|
+
const plan = createSetupPlan(input.value);
|
|
409
|
+
if (!plan.ok)
|
|
410
|
+
return resultFailure(plan);
|
|
411
|
+
return runHomeTuiController({ environment, plan: plan.value });
|
|
412
|
+
}
|
|
355
413
|
export async function runInitCommandWithoutSetupTui(parsed, environment) {
|
|
356
414
|
const mode = resolveInitDispatchMode(parsed, environment);
|
|
357
415
|
if (mode === 'setup-plan')
|
|
358
416
|
return runSetupPlanCommand(parsed, environment);
|
|
359
417
|
return runSetupApplyCommand({ ...parsed, flags: { ...parsed.flags, yes: true } }, environment);
|
|
360
418
|
}
|
|
419
|
+
function shouldRunSetupTui(parsed, environment) {
|
|
420
|
+
if (parsed.flags.plan === true || parsed.flags.json === true || parsed.flags.yes === true)
|
|
421
|
+
return false;
|
|
422
|
+
return canRunInteractiveTui(environment.stdin, environment.stdout);
|
|
423
|
+
}
|
|
361
424
|
export function createSetupLifecycleService(input) {
|
|
362
425
|
return new SetupLifecycleService({
|
|
363
426
|
store: () => (input.opened.ok ? { ok: true, value: { path: input.databasePath } } : input.opened),
|
package/dist/cli/dispatcher.js
CHANGED
|
@@ -5,7 +5,8 @@ import { databasePathFor, parseArgs, requiredFlag } from './cli-flags.js';
|
|
|
5
5
|
import { okText, usageFailure, visibleHelpText } from './cli-help.js';
|
|
6
6
|
import { openCliDatabase, resultFailure } from './cli-helpers.js';
|
|
7
7
|
import { runBootAgentSeedUpgrade } from '../agents/boot-upgrade.js';
|
|
8
|
-
import { runAgentCommand, runApprovalsCommand, runDefaultInteractiveEntrypoint, runDoctorAliasCommand, runInitCommand, runMcpDoctorCommand, runMcpInstallCommand, runMcpSetupCommand, runMemoryCommand, runMemoryImportCommand, runOpenCodeCommand, runOrchestratorCommand, runPermissionsCommand, runProductNextCommand, runProductResumeCommand, runRunsCommand, runSddCommand, runSetupApplyCommand, runSetupLifecycleCommand, runSetupPlanCommand, runSetupRollbackCommand, runProductStatusCommand, runSkillCommand, runSubagentCommand, runVerificationPlanCommand, runVerificationReportCommand, runWorkflowExecuteCommand, runWorkflowPreviewCommand, runWorkflowRunCommand, } from './commands/index.js';
|
|
8
|
+
import { runAgentCommand, runApprovalsCommand, runDefaultInteractiveEntrypoint, runDoctorAliasCommand, runHomeTuiCommand, runInitCommand, runMcpDoctorCommand, runMcpInstallCommand, runMcpSetupCommand, runMemoryCommand, runMemoryImportCommand, runOpenCodeCommand, runOrchestratorCommand, runPermissionsCommand, runProductNextCommand, runProductResumeCommand, runRunsCommand, runSddCommand, runSetupApplyCommand, runSetupLifecycleCommand, runSetupPlanCommand, runSetupReinstallApplyCommand, runSetupRollbackCommand, runProductStatusCommand, runSkillCommand, runSubagentCommand, runVerificationPlanCommand, runVerificationReportCommand, runWorkflowExecuteCommand, runWorkflowPreviewCommand, runWorkflowRunCommand, } from './commands/index.js';
|
|
9
|
+
import { canRunInteractiveTui } from './tui/terminal-capabilities.js';
|
|
9
10
|
const _promptBuffers = new WeakMap();
|
|
10
11
|
const require = createRequire(import.meta.url);
|
|
11
12
|
const packageJson = require('../../package.json');
|
|
@@ -55,7 +56,8 @@ export function dispatchCli(argv, environment) {
|
|
|
55
56
|
const opened = openCliDatabase(databasePath);
|
|
56
57
|
if (!opened.ok)
|
|
57
58
|
return resultFailure(opened);
|
|
58
|
-
|
|
59
|
+
if (!skipsBootAgentSeedUpgrade(area, command))
|
|
60
|
+
runBootAgentSeedUpgrade(opened.value, environment.env);
|
|
59
61
|
try {
|
|
60
62
|
if (isWorkflowId(area) && command === 'run')
|
|
61
63
|
return runWorkflowRunCommand(area, parsed, opened.value);
|
|
@@ -89,14 +91,20 @@ export function dispatchCli(argv, environment) {
|
|
|
89
91
|
opened.value.close();
|
|
90
92
|
}
|
|
91
93
|
}
|
|
94
|
+
function skipsBootAgentSeedUpgrade(area, command) {
|
|
95
|
+
return area === 'skills' && (command === 'index' || command === 'export');
|
|
96
|
+
}
|
|
92
97
|
function isGlobalVersionRequest(argv) {
|
|
93
98
|
return argv.length === 1 && (argv[0] === '--version' || argv[0] === '-v');
|
|
94
99
|
}
|
|
95
100
|
export async function dispatchCliAsync(argv, environment) {
|
|
96
101
|
const parsed = parseArgs(argv);
|
|
97
102
|
const [area, command] = parsed.positionals;
|
|
98
|
-
if (argv.length === 0)
|
|
103
|
+
if (argv.length === 0) {
|
|
104
|
+
if (canRunInteractiveTui(environment.stdin, environment.stdout))
|
|
105
|
+
return runHomeTuiCommand({ positionals: [], flags: {} }, environment);
|
|
99
106
|
return runDefaultInteractiveEntrypoint(environment);
|
|
107
|
+
}
|
|
100
108
|
if (area === 'mcp') {
|
|
101
109
|
if (!command)
|
|
102
110
|
return usageFailure('Missing command for mcp');
|
|
@@ -114,6 +122,8 @@ export async function dispatchCliAsync(argv, environment) {
|
|
|
114
122
|
return runInitCommand(parsed, environment);
|
|
115
123
|
if (area === 'setup' && command === 'apply')
|
|
116
124
|
return runSetupApplyCommand(parsed, environment);
|
|
125
|
+
if (area === 'setup' && command === 'reinstall' && parsed.flags.yes === true)
|
|
126
|
+
return runSetupReinstallApplyCommand(parsed, environment);
|
|
117
127
|
if (area === 'setup' && command === 'rollback')
|
|
118
128
|
return runSetupRollbackCommand(parsed, environment);
|
|
119
129
|
return dispatchCli(argv, environment);
|
|
@@ -173,6 +183,8 @@ function validateCommand(area, command) {
|
|
|
173
183
|
command === 'detach' ||
|
|
174
184
|
command === 'record-usage' ||
|
|
175
185
|
command === 'resolve' ||
|
|
186
|
+
command === 'index' ||
|
|
187
|
+
command === 'export' ||
|
|
176
188
|
command === 'status' ||
|
|
177
189
|
command === 'payload' ||
|
|
178
190
|
command === 'propose' ||
|
|
@@ -219,7 +231,7 @@ function validateCommand(area, command) {
|
|
|
219
231
|
return command === 'preview' ? { ok: true } : { ok: false, message: `Unknown opencode command: ${command}` };
|
|
220
232
|
}
|
|
221
233
|
if (area === 'setup') {
|
|
222
|
-
return command === 'status' || command === 'plan' || command === 'apply' || command === 'backup' || command === 'rollback'
|
|
234
|
+
return command === 'status' || command === 'plan' || command === 'apply' || command === 'reinstall' || command === 'backup' || command === 'rollback'
|
|
223
235
|
? { ok: true }
|
|
224
236
|
: { ok: false, message: `Unknown setup command: ${command}` };
|
|
225
237
|
}
|