pantheon-opencode 1.6.0-beta.8 → 1.6.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 (141) hide show
  1. package/AGENTS.global.md +118 -0
  2. package/AGENTS.md +18 -168
  3. package/CHANGELOG.md +126 -346
  4. package/README.md +83 -608
  5. package/README.pt-BR.md +120 -345
  6. package/bin/pantheon-init.mjs +366 -132
  7. package/commands/pantheon-audit.md +7 -1
  8. package/commands/pantheon-consolidate.md +1 -1
  9. package/commands/pantheon-deepwork.md +14 -3
  10. package/commands/pantheon-focus.md +17 -0
  11. package/commands/pantheon-vision.md +61 -12
  12. package/package.json +19 -11
  13. package/plugin.json +1 -1
  14. package/pyproject.toml +6 -2
  15. package/scripts/_pantheon_paths.py +24 -0
  16. package/scripts/build-agents-md.mjs +368 -69
  17. package/scripts/changelog-merge.mjs +161 -0
  18. package/scripts/check-plugin-v2-coverage.mjs +11 -8
  19. package/scripts/docs-check-changelog.mjs +204 -0
  20. package/scripts/docs-link-check.mjs +314 -0
  21. package/scripts/docs-media.mjs +157 -0
  22. package/scripts/doctor.mjs +828 -40
  23. package/scripts/install/agents-md.mjs +2 -2
  24. package/scripts/install/backup.mjs +648 -0
  25. package/scripts/install/cli-ui.mjs +303 -72
  26. package/scripts/install/component-selection.mjs +61 -0
  27. package/scripts/install/config-migration.mjs +583 -27
  28. package/scripts/install/exit-codes.mjs +26 -0
  29. package/scripts/install/file-inventory.mjs +555 -0
  30. package/scripts/install/health-check.mjs +31 -25
  31. package/scripts/install/interactive.mjs +78 -383
  32. package/scripts/install/migrate.mjs +49 -25
  33. package/scripts/install/model-picker.mjs +218 -250
  34. package/scripts/install/opencode-version.mjs +83 -21
  35. package/scripts/install/opencode.mjs +1465 -180
  36. package/scripts/install/plan-artifact.mjs +517 -0
  37. package/scripts/install/plan.mjs +475 -0
  38. package/scripts/install/plugin.mjs +251 -30
  39. package/scripts/install/prompt-result.mjs +2 -0
  40. package/scripts/install/shared.mjs +256 -99
  41. package/scripts/install/state.mjs +63 -8
  42. package/scripts/install/strings.mjs +60 -4
  43. package/scripts/install/venv.mjs +90 -47
  44. package/scripts/install/verify.mjs +128 -0
  45. package/scripts/install/vision-prompt.mjs +173 -0
  46. package/scripts/install-mcp.mjs +2 -2
  47. package/scripts/manifest-inventory.mjs +49 -3
  48. package/scripts/mcp_persistence.py +1535 -1050
  49. package/scripts/memory_mcp.py +12 -843
  50. package/scripts/node-engine-policy.mjs +85 -0
  51. package/scripts/package-evidence.mjs +10 -2
  52. package/scripts/postinstall.mjs +26 -26
  53. package/scripts/probe-pantheon-cost.mjs +118 -19
  54. package/scripts/prune.mjs +9 -3
  55. package/scripts/reconcile.mjs +325 -0
  56. package/scripts/release-gates.mjs +682 -0
  57. package/scripts/restore.mjs +222 -0
  58. package/scripts/run-node-tests.mjs +24 -8
  59. package/scripts/sync-artifacts.mjs +20 -7
  60. package/scripts/sync-tui.mjs +29 -4
  61. package/scripts/test-opencode-v2-sandbox.sh +36 -123
  62. package/scripts/uninstall.mjs +369 -34
  63. package/scripts/update.mjs +164 -0
  64. package/scripts/validate-node-engine-policy.mjs +13 -0
  65. package/scripts/version-check.mjs +34 -1
  66. package/scripts/versioning.mjs +23 -3
  67. package/scripts/vision-status.mjs +682 -0
  68. package/skills-lock.json +8 -8
  69. package/src/agents/aphrodite.md +13 -10
  70. package/src/agents/apollo.md +4 -5
  71. package/src/agents/athena.md +74 -46
  72. package/src/agents/demeter.md +10 -7
  73. package/src/agents/gaia.md +0 -1
  74. package/src/agents/hephaestus.md +4 -3
  75. package/src/agents/hermes.md +10 -9
  76. package/src/agents/iris.md +6 -1
  77. package/src/agents/mnemosyne.md +14 -15
  78. package/src/agents/nyx.md +4 -4
  79. package/src/agents/prometheus.md +12 -11
  80. package/src/agents/talos.md +6 -0
  81. package/src/agents/zeus.md +84 -56
  82. package/src/instructions/agent-return-format.instructions.md +12 -41
  83. package/src/instructions/memory-protocol.instructions.md +5 -11
  84. package/src/instructions/test-economy.instructions.md +12 -0
  85. package/src/instructions/yagni.instructions.md +6 -15
  86. package/src/instructions/zeus-anti-stall.instructions.md +6 -6
  87. package/src/instructions/zeus-communication-rules.instructions.md +6 -6
  88. package/src/instructions/zeus-council-synthesis.instructions.md +11 -12
  89. package/src/instructions/zeus-memory-operations.instructions.md +13 -7
  90. package/src/instructions/zeus-timeout-retry.instructions.md +36 -10
  91. package/src/mcp/_pantheon_paths.py +24 -0
  92. package/src/mcp/mcp_codemap_module.py +86 -18
  93. package/src/mcp/mcp_persistence.py +1535 -1050
  94. package/src/mcp/memory_mcp.py +444 -94
  95. package/src/mcp/pantheon_vision.py +285 -41
  96. package/src/mcp/requirements-mcp.txt +5 -0
  97. package/src/pantheon/context-pruner.ts +541 -0
  98. package/src/pantheon/cost-command.ts +814 -60
  99. package/src/pantheon/goal-loop.ts +11 -8
  100. package/src/pantheon/memory-context.ts +1017 -0
  101. package/src/pantheon/model-agents.ts +19 -0
  102. package/src/pantheon/model-command.ts +218 -56
  103. package/src/pantheon/model-pricing.ts +536 -0
  104. package/src/pantheon/presets.mjs +2 -0
  105. package/src/pantheon/task-result-guard.ts +50 -14
  106. package/src/pantheon/v2-bounded-read.ts +640 -0
  107. package/src/pantheon/v2-delegation-enforce.ts +133 -6
  108. package/src/pantheon/v2-execute-after.ts +135 -24
  109. package/src/pantheon/v2-model-overrides.ts +275 -0
  110. package/src/pantheon/v2-tools.ts +89 -35
  111. package/src/pantheon/v2-unsupported.mjs +2 -3
  112. package/src/pantheon/v2-vision.ts +622 -0
  113. package/src/pantheon/vision-local.ts +531 -0
  114. package/src/pantheon/vision.ts +1160 -115
  115. package/src/plugin-v2.ts +654 -162
  116. package/src/plugin.ts +15 -11
  117. package/src/plugins/tui/dist/tui-v2.d.ts +1036 -0
  118. package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -0
  119. package/src/plugins/tui/dist/tui-v2.js +3808 -0
  120. package/src/plugins/tui/dist/tui-v2.js.map +1 -0
  121. package/src/plugins/tui/dist/tui.js +4 -4
  122. package/src/plugins/tui/index-v2.ts +6 -0
  123. package/src/plugins/tui/package-lock.json +5416 -1297
  124. package/src/plugins/tui/package.json +14 -10
  125. package/src/plugins/tui/src/index-v2.tsx +4372 -0
  126. package/src/plugins/tui/src/index.tsx +3 -3
  127. package/src/plugins/tui/src/opencode-v2.d.ts +13 -0
  128. package/src/plugins/tui/tsconfig.typecheck.json +5 -0
  129. package/src/plugins/tui/tsdown.config.ts +2 -2
  130. package/src/plugins/tui/tui-v2.ts +2 -0
  131. package/src/plugins/tui/tui.ts +3 -0
  132. package/src/routing.yml +50 -5
  133. package/src/skills/agent-coordination/SKILL.md +7 -2
  134. package/src/skills/artifact-management/SKILL.md +5 -1
  135. package/src/skills/auto-continue/SKILL.md +14 -6
  136. package/src/skills/codemap/SKILL.md +1 -1
  137. package/src/skills/memory-bank/SKILL.md +21 -13
  138. package/src/skills/session-goal/SKILL.md +14 -15
  139. package/src/skills/spec-driven-development/SKILL.md +3 -1
  140. package/src/skills/worktrees/SKILL.md +30 -11
  141. package/scripts/probe-context-rehydrate.mjs +0 -263
