pantheon-opencode 1.5.1 → 1.6.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.
Files changed (62) hide show
  1. package/.pantheon/code-mode/README.md +4 -2
  2. package/.pantheon/code-mode/checkpoint_session.py +138 -102
  3. package/.pantheon/code-mode/compress-inline.py +102 -57
  4. package/.pantheon/code-mode/manifest.json +2 -8
  5. package/CHANGELOG.md +22 -0
  6. package/README.md +86 -52
  7. package/README.pt-BR.md +63 -43
  8. package/commands/pantheon-optimize.md +2 -2
  9. package/package.json +13 -1
  10. package/plugin.json +1 -1
  11. package/pyproject.toml +8 -15
  12. package/scripts/build-agents-md.mjs +2 -2
  13. package/scripts/check-plugin-v2-coverage.mjs +213 -0
  14. package/scripts/ci-validate-yaml.py +7 -5
  15. package/scripts/code_mode_server.py +116 -24
  16. package/scripts/doctor.mjs +85 -28
  17. package/scripts/install/cli-ui.mjs +1 -1
  18. package/scripts/install/config-migration.mjs +2 -2
  19. package/scripts/install/health-check.mjs +6 -19
  20. package/scripts/install/interactive.mjs +6 -6
  21. package/scripts/install/migrate.mjs +1 -1
  22. package/scripts/install/state.mjs +27 -2
  23. package/scripts/mcp_persistence_server.py +390 -76
  24. package/scripts/memory_mcp_server.py +370 -196
  25. package/scripts/postinstall.mjs +0 -7
  26. package/scripts/probe-context-rehydrate.mjs +28 -11
  27. package/scripts/prune.mjs +2 -2
  28. package/scripts/sync-tui.mjs +11 -5
  29. package/scripts/test-opencode-v2-sandbox.sh +1759 -0
  30. package/scripts/validate-routing.mjs +40 -0
  31. package/skills-lock.json +9 -10
  32. package/src/agents/mnemosyne.md +15 -16
  33. package/src/agents/zeus.md +1 -2
  34. package/src/mcp/code_mode_server.py +116 -24
  35. package/src/mcp/mcp_codemap_module.py +559 -129
  36. package/src/mcp/mcp_persistence_server.py +390 -76
  37. package/src/mcp/memory_mcp_server.py +371 -248
  38. package/src/mcp/pantheon_vision_server.py +136 -24
  39. package/src/mcp/requirements-mcp.txt +5 -3
  40. package/src/mcp/requirements-vision.txt +2 -0
  41. package/src/pantheon/model-command.ts +18 -7
  42. package/src/pantheon/todo-enforcer.ts +1 -1
  43. package/src/pantheon/vision.ts +1 -1
  44. package/src/plugin-v2.ts +134 -104
  45. package/src/plugins/tui/dist/tui.js +1 -1
  46. package/src/plugins/tui/package-lock.json +20 -20
  47. package/src/plugins/tui/package.json +12 -12
  48. package/src/routing.yml +0 -1
  49. package/src/skills/README.md +31 -36
  50. package/src/skills/auto-continue/SKILL.md +25 -75
  51. package/.pantheon/code-mode/eval-llm-judge.py +0 -255
  52. package/.pantheon/code-mode/eval-monte-carlo.py +0 -368
  53. package/.pantheon/code-mode/eval-run.py +0 -197
  54. package/.pantheon/code-mode/eval-static.py +0 -321
  55. package/.pantheon/code-mode/session-end-save.py +0 -186
  56. package/.pantheon/code-mode/session-end-save.sh +0 -18
  57. package/scripts/recover-zenodo-deposition.mjs +0 -146
  58. package/scripts/test-opencode-v1-v2-sandbox.sh +0 -862
  59. package/scripts/validate-zenodo-release.mjs +0 -154
  60. package/scripts/zenodo-artifact.mjs +0 -21
  61. package/scripts/zenodo-release-state.mjs +0 -53
  62. package/src/skills/orchestration-workflow/SKILL.md +0 -311
@@ -182,25 +182,12 @@ export function healthCheck(target, { dryRun = false, pythonTarget = target } =
182
182
  results.failed.push({ check: 'mcp-sdk', detail: 'NOT INSTALLED — all MCP servers will fail' })
183
183
  }
184
184
  }
185
- // Check 4: chromadb importable
186
- if (python) {
187
- const result = spawnSync(
188
- python,
189
- ['-c', 'from fastembed import TextEmbedding; print(TextEmbedding.__module__)'],
190
- { stdio: 'pipe' },
191
- )
192
- if (result.status === 0) {
193
- results.passed.push({
194
- check: 'chromadb',
195
- detail: result.stdout.toString().trim(),
196
- })
197
- } else {
198
- results.warnings.push({
199
- check: 'chromadb',
200
- detail: 'NOT INSTALLED — semantic search will fail',
201
- })
202
- }
203
- }
185
+ // Check 4: the memory server's only search backend is the stdlib's own
186
+ // SQLite FTS5 (check 5 below). The former "chromadb importable" probe
187
+ // imported fastembed, which the vector pipeline removal deleted, so it
188
+ // warned "semantic search will fail" on every install. Removed rather than
189
+ // repointed: check 5 already asserts the capability that matters, and a
190
+ // second sqlite3 import probe would tell us nothing new.
204
191
 
