pantheon-opencode 1.6.0-beta.1 → 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 (120) hide show
  1. package/AGENTS.global.md +182 -0
  2. package/AGENTS.md +10 -891
  3. package/CHANGELOG.md +326 -0
  4. package/README.md +496 -32
  5. package/README.pt-BR.md +285 -20
  6. package/bin/pantheon-init.mjs +26 -3
  7. package/commands/pantheon-audit.md +7 -1
  8. package/commands/pantheon-consolidate.md +1 -1
  9. package/commands/pantheon-deepwork.md +14 -3
  10. package/commands/pantheon-focus.md +17 -0
  11. package/commands/pantheon-vision.md +61 -12
  12. package/package.json +21 -14
  13. package/plugin.json +2 -2
  14. package/pyproject.toml +8 -6
  15. package/scripts/build-agents-md.mjs +374 -56
  16. package/scripts/changelog-merge.mjs +161 -0
  17. package/scripts/{code_mode_server.py → code_mode.py} +3 -3
  18. package/scripts/cost.mjs +244 -41
  19. package/scripts/doctor.mjs +151 -1
  20. package/scripts/install/agents-md.mjs +4 -4
  21. package/scripts/install/config-migration.mjs +317 -4
  22. package/scripts/install/health-check.mjs +21 -19
  23. package/scripts/install/interactive.mjs +1 -1
  24. package/scripts/install/opencode-version.mjs +246 -4
  25. package/scripts/install/opencode.mjs +627 -179
  26. package/scripts/install/plugin.mjs +43 -9
  27. package/scripts/install/shared.mjs +120 -12
  28. package/scripts/install/vision-prompt.mjs +161 -0
  29. package/scripts/install-mcp.mjs +28 -9
  30. package/scripts/{mcp_persistence_server.py → mcp_persistence.py} +2 -2
  31. package/{src/mcp/mcp_resources_server.py → scripts/mcp_resources.py} +2 -2
  32. package/scripts/{memory_mcp_server.py → memory_mcp.py} +2 -2
  33. package/scripts/probe-context-rehydrate.mjs +8 -2
  34. package/scripts/probe-pantheon-cost.mjs +71 -15
  35. package/scripts/run-node-tests.mjs +189 -0
  36. package/scripts/sync-artifacts.mjs +26 -13
  37. package/scripts/sync-tui.mjs +24 -3
  38. package/scripts/test-opencode-v2-sandbox.sh +180 -26
  39. package/scripts/validate-routing.mjs +3 -3
  40. package/scripts/validate-sandbox-install.mjs +138 -0
  41. package/scripts/versioning.mjs +13 -1
  42. package/scripts/vision-status.mjs +682 -0
  43. package/skills-lock.json +8 -8
  44. package/src/agents/aphrodite.md +20 -37
  45. package/src/agents/apollo.md +7 -3
  46. package/src/agents/athena.md +63 -35
  47. package/src/agents/demeter.md +8 -28
  48. package/src/agents/gaia.md +1 -1
  49. package/src/agents/hephaestus.md +10 -21
  50. package/src/agents/hermes.md +15 -38
  51. package/src/agents/iris.md +1 -1
  52. package/src/agents/mnemosyne.md +18 -54
  53. package/src/agents/nyx.md +1 -1
  54. package/src/agents/prometheus.md +16 -20
  55. package/src/agents/talos.md +10 -2
  56. package/src/agents/themis.md +5 -5
  57. package/src/agents/zeus.md +99 -129
  58. package/src/instructions/agent-return-format.instructions.md +18 -3
  59. package/src/instructions/backend-standards.instructions.md +2 -0
  60. package/src/instructions/frontend-standards.instructions.md +3 -1
  61. package/src/instructions/memory-protocol.instructions.md +11 -110
  62. package/src/instructions/zeus-anti-stall.instructions.md +14 -61
  63. package/src/instructions/zeus-communication-rules.instructions.md +0 -1
  64. package/src/instructions/zeus-council-synthesis.instructions.md +32 -260
  65. package/src/instructions/zeus-memory-operations.instructions.md +26 -0
  66. package/src/instructions/zeus-timeout-retry.instructions.md +40 -87
  67. package/src/mcp/{code_mode_server.py → code_mode.py} +3 -3
  68. package/src/mcp/eval_store.py +2 -2
  69. package/src/mcp/{mcp_persistence_server.py → mcp_persistence.py} +2 -2
  70. package/{scripts/mcp_resources_server.py → src/mcp/mcp_resources.py} +2 -2
  71. package/src/mcp/{memory_mcp_server.py → memory_mcp.py} +2 -2
  72. package/src/mcp/{pantheon_vision_server.py → pantheon_vision.py} +286 -42
  73. package/src/mcp/requirements-mcp.txt +6 -4
  74. package/src/mcp/requirements-vision.txt +2 -2
  75. package/src/pantheon/cost-command.ts +399 -101
  76. package/src/pantheon/delegation-enforce.ts +10 -1
  77. package/src/pantheon/presets.d.mts +0 -8
  78. package/src/pantheon/presets.mjs +5 -32
  79. package/src/pantheon/v2-bounded-read.ts +640 -0
  80. package/src/pantheon/v2-delegation-enforce.ts +214 -0
  81. package/src/pantheon/v2-execute-after.ts +186 -0
  82. package/src/pantheon/v2-tools.ts +429 -0
  83. package/src/pantheon/v2-unsupported.d.mts +11 -0
  84. package/src/pantheon/v2-unsupported.mjs +90 -0
  85. package/src/pantheon/v2-vision.ts +622 -0
  86. package/src/pantheon/vision-local.ts +531 -0
  87. package/src/pantheon/vision.ts +1160 -115
  88. package/src/plugin-v2.ts +1145 -219
  89. package/src/plugin.ts +12 -9
  90. package/src/plugins/tui/dist/server.d.ts +1 -2
  91. package/src/plugins/tui/dist/server.d.ts.map +1 -1
  92. package/src/plugins/tui/dist/tui-v2.d.ts +154 -0
  93. package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -0
  94. package/src/plugins/tui/dist/tui-v2.js +659 -0
  95. package/src/plugins/tui/dist/tui-v2.js.map +1 -0
  96. package/src/plugins/tui/dist/tui.d.ts +85 -82
  97. package/src/plugins/tui/dist/tui.d.ts.map +1 -1
  98. package/src/plugins/tui/dist/tui.js +72 -59
  99. package/src/plugins/tui/index-v2.ts +6 -0
  100. package/src/plugins/tui/package-lock.json +5516 -1353
  101. package/src/plugins/tui/package.json +22 -12
  102. package/src/plugins/tui/src/index-v2.tsx +734 -0
  103. package/src/plugins/tui/src/index.tsx +106 -85
  104. package/src/plugins/tui/src/opencode-v2.d.ts +13 -0
  105. package/src/plugins/tui/tsconfig.build.json +5 -0
  106. package/src/plugins/tui/tsconfig.typecheck.json +5 -0
  107. package/src/plugins/tui/tsdown.config.ts +22 -2
  108. package/src/plugins/tui/tui-v2.ts +2 -0
  109. package/src/plugins/tui/tui.ts +3 -0
  110. package/src/routing.yml +11 -21
  111. package/src/skills/README.md +3 -3
  112. package/src/skills/agent-coordination/SKILL.md +7 -2
  113. package/src/skills/artifact-management/SKILL.md +12 -5
  114. package/src/skills/auto-continue/SKILL.md +39 -30
  115. package/src/skills/code-review-checklist/SKILL.md +5 -5
  116. package/src/skills/context-compression/SKILL.md +26 -879
  117. package/src/skills/session-goal/SKILL.md +14 -5
  118. package/src/skills/spec-driven-development/SKILL.md +3 -1
  119. package/src/skills/tdd-with-agents/SKILL.md +18 -10
  120. package/opencode.json +0 -58
