@stonerzju/opencode 1.2.17 → 1.2.19
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/bin/opencode +29 -157
- package/package.json +29 -29
- package/src/acp/agent.ts +4 -4
- package/src/acp/session.ts +1 -1
- package/src/agent/agent.ts +3 -3
- package/src/bun/index.ts +2 -2
- package/src/cli/cmd/acp.ts +3 -3
- package/src/cli/cmd/debug/file.ts +1 -1
- package/src/cli/cmd/github.ts +2 -2
- package/src/cli/cmd/pr.ts +1 -1
- package/src/cli/cmd/tui/app.tsx +24 -24
- package/src/cli/cmd/tui/attach.ts +3 -3
- package/src/cli/cmd/tui/component/dialog-agent.tsx +3 -3
- package/src/cli/cmd/tui/component/dialog-command.tsx +3 -3
- package/src/cli/cmd/tui/component/dialog-mcp.tsx +5 -5
- package/src/cli/cmd/tui/component/dialog-model.tsx +4 -4
- package/src/cli/cmd/tui/component/dialog-provider.tsx +4 -4
- package/src/cli/cmd/tui/component/dialog-session-list.tsx +5 -5
- package/src/cli/cmd/tui/component/dialog-session-rename.tsx +3 -3
- package/src/cli/cmd/tui/component/dialog-skill.tsx +3 -3
- package/src/cli/cmd/tui/component/dialog-stash.tsx +3 -3
- package/src/cli/cmd/tui/component/dialog-status.tsx +2 -2
- package/src/cli/cmd/tui/component/dialog-tag.tsx +3 -3
- package/src/cli/cmd/tui/component/logo.tsx +2 -2
- package/src/cli/cmd/tui/component/prompt/autocomplete.tsx +6 -6
- package/src/cli/cmd/tui/component/prompt/frecency.tsx +2 -2
- package/src/cli/cmd/tui/component/prompt/history.tsx +2 -2
- package/src/cli/cmd/tui/component/prompt/index.tsx +14 -14
- package/src/cli/cmd/tui/component/prompt/stash.tsx +2 -2
- package/src/cli/cmd/tui/component/textarea-keybindings.ts +1 -1
- package/src/cli/cmd/tui/component/tips.tsx +1 -1
- package/src/cli/cmd/tui/context/directory.ts +1 -1
- package/src/cli/cmd/tui/context/exit.tsx +1 -1
- package/src/cli/cmd/tui/context/keybind.tsx +2 -2
- package/src/cli/cmd/tui/context/kv.tsx +2 -2
- package/src/cli/cmd/tui/context/local.tsx +6 -6
- package/src/cli/cmd/tui/context/sync.tsx +4 -4
- package/src/cli/cmd/tui/context/theme/opencode.json +245 -0
- package/src/cli/cmd/tui/context/theme.tsx +2 -2
- package/src/cli/cmd/tui/context/tui-config.tsx +1 -1
- package/src/cli/cmd/tui/event.ts +2 -2
- package/src/cli/cmd/tui/routes/home.tsx +6 -6
- package/src/cli/cmd/tui/routes/session/dialog-fork-from-timeline.tsx +6 -6
- package/src/cli/cmd/tui/routes/session/dialog-message.tsx +6 -6
- package/src/cli/cmd/tui/routes/session/dialog-subagent.tsx +2 -2
- package/src/cli/cmd/tui/routes/session/dialog-timeline.tsx +3 -3
- package/src/cli/cmd/tui/routes/session/header.tsx +5 -5
- package/src/cli/cmd/tui/routes/session/index.tsx +32 -32
- package/src/cli/cmd/tui/routes/session/permission.tsx +4 -4
- package/src/cli/cmd/tui/routes/session/sidebar.tsx +4 -4
- package/src/cli/cmd/tui/thread.ts +9 -9
- package/src/cli/cmd/tui/ui/dialog-confirm.tsx +1 -1
- package/src/cli/cmd/tui/ui/dialog-help.tsx +2 -2
- package/src/cli/cmd/tui/ui/dialog-select.tsx +5 -5
- package/src/cli/cmd/tui/ui/dialog.tsx +3 -3
- package/src/cli/cmd/tui/ui/toast.tsx +1 -1
- package/src/cli/cmd/tui/util/editor.ts +3 -3
- package/src/cli/cmd/tui/util/transcript.ts +1 -1
- package/src/cli/cmd/tui/worker.ts +10 -10
- package/src/cli/error.ts +1 -1
- package/src/cli/ui.ts +1 -1
- package/src/cli/upgrade.ts +4 -4
- package/src/command/index.ts +1 -1
- package/src/config/config.ts +10 -10
- package/src/config/markdown.ts +1 -1
- package/src/config/migrate-tui-config.ts +5 -5
- package/src/config/paths.ts +4 -4
- package/src/config/tui.ts +4 -4
- package/src/control/control.sql.ts +1 -1
- package/src/control/index.ts +1 -1
- package/src/control-plane/adaptors/worktree.ts +1 -1
- package/src/control-plane/session-proxy-middleware.ts +1 -1
- package/src/control-plane/workspace.sql.ts +1 -1
- package/src/control-plane/workspace.ts +7 -7
- package/src/file/index.ts +1 -1
- package/src/file/ripgrep.ts +2 -2
- package/src/file/watcher.ts +5 -5
- package/src/format/formatter.ts +1 -1
- package/src/ide/index.ts +3 -3
- package/src/index.ts +1 -1
- package/src/installation/index.ts +3 -3
- package/src/lsp/client.ts +3 -3
- package/src/lsp/index.ts +3 -3
- package/src/mcp/index.ts +4 -4
- package/src/permission/index.ts +2 -2
- package/src/permission/next.ts +10 -10
- package/src/plugin/codex.ts +1 -1
- package/src/plugin/copilot.ts +2 -2
- package/src/plugin/index.ts +1 -1
- package/src/project/bootstrap.ts +2 -2
- package/src/project/instance.ts +4 -4
- package/src/project/project.sql.ts +1 -1
- package/src/project/project.ts +5 -5
- package/src/project/state.ts +1 -1
- package/src/project/vcs.ts +4 -4
- package/src/provider/auth.ts +4 -4
- package/src/provider/error.ts +1 -1
- package/src/provider/models-snapshot.ts +2 -0
- package/src/provider/models.ts +1 -1
- package/src/provider/provider.ts +2 -2
- package/src/provider/transform.ts +2 -2
- package/src/pty/index.ts +5 -5
- package/src/question/index.ts +5 -5
- package/src/server/event.ts +1 -1
- package/src/server/mdns.ts +1 -1
- package/src/server/routes/global.ts +3 -3
- package/src/server/routes/permission.ts +1 -1
- package/src/server/routes/pty.ts +1 -1
- package/src/server/routes/session.ts +4 -4
- package/src/server/routes/tui.ts +1 -1
- package/src/server/server.ts +3 -3
- package/src/session/compaction.ts +7 -7
- package/src/session/index.ts +10 -10
- package/src/session/instruction.ts +1 -1
- package/src/session/llm.ts +11 -11
- package/src/session/message-v2.ts +10 -10
- package/src/session/message.ts +1 -1
- package/src/session/processor.ts +10 -10
- package/src/session/prompt.ts +8 -8
- package/src/session/retry.ts +2 -2
- package/src/session/revert.ts +1 -1
- package/src/session/session.sql.ts +3 -3
- package/src/session/status.ts +3 -3
- package/src/session/summary.ts +5 -5
- package/src/session/system.ts +1 -1
- package/src/session/todo.ts +2 -2
- package/src/share/share-next.ts +7 -7
- package/src/share/share.sql.ts +1 -1
- package/src/shell/shell.ts +3 -3
- package/src/skill/skill.ts +6 -6
- package/src/storage/db.ts +1 -1
- package/src/storage/storage.ts +1 -1
- package/src/tool/bash.ts +6 -6
- package/src/tool/edit.ts +1 -1
- package/src/tool/registry.ts +2 -2
- package/src/tool/skill.ts +1 -1
- package/src/tool/task.ts +3 -3
- package/src/util/array.ts +10 -0
- package/src/util/binary.ts +41 -0
- package/src/util/encode.ts +51 -0
- package/src/util/error.ts +54 -0
- package/src/util/identifier.ts +48 -0
- package/src/util/lazy.ts +4 -16
- package/src/util/path.ts +37 -0
- package/src/util/retry.ts +41 -0
- package/src/util/slug.ts +74 -0
- package/src/worktree/index.ts +3 -3
- package/AGENTS.md +0 -10
- package/BUN_SHELL_MIGRATION_PLAN.md +0 -136
- package/Dockerfile +0 -18
- package/README.md +0 -15
- package/bunfig.toml +0 -7
- package/drizzle.config.ts +0 -10
- package/script/build.ts +0 -224
- package/script/check-migrations.ts +0 -16
- package/script/postinstall.mjs +0 -131
- package/script/publish.ts +0 -181
- package/script/schema.ts +0 -63
- package/script/seed-e2e.ts +0 -50
- package/sst-env.d.ts +0 -10
- package/test/AGENTS.md +0 -81
- package/test/acp/agent-interface.test.ts +0 -51
- package/test/acp/event-subscription.test.ts +0 -683
- package/test/agent/agent.test.ts +0 -689
- package/test/bun.test.ts +0 -53
- package/test/cli/github-action.test.ts +0 -197
- package/test/cli/github-remote.test.ts +0 -80
- package/test/cli/import.test.ts +0 -38
- package/test/cli/plugin-auth-picker.test.ts +0 -120
- package/test/cli/tui/transcript.test.ts +0 -322
- package/test/config/agent-color.test.ts +0 -71
- package/test/config/config.test.ts +0 -1886
- package/test/config/fixtures/empty-frontmatter.md +0 -4
- package/test/config/fixtures/frontmatter.md +0 -28
- package/test/config/fixtures/markdown-header.md +0 -11
- package/test/config/fixtures/no-frontmatter.md +0 -1
- package/test/config/fixtures/weird-model-id.md +0 -13
- package/test/config/markdown.test.ts +0 -228
- package/test/config/tui.test.ts +0 -510
- package/test/control-plane/session-proxy-middleware.test.ts +0 -147
- package/test/control-plane/sse.test.ts +0 -56
- package/test/control-plane/workspace-server-sse.test.ts +0 -65
- package/test/control-plane/workspace-sync.test.ts +0 -97
- package/test/file/ignore.test.ts +0 -10
- package/test/file/index.test.ts +0 -394
- package/test/file/path-traversal.test.ts +0 -198
- package/test/file/ripgrep.test.ts +0 -39
- package/test/file/time.test.ts +0 -361
- package/test/fixture/db.ts +0 -11
- package/test/fixture/fixture.ts +0 -45
- package/test/fixture/lsp/fake-lsp-server.js +0 -77
- package/test/fixture/skills/agents-sdk/SKILL.md +0 -152
- package/test/fixture/skills/agents-sdk/references/callable.md +0 -92
- package/test/fixture/skills/cloudflare/SKILL.md +0 -211
- package/test/fixture/skills/index.json +0 -6
- package/test/ide/ide.test.ts +0 -82
- package/test/keybind.test.ts +0 -421
- package/test/lsp/client.test.ts +0 -95
- package/test/mcp/headers.test.ts +0 -153
- package/test/mcp/oauth-browser.test.ts +0 -249
- package/test/memory/abort-leak.test.ts +0 -136
- package/test/patch/patch.test.ts +0 -348
- package/test/permission/arity.test.ts +0 -33
- package/test/permission/next.test.ts +0 -689
- package/test/permission-task.test.ts +0 -319
- package/test/plugin/auth-override.test.ts +0 -44
- package/test/plugin/codex.test.ts +0 -123
- package/test/preload.ts +0 -80
- package/test/project/project.test.ts +0 -348
- package/test/project/worktree-remove.test.ts +0 -65
- package/test/provider/amazon-bedrock.test.ts +0 -446
- package/test/provider/copilot/convert-to-copilot-messages.test.ts +0 -523
- package/test/provider/copilot/copilot-chat-model.test.ts +0 -592
- package/test/provider/gitlab-duo.test.ts +0 -262
- package/test/provider/provider.test.ts +0 -2220
- package/test/provider/transform.test.ts +0 -2353
- package/test/pty/pty-output-isolation.test.ts +0 -140
- package/test/question/question.test.ts +0 -300
- package/test/scheduler.test.ts +0 -73
- package/test/server/global-session-list.test.ts +0 -89
- package/test/server/session-list.test.ts +0 -90
- package/test/server/session-select.test.ts +0 -78
- package/test/session/compaction.test.ts +0 -423
- package/test/session/instruction.test.ts +0 -170
- package/test/session/llm.test.ts +0 -667
- package/test/session/message-v2.test.ts +0 -924
- package/test/session/prompt.test.ts +0 -211
- package/test/session/retry.test.ts +0 -188
- package/test/session/revert-compact.test.ts +0 -285
- package/test/session/session.test.ts +0 -71
- package/test/session/structured-output-integration.test.ts +0 -233
- package/test/session/structured-output.test.ts +0 -385
- package/test/skill/discovery.test.ts +0 -110
- package/test/skill/skill.test.ts +0 -388
- package/test/snapshot/snapshot.test.ts +0 -1180
- package/test/storage/json-migration.test.ts +0 -846
- package/test/tool/__snapshots__/tool.test.ts.snap +0 -9
- package/test/tool/apply_patch.test.ts +0 -566
- package/test/tool/bash.test.ts +0 -402
- package/test/tool/edit.test.ts +0 -496
- package/test/tool/external-directory.test.ts +0 -127
- package/test/tool/fixtures/large-image.png +0 -0
- package/test/tool/fixtures/models-api.json +0 -38413
- package/test/tool/grep.test.ts +0 -110
- package/test/tool/question.test.ts +0 -107
- package/test/tool/read.test.ts +0 -504
- package/test/tool/registry.test.ts +0 -122
- package/test/tool/skill.test.ts +0 -112
- package/test/tool/truncation.test.ts +0 -160
- package/test/tool/webfetch.test.ts +0 -100
- package/test/tool/write.test.ts +0 -348
- package/test/util/filesystem.test.ts +0 -443
- package/test/util/format.test.ts +0 -59
- package/test/util/glob.test.ts +0 -164
- package/test/util/iife.test.ts +0 -36
- package/test/util/lazy.test.ts +0 -50
- package/test/util/lock.test.ts +0 -72
- package/test/util/process.test.ts +0 -59
- package/test/util/timeout.test.ts +0 -21
- package/test/util/wildcard.test.ts +0 -90
- package/tsconfig.json +0 -16
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DialogSelect, type DialogSelectOption } from "
|
|
1
|
+
import { DialogSelect, type DialogSelectOption } from "../ui/dialog-select"
|
|
2
2
|
import { createResource, createMemo } from "solid-js"
|
|
3
|
-
import { useDialog } from "
|
|
4
|
-
import { useSDK } from "
|
|
3
|
+
import { useDialog } from "../ui/dialog"
|
|
4
|
+
import { useSDK } from "../context/sdk"
|
|
5
5
|
|
|
6
6
|
export type DialogSkillProps = {
|
|
7
7
|
onSelect: (skill: string) => void
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useDialog } from "
|
|
2
|
-
import { DialogSelect } from "
|
|
1
|
+
import { useDialog } from "../ui/dialog"
|
|
2
|
+
import { DialogSelect } from "../ui/dialog-select"
|
|
3
3
|
import { createMemo, createSignal } from "solid-js"
|
|
4
|
-
import { Locale } from "
|
|
4
|
+
import { Locale } from "../../../../util/locale"
|
|
5
5
|
import { useTheme } from "../context/theme"
|
|
6
6
|
import { useKeybind } from "../context/keybind"
|
|
7
7
|
import { usePromptStash, type StashEntry } from "./prompt/stash"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TextAttributes } from "@opentui/core"
|
|
2
2
|
import { fileURLToPath } from "bun"
|
|
3
3
|
import { useTheme } from "../context/theme"
|
|
4
|
-
import { useDialog } from "
|
|
5
|
-
import { useSync } from "
|
|
4
|
+
import { useDialog } from "../ui/dialog"
|
|
5
|
+
import { useSync } from "../context/sync"
|
|
6
6
|
import { For, Match, Switch, Show, createMemo } from "solid-js"
|
|
7
7
|
|
|
8
8
|
export type DialogStatusProps = {}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createMemo, createResource } from "solid-js"
|
|
2
|
-
import { DialogSelect } from "
|
|
3
|
-
import { useDialog } from "
|
|
4
|
-
import { useSDK } from "
|
|
2
|
+
import { DialogSelect } from "../ui/dialog-select"
|
|
3
|
+
import { useDialog } from "../ui/dialog"
|
|
4
|
+
import { useSDK } from "../context/sdk"
|
|
5
5
|
import { createStore } from "solid-js/store"
|
|
6
6
|
|
|
7
7
|
export function DialogTag(props: { onSelect?: (value: string) => void }) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TextAttributes, RGBA } from "@opentui/core"
|
|
2
2
|
import { For, type JSX } from "solid-js"
|
|
3
|
-
import { useTheme, tint } from "
|
|
4
|
-
import { logo, marks } from "
|
|
3
|
+
import { useTheme, tint } from "../context/theme"
|
|
4
|
+
import { logo, marks } from "../../../logo"
|
|
5
5
|
|
|
6
6
|
// Shadow markers (rendered chars in parens):
|
|
7
7
|
// _ = full shadow cell (space with bg=shadow)
|
|
@@ -4,13 +4,13 @@ import fuzzysort from "fuzzysort"
|
|
|
4
4
|
import { firstBy } from "remeda"
|
|
5
5
|
import { createMemo, createResource, createEffect, onMount, onCleanup, Index, Show, createSignal } from "solid-js"
|
|
6
6
|
import { createStore } from "solid-js/store"
|
|
7
|
-
import { useSDK } from "
|
|
8
|
-
import { useSync } from "
|
|
9
|
-
import { useTheme, selectedForeground } from "
|
|
10
|
-
import { SplitBorder } from "
|
|
11
|
-
import { useCommandDialog } from "
|
|
7
|
+
import { useSDK } from "../../context/sdk"
|
|
8
|
+
import { useSync } from "../../context/sync"
|
|
9
|
+
import { useTheme, selectedForeground } from "../../context/theme"
|
|
10
|
+
import { SplitBorder } from "../border"
|
|
11
|
+
import { useCommandDialog } from "../dialog-command"
|
|
12
12
|
import { useTerminalDimensions } from "@opentui/solid"
|
|
13
|
-
import { Locale } from "
|
|
13
|
+
import { Locale } from "../../../../../util/locale"
|
|
14
14
|
import type { PromptInfo } from "./history"
|
|
15
15
|
import { useFrecency } from "./frecency"
|
|
16
16
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "path"
|
|
2
|
-
import { Global } from "
|
|
3
|
-
import { Filesystem } from "
|
|
2
|
+
import { Global } from "../../../../../global"
|
|
3
|
+
import { Filesystem } from "../../../../../util/filesystem"
|
|
4
4
|
import { onMount } from "solid-js"
|
|
5
5
|
import { createStore } from "solid-js/store"
|
|
6
6
|
import { createSimpleContext } from "../../context/helper"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "path"
|
|
2
|
-
import { Global } from "
|
|
3
|
-
import { Filesystem } from "
|
|
2
|
+
import { Global } from "../../../../../global"
|
|
3
|
+
import { Filesystem } from "../../../../../util/filesystem"
|
|
4
4
|
import { onMount } from "solid-js"
|
|
5
5
|
import { createStore, produce, unwrap } from "solid-js/store"
|
|
6
6
|
import { createSimpleContext } from "../../context/helper"
|
|
@@ -2,32 +2,32 @@ import { BoxRenderable, TextareaRenderable, MouseEvent, PasteEvent, t, dim, fg }
|
|
|
2
2
|
import { createEffect, createMemo, type JSX, onMount, createSignal, onCleanup, on, Show, Switch, Match } from "solid-js"
|
|
3
3
|
import "opentui-spinner/solid"
|
|
4
4
|
import path from "path"
|
|
5
|
-
import { Filesystem } from "
|
|
6
|
-
import { useLocal } from "
|
|
7
|
-
import { useTheme } from "
|
|
8
|
-
import { EmptyBorder } from "
|
|
9
|
-
import { useSDK } from "
|
|
10
|
-
import { useRoute } from "
|
|
11
|
-
import { useSync } from "
|
|
12
|
-
import { Identifier } from "
|
|
5
|
+
import { Filesystem } from "../../../../../util/filesystem"
|
|
6
|
+
import { useLocal } from "../../context/local"
|
|
7
|
+
import { useTheme } from "../../context/theme"
|
|
8
|
+
import { EmptyBorder } from "../border"
|
|
9
|
+
import { useSDK } from "../../context/sdk"
|
|
10
|
+
import { useRoute } from "../../context/route"
|
|
11
|
+
import { useSync } from "../../context/sync"
|
|
12
|
+
import { Identifier } from "../../../../../id/id"
|
|
13
13
|
import { createStore, produce } from "solid-js/store"
|
|
14
|
-
import { useKeybind } from "
|
|
14
|
+
import { useKeybind } from "../../context/keybind"
|
|
15
15
|
import { usePromptHistory, type PromptInfo } from "./history"
|
|
16
16
|
import { usePromptStash } from "./stash"
|
|
17
17
|
import { DialogStash } from "../dialog-stash"
|
|
18
18
|
import { type AutocompleteRef, Autocomplete } from "./autocomplete"
|
|
19
19
|
import { useCommandDialog } from "../dialog-command"
|
|
20
20
|
import { useRenderer } from "@opentui/solid"
|
|
21
|
-
import { Editor } from "
|
|
21
|
+
import { Editor } from "../../util/editor"
|
|
22
22
|
import { useExit } from "../../context/exit"
|
|
23
23
|
import { Clipboard } from "../../util/clipboard"
|
|
24
24
|
import type { FilePart } from "@opencode-ai/sdk/v2"
|
|
25
25
|
import { TuiEvent } from "../../event"
|
|
26
|
-
import { iife } from "
|
|
27
|
-
import { Locale } from "
|
|
28
|
-
import { formatDuration } from "
|
|
26
|
+
import { iife } from "../../../../../util/iife"
|
|
27
|
+
import { Locale } from "../../../../../util/locale"
|
|
28
|
+
import { formatDuration } from "../../../../../util/format"
|
|
29
29
|
import { createColors, createFrames } from "../../ui/spinner.ts"
|
|
30
|
-
import { useDialog } from "
|
|
30
|
+
import { useDialog } from "../../ui/dialog"
|
|
31
31
|
import { DialogProvider as DialogProviderConnect } from "../dialog-provider"
|
|
32
32
|
import { DialogAlert } from "../../ui/dialog-alert"
|
|
33
33
|
import { useToast } from "../../ui/toast"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "path"
|
|
2
|
-
import { Global } from "
|
|
3
|
-
import { Filesystem } from "
|
|
2
|
+
import { Global } from "../../../../../global"
|
|
3
|
+
import { Filesystem } from "../../../../../util/filesystem"
|
|
4
4
|
import { onMount } from "solid-js"
|
|
5
5
|
import { createStore, produce, unwrap } from "solid-js/store"
|
|
6
6
|
import { createSimpleContext } from "../../context/helper"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createMemo } from "solid-js"
|
|
2
2
|
import type { KeyBinding } from "@opentui/core"
|
|
3
3
|
import { useKeybind } from "../context/keybind"
|
|
4
|
-
import { Keybind } from "
|
|
4
|
+
import { Keybind } from "../../../../util/keybind"
|
|
5
5
|
|
|
6
6
|
const TEXTAREA_ACTIONS = [
|
|
7
7
|
"submit",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createMemo, createSignal, For } from "solid-js"
|
|
2
|
-
import { DEFAULT_THEMES, useTheme } from "
|
|
2
|
+
import { DEFAULT_THEMES, useTheme } from "../context/theme"
|
|
3
3
|
|
|
4
4
|
const themeCount = Object.keys(DEFAULT_THEMES).length
|
|
5
5
|
const themeTip = `Use {highlight}/themes{/highlight} or {highlight}Ctrl+X T{/highlight} to switch between ${themeCount} built-in themes`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRenderer } from "@opentui/solid"
|
|
2
2
|
import { createSimpleContext } from "./helper"
|
|
3
|
-
import { FormatError, FormatUnknownError } from "
|
|
3
|
+
import { FormatError, FormatUnknownError } from "../../../error"
|
|
4
4
|
import { win32FlushInputBuffer } from "../win32"
|
|
5
5
|
type Exit = ((reason?: unknown) => Promise<void>) & {
|
|
6
6
|
message: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createMemo } from "solid-js"
|
|
2
|
-
import { Keybind } from "
|
|
2
|
+
import { Keybind } from "../../../../util/keybind"
|
|
3
3
|
import { pipe, mapValues } from "remeda"
|
|
4
|
-
import type { TuiConfig } from "
|
|
4
|
+
import type { TuiConfig } from "../../../../config/tui"
|
|
5
5
|
import type { ParsedKey, Renderable } from "@opentui/core"
|
|
6
6
|
import { createStore } from "solid-js/store"
|
|
7
7
|
import { useKeyboard, useRenderer } from "@opentui/solid"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Global } from "
|
|
2
|
-
import { Filesystem } from "
|
|
1
|
+
import { Global } from "../../../../global"
|
|
2
|
+
import { Filesystem } from "../../../../util/filesystem"
|
|
3
3
|
import { createSignal, type Setter } from "solid-js"
|
|
4
4
|
import { createStore } from "solid-js/store"
|
|
5
5
|
import { createSimpleContext } from "./helper"
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { createStore } from "solid-js/store"
|
|
2
2
|
import { batch, createEffect, createMemo } from "solid-js"
|
|
3
|
-
import { useSync } from "
|
|
4
|
-
import { useTheme } from "
|
|
3
|
+
import { useSync } from "./sync"
|
|
4
|
+
import { useTheme } from "./theme"
|
|
5
5
|
import { uniqueBy } from "remeda"
|
|
6
6
|
import path from "path"
|
|
7
|
-
import { Global } from "
|
|
8
|
-
import { iife } from "
|
|
7
|
+
import { Global } from "../../../../global"
|
|
8
|
+
import { iife } from "../../../../util/iife"
|
|
9
9
|
import { createSimpleContext } from "./helper"
|
|
10
10
|
import { useToast } from "../ui/toast"
|
|
11
|
-
import { Provider } from "
|
|
11
|
+
import { Provider } from "../../../../provider/provider"
|
|
12
12
|
import { useArgs } from "./args"
|
|
13
13
|
import { useSDK } from "./sdk"
|
|
14
14
|
import { RGBA } from "@opentui/core"
|
|
15
|
-
import { Filesystem } from "
|
|
15
|
+
import { Filesystem } from "../../../../util/filesystem"
|
|
16
16
|
|
|
17
17
|
export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
|
|
18
18
|
name: "Local",
|
|
@@ -19,14 +19,14 @@ import type {
|
|
|
19
19
|
VcsInfo,
|
|
20
20
|
} from "@opencode-ai/sdk/v2"
|
|
21
21
|
import { createStore, produce, reconcile } from "solid-js/store"
|
|
22
|
-
import { useSDK } from "
|
|
23
|
-
import { Binary } from "
|
|
22
|
+
import { useSDK } from "./sdk"
|
|
23
|
+
import { Binary } from "../../../../util/binary"
|
|
24
24
|
import { createSimpleContext } from "./helper"
|
|
25
|
-
import type { Snapshot } from "
|
|
25
|
+
import type { Snapshot } from "../../../../snapshot"
|
|
26
26
|
import { useExit } from "./exit"
|
|
27
27
|
import { useArgs } from "./args"
|
|
28
28
|
import { batch, onMount } from "solid-js"
|
|
29
|
-
import { Log } from "
|
|
29
|
+
import { Log } from "../../../../util/log"
|
|
30
30
|
import type { Path } from "@opencode-ai/sdk"
|
|
31
31
|
|
|
32
32
|
export const { use: useSync, provider: SyncProvider } = createSimpleContext({
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://opencode.ai/theme.json",
|
|
3
|
+
"defs": {
|
|
4
|
+
"darkStep1": "#0a0a0a",
|
|
5
|
+
"darkStep2": "#141414",
|
|
6
|
+
"darkStep3": "#1e1e1e",
|
|
7
|
+
"darkStep4": "#282828",
|
|
8
|
+
"darkStep5": "#323232",
|
|
9
|
+
"darkStep6": "#3c3c3c",
|
|
10
|
+
"darkStep7": "#484848",
|
|
11
|
+
"darkStep8": "#606060",
|
|
12
|
+
"darkStep9": "#fab283",
|
|
13
|
+
"darkStep10": "#ffc09f",
|
|
14
|
+
"darkStep11": "#808080",
|
|
15
|
+
"darkStep12": "#eeeeee",
|
|
16
|
+
"darkSecondary": "#5c9cf5",
|
|
17
|
+
"darkAccent": "#9d7cd8",
|
|
18
|
+
"darkRed": "#e06c75",
|
|
19
|
+
"darkOrange": "#f5a742",
|
|
20
|
+
"darkGreen": "#7fd88f",
|
|
21
|
+
"darkCyan": "#56b6c2",
|
|
22
|
+
"darkYellow": "#e5c07b",
|
|
23
|
+
"lightStep1": "#ffffff",
|
|
24
|
+
"lightStep2": "#fafafa",
|
|
25
|
+
"lightStep3": "#f5f5f5",
|
|
26
|
+
"lightStep4": "#ebebeb",
|
|
27
|
+
"lightStep5": "#e1e1e1",
|
|
28
|
+
"lightStep6": "#d4d4d4",
|
|
29
|
+
"lightStep7": "#b8b8b8",
|
|
30
|
+
"lightStep8": "#a0a0a0",
|
|
31
|
+
"lightStep9": "#3b7dd8",
|
|
32
|
+
"lightStep10": "#2968c3",
|
|
33
|
+
"lightStep11": "#8a8a8a",
|
|
34
|
+
"lightStep12": "#1a1a1a",
|
|
35
|
+
"lightSecondary": "#7b5bb6",
|
|
36
|
+
"lightAccent": "#d68c27",
|
|
37
|
+
"lightRed": "#d1383d",
|
|
38
|
+
"lightOrange": "#d68c27",
|
|
39
|
+
"lightGreen": "#3d9a57",
|
|
40
|
+
"lightCyan": "#318795",
|
|
41
|
+
"lightYellow": "#b0851f"
|
|
42
|
+
},
|
|
43
|
+
"theme": {
|
|
44
|
+
"primary": {
|
|
45
|
+
"dark": "darkStep9",
|
|
46
|
+
"light": "lightStep9"
|
|
47
|
+
},
|
|
48
|
+
"secondary": {
|
|
49
|
+
"dark": "darkSecondary",
|
|
50
|
+
"light": "lightSecondary"
|
|
51
|
+
},
|
|
52
|
+
"accent": {
|
|
53
|
+
"dark": "darkAccent",
|
|
54
|
+
"light": "lightAccent"
|
|
55
|
+
},
|
|
56
|
+
"error": {
|
|
57
|
+
"dark": "darkRed",
|
|
58
|
+
"light": "lightRed"
|
|
59
|
+
},
|
|
60
|
+
"warning": {
|
|
61
|
+
"dark": "darkOrange",
|
|
62
|
+
"light": "lightOrange"
|
|
63
|
+
},
|
|
64
|
+
"success": {
|
|
65
|
+
"dark": "darkGreen",
|
|
66
|
+
"light": "lightGreen"
|
|
67
|
+
},
|
|
68
|
+
"info": {
|
|
69
|
+
"dark": "darkCyan",
|
|
70
|
+
"light": "lightCyan"
|
|
71
|
+
},
|
|
72
|
+
"text": {
|
|
73
|
+
"dark": "darkStep12",
|
|
74
|
+
"light": "lightStep12"
|
|
75
|
+
},
|
|
76
|
+
"textMuted": {
|
|
77
|
+
"dark": "darkStep11",
|
|
78
|
+
"light": "lightStep11"
|
|
79
|
+
},
|
|
80
|
+
"background": {
|
|
81
|
+
"dark": "darkStep1",
|
|
82
|
+
"light": "lightStep1"
|
|
83
|
+
},
|
|
84
|
+
"backgroundPanel": {
|
|
85
|
+
"dark": "darkStep2",
|
|
86
|
+
"light": "lightStep2"
|
|
87
|
+
},
|
|
88
|
+
"backgroundElement": {
|
|
89
|
+
"dark": "darkStep3",
|
|
90
|
+
"light": "lightStep3"
|
|
91
|
+
},
|
|
92
|
+
"border": {
|
|
93
|
+
"dark": "darkStep7",
|
|
94
|
+
"light": "lightStep7"
|
|
95
|
+
},
|
|
96
|
+
"borderActive": {
|
|
97
|
+
"dark": "darkStep8",
|
|
98
|
+
"light": "lightStep8"
|
|
99
|
+
},
|
|
100
|
+
"borderSubtle": {
|
|
101
|
+
"dark": "darkStep6",
|
|
102
|
+
"light": "lightStep6"
|
|
103
|
+
},
|
|
104
|
+
"diffAdded": {
|
|
105
|
+
"dark": "#4fd6be",
|
|
106
|
+
"light": "#1e725c"
|
|
107
|
+
},
|
|
108
|
+
"diffRemoved": {
|
|
109
|
+
"dark": "#c53b53",
|
|
110
|
+
"light": "#c53b53"
|
|
111
|
+
},
|
|
112
|
+
"diffContext": {
|
|
113
|
+
"dark": "#828bb8",
|
|
114
|
+
"light": "#7086b5"
|
|
115
|
+
},
|
|
116
|
+
"diffHunkHeader": {
|
|
117
|
+
"dark": "#828bb8",
|
|
118
|
+
"light": "#7086b5"
|
|
119
|
+
},
|
|
120
|
+
"diffHighlightAdded": {
|
|
121
|
+
"dark": "#b8db87",
|
|
122
|
+
"light": "#4db380"
|
|
123
|
+
},
|
|
124
|
+
"diffHighlightRemoved": {
|
|
125
|
+
"dark": "#e26a75",
|
|
126
|
+
"light": "#f52a65"
|
|
127
|
+
},
|
|
128
|
+
"diffAddedBg": {
|
|
129
|
+
"dark": "#20303b",
|
|
130
|
+
"light": "#d5e5d5"
|
|
131
|
+
},
|
|
132
|
+
"diffRemovedBg": {
|
|
133
|
+
"dark": "#37222c",
|
|
134
|
+
"light": "#f7d8db"
|
|
135
|
+
},
|
|
136
|
+
"diffContextBg": {
|
|
137
|
+
"dark": "darkStep2",
|
|
138
|
+
"light": "lightStep2"
|
|
139
|
+
},
|
|
140
|
+
"diffLineNumber": {
|
|
141
|
+
"dark": "darkStep3",
|
|
142
|
+
"light": "lightStep3"
|
|
143
|
+
},
|
|
144
|
+
"diffAddedLineNumberBg": {
|
|
145
|
+
"dark": "#1b2b34",
|
|
146
|
+
"light": "#c5d5c5"
|
|
147
|
+
},
|
|
148
|
+
"diffRemovedLineNumberBg": {
|
|
149
|
+
"dark": "#2d1f26",
|
|
150
|
+
"light": "#e7c8cb"
|
|
151
|
+
},
|
|
152
|
+
"markdownText": {
|
|
153
|
+
"dark": "darkStep12",
|
|
154
|
+
"light": "lightStep12"
|
|
155
|
+
},
|
|
156
|
+
"markdownHeading": {
|
|
157
|
+
"dark": "darkAccent",
|
|
158
|
+
"light": "lightAccent"
|
|
159
|
+
},
|
|
160
|
+
"markdownLink": {
|
|
161
|
+
"dark": "darkStep9",
|
|
162
|
+
"light": "lightStep9"
|
|
163
|
+
},
|
|
164
|
+
"markdownLinkText": {
|
|
165
|
+
"dark": "darkCyan",
|
|
166
|
+
"light": "lightCyan"
|
|
167
|
+
},
|
|
168
|
+
"markdownCode": {
|
|
169
|
+
"dark": "darkGreen",
|
|
170
|
+
"light": "lightGreen"
|
|
171
|
+
},
|
|
172
|
+
"markdownBlockQuote": {
|
|
173
|
+
"dark": "darkYellow",
|
|
174
|
+
"light": "lightYellow"
|
|
175
|
+
},
|
|
176
|
+
"markdownEmph": {
|
|
177
|
+
"dark": "darkYellow",
|
|
178
|
+
"light": "lightYellow"
|
|
179
|
+
},
|
|
180
|
+
"markdownStrong": {
|
|
181
|
+
"dark": "darkOrange",
|
|
182
|
+
"light": "lightOrange"
|
|
183
|
+
},
|
|
184
|
+
"markdownHorizontalRule": {
|
|
185
|
+
"dark": "darkStep11",
|
|
186
|
+
"light": "lightStep11"
|
|
187
|
+
},
|
|
188
|
+
"markdownListItem": {
|
|
189
|
+
"dark": "darkStep9",
|
|
190
|
+
"light": "lightStep9"
|
|
191
|
+
},
|
|
192
|
+
"markdownListEnumeration": {
|
|
193
|
+
"dark": "darkCyan",
|
|
194
|
+
"light": "lightCyan"
|
|
195
|
+
},
|
|
196
|
+
"markdownImage": {
|
|
197
|
+
"dark": "darkStep9",
|
|
198
|
+
"light": "lightStep9"
|
|
199
|
+
},
|
|
200
|
+
"markdownImageText": {
|
|
201
|
+
"dark": "darkCyan",
|
|
202
|
+
"light": "lightCyan"
|
|
203
|
+
},
|
|
204
|
+
"markdownCodeBlock": {
|
|
205
|
+
"dark": "darkStep12",
|
|
206
|
+
"light": "lightStep12"
|
|
207
|
+
},
|
|
208
|
+
"syntaxComment": {
|
|
209
|
+
"dark": "darkStep11",
|
|
210
|
+
"light": "lightStep11"
|
|
211
|
+
},
|
|
212
|
+
"syntaxKeyword": {
|
|
213
|
+
"dark": "darkAccent",
|
|
214
|
+
"light": "lightAccent"
|
|
215
|
+
},
|
|
216
|
+
"syntaxFunction": {
|
|
217
|
+
"dark": "darkStep9",
|
|
218
|
+
"light": "lightStep9"
|
|
219
|
+
},
|
|
220
|
+
"syntaxVariable": {
|
|
221
|
+
"dark": "darkRed",
|
|
222
|
+
"light": "lightRed"
|
|
223
|
+
},
|
|
224
|
+
"syntaxString": {
|
|
225
|
+
"dark": "darkGreen",
|
|
226
|
+
"light": "lightGreen"
|
|
227
|
+
},
|
|
228
|
+
"syntaxNumber": {
|
|
229
|
+
"dark": "darkOrange",
|
|
230
|
+
"light": "lightOrange"
|
|
231
|
+
},
|
|
232
|
+
"syntaxType": {
|
|
233
|
+
"dark": "darkYellow",
|
|
234
|
+
"light": "lightYellow"
|
|
235
|
+
},
|
|
236
|
+
"syntaxOperator": {
|
|
237
|
+
"dark": "darkCyan",
|
|
238
|
+
"light": "lightCyan"
|
|
239
|
+
},
|
|
240
|
+
"syntaxPunctuation": {
|
|
241
|
+
"dark": "darkStep12",
|
|
242
|
+
"light": "lightStep12"
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
@@ -39,8 +39,8 @@ import carbonfox from "./theme/carbonfox.json" with { type: "json" }
|
|
|
39
39
|
import { useKV } from "./kv"
|
|
40
40
|
import { useRenderer } from "@opentui/solid"
|
|
41
41
|
import { createStore, produce } from "solid-js/store"
|
|
42
|
-
import { Global } from "
|
|
43
|
-
import { Filesystem } from "
|
|
42
|
+
import { Global } from "../../../../global"
|
|
43
|
+
import { Filesystem } from "../../../../util/filesystem"
|
|
44
44
|
import { useTuiConfig } from "./tui-config"
|
|
45
45
|
|
|
46
46
|
type ThemeColors = {
|
package/src/cli/cmd/tui/event.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { Prompt, type PromptRef } from "
|
|
1
|
+
import { Prompt, type PromptRef } from "../component/prompt"
|
|
2
2
|
import { createMemo, Match, onMount, Show, Switch } from "solid-js"
|
|
3
|
-
import { useTheme } from "
|
|
4
|
-
import { useKeybind } from "
|
|
3
|
+
import { useTheme } from "../context/theme"
|
|
4
|
+
import { useKeybind } from "../context/keybind"
|
|
5
5
|
import { Logo } from "../component/logo"
|
|
6
6
|
import { Tips } from "../component/tips"
|
|
7
|
-
import { Locale } from "
|
|
7
|
+
import { Locale } from "../../../../util/locale"
|
|
8
8
|
import { useSync } from "../context/sync"
|
|
9
9
|
import { Toast } from "../ui/toast"
|
|
10
10
|
import { useArgs } from "../context/args"
|
|
11
11
|
import { useDirectory } from "../context/directory"
|
|
12
|
-
import { useRouteData } from "
|
|
12
|
+
import { useRouteData } from "../context/route"
|
|
13
13
|
import { usePromptRef } from "../context/prompt"
|
|
14
|
-
import { Installation } from "
|
|
14
|
+
import { Installation } from "../../../../installation"
|
|
15
15
|
import { useKV } from "../context/kv"
|
|
16
16
|
import { useCommandDialog } from "../component/dialog-command"
|
|
17
17
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createMemo, onMount } from "solid-js"
|
|
2
|
-
import { useSync } from "
|
|
3
|
-
import { DialogSelect, type DialogSelectOption } from "
|
|
2
|
+
import { useSync } from "../../context/sync"
|
|
3
|
+
import { DialogSelect, type DialogSelectOption } from "../../ui/dialog-select"
|
|
4
4
|
import type { TextPart } from "@opencode-ai/sdk/v2"
|
|
5
|
-
import { Locale } from "
|
|
6
|
-
import { useSDK } from "
|
|
7
|
-
import { useRoute } from "
|
|
5
|
+
import { Locale } from "../../../../../util/locale"
|
|
6
|
+
import { useSDK } from "../../context/sdk"
|
|
7
|
+
import { useRoute } from "../../context/route"
|
|
8
8
|
import { useDialog } from "../../ui/dialog"
|
|
9
|
-
import type { PromptInfo } from "
|
|
9
|
+
import type { PromptInfo } from "../../component/prompt/history"
|
|
10
10
|
|
|
11
11
|
export function DialogForkFromTimeline(props: { sessionID: string; onMove: (messageID: string) => void }) {
|
|
12
12
|
const sync = useSync()
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createMemo } from "solid-js"
|
|
2
|
-
import { useSync } from "
|
|
3
|
-
import { DialogSelect } from "
|
|
4
|
-
import { useSDK } from "
|
|
5
|
-
import { useRoute } from "
|
|
6
|
-
import { Clipboard } from "
|
|
7
|
-
import type { PromptInfo } from "
|
|
2
|
+
import { useSync } from "../../context/sync"
|
|
3
|
+
import { DialogSelect } from "../../ui/dialog-select"
|
|
4
|
+
import { useSDK } from "../../context/sdk"
|
|
5
|
+
import { useRoute } from "../../context/route"
|
|
6
|
+
import { Clipboard } from "../../util/clipboard"
|
|
7
|
+
import type { PromptInfo } from "../../component/prompt/history"
|
|
8
8
|
|
|
9
9
|
export function DialogMessage(props: {
|
|
10
10
|
messageID: string
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DialogSelect } from "
|
|
2
|
-
import { useRoute } from "
|
|
1
|
+
import { DialogSelect } from "../../ui/dialog-select"
|
|
2
|
+
import { useRoute } from "../../context/route"
|
|
3
3
|
|
|
4
4
|
export function DialogSubagent(props: { sessionID: string }) {
|
|
5
5
|
const route = useRoute()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createMemo, onMount } from "solid-js"
|
|
2
|
-
import { useSync } from "
|
|
3
|
-
import { DialogSelect, type DialogSelectOption } from "
|
|
2
|
+
import { useSync } from "../../context/sync"
|
|
3
|
+
import { DialogSelect, type DialogSelectOption } from "../../ui/dialog-select"
|
|
4
4
|
import type { TextPart } from "@opencode-ai/sdk/v2"
|
|
5
|
-
import { Locale } from "
|
|
5
|
+
import { Locale } from "../../../../../util/locale"
|
|
6
6
|
import { DialogMessage } from "./dialog-message"
|
|
7
7
|
import { useDialog } from "../../ui/dialog"
|
|
8
8
|
import type { PromptInfo } from "../../component/prompt/history"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type Accessor, createMemo, createSignal, Match, Show, Switch } from "solid-js"
|
|
2
|
-
import { useRouteData } from "
|
|
3
|
-
import { useSync } from "
|
|
2
|
+
import { useRouteData } from "../../context/route"
|
|
3
|
+
import { useSync } from "../../context/sync"
|
|
4
4
|
import { pipe, sumBy } from "remeda"
|
|
5
|
-
import { useTheme } from "
|
|
6
|
-
import { SplitBorder } from "
|
|
5
|
+
import { useTheme } from "../../context/theme"
|
|
6
|
+
import { SplitBorder } from "../../component/border"
|
|
7
7
|
import type { AssistantMessage, Session } from "@opencode-ai/sdk/v2"
|
|
8
|
-
import { useCommandDialog } from "
|
|
8
|
+
import { useCommandDialog } from "../../component/dialog-command"
|
|
9
9
|
import { useKeybind } from "../../context/keybind"
|
|
10
10
|
import { useTerminalDimensions } from "@opentui/solid"
|
|
11
11
|
|