pantheon-opencode 1.5.2 → 1.6.0-beta.10

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 (146) 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/AGENTS.global.md +182 -0
  6. package/AGENTS.md +10 -891
  7. package/CHANGELOG.md +343 -0
  8. package/README.md +577 -79
  9. package/README.pt-BR.md +345 -60
  10. package/bin/pantheon-init.mjs +26 -3
  11. package/commands/pantheon-audit.md +7 -1
  12. package/commands/pantheon-consolidate.md +1 -1
  13. package/commands/pantheon-deepwork.md +14 -3
  14. package/commands/pantheon-focus.md +17 -0
  15. package/commands/pantheon-optimize.md +2 -2
  16. package/commands/pantheon-vision.md +61 -12
  17. package/package.json +30 -11
  18. package/plugin.json +2 -2
  19. package/pyproject.toml +11 -16
  20. package/scripts/build-agents-md.mjs +376 -58
  21. package/scripts/changelog-merge.mjs +161 -0
  22. package/scripts/check-plugin-v2-coverage.mjs +213 -0
  23. package/scripts/ci-validate-yaml.py +7 -5
  24. package/scripts/{code_mode_server.py → code_mode.py} +119 -27
  25. package/scripts/cost.mjs +244 -41
  26. package/scripts/doctor.mjs +236 -29
  27. package/scripts/install/agents-md.mjs +4 -4
  28. package/scripts/install/cli-ui.mjs +1 -1
  29. package/scripts/install/config-migration.mjs +319 -6
  30. package/scripts/install/health-check.mjs +26 -37
  31. package/scripts/install/interactive.mjs +7 -7
  32. package/scripts/install/migrate.mjs +1 -1
  33. package/scripts/install/opencode-version.mjs +246 -4
  34. package/scripts/install/opencode.mjs +627 -179
  35. package/scripts/install/plugin.mjs +43 -9
  36. package/scripts/install/shared.mjs +120 -12
  37. package/scripts/install/vision-prompt.mjs +161 -0
  38. package/scripts/install-mcp.mjs +28 -9
  39. package/scripts/{mcp_persistence_server.py → mcp_persistence.py} +392 -78
  40. package/{src/mcp/mcp_resources_server.py → scripts/mcp_resources.py} +2 -2
  41. package/scripts/{memory_mcp_server.py → memory_mcp.py} +372 -198
  42. package/scripts/postinstall.mjs +0 -7
  43. package/scripts/probe-context-rehydrate.mjs +36 -13
  44. package/scripts/probe-pantheon-cost.mjs +71 -15
  45. package/scripts/prune.mjs +2 -2
  46. package/scripts/run-node-tests.mjs +189 -0
  47. package/scripts/sync-artifacts.mjs +26 -13
  48. package/scripts/sync-tui.mjs +24 -3
  49. package/scripts/test-opencode-v2-sandbox.sh +1913 -0
  50. package/scripts/validate-routing.mjs +43 -3
  51. package/scripts/validate-sandbox-install.mjs +138 -0
  52. package/scripts/versioning.mjs +13 -1
  53. package/scripts/vision-status.mjs +682 -0
  54. package/skills-lock.json +15 -16
  55. package/src/agents/aphrodite.md +20 -37
  56. package/src/agents/apollo.md +7 -3
  57. package/src/agents/athena.md +63 -35
  58. package/src/agents/demeter.md +8 -28
  59. package/src/agents/gaia.md +1 -1
  60. package/src/agents/hephaestus.md +10 -21
  61. package/src/agents/hermes.md +15 -38
  62. package/src/agents/iris.md +1 -1
  63. package/src/agents/mnemosyne.md +23 -60
  64. package/src/agents/nyx.md +1 -1
  65. package/src/agents/prometheus.md +16 -20
  66. package/src/agents/talos.md +10 -2
  67. package/src/agents/themis.md +5 -5
  68. package/src/agents/zeus.md +99 -130
  69. package/src/instructions/agent-return-format.instructions.md +18 -3
  70. package/src/instructions/backend-standards.instructions.md +2 -0
  71. package/src/instructions/frontend-standards.instructions.md +3 -1
  72. package/src/instructions/memory-protocol.instructions.md +11 -110
  73. package/src/instructions/zeus-anti-stall.instructions.md +14 -61
  74. package/src/instructions/zeus-communication-rules.instructions.md +0 -1
  75. package/src/instructions/zeus-council-synthesis.instructions.md +32 -260
  76. package/src/instructions/zeus-memory-operations.instructions.md +26 -0
  77. package/src/instructions/zeus-timeout-retry.instructions.md +40 -87
  78. package/src/mcp/{code_mode_server.py → code_mode.py} +119 -27
  79. package/src/mcp/eval_store.py +2 -2
  80. package/src/mcp/mcp_codemap_module.py +559 -129
  81. package/src/mcp/{mcp_persistence_server.py → mcp_persistence.py} +392 -78
  82. package/{scripts/mcp_resources_server.py → src/mcp/mcp_resources.py} +2 -2
  83. package/src/mcp/{memory_mcp_server.py → memory_mcp.py} +373 -250
  84. package/src/mcp/{pantheon_vision_server.py → pantheon_vision.py} +396 -40
  85. package/src/mcp/requirements-mcp.txt +10 -6
  86. package/src/mcp/requirements-vision.txt +4 -2
  87. package/src/pantheon/cost-command.ts +399 -101
  88. package/src/pantheon/delegation-enforce.ts +10 -1
  89. package/src/pantheon/model-command.ts +18 -7
  90. package/src/pantheon/presets.d.mts +0 -8
  91. package/src/pantheon/presets.mjs +5 -32
  92. package/src/pantheon/todo-enforcer.ts +1 -1
  93. package/src/pantheon/v2-bounded-read.ts +640 -0
  94. package/src/pantheon/v2-delegation-enforce.ts +214 -0
  95. package/src/pantheon/v2-execute-after.ts +186 -0
  96. package/src/pantheon/v2-tools.ts +429 -0
  97. package/src/pantheon/v2-unsupported.d.mts +11 -0
  98. package/src/pantheon/v2-unsupported.mjs +90 -0
  99. package/src/pantheon/v2-vision.ts +622 -0
  100. package/src/pantheon/vision-local.ts +531 -0
  101. package/src/pantheon/vision.ts +1161 -116
  102. package/src/plugin-v2.ts +1244 -288
  103. package/src/plugin.ts +12 -9
  104. package/src/plugins/tui/dist/server.d.ts +1 -2
  105. package/src/plugins/tui/dist/server.d.ts.map +1 -1
  106. package/src/plugins/tui/dist/tui-v2.d.ts +154 -0
  107. package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -0
  108. package/src/plugins/tui/dist/tui-v2.js +659 -0
  109. package/src/plugins/tui/dist/tui-v2.js.map +1 -0
  110. package/src/plugins/tui/dist/tui.d.ts +85 -82
  111. package/src/plugins/tui/dist/tui.d.ts.map +1 -1
  112. package/src/plugins/tui/dist/tui.js +72 -59
  113. package/src/plugins/tui/index-v2.ts +6 -0
  114. package/src/plugins/tui/package-lock.json +5504 -1341
  115. package/src/plugins/tui/package.json +25 -15
  116. package/src/plugins/tui/src/index-v2.tsx +734 -0
  117. package/src/plugins/tui/src/index.tsx +106 -85
  118. package/src/plugins/tui/src/opencode-v2.d.ts +13 -0
  119. package/src/plugins/tui/tsconfig.build.json +5 -0
  120. package/src/plugins/tui/tsconfig.typecheck.json +5 -0
  121. package/src/plugins/tui/tsdown.config.ts +22 -2
  122. package/src/plugins/tui/tui-v2.ts +2 -0
  123. package/src/plugins/tui/tui.ts +3 -0
  124. package/src/routing.yml +11 -22
  125. package/src/skills/README.md +34 -39
  126. package/src/skills/agent-coordination/SKILL.md +7 -2
  127. package/src/skills/artifact-management/SKILL.md +12 -5
  128. package/src/skills/auto-continue/SKILL.md +54 -95
  129. package/src/skills/code-review-checklist/SKILL.md +5 -5
  130. package/src/skills/context-compression/SKILL.md +26 -879
  131. package/src/skills/session-goal/SKILL.md +14 -5
  132. package/src/skills/spec-driven-development/SKILL.md +3 -1
  133. package/src/skills/tdd-with-agents/SKILL.md +18 -10
  134. package/.pantheon/code-mode/eval-llm-judge.py +0 -255
  135. package/.pantheon/code-mode/eval-monte-carlo.py +0 -368
  136. package/.pantheon/code-mode/eval-run.py +0 -197
  137. package/.pantheon/code-mode/eval-static.py +0 -321
  138. package/.pantheon/code-mode/session-end-save.py +0 -186
  139. package/.pantheon/code-mode/session-end-save.sh +0 -18
  140. package/opencode.json +0 -58
  141. package/scripts/recover-zenodo-deposition.mjs +0 -146
  142. package/scripts/test-opencode-v1-v2-sandbox.sh +0 -862
  143. package/scripts/validate-zenodo-release.mjs +0 -154
  144. package/scripts/zenodo-artifact.mjs +0 -94
  145. package/scripts/zenodo-release-state.mjs +0 -53
  146. package/src/skills/orchestration-workflow/SKILL.md +0 -311
