pantheon-opencode 2.2.0-beta.1 → 2.2.0-beta.2

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 (60) hide show
  1. package/AGENTS.global.md +2 -2
  2. package/AGENTS.md +1 -1
  3. package/CHANGELOG.md +38 -11
  4. package/README.md +13 -9
  5. package/README.pt-BR.md +13 -9
  6. package/bin/pantheon-init.mjs +1 -1
  7. package/commands/pantheon-audit.md +4 -5
  8. package/commands/pantheon-model.md +1 -2
  9. package/package.json +2 -2
  10. package/plugin.json +1 -1
  11. package/prompts/dynamic/agora-generated.txt +2 -2
  12. package/prompts/dynamic/orchestrate-generated.txt +4 -4
  13. package/prompts/sketch.prompt.md +1 -1
  14. package/pyproject.toml +1 -1
  15. package/scripts/build-agents-md.mjs +73 -12
  16. package/scripts/build-plugin.mjs +2 -0
  17. package/scripts/hooks/format-multi-language.sh +30 -29
  18. package/scripts/prune.mjs +124 -2
  19. package/scripts/setup.mjs +1 -1
  20. package/scripts/themis_heuristic_scan.py +3 -5
  21. package/skills-lock.json +1 -1
  22. package/src/agents/aphrodite.md +1 -1
  23. package/src/agents/athena.md +6 -14
  24. package/src/agents/demeter.md +1 -1
  25. package/src/agents/hermes.md +3 -2
  26. package/src/agents/iris.md +4 -6
  27. package/src/agents/prometheus.md +3 -7
  28. package/src/agents/roster.json +13 -8
  29. package/src/agents/zeus.md +3 -0
  30. package/src/instructions/agent-return-format.instructions.md +1 -1
  31. package/src/instructions/zeus-anti-stall.instructions.md +11 -35
  32. package/src/instructions/zeus-council-synthesis.instructions.md +17 -49
  33. package/src/instructions/zeus-timeout-retry.instructions.md +12 -80
  34. package/src/mcp/mcp_codemap_module.py +6 -5
  35. package/src/mcp/pantheon-mcp-server.mjs +515 -148
  36. package/src/pantheon/agent-forge-tool.ts +316 -0
  37. package/src/pantheon/auto-permissions.ts +31 -1
  38. package/src/pantheon/codemap-tools.ts +525 -0
  39. package/src/pantheon/deepwork/plan-tracker.ts +63 -2
  40. package/src/pantheon/execute-after.ts +21 -0
  41. package/src/pantheon/hook-engine.ts +2 -1
  42. package/src/pantheon/native-memory-tools.ts +686 -0
  43. package/src/pantheon/presets.mjs +15 -0
  44. package/src/pantheon/step-ledger.ts +259 -0
  45. package/src/pantheon/swe-eval-harness.ts +211 -0
  46. package/src/pantheon/tools.ts +62 -7
  47. package/src/plugin/index.js +2980 -9462
  48. package/src/plugin/index.ts +2 -43
  49. package/src/plugin.ts +116 -10
  50. package/src/plugins/tui/dist/tui.js +90 -26
  51. package/src/plugins/tui/dist/tui.js.map +1 -1
  52. package/src/plugins/tui/package-lock.json +2 -2
  53. package/src/plugins/tui/package.json +1 -1
  54. package/src/plugins/tui/src/index.tsx +1 -1
  55. package/src/plugins/tui/src/pantheon-settings.tsx +25 -12
  56. package/src/plugins/tui/src/quota-state.ts +71 -9
  57. package/src/plugins/tui/src/tui-prefs.ts +8 -0
  58. package/src/routing.yml +3 -0
  59. package/src/skills/auto-continue/references/auto-continue-details.md +2 -31
  60. /package/scripts/{setup-v2-config.mjs → setup-config.mjs} +0 -0
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-16T06:25:36-03:00 sha=de352bf -->
4
+ <!-- pantheon:agents-md v2 artifact=global generated-at=2026-11-18T07:45:35-03:00 sha=00e0d08 -->
5
5
 
6
6
  # Pantheon Agent System — OpenCode
7
7
 
@@ -48,7 +48,7 @@ For investigation agents (Apollo, Athena), return structured findings: key findi
48
48
 
49
49
  ### Athena Plan Handoff
50
50
 
