no url or dir

actual-tui-plugins
Sebastian Herrlinger 2026-03-04 15:12:34 +01:00
parent 5a5405630b
commit ed4513191d
4 changed files with 3 additions and 21 deletions

View File

@ -162,10 +162,7 @@ export function tui(input: {
const renderer = await createCliRenderer(rendererConfig(input.config))
const registry = createSolidSlotRegistry<TuiSlotMap, TuiSlotContext>(
renderer,
{
url: input.url,
directory: input.directory,
},
{},
{
onPluginError(event) {
console.error("[tui.slot] plugin error", {

View File

@ -46,8 +46,6 @@ export const { use: useSDK, provider: SDKProvider } = createSimpleContext({
TuiPlugin.init({
client: sdk,
event: emitter,
url: props.url,
directory: props.directory,
renderer: props.renderer,
slots: props.slots,
}).catch((error) => {

View File

@ -13,7 +13,6 @@ import { Log } from "@/util/log"
import { BunProc } from "@/bun"
import { Instance } from "@/project/instance"
import { registerThemes } from "./context/theme"
import { existsSync } from "fs"
export namespace TuiPlugin {
const log = Log.create({ service: "tui.plugin" })
@ -47,14 +46,7 @@ export namespace TuiPlugin {
}
async function load(input: TuiPluginInput) {
const base = input.directory ?? process.cwd()
const dir = existsSync(base) ? base : process.cwd()
if (dir !== base) {
log.info("tui plugin directory not found, using local cwd", {
requested: base,
directory: dir,
})
}
const dir = process.cwd()
await Instance.provide({
directory: dir,

View File

@ -44,10 +44,7 @@ export type TuiSlotMap = {
}
}
export type TuiSlotContext = {
url: string
directory?: string
}
export type TuiSlotContext = {}
export type TuiSlotPlugin<Node = unknown> = SlotPlugin<Node, TuiSlotMap, TuiSlotContext>
@ -65,8 +62,6 @@ export type TuiEventBus = {
export type TuiPluginInput<Renderer = CliRenderer> = {
client: ReturnType<typeof createOpencodeClientV2>
event: TuiEventBus
url: string
directory?: string
renderer: Renderer
slots: TuiSlots
}