pantheon-opencode 1.5.0-beta.3 → 1.5.0-beta.4
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/manifest.json +21 -0
- package/CHANGELOG.md +835 -0
- package/README.md +62 -0
- package/README.pt-BR.md +18 -1
- package/package.json +2 -1
- package/plugin.json +1 -1
- package/pyproject.toml +1 -1
- package/scripts/code_mode_server.py +305 -9
- package/scripts/install/opencode.mjs +36 -0
- package/scripts/probe-pantheon-cost.mjs +10 -1
- package/scripts/sync-tui.mjs +78 -34
- package/src/agents/zeus.md +2 -2
- package/src/mcp/code_mode_server.py +305 -9
- package/src/pantheon/background-job-board.ts +14 -0
- package/src/pantheon/cost-command.ts +62 -42
- package/src/pantheon/delegate-manager.ts +109 -12
- package/src/pantheon/native-probe.ts +234 -0
- package/src/pantheon/native-task-status.ts +139 -0
- package/src/pantheon/task-result-guard.ts +107 -0
- package/src/pantheon/token-opt.ts +18 -110
- package/src/pantheon/tool-ceiling.ts +159 -0
- package/src/pantheon/v2-events.ts +10 -1
- package/src/plugin.ts +19 -1
- package/src/plugins/tui/package-lock.json +2 -2
- package/src/plugins/tui/package.json +1 -1
package/src/plugin.ts
CHANGED
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
} from './pantheon/presets.mjs'
|
|
47
47
|
import { safeSessionPath } from './pantheon/session-guard.ts'
|
|
48
48
|
import { StepCapTracker } from './pantheon/step-cap.ts'
|
|
49
|
+
import { createTaskResultGuard } from './pantheon/task-result-guard.ts'
|
|
49
50
|
import {
|
|
50
51
|
TODO_ENFORCER_DEFAULTS,
|
|
51
52
|
TodoEnforcer,
|
|
@@ -53,6 +54,7 @@ import {
|
|
|
53
54
|
todoEnforcerEnabledFromEnv,
|
|
54
55
|
} from './pantheon/todo-enforcer.ts'
|
|
55
56
|
import { TodoPreserver } from './pantheon/todo-preserve.ts'
|
|
57
|
+
import { handleToolCeilingEvent, type ToolCeilingResult } from './pantheon/tool-ceiling.ts'
|
|
56
58
|
import { checkTuiVersionStaleness } from './pantheon/tui-version-check.ts'
|
|
57
59
|
import { activePresetCandidates, createVisionHandler } from './pantheon/vision.ts'
|
|
58
60
|
|
|
@@ -165,6 +167,7 @@ const COMPACTION_MAX_ITEMS = 10
|
|
|
165
167
|
const rootSessions = new Set<string>()
|
|
166
168
|
const sessionHierarchy = new SessionHierarchyRegistry()
|
|
167
169
|
const sessionAgents = new Map<string, string>()
|
|
170
|
+
const sessionToolCeilings = new Map<string, ToolCeilingResult>()
|
|
168
171
|
|
|
169
172
|
/**
|
|
170
173
|
* Seed resumed root sessions without making OpenCode startup depend on the
|
|
@@ -504,13 +507,18 @@ const plugin: Plugin = async (input: PluginInput) => {
|
|
|
504
507
|
},
|
|
505
508
|
}
|
|
506
509
|
const sandboxHandler = createContextSandbox(sandboxConfig)
|
|
510
|
+
// Task Result Guard (2026-09-10): detect empty task() results from native
|
|
511
|
+
// opencode subagent calls and convert to explicit errors. Runs FIRST in the
|
|
512
|
+
// chain so the error message is visible even if later handlers skip.
|
|
513
|
+
const taskResultGuard = createTaskResultGuard()
|
|
507
514
|
const combinedAfter: typeof readEnhancer = async (input, output) => {
|
|
515
|
+
await taskResultGuard(input, output)
|
|
508
516
|
await sandboxHandler(input, output)
|
|
509
517
|
await readEnhancer(input, output)
|
|
510
518
|
}
|
|
511
519
|
|
|
512
520
|
// Wave 4 (PR #46): /cost — delegation cost + token visibility. Reads
|
|
513
|
-
// opencode.db read-only
|
|
521
|
+
// opencode.db read-only via the single node:sqlite backend.
|
|
514
522
|
// Fully wired (unlike dispatch-guard, which is manual-orchestration-only
|
|
515
523
|
// because opencode 1.18.x cannot intercept task completion via hooks).
|
|
516
524
|
const costCommand = createCostCommand()
|
|
@@ -615,6 +623,9 @@ const plugin: Plugin = async (input: PluginInput) => {
|
|
|
615
623
|
if (ev.type === 'session.compacted') {
|
|
616
624
|
await todoPreserver.onCompacted(ev.properties.sessionID)
|
|
617
625
|
}
|
|
626
|
+
if (ev.type === 'message.updated') {
|
|
627
|
+
await handleToolCeilingEvent(input.client, ev, sessionToolCeilings)
|
|
628
|
+
}
|
|
618
629
|
// Phase 3: observe completion on child sessions → finalizeDelegation.
|
|
619
630
|
// The board transition fires onTerminal → the file-only audit log (no
|
|
620
631
|
// chat delivery — see the onTerminal listener above). Unknown sessions
|
|
@@ -680,6 +691,13 @@ const plugin: Plugin = async (input: PluginInput) => {
|
|
|
680
691
|
list: (sessionID: string) => todoEnforcer.listPendingTodos(sessionID),
|
|
681
692
|
},
|
|
682
693
|
})
|
|
694
|
+
const ceiling = sessionToolCeilings.get(_input.sessionID)
|
|
695
|
+
if (ceiling?.status === 'OK') {
|
|
696
|
+
output.context.push(
|
|
697
|
+
`<tool_ceiling remaining_context_tokens="${ceiling.ceiling}">` +
|
|
698
|
+
'Use the remaining host-reported context budget when selecting tools.</tool_ceiling>',
|
|
699
|
+
)
|
|
700
|
+
}
|
|
683
701
|
if (blocks.length > 0) {
|
|
684
702
|
output.context.push(...blocks)
|
|
685
703
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pantheon-tui",
|
|
3
|
-
"version": "1.5.0-beta.
|
|
3
|
+
"version": "1.5.0-beta.4",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pantheon-tui",
|
|
9
|
-
"version": "1.5.0-beta.
|
|
9
|
+
"version": "1.5.0-beta.4",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@opencode-ai/plugin": ">=1.14.0",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pantheon-tui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.5.0-beta.
|
|
4
|
+
"version": "1.5.0-beta.4",
|
|
5
5
|
"description": "Pantheon TUI plugin — sidebar (version, preset, sessions, real-time delegations) + AI subscription usage gauges incl. OpenCode Go/Zen dollar limits (vendored, MIT)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"exports": {
|