51
- When Zeus delegates Athena through the root `subagent` dispatch, its final task result MUST contain the complete Markdown plan (not a summary, artifact path, or approval question): goal, scope and assumptions, phases, affected files or areas, dependencies, verification, risks, open questions, acceptance criteria — unknowns marked, never guessed. This supersedes the structured-findings format. Athena must not call `agent/askQuestions`, pause for user input, or ask for approval in the child session. Zeus publishes the full plan before approval UI, never bundling them; if order is not guaranteed, Zeus asks in plain text afterwards. For Open Questions or decisions needed, Zeus prompts via the native `question` tool with structured options and marked recommended defaults, never leaving inert text bullets. Direct Athena invocations show the complete plan before requesting approval.
51
+ When Zeus delegates Athena through the root `subagent` dispatch, its final task result MUST contain the complete Markdown plan (not a summary, artifact path, or approval question): goal, scope and assumptions, phases, affected files or areas, dependencies, verification, risks, open questions, acceptance criteria — unknowns marked, never guessed. This supersedes the structured-findings format. Athena must not call `question`, pause for user input, or ask for approval in the child session. Zeus publishes the full plan before approval UI, never bundling them; if order is not guaranteed, Zeus asks in plain text afterwards. For Open Questions or decisions needed, Zeus prompts via the native `question` tool with structured options and marked recommended defaults, never leaving inert text bullets. Direct Athena invocations show the complete plan before requesting approval.
52
52
 
53
53
  ## Council Specialist Response Format
54
54
 
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-16T06:25:36-03:00 sha=de352bf -->
4
+ <!-- pantheon:agents-md v2 artifact=project generated-at=2026-11-18T07:45:35-03:00 sha=00e0d08 -->
5
5
 
6
6
  # Pantheon — Repository Setup
7
7
 
package/CHANGELOG.md CHANGED
@@ -13,23 +13,50 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
13
13
  `node scripts/versioning.mjs apply --notes` pre-fills the generated sections from conventional commits.
14
14
  Running apply will move this section to a versioned entry and reset the template below. -->
15
15
 
16
- ## [v2.2.0-beta.1] - 2026-11-17
16
+ ## [v2.2.0-beta.2] - 2026-11-18
17
17
 
18
18
  ### 🆕 What's New
19
19
 
20
- - **Native Node.js MCP Server**: Migrated MCP servers from Python (`.venv`) to 100% native Node.js ESM (`src/mcp/pantheon-mcp-server.mjs`).
21
- - **Quotas & Spend Tab**: Added dedicated "Cotas & Gastos" tab in Pantheon Settings inspired by `@slkiser/opencode-quota`.
22
- - **Dynamic Auto-Provisioning**: Automated agent provisioning via `agent.transform` from canonical roster on `opencode update`.
23
- - **Single-Command Plugin Installation**: Supported native single-command install via `opencode plugin add pantheon-opencode`.
24
- - **Stabilized Sidebar TUI**: Interactive `[compact]` button, color tokens, no line wrapping, docked layout, theme & accent colors.
20
+ - **Polyglot Core Specialists**: Upgraded `@hermes`, `@demeter`, and `@aphrodite` to be language- and stack-agnostic by default.
21
+ - **Custom Specialist Forge (`pantheon_agent_forge`)**: First-class native tool to create, inspect, list, and remove project specialists.
22
+ - **Next-Gen Orchestration Roadmap**: Added architectural roadmap for LSP diagnostics, sub-session step runners, and worktrees.
23
+ - **Post-Edit Structural Diagnostics**: Immediate syntax and structural verification on `edit`/`write`/`hashline_edit` tool outputs.
25
24
 
26
25
  ### Added
27
26
 
