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
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ import { fileURLToPath } from 'node:url'
3
+ import { validateNodeEnginePolicy } from './node-engine-policy.mjs'
4
+
5
+ const root = fileURLToPath(new URL('..', import.meta.url))
6
+ const errors = validateNodeEnginePolicy(root)
7
+ if (errors.length) {
8
+ console.error('Node engine policy validation failed:')
9
+ for (const error of errors) console.error(`- ${error}`)
10
+ process.exitCode = 1
11
+ } else {
12
+ console.log('Node engine policy is consistent across manifests and lockfiles.')
13
+ }
@@ -19,6 +19,14 @@ export const MANIFESTS = Object.freeze(
19
19
  }),
20
20
  )
21
21
 
22
+ const RELEASE_METADATA = Object.freeze(
23
+ VERSION_MANIFEST_INVENTORY.filter((item) => item.role === 'metadata').map((item) => ({
24
+ name: item.file,
25
+ file: item.file,
26
+ kind: item.kind,
27
+ })),
28
+ )
29
+
22
30
  function readLegacyVersion(root, manifest) {
23
31
  const path = join(root, manifest.file)
24
32
  const text = readFileSync(path, 'utf8')
@@ -27,6 +35,11 @@ function readLegacyVersion(root, manifest) {
27
35
  if (!match) throw new Error(`${manifest.file} is missing version`)
28
36
  return match[1]
29
37
  }
38
+ if (manifest.kind === 'cff') {
39
+ const match = text.match(/^version:\s*([^\s#]+)\s*(?:#.*)?$/m)
40
+ if (!match) throw new Error(`${manifest.file} is missing version`)
41
+ return match[1]
42
+ }
30
43
  const data = JSON.parse(text)
31
44
  if (typeof data.version !== 'string') throw new Error(`${manifest.file} is missing version`)
32
45
  return data.version
@@ -64,6 +77,15 @@ export function compareVersions(root) {
64
77
  }
65
78
  return { name: manifest.name, version, ok: version !== null && version === source }
66
79
  })
80
+ const releaseMetadata = RELEASE_METADATA.map((manifest) => {
81
+ let version = null
82
+ try {
83
+ version = readLegacyVersion(root, manifest)
84
+ } catch (error) {
85
+ errors.push(`${manifest.file}: ${error.message}`)
86
+ }
87
+ return { name: manifest.name, version, ok: version !== null && version === source }
88
+ })
67
89
  const locks = LOCK_INVENTORY.map((entry) => {
68
90
  let version = null
69
91
  try {
@@ -81,11 +103,13 @@ export function compareVersions(root) {
81
103
  return {
82
104
  source,
83
105
  manifests,
106
+ releaseMetadata,
84
107
  locks,
85
108
  errors: [...new Set(errors)],
86
109
  ok:
87
110
  source !== null &&
88
111
  manifests.every((item) => item.ok) &&
112
+ releaseMetadata.every((item) => item.ok) &&
89
113
  locks.every((item) => item.ok) &&
90
114
  errors.length === 0,
91
115
  }
@@ -100,7 +124,11 @@ export function syncToSource(root) {
100
124
  const source = inventory.sourceVersion
101
125
  const changed = inventory.versions.filter(({ version }) => version !== source).length
102
126
  const lockChanged = inventory.documents.filter(
103
- ({ entry, data }) => entry.role === 'lock' && data.version !== source,
127
+ ({ entry, data }) =>
128
+ entry.role === 'lock' &&
129
+ (data.version !== source ||
130
+ (entry.file === 'package-lock.json' &&
131
+ data.packages?.['src/plugins/tui']?.version !== source)),
104
132
  ).length
105
133
  if (changed || lockChanged) writeInventoryVersion(inventory, source)
106
134
  return changed + lockChanged
@@ -114,6 +142,11 @@ function printDivergenceTable(result) {
114
142
  item.version ?? 'MISSING',
115
143
  item.ok ? 'ok' : 'DIVERGENT',
116
144
  ]),
145
+ ...result.releaseMetadata.map((item) => [
146
+ item.name,
147
+ item.version ?? 'MISSING',
148
+ item.ok ? 'ok' : 'DIVERGENT',
149
+ ]),
117
150
  ...result.locks.map((item) => [
118
151
  item.name,
119
152
  item.version ?? 'MISSING',
@@ -24,6 +24,7 @@ import { execFileSync } from 'node:child_process'
24
24
  import { existsSync, readFileSync } from 'node:fs'
25
25
  import { basename, dirname, join } from 'node:path'
26
26
  import { fileURLToPath } from 'node:url'
27
+ import { mergeUnreleasedIntoVersion } from './changelog-merge.mjs'
27
28
  import {
28
29
  commitPreparedUpdates,
29
30
  prepareInventoryVersion,
@@ -110,7 +111,15 @@ function analyzeConventionalCommits(since) {
110
111
  function prepareManifests(newVersion) {
111
112
  if (!SEMVER_PATTERN.test(newVersion)) throw new Error(`invalid version: ${newVersion}`)
112
113
  const inventory = validateInventory(ROOT, { allowVersionDivergence: true })
113
- return { inventory, updates: prepareInventoryVersion(inventory, newVersion) }
114
+ const releaseMetadataFiles = new Set(
115
+ inventory.documents
116
+ .filter(({ entry }) => entry.role === 'metadata')
117
+ .map(({ entry }) => entry.file),
118
+ )
119
+ const updates = prepareInventoryVersion(inventory, newVersion).filter(
120
+ ({ path }) => !releaseMetadataFiles.has(path.slice(ROOT.length + 1)),
121
+ )
122
+ return { inventory, updates }
114
123
  }
115
124
 
116
125
  /**
@@ -311,7 +320,7 @@ function prepareUnreleased(newVersion, dateStr, notesBody = null) {
311
320
  // injection when interpolated next to the template's HTML comment.
312
321
  const writtenBody = sanitizeCommentDelimiters(cleanedBody)
313
322
 
314
- const newTemplate = `\n\n<!-- Add new changes here. Running \`node scripts/versioning.mjs apply\` will\n move this section to a versioned entry and reset the template below. -->\n\n## 🆕 What's New\n\n## 🐞 Fixed\n\n## ⚠️ Known Issues\n\n## ✅ Closed Issues`
323
+ const newTemplate = `\n\n<!-- Add new changes here. Running \`node scripts/versioning.mjs apply\` will\n move this section to a versioned entry and reset the template below. -->`
315
324
  const newVersionHeader = `## [v${newVersion}] - ${dateStr}`
316
325
 
317
326
  const before = content.slice(0, idx)
@@ -471,6 +480,17 @@ switch (command) {
471
480
  case 'changelog': {
472
481
  const version = arg || getCurrentVersion()
473
482
  const date = new Date().toISOString().slice(0, 10)
483
+ const currentChangelog = readFileSync(CHANGELOG_PATH, 'utf-8')
484
+ const mergePlan = mergeUnreleasedIntoVersion(currentChangelog, version)
485
+ if (mergePlan) {
486
+ if (mergePlan.changed) {
487
+ commitPreparedUpdates([{ path: CHANGELOG_PATH, content: mergePlan.content }])
488
+ console.log(` ✓ CHANGELOG: merged [Unreleased] into existing [v${version}]`)
489
+ } else {
490
+ console.log(` ✓ CHANGELOG: [Unreleased] is empty; [v${version}] unchanged`)
491
+ }
492
+ break
493
+ }
474
494
  const changelogPlan = prepareUnreleased(version, date)
475
495
  if (changelogPlan.changed) {
476
496
  commitPreparedUpdates([{ path: CHANGELOG_PATH, content: changelogPlan.content }])
@@ -492,7 +512,7 @@ Commands:
492
512
  --beta: advance the committed X.Y.Z-beta.N line and
493
513
  promote [Unreleased] → [vX.Y.Z-beta.N] in CHANGELOG
494
514
  beta Alias for 'apply --beta'
495
- changelog [version] Promote [Unreleased] → [vX.Y.Z] without bumping
515
+ changelog [version] Promote [Unreleased], or merge into an existing version section
496
516
 
497
517
  Release flow (stable):
498
518
  1. node scripts/versioning.mjs apply [minor]