pantheon-opencode 1.6.0-beta.9 → 1.6.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.
Files changed (140) hide show
  1. package/AGENTS.global.md +118 -0
  2. package/AGENTS.md +18 -168
  3. package/CHANGELOG.md +144 -365
  4. package/README.md +124 -607
  5. package/README.pt-BR.md +120 -345
  6. package/bin/pantheon-init.mjs +504 -141
  7. package/commands/pantheon-deepwork.md +14 -3
  8. package/commands/pantheon-vision.md +61 -12
  9. package/package.json +22 -13
  10. package/plugin.json +1 -1
  11. package/pyproject.toml +6 -2
  12. package/scripts/_pantheon_paths.py +24 -0
  13. package/scripts/build-agents-md.mjs +368 -69
  14. package/scripts/changelog-merge.mjs +161 -0
  15. package/scripts/check-plugin-v2-coverage.mjs +11 -8
  16. package/scripts/docs-check-changelog.mjs +204 -0
  17. package/scripts/docs-link-check.mjs +314 -0
  18. package/scripts/docs-media.mjs +157 -0
  19. package/scripts/doctor.mjs +850 -45
  20. package/scripts/install/agents-md.mjs +2 -2
  21. package/scripts/install/backup.mjs +648 -0
  22. package/scripts/install/cli-ui.mjs +303 -72
  23. package/scripts/install/component-selection.mjs +61 -0
  24. package/scripts/install/config-migration.mjs +583 -27
  25. package/scripts/install/exit-codes.mjs +26 -0
  26. package/scripts/install/file-inventory.mjs +555 -0
  27. package/scripts/install/health-check.mjs +31 -25
  28. package/scripts/install/interactive.mjs +99 -383
  29. package/scripts/install/interrupt.mjs +78 -0
  30. package/scripts/install/migrate.mjs +49 -25
  31. package/scripts/install/model-picker.mjs +218 -250
  32. package/scripts/install/opencode-state.mjs +91 -0
  33. package/scripts/install/opencode-version.mjs +83 -21
  34. package/scripts/install/opencode.mjs +1675 -187
  35. package/scripts/install/plan-artifact.mjs +517 -0
  36. package/scripts/install/plan.mjs +475 -0
  37. package/scripts/install/plugin.mjs +214 -27
  38. package/scripts/install/prompt-result.mjs +2 -0
  39. package/scripts/install/run-record.mjs +115 -0
  40. package/scripts/install/shared.mjs +256 -99
  41. package/scripts/install/state.mjs +63 -8
  42. package/scripts/install/strings.mjs +93 -8
  43. package/scripts/install/v2-capabilities.mjs +205 -0
  44. package/scripts/install/venv.mjs +90 -47
  45. package/scripts/install/verify.mjs +128 -0
  46. package/scripts/install/vision-prompt.mjs +173 -0
  47. package/scripts/install-mcp.mjs +2 -2
  48. package/scripts/manifest-inventory.mjs +49 -3
  49. package/scripts/mcp_persistence.py +1535 -1050
  50. package/scripts/memory_mcp.py +12 -843
  51. package/scripts/node-engine-policy.mjs +85 -0
  52. package/scripts/package-evidence.mjs +10 -2
  53. package/scripts/postinstall.mjs +26 -26
  54. package/scripts/probe-pantheon-cost.mjs +118 -19
  55. package/scripts/prune.mjs +9 -3
  56. package/scripts/reconcile.mjs +325 -0
  57. package/scripts/release-gates.mjs +687 -0
  58. package/scripts/restore.mjs +222 -0
  59. package/scripts/run-node-tests.mjs +24 -8
  60. package/scripts/sync-artifacts.mjs +19 -7
  61. package/scripts/sync-tui.mjs +5 -1
  62. package/scripts/test-opencode-v2-sandbox.sh +36 -123
  63. package/scripts/uninstall.mjs +369 -34
  64. package/scripts/update.mjs +164 -0
  65. package/scripts/validate-node-engine-policy.mjs +13 -0
  66. package/scripts/version-check.mjs +34 -1
  67. package/scripts/versioning.mjs +23 -3
  68. package/scripts/vision-status.mjs +682 -0
  69. package/skills-lock.json +8 -8
  70. package/src/agents/aphrodite.md +13 -10
  71. package/src/agents/apollo.md +4 -5
  72. package/src/agents/athena.md +74 -46
  73. package/src/agents/demeter.md +10 -7
  74. package/src/agents/gaia.md +0 -1
  75. package/src/agents/hephaestus.md +4 -3
  76. package/src/agents/hermes.md +10 -9
  77. package/src/agents/iris.md +6 -1
  78. package/src/agents/mnemosyne.md +10 -4
  79. package/src/agents/nyx.md +4 -4
  80. package/src/agents/prometheus.md +12 -11
  81. package/src/agents/talos.md +6 -0
  82. package/src/agents/zeus.md +84 -56
  83. package/src/instructions/agent-return-format.instructions.md +12 -41
  84. package/src/instructions/memory-protocol.instructions.md +5 -11
  85. package/src/instructions/test-economy.instructions.md +12 -0
  86. package/src/instructions/yagni.instructions.md +6 -15
  87. package/src/instructions/zeus-anti-stall.instructions.md +6 -6
  88. package/src/instructions/zeus-communication-rules.instructions.md +6 -6
  89. package/src/instructions/zeus-council-synthesis.instructions.md +11 -12
  90. package/src/instructions/zeus-memory-operations.instructions.md +13 -7
  91. package/src/instructions/zeus-timeout-retry.instructions.md +36 -10
  92. package/src/mcp/_pantheon_paths.py +24 -0
  93. package/src/mcp/mcp_codemap_module.py +86 -18
  94. package/src/mcp/mcp_persistence.py +1535 -1050
  95. package/src/mcp/memory_mcp.py +444 -94
  96. package/src/mcp/pantheon_vision.py +285 -41
  97. package/src/mcp/requirements-mcp.txt +6 -1
  98. package/src/mcp/requirements-vision.txt +1 -1
  99. package/src/pantheon/context-pruner.ts +541 -0
  100. package/src/pantheon/cost-command.ts +901 -60
  101. package/src/pantheon/delegation-enforce.ts +160 -23
  102. package/src/pantheon/goal-loop.ts +11 -8
  103. package/src/pantheon/guard-path.ts +162 -0
  104. package/src/pantheon/memory-context.ts +1017 -0
  105. package/src/pantheon/model-agents.ts +19 -0
  106. package/src/pantheon/model-command.ts +218 -56
  107. package/src/pantheon/model-pricing.ts +536 -0
  108. package/src/pantheon/presets.mjs +2 -0
  109. package/src/pantheon/task-result-guard.ts +50 -14
  110. package/src/pantheon/v2-bounded-read.ts +654 -0
  111. package/src/pantheon/v2-bridge.ts +27 -0
  112. package/src/pantheon/v2-delegation-enforce.ts +133 -6
  113. package/src/pantheon/v2-execute-after.ts +135 -24
  114. package/src/pantheon/v2-model-overrides.ts +275 -0
  115. package/src/pantheon/v2-shell-hooks.ts +260 -0
  116. package/src/pantheon/v2-tools.ts +89 -35
  117. package/src/pantheon/v2-unsupported.mjs +34 -7
  118. package/src/pantheon/v2-vision.ts +622 -0
  119. package/src/pantheon/vision-local.ts +531 -0
  120. package/src/pantheon/vision.ts +1166 -116
  121. package/src/plugin-v2.ts +1039 -171
  122. package/src/plugin.ts +37 -13
  123. package/src/plugins/tui/dist/tui-v2.d.ts +1029 -2
  124. package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -1
  125. package/src/plugins/tui/dist/tui-v2.js +3742 -85
  126. package/src/plugins/tui/dist/tui.js +1 -1
  127. package/src/plugins/tui/package-lock.json +15 -15
  128. package/src/plugins/tui/package.json +7 -5
  129. package/src/plugins/tui/src/index-v2.tsx +4314 -50
  130. package/src/plugins/tui/tsconfig.typecheck.json +5 -0
  131. package/src/routing.yml +50 -5
  132. package/src/skills/agent-coordination/SKILL.md +7 -2
  133. package/src/skills/artifact-management/SKILL.md +5 -1
  134. package/src/skills/auto-continue/SKILL.md +14 -6
  135. package/src/skills/codemap/SKILL.md +1 -1
  136. package/src/skills/memory-bank/SKILL.md +21 -13
  137. package/src/skills/session-goal/SKILL.md +12 -22
  138. package/src/skills/spec-driven-development/SKILL.md +3 -1
  139. package/src/skills/worktrees/SKILL.md +30 -11
  140. package/scripts/probe-context-rehydrate.mjs +0 -263