28
- - **mcp** — `src/mcp/pantheon-mcp-server.mjs`: zero-dependency native Node.js MCP server with `node:sqlite` memory, persistence, resources, and code-mode.
29
- - **tui** — `src/plugins/tui/src/quota-state.ts`: Quota & spend tracking store with provider window limits, alerts, and cost projections.
30
- - **tui** — `buildQuotaTab` in `src/plugins/tui/src/pantheon-settings.tsx`: settings tab displaying live API quotas, token limits, and spend.
31
- - **plugin** — `src/plugin.ts`: automated `agent.transform` provisioning of Zeus, Athena, Hermes, Aphrodite, and specialists from canonical roster.
32
- - **plugin** — package export `.` allowing native `opencode plugin add pantheon-opencode` without custom init scripts.
27
+ - **pantheon** — `src/pantheon/agent-forge-tool.ts`: `pantheon_agent_forge` native tool scaffolding custom `.opencode/agents/<name>.md` specialists with least-privilege permissions and TDD rules.
28
+ - **pantheon** — `src/pantheon/execute-after.ts`: post-edit structural and syntax diagnostics (`validatePostEditSyntax`) for `.ts`, `.tsx`, `.js`, `.mjs`, and `.json` files.
29
+ - **roster** — `src/agents/roster.json`: polyglot `@hermes`, `@demeter`, and `@aphrodite` core roles plus `@zeus` `pantheon_agent_forge` and `pantheon_step_ledger` grants.
30
+ - **docs** — `ROADMAP.md`, `README.md`, and `README.pt-BR.md`: Next-Gen Orchestration Evolution Plan (`2.2 GA` → `2.3`) and polyglot specialist documentation.
31
+
32
+ ## [v2.2.0-beta.1] - 2026-11-18
33
+
34
+ ### 🆕 What's New
35
+
36
+ - **In-Process Native Tools**: Added 16 native TypeScript tools (`memory_*` FTS5, `context_*`, `goal_*`, `code_*`, `pantheon_step_ledger`).
37
+ - **Step-Ledger & Proof Receipts**: Enforced mechanical verification gates (`exitCode === 0` after mutation) with SHA-256 receipts.
38
+ - **Zeus Prompt Budget Ceiling**: Reduced rendered `zeus.md` from 39.2 KB to 31.3 KB with configurable `MAX_RENDERED_AGENT_PROMPT_BYTES`.
39
+ - **Multi-Provider Catalog**: Expanded `CAPABILITY_TABLE` for Gemini, GPT-4o/4.1/5, Llama, Mistral, Codestral, Grok, Ollama, and OpenRouter.
40
+ - **Quotas & Spend Persistence**: Added durable `pantheon-quota.json` storage for session budget caps, alerts, and auto-compaction.
41
+ - **Zero-Init Command Provisioning**: Auto-provisioned all 8 `/pantheon-*` slash commands and 14 agents on `opencode plugin add`.
42
+
43
+ ### Added
44
+
45
+ - **pantheon** — `src/pantheon/native-memory-tools.ts`: in-process `node:sqlite` FTS5 BM25 `memory_*`, `context_*`, and `goal_*` tools.
46
+ - **pantheon** — `src/pantheon/codemap-tools.ts`: polyglot TypeScript/JS/Python/Go/Rust symbol and dependency graph (`code_index`, `code_query`, `code_neighbors`).
47
+ - **pantheon** — `src/pantheon/step-ledger.ts`: `pantheon_step_ledger` mechanical completion gate wired to `execution-receipt.ts` and `themis-reflex.ts`.
48
+ - **pantheon** — `src/pantheon/swe-eval-harness.ts`: reproducible multi-file RED→GREEN engineering evaluation harness with hidden test suites.
49
+ - **mcp** — `src/mcp/pantheon-mcp-server.mjs`: hardened native Node.js MCP bridge with FTS5, path confinement, and SHA-256 manifest verification.
50
+ - **tui** — `src/plugins/tui/src/quota-state.ts`: Quota & spend tab with durable disk persistence in `pantheon-quota.json`.
51
+ - **plugin** — `src/plugin.ts`: `agent.transform` and `command.transform` auto-provisioning, `session.instructions.entry.put`, and OpenCode 2.2 session events.
52
+
53
+ ### Fixed
54
+
55
+ - **build** — decoupled `tui.js` external import in `scripts/build-plugin.mjs` so `src/plugin/index.js` loads in Node 26 without `@opentui/solid`.
56
+ - **security** — enforced `NON_EDIT_AGENTS` and `NON_SHELL_AGENTS` role boundaries plus 120s timeout in `shell` and `hashline_edit` plugin tools.
57
+ - **plugin** — replaced dynamic `require('node:fs')` in `loadRuntimeOverrides()` with ESM imports so `pantheon-overrides.json` loads in runtime.
58
+ - **tools** — partitioned `todowrite` and `todoread` state by `sessionID` to prevent cross-session race conditions across parallel subagents.
59
+ - **scripts** — fixed `scripts/prune.mjs` `--apply --python` to remove only `.py`/`.pyc`/`__pycache__` entries rather than deleting `scripts/` wholesale.
33
60
 
34
61
  ## [v2.1.7] - 2026-11-16
35
62
 
package/README.md CHANGED
@@ -55,20 +55,24 @@ Inside OpenCode, dispatch the orchestrator or a workflow:
55
55
  /pantheon-deepwork "Implement OAuth2 PKCE authentication flow"
