pantheon-opencode 1.5.0-beta.8 → 1.5.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.
- package/AGENTS.md +14 -63
- package/CHANGELOG.md +320 -0
- package/README.md +14 -27
- package/README.pt-BR.md +5 -6
- package/commands/pantheon.md +1 -35
- package/package.json +1 -2
- package/plugin.json +1 -1
- package/pyproject.toml +2 -5
- package/scripts/doctor.mjs +32 -3
- package/scripts/install/plugin.mjs +9 -12
- package/scripts/mcp_persistence_server.py +1 -1
- package/scripts/sync-tui.mjs +8 -11
- package/src/agents/apollo.md +1 -0
- package/src/agents/gaia.md +1 -0
- package/src/agents/zeus.md +9 -52
- package/src/instructions/memory-protocol.instructions.md +6 -3
- package/src/instructions/zeus-anti-stall.instructions.md +2 -4
- package/src/instructions/zeus-council-synthesis.instructions.md +3 -28
- package/src/instructions/zeus-timeout-retry.instructions.md +3 -28
- package/src/mcp/mcp_persistence_server.py +1 -1
- package/src/mcp/toon_codec.py +2 -4
- package/src/pantheon/background-job-board.ts +4 -4
- package/src/pantheon/{delegation-compaction.ts → compaction-context.ts} +10 -100
- package/src/pantheon/cost-command.ts +1 -2
- package/src/pantheon/delegation-enforce.ts +59 -14
- package/src/pantheon/goal-loop.ts +1 -1
- package/src/pantheon/goal-store.ts +1 -1
- package/src/pantheon/idle-continuation.ts +4 -6
- package/src/pantheon/model-command.ts +1 -2
- package/src/pantheon/native-task-status.ts +2 -2
- package/src/pantheon/presets.d.mts +0 -20
- package/src/pantheon/presets.mjs +0 -64
- package/src/pantheon/session-guard.ts +2 -2
- package/src/pantheon/session-id.ts +30 -0
- package/src/pantheon/task-result-guard.ts +2 -3
- package/src/pantheon/todo-enforcer.ts +3 -3
- package/src/pantheon/tool-context.ts +23 -0
- package/src/pantheon/v2-bridge.ts +1 -4
- package/src/plugin-v2.ts +8 -21
- package/src/plugin.ts +61 -245
- package/src/plugins/pantheon-hooks.ts +1 -1
- package/src/plugins/tui/dist/tui.d.ts +229 -77
- package/src/plugins/tui/dist/tui.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui.js +509 -259
- package/src/plugins/tui/package-lock.json +2 -2
- package/src/plugins/tui/package.json +2 -2
- package/src/plugins/tui/src/index.tsx +753 -279
- package/src/routing.yml +0 -16
- package/src/skills/context-compression/SKILL.md +1 -1
- package/scripts/generate-preset-docs.mjs +0 -300
- package/scripts/generate-prompts.sh +0 -222
- package/scripts/hash_verify.py +0 -192
- package/scripts/install/component.mjs +0 -24
- package/scripts/install/migrate-config.mjs +0 -302
- package/scripts/test-context-compression.sh +0 -169
- package/src/pantheon/auto-wake.ts +0 -85
- package/src/pantheon/chat-reminders.ts +0 -9
- package/src/pantheon/comment-checker.ts +0 -48
- package/src/pantheon/compaction-assert.ts +0 -160
- package/src/pantheon/compaction-handoff.ts +0 -304
- package/src/pantheon/cost-tracker.ts +0 -108
- package/src/pantheon/delegate-manager.ts +0 -766
- package/src/pantheon/delegation-classifier.ts +0 -307
- package/src/pantheon/delegation-finalize.ts +0 -406
- package/src/pantheon/delegation-notify.ts +0 -212
- package/src/pantheon/delegation-toast.ts +0 -73
- package/src/pantheon/delegation.ts +0 -1337
- package/src/pantheon/dispatch-guard.ts +0 -109
- package/src/pantheon/native-probe.ts +0 -234
- package/src/pantheon/permission-eval.ts +0 -284
- package/src/pantheon/preemptive-compact.ts +0 -76
- package/src/pantheon/provider-capabilities.ts +0 -221
- package/src/pantheon/provider-stream-tracker.ts +0 -182
- package/src/pantheon/retry-policy.ts +0 -212
- package/src/pantheon/step-cap.ts +0 -110
- package/src/pantheon/token-opt.ts +0 -689
- package/src/pantheon/toon-codec.ts +0 -481
- package/src/pantheon/v2-events.ts +0 -148
- package/src/pantheon/v2-hooks.ts +0 -287
- package/src/pantheon/v2-tool-definitions.ts +0 -331
- package/src/pantheon/zeus-delegate-with-retry.ts +0 -406
- package/src/plugins/tui/dist/tui.tsx +0 -2777
package/src/pantheon/step-cap.ts
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* R4 — Per-agent step caps (max_steps).
|
|
3
|
-
*
|
|
4
|
-
* Pure library. routing.yml `agents.<name>.max_steps` gives each agent a
|
|
5
|
-
* step budget (e.g. explore: 25, reviewer: 25, oracle: 15). When an agent's
|
|
6
|
-
* step count reaches max_steps it is forced to summarize-and-stop: the
|
|
7
|
-
* delegation is either skipped with a capped summary (already at cap) or
|
|
8
|
-
* the prompt is appended with a stop instruction (cap hit mid-dispatch).
|
|
9
|
-
*
|
|
10
|
-
* The tracker is PERMANENT-PER-PROCESS: counters accumulate for the process
|
|
11
|
-
* lifetime and are intentionally NOT reset on successful delegations or
|
|
12
|
-
* session end — a per-session reset would let an agent exceed its process
|
|
13
|
-
* budget over a long session. `reset()` exists as a tested utility for
|
|
14
|
-
* tests and future explicit reset points; no production caller wires it.
|
|
15
|
-
*
|
|
16
|
-
* @module step-cap
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
// ─── Types ─────────────────────────────────────────────────────────────
|
|
20
|
-
|
|
21
|
-
/** Default step budget when routing.yml omits max_steps for an agent. */
|
|
22
|
-
export const DEFAULT_MAX_STEPS = 25
|
|
23
|
-
|
|
24
|
-
// ─── Stop instruction ──────────────────────────────────────────────────
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* The forced summarize-and-stop instruction injected into a prompt when an
|
|
28
|
-
* agent's step count reaches max_steps.
|
|
29
|
-
*/
|
|
30
|
-
export function buildStopInstruction(agent: string, maxSteps: number): string {
|
|
31
|
-
return (
|
|
32
|
-
`\n\n[STEP CAP REACHED — ${agent} at ${maxSteps} steps] ` +
|
|
33
|
-
`You have reached the maximum step budget for this delegation. ` +
|
|
34
|
-
`STOP working immediately and summarize what was accomplished (and ` +
|
|
35
|
-
`what remains, if any) as your final message. Do not start new work.`
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* The text returned when a delegation is skipped because the agent is
|
|
41
|
-
* already at its step cap — marks the delegation as capped and asks for a
|
|
42
|
-
* summary of prior results instead of starting new work.
|
|
43
|
-
*/
|
|
44
|
-
export function cappedSummary(agent: string, maxSteps: number): string {
|
|
45
|
-
return (
|
|
46
|
-
`[STEP CAP REACHED] ${agent} has reached its max_steps budget (${maxSteps}). ` +
|
|
47
|
-
`Delegation skipped — no new work was started. ` +
|
|
48
|
-
`Summarize prior results and stop.`
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// ─── Tracker ───────────────────────────────────────────────────────────
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Per-agent step counters with a max_steps budget. Keyed by lowercase agent
|
|
56
|
-
* name (matching is case-insensitive). Agents without a configured budget
|
|
57
|
-
* are never capped.
|
|
58
|
-
*/
|
|
59
|
-
export class StepCapTracker {
|
|
60
|
-
private readonly steps = new Map<string, number>()
|
|
61
|
-
readonly maxStepsByAgent: Readonly<Record<string, number>>
|
|
62
|
-
|
|
63
|
-
constructor(maxStepsByAgent: Readonly<Record<string, number>> = {}) {
|
|
64
|
-
this.maxStepsByAgent = maxStepsByAgent
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/** The configured budget for an agent, or undefined when uncapped. */
|
|
68
|
-
maxStepsFor(agent: string): number | undefined {
|
|
69
|
-
return this.maxStepsByAgent[agent.toLowerCase()]
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/** Current step count for an agent. */
|
|
73
|
-
stepCount(agent: string): number {
|
|
74
|
-
return this.steps.get(agent.toLowerCase()) ?? 0
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/** Whether the agent has reached (or exceeded) its max_steps budget. */
|
|
78
|
-
isCapped(agent: string): boolean {
|
|
79
|
-
const max = this.maxStepsFor(agent)
|
|
80
|
-
if (max === undefined) return false
|
|
81
|
-
return this.stepCount(agent) >= max
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Record one step for an agent. Returns the new count and whether this
|
|
86
|
-
* step hit the cap (capped === true exactly when steps >= maxSteps).
|
|
87
|
-
*/
|
|
88
|
-
recordStep(agent: string): {
|
|
89
|
-
steps: number
|
|
90
|
-
capped: boolean
|
|
91
|
-
maxSteps: number | undefined
|
|
92
|
-
} {
|
|
93
|
-
const key = agent.toLowerCase()
|
|
94
|
-
const max = this.maxStepsFor(agent)
|
|
95
|
-
const steps = (this.steps.get(key) ?? 0) + 1
|
|
96
|
-
this.steps.set(key, steps)
|
|
97
|
-
return { steps, capped: max !== undefined && steps >= max, maxSteps: max }
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Reset an agent's step count.
|
|
102
|
-
*
|
|
103
|
-
* Intentionally NOT wired in production: the tracker is permanent-per-
|
|
104
|
-
* process (see module docstring) so agents cannot exceed their process
|
|
105
|
-
* budget via resets. Exists for tests and future explicit reset points.
|
|
106
|
-
*/
|
|
107
|
-
reset(agent: string): void {
|
|
108
|
-
this.steps.delete(agent.toLowerCase())
|
|
109
|
-
}
|
|
110
|
-
}
|