@@ -15,7 +15,7 @@
15
15
  # `@opencode/plugin@2.0.18` SDK contract or compatibility across the full 2.x
16
16
  # line. This project is V2-exclusive, so there is a single host leg to validate.
17
17
  #
18
- # Modes (combinable):
18
+ # Modes (run sequentially; a failure stops later checks):
19
19
  # --prepare Build tarball, install pantheon-opencode + the OpenCode V2
20
20
  # binary in the sandbox prefix, headless init, and generate
21
21
  # the project config and sandbox run-test.sh.
@@ -23,7 +23,6 @@
23
23
  # regenerated first).
24
24
  # --prompts Prompt battery via `opencode run --format json`.
25
25
  # --cost Offline pantheon_cost probe.
26
- # --rehydrate Offline context_rehydrate + context_session_summary probe.
27
26
  # --hooks V2 hook canary: proves hook callbacks FIRE through the
28
27
  # sandbox's V2 binary (not merely that a plugin loaded).
29
28
  # This does not test transform callback effects or Pantheon
@@ -33,6 +32,11 @@
33
32
  #
34
33
  # Env overrides:
35
34
  # PANTHEON_SANDBOX_ROOT Sandbox root (default: ~/pantheon-sandbox)
35
+ # PANTHEON_SANDBOX_TARBALL Optional pre-built package tarball to install
36
+ # instead of running `npm pack` in the checkout. The
37
+ # release gate points this at its one immutable
38
+ # artifact so the sandbox validates the exact bytes
39
+ # that will be published.
36
40
  # OPENCODE_V2_SPEC npm spec providing the V2 binary
