@neurocode-ai/tui 1.18.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bunfig.toml +4 -0
- package/package.json +72 -0
- package/src/app.tsx +1134 -0
- package/src/attention.ts +260 -0
- package/src/audio.d.ts +9 -0
- package/src/audio.ts +53 -0
- package/src/clipboard.ts +124 -0
- package/src/component/bg-pulse-render.ts +436 -0
- package/src/component/bg-pulse.tsx +99 -0
- package/src/component/command-palette.tsx +79 -0
- package/src/component/dialog-agent.tsx +31 -0
- package/src/component/dialog-console-org.tsx +135 -0
- package/src/component/dialog-debug.tsx +90 -0
- package/src/component/dialog-mcp.tsx +85 -0
- package/src/component/dialog-model.tsx +197 -0
- package/src/component/dialog-move-session.tsx +353 -0
- package/src/component/dialog-provider.tsx +469 -0
- package/src/component/dialog-retry-action.tsx +160 -0
- package/src/component/dialog-session-delete-failed.tsx +99 -0
- package/src/component/dialog-session-list.tsx +364 -0
- package/src/component/dialog-session-rename.tsx +31 -0
- package/src/component/dialog-skill.tsx +70 -0
- package/src/component/dialog-stash.tsx +87 -0
- package/src/component/dialog-status.tsx +168 -0
- package/src/component/dialog-tag.tsx +47 -0
- package/src/component/dialog-theme-list.tsx +50 -0
- package/src/component/dialog-variant.tsx +39 -0
- package/src/component/dialog-workspace-create.tsx +308 -0
- package/src/component/dialog-workspace-file-changes.tsx +144 -0
- package/src/component/dialog-workspace-list.tsx +112 -0
- package/src/component/dialog-workspace-unavailable.tsx +69 -0
- package/src/component/error-component.tsx +240 -0
- package/src/component/logo.tsx +61 -0
- package/src/component/plugin-route-missing.tsx +14 -0
- package/src/component/prompt/autocomplete.tsx +781 -0
- package/src/component/prompt/cwd.ts +0 -0
- package/src/component/prompt/frecency.tsx +1 -0
- package/src/component/prompt/history.tsx +1 -0
- package/src/component/prompt/index.tsx +1713 -0
- package/src/component/prompt/local-attachment.ts +48 -0
- package/src/component/prompt/move.tsx +205 -0
- package/src/component/prompt/stash.tsx +1 -0
- package/src/component/prompt/workspace.tsx +137 -0
- package/src/component/register-spinner.ts +6 -0
- package/src/component/spinner.tsx +26 -0
- package/src/component/startup-loading.tsx +63 -0
- package/src/component/todo-item.tsx +32 -0
- package/src/component/use-connected.tsx +12 -0
- package/src/component/workspace-label.tsx +19 -0
- package/src/config/index.tsx +129 -0
- package/src/config/keybind.ts +471 -0
- package/src/context/args.tsx +16 -0
- package/src/context/clipboard.tsx +18 -0
- package/src/context/data.tsx +569 -0
- package/src/context/directory.ts +17 -0
- package/src/context/editor.ts +408 -0
- package/src/context/epilogue.tsx +6 -0
- package/src/context/event.ts +36 -0
- package/src/context/exit.tsx +8 -0
- package/src/context/helper.tsx +26 -0
- package/src/context/kv.tsx +66 -0
- package/src/context/local.tsx +542 -0
- package/src/context/location.tsx +14 -0
- package/src/context/path-format.tsx +24 -0
- package/src/context/permission.tsx +26 -0
- package/src/context/project.tsx +115 -0
- package/src/context/prompt.tsx +18 -0
- package/src/context/route.tsx +60 -0
- package/src/context/runtime.tsx +62 -0
- package/src/context/sdk.tsx +151 -0
- package/src/context/sync.tsx +666 -0
- package/src/context/theme.tsx +332 -0
- package/src/context/thinking.ts +67 -0
- package/src/editor-zed.ts +286 -0
- package/src/editor.ts +101 -0
- package/src/feature-plugins/builtins.ts +36 -0
- package/src/feature-plugins/home/footer.tsx +100 -0
- package/src/feature-plugins/home/tips-view.tsx +287 -0
- package/src/feature-plugins/home/tips.tsx +59 -0
- package/src/feature-plugins/sidebar/context.tsx +65 -0
- package/src/feature-plugins/sidebar/files.tsx +70 -0
- package/src/feature-plugins/sidebar/footer.tsx +98 -0
- package/src/feature-plugins/sidebar/lsp.tsx +65 -0
- package/src/feature-plugins/sidebar/mcp.tsx +97 -0
- package/src/feature-plugins/sidebar/todo.tsx +49 -0
- package/src/feature-plugins/system/diff-viewer-file-tree-utils.ts +232 -0
- package/src/feature-plugins/system/diff-viewer-file-tree.tsx +162 -0
- package/src/feature-plugins/system/diff-viewer-ui.tsx +103 -0
- package/src/feature-plugins/system/diff-viewer.tsx +1077 -0
- package/src/feature-plugins/system/notifications.ts +94 -0
- package/src/feature-plugins/system/plugins.tsx +269 -0
- package/src/feature-plugins/system/which-key.tsx +608 -0
- package/src/index.tsx +1 -0
- package/src/keymap.tsx +290 -0
- package/src/logo.ts +11 -0
- package/src/parsers-config.ts +386 -0
- package/src/plugin/adapters.tsx +355 -0
- package/src/plugin/api.ts +52 -0
- package/src/plugin/command-shim.ts +109 -0
- package/src/plugin/runtime.tsx +81 -0
- package/src/plugin/slots.tsx +65 -0
- package/src/prompt/display.ts +48 -0
- package/src/prompt/frecency.tsx +80 -0
- package/src/prompt/history.tsx +111 -0
- package/src/prompt/part.ts +29 -0
- package/src/prompt/stash.tsx +89 -0
- package/src/prompt/traits.ts +29 -0
- package/src/routes/home/session-destination.tsx +41 -0
- package/src/routes/home.tsx +95 -0
- package/src/routes/session/dialog-fork-from-timeline.tsx +76 -0
- package/src/routes/session/dialog-message.tsx +109 -0
- package/src/routes/session/dialog-subagent.tsx +26 -0
- package/src/routes/session/dialog-timeline.tsx +47 -0
- package/src/routes/session/footer.tsx +91 -0
- package/src/routes/session/index.tsx +2710 -0
- package/src/routes/session/permission.tsx +718 -0
- package/src/routes/session/question.tsx +514 -0
- package/src/routes/session/sidebar.tsx +103 -0
- package/src/routes/session/subagent-footer.tsx +132 -0
- package/src/runtime.tsx +9 -0
- package/src/terminal-win32.ts +130 -0
- package/src/theme/assets/aura.json +69 -0
- package/src/theme/assets/ayu.json +80 -0
- package/src/theme/assets/carbonfox.json +248 -0
- package/src/theme/assets/catppuccin-frappe.json +230 -0
- package/src/theme/assets/catppuccin-macchiato.json +230 -0
- package/src/theme/assets/catppuccin.json +112 -0
- package/src/theme/assets/cobalt2.json +225 -0
- package/src/theme/assets/cursor.json +249 -0
- package/src/theme/assets/dracula.json +219 -0
- package/src/theme/assets/everforest.json +241 -0
- package/src/theme/assets/flexoki.json +237 -0
- package/src/theme/assets/github.json +233 -0
- package/src/theme/assets/gruvbox.json +242 -0
- package/src/theme/assets/kanagawa.json +77 -0
- package/src/theme/assets/lucent-orng.json +234 -0
- package/src/theme/assets/material.json +235 -0
- package/src/theme/assets/matrix.json +77 -0
- package/src/theme/assets/mercury.json +252 -0
- package/src/theme/assets/monokai.json +221 -0
- package/src/theme/assets/nightowl.json +221 -0
- package/src/theme/assets/nord.json +223 -0
- package/src/theme/assets/one-dark.json +84 -0
- package/src/theme/assets/opencode.json +245 -0
- package/src/theme/assets/orng.json +249 -0
- package/src/theme/assets/osaka-jade.json +93 -0
- package/src/theme/assets/palenight.json +222 -0
- package/src/theme/assets/rosepine.json +234 -0
- package/src/theme/assets/solarized.json +223 -0
- package/src/theme/assets/synthwave84.json +226 -0
- package/src/theme/assets/tokyonight.json +243 -0
- package/src/theme/assets/vercel.json +245 -0
- package/src/theme/assets/vesper.json +218 -0
- package/src/theme/assets/zenburn.json +223 -0
- package/src/theme/index.ts +1089 -0
- package/src/ui/border.ts +21 -0
- package/src/ui/dialog-alert.tsx +66 -0
- package/src/ui/dialog-confirm.tsx +108 -0
- package/src/ui/dialog-export-options.tsx +217 -0
- package/src/ui/dialog-help.tsx +40 -0
- package/src/ui/dialog-prompt.tsx +126 -0
- package/src/ui/dialog-select.tsx +790 -0
- package/src/ui/dialog.tsx +231 -0
- package/src/ui/link.tsx +34 -0
- package/src/ui/spinner.ts +368 -0
- package/src/ui/toast.tsx +102 -0
- package/src/util/collapse-tool-output.ts +19 -0
- package/src/util/error.ts +182 -0
- package/src/util/filetype.ts +130 -0
- package/src/util/format.ts +20 -0
- package/src/util/layout.ts +25 -0
- package/src/util/locale.ts +86 -0
- package/src/util/model.ts +28 -0
- package/src/util/path.ts +12 -0
- package/src/util/persistence.ts +33 -0
- package/src/util/presentation.ts +38 -0
- package/src/util/provider-origin.ts +7 -0
- package/src/util/record.ts +3 -0
- package/src/util/renderer.ts +7 -0
- package/src/util/revert-diff.ts +18 -0
- package/src/util/scroll.ts +27 -0
- package/src/util/selection.ts +79 -0
- package/src/util/session.ts +3 -0
- package/src/util/signal.ts +51 -0
- package/src/util/system.ts +20 -0
- package/src/util/tool-display.ts +13 -0
- package/src/util/transcript.ts +112 -0
- package/sst-env.d.ts +10 -0
- package/test/app-lifecycle.test.tsx +128 -0
- package/test/cli/cmd/tui/dialog-workspace-create.test.ts +28 -0
- package/test/cli/cmd/tui/model-options.test.ts +32 -0
- package/test/cli/cmd/tui/notifications.test.ts +267 -0
- package/test/cli/cmd/tui/provider-options.test.ts +41 -0
- package/test/cli/cmd/tui/sync-fixture.tsx +70 -0
- package/test/cli/cmd/tui/sync-live-hydration.test.tsx +262 -0
- package/test/cli/cmd/tui/sync-undefined-messages.test.tsx +43 -0
- package/test/cli/cmd/tui/sync.test.tsx +65 -0
- package/test/cli/tui/__snapshots__/inline-tool-wrap-snapshot.test.tsx.snap +92 -0
- package/test/cli/tui/data.test.tsx +486 -0
- package/test/cli/tui/dialog-prompt.test.tsx +147 -0
- package/test/cli/tui/diff-viewer-file-tree.test.tsx +200 -0
- package/test/cli/tui/diff-viewer.test.tsx +268 -0
- package/test/cli/tui/inline-tool-wrap-snapshot.test.tsx +351 -0
- package/test/cli/tui/prompt-submit-race.test.ts +98 -0
- package/test/cli/tui/thinking.test.ts +36 -0
- package/test/cli/tui/use-event.test.tsx +148 -0
- package/test/clipboard.test.ts +19 -0
- package/test/component/dialog-session-list.test.ts +46 -0
- package/test/config.test.tsx +127 -0
- package/test/context/local.test.ts +22 -0
- package/test/editor.test.ts +32 -0
- package/test/feature-plugins/diff-viewer-file-tree-utils.test.ts +323 -0
- package/test/fixture/fixture.ts +13 -0
- package/test/fixture/tui-environment.tsx +32 -0
- package/test/fixture/tui-plugin.ts +36 -0
- package/test/fixture/tui-runtime.ts +12 -0
- package/test/fixture/tui-sdk.ts +109 -0
- package/test/index.test.tsx +6 -0
- package/test/keymap.test.tsx +141 -0
- package/test/plugin/runtime.test.ts +50 -0
- package/test/plugin/slots.test.tsx +38 -0
- package/test/prompt/display.test.ts +33 -0
- package/test/prompt/history.test.ts +39 -0
- package/test/prompt/jsonl.test.ts +24 -0
- package/test/prompt/local-attachment.test.ts +43 -0
- package/test/prompt/part.test.ts +53 -0
- package/test/prompt/persistence.test.ts +23 -0
- package/test/prompt/traits.test.ts +25 -0
- package/test/runtime.test.tsx +37 -0
- package/test/theme.test.ts +81 -0
- package/test/util/error.test.ts +49 -0
- package/test/util/filetype.test.ts +16 -0
- package/test/util/format.test.ts +59 -0
- package/test/util/model.test.ts +9 -0
- package/test/util/presentation.test.ts +8 -0
- package/test/util/renderer.test.ts +30 -0
- package/test/util/revert-diff.test.ts +35 -0
- package/test/util/session.test.ts +10 -0
- package/test/util/tool-display.test.ts +40 -0
- package/test/util/transcript.test.ts +421 -0
- package/tsconfig.json +10 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { createMemo, onMount } from "solid-js"
|
|
2
|
+
import { useSync } from "../../context/sync"
|
|
3
|
+
import { DialogSelect, type DialogSelectOption } from "../../ui/dialog-select"
|
|
4
|
+
import type { TextPart } from "@neurocode-ai/sdk/v2"
|
|
5
|
+
import { Locale } from "../../util/locale"
|
|
6
|
+
import { DialogMessage } from "./dialog-message"
|
|
7
|
+
import { useDialog } from "../../ui/dialog"
|
|
8
|
+
import type { PromptInfo } from "../../component/prompt/history"
|
|
9
|
+
|
|
10
|
+
export function DialogTimeline(props: {
|
|
11
|
+
sessionID: string
|
|
12
|
+
onMove: (messageID: string) => void
|
|
13
|
+
setPrompt?: (prompt: PromptInfo) => void
|
|
14
|
+
}) {
|
|
15
|
+
const sync = useSync()
|
|
16
|
+
const dialog = useDialog()
|
|
17
|
+
|
|
18
|
+
onMount(() => {
|
|
19
|
+
dialog.setSize("large")
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
const options = createMemo((): DialogSelectOption<string>[] => {
|
|
23
|
+
const messages = sync.data.message[props.sessionID] ?? []
|
|
24
|
+
const result = [] as DialogSelectOption<string>[]
|
|
25
|
+
for (const message of messages) {
|
|
26
|
+
if (message.role !== "user") continue
|
|
27
|
+
const part = (sync.data.part[message.id] ?? []).find(
|
|
28
|
+
(x) => x.type === "text" && !x.synthetic && !x.ignored,
|
|
29
|
+
) as TextPart
|
|
30
|
+
if (!part) continue
|
|
31
|
+
result.push({
|
|
32
|
+
title: part.text.replace(/\n/g, " "),
|
|
33
|
+
value: message.id,
|
|
34
|
+
footer: Locale.time(message.time.created),
|
|
35
|
+
onSelect: (dialog) => {
|
|
36
|
+
dialog.replace(() => (
|
|
37
|
+
<DialogMessage messageID={message.id} sessionID={props.sessionID} setPrompt={props.setPrompt} />
|
|
38
|
+
))
|
|
39
|
+
},
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
result.reverse()
|
|
43
|
+
return result
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
return <DialogSelect onMove={(option) => props.onMove(option.value)} title="Timeline" options={options()} />
|
|
47
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { createMemo, Match, onCleanup, onMount, Show, Switch } from "solid-js"
|
|
2
|
+
import { useTheme } from "../../context/theme"
|
|
3
|
+
import { useSync } from "../../context/sync"
|
|
4
|
+
import { useDirectory } from "../../context/directory"
|
|
5
|
+
import { useConnected } from "../../component/use-connected"
|
|
6
|
+
import { createStore } from "solid-js/store"
|
|
7
|
+
import { useRoute } from "../../context/route"
|
|
8
|
+
|
|
9
|
+
export function Footer() {
|
|
10
|
+
const { theme } = useTheme()
|
|
11
|
+
const sync = useSync()
|
|
12
|
+
const route = useRoute()
|
|
13
|
+
const mcp = createMemo(() => Object.values(sync.data.mcp).filter((x) => x.status === "connected").length)
|
|
14
|
+
const mcpError = createMemo(() => Object.values(sync.data.mcp).some((x) => x.status === "failed"))
|
|
15
|
+
const lsp = createMemo(() => Object.keys(sync.data.lsp))
|
|
16
|
+
const permissions = createMemo(() => {
|
|
17
|
+
if (route.data.type !== "session") return []
|
|
18
|
+
return sync.data.permission[route.data.sessionID] ?? []
|
|
19
|
+
})
|
|
20
|
+
const directory = useDirectory()
|
|
21
|
+
const connected = useConnected()
|
|
22
|
+
|
|
23
|
+
const [store, setStore] = createStore({
|
|
24
|
+
welcome: false,
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
onMount(() => {
|
|
28
|
+
// Track all timeouts to ensure proper cleanup
|
|
29
|
+
const timeouts: ReturnType<typeof setTimeout>[] = []
|
|
30
|
+
|
|
31
|
+
function tick() {
|
|
32
|
+
if (connected()) return
|
|
33
|
+
if (!store.welcome) {
|
|
34
|
+
setStore("welcome", true)
|
|
35
|
+
timeouts.push(setTimeout(() => tick(), 5000))
|
|
36
|
+
return
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (store.welcome) {
|
|
40
|
+
setStore("welcome", false)
|
|
41
|
+
timeouts.push(setTimeout(() => tick(), 10_000))
|
|
42
|
+
return
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
timeouts.push(setTimeout(() => tick(), 10_000))
|
|
46
|
+
|
|
47
|
+
onCleanup(() => {
|
|
48
|
+
timeouts.forEach(clearTimeout)
|
|
49
|
+
})
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<box flexDirection="row" justifyContent="space-between" gap={1} flexShrink={0}>
|
|
54
|
+
<text fg={theme.textMuted}>{directory()}</text>
|
|
55
|
+
<box gap={2} flexDirection="row" flexShrink={0}>
|
|
56
|
+
<Switch>
|
|
57
|
+
<Match when={store.welcome}>
|
|
58
|
+
<text fg={theme.text}>
|
|
59
|
+
Get started <span style={{ fg: theme.textMuted }}>/connect</span>
|
|
60
|
+
</text>
|
|
61
|
+
</Match>
|
|
62
|
+
<Match when={connected()}>
|
|
63
|
+
<Show when={permissions().length > 0}>
|
|
64
|
+
<text fg={theme.warning}>
|
|
65
|
+
<span style={{ fg: theme.warning }}>△</span> {permissions().length} Permission
|
|
66
|
+
{permissions().length > 1 ? "s" : ""}
|
|
67
|
+
</text>
|
|
68
|
+
</Show>
|
|
69
|
+
<text fg={theme.text}>
|
|
70
|
+
<span style={{ fg: lsp().length > 0 ? theme.success : theme.textMuted }}>•</span> {lsp().length} LSP
|
|
71
|
+
</text>
|
|
72
|
+
<Show when={mcp()}>
|
|
73
|
+
<text fg={theme.text}>
|
|
74
|
+
<Switch>
|
|
75
|
+
<Match when={mcpError()}>
|
|
76
|
+
<span style={{ fg: theme.error }}>⊙ </span>
|
|
77
|
+
</Match>
|
|
78
|
+
<Match when={true}>
|
|
79
|
+
<span style={{ fg: theme.success }}>⊙ </span>
|
|
80
|
+
</Match>
|
|
81
|
+
</Switch>
|
|
82
|
+
{mcp()} MCP
|
|
83
|
+
</text>
|
|
84
|
+
</Show>
|
|
85
|
+
<text fg={theme.textMuted}>/status</text>
|
|
86
|
+
</Match>
|
|
87
|
+
</Switch>
|
|
88
|
+
</box>
|
|
89
|
+
</box>
|
|
90
|
+
)
|
|
91
|
+
}
|