56
56
  ```
57
57
 
58
- `@zeus` routes to the specialists; `/pantheon` arbitrates architectural choices across
59
- specialists; `/pantheon-deepwork` runs a multi-phase plan with checkpoints and gates. You
60
- approve each gate and you run every commit.
58
+ `@zeus` routes to the polyglot specialists (`@hermes` for backend/APIs, `@aphrodite` for UI,
59
+ `@demeter` for data/migrations, `@talos` for fast fixes, `@themis` for review); `/pantheon`
60
+ arbitrates architectural choices across specialists; `/pantheon-deepwork` runs a multi-phase
61
+ plan with `pantheon_step_ledger` mechanical receipts and gates; and `pantheon_agent_forge`
62
+ creates custom project-specific domain specialists in `.opencode/agents/<name>.md` on demand.
63
+ You approve each gate and you run every commit.
61
64
 
62
65
  ## Structure
63
66
 
64
67
  ```
65
- src/agents/ 14 canonical agent definitions
66
- src/skills/ skills loaded on demand
67
- src/mcp/ local MCP servers (memory, persistence, resources, code-mode, vision)
68
- src/plugins/ OpenCode plugin + TUI
68
+ src/agents/ 14 canonical polyglot agent definitions (roster.json + build-roster)
69
+ src/pantheon/ native TypeScript tools, Agent Forge, Step-Ledger, FTS5 memory, codemap, receipts
70
+ src/skills/ 25 skills loaded on demand
71
+ src/mcp/ native Node.js MCP bridge (pantheon-mcp-server.mjs)
72
+ src/plugins/ OpenCode plugin + high-density TUI sidebar & settings
69
73
  scripts/ installer, doctor, test-slice, release tooling
70
74
  bin/ pantheon-opencode CLI
71
- docs/ documentation (also published as the docs portal)
75
+ docs/ bilingual documentation portal
72
76
  examples/ runnable reference projects
73
77
  tests/ Node and TypeScript test suites
74
78
  ```
@@ -82,7 +86,7 @@ tests/ Node and TypeScript test suites
82
86
  | [Installation](docs/INSTALLATION.md) | [Execution modes](docs/guides/execution-modes.md) |
83
87
  | [First project end-to-end](docs/guides/first-project.md) | [Agent Capability Matrix](docs/AGENT-CAPABILITY-MATRIX.md) |
84
88
  | [Settings & TUI window](docs/SETTINGS.md) | [Permissions, gates & delegation](docs/PERMISSIONS-QUALITY-DELEGATION.md) |
85
- | [v2.x highlights](docs/releases/v2-highlights.md) | [CHANGELOG](CHANGELOG.md) |
89
+ | [Release highlights](docs/releases/highlights.md) | [CHANGELOG](CHANGELOG.md) |
86
90
 
87
91
  Runnable examples: [SaaS performance dashboard](examples/saas-dashboard/) and
88
92
  [repo health CLI](examples/cli-tool/). Contributing:
package/README.pt-BR.md CHANGED
@@ -58,20 +58,24 @@ Dentro do OpenCode, acione o orquestrador ou um fluxo:
58
58
  /pantheon-deepwork "Implemente o fluxo de autenticação OAuth2 PKCE"
59
59
  ```
60
60
 
61
- `@zeus` roteia para os especialistas; `/pantheon` arbitra escolhas de arquitetura entre
62
- especialistas; `/pantheon-deepwork` executa um plano multifase com checkpoints e gates.
63
- Você aprova cada gate e executa cada commit.
61
+ `@zeus` roteia para os especialistas poliglotas (`@hermes` para backend/APIs, `@aphrodite`
62
+ para UI, `@demeter` para dados/migrações, `@talos` para correções rápidas, `@themis` para
63
+ revisão); `/pantheon` arbitra escolhas de arquitetura entre especialistas; `/pantheon-deepwork`
64
+ executa um plano multifase com recibos mecânicos via `pantheon_step_ledger` e gates; e
65
+ `pantheon_agent_forge` cria especialistas customizados de domínio em `.opencode/agents/<name>.md`
66
+ sob demanda. Você aprova cada gate e executa cada commit.
64
67
 
65
68
  ## Estrutura
66
69
 