37
41
  # (default: @opencode/cli@latest). NOTE: this is an
38
42
  # install spec only — it is not a dependency of this
@@ -67,6 +71,12 @@ OPENCODE_V2_SPEC="${OPENCODE_V2_SPEC:-@opencode/cli@latest}"
67
71
  PANTHEON_SANDBOX_MODEL="${PANTHEON_SANDBOX_MODEL:-opencode-go/mimo-v2.5}"
68
72
  PANTHEON_PROMPT_TIMEOUT="${PANTHEON_PROMPT_TIMEOUT:-300}"
69
73
 
74
+ # Optional pre-built package tarball. The release gate sets this to the ONE
75
+ # immutable artifact it already packed and hashed, so the sandbox installs the
76
+ # exact bytes that will be published instead of packing a second tarball. When
77
+ # unset (developer use) --prepare keeps packing from the checkout.
78
+ SANDBOX_TARBALL="${PANTHEON_SANDBOX_TARBALL:-}"
79
+
70
80
  V2_BIN="${OPENCODE_V2_BIN:-opencode2}"
71
81
 
72
82
  # OpenCode V2's CLI talks to its background service for `mcp list`. Keep the
@@ -88,14 +98,12 @@ TARGET_VERSION="v2"
88
98
 
89
99
  REPORT_FILE="$SANDBOX_ROOT/prompts-report.md"
90
100
  COST_REPORT_FILE="$SANDBOX_ROOT/pantheon-cost-report.md"
91
- REHYDRATE_REPORT_FILE="$SANDBOX_ROOT/context-rehydrate-report.md"
92
101
  EXTRACT_PY="$SANDBOX_ROOT/.prompt-extract-json.py"
93
102
 
94
103
  MODE_PREPARE=0
95
104
  MODE_RESET=0
96
105
  MODE_PROMPTS=0
