pantheon-opencode 1.6.2-beta.13 → 1.6.2-beta.15
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 +16 -0
- package/bin/pantheon-init.mjs +6 -32
- package/package.json +1 -1
- 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/src/pantheon/jev-decision-tool.ts +7 -51
- package/src/pantheon/jev-decisions.ts +12 -28
- package/src/pantheon/v2-native-decisions.ts +1 -1
- package/src/plugins/tui/dist/tui-v2.js +2 -2
- 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/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,22 @@ 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-beta.15] - 2026-11-03
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **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.
|
|
18
|
+
- **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.
|
|
19
|
+
|
|
20
|
+
## [v1.6.2-beta.14] - 2026-11-03
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- **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.
|
|
25
|
+
- **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).
|
|
26
|
+
|
|
27
|
+
<!-- Add new changes here. Running `node scripts/versioning.mjs apply` will
|
|
28
|
+
move this section to a versioned entry and reset the template below. -->
|
|
13
29
|
## [v1.6.2-beta.13] - 2026-11-03
|
|
14
30
|
|
|
15
31
|
### Added
|
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. */
|
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pantheon",
|
|
3
3
|
"publisher": "ils15",
|
|
4
|
-
"version": "1.6.2-beta.
|
|
4
|
+
"version": "1.6.2-beta.15",
|
|
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-beta.
|
|
7
|
+
version = "1.6.2-beta.15"
|
|
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
|
+
}
|
|
@@ -21,7 +21,6 @@ import { readUserDecisionRouterConfig } from '../../scripts/install/decision-rou
|
|
|
21
21
|
import {
|
|
22
22
|
consumeJevDecisionResult,
|
|
23
23
|
isJevDecisionPreset,
|
|
24
|
-
type JevDecisionCatalogEntry,
|
|
25
24
|
type JevHostSkill,
|
|
26
25
|
type NativeJevRouteFailure,
|
|
27
26
|
prepareJevDecisionRequest,
|
|
@@ -41,7 +40,12 @@ import type { NativeDecisionRequest } from './v2-native-decisions.ts'
|
|
|
41
40
|
import type { V2ToolDef } from './v2-tools.ts'
|
|
42
41
|
|
|
43
42
|
export interface V2JevDecisionRuntime {
|
|
44
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* Raw host model catalog (`ctx.model.list`); still wired, but the route no
|
|
45
|
+
* longer consults it — field evidence (2.2.5): decision models are not chat
|
|
46
|
+
* models and never appear in the catalog. Removed with the 2.0 runtime
|
|
47
|
+
* reshaping.
|
|
48
|
+
*/
|
|
45
49
|
readonly listModels: () => Promise<unknown>
|
|
46
50
|
/** The host's native Decisions API (`ctx.experimental.generate.decisions`). */
|
|
47
51
|
readonly decide: (request: NativeDecisionRequest) => Promise<unknown>
|
|
@@ -65,7 +69,6 @@ export type JevDecisionRunFailure =
|
|
|
65
69
|
| 'CONFIG_UNAVAILABLE'
|
|
66
70
|
| 'DISABLED'
|
|
67
71
|
| 'CONSENT_MISSING'
|
|
68
|
-
| 'CATALOG_UNAVAILABLE'
|
|
69
72
|
| 'CAP_OR_PERIOD_DENIED'
|
|
70
73
|
| NativeJevRouteFailure
|
|
71
74
|
| 'PERMISSION_UNAVAILABLE'
|
|
@@ -98,11 +101,6 @@ function refusalDetail(reasonCode: JevDecisionRunFailure, err: unknown): string
|
|
|
98
101
|
return JSON.stringify({ advisory: false, effect: 'none', reasonCode, detail })
|
|
99
102
|
}
|
|
100
103
|
|
|
101
|
-
/** Refusal carrying an already-sanitized enum detail (never free-form text). */
|
|
102
|
-
function refusalNamed(reasonCode: JevDecisionRunFailure, detail: string): string {
|
|
103
|
-
return JSON.stringify({ advisory: false, effect: 'none', reasonCode, detail })
|
|
104
|
-
}
|
|
105
|
-
|
|
106
104
|
function isNonBlankString(value: unknown): value is string {
|
|
107
105
|
return typeof value === 'string' && value.trim().length > 0
|
|
108
106
|
}
|
|
@@ -137,36 +135,6 @@ async function readHostSkills(runtime: V2JevDecisionRuntime): Promise<JevHostSki
|
|
|
137
135
|
return skills
|
|
138
136
|
}
|
|
139
137
|
|
|
140
|
-
function asRecord(value: unknown): Record<string, unknown> | undefined {
|
|
141
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value)
|
|
142
|
-
? (value as Record<string, unknown>)
|
|
143
|
-
: undefined
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
async function readCatalog(runtime: V2JevDecisionRuntime): Promise<JevDecisionCatalogEntry[]> {
|
|
147
|
-
// The 2.2.5 host wraps the catalog in a page object ({ data: [...] }); the
|
|
148
|
-
// vision surface already tolerates both shapes (modelList in v2-vision.ts).
|
|
149
|
-
// Requiring a bare array here turned every real session into
|
|
150
|
-
// CATALOG_UNAVAILABLE (field evidence: detail TypeError under beta.10 with
|
|
151
|
-
// the receiver binding already in place).
|
|
152
|
-
const raw = await runtime.listModels()
|
|
153
|
-
const candidates = Array.isArray(raw) ? raw : (asRecord(raw)?.data ?? asRecord(raw)?.models)
|
|
154
|
-
if (!Array.isArray(candidates)) throw new TypeError('Model catalog is not a list')
|
|
155
|
-
const entries: JevDecisionCatalogEntry[] = []
|
|
156
|
-
for (const model of candidates) {
|
|
157
|
-
if (model === null || typeof model !== 'object' || Array.isArray(model)) continue
|
|
158
|
-
const record = model as Record<string, unknown>
|
|
159
|
-
if (!isNonBlankString(record.providerID) || !isNonBlankString(record.id)) continue
|
|
160
|
-
if (typeof record.type !== 'string') continue
|
|
161
|
-
entries.push({
|
|
162
|
-
providerID: record.providerID,
|
|
163
|
-
id: record.id,
|
|
164
|
-
type: record.type,
|
|
165
|
-
} as JevDecisionCatalogEntry)
|
|
166
|
-
}
|
|
167
|
-
return entries
|
|
168
|
-
}
|
|
169
|
-
|
|
170
138
|
/**
|
|
171
139
|
* Run one explicit, gate-checked native Jev decision. Every failure path
|
|
172
140
|
* returns a bounded refusal JSON; the only caller-visible success output is
|
|
@@ -197,25 +165,13 @@ export async function runJevDecision(
|
|
|
197
165
|
if (!config.enabled) return refusal('DISABLED')
|
|
198
166
|
if (!config.egress_consent) return refusal('CONSENT_MISSING')
|
|
199
167
|
|
|
200
|
-
let catalog: JevDecisionCatalogEntry[]
|
|
201
|
-
try {
|
|
202
|
-
catalog = await readCatalog(runtime)
|
|
203
|
-
} catch (err) {
|
|
204
|
-
return refusalDetail('CATALOG_UNAVAILABLE', err)
|
|
205
|
-
}
|
|
206
|
-
|
|
207
168
|
const ledger = openLocalDecisionBudgetLedger({ dbPath: resolveLocalDecisionBudgetDbPath() })
|
|
208
169
|
try {
|
|
209
170
|
const selection = resolveNativeJevRoute(
|
|
210
171
|
config,
|
|
211
|
-
catalog,
|
|
212
172
|
(provider, model) => ledger.canReserve(provider, model).status === 'eligible',
|
|
213
173
|
)
|
|
214
|
-
if (!selection.ok)
|
|
215
|
-
return selection.detail === undefined
|
|
216
|
-
? refusal(selection.reasonCode)
|
|
217
|
-
: refusalNamed(selection.reasonCode, selection.detail)
|
|
218
|
-
}
|
|
174
|
+
if (!selection.ok) return refusal(selection.reasonCode)
|
|
219
175
|
|
|
220
176
|
if (typeof runtime.permissionAssert !== 'function') return refusal('PERMISSION_UNAVAILABLE')
|
|
221
177
|
const assertion = await assertDecisionEgressPermission(
|
|
@@ -25,16 +25,12 @@ import {
|
|
|
25
25
|
import { selectPantheonSkills } from './local-decision-skills.ts'
|
|
26
26
|
import { PANTHEON_AGENT_CATALOG, PANTHEON_SKILL_CATALOG } from './pantheon-decision-catalog.ts'
|
|
27
27
|
import {
|
|
28
|
+
findRouteKind,
|
|
28
29
|
NATIVE_DECISION_MAX_PROMPT_LENGTH,
|
|
29
30
|
type NativeDecisionRequest,
|
|
30
|
-
type NativeDecisionRouteFailure,
|
|
31
31
|
type ResolvedNativeDecisionRoute,
|
|
32
|
-
resolveNativeDecisionRoute,
|
|
33
32
|
} from './v2-native-decisions.ts'
|
|
34
33
|
|
|
35
|
-
/** Catalog entry shape the route resolver needs from the host model list. */
|
|
36
|
-
export type JevDecisionCatalogEntry = Parameters<typeof resolveNativeDecisionRoute>[2][number]
|
|
37
|
-
|
|
38
34
|
/** Config-level providers that have a native host Decisions route. */
|
|
39
35
|
export type NativeJevProviderId = Extract<
|
|
40
36
|
DecisionProviderId,
|
|
@@ -57,7 +53,7 @@ export function isNativeJevProvider(provider: unknown): provider is NativeJevPro
|
|
|
57
53
|
return typeof provider === 'string' && Object.hasOwn(NATIVE_JEV_HOST_PROVIDERS, provider)
|
|
58
54
|
}
|
|
59
55
|
|
|
60
|
-
export type NativeJevRouteFailure = 'NO_ELIGIBLE_CANDIDATE'
|
|
56
|
+
export type NativeJevRouteFailure = 'NO_ELIGIBLE_CANDIDATE'
|
|
61
57
|
|
|
62
58
|
export interface NativeJevRouteSelection {
|
|
63
59
|
readonly route: ResolvedNativeDecisionRoute
|
|
@@ -68,18 +64,7 @@ export interface NativeJevRouteSelection {
|
|
|
68
64
|
|
|
69
65
|
export type NativeJevRouteResolution =
|
|
70
66
|
| { readonly ok: true; readonly selection: NativeJevRouteSelection }
|
|
71
|
-
| {
|
|
72
|
-
readonly ok: false
|
|
73
|
-
readonly reasonCode: NativeJevRouteFailure
|
|
74
|
-
/**
|
|
75
|
-
* The inner route-resolution verdict when `reasonCode` is
|
|
76
|
-
* ROUTE_UNRESOLVED (`MODEL_NOT_IN_CATALOG`, `AMBIGUOUS_MODEL`,
|
|
77
|
-
* `MODEL_NOT_DECISION`): the class alone does not tell the user whether
|
|
78
|
-
* the configured decision model is absent from the host catalog or
|
|
79
|
-
* present but not decision-typed, and those have different fixes.
|
|
80
|
-
*/
|
|
81
|
-
readonly detail?: NativeDecisionRouteFailure
|
|
82
|
-
}
|
|
67
|
+
| { readonly ok: false; readonly reasonCode: NativeJevRouteFailure }
|
|
83
68
|
|
|
84
69
|
/**
|
|
85
70
|
* Keep only candidates that both map to a native route and pass the caller's
|
|
@@ -126,7 +111,6 @@ function readEnabledCandidates(config: unknown): UserDecisionRouterCandidate[] {
|
|
|
126
111
|
*/
|
|
127
112
|
export function resolveNativeJevRoute(
|
|
128
113
|
config: unknown,
|
|
129
|
-
catalog: readonly JevDecisionCatalogEntry[],
|
|
130
114
|
checkAdmission: (provider: BudgetProvider, model: string) => boolean,
|
|
131
115
|
): NativeJevRouteResolution {
|
|
132
116
|
const record =
|
|
@@ -165,18 +149,18 @@ export function resolveNativeJevRoute(
|
|
|
165
149
|
}
|
|
166
150
|
|
|
167
151
|
const hostProvider = NATIVE_JEV_HOST_PROVIDERS[selected.provider]
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}
|
|
152
|
+
// NO catalog-presence gate. Field evidence (2.2.5, 2026-11-03): decision
|
|
153
|
+
// models are not chat models — `model.list()` never exposes them (561
|
|
154
|
+
// entries, 0 jev) while the decisions API answers the exact same ref
|
|
155
|
+
// directly (jev-1.13-free → 200; jev-1.13 → 404 from the host itself).
|
|
156
|
+
// The host is the authority on model existence: an unknown model surfaces
|
|
157
|
+
// later as DECISION_CALL_FAILED. Consent, budget caps and the host
|
|
158
|
+
// permission assertion remain the actual safety gates.
|
|
159
|
+
const routeModel = { providerID: hostProvider, id: selected.model }
|
|
176
160
|
return {
|
|
177
161
|
ok: true,
|
|
178
162
|
selection: {
|
|
179
|
-
route:
|
|
163
|
+
route: Object.freeze({ model: routeModel, ...findRouteKind(routeModel) }),
|
|
180
164
|
provider: selected.provider,
|
|
181
165
|
accountingProvider: DECISION_PROVIDER_ADAPTERS[selected.provider].accountingProvider,
|
|
182
166
|
model: selected.model,
|
|
@@ -81,7 +81,7 @@ function readModelRef(value: unknown): NativeDecisionModelRef | null {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
function findRouteKind(
|
|
84
|
+
export function findRouteKind(
|
|
85
85
|
model: NativeDecisionModelRef,
|
|
86
86
|
): Pick<ResolvedNativeDecisionRoute, 'kind' | 'billing'> {
|
|
87
87
|
const stock = NATIVE_STOCK_DECISION_ROUTES.find(
|
|
@@ -3197,7 +3197,7 @@ function Sidebar(props) {
|
|
|
3197
3197
|
setProp(_el$12, "width", "100%");
|
|
3198
3198
|
setProp(_el$12, "padding", 1);
|
|
3199
3199
|
setProp(_el$13, "attributes", 1);
|
|
3200
|
-
insert(_el$13, `Pantheon v1.6.2-beta.
|
|
3200
|
+
insert(_el$13, `Pantheon v1.6.2-beta.15`);
|
|
3201
3201
|
insert(_el$14, () => presetHeaderLine(model.preset().name ?? "", model.provider()));
|
|
3202
3202
|
insert(_el$12, createComponent(Show, {
|
|
3203
3203
|
get when() {
|
|
@@ -3918,7 +3918,7 @@ function HomeStatus(props) {
|
|
|
3918
3918
|
const muted = () => props.context.theme?.text?.muted ?? props.context.theme?.text?.base;
|
|
3919
3919
|
return (() => {
|
|
3920
3920
|
var _el$72 = createElement("text");
|
|
3921
|
-
insert(_el$72, () => `Pantheon v1.6.2-beta.
|
|
3921
|
+
insert(_el$72, () => `Pantheon v1.6.2-beta.15${preset().name ? ` ▸ ${preset().name}` : ""}`);
|
|
3922
3922
|
effect((_$p) => setProp(_el$72, "fg", muted(), _$p));
|
|
3923
3923
|
return _el$72;
|
|
3924
3924
|
})();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pantheon-tui",
|
|
3
|
-
"version": "1.6.2-beta.
|
|
3
|
+
"version": "1.6.2-beta.15",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pantheon-tui",
|
|
9
|
-
"version": "1.6.2-beta.
|
|
9
|
+
"version": "1.6.2-beta.15",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@opencode-ai/plugin": "1.18.33",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pantheon-tui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.6.2-beta.
|
|
4
|
+
"version": "1.6.2-beta.15",
|
|
5
5
|
"description": "Pantheon TUI plugin — V1 rich sidebar and usage gauges; native V2 status, session and delegation sidebar",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"engines": {
|