@@ -11,6 +11,8 @@
11
11
  import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
12
12
  import { dirname, join } from 'node:path'
13
13
  import { fileURLToPath } from 'node:url'
14
+ import { configure as configureUi, tag } from './cli-ui.mjs'
15
+ import { ACTIONS, fingerprintOutput, recordChange } from './plan.mjs'
14
16
  import { createInitialState, readState, writeState } from './state.mjs'
15
17
 
16
18
  const __dirname = dirname(fileURLToPath(import.meta.url))
@@ -44,10 +46,14 @@ export function detectVersion(target) {
44
46
  *
45
47
  * @param {string} target - Installation directory
46
48
  * @param {string|null} currentVersion - Detected version (null = fresh install)
47
- * @param {{ dryRun?: boolean }} [options]
49
+ * @param {{ dryRun?: boolean, recorder?: (change: object) => void }} [options]
48
50
  * @returns {{ applied: number, messages: string[] }}
49
51
  */
50
- export function runMigrations(target, currentVersion, { dryRun = false } = {}) {
52
+ export function runMigrations(
53
+ target,
54
+ currentVersion,
55
+ { dryRun = false, recorder = null, updatedAt = new Date().toISOString() } = {},
56
+ ) {
51
57
  const applied = []
52
58
  const semver = parseSemver(currentVersion)
53
59
 
@@ -104,16 +110,18 @@ export function runMigrations(target, currentVersion, { dryRun = false } = {}) {
104
110
  }
105
111
 
106
112
  // ── Write updated state ───────────────────────────────────────────
107
- if (applied.length > 0 && !dryRun) {
113
+ if (applied.length > 0) {
114
+ const statePath = join(target, '.pantheon', 'install-state.json')
108
115
  const newVersion = formatSemver(semver)
109
116
  let state = readState(target)
110
- if (!state) state = createInitialState(newVersion)
117
+ const stateExisted = state !== null
118
+ if (!state) state = createInitialState(newVersion, updatedAt)
111
119
  state.pantheon_version = newVersion
112
120
  for (const m of applied) {
113
121
  state.applied_migrations.push({
114
122
  from: m.from,
115
123
  to: m.to,
116
- applied_at: new Date().toISOString(),
124
+ applied_at: updatedAt,
117
125
  status: 'completed',
118
126
  })
119
127
  }
@@ -125,12 +133,31 @@ export function runMigrations(target, currentVersion, { dryRun = false } = {}) {
125
133
  runtime: { version: 1, status: 'installed' },
126
134
  }
127
135
  }
128
- writeState(target, state)
136
+ state.updated_at = updatedAt
137
+ state.schema_version = 2
138
+ const stateContent = `${JSON.stringify(state, null, 2)}\n`
139
+ if (!dryRun) writeState(target, state, { updatedAt })
140
+ recordChange(
141
+ {
142
+ path: statePath,
143
+ action: stateExisted ? ACTIONS.UPDATE : ACTIONS.CREATE,
144
+ bytes: Buffer.byteLength(stateContent, 'utf8'),
145
+ outputFingerprint: fingerprintOutput(stateContent),
146
+ scored: false,
147
+ },
148
+ recorder,
149
+ )
150
+ return {
151
+ applied: applied.length,
152
+ messages: applied.map((m) => `${m.from} → ${m.to}: ${m.description}`),
153
+ plannedState: state,
154
+ }
129
155
  }
130
156
 
131
157
  return {
132
158
  applied: applied.length,
133
159
  messages: applied.map((m) => `${m.from} → ${m.to}: ${m.description}`),
160
+ plannedState: null,
134
161
  }
135
162
  }
136
163
 
@@ -238,26 +265,24 @@ export function resumePendingMigration(target) {
238
265
  export function rollbackMigration(target, version) {
239
266
  const state = readState(target)
240
267
  if (!state) {
241
- console.log(' \u26A0\uFE0F No install state found — nothing to roll back')
268
+ console.log(' [WARN] No install state found — nothing to roll back')
242
269
  return { success: false, reason: 'No install state' }
243
270
  }
244
271
 
245
272
  const migrations = state.applied_migrations || []
246
273
  const targetMigration = migrations.find((m) => m.to === version && m.status === 'completed')
247
274
  if (!targetMigration) {
248
- console.log(` \u26A0\uFE0F No completed migration found for version ${version}`)
275
+ console.log(` [WARN] No completed migration found for version ${version}`)
249
276
  return { success: false, reason: 'Migration not found' }
250
277
  }
251
278
 
252
- console.log(
253
- ` \u{1F504} Rolling back migration: ${targetMigration.from} \u2192 ${targetMigration.to}`,
254
- )
279
+ console.log(` Rolling back migration: ${targetMigration.from} -> ${targetMigration.to}`)
255
280
 
256
281
  targetMigration.status = 'rolled_back'
257
282
  state.pantheon_version = targetMigration.from
258
283
  writeState(target, state)
259
284
 
260
- console.log(` \u2705 Rolled back to ${targetMigration.from}`)
285
+ console.log(` [OK] Rolled back to ${targetMigration.from}`)
261
286
  return { success: true, migration: targetMigration }
262
287
  }
263
288
 
@@ -328,24 +353,23 @@ function main() {
328
353
  const dryRun = args.includes('--dry-run')
329
354
  const force = args.includes('--force')
330
355
  const list = args.includes('--list')
356
+ // One dry-run marker for the whole CLI: cli-ui's tag(). This file used to
357
+ // hardcode its own `[DRY-RUN]` prefix while other CLIs printed `[dry-run]`.
358
+ configureUi({ dryRun })
331
359
 
332
360
  if (list) {
333
361
  const history = listAppliedMigrations(target)
334
362
  if (!history.currentVersion) {
335
- console.log(` \u2139\uFE0F No install state found in: ${target}`)
363
+ console.log(` [INFO] No install state found in: ${target}`)
336
364
  return
337
365
  }
338
366
  console.log(` Current version: ${history.currentVersion}`)
339
367
  console.log(` Previous version: ${history.previousVersion || 'N/A'}`)
340
368
  console.log(` Applied migrations: ${history.migrations.length}`)
341
369
  for (const m of history.migrations) {
342
- const icon =
343
- m.status === 'completed'
344
- ? '\u2705'
345
- : m.status === 'rolled_back'
346
- ? '\u{1F504}'
347
- : '\u26A0\uFE0F'
348
- console.log(` ${icon} ${m.from} \u2192 ${m.to} [${m.status}] (${m.applied_at})`)
370
+ const status =
371
+ m.status === 'completed' ? '[OK]' : m.status === 'rolled_back' ? '[ROLLED BACK]' : '[WARN]'
372
+ console.log(` ${status} ${m.from} -> ${m.to} [${m.status}] (${m.applied_at})`)
349
373
  }
350
374
  return
351
375
  }
@@ -361,9 +385,9 @@ function main() {
361
385
  if (!dryRun) {
362
386
  const state = createInitialState(PANTHON_VERSION)
363
387
  writeState(target, state)
364
- console.log(` \u2705 Fresh install — state written (${PANTHON_VERSION})`)
388
+ console.log(` [OK] Fresh install — state written (${PANTHON_VERSION})`)
365
389
  } else {
366
- console.log(` \u2705 Fresh install — would write state (${PANTHON_VERSION})`)
390
+ console.log(` ${tag(`Fresh install — would write state (${PANTHON_VERSION})`)}`)
367
391
  }
368
392
  return
369
393
  }
@@ -371,19 +395,19 @@ function main() {
371
395
  console.log(` Current version: ${currentVersion}`)
372
396
 
373
397
  if (!force && currentVersion === PANTHON_VERSION) {
374
- console.log(' \u23ED\uFE0F Already at latest version — no migrations needed')
398
+ console.log(' [OK] Already at latest version — no migrations needed')
375
399
  return
376
400
  }
377
401
 
378
402
  const migration = runMigrations(target, currentVersion, { dryRun })
379
403
 
380
404
  if (migration.applied > 0) {
381
- console.log(` \u2705 Applied ${migration.applied} migration(s):`)
405
+ console.log(` [OK] Applied ${migration.applied} migration(s):`)
382
406
  for (const msg of migration.messages) {
383
407
  console.log(` \u2022 ${msg}`)
384
408
  }
385
409
  } else {
386
- console.log(' \u23ED\uFE0F No applicable migrations')
410
+ console.log(' [INFO] No applicable migrations')
387
411
  }
388
412
  }
389
413