97
106
  MODE_COST=0
98
- MODE_REHYDRATE=0
99
107
  MODE_HOOKS=0
100
108
  RUN_VERSION=""
101
109
 
@@ -265,7 +273,10 @@ for record in records:
265
273
  if command != python_bin or cwd != runtime_dir or script not in expected:
266
274
  raise SystemExit(1)
267
275
  registered.add(script)
268
- if len(records) != len(expected) or registered != expected:
276
+ # OpenCode can initialize the same configured workspace more than once during
277
+ # service startup and `mcp list`. Count the logical server set here; the later
278
+ # `mcp list` assertion still requires exactly five connected MCP names.
279
+ if registered != expected:
269
280
  raise SystemExit(1)
270
281
  PY
271
282
  then
@@ -1109,14 +1120,26 @@ cmd_reset() {
1109
1120
  }
1110
1121
 
1111
1122
  install_binaries() {
1112
- log "--- Installing pantheon-opencode (from repo tarball) ---"
1113
- cd "$REPO_DIR"
1114
- npm pack --ignore-scripts 2>/dev/null || die "npm pack failed"
1115
- local tgz
1116
- tgz=$(ls -t pantheon-opencode-*.tgz | head -1)
1123
+ local tgz_path
1124
+ if [ -n "$SANDBOX_TARBALL" ]; then
1125
+ [ -f "$SANDBOX_TARBALL" ] \
1126
+ || die "PANTHEON_SANDBOX_TARBALL does not exist: $SANDBOX_TARBALL"
1127
+ tgz_path="$(cd "$(dirname "$SANDBOX_TARBALL")" && pwd)/$(basename "$SANDBOX_TARBALL")"
1128
+ log "--- Installing pantheon-opencode (from supplied release tarball) ---"
1129
+ else
1130
+ log "--- Installing pantheon-opencode (from repo tarball) ---"
1131
+ cd "$REPO_DIR"
1132
+ npm pack --ignore-scripts 2>/dev/null || die "npm pack failed"
1133
+ local tgz
1134
+ tgz=$(ls -t pantheon-opencode-*.tgz | head -1)
1135
+ tgz_path="$REPO_DIR/$tgz"
1136
+ fi
1117
1137
  npm rm -g pantheon-opencode 2>/dev/null || true
1118
- npm install -g "$REPO_DIR/$tgz" || die "install of $tgz failed"
1119
- if ! git -C "$REPO_DIR" ls-files --error-unmatch -- "$tgz" >/dev/null 2>&1; then rm -f -- "$tgz"; fi
1138
+ npm install -g "$tgz_path" || die "install of $(basename "$tgz_path") failed"
1139
+ if [ -z "$SANDBOX_TARBALL" ] \
1140
+ && ! git -C "$REPO_DIR" ls-files --error-unmatch -- "$tgz_path" >/dev/null 2>&1; then
1141
+ rm -f -- "$tgz_path"
1142
+ fi
1120
1143
  log "--- Installing OpenCode V2 ($OPENCODE_V2_SPEC) ---"
1121
1144
  npm install -g "$OPENCODE_V2_SPEC" || die "install of $OPENCODE_V2_SPEC failed"
1122
1145
  }
@@ -1535,45 +1558,6 @@ run_cost_probe() { # v
1535
1558
  record "$v" "pantheon-cost" "$status" "$detail"
1536
1559
  }
1537
1560
 
