refactor(tui): extract standalone package (#31193)

This commit is contained in:
Dax
2026-06-07 05:24:27 +00:00
committed by GitHub
parent 7a2c49e762
commit 106f8e94d6
84 changed files with 1148 additions and 1919 deletions
+3 -3
View File
@@ -2,7 +2,7 @@ import path from "path"
import { onMount } from "solid-js"
import { createStore, produce, unwrap } from "solid-js/store"
import { createSimpleContext } from "../context/helper"
import { useTuiEnvironment } from "../runtime"
import { useTuiPaths } from "../context/runtime"
import { appendText, readText, writeText } from "../util/persistence"
import type { PromptInfo } from "./history"
@@ -32,8 +32,8 @@ export function parsePromptStash(text: string) {
export const { use: usePromptStash, provider: PromptStashProvider } = createSimpleContext({
name: "PromptStash",
init: () => {
const environment = useTuiEnvironment()
const stashPath = path.join(environment.paths.state, "prompt-stash.jsonl")
const paths = useTuiPaths()
const stashPath = path.join(paths.state, "prompt-stash.jsonl")
onMount(async () => {
const lines = parsePromptStash(await readText(stashPath).catch(() => ""))
setStore("entries", lines)