@uniqbit/mate-core 1.0.0-canary.2 → 1.0.0-canary.3
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/opencode-plugin/tui.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** @jsxRuntime automatic */
|
|
2
2
|
/** @jsxImportSource @opentui/solid */
|
|
3
3
|
/** Root entry for a plugin bound by directory path; see `server.ts`. */
|
|
4
|
-
|
|
4
|
+
// Explicit extensions let OpenTUI prescan the re-export chain in node_modules.
|
|
5
|
+
export { default } from "./src/tui.tsx";
|
package/package.json
CHANGED
package/src/opencode/tui.tsx
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
/** @jsxRuntime automatic */
|
|
2
2
|
/** @jsxImportSource @opentui/solid */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* OpenCode V2 TUI plugin module (`{ id, setup }`), OpenCode 2.x only.
|
|
6
|
-
* Solid JSX, not React: `key` is not a reconciliation prop here and `TextProps`
|
|
7
|
-
* does not accept it, so the jsx-key rules cannot be satisfied — only suppressed.
|
|
8
|
-
* The line list is a function child: Solid re-runs its `.map` whole on a store change, fine for a few lines.
|
|
9
|
-
*/
|
|
10
|
-
import type { JSX } from "@opentui/solid";
|
|
3
|
+
// OpenCode scans source imports to bind host modules; implicit JSX imports are missed in node_modules.
|
|
4
|
+
import { jsx } from "@opentui/solid/jsx-runtime";
|
|
11
5
|
|
|
12
6
|
import { BRAND_ACCENT } from "../brand/palette";
|
|
13
7
|
import { mateVersion } from "../runtime/install";
|
|
@@ -68,25 +62,21 @@ function SessionContext({
|
|
|
68
62
|
const text = api.theme.text;
|
|
69
63
|
const warning = text.feedback?.warning?.base ?? text.muted;
|
|
70
64
|
|
|
71
|
-
return (
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
notes.lines.map((note) => <text fg={warning}>{note}</text>)) as unknown as JSX.Element
|
|
87
|
-
}
|
|
88
|
-
</box>
|
|
89
|
-
);
|
|
65
|
+
return jsx("box", {
|
|
66
|
+
width: "100%",
|
|
67
|
+
maxWidth: sidebar ? undefined : 75,
|
|
68
|
+
paddingLeft: sidebar ? 0 : 2,
|
|
69
|
+
paddingRight: sidebar ? 0 : 2,
|
|
70
|
+
paddingBottom: sidebar ? 1 : 0,
|
|
71
|
+
flexShrink: 0,
|
|
72
|
+
children: [
|
|
73
|
+
jsx("text", { fg: MATE_VERSION_COLOR, children: `mate v${MATE_VERSION}` }),
|
|
74
|
+
jsx("text", { fg: text.muted, children: `repo: ${context.repositoryPath}` }),
|
|
75
|
+
jsx("text", { fg: text.muted, children: `mate: ${context.companionPath}` }),
|
|
76
|
+
// A function child keeps late staleness updates reactive without the Solid transform.
|
|
77
|
+
() => notes.lines.map((note) => jsx("text", { fg: warning, children: note })),
|
|
78
|
+
],
|
|
79
|
+
});
|
|
90
80
|
}
|
|
91
81
|
|
|
92
82
|
/** Polls the session lines; a line that appears after startup is also raised as a toast. */
|
|
@@ -116,11 +106,11 @@ function setup(api: MateTuiApi): (() => void) | undefined {
|
|
|
116
106
|
|
|
117
107
|
api.ui.slot({
|
|
118
108
|
prepend: "home.footer",
|
|
119
|
-
render: () =>
|
|
109
|
+
render: () => SessionContext({ api, notes }),
|
|
120
110
|
});
|
|
121
111
|
api.ui.slot({
|
|
122
112
|
append: "sidebar.content",
|
|
123
|
-
render: () =>
|
|
113
|
+
render: () => SessionContext({ api, notes, sidebar: true }),
|
|
124
114
|
});
|
|
125
115
|
return () => clearInterval(timer);
|
|
126
116
|
}
|