1538
- run_rehydrate_probe() { # v
1539
- local v="$1" package_root probe raw status detail
1540
- if ! package_root="$(installed_package_root)"; then
1541
- record "$v" "context-rehydrate" "FAIL" "sandbox package is not installed"
1542
- return 0
1543
- fi
1544
- probe="$package_root/scripts/probe-context-rehydrate.mjs"
1545
- if [ ! -f "$probe" ]; then
1546
- record "$v" "context-rehydrate" "FAIL" "installed package has no offline context probe"
1547
- return 0
1548
- fi
1549
- if ! command -v node >/dev/null 2>&1; then
1550
- record "$v" "context-rehydrate" "FAIL" "node runtime is not available"
1551
- return 0
1552
- fi
1553
- set +e
1554
- raw="$(timeout 30 node "$probe" --version "$v" --json 2>&1)"
1555
- local rc=$?
1556
- set -e
1557
- case "$raw" in
1558
- *'"status":"PASS"'*) status="PASS" ;;
1559
- *'"status":"NOT_TESTED"'*) status="FAIL" ;;
1560
- *'"status":"AMBIENTAL"'*) status="FAIL" ;;
1561
- *) status="FAIL" ;;
1562
- esac
1563
- detail="$(printf '%s' "$raw" | tr '\n' ' ' | cut -c1-400)"
1564
- if [ "$rc" -eq 124 ]; then
1565
- status="FAIL"
1566
- detail="context probe timed out after 30s"
1567
- elif [ "$rc" -ne 0 ] && [ "$status" = "PASS" ]; then
1568
- # A non-zero probe exit must never be reported as PASS.
1569
- status="FAIL"
1570
- detail="$detail (probe exit $rc)"
1571
- elif [ "$rc" -ne 0 ] && [ "$status" != "FAIL" ]; then
1572
- detail="$detail (probe exit $rc)"
1573
- fi
1574
- record "$v" "context-rehydrate" "$status" "$detail"
1575
- }
1576
-
1577
1561
  run_version_prompts() { # v
1578
1562
  local v="$1" bin
1579
1563
  if ! bin="$(sandbox_bin)"; then
@@ -1666,31 +1650,6 @@ write_cost_report() { # versions...
1666
1650
  log "Cost probe report written to $COST_REPORT_FILE"
1667
1651
  }
1668
1652
 
1669
- write_rehydrate_report() { # versions...
1670
- local versions=("$@") total_fail=0 total_pass=0
1671
- {
1672
- printf '# Pantheon Context Rehydration Probe Report\n\n'
1673
- printf -- '- **Date:** %s\n' "$(date -u '+%Y-%m-%d %H:%M UTC')"
1674
- printf -- '- **Sandbox:** %s\n\n' "$SANDBOX_ROOT"
1675
- printf '| Version | Probe | Result | Detail |\n|---|---|---|---|\n'
1676
- local v result
1677
- for v in "${versions[@]}"; do
1678
- result="${RESULTS["$v:context-rehydrate"]:-NOT_TESTED}"
1679
- case "$result" in
1680
- PASS) total_pass=$((total_pass + 1)) ;;
1681
- *) total_fail=$((total_fail + 1)) ;;
1682
- esac
1683
- printf '| %s | context_rehydrate + context_session_summary | %s | %s |\n' \
1684
- "$v" "$result" "${DETAILS["$v:context-rehydrate"]:-—}"
1685
- done
1686
- printf '\n## Summary\n\n'
1687
- printf -- '- PASS: %d\n- Not PASS (blocking): %d\n\n' \
1688
- "$total_pass" "$total_fail"
1689
- printf '**Verdict: %s**\n' "$(probe_verdict "$total_pass" "$((total_pass + total_fail))")"
1690
- } > "$REHYDRATE_REPORT_FILE"
1691
- log "Context probe report written to $REHYDRATE_REPORT_FILE"
1692
- }
1693
-
1694
1653
  run_cost() { # versions...
1695
1654
  local versions=("$@") v fail=0
1696
1655
  mkdir -p "$SANDBOX_ROOT"
@@ -1710,25 +1669,6 @@ run_cost() { # versions...
1710
1669
  log "Cost probe: PASS."
1711
1670
  }
1712
1671
 
1713
- run_rehydrate() { # versions...
1714
- local versions=("$@") v fail=0
1715
- mkdir -p "$SANDBOX_ROOT"
1716
- for v in "${versions[@]}"; do
1717
- log "[$v] context_rehydrate/session_summary offline probe ..."
1718
- run_rehydrate_probe "$v"
1719
- log "[$v] context probe → ${RESULTS["$v:context-rehydrate"]}"
1720
- done
1721
- write_rehydrate_report "${versions[@]}"
1722
- for v in "${versions[@]}"; do
1723
- [ "${RESULTS["$v:context-rehydrate"]:-}" = "PASS" ] || fail=$((fail + 1))
1724
- done
1725
- if [ "$fail" -gt 0 ]; then
1726
- log "Context probe: $fail check(s) without explicit PASS."
1727
- exit 1
1728
- fi
1729
- log "Context probe: PASS."
1730
- }
1731
-
1732
1672
  # ── Hook canary (proves callbacks FIRE, not just that a plugin loaded) ────────
1733
1673
 
1734
1674
  run_hooks() {
@@ -1813,7 +1753,6 @@ while [ $# -gt 0 ]; do
1813
1753
  --reset) MODE_RESET=1 ;;
1814
1754
  --prompts) MODE_PROMPTS=1 ;;
1815
1755
  --cost) MODE_COST=1 ;;
