pantheon-opencode 1.6.2-beta.9 → 1.6.2
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/CHANGELOG.md +101 -0
- package/README.md +34 -60
- package/README.pt-BR.md +10 -12
- package/bin/pantheon-init.mjs +22 -32
- package/package.json +3 -3
- package/plugin.json +1 -1
- package/pyproject.toml +1 -1
- package/scripts/decision-router.mjs +41 -56
- package/scripts/install/decision-router-config.mjs +67 -1
- package/scripts/install/npx-cache-sweep.mjs +103 -0
- package/scripts/install/opencode.mjs +7 -7
- package/scripts/install/plugin.mjs +4 -3
- package/scripts/install/strings.mjs +4 -0
- package/scripts/release-gates.mjs +6 -82
- package/scripts/sync-tui.mjs +3 -3
- package/src/agents/zeus.md +4 -2
- package/src/pantheon/jev-decision-tool.ts +366 -114
- package/src/pantheon/jev-decisions.ts +11 -13
- package/src/pantheon/jev-escalation.ts +639 -0
- package/src/pantheon/jev-quality-score.ts +432 -0
- package/src/pantheon/jev-risk-gate.ts +479 -0
- package/src/pantheon/local-decision-prompt.ts +12 -18
- package/src/pantheon/v2-decision-telemetry.ts +14 -4
- package/src/pantheon/v2-native-decisions.ts +1 -1
- package/src/plugin-v2.ts +201 -24
- package/src/plugins/tui/dist/server-v2.d.ts +19 -11
- package/src/plugins/tui/dist/server-v2.d.ts.map +1 -1
- package/src/plugins/tui/dist/server-v2.js +19 -789
- package/src/plugins/tui/dist/server-v2.js.map +1 -1
- package/src/plugins/tui/dist/tui-v2.d.ts +12 -331
- package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui-v2.js +257 -5370
- package/src/plugins/tui/dist/tui-v2.js.map +1 -1
- package/src/plugins/tui/dist/tui.js +1 -1
- package/src/plugins/tui/package-lock.json +2 -2
- package/src/plugins/tui/package.json +1 -1
- package/src/plugins/tui/src/index-v2.tsx +213 -86
- package/src/plugins/tui/src/server-v2.ts +18 -982
- package/src/plugins/tui/tsconfig.typecheck.json +1 -6
- package/src/plugins/tui/tsdown.config.ts +1 -11
- package/src/plugins/tui/dist/cost-data-CCZUs1aJ.js +0 -749
- package/src/plugins/tui/dist/cost-data-CCZUs1aJ.js.map +0 -1
- package/src/plugins/tui/dist/quota-adapters.d.ts +0 -89
- package/src/plugins/tui/dist/quota-adapters.d.ts.map +0 -1
- package/src/plugins/tui/dist/quota-adapters.js +0 -1142
- package/src/plugins/tui/dist/quota-adapters.js.map +0 -1
- package/src/plugins/tui/dist/quota-cli.d.ts +0 -17
- package/src/plugins/tui/dist/quota-cli.d.ts.map +0 -1
- package/src/plugins/tui/dist/quota-cli.js +0 -184
- package/src/plugins/tui/dist/quota-cli.js.map +0 -1
- package/src/plugins/tui/dist/quota-rpc-DMmXBhBe.js +0 -684
- package/src/plugins/tui/dist/quota-rpc-DMmXBhBe.js.map +0 -1
- package/src/plugins/tui/dist/usage-history-contract-nt1rnBPE.js +0 -118
- package/src/plugins/tui/dist/usage-history-contract-nt1rnBPE.js.map +0 -1
- package/src/plugins/tui/dist/usage-history-worker.js +0 -25
- package/src/plugins/tui/dist/usage-history-worker.js.map +0 -1
- package/src/plugins/tui/src/go-key-diagnostic-ui.ts +0 -100
- package/src/plugins/tui/src/go-key-diagnostic.ts +0 -125
- package/src/plugins/tui/src/quota-adapters.ts +0 -1598
- package/src/plugins/tui/src/quota-cli.ts +0 -237
- package/src/plugins/tui/src/quota-rpc.ts +0 -373
- package/src/plugins/tui/src/quota-v2-model.ts +0 -1032
- package/src/plugins/tui/src/quota-v2.tsx +0 -1238
- package/src/plugins/tui/src/usage-history-contract.ts +0 -217
- package/src/plugins/tui/src/usage-history-validation.ts +0 -104
- package/src/plugins/tui/src/usage-history-view.tsx +0 -236
- package/src/plugins/tui/src/usage-history-worker.ts +0 -25
- package/src/plugins/tui/src/usage-view-model.ts +0 -272
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,107 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
10
10
|
<!-- Add new changes here. Running `node scripts/versioning.mjs apply` will
|
|
11
11
|
move this section to a versioned entry and reset the template below. -->
|
|
12
12
|
|
|
13
|
+
## [v1.6.2] - 2026-11-03
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **routing** — The Jev uplift: the native `pantheon_jev_decide` route works end to end (Console free variant field-verified), and TypeSafe direct is one `decision-router setup-model` command away.
|
|
18
|
+
- **routing** — `decision-router doctor` is route-aware: Console routes pass host-native without a catalog probe; the TypeSafe route is checked against the provider entry.
|
|
19
|
+
- **hooks** — J1 risk-score advisory gate (shadow): one Jev risk-score + intent observation per exfil-capable tool call when `PANTHEON_J1_RISK_SCORE` is on; never blocks; zero user content.
|
|
20
|
+
- **hooks** — J3 turn-complexity escalation (shadow): cheap-vs-main per delegate dispatch with local rails, behind `PANTHEON_J3_ESCALATION`; the override is proven, never applied in shadow.
|
|
21
|
+
- **routing** — J4 `mode: "review"` quality scoring: one round-trip quality + needs-review predicate for delegated results, on demand; the result never leaves the machine.
|
|
22
|
+
- **routing** — The offline J2 skill-selection scorecard harness ships in `bench/results/` (29 scenarios, replies faked, honest negatives).
|
|
23
|
+
- **install** — `init` sweeps stale `pantheon-opencode` copies from the npm cache's `_npx/` after a successful install (failures retry on the next init).
|
|
24
|
+
|
|
25
|
+
### Deprecated
|
|
26
|
+
|
|
27
|
+
- **install** — `--opencode-version v1` keeps its deprecation warning on this line; Pantheon 2.0 refuses it outright.
|
|
28
|
+
|
|
29
|
+
### Removed
|
|
30
|
+
|
|
31
|
+
- **tui** — The native `/quota` panel, the sidebar quota block, usage history, go-key diagnostics, and the `pantheon.quota` RPC; see the community replacement below.
|
|
32
|
+
- **tui** — `/quota-go-check` and the undocumented `PANTHEON_TRUSTED_BL_EXECUTABLE` env var.
|
|
33
|
+
- **docs** — The quota replacement is documented in `docs/tui-v2-quota-providers.md`: `@slkiser/opencode-quota`.
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- **routing** — Three field-measured causes of a dead `pantheon_jev_decide` are fixed: the detached `model.list()` call, the wrapped `{ data: [...] }` shape, and the catalog-presence gate.
|
|
38
|
+
- **routing** — Decision models are not chat models: route resolution reads config only; the visible `pantheon-decision-router:v1` prompt marker is suppressed.
|
|
39
|
+
- **agents** — Zeus's decision-routing instructions no longer reference the removed `/quota-go-check` command.
|
|
40
|
+
|
|
41
|
+
## [v1.6.2-beta.17] - 2026-11-03
|
|
42
|
+
|
|
43
|
+
### Added
|
|
44
|
+
|
|
45
|
+
- **routing** — J2 skill-selection scorecard harness: an offline, rerunnable, dated scorecard (29 synthetic scenarios including adversarial injection and refusal shapes, every Jev reply faked — zero network) measuring the P2 prefilter and the skills preset against expected picks, with honest negatives recorded in `bench/results/`. Activation gate: two consecutive scorecards, separately reviewed.
|
|
46
|
+
- **hooks** — J3 turn-complexity escalation policy (shadow): when `PANTHEON_J3_ESCALATION` is on, delegate dispatches get one Jev complexity classification resolved cheap-vs-main through a pure policy with independent local rails (risk-word states never downgrade, user-pinned models always win, oversize context never downgrades, uncertainty resolves to main). Structurally shadow-only — the wiring cannot reach the override mechanism (contract-test enforced); the mechanism itself is proven by direct tests for the separately reviewed activation. Default off.
|
|
47
|
+
- **routing** — J4 output quality scoring: a new `mode: "review"` on `pantheon_jev_decide` scores a delegated result against caller-named criteria (one round-trip: quality score + needs-human-review predicate). The request carries no result content — only delegate id, result kind, shape metrics, and bounded criteria. Advisory flag only; nothing blocks. On demand (Zeus-only, same consent/caps/permission chain).
|
|
48
|
+
|
|
49
|
+
## [v1.6.2-beta.16] - 2026-11-03
|
|
50
|
+
|
|
51
|
+
### Added
|
|
52
|
+
|
|
53
|
+
- **hooks** — J1 risk-score advisory gate (shadow): when `PANTHEON_J1_RISK_SCORE` is on, exfil-capable tool calls get one Jev risk-score + intent-predicate observation through the same gate chain as `pantheon_jev_decide` (consent, budget caps, `decision.egress` permission). Shadow only — the verdict is always observed, never enforced; nothing blocks or delays (2s abandon, fail-open on every failure mode). The request carries zero user content: tool name token, scope class, input hash only. Default off.
|
|
54
|
+
|
|
55
|
+
## [v1.6.2-beta.15] - 2026-11-03
|
|
56
|
+
|
|
57
|
+
### Added
|
|
58
|
+
|
|
59
|
+
- **routing** — `decision-router setup-model typesafe-jev/...` now provisions the TypeSafe host provider entry itself (the same additive `providers.typesafe-ai` merge the installer's `--decision-model` path performs), so the TypeSafe direct route is one command plus your own sign-in.
|
|
60
|
+
- **routing** — `doctor` checks are route-aware: the Console routes pass as host-native without any catalog probe (decision models are not chat models and never appear in `opencode models`), and the TypeSafe route is verified against the provider entry with a provisioning fix hint.
|
|
61
|
+
|
|
62
|
+
## [v1.6.2-beta.14] - 2026-11-03
|
|
63
|
+
|
|
64
|
+
### Fixed
|
|
65
|
+
|
|
66
|
+
- **routing** — The native Jev route no longer consults the host chat catalog. Decision models are not chat models: on a measured 2.2.5 host the catalog carries 561 entries and zero jev models, while the decisions API answers the exact same model ref directly (`jev-1.13-free` -> real answer at $0.00; the paid `jev-1.13` without a Zen workspace -> the host's own 404). The catalog-presence gate was a wrong assumption that sandbox mocks reinforced; route resolution is now config + budget admission, with consent, caps and the host permission assertion unchanged as the safety gates. `ROUTE_UNRESOLVED` and its inner verdicts are gone from the surface. Field-verified end to end: Zeus -> `pantheon_jev_decide` (mode skills) -> real Jev answer, usage reconciled.
|
|
67
|
+
- **routing** — The `decision-router setup-model` checklist no longer tells users to verify the model in the host catalog (it is not there by design).
|
|
68
|
+
|
|
69
|
+
<!-- Add new changes here. Running `node scripts/versioning.mjs apply` will
|
|
70
|
+
move this section to a versioned entry and reset the template below. -->
|
|
71
|
+
## [v1.6.2-beta.13] - 2026-11-03
|
|
72
|
+
|
|
73
|
+
### Added
|
|
74
|
+
|
|
75
|
+
- **install** — `init` now sweeps stale `pantheon-opencode` copies out of the npm cache's `_npx/` after a successful install (only the package subtree; unrelated packages and the just-installed copy survive). Field evidence: a 1.6.1 npx copy beside the registered 1.6.2-beta.12 made a bare `npx pantheon-opencode doctor` report the registered plugin as outdated, and old copies accumulate forever because npm never prunes them. Removal failures are swallowed and retried by the next init.
|
|
76
|
+
- **routing** — `ROUTE_UNRESOLVED` refusals now carry the inner verdict in `detail` (`MODEL_NOT_IN_CATALOG`, `AMBIGUOUS_MODEL`, `MODEL_NOT_DECISION`): the class alone does not tell whether the configured decision model is absent from the host catalog or present but not decision-typed, and those have different fixes. Field-measured on 2.2.5: a host catalog without the Console Jev model (no OpenCode Console credential) reports `MODEL_NOT_IN_CATALOG`.
|
|
77
|
+
|
|
78
|
+
<!-- Add new changes here. Running `node scripts/versioning.mjs apply` will
|
|
79
|
+
move this section to a versioned entry and reset the template below. -->
|
|
80
|
+
## [v1.6.2-beta.12] - 2026-11-03
|
|
81
|
+
|
|
82
|
+
### Added
|
|
83
|
+
|
|
84
|
+
- **routing** — `ROUTE_UNRESOLVED` refusals now carry the inner verdict in `detail` (`MODEL_NOT_IN_CATALOG`, `AMBIGUOUS_MODEL`, `MODEL_NOT_DECISION`): the class alone does not tell whether the configured decision model is absent from the host catalog or present but not decision-typed, and those have different fixes. Field-measured on 2.2.5: a host catalog without the Console Jev model (no OpenCode Console credential) reports `MODEL_NOT_IN_CATALOG`.
|
|
85
|
+
|
|
86
|
+
<!-- Add new changes here. Running `node scripts/versioning.mjs apply` will
|
|
87
|
+
move this section to a versioned entry and reset the template below. -->
|
|
88
|
+
## [v1.6.2-beta.11] - 2026-11-03
|
|
89
|
+
|
|
90
|
+
### Fixed
|
|
91
|
+
|
|
92
|
+
- **routing** — `pantheon_jev_decide` now accepts the host's wrapped catalog shape. The 2.2.5 host returns `{ data: [...] }` from `model.list()`, not a bare array; requiring an array turned every real session into `CATALOG_UNAVAILABLE` (field evidence: the sanitized `detail: TypeError` under beta.10 once the receiver binding landed). Same tolerance as the vision surface, which already unwrapped the page object.
|
|
93
|
+
|
|
94
|
+
<!-- Add new changes here. Running `node scripts/versioning.mjs apply` will
|
|
95
|
+
move this section to a versioned entry and reset the template below. -->
|
|
96
|
+
## [v1.6.2-beta.10] - 2026-11-03
|
|
97
|
+
|
|
98
|
+
### Added
|
|
99
|
+
|
|
100
|
+
- **routing** — Jev refusals carry the sanitized error CLASS in a `detail` field (`TypeError`, `RangeError`, …): enough to tell a detached-call failure from a host-side data failure, while the message (which can carry paths or provider detail) never reaches the chat.
|
|
101
|
+
|
|
102
|
+
### Changed
|
|
103
|
+
|
|
104
|
+
- **tui** — The native quota surface is removed: the `/quota` panel, the sidebar quota block, usage history, the go-key diagnostics, and the `pantheon.quota` RPC no longer ship. The recommended community plugin [`@slkiser/opencode-quota`](https://github.com/slkiser/opencode-quota) covers provider quota and usage (OpenCode 2.0.26+; an `npx` installer path exists for 1.x hosts) — see [Quota & usage](docs/tui-v2-quota-providers.md). `pantheon_cost` and the sidebar `Context` block are unaffected.
|
|
105
|
+
- **routing** — The visible `<!-- pantheon-decision-router:v1 … -->` marker is no longer appended to the prompt: the host chat rendered the HTML comment to the user. The router keeps running (shadow observation, telemetry, budget, presets); measured evidence showed every prompt mutation was a no-op (F-24, F-08/F-09), so no behavioral routing is lost.
|
|
106
|
+
- **agents** — Zeus's decision-routing instructions no longer reference the removed `/quota-go-check` command.
|
|
107
|
+
|
|
108
|
+
### Fixed
|
|
109
|
+
|
|
110
|
+
- **routing** — The native Jev runtime now invokes host methods with their owning domain as receiver. `model.list()` was called detached from the host object and threw on real sessions, surfacing only as `CATALOG_UNAVAILABLE`; the canary always exercised the bound call and never caught it. `decisions()` and `skill.list()` are bound the same way, with a contract test that fails on any detached call.
|
|
111
|
+
|
|
112
|
+
<!-- Add new changes here. Running `node scripts/versioning.mjs apply` will
|
|
113
|
+
move this section to a versioned entry and reset the template below. -->
|
|
13
114
|
## [v1.6.2-beta.9] - 2026-11-02
|
|
14
115
|
|
|
15
116
|
### Added
|
package/README.md
CHANGED
|
@@ -104,68 +104,22 @@ see [Quick Start](docs/QUICKSTART.md).
|
|
|
104
104
|
the host's native Decisions API (TypeSafe Jev via OpenCode Console or a
|
|
105
105
|
configured decision model) behind the user's consent and budget gates — it
|
|
106
106
|
never dispatches agents, runs skills, or changes permissions. This does not
|
|
107
|
-
change separately documented
|
|
107
|
+
change the separately documented Vision integration. See the
|
|
108
108
|
[router reference](docs/reference/local-decision-router.md) and the
|
|
109
109
|
[Native Decisions (Jev)](docs/reference/native-decisions.md).
|
|
110
110
|
- **An optional TUI** with a dispatch sidebar block and a full-width
|
|
111
|
-
`/dispatch` panel. The V2
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
discount, and is explicitly not billable.
|
|
124
|
-
Quota windows show text amounts and status, not provider progress gauges. They
|
|
125
|
-
show a local countdown and the provider-reported reset date/time in UTC when
|
|
126
|
-
valid timing is available; missing timing is not inferred. After expiry the UI
|
|
127
|
-
shows “aguardando atualização” until refreshed data arrives.
|
|
128
|
-
When a quota status request fails, the UI preserves the last valid
|
|
129
|
-
snapshot, marks it stale, and shows the failure cause as `Erro: <causa>`
|
|
130
|
-
in the sidebar and `/quota` panel (plus a `Último erro` line) instead
|
|
131
|
-
of a blind "Status indisponível"; the cause is logged as
|
|
132
|
-
`[pantheon-tui quota]`.
|
|
133
|
-
Usage severity uses warning color from 60% consumed and error color above 85%.
|
|
134
|
-
Session costs, provider balances and selected-key usage retain their distinct
|
|
135
|
-
labels and reported periods. Long values and states continue onto additional
|
|
136
|
-
lines within the sidebar's fixed 34-column content budget.
|
|
137
|
-
The installer selects the `plugins` component by default; in interactive setup
|
|
138
|
-
you can change the component selection. A component-scoped install includes
|
|
139
|
-
the TUI only when `plugins` is selected.
|
|
140
|
-
The V2 quota RPC shows providers when OpenCode lists an active supported
|
|
141
|
-
connection and Pantheon can locally resolve a nonblank credential. OpenCode
|
|
142
|
-
Go also supports `OPENCODE_API_KEY` and effective `opencode-go`/`opencode`
|
|
143
|
-
provider settings. This is not proof that the provider accepted the
|
|
144
|
-
credential; failed requests and unsupported adapters can remain visible as
|
|
145
|
-
unavailable. OpenCode Go checks a selected Console OAuth login first when
|
|
146
|
-
available, then uses the first available API key if no Console login exists
|
|
147
|
-
or its request fails; a Console 404 or a successful response without an
|
|
148
|
-
access object reports no Go subscription and does not fall back.
|
|
149
|
-
The API-key route follows OpenCode Quota's supported Go usage endpoint. See
|
|
150
|
-
the
|
|
151
|
-
[quota provider coverage table](docs/tui-v2-quota-providers.md) for limits and
|
|
152
|
-
troubleshooting.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
Quota status requests are separate from the decision subsystem and continue to use
|
|
156
|
-
their documented provider APIs. Removing decision-provider transport does not
|
|
157
|
-
disable these quota requests.
|
|
158
|
-
`/quota-go-check` is a separate manual, confirmation-gated diagnostic: one
|
|
159
|
-
GET to `https://opencode.ai/zen/go/v1/usage` with the configured Go API key
|
|
160
|
-
(not OAuth), at most one attempt per plugin runtime. It never refreshes quota,
|
|
161
|
-
follows redirects or retries. Only HTTP 401 bodies are inspected, up to 4096
|
|
162
|
-
bytes, for an own top-level JSON `error` property; its value is never inspected.
|
|
163
|
-
Results contain only a safe category, optional HTTP status, coarse content type,
|
|
164
|
-
and (for 401) whether that structure is present, absent, or unavailable.
|
|
165
|
-
No error code, type, message, body, request ID, or byte count is displayed;
|
|
166
|
-
a 401 rejection's cause remains unknown. `success` means
|
|
167
|
-
HTTP success only—not a stable quota contract or parsed quota correctness.
|
|
168
|
-
Require Themis security review before using this diagnostic.
|
|
111
|
+
`/dispatch` panel. The V2 sidebar keeps the Pantheon version, the active
|
|
112
|
+
preset/source, git state, and a `Context` block (tokens, a percent gauge,
|
|
113
|
+
`$<spent> spent`, and a muted `cache <n>% · <n.n> tok/s` line); the native
|
|
114
|
+
prompt footer keeps its own line, and Pantheon only appends
|
|
115
|
+
`▸<preset> · ✦<n> ativos` while delegations are running. The installer
|
|
116
|
+
selects the `plugins` component by default; in interactive setup you can
|
|
117
|
+
change the component selection. A component-scoped install includes the TUI
|
|
118
|
+
only when `plugins` is selected. The TUI ships no quota panel: for provider
|
|
119
|
+
quota and usage inside OpenCode, install the recommended community plugin
|
|
120
|
+
[`@slkiser/opencode-quota`](https://github.com/slkiser/opencode-quota) — see
|
|
121
|
+
[Quota & usage](docs/tui-v2-quota-providers.md). `pantheon_cost` and
|
|
122
|
+
`pantheon_model` keep working unchanged.
|
|
169
123
|
|
|
170
124
|
Vision requests to OpenCode Zen require a valid active session and are rejected
|
|
171
125
|
before image fetching or model-catalog lookup when the session is missing or
|
|
@@ -258,7 +212,27 @@ credentials cannot activate it. Native child-session dispatch remains separate.
|
|
|
258
212
|
The one native egress surface is the Zeus-only `pantheon_jev_decide` tool,
|
|
259
213
|
available on hosts that expose the V2.2.5 native Decisions API; its full gate
|
|
260
214
|
chain, routes, and settlement rules are documented once in
|
|
261
|
-
[V2 native Decisions](docs/reference/native-decisions.md).
|
|
215
|
+
[V2 native Decisions](docs/reference/native-decisions.md). An opt-in second
|
|
216
|
+
consumer of that chain, the J1 risk-score shadow gate, fires one bounded
|
|
217
|
+
native decision per write/execute tool call behind `PANTHEON_J1_RISK_SCORE`
|
|
218
|
+
(off by default, zero overhead when off): the request carries no user content
|
|
219
|
+
(tool name token, scope class, input sha256 only), every failure mode skips
|
|
220
|
+
silently with a reason token, and the shadow record is the whole effect — it
|
|
221
|
+
never blocks, asks, or narrows a permission. A third opt-in consumer, the J3
|
|
222
|
+
turn-complexity escalation, runs in shadow behind `PANTHEON_J3_ESCALATION`
|
|
223
|
+
(off by default): it classifies each delegate dispatch with one bounded score
|
|
224
|
+
question (Brief sha256, length and a risk-word flag only — the Brief text
|
|
225
|
+
never leaves the machine), local rails (risk words, user-pinned models, large
|
|
226
|
+
context) and every unsure answer always favor the main model, and the recorded
|
|
227
|
+
verdict never changes the dispatched model — the per-agent override mechanism
|
|
228
|
+
is proved by test and reserved for a separately reviewed activation with its
|
|
229
|
+
own measured baseline. A fourth consumer needs no flag at all: the tool's
|
|
230
|
+
`mode: "review"` (J4 output-quality scoring) runs only when Zeus explicitly
|
|
231
|
+
asks, after a delegation completes — one typed round-trip returns an advisory
|
|
232
|
+
quality score against named criteria plus a needs-review flag. The result
|
|
233
|
+
content never leaves the machine (shape metrics and criteria only, hostile
|
|
234
|
+
criteria rejected outright), and the verdict is advisory telemetry plus a
|
|
235
|
+
flag: it never blocks, retries, or alters the delegated result.
|
|
262
236
|
|
|
263
237
|
The installer may retain a legacy target-specific preference; it does not control
|
|
264
238
|
runtime routing. `npx pantheon-opencode decision-router ...` manages stored
|
package/README.pt-BR.md
CHANGED
|
@@ -85,18 +85,16 @@ apenas — `init` → reiniciar → `/dispatch` → primeiro resultado — veja
|
|
|
85
85
|
[referência do roteador](docs/reference/local-decision-router.md) e o
|
|
86
86
|
[Decisions nativas (Jev)](docs/reference/native-decisions.md).
|
|
87
87
|
- **Uma TUI opcional**, com bloco de dispatch na sidebar e painel `/dispatch`
|
|
88
|
-
em largura total. A
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
pelo provedor em UTC. Horários ausentes não são inferidos. Use `E` para
|
|
99
|
-
desativar a quota e `M` para alternar entre restante e usado.
|
|
88
|
+
em largura total. A sidebar V2 mantém a versão do Pantheon, o preset/fonte
|
|
89
|
+
ativos, o estado do git e um bloco `Context` (tokens, medidor de percentual,
|
|
90
|
+
`$<gasto> gastos` e uma linha mutada `cache <n>% · <n.n> tok/s`); o rodapé
|
|
91
|
+
nativo do prompt segue intacto, e o Pantheon só acrescenta
|
|
92
|
+
`▸<preset> · ✦<n> ativos` enquanto há delegações rodando. A TUI não traz mais
|
|
93
|
+
painel de quota: para ver quota e uso de provedores dentro do OpenCode,
|
|
94
|
+
instale o plugin comunitário recomendado
|
|
95
|
+
[`@slkiser/opencode-quota`](https://github.com/slkiser/opencode-quota) — veja
|
|
96
|
+
[Quota & uso](docs/tui-v2-quota-providers.md). As tools `pantheon_cost` e
|
|
97
|
+
`pantheon_model` seguem funcionando sem alterações.
|
|
100
98
|
|
|
101
99
|
A memória MCP fica disponível para busca explícita: o coordenador consulta o
|
|
102
100
|
histórico uma vez quando ele pode mudar a tarefa e repassa apenas resultados
|
package/bin/pantheon-init.mjs
CHANGED
|
@@ -26,6 +26,7 @@ import { fileURLToPath } from 'node:url'
|
|
|
26
26
|
import { configure as configureUi, endGaugeLine, tag } from '../scripts/install/cli-ui.mjs'
|
|
27
27
|
import { resolveComponentSelection } from '../scripts/install/component-selection.mjs'
|
|
28
28
|
import { resolveGlobalConfigDirectory } from '../scripts/install/config-paths.mjs'
|
|
29
|
+
import { provisionTypesafeHostProvider } from '../scripts/install/decision-router-config.mjs'
|
|
29
30
|
import { resolveInstallExitCode } from '../scripts/install/exit-codes.mjs'
|
|
30
31
|
import { createInterruptHandler } from '../scripts/install/interrupt.mjs'
|
|
31
32
|
import { parseOpenCodeVersion } from '../scripts/install/opencode-version.mjs'
|
|
@@ -68,40 +69,13 @@ function readVersion() {
|
|
|
68
69
|
/**
|
|
69
70
|
* Merge (never overwrite) the TypeSafe decision-model entry into the user's
|
|
70
71
|
* OpenCode config, so choosing the TypeSafe route in the wizard needs only the
|
|
71
|
-
* user's own sign-in afterwards.
|
|
72
|
-
*
|
|
73
|
-
* short failure reason for the installer to print.
|
|
72
|
+
* user's own sign-in afterwards. Delegates to the shared installer module —
|
|
73
|
+
* the same provisioner `decision-router setup-model typesafe-jev/...` uses.
|
|
74
|
+
* Returns true, or a short failure reason for the installer to print.
|
|
74
75
|
*/
|
|
75
76
|
function provisionTypesafeProvider() {
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
const base = xdg && xdg.startsWith('/') ? xdg : `${home ?? '~'}/.config`
|
|
79
|
-
const candidates = [`${base}/opencode/opencode.json`]
|
|
80
|
-
if (home) candidates.push(`${home}/.config/opencode/opencode.json`)
|
|
81
|
-
const configPath = candidates.find((candidate) => fs.existsSync(candidate))
|
|
82
|
-
if (configPath === undefined) return 'opencode.json not found'
|
|
83
|
-
let data
|
|
84
|
-
try {
|
|
85
|
-
data = JSON.parse(fs.readFileSync(configPath, 'utf8'))
|
|
86
|
-
} catch {
|
|
87
|
-
return 'opencode.json is not plain JSON (comments?)'
|
|
88
|
-
}
|
|
89
|
-
data.providers ??= {}
|
|
90
|
-
data.providers['typesafe-ai'] ??= {}
|
|
91
|
-
data.providers['typesafe-ai'].models ??= {}
|
|
92
|
-
if (data.providers['typesafe-ai'].models['jev-1.14.0'] === undefined) {
|
|
93
|
-
data.providers['typesafe-ai'].models['jev-1.14.0'] = {
|
|
94
|
-
name: 'Jev (TypeSafe direct)',
|
|
95
|
-
modelID: 'jev-latest',
|
|
96
|
-
type: 'decision',
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
try {
|
|
100
|
-
fs.writeFileSync(configPath, `${JSON.stringify(data, null, 2)}\n`)
|
|
101
|
-
return true
|
|
102
|
-
} catch (error) {
|
|
103
|
-
return String(error instanceof Error ? error.message : error)
|
|
104
|
-
}
|
|
77
|
+
const result = provisionTypesafeHostProvider({ env: process.env })
|
|
78
|
+
return result.ok ? true : result.reason
|
|
105
79
|
}
|
|
106
80
|
|
|
107
81
|
/** Value of a repeatable installer flag from the raw argv, or undefined. */
|
|
@@ -1077,6 +1051,22 @@ async function main() {
|
|
|
1077
1051
|
}
|
|
1078
1052
|
}
|
|
1079
1053
|
|
|
1054
|
+
// Old-version residue: every `npx pantheon-opencode` invocation materializes
|
|
1055
|
+
// a full copy under the npm cache's _npx/ and nothing in npm removes old
|
|
1056
|
+
// ones. The registration points at THIS run's copy, so every other copy is
|
|
1057
|
+
// unreferenced residue — sweep it (only the pantheon-opencode subtree;
|
|
1058
|
+
// failures are swallowed and retried by the next init).
|
|
1059
|
+
try {
|
|
1060
|
+
const { sweepStalePantheonNpxCaches } = await import('../scripts/install/npx-cache-sweep.mjs')
|
|
1061
|
+
const sweep = await sweepStalePantheonNpxCaches({ keep: ROOT })
|
|
1062
|
+
if (sweep.removed.length > 0) {
|
|
1063
|
+
console.log('')
|
|
1064
|
+
console.log(` ${S.sweptNpxCaches(sweep.removed.length)}`)
|
|
1065
|
+
}
|
|
1066
|
+
} catch {
|
|
1067
|
+
// Diagnostics-only: a failed sweep never fails the install.
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1080
1070
|
console.log('')
|
|
1081
1071
|
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━')
|
|
1082
1072
|
console.log(` ${S.installedTitle(version)}`)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pantheon-opencode",
|
|
3
|
-
"version": "1.6.2
|
|
4
|
-
"description": "Multi-agent orchestration for OpenCode
|
|
3
|
+
"version": "1.6.2",
|
|
4
|
+
"description": "Multi-agent orchestration for OpenCode \u2014 14 specialized agents, TDD, Themis review gates.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"workspaces": [
|
|
7
7
|
"src/plugins/tui"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"start": "OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true opencode",
|
|
33
33
|
"prepack": "npm run check:decision-router",
|
|
34
34
|
"prepublishOnly": "node scripts/validate-routing.mjs && npm run check:decision-router",
|
|
35
|
-
"postpublish": "node -e \"console.log('
|
|
35
|
+
"postpublish": "node -e \"console.log('\u2705 Published pantheon-opencode v' + require('./package.json').version + ' to npm')\"",
|
|
36
36
|
"version:status": "node scripts/versioning.mjs status",
|
|
37
37
|
"version:apply": "node scripts/versioning.mjs apply",
|
|
38
38
|
"version:check": "node scripts/version-check.mjs",
|
package/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pantheon",
|
|
3
3
|
"publisher": "ils15",
|
|
4
|
-
"version": "1.6.2
|
|
4
|
+
"version": "1.6.2",
|
|
5
5
|
"displayName": "Pantheon",
|
|
6
6
|
"description": "Conductor-Delegate orchestration platform with 14 specialized agents, 20 skills, and OpenCode support.",
|
|
7
7
|
"agents": "./src/agents",
|
package/pyproject.toml
CHANGED
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.backends._legacy:_Backend"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pantheon"
|
|
7
|
-
version = "1.6.2
|
|
7
|
+
version = "1.6.2"
|
|
8
8
|
description = "Multi-agent orchestration framework"
|
|
9
9
|
requires-python = ">=3.11"
|
|
10
10
|
# Python sources under src/mcp/ import fastmcp/pydantic at runtime, but those
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { spawnSync } from 'node:child_process'
|
|
3
2
|
import { existsSync } from 'node:fs'
|
|
4
3
|
import { pathToFileURL } from 'node:url'
|
|
5
4
|
// Prebuilt bundles: Node refuses to strip TypeScript types under node_modules,
|
|
@@ -32,6 +31,8 @@ import {
|
|
|
32
31
|
DECISION_PROVIDER_BUDGET_MAPPING,
|
|
33
32
|
DECISION_ROUTER_MODELS,
|
|
34
33
|
diffDecisionRouterSurfaces,
|
|
34
|
+
inspectTypesafeHostProvider,
|
|
35
|
+
provisionTypesafeHostProvider,
|
|
35
36
|
readUserDecisionRouterConfig,
|
|
36
37
|
resolveUserDecisionRouterConfigPath,
|
|
37
38
|
updateUserDecisionRouterConfig,
|
|
@@ -336,6 +337,23 @@ export async function runDecisionRouterCommand(
|
|
|
336
337
|
noConsent ? 'Egress consent NOT recorded (--no-consent).' : 'Egress consent recorded: yes.',
|
|
337
338
|
)
|
|
338
339
|
|
|
340
|
+
// The TypeSafe route needs a host-side provider entry the decisions API
|
|
341
|
+
// can resolve; the Console routes are host-native and need none. The
|
|
342
|
+
// merge is additive and idempotent; a failure is a printed warning (the
|
|
343
|
+
// decision config stays valid — the call fails at the host until the
|
|
344
|
+
// entry exists).
|
|
345
|
+
if (provider === 'typesafe-jev') {
|
|
346
|
+
const provision = provisionTypesafeHostProvider({ env })
|
|
347
|
+
if (provision.ok) {
|
|
348
|
+
stdout(
|
|
349
|
+
`TypeSafe provider entry merged into ${provision.path} (models.typesafe-ai, type "decision"). ` +
|
|
350
|
+
'Sign in with `opencode auth login` (TypeSafe) or /connect.',
|
|
351
|
+
)
|
|
352
|
+
} else {
|
|
353
|
+
stdout(`⚠ TypeSafe provider entry NOT merged: ${provision.reason}`)
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
339
357
|
const ledger = openLedger(env)
|
|
340
358
|
try {
|
|
341
359
|
ledger.configureUserCaps({
|
|
@@ -373,11 +391,11 @@ export async function runDecisionRouterCommand(
|
|
|
373
391
|
|
|
374
392
|
stdout('')
|
|
375
393
|
stdout('Native route checklist:')
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
)
|
|
379
|
-
stdout('
|
|
380
|
-
stdout('
|
|
394
|
+
// Decision models are not chat models: they never appear in the host
|
|
395
|
+
// model catalog (field evidence 2.2.5: 561 entries, 0 jev, while the
|
|
396
|
+
// decisions API answers the same ref directly). No catalog step here.
|
|
397
|
+
stdout(' 1. Restart OpenCode so the plugin registers pantheon_jev_decide.')
|
|
398
|
+
stdout(' 2. Ask the Zeus agent to call pantheon_jev_decide (mode: "delegation" or "skills").')
|
|
381
399
|
stdout('Read-only verification: decision-router status / doctor / holds.')
|
|
382
400
|
return
|
|
383
401
|
}
|
|
@@ -468,25 +486,27 @@ export async function runDecisionRouterCommand(
|
|
|
468
486
|
? { provider: egress.provider, model: egress.candidate.model }
|
|
469
487
|
: null
|
|
470
488
|
if (target !== null) {
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
const
|
|
476
|
-
if (
|
|
477
|
-
pass(
|
|
489
|
+
// Route-aware checks, not a catalog probe: decision models are not chat
|
|
490
|
+
// models and never appear in `opencode models` (field evidence 2.2.5:
|
|
491
|
+
// 561 entries, 0 jev, while the decisions API answers the same ref).
|
|
492
|
+
if (target.provider === 'typesafe-jev') {
|
|
493
|
+
const hostProvider = inspectTypesafeHostProvider({ env })
|
|
494
|
+
if (hostProvider.present) {
|
|
495
|
+
pass(
|
|
496
|
+
'native-route',
|
|
497
|
+
`typesafe-ai provider entry present (${hostProvider.path}); credential via \`opencode auth login\` (TypeSafe) or /connect`,
|
|
498
|
+
)
|
|
478
499
|
} else {
|
|
479
|
-
|
|
480
|
-
'
|
|
481
|
-
|
|
482
|
-
'
|
|
500
|
+
fail(
|
|
501
|
+
'native-route',
|
|
502
|
+
`opencode.json has no providers.typesafe-ai entry (${hostProvider.path})`,
|
|
503
|
+
'decision-router setup-model typesafe-jev/jev-1.14.0 merges it (type: "decision")',
|
|
483
504
|
)
|
|
484
505
|
}
|
|
485
506
|
} else {
|
|
486
|
-
|
|
487
|
-
'
|
|
488
|
-
|
|
489
|
-
'run `opencode models` manually; slow plugin activation is the usual cause',
|
|
507
|
+
pass(
|
|
508
|
+
'native-route',
|
|
509
|
+
'host-native opencode route; decision models are not listed in the chat catalog by design',
|
|
490
510
|
)
|
|
491
511
|
}
|
|
492
512
|
}
|
|
@@ -503,41 +523,6 @@ export async function runDecisionRouterCommand(
|
|
|
503
523
|
throw new DecisionRouterUsageError(USAGE)
|
|
504
524
|
}
|
|
505
525
|
|
|
506
|
-
/** Spawn-sync timeout floor so a wedged host cannot stall the doctor. */
|
|
507
|
-
const HOST_PROBE_TIMEOUT_MS = 30_000
|
|
508
|
-
|
|
509
|
-
/**
|
|
510
|
-
* Best-effort host catalog probe for the doctor. Returns the set of
|
|
511
|
-
* `provider/model` (and bare model ids, for exact-id matching) the host
|
|
512
|
-
* reports, or the reason the probe failed. Never writes anything.
|
|
513
|
-
*/
|
|
514
|
-
function probeHostCatalog(env) {
|
|
515
|
-
let result
|
|
516
|
-
try {
|
|
517
|
-
result = spawnSync('opencode', ['models'], {
|
|
518
|
-
encoding: 'utf8',
|
|
519
|
-
timeout: HOST_PROBE_TIMEOUT_MS,
|
|
520
|
-
env,
|
|
521
|
-
})
|
|
522
|
-
} catch (error) {
|
|
523
|
-
return { ok: false, reason: String(error?.message ?? error) }
|
|
524
|
-
}
|
|
525
|
-
if (result.error) return { ok: false, reason: String(result.error.message ?? result.error) }
|
|
526
|
-
if (result.status !== 0) {
|
|
527
|
-
const output = `${result.stdout ?? ''}${result.stderr ?? ''}`.trim()
|
|
528
|
-
return { ok: false, reason: output.slice(0, 120) || `exit ${result.status}` }
|
|
529
|
-
}
|
|
530
|
-
const models = new Set()
|
|
531
|
-
for (const line of `${result.stdout ?? ''}`.split(/\r?\n/)) {
|
|
532
|
-
const id = line.trim()
|
|
533
|
-
if (!id) continue
|
|
534
|
-
models.add(id)
|
|
535
|
-
const slash = id.indexOf('/')
|
|
536
|
-
if (slash > 0) models.add(id.slice(slash + 1))
|
|
537
|
-
}
|
|
538
|
-
return { ok: true, models }
|
|
539
|
-
}
|
|
540
|
-
|
|
541
526
|
/** Cap- and period-eligible candidates, read-only, from the separated surfaces. */
|
|
542
527
|
function capEligibleCandidates(config, inspection, wallPeriod) {
|
|
543
528
|
if (inspection.caps === null) return []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { chmodSync, lstatSync, mkdirSync, readFileSync } from 'node:fs'
|
|
1
|
+
import { chmodSync, existsSync, lstatSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'
|
|
2
2
|
import { homedir } from 'node:os'
|
|
3
3
|
import { dirname, isAbsolute, join, parse, resolve, sep } from 'node:path'
|
|
4
4
|
import { assertNoSymlinkAncestors, writeFileAtomically } from './verify.mjs'
|
|
@@ -558,3 +558,69 @@ function assertTrustedDirectoryChain(directory) {
|
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
}
|
|
561
|
+
|
|
562
|
+
/** Host config file the TypeSafe provisioner merges into. */
|
|
563
|
+
function resolveHostOpenCodeConfigPath(env) {
|
|
564
|
+
const xdg = env.XDG_CONFIG_HOME
|
|
565
|
+
const home = env.HOME && isAbsolute(env.HOME) ? env.HOME : homedir()
|
|
566
|
+
const root = xdg && isAbsolute(xdg) ? xdg : join(home, '.config')
|
|
567
|
+
return resolve(root, 'opencode', 'opencode.json')
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* Additively merge the TypeSafe decision provider entry into the user's host
|
|
572
|
+
* `opencode.json` (`providers.typesafe-ai.models["jev-1.14.0"]`, type
|
|
573
|
+
* "decision"). Existing provider entries and an existing model entry are
|
|
574
|
+
* preserved. Read-only on the decision-router config; the merge is the one
|
|
575
|
+
* write.
|
|
576
|
+
* @param {{ env?: Record<string, string | undefined> }} [options]
|
|
577
|
+
* @returns {{ ok: true, path: string } | { ok: false, reason: string }}
|
|
578
|
+
*/
|
|
579
|
+
export function provisionTypesafeHostProvider({ env = process.env } = {}) {
|
|
580
|
+
const configPath = resolveHostOpenCodeConfigPath(env)
|
|
581
|
+
if (!existsSync(configPath)) return { ok: false, reason: 'opencode.json not found' }
|
|
582
|
+
let data
|
|
583
|
+
try {
|
|
584
|
+
const parsed = JSON.parse(readFileSync(configPath, 'utf8'))
|
|
585
|
+
if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
586
|
+
return { ok: false, reason: 'opencode.json is not a JSON object' }
|
|
587
|
+
}
|
|
588
|
+
data = parsed
|
|
589
|
+
} catch {
|
|
590
|
+
return { ok: false, reason: 'opencode.json is not plain JSON (comments?)' }
|
|
591
|
+
}
|
|
592
|
+
data.providers ??= {}
|
|
593
|
+
data.providers['typesafe-ai'] ??= {}
|
|
594
|
+
data.providers['typesafe-ai'].models ??= {}
|
|
595
|
+
if (data.providers['typesafe-ai'].models['jev-1.14.0'] === undefined) {
|
|
596
|
+
data.providers['typesafe-ai'].models['jev-1.14.0'] = {
|
|
597
|
+
name: 'Jev (TypeSafe direct)',
|
|
598
|
+
modelID: 'jev-latest',
|
|
599
|
+
type: 'decision',
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
try {
|
|
603
|
+
writeFileSync(configPath, `${JSON.stringify(data, null, 2)}\n`)
|
|
604
|
+
return { ok: true, path: configPath }
|
|
605
|
+
} catch (error) {
|
|
606
|
+
return { ok: false, reason: String(error instanceof Error ? error.message : error) }
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* Read-only check that the TypeSafe provider entry exists in the host config.
|
|
612
|
+
* Never writes; an unreadable config reports present:false with the path for
|
|
613
|
+
* the doctor's fix hint.
|
|
614
|
+
* @param {{ env?: Record<string, string | undefined> }} [options]
|
|
615
|
+
* @returns {{ present: boolean, path: string }}
|
|
616
|
+
*/
|
|
617
|
+
export function inspectTypesafeHostProvider({ env = process.env } = {}) {
|
|
618
|
+
const configPath = resolveHostOpenCodeConfigPath(env)
|
|
619
|
+
try {
|
|
620
|
+
const parsed = JSON.parse(readFileSync(configPath, 'utf8'))
|
|
621
|
+
const model = parsed?.providers?.['typesafe-ai']?.models?.['jev-1.14.0']
|
|
622
|
+
return { present: model !== undefined && model !== null, path: configPath }
|
|
623
|
+
} catch {
|
|
624
|
+
return { present: false, path: configPath }
|
|
625
|
+
}
|
|
626
|
+
}
|