@@ -14,10 +14,10 @@ Use this skill to pin a session objective at the start of a long or complex sess
14
14
 
15
15
  ## Usage
16
16
 
17
- Invoke via the `/focus` command:
17
+ Invoke via the `/pantheon-focus` command (a conversation-only goal anchor):
18
18
 
19
19
  ```
20
- /focus Implement JWT authentication with refresh token rotation
20
+ /pantheon-focus Implement JWT authentication with refresh token rotation
21
21
  ```
22
22
 
23
23
  Or state it explicitly at the start of a session:
@@ -70,9 +70,18 @@ Before each major delegation or decision, run this quick check:
70
70
 
71
71
  ---
72
72
 
73
- ## Cross-Session Persistence
73
+ ## Cross-Session Continuity
74
74
 
75
- For goals that span multiple sessions, write the goal to `/memories/session/`:
75
+ V2 does not provide durable goal tools. `/pantheon-focus` only anchors the current
76
+ conversation and must not be described as surviving compaction or a new
77
+ session. For multi-phase work that needs persistent checkpoints, use
78
+ `/pantheon-deepwork`; otherwise ask before writing a goal to a project file.
79
+
80
+ In V1, use the implemented goal tools when they are available and explicitly
81
+ authorized. Do not infer that their presence in one host generation means they
82
+ exist in V2.
83
+
84
+ Historical path example (not a V2 runtime command):
76
85
 
