mirror of
https://git.sync.wtf/troed/oc-ls-stats.git
synced 2026-08-31 09:43:38 +03:00
Fix plugin loading: correct TUI signature, fix regex syntax, restore SessionPromptRight component
This commit is contained in:
+1
-4
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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} />
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user