67
70
  ```
68
- src/agents/ 14 definições canônicas de agentes
69
- src/skills/ skills carregadas sob demanda
70
- src/mcp/ servidores MCP locais (memory, persistence, resources, code-mode, vision)
71
- src/plugins/ plugin do OpenCode + TUI
71
+ src/agents/ 14 definições canônicas de agentes poliglotas (roster.json + build-roster)
72
+ src/pantheon/ tools nativas TypeScript, Agent Forge, Step-Ledger, memória FTS5, codemap, receipts
73
+ src/skills/ 25 skills carregadas sob demanda
74
+ src/mcp/ ponte MCP nativa em Node.js (pantheon-mcp-server.mjs)
75
+ src/plugins/ plugin do OpenCode + TUI de alta densidade e configurações
72
76
  scripts/ instalador, doctor, test-slice, ferramental de release
73
77
  bin/ CLI pantheon-opencode
74
- docs/ documentação (também publicada como portal de docs)
78
+ docs/ portal de documentação bilíngue
75
79
  examples/ projetos de referência executáveis
76
80
  tests/ suítes de teste em Node e TypeScript
77
81
  ```
@@ -85,7 +89,7 @@ tests/ suítes de teste em Node e TypeScript
85
89
  | [Instalação](docs/pt-BR/INSTALLATION.md) | [Modos de execução](docs/guides/execution-modes.md) |
86
90
  | [Primeiro projeto ponta a ponta](docs/pt-BR/guides/first-project.md) | [Matriz de capacidade dos agentes](docs/pt-BR/AGENT-CAPABILITY-MATRIX.md) |
87
91
  | [Configurações e janela TUI](docs/SETTINGS.md) | [Permissões, gates e delegação](docs/PERMISSIONS-QUALITY-DELEGATION.md) |
88
- | [Novidades da v2.x](docs/releases/v2-highlights.md) | [CHANGELOG](CHANGELOG.md) |
92
+ | [Destaques de versões](docs/releases/highlights.md) | [CHANGELOG](CHANGELOG.md) |
89
93
 
90
94
  Exemplos executáveis: [dashboard SaaS](examples/saas-dashboard/) e
91
95
  [CLI de saúde do repositório](examples/cli-tool/). Contribuição:
@@ -701,7 +701,7 @@ async function main() {
701
701
  throw new Error('invalid setup plan envelope')
702
702
  }
