pantheon-opencode 1.1.1-beta.6 → 1.1.1-beta.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pantheon-opencode",
3
- "version": "1.1.1-beta.6",
3
+ "version": "1.1.1-beta.8",
4
4
  "description": "Multi-agent orchestration for OpenCode — 14 specialized agents, TDD, Themis review gates.",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -0,0 +1,8 @@
1
+ import { TuiPluginModule } from "@opencode-ai/plugin/tui";
2
+ //#region src/index.d.ts
3
+ declare const plugin: TuiPluginModule & {
4
+ id: string;
5
+ };
6
+ //#endregion
7
+ export { plugin as default };
8
+ //# sourceMappingURL=tui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tui.d.ts","names":[],"sources":["../src/index.tsx"],"mappings":";;cAmTM,QAAQ;EAAoB"}
@@ -1,143 +1,495 @@
1
- // src/index.tsx
2
- import { createMemo, createSignal, Show, For } from "solid-js";
3
- import { jsx, jsxs } from "@opentui/solid/jsx-runtime";
4
- async function readVersion(api) {
5
- try {
6
- const wt = api.state.path?.worktree ?? "";
7
- const fp = wt ? `${wt}/package.json` : "package.json";
8
- const r = await api.client.file.read({ query: { path: fp } });
9
- const m = String(r?.content ?? "").match(/"version":\s*"([^"]+)"/);
10
- if (m?.[1]) return m[1];
11
- } catch {
12
- }
13
- return "5.0.0";
14
- }
15
- var AGENTS = [
16
- "zeus",
17
- "athena",
18
- "apollo",
19
- "hermes",
20
- "aphrodite",
21
- "demeter",
22
- "themis",
23
- "prometheus",
24
- "hephaestus",
25
- "nyx",
26
- "gaia",
27
- "iris",
28
- "mnemosyne",
29
- "talos"
1
+ import { createComponent, createElement, createTextNode, effect, insert, insertNode, setProp } from "@opentui/solid";
2
+ import { For, Show, createMemo, createSignal } from "solid-js";
3
+ //#region src/index.tsx
4
+ /** @jsxImportSource @opentui/solid */
5
+ const BAR_WIDTH = 20;
6
+ const COMMANDS = [
7
+ {
8
+ name: "/pantheon",
9
+ desc: "Council synthesis"
10
+ },
11
+ {
12
+ name: "/pantheon-status",
13
+ desc: "System status"
14
+ },
15
+ {
16
+ name: "/pantheon-audit",
17
+ desc: "Full audit"
18
+ },
19
+ {
20
+ name: "/pantheon-bg",
21
+ desc: "List background tasks"
22
+ },
23
+ {
24
+ name: "/pantheon-cancel",
25
+ desc: "Cancel task"
26
+ },
27
+ {
28
+ name: "/pantheon-deepwork",
29
+ desc: "Deep work mode"
30
+ },
31
+ {
32
+ name: "/pantheon-focus",
33
+ desc: "Focus on scope"
34
+ },
35
+ {
36
+ name: "/pantheon-remember",
37
+ desc: "Memory store/recall"
38
+ },
39
+ {
40
+ name: "/pantheon-search",
41
+ desc: "Memory search"
42
+ },
43
+ {
44
+ name: "/pantheon-consolidate",
45
+ desc: "Merge memories"
46
+ },
47
+ {
48
+ name: "/pantheon-forget",
49
+ desc: "Compress memories"
50
+ }
30
51
  ];
31
- var CMDS = [
32
- "/pantheon",
33
- "/pantheon-status",
34
- "/pantheon-audit",
35
- "/pantheon-bg",
36
- "/pantheon-deepwork",
37
- "/pantheon-focus",
38
- "/pantheon-remember",
39
- "/pantheon-search",
40
- "/pantheon-forget"
52
+ const AGENTS = [
53
+ {
54
+ name: "zeus",
55
+ tier: "default",
56
+ role: "Orchestrator"
57
+ },
58
+ {
59
+ name: "athena",
60
+ tier: "premium",
61
+ role: "Strategic planner"
62
+ },
63
+ {
64
+ name: "apollo",
65
+ tier: "fast",
66
+ role: "Codebase discovery"
67
+ },
68
+ {
69
+ name: "hermes",
70
+ tier: "default",
71
+ role: "Backend"
72
+ },
73
+ {
74
+ name: "aphrodite",
75
+ tier: "default",
76
+ role: "Frontend"
77
+ },
78
+ {
79
+ name: "demeter",
80
+ tier: "default",
81
+ role: "Database"
82
+ },
83
+ {
84
+ name: "themis",
85
+ tier: "premium",
86
+ role: "Quality & security"
87
+ },
88
+ {
89
+ name: "prometheus",
90
+ tier: "default",
91
+ role: "Infrastructure"
92
+ },
93
+ {
94
+ name: "hephaestus",
95
+ tier: "default",
96
+ role: "AI pipelines"
97
+ },
98
+ {
99
+ name: "nyx",
100
+ tier: "fast",
101
+ role: "Observability"
102
+ },
103
+ {
104
+ name: "gaia",
105
+ tier: "fast",
106
+ role: "Remote sensing"
107
+ },
108
+ {
109
+ name: "iris",
110
+ tier: "fast",
111
+ role: "GitHub operations"
112
+ },
113
+ {
114
+ name: "mnemosyne",
115
+ tier: "fast",
116
+ role: "Memory bank"
117
+ },
118
+ {
119
+ name: "talos",
120
+ tier: "fast",
121
+ role: "Hotfixes"
122
+ }
41
123
  ];
42
- function PantheonPanel(props) {
43
- const [showSub, setShowSub] = createSignal(false);
44
- const [showCmd, setShowCmd] = createSignal(false);
45
- const [showAg, setShowAg] = createSignal(false);
46
- const [showCfg, setShowCfg] = createSignal(false);
47
- const [showMem, setShowMem] = createSignal(false);
48
- const branch = createMemo(() => {
49
- const b = props.api.state.vcs?.branch;
50
- return b ? `\u2387 ${b}` : null;
51
- });
52
- return /* @__PURE__ */ jsxs("box", { flexDirection: "column", width: "100%", children: [
53
- /* @__PURE__ */ jsxs("text", { fg: props.api.theme.current.accent, attributes: { bold: true }, children: [
54
- "Pantheon v",
55
- props.version
56
- ] }),
57
- /* @__PURE__ */ jsx(Show, { when: branch(), children: (b) => /* @__PURE__ */ jsx("box", { marginTop: 1, children: /* @__PURE__ */ jsx("text", { fg: props.api.theme.current.textMuted, children: b() }) }) }),
58
- /* @__PURE__ */ jsxs("box", { marginTop: 0, onMouseDown: () => setShowSub((x) => !x), children: [
59
- /* @__PURE__ */ jsxs("text", { fg: props.api.theme.current.text, attributes: { bold: true }, children: [
60
- showSub() ? "\u25BC " : "\u25B6 ",
61
- "Subagents"
62
- ] }),
63
- /* @__PURE__ */ jsxs("text", { fg: props.api.theme.current.textMuted, children: [
64
- " (",
65
- props.api.state.session.count(),
66
- ")"
67
- ] })
68
- ] }),
69
- /* @__PURE__ */ jsx(Show, { when: showSub(), children: /* @__PURE__ */ jsx("box", { marginLeft: 1, children: /* @__PURE__ */ jsxs("text", { fg: props.api.theme.current.textMuted, children: [
70
- "sessions: ",
71
- props.api.state.session.count()
72
- ] }) }) }),
73
- /* @__PURE__ */ jsxs("box", { marginTop: 0, onMouseDown: () => setShowCmd((x) => !x), children: [
74
- /* @__PURE__ */ jsxs("text", { fg: props.api.theme.current.text, attributes: { bold: true }, children: [
75
- showCmd() ? "\u25BC " : "\u25B6 ",
76
- "Commands"
77
- ] }),
78
- /* @__PURE__ */ jsxs("text", { fg: props.api.theme.current.textMuted, children: [
79
- " (",
80
- CMDS.length,
81
- ")"
82
- ] })
83
- ] }),
84
- /* @__PURE__ */ jsx(Show, { when: showCmd(), children: /* @__PURE__ */ jsx("box", { marginLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx(For, { each: CMDS, children: (cmd) => /* @__PURE__ */ jsxs("text", { fg: props.api.theme.current.textMuted, children: [
85
- "\xB7",
86
- " ",
87
- cmd
88
- ] }) }) }) }),
89
- /* @__PURE__ */ jsxs("box", { marginTop: 0, onMouseDown: () => setShowAg((x) => !x), children: [
90
- /* @__PURE__ */ jsxs("text", { fg: props.api.theme.current.text, attributes: { bold: true }, children: [
91
- showAg() ? "\u25BC " : "\u25B6 ",
92
- "Agents"
93
- ] }),
94
- /* @__PURE__ */ jsxs("text", { fg: props.api.theme.current.textMuted, children: [
95
- " (",
96
- AGENTS.length,
97
- ")"
98
- ] })
99
- ] }),
100
- /* @__PURE__ */ jsx(Show, { when: showAg(), children: /* @__PURE__ */ jsx("box", { marginLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx(For, { each: AGENTS, children: (a) => /* @__PURE__ */ jsxs("text", { fg: props.api.theme.current.textMuted, children: [
101
- "\xB7",
102
- " ",
103
- a
104
- ] }) }) }) }),
105
- /* @__PURE__ */ jsx("box", { marginTop: 0, onMouseDown: () => setShowCfg((x) => !x), children: /* @__PURE__ */ jsxs("text", { fg: props.api.theme.current.text, attributes: { bold: true }, children: [
106
- showCfg() ? "\u25BC " : "\u25B6 ",
107
- "Config"
108
- ] }) }),
109
- /* @__PURE__ */ jsx(Show, { when: showCfg(), children: /* @__PURE__ */ jsxs("box", { marginLeft: 1, flexDirection: "column", children: [
110
- /* @__PURE__ */ jsxs("text", { fg: props.api.theme.current.textMuted, children: [
111
- "MCPs: ",
112
- props.api.state.config?.mcp ? Object.keys(props.api.state.config.mcp).length : 0
113
- ] }),
114
- /* @__PURE__ */ jsxs("text", { fg: props.api.theme.current.textMuted, children: [
115
- "Compaction: ",
116
- props.api.state.config?.compaction?.auto ? "ON" : "OFF"
117
- ] })
118
- ] }) }),
119
- /* @__PURE__ */ jsx("box", { marginTop: 0, onMouseDown: () => setShowMem((x) => !x), children: /* @__PURE__ */ jsxs("text", { fg: props.api.theme.current.text, attributes: { bold: true }, children: [
120
- showMem() ? "\u25BC " : "\u25B6 ",
121
- "Memory"
122
- ] }) }),
123
- /* @__PURE__ */ jsx(Show, { when: showMem(), children: /* @__PURE__ */ jsx("box", { marginLeft: 1, children: /* @__PURE__ */ jsx("text", { fg: props.api.theme.current.textMuted, children: props.api.state.memory?.entries > 0 ? `Entries: ${props.api.state.memory.entries}` : "(no data)" }) }) })
124
- ] });
124
+ function safeNum(v) {
125
+ return typeof v === "number" && Number.isFinite(v) ? v : 0;
126
+ }
127
+ function fmtInt(n) {
128
+ return Intl.NumberFormat("en-US").format(Math.max(0, Math.round(n)));
129
+ }
130
+ function fmtCost(v) {
131
+ if (v <= 0) return "";
132
+ if (v < .01) return "<$0.01";
133
+ return `$${v.toFixed(2)}`;
134
+ }
135
+ function msgTokens(msg) {
136
+ const t = msg?.tokens ?? msg?.info?.tokens ?? {};
137
+ return safeNum(t.input) + safeNum(t.output) + safeNum(t.reasoning) + safeNum(t?.cache?.read) + safeNum(t?.cache?.write);
138
+ }
139
+ function msgCost(src) {
140
+ for (const c of [
141
+ src?.cost,
142
+ src?.info?.cost,
143
+ src?.usage?.cost
144
+ ]) if (typeof c === "number" && c > 0) return c;
145
+ return 0;
146
+ }
147
+ function buildBar(pct) {
148
+ const filled = Math.max(0, Math.min(BAR_WIDTH, Math.round(Math.max(0, Math.min(100, pct)) / 100 * BAR_WIDTH)));
149
+ return "█".repeat(filled) + "░".repeat(BAR_WIDTH - filled);
150
+ }
151
+ function ContextBar(props) {
152
+ const messages = createMemo(() => {
153
+ try {
154
+ return props.api.state.session.messages(props.sessionID) ?? [];
155
+ } catch {
156
+ return [];
157
+ }
158
+ });
159
+ const usage = createMemo(() => {
160
+ const lastAssistant = [...messages()].reverse().find((m) => {
161
+ return (m?.role ?? m?.info?.role) === "assistant" && safeNum(m?.tokens?.output) > 0;
162
+ });
163
+ if (!lastAssistant) return null;
164
+ const tokens = msgTokens(lastAssistant);
165
+ const pid = lastAssistant?.providerID ?? lastAssistant?.info?.providerID;
166
+ const mid = lastAssistant?.modelID ?? lastAssistant?.info?.modelID;
167
+ const ctxLimit = safeNum((pid ? (props.api.state.provider ?? []).find((p) => p.id === pid) : null)?.models?.[mid ?? ""]?.limit?.context);
168
+ return {
169
+ tokens,
170
+ limit: ctxLimit > 0 ? ctxLimit : 128e3,
171
+ percent: ctxLimit > 0 ? Math.round(tokens / ctxLimit * 100) : 0
172
+ };
173
+ });
174
+ const totalCost = createMemo(() => {
175
+ const state = props.api.state.session?.get?.(props.sessionID);
176
+ const fromState = msgCost(state);
177
+ if (fromState > 0) return fromState;
178
+ return messages().reduce((sum, m) => sum + msgCost(m), 0);
179
+ });
180
+ const theme = () => props.api.theme.current;
181
+ return createComponent(Show, {
182
+ get when() {
183
+ return usage();
184
+ },
185
+ children: (u) => {
186
+ const pct = u().percent;
187
+ const c = theme();
188
+ const barColor = pct >= 90 ? c.error : pct >= 70 ? c.warning : c.accent;
189
+ const costStr = fmtCost(totalCost());
190
+ return (() => {
191
+ var _el$ = createElement("box"), _el$2 = createElement("box"), _el$3 = createElement("text"), _el$5 = createElement("text"), _el$6 = createElement("text"), _el$7 = createElement("text");
192
+ insertNode(_el$, _el$2);
193
+ insertNode(_el$, _el$7);
194
+ setProp(_el$, "flexDirection", "column");
195
+ insertNode(_el$2, _el$3);
196
+ insertNode(_el$2, _el$5);
197
+ insertNode(_el$2, _el$6);
198
+ setProp(_el$2, "flexDirection", "row");
199
+ setProp(_el$2, "gap", 1);
200
+ insertNode(_el$3, createTextNode(`Context`));
201
+ setProp(_el$3, "attributes", { bold: true });
202
+ setProp(_el$5, "fg", barColor);
203
+ insert(_el$5, () => buildBar(pct));
204
+ setProp(_el$6, "fg", barColor);
205
+ insert(_el$6, `${pct}%`);
206
+ insert(_el$7, () => `${fmtInt(u().tokens)} / ${fmtInt(u().limit)} tok${costStr ? ` ${costStr}` : ""}`);
207
+ effect((_p$) => {
208
+ var _v$ = c.text, _v$2 = c.textMuted;
209
+ _v$ !== _p$.e && (_p$.e = setProp(_el$3, "fg", _v$, _p$.e));
210
+ _v$2 !== _p$.t && (_p$.t = setProp(_el$7, "fg", _v$2, _p$.t));
211
+ return _p$;
212
+ }, {
213
+ e: void 0,
214
+ t: void 0
215
+ });
216
+ return _el$;
217
+ })();
218
+ }
219
+ });
125
220
  }
126
- function createSlot(api) {
127
- const version = createMemo(() => readVersion(api));
128
- return {
129
- order: 900,
130
- slots: {
131
- sidebar_content(_ctx, input) {
132
- return /* @__PURE__ */ jsx(PantheonPanel, { api, version: version() });
133
- }
134
- }
135
- };
221
+ function View(props) {
222
+ const [showCommands, setShowCommands] = createSignal(false);
223
+ const [showAgents, setShowAgents] = createSignal(false);
224
+ const [showConfig, setShowConfig] = createSignal(false);
225
+ const [showSubagents, setShowSubagents] = createSignal(false);
226
+ const theme = () => props.api.theme.current;
227
+ const branch = createMemo(() => props.api.state.vcs?.branch ? `\u2387 ${props.api.state.vcs.branch}` : null);
228
+ const sessionCount = createMemo(() => {
229
+ try {
230
+ return props.api.state.session.count();
231
+ } catch {
232
+ return 0;
233
+ }
234
+ });
235
+ const memoryCount = createMemo(() => {
236
+ const mem = props.api.state.memory;
237
+ return safeNum(mem?.entries) || safeNum(mem?.count);
238
+ });
239
+ const configSummary = createMemo(() => {
240
+ const cfg = props.api.state.config;
241
+ if (!cfg) return null;
242
+ return {
243
+ mcpCount: cfg.mcp ? Object.keys(cfg.mcp).length : 0,
244
+ pluginCount: Array.isArray(cfg.plugin) ? cfg.plugin.length : 0,
245
+ autoCompaction: cfg.compaction?.auto === true
246
+ };
247
+ });
248
+ const HR = () => (() => {
249
+ var _el$8 = createElement("text");
250
+ insertNode(_el$8, createTextNode(`────────────────────────────`));
251
+ effect((_$p) => setProp(_el$8, "fg", theme().textMuted, _$p));
252
+ return _el$8;
253
+ })();
254
+ return (() => {
255
+ var _el$0 = createElement("box"), _el$1 = createElement("text"), _el$10 = createElement("box"), _el$11 = createElement("text"), _el$12 = createElement("text"), _el$15 = createElement("box"), _el$16 = createElement("text"), _el$17 = createElement("text"), _el$19 = createElement("box"), _el$20 = createElement("text"), _el$21 = createElement("text"), _el$23 = createElement("box"), _el$24 = createElement("text"), _el$25 = createElement("box"), _el$26 = createElement("text");
256
+ insertNode(_el$0, _el$1);
257
+ insertNode(_el$0, _el$10);
258
+ insertNode(_el$0, _el$15);
259
+ insertNode(_el$0, _el$19);
260
+ insertNode(_el$0, _el$23);
261
+ insertNode(_el$0, _el$25);
262
+ setProp(_el$0, "flexDirection", "column");
263
+ setProp(_el$0, "width", "100%");
264
+ setProp(_el$1, "attributes", { bold: true });
265
+ insert(_el$1, () => `Pantheon v${props.version}`);
266
+ insert(_el$0, createComponent(Show, {
267
+ get when() {
268
+ return branch();
269
+ },
270
+ children: (b) => (() => {
271
+ var _el$27 = createElement("text");
272
+ insert(_el$27, b);
273
+ effect((_$p) => setProp(_el$27, "fg", theme().textMuted, _$p));
274
+ return _el$27;
275
+ })()
276
+ }), _el$10);
277
+ insert(_el$0, createComponent(HR, {}), _el$10);
278
+ insert(_el$0, createComponent(ContextBar, {
279
+ get api() {
280
+ return props.api;
281
+ },
282
+ get sessionID() {
283
+ return props.sessionID;
284
+ }
285
+ }), _el$10);
286
+ insert(_el$0, createComponent(HR, {}), _el$10);
287
+ insertNode(_el$10, _el$11);
288
+ insertNode(_el$10, _el$12);
289
+ setProp(_el$10, "onMouseDown", () => setShowSubagents((x) => !x));
290
+ setProp(_el$11, "attributes", { bold: true });
291
+ insert(_el$11, () => `${showSubagents() ? "▼" : "▶"} Subagents`);
292
+ insert(_el$12, () => ` (${String(sessionCount())})`);
293
+ insert(_el$0, createComponent(Show, {
294
+ get when() {
295
+ return showSubagents();
296
+ },
297
+ get children() {
298
+ var _el$13 = createElement("box"), _el$14 = createElement("text");
299
+ insertNode(_el$13, _el$14);
300
+ setProp(_el$13, "marginLeft", 1);
301
+ insert(_el$14, () => `Active sessions: ${String(sessionCount())}`);
302
+ effect((_$p) => setProp(_el$14, "fg", theme().textMuted, _$p));
303
+ return _el$13;
304
+ }
305
+ }), _el$15);
306
+ insertNode(_el$15, _el$16);
307
+ insertNode(_el$15, _el$17);
308
+ setProp(_el$15, "onMouseDown", () => setShowCommands((x) => !x));
309
+ setProp(_el$16, "attributes", { bold: true });
310
+ insert(_el$16, () => `${showCommands() ? "▼" : "▶"} Commands`);
311
+ insert(_el$17, () => ` (${String(COMMANDS.length)})`);
312
+ insert(_el$0, createComponent(Show, {
313
+ get when() {
314
+ return showCommands();
315
+ },
316
+ get children() {
317
+ var _el$18 = createElement("box");
318
+ setProp(_el$18, "marginLeft", 1);
319
+ setProp(_el$18, "flexDirection", "column");
320
+ insert(_el$18, createComponent(For, {
321
+ each: COMMANDS,
322
+ children: (cmd) => (() => {
323
+ var _el$28 = createElement("box"), _el$29 = createElement("text"), _el$30 = createElement("text");
324
+ insertNode(_el$28, _el$29);
325
+ insertNode(_el$28, _el$30);
326
+ setProp(_el$28, "onMouseDown", (e) => {
327
+ e.stopPropagation();
328
+ try {
329
+ const cmdApi = props.api.command;
330
+ const cmdName = cmd.name.replace("/", "");
331
+ if (cmdApi?.trigger?.(cmdName)) return;
332
+ } catch {}
333
+ props.api.ui?.toast?.({
334
+ title: "Command",
335
+ message: `Type ${cmd.name} in chat`
336
+ });
337
+ });
338
+ insert(_el$29, () => cmd.name);
339
+ insert(_el$30, () => ` \u2014 ${cmd.desc}`);
340
+ effect((_p$) => {
341
+ var _v$10 = cmd.name === "/pantheon" ? theme().accent : theme().textMuted, _v$11 = theme().textMuted;
342
+ _v$10 !== _p$.e && (_p$.e = setProp(_el$29, "fg", _v$10, _p$.e));
343
+ _v$11 !== _p$.t && (_p$.t = setProp(_el$30, "fg", _v$11, _p$.t));
344
+ return _p$;
345
+ }, {
346
+ e: void 0,
347
+ t: void 0
348
+ });
349
+ return _el$28;
350
+ })()
351
+ }));
352
+ return _el$18;
353
+ }
354
+ }), _el$19);
355
+ insertNode(_el$19, _el$20);
356
+ insertNode(_el$19, _el$21);
357
+ setProp(_el$19, "onMouseDown", () => setShowAgents((x) => !x));
358
+ setProp(_el$20, "attributes", { bold: true });
359
+ insert(_el$20, () => `${showAgents() ? "▼" : "▶"} Agents`);
360
+ insert(_el$21, () => ` (${String(AGENTS.length)})`);
361
+ insert(_el$0, createComponent(Show, {
362
+ get when() {
363
+ return showAgents();
364
+ },
365
+ get children() {
366
+ var _el$22 = createElement("box");
367
+ setProp(_el$22, "marginLeft", 1);
368
+ setProp(_el$22, "flexDirection", "column");
369
+ insert(_el$22, createComponent(For, {
370
+ each: AGENTS,
371
+ children: (agent) => (() => {
372
+ var _el$31 = createElement("box"), _el$32 = createElement("text"), _el$33 = createElement("text");
373
+ insertNode(_el$31, _el$32);
374
+ insertNode(_el$31, _el$33);
375
+ insert(_el$32, () => `${agent.tier === "premium" ? "✦ " : "· "}${agent.name}`);
376
+ insert(_el$33, () => ` \u2014 ${agent.role}`);
377
+ effect((_p$) => {
378
+ var _v$12 = agent.tier === "premium" ? theme().accent : theme().textMuted, _v$13 = theme().textMuted;
379
+ _v$12 !== _p$.e && (_p$.e = setProp(_el$32, "fg", _v$12, _p$.e));
380
+ _v$13 !== _p$.t && (_p$.t = setProp(_el$33, "fg", _v$13, _p$.t));
381
+ return _p$;
382
+ }, {
383
+ e: void 0,
384
+ t: void 0
385
+ });
386
+ return _el$31;
387
+ })()
388
+ }));
389
+ return _el$22;
390
+ }
391
+ }), _el$23);
392
+ insertNode(_el$23, _el$24);
393
+ setProp(_el$23, "onMouseDown", () => setShowConfig((x) => !x));
394
+ setProp(_el$24, "attributes", { bold: true });
395
+ insert(_el$24, () => `${showConfig() ? "▼" : "▶"} Config`);
396
+ insert(_el$0, createComponent(Show, {
397
+ get when() {
398
+ return showConfig();
399
+ },
400
+ get children() {
401
+ return createComponent(Show, {
402
+ get when() {
403
+ return configSummary();
404
+ },
405
+ get fallback() {
406
+ return (() => {
407
+ var _el$34 = createElement("box"), _el$35 = createElement("text");
408
+ insertNode(_el$34, _el$35);
409
+ setProp(_el$34, "marginLeft", 1);
410
+ insertNode(_el$35, createTextNode(`No config data`));
411
+ effect((_$p) => setProp(_el$35, "fg", theme().textMuted, _$p));
412
+ return _el$34;
413
+ })();
414
+ },
415
+ children: (cfg) => (() => {
416
+ var _el$37 = createElement("box"), _el$38 = createElement("text"), _el$39 = createElement("text");
417
+ insertNode(_el$37, _el$38);
418
+ insertNode(_el$37, _el$39);
419
+ setProp(_el$37, "marginLeft", 1);
420
+ setProp(_el$37, "flexDirection", "column");
421
+ insert(_el$38, () => `MCP servers: ${String(cfg().mcpCount)} Plugins: ${String(cfg().pluginCount)}`);
422
+ insert(_el$39, () => `Auto-compaction: ${cfg().autoCompaction ? "ON" : "OFF"}`);
423
+ effect((_p$) => {
424
+ var _v$14 = theme().textMuted, _v$15 = theme().textMuted;
425
+ _v$14 !== _p$.e && (_p$.e = setProp(_el$38, "fg", _v$14, _p$.e));
426
+ _v$15 !== _p$.t && (_p$.t = setProp(_el$39, "fg", _v$15, _p$.t));
427
+ return _p$;
428
+ }, {
429
+ e: void 0,
430
+ t: void 0
431
+ });
432
+ return _el$37;
433
+ })()
434
+ });
435
+ }
436
+ }), _el$25);
437
+ insertNode(_el$25, _el$26);
438
+ setProp(_el$25, "marginTop", 1);
439
+ insert(_el$26, () => `Memory: ${memoryCount() > 0 ? `${fmtInt(memoryCount())} entries` : "0 entries"}`);
440
+ effect((_p$) => {
441
+ var _v$3 = theme().accent, _v$4 = theme().text, _v$5 = theme().textMuted, _v$6 = theme().text, _v$7 = theme().textMuted, _v$8 = theme().text, _v$9 = theme().textMuted, _v$0 = theme().text, _v$1 = theme().textMuted;
442
+ _v$3 !== _p$.e && (_p$.e = setProp(_el$1, "fg", _v$3, _p$.e));
443
+ _v$4 !== _p$.t && (_p$.t = setProp(_el$11, "fg", _v$4, _p$.t));
444
+ _v$5 !== _p$.a && (_p$.a = setProp(_el$12, "fg", _v$5, _p$.a));
445
+ _v$6 !== _p$.o && (_p$.o = setProp(_el$16, "fg", _v$6, _p$.o));
446
+ _v$7 !== _p$.i && (_p$.i = setProp(_el$17, "fg", _v$7, _p$.i));
447
+ _v$8 !== _p$.n && (_p$.n = setProp(_el$20, "fg", _v$8, _p$.n));
448
+ _v$9 !== _p$.s && (_p$.s = setProp(_el$21, "fg", _v$9, _p$.s));
449
+ _v$0 !== _p$.h && (_p$.h = setProp(_el$24, "fg", _v$0, _p$.h));
450
+ _v$1 !== _p$.r && (_p$.r = setProp(_el$26, "fg", _v$1, _p$.r));
451
+ return _p$;
452
+ }, {
453
+ e: void 0,
454
+ t: void 0,
455
+ a: void 0,
456
+ o: void 0,
457
+ i: void 0,
458
+ n: void 0,
459
+ s: void 0,
460
+ h: void 0,
461
+ r: void 0
462
+ });
463
+ return _el$0;
464
+ })();
136
465
  }
137
- var tui = async (api) => {
138
- api.slots.register(createSlot(api));
466
+ const tui = async (api, _options, _meta) => {
467
+ let version = "5.0.0";
468
+ try {
469
+ const wt = api.state.path?.worktree ?? "";
470
+ const fp = wt ? `${wt}/package.json` : "package.json";
471
+ const result = await api.client.file.read({ query: { path: fp } });
472
+ const match = String(result?.content ?? "").match(/"version":\s*"([^"]+)"/);
473
+ if (match?.[1]) version = match[1];
474
+ } catch {}
475
+ api.slots.register({
476
+ order: 900,
477
+ slots: { sidebar_content(_ctx, props) {
478
+ return createComponent(View, {
479
+ api,
480
+ get sessionID() {
481
+ return props.session_id;
482
+ },
483
+ version
484
+ });
485
+ } }
486
+ });
139
487
  };
140
- var index_default = { id: "pantheon.tui", tui };
141
- export {
142
- index_default as default
488
+ const plugin = {
489
+ id: "pantheon.tui",
490
+ tui
143
491
  };
492
+ //#endregion
493
+ export { plugin as default };
494
+
495
+ //# sourceMappingURL=tui.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tui.js","names":[],"sources":[],"mappings":""}