pantheon-opencode 1.7.0 → 2.0.0-beta.1
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/AGENTS.global.md +2 -2
- package/AGENTS.md +3 -3
- package/CHANGELOG.md +64 -60
- package/README.md +52 -45
- package/README.pt-BR.md +19 -19
- package/bin/pantheon-init.mjs +11 -48
- package/package.json +9 -13
- package/plugin.json +2 -2
- package/pyproject.toml +1 -1
- package/scripts/build-agents-md.mjs +7 -6
- package/scripts/{check-plugin-v2-coverage.mjs → check-plugin-coverage.mjs} +7 -7
- package/scripts/{decision-router-v2-budget.mjs → decision-router-budget-gates.mjs} +1 -1
- package/scripts/{decision-router-v2-egress.mjs → decision-router-egress.mjs} +1 -1
- package/scripts/decision-router.mjs +2 -2
- package/scripts/docs-media.mjs +1 -1
- package/scripts/doctor.mjs +225 -136
- package/scripts/install/behavior-overrides.bundle.mjs +123 -0
- package/scripts/install/{v2-capabilities.mjs → capabilities.mjs} +7 -7
- package/scripts/install/config-migration.mjs +60 -253
- package/scripts/install/file-inventory.mjs +6 -4
- package/scripts/install/interactive.mjs +1 -1
- package/scripts/install/opencode-state.mjs +13 -12
- package/scripts/install/opencode-version.mjs +97 -162
- package/scripts/install/opencode.mjs +271 -428
- package/scripts/install/plan.mjs +1 -9
- package/scripts/install/plugin.mjs +19 -35
- package/scripts/install/shared.mjs +40 -1
- package/scripts/package-evidence.mjs +1 -4
- package/scripts/probe-pantheon-cost.mjs +1 -1
- package/scripts/reconcile.mjs +5 -7
- package/scripts/release-gates.mjs +22 -61
- package/scripts/setup-v2-config.mjs +10 -8
- package/scripts/setup.mjs +12 -22
- package/scripts/sync-tui.mjs +9 -17
- package/scripts/{test-opencode-v2-sandbox.sh → test-opencode-sandbox.sh} +9 -9
- package/scripts/update-skills-lock.mjs +24 -12
- package/scripts/update.mjs +17 -1
- package/scripts/validate-routing.mjs +79 -4
- package/scripts/validate-sandbox-install.mjs +3 -3
- package/skills-lock.json +25 -8
- package/src/agents/zeus.md +1 -0
- package/src/pantheon/behavior-overrides.ts +191 -0
- package/src/pantheon/{v2-bounded-read.ts → bounded-read.ts} +1 -1
- package/src/pantheon/cost-command.ts +1 -1
- package/src/pantheon/{v2-decision-contracts.ts → decision-contracts.ts} +3 -3
- package/src/pantheon/{v2-decision-points → decision-points}/p1-agent.ts +3 -3
- package/src/pantheon/{v2-decision-points → decision-points}/p10-claims.ts +2 -2
- package/src/pantheon/{v2-decision-points → decision-points}/p11-catalog.ts +2 -2
- package/src/pantheon/{v2-decision-points → decision-points}/p2-skill.ts +3 -3
- package/src/pantheon/{v2-decision-points → decision-points}/p3-complexity.ts +6 -6
- package/src/pantheon/{v2-decision-points → decision-points}/p4-memory.ts +2 -2
- package/src/pantheon/{v2-decision-points → decision-points}/p5-themis-verify.ts +2 -2
- package/src/pantheon/{v2-decision-points → decision-points}/p6-council.ts +3 -3
- package/src/pantheon/{v2-decision-points → decision-points}/p7-loop.ts +5 -5
- package/src/pantheon/{v2-decision-points → decision-points}/p8-guardrail.ts +2 -2
- package/src/pantheon/{v2-decision-points → decision-points}/p9-memory-compaction.ts +2 -2
- package/src/pantheon/{v2-decision-points.ts → decision-points.ts} +5 -5
- package/src/pantheon/{v2-decision-policy.ts → decision-policy.ts} +2 -2
- package/src/pantheon/{v2-decision-prompt-surface.ts → decision-prompt-surface.ts} +3 -3
- package/src/pantheon/{v2-decision-registry.ts → decision-registry.ts} +10 -13
- package/src/pantheon/{v2-decision-resource-ids.ts → decision-resource-ids.ts} +1 -1
- package/src/pantheon/{v2-decision-shadow.ts → decision-shadow.ts} +1 -1
- package/src/pantheon/{v2-decision-telemetry.ts → decision-telemetry.ts} +1 -1
- package/src/pantheon/{v2-execute-after.ts → execute-after.ts} +4 -4
- package/src/pantheon/goal-store.ts +7 -0
- package/src/pantheon/{v2-hook-engine.ts → hook-engine.ts} +3 -3
- package/src/pantheon/jev-decision-tool.ts +3 -3
- package/src/pantheon/jev-decisions.ts +12 -6
- package/src/pantheon/jev-escalation.ts +6 -6
- package/src/pantheon/jev-quality-score.ts +2 -2
- package/src/pantheon/jev-rank-verify.ts +2 -2
- package/src/pantheon/jev-risk-gate.ts +4 -4
- package/src/pantheon/local-decision-agents.ts +1 -1
- package/src/pantheon/local-decision-router.ts +1 -1
- package/src/pantheon/local-decision-tool.ts +2 -2
- package/src/pantheon/local-orchestration.ts +1 -1
- package/src/pantheon/model-command.ts +1 -1
- package/src/pantheon/{v2-vision.ts → native-vision.ts} +12 -15
- package/src/pantheon/pantheon-decision-catalog.ts +12 -0
- package/src/pantheon/{v2-shell-hooks.ts → shell-hooks.ts} +4 -4
- package/src/pantheon/{v2-tools.ts → tools.ts} +4 -4
- package/src/pantheon/{v2-unsupported.d.mts → unsupported.d.mts} +3 -3
- package/src/pantheon/{v2-unsupported.mjs → unsupported.mjs} +8 -8
- package/src/pantheon/update-notifier.ts +101 -0
- package/src/pantheon/vision-local.ts +12 -3
- package/src/pantheon/vision.ts +120 -2
- package/src/{plugin-v2 → plugin}/index.ts +7 -7
- package/src/plugin.ts +2875 -500
- package/src/plugins/hook-runner.ts +3 -3
- package/src/plugins/tui/dist/server.d.ts +23 -9
- package/src/plugins/tui/dist/server.d.ts.map +1 -1
- package/src/plugins/tui/dist/server.js +25 -12
- package/src/plugins/tui/dist/server.js.map +1 -1
- package/src/plugins/tui/dist/tui.d.ts +1023 -494
- package/src/plugins/tui/dist/tui.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui.js +4841 -2066
- package/src/plugins/tui/dist/tui.js.map +1 -1
- package/src/plugins/tui/{index-v2.ts → index.ts} +1 -1
- package/src/plugins/tui/package-lock.json +2 -42
- package/src/plugins/tui/package.json +4 -10
- package/src/plugins/tui/src/cost-data.ts +1 -1
- package/src/plugins/tui/src/index.tsx +4222 -2822
- package/src/plugins/tui/src/pantheon-settings-state.ts +111 -0
- package/src/plugins/tui/src/pantheon-settings.tsx +236 -0
- package/src/plugins/tui/src/server.ts +23 -10
- package/src/plugins/tui/src/update-notice.ts +86 -0
- package/src/plugins/tui/tsconfig.typecheck.json +1 -1
- package/src/plugins/tui/tsdown.config.ts +3 -5
- package/src/plugins/tui/tui.ts +1 -2
- package/src/routing.yml +36 -0
- package/src/skills/README.md +16 -1
- package/src/skills/artifact-management/SKILL.md +10 -67
- package/src/skills/artifact-management/references/artifact-templates.md +71 -0
- package/src/skills/auto-continue/SKILL.md +10 -0
- package/src/skills/code-review-checklist/SKILL.md +11 -44
- package/src/skills/code-review-checklist/references/review-checklists.md +54 -0
- package/src/skills/instruction-forge/SKILL.md +57 -0
- package/src/skills/instruction-forge/references/agents-md-doctrine.md +50 -0
- package/src/skills/instruction-forge/references/eval-doctrine.md +37 -0
- package/src/skills/instruction-forge/references/skill-doctrine.md +62 -0
- package/src/skills/memory-bank/SKILL.md +11 -90
- package/src/skills/memory-bank/references/anti-patterns.md +33 -0
- package/src/skills/memory-bank/references/product-adoption.md +19 -0
- package/src/skills/memory-bank/references/storage-model.md +21 -0
- package/src/skills/memory-bank/references/structure-and-frequency.md +44 -0
- package/src/skills/reflect/SKILL.md +1 -0
- package/src/skills/session-goal/SKILL.md +7 -54
- package/src/skills/session-goal/references/goal-format.md +26 -0
- package/src/skills/session-goal/references/session-reuse.md +44 -0
- package/src/skills/tdd-with-agents/SKILL.md +11 -101
- package/src/skills/tdd-with-agents/references/advanced-testing-patterns.md +58 -0
- package/src/skills/tdd-with-agents/references/testing-by-layer.md +60 -0
- package/src/skills/visual-review-pipeline/SKILL.md +11 -120
- package/src/skills/visual-review-pipeline/references/findings-schema.md +49 -0
- package/src/skills/visual-review-pipeline/references/workflow-steps.md +111 -0
- package/scripts/hooks/log-session-start.sh +0 -48
- package/scripts/hooks/validate-post-conditions.sh +0 -21
- package/scripts/hooks/validate-talos-scope.sh +0 -50
- package/scripts/hooks/validate-tool-safety.sh +0 -49
- package/src/pantheon/goal-loop.ts +0 -314
- package/src/pantheon/idle-continuation.ts +0 -52
- package/src/pantheon/todo-preserve.ts +0 -301
- package/src/pantheon/tool-ceiling.ts +0 -159
- package/src/pantheon/v2-bridge.ts +0 -153
- package/src/plugin-v2.ts +0 -2954
- package/src/plugins/pantheon-hooks.ts +0 -1433
- package/src/plugins/tui/dist/server-v2.d.ts +0 -30
- package/src/plugins/tui/dist/server-v2.d.ts.map +0 -1
- package/src/plugins/tui/dist/server-v2.js +0 -33
- package/src/plugins/tui/dist/server-v2.js.map +0 -1
- package/src/plugins/tui/dist/tui-v2.d.ts +0 -1039
- package/src/plugins/tui/dist/tui-v2.d.ts.map +0 -1
- package/src/plugins/tui/dist/tui-v2.js +0 -4597
- package/src/plugins/tui/dist/tui-v2.js.map +0 -1
- package/src/plugins/tui/src/index-v2.tsx +0 -4496
- package/src/plugins/tui/src/server-v2.ts +0 -28
- package/src/plugins/tui/tui-v2.ts +0 -2
- /package/src/pantheon/{v2-decision-budget.ts → decision-budget.ts} +0 -0
- /package/src/pantheon/{v2-decision-egress.ts → decision-egress.ts} +0 -0
- /package/src/pantheon/{v2-decision-events.ts → decision-events.ts} +0 -0
- /package/src/pantheon/{v2-decision-heuristic.ts → decision-heuristic.ts} +0 -0
- /package/src/pantheon/{v2-decision-premises.ts → decision-premises.ts} +0 -0
- /package/src/pantheon/{v2-decision-rank.ts → decision-rank.ts} +0 -0
- /package/src/pantheon/{v2-decision-verify.ts → decision-verify.ts} +0 -0
- /package/src/pantheon/{v2-delegation-enforce.ts → delegation-policy.ts} +0 -0
- /package/src/pantheon/{v2-model-overrides.ts → model-overrides.ts} +0 -0
- /package/src/pantheon/{v2-native-decisions.ts → native-decisions.ts} +0 -0
- /package/src/plugins/tui/src/{opencode-v2.d.ts → opencode.d.ts} +0 -0
package/scripts/install/plan.mjs
CHANGED
|
@@ -228,11 +228,9 @@ export function displayPath(target, filePath) {
|
|
|
228
228
|
* * `mcpServers` — the MCP servers this pass seeds into opencode.json, in
|
|
229
229
|
* write order, with their count. Derived from the write path, never a
|
|
230
230
|
* separate hand-maintained list.
|
|
231
|
-
* * `versionAssumed` — the host generation could not be probed, so the plan
|
|
232
|
-
* assumes V1 and may diverge from an apply on a 2.x host.
|
|
233
231
|
*
|
|
234
232
|
* @param {string} target - install target (used to relativize paths)
|
|
235
|
-
* @param {{ files: object[], totals: object, mcpServers?: string[], runtimeEffects?: { venv: string, dependencies: string }
|
|
233
|
+
* @param {{ files: object[], totals: object, mcpServers?: string[], runtimeEffects?: { venv: string, dependencies: string } }} plan
|
|
236
234
|
* @param {{ perFile?: boolean }} [options] - `perFile: false` renders the
|
|
237
235
|
* summary (totals + MCP servers + "No files were written.") without the
|
|
238
236
|
* per-file list. That is the DEFAULT dry-run surface; the per-file list is
|
|
@@ -268,12 +266,6 @@ export function formatChangePlan(target, plan, { perFile = true } = {}) {
|
|
|
268
266
|
` MCP dependencies: ${dependencies === 'install' ? 'install (may download packages)' : dependencies}`,
|
|
269
267
|
)
|
|
270
268
|
}
|
|
271
|
-
if (plan.versionAssumed) {
|
|
272
|
-
lines.push(
|
|
273
|
-
' OpenCode host generation unknown — this plan assumes V1 and may diverge from the ' +
|
|
274
|
-
'apply. Pass --opencode-version v1|v2 to pin it.',
|
|
275
|
-
)
|
|
276
|
-
}
|
|
277
269
|
lines.push(' No files were written.')
|
|
278
270
|
return lines.join('\n')
|
|
279
271
|
}
|
|
@@ -69,7 +69,6 @@ export function runNpmCi(cwd, { timeoutMs = NPM_CI_TIMEOUT_MS, env = sanitizeNpm
|
|
|
69
69
|
* @param {string} dstDir - Destination plugin directory
|
|
70
70
|
* @param {object} [options]
|
|
71
71
|
* @param {boolean} [options.dryRun=false] - If true, don't write files
|
|
72
|
-
* @param {'v1'|'v2'} [options.version='v1'] - Host plugin generation
|
|
73
72
|
* @param {(change: object) => void} [options.recorder] - optional change recorder for preview
|
|
74
73
|
* @param {Set<string>|null} [options.reviewedRemovals] - paths approved by the current plan
|
|
75
74
|
* @param {Map<string, object>|null} [options.reviewedSnapshots] - pre-apply path snapshots
|
|
@@ -78,20 +77,15 @@ export function runNpmCi(cwd, { timeoutMs = NPM_CI_TIMEOUT_MS, env = sanitizeNpm
|
|
|
78
77
|
export function copyPluginFiles(
|
|
79
78
|
srcDir,
|
|
80
79
|
dstDir,
|
|
81
|
-
{
|
|
82
|
-
dryRun = false,
|
|
83
|
-
version = 'v1',
|
|
84
|
-
recorder = null,
|
|
85
|
-
reviewedRemovals = null,
|
|
86
|
-
reviewedSnapshots = null,
|
|
87
|
-
} = {},
|
|
80
|
+
{ dryRun = false, recorder = null, reviewedRemovals = null, reviewedSnapshots = null } = {},
|
|
88
81
|
) {
|
|
89
82
|
const result = { created: 0, skipped: 0, errors: 0, problems: [] }
|
|
90
83
|
const distDir = join(dstDir, 'dist')
|
|
91
|
-
// The root loader (tui.ts
|
|
92
|
-
//
|
|
93
|
-
//
|
|
94
|
-
|
|
84
|
+
// The root loader (tui.ts) is only a re-export of the compiled bundle, and
|
|
85
|
+
// the local plugin entry (index.ts) re-exports the server bundle the host
|
|
86
|
+
// attaches. Writing either while its bundle is missing installs a plugin the
|
|
87
|
+
// host loads and then fails to resolve — a silent broken install, so refuse.
|
|
88
|
+
const requiredBundle = join(srcDir, 'dist', 'tui.js')
|
|
95
89
|
const bundleAvailable = existsSync(requiredBundle)
|
|
96
90
|
if (!bundleAvailable) {
|
|
97
91
|
result.errors++
|
|
@@ -100,8 +94,8 @@ export function copyPluginFiles(
|
|
|
100
94
|
'plugin entrypoint that re-exports a missing bundle. Reinstall pantheon-opencode.',
|
|
101
95
|
)
|
|
102
96
|
}
|
|
103
|
-
const requiredServerBundle = join(srcDir, 'dist', 'server
|
|
104
|
-
const serverBundleAvailable =
|
|
97
|
+
const requiredServerBundle = join(srcDir, 'dist', 'server.js')
|
|
98
|
+
const serverBundleAvailable = existsSync(requiredServerBundle)
|
|
105
99
|
if (!serverBundleAvailable) {
|
|
106
100
|
result.errors++
|
|
107
101
|
result.problems.push(
|
|
@@ -142,17 +136,9 @@ export function copyPluginFiles(
|
|
|
142
136
|
const pkgSrc = join(srcDir, 'package.json')
|
|
143
137
|
if (existsSync(pkgSrc)) {
|
|
144
138
|
const packageJson = JSON.parse(readFileSync(pkgSrc, 'utf8'))
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
// The OpenCode host resolves the plugin server through the `./server` export.
|
|
149
|
-
// In the V2 copy it must point at the V2 server entry so the host attaches
|
|
150
|
-
// the copy's V2 server half (the TUI reactive channel depends on it);
|
|
151
|
-
// otherwise the host loads the V1 server stub of the previous generation's
|
|
152
|
-
// payload.
|
|
153
|
-
if (version === 'v2' && packageJson.exports?.['./server-v2']) {
|
|
154
|
-
packageJson.exports['./server'] = packageJson.exports['./server-v2']
|
|
155
|
-
}
|
|
139
|
+
// The host resolves the plugin server through the `./server` export, so
|
|
140
|
+
// the copy carries the manifest verbatim: `./server` points at the server
|
|
141
|
+
// bundle whose attachment the TUI reactive channel depends on.
|
|
156
142
|
const pkgStatus = writeIfChanged(
|
|
157
143
|
join(dstDir, 'package.json'),
|
|
158
144
|
`${JSON.stringify(packageJson, null, 2)}\n`,
|
|
@@ -163,8 +149,8 @@ export function copyPluginFiles(
|
|
|
163
149
|
else result.skipped++
|
|
164
150
|
}
|
|
165
151
|
|
|
166
|
-
//
|
|
167
|
-
const tuiEntrySrc = join(srcDir,
|
|
152
|
+
// The root loader is a re-export of the compiled bundle.
|
|
153
|
+
const tuiEntrySrc = join(srcDir, 'tui.ts')
|
|
168
154
|
if (!existsSync(tuiEntrySrc)) {
|
|
169
155
|
result.errors++
|
|
170
156
|
result.problems.push(
|
|
@@ -181,19 +167,19 @@ export function copyPluginFiles(
|
|
|
181
167
|
else result.skipped++
|
|
182
168
|
}
|
|
183
169
|
|
|
184
|
-
const
|
|
185
|
-
const
|
|
186
|
-
if (
|
|
170
|
+
const serverEntry = join(srcDir, 'index.ts')
|
|
171
|
+
const serverDestination = join(dstDir, 'index.ts')
|
|
172
|
+
if (serverBundleAvailable && existsSync(serverEntry)) {
|
|
187
173
|
const entryStatus = writeIfChanged(
|
|
188
|
-
|
|
189
|
-
readFileSync(
|
|
174
|
+
serverDestination,
|
|
175
|
+
readFileSync(serverEntry, 'utf8'),
|
|
190
176
|
dryRun,
|
|
191
177
|
{ recorder },
|
|
192
178
|
)
|
|
193
179
|
if (entryStatus === 'created') result.created++
|
|
194
180
|
else result.skipped++
|
|
195
181
|
} else {
|
|
196
|
-
removeLegacyFile(
|
|
182
|
+
removeLegacyFile(serverDestination, dstDir, {
|
|
197
183
|
dryRun,
|
|
198
184
|
recorder,
|
|
199
185
|
reviewedRemovals,
|
|
@@ -290,7 +276,6 @@ export function installPlugin(
|
|
|
290
276
|
{
|
|
291
277
|
dryRun = false,
|
|
292
278
|
clean = false,
|
|
293
|
-
version = 'v1',
|
|
294
279
|
recorder = null,
|
|
295
280
|
reviewedRemovals = null,
|
|
296
281
|
reviewedSnapshots = null,
|
|
@@ -311,7 +296,6 @@ export function installPlugin(
|
|
|
311
296
|
|
|
312
297
|
const copyResult = copyPluginFiles(srcDir, dstDir, {
|
|
313
298
|
dryRun,
|
|
314
|
-
version,
|
|
315
299
|
recorder,
|
|
316
300
|
reviewedRemovals,
|
|
317
301
|
reviewedSnapshots,
|
|
@@ -31,6 +31,7 @@ if (!isSupportedNodeVersion(process.versions.node)) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
import { dump, load } from 'js-yaml'
|
|
34
|
+
import { installDecision, mergeOverrides } from './behavior-overrides.bundle.mjs'
|
|
34
35
|
|
|
35
36
|
import {
|
|
36
37
|
ACTIONS,
|
|
@@ -530,6 +531,34 @@ function recordDirectoryOutcomes(srcDir, dstDir, recorder) {
|
|
|
530
531
|
}
|
|
531
532
|
}
|
|
532
533
|
|
|
534
|
+
function readOptionalFile(path) {
|
|
535
|
+
try {
|
|
536
|
+
return readFileSync(path, 'utf8')
|
|
537
|
+
} catch {
|
|
538
|
+
return undefined
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Named-behavior overrides for one install target: the registry comes from
|
|
544
|
+
* routing.yml; the override file lives beside the install target (project:
|
|
545
|
+
* `.pantheon/overrides.json`; global config dir: `pantheon-overrides.json`).
|
|
546
|
+
* Override FILES are inputs — never inventoried, never written.
|
|
547
|
+
*/
|
|
548
|
+
function loadSkillsOverrideContext(target) {
|
|
549
|
+
let registry = []
|
|
550
|
+
try {
|
|
551
|
+
const routing = load(readFileSync(join(ROOT, 'src', 'routing.yml'), 'utf8'))
|
|
552
|
+
if (Array.isArray(routing?.behaviors)) registry = routing.behaviors
|
|
553
|
+
} catch {
|
|
554
|
+
registry = []
|
|
555
|
+
}
|
|
556
|
+
const globalRaw = readOptionalFile(join(target, 'pantheon-overrides.json'))
|
|
557
|
+
const projectRaw = readOptionalFile(join(target, '.pantheon', 'overrides.json'))
|
|
558
|
+
const { entries: effective } = mergeOverrides(globalRaw, projectRaw)
|
|
559
|
+
return { registry, effective }
|
|
560
|
+
}
|
|
561
|
+
|
|
533
562
|
export function installSkills(
|
|
534
563
|
skills,
|
|
535
564
|
target,
|
|
@@ -547,7 +576,14 @@ export function installSkills(
|
|
|
547
576
|
let created = 0
|
|
548
577
|
let skipped = 0
|
|
549
578
|
|
|
579
|
+
const { registry, effective } = loadSkillsOverrideContext(target)
|
|
550
580
|
for (const skill of skills) {
|
|
581
|
+
const decision = installDecision(effective, registry, `skill-${skill}`)
|
|
582
|
+
if (decision === 'skip') continue
|
|
583
|
+
const contentOverride =
|
|
584
|
+
decision && typeof decision === 'object' && 'content' in decision
|
|
585
|
+
? decision.content
|
|
586
|
+
: undefined
|
|
551
587
|
const src = join(srcSkillsDir, skill)
|
|
552
588
|
const dst = join(dstSkillsDir, skill)
|
|
553
589
|
|
|
@@ -572,7 +608,10 @@ export function installSkills(
|
|
|
572
608
|
}
|
|
573
609
|
copyDirRecursive(srcPath, dstPath)
|
|
574
610
|
} else {
|
|
575
|
-
const content =
|
|
611
|
+
const content =
|
|
612
|
+
entry === 'SKILL.md' && from === src && contentOverride !== undefined
|
|
613
|
+
? contentOverride
|
|
614
|
+
: readFileSync(srcPath, 'utf8')
|
|
576
615
|
const dstStat = lstatOrNull(dstPath)
|
|
577
616
|
if (dstStat?.isSymbolicLink()) {
|
|
578
617
|
throw new Error(`Refusing to read through symlink: ${dstPath}`)
|
|
@@ -26,12 +26,9 @@ const REQUIRED_PAYLOAD = [
|
|
|
26
26
|
'package/pyproject.toml',
|
|
27
27
|
'package/src/plugins/tui/package.json',
|
|
28
28
|
'package/src/plugins/tui/package-lock.json',
|
|
29
|
-
'package/src/plugin.ts',
|
|
30
|
-
'package/src/plugin-v2.ts',
|
|
31
|
-
'package/src/pantheon/v2-bridge.ts',
|
|
32
29
|
'package/src/plugins/tui/dist/tui.js',
|
|
33
30
|
'package/src/plugins/tui/dist/server.js',
|
|
34
|
-
'package/src/plugins/tui/dist/server
|
|
31
|
+
'package/src/plugins/tui/dist/server.js',
|
|
35
32
|
'package/bin/pantheon-init.mjs',
|
|
36
33
|
'package/scripts/doctor.mjs',
|
|
37
34
|
'package/scripts/node-engine-policy.mjs',
|
|
@@ -220,7 +220,7 @@ async function main() {
|
|
|
220
220
|
const dataHome = join(root, 'data')
|
|
221
221
|
const opencodeDir = join(dataHome, 'opencode')
|
|
222
222
|
// Every real installation writes `opencode.db`; the v1/v2 distinction is the
|
|
223
|
-
// SCHEMA of that file, never its name. Deriving `opencode
|
|
223
|
+
// SCHEMA of that file, never its name. Deriving `opencode.db` here made the
|
|
224
224
|
// probe assert a path that exists on no real machine.
|
|
225
225
|
const selectedDb = join(opencodeDir, 'opencode.db')
|
|
226
226
|
const otherDb = join(root, 'other.db')
|
package/scripts/reconcile.mjs
CHANGED
|
@@ -118,12 +118,11 @@ function resolveTarget(args) {
|
|
|
118
118
|
return resolve(join(homedir(), '.config', 'opencode'))
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
function layoutFor({ global
|
|
121
|
+
function layoutFor({ global }) {
|
|
122
|
+
// V2-only: a project target is always the project-v2 layout; the V1
|
|
123
|
+
// project-v1 layout no longer exists.
|
|
122
124
|
return Object.fromEntries(
|
|
123
|
-
VALID_COMPONENTS.map((component) => [
|
|
124
|
-
component,
|
|
125
|
-
global ? 'global' : version === 'v2' ? 'project-v2' : 'project-v1',
|
|
126
|
-
]),
|
|
125
|
+
VALID_COMPONENTS.map((component) => [component, global ? 'global' : 'project-v2']),
|
|
127
126
|
)
|
|
128
127
|
}
|
|
129
128
|
|
|
@@ -134,7 +133,6 @@ async function buildReview(target, components, global) {
|
|
|
134
133
|
throw new Error('No readable installer state found; unowned legacy files will not be removed')
|
|
135
134
|
const { installOpenCode } = await import('./install/opencode.mjs')
|
|
136
135
|
const desired = await installOpenCode(target, true, false, components, {
|
|
137
|
-
version: 'auto',
|
|
138
136
|
global,
|
|
139
137
|
quiet: true,
|
|
140
138
|
quietPlan: true,
|
|
@@ -146,7 +144,7 @@ async function buildReview(target, components, global) {
|
|
|
146
144
|
.filter((file) => typeof file.outputFingerprint === 'string')
|
|
147
145
|
.map((file) => [file.path, { sha256: file.outputFingerprint }]),
|
|
148
146
|
)
|
|
149
|
-
const selectedLayouts = layoutFor({ global
|
|
147
|
+
const selectedLayouts = layoutFor({ global })
|
|
150
148
|
const report = classifyFileInventory(target, state, {
|
|
151
149
|
desiredFiles,
|
|
152
150
|
selectedComponents: components,
|
|
@@ -56,8 +56,8 @@ const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..')
|
|
|
56
56
|
|
|
57
57
|
const GATE_NAMES = ['host', 'install', 'package', 'changelog', 'metadata']
|
|
58
58
|
|
|
59
|
-
/** Support is family-level:
|
|
60
|
-
export const SUPPORTED_FAMILIES = Object.freeze(['
|
|
59
|
+
/** Support is family-level: this is the family this release supports. */
|
|
60
|
+
export const SUPPORTED_FAMILIES = Object.freeze(['2.x'])
|
|
61
61
|
|
|
62
62
|
/** Known-broken hosts. Every other member of a supported family is supported. */
|
|
63
63
|
export const KNOWN_BROKEN_HOSTS = Object.freeze(['2.0.22'])
|
|
@@ -78,9 +78,11 @@ const REQUIRED_TARBALL_PAYLOAD = [
|
|
|
78
78
|
'package/package.json',
|
|
79
79
|
'package/plugin.json',
|
|
80
80
|
'package/pyproject.toml',
|
|
81
|
+
// The plugin export target and its directory shim (the registered entry).
|
|
81
82
|
'package/src/plugin.ts',
|
|
82
|
-
'package/src/plugin
|
|
83
|
+
'package/src/plugin/index.ts',
|
|
83
84
|
'package/src/plugins/tui/dist/tui.js',
|
|
85
|
+
'package/src/plugins/tui/dist/server.js',
|
|
84
86
|
'package/src/plugins/tui/package.json',
|
|
85
87
|
'package/src/plugins/tui/package-lock.json',
|
|
86
88
|
'package/bin/pantheon-init.mjs',
|
|
@@ -271,21 +273,12 @@ export function validateMatrix(matrix) {
|
|
|
271
273
|
`matrix row ${row.host} has an undeclared family: ${JSON.stringify(row.line)}`,
|
|
272
274
|
)
|
|
273
275
|
}
|
|
274
|
-
if (
|
|
275
|
-
throw new Error(`host ${row.host} does not belong to the 1.19.x family`)
|
|
276
|
-
}
|
|
277
|
-
if (row.line === '2.x' && !row.host.startsWith('2.')) {
|
|
276
|
+
if (!row.host.startsWith('2.')) {
|
|
278
277
|
throw new Error(`host ${row.host} does not belong to the 2.x family`)
|
|
279
278
|
}
|
|
280
|
-
if (row.
|
|
281
|
-
throw new Error(`kind ${row.kind} cannot run on the 1.19.x family`)
|
|
282
|
-
}
|
|
283
|
-
if (row.line === '2.x' && row.kind !== 'sandbox-v2') {
|
|
279
|
+
if (row.kind !== 'sandbox-v2') {
|
|
284
280
|
throw new Error(`kind ${row.kind} cannot run on the 2.x family`)
|
|
285
281
|
}
|
|
286
|
-
if (!['sandbox-v2', 'v1-permission'].includes(row.kind)) {
|
|
287
|
-
throw new Error(`matrix row ${row.host} has an unknown kind: ${JSON.stringify(row.kind)}`)
|
|
288
|
-
}
|
|
289
282
|
}
|
|
290
283
|
}
|
|
291
284
|
|
|
@@ -295,34 +288,6 @@ export function hostEvidenceWarning(checks) {
|
|
|
295
288
|
: null
|
|
296
289
|
}
|
|
297
290
|
|
|
298
|
-
function v1Proof(root, row) {
|
|
299
|
-
rmSync(root, { recursive: true, force: true })
|
|
300
|
-
const prefix = join(root, 'prefix')
|
|
301
|
-
const home = join(root, 'home')
|
|
302
|
-
mkdirSync(prefix, { recursive: true })
|
|
303
|
-
mkdirSync(home, { recursive: true })
|
|
304
|
-
run(
|
|
305
|
-
`host-${row.host}-install`,
|
|
306
|
-
'npm',
|
|
307
|
-
['install', '--global', '--prefix', prefix, `opencode-ai@${row.host}`],
|
|
308
|
-
{
|
|
309
|
-
env: { HOME: home, npm_config_cache: join(root, 'npm-cache') },
|
|
310
|
-
},
|
|
311
|
-
)
|
|
312
|
-
const binary = join(prefix, 'bin', 'opencode')
|
|
313
|
-
return run(`host-${row.host}`, 'bash', ['tests/canary/run-v1-permission-proof.sh'], {
|
|
314
|
-
env: {
|
|
315
|
-
HOME: home,
|
|
316
|
-
XDG_CONFIG_HOME: join(root, 'config'),
|
|
317
|
-
XDG_DATA_HOME: join(root, 'data'),
|
|
318
|
-
XDG_STATE_HOME: join(root, 'state'),
|
|
319
|
-
XDG_CACHE_HOME: join(root, 'cache'),
|
|
320
|
-
PATH: `${join(prefix, 'bin')}:${process.env.PATH ?? ''}`,
|
|
321
|
-
PANTHEON_V1_CANARY_BIN: binary,
|
|
322
|
-
},
|
|
323
|
-
})
|
|
324
|
-
}
|
|
325
|
-
|
|
326
291
|
function hostGate(options) {
|
|
327
292
|
const tarball = singleTarball(options)
|
|
328
293
|
const matrix = matrixFromEnv()
|
|
@@ -330,21 +295,17 @@ function hostGate(options) {
|
|
|
330
295
|
const checks = []
|
|
331
296
|
matrix.forEach((row, index) => {
|
|
332
297
|
const root = join(runnerTemp(), `pantheon-release-host-${safeName(row.host)}`)
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
)
|
|
345
|
-
return
|
|
346
|
-
}
|
|
347
|
-
checks.push(v1Proof(root, row))
|
|
298
|
+
rmSync(root, { recursive: true, force: true })
|
|
299
|
+
checks.push(
|
|
300
|
+
run(
|
|
301
|
+
`host-${row.host}`,
|
|
302
|
+
'bash',
|
|
303
|
+
['scripts/test-opencode-sandbox.sh', '--prepare', '--run', 'v2'],
|
|
304
|
+
{
|
|
305
|
+
env: sandboxEnv(root, row.host, tarball, 49380 + index),
|
|
306
|
+
},
|
|
307
|
+
),
|
|
308
|
+
)
|
|
348
309
|
})
|
|
349
310
|
const measuredFamilies = [...new Set(matrix.map((row) => row.line))]
|
|
350
311
|
const unmeasuredFamilies = SUPPORTED_FAMILIES.filter(
|
|
@@ -380,7 +341,7 @@ function installGate(options) {
|
|
|
380
341
|
const sandbox = run(
|
|
381
342
|
'sandbox-install',
|
|
382
343
|
'bash',
|
|
383
|
-
['scripts/test-opencode-
|
|
344
|
+
['scripts/test-opencode-sandbox.sh', '--prepare', '--run', 'v2'],
|
|
384
345
|
{ env: sandboxEnv(root, host, tarball, port) },
|
|
385
346
|
)
|
|
386
347
|
const version = installedVersion(root)
|
|
@@ -459,19 +420,19 @@ function packageGate(options) {
|
|
|
459
420
|
const validate = run('package-validate', 'npm', ['run', 'package:validate'])
|
|
460
421
|
|
|
461
422
|
// TUI dist stamp gate (QA beta.20 "O artefato TUI"): the sidebar version is
|
|
462
|
-
// build-time baked into tui
|
|
423
|
+
// build-time baked into tui.js — a stale embed ships a footer lying about
|
|
463
424
|
// the running version. Extract the dist from THIS tarball and require the
|
|
464
425
|
// release version string to be present.
|
|
465
426
|
const stamp = run(
|
|
466
427
|
'tui-dist-read',
|
|
467
428
|
'tar',
|
|
468
|
-
['-xzOf', tarball, 'package/src/plugins/tui/dist/tui
|
|
429
|
+
['-xzOf', tarball, 'package/src/plugins/tui/dist/tui.js'],
|
|
469
430
|
{ echo: false },
|
|
470
431
|
)
|
|
471
432
|
const distText = stamp.output
|
|
472
433
|
if (!distText.includes(options.version)) {
|
|
473
434
|
throw new Error(
|
|
474
|
-
`TUI dist embed is stale: ${options.version} not found in the packaged tui
|
|
435
|
+
`TUI dist embed is stale: ${options.version} not found in the packaged tui.js — ` +
|
|
475
436
|
'rebuild the TUI workspace (npm run build --workspace=src/plugins/tui) at the release version and repack',
|
|
476
437
|
)
|
|
477
438
|
}
|
|
@@ -4,8 +4,9 @@ import { isDeepStrictEqual } from 'node:util'
|
|
|
4
4
|
import * as clack from '@clack/prompts'
|
|
5
5
|
import { createBackupSet } from './install/backup.mjs'
|
|
6
6
|
import {
|
|
7
|
+
convertLegacyPermissionsToV2,
|
|
7
8
|
MCP_ENTRYPOINT_RENAMES,
|
|
8
|
-
|
|
9
|
+
normalizeMcpConfigToV2,
|
|
9
10
|
PANTHEON_MCP_ENTRYPOINTS,
|
|
10
11
|
validateMcpV1toV2Source,
|
|
11
12
|
} from './install/config-migration.mjs'
|
|
@@ -481,7 +482,7 @@ function inspectInstallerEntries(config) {
|
|
|
481
482
|
const plugins = new Set()
|
|
482
483
|
if (Array.isArray(config.plugins)) {
|
|
483
484
|
for (const entry of config.plugins) {
|
|
484
|
-
if (pluginReferenceIdentity(entry) === 'src/plugin
|
|
485
|
+
if (pluginReferenceIdentity(entry) === 'src/plugin') plugins.add('V2 plugin')
|
|
485
486
|
}
|
|
486
487
|
}
|
|
487
488
|
|
|
@@ -593,7 +594,7 @@ function managedEntryMovePlan(files) {
|
|
|
593
594
|
const sourcePlugins = sourcePluginsProperty?.valueNode
|
|
594
595
|
if (sourcePlugins?.type === 'array') {
|
|
595
596
|
const pluginItems = sourcePlugins.items.filter(
|
|
596
|
-
(item) => pluginReferenceIdentity(item.value) === 'src/plugin
|
|
597
|
+
(item) => pluginReferenceIdentity(item.value) === 'src/plugin',
|
|
597
598
|
)
|
|
598
599
|
if (pluginItems.length > 0) {
|
|
599
600
|
const targetPlugins = target.config?.plugins
|
|
@@ -606,7 +607,7 @@ function managedEntryMovePlan(files) {
|
|
|
606
607
|
const prefixCount = pluginItems.length
|
|
607
608
|
const prefixSafe = pluginItems.every((item, index) => sourcePlugins.items[index] === item)
|
|
608
609
|
const targetManagedPlugins = Array.isArray(targetPlugins)
|
|
609
|
-
? targetPlugins.filter((plugin) => pluginReferenceIdentity(plugin) === 'src/plugin
|
|
610
|
+
? targetPlugins.filter((plugin) => pluginReferenceIdentity(plugin) === 'src/plugin')
|
|
610
611
|
: []
|
|
611
612
|
if (targetManagedPlugins.length > 0) {
|
|
612
613
|
const exactDuplicate =
|
|
@@ -632,7 +633,7 @@ function managedEntryMovePlan(files) {
|
|
|
632
633
|
const targetSafe =
|
|
633
634
|
targetPlugins === undefined ||
|
|
634
635
|
(Array.isArray(targetPlugins) &&
|
|
635
|
-
!targetPlugins.some((plugin) => pluginReferenceIdentity(plugin) === 'src/plugin
|
|
636
|
+
!targetPlugins.some((plugin) => pluginReferenceIdentity(plugin) === 'src/plugin'))
|
|
636
637
|
const canMove =
|
|
637
638
|
prefixSafe &&
|
|
638
639
|
exactSourceDuplicates &&
|
|
@@ -716,7 +717,7 @@ function addManagedEntriesToJson(config, moves, disabledMcpServers = []) {
|
|
|
716
717
|
if (!isRecord(config.mcp)) throw new Error('Target MCP map is unsupported.')
|
|
717
718
|
let targetShape = validateMcpV1toV2Source(config.mcp)
|
|
718
719
|
if (move.nested && !targetShape.hasV2ServersMap && Object.hasOwn(config.mcp, 'servers')) {
|
|
719
|
-
config.mcp =
|
|
720
|
+
config.mcp = normalizeMcpConfigToV2(config.mcp)
|
|
720
721
|
targetShape = validateMcpV1toV2Source(config.mcp)
|
|
721
722
|
}
|
|
722
723
|
const nested = move.nested || targetShape.hasV2ServersMap
|
|
@@ -855,8 +856,9 @@ function makeV2Policy(source, askChoices) {
|
|
|
855
856
|
if (source.key === 'permission') {
|
|
856
857
|
validateLegacyPolicy(source.value)
|
|
857
858
|
const permission = applyAskChoices(source, askChoices)
|
|
858
|
-
const
|
|
859
|
-
|
|
859
|
+
const policy = convertLegacyPermissionsToV2(permission, {
|
|
860
|
+
mcpServerNames: source.mcpServers ?? [],
|
|
861
|
+
})
|
|
860
862
|
validateV2Policy(policy)
|
|
861
863
|
return policy
|
|
862
864
|
}
|
package/scripts/setup.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import path from 'node:path'
|
|
|
5
5
|
import { fileURLToPath } from 'node:url'
|
|
6
6
|
import { isDeepStrictEqual } from 'node:util'
|
|
7
7
|
import * as clack from '@clack/prompts'
|
|
8
|
-
import {
|
|
8
|
+
import { resolveOpenCodeVersion } from './install/opencode-version.mjs'
|
|
9
9
|
import { planArtifactDigest } from './install/plan-artifact.mjs'
|
|
10
10
|
import {
|
|
11
11
|
applyConfigChanges,
|
|
@@ -157,7 +157,11 @@ function safeOperationPath(value) {
|
|
|
157
157
|
return parts.join('/')
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
/**
|
|
160
|
+
/**
|
|
161
|
+
* Review and apply the opt-in config migration before allowing init to write.
|
|
162
|
+
* V2-only: setup exists for OpenCode 2.x hosts, and the generation gate refuses
|
|
163
|
+
* a confirmed 1.x host before anything runs.
|
|
164
|
+
*/
|
|
161
165
|
export async function runSetup({
|
|
162
166
|
args = process.argv.slice(2),
|
|
163
167
|
env = process.env,
|
|
@@ -196,33 +200,19 @@ export async function runSetup({
|
|
|
196
200
|
return helpResult?.status ?? helpResult?.code ?? 0
|
|
197
201
|
}
|
|
198
202
|
|
|
199
|
-
let detectionFallback = false
|
|
200
|
-
const warnings = []
|
|
201
|
-
let generation
|
|
202
203
|
try {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
warn: () =>
|
|
207
|
-
warnings.push('OpenCode version detection was inconclusive; pass --version v1 or v2.'),
|
|
208
|
-
onFallback: () => {
|
|
209
|
-
detectionFallback = true
|
|
210
|
-
},
|
|
211
|
-
})
|
|
204
|
+
// Single-generation gate: refuse a confirmed 1.x host (and an explicit
|
|
205
|
+
// OPENCODE_VERSION=v1 pin) before any config review or init can run.
|
|
206
|
+
resolveVersion({ env })
|
|
212
207
|
} catch (error) {
|
|
213
208
|
writeOutput(
|
|
214
209
|
output,
|
|
215
|
-
`${error instanceof Error ? error.message : 'OpenCode generation
|
|
210
|
+
`${error instanceof Error ? error.message : 'OpenCode generation could not be resolved; install OpenCode 2.x and re-run setup.'}\n`,
|
|
216
211
|
)
|
|
217
212
|
return 1
|
|
218
213
|
}
|
|
219
|
-
for (const warning of warnings) writeOutput(output, `${warning}\n`)
|
|
220
214
|
|
|
221
|
-
const migrationEnabled =
|
|
222
|
-
generation === 'v2' &&
|
|
223
|
-
!detectionFallback &&
|
|
224
|
-
!args.includes('--project') &&
|
|
225
|
-
!args.includes('--help')
|
|
215
|
+
const migrationEnabled = !args.includes('--project') && !args.includes('--help')
|
|
226
216
|
const dryRun = args.includes('--dry-run')
|
|
227
217
|
let initEnv = env
|
|
228
218
|
let prepared = { status: 'unchanged', changes: [] }
|
|
@@ -265,7 +255,7 @@ export async function runSetup({
|
|
|
265
255
|
initEnv = { ...env, PANTHEON_SETUP_TARGET: configDir }
|
|
266
256
|
}
|
|
267
257
|
|
|
268
|
-
const pinnedArgs = [...passthroughArgs(args)
|
|
258
|
+
const pinnedArgs = [...passthroughArgs(args)]
|
|
269
259
|
const previewArgs = [
|
|
270
260
|
'init',
|
|
271
261
|
'--dry-run',
|
package/scripts/sync-tui.mjs
CHANGED
|
@@ -14,7 +14,6 @@ import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync
|
|
|
14
14
|
import { homedir } from 'node:os'
|
|
15
15
|
import { join } from 'node:path'
|
|
16
16
|
import { fileURLToPath, pathToFileURL } from 'node:url'
|
|
17
|
-
import { resolveOpenCodeVersion } from './install/opencode-version.mjs'
|
|
18
17
|
import { isSupportedNodeVersion } from './node-engine-policy.mjs'
|
|
19
18
|
|
|
20
19
|
const __dirname = fileURLToPath(new URL('.', import.meta.url))
|
|
@@ -65,7 +64,7 @@ function resolveConfigDir() {
|
|
|
65
64
|
* The raw TSX source is never copied — the loader consumes only the bundle.
|
|
66
65
|
* @returns {{ created: number, skipped: number }}
|
|
67
66
|
*/
|
|
68
|
-
export function copyPluginFiles(srcDir, dstDir
|
|
67
|
+
export function copyPluginFiles(srcDir, dstDir) {
|
|
69
68
|
const result = { created: 0, skipped: 0 }
|
|
70
69
|
|
|
71
70
|
mkdirSync(dstDir, { recursive: true })
|
|
@@ -90,17 +89,11 @@ export function copyPluginFiles(srcDir, dstDir, version) {
|
|
|
90
89
|
const pkgSrc = join(srcDir, 'package.json')
|
|
91
90
|
if (existsSync(pkgSrc)) {
|
|
92
91
|
const packageJson = JSON.parse(readFileSync(pkgSrc, 'utf8'))
|
|
93
|
-
if (version === 'v2' && packageJson.exports?.['./tui-v2']) {
|
|
94
|
-
packageJson.exports['./tui'] = packageJson.exports['./tui-v2']
|
|
95
|
-
}
|
|
96
92
|
// Mirror of scripts/install/plugin.mjs: the OpenCode host resolves the
|
|
97
93
|
// plugin server through the `./server` export. In the V2 copy it must
|
|
98
94
|
// point at the V2 server entry so the host attaches the copy's V2 server
|
|
99
95
|
// half (the TUI reactive channel depends on it); otherwise the host loads
|
|
100
96
|
// the V1 server stub of the previous generation's payload.
|
|
101
|
-
if (version === 'v2' && packageJson.exports?.['./server-v2']) {
|
|
102
|
-
packageJson.exports['./server'] = packageJson.exports['./server-v2']
|
|
103
|
-
}
|
|
104
97
|
const content = `${JSON.stringify(packageJson, null, 2)}\n`
|
|
105
98
|
if (writeIfChanged(join(dstDir, 'package.json'), content)) result.created++
|
|
106
99
|
else result.skipped++
|
|
@@ -117,19 +110,19 @@ export function copyPluginFiles(srcDir, dstDir, version) {
|
|
|
117
110
|
} else result.skipped++
|
|
118
111
|
}
|
|
119
112
|
|
|
120
|
-
const tuiEntry = join(srcDir,
|
|
113
|
+
const tuiEntry = join(srcDir, 'tui.ts')
|
|
121
114
|
if (existsSync(tuiEntry)) {
|
|
122
115
|
if (writeIfChanged(join(dstDir, 'tui.ts'), readFileSync(tuiEntry, 'utf8'))) result.created++
|
|
123
116
|
else result.skipped++
|
|
124
117
|
}
|
|
125
118
|
|
|
126
|
-
const
|
|
127
|
-
const
|
|
128
|
-
if (
|
|
129
|
-
if (writeIfChanged(
|
|
119
|
+
const serverEntry = join(srcDir, 'index.ts')
|
|
120
|
+
const serverDestination = join(dstDir, 'index.ts')
|
|
121
|
+
if (existsSync(serverEntry)) {
|
|
122
|
+
if (writeIfChanged(serverDestination, readFileSync(serverEntry, 'utf8'))) result.created++
|
|
130
123
|
else result.skipped++
|
|
131
|
-
} else if (existsSync(
|
|
132
|
-
rmSync(
|
|
124
|
+
} else if (existsSync(serverDestination)) {
|
|
125
|
+
rmSync(serverDestination, { force: true })
|
|
133
126
|
}
|
|
134
127
|
|
|
135
128
|
// Keep the copied plugin installable with deterministic npm ci.
|
|
@@ -209,8 +202,7 @@ async function main() {
|
|
|
209
202
|
const sourceVersion = readVersion(join(tuiSrcDir, 'package.json'))
|
|
210
203
|
|
|
211
204
|
// Copy fresh files
|
|
212
|
-
const
|
|
213
|
-
const { created } = copyPluginFiles(tuiSrcDir, tuiCopyDir, version)
|
|
205
|
+
const { created } = copyPluginFiles(tuiSrcDir, tuiCopyDir)
|
|
214
206
|
|
|
215
207
|
// Lockfile installation is the only accepted dependency path. Strip
|
|
216
208
|
// global-context npm vars so a global postinstall can't trigger ECIGLOBAL.
|