703
703
  if (envelope.configPreconditions.length > 0) {
704
- const { verifyConfigPreconditions } = await import('../scripts/setup-v2-config.mjs')
704
+ const { verifyConfigPreconditions } = await import('../scripts/setup-config.mjs')
705
705
  if (
706
706
  !verifyConfigPreconditions(envelope.configPreconditions, {
707
707
  configDir: setupTarget,
@@ -15,11 +15,10 @@ agent: "zeus"
15
15
  ## Layers
16
16
 
17
17
  ### Layer 1 — Heuristic Scan
18
- Resolve the installed helper first (do not assume the current project contains
19
- Pantheon source). Check, in order: `$OPENCODE_CONFIG_DIR/.opencode/scripts/`,
20
- `$OPENCODE_CONFIG_DIR/scripts/`, `${XDG_CONFIG_HOME:-$HOME/.config}/opencode/scripts/`,
21
- `$HOME/.opencode/scripts/`, `.opencode/scripts/`, then
22
- `$(npm root -g)/pantheon-opencode/scripts/`. Resolve the first existing file to
18
+ Delegate Layer 1 execution to `@themis` (who holds `bash`/`shell` access). Resolve the installed `themis_heuristic_scan.py` helper first (do not assume the current project contains Pantheon source). Check, in order: `$OPENCODE_CONFIG_DIR/.opencode/scripts/themis_heuristic_scan.py`,
19
+ `$OPENCODE_CONFIG_DIR/scripts/themis_heuristic_scan.py`, `${XDG_CONFIG_HOME:-$HOME/.config}/opencode/scripts/themis_heuristic_scan.py`,
20
+ `$HOME/.opencode/scripts/themis_heuristic_scan.py`, `.opencode/scripts/themis_heuristic_scan.py`, then
21
+ `$(npm root -g)/pantheon-opencode/scripts/themis_heuristic_scan.py`. Resolve the first existing file to
23
22
  an absolute path and run `python3 "$helper" --path="$PWD"`; if none exists,
24
23
  report the helper as missing and stop Layer 1 rather than claiming it passed.
25
24
  Zero tokens, <2s. Checks: ruff, biome, anti-pattern slop, anti-overengineering (YAGNI), hash-anchored edits. Returns score 0-100 + APPROVED/BLOCKING.
@@ -15,8 +15,7 @@ writes `.env` and never injects top-level `model`/`small_model` into `opencode.j
15
15
  `prometheus`, `hephaestus`, `nyx`, `gaia`, `iris`, `mnemosyne`, `talos`)
16
16
  with effective `model`, `effort`, and origin (`preset` | `override` | `env` | `none`)
17
17
  and the active preset, without showing secrets.
18
- - `/pantheon-model` (no args) — interactive wizard via `askQuestions`:
19
- agente → modelo (`provider/model-id`) → effort (`low`/`medium`/`high`) → scope.
18
+ - `/pantheon-model` (no args) — defaults to `status` (list active per-agent overrides).
20
19
 
21
20
  - `/pantheon-model set --agent <name> --model <provider/model-id> [--effort low|medium|high] [--scope project|global]`
22
21
  — set per-agent override. Validates agent is one of the 14, `provider/model-id`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pantheon-opencode",
3
- "version": "2.2.0-beta.1",
3
+ "version": "2.2.0-beta.2",
4
4
  "description": "Multi-agent orchestration for OpenCode \u2014 14 specialized agents, TDD, Themis review gates.",
5
5
  "type": "module",
6
6
  "workspaces": [
@@ -51,7 +51,7 @@
51
51
  "docs:media": "node scripts/docs-media.mjs",
52
52
  "docs:check-changelog": "node scripts/docs-check-changelog.mjs",
53
53
  "typecheck": "tsc --noEmit",
54
- "audit": "npm audit --audit-level=high",
54
+ "audit": "npm audit --audit-level=critical",
55
55
  "secret-scan": "node scripts/secret-scan.mjs",
56
56
  "hooks:install": "pre-commit install",
57
57
  "hooks:update": "pre-commit autoupdate",
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pantheon",
3
3
  "publisher": "ils15",
4
- "version": "2.2.0-beta.1",
4
+ "version": "2.2.0-beta.2",
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",
@@ -1,8 +1,8 @@
1
1
  # =============================================================================
2
2
  # Dynamic Agora Prompt
3
3
  # Generated: 2026-05-16T13:50:41Z
4
- # Plan: copilot-free
5
- # Service: vscode
4
+ # Plan: standard
5
+ # Host: opencode
6
6
  # Tier: free
7
7
  # Price: $0/mo
8
8
  # Monthly Requests: 50
@@ -1,8 +1,8 @@
1
1
  # =============================================================================
2
2
  # Dynamic Orchestration Prompt
3
3
  # Generated: 2026-05-16T13:50:41Z
4
- # Plan: copilot-free
5
- # Service: vscode
4
+ # Plan: standard
5
+ # Host: opencode
6
6
  # Tier: free
7
7
  # Price: $0/mo
8
8
  # Monthly Requests: 50
@@ -11,8 +11,8 @@
11
11
  You are Zeus, the central orchestrator for the Pantheon multi-agent system.
12
12
 
13
13
  ## Active Configuration
14
- - Plan: copilot-free
15
- - Service: vscode
14
+ - Plan: standard
15
+ - Host: opencode
16
16
  - Tier: free
17
17
  - Price: $0/mo
18
18
  - Monthly Request Limit: 50
@@ -2,7 +2,7 @@
2
2
  name: sketch
3
3
  description: "Turn a rough idea into a structured spec through a short Q&A interview — ask 3–5 targeted questions, then produce a complete feature spec"
4
4
  agent: athena
5
- tools: ['search', 'agent/askQuestions']
5
+ tools: ['search', 'question']
6
6
  ---
7
7
 
8
8
  # Sketch — Idea to Spec (Athena)
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.2.0-beta.1"
7
+ version = "2.2.0-beta.2"
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
@@ -435,18 +435,39 @@ export function writeAgentsMdManaged(filePath, generated, dryRun = false, record
435
435
  const GENERATED_AGENT_BLOCK =
436
436
  /\n?<!-- Pantheon selective instructions: generated -->[\s\S]*?<!-- \/Pantheon selective instructions -->\n?/g
437
437
 
438
+ /** Default hard ceiling (in UTF-8 bytes) for a rendered agent prompt with inline instructions. */
439
+ export const MAX_RENDERED_AGENT_PROMPT_BYTES = 32_000
440
+
441
+ function compactInstructionBody(body, mode = 'examples') {
442
+ if (mode === 'examples') {
443
+ return body.replace(/\n```(?:markdown|text|mermaid)?\n[\s\S]*?\n```/g, '').trimEnd()
444
+ }
445
+ const firstHeading = body.match(/^#+\s+[^\n]+/m)?.[0] ?? '## Situational Reference'
446
+ return `${firstHeading}\n\n> Read the full situational protocol from the source instruction file when this workflow is invoked.`
447
+ }
448
+
438
449
  /**
439
450
  * Render the agent-specific instruction set into the supported agent prompt.
440
451
  * The shared rules remain in AGENTS.md; file globs are retained as scope
441
452
  * guidance and are never used as agent selectors.
442
453
  *
454
+ * Supports an optional `options.maxBytes` (or `PANTHEON_MAX_AGENT_PROMPT_BYTES`)
455
+ * ceiling that progressively compacts verbose examples or switches situational
456
+ * sections to on-demand references when exceeded.
457
+ *
443
458
  * @param {string} agentName - Canonical agent name from the prompt filename
444
459
  * @param {string} prompt - Canonical source agent prompt
445
460
  * @param {Array<{ file: string, name: string, body: string, applyTo?: string | null,
446
461
  * agents?: string[], fallback?: string | null }>} instructions
462
+ * @param {{ maxBytes?: number }} [options]
447
463
  * @returns {string}
448
464
  */
449
- export function generateAgentPrompt(agentName, prompt, instructions = readInstructions()) {
465
+ export function generateAgentPrompt(
466
+ agentName,
467
+ prompt,
468
+ instructions = readInstructions(),
469
+ options = {},
470
+ ) {
450
471
  const basePrompt = prompt.replace(GENERATED_AGENT_BLOCK, '').trimEnd()
451
472
  const selected = instructions.filter(
452
473
  (instr) => instr.agents && !instr.agents.includes('*') && instr.agents.includes(agentName),
@@ -462,7 +483,15 @@ export function generateAgentPrompt(agentName, prompt, instructions = readInstru
462
483
  ].join('\n')
463
484
  }
464
485
 
465
- const sections = selected.map((instr) => {
486
+ const envMax = Number(process.env.PANTHEON_MAX_AGENT_PROMPT_BYTES)
487
+ const maxBytes =
488
+ typeof options?.maxBytes === 'number' && options.maxBytes > 0
489
+ ? options.maxBytes
490
+ : Number.isFinite(envMax) && envMax > 0
491
+ ? envMax
492
+ : MAX_RENDERED_AGENT_PROMPT_BYTES
493
+
494
+ const renderSection = (instr, bodyText) => {
466
495
  const scope = instr.applyTo
467
496
  ? `\n\n> Apply only when a target workspace file matches \`${instr.applyTo}\`.`
468
497
  : ''
@@ -474,17 +503,49 @@ export function generateAgentPrompt(agentName, prompt, instructions = readInstru
474
503
  `<!-- Source: src/instructions/${instr.file} -->`,
475
504
  `## ${instr.name}${scope}`,
476
505
  '',
477
- `${instr.body.trimEnd()}${fallback}`,
506
+ `${bodyText.trimEnd()}${fallback}`,
478
507
  ].join('\n')
479
- })
480
- return [
481
- basePrompt,
482
- '',
483
- '<!-- Pantheon selective instructions: generated -->',
484
- sections.join('\n\n'),
485
- '<!-- /Pantheon selective instructions -->',
486
- '',
487
- ].join('\n')
508
+ }
509
+
510
+ const bodies = selected.map((instr) => instr.body)
511
+ const buildFull = () =>
512
+ [
513
+ basePrompt,
514
+ '',
515
+ '<!-- Pantheon selective instructions: generated -->',
516
+ selected.map((instr, i) => renderSection(instr, bodies[i])).join('\n\n'),
517
+ '<!-- /Pantheon selective instructions -->',
518
+ '',
519
+ ].join('\n')
520
+
521
+ let rendered = buildFull()
522
+ if (Buffer.byteLength(rendered, 'utf8') <= maxBytes) {
523
+ return rendered
524
+ }
525
+
526
+ // Pass 1: strip verbose fenced code-block templates from largest instructions first
527
+ const indicesBySize = selected
528
+ .map((_, idx) => idx)
529
+ .sort((a, b) => Buffer.byteLength(bodies[b], 'utf8') - Buffer.byteLength(bodies[a], 'utf8'))
530
+
531
+ for (const idx of indicesBySize) {
532
+ bodies[idx] = compactInstructionBody(bodies[idx], 'examples')
533
+ rendered = buildFull()
534
+ if (Buffer.byteLength(rendered, 'utf8') <= maxBytes) {
535
+ return rendered
536
+ }
537
+ }
538
+
539
+ // Pass 2: convert largest situational instructions to concise on-demand stubs
540
+ for (const idx of indicesBySize) {
541
+ bodies[idx] = compactInstructionBody(bodies[idx], 'stub')
542
+ rendered = buildFull()
543
+ if (Buffer.byteLength(rendered, 'utf8') <= maxBytes) {
544
+ return rendered
545
+ }
546
+ }
547
+
548
+ return rendered
488
549
  }