@@ -1,146 +0,0 @@
1
- import { pathToFileURL } from 'node:url'
2
- import { validateZenodoResponse } from './zenodo-release-state.mjs'
3
-
4
- export function zenodoReleaseMarker(tag) {
5
- if (typeof tag !== 'string' || !/^v\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(tag))
6
- throw new Error('Release tag is invalid.')
7
- return `pantheon-opencode-release:${tag}`
8
- }
9
-
10
- function depositionDescription(deposition) {
11
- return [deposition?.metadata?.description, deposition?.description]
12
- .filter((value) => typeof value === 'string')
13
- .join('\n')
14
- }
15
-
16
- function exactTotal(value) {
17
- if (Number.isSafeInteger(value) && value >= 0) return value
18
- if (
19
- value &&
20
- typeof value === 'object' &&
21
- Number.isSafeInteger(value.value) &&
22
- value.value >= 0 &&
23
- (value.relation === undefined || value.relation === 'eq')
24
- )
25
- return value.value
26
- return null
27
- }
28
-
29
- export async function findUniqueZenodoDeposition(
30
- depositionsUrl,
31
- token,
32
- releaseMarker,
33
- fetchImpl = fetch,
34
- ) {
35
- let url
36
- try {
37
- url = new URL(depositionsUrl)
38
- } catch {
39
- throw new Error('Zenodo deposition URL must be a valid absolute HTTPS URL.')
40
- }
41
- if (
42
- url.protocol !== 'https:' ||
43
- !url.hostname ||
44
- url.username ||
45
- url.password ||
46
- url.hash ||
47
- /%(?![0-9A-Fa-f]{2})/.test(depositionsUrl) ||
48
- /[\s{}\\|^`]/.test(depositionsUrl)
49
- )
50
- throw new Error('Zenodo deposition URL must be a valid HTTPS URL without credentials.')
51
- if (typeof releaseMarker !== 'string' || !releaseMarker)
52
- throw new Error('Zenodo release marker is required.')
53
- if (typeof token !== 'string' || !token) throw new Error('Zenodo token is required.')
54
- url.searchParams.set('q', releaseMarker)
55
- // Zenodo documents page/size for this endpoint. The response's links are
56
- // optional, so keep a deterministic fallback for the real hits/total shape.
57
- url.searchParams.set('page', '1')
58
- url.searchParams.set('size', '100')
59
- const candidates = []
60
- const visitedUrls = new Set()
61
- let nextUrl = url
62
- let pageNumber = 1
63
- let expectedTotal = null
64
- while (nextUrl) {
65
- const currentUrl = String(nextUrl)
66
- if (visitedUrls.has(currentUrl)) throw new Error('Zenodo search returned a pagination cycle.')
67
- visitedUrls.add(currentUrl)
68
- const response = await fetchImpl(nextUrl, {
69
- headers: { Authorization: `Bearer ${token}`, Accept: 'application/json' },
70
- })
71
- if (!response.ok) throw new Error(`Zenodo deposition search failed (${response.status}).`)
72
- const payload = await response.json()
73
- if (Array.isArray(payload)) {
74
- throw new Error('Zenodo search returned ambiguous pagination.')
75
- }
76
- const page = payload?.hits?.hits
77
- const total = payload?.hits?.total
78
- const normalizedTotal = exactTotal(total)
79
- if (!Array.isArray(page) || normalizedTotal === null)
80
- throw new Error('Zenodo search returned ambiguous pagination.')
81
- if (expectedTotal !== null && expectedTotal !== normalizedTotal)
82
- throw new Error('Zenodo search returned inconsistent pagination totals.')
83
- expectedTotal = normalizedTotal
84
- candidates.push(...page)
85
- const rawNext = payload?.links?.next
86
- if (candidates.length >= expectedTotal) {
87
- nextUrl = null
88
- } else if (rawNext === null || rawNext === undefined || rawNext === '') {
89
- // Some Zenodo Cloud responses omit links entirely. Continue with the
90
- // documented page parameter instead of treating the first page as the
91
- // complete search result.
92
- if (page.length === 0)
93
- throw new Error('Zenodo search ended before all results were examined.')
94
- pageNumber += 1
95
- const pagedNext = new URL(url)
96
- pagedNext.searchParams.set('page', String(pageNumber))
97
- nextUrl = pagedNext
98
- } else {
99
- if (typeof rawNext !== 'string')
100
- throw new Error('Zenodo search returned an invalid pagination link.')
101
- let parsedNext
102
- try {
103
- parsedNext = new URL(rawNext, url)
104
- } catch {
105
- throw new Error('Zenodo search returned an invalid pagination link.')
106
- }
107
- if (
108
- parsedNext.protocol !== 'https:' ||
109
- parsedNext.origin !== url.origin ||
110
- parsedNext.pathname !== url.pathname
111
- )
112
- throw new Error('Zenodo search returned an unsafe pagination link.')
113
- const linkedPage = Number(parsedNext.searchParams.get('page'))
114
- if (Number.isSafeInteger(linkedPage) && linkedPage > pageNumber) {
115
- pageNumber = linkedPage
116
- }
117
- nextUrl = parsedNext
118
- }
119
- }
120
- const escapedMarker = releaseMarker.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
121
- const markerPattern = new RegExp(`(?:^|[^A-Za-z0-9._:-])${escapedMarker}(?![A-Za-z0-9.-])`)
122
- const matches = candidates.filter((deposition) =>
123
- markerPattern.test(depositionDescription(deposition)),
124
- )
125
- if (matches.length === 0) return null
126
- if (matches.length !== 1) {
127
- throw new Error(
128
- `Zenodo recovery requires exactly one matching deposition; found ${matches.length}.`,
129
- )
130
- }
131
- return validateZenodoResponse(matches[0])
132
- }
133
-
134
- if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
135
- try {
136
- const result = await findUniqueZenodoDeposition(
137
- process.env.ZENODO_DEPOSITIONS_URL,
138
- process.env.ZENODO_TOKEN,
139
- process.env.RELEASE_MARKER,
140
- )
141
- process.stdout.write(JSON.stringify(result))
142
- } catch (error) {
143
- console.error(`zenodo recovery: ${error.message}`)
144
- process.exit(1)
145
- }
146
- }