77
86
  ```
78
87
  /memories/session/current-goal.md
@@ -84,7 +93,7 @@ Status: Phase 2 of 3 (backend done, frontend in progress)
84
93
  Next: POST /auth/refresh endpoint
85
94
  ```
86
95
 
87
- This ensures the goal survives context compaction and session restarts.
96
+ This file-based approach requires explicit authorization and is not automatic.
88
97
 
89
98
  ---
90
99
 
@@ -12,7 +12,9 @@ description: "Define requirements via spec-first before any code — PRD, edge c
12
12
  2. **PRD** — Escreva um documento de requisitos: objetivo, personas, fluxos, regras de negócio, critérios de aceitação
13
13
  3. **Edge Cases** — Mapeie entradas inválidas, concorrência, falhas de API, estados vazios
14
14
  4. **Technical Spec** — Decisões de arquitetura: componentes, dados, API contracts, deploy
15
- 5. **Approval** — Apresente ao usuário antes de codar. "É isso mesmo?"
15
+ 5. **Approval** — Apresente o plano completo ao usuário antes de codar. Se o
16
+ planejamento veio de um subagente, devolva o plano integral ao orquestrador
17
+ para que ele o exiba na conversa principal antes de pedir aprovação.
16
18
 
17
19
  ## Anti-patterns
18
20
  - ❌ Pular direto pra implementação
@@ -8,13 +8,21 @@ alwaysApply: false
8
8
 
9
9
  # TDD with Agents
10
10
 
11
- Enforce RED → GREEN → REFACTOR cycle across all implementation agents. Includes advanced testing patterns for E2E, load, mutation, and contract testing.
11
+ Use RED → GREEN → REFACTOR for behavior-changing implementation where a meaningful test can express the change. Keep verification proportional to the changed surface and risk; advanced testing patterns are reserved for changes that warrant them.
12
12
 
13
13
  ---
14
14
 
15
15
  ## Core Principle
16
16
 
17
- > **Write the test FIRST. Watch it fail. Write minimal code to pass. Refactor with confidence.**
17
+ > **For testable behavior changes, write the focused test first, observe RED, implement minimally, then refactor.**
18
+
19
+ ## Proportional TDD
20
+
21
+ - Use the complete RED → GREEN → REFACTOR cycle for new or changed behavior when a focused test is practical. Include a focused regression check for bug fixes.
22
+ - For typo, formatting, documentation-only, or otherwise non-behavioral edits, do not invent a test; inspect the diff and run the narrowest relevant validation.
23
+ - Run targeted tests for a small change. Run broader suites when the changed surface, integration boundaries, or risk make them useful; do not run the whole suite solely because one line changed.
24
+ - If a relevant existing test already captures the behavior, use it instead of adding a duplicate. If no automated check can express the change, report the manual or static verification performed.
25
+ - Auth, security, payment, data-integrity, and schema/migration changes retain focused RED/GREEN tests, required regression coverage, and Themis review. Do not weaken a project-specific required safety gate.
18
26
 
19
27
  ---
20
28
 
@@ -112,12 +120,12 @@ def test_provider_satisfies_consumer_contract():
112
120
  pass
