forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtui-environment.tsx
More file actions
32 lines (31 loc) · 883 Bytes
/
Copy pathtui-environment.tsx
File metadata and controls
32 lines (31 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/** @jsxImportSource @opentui/solid */
import {
TuiPathsProvider,
TuiStartupProvider,
TuiTerminalEnvironmentProvider,
type TuiPaths,
} from "@opencode-ai/tui/context/runtime"
import type { ParentProps } from "solid-js"
export function TestTuiContexts(
props: ParentProps<{
cwd?: string
directory?: string
paths?: Partial<TuiPaths>
}>,
) {
return (
<TuiPathsProvider
value={{
cwd: props.cwd ?? props.directory ?? "/tmp/opencode/packages/opencode",
home: "/tmp/opencode/home",
state: "/tmp/opencode/state",
worktree: "/tmp/opencode",
...props.paths,
}}
>
<TuiTerminalEnvironmentProvider value={{ platform: "linux" }}>
<TuiStartupProvider value={{ skipInitialLoading: false }}>{props.children}</TuiStartupProvider>
</TuiTerminalEnvironmentProvider>
</TuiPathsProvider>
)
}