pantheon-opencode 1.6.0-beta.8 → 1.6.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/AGENTS.global.md +118 -0
- package/AGENTS.md +18 -168
- package/CHANGELOG.md +126 -346
- package/README.md +83 -608
- package/README.pt-BR.md +120 -345
- package/bin/pantheon-init.mjs +366 -132
- package/commands/pantheon-audit.md +7 -1
- package/commands/pantheon-consolidate.md +1 -1
- package/commands/pantheon-deepwork.md +14 -3
- package/commands/pantheon-focus.md +17 -0
- package/commands/pantheon-vision.md +61 -12
- package/package.json +19 -11
- package/plugin.json +1 -1
- package/pyproject.toml +6 -2
- package/scripts/_pantheon_paths.py +24 -0
- package/scripts/build-agents-md.mjs +368 -69
- package/scripts/changelog-merge.mjs +161 -0
- package/scripts/check-plugin-v2-coverage.mjs +11 -8
- package/scripts/docs-check-changelog.mjs +204 -0
- package/scripts/docs-link-check.mjs +314 -0
- package/scripts/docs-media.mjs +157 -0
- package/scripts/doctor.mjs +828 -40
- package/scripts/install/agents-md.mjs +2 -2
- package/scripts/install/backup.mjs +648 -0
- package/scripts/install/cli-ui.mjs +303 -72
- package/scripts/install/component-selection.mjs +61 -0
- package/scripts/install/config-migration.mjs +583 -27
- package/scripts/install/exit-codes.mjs +26 -0
- package/scripts/install/file-inventory.mjs +555 -0
- package/scripts/install/health-check.mjs +31 -25
- package/scripts/install/interactive.mjs +78 -383
- package/scripts/install/migrate.mjs +49 -25
- package/scripts/install/model-picker.mjs +218 -250
- package/scripts/install/opencode-version.mjs +83 -21
- package/scripts/install/opencode.mjs +1465 -180
- package/scripts/install/plan-artifact.mjs +517 -0
- package/scripts/install/plan.mjs +475 -0
- package/scripts/install/plugin.mjs +251 -30
- package/scripts/install/prompt-result.mjs +2 -0
- package/scripts/install/shared.mjs +256 -99
- package/scripts/install/state.mjs +63 -8
- package/scripts/install/strings.mjs +60 -4
- package/scripts/install/venv.mjs +90 -47
- package/scripts/install/verify.mjs +128 -0
- package/scripts/install/vision-prompt.mjs +173 -0
- package/scripts/install-mcp.mjs +2 -2
- package/scripts/manifest-inventory.mjs +49 -3
- package/scripts/mcp_persistence.py +1535 -1050
- package/scripts/memory_mcp.py +12 -843
- package/scripts/node-engine-policy.mjs +85 -0
- package/scripts/package-evidence.mjs +10 -2
- package/scripts/postinstall.mjs +26 -26
- package/scripts/probe-pantheon-cost.mjs +118 -19
- package/scripts/prune.mjs +9 -3
- package/scripts/reconcile.mjs +325 -0
- package/scripts/release-gates.mjs +682 -0
- package/scripts/restore.mjs +222 -0
- package/scripts/run-node-tests.mjs +24 -8
- package/scripts/sync-artifacts.mjs +20 -7
- package/scripts/sync-tui.mjs +29 -4
- package/scripts/test-opencode-v2-sandbox.sh +36 -123
- package/scripts/uninstall.mjs +369 -34
- package/scripts/update.mjs +164 -0
- package/scripts/validate-node-engine-policy.mjs +13 -0
- package/scripts/version-check.mjs +34 -1
- package/scripts/versioning.mjs +23 -3
- package/scripts/vision-status.mjs +682 -0
- package/skills-lock.json +8 -8
- package/src/agents/aphrodite.md +13 -10
- package/src/agents/apollo.md +4 -5
- package/src/agents/athena.md +74 -46
- package/src/agents/demeter.md +10 -7
- package/src/agents/gaia.md +0 -1
- package/src/agents/hephaestus.md +4 -3
- package/src/agents/hermes.md +10 -9
- package/src/agents/iris.md +6 -1
- package/src/agents/mnemosyne.md +14 -15
- package/src/agents/nyx.md +4 -4
- package/src/agents/prometheus.md +12 -11
- package/src/agents/talos.md +6 -0
- package/src/agents/zeus.md +84 -56
- package/src/instructions/agent-return-format.instructions.md +12 -41
- package/src/instructions/memory-protocol.instructions.md +5 -11
- package/src/instructions/test-economy.instructions.md +12 -0
- package/src/instructions/yagni.instructions.md +6 -15
- package/src/instructions/zeus-anti-stall.instructions.md +6 -6
- package/src/instructions/zeus-communication-rules.instructions.md +6 -6
- package/src/instructions/zeus-council-synthesis.instructions.md +11 -12
- package/src/instructions/zeus-memory-operations.instructions.md +13 -7
- package/src/instructions/zeus-timeout-retry.instructions.md +36 -10
- package/src/mcp/_pantheon_paths.py +24 -0
- package/src/mcp/mcp_codemap_module.py +86 -18
- package/src/mcp/mcp_persistence.py +1535 -1050
- package/src/mcp/memory_mcp.py +444 -94
- package/src/mcp/pantheon_vision.py +285 -41
- package/src/mcp/requirements-mcp.txt +5 -0
- package/src/pantheon/context-pruner.ts +541 -0
- package/src/pantheon/cost-command.ts +814 -60
- package/src/pantheon/goal-loop.ts +11 -8
- package/src/pantheon/memory-context.ts +1017 -0
- package/src/pantheon/model-agents.ts +19 -0
- package/src/pantheon/model-command.ts +218 -56
- package/src/pantheon/model-pricing.ts +536 -0
- package/src/pantheon/presets.mjs +2 -0
- package/src/pantheon/task-result-guard.ts +50 -14
- package/src/pantheon/v2-bounded-read.ts +640 -0
- package/src/pantheon/v2-delegation-enforce.ts +133 -6
- package/src/pantheon/v2-execute-after.ts +135 -24
- package/src/pantheon/v2-model-overrides.ts +275 -0
- package/src/pantheon/v2-tools.ts +89 -35
- package/src/pantheon/v2-unsupported.mjs +2 -3
- package/src/pantheon/v2-vision.ts +622 -0
- package/src/pantheon/vision-local.ts +531 -0
- package/src/pantheon/vision.ts +1160 -115
- package/src/plugin-v2.ts +654 -162
- package/src/plugin.ts +15 -11
- package/src/plugins/tui/dist/tui-v2.d.ts +1036 -0
- package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -0
- package/src/plugins/tui/dist/tui-v2.js +3808 -0
- package/src/plugins/tui/dist/tui-v2.js.map +1 -0
- package/src/plugins/tui/dist/tui.js +4 -4
- package/src/plugins/tui/index-v2.ts +6 -0
- package/src/plugins/tui/package-lock.json +5416 -1297
- package/src/plugins/tui/package.json +14 -10
- package/src/plugins/tui/src/index-v2.tsx +4372 -0
- package/src/plugins/tui/src/index.tsx +3 -3
- package/src/plugins/tui/src/opencode-v2.d.ts +13 -0
- package/src/plugins/tui/tsconfig.typecheck.json +5 -0
- package/src/plugins/tui/tsdown.config.ts +2 -2
- package/src/plugins/tui/tui-v2.ts +2 -0
- package/src/plugins/tui/tui.ts +3 -0
- package/src/routing.yml +50 -5
- package/src/skills/agent-coordination/SKILL.md +7 -2
- package/src/skills/artifact-management/SKILL.md +5 -1
- package/src/skills/auto-continue/SKILL.md +14 -6
- package/src/skills/codemap/SKILL.md +1 -1
- package/src/skills/memory-bank/SKILL.md +21 -13
- package/src/skills/session-goal/SKILL.md +14 -15
- package/src/skills/spec-driven-development/SKILL.md +3 -1
- package/src/skills/worktrees/SKILL.md +30 -11
- package/scripts/probe-context-rehydrate.mjs +0 -263
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vision-prompt.mjs — optional vision step of `pantheon-opencode init`.
|
|
3
|
+
*
|
|
4
|
+
* After the model-preset wizard, an interactive TTY session is offered a
|
|
5
|
+
* three-way choice for the vision model:
|
|
6
|
+
* 1. automatic discovery (default, Enter) — writes nothing
|
|
7
|
+
* 2. pin a `provider/model` — merges `visionModel` into the
|
|
8
|
+
* GLOBAL vision config (~/.config/opencode/opencode-vision.json)
|
|
9
|
+
* 3. skip — writes nothing
|
|
10
|
+
*
|
|
11
|
+
* Non-interactive runs (no TTY, `--yes`, `--headless`, automated sandboxes)
|
|
12
|
+
* never reach this module: `installOpenCode` only calls it when
|
|
13
|
+
* `interactive && !dryRun && !autoYes`. Automatic discovery therefore stays
|
|
14
|
+
* the default in every non-interactive flow and no run blocks on stdin.
|
|
15
|
+
*
|
|
16
|
+
* The write mirrors the `/pantheon-vision` command: atomic, `.bak` backup,
|
|
17
|
+
* and a MERGE — existing keys are never overwritten.
|
|
18
|
+
*/
|
|
19
|
+
import { copyFileSync, existsSync, mkdirSync, readFileSync } from 'node:fs'
|
|
20
|
+
import { homedir } from 'node:os'
|
|
21
|
+
import { dirname, join } from 'node:path'
|
|
22
|
+
import { writeConfigWithBackup } from './shared.mjs'
|
|
23
|
+
import { verifyRegularFile } from './verify.mjs'
|
|
24
|
+
|
|
25
|
+
const CONFIG_FILENAME = 'opencode-vision.json'
|
|
26
|
+
/** `provider/model` — exactly one slash, no surrounding whitespace. */
|
|
27
|
+
const MODEL_PATTERN = /^[^\s/]+\/[^\s/]+$/
|
|
28
|
+
const MAX_PIN_ATTEMPTS = 3
|
|
29
|
+
|
|
30
|
+
/** Global vision config path, honoring `XDG_CONFIG_HOME` (same rule as the plugin). */
|
|
31
|
+
export function globalVisionConfigPath(env = process.env) {
|
|
32
|
+
const home = env.HOME?.trim() || homedir()
|
|
33
|
+
const xdg = env.XDG_CONFIG_HOME?.trim() || join(home, '.config')
|
|
34
|
+
return join(xdg, 'opencode', CONFIG_FILENAME)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** True when `value` looks like a `provider/model` id (one slash, no spaces). */
|
|
38
|
+
export function isValidVisionModel(value) {
|
|
39
|
+
return typeof value === 'string' && MODEL_PATTERN.test(value.trim())
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Merge `visionModel` into a vision config, preserving every other key.
|
|
44
|
+
* Defaults to the GLOBAL config; pass `configPath` to target another file
|
|
45
|
+
* (e.g. the project config `.opencode/opencode-vision.json`). Creates the
|
|
46
|
+
* parent directory when missing; never overwrites existing keys. A corrupted
|
|
47
|
+
* JSON file is left byte-identical (the caller decides what to tell the user)
|
|
48
|
+
* rather than clobbered.
|
|
49
|
+
*
|
|
50
|
+
* A concurrent writer that changes the file between the read and the atomic
|
|
51
|
+
* swap makes `writeConfigWithBackup` return `'conflict'`: the write is aborted,
|
|
52
|
+
* `wrote` is `false`, and the newer content is left untouched.
|
|
53
|
+
*
|
|
54
|
+
* @param {object} [opts]
|
|
55
|
+
* @param {Record<string, string|undefined>} [opts.env]
|
|
56
|
+
* @param {boolean} [opts.dryRun]
|
|
57
|
+
* @param {string} [opts.configPath] - explicit target file (defaults to global)
|
|
58
|
+
* @param {(existing: string|null) => void} [opts.beforeRecheck] - test seam
|
|
59
|
+
* forwarded to `writeConfigWithBackup` to simulate a concurrent writer.
|
|
60
|
+
* @returns {{path: string, wrote: boolean, reason: 'created'|'skipped'|'conflict'|'corrupt'|'dry-run'}}
|
|
61
|
+
*/
|
|
62
|
+
export function mergeVisionModel(
|
|
63
|
+
model,
|
|
64
|
+
{ env = process.env, dryRun = false, beforeRecheck, configPath: target } = {},
|
|
65
|
+
) {
|
|
66
|
+
const configPath = target ?? globalVisionConfigPath(env)
|
|
67
|
+
let parsed = {}
|
|
68
|
+
let existingRaw
|
|
69
|
+
if (existsSync(configPath)) {
|
|
70
|
+
existingRaw = readFileSync(configPath, 'utf8')
|
|
71
|
+
try {
|
|
72
|
+
const data = JSON.parse(existingRaw)
|
|
73
|
+
if (data && typeof data === 'object' && !Array.isArray(data)) parsed = data
|
|
74
|
+
} catch {
|
|
75
|
+
return { path: configPath, wrote: false, reason: 'corrupt' }
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (dryRun) return { path: configPath, wrote: false, reason: 'dry-run' }
|
|
79
|
+
const next = { ...parsed, visionModel: model }
|
|
80
|
+
const content = `${JSON.stringify(next, null, 2)}\n`
|
|
81
|
+
mkdirSync(dirname(configPath), { recursive: true })
|
|
82
|
+
const status = writeConfigWithBackup(configPath, content, false, {
|
|
83
|
+
expectedContent: existingRaw,
|
|
84
|
+
beforeRecheck,
|
|
85
|
+
// This file is GLOBAL and lives outside the config dir, so the target-scoped
|
|
86
|
+
// exact backup set never captures it. Keep its own `<file>.bak` recovery.
|
|
87
|
+
beforeSwap: (existing) => {
|
|
88
|
+
if (existing === null) return
|
|
89
|
+
try {
|
|
90
|
+
copyFileSync(configPath, `${configPath}.bak`)
|
|
91
|
+
verifyRegularFile(`${configPath}.bak`, readFileSync(configPath))
|
|
92
|
+
} catch {
|
|
93
|
+
// Best-effort: a backup failure must not block the write.
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
})
|
|
97
|
+
return { path: configPath, wrote: status === 'created', reason: status }
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Ask the interactive vision question. `rl` may be injected (tests / an
|
|
102
|
+
* existing readline interface); otherwise a private one is created and closed.
|
|
103
|
+
* Returns `{action, visionModel?, wrote?, path?}` — never throws on bad input,
|
|
104
|
+
* and never writes for the default/skip paths.
|
|
105
|
+
*
|
|
106
|
+
* @param {{rl?: object, logger?: object, env?: Record<string, string|undefined>, dryRun?: boolean, beforeRecheck?: (existing: string|null) => void}} [opts]
|
|
107
|
+
*/
|
|
108
|
+
export async function runVisionPrompt({
|
|
109
|
+
rl,
|
|
110
|
+
logger = console,
|
|
111
|
+
env = process.env,
|
|
112
|
+
dryRun = false,
|
|
113
|
+
beforeRecheck,
|
|
114
|
+
} = {}) {
|
|
115
|
+
let iface = rl
|
|
116
|
+
let closeAfter = false
|
|
117
|
+
if (!iface) {
|
|
118
|
+
const { createInterface } = await import('node:readline/promises')
|
|
119
|
+
iface = createInterface({ input: process.stdin, output: process.stdout })
|
|
120
|
+
closeAfter = true
|
|
121
|
+
}
|
|
122
|
+
try {
|
|
123
|
+
logger.log?.('')
|
|
124
|
+
logger.log?.('Vision — how should images be described?')
|
|
125
|
+
logger.log?.(
|
|
126
|
+
' 1) Automatic discovery (default) — pick a vision-capable model from the host catalog',
|
|
127
|
+
)
|
|
128
|
+
logger.log?.(' 2) Pin a provider/model (e.g. opencode-go/mimo-v2.5)')
|
|
129
|
+
logger.log?.(' 3) Skip')
|
|
130
|
+
const answer = (await iface.question('Choice [1]: ')).trim().toLowerCase()
|
|
131
|
+
|
|
132
|
+
if (answer === '' || answer === '1' || answer === 'auto' || answer === 'discovery') {
|
|
133
|
+
logger.log?.('Vision: automatic discovery (no config written).')
|
|
134
|
+
return { action: 'auto' }
|
|
135
|
+
}
|
|
136
|
+
if (answer === '3' || answer === 'skip' || answer === 'no') {
|
|
137
|
+
logger.log?.('Vision: skipped (no config written).')
|
|
138
|
+
return { action: 'skip' }
|
|
139
|
+
}
|
|
140
|
+
if (answer === '2' || answer === 'pin') {
|
|
141
|
+
for (let attempt = 0; attempt < MAX_PIN_ATTEMPTS; attempt++) {
|
|
142
|
+
const raw = (await iface.question('provider/model (e.g. opencode-go/mimo-v2.5): ')).trim()
|
|
143
|
+
if (!isValidVisionModel(raw)) {
|
|
144
|
+
logger.warn?.(`Invalid model "${raw}" — expected provider/model (one slash, no spaces).`)
|
|
145
|
+
continue
|
|
146
|
+
}
|
|
147
|
+
const result = mergeVisionModel(raw, { env, dryRun, beforeRecheck })
|
|
148
|
+
if (result.reason === 'corrupt') {
|
|
149
|
+
logger.warn?.(
|
|
150
|
+
`Vision config at ${result.path} is not valid JSON — leaving it untouched; fix it and re-run.`,
|
|
151
|
+
)
|
|
152
|
+
return { action: 'pin', visionModel: raw, wrote: false, path: result.path }
|
|
153
|
+
}
|
|
154
|
+
if (result.reason === 'conflict') {
|
|
155
|
+
logger.warn?.(
|
|
156
|
+
`Vision: not saved — config at ${result.path} was modified concurrently; re-run to retry.`,
|
|
157
|
+
)
|
|
158
|
+
} else {
|
|
159
|
+
logger.log?.(`Vision: pinned ${raw} in ${result.path}.`)
|
|
160
|
+
}
|
|
161
|
+
return { action: 'pin', visionModel: raw, wrote: result.wrote, path: result.path }
|
|
162
|
+
}
|
|
163
|
+
logger.warn?.('Vision: no valid model entered — skipping (no config written).')
|
|
164
|
+
return { action: 'skip' }
|
|
165
|
+
}
|
|
166
|
+
logger.warn?.(
|
|
167
|
+
`Unknown choice "${answer}" — defaulting to automatic discovery (no config written).`,
|
|
168
|
+
)
|
|
169
|
+
return { action: 'auto' }
|
|
170
|
+
} finally {
|
|
171
|
+
if (closeAfter) iface.close()
|
|
172
|
+
}
|
|
173
|
+
}
|
package/scripts/install-mcp.mjs
CHANGED
|
@@ -238,7 +238,7 @@ export const MCPS = {
|
|
|
238
238
|
tier: 1,
|
|
239
239
|
name: 'Pantheon Memory',
|
|
240
240
|
description:
|
|
241
|
-
'Pantheon Memory MCP Server — persistent memory with
|
|
241
|
+
'Pantheon Memory MCP Server — persistent SQLite memory with FTS5/BM25 keyword search, exact-key recall, and explicit maintenance; no embedding/vector search',
|
|
242
242
|
platforms: {
|
|
243
243
|
opencode: {
|
|
244
244
|
type: 'local',
|
|
@@ -259,7 +259,7 @@ export const MCPS = {
|
|
|
259
259
|
tier: 1,
|
|
260
260
|
name: 'Pantheon Persistence',
|
|
261
261
|
description:
|
|
262
|
-
'Pantheon Persistence MCP Server —
|
|
262
|
+
'Pantheon Persistence MCP Server — operational-state checkpoints via context_save/context_get and four manual session-scoped goal tools',
|
|
263
263
|
env: [],
|
|
264
264
|
platforms: {
|
|
265
265
|
opencode: {
|
|
@@ -57,6 +57,18 @@ export const MANIFEST_INVENTORY = Object.freeze([
|
|
|
57
57
|
name: 'pantheon-tui',
|
|
58
58
|
valuePath: ['name'],
|
|
59
59
|
}),
|
|
60
|
+
Object.freeze({
|
|
61
|
+
id: 'zenodo-release-metadata',
|
|
62
|
+
role: 'metadata',
|
|
63
|
+
file: '.zenodo.json',
|
|
64
|
+
kind: 'json',
|
|
65
|
+
}),
|
|
66
|
+
Object.freeze({
|
|
67
|
+
id: 'citation-release-metadata',
|
|
68
|
+
role: 'metadata',
|
|
69
|
+
file: 'CITATION.cff',
|
|
70
|
+
kind: 'cff',
|
|
71
|
+
}),
|
|
60
72
|
Object.freeze({
|
|
61
73
|
id: 'root-lock',
|
|
62
74
|
role: 'lock',
|
|
@@ -76,7 +88,7 @@ export const MANIFEST_INVENTORY = Object.freeze([
|
|
|
76
88
|
])
|
|
77
89
|
|
|
78
90
|
export const VERSION_MANIFEST_INVENTORY = Object.freeze(
|
|
79
|
-
MANIFEST_INVENTORY.filter(({ role }) => role
|
|
91
|
+
MANIFEST_INVENTORY.filter(({ role }) => role !== 'lock'),
|
|
80
92
|
)
|
|
81
93
|
|
|
82
94
|
export const LOCK_INVENTORY = Object.freeze(
|
|
@@ -99,11 +111,18 @@ function readToml(file, text) {
|
|
|
99
111
|
return parsed
|
|
100
112
|
}
|
|
101
113
|
|
|
114
|
+
function readCff(file, text) {
|
|
115
|
+
const match = /^version:\s*([^\s#]+)\s*(?:#.*)?$/m.exec(text)
|
|
116
|
+
if (!match) throw new Error(`${file} is missing top-level version metadata`)
|
|
117
|
+
return { version: match[1] }
|
|
118
|
+
}
|
|
119
|
+
|
|
102
120
|
function readDocument(root, entry) {
|
|
103
121
|
const path = join(root, entry.file)
|
|
104
122
|
if (!existsSync(path)) throw new Error(`manifest inventory file is missing: ${entry.file}`)
|
|
105
123
|
const text = readFileSync(path, 'utf8')
|
|
106
124
|
if (entry.kind === 'toml') return { entry, path, text, data: readToml(entry.file, text) }
|
|
125
|
+
if (entry.kind === 'cff') return { entry, path, text, data: readCff(entry.file, text) }
|
|
107
126
|
let data
|
|
108
127
|
try {
|
|
109
128
|
data = JSON.parse(text)
|
|
@@ -175,6 +194,24 @@ function validateLock(document, manifestsByFile, allowVersionDivergence) {
|
|
|
175
194
|
if (!allowVersionDivergence && rootPackage.version !== manifestVersionValue) {
|
|
176
195
|
throw new Error(`${entry.file} packages[""] version diverges from ${entry.packageFile}`)
|
|
177
196
|
}
|
|
197
|
+
|
|
198
|
+
if (entry.file === 'package-lock.json') {
|
|
199
|
+
const tuiManifest = manifestsByFile.get('src/plugins/tui/package.json')
|
|
200
|
+
const tuiWorkspace = data.packages?.['src/plugins/tui']
|
|
201
|
+
if (!tuiManifest) throw new Error('package-lock.json has no TUI workspace manifest partner')
|
|
202
|
+
if (!tuiWorkspace || typeof tuiWorkspace !== 'object' || Array.isArray(tuiWorkspace)) {
|
|
203
|
+
throw new Error('package-lock.json is missing packages["src/plugins/tui"]')
|
|
204
|
+
}
|
|
205
|
+
if (tuiWorkspace.name !== 'pantheon-tui') {
|
|
206
|
+
throw new Error('package-lock.json TUI workspace name must be pantheon-tui')
|
|
207
|
+
}
|
|
208
|
+
assertSemver(tuiWorkspace.version, 'package-lock.json TUI workspace version')
|
|
209
|
+
if (!allowVersionDivergence && tuiWorkspace.version !== manifestVersion(tuiManifest)) {
|
|
210
|
+
throw new Error(
|
|
211
|
+
'package-lock.json TUI workspace version diverges from src/plugins/tui/package.json',
|
|
212
|
+
)
|
|
213
|
+
}
|
|
214
|
+
}
|
|
178
215
|
}
|
|
179
216
|
|
|
180
217
|
/** Read and validate every entry before a caller is allowed to write anything. */
|
|
@@ -186,7 +223,7 @@ export function validateInventory(root, { allowVersionDivergence = false } = {})
|
|
|
186
223
|
.map((document) => [document.entry.file, document]),
|
|
187
224
|
)
|
|
188
225
|
const versions = documents
|
|
189
|
-
.filter(({ entry }) => entry.role === 'manifest')
|
|
226
|
+
.filter(({ entry }) => entry.role === 'manifest' || entry.role === 'metadata')
|
|
190
227
|
.map((document) => ({ file: document.entry.file, version: manifestVersion(document) }))
|
|
191
228
|
documents.filter(({ entry }) => entry.role === 'manifest').forEach(manifestName)
|
|
192
229
|
const sourceVersion = versions[0].version
|
|
@@ -309,8 +346,17 @@ function replaceTomlProjectVersion(text, version, file) {
|
|
|
309
346
|
|
|
310
347
|
function prepareDocumentVersion(document, version) {
|
|
311
348
|
const { entry, text } = document
|
|
349
|
+
if (entry.role === 'metadata') {
|
|
350
|
+
const current = manifestVersion(document)
|
|
351
|
+
return text.split(current).join(version)
|
|
352
|
+
}
|
|
312
353
|
if (entry.kind === 'toml') return replaceTomlProjectVersion(text, version, entry.file)
|
|
313
|
-
const paths =
|
|
354
|
+
const paths =
|
|
355
|
+
entry.role === 'lock'
|
|
356
|
+
? entry.file === 'package-lock.json'
|
|
357
|
+
? [['version'], ['packages', '', 'version'], ['packages', 'src/plugins/tui', 'version']]
|
|
358
|
+
: [['version'], ['packages', '', 'version']]
|
|
359
|
+
: [['version']]
|
|
314
360
|
return replaceJsonStringValues(text, paths, version, entry.file)
|
|
315
361
|
}
|
|
316
362
|
|