pantheon-opencode 1.6.0-beta.13 → 1.6.0-beta.14
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/CHANGELOG.md +24 -6
- package/README.md +14 -0
- package/README.pt-BR.md +1 -1
- package/bin/pantheon-init.mjs +29 -36
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/pyproject.toml +1 -1
- package/scripts/check-plugin-v2-coverage.mjs +4 -1
- package/scripts/install/agents-md.mjs +2 -2
- package/scripts/install/cli-ui.mjs +32 -71
- package/scripts/install/component-selection.mjs +61 -0
- package/scripts/install/health-check.mjs +3 -3
- package/scripts/install/interactive.mjs +9 -6
- package/scripts/install/migrate.mjs +13 -19
- package/scripts/install/model-picker.mjs +155 -228
- package/scripts/install/opencode.mjs +52 -27
- package/scripts/install/shared.mjs +5 -5
- package/scripts/install/strings.mjs +6 -6
- package/scripts/install/venv.mjs +5 -5
- package/src/agents/apollo.md +3 -3
- package/src/plugins/tui/dist/tui-v2.js +2 -2
- package/src/plugins/tui/dist/tui.js +1 -1
- package/src/plugins/tui/package-lock.json +2 -2
- package/src/plugins/tui/package.json +1 -1
- package/src/routing.yml +45 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,18 +5,36 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
## [Unreleased
|
|
8
|
+
## [v1.6.0-beta.14] - Unreleased
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
move this section to a versioned entry and reset the template below. -->
|
|
10
|
+
_Pre-release candidate; not yet published._
|
|
12
11
|
|
|
13
12
|
## 🆕 What's New
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
- **Installer model profiles:** choose Inherit, OpenCode Go (hybrid), OpenAI, or
|
|
15
|
+
Anthropic. Inherit leaves the active preset unset; OpenCode Go combines the
|
|
16
|
+
premium lineup for Zeus, Athena, Themis, and Hephaestus with the Go lineup for
|
|
17
|
+
other agents. Existing `go-free`, `go-fast`, and `go-premium` preset IDs remain
|
|
18
|
+
available for compatibility.
|
|
19
|
+
- **Anthropic key guidance:** the profile identifies `ANTHROPIC_API_KEY` as the
|
|
20
|
+
required environment variable. The installer does not collect or inspect API
|
|
21
|
+
keys; configure the key in your environment.
|
|
22
|
+
- **Modernized installer progress and terminal safety:** Clack spinners are used
|
|
23
|
+
in interactive TTYs, with readable output in headless/non-TTY runs. Canceling
|
|
24
|
+
or selecting no components stops safely without writes; `--no-mcp` continues
|
|
25
|
+
to exclude runtime, and `--yes` does not override an explicit decline.
|
|
26
|
+
- **Proportional delegation guidance:** prompts now route bounded work directly
|
|
27
|
+
to the relevant specialist and call for planning, broad discovery, review, or
|
|
28
|
+
parallel work only when the request, uncertainty, dependencies, or risk
|
|
29
|
+
warrant it.
|
|
16
30
|
|
|
17
|
-
##
|
|
31
|
+
## 🐞 Fixed
|
|
18
32
|
|
|
19
|
-
|
|
33
|
+
- **Reduce duplicated CI work:** plugin V2 coverage now measures one focused
|
|
34
|
+
TypeScript contract test while retaining its required 80% line-coverage
|
|
35
|
+
threshold. The hook canary has one CI owner (`test:node`); its duplicate
|
|
36
|
+
standalone CI invocation was removed. This records the CI configuration
|
|
37
|
+
change, not a claim that the current CI run passed.
|
|
20
38
|
|
|
21
39
|
## [v1.6.0-beta.13] - 2026-10-17
|
|
22
40
|
|
package/README.md
CHANGED
|
@@ -27,6 +27,10 @@ way to plan work, make progress, check results, and keep useful project context.
|
|
|
27
27
|
collaborators.
|
|
28
28
|
- **You stay in charge:** Pantheon supports your decisions; it does not replace
|
|
29
29
|
your judgment or your review of generated code.
|
|
30
|
+
- **Right-sized coordination:** bounded work goes to the correct specialist;
|
|
31
|
+
planning, discovery, parallel work, and review are added when scope and risk
|
|
32
|
+
call for them. `/pantheon-deepwork` remains the checkpointed workflow for
|
|
33
|
+
heavy multi-phase work.
|
|
30
34
|
|
|
31
35
|
## Start in 2 minutes
|
|
32
36
|
|
|
@@ -69,6 +73,16 @@ behavior. The installer guides you through the available setup. For optional MCP
|
|
|
69
73
|
project-local installation, or non-interactive setup, see the
|
|
70
74
|
[installation guide](docs/INSTALLATION.md).
|
|
71
75
|
|
|
76
|
+
In the interactive **V1 model setup**, the profile choices are **Inherit**,
|
|
77
|
+
**OpenCode Go**, **OpenAI**, and **Anthropic**. OpenCode Go saves the internal
|
|
78
|
+
`go-hybrid` profile (premium routes for Zeus, Athena, Themis, and Hephaestus;
|
|
79
|
+
the existing fast Go routes for the other agents). Anthropic uses
|
|
80
|
+
`anthropic/claude-sonnet-5-5`; configure `ANTHROPIC_API_KEY` in your environment
|
|
81
|
+
yourself. The installer does not read or validate API keys or contact provider
|
|
82
|
+
catalogs. Legacy `go-free`, `go-fast`, and `go-premium` presets remain available
|
|
83
|
+
for existing saved settings and explicit `--preset` use. V2 continues to ignore
|
|
84
|
+
static presets and uses explicit per-agent model overrides instead.
|
|
85
|
+
|
|
72
86
|
In an interactive TTY setup summary, Pantheon recommends the persistent
|
|
73
87
|
external worktree location
|
|
74
88
|
`<project-parent>/.pantheon-worktrees/<exact-repository-directory-basename>/<task>`
|
package/README.pt-BR.md
CHANGED
|
@@ -79,7 +79,7 @@ verificações repetíveis e passagens claras entre etapas do trabalho.
|
|
|
79
79
|
|
|
80
80
|
## Status
|
|
81
81
|
|
|
82
|
-
Versão operacional neste checkout: **v1.6.0-beta.
|
|
82
|
+
Versão operacional neste checkout: **v1.6.0-beta.14** (esta página não afirma publicação). O Pantheon foi feito para OpenCode e depende da
|
|
83
83
|
disponibilidade e da configuração do OpenCode e dos serviços opcionais que você
|
|
84
84
|
escolher. Veja as [releases](https://github.com/ils15/pantheon-opencode/releases)
|
|
85
85
|
e o [changelog](CHANGELOG.md) para acompanhar as mudanças publicadas.
|
package/bin/pantheon-init.mjs
CHANGED
|
@@ -20,6 +20,7 @@ import fs from 'node:fs'
|
|
|
20
20
|
import os from 'node:os'
|
|
21
21
|
import path from 'node:path'
|
|
22
22
|
import { fileURLToPath } from 'node:url'
|
|
23
|
+
import { resolveComponentSelection } from '../scripts/install/component-selection.mjs'
|
|
23
24
|
import { resolveInstallExitCode } from '../scripts/install/exit-codes.mjs'
|
|
24
25
|
import {
|
|
25
26
|
createPlanArtifact,
|
|
@@ -320,7 +321,6 @@ async function main() {
|
|
|
320
321
|
}
|
|
321
322
|
const isProject = reviewedPlan ? reviewedPlan.options.isProject : args.includes('--project')
|
|
322
323
|
const isDryRun = reviewedPlan ? false : args.includes('--dry-run')
|
|
323
|
-
const skipMCP = args.includes('--no-mcp')
|
|
324
324
|
// --clean is an alias of --force (both wipe component dirs + recreate venv).
|
|
325
325
|
const forceReinstall = reviewedPlan
|
|
326
326
|
? reviewedPlan.options.clean
|
|
@@ -398,11 +398,22 @@ async function main() {
|
|
|
398
398
|
}
|
|
399
399
|
|
|
400
400
|
const presetIndex = args.indexOf('--preset')
|
|
401
|
-
const
|
|
402
|
-
|
|
403
|
-
|
|
401
|
+
const inlinePreset = args.find((arg) => arg.startsWith('--preset='))
|
|
402
|
+
const hasPresetOption = presetIndex >= 0 || inlinePreset !== undefined
|
|
403
|
+
const parsedPreset =
|
|
404
|
+
presetIndex >= 0
|
|
404
405
|
? (args[presetIndex + 1] ?? null)
|
|
405
|
-
: null
|
|
406
|
+
: (inlinePreset?.slice('--preset='.length) ?? null)
|
|
407
|
+
if (
|
|
408
|
+
hasPresetOption &&
|
|
409
|
+
(typeof parsedPreset !== 'string' ||
|
|
410
|
+
parsedPreset.trim() === '' ||
|
|
411
|
+
parsedPreset.startsWith('--'))
|
|
412
|
+
) {
|
|
413
|
+
console.error('❌ --preset requires a non-empty value')
|
|
414
|
+
process.exit(1)
|
|
415
|
+
}
|
|
416
|
+
const presetOpt = reviewedPlan ? (reviewedPlan.options.preset ?? null) : parsedPreset
|
|
406
417
|
// Explicit top-level model overrides for the generated config.
|
|
407
418
|
const modelIndex = args.indexOf('--model')
|
|
408
419
|
const modelOpt = reviewedPlan
|
|
@@ -439,29 +450,18 @@ async function main() {
|
|
|
439
450
|
process.exit(1)
|
|
440
451
|
}
|
|
441
452
|
|
|
442
|
-
//
|
|
443
|
-
//
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
if (!reviewedPlan && componentsOpt !== null) {
|
|
453
|
-
requestedComponents = componentsOpt
|
|
454
|
-
.split(',')
|
|
455
|
-
.map((c) => c.trim())
|
|
456
|
-
.filter(Boolean)
|
|
457
|
-
const unknown = requestedComponents.filter((c) => !KNOWN_COMPONENTS.includes(c))
|
|
458
|
-
if (requestedComponents.length === 0 || unknown.length > 0) {
|
|
459
|
-
console.error(
|
|
460
|
-
`❌ Invalid --components "${componentsOpt}" — expected comma-separated names from: ${KNOWN_COMPONENTS.join(', ')}`,
|
|
461
|
-
)
|
|
462
|
-
process.exit(1)
|
|
463
|
-
}
|
|
453
|
+
// Resolve the user's explicit selection separately from the defaults. An
|
|
454
|
+
// unscoped install gets runtime by default; explicit --components does not.
|
|
455
|
+
let componentSelection
|
|
456
|
+
try {
|
|
457
|
+
componentSelection = resolveComponentSelection(args, {
|
|
458
|
+
reviewedComponents: reviewedPlan?.options.components ?? null,
|
|
459
|
+
})
|
|
460
|
+
} catch (err) {
|
|
461
|
+
console.error(`❌ ${err.message}`)
|
|
462
|
+
process.exit(1)
|
|
464
463
|
}
|
|
464
|
+
const { components, requestedComponentsForPrompt, noMcp: skipMCP } = componentSelection
|
|
465
465
|
|
|
466
466
|
// --merge-dev-config <path> opts IN to merging a contributor's personal
|
|
467
467
|
// OpenCode config into the generated one. Only third-party plugin/provider/
|
|
@@ -499,15 +499,6 @@ async function main() {
|
|
|
499
499
|
autoYes = true
|
|
500
500
|
}
|
|
501
501
|
|
|
502
|
-
const components = reviewedPlan
|
|
503
|
-
? requestedComponents
|
|
504
|
-
: (requestedComponents ?? ['agents', 'skills', 'instructions', 'commands', 'plugins'])
|
|
505
|
-
if (!reviewedPlan && !skipMCP && !components.includes('runtime')) components.push('runtime')
|
|
506
|
-
if (!reviewedPlan && skipMCP) {
|
|
507
|
-
const runtimeIndex = components.indexOf('runtime')
|
|
508
|
-
if (runtimeIndex >= 0) components.splice(runtimeIndex, 1)
|
|
509
|
-
}
|
|
510
|
-
|
|
511
502
|
// Version info
|
|
512
503
|
const version = readVersion()
|
|
513
504
|
const { strings } = await import('../scripts/install/strings.mjs')
|
|
@@ -539,6 +530,8 @@ async function main() {
|
|
|
539
530
|
version: versionOpt ?? 'auto',
|
|
540
531
|
mergeDevConfig: mergeDevConfigOpt,
|
|
541
532
|
expectedPlan: reviewedPlan,
|
|
533
|
+
requestedComponents: requestedComponentsForPrompt,
|
|
534
|
+
noMcp: skipMCP,
|
|
542
535
|
planTimestamp,
|
|
543
536
|
quiet: isJson,
|
|
544
537
|
})
|
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pantheon",
|
|
3
3
|
"publisher": "ils15",
|
|
4
|
-
"version": "1.6.0-beta.
|
|
4
|
+
"version": "1.6.0-beta.14",
|
|
5
5
|
"displayName": "Pantheon",
|
|
6
6
|
"description": "Conductor-Delegate orchestration platform with 14 specialized agents, 20 skills, and OpenCode support.",
|
|
7
7
|
"agents": "./src/agents",
|
package/pyproject.toml
CHANGED
|
@@ -135,8 +135,11 @@ function formatMetric(metric) {
|
|
|
135
135
|
|
|
136
136
|
function listTypeScriptTests(repoRoot) {
|
|
137
137
|
const directory = join(repoRoot, 'tests', 'pantheon')
|
|
138
|
+
// This is the only TypeScript test file that imports src/plugin-v2.ts. Its
|
|
139
|
+
// isolated measured coverage matches the full-suite baseline; `test:ts`
|
|
140
|
+
// remains the separate full TypeScript suite.
|
|
138
141
|
return readdirSync(directory)
|
|
139
|
-
.filter((file) => file
|
|
142
|
+
.filter((file) => file === 'plugin-v2-contract.test.ts')
|
|
140
143
|
.sort()
|
|
141
144
|
.map((file) => join(directory, file))
|
|
142
145
|
}
|
|
@@ -208,9 +208,9 @@ if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
|
208
208
|
try {
|
|
209
209
|
const content = generateAgentsMdForPlatform(targetDir, platformName, extraSections)
|
|
210
210
|
const agentCount = (content.match(/^\| @/gm) || []).length
|
|
211
|
-
console.log(
|
|
211
|
+
console.log(`[OK] Generated AGENTS.md in ${targetDir} (${agentCount} agents)`)
|
|
212
212
|
} catch (err) {
|
|
213
|
-
console.error(
|
|
213
|
+
console.error(`[ERROR] Failed to generate AGENTS.md: ${err.message}`)
|
|
214
214
|
process.exit(1)
|
|
215
215
|
}
|
|
216
216
|
}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import { basename, dirname, join, resolve } from 'node:path'
|
|
2
|
+
import { spinner as clackSpinner } from '@clack/prompts'
|
|
2
3
|
import { strings } from './strings.mjs'
|
|
3
4
|
|
|
4
5
|
export const icons = {
|
|
5
|
-
success: '
|
|
6
|
-
warning: '
|
|
7
|
-
error: '
|
|
8
|
-
info: '
|
|
9
|
-
progress: '
|
|
10
|
-
done: '
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
star: '\u2b50',
|
|
14
|
-
wrench: '\u{1F527}',
|
|
15
|
-
rocket: '\u{1F680}',
|
|
16
|
-
package: '\u{1F4E6}',
|
|
17
|
-
gear: '\u2699\ufe0f',
|
|
6
|
+
success: '[OK]',
|
|
7
|
+
warning: '[WARN]',
|
|
8
|
+
error: '[ERROR]',
|
|
9
|
+
info: '[INFO]',
|
|
10
|
+
progress: '[RUNNING]',
|
|
11
|
+
done: '[DONE]',
|
|
12
|
+
bullet: '*',
|
|
13
|
+
rocket: '[OK]',
|
|
18
14
|
}
|
|
19
15
|
|
|
20
16
|
export const colors = {
|
|
@@ -55,18 +51,27 @@ export function section(title) {
|
|
|
55
51
|
console.log(tag(line))
|
|
56
52
|
}
|
|
57
53
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
} else if (!_quiet) {
|
|
67
|
-
process.stdout.write(`\r${doneText}\n`)
|
|
54
|
+
function progress(message) {
|
|
55
|
+
if (tty() && !_quiet) {
|
|
56
|
+
const indicator = clackSpinner()
|
|
57
|
+
indicator.start(tag(message))
|
|
58
|
+
return (ok = true) => {
|
|
59
|
+
const doneText = tag(`${message} — ${ok ? 'complete' : 'failed'}`)
|
|
60
|
+
if (ok) indicator.stop(doneText)
|
|
61
|
+
else indicator.error(doneText)
|
|
68
62
|
}
|
|
69
63
|
}
|
|
64
|
+
|
|
65
|
+
if (!_quiet) console.log(tag(`${icons.progress} ${message}`))
|
|
66
|
+
return (ok = true) => {
|
|
67
|
+
const doneText = tag(`${ok ? icons.done : icons.error} ${message}`)
|
|
68
|
+
if (_quiet && !ok) console.warn(doneText)
|
|
69
|
+
else if (!_quiet) console.log(doneText)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function step(message) {
|
|
74
|
+
return progress(message)
|
|
70
75
|
}
|
|
71
76
|
|
|
72
77
|
export function success(message) {
|
|
@@ -74,7 +79,7 @@ export function success(message) {
|
|
|
74
79
|
}
|
|
75
80
|
|
|
76
81
|
export function warning(message) {
|
|
77
|
-
console.warn(tag(`${icons.warning}${message}`))
|
|
82
|
+
console.warn(tag(`${icons.warning} ${message}`))
|
|
78
83
|
}
|
|
79
84
|
|
|
80
85
|
export function error(message) {
|
|
@@ -83,7 +88,7 @@ export function error(message) {
|
|
|
83
88
|
|
|
84
89
|
export function info(message) {
|
|
85
90
|
if (_quiet) return
|
|
86
|
-
console.log(tag(`${icons.info}${message}`))
|
|
91
|
+
console.log(tag(`${icons.info} ${message}`))
|
|
87
92
|
}
|
|
88
93
|
|
|
89
94
|
export function bullet(text, indent = 0) {
|
|
@@ -118,51 +123,7 @@ export function summaryTable(items) {
|
|
|
118
123
|
}
|
|
119
124
|
|
|
120
125
|
export function spinner(message) {
|
|
121
|
-
|
|
122
|
-
'\u280b',
|
|
123
|
-
'\u2819',
|
|
124
|
-
'\u2839',
|
|
125
|
-
'\u2838',
|
|
126
|
-
'\u283c',
|
|
127
|
-
'\u2834',
|
|
128
|
-
'\u2826',
|
|
129
|
-
'\u2827',
|
|
130
|
-
'\u2807',
|
|
131
|
-
'\u280f',
|
|
132
|
-
]
|
|
133
|
-
let i = 0
|
|
134
|
-
let running = true
|
|
135
|
-
|
|
136
|
-
if (tty() && !_quiet) {
|
|
137
|
-
const interval = setInterval(() => {
|
|
138
|
-
if (!running) {
|
|
139
|
-
clearInterval(interval)
|
|
140
|
-
return
|
|
141
|
-
}
|
|
142
|
-
process.stdout.write(`\r${frames[i % frames.length]} ${tag(message)}...`)
|
|
143
|
-
i++
|
|
144
|
-
}, 80)
|
|
145
|
-
process.stdout.write(`\r${frames[0]} ${tag(message)}...`)
|
|
146
|
-
|
|
147
|
-
return (ok = true) => {
|
|
148
|
-
running = false
|
|
149
|
-
clearInterval(interval)
|
|
150
|
-
const icon = ok ? icons.success : icons.error
|
|
151
|
-
process.stdout.write(`\r${icon} ${tag(message)}\n`)
|
|
152
|
-
}
|
|
153
|
-
} else {
|
|
154
|
-
const text = tag(`${icons.progress} ${message}...`)
|
|
155
|
-
if (!_quiet) process.stdout.write(text)
|
|
156
|
-
return (ok = true) => {
|
|
157
|
-
const icon = ok ? icons.success : icons.error
|
|
158
|
-
const doneText = tag(`${icon} ${message}`)
|
|
159
|
-
if (_quiet && !ok) {
|
|
160
|
-
console.warn(doneText)
|
|
161
|
-
} else if (!_quiet) {
|
|
162
|
-
process.stdout.write(`\r${doneText}\n`)
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
126
|
+
return progress(message)
|
|
166
127
|
}
|
|
167
128
|
|
|
168
129
|
export function printSummary(target, _platforms, stats) {
|
|
@@ -192,7 +153,7 @@ export function printSummary(target, _platforms, stats) {
|
|
|
192
153
|
console.log('')
|
|
193
154
|
}
|
|
194
155
|
|
|
195
|
-
console.log(tag(` ${
|
|
156
|
+
console.log(tag(` ${S.summaryNext.trim()}`))
|
|
196
157
|
console.log(tag(S.summaryNextAgents))
|
|
197
158
|
console.log(tag(S.summaryNextMcp))
|
|
198
159
|
console.log(tag(S.summaryNextDoctor))
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
const DEFAULT_INSTALL_COMPONENTS = ['agents', 'skills', 'instructions', 'commands', 'plugins']
|
|
2
|
+
const KNOWN_COMPONENTS = ['agents', 'skills', 'instructions', 'commands', 'plugins', 'runtime']
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Resolve CLI component flags without widening an explicit component selection.
|
|
6
|
+
*
|
|
7
|
+
* @param {string[]} args CLI arguments
|
|
8
|
+
* @param {{ reviewedComponents?: string[] | null }} [options]
|
|
9
|
+
* @returns {{ components: string[], requestedComponentsForPrompt: string[] | null }}
|
|
10
|
+
*/
|
|
11
|
+
export function resolveComponentSelection(args, { reviewedComponents = null } = {}) {
|
|
12
|
+
const noMcp = args.includes('--no-mcp')
|
|
13
|
+
if (reviewedComponents !== null) {
|
|
14
|
+
return {
|
|
15
|
+
components: [...reviewedComponents],
|
|
16
|
+
requestedComponentsForPrompt: null,
|
|
17
|
+
noMcp,
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const componentsIndex = args.indexOf('--components')
|
|
22
|
+
const inlineComponents = args.find((arg) => arg.startsWith('--components='))
|
|
23
|
+
const componentsOpt =
|
|
24
|
+
componentsIndex >= 0
|
|
25
|
+
? (args[componentsIndex + 1] ?? null)
|
|
26
|
+
: (inlineComponents?.split('=', 2)[1] ?? null)
|
|
27
|
+
|
|
28
|
+
let explicitComponents = null
|
|
29
|
+
if (componentsOpt !== null) {
|
|
30
|
+
explicitComponents = componentsOpt
|
|
31
|
+
.split(',')
|
|
32
|
+
.map((component) => component.trim())
|
|
33
|
+
.filter(Boolean)
|
|
34
|
+
const unknown = explicitComponents.filter((component) => !KNOWN_COMPONENTS.includes(component))
|
|
35
|
+
if (explicitComponents.length === 0 || unknown.length > 0) {
|
|
36
|
+
throw new Error(
|
|
37
|
+
`Invalid --components "${componentsOpt}" — expected comma-separated names from: ${KNOWN_COMPONENTS.join(', ')}`,
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const components = explicitComponents ? [...explicitComponents] : [...DEFAULT_INSTALL_COMPONENTS]
|
|
43
|
+
if (noMcp) {
|
|
44
|
+
return {
|
|
45
|
+
components: components.filter((component) => component !== 'runtime'),
|
|
46
|
+
requestedComponentsForPrompt: explicitComponents
|
|
47
|
+
? explicitComponents.filter((component) => component !== 'runtime')
|
|
48
|
+
: null,
|
|
49
|
+
noMcp,
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Runtime is a default only for an unscoped install. Explicit --components
|
|
54
|
+
// remains the user's exact scope; runtime can still be requested by name.
|
|
55
|
+
if (explicitComponents === null && !components.includes('runtime')) components.push('runtime')
|
|
56
|
+
return {
|
|
57
|
+
components,
|
|
58
|
+
requestedComponentsForPrompt: explicitComponents ? [...explicitComponents] : null,
|
|
59
|
+
noMcp,
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -269,9 +269,9 @@ function main() {
|
|
|
269
269
|
const results = healthCheck(target, { dryRun })
|
|
270
270
|
|
|
271
271
|
console.log('\n 📊 Health Check:')
|
|
272
|
-
for (const p of results.passed) console.log(`
|
|
273
|
-
for (const w of results.warnings) console.log(`
|
|
274
|
-
for (const f of results.failed) console.log(`
|
|
272
|
+
for (const p of results.passed) console.log(` [OK] ${p.check}: ${p.detail}`)
|
|
273
|
+
for (const w of results.warnings) console.log(` [WARN] ${w.check}: ${w.detail}`)
|
|
274
|
+
for (const f of results.failed) console.log(` [ERROR] ${f.check}: ${f.detail}`)
|
|
275
275
|
|
|
276
276
|
console.log(
|
|
277
277
|
`\n Summary: ${results.passed.length} passed, ${results.warnings.length} warnings, ${results.failed.length} failed`,
|
|
@@ -35,23 +35,25 @@ export async function promptReview(
|
|
|
35
35
|
/**
|
|
36
36
|
* Collect interactive setup choices before the installer begins any writes.
|
|
37
37
|
*
|
|
38
|
-
* @param {{ components?: string[], defaultComponents?: string[], prompts?: typeof clack, isTTY?: boolean }} [options]
|
|
38
|
+
* @param {{ components?: string[], defaultComponents?: string[], noMcp?: boolean, prompts?: typeof clack, isTTY?: boolean }} [options]
|
|
39
39
|
* @returns {Promise<{ components?: Set<string>, target?: string, confirmed?: boolean, canceled?: boolean }>}
|
|
40
40
|
*/
|
|
41
41
|
export async function runInteractiveInstall({
|
|
42
42
|
components = [],
|
|
43
43
|
defaultComponents = [],
|
|
44
|
+
noMcp = false,
|
|
44
45
|
prompts = clack,
|
|
45
46
|
isTTY = isTerminal(),
|
|
46
47
|
} = {}) {
|
|
47
|
-
const
|
|
48
|
+
const isAllowed = (component) => !noMcp || component !== 'runtime'
|
|
49
|
+
const defaults = (defaultComponents.length > 0 ? defaultComponents : components).filter(isAllowed)
|
|
48
50
|
const defaultSet = new Set(defaults)
|
|
49
51
|
|
|
50
52
|
// Preserve the prior no-TTY fallback (defaults, global target, and no apply
|
|
51
53
|
// authorization) without asking a terminal prompt library to access stdin.
|
|
52
54
|
if (!isTTY) return { components: defaultSet, target: 'global', confirmed: true }
|
|
53
55
|
|
|
54
|
-
|
|
56
|
+
prompts.intro?.('OpenCode Installer')
|
|
55
57
|
|
|
56
58
|
const componentOptions = [
|
|
57
59
|
{ label: 'agents', value: 'agents', hint: 'Agent configurations and routing (14 agents)' },
|
|
@@ -61,7 +63,7 @@ export async function runInteractiveInstall({
|
|
|
61
63
|
{ label: 'commands', value: 'commands', hint: 'OpenCode command shortcuts' },
|
|
62
64
|
{ label: 'plugins', value: 'plugins', hint: 'TUI sidebar plugin' },
|
|
63
65
|
{ label: 'runtime', value: 'runtime', hint: 'Python venv + MCP server scripts' },
|
|
64
|
-
]
|
|
66
|
+
].filter((option) => isAllowed(option.value))
|
|
65
67
|
const chosen = await prompts.multiselect({
|
|
66
68
|
message: 'Select components to install:',
|
|
67
69
|
options: componentOptions,
|
|
@@ -70,9 +72,10 @@ export async function runInteractiveInstall({
|
|
|
70
72
|
})
|
|
71
73
|
if (cancelPrompt(prompts, chosen)) return { canceled: true }
|
|
72
74
|
|
|
73
|
-
const selectedComponents = new Set(chosen)
|
|
75
|
+
const selectedComponents = new Set(chosen.filter(isAllowed))
|
|
74
76
|
if (selectedComponents.size === 0) {
|
|
75
|
-
|
|
77
|
+
prompts.cancel?.('No components selected. Installation canceled.')
|
|
78
|
+
return { canceled: true }
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
const target = await prompts.select({
|
|
@@ -264,26 +264,24 @@ export function resumePendingMigration(target) {
|
|
|
264
264
|
export function rollbackMigration(target, version) {
|
|
265
265
|
const state = readState(target)
|
|
266
266
|
if (!state) {
|
|
267
|
-
console.log('
|
|
267
|
+
console.log(' [WARN] No install state found — nothing to roll back')
|
|
268
268
|
return { success: false, reason: 'No install state' }
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
const migrations = state.applied_migrations || []
|
|
272
272
|
const targetMigration = migrations.find((m) => m.to === version && m.status === 'completed')
|
|
273
273
|
if (!targetMigration) {
|
|
274
|
-
console.log(`
|
|
274
|
+
console.log(` [WARN] No completed migration found for version ${version}`)
|
|
275
275
|
return { success: false, reason: 'Migration not found' }
|
|
276
276
|
}
|
|
277
277
|
|
|
278
|
-
console.log(
|
|
279
|
-
` \u{1F504} Rolling back migration: ${targetMigration.from} \u2192 ${targetMigration.to}`,
|
|
280
|
-
)
|
|
278
|
+
console.log(` Rolling back migration: ${targetMigration.from} -> ${targetMigration.to}`)
|
|
281
279
|
|
|
282
280
|
targetMigration.status = 'rolled_back'
|
|
283
281
|
state.pantheon_version = targetMigration.from
|
|
284
282
|
writeState(target, state)
|
|
285
283
|
|
|
286
|
-
console.log(`
|
|
284
|
+
console.log(` [OK] Rolled back to ${targetMigration.from}`)
|
|
287
285
|
return { success: true, migration: targetMigration }
|
|
288
286
|
}
|
|
289
287
|
|
|
@@ -358,20 +356,16 @@ function main() {
|
|
|
358
356
|
if (list) {
|
|
359
357
|
const history = listAppliedMigrations(target)
|
|
360
358
|
if (!history.currentVersion) {
|
|
361
|
-
console.log(`
|
|
359
|
+
console.log(` [INFO] No install state found in: ${target}`)
|
|
362
360
|
return
|
|
363
361
|
}
|
|
364
362
|
console.log(` Current version: ${history.currentVersion}`)
|
|
365
363
|
console.log(` Previous version: ${history.previousVersion || 'N/A'}`)
|
|
366
364
|
console.log(` Applied migrations: ${history.migrations.length}`)
|
|
367
365
|
for (const m of history.migrations) {
|
|
368
|
-
const
|
|
369
|
-
m.status === 'completed'
|
|
370
|
-
|
|
371
|
-
: m.status === 'rolled_back'
|
|
372
|
-
? '\u{1F504}'
|
|
373
|
-
: '\u26A0\uFE0F'
|
|
374
|
-
console.log(` ${icon} ${m.from} \u2192 ${m.to} [${m.status}] (${m.applied_at})`)
|
|
366
|
+
const status =
|
|
367
|
+
m.status === 'completed' ? '[OK]' : m.status === 'rolled_back' ? '[ROLLED BACK]' : '[WARN]'
|
|
368
|
+
console.log(` ${status} ${m.from} -> ${m.to} [${m.status}] (${m.applied_at})`)
|
|
375
369
|
}
|
|
376
370
|
return
|
|
377
371
|
}
|
|
@@ -387,9 +381,9 @@ function main() {
|
|
|
387
381
|
if (!dryRun) {
|
|
388
382
|
const state = createInitialState(PANTHON_VERSION)
|
|
389
383
|
writeState(target, state)
|
|
390
|
-
console.log(`
|
|
384
|
+
console.log(` [OK] Fresh install — state written (${PANTHON_VERSION})`)
|
|
391
385
|
} else {
|
|
392
|
-
console.log(`
|
|
386
|
+
console.log(` [DRY-RUN] Fresh install — would write state (${PANTHON_VERSION})`)
|
|
393
387
|
}
|
|
394
388
|
return
|
|
395
389
|
}
|
|
@@ -397,19 +391,19 @@ function main() {
|
|
|
397
391
|
console.log(` Current version: ${currentVersion}`)
|
|
398
392
|
|
|
399
393
|
if (!force && currentVersion === PANTHON_VERSION) {
|
|
400
|
-
console.log('
|
|
394
|
+
console.log(' [OK] Already at latest version — no migrations needed')
|
|
401
395
|
return
|
|
402
396
|
}
|
|
403
397
|
|
|
404
398
|
const migration = runMigrations(target, currentVersion, { dryRun })
|
|
405
399
|
|
|
406
400
|
if (migration.applied > 0) {
|
|
407
|
-
console.log(`
|
|
401
|
+
console.log(` [OK] Applied ${migration.applied} migration(s):`)
|
|
408
402
|
for (const msg of migration.messages) {
|
|
409
403
|
console.log(` \u2022 ${msg}`)
|
|
410
404
|
}
|
|
411
405
|
} else {
|
|
412
|
-
console.log('
|
|
406
|
+
console.log(' [INFO] No applicable migrations')
|
|
413
407
|
}
|
|
414
408
|
}
|
|
415
409
|
|