pantheon-opencode 1.2.1 → 1.3.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 (37) hide show
  1. package/AGENTS.md +10 -0
  2. package/README.md +53 -15
  3. package/bin/pantheon-init.mjs +14 -0
  4. package/opencode.json +17 -1
  5. package/package.json +13 -4
  6. package/scripts/changelog-extract.mjs +112 -0
  7. package/scripts/doctor.mjs +303 -13
  8. package/scripts/hooks/audit-imports.sh +43 -0
  9. package/scripts/hooks/format-multi-language.sh +96 -0
  10. package/scripts/hooks/log-session-start.sh +42 -0
  11. package/scripts/hooks/on-subagent-delegation-start.sh +201 -0
  12. package/scripts/hooks/on-subagent-delegation-stop.sh +419 -0
  13. package/scripts/hooks/run-type-check.sh +21 -0
  14. package/scripts/hooks/scan-secrets.sh +97 -0
  15. package/scripts/hooks/validate-post-conditions.sh +21 -0
  16. package/scripts/hooks/validate-talos-scope.sh +50 -0
  17. package/scripts/hooks/validate-tool-safety.sh +46 -0
  18. package/scripts/install/opencode.mjs +58 -29
  19. package/scripts/install/plugin.mjs +4 -2
  20. package/scripts/install-mcp.mjs +104 -56
  21. package/scripts/mcp_persistence_server.py +1 -0
  22. package/scripts/prune.mjs +359 -0
  23. package/scripts/version-check.mjs +146 -0
  24. package/scripts/versioning.mjs +13 -14
  25. package/src/agents/zeus.md +33 -5
  26. package/src/mcp/requirements-mcp.txt +8 -5
  27. package/src/mcp/requirements-vision.txt +3 -3
  28. package/src/plugins/hook-runner.ts +186 -0
  29. package/src/plugins/pantheon-hooks.ts +1503 -0
  30. package/src/plugins/tui/dist/tui.d.ts +8 -0
  31. package/src/plugins/tui/dist/tui.d.ts.map +1 -0
  32. package/src/plugins/tui/dist/tui.js +1198 -0
  33. package/src/plugins/tui/dist/tui.js.map +1 -0
  34. package/src/plugins/tui/dist/tui.tsx +1204 -0
  35. package/src/plugins/tui/package.json +2 -2
  36. package/src/plugins/tui/src/index.tsx +16 -1
  37. package/src/mcp/requirements-mcp-core.txt +0 -5
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "pantheon-tui",
3
3
  "type": "module",
4
- "version": "1.2.0",
5
- "description": "Pantheon TUI plugin \u2014 sidebar (agents, sessions, commands, config, memory, active preset) + AI subscription usage gauges incl. OpenCode Go/Zen dollar limits (vendored, MIT)",
4
+ "version": "1.3.0",
5
+ "description": "Pantheon TUI plugin — sidebar (agents, sessions, commands, config, memory, active preset) + AI subscription usage gauges incl. OpenCode Go/Zen dollar limits (vendored, MIT)",
6
6
  "license": "MIT",
7
7
  "exports": {
8
8
  "./tui": "./dist/tui.tsx"
@@ -49,6 +49,7 @@ import { Buffer } from 'node:buffer'
49
49
  import { mkdir, readFile, writeFile } from 'node:fs/promises'
50
50
  import { homedir } from 'node:os'
51
51
  import { dirname, join } from 'node:path'
52
+ import { fileURLToPath } from 'node:url'
52
53
  import type { TuiPlugin, TuiPluginApi, TuiPluginModule } from '@opencode-ai/plugin/tui'
53
54
  import { createMemo, createResource, createSignal, For, onCleanup, onMount, Show } from 'solid-js'
54
55
 
@@ -166,6 +167,20 @@ async function resolvePresetForTui(
166
167
  * 4. null */
167
168
 
168
169
  async function detectVersion(api: TuiPluginApi): Promise<string | null> {
170
+ // Try 0: package.json do PACOTE PANTHEON instalado. O TUI é carregado de
171
+ // <pacote>/src/plugins/tui/dist/tui.tsx (fix #32 garante esse path) →
172
+ // 4 níveis acima (dist → tui → plugins → src → raiz) está o package.json
173
+ // do pacote. Funciona em QUALQUER cwd (ex: sandbox sem package.json/git) e
174
+ // também em dev (source no repo). Se falhar, cai para os tries abaixo.
175
+ try {
176
+ const pkgUrl = new URL('../../../../package.json', import.meta.url)
177
+ const pkgContent = await readFile(fileURLToPath(pkgUrl), 'utf8')
178
+ const match = pkgContent.match(/"version":\s*"([^"]+)"/)
179
+ if (match?.[1]) return match[1]
180
+ } catch {
181
+ /* fall through */
182
+ }
183
+
169
184
  // Try 1: package.json do projeto (via worktree path)
170
185
  try {
171
186
  const wt = ((api.state as any).path?.worktree ?? '') as string
@@ -192,7 +207,7 @@ async function detectVersion(api: TuiPluginApi): Promise<string | null> {
192
207
  .trim()
193
208
  .replace(/^v/, '')
194
209
  .replace(/-\d+-g[0-9a-f]+$/, '')
195
- if (tag && tag !== '5.0.0') return tag
210
+ if (tag) return tag
196
211
  }
197
212
  } catch {
198
213
  /* fall through */
@@ -1,5 +0,0 @@
1
- mcp>=1.28.0
2
- fastmcp>=3.4.0
3
- pyyaml>=6.0
4
- sqlite-vec>=0.1.7
5
- fastembed>=0.5.0