pantheon-opencode 1.4.3 → 1.5.0-beta.1

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 (111) hide show
  1. package/.pantheon/code-mode/.gitkeep +0 -0
  2. package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-1.json +8 -0
  3. package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-10.json +8 -0
  4. package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-11.json +8 -0
  5. package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-2.json +8 -0
  6. package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-3.json +8 -0
  7. package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-4.json +8 -0
  8. package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-5.json +8 -0
  9. package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-6.json +8 -0
  10. package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-7.json +8 -0
  11. package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-8.json +8 -0
  12. package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-9.json +8 -0
  13. package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/heartbeat.json +8 -0
  14. package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/session.json +11 -0
  15. package/.pantheon/code-mode/README.md +93 -0
  16. package/.pantheon/code-mode/checkpoint-session.py +7 -0
  17. package/.pantheon/code-mode/checkpoint-session.sh +11 -0
  18. package/.pantheon/code-mode/checkpoint_session.py +481 -0
  19. package/.pantheon/code-mode/compress-inline.py +450 -0
  20. package/.pantheon/code-mode/eval-llm-judge.py +255 -0
  21. package/.pantheon/code-mode/eval-monte-carlo.py +368 -0
  22. package/.pantheon/code-mode/eval-run.py +197 -0
  23. package/.pantheon/code-mode/eval-static.py +321 -0
  24. package/.pantheon/code-mode/example-sync.sh +5 -0
  25. package/.pantheon/code-mode/session-end-save.py +186 -0
  26. package/.pantheon/code-mode/session-end-save.sh +18 -0
  27. package/.pantheon/code-mode/test-allowed.sh +5 -0
  28. package/.pantheon/code-mode/test-auto-continue-checkpoint.sh +179 -0
  29. package/.pantheon/code-mode/test-env.sh +7 -0
  30. package/.pantheon/code-mode/test-prlimit.sh +9 -0
  31. package/.pantheon/code-mode/test-timeout.sh +6 -0
  32. package/README.md +158 -1101
  33. package/README.pt-BR.md +222 -0
  34. package/bin/pantheon-init.mjs +30 -11
  35. package/opencode.json +1 -0
  36. package/package.json +14 -3
  37. package/plugin.json +15 -0
  38. package/scripts/_pantheon_paths.py +48 -7
  39. package/scripts/ci-validate-yaml.py +7 -2
  40. package/scripts/code_mode_server.py +33 -2
  41. package/scripts/doctor.mjs +135 -127
  42. package/scripts/generate-preset-docs.mjs +127 -66
  43. package/scripts/generate-prompts.sh +2 -2
  44. package/scripts/install/cli-ui.mjs +8 -1
  45. package/scripts/install/config-migration.mjs +401 -0
  46. package/scripts/install/health-check.mjs +3 -3
  47. package/scripts/install/model-picker.mjs +72 -23
  48. package/scripts/install/opencode-version.mjs +47 -0
  49. package/scripts/install/opencode.mjs +261 -88
  50. package/scripts/install/plugin.mjs +112 -42
  51. package/scripts/install/shared.mjs +13 -158
  52. package/scripts/install-mcp.mjs +44 -232
  53. package/scripts/mcp_persistence_server.py +344 -15
  54. package/scripts/mcp_resources_server.py +144 -40
  55. package/scripts/memory_mcp_server.py +2 -2
  56. package/scripts/recover-zenodo-deposition.mjs +146 -0
  57. package/scripts/sync-tui.mjs +32 -7
  58. package/scripts/test-opencode-v1-v2-sandbox.sh +591 -0
  59. package/scripts/uninstall.mjs +298 -954
  60. package/scripts/validate-zenodo-release.mjs +154 -0
  61. package/scripts/zenodo-artifact.mjs +21 -0
  62. package/scripts/zenodo-release-state.mjs +53 -0
  63. package/src/agents/zeus.md +25 -14
  64. package/src/mcp/_pantheon_paths.py +48 -7
  65. package/src/mcp/code_mode_server.py +33 -2
  66. package/src/mcp/eval_store.py +1 -1
  67. package/src/mcp/mcp_persistence_server.py +344 -15
  68. package/src/mcp/mcp_resources_server.py +144 -40
  69. package/src/mcp/pantheon_vision_server.py +1 -1
  70. package/src/mcp/toon_codec.py +491 -0
  71. package/src/pantheon/background-job-board.ts +67 -1
  72. package/src/pantheon/cost-command.ts +13 -9
  73. package/src/pantheon/delegate-manager.ts +384 -0
  74. package/src/pantheon/delegate-task-adapter.ts +444 -0
  75. package/src/pantheon/delegation-classifier.ts +307 -0
  76. package/src/pantheon/delegation-enforce.ts +13 -12
  77. package/src/pantheon/delegation-finalize.ts +374 -0
  78. package/src/pantheon/delegation-notify.ts +212 -0
  79. package/src/pantheon/delegation-toast.ts +73 -0
  80. package/src/pantheon/delegation.ts +1120 -0
  81. package/src/pantheon/goal-loop.ts +2 -2
  82. package/src/pantheon/goal-store.ts +1 -1
  83. package/src/pantheon/hashline/tool.ts +2 -2
  84. package/src/pantheon/model-command.ts +2 -1
  85. package/src/pantheon/permission-eval.ts +284 -0
  86. package/src/pantheon/step-cap.ts +110 -0
  87. package/src/pantheon/token-opt.ts +555 -0
  88. package/src/pantheon/toon-codec.ts +481 -0
  89. package/src/pantheon/tui-version-check.ts +1 -3
  90. package/src/pantheon/v2-bridge.ts +129 -0
  91. package/src/pantheon/v2-events.ts +131 -0
  92. package/src/pantheon/v2-hooks.ts +287 -0
  93. package/src/pantheon/v2-tool-definitions.ts +331 -0
  94. package/src/pantheon/zeus-delegate-with-retry.ts +406 -0
  95. package/src/plugin-v2/index.ts +21 -0
  96. package/src/plugin-v2.ts +836 -0
  97. package/src/plugin.ts +241 -42
  98. package/src/plugins/tui/dist/server.d.ts +1 -1
  99. package/src/plugins/tui/dist/server.d.ts.map +1 -1
  100. package/src/plugins/tui/dist/server.js +1 -1
  101. package/src/plugins/tui/dist/server.js.map +1 -1
  102. package/src/plugins/tui/dist/tui.d.ts +10 -7
  103. package/src/plugins/tui/dist/tui.d.ts.map +1 -1
  104. package/src/plugins/tui/dist/tui.js +11 -8
  105. package/src/plugins/tui/dist/tui.js.map +1 -1
  106. package/src/plugins/tui/dist/tui.tsx +22 -16
  107. package/src/plugins/tui/package-lock.json +51 -51
  108. package/src/plugins/tui/package.json +7 -7
  109. package/src/plugins/tui/src/index.tsx +28 -24
  110. package/src/skills/README.md +0 -2
  111. package/src/pantheon/tool-context.ts +0 -41
