Fix plugin loading: correct TUI signature, fix regex syntax, restore SessionPromptRight component

This commit is contained in:
Troed Sångberg
2026-06-13 21:15:22 +02:00
parent a161a54aaa
commit aa61f922a1
2 changed files with 5 additions and 8 deletions
+1 -4
View File
@@ -1,12 +1,9 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@troed/oc-ls-stats",
"version": "0.0.17",
"version": "0.0.19",
"type": "module",
"exports": {
".": {
"import": "./tui.tsx"
},
"./tui": {
"import": "./tui.tsx"
}
+4 -4
View File
@@ -89,8 +89,8 @@ function parseJSONC(text: string): unknown {
}
if (ch === ",") {
const next = text.indexOf(/[\s}])/), i + 1)
if (next !== -1 && /[\}])]/.test(text[next])) {
const next = text.indexOf(/[\s}\]]/, i + 1)
if (next !== -1 && /[\s}\]]/.test(text[next])) {
i++
continue
}
@@ -275,7 +275,7 @@ function SessionPromptRight(props: {
return <>{text() ? <text fg={props.api.theme.current.textMuted}>{text()}</text> : null}</>
}
const tui: TuiPlugin = async (api, options) => {
const tui: TuiPlugin = async (api) => {
console.log("[oc-ls-stats] TUI plugin loaded!")
const tracker: TrackerState = {
streamSamplesBySession: {},
@@ -480,7 +480,7 @@ const tui: TuiPlugin = async (api, options) => {
api.slots.register({
slots: {
session_prompt_right(_ctx, value) {
return <text fg="#ff0000" bg="#000000">*** SCOPED v0.0.17 LOADED ***</text>
return <SessionPromptRight api={api} sessionID={value.session_id} tracker={tracker} version={version} clock={clock} />
},
},
})