205
192
  // Check 5: SQLite FTS5 available
206
193
  if (python) {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { emitKeypressEvents } from 'node:readline'
4
- import { colors, icons } from './cli-ui.mjs'
4
+ import { colors } from './cli-ui.mjs'
5
5
 
6
6
  const cursorHide = () => process.stdout.write('\x1b[?25l')
7
7
  const cursorShow = () => process.stdout.write('\x1b[?25h')
@@ -95,7 +95,7 @@ export async function promptMultiSelect(
95
95
  const lineCount = lines.length
96
96
  if (previousLineCount > 0) cursorUp(previousLineCount)
97
97
  clearDown()
98
- process.stdout.write(lines.join('\n') + '\n')
98
+ process.stdout.write(`${lines.join('\n')}\n`)
99
99
  previousLineCount = lineCount
100
100
  }
101
101
 
@@ -122,7 +122,7 @@ export async function promptMultiSelect(
122
122
  reject(new Error('Canceled'))
123
123
  }
124
124
 
125
- function handler(str, key) {
125
+ function handler(_str, key) {
126
126
  if (!key) return
127
127
  if ((key.ctrl && key.name === 'c') || key.name === 'escape') {
128
128
  cancel()
@@ -184,7 +184,7 @@ export async function promptConfirm(message, { default: def = true } = {}) {
184
184
  reject(new Error('Canceled'))
185
185
  }
186
186
 
187
- function handler(str, key) {
187
+ function handler(_str, key) {
188
188
  if (!key) return
189
189
  if ((key.ctrl && key.name === 'c') || key.name === 'escape') {
190
190
  cancel()
@@ -263,7 +263,7 @@ export async function promptList(options, { title = '' } = {}) {
263
263
  const lineCount = lines.length
264
264
  if (previousLineCount > 0) cursorUp(previousLineCount)
265
265
  clearDown()
266
- process.stdout.write(lines.join('\n') + '\n')
266
+ process.stdout.write(`${lines.join('\n')}\n`)
267
267
  previousLineCount = lineCount
268
268
  }
269
269
 
@@ -290,7 +290,7 @@ export async function promptList(options, { title = '' } = {}) {
290
290
  reject(new Error('Canceled'))
291
291
  }
292
292
 
293
- function handler(str, key) {
293
+ function handler(_str, key) {
294
294
  if (!key) return
295
295
  if ((key.ctrl && key.name === 'c') || key.name === 'escape') {
296
296
  cancel()
@@ -332,7 +332,7 @@ function main() {
332
332
  if (list) {
333
333
  const history = listAppliedMigrations(target)
334
334
  if (!history.currentVersion) {
335
- console.log(' \u2139\uFE0F No install state found in: ' + target)
335
+ console.log(` \u2139\uFE0F No install state found in: ${target}`)
336
336
  return
337
337
  }
338
338
  console.log(` Current version: ${history.currentVersion}`)
@@ -108,7 +108,32 @@ export function upgradeStateV1toV2(state) {
108
108
  }
109
109
 
110
110
  /**
111
- * Normalize any state to v2 (handles v1 → v2 upgrade).
111
+ * Guarantee the required v2 collections exist on a state object.
112
+ *
113
+ * A schema-v2 entry may be written by a partial writer — e.g. the postinstall
114
+ * version marker in sync-tui.mjs persisted only `pantheon_version` /
115
+ * `previous_version`, and writeState() then stamped it `schema_version: 2`.
116
+ * Such an entry has no `applied_migrations`, so the next `init` crashed in
117
+ * runMigrations() with
118
+ * "Cannot read properties of undefined (reading 'push')".
119
+ * Backfill the collections on read instead of trusting every writer.
120
+ * @param {object} state
121
+ * @returns {object} the same state object with required collections present
122
+ */
123
+ function ensureV2Shape(state) {
124
+ if (!Array.isArray(state.applied_migrations)) state.applied_migrations = []
125
+ if (
126
+ !state.components ||
127
+ typeof state.components !== 'object' ||
128
+ Array.isArray(state.components)
129
+ ) {
130
+ state.components = upgradeStateV1toV2(state).components
131
+ }
132
+ return state
133
+ }
134
+
135
+ /**
136
+ * Normalize any state to v2 (handles v1 → v2 upgrade and partial v2 markers).
112
137
  * @param {object} state
113
138
  * @returns {object|null}
114
139
  */
@@ -116,7 +141,7 @@ function normalizeState(state) {
116
141
  if (!state || typeof state !== 'object') return null
117
142
  if (isV1State(state)) return upgradeStateV1toV2(state)
118
143
  if (!state.schema_version || state.schema_version < 2) return upgradeStateV1toV2(state)
119
- return state
144
+ return ensureV2Shape(state)
120
145
  }
121
146
 
122
147
  /**