1816
- --rehydrate) MODE_REHYDRATE=1 ;;
1817
1756
  --hooks) MODE_HOOKS=1 ;;
1818
1757
  --run)
1819
1758
  shift
@@ -1839,7 +1778,7 @@ fi
1839
1778
 
1840
1779
  if [ "$MODE_PREPARE" -eq 0 ] && [ -z "$RUN_VERSION" ] \
1841
1780
  && [ "$MODE_PROMPTS" -eq 0 ] && [ "$MODE_COST" -eq 0 ] \
1842
- && [ "$MODE_REHYDRATE" -eq 0 ] && [ "$MODE_HOOKS" -eq 0 ]; then
1781
+ && [ "$MODE_HOOKS" -eq 0 ]; then
1843
1782
  usage
1844
1783
  fi
1845
1784
 
@@ -1859,10 +1798,6 @@ if [ -n "$RUN_VERSION" ]; then
1859
1798
  sandbox_env
1860
1799
  run_cost "$RUN_VERSION"
1861
1800
  fi
1862
- if [ "$MODE_REHYDRATE" -eq 1 ]; then
1863
- sandbox_env
1864
- run_rehydrate "$RUN_VERSION"
1865
- fi
1866
1801
  if [ "$MODE_HOOKS" -eq 1 ]; then
1867
1802
  sandbox_env
1868
1803
  run_hooks
@@ -1873,37 +1808,15 @@ elif [ "$MODE_PROMPTS" -eq 1 ]; then
1873
1808
  if [ "$MODE_COST" -eq 1 ]; then
1874
1809
  run_cost "$TARGET_VERSION"
1875
1810
  fi
1876
- if [ "$MODE_REHYDRATE" -eq 1 ]; then
1877
- run_rehydrate "$TARGET_VERSION"
1878
- fi
1879
1811
  if [ "$MODE_HOOKS" -eq 1 ]; then
1880
1812
  run_hooks
1881
1813
  fi
1882
1814
  elif [ "$MODE_COST" -eq 1 ]; then
1883
1815
  sandbox_env
1884
1816
  run_cost "$TARGET_VERSION"
1885
- if [ "$MODE_REHYDRATE" -eq 1 ]; then
1886
- run_rehydrate "$TARGET_VERSION"
1887
- fi
1888
1817
  if [ "$MODE_HOOKS" -eq 1 ]; then
1889
1818
  run_hooks
1890
1819
  fi
1891
- elif [ "$MODE_REHYDRATE" -eq 1 ]; then
1892
- sandbox_env
1893
- rehydrate_status=0
1894
- # run_rehydrate exits when its check fails; isolate it so the separately
1895
- # requested hook canary still runs, then return a failing status afterward.
1896
- (run_rehydrate "$TARGET_VERSION") || rehydrate_status=$?
1897
- hooks_status=0
1898
- if [ "$MODE_HOOKS" -eq 1 ]; then
1899
- (run_hooks) || hooks_status=$?
1900
- fi
1901
- if [ "$rehydrate_status" -ne 0 ]; then
1902
- exit "$rehydrate_status"
1903
- fi
1904
- if [ "$hooks_status" -ne 0 ]; then
1905
- exit "$hooks_status"
1906
- fi
1907
1820
  elif [ "$MODE_HOOKS" -eq 1 ]; then
1908
1821
  sandbox_env
1909
1822
  run_hooks