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/scripts/prune.mjs CHANGED
@@ -232,6 +232,72 @@ export function findLegacyInstallDir(configDir) {
232
232
  )
233
233
  }
234
234
 
235
+ // ---------------------------------------------------------------------------
236
+ // (d) Legacy Python / FastMCP artifacts and obsolete builds
237
+ // → With Pantheon v2.2+, all MCPs migrated to native TypeScript/Node.js.
238
+ // The config .venv, scripts/*.py, and standalone TUI clone are dead weight.
239
+ // ---------------------------------------------------------------------------
240
+
241
+ export function findLegacyPythonArtifacts(configDir, pythonFlag = false) {
242
+ if (!existsSync(configDir)) return
243
+
244
+ // 1. .venv in config dir
245
+ const venvDir = join(configDir, '.venv')
246
+ if (existsSync(venvDir)) {
247
+ add(
248
+ 'legacy-python-venv',
249
+ venvDir,
250
+ 'obsolete Python virtual environment (~150MB); MCP servers now run on native Node.js',
251
+ pythonFlag ? 'remove' : 'list',
252
+ )
253
+ }
254
+
255
+ // 2. scripts/ in config dir with .py files
256
+ const scriptsDir = join(configDir, 'scripts')
257
+ if (existsSync(scriptsDir)) {
258
+ try {
259
+ const files = readdirSync(scriptsDir)
260
+ const pyFiles = files.filter(
261
+ (f) => f.endsWith('.py') || f.endsWith('.pyc') || f === '__pycache__',
262
+ )
263
+ if (pyFiles.length > 0) {
264
+ add(
265
+ 'legacy-python-scripts',
266
+ scriptsDir,
267
+ `legacy Python MCP scripts (${pyFiles.length} file(s) replaced by src/mcp/pantheon-mcp-server.mjs)`,
268
+ pythonFlag ? 'remove' : 'list',
269
+ )
270
+ }
271
+ } catch {
272
+ // ignore
273
+ }
274
+ }
275
+
276
+ // 3. requirements-vision.txt or requirements*.txt
277
+ for (const name of ['requirements-vision.txt', 'requirements.txt']) {
278
+ const reqFile = join(configDir, name)
279
+ if (existsSync(reqFile)) {
280
+ add(
281
+ 'legacy-python-reqs',
282
+ reqFile,
283
+ 'obsolete Python pip requirements file',
284
+ pythonFlag ? 'remove' : 'list',
285
+ )
286
+ }
287
+ }
288
+
289
+ // 4. legacy standalone pantheon-tui clone
290
+ const legacyTui = join(configDir, 'plugins', 'pantheon-tui')
291
+ if (existsSync(legacyTui)) {
292
+ add(
293
+ 'legacy-tui-dir',
294
+ legacyTui,
295
+ 'legacy standalone pantheon-tui clone (~500MB); now bundled directly in pantheon-opencode',
296
+ pythonFlag ? 'remove' : 'list',
297
+ )
298
+ }
299
+ }
300
+
235
301
  // ---------------------------------------------------------------------------
236
302
  // Deepwork & Worktrees prune
237
303
  // ---------------------------------------------------------------------------