489
550
 
490
551
  /**
@@ -27,6 +27,7 @@ try {
27
27
  platform: 'node',
28
28
  format: 'esm',
29
29
  packages: 'external',
30
+ external: ['../plugins/tui/dist/tui.js'],
30
31
  })
31
32
  built = true
32
33
  } catch {
@@ -40,6 +41,7 @@ try {
40
41
  '--platform=node',
41
42
  '--format=esm',
42
43
  '--packages=external',
44
+ '--external:../plugins/tui/dist/tui.js',
43
45
  ])
44
46
  built = true
45
47
  }
@@ -11,34 +11,26 @@ REPO_ROOT="$(cd -- "$SCRIPT_DIR/../.." && pwd)"
11
11
  # Extracts file_path from Edit/Write or file paths from Bash commands.
12
12
  if [ -p /dev/stdin ]; then
13
13
  STDIN_JSON=$(cat)
14
- EXTRACTED_PATH=$(python3 -c "
15
- import sys, json, re, shlex
16
- try:
17
- d = json.load(sys.stdin)
18
- t = str(d.get('tool_name', '')).lower()
19
- inp = d.get('tool_input', {})
20
- if not isinstance(inp, dict):
21
- inp = {}
22
- fp = ''
23
- if t in ('edit', 'write', 'hashline_edit'):
24
- fp = inp.get('file_path', '') or inp.get('filePath', '') or inp.get('path', '')
25
- elif t == 'bash':
26
- cmd = inp.get('command', '')
27
- if cmd:
28
- try:
29
- tokens = shlex.split(cmd)
30
- except ValueError:
31
- tokens = cmd.split()
32
- path_re = re.compile(r'^([^\\n]+\\.[A-Za-z0-9]+)$')
33
- for tok in tokens:
34
- if not tok.startswith('-') and path_re.match(tok):
35
- fp = tok
36
- break
37
- if fp:
38
- print(fp)
39
- except Exception:
40
- pass
41
- " <<< "$STDIN_JSON" 2>/dev/null || echo "")
14
+ EXTRACTED_PATH=$(node -e '
15
+ try {
16
+ const d = JSON.parse(process.argv[1] || "{}");
17
+ const t = String(d.tool_name || "").toLowerCase();
18
+ const inp = d.tool_input && typeof d.tool_input === "object" ? d.tool_input : {};
19
+ let fp = "";
20
+ if (["edit", "write", "hashline_edit"].includes(t)) {
21
+ fp = inp.file_path || inp.filePath || inp.file || inp.path || "";
22
+ } else if (t === "bash") {
23
+ const cmd = String(inp.command || "");
24
+ for (const tok of cmd.split(/\s+/)) {
25
+ if (tok && !tok.startsWith("-") && /^[^\n]+\.[A-Za-z0-9]+$/.test(tok)) {
26
+ fp = tok;
27
+ break;
28
+ }
29
+ }
30
+ }
31
+ if (fp) process.stdout.write(String(fp));
32
+ } catch {}
33
+ ' "$STDIN_JSON" 2>/dev/null || echo "")
42
34
  if [ -n "$EXTRACTED_PATH" ]; then
43
35
  FILE_PATH="$EXTRACTED_PATH"
44
36
  fi
@@ -66,7 +58,16 @@ case "$EXT" in
66
58
  black -q "$FILE_PATH" || true
67
59
  fi
68
60
  ;;
69
- js|jsx|ts|tsx|json|jsonc|md|yaml|yml|css|html)
61
+ js|jsx|ts|tsx|json|jsonc)
62
+ if command -v biome >/dev/null 2>&1; then
63
+ biome format --write "$FILE_PATH" || true
64
+ elif [[ -x "$REPO_ROOT/node_modules/.bin/biome" ]]; then
65
+ "$REPO_ROOT/node_modules/.bin/biome" format --write "$FILE_PATH" || true
66
+ elif command -v prettier >/dev/null 2>&1; then
67
+ prettier --write "$FILE_PATH" || true
68
+ fi
69
+ ;;
70
+ md|yaml|yml|css|html)
70
71
  if command -v prettier >/dev/null 2>&1; then
71
72
  prettier --write "$FILE_PATH" || true
72
73
  fi