pantheon-opencode 2.0.0-rc.1 → 2.0.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.
- package/AGENTS.global.md +2 -2
- package/AGENTS.md +8 -8
- package/CHANGELOG.md +92 -0
- package/README.md +15 -2
- package/README.pt-BR.md +15 -2
- package/bin/pantheon-init.mjs +13 -0
- package/commands/pantheon-audit.md +1 -1
- package/commands/pantheon-deepwork.md +1 -1
- package/commands/pantheon-optimize.md +41 -63
- package/package.json +4 -3
- package/plugin.json +1 -1
- package/prompts/optimize-database.prompt.md +5 -5
- package/prompts/plan-architecture.prompt.md +6 -6
- package/pyproject.toml +1 -1
- package/scripts/build-agents-md.mjs +10 -10
- package/scripts/build-plugin.mjs +26 -0
- package/scripts/install/opencode-version.mjs +17 -5
- package/scripts/install/opencode.mjs +8 -1
- package/scripts/optimize.mjs +322 -0
- package/scripts/prune.mjs +105 -14
- package/scripts/update.mjs +20 -15
- package/skills-lock.json +11 -11
- package/src/agents/aphrodite.md +15 -14
- package/src/agents/apollo.md +2 -1
- package/src/agents/athena.md +19 -12
- package/src/agents/demeter.md +2 -0
- package/src/agents/hephaestus.md +1 -0
- package/src/agents/hermes.md +19 -95
- package/src/agents/iris.md +3 -0
- package/src/agents/nyx.md +1 -0
- package/src/agents/prometheus.md +2 -0
- package/src/agents/talos.md +3 -0
- package/src/agents/themis.md +91 -87
- package/src/agents/zeus.md +41 -266
- package/src/instructions/agent-return-format.instructions.md +1 -1
- package/src/instructions/memory-protocol.instructions.md +1 -1
- package/src/instructions/zeus-anti-stall.instructions.md +3 -3
- package/src/instructions/zeus-communication-rules.instructions.md +1 -1
- package/src/instructions/zeus-council-synthesis.instructions.md +29 -10
- package/src/instructions/zeus-timeout-retry.instructions.md +10 -10
- package/src/pantheon/model-command.ts +12 -12
- package/src/pantheon/tools.ts +4 -0
- package/src/pantheon/tui-version-check.ts +1 -1
- package/src/pantheon/update-notifier.ts +13 -8
- package/src/pantheon/vision.ts +20 -20
- package/src/plugin/index.js +14594 -0
- package/src/plugins/tui/dist/tui.d.ts +3 -3
- package/src/plugins/tui/dist/tui.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui.js +1028 -393
- package/src/plugins/tui/dist/tui.js.map +1 -1
- package/src/plugins/tui/package-lock.json +2 -2
- package/src/plugins/tui/package.json +1 -1
- package/src/plugins/tui/src/autonomy-state.ts +66 -25
- package/src/plugins/tui/src/decision-router-state.ts +59 -24
- package/src/plugins/tui/src/index.tsx +44 -23
- package/src/plugins/tui/src/j1-gate-status.ts +26 -9
- package/src/plugins/tui/src/pantheon-settings.tsx +484 -124
- package/src/plugins/tui/src/settings-i18n.ts +203 -0
- package/src/plugins/tui/src/tui-prefs.ts +131 -4
- package/src/plugins/tui/src/update-notice.ts +9 -6
- package/src/plugins/tui/src/whats-new-open.ts +4 -4
- package/src/plugins/tui/src/whats-new.tsx +119 -17
- package/src/skills/agent-coordination/SKILL.md +6 -6
- package/src/skills/artifact-management/SKILL.md +43 -39
- package/src/skills/artifact-management/references/artifact-templates.md +103 -48
- package/src/skills/auto-continue/references/auto-continue-details.md +13 -13
- package/src/skills/code-review-checklist/SKILL.md +6 -6
- package/src/skills/incremental-implementation/SKILL.md +13 -13
- package/src/skills/memory-bank/references/anti-patterns.md +3 -3
- package/src/skills/spec-driven-development/SKILL.md +12 -14
- package/src/skills/tdd-with-agents/SKILL.md +6 -5
- package/src/skills/visual-review-pipeline/SKILL.md +1 -1
- package/src/skills/visual-review-pipeline/references/workflow-steps.md +1 -1
package/AGENTS.global.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!-- pantheon:generated:begin — Pantheon-managed region; regenerated on install/upgrade, never edit inside -->
|
|
2
2
|
<!-- Generated by scripts/build-agents-md.mjs — do not edit directly. -->
|
|
3
3
|
<!-- Source of truth: src/instructions/*.instructions.md + the static sections in this script. -->
|
|
4
|
-
<!-- pantheon:agents-md v2 artifact=global generated-at=2026-11-
|
|
4
|
+
<!-- pantheon:agents-md v2 artifact=global generated-at=2026-11-11T10:16:35-03:00 sha=d5466bf -->
|
|
5
5
|
|
|
6
6
|
# Pantheon Agent System — OpenCode
|
|
7
7
|
|
|
@@ -37,7 +37,7 @@ All agents check each result against the request and evidence; remove unrelated
|
|
|
37
37
|
## subtask_summary
|
|
38
38
|
**files_changed:** [list of file paths, one per line]
|
|
39
39
|
**summary:** What was done, in 2-3 sentences
|
|
40
|
-
**tests:**
|
|
40
|
+
**tests:** [PASS] All passing / [WARN] X failing / [FAIL] Not run (reason)
|
|
41
41
|
**coverage:** X% (if applicable)
|
|
42
42
|
**tokens:** ~N input / ~M output (estimated)
|
|
43
43
|
**status:** complete | partial (reason) | escalated (reason)
|
package/AGENTS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!-- pantheon:generated:begin — Pantheon-managed region; regenerated on install/upgrade, never edit inside -->
|
|
2
2
|
<!-- Generated by scripts/build-agents-md.mjs — do not edit directly. -->
|
|
3
3
|
<!-- Source of truth: project sections in scripts/build-agents-md.mjs. -->
|
|
4
|
-
<!-- pantheon:agents-md v2 artifact=project generated-at=2026-11-
|
|
4
|
+
<!-- pantheon:agents-md v2 artifact=project generated-at=2026-11-11T10:16:35-03:00 sha=d5466bf -->
|
|
5
5
|
|
|
6
6
|
# Pantheon — Repository Setup
|
|
7
7
|
|
|
@@ -13,18 +13,18 @@ Setup: [INSTALLATION.md](docs/INSTALLATION.md).
|
|
|
13
13
|
- Test: focused checks by default; `npm test` for CI/release or broad/high-risk changes
|
|
14
14
|
- Lint: `npm run lint`
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Global Installation Testing (Sandbox)
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
Validate global installation AS A REAL USER in the sandbox `~/pantheon-sandbox/` (outside the repo; with dedicated HOME, npm prefix, and venv); the dev environment is NOT suitable for packaging tests.
|
|
19
19
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
20
|
+
- Run: `bash ~/pantheon-sandbox/run-test.sh` (MCPs, doctor, TUI)
|
|
21
|
+
- Agent rule: validate global installation (npm pack, `init`, MCPs, hooks) in the sandbox — NEVER in the development environment
|
|
22
|
+
- Teardown: `rm -rf ~/pantheon-sandbox`
|
|
23
23
|
|
|
24
24
|
## Worktrees
|
|
25
25
|
|
|
26
|
-
-
|
|
27
|
-
-
|
|
26
|
+
- Never create worktrees inside the main project; use `<project-parent>/.pantheon-worktrees/<repo-basename>/<task>`.
|
|
27
|
+
- Worktrees do not live inside `.pantheon/`.
|
|
28
28
|
|
|
29
29
|
## Conventions
|
|
30
30
|
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,30 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
## [v2.0.1] - 2026-11-11
|
|
9
|
+
|
|
10
|
+
### 🆕 What's New
|
|
11
|
+
|
|
12
|
+
- **Bilingual TUI Settings**: Portuguese (pt-BR) and English (en) with system locale auto-detection and manual toggle in the TUI menu.
|
|
13
|
+
- **Decision Model Selector**: Interactive selector in TUI settings to cycle across all remote Jev models without manual JSON editing.
|
|
14
|
+
- **Modernized Council Synthesis**: Domain Authority table, Mermaid arbitration diagram, and immediate action checklist.
|
|
15
|
+
- **Modernized Strategic Planning**: Sub-10s test slicing, Mermaid workflow diagram, impact matrix, and rollback blueprint.
|
|
16
|
+
- **Demystified J1 Safety Ladder**: Plain-language descriptions for execution modes (shadow, enforce, off) and safety limits.
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- **tui** — bilingual dictionary and locale resolution helper (PT-BR / EN) in settings-i18n.ts.
|
|
21
|
+
- **tui** — language preference in TuiPrefs with cycling options (auto, pt-BR, en) and live preview.
|
|
22
|
+
- **tui** — unit test suite in tests/tui-settings-i18n.test.mjs validating locale and tab rendering.
|
|
23
|
+
- **routing** — permanent interactive target selector cycler row in the Decision tab across all modes.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- **council** — modernized Zeus council synthesis with Domain Authority matrix and Mermaid graph.
|
|
28
|
+
- **planning** — modernized Athena strategic planning template with sub-10s test slicing.
|
|
29
|
+
- **tui** — humanized settings labels for Decision Router, Selection mode, Egress, and J1 Ladder.
|
|
30
|
+
- **tui** — localized Autonomy tab notes for Goal Loop continuation, budgets, and risk gradient.
|
|
31
|
+
|
|
8
32
|
## [v1.7.0] - 2026-11-07
|
|
9
33
|
|
|
10
34
|
### 🆕 What's New
|
|
@@ -71,6 +95,74 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
71
95
|
`node scripts/versioning.mjs apply --notes` pre-fills the generated sections from conventional commits.
|
|
72
96
|
Running apply will move this section to a versioned entry and reset the template below. -->
|
|
73
97
|
|
|
98
|
+
## [v2.0.0] - 2026-11-11
|
|
99
|
+
|
|
100
|
+
### 🆕 What's New
|
|
101
|
+
|
|
102
|
+
- **OpenCode 2.x Architecture**: Official 2.0 release dedicated to OpenCode 2.x, removing legacy V1 shims for low latency.
|
|
103
|
+
- **Fast-Path Direct Dispatch**: Zeus executes direct implementation requests in 1 turn without mandatory planning or approval cascades.
|
|
104
|
+
- **Native Subagent Execution**: Parallel background subagents (task(background: true)) for non-blocking test and build workflows.
|
|
105
|
+
- **Implementer Tool Grants**: Added native glob, grep, and bash access across all implementers to eliminate discovery round-trips.
|
|
106
|
+
- **Prompt Diet & English Unification**: Condensed agent prompts by up to 70% and standardized instructions across all agents to English.
|
|
107
|
+
- **Full TUI Settings Suite**: Fullscreen settings overlay (/pantheon-settings) with Autonomy, Decision, TUI, and Doctor tabs.
|
|
108
|
+
|
|
109
|
+
### Added
|
|
110
|
+
|
|
111
|
+
- **agents** — Fast-Path Direct Implementation in Zeus routing direct coding requests immediately to domain specialists in 1 turn.
|
|
112
|
+
- **agents** — Native glob, grep, and bash permissions granted to implementers (Talos, Prometheus, Demeter, Hermes, Aphrodite).
|
|
113
|
+
- **agents** — Parallel background execution guidance for tests and builds using task(background: true).
|
|
114
|
+
- **tui** — Full-screen settings overlay (/pantheon-settings) with tabs for Autonomy, Decision, TUI Personalization, and Doctor.
|
|
115
|
+
- **tui** — Autonomy tab managing persisted goal loops, cooldown periods, and continuation caps.
|
|
116
|
+
- **tui** — Decision tab configuring Jev routing model, candidate selection mode, provider status, and egress consent.
|
|
117
|
+
- **skills** — In-process pantheon_skill_search with 24h query cache and test-slicing skill for fast bounded runs under 100ms.
|
|
118
|
+
- **routing** — Named-behavior overrides registered in routing.yml with pure loader and quarantine fallback.
|
|
119
|
+
|
|
120
|
+
### Changed
|
|
121
|
+
|
|
122
|
+
- **agents** — Condensed Hermes, Zeus, and Apollo prompts by up to 70%, eliminating tutorial boilerplate and saving >8,000 tokens per turn.
|
|
123
|
+
- **instructions** — Standardized all agent instructions and repository headers to English with zero-emoji enforcement.
|
|
124
|
+
- **install** — Native opencode plugin add pantheon-opencode flow, lean init, and automated sibling opencode.jsonc sync.
|
|
125
|
+
- **skills** — Progressive disclosure architecture separating core instructions (<120 lines) from references/.
|
|
126
|
+
- **council** — Assertive synthesis protocol with Domain Authority precedence and JEV arbitration.
|
|
127
|
+
|
|
128
|
+
### Removed
|
|
129
|
+
|
|
130
|
+
- 💥 **host** — Removed OpenCode V1 runtime contract, shims, and legacy bridge per ADR-0014.
|
|
131
|
+
- **install** — Removed interactive init wizard in favor of one-shot preview and /pantheon-settings configuration.
|
|
132
|
+
|
|
133
|
+
### Fixed
|
|
134
|
+
|
|
135
|
+
- **tools** — Replaced legacy shell permissions with native OpenCode V2 bash across all implementers.
|
|
136
|
+
- **tui** — Resolved tab squish and footer overlap on narrow viewports in settings window using flexWrap.
|
|
137
|
+
- **tui** — Fixed settings navigation loss and cyclic route structure errors when closing dialogs.
|
|
138
|
+
- **install** — Fixed missing pantheon tools caused by opencode.jsonc overriding opencode.json.
|
|
139
|
+
- **vision** — Reconciled temp-dir restart orphans and crash strays with disk cap.
|
|
140
|
+
|
|
141
|
+
## [v2.0.0-rc.2] - 2026-11-11
|
|
142
|
+
|
|
143
|
+
### 🆕 What's New
|
|
144
|
+
|
|
145
|
+
- **Token optimization**: Unified English instructions and condensed Zeus prompt to 73 lines with fast 1-turn bypass.
|
|
146
|
+
- **OpenCode V2 permissions**: Replaced legacy shell permissions with native bash across all implementers.
|
|
147
|
+
- **TUI settings stability**: Fullscreen settings view with flexWrap tabs and footer to prevent compression and overlap.
|
|
148
|
+
- **Sibling config sync**: Automated opencode.jsonc synchronization during install to guarantee pantheon tools.
|
|
149
|
+
- **Pruning CLI**: Added --deepwork and --worktrees flags to scripts/prune.mjs with clean reporting.
|
|
150
|
+
|
|
151
|
+
### Changed
|
|
152
|
+
|
|
153
|
+
- **agents** — Zeus prompt condensed to 73 lines with fast bypass and bounded read permissions.
|
|
154
|
+
- **agents** — Themis, Apollo, Athena, Hermes, and Zeus instructions standardized to English.
|
|
155
|
+
- **agents** — Cleaned emojis from all instruction headers and tables across src/instructions/.
|
|
156
|
+
- **install** — opencode.mjs synchronizes pantheon-opencode into sibling opencode.jsonc.
|
|
157
|
+
- **tui** — src/plugins/tui/src/pantheon-settings.tsx wrapped tabs and footer with flexWrap and capped dialog maxHeight.
|
|
158
|
+
- **scripts** — scripts/prune.mjs added findStaleDeepwork and findStaleWorktrees with zero emojis.
|
|
159
|
+
|
|
160
|
+
### Fixed
|
|
161
|
+
|
|
162
|
+
- **tools** — Fixed "No tool named 'shell' is currently available" by updating agent permission frontmatters to `bash: allow`.
|
|
163
|
+
- **tui** — Fixed squished tab labels and footer button overlap under narrow viewport widths.
|
|
164
|
+
- **install** — Fixed missing pantheon tools caused by opencode.jsonc overriding opencode.json.
|
|
165
|
+
|
|
74
166
|
## [v2.0.0-rc.1] - 2026-11-10
|
|
75
167
|
|
|
76
168
|
### 🆕 What's New
|
package/README.md
CHANGED
|
@@ -184,10 +184,13 @@ Run `/pantheon-settings` (or `Pantheon: Settings` in the command palette) to ope
|
|
|
184
184
|
|
|
185
185
|
- **Gates & Overrides:** Toggle named behaviors live; persists to `pantheon-overrides.json`.
|
|
186
186
|
- **Model Presets:** Switch active model tier globally or per project.
|
|
187
|
-
- **Decision Model:**
|
|
187
|
+
- **Decision Model Selector:** Interactive selector to cycle across all remote decision models (`openrouter-jev`, `typesafe-jev`, `openai-decisions`, `vercel-gateway-jev`, etc.) directly from the UI.
|
|
188
|
+
- **Bilingual Settings (PT-BR / EN):** Full visual localization for Decision, Autonomy, and Safety tabs, auto-detecting environment locale with manual toggle in the TUI tab.
|
|
188
189
|
- **Updates:** Check registry channel (`beta` / `stable`) and trigger upgrades.
|
|
189
190
|
- **Doctor:** Run inline system health diagnostics.
|
|
190
|
-
- **TUI Personalization:** Adjust spacing (`comfortable` vs `compact`), separators, gauge bar styles,
|
|
191
|
+
- **TUI Personalization:** Adjust spacing (`comfortable` vs `compact`), separators, gauge bar styles, context display rows, and language.
|
|
192
|
+
- **Non-Destructive Overlay & Mouse Navigation:** Opens as a floating dialog overlay over the active session without blanking the workspace (configurable via `dialog` vs `fullscreen`), with full mouse click support for tabs, sidebar, rows, value cyclers, and actions.
|
|
193
|
+
- **Modernized What's New Window:** Card layout with rounded border, pagination buttons, and a dedicated `[OK, Entendido]` button with keyboard (`Enter`/`Esc`/`Q`) and mouse click support.
|
|
191
194
|
|
|
192
195
|
---
|
|
193
196
|
|
|
@@ -202,6 +205,16 @@ Run `/pantheon-settings` (or `Pantheon: Settings` in the command palette) to ope
|
|
|
202
205
|
|
|
203
206
|
---
|
|
204
207
|
|
|
208
|
+
## What's New in v2.0.1
|
|
209
|
+
|
|
210
|
+
- **Bilingual TUI Settings (PT-BR / EN):** Visual localization for Decision Router, Autonomy & Budgets, and J1 Safety Gate tabs, with intelligent system locale auto-detection (`LANG` / `LC_ALL`) and manual preference cycling (`auto`, `pt-BR`, `en`).
|
|
211
|
+
- **Interactive Decision Model Selector:** Permanently accessible selector row in `/pantheon-settings` to cycle across all 6 remote decision models without manual JSON configuration.
|
|
212
|
+
- **Modernized Council Synthesis (`/pantheon`):** Rich synthesis artifacts featuring Domain Authority breakdown, Mermaid arbitration diagrams, and immediate action checklists.
|
|
213
|
+
- **Modernized Strategic Planning (`/pantheon-deepwork`):** Athena plans now enforce mandatory sub-10s test slicing, execution dependency diagrams, blast radius impact matrix, and rollback blueprints.
|
|
214
|
+
- **Demystified J1 Safety Ladder:** Plain-language descriptions for J1 execution modes (`shadow`, `enforce`, `off`), making telemetry and protection gates clear.
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
205
218
|
## What's New in v2.0.0-rc.1
|
|
206
219
|
|
|
207
220
|
- **Release Candidate Series Inauguration:** Production-ready multi-agent orchestration for OpenCode 2.x.
|
package/README.pt-BR.md
CHANGED
|
@@ -180,10 +180,13 @@ Execute `/pantheon-settings` (ou `Pantheon: Settings` na paleta de comandos) par
|
|
|
180
180
|
|
|
181
181
|
- **Gates & Overrides:** Habilite ou desabilite comportamentos nomeados em tempo real (salvo em `pantheon-overrides.json`).
|
|
182
182
|
- **Presets de Modelos:** Alterne o tier de modelos ativo globalmente ou no projeto.
|
|
183
|
-
- **Modelo de Decisão:**
|
|
183
|
+
- **Seletor de Modelo de Decisão:** Alterne interativamente entre os modelos remotos de decisão (`openrouter-jev`, `typesafe-jev`, `openai-decisions`, etc.) diretamente na interface.
|
|
184
|
+
- **Suporte Multilíngue (PT-BR / EN):** Tradução visual completa das abas Decisões, Autonomia e Segurança, com detecção automática da linguagem do sistema e troca manual na aba TUI.
|
|
184
185
|
- **Atualizações:** Verifique o canal do registro (`beta` / `stable`) e dispare upgrades.
|
|
185
186
|
- **Doctor:** Execute o diagnóstico de saúde do sistema diretamente na interface.
|
|
186
|
-
- **Personalização da TUI:** Ajuste espaçamento (`comfortable` vs `compact`), separadores, estilo das barras de progresso
|
|
187
|
+
- **Personalização da TUI:** Ajuste espaçamento (`comfortable` vs `compact`), separadores, estilo das barras de progresso, linhas de contexto e idioma.
|
|
188
|
+
- **Overlay Não-Destrutivo e Navegação por Clique:** Abre como diálogo flutuante sobre a sessão ativa mantendo a TUI visível (configurável entre `dialog` e `fullscreen`), com suporte completo a cliques de mouse em abas, menu lateral, linhas, seletores e botões de ação.
|
|
189
|
+
- **Janela de Novidades Modernizada:** Layout em card com bordas arredondadas, paginação visual e botão dedicado `[OK, Entendido]` com confirmação via mouse ou teclado (`Enter`/`Esc`/`Q`).
|
|
187
190
|
|
|
188
191
|
---
|
|
189
192
|
|
|
@@ -198,6 +201,16 @@ Execute `/pantheon-settings` (ou `Pantheon: Settings` na paleta de comandos) par
|
|
|
198
201
|
|
|
199
202
|
---
|
|
200
203
|
|
|
204
|
+
## O Que Há de Novo na v2.0.1
|
|
205
|
+
|
|
206
|
+
- **Configurações TUI Bilíngues (PT-BR / EN):** Localização visual para o Assistente de Decisão Jev, Autonomia & Orçamentos e Portão de Segurança J1, com detecção inteligente da linguagem do ambiente (`LANG` / `LC_ALL`) e seleção manual (`auto`, `pt-BR`, `en`).
|
|
207
|
+
- **Seletor Interativo de Modelos Jev:** Linha de seleção sempre visível em `/pantheon-settings` para alternar entre os 6 modelos remotos suportados sem editar arquivos JSON manualmente.
|
|
208
|
+
- **Síntese do Conselho Modernizada (`/pantheon`):** Artefatos com Autoridade por Domínio, diagrama visual de arbitragem em Mermaid e checklist de ações imediatas.
|
|
209
|
+
- **Planejamento Estratégico Modernizado (`/pantheon-deepwork`):** Planos da Athena com fluxo visual em Mermaid, fatiamento rigoroso de testes (< 10s), análise de raio de impacto e plano de rollback.
|
|
210
|
+
- **Desmistificação da Escala de Segurança J1:** Descrições claras dos modos de execução (`shadow`, `enforce`, `off`), eliminando ambiguidades sobre bloqueio e telemetria.
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
201
214
|
## O Que Há de Novo na v2.0.0-rc.1
|
|
202
215
|
|
|
203
216
|
- **Inauguração da Série Release Candidate:** Orquestração multi-agente pronta para produção no OpenCode 2.x.
|
package/bin/pantheon-init.mjs
CHANGED
|
@@ -114,6 +114,9 @@ function printUsage() {
|
|
|
114
114
|
)
|
|
115
115
|
console.log(' npx pantheon-opencode prune # List legacy artifacts (dry-run)')
|
|
116
116
|
console.log(' npx pantheon-opencode prune --apply # Remove stale backups')
|
|
117
|
+
console.log(
|
|
118
|
+
' npx pantheon-opencode optimize [--apply] # Archive completed deepwork & clean logs',
|
|
119
|
+
)
|
|
117
120
|
console.log(' npx pantheon-opencode doctor [--profile] # Run health check')
|
|
118
121
|
console.log(
|
|
119
122
|
' npx pantheon-opencode restore [--project] [--yes] # Restore an exact installer backup',
|
|
@@ -170,6 +173,16 @@ async function main() {
|
|
|
170
173
|
process.exit(result.status ?? 1)
|
|
171
174
|
}
|
|
172
175
|
|
|
176
|
+
if (command === 'optimize') {
|
|
177
|
+
const { spawnSync } = await import('node:child_process')
|
|
178
|
+
const optimizeScript = path.join(ROOT, 'scripts', 'optimize.mjs')
|
|
179
|
+
const result = spawnSync(process.execPath, [optimizeScript, ...args.slice(1)], {
|
|
180
|
+
stdio: 'inherit',
|
|
181
|
+
cwd: process.cwd(),
|
|
182
|
+
})
|
|
183
|
+
process.exit(result.status ?? 1)
|
|
184
|
+
}
|
|
185
|
+
|
|
173
186
|
if (command === 'uninstall') {
|
|
174
187
|
const { spawnSync } = await import('node:child_process')
|
|
175
188
|
const uninstallScript = path.join(ROOT, 'scripts', 'uninstall.mjs')
|
|
@@ -28,4 +28,4 @@ Zero tokens, <2s. Checks: ruff, biome, anti-pattern slop, anti-overengineering (
|
|
|
28
28
|
~500 tokens. Confidence scoring, regression prediction, OWASP Top 10.
|
|
29
29
|
|
|
30
30
|
### Layer 3 — Verification Planning
|
|
31
|
-
For N>5 file changes.
|
|
31
|
+
For N>5 file changes. Proposes a verification plan before implementing.
|
|
@@ -56,7 +56,7 @@ Usage: --resume <slug> | --status <slug> | --list
|
|
|
56
56
|
|
|
57
57
|
## Full-Auto Mode (`--full-auto`)
|
|
58
58
|
|
|
59
|
-
>
|
|
59
|
+
> [!WARNING] Automates only eligible review gates. Gate 1 and commit/deploy gates still require approval.
|
|
60
60
|
|
|
61
61
|
`--full-auto` does not hide the plan or skip Gate 1: Zeus still displays the
|
|
62
62
|
complete plan in the main conversation and waits for explicit approval before
|
|
@@ -1,79 +1,57 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "Scan, clean, cache, and archive Pantheon project files. Scans for bloat, archives completed deepwork,
|
|
2
|
+
description: "Scan, clean, cache, and archive Pantheon project files. Scans for bloat, archives completed deepwork, and cleans workspace artifacts. Usage: /pantheon-optimize"
|
|
3
3
|
agent: "zeus"
|
|
4
4
|
---
|
|
5
5
|
# /pantheon-optimize — Pantheon Project Optimizer
|
|
6
6
|
|
|
7
|
-
**What:** Multi-mode optimization:
|
|
7
|
+
**What:** Multi-mode workspace optimization: archives or cleans completed deepwork sessions from `.pantheon/deepwork/`, prunes stale backups and logs, and reports optimization opportunities.
|
|
8
8
|
|
|
9
|
-
## Usage
|
|
9
|
+
## CLI Usage (Deterministic, Zero-Token)
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
/pantheon-optimize → Full scan + compress (default)
|
|
13
|
-
/pantheon-optimize --dry-run → Preview only, no changes
|
|
14
|
-
/pantheon-optimize --archive → Archive completed deepwork sessions
|
|
15
|
-
/pantheon-optimize --cache → Migrate memory-bank to MCP memory
|
|
16
|
-
/pantheon-optimize --path=<dir> → Limit scan to directory
|
|
17
|
-
/pantheon-optimize --all → Run all modes (default)
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Modes
|
|
21
|
-
|
|
22
|
-
### `--archive` — Deepwork Archiving
|
|
23
|
-
Archives completed deepwork sessions from `.pantheon/deepwork/<slug>/` to `.pantheon/deepwork/archive/<slug>/`.
|
|
24
|
-
|
|
25
|
-
**Criteria:** A session is "completed" if it has a `REVIEW.md` containing "APPROVED".
|
|
11
|
+
You can run the optimizer directly from the terminal without AI token spend:
|
|
26
12
|
|
|
13
|
+
```bash
|
|
14
|
+
pantheon-opencode optimize # Dry-run inspection (default)
|
|
15
|
+
pantheon-opencode optimize --apply # Archive completed deepworks and clean old logs
|
|
16
|
+
pantheon-opencode optimize --clean --apply # Permanently remove resolved deepworks
|
|
17
|
+
pantheon-opencode optimize --age 5 # Set inactivity threshold (days)
|
|
27
18
|
```
|
|
28
|
-
/pantheon-optimize archive → Interactive (ask per slug)
|
|
29
|
-
/pantheon-optimize archive --dry-run → Preview only
|
|
30
|
-
/pantheon-optimize archive --auto → Archive all completed
|
|
31
|
-
/pantheon-optimize archive --auto --keep=2 → Keep only PLAN.md + REVIEW.md
|
|
32
|
-
/pantheon-optimize archive --auto --compress → Single .md per slug
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### `--cache` — Memory Bank Migration
|
|
36
|
-
Scans `.pantheon/memory-bank/` for flat `.md` files and migrates them to the FTS5-backed MCP memory server.
|
|
37
19
|
|
|
38
|
-
|
|
39
|
-
1. Reads all `.md` files in `.pantheon/memory-bank/`
|
|
40
|
-
2. Chunks by heading (## sections)
|
|
41
|
-
3. Calls `memory_store()` for each chunk with appropriate namespace
|
|
42
|
-
4. Optionally archives the original files after successful migration
|
|
20
|
+
## Slash Command Usage
|
|
43
21
|
|
|
44
22
|
```
|
|
45
|
-
/pantheon-optimize
|
|
46
|
-
/pantheon-optimize
|
|
47
|
-
/pantheon-optimize
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### `--dry-run` (global flag)
|
|
51
|
-
Prevents any destructive action. Shows what WOULD be done.
|
|
52
|
-
|
|
53
|
-
### Default mode (no flags)
|
|
54
|
-
Runs bloat scan on all `.md` and `.json` files + compression report.
|
|
55
|
-
|
|
56
|
-
## Output
|
|
57
|
-
|
|
23
|
+
/pantheon-optimize → Full inspection (preview only)
|
|
24
|
+
/pantheon-optimize --archive → Archive completed deepwork sessions
|
|
25
|
+
/pantheon-optimize --clean → Delete completed deepwork sessions
|
|
58
26
|
```
|
|
59
|
-
🧹 Pantheon Optimize Report
|
|
60
|
-
|
|
61
|
-
📦 Bloat Scan: 47 .md + 12 .json files
|
|
62
|
-
→ 3 oversized files found
|
|
63
|
-
→ ~2.4K tokens recoverable
|
|
64
27
|
|
|
65
|
-
|
|
66
|
-
→ 12 completed (REVIEW.md APPROVED)
|
|
67
|
-
→ 3 in progress (skipped)
|
|
68
|
-
→ Run with --archive --auto to archive 12 sessions
|
|
69
|
-
|
|
70
|
-
🗄️ Memory Cache: 24 files in memory-bank/
|
|
71
|
-
→ 18 already in MCP memory (dedup)
|
|
72
|
-
→ 6 candidates for migration (~3.2K tokens)
|
|
73
|
-
→ Run with --cache to migrate
|
|
28
|
+
## Modes
|
|
74
29
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
30
|
+
### Deepwork Optimization
|
|
31
|
+
Completed or inactive deepwork sessions in `.pantheon/deepwork/<slug>/` are identified by:
|
|
32
|
+
1. `REVIEW.md` containing "APPROVED" or "PASS".
|
|
33
|
+
2. `STATUS.md` marked "complete".
|
|
34
|
+
3. Inactivity exceeding the age threshold (default: 7 days).
|
|
35
|
+
|
|
36
|
+
### Output
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
Pantheon Optimizer — Workspace Inspection
|
|
40
|
+
Target: /path/to/project
|
|
41
|
+
Mode: dry-run (preview only)
|
|
42
|
+
────────────────────────────────────────────────────────────
|
|
43
|
+
Deepwork sessions: 5 total
|
|
44
|
+
Resolvable candidates (4):
|
|
45
|
+
- beta10-jev-uplift (inactive for >7 days)
|
|
46
|
+
- decision-layer-v2 (inactive for >7 days)
|
|
47
|
+
- opencode-v2-dual-migration (inactive for >7 days)
|
|
48
|
+
- v2-cycle (inactive for >7 days)
|
|
49
|
+
Active sessions kept (1):
|
|
50
|
+
- 2.0-jev-uplift (in-progress)
|
|
51
|
+
Stale backups: 0 candidates (>14 days, keeping 3 latest)
|
|
52
|
+
Stale logs: 0 candidates (>7 days)
|
|
53
|
+
────────────────────────────────────────────────────────────
|
|
54
|
+
[DRY-RUN] No changes made.
|
|
55
|
+
To archive resolved deepworks: pantheon-opencode optimize --apply
|
|
56
|
+
To permanently delete resolved deepworks: pantheon-opencode optimize --clean --apply
|
|
79
57
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pantheon-opencode",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Multi-agent orchestration for OpenCode \u2014 14 specialized agents, TDD, Themis review gates.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"workspaces": [
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"setup": "node scripts/setup.mjs",
|
|
21
21
|
"build:agents-md": "node scripts/build-agents-md.mjs",
|
|
22
22
|
"build:decision-router": "node scripts/build-decision-router.mjs",
|
|
23
|
+
"build:plugin": "node scripts/build-plugin.mjs",
|
|
23
24
|
"check:decision-router": "node scripts/build-decision-router.mjs --check",
|
|
24
25
|
"skills:lock": "node scripts/update-skills-lock.mjs",
|
|
25
26
|
"setup:lite": "node bin/pantheon-init.mjs init --yes --clean --components agents,skills,instructions",
|
|
@@ -28,8 +29,8 @@
|
|
|
28
29
|
"init": "node bin/pantheon-init.mjs init --yes",
|
|
29
30
|
"opencode": "OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true opencode",
|
|
30
31
|
"start": "OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true opencode",
|
|
31
|
-
"prepack": "npm run check:decision-router",
|
|
32
|
-
"prepublishOnly": "node scripts/validate-routing.mjs && npm run check:decision-router",
|
|
32
|
+
"prepack": "npm run build:plugin && npm run check:decision-router",
|
|
33
|
+
"prepublishOnly": "node scripts/validate-routing.mjs && npm run build:plugin && npm run check:decision-router",
|
|
33
34
|
"postpublish": "node -e \"console.log('\u2705 Published pantheon-opencode v' + require('./package.json').version + ' to npm')\"",
|
|
34
35
|
"version:status": "node scripts/versioning.mjs status",
|
|
35
36
|
"version:apply": "node scripts/versioning.mjs apply",
|
package/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pantheon",
|
|
3
3
|
"publisher": "ils15",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.1",
|
|
5
5
|
"displayName": "Pantheon",
|
|
6
6
|
"description": "Conductor-Delegate orchestration platform with 14 specialized agents, 25 skills, and OpenCode support.",
|
|
7
7
|
"agents": "./src/agents",
|
|
@@ -45,11 +45,11 @@ tools: ['search', 'usages']
|
|
|
45
45
|
- Replication lag (if applicable)
|
|
46
46
|
|
|
47
47
|
## Output
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
48
|
+
- Performance baseline
|
|
49
|
+
- Optimization recommendations
|
|
50
|
+
- Migration scripts
|
|
51
|
+
- Estimated performance gains
|
|
52
|
+
- Monitoring dashboard setup
|
|
53
53
|
|
|
54
54
|
## When to Use
|
|
55
55
|
- Query is slow
|
|
@@ -46,12 +46,12 @@ After plan, offer:
|
|
|
46
46
|
"Ready to execute with @zeus? I can coordinate all agents..."
|
|
47
47
|
|
|
48
48
|
## Output Format
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
49
|
+
- Requirements summary
|
|
50
|
+
- Codebase findings
|
|
51
|
+
- Comprehensive TDD plan
|
|
52
|
+
- Risk assessment
|
|
53
|
+
- Design decisions with rationale
|
|
54
|
+
- Ready for @zeus handoff
|
|
55
55
|
|
|
56
56
|
## When to Use
|
|
57
57
|
- Planning complex features (payment, auth, etc)
|
package/pyproject.toml
CHANGED
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.backends._legacy:_Backend"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pantheon"
|
|
7
|
-
version = "2.0.
|
|
7
|
+
version = "2.0.1"
|
|
8
8
|
description = "Multi-agent orchestration framework"
|
|
9
9
|
requires-python = ">=3.11"
|
|
10
10
|
# Python sources under src/mcp/ import fastmcp/pydantic at runtime, but those
|
|
@@ -138,18 +138,18 @@ Setup: [INSTALLATION.md](docs/INSTALLATION.md).
|
|
|
138
138
|
- Test: focused checks by default; \`npm test\` for CI/release or broad/high-risk changes
|
|
139
139
|
- Lint: \`npm run lint\`
|
|
140
140
|
|
|
141
|
-
##
|
|
141
|
+
## Global Installation Testing (Sandbox)
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
Validate global installation AS A REAL USER in the sandbox \`~/pantheon-sandbox/\` (outside the repo; with dedicated HOME, npm prefix, and venv); the dev environment is NOT suitable for packaging tests.
|
|
144
144
|
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
-
|
|
145
|
+
- Run: \`bash ~/pantheon-sandbox/run-test.sh\` (MCPs, doctor, TUI)
|
|
146
|
+
- Agent rule: validate global installation (npm pack, \`init\`, MCPs, hooks) in the sandbox — NEVER in the development environment
|
|
147
|
+
- Teardown: \`rm -rf ~/pantheon-sandbox\`
|
|
148
148
|
|
|
149
149
|
## Worktrees
|
|
150
150
|
|
|
151
|
-
-
|
|
152
|
-
-
|
|
151
|
+
- Never create worktrees inside the main project; use \`<project-parent>/.pantheon-worktrees/<repo-basename>/<task>\`.
|
|
152
|
+
- Worktrees do not live inside \`.pantheon/\`.
|
|
153
153
|
|
|
154
154
|
## Conventions
|
|
155
155
|
|
|
@@ -603,14 +603,14 @@ function main() {
|
|
|
603
603
|
}
|
|
604
604
|
if (stale.length > 0) {
|
|
605
605
|
console.error(
|
|
606
|
-
|
|
606
|
+
`[ERROR] ${stale.join(' and ')} ${
|
|
607
607
|
stale.length > 1 ? 'are' : 'is'
|
|
608
608
|
} stale — run: node scripts/build-agents-md.mjs`,
|
|
609
609
|
)
|
|
610
610
|
process.exit(1)
|
|
611
611
|
}
|
|
612
612
|
console.log(
|
|
613
|
-
|
|
613
|
+
`[OK] AGENTS.md and AGENTS.global.md are up to date (${sharedCount} shared instruction sections)`,
|
|
614
614
|
)
|
|
615
615
|
return
|
|
616
616
|
}
|
|
@@ -620,7 +620,7 @@ function main() {
|
|
|
620
620
|
verifyRegularFile(AGENTS_GLOBAL_MD_PATH, global)
|
|
621
621
|
verifyRegularFile(AGENTS_MD_PATH, project)
|
|
622
622
|
console.log(
|
|
623
|
-
|
|
623
|
+
`[OK] Generated AGENTS.md (${logicalLineCount(project)} lines) + AGENTS.global.md ` +
|
|
624
624
|
`(${logicalLineCount(global)} lines, ${sharedCount} shared instruction sections)`,
|
|
625
625
|
)
|
|
626
626
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* build-plugin.mjs — Bundles src/plugin.ts into src/plugin/index.js.
|
|
5
|
+
*
|
|
6
|
+
* Ensures OpenCode and Node.js can import the Pantheon plugin from node_modules
|
|
7
|
+
* without triggering ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING on Node 22+.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { dirname, join } from 'node:path'
|
|
11
|
+
import { fileURLToPath } from 'node:url'
|
|
12
|
+
import { buildSync } from 'esbuild'
|
|
13
|
+
|
|
14
|
+
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
15
|
+
const root = join(__dirname, '..')
|
|
16
|
+
|
|
17
|
+
buildSync({
|
|
18
|
+
entryPoints: [join(root, 'src', 'plugin.ts')],
|
|
19
|
+
outfile: join(root, 'src', 'plugin', 'index.js'),
|
|
20
|
+
bundle: true,
|
|
21
|
+
platform: 'node',
|
|
22
|
+
format: 'esm',
|
|
23
|
+
packages: 'external',
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
console.log('Built src/plugin/index.js via esbuild.')
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** OpenCode host gate shared by the CLI and installer. */
|
|
2
2
|
|
|
3
3
|
import { spawnSync } from 'node:child_process'
|
|
4
|
-
import { mkdtempSync, rmSync } from 'node:fs'
|
|
5
|
-
import { tmpdir } from 'node:os'
|
|
4
|
+
import { existsSync, mkdtempSync, rmSync } from 'node:fs'
|
|
5
|
+
import { homedir, tmpdir } from 'node:os'
|
|
6
6
|
import { join } from 'node:path'
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -202,6 +202,19 @@ function parseHostMajor(text) {
|
|
|
202
202
|
return { ambiguous: [...majors].sort((a, b) => a - b) }
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
function resolveCandidateBinary(explicitBinary, env) {
|
|
206
|
+
if (explicitBinary) return explicitBinary
|
|
207
|
+
if (env.OPENCODE_BIN) return env.OPENCODE_BIN
|
|
208
|
+
if (process.platform !== 'win32') {
|
|
209
|
+
const userHome = env.HOME || homedir()
|
|
210
|
+
const standardBin = join(userHome, '.opencode', 'bin', 'opencode')
|
|
211
|
+
if (existsSync(standardBin)) {
|
|
212
|
+
return standardBin
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return 'opencode'
|
|
216
|
+
}
|
|
217
|
+
|
|
205
218
|
/**
|
|
206
219
|
* Resolve the target OpenCode generation. There is exactly one, and the probe
|
|
207
220
|
* must CONFIRM the host is 2.x before any write: there is no generation to fall
|
|
@@ -237,11 +250,10 @@ export function resolveOpenCodeVersion(options = {}) {
|
|
|
237
250
|
`Invalid OPENCODE_VERSION "${env.OPENCODE_VERSION}" — only "${SUPPORTED_GENERATION}" can be pinned`,
|
|
238
251
|
)
|
|
239
252
|
}
|
|
240
|
-
const binary = options.binary
|
|
253
|
+
const binary = resolveCandidateBinary(options.binary, env)
|
|
241
254
|
if (/(?:^|[\\/])opencode2(?:\.exe)?$/i.test(binary)) return SUPPORTED_GENERATION
|
|
242
255
|
|
|
243
|
-
const probe =
|
|
244
|
-
options.probe ?? (() => probeHostVersion(binary || 'opencode', options.probeTimeoutMs))
|
|
256
|
+
const probe = options.probe ?? (() => probeHostVersion(binary, options.probeTimeoutMs))
|
|
245
257
|
let raw
|
|
246
258
|
try {
|
|
247
259
|
raw = probe()
|
|
@@ -2587,10 +2587,17 @@ async function installPass(
|
|
|
2587
2587
|
let healed = raw.replace(/,?\s*"source":\s*"agents\/[A-Za-z0-9_-]+\.md"/g, '')
|
|
2588
2588
|
// A source-first entry leaves `"name": {,` — repair the orphan.
|
|
2589
2589
|
healed = healed.replace(/("[A-Za-z0-9_-]+": \{),/g, '$1')
|
|
2590
|
+
if (healed.includes('"plugins":') && !healed.includes('pantheon-opencode')) {
|
|
2591
|
+
const pluginPkg = join(packageDir, 'src', 'plugin')
|
|
2592
|
+
healed = healed.replace(
|
|
2593
|
+
/"plugins":\s*\[/,
|
|
2594
|
+
`"plugins": [\n {\n "package": "${pluginPkg}",\n "options": {}\n },`,
|
|
2595
|
+
)
|
|
2596
|
+
}
|
|
2590
2597
|
if (healed !== raw) {
|
|
2591
2598
|
writeFileSync(jsoncPath, healed)
|
|
2592
2599
|
warning(
|
|
2593
|
-
'Healed the sibling opencode.jsonc: removed stale cwd-relative agent "source" fields ' +
|
|
2600
|
+
'Healed the sibling opencode.jsonc: synchronized plugins and removed stale cwd-relative agent "source" fields ' +
|
|
2594
2601
|
'(the field that made agents vanish outside the config dir). Review the file if you hand-edit it.',
|
|
2595
2602
|
)
|
|
2596
2603
|
}
|