pantheon-opencode 1.0.0

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 (128) hide show
  1. package/AGENTS.md +37 -0
  2. package/LICENSE +21 -0
  3. package/README.md +1013 -0
  4. package/bin/pantheon-init.mjs +183 -0
  5. package/commands/pantheon-audit.md +25 -0
  6. package/commands/pantheon-bg.md +10 -0
  7. package/commands/pantheon-consolidate.md +11 -0
  8. package/commands/pantheon-deepwork.md +128 -0
  9. package/commands/pantheon-doc.md +10 -0
  10. package/commands/pantheon-focus.md +9 -0
  11. package/commands/pantheon-forget.md +58 -0
  12. package/commands/pantheon-hash.md +11 -0
  13. package/commands/pantheon-optimize.md +79 -0
  14. package/commands/pantheon-remember.md +44 -0
  15. package/commands/pantheon-search.md +48 -0
  16. package/commands/pantheon-status.md +71 -0
  17. package/commands/pantheon-todo.md +11 -0
  18. package/commands/pantheon.md +49 -0
  19. package/docs/AGENT-MCP.md +194 -0
  20. package/docs/ARCHITECTURE.md +384 -0
  21. package/docs/BRANCH-PROTECTION.md +142 -0
  22. package/docs/INDEX.md +81 -0
  23. package/docs/INSTALLATION.md +217 -0
  24. package/docs/MCP.md +238 -0
  25. package/docs/MEMORY.md +471 -0
  26. package/docs/MIGRATION-MEMORY-BANK.md +139 -0
  27. package/docs/PLATFORMS.md +5 -0
  28. package/docs/QUICKSTART.md +49 -0
  29. package/docs/README.md +18 -0
  30. package/docs/RELEASING.md +256 -0
  31. package/docs/SETUP.md +5 -0
  32. package/docs/UPGRADING.md +41 -0
  33. package/docs/mcp-recommendations.md +439 -0
  34. package/docs/mcp-tools.md +156 -0
  35. package/docs/mcp-user-guide.md +204 -0
  36. package/docs/persistence-mcp.md +111 -0
  37. package/package.json +72 -0
  38. package/pantheon.schema.json +158 -0
  39. package/scripts/__init__.py +0 -0
  40. package/scripts/_pantheon_paths.py +68 -0
  41. package/scripts/check-version-consistency.sh +23 -0
  42. package/scripts/code_mode_server.py +202 -0
  43. package/scripts/doctor.mjs +763 -0
  44. package/scripts/generate-prompts.sh +222 -0
  45. package/scripts/generate-routing-docs.mjs +104 -0
  46. package/scripts/hash_verify.py +192 -0
  47. package/scripts/init-pantheon-mcp.sh +118 -0
  48. package/scripts/install/agents-md.mjs +214 -0
  49. package/scripts/install/health-check.mjs +196 -0
  50. package/scripts/install/migrate.mjs +209 -0
  51. package/scripts/install/opencode.mjs +645 -0
  52. package/scripts/install/shared.mjs +655 -0
  53. package/scripts/install/venv.mjs +116 -0
  54. package/scripts/install-mcp.mjs +885 -0
  55. package/scripts/install.mjs +26 -0
  56. package/scripts/manifest.mjs +622 -0
  57. package/scripts/mcp_persistence_server.py +459 -0
  58. package/scripts/mcp_resources_server.py +206 -0
  59. package/scripts/memory_cache.py +78 -0
  60. package/scripts/memory_mcp_server.py +605 -0
  61. package/scripts/paths.py +64 -0
  62. package/scripts/prune_context.py +72 -0
  63. package/scripts/release-bundle.mjs +109 -0
  64. package/scripts/scrub-secrets.py +282 -0
  65. package/scripts/scrub_secrets.py +281 -0
  66. package/scripts/test-context-compression.sh +166 -0
  67. package/scripts/themis_heuristic_scan.py +287 -0
  68. package/scripts/todo_enforcer.py +242 -0
  69. package/scripts/uninstall.mjs +1057 -0
  70. package/scripts/validate-routing.mjs +160 -0
  71. package/scripts/validate_agent_frontmatter.py +226 -0
  72. package/scripts/versioning.mjs +254 -0
  73. package/skills-lock.json +16 -0
  74. package/src/agents/aphrodite.md +162 -0
  75. package/src/agents/apollo.md +109 -0
  76. package/src/agents/athena.md +226 -0
  77. package/src/agents/demeter.md +146 -0
  78. package/src/agents/gaia.md +82 -0
  79. package/src/agents/hephaestus.md +105 -0
  80. package/src/agents/hermes.md +302 -0
  81. package/src/agents/iris.md +99 -0
  82. package/src/agents/mnemosyne.md +226 -0
  83. package/src/agents/nyx.md +87 -0
  84. package/src/agents/prometheus.md +199 -0
  85. package/src/agents/talos.md +93 -0
  86. package/src/agents/themis.md +187 -0
  87. package/src/agents/zeus.md +209 -0
  88. package/src/instructions/agent-return-format.instructions.md +26 -0
  89. package/src/instructions/backend-standards.instructions.md +45 -0
  90. package/src/instructions/documentation-standards.instructions.md +53 -0
  91. package/src/instructions/frontend-standards.instructions.md +46 -0
  92. package/src/instructions/memory-protocol.instructions.md +67 -0
  93. package/src/instructions/yagni.instructions.md +21 -0
  94. package/src/instructions/zeus-anti-stall.instructions.md +72 -0
  95. package/src/instructions/zeus-communication-rules.instructions.md +15 -0
  96. package/src/instructions/zeus-council-synthesis.instructions.md +105 -0
  97. package/src/instructions/zeus-timeout-retry.instructions.md +127 -0
  98. package/src/mcp/_pantheon_paths.py +67 -0
  99. package/src/mcp/code_mode_server.py +202 -0
  100. package/src/mcp/init-pantheon-mcp.sh +118 -0
  101. package/src/mcp/install-mcp.mjs +885 -0
  102. package/src/mcp/mcp_persistence_server.py +458 -0
  103. package/src/mcp/mcp_resources_server.py +205 -0
  104. package/src/mcp/memory_mcp_server.py +604 -0
  105. package/src/mcp/requirements-mcp-core.txt +5 -0
  106. package/src/mcp/requirements-mcp.txt +5 -0
  107. package/src/plugin.ts +19 -0
  108. package/src/plugins/tui/dist/tui.js +143 -0
  109. package/src/plugins/tui/dist/tui.tsx +144 -0
  110. package/src/plugins/tui/package.json +32 -0
  111. package/src/plugins/tui/src/index.tsx +144 -0
  112. package/src/plugins/tui/tsdown.config.ts +22 -0
  113. package/src/routing.yml +499 -0
  114. package/src/skills/README.md +230 -0
  115. package/src/skills/agent-coordination/SKILL.md +95 -0
  116. package/src/skills/artifact-management/SKILL.md +118 -0
  117. package/src/skills/auto-continue/SKILL.md +280 -0
  118. package/src/skills/code-review-checklist/SKILL.md +139 -0
  119. package/src/skills/context-compression/SKILL.md +861 -0
  120. package/src/skills/git-workflow-and-versioning/SKILL.md +32 -0
  121. package/src/skills/incremental-implementation/SKILL.md +27 -0
  122. package/src/skills/memory-bank/SKILL.md +165 -0
  123. package/src/skills/orchestration-workflow/SKILL.md +311 -0
  124. package/src/skills/security-hardening/SKILL.md +36 -0
  125. package/src/skills/session-goal/SKILL.md +138 -0
  126. package/src/skills/spec-driven-development/SKILL.md +23 -0
  127. package/src/skills/tdd-with-agents/SKILL.md +170 -0
  128. package/src/skills/visual-review-pipeline/SKILL.md +200 -0