File without changes
@@ -0,0 +1,8 @@
1
+ {
2
+ "slug": "initial-token-40k",
3
+ "phase": 0,
4
+ "turn_count": 1,
5
+ "timestamp": "2026-07-24T10:57:09.398807+00:00",
6
+ "context_hash": "",
7
+ "version": 2
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "slug": "initial-token-40k",
3
+ "phase": 0,
4
+ "turn_count": 10,
5
+ "timestamp": "2026-07-24T11:14:15.230136+00:00",
6
+ "context_hash": "",
7
+ "version": 2
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "slug": "initial-token-40k",
3
+ "phase": 0,
4
+ "turn_count": 11,
5
+ "timestamp": "2026-07-24T11:21:25.938170+00:00",
6
+ "context_hash": "",
7
+ "version": 2
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "slug": "initial-token-40k",
3
+ "phase": 0,
4
+ "turn_count": 2,
5
+ "timestamp": "2026-07-24T11:00:35.522164+00:00",
6
+ "context_hash": "",
7
+ "version": 2
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "slug": "initial-token-40k",
3
+ "phase": 0,
4
+ "turn_count": 3,
5
+ "timestamp": "2026-07-24T11:01:21.558497+00:00",
6
+ "context_hash": "",
7
+ "version": 2
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "slug": "initial-token-40k",
3
+ "phase": 0,
4
+ "turn_count": 4,
5
+ "timestamp": "2026-07-24T11:02:18.695362+00:00",
6
+ "context_hash": "",
7
+ "version": 2
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "slug": "initial-token-40k",
3
+ "phase": 0,
4
+ "turn_count": 5,
5
+ "timestamp": "2026-07-24T11:04:13.337080+00:00",
6
+ "context_hash": "",
7
+ "version": 2
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "slug": "initial-token-40k",
3
+ "phase": 0,
4
+ "turn_count": 6,
5
+ "timestamp": "2026-07-24T11:07:03.322884+00:00",
6
+ "context_hash": "",
7
+ "version": 2
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "slug": "initial-token-40k",
3
+ "phase": 0,
4
+ "turn_count": 7,
5
+ "timestamp": "2026-07-24T11:08:30.280736+00:00",
6
+ "context_hash": "",
7
+ "version": 2
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "slug": "initial-token-40k",
3
+ "phase": 0,
4
+ "turn_count": 8,
5
+ "timestamp": "2026-07-24T11:10:03.409420+00:00",
6
+ "context_hash": "",
7
+ "version": 2
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "slug": "initial-token-40k",
3
+ "phase": 0,
4
+ "turn_count": 9,
5
+ "timestamp": "2026-07-24T11:12:14.924527+00:00",
6
+ "context_hash": "",
7
+ "version": 2
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "slug": "initial-token-40k",
3
+ "last_action": "2026-07-24T11:21:25.938170+00:00",
4
+ "turn_count": 11,
5
+ "current_phase": 0,
6
+ "status": "alive",
7
+ "next_action": "checkpoint saved"
8
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "task_id": "initial-token-40k",
3
+ "mode": "deepwork",
4
+ "start_time": "2026-07-24T10:57:06.212552+00:00",
5
+ "last_activity": "2026-07-24T11:21:25.938170+00:00",
6
+ "status": "in_progress",
7
+ "gate_history": [],
8
+ "stop_reason": null,
9
+ "stopped_at": null,
10
+ "turn_count": 11
11
+ }
@@ -0,0 +1,93 @@
1
+ # Pantheon Code Mode Scripts
2
+
3
+ Orchestration scripts executed via the `pantheon-code-mode` MCP server
4
+ (`execute_code_script`). All scripts live in this directory.
5
+
6
+ ## Script Index
7
+
8
+ | Script | Language | Purpose |
9
+ |--------|----------|---------|
10
+ | `checkpoint_session.py` | Python | Full checkpoint management: init, save, status, resume, list, health, archive, cleanup |
11
+ | `checkpoint-session.sh` | Bash | Shell wrapper for `checkpoint_session.py` |
12
+ | `compress-inline.py` | Python | Inline context compression — score, compress, stats, batch modes |
13
+ | `session-end-save.py` | Python | Session-end Vector DB backup scaffold |
14
+ | `session-end-save.sh` | Bash | Shell wrapper for `session-end-save.py` |
15
+ | `example-sync.sh` | Bash | Minimal demo script for testing `execute_code_script` |
16
+
17
+ ## checkpoint_session.py Commands
18
+
19
+ | Command | Description |
20
+ |---------|-------------|
21
+ | `init <slug>` | Create session.json and heartbeat.json |
22
+ | `save <slug>` | Save checkpoint + update heartbeat |
23
+ | `status <slug>` | Show human-readable session status |
24
+ | `resume <slug>` | Print latest checkpoint as JSON |
25
+ | `list <slug>` | List all checkpoints for a slug |
26
+ | `health <slug>` | Validate session consistency (required fields, checkpoint integrity, stale detection) |
27
+ | `archive <slug>` | Move session to `.pantheon/deepwork/archive/<slug>/` |
28
+ | `cleanup [--dry-run]` | Remove orphan directories, temp files, flag stale sessions |
29
+
30
+ ## Invocation
31
+
32
+ From an agent prompt, call via the MCP tool:
33
+
34
+ ```
35
+ execute_code_script("checkpoint-session.sh", args=["init", "my-task"])
36
+ ```
37
+
38
+ Or directly for cleanup (which doesn't need `checkpoint-session.sh`):
39
+
40
+ ```
41
+ execute_code_script("checkpoint_session.py", args=["cleanup", "--dry-run"])
42
+ ```
43
+
44
+ All scripts are idempotent unless noted otherwise.
45
+
46
+ ## Script Metadata (YAML Frontmatter)
47
+
48
+ Scripts may declare optional metadata in a comment-style YAML frontmatter
49
+ block at the top of the file (after the shebang). Comment lines keep the
50
+ script a valid executable in both bash and python:
51
+
52
+ ```python
53
+ #!/usr/bin/env python3
54
+ # ---
55
+ # description: Runs the checkpoint save
56
+ # timeout: 5
57
+ # allowed_args:
58
+ # - compress
59
+ # - --text
60
+ # ---
61
+ import sys
62
+ ...
63
+ ```
64
+
65
+ Supported keys:
66
+
67
+ | Key | Type | Purpose |
68
+ |-----|------|---------|
69
+ | `description` | string | Human-readable purpose, surfaced in tool output metadata |
70
+ | `timeout` | int (seconds) | Per-script execution timeout override (default 30s). The subprocess is killed when it elapses. |
71
+ | `allowed_args` | list of strings | Allowlist of CLI args accepted by `execute_code_script`. Passing an unlisted arg is rejected before execution. Omit for unrestricted args. |
72
+
73
+ Metadata is exposed in two places:
74
+
75
+ - `execute_code_script(..., json_output=true)` returns a structured dict with
76
+ `stdout`, `stderr`, `exit_code`, `duration_ms`, `timed_out`, `timeout_s`
77
+ and `metadata` (the parsed frontmatter).
78
+ - `pantheon://code-mode/scripts/{name}` resource prepends a `# metadata`
79
+ section when frontmatter is present.
80
+
81
+ Malformed or missing frontmatter fails open: the script executes with the
82
+ 30s default timeout and no arg restriction.
83
+
84
+ ## Conventions
85
+
86
+ - **Wrapper pattern**: `.sh` files are thin wrappers that pass `$@` to a
87
+ `.py` implementation. This keeps CLI ergonomics (shell-native `--flags`)
88
+ while keeping logic in Python where it's more reliable.
89
+ - **Exit codes**: 0 = success / no issues, 1 = action taken (recovery
90
+ dispatched, etc.), 2+ = error.
91
+ - **Paths**: Scripts resolve their own directory at runtime; never hardcode.
92
+ - **Output**: Artifacts go under `.pantheon/memory-bank/.tmp/` (gitignored).
93
+ See `skill: artifact-management`.
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env python3
2
+ """CLI shim — delegates to ``checkpoint_session`` module."""
3
+
4
+ from checkpoint_session import main
5
+
6
+ if __name__ == "__main__":
7
+ main()
@@ -0,0 +1,11 @@
1
+ #!/bin/bash
2
+ # Wrapper for checkpoint_session.py
3
+ # Usage: ./checkpoint-session.sh <command> <slug>
4
+ #
5
+ # Commands: init, save, status, resume, list, health, archive, cleanup
6
+
7
+ set -euo pipefail
8
+
9
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
10
+
11
+ python3 "$SCRIPT_DIR/checkpoint_session.py" "$@"