pantheon-opencode 2.0.0-beta.2 → 2.0.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/CHANGELOG.md +24 -0
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/pyproject.toml +1 -1
- package/scripts/update.mjs +10 -5
- package/src/plugins/tui/dist/tui.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui.js +798 -410
- package/src/plugins/tui/dist/tui.js.map +1 -1
- package/src/plugins/tui/package-lock.json +2 -2
- package/src/plugins/tui/package.json +1 -1
- package/src/plugins/tui/src/decision-router-state.ts +22 -19
- package/src/plugins/tui/src/doctor-state.ts +41 -32
- package/src/plugins/tui/src/index.tsx +21 -3
- package/src/plugins/tui/src/j1-gate-status.ts +29 -27
- package/src/plugins/tui/src/pantheon-settings-state.ts +209 -110
- package/src/plugins/tui/src/pantheon-settings.tsx +605 -271
- package/src/plugins/tui/src/preset-state.ts +21 -22
- package/src/plugins/tui/src/update-status.ts +14 -20
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
writeFileSync,
|
|
25
25
|
} from 'node:fs'
|
|
26
26
|
import { dirname, join } from 'node:path'
|
|
27
|
-
import type { SettingsRow,
|
|
27
|
+
import type { SettingsRow, SettingsTab } from './pantheon-settings-state.ts'
|
|
28
28
|
|
|
29
29
|
/** Mirrors routing.yml `presets:` — drift-pinned against loadPresetDefs(). */
|
|
30
30
|
export const PRESET_NAMES: readonly string[] = Object.freeze([
|
|
@@ -111,33 +111,32 @@ export interface PresetSectionInput {
|
|
|
111
111
|
projectName: string | null
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
114
|
+
/** The staged value 'none' means: delete the global marker (the CLI contract). */
|
|
115
|
+
export const PRESET_NONE = 'none'
|
|
116
|
+
|
|
117
|
+
export const PRESET_CYCLE: readonly string[] = Object.freeze([PRESET_NONE, ...PRESET_NAMES])
|
|
118
|
+
|
|
119
|
+
export function buildPresetTab(input: PresetSectionInput): SettingsTab {
|
|
120
|
+
const rows: SettingsRow[] = [
|
|
121
|
+
{
|
|
122
|
+
id: 'preset',
|
|
123
|
+
name: 'Preset',
|
|
124
|
+
value: input.globalName ?? PRESET_NONE,
|
|
125
|
+
cycle: PRESET_CYCLE,
|
|
126
|
+
note: 'global marker · atomic write, .bak backup · none = opencode defaults',
|
|
127
|
+
},
|
|
128
|
+
]
|
|
128
129
|
if (input.projectName !== null) {
|
|
129
130
|
rows.push({
|
|
130
131
|
id: 'preset.project',
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
selectable: false,
|
|
132
|
+
name: 'Project',
|
|
133
|
+
value: input.projectName,
|
|
134
|
+
note: `${projectActivePresetPath()} wins over the global marker — read-only here`,
|
|
135
135
|
})
|
|
136
136
|
}
|
|
137
137
|
return {
|
|
138
138
|
id: 'preset',
|
|
139
|
-
title: '
|
|
140
|
-
rows,
|
|
141
|
-
hint: 'enter: activate globally · writes <config>/opencode/.pantheon/active-preset.json',
|
|
139
|
+
title: 'Preset',
|
|
140
|
+
groups: [{ title: 'Model preset', rows }],
|
|
142
141
|
}
|
|
143
142
|
}
|
|
@@ -7,12 +7,8 @@
|
|
|
7
7
|
* whole thing is testable without network.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { SettingsRow,
|
|
11
|
-
import {
|
|
12
|
-
comparePantheonVersions,
|
|
13
|
-
UPDATE_CHECK_TTL_MS,
|
|
14
|
-
type UpdateCheckState,
|
|
15
|
-
} from './update-notice.ts'
|
|
10
|
+
import type { SettingsRow, SettingsTab } from './pantheon-settings-state.ts'
|
|
11
|
+
import { comparePantheonVersions, type UpdateCheckState } from './update-notice.ts'
|
|
16
12
|
|
|
17
13
|
export type UpdateChannel = 'stable' | 'beta'
|
|
18
14
|
|
|
@@ -47,7 +43,7 @@ export interface UpdatesSectionInput {
|
|
|
47
43
|
nowMs?: number
|
|
48
44
|
}
|
|
49
45
|
|
|
50
|
-
export function
|
|
46
|
+
export function buildUpdatesTab(input: UpdatesSectionInput): SettingsTab {
|
|
51
47
|
const nowMs = input.nowMs ?? Date.now()
|
|
52
48
|
const channel = updateChannelFor(input.currentVersion)
|
|
53
49
|
const lastCheckMs = input.state.lastCheckMs
|
|
@@ -56,20 +52,20 @@ export function buildUpdatesSection(input: UpdatesSectionInput): SettingsSection
|
|
|
56
52
|
const rows: SettingsRow[] = [
|
|
57
53
|
{
|
|
58
54
|
id: 'update.channel',
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
name: 'Channel',
|
|
56
|
+
value: channel,
|
|
57
|
+
note: 'stable tracks npm `latest`; beta tracks npm `beta`',
|
|
62
58
|
},
|
|
63
59
|
{
|
|
64
60
|
id: 'update.check',
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
name: 'Check now',
|
|
62
|
+
value: input.checking
|
|
67
63
|
? 'checking…'
|
|
68
64
|
: lastCheckMs
|
|
69
65
|
? `last check ${formatAgo(nowMs - lastCheckMs)}`
|
|
70
66
|
: 'never checked',
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
action: 'update-check',
|
|
68
|
+
note: 'enter probes the registry for the running channel',
|
|
73
69
|
},
|
|
74
70
|
]
|
|
75
71
|
|
|
@@ -82,17 +78,15 @@ export function buildUpdatesSection(input: UpdatesSectionInput): SettingsSection
|
|
|
82
78
|
!(stable(input.currentVersion) && !stable(latest))
|
|
83
79
|
rows.push({
|
|
84
80
|
id: 'update.latest',
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
selectable: false,
|
|
81
|
+
name: 'Registry',
|
|
82
|
+
value: newer ? `v${latest} available` : 'up to date',
|
|
83
|
+
note: newer ? 'adopt with `pantheon-opencode update`' : 'no newer compatible version',
|
|
89
84
|
})
|
|
90
85
|
}
|
|
91
86
|
|
|
92
87
|
return {
|
|
93
88
|
id: 'updates',
|
|
94
89
|
title: 'Updates',
|
|
95
|
-
|
|
96
|
-
rows,
|
|
90
|
+
groups: [{ title: 'Updates', rows }],
|
|
97
91
|
}
|
|
98
92
|
}
|