113
121
  ```
114
122
 
115
- ### Mutation Testing
123
+ ### Mutation Testing (high-risk/critical logic only)
116
124
  - Mutate source code (change `>` to `<`, remove conditions)
117
125
  - Run tests → should fail (mutation killed)
118
126
  - If tests pass → test is weak; improve it
119
127
 
120
- ### Visual Regression
128
+ ### Visual Regression (visual behavior only)
121
129
  ```typescript
122
130
  test('homepage looks the same', async ({ page }) => {
123
131
  await page.goto('/')
@@ -129,8 +137,8 @@ test('homepage looks the same', async ({ page }) => {
129
137
 
130
138
  ## Coverage Rules
131
139
 
132
- - **Minimum: 80%** for all code
133
- - **Critical paths: 100%** (auth, payments, data integrity)
140
+ - Follow a repository's explicit coverage threshold when the changed code is in its measurement scope; do not manufacture a coverage target for docs, formatting, or a tiny isolated edit.
141
+ - **Critical paths:** preserve project-required coverage and tests for auth, payments, and data integrity.
134
142
  - **No snapshot testing** — test behavior, not output shape
135
143
  - **Test edge cases**: empty input, null, boundary values, errors
136
144
 
@@ -143,20 +151,20 @@ test('homepage looks the same', async ({ page }) => {
143
151
  | **Hermes** | Unit + integration for FastAPI endpoints, services, middleware |
144
152
  | **Aphrodite** | Component behavior tests with React Testing Library |
145
153
  | **Demeter** | Migration upgrade/downgrade, query correctness |
146
- | **Themis** | Verifies coverage ≥80%, edge cases tested, error conditions |
154
+ | **Themis** | Reviews the changed surface, relevant edge/error cases, and applicable repository coverage requirements; always review sensitive/material changes |
147
155
 
148
156
  ---
149
157
 
150
158
  ## Workflow
151
159
 
152
160
  ```
153
- 1. Zeus/Athena defines feature with testable acceptance criteria
161
+ 1. Use a plan/spec only when scope, risk, or ambiguity warrants it; a bounded fix may proceed directly
154
162
  2. Hermes writes failing test (RED)
155
163
  3. Hermes implements minimal code (GREEN)
156
164
  4. Hermes refactors (REFACTOR)
157
165
  5. Aphrodite writes frontend tests in parallel
158
- 6. Themis reviews: coverage, edge cases, correctness
159
- 7. If coverage <80% → NEEDS_REVISION
166
+ 6. Themis reviews sensitive or material changes, checking changed behavior and applicable quality gates
167
+ 7. Escalate unmet repository or safety-critical test requirements; do not fail a micro-edit against an unrelated global coverage figure
160
168
  ```
161
169
 
162
170
  ---
package/opencode.json DELETED
@@ -1,58 +0,0 @@
1
- {
2
- "$schema": "https://opencode.ai/config.json",
3
- "provider": {
4
- "opencode-go": {
5
- "models": {
6
- "mimo-v2.5": {
7
- "attachment": true,
8
- "modalities": { "input": ["text", "image"] }
9
- }
10
- }
11
- }
12
- },
13
- "default_agent": "zeus",
14
- "plugins": ["src/plugin-v2"],
15
- "experimental": {
16
- "subagent_depth": 2
17
- },
18
- "permission": {
19
- "skill": {
20
- "*": "allow"
21
- },
22
- "websearch": "deny",
23
- "bash": {
24
- "git *": "allow",
25
- "npm *": "allow",
26
- "npx *": "allow",
27
- "pytest *": "allow",
28
- "ruff *": "allow",
29
- "pip *": "allow",
30
- "python3 *": "allow"
31
- }
32
- },
33
- "mcp": {
34
- "bifrost": {
35
- "type": "remote",
36
- "url": "https://llm.ofertachina.cloud/mcp",
37
- "enabled": true
38
- }
39
- },
40
- "agent": {
41
- "talos": {
42
- "permission": {
43
- "edit": {
44
- "*": "allow",
45
- "**/migrations/**": "deny",
46
- "**/alembic/**": "deny",
47
- "**/models/**": "deny",
48
- "**/auth/**": "deny",
49
- "**/*.sql": "deny"
50
- },
51
- "bash": {
52
- "*": "allow",
53
- "alembic *": "deny"
54
- }
55
- }
56
- }
57
- }
58
- }