pantheon-opencode 1.4.2 → 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.
- package/.pantheon/code-mode/.gitkeep +0 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-1.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-10.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-11.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-2.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-3.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-4.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-5.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-6.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-7.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-8.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/checkpoint-9.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/heartbeat.json +8 -0
- package/.pantheon/code-mode/.pantheon/deepwork/initial-token-40k/session.json +11 -0
- package/.pantheon/code-mode/README.md +93 -0
- package/.pantheon/code-mode/checkpoint-session.py +7 -0
- package/.pantheon/code-mode/checkpoint-session.sh +11 -0
- package/.pantheon/code-mode/checkpoint_session.py +481 -0
- package/.pantheon/code-mode/compress-inline.py +450 -0
- package/.pantheon/code-mode/eval-llm-judge.py +255 -0
- package/.pantheon/code-mode/eval-monte-carlo.py +368 -0
- package/.pantheon/code-mode/eval-run.py +197 -0
- package/.pantheon/code-mode/eval-static.py +321 -0
- package/.pantheon/code-mode/example-sync.sh +5 -0
- package/.pantheon/code-mode/session-end-save.py +186 -0
- package/.pantheon/code-mode/session-end-save.sh +18 -0
- package/.pantheon/code-mode/test-allowed.sh +5 -0
- package/.pantheon/code-mode/test-auto-continue-checkpoint.sh +179 -0
- package/.pantheon/code-mode/test-env.sh +7 -0
- package/.pantheon/code-mode/test-prlimit.sh +9 -0
- package/.pantheon/code-mode/test-timeout.sh +6 -0
- package/README.md +158 -1189
- package/README.pt-BR.md +222 -0
- package/bin/pantheon-init.mjs +30 -11
- package/opencode.json +1 -0
- package/package.json +14 -3
- package/plugin.json +15 -0
- package/scripts/_pantheon_paths.py +48 -7
- package/scripts/ci-validate-yaml.py +7 -2
- package/scripts/code_mode_server.py +33 -2
- package/scripts/doctor.mjs +135 -127
- package/scripts/generate-preset-docs.mjs +127 -66
- package/scripts/generate-prompts.sh +2 -2
- package/scripts/install/cli-ui.mjs +8 -1
- package/scripts/install/config-migration.mjs +401 -0
- package/scripts/install/health-check.mjs +3 -3
- package/scripts/install/model-picker.mjs +72 -23
- package/scripts/install/opencode-version.mjs +47 -0
- package/scripts/install/opencode.mjs +261 -88
- package/scripts/install/plugin.mjs +112 -42
- package/scripts/install/shared.mjs +13 -158
- package/scripts/install-mcp.mjs +44 -232
- package/scripts/mcp_persistence_server.py +344 -15
- package/scripts/mcp_resources_server.py +144 -40
- package/scripts/memory_mcp_server.py +2 -2
- package/scripts/recover-zenodo-deposition.mjs +146 -0
- package/scripts/sync-tui.mjs +32 -7
- package/scripts/test-opencode-v1-v2-sandbox.sh +591 -0
- package/scripts/uninstall.mjs +298 -954
- package/scripts/validate-zenodo-release.mjs +154 -0
- package/scripts/zenodo-artifact.mjs +21 -0
- package/scripts/zenodo-release-state.mjs +53 -0
- package/src/mcp/_pantheon_paths.py +48 -7
- package/src/mcp/code_mode_server.py +33 -2
- package/src/mcp/eval_store.py +1 -1
- package/src/mcp/mcp_persistence_server.py +344 -15
- package/src/mcp/mcp_resources_server.py +144 -40
- package/src/mcp/pantheon_vision_server.py +1 -1
- package/src/mcp/toon_codec.py +491 -0
- package/src/pantheon/background-job-board.ts +67 -1
- package/src/pantheon/cost-command.ts +6 -2
- package/src/pantheon/delegate-manager.ts +384 -0
- package/src/pantheon/delegate-task-adapter.ts +444 -0
- package/src/pantheon/delegation-notify.ts +35 -20
- package/src/pantheon/model-command.ts +86 -32
- package/src/pantheon/token-opt.ts +555 -0
- package/src/pantheon/toon-codec.ts +481 -0
- package/src/pantheon/tui-version-check.ts +1 -3
- package/src/pantheon/v2-bridge.ts +129 -0
- package/src/pantheon/v2-events.ts +131 -0
- package/src/pantheon/v2-hooks.ts +287 -0
- package/src/pantheon/v2-tool-definitions.ts +331 -0
- package/src/plugin-v2/index.ts +21 -0
- package/src/plugin-v2.ts +836 -0
- package/src/plugin.ts +57 -10
- package/src/plugins/tui/dist/server.d.ts +1 -1
- package/src/plugins/tui/dist/server.d.ts.map +1 -1
- package/src/plugins/tui/dist/server.js +1 -1
- package/src/plugins/tui/dist/server.js.map +1 -1
- package/src/plugins/tui/dist/tui.d.ts +10 -7
- package/src/plugins/tui/dist/tui.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui.js +11 -8
- package/src/plugins/tui/dist/tui.js.map +1 -1
- package/src/plugins/tui/dist/tui.tsx +22 -16
- package/src/plugins/tui/package-lock.json +51 -51
- package/src/plugins/tui/package.json +7 -7
- package/src/plugins/tui/src/index.tsx +22 -16
- package/src/skills/README.md +0 -2
|
File without changes
|
|
@@ -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,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" "$@"
|