@@ -0,0 +1,204 @@
1
+ # MCP User Guide: Adding Custom Servers & Agent Awareness
2
+
3
+ This guide explains how to add your own MCP servers to Pantheon and make agents aware of them.
4
+
5
+ ---
6
+
7
+ ## Quick Start
8
+
9
+ Add an MCP server to your platform config. All examples below use a fictional `my-tools` server:
10
+
11
+ **OpenCode** (`opencode.json`):
12
+ ```json
13
+ {
14
+ "mcp": {
15
+ "my-tools": {
16
+ "type": "local",
17
+ "command": ["node", "my-mcp-server.js"],
18
+ "enabled": true
19
+ }
20
+ }
21
+ }
22
+ ```
23
+
24
+ **** (`.mcp.json`):
25
+ ```json
26
+ {
27
+ "mcpServers": {
28
+ "my-tools": {
29
+ "command": "node",
30
+ "args": ["my-mcp-server.js"]
31
+ }
32
+ }
33
+ }
34
+ ```
35
+
36
+ ** / ** (`.vscode/mcp.json` or `./mcp.json`):
37
+ ```json
38
+ {
39
+ "servers": {
40
+ "my-tools": {
41
+ "type": "stdio",
42
+ "command": "node",
43
+ "args": ["my-mcp-server.js"]
44
+ }
45
+ }
46
+ }
47
+ ```
48
+
49
+ **** (`_mcp_settings.json`):
50
+ ```json
51
+ {
52
+ "mcpServers": {
53
+ "my-tools": {
54
+ "command": "node",
55
+ "args": ["my-mcp-server.js"]
56
+ }
57
+ }
58
+ }
59
+ ```
60
+
61
+ After adding, restart your MCP client. Verify the server connects.
62
+
63
+ ---
64
+
65
+ ## Making Agents Aware of Custom MCPs
66
+
67
+ Adding a server to config is only half the work. **Agents don't auto-discover MCP tools** — you must declare them in the agent's `.agent.md` file.
68
+
69
+ ### Step 1: Add `mcp_tools:` to Frontmatter
70
+
71
+ In the agent's YAML frontmatter, add an `mcp_tools:` block listing which tools from which server the agent can use:
72
+
73
+ ```yaml
74
+ ---
75
+ name: hermes
76
+ mcp_tools:
77
+ my-tools:
78
+ - analyze_dependency
79
+ - scan_vulnerabilities
80
+ ---
81
+ ```
82
+
83
+ This tells the platform to inject these tool definitions into the agent's context.
84
+
85
+ ### Step 2: Document Tools in the Agent Body
86
+
87
+ Add a `## Custom MCP Tools` section in the agent's body so the agent understands *when* and *how* to use each tool:
88
+
89
+ ```markdown
90
+ ## Custom MCP Tools
91
+
92
+ | Server | Tool | Signature | When to use |
93
+ |--------|------|-----------|-------------|
94
+ | **my-tools** | `analyze_dependency(package, depth?)` | Check a dependency for known vulnerabilities |
95
+ | **my-tools** | `scan_vulnerabilities(path)` | Scan a directory for security issues |
96
+ ```
97
+
98
+ ### Step 3: Set Access Control
99
+
100
+ **OpenCode** (`opencode.json`):
101
+ ```json
102
+ {
103
+ "permission": {
104
+ "mcp": {
105
+ "my-tools": "ask"
106
+ }
107
+ }
108
+ }
109
+ ```
110
+
111
+ Values: `allow` (auto-approve), `ask` (prompt user), `deny` (block).
112
+
113
+ ---
114
+
115
+ ## Full Example: GitHub MCP
116
+
117
+ ### 1. Install & Configure
118
+
119
+ **OpenCode** (`opencode.json`):
120
+ ```json
121
+ {
122
+ "mcp": {
123
+ "github": {
124
+ "type": "local",
125
+ "command": ["npx", "-y", "@modelcontextprotocol/server-github"],
126
+ "env": {
127
+ "GITHUB_TOKEN": "{env:GITHUB_TOKEN}"
128
+ },
129
+ "enabled": true
130
+ }
131
+ }
132
+ }
133
+ ```
134
+
135
+ ### 2. Declare in Agent Frontmatter
136
+
137
+ ```yaml
138
+ ---
139
+ name: iris
140
+ mcp_tools:
141
+ github:
142
+ - create_issue
143
+ - list_pull_requests
144
+ - search_code
145
+ ---
146
+ ```
147
+
148
+ ### 3. Document in Agent Body
149
+
150
+ ```markdown
151
+ ## Custom MCP Tools
152
+
153
+ | Server | Tool | Signature | What it does |
154
+ |--------|------|-----------|-------------|
155
+ | **github** | `create_issue(title, body, labels?)` | Create a GitHub issue in the current repo |
156
+ | **github** | `list_pull_requests(state?: "open")` | List PRs with optional state filter |
157
+ | **github** | `search_code(query)` | Search code across the repository |
158
+ ```
159
+
160
+ ### 4. Configure Permissions
161
+
162
+ ```json
163
+ {
164
+ "permission": {
165
+ "mcp": {
166
+ "github": "ask"
167
+ }
168
+ }
169
+ }
170
+ ```
171
+
172
+ ---
173
+
174
+ ## Best Practices
175
+
176
+ | Practice | Recommendation |
177
+ |----------|---------------|
178
+ | **Server names** | Short, descriptive, lowercase (e.g., `github`, `postgres`, `slack`). They become the prefix. |
179
+ | **Tool declarations** | Only declare tools the agent actually needs. |
180
+ | **Documentation** | Always add a `## Custom MCP Tools` table with signature + purpose. |
181
+ | **Permission** | Start with `ask` for new MCPs. Only downgrade to `allow` after verifying read-only safety. |
182
+ | **Max MCPs** | Follow the 3-7 rule: 3 core + up to 4 custom. Beyond 7, accuracy degrades. |
183
+ | **Naming** | Match `mcp_tools:` keys to the server name in your config. They must be identical. |
184
+ | **Environment variables** | Use `{env:VAR}` interpolation for secrets. Never inline tokens in config. |
185
+
186
+ ---
187
+
188
+ ## Troubleshooting
189
+
190
+ | Symptom | Cause | Fix |
191
+ |---------|-------|-----|
192
+ | Agent says "I don't have that tool" | MCP not declared in frontmatter | Add `mcp_tools:` entry |
193
+ | Tool exists but agent doesn't use it | No body documentation | Add `## Custom MCP Tools` section |
194
+ | "Server not found" | Config typo | Check server name matches config |
195
+ | "Tool call failed" | Permission denied | Set to `allow` or `ask` in config |
196
+ | Agent uses wrong tool | Too many MCPs | Reduce to ≤5 per agent |
197
+ | Changes not taking effect | Client cache | Restart the MCP client |
198
+
199
+ ---
200
+
201
+ ## Reference
202
+
203
+ - [MCP Tool Registry](mcp-tools.md) — Canonical reference of built-in Pantheon MCP tools
204
+ - [MCP Security](skill: mcp-security) — Security hardening rules
@@ -0,0 +1,111 @@
1
+ # Pantheon Persistence MCP
2
+
3
+ **Server:** `pantheon-persistence`
4
+ **Script:** `scripts/mcp_persistence_server.py`
5
+ **Dependencies:** Zero (stdlib only: sqlite3)
6
+
7
+ A lightweight key-value store with SQLite + FTS5, TTL, and namespaces.
8
+ Separate from `pantheon-memory` (vector/ChromaDB).
9
+
10
+ ## Purpose
11
+
12
+ - **Cache entre agentes** — compartilhar descobertas rápidas sem ir pro ChromaDB
13
+ - **Estado de execução** — steps de jobs, progresso, checkpoints
14
+ - **Dados efêmeros com TTL** — cache que expira sozinho
15
+ - **Dados locais** — tokens temporários, debug info (evita ir pro GitHub)
16
+
17
+ ## Architecture
18
+
19
+ ```
20
+ pantheon-persistence MCP
21
+ ├── Global DB: ~/.config/opencode/persistence/global.db
22
+ └── Project DB: .pantheon/persistence/project.db
23
+ ```
24
+
25
+ - **Global**: dados cross-projeto (cache de agentes, preferências)
26
+ - **Project**: dados específicos do projeto atual
27
+
28
+ ## Tools (6)
29
+
30
+ ### kv_store
31
+ Store a key-value pair with optional TTL.
32
+
33
+ `kv_store(namespace, key, value, ttl?, scope?)`
34
+ - `ttl`: seconds. null = forever
35
+ - `scope`: "project" (default) or "global"
36
+ - Returns `{"status": "stored", "namespace": ns, "key": k}`
37
+
38
+ ### kv_get
39
+ Retrieve a value by namespace + key.
40
+
41
+ `kv_get(namespace, key, scope?)`
42
+ - Auto-filters expired entries (SQL-level)
43
+ - Returns value string or null
44
+
45
+ ### kv_delete
46
+ Remove an entry.
47
+
48
+ `kv_delete(namespace, key, scope?)`
49
+ - Returns `{"status": "deleted"}` or `{"status": "not_found"}`
50
+
51
+ ### kv_list
52
+ List entries in a namespace with optional prefix filter.
53
+
54
+ `kv_list(namespace, prefix?, scope?, limit?)`
55
+ - Returns array of `{key, value, created_at, expires_at}`
56
+ - Respects TTL (expired items not returned)
57
+
58
+ ### kv_search
59
+ Full-text search across all namespaces using SQLite FTS5.
60
+
61
+ `kv_search(query, namespace?, scope?, limit?)`
62
+ - BM25-ranked results
63
+ - Terms are sanitized and quoted for injection safety
64
+ - Returns array of `{namespace, key, value, created_at, score}`
65
+
66
+ ### purge_expired
67
+ Remove expired entries and rotate deletelog.
68
+
69
+ `purge_expired(scope?, dry_run?)`
70
+ - Soft-delete with deletelog audit trail
71
+ - dry_run previews without purging
72
+ - Deletelog rotates at 1MB (keeps last 3)
73
+
74
+ ## TTL Lifecycle
75
+
76
+ ```python
77
+ # Cache que expira em 1 hora
78
+ kv_store(namespace="cache-apollo", key="api-response", value="...", ttl=3600)
79
+
80
+ # Dado permanente (sobrescreve sem perder created_at)
81
+ kv_store(namespace="config", key="db-url", value="postgres://...")
82
+
83
+ # Busca: expirados são invisíveis automaticamente
84
+ result = kv_get(namespace="cache-apollo", key="api-response") # None se expirou
85
+
86
+ # Limpeza manual (opcional — TTL já filtra na leitura)
87
+ purge_expired(scope="project")
88
+ ```
89
+
90
+ ## Naming Conventions
91
+
92
+ | Namespace | Purpose | TTL |
93
+ |-----------|---------|-----|
94
+ | `cache-{agent}` | Descobertas temporárias | 300-3600s |
95
+ | `session-{id}` | Estado de sessão | 7200s |
96
+ | `job-{id}` | Progresso de job | 86400s |
97
+ | `config` | Config persistente | null |
98
+ | `local-only` | Dados sensíveis | 3600s |
99
+
100
+ ## Comparison with pantheon-memory
101
+
102
+ | Aspect | persistence (this) | memory |
103
+ |--------|-------------------|--------|
104
+ | Storage | SQLite KV | ChromaDB vector |
105
+ | Search | FTS5 (exato/keyword) | Cosine similarity (semântico) |
106
+ | TTL | ✅ Por entrada | ❌ Nenhum |
107
+ | Namespace | ✅ Coluna + scope | ✅ Session + category |
108
+ | Deploys | stdlib, 0 deps | chromadb + sentence-transformers |
109
+ | Startup | <0.5s | 3-8s |
110
+ | Tools | 6 | 14 |
111
+ | Lines | 449 | 1,344 |
package/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "pantheon-opencode",
3
+ "version": "1.0.0",
4
+ "description": "Multi-agent orchestration for OpenCode \u2014 14 specialized agents, TDD, Themis review gates.",
5
+ "publishConfig": {
6
+ "access": "public",
7
+ "registry": "https://registry.npmjs.org/"
8
+ },
9
+ "scripts": {
10
+ "install": "node scripts/install.mjs",
11
+ "install:lite": "node scripts/install.mjs --clean --components agents,skills,instructions",
12
+ "doctor": "node scripts/doctor.mjs",
13
+ "init": "npx pantheon init",
14
+ "opencode": "OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true opencode",
15
+ "start": "OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true opencode"
16
+ },
17
+ "bin": {
18
+ "pantheon-orchestrator": "./bin/pantheon-init.mjs"
19
+ },
20
+ "files": [
21
+ "LICENSE",
22
+ "scripts/install/*.mjs",
23
+ "scripts/*.py",
24
+ "src/plugin.ts",
25
+ "README.md",
26
+ "src/mcp/*.txt",
27
+ "commands/*.md",
28
+ "src/skills/**/*.txt",
29
+ "src/skills/**/*.md",
30
+ "pantheon.schema.json",
31
+ "skills-lock.json",
32
+ "scripts/*.sh",
33
+ "src/agents/*.md",
34
+ "bin/*.mjs",
35
+ "AGENTS.md",
36
+ "src/mcp/*.py",
37
+ "src/instructions/*.instructions.md",
38
+ "src/mcp/*.mjs",
39
+ "scripts/*.mjs",
40
+ "src/plugins/tui/**",
41
+ "docs/*.md",
42
+ "src/mcp/*.sh",
43
+ "src/routing.yml",
44
+ "src/mcp/requirements*"
45
+ ],
46
+ "dependencies": {
47
+ "js-yaml": "^4.3.0"
48
+ },
49
+ "devDependencies": {
50
+ "@commitlint/cli": "^19.8.0",
51
+ "@commitlint/config-conventional": "^19.8.0",
52
+ "husky": "^9.1.7"
53
+ },
54
+ "repository": {
55
+ "type": "git",
56
+ "url": "https://github.com/ils15/pantheon.git"
57
+ },
58
+ "keywords": [
59
+ "github",
60
+ "copilot",
61
+ "agents",
62
+ "skills",
63
+ "plugin",
64
+ "orchestration"
65
+ ],
66
+ "author": "ils15",
67
+ "license": "MIT",
68
+ "engines": {
69
+ "node": ">=18"
70
+ },
71
+ "preferGlobal": true
72
+ }
@@ -0,0 +1,158 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://pantheon.orchestrator/schema.json",
4
+ "title": "Pantheon Configuration Schema",
5
+ "description": "Configuration schema for Pantheon multi-agent orchestration platform",
6
+ "type": "object",
7
+ "properties": {
8
+ "version": {
9
+ "type": "string",
10
+ "description": "Schema version — must follow semantic versioning (e.g., \"5.0.0\")",
11
+ "pattern": "^\\d+\\.\\d+\\.\\d+$"
12
+ },
13
+ "agents": {
14
+ "type": "object",
15
+ "description": "Per-agent configuration overrides. Keys must match registered agent names.",
16
+ "additionalProperties": {
17
+ "type": "object",
18
+ "properties": {
19
+ "model": {
20
+ "type": "string",
21
+ "description": "Model identifier assigned to this agent (e.g., \"gpt-4o\", \"claude-sonnet-4\")"
22
+ },
23
+ "temperature": {
24
+ "type": "number",
25
+ "minimum": 0,
26
+ "maximum": 2,
27
+ "description": "Sampling temperature (0 = deterministic, 2 = maximum creativity)"
28
+ },
29
+ "disabled": {
30
+ "type": "boolean",
31
+ "description": "If true, the agent is excluded from routing"
32
+ },
33
+ "prompt": {
34
+ "type": "string",
35
+ "description": "Custom system prompt override for this agent"
36
+ }
37
+ },
38
+ "additionalProperties": false
39
+ }
40
+ },
41
+ "presets": {
42
+ "type": "object",
43
+ "description": "Named model presets for quick assignment to agents",
44
+ "additionalProperties": {
45
+ "type": "object",
46
+ "properties": {
47
+ "model": {
48
+ "type": "string",
49
+ "description": "Model identifier (e.g., \"gpt-4o\", \"claude-sonnet-4-20250514\")"
50
+ },
51
+ "temperature": {
52
+ "type": "number",
53
+ "minimum": 0,
54
+ "maximum": 2,
55
+ "description": "Default sampling temperature for this preset"
56
+ },
57
+ "maxTokens": {
58
+ "type": "integer",
59
+ "minimum": 1,
60
+ "maximum": 1048576,
61
+ "description": "Maximum output tokens for this preset"
62
+ }
63
+ },
64
+ "additionalProperties": false
65
+ }
66
+ },
67
+ "disabled_agents": {
68
+ "type": "array",
69
+ "description": "List of agent names to globally disable from routing",
70
+ "items": {
71
+ "type": "string"
72
+ },
73
+ "uniqueItems": true
74
+ },
75
+ "disabled_skills": {
76
+ "type": "array",
77
+ "description": "List of skill names to disable from loading",
78
+ "items": {
79
+ "type": "string"
80
+ },
81
+ "uniqueItems": true
82
+ },
83
+ "disabled_mcps": {
84
+ "type": "array",
85
+ "description": "List of MCP server names to disable from initialization",
86
+ "items": {
87
+ "type": "string"
88
+ },
89
+ "uniqueItems": true
90
+ },
91
+ "skills": {
92
+ "type": "object",
93
+ "description": "Skill loading configuration",
94
+ "properties": {
95
+ "paths": {
96
+ "type": "array",
97
+ "description": "Additional filesystem paths to search for SKILL.md files",
98
+ "items": {
99
+ "type": "string"
100
+ }
101
+ }
102
+ },
103
+ "additionalProperties": false
104
+ },
105
+ "fallback": {
106
+ "type": "array",
107
+ "description": "Ordered model fallback chain. If primary model fails, fallback models are tried in sequence.",
108
+ "items": {
109
+ "type": "object",
110
+ "properties": {
111
+ "model": {
112
+ "type": "string",
113
+ "description": "Fallback model identifier"
114
+ },
115
+ "provider": {
116
+ "type": "string",
117
+ "description": "Provider name (e.g., \"openai\", \"anthropic\", \"google\")"
118
+ }
119
+ },
120
+ "required": ["model"],
121
+ "additionalProperties": false
122
+ },
123
+ "minItems": 1
124
+ },
125
+ "routing": {
126
+ "type": "object",
127
+ "description": "Routing configuration — task-to-agent mapping rules",
128
+ "properties": {
129
+ "default_model": {
130
+ "type": "string",
131
+ "description": "Default model to use when no agent override or preset is matched"
132
+ },
133
+ "rules": {
134
+ "type": "array",
135
+ "description": "Route matching rules evaluated in order (first match wins)",
136
+ "items": {
137
+ "type": "object",
138
+ "properties": {
139
+ "pattern": {
140
+ "type": "string",
141
+ "description": "Task pattern to match (glob or regex)"
142
+ },
143
+ "agent": {
144
+ "type": "string",
145
+ "description": "Target agent name for matched tasks"
146
+ }
147
+ },
148
+ "required": ["pattern", "agent"],
149
+ "additionalProperties": false
150
+ }
151
+ }
152
+ },
153
+ "additionalProperties": false
154
+ }
155
+ },
156
+ "required": ["version"],
157
+ "additionalProperties": false
158
+ }
File without changes
@@ -0,0 +1,68 @@
1
+ # Auto-generated: resolved symlink from ../src/mcp/_pantheon_paths.py
2
+ #!/usr/bin/env python3
3
+ """Pantheon path resolution — global install + project root detection.
4
+
5
+ Provides two functions used by all MCP servers and utility scripts:
6
+
7
+ pantheon_home() -> Path
8
+ Pantheon global installation directory.
9
+ Priority: $PANTHEON_HOME → $XDG_CONFIG_HOME/opencode → ~/.config/opencode
10
+
11
+ pantheon_project() -> Path | None
12
+ Current Pantheon project root.
13
+ Priority: $PANTHEON_PROJECT → os.getcwd() → None (resources disabled)
14
+
15
+ Usage:
16
+ from _pantheon_paths import pantheon_home, pantheon_project
17
+ """
18
+
19
+ from __future__ import annotations
20
+
21
+ import os
22
+ from pathlib import Path
23
+
24
+
25
+ def pantheon_home() -> Path:
26
+ """Return the Pantheon global installation directory.
27
+
28
+ Resolution priority:
29
+ 1. $PANTHEON_HOME env var (explicit user override)
30
+ 2. $XDG_CONFIG_HOME/opencode (XDG Base Directory spec)
31
+ 3. ~/.config/opencode (POSIX default)
32
+
33
+ Returns:
34
+ Absolute Path to the Pantheon global config directory.
35
+ """
36
+ env = os.environ.get("PANTHEON_HOME")
37
+ if env:
38
+ return Path(env).expanduser().resolve()
39
+
40
+ xdg = os.environ.get("XDG_CONFIG_HOME")
41
+ if xdg:
42
+ return Path(xdg).expanduser().resolve() / "opencode"
43
+
44
+ return Path.home() / ".config" / "opencode"
45
+
46
+
47
+ def pantheon_project() -> Path | None:
48
+ """Return the Pantheon project root directory.
49
+
50
+ Resolution priority:
51
+ 1. $PANTHEON_PROJECT env var (explicit override)
52
+ 2. Current working directory (set by MCP client's cwd in opencode.json)
53
+
54
+ Returns:
55
+ Absolute Path to the project root, or None if neither is available
56
+ (project-scoped resources like deepwork/memory-bank are unavailable).
57
+ """
58
+ env = os.environ.get("PANTHEON_PROJECT")
59
+ if env:
60
+ return Path(env).expanduser().resolve()
61
+
62
+ cwd = os.getcwd()
63
+ if cwd:
64
+ return Path(cwd).resolve()
65
+
66
+ return None
67
+
68
+
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env bash
2
+ # check-version-consistency.sh — Verifies all 3 manifests have the same version
3
+ set -euo pipefail
4
+
5
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
+ ROOT="$(dirname "$SCRIPT_DIR")"
7
+
8
+ pkg_ver=$(node -p "require('$ROOT/package.json').version")
9
+ plugin_ver=$(node -p "require('$ROOT/plugin.json').version")
10
+ gh_plugin_ver=$(node -p "require('$ROOT/.github/plugin/plugin.json').version")
11
+
12
+ echo "package.json: $pkg_ver"
13
+ echo "plugin.json: $plugin_ver"
14
+ echo ".github/plugin/plugin.json: $gh_plugin_ver"
15
+
16
+ if [ "$pkg_ver" != "$plugin_ver" ] || [ "$pkg_ver" != "$gh_plugin_ver" ]; then
17
+ echo "❌ Version mismatch across manifests!"
18
+ echo ""
19
+ echo "Fix: run 'node scripts/versioning.mjs apply' to sync all manifests"
20
+ exit 1
21
+ fi
22
+
23
+ echo "✅ All versions match: $pkg_ver"