pantheon-opencode 1.6.1 → 1.6.2-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.
- package/AGENTS.global.md +11 -11
- package/AGENTS.md +2 -2
- package/CHANGELOG.md +16 -0
- package/README.md +91 -19
- package/README.pt-BR.md +14 -9
- package/bin/pantheon-init.mjs +106 -19
- package/package.json +3 -2
- package/plugin.json +1 -1
- package/pyproject.toml +1 -1
- package/scripts/build-agents-md.mjs +1 -1
- package/scripts/doctor.mjs +213 -45
- package/scripts/install/agents-md.mjs +2 -1
- package/scripts/install/config-migration.mjs +344 -393
- package/scripts/install/config-paths.mjs +15 -0
- package/scripts/install/mcp-permissions.mjs +164 -0
- package/scripts/install/opencode-version.mjs +31 -13
- package/scripts/install/opencode-wildcard.mjs +106 -0
- package/scripts/install/opencode.mjs +240 -69
- package/scripts/install/plan-artifact.mjs +12 -1
- package/scripts/install/plugin.mjs +17 -1
- package/scripts/install/v2-capabilities.mjs +5 -6
- package/scripts/package-evidence.mjs +1 -0
- package/scripts/sandbox-env.sh +174 -0
- package/scripts/setup-v2-config.mjs +1703 -0
- package/scripts/setup.mjs +415 -0
- package/scripts/sync-tui.mjs +9 -1
- package/scripts/test-opencode-v2-sandbox.sh +438 -151
- package/scripts/update-skills-lock.mjs +30 -0
- package/skills-lock.json +10 -10
- package/src/agents/aphrodite.md +5 -2
- package/src/agents/apollo.md +5 -0
- package/src/agents/athena.md +6 -1
- package/src/agents/demeter.md +5 -1
- package/src/agents/gaia.md +4 -0
- package/src/agents/hephaestus.md +6 -1
- package/src/agents/hermes.md +6 -3
- package/src/agents/iris.md +5 -1
- package/src/agents/mnemosyne.md +20 -50
- package/src/agents/nyx.md +5 -1
- package/src/agents/prometheus.md +4 -0
- package/src/agents/talos.md +4 -0
- package/src/agents/themis.md +4 -0
- package/src/agents/zeus.md +9 -3
- package/src/instructions/agent-return-format.instructions.md +1 -1
- package/src/instructions/memory-protocol.instructions.md +3 -3
- package/src/instructions/test-economy.instructions.md +6 -6
- package/src/mcp/pantheon_vision.py +37 -36
- package/src/pantheon/v2-vision.ts +34 -29
- package/src/pantheon/vision.ts +43 -10
- package/src/plugin-v2.ts +30 -53
- package/src/plugins/tui/dist/quota-adapters.d.ts +89 -0
- package/src/plugins/tui/dist/quota-adapters.d.ts.map +1 -0
- package/src/plugins/tui/dist/quota-adapters.js +1142 -0
- package/src/plugins/tui/dist/quota-adapters.js.map +1 -0
- package/src/plugins/tui/dist/quota-cli.d.ts +17 -0
- package/src/plugins/tui/dist/quota-cli.d.ts.map +1 -0
- package/src/plugins/tui/dist/quota-cli.js +184 -0
- package/src/plugins/tui/dist/quota-cli.js.map +1 -0
- package/src/plugins/tui/dist/quota-rpc-UL2HuFRJ.js +390 -0
- package/src/plugins/tui/dist/quota-rpc-UL2HuFRJ.js.map +1 -0
- package/src/plugins/tui/dist/server-v2.d.ts +14 -0
- package/src/plugins/tui/dist/server-v2.d.ts.map +1 -0
- package/src/plugins/tui/dist/server-v2.js +673 -0
- package/src/plugins/tui/dist/server-v2.js.map +1 -0
- package/src/plugins/tui/dist/tui-v2.d.ts +247 -52
- package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui-v2.js +2492 -529
- package/src/plugins/tui/dist/tui-v2.js.map +1 -1
- package/src/plugins/tui/dist/tui.js +1 -1
- package/src/plugins/tui/index-v2.ts +3 -6
- package/src/plugins/tui/package-lock.json +2 -2
- package/src/plugins/tui/package.json +3 -2
- package/src/plugins/tui/src/context-gauge.ts +59 -0
- package/src/plugins/tui/src/go-key-diagnostic-ui.ts +100 -0
- package/src/plugins/tui/src/go-key-diagnostic.ts +125 -0
- package/src/plugins/tui/src/index-v2.tsx +199 -240
- package/src/plugins/tui/src/model-usage-limits.ts +4 -0
- package/src/plugins/tui/src/quota-adapters.ts +1598 -0
- package/src/plugins/tui/src/quota-cli.ts +237 -0
- package/src/plugins/tui/src/quota-rpc.ts +209 -0
- package/src/plugins/tui/src/quota-v2-model.ts +1032 -0
- package/src/plugins/tui/src/quota-v2.tsx +986 -0
- package/src/plugins/tui/src/server-v2.ts +841 -0
- package/src/plugins/tui/src/sidebar-width.ts +129 -0
- package/src/plugins/tui/tsconfig.typecheck.json +1 -1
- package/src/plugins/tui/tsdown.config.ts +8 -1
- package/src/routing.yml +72 -13
- package/src/skills/README.md +4 -0
- package/src/skills/agent-coordination/SKILL.md +0 -3
- package/src/skills/artifact-management/SKILL.md +0 -3
- package/src/skills/auto-continue/SKILL.md +0 -3
- package/src/skills/code-review-checklist/SKILL.md +0 -3
- package/src/skills/context-compression/SKILL.md +0 -3
- package/src/skills/memory-bank/SKILL.md +6 -28
- package/src/skills/session-goal/SKILL.md +0 -3
- package/src/skills/simplify/SKILL.md +5 -4
- package/src/skills/tdd-with-agents/SKILL.md +0 -3
- package/src/skills/visual-review-pipeline/SKILL.md +0 -1
- package/src/pantheon/memory-context.ts +0 -1017
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { createHash } from 'node:crypto'
|
|
4
|
+
import { existsSync, readdirSync, readFileSync, writeFileSync } from 'node:fs'
|
|
5
|
+
import { join, relative } from 'node:path'
|
|
6
|
+
import { fileURLToPath } from 'node:url'
|
|
7
|
+
|
|
8
|
+
const ROOT = join(fileURLToPath(new URL('.', import.meta.url)), '..')
|
|
9
|
+
const SKILLS_DIR = join(ROOT, 'src', 'skills')
|
|
10
|
+
const LOCK_PATH = join(ROOT, 'skills-lock.json')
|
|
11
|
+
|
|
12
|
+
/** Rebuild the sorted SHA-256 inventory for every canonical skill file. */
|
|
13
|
+
function updateSkillsLock() {
|
|
14
|
+
const skillFiles = readdirSync(SKILLS_DIR, { withFileTypes: true })
|
|
15
|
+
.filter((entry) => entry.isDirectory())
|
|
16
|
+
.map((entry) => join(SKILLS_DIR, entry.name, 'SKILL.md'))
|
|
17
|
+
.filter((path) => existsSync(path))
|
|
18
|
+
.sort()
|
|
19
|
+
|
|
20
|
+
const lock = Object.fromEntries(
|
|
21
|
+
skillFiles.map((path) => [
|
|
22
|
+
relative(ROOT, path).split('\\').join('/'),
|
|
23
|
+
createHash('sha256').update(readFileSync(path)).digest('hex'),
|
|
24
|
+
]),
|
|
25
|
+
)
|
|
26
|
+
writeFileSync(LOCK_PATH, `${JSON.stringify(lock, null, 2)}\n`)
|
|
27
|
+
process.stdout.write(`Updated ${Object.keys(lock).length} skill digests in skills-lock.json\n`)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
updateSkillsLock()
|
package/skills-lock.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
"src/skills/agent-coordination/SKILL.md": "
|
|
3
|
-
"src/skills/artifact-management/SKILL.md": "
|
|
4
|
-
"src/skills/auto-continue/SKILL.md": "
|
|
2
|
+
"src/skills/agent-coordination/SKILL.md": "ffa4cfc9c778dd9619665010de32d82d49ae5bb803c985dc99417eb6fc7c3d1c",
|
|
3
|
+
"src/skills/artifact-management/SKILL.md": "55446fbd0e13f9097d091b9773c37910409b70e26df5781bde8d903ff89a07fd",
|
|
4
|
+
"src/skills/auto-continue/SKILL.md": "090f61bfa1a394f5146e838c63e7e9d58f47a1f49bc84927e5cdfc07eaa4cc33",
|
|
5
5
|
"src/skills/clonedeps/SKILL.md": "3e0b43cf96da98c83699dc48db3fd58fbfda84b9022bb70d3747875c81c3e124",
|
|
6
|
-
"src/skills/code-review-checklist/SKILL.md": "
|
|
6
|
+
"src/skills/code-review-checklist/SKILL.md": "cbaffb89045e1bbb7c3c905248f953ec3faa2c1d4679bcd5320df99798df2f98",
|
|
7
7
|
"src/skills/codemap/SKILL.md": "d21b3fa66b931b29dcf1ec0f0fcf1ec28514642a9f33f96e4b2901a0be74c72d",
|
|
8
|
-
"src/skills/context-compression/SKILL.md": "
|
|
8
|
+
"src/skills/context-compression/SKILL.md": "4d8368309ec72fefac69ad5cddd43650647d0bc684b6f8bf3cacc004edb56ef5",
|
|
9
9
|
"src/skills/git-workflow-and-versioning/SKILL.md": "685a94041f1b4ce2a430301f517b89102055696267c369a7e8fb191606659276",
|
|
10
10
|
"src/skills/incremental-implementation/SKILL.md": "7065ddb45da3c6b6751de07f290e92e6cb072e949a2e3aaae13ee7762f0a70fc",
|
|
11
11
|
"src/skills/loop-engineering/SKILL.md": "f804e545821b9cca8fe0ec517307ed902446f28c2ca8ff9194c0f987cf7229e3",
|
|
12
|
-
"src/skills/memory-bank/SKILL.md": "
|
|
12
|
+
"src/skills/memory-bank/SKILL.md": "6c27623e5588b7ba44fbd0ea88e5061ed36894e1c7cbc88e50f003c2b463d9ff",
|
|
13
13
|
"src/skills/reflect/SKILL.md": "4c7608c2a55cb8a50ac90fc0e2446bdf25e7914b1748cb7731c311d13c29dfdd",
|
|
14
14
|
"src/skills/security-hardening/SKILL.md": "6d637e122421f7bc3b751f04854ad343a5a5d35249458bc8939233138fd3f20d",
|
|
15
|
-
"src/skills/session-goal/SKILL.md": "
|
|
16
|
-
"src/skills/simplify/SKILL.md": "
|
|
15
|
+
"src/skills/session-goal/SKILL.md": "2911157c8e020f62ca015a73a46f5427f41da71c83e624d6a1cecf7d64c64aea",
|
|
16
|
+
"src/skills/simplify/SKILL.md": "1f3c06f4f856cbc8cdefcfe7fd260ad7382a441d8d9d9162671b17dc33aa6edd",
|
|
17
17
|
"src/skills/spec-driven-development/SKILL.md": "ccfbc0c32116a1d144f5c12a4187c053322ed31625a622a58c59739a57a86743",
|
|
18
|
-
"src/skills/tdd-with-agents/SKILL.md": "
|
|
18
|
+
"src/skills/tdd-with-agents/SKILL.md": "be976bced6934233ed04778e84e939a5bd4e18805984c1d7c25852690060b34e",
|
|
19
19
|
"src/skills/verification-planning/SKILL.md": "14186446ef51e1ba2c87b337e8d5f86e566d805156ab21fba2a75f8c4a99df3f",
|
|
20
|
-
"src/skills/visual-review-pipeline/SKILL.md": "
|
|
20
|
+
"src/skills/visual-review-pipeline/SKILL.md": "a630b4f2a5e7ba8df55993684f6c33c615b27b50e8c11ec256bed641c31a9253",
|
|
21
21
|
"src/skills/worktrees/SKILL.md": "9cf2b036e90d9ff7c6deb786ad7bab2cb78d6bf39166a67d5cbeafc29f593c6e"
|
|
22
22
|
}
|
package/src/agents/aphrodite.md
CHANGED
|
@@ -16,10 +16,13 @@ permission:
|
|
|
16
16
|
"*": deny
|
|
17
17
|
temperature: 0.3
|
|
18
18
|
skills:
|
|
19
|
+
- incremental-implementation
|
|
20
|
+
- loop-engineering
|
|
21
|
+
- reflect
|
|
22
|
+
- simplify
|
|
19
23
|
- tdd-with-agents
|
|
20
24
|
- visual-review-pipeline
|
|
21
|
-
-
|
|
22
|
-
- incremental-implementation
|
|
25
|
+
- worktrees
|
|
23
26
|
mcp_tools:
|
|
24
27
|
pantheon-resources: all
|
|
25
28
|
pantheon-memory: [memory_search]
|
package/src/agents/apollo.md
CHANGED
package/src/agents/athena.md
CHANGED
|
@@ -10,8 +10,13 @@ mcp_tools:
|
|
|
10
10
|
pantheon-resources: all
|
|
11
11
|
pantheon-memory: [memory_search, code_query, code_neighbors]
|
|
12
12
|
skills:
|
|
13
|
-
-
|
|
13
|
+
- loop-engineering
|
|
14
14
|
- memory-bank
|
|
15
|
+
- reflect
|
|
16
|
+
- simplify
|
|
17
|
+
- spec-driven-development
|
|
18
|
+
- verification-planning
|
|
19
|
+
- worktrees
|
|
15
20
|
permission:
|
|
16
21
|
edit: deny
|
|
17
22
|
hashline_edit: deny
|
package/src/agents/demeter.md
CHANGED
|
@@ -13,8 +13,12 @@ permission:
|
|
|
13
13
|
"*": deny
|
|
14
14
|
temperature: 0.2
|
|
15
15
|
skills:
|
|
16
|
-
- tdd-with-agents
|
|
17
16
|
- incremental-implementation
|
|
17
|
+
- loop-engineering
|
|
18
|
+
- reflect
|
|
19
|
+
- simplify
|
|
20
|
+
- tdd-with-agents
|
|
21
|
+
- worktrees
|
|
18
22
|
mcp_tools:
|
|
19
23
|
pantheon-resources: all
|
|
20
24
|
pantheon-memory: [memory_search]
|
package/src/agents/gaia.md
CHANGED
package/src/agents/hephaestus.md
CHANGED
|
@@ -13,8 +13,13 @@ permission:
|
|
|
13
13
|
"*": deny
|
|
14
14
|
temperature: 0.3
|
|
15
15
|
skills:
|
|
16
|
-
- tdd-with-agents
|
|
17
16
|
- auto-continue
|
|
17
|
+
- clonedeps
|
|
18
|
+
- loop-engineering
|
|
19
|
+
- reflect
|
|
20
|
+
- simplify
|
|
21
|
+
- tdd-with-agents
|
|
22
|
+
- worktrees
|
|
18
23
|
mcp_tools:
|
|
19
24
|
pantheon-resources: all
|
|
20
25
|
pantheon-memory: [memory_search]
|
package/src/agents/hermes.md
CHANGED
|
@@ -12,11 +12,14 @@ mcp_tools:
|
|
|
12
12
|
pantheon-code-mode: [execute_code_script]
|
|
13
13
|
temperature: 0.3
|
|
14
14
|
skills:
|
|
15
|
-
-
|
|
16
|
-
- file-prompts
|
|
17
|
-
- streaming-patterns
|
|
15
|
+
- clonedeps
|
|
18
16
|
- git-workflow-and-versioning
|
|
19
17
|
- incremental-implementation
|
|
18
|
+
- loop-engineering
|
|
19
|
+
- reflect
|
|
20
|
+
- simplify
|
|
21
|
+
- tdd-with-agents
|
|
22
|
+
- worktrees
|
|
20
23
|
permission:
|
|
21
24
|
bash: allow
|
|
22
25
|
read: allow
|
package/src/agents/iris.md
CHANGED
|
@@ -16,8 +16,12 @@ permission:
|
|
|
16
16
|
"*": deny
|
|
17
17
|
temperature: 0.2
|
|
18
18
|
skills:
|
|
19
|
-
- git-workflow-and-versioning
|
|
20
19
|
- artifact-management
|
|
20
|
+
- git-workflow-and-versioning
|
|
21
|
+
- loop-engineering
|
|
22
|
+
- reflect
|
|
23
|
+
- simplify
|
|
24
|
+
- worktrees
|
|
21
25
|
mcp_tools:
|
|
22
26
|
pantheon-resources: all
|
|
23
27
|
pantheon-memory: [memory_recall]
|
package/src/agents/mnemosyne.md
CHANGED
|
@@ -18,9 +18,13 @@ mcp_tools:
|
|
|
18
18
|
pantheon-code-mode: [execute_code_script]
|
|
19
19
|
skills:
|
|
20
20
|
- artifact-management
|
|
21
|
-
- memory-bank
|
|
22
21
|
- context-compression
|
|
22
|
+
- loop-engineering
|
|
23
|
+
- memory-bank
|
|
24
|
+
- reflect
|
|
23
25
|
- session-goal
|
|
26
|
+
- simplify
|
|
27
|
+
- worktrees
|
|
24
28
|
permission:
|
|
25
29
|
bash: deny
|
|
26
30
|
read: allow
|
|
@@ -73,52 +77,16 @@ If asked to edit code, refuse and redirect to the appropriate implementation age
|
|
|
73
77
|
## TOOLS NOT AVAILABLE
|
|
74
78
|
- bash - forbidden
|
|
75
79
|
|
|
76
|
-
##
|
|
77
|
-
|
|
78
|
-
Mnemosyne executes the expanded compression pipeline. When Zeus delegates compression:
|
|
79
|
-
|
|
80
|
-
### Compression Pipeline
|
|
81
|
-
1. **Receive**: Zeus sends batch with:
|
|
82
|
-
- Subtask_summaries with priority scores (CRITICAL/HIGH/MEDIUM/LOW)
|
|
83
|
-
- Semantic summaries for CRITICAL/HIGH entries
|
|
84
|
-
- Cross-references to add (endpoints, tables, decisions)
|
|
85
|
-
- IMPL/REVIEW artifacts to archive
|
|
86
|
-
- Next phase agent info
|
|
87
|
-
|
|
88
|
-
2. **Privacy check**: Never store secrets, credentials, or tokens in durable memory. The current `memory_store` handler stores submitted values and metadata; automatic regex scrubbing/redaction is not guaranteed. Omit sensitive content or redact it before storing.
|
|
89
|
-
|
|
90
|
-
3. **Write ZZ artifact**: Create `.pantheon/memory-bank/.tmp/ZZ-phase{N}-context.md` with:
|
|
91
|
-
- From/To agent info
|
|
92
|
-
- Budget allocated/used
|
|
93
|
-
- CRITICAL entries (expanded 3-line summaries)
|
|
94
|
-
- HIGH entries (2-line summaries)
|
|
95
|
-
- MEDIUM entries (1-line table rows)
|
|
96
|
-
- Cross-references
|
|
97
|
-
|
|
98
|
-
4. **Update 01-active-context.md**: Append compressed entries to `## Completed Phases` section
|
|
99
|
-
- CRITICAL: expanded (3 lines + summary)
|
|
100
|
-
- HIGH: standard (2 lines)
|
|
101
|
-
- MEDIUM: 1-line | LOW: 0.5-line (filename only)
|
|
102
|
-
- Apply budget allocation (priority-greedy)
|
|
103
|
-
|
|
104
|
-
5. **Archive IMPL/REVIEW**: Append to `02-progress-log.md` (same as Level 1)
|
|
105
|
-
|
|
106
|
-
6. **Update Cross-References**:
|
|
107
|
-
- Append new entries to `_xref/index.md`
|
|
108
|
-
- Increment `_xref/_next_id.json`
|
|
109
|
-
|
|
110
|
-
7. **Optional durable memory**: Only when explicitly requested and the result is reusable across sessions, store one concise top-level decision/fact. Do not index every compressed entry, phase result, or artifact.
|
|
111
|
-
|
|
112
|
-
8. **Report**: Return the compression summary and any unresolved items; do not report memory-index counts unless an explicit store was requested.
|
|
113
|
-
|
|
114
|
-
### Write Protocol
|
|
115
|
-
- Atomic write: .tmp → fsync → validate → rename
|
|
116
|
-
- Secret handling: omit or manually redact secrets before durable storage; do not rely on automatic MCP scrubbing.
|
|
80
|
+
## Context and Checkpoint Guidance
|
|
117
81
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
82
|
+
OpenCode's native compaction owns summarizing the active conversation. Do not
|
|
83
|
+
run a second phase-scoring, indexing, or transcript-copy pipeline. Use
|
|
84
|
+
`context_save` only for a concise checkpoint when the user requests one or the
|
|
85
|
+
task is expected to resume in another session; use `context_get` when resuming.
|
|
86
|
+
Keep the objective, current phase, completed work, next step, decisions,
|
|
87
|
+
blockers, and uncertain external outcomes. Do not save routine phase summaries,
|
|
88
|
+
tool logs, transcripts, or secrets. Durable `memory_store` follows the explicit
|
|
89
|
+
request policy below and remains separate from session checkpoints.
|
|
122
90
|
|
|
123
91
|
## Recall Handler (Level 3)
|
|
124
92
|
|
|
@@ -139,7 +107,9 @@ Mnemosyne recalls stored entries with the `memory_search` MCP tool:
|
|
|
139
107
|
```
|
|
140
108
|
|
|
141
109
|
**Integration with compress_context:**
|
|
142
|
-
|
|
110
|
+
Native OpenCode compaction owns the active conversation. Do not create a Memory
|
|
111
|
+
Bank artifact or durable entry for each compacted phase. Persist a reusable
|
|
112
|
+
outcome only under the explicit memory-store policy.
|
|
143
113
|
|
|
144
114
|
**Integration with Close sprint:**
|
|
145
115
|
When `Close sprint` is called, do not create a durable-memory copy of temporary artifacts unless explicitly requested.
|
|
@@ -157,8 +127,8 @@ Use this only when the user or Zeus explicitly asks to preserve a reusable resul
|
|
|
157
127
|
|
|
158
128
|
`pantheon-memory` stores durable SQLite entries with no entry TTL. Its search is
|
|
159
129
|
FTS5/BM25 lexical matching only, with no semantic/vector fallback. Never store
|
|
160
|
-
secrets, credentials, or tokens:
|
|
161
|
-
|
|
130
|
+
secrets, credentials, or tokens: automatic regex scrubbing/redaction is not guaranteed.
|
|
131
|
+
The MCP stores submitted values and metadata.
|
|
162
132
|
|
|
163
133
|
**Command:** `@mnemosyne Store <concise reusable result>`
|
|
164
134
|
|
|
@@ -172,7 +142,7 @@ without guaranteed automatic scrubbing.
|
|
|
172
142
|
- Continue through explicitly requested memory-bank tasks
|
|
173
143
|
- Do not start Quick-index or persistence operations automatically
|
|
174
144
|
- Stop before destructive memory operations (delete, cleanup, compress with force)
|
|
175
|
-
-
|
|
145
|
+
- Native context compaction does not trigger a separate memory workflow
|
|
176
146
|
- For Sprint close: auto-continue through final index → wipe .tmp/ → update progress
|
|
177
147
|
- Partial results OK — memory operations are transactional and safe to interrupt
|
|
178
148
|
|
package/src/agents/nyx.md
CHANGED
|
@@ -14,8 +14,12 @@ permission:
|
|
|
14
14
|
"*": deny
|
|
15
15
|
temperature: 0.1
|
|
16
16
|
skills:
|
|
17
|
-
- security-hardening
|
|
18
17
|
- auto-continue
|
|
18
|
+
- loop-engineering
|
|
19
|
+
- reflect
|
|
20
|
+
- security-hardening
|
|
21
|
+
- simplify
|
|
22
|
+
- worktrees
|
|
19
23
|
mcp_tools:
|
|
20
24
|
pantheon-resources: all
|
|
21
25
|
pantheon-memory: [memory_search]
|
package/src/agents/prometheus.md
CHANGED
package/src/agents/talos.md
CHANGED
package/src/agents/themis.md
CHANGED
|
@@ -14,8 +14,12 @@ permission:
|
|
|
14
14
|
temperature: 0.1
|
|
15
15
|
skills:
|
|
16
16
|
- code-review-checklist
|
|
17
|
+
- loop-engineering
|
|
18
|
+
- reflect
|
|
17
19
|
- security-hardening
|
|
20
|
+
- simplify
|
|
18
21
|
- tdd-with-agents
|
|
22
|
+
- worktrees
|
|
19
23
|
mcp_tools:
|
|
20
24
|
pantheon-resources: all
|
|
21
25
|
pantheon-memory: [memory_search]
|
package/src/agents/zeus.md
CHANGED
|
@@ -18,11 +18,17 @@ mcp_tools:
|
|
|
18
18
|
pantheon-vision: [vision_describe]
|
|
19
19
|
skills:
|
|
20
20
|
- agent-coordination
|
|
21
|
-
- session-goal
|
|
22
21
|
- artifact-management
|
|
23
|
-
- context-compression
|
|
24
22
|
- auto-continue
|
|
23
|
+
- codemap
|
|
24
|
+
- context-compression
|
|
25
25
|
- incremental-implementation
|
|
26
|
+
- loop-engineering
|
|
27
|
+
- reflect
|
|
28
|
+
- session-goal
|
|
29
|
+
- simplify
|
|
30
|
+
- verification-planning
|
|
31
|
+
- worktrees
|
|
26
32
|
|
|
27
33
|
---
|
|
28
34
|
|
|
@@ -69,7 +75,7 @@ Zeus nunca toca no código. Use o menor fluxo que preserve segurança: encaminhe
|
|
|
69
75
|
|
|
70
76
|
**Gates proporcionais** (via ferramenta root `question`, se visível):
|
|
71
77
|
- Tarefa delimitada, reversível, de baixa incerteza e não sensível/sem mudança material em API visível ao usuário: não force planejamento nem aprovação de plano; se delegar, encaminhe uma vez ao especialista correto, que inspeciona o contexto necessário, altera, verifica o comportamento e resume.
|
|
72
|
-
-
|
|
78
|
+
- Para um entregável delimitado, delegue uma vez ao especialista final; ele pode reunir os fatos necessários. Use Apollo à parte apenas se a pesquisa for o entregável ou bloquear a escolha do especialista. Planejamento e council ficam sob demanda; nunca dispare council para correção pequena.
|
|
73
79
|
- Escopo amplo/material, alta incerteza, mudança de API visível ao usuário, auth/segurança, dados/schema/migração e operações destrutivas mantêm os gates de planejamento, revisão e aprovação aplicáveis; trabalho auth/segurança e dados/schema mantém revisão Themis.
|
|
74
80
|
- Mantenha os agentes especializados disponíveis sob demanda; não remova uma especialidade com base em uma única tarefa ou observação de overhead.
|
|
75
81
|
- Commit, push, merge, deploy de produção, alteração global, operação destrutiva e ampliação de permissões nunca são automáticos.
|
|
@@ -6,7 +6,7 @@ agents: ["*"]
|
|
|
6
6
|
|
|
7
7
|
# Agent Return Format
|
|
8
8
|
|
|
9
|
-
Implementation agents (Hermes, Aphrodite, Demeter, Hephaestus, Prometheus) MUST return results to Zeus in this format:
|
|
9
|
+
All agents check each result against the request and evidence; remove unrelated work, generic filler, unsupported claims, and unnecessary complexity; state uncertainty and preserve safety constraints. Implementation agents (Hermes, Aphrodite, Demeter, Hephaestus, Prometheus) MUST return results to Zeus in this format:
|
|
10
10
|
|
|
11
11
|
## subtask_summary
|
|
12
12
|
**files_changed:** [list of file paths, one per line]
|
|
@@ -12,6 +12,6 @@ agents: ["*"]
|
|
|
12
12
|
- Use a targeted query (`top_k=2`) and ignore weak matches; missing or irrelevant results never block current work.
|
|
13
13
|
|
|
14
14
|
### Persistence
|
|
15
|
-
- Use only
|
|
16
|
-
-
|
|
17
|
-
-
|
|
15
|
+
- Use only granted tools: Zeus has `memory_search` and temporary `context_save/get` checkpoints, but no durable writes; Mnemosyne has `memory_store` and other durable tools.
|
|
16
|
+
- Let native OpenCode compaction summarize active context. Use `context_save/get` only for cross-session resume; keep the goal, phase, progress, next step, decisions, blockers, and uncertain outcomes — no transcripts or routine logs.
|
|
17
|
+
- Store at most one concise, reusable top-level result only on explicit request. Never persist child summaries, test logs, or temporary state. Never store secrets, credentials, or tokens; confirm writes and state failures. Create ADRs only on request.
|
|
@@ -3,10 +3,10 @@ description: "Test economy — write smaller, focused suites; heavy install/E2E
|
|
|
3
3
|
name: "Test Economy"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
Write
|
|
6
|
+
Write one focused test per behavior; do not duplicate coverage.
|
|
7
7
|
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
8
|
+
- Prefer unit/integration checks; use E2E, install, or network tests only when a change affects that path.
|
|
9
|
+
- Avoid assertions on copy/formatting or tests that merely restate the implementation.
|
|
10
|
+
- Default to focused tests; run the full suite only for scope, risk, or CI/release gates. Bug fixes need one regression test unless existing coverage catches them.
|
|
11
|
+
- Keep slow install/E2E suites opt-in, never per edit or phase; reserve them for release gates.
|
|
12
|
+
- Test economy does NOT weaken stronger gates: auth, security, data-integrity, and required coverage.
|
|
@@ -15,7 +15,6 @@ import json
|
|
|
15
15
|
import logging
|
|
16
16
|
import mimetypes
|
|
17
17
|
import os
|
|
18
|
-
import re
|
|
19
18
|
import sqlite3
|
|
20
19
|
import struct
|
|
21
20
|
import sys
|
|
@@ -71,13 +70,8 @@ OPENCODE_ENDPOINT = "https://opencode.ai/zen/v1/chat/completions"
|
|
|
71
70
|
# elsewhere.
|
|
72
71
|
SESSION_HEADER = "x-opencode-session"
|
|
73
72
|
_ZEN_ENDPOINT_PREFIX = "https://opencode.ai/zen/"
|
|
74
|
-
#
|
|
75
|
-
#
|
|
76
|
-
# the length is bounded. Anything else — empty, whitespace, control characters,
|
|
77
|
-
# quotes, CR/LF — is rejected instead of being copied into the header, where a
|
|
78
|
-
# CRLF would split it and let a caller inject extra headers/requests.
|
|
79
|
-
_SESSION_ID_MAX_LENGTH = 128
|
|
80
|
-
_SESSION_ID_PATTERN = re.compile(r"[A-Za-z0-9._:-]+")
|
|
73
|
+
# Keep in sync with src/pantheon/session-guard.ts: OpenCode accepts IDs that
|
|
74
|
+
# start with "ses". Do not add a narrower local format or length constraint.
|
|
81
75
|
_ALLOWED_MIME_TYPES = {"image/png", "image/jpeg", "image/webp", "image/gif"}
|
|
82
76
|
_EXTENSION_MIME_TYPES = {
|
|
83
77
|
".png": "image/png",
|
|
@@ -297,22 +291,19 @@ def _is_zen_endpoint(endpoint: str) -> bool:
|
|
|
297
291
|
|
|
298
292
|
|
|
299
293
|
def _validated_session_id(value: object) -> str | None:
|
|
300
|
-
"""Return a session id
|
|
294
|
+
"""Return a host-valid session id, following the shared ``ses`` contract."""
|
|
295
|
+
return value if isinstance(value, str) and value.startswith("ses") else None
|
|
301
296
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
return None
|
|
313
|
-
if _SESSION_ID_PATTERN.fullmatch(candidate) is None:
|
|
314
|
-
return None
|
|
315
|
-
return candidate
|
|
297
|
+
|
|
298
|
+
def _require_session_id(value: object) -> str:
|
|
299
|
+
"""Return a valid session id or fail before any Zen-bound work."""
|
|
300
|
+
session_id = _validated_session_id(value)
|
|
301
|
+
if session_id is None:
|
|
302
|
+
raise VisionError(
|
|
303
|
+
"A valid OpenCode session id is required for Zen Vision; "
|
|
304
|
+
"retry from an active OpenCode session."
|
|
305
|
+
)
|
|
306
|
+
return session_id
|
|
316
307
|
|
|
317
308
|
|
|
318
309
|
def _strip_provider_prefix(model: str) -> str:
|
|
@@ -637,13 +628,11 @@ async def _gateway(
|
|
|
637
628
|
) -> str:
|
|
638
629
|
"""Send one multimodal request to the selected OpenCode gateway.
|
|
639
630
|
|
|
640
|
-
``session_id``
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
unusable value (empty, whitespace, control characters, CR/LF, quotes) is
|
|
644
|
-
dropped rather than copied into the header. It is never logged and never
|
|
645
|
-
sent to a non-Zen host.
|
|
631
|
+
A valid ``session_id`` is required before auth lookup or POST. It is sent as
|
|
632
|
+
``x-opencode-session`` only for a Zen endpoint, and is never logged or sent
|
|
633
|
+
to a non-Zen host.
|
|
646
634
|
"""
|
|
635
|
+
safe_session_id = _require_session_id(session_id)
|
|
647
636
|
key, endpoint = _resolve_auth()
|
|
648
637
|
if not key:
|
|
649
638
|
# Missing credential is FATAL here (unlike the graceful describe/ocr
|
|
@@ -680,8 +669,7 @@ async def _gateway(
|
|
|
680
669
|
"Authorization": f"Bearer {key}",
|
|
681
670
|
"Content-Type": "application/json",
|
|
682
671
|
}
|
|
683
|
-
|
|
684
|
-
if safe_session_id is not None and _is_zen_endpoint(endpoint):
|
|
672
|
+
if _is_zen_endpoint(endpoint):
|
|
685
673
|
headers[SESSION_HEADER] = safe_session_id
|
|
686
674
|
try:
|
|
687
675
|
async with httpx.AsyncClient(timeout=REQUEST_TIMEOUT_SECONDS) as client:
|
|
@@ -786,15 +774,21 @@ async def vision_describe(
|
|
|
786
774
|
through the tool call because a local MCP process is not handed one by the
|
|
787
775
|
host. It is sent only to a Zen endpoint and never logged.
|
|
788
776
|
"""
|
|
777
|
+
key, _endpoint = _resolve_auth()
|
|
778
|
+
session = None
|
|
779
|
+
if key:
|
|
780
|
+
try:
|
|
781
|
+
session = _require_session_id(session_id)
|
|
782
|
+
except Exception as exc:
|
|
783
|
+
return _error_message(exc)
|
|
789
784
|
try:
|
|
790
785
|
image = await _prepare_input(path)
|
|
791
786
|
except Exception as exc:
|
|
792
787
|
return _error_message(exc)
|
|
793
|
-
key, _endpoint = _resolve_auth()
|
|
794
788
|
if not key:
|
|
795
789
|
return _local_vision_text(image)
|
|
796
790
|
try:
|
|
797
|
-
return await _gateway(image, prompt or _DESCRIBE_PROMPT, session_id=
|
|
791
|
+
return await _gateway(image, prompt or _DESCRIBE_PROMPT, session_id=session)
|
|
798
792
|
except Exception as exc:
|
|
799
793
|
return _error_message(exc)
|
|
800
794
|
|
|
@@ -807,15 +801,21 @@ async def vision_ocr(path: str, session_id: str | None = None) -> str:
|
|
|
807
801
|
when no gateway credential is configured. ``session_id`` reaches the Zen
|
|
808
802
|
gateway as the ``x-opencode-session`` header (see ``vision_describe``).
|
|
809
803
|
"""
|
|
804
|
+
key, _endpoint = _resolve_auth()
|
|
805
|
+
session = None
|
|
806
|
+
if key:
|
|
807
|
+
try:
|
|
808
|
+
session = _require_session_id(session_id)
|
|
809
|
+
except Exception as exc:
|
|
810
|
+
return _error_message(exc)
|
|
810
811
|
try:
|
|
811
812
|
image = await _prepare_input(path)
|
|
812
813
|
except Exception as exc:
|
|
813
814
|
return _error_message(exc)
|
|
814
|
-
key, _endpoint = _resolve_auth()
|
|
815
815
|
if not key:
|
|
816
816
|
return _local_vision_text(image)
|
|
817
817
|
try:
|
|
818
|
-
return await _gateway(image, _OCR_PROMPT, session_id=
|
|
818
|
+
return await _gateway(image, _OCR_PROMPT, session_id=session)
|
|
819
819
|
except Exception as exc:
|
|
820
820
|
return _error_message(exc)
|
|
821
821
|
|
|
@@ -830,9 +830,10 @@ async def vision_analyze(path: str, session_id: str | None = None) -> str:
|
|
|
830
830
|
(see ``vision_describe``).
|
|
831
831
|
"""
|
|
832
832
|
try:
|
|
833
|
+
session = _require_session_id(session_id)
|
|
833
834
|
image = await _prepare_input(path)
|
|
834
835
|
content = await _gateway(
|
|
835
|
-
image, _ANALYZE_PROMPT, structured=True, session_id=
|
|
836
|
+
image, _ANALYZE_PROMPT, structured=True, session_id=session
|
|
836
837
|
)
|
|
837
838
|
parsed = _parse_json_object(content)
|
|
838
839
|
if parsed is None:
|