@@ -309,12 +375,14 @@ export function runPrune({
309
375
  removeDirs,
310
376
  deepwork,
311
377
  worktrees,
378
+ python,
312
379
  }) {
313
380
  findings.length = 0
314
381
  findLegacyGlobalInstalls()
315
382
  findStaleBackups(configDir, maxAgeDays)
316
383
  findLegacyDirs(configDir)
317
384
  findLegacyInstallDir(configDir)
385
+ findLegacyPythonArtifacts(configDir, python)
318
386
  if (deepwork || repoDir) {
319
387
  findStaleDeepwork(repoDir || _ROOT, maxAgeDays, deepwork)
320
388
  }
@@ -324,7 +392,7 @@ export function runPrune({
324
392
 
325
393
  console.log(`Pantheon prune — config dir: ${configDir}`)
326
394
  console.log(
327
- ` mode: ${apply ? 'APPLY' : 'DRY-RUN'}${removeDirs ? ' + REMOVE-DIRS' : ''}${deepwork ? ' + DEEPWORK' : ''}${worktrees ? ' + WORKTREES' : ''}`,
395
+ ` mode: ${apply ? 'APPLY' : 'DRY-RUN'}${removeDirs ? ' + REMOVE-DIRS' : ''}${deepwork ? ' + DEEPWORK' : ''}${worktrees ? ' + WORKTREES' : ''}${python ? ' + PYTHON' : ''}`,
328
396
  )
329
397
  console.log('')
330
398
 
@@ -337,6 +405,57 @@ export function runPrune({
337
405
  let remain = 0
338
406
  for (const f of findings) {
339
407
  console.log(` ${format(f)}`)
408
+ if (f.type === 'legacy-python-scripts') {
409
+ if (apply && python) {
410
+ try {
411
+ const entries = readdirSync(f.target)
412
+ for (const entry of entries) {
413
+ if (entry.endsWith('.py') || entry.endsWith('.pyc') || entry === '__pycache__') {
414
+ rmSync(join(f.target, entry), { recursive: true, force: true })
415
+ }
416
+ }
417
+ if (readdirSync(f.target).length === 0) {
418
+ rmSync(f.target, { recursive: true, force: true })
419
+ }
420
+ console.log(' → removed (--python)')
421
+ removed++
422
+ continue
423
+ } catch (err) {
424
+ console.log(` → failed: ${err.message}`)
425
+ remain++
426
+ continue
427
+ }
428
+ }
429
+ if (!apply && python) {
430
+ removed++
431
+ continue
432
+ }
433
+ console.log(' → kept: removal requires --apply --python')
434
+ remain++
435
+ continue
436
+ }
437
+ if (f.type.startsWith('legacy-python') || f.type === 'legacy-tui-dir') {
438
+ if (apply && python) {
439
+ try {
440
+ rmSync(f.target, { recursive: true, force: true })
441
+ console.log(' → removed (--python)')
442
+ removed++
443
+ continue
444
+ } catch (err) {
445
+ console.log(` → failed: ${err.message}`)
446
+ remain++
447
+ continue
448
+ }
449
+ }
450
+ if (!apply && python) {
451
+ removed++
452
+ continue
453
+ }
454
+ console.log(' → kept: removal requires --apply --python')
455
+ remain++
456
+ continue
457
+ }
458
+
340
459
  if (f.action === 'remove' && apply) {
341
460
  try {
342
461
  rmSync(f.target, { recursive: true, force: true })
@@ -354,7 +473,7 @@ export function runPrune({
354
473
  removed++
355
474
  continue
356
475
  }
357
- if (f.action === 'list' && apply && removeDirs) {
476
+ if (f.type === 'legacy-dir' && apply && removeDirs) {
358
477
  try {
359
478
  rmSync(f.target, { recursive: true, force: true })
360
479
  console.log(' → removed (--remove-dirs)')
@@ -399,6 +518,7 @@ Options:
399
518
  --apply Remove stale backups (default: dry-run, list only)
400
519
  --remove-dirs With --apply, also remove legacy directories
401
520
  (explicit confirmation; default: list only)
521
+ --python Find and remove obsolete Python artifacts (.venv, scripts, reqs)
402
522
  --deepwork Find and remove stale deepwork session artifacts
403
523
  --worktrees Find and clean up detached worktree directories
404
524
  --target <dir> Override the config directory (XDG-aware by default)
@@ -423,6 +543,7 @@ function main() {
423
543
 
424
544
  const apply = args.includes('--apply') || args.includes('-y')
425
545
  const removeDirs = args.includes('--remove-dirs')
546
+ const python = args.includes('--python')
426
547
  const deepwork = args.includes('--deepwork')
427
548
  const worktrees = args.includes('--worktrees')
428
549
  const targetIdx = args.indexOf('--target')
@@ -445,6 +566,7 @@ function main() {
445
566
  removeDirs,
446
567
  deepwork,
447
568
  worktrees,
569
+ python,
448
570
  })
449
571
 
450
572
  // 0 = clean/cleaned; 1 = findings remain; 2 = usage error (handled above)
package/scripts/setup.mjs CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  prepareV2Config,
13
13
  resolveGlobalConfigDirectory,
14
14
  verifyConfigPreconditions,
15
- } from './setup-v2-config.mjs'
15
+ } from './setup-config.mjs'
16
16
 
17
17
  const INIT_CLI = fileURLToPath(new URL('../bin/pantheon-init.mjs', import.meta.url))
18
18
 
@@ -148,8 +148,6 @@ class Scanner:
148
148
  "npx",
149
149
  "biome",
150
150
  "check",
151
- "--write",
152
- "--unsafe",
153
151
  *[str(f) for f in files],
154
152
  ],
155
153
  capture_output=True,
@@ -161,11 +159,11 @@ class Scanner:
161
159
  self.report.append(" ⏭️ biome: not available")
162
160
  return
163
161
 
164
- if result.returncode == 0 or "safe fixes" in result.stdout:
165
- self.report.append(" ✅ biome: clean or auto-fixed")
162
+ if result.returncode == 0:
163
+ self.report.append(" ✅ biome: clean")
166
164
  else:
167
165
  self.report.append(" ⚠️ biome: issues found")
168
- # self.deduct(10) # biome internal bug, not our code
166
+ self.deduct(10)
169
167
 
170
168
  def run_antipattern(self) -> None:
171
169
  hits = 0
package/skills-lock.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "src/skills/agent-forge/SKILL.md": "cbe09946a59fa45b471828d9de6e7bc5c4b2fa29e0ce48e21d188593ece6c046",
4
4
  "src/skills/artifact-management/references/artifact-templates.md": "d1a5d082266311c362e63e097f461fe993a4eac7485c4a445fba7993c404e1c7",
5
5
  "src/skills/artifact-management/SKILL.md": "d11bc6a9968758294bd9ae56dfa8df43090c5f1f7c4f706861687d8ac3bb88a2",
6
- "src/skills/auto-continue/references/auto-continue-details.md": "3064ee565c9e6dd2724d1170404888a65d700aaec0058d3aa2be1acce4771e72",
6
+ "src/skills/auto-continue/references/auto-continue-details.md": "9fcac10a664f41439f234d1ded98b8976fdc3db5755e88f7ad89f3409fdb14d8",
7
7
  "src/skills/auto-continue/SKILL.md": "7bfddd84f96b657043074a35ef2f524913ccbed2689fc8a26ad425167f4b77c5",
8
8
  "src/skills/clonedeps/SKILL.md": "3e0b43cf96da98c83699dc48db3fd58fbfda84b9022bb70d3747875c81c3e124",
9
9
  "src/skills/code-review-checklist/references/review-checklists.md": "ca5e8059e46052b88489cdc3ffcd009fa2b33f6bcff0493ded47a3ae12c6b94e",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: aphrodite
3
- description: "Frontend specialist — React 19, TypeScript strict, WCAG accessibility, responsive design, TDD, modern API patterns, deprecated npm detection. Routes discovery and Themis review requests through Zeus."
3
+ description: "Frontend & UI specialist — React 19, SolidJS, Vue, Svelte, Next.js, TypeScript strict, WCAG accessibility, responsive design, TDD, modern API patterns, deprecated npm detection. Routes discovery and Themis review requests through Zeus."
4
4
  mode: all
5
5
  reasoning_effort: medium
6
6
  temperature: 0.3
@@ -27,6 +27,7 @@ mcp_tools:
27
27
  - code_query
28
28
  - code_neighbors
29
29
  skills:
30
+ - artifact-management
30
31
  - loop-engineering
31
32
  - memory-bank
32
33
  - reflect
@@ -84,13 +85,6 @@ Only an Athena root session may delegate discovery to @apollo. A child session h
84
85
  6. **Ask for approval only when directly invoked**; if delegated, Zeus owns the user-facing gate
85
86
  7. **Handoff** the approved scope to @zeus when the user also requested execution
86
87
 
87
- ## Model Source of Truth
88
-
89
- Only Athena should fetch and reconcile supported-model information from:
90
- - https://docs.github.com/pt/copilot/reference/ai-models/supported-models
91
-
92
- Use `webfetch` to verify availability before proposing model updates to other agents.
93
-
94
88
  ## Bounded Research Strategy (Fast Planning)
95
89
 
96
90
  **Rules**:
@@ -180,11 +174,11 @@ detail.
180
174
 
181
175
  - When delegated by Zeus through the root `subagent` dispatch, return the complete Markdown plan in
182
176
  the final task result. This plan handoff overrides the generic investigation
183
- findings format above. **Do not call `agent/askQuestions`, pause for user
177
+ findings format above. **Do not call `question`, pause for user
184
178
  input, or ask the user to approve from the child session**; Zeus owns the
185
179
  user-facing approval gate.
186
180
  - When invoked directly in the user's conversation, present the complete plan
187
- in that conversation first. Only then may you call `agent/askQuestions` to
181
+ in that conversation first. Only then may you call `question` to
188
182
  request approval.
189
183
  - Approval never authorizes work outside the plan, and approving a plan alone
190
184
  is not permission to implement unless the user's original request also asked
@@ -250,17 +244,15 @@ Before creating a plan:
250
244
 
251
245
  ## Research with Web Fetch
252
246
 
253
- For external docs/specs, use `webfetch` (see `internet-search` skill for patterns):
247
+ For external docs/specs, use `webfetch`:
254
248
  - RFCs, official documentation, GitHub issues/PRs
255
249
  - Synthesize findings into plan recommendations
256
250
 
257
- ## Auto-Continue (Embedded: Planning)
251
+ ## Execution Discipline
258
252
 
259
- - Auto-continue through research → analysis → plan writing
260
- - Run bounded research (max 3 codebase searches or 5 min) then proceed to plan
253
+ - Proceed directly through bounded research → analysis → plan writing without unnecessary pauses
261
254
  - STOP after the complete plan is returned — Zeus owns Gate 1 when Athena is delegated
262
255
  - Never auto-implement after planning — handoff to Zeus
263
- - Do NOT re-plan without new information
264
256
  - Partial results NOT allowed — plan must be complete before presenting
265
257
 
266
258
  ## Skills
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: demeter
3
- description: "Database specialist — SQLAlchemy 2.0, Alembic, query optimization, N+1 prevention, TDD migrations, modern DB libs. Requests Zeus to route broad discovery to Apollo; sends review needs to Zeus."
3
+ description: "Database & data specialist — Polyglot SQL/NoSQL, PostgreSQL, SQLite, Prisma, Drizzle, TypeORM, SQLAlchemy 2.0, Alembic, query optimization, N+1 prevention, TDD migrations. Requests Zeus to route broad discovery to Apollo; sends review needs to Zeus."
4
4
  mode: all
5
5
  reasoning_effort: medium
6
6
  temperature: 0.2
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: hermes
3
- description: "Backend specialist — FastAPI, Python, async, modern Python stdlib, obsolete lib detection. Root Hermes may call Apollo for discovery; child sessions do not delegate. Sends material work to Themis via Zeus."
3
+ description: "Polyglot backend & API specialist — TypeScript/Node.js, Python/FastAPI, Go, Rust, Java, async services, modern stdlib, obsolete lib detection. Root Hermes may call Apollo for discovery; child sessions do not delegate. Sends material work to Themis via Zeus."
4
4
  mode: all
5
5
  reasoning_effort: medium
6
6
  temperature: 0.3
@@ -24,6 +24,7 @@ mcp_tools:
24
24
  pantheon-code-mode: [execute_code_script]
25
25
  skills:
26
26
  - clonedeps
27
+ - code-review-checklist
27
28
  - fast-path-execution
28
29
  - git-workflow-and-versioning
29
30
  - incremental-implementation
@@ -40,7 +41,7 @@ skills:
40
41
  - **Targeted Slices Only:** In TDD loops, run ONLY the test slice for the changed file (`pytest tests/test_<file>.py -k <func>`, `node --test tests/<file>.test.mjs`).
41
42
  - **NEVER RUN `npm test`:** Unconstrained suites destroy execution speed and blow context windows.
42
43
 
43
- # Hermes - Backend Executor (FastAPI Specialist)
44
+ # Hermes - Polyglot Backend & API Executor (TypeScript/Node, Python/FastAPI, Go, Rust)
44
45
 
45
46
  ## When NOT to Use Hermes
46
47
  - For database schema changes — that's @demeter
@@ -90,14 +90,12 @@ skills:
90
90
  - Called by @zeus after review phase
91
91
  - Await @zeus approval before merge
92
92
 
93
- ## Auto-Continue (Embedded: GitHub Ops)
93
+ ## Execution Discipline (GitHub Ops)
94
94
 
95
- - Auto-continue through PR creation workflow (branch → commit → PR as DRAFT)
96
- - STOP before push — never auto-push without confirmation
97
- - Always ask before merge — never auto-merge under any circumstances
95
+ - Proceed automatically through local git preparation (branch → stage → commit)
96
+ - STOP before `git push`, PR creation, or release publishing — never push without explicit human confirmation
97
+ - Always ask before merge — never auto-merge under any circumstances
98
98
  - Keep PRs as DRAFT by default — ask before marking ready
99
- - No checkpoint needed (low operation count per invocation)
100
- - Partial results NOT applicable — linear git operations
101
99
 
102
100
  ## Skills
103
101
  `git-workflow-and-versioning`
@@ -26,6 +26,7 @@ skills:
26
26
  - incremental-implementation
27
27
  - loop-engineering
28
28
  - reflect
29
+ - security-hardening
29
30
  - simplify
30
31
  - worktrees
31
32
  ---
@@ -76,16 +77,12 @@ skills:
76
77
  - Deploy on tagged releases
77
78
  - Staging environment as gate
78
79
 
79
- ### 4. Observability & Monitoring
80
- - OpenTelemetry tracing (OTLP, Jaeger, Zipkin exporters), span design
81
- - Health/metrics endpoints, log aggregation, alerting rules
82
- - Token/cost tracking and latency dashboards for AI pipelines
83
-
84
- ### 5. Environment Configuration
80
+ ### 4. Environment & GPU Infrastructure
85
81
  - Never hardcode secrets
86
82
  - .env files for development
87
83
  - Environment variables for production
88
84
  - Separate configs: dev/staging/prod
85
+ - GPU sizing, container runtimes, and model serving infrastructure
89
86
 
90
87
  ## Handoffs
91
88
  - **Discovery:** Send discovery needs and any findings to Zeus. Zeus may dispatch to targets; only root Athena/Hermes sessions may call @apollo directly. Child sessions must not dispatch another Pantheon agent.
@@ -152,7 +149,6 @@ You are the model provider hub. You route AI requests to the right model, optimi
152
149
  - **Discovery:** Pass pricing/capability research needs and any findings to Zeus for routing; do not dispatch Apollo from a child session.
153
150
  - **Observability:** Ask Zeus to route any separate token-usage request to @nyx, with the period and metric source specified.
154
151
  - **Themis review:** If review is required, report the need and relevant findings to Zeus; Zeus root decides and dispatches Themis. Child sessions must not dispatch Themis.
155
- - **To @prometheus:** For GPU infrastructure: "Deploy [model] on [infra]. Requirements: [GPU type, memory, storage]."
156
152
  - **To @zeus:** For escalations and cross-cutting decisions.
157
153
 
158
154
  ## Model Fallback Chain Pattern