mirror of
https://github.com/anomalyco/opencode.git
synced 2026-03-14 02:34:24 +00:00
Compare commits
6 Commits
startup
...
effect-aut
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
87a6c54226 | ||
|
|
1739817ee7 | ||
|
|
11e2c85336 | ||
|
|
201e80956a | ||
|
|
7f12976ea0 | ||
|
|
f7259617e5 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -17,7 +17,7 @@ ts-dist
|
||||
/result
|
||||
refs
|
||||
Session.vim
|
||||
/opencode.json
|
||||
opencode.json
|
||||
a.out
|
||||
target
|
||||
.scripts
|
||||
|
||||
@@ -176,25 +176,6 @@ await page.keyboard.press(`${modKey}+Comma`) // Open settings
|
||||
- These helpers use the fixture-enabled test-only terminal driver and wait for output after the terminal writer settles.
|
||||
- Avoid `waitForTimeout` and custom DOM or `data-*` readiness checks.
|
||||
|
||||
### Wait on state
|
||||
|
||||
- Never use wall-clock waits like `page.waitForTimeout(...)` to make a test pass
|
||||
- Avoid race-prone flows that assume work is finished after an action
|
||||
- Wait or poll on observable state with `expect(...)`, `expect.poll(...)`, or existing helpers
|
||||
- Prefer locator assertions like `toBeVisible()`, `toHaveCount(0)`, and `toHaveAttribute(...)` for normal UI state, and reserve `expect.poll(...)` for probe, mock, or backend state
|
||||
|
||||
### Add hooks
|
||||
|
||||
- If required state is not observable from the UI, add a small test-only driver or probe in app code instead of sleeps or fragile DOM checks
|
||||
- Keep these hooks minimal and purpose-built, following the style of `packages/app/src/testing/terminal.ts`
|
||||
- Test-only hooks must be inert unless explicitly enabled; do not add normal-runtime listeners, reactive subscriptions, or per-update allocations for e2e ceremony
|
||||
- When mocking routes or APIs, expose explicit mock state and wait on that before asserting post-action UI
|
||||
|
||||
### Prefer helpers
|
||||
|
||||
- Prefer fluent helpers and drivers when they make intent obvious and reduce locator-heavy noise
|
||||
- Use direct locators when the interaction is simple and a helper would not add clarity
|
||||
|
||||
## Writing New Tests
|
||||
|
||||
1. Choose appropriate folder or create new one
|
||||
|
||||
@@ -36,22 +36,6 @@ async function terminalID(term: Locator) {
|
||||
throw new Error(`Active terminal missing ${terminalAttr}`)
|
||||
}
|
||||
|
||||
export async function terminalConnects(page: Page, input?: { term?: Locator }) {
|
||||
const term = input?.term ?? page.locator(terminalSelector).first()
|
||||
const id = await terminalID(term)
|
||||
return page.evaluate((id) => {
|
||||
return (window as E2EWindow).__opencode_e2e?.terminal?.terminals?.[id]?.connects ?? 0
|
||||
}, id)
|
||||
}
|
||||
|
||||
export async function disconnectTerminal(page: Page, input?: { term?: Locator }) {
|
||||
const term = input?.term ?? page.locator(terminalSelector).first()
|
||||
const id = await terminalID(term)
|
||||
await page.evaluate((id) => {
|
||||
;(window as E2EWindow).__opencode_e2e?.terminal?.controls?.[id]?.disconnect?.()
|
||||
}, id)
|
||||
}
|
||||
|
||||
async function terminalReady(page: Page, term?: Locator) {
|
||||
const next = term ?? page.locator(terminalSelector).first()
|
||||
const id = await terminalID(next)
|
||||
@@ -604,19 +588,12 @@ export async function seedSessionTask(
|
||||
.flatMap((message) => message.parts)
|
||||
.find((part) => {
|
||||
if (part.type !== "tool" || part.tool !== "task") return false
|
||||
if (!("state" in part) || !part.state || typeof part.state !== "object") return false
|
||||
if (!("input" in part.state) || !part.state.input || typeof part.state.input !== "object") return false
|
||||
if (!("description" in part.state.input) || part.state.input.description !== input.description) return false
|
||||
if (!("metadata" in part.state) || !part.state.metadata || typeof part.state.metadata !== "object")
|
||||
return false
|
||||
if (!("sessionId" in part.state.metadata)) return false
|
||||
return typeof part.state.metadata.sessionId === "string" && part.state.metadata.sessionId.length > 0
|
||||
if (part.state.input?.description !== input.description) return false
|
||||
return typeof part.state.metadata?.sessionId === "string" && part.state.metadata.sessionId.length > 0
|
||||
})
|
||||
|
||||
if (!part || !("state" in part) || !part.state || typeof part.state !== "object") return
|
||||
if (!("metadata" in part.state) || !part.state.metadata || typeof part.state.metadata !== "object") return
|
||||
if (!("sessionId" in part.state.metadata)) return
|
||||
const id = part.state.metadata.sessionId
|
||||
if (!part) return
|
||||
const id = part.state.metadata?.sessionId
|
||||
if (typeof id !== "string" || !id) return
|
||||
const child = await sdk.session
|
||||
.get({ sessionID: id })
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
import { test, expect } from "../fixtures"
|
||||
import {
|
||||
composerEvent,
|
||||
type ComposerDriverState,
|
||||
type ComposerProbeState,
|
||||
type ComposerWindow,
|
||||
} from "../../src/testing/session-composer"
|
||||
import { cleanupSession, clearSessionDockSeed, seedSessionQuestion } from "../actions"
|
||||
import { cleanupSession, clearSessionDockSeed, seedSessionQuestion, seedSessionTodos } from "../actions"
|
||||
import {
|
||||
permissionDockSelector,
|
||||
promptSelector,
|
||||
questionDockSelector,
|
||||
sessionComposerDockSelector,
|
||||
sessionTodoDockSelector,
|
||||
sessionTodoListSelector,
|
||||
sessionTodoToggleButtonSelector,
|
||||
} from "../selectors"
|
||||
|
||||
@@ -46,8 +42,12 @@ async function withDockSeed<T>(sdk: Sdk, sessionID: string, fn: () => Promise<T>
|
||||
|
||||
async function clearPermissionDock(page: any, label: RegExp) {
|
||||
const dock = page.locator(permissionDockSelector)
|
||||
await expect(dock).toBeVisible()
|
||||
await dock.getByRole("button", { name: label }).click()
|
||||
for (let i = 0; i < 3; i++) {
|
||||
const count = await dock.count()
|
||||
if (count === 0) return
|
||||
await dock.getByRole("button", { name: label }).click()
|
||||
await page.waitForTimeout(150)
|
||||
}
|
||||
}
|
||||
|
||||
async function setAutoAccept(page: any, enabled: boolean) {
|
||||
@@ -59,120 +59,6 @@ async function setAutoAccept(page: any, enabled: boolean) {
|
||||
await expect(button).toHaveAttribute("aria-pressed", enabled ? "true" : "false")
|
||||
}
|
||||
|
||||
async function expectQuestionBlocked(page: any) {
|
||||
await expect(page.locator(questionDockSelector)).toBeVisible()
|
||||
await expect(page.locator(promptSelector)).toHaveCount(0)
|
||||
}
|
||||
|
||||
async function expectQuestionOpen(page: any) {
|
||||
await expect(page.locator(questionDockSelector)).toHaveCount(0)
|
||||
await expect(page.locator(promptSelector)).toBeVisible()
|
||||
}
|
||||
|
||||
async function expectPermissionBlocked(page: any) {
|
||||
await expect(page.locator(permissionDockSelector)).toBeVisible()
|
||||
await expect(page.locator(promptSelector)).toHaveCount(0)
|
||||
}
|
||||
|
||||
async function expectPermissionOpen(page: any) {
|
||||
await expect(page.locator(permissionDockSelector)).toHaveCount(0)
|
||||
await expect(page.locator(promptSelector)).toBeVisible()
|
||||
}
|
||||
|
||||
async function todoDock(page: any, sessionID: string) {
|
||||
await page.addInitScript(() => {
|
||||
const win = window as ComposerWindow
|
||||
win.__opencode_e2e = {
|
||||
...win.__opencode_e2e,
|
||||
composer: {
|
||||
enabled: true,
|
||||
sessions: {},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
const write = async (driver: ComposerDriverState | undefined) => {
|
||||
await page.evaluate(
|
||||
(input) => {
|
||||
const win = window as ComposerWindow
|
||||
const composer = win.__opencode_e2e?.composer
|
||||
if (!composer?.enabled) throw new Error("Composer e2e driver is not enabled")
|
||||
composer.sessions ??= {}
|
||||
const prev = composer.sessions[input.sessionID] ?? {}
|
||||
if (!input.driver) {
|
||||
if (!prev.probe) {
|
||||
delete composer.sessions[input.sessionID]
|
||||
} else {
|
||||
composer.sessions[input.sessionID] = { probe: prev.probe }
|
||||
}
|
||||
} else {
|
||||
composer.sessions[input.sessionID] = {
|
||||
...prev,
|
||||
driver: input.driver,
|
||||
}
|
||||
}
|
||||
window.dispatchEvent(new CustomEvent(input.event, { detail: { sessionID: input.sessionID } }))
|
||||
},
|
||||
{ event: composerEvent, sessionID, driver },
|
||||
)
|
||||
}
|
||||
|
||||
const read = () =>
|
||||
page.evaluate((sessionID) => {
|
||||
const win = window as ComposerWindow
|
||||
return win.__opencode_e2e?.composer?.sessions?.[sessionID]?.probe ?? null
|
||||
}, sessionID) as Promise<ComposerProbeState | null>
|
||||
|
||||
const api = {
|
||||
async clear() {
|
||||
await write(undefined)
|
||||
return api
|
||||
},
|
||||
async open(todos: NonNullable<ComposerDriverState["todos"]>) {
|
||||
await write({ live: true, todos })
|
||||
return api
|
||||
},
|
||||
async finish(todos: NonNullable<ComposerDriverState["todos"]>) {
|
||||
await write({ live: false, todos })
|
||||
return api
|
||||
},
|
||||
async expectOpen(states: ComposerProbeState["states"]) {
|
||||
await expect.poll(read, { timeout: 10_000 }).toMatchObject({
|
||||
mounted: true,
|
||||
collapsed: false,
|
||||
hidden: false,
|
||||
count: states.length,
|
||||
states,
|
||||
})
|
||||
return api
|
||||
},
|
||||
async expectCollapsed(states: ComposerProbeState["states"]) {
|
||||
await expect.poll(read, { timeout: 10_000 }).toMatchObject({
|
||||
mounted: true,
|
||||
collapsed: true,
|
||||
hidden: true,
|
||||
count: states.length,
|
||||
states,
|
||||
})
|
||||
return api
|
||||
},
|
||||
async expectClosed() {
|
||||
await expect.poll(read, { timeout: 10_000 }).toMatchObject({ mounted: false })
|
||||
return api
|
||||
},
|
||||
async collapse() {
|
||||
await page.locator(sessionTodoToggleButtonSelector).click()
|
||||
return api
|
||||
},
|
||||
async expand() {
|
||||
await page.locator(sessionTodoToggleButtonSelector).click()
|
||||
return api
|
||||
},
|
||||
}
|
||||
|
||||
return api
|
||||
}
|
||||
|
||||
async function withMockPermission<T>(
|
||||
page: any,
|
||||
request: {
|
||||
@@ -184,7 +70,7 @@ async function withMockPermission<T>(
|
||||
always?: string[]
|
||||
},
|
||||
opts: { child?: any } | undefined,
|
||||
fn: (state: { resolved: () => Promise<void> }) => Promise<T>,
|
||||
fn: () => Promise<T>,
|
||||
) {
|
||||
let pending = [
|
||||
{
|
||||
@@ -233,14 +119,8 @@ async function withMockPermission<T>(
|
||||
|
||||
if (sessionList) await page.route("**/session?*", sessionList)
|
||||
|
||||
const state = {
|
||||
async resolved() {
|
||||
await expect.poll(() => pending.length, { timeout: 10_000 }).toBe(0)
|
||||
},
|
||||
}
|
||||
|
||||
try {
|
||||
return await fn(state)
|
||||
return await fn()
|
||||
} finally {
|
||||
await page.unroute("**/permission", list)
|
||||
await page.unroute("**/session/*/permissions/*", reply)
|
||||
@@ -293,12 +173,14 @@ test("blocked question flow unblocks after submit", async ({ page, sdk, gotoSess
|
||||
})
|
||||
|
||||
const dock = page.locator(questionDockSelector)
|
||||
await expectQuestionBlocked(page)
|
||||
await expect.poll(() => dock.count(), { timeout: 10_000 }).toBe(1)
|
||||
await expect(page.locator(promptSelector)).toHaveCount(0)
|
||||
|
||||
await dock.locator('[data-slot="question-option"]').first().click()
|
||||
await dock.getByRole("button", { name: /submit/i }).click()
|
||||
|
||||
await expectQuestionOpen(page)
|
||||
await expect.poll(() => page.locator(questionDockSelector).count(), { timeout: 10_000 }).toBe(0)
|
||||
await expect(page.locator(promptSelector)).toBeVisible()
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -317,14 +199,15 @@ test("blocked permission flow supports allow once", async ({ page, sdk, gotoSess
|
||||
metadata: { description: "Need permission for command" },
|
||||
},
|
||||
undefined,
|
||||
async (state) => {
|
||||
async () => {
|
||||
await page.goto(page.url())
|
||||
await expectPermissionBlocked(page)
|
||||
await expect.poll(() => page.locator(permissionDockSelector).count(), { timeout: 10_000 }).toBe(1)
|
||||
await expect(page.locator(promptSelector)).toHaveCount(0)
|
||||
|
||||
await clearPermissionDock(page, /allow once/i)
|
||||
await state.resolved()
|
||||
await page.goto(page.url())
|
||||
await expectPermissionOpen(page)
|
||||
await expect.poll(() => page.locator(permissionDockSelector).count(), { timeout: 10_000 }).toBe(0)
|
||||
await expect(page.locator(promptSelector)).toBeVisible()
|
||||
},
|
||||
)
|
||||
})
|
||||
@@ -343,14 +226,15 @@ test("blocked permission flow supports reject", async ({ page, sdk, gotoSession
|
||||
patterns: ["/tmp/opencode-e2e-perm-reject"],
|
||||
},
|
||||
undefined,
|
||||
async (state) => {
|
||||
async () => {
|
||||
await page.goto(page.url())
|
||||
await expectPermissionBlocked(page)
|
||||
await expect.poll(() => page.locator(permissionDockSelector).count(), { timeout: 10_000 }).toBe(1)
|
||||
await expect(page.locator(promptSelector)).toHaveCount(0)
|
||||
|
||||
await clearPermissionDock(page, /deny/i)
|
||||
await state.resolved()
|
||||
await page.goto(page.url())
|
||||
await expectPermissionOpen(page)
|
||||
await expect.poll(() => page.locator(permissionDockSelector).count(), { timeout: 10_000 }).toBe(0)
|
||||
await expect(page.locator(promptSelector)).toBeVisible()
|
||||
},
|
||||
)
|
||||
})
|
||||
@@ -370,14 +254,15 @@ test("blocked permission flow supports allow always", async ({ page, sdk, gotoSe
|
||||
metadata: { description: "Need permission for command" },
|
||||
},
|
||||
undefined,
|
||||
async (state) => {
|
||||
async () => {
|
||||
await page.goto(page.url())
|
||||
await expectPermissionBlocked(page)
|
||||
await expect.poll(() => page.locator(permissionDockSelector).count(), { timeout: 10_000 }).toBe(1)
|
||||
await expect(page.locator(promptSelector)).toHaveCount(0)
|
||||
|
||||
await clearPermissionDock(page, /allow always/i)
|
||||
await state.resolved()
|
||||
await page.goto(page.url())
|
||||
await expectPermissionOpen(page)
|
||||
await expect.poll(() => page.locator(permissionDockSelector).count(), { timeout: 10_000 }).toBe(0)
|
||||
await expect(page.locator(promptSelector)).toBeVisible()
|
||||
},
|
||||
)
|
||||
})
|
||||
@@ -416,12 +301,14 @@ test("child session question request blocks parent dock and unblocks after submi
|
||||
})
|
||||
|
||||
const dock = page.locator(questionDockSelector)
|
||||
await expectQuestionBlocked(page)
|
||||
await expect.poll(() => dock.count(), { timeout: 10_000 }).toBe(1)
|
||||
await expect(page.locator(promptSelector)).toHaveCount(0)
|
||||
|
||||
await dock.locator('[data-slot="question-option"]').first().click()
|
||||
await dock.getByRole("button", { name: /submit/i }).click()
|
||||
|
||||
await expectQuestionOpen(page)
|
||||
await expect.poll(() => page.locator(questionDockSelector).count(), { timeout: 10_000 }).toBe(0)
|
||||
await expect(page.locator(promptSelector)).toBeVisible()
|
||||
})
|
||||
} finally {
|
||||
await cleanupSession({ sdk, sessionID: child.id })
|
||||
@@ -457,15 +344,17 @@ test("child session permission request blocks parent dock and supports allow onc
|
||||
metadata: { description: "Need child permission" },
|
||||
},
|
||||
{ child },
|
||||
async (state) => {
|
||||
async () => {
|
||||
await page.goto(page.url())
|
||||
await expectPermissionBlocked(page)
|
||||
const dock = page.locator(permissionDockSelector)
|
||||
await expect.poll(() => dock.count(), { timeout: 10_000 }).toBe(1)
|
||||
await expect(page.locator(promptSelector)).toHaveCount(0)
|
||||
|
||||
await clearPermissionDock(page, /allow once/i)
|
||||
await state.resolved()
|
||||
await page.goto(page.url())
|
||||
|
||||
await expectPermissionOpen(page)
|
||||
await expect.poll(() => page.locator(permissionDockSelector).count(), { timeout: 10_000 }).toBe(0)
|
||||
await expect(page.locator(promptSelector)).toBeVisible()
|
||||
},
|
||||
)
|
||||
} finally {
|
||||
@@ -476,31 +365,36 @@ test("child session permission request blocks parent dock and supports allow onc
|
||||
|
||||
test("todo dock transitions and collapse behavior", async ({ page, sdk, gotoSession }) => {
|
||||
await withDockSession(sdk, "e2e composer dock todo", async (session) => {
|
||||
const dock = await todoDock(page, session.id)
|
||||
await gotoSession(session.id)
|
||||
await expect(page.locator(sessionComposerDockSelector)).toBeVisible()
|
||||
await withDockSeed(sdk, session.id, async () => {
|
||||
await gotoSession(session.id)
|
||||
|
||||
try {
|
||||
await dock.open([
|
||||
{ content: "first task", status: "pending", priority: "high" },
|
||||
{ content: "second task", status: "in_progress", priority: "medium" },
|
||||
])
|
||||
await dock.expectOpen(["pending", "in_progress"])
|
||||
await seedSessionTodos(sdk, {
|
||||
sessionID: session.id,
|
||||
todos: [
|
||||
{ content: "first task", status: "pending", priority: "high" },
|
||||
{ content: "second task", status: "in_progress", priority: "medium" },
|
||||
],
|
||||
})
|
||||
|
||||
await dock.collapse()
|
||||
await dock.expectCollapsed(["pending", "in_progress"])
|
||||
await expect.poll(() => page.locator(sessionTodoDockSelector).count(), { timeout: 10_000 }).toBe(1)
|
||||
await expect(page.locator(sessionTodoListSelector)).toBeVisible()
|
||||
|
||||
await dock.expand()
|
||||
await dock.expectOpen(["pending", "in_progress"])
|
||||
await page.locator(sessionTodoToggleButtonSelector).click()
|
||||
await expect(page.locator(sessionTodoListSelector)).toBeHidden()
|
||||
|
||||
await dock.finish([
|
||||
{ content: "first task", status: "completed", priority: "high" },
|
||||
{ content: "second task", status: "cancelled", priority: "medium" },
|
||||
])
|
||||
await dock.expectClosed()
|
||||
} finally {
|
||||
await dock.clear()
|
||||
}
|
||||
await page.locator(sessionTodoToggleButtonSelector).click()
|
||||
await expect(page.locator(sessionTodoListSelector)).toBeVisible()
|
||||
|
||||
await seedSessionTodos(sdk, {
|
||||
sessionID: session.id,
|
||||
todos: [
|
||||
{ content: "first task", status: "completed", priority: "high" },
|
||||
{ content: "second task", status: "cancelled", priority: "medium" },
|
||||
],
|
||||
})
|
||||
|
||||
await expect.poll(() => page.locator(sessionTodoDockSelector).count(), { timeout: 10_000 }).toBe(0)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -520,7 +414,8 @@ test("keyboard focus stays off prompt while blocked", async ({ page, sdk, gotoSe
|
||||
],
|
||||
})
|
||||
|
||||
await expectQuestionBlocked(page)
|
||||
await expect.poll(() => page.locator(questionDockSelector).count(), { timeout: 10_000 }).toBe(1)
|
||||
await expect(page.locator(promptSelector)).toHaveCount(0)
|
||||
|
||||
await page.locator("main").click({ position: { x: 5, y: 5 } })
|
||||
await page.keyboard.type("abc")
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
import type { Page } from "@playwright/test"
|
||||
import { disconnectTerminal, runTerminal, terminalConnects, waitTerminalReady } from "../actions"
|
||||
import { test, expect } from "../fixtures"
|
||||
import { terminalSelector } from "../selectors"
|
||||
import { terminalToggleKey } from "../utils"
|
||||
|
||||
async function open(page: Page) {
|
||||
const term = page.locator(terminalSelector).first()
|
||||
const visible = await term.isVisible().catch(() => false)
|
||||
if (!visible) await page.keyboard.press(terminalToggleKey)
|
||||
await waitTerminalReady(page, { term })
|
||||
return term
|
||||
}
|
||||
|
||||
test("terminal reconnects without replacing the pty", async ({ page, withProject }) => {
|
||||
await withProject(async ({ gotoSession }) => {
|
||||
const name = `OPENCODE_E2E_RECONNECT_${Date.now()}`
|
||||
const token = `E2E_RECONNECT_${Date.now()}`
|
||||
|
||||
await gotoSession()
|
||||
|
||||
const term = await open(page)
|
||||
const id = await term.getAttribute("data-pty-id")
|
||||
if (!id) throw new Error("Active terminal missing data-pty-id")
|
||||
|
||||
const prev = await terminalConnects(page, { term })
|
||||
|
||||
await runTerminal(page, {
|
||||
term,
|
||||
cmd: `export ${name}=${token}; echo ${token}`,
|
||||
token,
|
||||
})
|
||||
|
||||
await disconnectTerminal(page, { term })
|
||||
|
||||
await expect.poll(() => terminalConnects(page, { term }), { timeout: 15_000 }).toBeGreaterThan(prev)
|
||||
await expect.poll(() => term.getAttribute("data-pty-id"), { timeout: 5_000 }).toBe(id)
|
||||
|
||||
await runTerminal(page, {
|
||||
term,
|
||||
cmd: `echo $${name}`,
|
||||
token,
|
||||
timeout: 15_000,
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -2,8 +2,7 @@
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"noEmit": true,
|
||||
"rootDir": "..",
|
||||
"types": ["node", "bun"]
|
||||
},
|
||||
"include": ["./**/*.ts", "../src/testing/terminal.ts"]
|
||||
"include": ["./**/*.ts"]
|
||||
}
|
||||
|
||||
@@ -73,7 +73,6 @@ const serverEnv = {
|
||||
OPENCODE_E2E_MESSAGE: "Seeded for UI e2e",
|
||||
OPENCODE_E2E_MODEL: "opencode/gpt-5-nano",
|
||||
OPENCODE_CLIENT: "app",
|
||||
OPENCODE_STRICT_CONFIG_DEPS: "true",
|
||||
} satisfies Record<string, string>
|
||||
|
||||
const runnerEnv = {
|
||||
|
||||
@@ -12,7 +12,6 @@ import { type BaseRouterProps, Navigate, Route, Router } from "@solidjs/router"
|
||||
import { type Duration, Effect } from "effect"
|
||||
import {
|
||||
type Component,
|
||||
createMemo,
|
||||
createResource,
|
||||
createSignal,
|
||||
ErrorBoundary,
|
||||
@@ -68,7 +67,7 @@ const SessionIndexRoute = () => <Navigate href="session" />
|
||||
|
||||
function UiI18nBridge(props: ParentProps) {
|
||||
const language = useLanguage()
|
||||
return <I18nProvider value={{ locale: language.intl, t: language.t }}>{props.children}</I18nProvider>
|
||||
return <I18nProvider value={{ locale: language.locale, t: language.t }}>{props.children}</I18nProvider>
|
||||
}
|
||||
|
||||
declare global {
|
||||
@@ -160,7 +159,7 @@ const effectMinDuration =
|
||||
<A, E, R>(e: Effect.Effect<A, E, R>) =>
|
||||
Effect.all([e, Effect.sleep(duration)], { concurrency: "unbounded" }).pipe(Effect.map((v) => v[0]))
|
||||
|
||||
function ConnectionGate(props: ParentProps<{ disableHealthCheck?: boolean }>) {
|
||||
function ConnectionGate(props: ParentProps) {
|
||||
const server = useServer()
|
||||
const checkServerHealth = useCheckServerHealth()
|
||||
|
||||
@@ -169,23 +168,21 @@ function ConnectionGate(props: ParentProps<{ disableHealthCheck?: boolean }>) {
|
||||
// performs repeated health check with a grace period for
|
||||
// non-http connections, otherwise fails instantly
|
||||
const [startupHealthCheck, healthCheckActions] = createResource(() =>
|
||||
props.disableHealthCheck
|
||||
? true
|
||||
: Effect.gen(function* () {
|
||||
if (!server.current) return true
|
||||
const { http, type } = server.current
|
||||
Effect.gen(function* () {
|
||||
if (!server.current) return true
|
||||
const { http, type } = server.current
|
||||
|
||||
while (true) {
|
||||
const res = yield* Effect.promise(() => checkServerHealth(http))
|
||||
if (res.healthy) return true
|
||||
if (checkMode() === "background" || type === "http") return false
|
||||
}
|
||||
}).pipe(
|
||||
effectMinDuration(checkMode() === "blocking" ? "1.2 seconds" : 0),
|
||||
Effect.timeoutOrElse({ duration: "10 seconds", onTimeout: () => Effect.succeed(false) }),
|
||||
Effect.ensuring(Effect.sync(() => setCheckMode("background"))),
|
||||
Effect.runPromise,
|
||||
),
|
||||
while (true) {
|
||||
const res = yield* Effect.promise(() => checkServerHealth(http))
|
||||
if (res.healthy) return true
|
||||
if (checkMode() === "background" || type === "http") return false
|
||||
}
|
||||
}).pipe(
|
||||
effectMinDuration(checkMode() === "blocking" ? "1.2 seconds" : 0),
|
||||
Effect.timeoutOrElse({ duration: "10 seconds", onTimeout: () => Effect.succeed(false) }),
|
||||
Effect.ensuring(Effect.sync(() => setCheckMode("background"))),
|
||||
Effect.runPromise,
|
||||
),
|
||||
)
|
||||
|
||||
return (
|
||||
@@ -219,12 +216,8 @@ function ConnectionGate(props: ParentProps<{ disableHealthCheck?: boolean }>) {
|
||||
}
|
||||
|
||||
function ConnectionError(props: { onRetry?: () => void; onServerSelected?: (key: ServerConnection.Key) => void }) {
|
||||
const language = useLanguage()
|
||||
const server = useServer()
|
||||
const others = () => server.list.filter((s) => ServerConnection.key(s) !== server.key)
|
||||
const name = createMemo(() => server.name || server.key)
|
||||
const serverToken = "\u0000server\u0000"
|
||||
const unreachable = createMemo(() => language.t("app.server.unreachable", { server: serverToken }).split(serverToken))
|
||||
|
||||
const timer = setInterval(() => props.onRetry?.(), 1000)
|
||||
onCleanup(() => clearInterval(timer))
|
||||
@@ -234,15 +227,13 @@ function ConnectionError(props: { onRetry?: () => void; onServerSelected?: (key:
|
||||
<div class="flex flex-col items-center max-w-md text-center">
|
||||
<Splash class="w-12 h-15 mb-4" />
|
||||
<p class="text-14-regular text-text-base">
|
||||
{unreachable()[0]}
|
||||
<span class="text-text-strong font-medium">{name()}</span>
|
||||
{unreachable()[1]}
|
||||
Could not reach <span class="text-text-strong font-medium">{server.name || server.key}</span>
|
||||
</p>
|
||||
<p class="mt-1 text-12-regular text-text-weak">{language.t("app.server.retrying")}</p>
|
||||
<p class="mt-1 text-12-regular text-text-weak">Retrying automatically...</p>
|
||||
</div>
|
||||
<Show when={others().length > 0}>
|
||||
<div class="flex flex-col gap-2 w-full max-w-sm">
|
||||
<span class="text-12-regular text-text-base text-center">{language.t("app.server.otherServers")}</span>
|
||||
<span class="text-12-regular text-text-base text-center">Other servers</span>
|
||||
<div class="flex flex-col gap-1 bg-surface-base rounded-lg p-2">
|
||||
<For each={others()}>
|
||||
{(conn) => {
|
||||
@@ -270,11 +261,10 @@ export function AppInterface(props: {
|
||||
defaultServer: ServerConnection.Key
|
||||
servers?: Array<ServerConnection.Any>
|
||||
router?: Component<BaseRouterProps>
|
||||
disableHealthCheck?: boolean
|
||||
}) {
|
||||
return (
|
||||
<ServerProvider defaultServer={props.defaultServer} servers={props.servers}>
|
||||
<ConnectionGate disableHealthCheck={props.disableHealthCheck}>
|
||||
<ConnectionGate>
|
||||
<GlobalSDKProvider>
|
||||
<GlobalSyncProvider>
|
||||
<Dynamic
|
||||
|
||||
@@ -2,7 +2,6 @@ import { useIsRouting, useLocation } from "@solidjs/router"
|
||||
import { batch, createEffect, onCleanup, onMount } from "solid-js"
|
||||
import { createStore } from "solid-js/store"
|
||||
import { Tooltip } from "@opencode-ai/ui/tooltip"
|
||||
import { useLanguage } from "@/context/language"
|
||||
|
||||
type Mem = Performance & {
|
||||
memory?: {
|
||||
@@ -28,17 +27,17 @@ type Obs = PerformanceObserverInit & {
|
||||
const span = 5000
|
||||
|
||||
const ms = (n?: number, d = 0) => {
|
||||
if (n === undefined || Number.isNaN(n)) return
|
||||
if (n === undefined || Number.isNaN(n)) return "n/a"
|
||||
return `${n.toFixed(d)}ms`
|
||||
}
|
||||
|
||||
const time = (n?: number) => {
|
||||
if (n === undefined || Number.isNaN(n)) return
|
||||
if (n === undefined || Number.isNaN(n)) return "n/a"
|
||||
return `${Math.round(n)}`
|
||||
}
|
||||
|
||||
const mb = (n?: number) => {
|
||||
if (n === undefined || Number.isNaN(n)) return
|
||||
if (n === undefined || Number.isNaN(n)) return "n/a"
|
||||
const v = n / 1024 / 1024
|
||||
return `${v >= 1024 ? v.toFixed(0) : v.toFixed(1)}MB`
|
||||
}
|
||||
@@ -75,7 +74,6 @@ function Cell(props: { bad?: boolean; dim?: boolean; label: string; tip: string;
|
||||
}
|
||||
|
||||
export function DebugBar() {
|
||||
const language = useLanguage()
|
||||
const location = useLocation()
|
||||
const routing = useIsRouting()
|
||||
const [state, setState] = createStore({
|
||||
@@ -100,15 +98,14 @@ export function DebugBar() {
|
||||
},
|
||||
})
|
||||
|
||||
const na = () => language.t("debugBar.na")
|
||||
const heap = () => (state.heap.limit ? (state.heap.used ?? 0) / state.heap.limit : undefined)
|
||||
const heapv = () => {
|
||||
const value = heap()
|
||||
if (value === undefined) return na()
|
||||
if (value === undefined) return "n/a"
|
||||
return `${Math.round(value * 100)}%`
|
||||
}
|
||||
const longv = () => (state.long.count === undefined ? na() : `${time(state.long.block) ?? na()}/${state.long.count}`)
|
||||
const navv = () => (state.nav.pending ? "..." : (time(state.nav.dur) ?? na()))
|
||||
const longv = () => (state.long.count === undefined ? "n/a" : `${time(state.long.block)}/${state.long.count}`)
|
||||
const navv = () => (state.nav.pending ? "..." : time(state.nav.dur))
|
||||
|
||||
let prev = ""
|
||||
let start = 0
|
||||
@@ -362,7 +359,7 @@ export function DebugBar() {
|
||||
|
||||
return (
|
||||
<aside
|
||||
aria-label={language.t("debugBar.ariaLabel")}
|
||||
aria-label="Development performance diagnostics"
|
||||
class="pointer-events-auto fixed bottom-3 right-3 z-50 w-[308px] max-w-[calc(100vw-1.5rem)] overflow-hidden rounded-xl border p-0.5 text-text-on-interactive-base shadow-[var(--shadow-lg-border-base)] sm:bottom-4 sm:right-4 sm:w-[324px]"
|
||||
style={{
|
||||
"background-color": "color-mix(in srgb, var(--icon-interactive-base) 42%, black)",
|
||||
@@ -371,70 +368,67 @@ export function DebugBar() {
|
||||
>
|
||||
<div class="grid grid-cols-5 gap-px font-mono">
|
||||
<Cell
|
||||
label={language.t("debugBar.nav.label")}
|
||||
tip={language.t("debugBar.nav.tip")}
|
||||
label="NAV"
|
||||
tip="Last completed route transition touching a session page, measured from router start until the first paint after it settles."
|
||||
value={navv()}
|
||||
bad={bad(state.nav.dur, 400)}
|
||||
dim={state.nav.dur === undefined && !state.nav.pending}
|
||||
/>
|
||||
<Cell
|
||||
label={language.t("debugBar.fps.label")}
|
||||
tip={language.t("debugBar.fps.tip")}
|
||||
value={state.fps === undefined ? na() : `${Math.round(state.fps)}`}
|
||||
label="FPS"
|
||||
tip="Rolling frames per second over the last 5 seconds."
|
||||
value={state.fps === undefined ? "n/a" : `${Math.round(state.fps)}`}
|
||||
bad={bad(state.fps, 50, true)}
|
||||
dim={state.fps === undefined}
|
||||
/>
|
||||
<Cell
|
||||
label={language.t("debugBar.frame.label")}
|
||||
tip={language.t("debugBar.frame.tip")}
|
||||
value={time(state.gap) ?? na()}
|
||||
label="FRAME"
|
||||
tip="Worst frame time over the last 5 seconds."
|
||||
value={time(state.gap)}
|
||||
bad={bad(state.gap, 50)}
|
||||
dim={state.gap === undefined}
|
||||
/>
|
||||
<Cell
|
||||
label={language.t("debugBar.jank.label")}
|
||||
tip={language.t("debugBar.jank.tip")}
|
||||
value={state.jank === undefined ? na() : `${state.jank}`}
|
||||
label="JANK"
|
||||
tip="Frames over 32ms in the last 5 seconds."
|
||||
value={state.jank === undefined ? "n/a" : `${state.jank}`}
|
||||
bad={bad(state.jank, 8)}
|
||||
dim={state.jank === undefined}
|
||||
/>
|
||||
<Cell
|
||||
label={language.t("debugBar.long.label")}
|
||||
tip={language.t("debugBar.long.tip", { max: ms(state.long.max) ?? na() })}
|
||||
label="LONG"
|
||||
tip={`Blocked time and long-task count in the last 5 seconds. Max task: ${ms(state.long.max)}.`}
|
||||
value={longv()}
|
||||
bad={bad(state.long.block, 200)}
|
||||
dim={state.long.count === undefined}
|
||||
/>
|
||||
<Cell
|
||||
label={language.t("debugBar.delay.label")}
|
||||
tip={language.t("debugBar.delay.tip")}
|
||||
value={time(state.delay) ?? na()}
|
||||
label="DELAY"
|
||||
tip="Worst observed input delay in the last 5 seconds."
|
||||
value={time(state.delay)}
|
||||
bad={bad(state.delay, 100)}
|
||||
dim={state.delay === undefined}
|
||||
/>
|
||||
<Cell
|
||||
label={language.t("debugBar.inp.label")}
|
||||
tip={language.t("debugBar.inp.tip")}
|
||||
value={time(state.inp) ?? na()}
|
||||
label="INP"
|
||||
tip="Approximate interaction duration over the last 5 seconds. This is INP-like, not the official Web Vitals INP."
|
||||
value={time(state.inp)}
|
||||
bad={bad(state.inp, 200)}
|
||||
dim={state.inp === undefined}
|
||||
/>
|
||||
<Cell
|
||||
label={language.t("debugBar.cls.label")}
|
||||
tip={language.t("debugBar.cls.tip")}
|
||||
value={state.cls === undefined ? na() : state.cls.toFixed(2)}
|
||||
label="CLS"
|
||||
tip="Cumulative layout shift for the current app lifetime."
|
||||
value={state.cls === undefined ? "n/a" : state.cls.toFixed(2)}
|
||||
bad={bad(state.cls, 0.1)}
|
||||
dim={state.cls === undefined}
|
||||
/>
|
||||
<Cell
|
||||
label={language.t("debugBar.mem.label")}
|
||||
label="MEM"
|
||||
tip={
|
||||
state.heap.used === undefined
|
||||
? language.t("debugBar.mem.tipUnavailable")
|
||||
: language.t("debugBar.mem.tip", {
|
||||
used: mb(state.heap.used) ?? na(),
|
||||
limit: mb(state.heap.limit) ?? na(),
|
||||
})
|
||||
? "Used JS heap vs heap limit. Chromium only."
|
||||
: `Used JS heap vs heap limit. ${mb(state.heap.used)} of ${mb(state.heap.limit)}.`
|
||||
}
|
||||
value={heapv()}
|
||||
bad={bad(heap(), 0.8)}
|
||||
|
||||
@@ -426,7 +426,7 @@ export function DialogSelectFile(props: { mode?: DialogSelectFileMode; onOpenFil
|
||||
</Show>
|
||||
</div>
|
||||
<Show when={item.keybind}>
|
||||
<Keybind class="rounded-[4px]">{formatKeybind(item.keybind ?? "", language.t)}</Keybind>
|
||||
<Keybind class="rounded-[4px]">{formatKeybind(item.keybind ?? "")}</Keybind>
|
||||
</Show>
|
||||
</div>
|
||||
</Match>
|
||||
|
||||
@@ -121,7 +121,7 @@ function ServerForm(props: ServerFormProps) {
|
||||
|
||||
return (
|
||||
<div class="px-5">
|
||||
<div class="bg-surface-base rounded-md p-5 flex flex-col gap-3">
|
||||
<div class="bg-surface-raised-base rounded-md p-5 flex flex-col gap-3">
|
||||
<div class="flex-1 min-w-0 [&_[data-slot=input-wrapper]]:relative">
|
||||
<TextField
|
||||
type="text"
|
||||
@@ -149,7 +149,7 @@ function ServerForm(props: ServerFormProps) {
|
||||
<TextField
|
||||
type="text"
|
||||
label={language.t("dialog.server.add.username")}
|
||||
placeholder={language.t("dialog.server.add.usernamePlaceholder")}
|
||||
placeholder="username"
|
||||
value={props.username}
|
||||
disabled={props.busy}
|
||||
onChange={props.onUsernameChange}
|
||||
@@ -158,7 +158,7 @@ function ServerForm(props: ServerFormProps) {
|
||||
<TextField
|
||||
type="password"
|
||||
label={language.t("dialog.server.add.password")}
|
||||
placeholder={language.t("dialog.server.add.passwordPlaceholder")}
|
||||
placeholder="password"
|
||||
value={props.password}
|
||||
disabled={props.busy}
|
||||
onChange={props.onPasswordChange}
|
||||
@@ -542,7 +542,7 @@ export function DialogSelectServer() {
|
||||
if (x) select(x)
|
||||
}}
|
||||
divider={true}
|
||||
class="px-5 [&_[data-slot=list-search-wrapper]]:w-full [&_[data-slot=list-scroll]]h-[300px] [&_[data-slot=list-scroll]]:overflow-y-auto [&_[data-slot=list-items]]:bg-surface-base [&_[data-slot=list-items]]:rounded-md [&_[data-slot=list-item]]:min-h-14 [&_[data-slot=list-item]]:p-3 [&_[data-slot=list-item]]:!bg-transparent"
|
||||
class="px-5 [&_[data-slot=list-search-wrapper]]:w-full [&_[data-slot=list-scroll]]h-[300px] [&_[data-slot=list-scroll]]:overflow-y-auto [&_[data-slot=list-items]]:bg-surface-raised-base [&_[data-slot=list-items]]:rounded-md [&_[data-slot=list-item]]:min-h-14 [&_[data-slot=list-item]]:p-3 [&_[data-slot=list-item]]:!bg-transparent"
|
||||
>
|
||||
{(i) => {
|
||||
const key = ServerConnection.key(i)
|
||||
|
||||
@@ -38,8 +38,7 @@ import { usePlatform } from "@/context/platform"
|
||||
import { useSessionLayout } from "@/pages/session/session-layout"
|
||||
import { createSessionTabs } from "@/pages/session/helpers"
|
||||
import { createTextFragment, getCursorPosition, setCursorPosition, setRangeEdge } from "./prompt-input/editor-dom"
|
||||
import { createPromptAttachments } from "./prompt-input/attachments"
|
||||
import { ACCEPTED_FILE_TYPES } from "./prompt-input/files"
|
||||
import { createPromptAttachments, ACCEPTED_FILE_TYPES } from "./prompt-input/attachments"
|
||||
import {
|
||||
canNavigateHistoryAtCursor,
|
||||
navigatePromptHistory,
|
||||
@@ -121,8 +120,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
||||
let slashPopoverRef!: HTMLDivElement
|
||||
|
||||
const mirror = { input: false }
|
||||
const inset = 52
|
||||
const space = `${inset}px`
|
||||
const inset = 44
|
||||
|
||||
const scrollCursorIntoView = () => {
|
||||
const container = scrollRef
|
||||
@@ -157,11 +155,8 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
||||
}
|
||||
}
|
||||
|
||||
const queueScroll = (count = 2) => {
|
||||
requestAnimationFrame(() => {
|
||||
scrollCursorIntoView()
|
||||
if (count > 1) queueScroll(count - 1)
|
||||
})
|
||||
const queueScroll = () => {
|
||||
requestAnimationFrame(scrollCursorIntoView)
|
||||
}
|
||||
|
||||
const activeFileTab = createSessionTabs({
|
||||
@@ -1012,7 +1007,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
||||
return true
|
||||
}
|
||||
|
||||
const { addAttachment, removeAttachment, handlePaste } = createPromptAttachments({
|
||||
const { addImageAttachment, removeImageAttachment, handlePaste } = createPromptAttachments({
|
||||
editor: () => editorRef,
|
||||
isFocused,
|
||||
isDialogActive: () => !!dialog.active,
|
||||
@@ -1252,7 +1247,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
||||
onOpen={(attachment) =>
|
||||
dialog.show(() => <ImagePreview src={attachment.dataUrl} alt={attachment.filename} />)
|
||||
}
|
||||
onRemove={removeAttachment}
|
||||
onRemove={removeImageAttachment}
|
||||
removeLabel={language.t("prompt.attachment.remove")}
|
||||
/>
|
||||
<div
|
||||
@@ -1270,11 +1265,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
||||
editorRef?.focus()
|
||||
}}
|
||||
>
|
||||
<div
|
||||
class="relative max-h-[240px] overflow-y-auto no-scrollbar"
|
||||
ref={(el) => (scrollRef = el)}
|
||||
style={{ "scroll-padding-bottom": space }}
|
||||
>
|
||||
<div class="relative max-h-[240px] overflow-y-auto no-scrollbar" ref={(el) => (scrollRef = el)}>
|
||||
<div
|
||||
data-component="prompt-input"
|
||||
ref={(el) => {
|
||||
@@ -1296,34 +1287,22 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
||||
onKeyDown={handleKeyDown}
|
||||
classList={{
|
||||
"select-text": true,
|
||||
"w-full pl-3 pr-2 pt-2 text-14-regular text-text-strong focus:outline-none whitespace-pre-wrap": true,
|
||||
"w-full pl-3 pr-2 pt-2 pb-11 text-14-regular text-text-strong focus:outline-none whitespace-pre-wrap": true,
|
||||
"[&_[data-type=file]]:text-syntax-property": true,
|
||||
"[&_[data-type=agent]]:text-syntax-type": true,
|
||||
"font-mono!": store.mode === "shell",
|
||||
}}
|
||||
style={{ "padding-bottom": space }}
|
||||
/>
|
||||
<Show when={!prompt.dirty()}>
|
||||
<div
|
||||
class="absolute top-0 inset-x-0 pl-3 pr-2 pt-2 text-14-regular text-text-weak pointer-events-none whitespace-nowrap truncate"
|
||||
class="absolute top-0 inset-x-0 pl-3 pr-2 pt-2 pb-11 text-14-regular text-text-weak pointer-events-none whitespace-nowrap truncate"
|
||||
classList={{ "font-mono!": store.mode === "shell" }}
|
||||
style={{ "padding-bottom": space }}
|
||||
>
|
||||
{placeholder()}
|
||||
</div>
|
||||
</Show>
|
||||
</div>
|
||||
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="pointer-events-none absolute inset-x-0 bottom-0"
|
||||
style={{
|
||||
height: space,
|
||||
background:
|
||||
"linear-gradient(to top, var(--surface-raised-stronger-non-alpha) calc(100% - 20px), transparent)",
|
||||
}}
|
||||
/>
|
||||
|
||||
<div class="pointer-events-none absolute bottom-2 right-2 flex items-center gap-2">
|
||||
<input
|
||||
ref={fileInputRef}
|
||||
@@ -1332,7 +1311,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
||||
class="hidden"
|
||||
onChange={(e) => {
|
||||
const file = e.currentTarget.files?.[0]
|
||||
if (file) void addAttachment(file)
|
||||
if (file) addImageAttachment(file)
|
||||
e.currentTarget.value = ""
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
import { describe, expect, test } from "bun:test"
|
||||
import { attachmentMime } from "./files"
|
||||
|
||||
describe("attachmentMime", () => {
|
||||
test("keeps PDFs when the browser reports the mime", async () => {
|
||||
const file = new File(["%PDF-1.7"], "guide.pdf", { type: "application/pdf" })
|
||||
expect(await attachmentMime(file)).toBe("application/pdf")
|
||||
})
|
||||
|
||||
test("normalizes structured text types to text/plain", async () => {
|
||||
const file = new File(['{"ok":true}\n'], "data.json", { type: "application/json" })
|
||||
expect(await attachmentMime(file)).toBe("text/plain")
|
||||
})
|
||||
|
||||
test("accepts text files even with a misleading browser mime", async () => {
|
||||
const file = new File(["export const x = 1\n"], "main.ts", { type: "video/mp2t" })
|
||||
expect(await attachmentMime(file)).toBe("text/plain")
|
||||
})
|
||||
|
||||
test("rejects binary files", async () => {
|
||||
const file = new File([Uint8Array.of(0, 255, 1, 2)], "blob.bin", { type: "application/octet-stream" })
|
||||
expect(await attachmentMime(file)).toBeUndefined()
|
||||
})
|
||||
})
|
||||
@@ -4,27 +4,12 @@ import { usePrompt, type ContentPart, type ImageAttachmentPart } from "@/context
|
||||
import { useLanguage } from "@/context/language"
|
||||
import { uuid } from "@/utils/uuid"
|
||||
import { getCursorPosition } from "./editor-dom"
|
||||
import { attachmentMime } from "./files"
|
||||
|
||||
export const ACCEPTED_IMAGE_TYPES = ["image/png", "image/jpeg", "image/gif", "image/webp"]
|
||||
export const ACCEPTED_FILE_TYPES = [...ACCEPTED_IMAGE_TYPES, "application/pdf"]
|
||||
const LARGE_PASTE_CHARS = 8000
|
||||
const LARGE_PASTE_BREAKS = 120
|
||||
|
||||
function dataUrl(file: File, mime: string) {
|
||||
return new Promise<string>((resolve) => {
|
||||
const reader = new FileReader()
|
||||
reader.addEventListener("error", () => resolve(""))
|
||||
reader.addEventListener("load", () => {
|
||||
const value = typeof reader.result === "string" ? reader.result : ""
|
||||
const idx = value.indexOf(",")
|
||||
if (idx === -1) {
|
||||
resolve(value)
|
||||
return
|
||||
}
|
||||
resolve(`data:${mime};base64,${value.slice(idx + 1)}`)
|
||||
})
|
||||
reader.readAsDataURL(file)
|
||||
})
|
||||
}
|
||||
|
||||
function largePaste(text: string) {
|
||||
if (text.length >= LARGE_PASTE_CHARS) return true
|
||||
let breaks = 0
|
||||
@@ -50,41 +35,28 @@ export function createPromptAttachments(input: PromptAttachmentsInput) {
|
||||
const prompt = usePrompt()
|
||||
const language = useLanguage()
|
||||
|
||||
const warn = () => {
|
||||
showToast({
|
||||
title: language.t("prompt.toast.pasteUnsupported.title"),
|
||||
description: language.t("prompt.toast.pasteUnsupported.description"),
|
||||
})
|
||||
const addImageAttachment = async (file: File) => {
|
||||
if (!ACCEPTED_FILE_TYPES.includes(file.type)) return
|
||||
|
||||
const reader = new FileReader()
|
||||
reader.onload = () => {
|
||||
const editor = input.editor()
|
||||
if (!editor) return
|
||||
const dataUrl = reader.result as string
|
||||
const attachment: ImageAttachmentPart = {
|
||||
type: "image",
|
||||
id: uuid(),
|
||||
filename: file.name,
|
||||
mime: file.type,
|
||||
dataUrl,
|
||||
}
|
||||
const cursorPosition = prompt.cursor() ?? getCursorPosition(editor)
|
||||
prompt.set([...prompt.current(), attachment], cursorPosition)
|
||||
}
|
||||
reader.readAsDataURL(file)
|
||||
}
|
||||
|
||||
const add = async (file: File, toast = true) => {
|
||||
const mime = await attachmentMime(file)
|
||||
if (!mime) {
|
||||
if (toast) warn()
|
||||
return false
|
||||
}
|
||||
|
||||
const editor = input.editor()
|
||||
if (!editor) return false
|
||||
|
||||
const url = await dataUrl(file, mime)
|
||||
if (!url) return false
|
||||
|
||||
const attachment: ImageAttachmentPart = {
|
||||
type: "image",
|
||||
id: uuid(),
|
||||
filename: file.name,
|
||||
mime,
|
||||
dataUrl: url,
|
||||
}
|
||||
const cursor = prompt.cursor() ?? getCursorPosition(editor)
|
||||
prompt.set([...prompt.current(), attachment], cursor)
|
||||
return true
|
||||
}
|
||||
|
||||
const addAttachment = (file: File) => add(file)
|
||||
|
||||
const removeAttachment = (id: string) => {
|
||||
const removeImageAttachment = (id: string) => {
|
||||
const current = prompt.current()
|
||||
const next = current.filter((part) => part.type !== "image" || part.id !== id)
|
||||
prompt.set(next, prompt.cursor())
|
||||
@@ -100,16 +72,21 @@ export function createPromptAttachments(input: PromptAttachmentsInput) {
|
||||
|
||||
const items = Array.from(clipboardData.items)
|
||||
const fileItems = items.filter((item) => item.kind === "file")
|
||||
const imageItems = fileItems.filter((item) => ACCEPTED_FILE_TYPES.includes(item.type))
|
||||
|
||||
if (imageItems.length > 0) {
|
||||
for (const item of imageItems) {
|
||||
const file = item.getAsFile()
|
||||
if (file) await addImageAttachment(file)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if (fileItems.length > 0) {
|
||||
let found = false
|
||||
for (const item of fileItems) {
|
||||
const file = item.getAsFile()
|
||||
if (!file) continue
|
||||
const ok = await add(file, false)
|
||||
if (ok) found = true
|
||||
}
|
||||
if (!found) warn()
|
||||
showToast({
|
||||
title: language.t("prompt.toast.pasteUnsupported.title"),
|
||||
description: language.t("prompt.toast.pasteUnsupported.description"),
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
@@ -119,7 +96,7 @@ export function createPromptAttachments(input: PromptAttachmentsInput) {
|
||||
if (input.readClipboardImage && !plainText) {
|
||||
const file = await input.readClipboardImage()
|
||||
if (file) {
|
||||
await addAttachment(file)
|
||||
await addImageAttachment(file)
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -176,12 +153,11 @@ export function createPromptAttachments(input: PromptAttachmentsInput) {
|
||||
const dropped = event.dataTransfer?.files
|
||||
if (!dropped) return
|
||||
|
||||
let found = false
|
||||
for (const file of Array.from(dropped)) {
|
||||
const ok = await add(file, false)
|
||||
if (ok) found = true
|
||||
if (ACCEPTED_FILE_TYPES.includes(file.type)) {
|
||||
await addImageAttachment(file)
|
||||
}
|
||||
}
|
||||
if (!found && dropped.length > 0) warn()
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
@@ -197,8 +173,8 @@ export function createPromptAttachments(input: PromptAttachmentsInput) {
|
||||
})
|
||||
|
||||
return {
|
||||
addAttachment,
|
||||
removeAttachment,
|
||||
addImageAttachment,
|
||||
removeImageAttachment,
|
||||
handlePaste,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
export const ACCEPTED_IMAGE_TYPES = ["image/png", "image/jpeg", "image/gif", "image/webp"]
|
||||
|
||||
const IMAGE_MIMES = new Set(ACCEPTED_IMAGE_TYPES)
|
||||
const IMAGE_EXTS = new Map([
|
||||
["gif", "image/gif"],
|
||||
["jpeg", "image/jpeg"],
|
||||
["jpg", "image/jpeg"],
|
||||
["png", "image/png"],
|
||||
["webp", "image/webp"],
|
||||
])
|
||||
const TEXT_MIMES = new Set([
|
||||
"application/json",
|
||||
"application/ld+json",
|
||||
"application/toml",
|
||||
"application/x-toml",
|
||||
"application/x-yaml",
|
||||
"application/xml",
|
||||
"application/yaml",
|
||||
])
|
||||
|
||||
export const ACCEPTED_FILE_TYPES = [
|
||||
...ACCEPTED_IMAGE_TYPES,
|
||||
"application/pdf",
|
||||
"text/*",
|
||||
"application/json",
|
||||
"application/ld+json",
|
||||
"application/toml",
|
||||
"application/x-toml",
|
||||
"application/x-yaml",
|
||||
"application/xml",
|
||||
"application/yaml",
|
||||
".c",
|
||||
".cc",
|
||||
".cjs",
|
||||
".conf",
|
||||
".cpp",
|
||||
".css",
|
||||
".csv",
|
||||
".cts",
|
||||
".env",
|
||||
".go",
|
||||
".gql",
|
||||
".graphql",
|
||||
".h",
|
||||
".hh",
|
||||
".hpp",
|
||||
".htm",
|
||||
".html",
|
||||
".ini",
|
||||
".java",
|
||||
".js",
|
||||
".json",
|
||||
".jsx",
|
||||
".log",
|
||||
".md",
|
||||
".mdx",
|
||||
".mjs",
|
||||
".mts",
|
||||
".py",
|
||||
".rb",
|
||||
".rs",
|
||||
".sass",
|
||||
".scss",
|
||||
".sh",
|
||||
".sql",
|
||||
".toml",
|
||||
".ts",
|
||||
".tsx",
|
||||
".txt",
|
||||
".xml",
|
||||
".yaml",
|
||||
".yml",
|
||||
".zsh",
|
||||
]
|
||||
|
||||
const SAMPLE = 4096
|
||||
|
||||
function kind(type: string) {
|
||||
return type.split(";", 1)[0]?.trim().toLowerCase() ?? ""
|
||||
}
|
||||
|
||||
function ext(name: string) {
|
||||
const idx = name.lastIndexOf(".")
|
||||
if (idx === -1) return ""
|
||||
return name.slice(idx + 1).toLowerCase()
|
||||
}
|
||||
|
||||
function textMime(type: string) {
|
||||
if (!type) return false
|
||||
if (type.startsWith("text/")) return true
|
||||
if (TEXT_MIMES.has(type)) return true
|
||||
if (type.endsWith("+json")) return true
|
||||
return type.endsWith("+xml")
|
||||
}
|
||||
|
||||
function textBytes(bytes: Uint8Array) {
|
||||
if (bytes.length === 0) return true
|
||||
let count = 0
|
||||
for (const byte of bytes) {
|
||||
if (byte === 0) return false
|
||||
if (byte < 9 || (byte > 13 && byte < 32)) count += 1
|
||||
}
|
||||
return count / bytes.length <= 0.3
|
||||
}
|
||||
|
||||
export async function attachmentMime(file: File) {
|
||||
const type = kind(file.type)
|
||||
if (IMAGE_MIMES.has(type)) return type
|
||||
if (type === "application/pdf") return type
|
||||
|
||||
const suffix = ext(file.name)
|
||||
const fallback = IMAGE_EXTS.get(suffix) ?? (suffix === "pdf" ? "application/pdf" : undefined)
|
||||
if ((!type || type === "application/octet-stream") && fallback) return fallback
|
||||
|
||||
if (textMime(type)) return "text/plain"
|
||||
const bytes = new Uint8Array(await file.slice(0, SAMPLE).arrayBuffer())
|
||||
if (!textBytes(bytes)) return
|
||||
return "text/plain"
|
||||
}
|
||||
@@ -7,16 +7,12 @@ const createdClients: string[] = []
|
||||
const createdSessions: string[] = []
|
||||
const enabledAutoAccept: Array<{ sessionID: string; directory: string }> = []
|
||||
const optimistic: Array<{
|
||||
directory?: string
|
||||
sessionID?: string
|
||||
message: {
|
||||
agent: string
|
||||
model: { providerID: string; modelID: string }
|
||||
variant?: string
|
||||
}
|
||||
}> = []
|
||||
const optimisticSeeded: boolean[] = []
|
||||
const storedSessions: Record<string, Array<{ id: string; title?: string }>> = {}
|
||||
const sentShell: string[] = []
|
||||
const syncedDirectories: string[] = []
|
||||
|
||||
@@ -32,12 +28,7 @@ const clientFor = (directory: string) => {
|
||||
session: {
|
||||
create: async () => {
|
||||
createdSessions.push(directory)
|
||||
return {
|
||||
data: {
|
||||
id: `session-${createdSessions.length}`,
|
||||
title: `New session ${createdSessions.length}`,
|
||||
},
|
||||
}
|
||||
return { data: { id: `session-${createdSessions.length}` } }
|
||||
},
|
||||
shell: async () => {
|
||||
sentShell.push(directory)
|
||||
@@ -138,16 +129,9 @@ beforeAll(async () => {
|
||||
session: {
|
||||
optimistic: {
|
||||
add: (value: {
|
||||
directory?: string
|
||||
sessionID?: string
|
||||
message: { agent: string; model: { providerID: string; modelID: string }; variant?: string }
|
||||
}) => {
|
||||
optimistic.push(value)
|
||||
optimisticSeeded.push(
|
||||
!!value.directory &&
|
||||
!!value.sessionID &&
|
||||
!!storedSessions[value.directory]?.find((item) => item.id === value.sessionID)?.title,
|
||||
)
|
||||
},
|
||||
remove: () => undefined,
|
||||
},
|
||||
@@ -160,21 +144,7 @@ beforeAll(async () => {
|
||||
useGlobalSync: () => ({
|
||||
child: (directory: string) => {
|
||||
syncedDirectories.push(directory)
|
||||
storedSessions[directory] ??= []
|
||||
return [
|
||||
{ session: storedSessions[directory] },
|
||||
(...args: unknown[]) => {
|
||||
if (args[0] !== "session") return
|
||||
const next = args[1]
|
||||
if (typeof next === "function") {
|
||||
storedSessions[directory] = next(storedSessions[directory]) as Array<{ id: string; title?: string }>
|
||||
return
|
||||
}
|
||||
if (Array.isArray(next)) {
|
||||
storedSessions[directory] = next as Array<{ id: string; title?: string }>
|
||||
}
|
||||
},
|
||||
]
|
||||
return [{}, () => undefined]
|
||||
},
|
||||
}),
|
||||
}))
|
||||
@@ -200,13 +170,11 @@ beforeEach(() => {
|
||||
createdSessions.length = 0
|
||||
enabledAutoAccept.length = 0
|
||||
optimistic.length = 0
|
||||
optimisticSeeded.length = 0
|
||||
params = {}
|
||||
sentShell.length = 0
|
||||
syncedDirectories.length = 0
|
||||
selected = "/repo/worktree-a"
|
||||
variant = undefined
|
||||
for (const key of Object.keys(storedSessions)) delete storedSessions[key]
|
||||
})
|
||||
|
||||
describe("prompt submit worktree selection", () => {
|
||||
@@ -239,7 +207,7 @@ describe("prompt submit worktree selection", () => {
|
||||
expect(createdClients).toEqual(["/repo/worktree-a", "/repo/worktree-b"])
|
||||
expect(createdSessions).toEqual(["/repo/worktree-a", "/repo/worktree-b"])
|
||||
expect(sentShell).toEqual(["/repo/worktree-a", "/repo/worktree-b"])
|
||||
expect(syncedDirectories).toEqual(["/repo/worktree-a", "/repo/worktree-a", "/repo/worktree-b", "/repo/worktree-b"])
|
||||
expect(syncedDirectories).toEqual(["/repo/worktree-a", "/repo/worktree-b"])
|
||||
})
|
||||
|
||||
test("applies auto-accept to newly created sessions", async () => {
|
||||
@@ -303,32 +271,4 @@ describe("prompt submit worktree selection", () => {
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
test("seeds new sessions before optimistic prompts are added", async () => {
|
||||
const submit = createPromptSubmit({
|
||||
info: () => undefined,
|
||||
imageAttachments: () => [],
|
||||
commentCount: () => 0,
|
||||
autoAccept: () => false,
|
||||
mode: () => "normal",
|
||||
working: () => false,
|
||||
editor: () => undefined,
|
||||
queueScroll: () => undefined,
|
||||
promptLength: (value) => value.reduce((sum, part) => sum + ("content" in part ? part.content.length : 0), 0),
|
||||
addToHistory: () => undefined,
|
||||
resetHistoryNavigation: () => undefined,
|
||||
setMode: () => undefined,
|
||||
setPopover: () => undefined,
|
||||
newSessionWorktree: () => selected,
|
||||
onNewSessionWorktreeReset: () => undefined,
|
||||
onSubmit: () => undefined,
|
||||
})
|
||||
|
||||
const event = { preventDefault: () => undefined } as unknown as Event
|
||||
|
||||
await submit.handleSubmit(event)
|
||||
|
||||
expect(storedSessions["/repo/worktree-a"]).toEqual([{ id: "session-1", title: "New session 1" }])
|
||||
expect(optimisticSeeded).toEqual([true])
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import type { Message, Session } from "@opencode-ai/sdk/v2/client"
|
||||
import type { Message } from "@opencode-ai/sdk/v2/client"
|
||||
import { showToast } from "@opencode-ai/ui/toast"
|
||||
import { base64Encode } from "@opencode-ai/util/encode"
|
||||
import { Binary } from "@opencode-ai/util/binary"
|
||||
import { useNavigate, useParams } from "@solidjs/router"
|
||||
import type { Accessor } from "solid-js"
|
||||
import type { FileSelection } from "@/context/file"
|
||||
@@ -267,20 +266,6 @@ export function createPromptSubmit(input: PromptSubmitInput) {
|
||||
}
|
||||
}
|
||||
|
||||
const seed = (dir: string, info: Session) => {
|
||||
const [, setStore] = globalSync.child(dir)
|
||||
setStore("session", (list: Session[]) => {
|
||||
const result = Binary.search(list, info.id, (item) => item.id)
|
||||
const next = [...list]
|
||||
if (result.found) {
|
||||
next[result.index] = info
|
||||
return next
|
||||
}
|
||||
next.splice(result.index, 0, info)
|
||||
return next
|
||||
})
|
||||
}
|
||||
|
||||
const handleSubmit = async (event: Event) => {
|
||||
event.preventDefault()
|
||||
|
||||
@@ -356,7 +341,7 @@ export function createPromptSubmit(input: PromptSubmitInput) {
|
||||
|
||||
let session = input.info()
|
||||
if (!session && isNewSession) {
|
||||
const created = await client.session
|
||||
session = await client.session
|
||||
.create()
|
||||
.then((x) => x.data ?? undefined)
|
||||
.catch((err) => {
|
||||
@@ -366,9 +351,7 @@ export function createPromptSubmit(input: PromptSubmitInput) {
|
||||
})
|
||||
return undefined
|
||||
})
|
||||
if (created) {
|
||||
seed(sessionDirectory, created)
|
||||
session = created
|
||||
if (session) {
|
||||
if (shouldAutoAccept) permission.enableAutoAccept(session.id, sessionDirectory)
|
||||
layout.handoff.setTabs(base64Encode(sessionDirectory), session.id)
|
||||
navigate(`/${base64Encode(sessionDirectory)}/session/${session.id}`)
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
type ParentProps,
|
||||
Show,
|
||||
} from "solid-js"
|
||||
import { useLanguage } from "@/context/language"
|
||||
import { type ServerConnection, serverName } from "@/context/server"
|
||||
import type { ServerHealth } from "@/utils/server-health"
|
||||
|
||||
@@ -26,7 +25,6 @@ interface ServerRowProps extends ParentProps {
|
||||
}
|
||||
|
||||
export function ServerRow(props: ServerRowProps) {
|
||||
const language = useLanguage()
|
||||
const [truncated, setTruncated] = createSignal(false)
|
||||
let nameRef: HTMLSpanElement | undefined
|
||||
let versionRef: HTMLSpanElement | undefined
|
||||
@@ -102,7 +100,7 @@ export function ServerRow(props: ServerRowProps) {
|
||||
{conn().http.username ? (
|
||||
<span class="text-text-weak">{conn().http.username}</span>
|
||||
) : (
|
||||
<span class="text-text-weaker">{language.t("server.row.noUsername")}</span>
|
||||
<span class="text-text-weaker">no username</span>
|
||||
)}
|
||||
</span>
|
||||
{conn().http.password && <span class="text-text-weak">••••••••</span>}
|
||||
|
||||
@@ -46,63 +46,63 @@ type OS = "macos" | "windows" | "linux" | "unknown"
|
||||
const MAC_APPS = [
|
||||
{
|
||||
id: "vscode",
|
||||
label: "session.header.open.app.vscode",
|
||||
label: "VS Code",
|
||||
icon: "vscode",
|
||||
openWith: "Visual Studio Code",
|
||||
},
|
||||
{ id: "cursor", label: "session.header.open.app.cursor", icon: "cursor", openWith: "Cursor" },
|
||||
{ id: "zed", label: "session.header.open.app.zed", icon: "zed", openWith: "Zed" },
|
||||
{ id: "textmate", label: "session.header.open.app.textmate", icon: "textmate", openWith: "TextMate" },
|
||||
{ id: "cursor", label: "Cursor", icon: "cursor", openWith: "Cursor" },
|
||||
{ id: "zed", label: "Zed", icon: "zed", openWith: "Zed" },
|
||||
{ id: "textmate", label: "TextMate", icon: "textmate", openWith: "TextMate" },
|
||||
{
|
||||
id: "antigravity",
|
||||
label: "session.header.open.app.antigravity",
|
||||
label: "Antigravity",
|
||||
icon: "antigravity",
|
||||
openWith: "Antigravity",
|
||||
},
|
||||
{ id: "terminal", label: "session.header.open.app.terminal", icon: "terminal", openWith: "Terminal" },
|
||||
{ id: "iterm2", label: "session.header.open.app.iterm2", icon: "iterm2", openWith: "iTerm" },
|
||||
{ id: "ghostty", label: "session.header.open.app.ghostty", icon: "ghostty", openWith: "Ghostty" },
|
||||
{ id: "warp", label: "session.header.open.app.warp", icon: "warp", openWith: "Warp" },
|
||||
{ id: "xcode", label: "session.header.open.app.xcode", icon: "xcode", openWith: "Xcode" },
|
||||
{ id: "terminal", label: "Terminal", icon: "terminal", openWith: "Terminal" },
|
||||
{ id: "iterm2", label: "iTerm2", icon: "iterm2", openWith: "iTerm" },
|
||||
{ id: "ghostty", label: "Ghostty", icon: "ghostty", openWith: "Ghostty" },
|
||||
{ id: "warp", label: "Warp", icon: "warp", openWith: "Warp" },
|
||||
{ id: "xcode", label: "Xcode", icon: "xcode", openWith: "Xcode" },
|
||||
{
|
||||
id: "android-studio",
|
||||
label: "session.header.open.app.androidStudio",
|
||||
label: "Android Studio",
|
||||
icon: "android-studio",
|
||||
openWith: "Android Studio",
|
||||
},
|
||||
{
|
||||
id: "sublime-text",
|
||||
label: "session.header.open.app.sublimeText",
|
||||
label: "Sublime Text",
|
||||
icon: "sublime-text",
|
||||
openWith: "Sublime Text",
|
||||
},
|
||||
] as const
|
||||
|
||||
const WINDOWS_APPS = [
|
||||
{ id: "vscode", label: "session.header.open.app.vscode", icon: "vscode", openWith: "code" },
|
||||
{ id: "cursor", label: "session.header.open.app.cursor", icon: "cursor", openWith: "cursor" },
|
||||
{ id: "zed", label: "session.header.open.app.zed", icon: "zed", openWith: "zed" },
|
||||
{ id: "vscode", label: "VS Code", icon: "vscode", openWith: "code" },
|
||||
{ id: "cursor", label: "Cursor", icon: "cursor", openWith: "cursor" },
|
||||
{ id: "zed", label: "Zed", icon: "zed", openWith: "zed" },
|
||||
{
|
||||
id: "powershell",
|
||||
label: "session.header.open.app.powershell",
|
||||
label: "PowerShell",
|
||||
icon: "powershell",
|
||||
openWith: "powershell",
|
||||
},
|
||||
{
|
||||
id: "sublime-text",
|
||||
label: "session.header.open.app.sublimeText",
|
||||
label: "Sublime Text",
|
||||
icon: "sublime-text",
|
||||
openWith: "Sublime Text",
|
||||
},
|
||||
] as const
|
||||
|
||||
const LINUX_APPS = [
|
||||
{ id: "vscode", label: "session.header.open.app.vscode", icon: "vscode", openWith: "code" },
|
||||
{ id: "cursor", label: "session.header.open.app.cursor", icon: "cursor", openWith: "cursor" },
|
||||
{ id: "zed", label: "session.header.open.app.zed", icon: "zed", openWith: "zed" },
|
||||
{ id: "vscode", label: "VS Code", icon: "vscode", openWith: "code" },
|
||||
{ id: "cursor", label: "Cursor", icon: "cursor", openWith: "cursor" },
|
||||
{ id: "zed", label: "Zed", icon: "zed", openWith: "zed" },
|
||||
{
|
||||
id: "sublime-text",
|
||||
label: "session.header.open.app.sublimeText",
|
||||
label: "Sublime Text",
|
||||
icon: "sublime-text",
|
||||
openWith: "Sublime Text",
|
||||
},
|
||||
@@ -160,9 +160,9 @@ export function SessionHeader() {
|
||||
})
|
||||
|
||||
const fileManager = createMemo(() => {
|
||||
if (os() === "macos") return { label: "session.header.open.finder", icon: "finder" as const }
|
||||
if (os() === "windows") return { label: "session.header.open.fileExplorer", icon: "file-explorer" as const }
|
||||
return { label: "session.header.open.fileManager", icon: "finder" as const }
|
||||
if (os() === "macos") return { label: "Finder", icon: "finder" as const }
|
||||
if (os() === "windows") return { label: "File Explorer", icon: "file-explorer" as const }
|
||||
return { label: "File Manager", icon: "finder" as const }
|
||||
})
|
||||
|
||||
createEffect(() => {
|
||||
@@ -187,10 +187,8 @@ export function SessionHeader() {
|
||||
|
||||
const options = createMemo(() => {
|
||||
return [
|
||||
{ id: "finder", label: language.t(fileManager().label), icon: fileManager().icon },
|
||||
...apps()
|
||||
.filter((app) => exists[app.id])
|
||||
.map((app) => ({ ...app, label: language.t(app.label) })),
|
||||
{ id: "finder", label: fileManager().label, icon: fileManager().icon },
|
||||
...apps().filter((app) => exists[app.id]),
|
||||
] as const
|
||||
})
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import { IconButton } from "@opencode-ai/ui/icon-button"
|
||||
import { Tabs } from "@opencode-ai/ui/tabs"
|
||||
import { DropdownMenu } from "@opencode-ai/ui/dropdown-menu"
|
||||
import { Icon } from "@opencode-ai/ui/icon"
|
||||
import { isDefaultTitle as isDefaultTerminalTitle } from "@/context/terminal-title"
|
||||
import { useTerminal, type LocalPTY } from "@/context/terminal"
|
||||
import { useLanguage } from "@/context/language"
|
||||
import { focusTerminalById } from "@/pages/session/helpers"
|
||||
@@ -28,7 +27,11 @@ export function SortableTerminalTab(props: { terminal: LocalPTY; onClose?: () =>
|
||||
const isDefaultTitle = () => {
|
||||
const number = props.terminal.titleNumber
|
||||
if (!Number.isFinite(number) || number <= 0) return false
|
||||
return isDefaultTerminalTitle(props.terminal.title, number)
|
||||
const match = props.terminal.title.match(/^Terminal (\d+)$/)
|
||||
if (!match) return false
|
||||
const parsed = Number(match[1])
|
||||
if (!Number.isFinite(parsed) || parsed <= 0) return false
|
||||
return parsed === number
|
||||
}
|
||||
|
||||
const label = () => {
|
||||
|
||||
@@ -12,7 +12,6 @@ import { usePlatform } from "@/context/platform"
|
||||
import { useSettings, monoFontFamily } from "@/context/settings"
|
||||
import { playSound, SOUND_OPTIONS } from "@/utils/sound"
|
||||
import { Link } from "./link"
|
||||
import { SettingsList } from "./settings-list"
|
||||
|
||||
let demoSoundState = {
|
||||
cleanup: undefined as (() => void) | undefined,
|
||||
@@ -178,7 +177,7 @@ export const SettingsGeneral: Component = () => {
|
||||
|
||||
const GeneralSection = () => (
|
||||
<div class="flex flex-col gap-1">
|
||||
<SettingsList>
|
||||
<div class="bg-surface-raised-base px-4 rounded-lg">
|
||||
<SettingsRow
|
||||
title={language.t("settings.general.row.language.title")}
|
||||
description={language.t("settings.general.row.language.description")}
|
||||
@@ -249,7 +248,7 @@ export const SettingsGeneral: Component = () => {
|
||||
triggerStyle={{ "min-width": "180px" }}
|
||||
/>
|
||||
</SettingsRow>
|
||||
</SettingsList>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -257,7 +256,7 @@ export const SettingsGeneral: Component = () => {
|
||||
<div class="flex flex-col gap-1">
|
||||
<h3 class="text-14-medium text-text-strong pb-2">{language.t("settings.general.section.appearance")}</h3>
|
||||
|
||||
<SettingsList>
|
||||
<div class="bg-surface-raised-base px-4 rounded-lg">
|
||||
<SettingsRow
|
||||
title={language.t("settings.general.row.colorScheme.title")}
|
||||
description={language.t("settings.general.row.colorScheme.description")}
|
||||
@@ -334,7 +333,7 @@ export const SettingsGeneral: Component = () => {
|
||||
)}
|
||||
</Select>
|
||||
</SettingsRow>
|
||||
</SettingsList>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -342,7 +341,7 @@ export const SettingsGeneral: Component = () => {
|
||||
<div class="flex flex-col gap-1">
|
||||
<h3 class="text-14-medium text-text-strong pb-2">{language.t("settings.general.section.notifications")}</h3>
|
||||
|
||||
<SettingsList>
|
||||
<div class="bg-surface-raised-base px-4 rounded-lg">
|
||||
<SettingsRow
|
||||
title={language.t("settings.general.notifications.agent.title")}
|
||||
description={language.t("settings.general.notifications.agent.description")}
|
||||
@@ -378,7 +377,7 @@ export const SettingsGeneral: Component = () => {
|
||||
/>
|
||||
</div>
|
||||
</SettingsRow>
|
||||
</SettingsList>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -386,7 +385,7 @@ export const SettingsGeneral: Component = () => {
|
||||
<div class="flex flex-col gap-1">
|
||||
<h3 class="text-14-medium text-text-strong pb-2">{language.t("settings.general.section.sounds")}</h3>
|
||||
|
||||
<SettingsList>
|
||||
<div class="bg-surface-raised-base px-4 rounded-lg">
|
||||
<SettingsRow
|
||||
title={language.t("settings.general.sounds.agent.title")}
|
||||
description={language.t("settings.general.sounds.agent.description")}
|
||||
@@ -431,7 +430,7 @@ export const SettingsGeneral: Component = () => {
|
||||
)}
|
||||
/>
|
||||
</SettingsRow>
|
||||
</SettingsList>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -439,7 +438,7 @@ export const SettingsGeneral: Component = () => {
|
||||
<div class="flex flex-col gap-1">
|
||||
<h3 class="text-14-medium text-text-strong pb-2">{language.t("settings.general.section.updates")}</h3>
|
||||
|
||||
<SettingsList>
|
||||
<div class="bg-surface-raised-base px-4 rounded-lg">
|
||||
<SettingsRow
|
||||
title={language.t("settings.updates.row.startup.title")}
|
||||
description={language.t("settings.updates.row.startup.description")}
|
||||
@@ -475,7 +474,7 @@ export const SettingsGeneral: Component = () => {
|
||||
: language.t("settings.updates.action.checkNow")}
|
||||
</Button>
|
||||
</SettingsRow>
|
||||
</SettingsList>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -505,7 +504,7 @@ export const SettingsGeneral: Component = () => {
|
||||
<div class="flex flex-col gap-1">
|
||||
<h3 class="text-14-medium text-text-strong pb-2">{language.t("settings.desktop.section.wsl")}</h3>
|
||||
|
||||
<SettingsList>
|
||||
<div class="bg-surface-raised-base px-4 rounded-lg">
|
||||
<SettingsRow
|
||||
title={language.t("settings.desktop.wsl.title")}
|
||||
description={language.t("settings.desktop.wsl.description")}
|
||||
@@ -518,7 +517,7 @@ export const SettingsGeneral: Component = () => {
|
||||
/>
|
||||
</div>
|
||||
</SettingsRow>
|
||||
</SettingsList>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}}
|
||||
@@ -538,7 +537,7 @@ export const SettingsGeneral: Component = () => {
|
||||
<div class="flex flex-col gap-1">
|
||||
<h3 class="text-14-medium text-text-strong pb-2">{language.t("settings.general.section.display")}</h3>
|
||||
|
||||
<SettingsList>
|
||||
<div class="bg-surface-raised-base px-4 rounded-lg">
|
||||
<SettingsRow
|
||||
title={
|
||||
<div class="flex items-center gap-2">
|
||||
@@ -556,7 +555,7 @@ export const SettingsGeneral: Component = () => {
|
||||
<Switch checked={value() === "wayland"} onChange={onChange} />
|
||||
</div>
|
||||
</SettingsRow>
|
||||
</SettingsList>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}}
|
||||
|
||||
@@ -9,7 +9,6 @@ import fuzzysort from "fuzzysort"
|
||||
import { formatKeybind, parseKeybind, useCommand } from "@/context/command"
|
||||
import { useLanguage } from "@/context/language"
|
||||
import { useSettings } from "@/context/settings"
|
||||
import { SettingsList } from "./settings-list"
|
||||
|
||||
const IS_MAC = typeof navigator === "object" && /(Mac|iPod|iPhone|iPad)/.test(navigator.platform)
|
||||
const PALETTE_ID = "command.palette"
|
||||
@@ -239,7 +238,7 @@ function useKeyCapture(input: {
|
||||
showToast({
|
||||
title: input.language.t("settings.shortcuts.conflict.title"),
|
||||
description: input.language.t("settings.shortcuts.conflict.description", {
|
||||
keybind: formatKeybind(next, input.language.t),
|
||||
keybind: formatKeybind(next),
|
||||
titles: [...conflicts.values()].join(", "),
|
||||
}),
|
||||
})
|
||||
@@ -407,7 +406,7 @@ export const SettingsKeybinds: Component = () => {
|
||||
<Show when={(filtered().get(group) ?? []).length > 0}>
|
||||
<div class="flex flex-col gap-1">
|
||||
<h3 class="text-14-medium text-text-strong pb-2">{language.t(groupKey[group])}</h3>
|
||||
<SettingsList>
|
||||
<div class="bg-surface-raised-base px-4 rounded-lg">
|
||||
<For each={filtered().get(group) ?? []}>
|
||||
{(id) => (
|
||||
<div class="flex items-center justify-between gap-4 py-3 border-b border-border-weak-base last:border-none">
|
||||
@@ -433,7 +432,7 @@ export const SettingsKeybinds: Component = () => {
|
||||
</div>
|
||||
)}
|
||||
</For>
|
||||
</SettingsList>
|
||||
</div>
|
||||
</div>
|
||||
</Show>
|
||||
)}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import { type Component, type JSX } from "solid-js"
|
||||
|
||||
export const SettingsList: Component<{ children: JSX.Element }> = (props) => {
|
||||
return <div class="bg-surface-base px-4 rounded-lg">{props.children}</div>
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import { type Component, For, Show } from "solid-js"
|
||||
import { useLanguage } from "@/context/language"
|
||||
import { useModels } from "@/context/models"
|
||||
import { popularProviders } from "@/hooks/use-providers"
|
||||
import { SettingsList } from "./settings-list"
|
||||
|
||||
type ModelItem = ReturnType<ReturnType<typeof useModels>["list"]>[number]
|
||||
|
||||
@@ -101,7 +100,7 @@ export const SettingsModels: Component = () => {
|
||||
<ProviderIcon id={group.category} class="size-5 shrink-0 icon-strong-base" />
|
||||
<span class="text-14-medium text-text-strong">{group.items[0].provider.name}</span>
|
||||
</div>
|
||||
<SettingsList>
|
||||
<div class="bg-surface-raised-base px-4 rounded-lg">
|
||||
<For each={group.items}>
|
||||
{(item) => {
|
||||
const key = { providerID: item.provider.id, modelID: item.id }
|
||||
@@ -125,7 +124,7 @@ export const SettingsModels: Component = () => {
|
||||
)
|
||||
}}
|
||||
</For>
|
||||
</SettingsList>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</For>
|
||||
|
||||
@@ -11,7 +11,6 @@ import { useGlobalSync } from "@/context/global-sync"
|
||||
import { DialogConnectProvider } from "./dialog-connect-provider"
|
||||
import { DialogSelectProvider } from "./dialog-select-provider"
|
||||
import { DialogCustomProvider } from "./dialog-custom-provider"
|
||||
import { SettingsList } from "./settings-list"
|
||||
|
||||
type ProviderSource = "env" | "api" | "config" | "custom"
|
||||
type ProviderItem = ReturnType<ReturnType<typeof useProviders>["connected"]>[number]
|
||||
@@ -137,7 +136,7 @@ export const SettingsProviders: Component = () => {
|
||||
<div class="flex flex-col gap-8 max-w-[720px]">
|
||||
<div class="flex flex-col gap-1" data-component="connected-providers-section">
|
||||
<h3 class="text-14-medium text-text-strong pb-2">{language.t("settings.providers.section.connected")}</h3>
|
||||
<SettingsList>
|
||||
<div class="bg-surface-raised-base px-4 rounded-lg">
|
||||
<Show
|
||||
when={connected().length > 0}
|
||||
fallback={
|
||||
@@ -170,12 +169,12 @@ export const SettingsProviders: Component = () => {
|
||||
)}
|
||||
</For>
|
||||
</Show>
|
||||
</SettingsList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-1">
|
||||
<h3 class="text-14-medium text-text-strong pb-2">{language.t("settings.providers.section.popular")}</h3>
|
||||
<SettingsList>
|
||||
<div class="bg-surface-raised-base px-4 rounded-lg">
|
||||
<For each={popular()}>
|
||||
{(item) => (
|
||||
<div class="flex flex-wrap items-center justify-between gap-4 min-h-16 py-3 border-b border-border-weak-base last:border-none">
|
||||
@@ -233,7 +232,7 @@ export const SettingsProviders: Component = () => {
|
||||
{language.t("common.connect")}
|
||||
</Button>
|
||||
</div>
|
||||
</SettingsList>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
variant="ghost"
|
||||
|
||||
@@ -86,17 +86,15 @@ const useServerHealth = (servers: Accessor<ServerConnection.Any[]>) => {
|
||||
const useDefaultServerKey = (
|
||||
get: (() => string | Promise<string | null | undefined> | null | undefined) | undefined,
|
||||
) => {
|
||||
const [state, setState] = createStore({
|
||||
url: undefined as string | undefined,
|
||||
tick: 0,
|
||||
})
|
||||
const [url, setUrl] = createSignal<string | undefined>()
|
||||
const [tick, setTick] = createSignal(0)
|
||||
|
||||
createEffect(() => {
|
||||
state.tick
|
||||
tick()
|
||||
let dead = false
|
||||
const result = get?.()
|
||||
if (!result) {
|
||||
setState("url", undefined)
|
||||
setUrl(undefined)
|
||||
onCleanup(() => {
|
||||
dead = true
|
||||
})
|
||||
@@ -106,7 +104,7 @@ const useDefaultServerKey = (
|
||||
if (result instanceof Promise) {
|
||||
void result.then((next) => {
|
||||
if (dead) return
|
||||
setState("url", next ? normalizeServerUrl(next) : undefined)
|
||||
setUrl(next ? normalizeServerUrl(next) : undefined)
|
||||
})
|
||||
onCleanup(() => {
|
||||
dead = true
|
||||
@@ -114,7 +112,7 @@ const useDefaultServerKey = (
|
||||
return
|
||||
}
|
||||
|
||||
setState("url", normalizeServerUrl(result))
|
||||
setUrl(normalizeServerUrl(result))
|
||||
onCleanup(() => {
|
||||
dead = true
|
||||
})
|
||||
@@ -122,11 +120,11 @@ const useDefaultServerKey = (
|
||||
|
||||
return {
|
||||
key: () => {
|
||||
const u = state.url
|
||||
const u = url()
|
||||
if (!u) return
|
||||
return ServerConnection.key({ type: "http", http: { url: u } })
|
||||
},
|
||||
refresh: () => setState("tick", (value) => value + 1),
|
||||
refresh: () => setTick((value) => value + 1),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -65,16 +65,6 @@ const debugTerminal = (...values: unknown[]) => {
|
||||
console.debug("[terminal]", ...values)
|
||||
}
|
||||
|
||||
const errorStatus = (err: unknown) => {
|
||||
if (!err || typeof err !== "object") return
|
||||
if (!("data" in err)) return
|
||||
const data = err.data
|
||||
if (!data || typeof data !== "object") return
|
||||
if (!("statusCode" in data)) return
|
||||
const status = data.statusCode
|
||||
return typeof status === "number" ? status : undefined
|
||||
}
|
||||
|
||||
const useTerminalUiBindings = (input: {
|
||||
container: HTMLDivElement
|
||||
term: Term
|
||||
@@ -199,11 +189,7 @@ export const Terminal = (props: TerminalProps) => {
|
||||
const start =
|
||||
typeof local.pty.cursor === "number" && Number.isSafeInteger(local.pty.cursor) ? local.pty.cursor : undefined
|
||||
let cursor = start ?? 0
|
||||
let seek = start !== undefined ? start : restore ? -1 : 0
|
||||
let output: ReturnType<typeof terminalWriter> | undefined
|
||||
let drop: VoidFunction | undefined
|
||||
let reconn: ReturnType<typeof setTimeout> | undefined
|
||||
let tries = 0
|
||||
|
||||
const cleanup = () => {
|
||||
if (!cleanups.length) return
|
||||
@@ -467,135 +453,85 @@ export const Terminal = (props: TerminalProps) => {
|
||||
}
|
||||
|
||||
const once = { value: false }
|
||||
const decoder = new TextDecoder()
|
||||
let closing = false
|
||||
|
||||
const fail = (err: unknown) => {
|
||||
const url = new URL(sdk.url + `/pty/${id}/connect`)
|
||||
url.searchParams.set("directory", sdk.directory)
|
||||
url.searchParams.set("cursor", String(start !== undefined ? start : restore ? -1 : 0))
|
||||
url.protocol = url.protocol === "https:" ? "wss:" : "ws:"
|
||||
url.username = server.current?.http.username ?? "opencode"
|
||||
url.password = server.current?.http.password ?? ""
|
||||
|
||||
const socket = new WebSocket(url)
|
||||
socket.binaryType = "arraybuffer"
|
||||
ws = socket
|
||||
|
||||
const handleOpen = () => {
|
||||
probe.connect()
|
||||
local.onConnect?.()
|
||||
scheduleSize(t.cols, t.rows)
|
||||
}
|
||||
socket.addEventListener("open", handleOpen)
|
||||
if (socket.readyState === WebSocket.OPEN) handleOpen()
|
||||
|
||||
const decoder = new TextDecoder()
|
||||
const handleMessage = (event: MessageEvent) => {
|
||||
if (disposed) return
|
||||
if (closing) return
|
||||
if (event.data instanceof ArrayBuffer) {
|
||||
const bytes = new Uint8Array(event.data)
|
||||
if (bytes[0] !== 0) return
|
||||
const json = decoder.decode(bytes.subarray(1))
|
||||
try {
|
||||
const meta = JSON.parse(json) as { cursor?: unknown }
|
||||
const next = meta?.cursor
|
||||
if (typeof next === "number" && Number.isSafeInteger(next) && next >= 0) {
|
||||
cursor = next
|
||||
}
|
||||
} catch (err) {
|
||||
debugTerminal("invalid websocket control frame", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
const data = typeof event.data === "string" ? event.data : ""
|
||||
if (!data) return
|
||||
output?.push(data)
|
||||
cursor += data.length
|
||||
}
|
||||
socket.addEventListener("message", handleMessage)
|
||||
|
||||
const handleError = (error: Event) => {
|
||||
if (disposed) return
|
||||
if (closing) return
|
||||
if (once.value) return
|
||||
once.value = true
|
||||
local.onConnectError?.(err)
|
||||
console.error("WebSocket error:", error)
|
||||
local.onConnectError?.(error)
|
||||
}
|
||||
socket.addEventListener("error", handleError)
|
||||
|
||||
const gone = () =>
|
||||
sdk.client.pty
|
||||
.get({ ptyID: id })
|
||||
.then(() => false)
|
||||
.catch((err) => {
|
||||
if (errorStatus(err) === 404) return true
|
||||
debugTerminal("failed to inspect terminal session", err)
|
||||
return false
|
||||
})
|
||||
|
||||
const retry = (err: unknown) => {
|
||||
const handleClose = (event: CloseEvent) => {
|
||||
if (disposed) return
|
||||
if (reconn !== undefined) return
|
||||
|
||||
const ms = Math.min(250 * 2 ** Math.min(tries, 4), 4_000)
|
||||
reconn = setTimeout(async () => {
|
||||
reconn = undefined
|
||||
if (disposed) return
|
||||
if (await gone()) {
|
||||
if (disposed) return
|
||||
fail(err)
|
||||
return
|
||||
}
|
||||
if (disposed) return
|
||||
tries += 1
|
||||
open()
|
||||
}, ms)
|
||||
if (closing) return
|
||||
// Normal closure (code 1000) means PTY process exited - server event handles cleanup
|
||||
// For other codes (network issues, server restart), trigger error handler
|
||||
if (event.code !== 1000) {
|
||||
if (once.value) return
|
||||
once.value = true
|
||||
local.onConnectError?.(new Error(`WebSocket closed abnormally: ${event.code}`))
|
||||
}
|
||||
}
|
||||
socket.addEventListener("close", handleClose)
|
||||
|
||||
const open = () => {
|
||||
if (disposed) return
|
||||
drop?.()
|
||||
|
||||
const url = new URL(sdk.url + `/pty/${id}/connect`)
|
||||
url.searchParams.set("directory", sdk.directory)
|
||||
url.searchParams.set("cursor", String(seek))
|
||||
url.protocol = url.protocol === "https:" ? "wss:" : "ws:"
|
||||
url.username = server.current?.http.username ?? "opencode"
|
||||
url.password = server.current?.http.password ?? ""
|
||||
|
||||
const socket = new WebSocket(url)
|
||||
socket.binaryType = "arraybuffer"
|
||||
ws = socket
|
||||
|
||||
const handleOpen = () => {
|
||||
if (disposed) return
|
||||
tries = 0
|
||||
probe.connect()
|
||||
local.onConnect?.()
|
||||
scheduleSize(t.cols, t.rows)
|
||||
}
|
||||
|
||||
const handleMessage = (event: MessageEvent) => {
|
||||
if (disposed) return
|
||||
if (event.data instanceof ArrayBuffer) {
|
||||
const bytes = new Uint8Array(event.data)
|
||||
if (bytes[0] !== 0) return
|
||||
const json = decoder.decode(bytes.subarray(1))
|
||||
try {
|
||||
const meta = JSON.parse(json) as { cursor?: unknown }
|
||||
const next = meta?.cursor
|
||||
if (typeof next === "number" && Number.isSafeInteger(next) && next >= 0) {
|
||||
cursor = next
|
||||
seek = next
|
||||
}
|
||||
} catch (err) {
|
||||
debugTerminal("invalid websocket control frame", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
const data = typeof event.data === "string" ? event.data : ""
|
||||
if (!data) return
|
||||
output?.push(data)
|
||||
cursor += data.length
|
||||
seek = cursor
|
||||
}
|
||||
|
||||
const handleError = (error: Event) => {
|
||||
if (disposed) return
|
||||
debugTerminal("websocket error", error)
|
||||
}
|
||||
|
||||
const stop = () => {
|
||||
socket.removeEventListener("open", handleOpen)
|
||||
socket.removeEventListener("message", handleMessage)
|
||||
socket.removeEventListener("error", handleError)
|
||||
socket.removeEventListener("close", handleClose)
|
||||
if (ws === socket) ws = undefined
|
||||
if (drop === stop) drop = undefined
|
||||
if (socket.readyState !== WebSocket.CLOSED && socket.readyState !== WebSocket.CLOSING) socket.close(1000)
|
||||
}
|
||||
|
||||
const handleClose = (event: CloseEvent) => {
|
||||
if (ws === socket) ws = undefined
|
||||
if (drop === stop) drop = undefined
|
||||
socket.removeEventListener("open", handleOpen)
|
||||
socket.removeEventListener("message", handleMessage)
|
||||
socket.removeEventListener("error", handleError)
|
||||
socket.removeEventListener("close", handleClose)
|
||||
if (disposed) return
|
||||
if (event.code === 1000) return
|
||||
retry(new Error(language.t("terminal.connectionLost.abnormalClose", { code: event.code })))
|
||||
}
|
||||
|
||||
drop = stop
|
||||
socket.addEventListener("open", handleOpen)
|
||||
socket.addEventListener("message", handleMessage)
|
||||
socket.addEventListener("error", handleError)
|
||||
socket.addEventListener("close", handleClose)
|
||||
}
|
||||
|
||||
probe.control({
|
||||
disconnect: () => {
|
||||
if (!ws) return
|
||||
ws.close(4_000, "e2e")
|
||||
},
|
||||
cleanups.push(() => {
|
||||
closing = true
|
||||
socket.removeEventListener("open", handleOpen)
|
||||
socket.removeEventListener("message", handleMessage)
|
||||
socket.removeEventListener("error", handleError)
|
||||
socket.removeEventListener("close", handleClose)
|
||||
if (socket.readyState !== WebSocket.CLOSED && socket.readyState !== WebSocket.CLOSING) socket.close(1000)
|
||||
})
|
||||
|
||||
open()
|
||||
}
|
||||
|
||||
void run().catch((err) => {
|
||||
@@ -613,8 +549,6 @@ export const Terminal = (props: TerminalProps) => {
|
||||
disposed = true
|
||||
if (fitFrame !== undefined) cancelAnimationFrame(fitFrame)
|
||||
if (sizeTimer !== undefined) clearTimeout(sizeTimer)
|
||||
if (reconn !== undefined) clearTimeout(reconn)
|
||||
drop?.()
|
||||
if (ws && ws.readyState !== WebSocket.CLOSED && ws.readyState !== WebSocket.CLOSING) ws.close(1000)
|
||||
|
||||
const finalize = () => {
|
||||
|
||||
@@ -2,7 +2,6 @@ import { createEffect, createMemo, onCleanup, onMount, type Accessor } from "sol
|
||||
import { createStore } from "solid-js/store"
|
||||
import { createSimpleContext } from "@opencode-ai/ui/context"
|
||||
import { useDialog } from "@opencode-ai/ui/context/dialog"
|
||||
import { dict as en } from "@/i18n/en"
|
||||
import { useLanguage } from "@/context/language"
|
||||
import { useSettings } from "@/context/settings"
|
||||
import { Persist, persisted } from "@/utils/persist"
|
||||
@@ -14,27 +13,6 @@ const DEFAULT_PALETTE_KEYBIND = "mod+shift+p"
|
||||
const SUGGESTED_PREFIX = "suggested."
|
||||
const EDITABLE_KEYBIND_IDS = new Set(["terminal.toggle", "terminal.new", "file.attach"])
|
||||
|
||||
type KeyLabel =
|
||||
| "common.key.ctrl"
|
||||
| "common.key.alt"
|
||||
| "common.key.shift"
|
||||
| "common.key.meta"
|
||||
| "common.key.space"
|
||||
| "common.key.backspace"
|
||||
| "common.key.enter"
|
||||
| "common.key.tab"
|
||||
| "common.key.delete"
|
||||
| "common.key.home"
|
||||
| "common.key.end"
|
||||
| "common.key.pageUp"
|
||||
| "common.key.pageDown"
|
||||
| "common.key.insert"
|
||||
| "common.key.esc"
|
||||
|
||||
function keyText(key: KeyLabel, t?: (key: KeyLabel) => string) {
|
||||
return t ? t(key) : en[key]
|
||||
}
|
||||
|
||||
function actionId(id: string) {
|
||||
if (!id.startsWith(SUGGESTED_PREFIX)) return id
|
||||
return id.slice(SUGGESTED_PREFIX.length)
|
||||
@@ -167,7 +145,7 @@ export function matchKeybind(keybinds: Keybind[], event: KeyboardEvent): boolean
|
||||
return false
|
||||
}
|
||||
|
||||
export function formatKeybind(config: string, t?: (key: KeyLabel) => string): string {
|
||||
export function formatKeybind(config: string): string {
|
||||
if (!config || config === "none") return ""
|
||||
|
||||
const keybinds = parseKeybind(config)
|
||||
@@ -176,10 +154,10 @@ export function formatKeybind(config: string, t?: (key: KeyLabel) => string): st
|
||||
const kb = keybinds[0]
|
||||
const parts: string[] = []
|
||||
|
||||
if (kb.ctrl) parts.push(IS_MAC ? "⌃" : keyText("common.key.ctrl", t))
|
||||
if (kb.alt) parts.push(IS_MAC ? "⌥" : keyText("common.key.alt", t))
|
||||
if (kb.shift) parts.push(IS_MAC ? "⇧" : keyText("common.key.shift", t))
|
||||
if (kb.meta) parts.push(IS_MAC ? "⌘" : keyText("common.key.meta", t))
|
||||
if (kb.ctrl) parts.push(IS_MAC ? "⌃" : "Ctrl")
|
||||
if (kb.alt) parts.push(IS_MAC ? "⌥" : "Alt")
|
||||
if (kb.shift) parts.push(IS_MAC ? "⇧" : "Shift")
|
||||
if (kb.meta) parts.push(IS_MAC ? "⌘" : "Meta")
|
||||
|
||||
if (kb.key) {
|
||||
const keys: Record<string, string> = {
|
||||
@@ -189,29 +167,10 @@ export function formatKeybind(config: string, t?: (key: KeyLabel) => string): st
|
||||
arrowright: "→",
|
||||
comma: ",",
|
||||
plus: "+",
|
||||
}
|
||||
const named: Record<string, KeyLabel> = {
|
||||
backspace: "common.key.backspace",
|
||||
delete: "common.key.delete",
|
||||
end: "common.key.end",
|
||||
enter: "common.key.enter",
|
||||
esc: "common.key.esc",
|
||||
escape: "common.key.esc",
|
||||
home: "common.key.home",
|
||||
insert: "common.key.insert",
|
||||
pagedown: "common.key.pageDown",
|
||||
pageup: "common.key.pageUp",
|
||||
space: "common.key.space",
|
||||
tab: "common.key.tab",
|
||||
space: "Space",
|
||||
}
|
||||
const key = kb.key.toLowerCase()
|
||||
const displayKey =
|
||||
keys[key] ??
|
||||
(named[key]
|
||||
? keyText(named[key], t)
|
||||
: key.length === 1
|
||||
? key.toUpperCase()
|
||||
: key.charAt(0).toUpperCase() + key.slice(1))
|
||||
const displayKey = keys[key] ?? (key.length === 1 ? key.toUpperCase() : key.charAt(0).toUpperCase() + key.slice(1))
|
||||
parts.push(displayKey)
|
||||
}
|
||||
|
||||
@@ -405,17 +364,17 @@ export const { use: useCommand, provider: CommandProvider } = createSimpleContex
|
||||
},
|
||||
keybind(id: string) {
|
||||
if (id === PALETTE_ID) {
|
||||
return formatKeybind(settings.keybinds.get(PALETTE_ID) ?? DEFAULT_PALETTE_KEYBIND, language.t)
|
||||
return formatKeybind(settings.keybinds.get(PALETTE_ID) ?? DEFAULT_PALETTE_KEYBIND)
|
||||
}
|
||||
|
||||
const base = actionId(id)
|
||||
const option = options().find((x) => actionId(x.id) === base)
|
||||
if (option?.keybind) return formatKeybind(option.keybind, language.t)
|
||||
if (option?.keybind) return formatKeybind(option.keybind)
|
||||
|
||||
const meta = catalog[base]
|
||||
const config = bind(base, meta?.keybind)
|
||||
if (!config) return ""
|
||||
return formatKeybind(config, language.t)
|
||||
return formatKeybind(config)
|
||||
},
|
||||
show: showPalette,
|
||||
keybinds(enabled: boolean) {
|
||||
|
||||
@@ -43,10 +43,10 @@ export {
|
||||
touchFileContent,
|
||||
}
|
||||
|
||||
function errorMessage(error: unknown, fallback: string) {
|
||||
function errorMessage(error: unknown) {
|
||||
if (error instanceof Error && error.message) return error.message
|
||||
if (typeof error === "string" && error) return error
|
||||
return fallback
|
||||
return "Unknown error"
|
||||
}
|
||||
|
||||
export const { use: useFile, provider: FileProvider } = createSimpleContext({
|
||||
@@ -184,7 +184,7 @@ export const { use: useFile, provider: FileProvider } = createSimpleContext({
|
||||
})
|
||||
.catch((e) => {
|
||||
if (scope() !== directory) return
|
||||
setLoadError(file, errorMessage(e, language.t("error.chain.unknown")))
|
||||
setLoadError(file, errorMessage(e))
|
||||
})
|
||||
.finally(() => {
|
||||
inflight.delete(key)
|
||||
|
||||
@@ -4,7 +4,6 @@ import { createGlobalEmitter } from "@solid-primitives/event-bus"
|
||||
import { batch, onCleanup } from "solid-js"
|
||||
import z from "zod"
|
||||
import { createSdkForServer } from "@/utils/server"
|
||||
import { useLanguage } from "./language"
|
||||
import { usePlatform } from "./platform"
|
||||
import { useServer } from "./server"
|
||||
|
||||
@@ -15,7 +14,6 @@ const abortError = z.object({
|
||||
export const { use: useGlobalSDK, provider: GlobalSDKProvider } = createSimpleContext({
|
||||
name: "GlobalSDK",
|
||||
init: () => {
|
||||
const language = useLanguage()
|
||||
const server = useServer()
|
||||
const platform = usePlatform()
|
||||
const abort = new AbortController()
|
||||
@@ -32,7 +30,7 @@ export const { use: useGlobalSDK, provider: GlobalSDKProvider } = createSimpleCo
|
||||
})()
|
||||
|
||||
const currentServer = server.current
|
||||
if (!currentServer) throw new Error(language.t("error.globalSDK.noServerAvailable"))
|
||||
if (!currentServer) throw new Error("No server available")
|
||||
|
||||
const eventSdk = createSdkForServer({
|
||||
signal: abort.signal,
|
||||
@@ -220,7 +218,7 @@ export const { use: useGlobalSDK, provider: GlobalSDKProvider } = createSimpleCo
|
||||
event: emitter,
|
||||
createClient(opts: Omit<Parameters<typeof createSdkForServer>[0], "server" | "fetch">) {
|
||||
const s = server.current
|
||||
if (!s) throw new Error(language.t("error.globalSDK.serverNotAvailable"))
|
||||
if (!s) throw new Error("Server not available")
|
||||
return createSdkForServer({
|
||||
server: s.http,
|
||||
fetch: platform.fetch,
|
||||
|
||||
@@ -164,7 +164,6 @@ function createGlobalSync() {
|
||||
sdkCache.delete(directory)
|
||||
clearSessionPrefetchDirectory(directory)
|
||||
},
|
||||
translate: language.t,
|
||||
})
|
||||
|
||||
const sdkFor = (directory: string) => {
|
||||
|
||||
@@ -139,7 +139,7 @@ export async function bootstrapDirectory(input: {
|
||||
const project = getFilename(input.directory)
|
||||
showToast({
|
||||
variant: "error",
|
||||
title: input.translate("toast.project.reloadFailed.title", { project }),
|
||||
title: `Failed to reload ${project}`,
|
||||
description: formatServerError(err, input.translate),
|
||||
})
|
||||
input.setStore("status", "partial")
|
||||
|
||||
@@ -21,7 +21,6 @@ describe("createChildStoreManager", () => {
|
||||
isLoadingSessions: () => false,
|
||||
onBootstrap() {},
|
||||
onDispose() {},
|
||||
translate: (key) => key,
|
||||
})
|
||||
|
||||
Array.from({ length: 30 }, (_, index) => `/pinned-${index}`).forEach((directory) => {
|
||||
|
||||
@@ -21,7 +21,6 @@ export function createChildStoreManager(input: {
|
||||
isLoadingSessions: (directory: string) => boolean
|
||||
onBootstrap: (directory: string) => void
|
||||
onDispose: (directory: string) => void
|
||||
translate: (key: string, vars?: Record<string, string | number>) => string
|
||||
}) {
|
||||
const children: Record<string, [Store<State>, SetStoreFunction<State>]> = {}
|
||||
const vcsCache = new Map<string, VcsCache>()
|
||||
@@ -130,7 +129,7 @@ export function createChildStoreManager(input: {
|
||||
createStore({ value: undefined as VcsInfo | undefined }),
|
||||
),
|
||||
)
|
||||
if (!vcs) throw new Error(input.translate("error.childStore.persistedCacheCreateFailed"))
|
||||
if (!vcs) throw new Error("Failed to create persisted cache")
|
||||
const vcsStore = vcs[0]
|
||||
vcsCache.set(directory, { store: vcsStore, setStore: vcs[1], ready: vcs[3] })
|
||||
|
||||
@@ -140,7 +139,7 @@ export function createChildStoreManager(input: {
|
||||
createStore({ value: undefined as ProjectMeta | undefined }),
|
||||
),
|
||||
)
|
||||
if (!meta) throw new Error(input.translate("error.childStore.persistedProjectMetadataCreateFailed"))
|
||||
if (!meta) throw new Error("Failed to create persisted project metadata")
|
||||
metaCache.set(directory, { store: meta[0], setStore: meta[1], ready: meta[3] })
|
||||
|
||||
const icon = runWithOwner(input.owner, () =>
|
||||
@@ -149,7 +148,7 @@ export function createChildStoreManager(input: {
|
||||
createStore({ value: undefined as string | undefined }),
|
||||
),
|
||||
)
|
||||
if (!icon) throw new Error(input.translate("error.childStore.persistedProjectIconCreateFailed"))
|
||||
if (!icon) throw new Error("Failed to create persisted project icon")
|
||||
iconCache.set(directory, { store: icon[0], setStore: icon[1], ready: icon[3] })
|
||||
|
||||
const init = () =>
|
||||
@@ -212,7 +211,7 @@ export function createChildStoreManager(input: {
|
||||
}
|
||||
mark(directory)
|
||||
const childStore = children[directory]
|
||||
if (!childStore) throw new Error(input.translate("error.childStore.storeCreateFailed"))
|
||||
if (!childStore) throw new Error("Failed to create store")
|
||||
return childStore
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import {
|
||||
getSessionPrefetch,
|
||||
runSessionPrefetch,
|
||||
setSessionPrefetch,
|
||||
shouldSkipSessionPrefetch,
|
||||
} from "./session-prefetch"
|
||||
|
||||
describe("session prefetch", () => {
|
||||
@@ -17,12 +16,11 @@ describe("session prefetch", () => {
|
||||
directory: "/tmp/a",
|
||||
sessionID: "ses_1",
|
||||
limit: 200,
|
||||
cursor: "abc",
|
||||
complete: false,
|
||||
at: 123,
|
||||
})
|
||||
|
||||
expect(getSessionPrefetch("/tmp/a", "ses_1")).toEqual({ limit: 200, cursor: "abc", complete: false, at: 123 })
|
||||
expect(getSessionPrefetch("/tmp/a", "ses_1")).toEqual({ limit: 200, complete: false, at: 123 })
|
||||
expect(getSessionPrefetch("/tmp/b", "ses_1")).toBeUndefined()
|
||||
|
||||
clearSessionPrefetch("/tmp/a", ["ses_1"])
|
||||
@@ -40,57 +38,26 @@ describe("session prefetch", () => {
|
||||
sessionID: "ses_2",
|
||||
task: async () => {
|
||||
calls += 1
|
||||
return { limit: 100, cursor: "next", complete: true, at: 456 }
|
||||
return { limit: 100, complete: true, at: 456 }
|
||||
},
|
||||
})
|
||||
|
||||
const [a, b] = await Promise.all([run(), run()])
|
||||
|
||||
expect(calls).toBe(1)
|
||||
expect(a).toEqual({ limit: 100, cursor: "next", complete: true, at: 456 })
|
||||
expect(b).toEqual({ limit: 100, cursor: "next", complete: true, at: 456 })
|
||||
expect(a).toEqual({ limit: 100, complete: true, at: 456 })
|
||||
expect(b).toEqual({ limit: 100, complete: true, at: 456 })
|
||||
})
|
||||
|
||||
test("clears a whole directory", () => {
|
||||
setSessionPrefetch({ directory: "/tmp/d", sessionID: "ses_1", limit: 10, cursor: "a", complete: true, at: 1 })
|
||||
setSessionPrefetch({ directory: "/tmp/d", sessionID: "ses_2", limit: 20, cursor: "b", complete: false, at: 2 })
|
||||
setSessionPrefetch({ directory: "/tmp/e", sessionID: "ses_1", limit: 30, cursor: "c", complete: true, at: 3 })
|
||||
setSessionPrefetch({ directory: "/tmp/d", sessionID: "ses_1", limit: 10, complete: true, at: 1 })
|
||||
setSessionPrefetch({ directory: "/tmp/d", sessionID: "ses_2", limit: 20, complete: false, at: 2 })
|
||||
setSessionPrefetch({ directory: "/tmp/e", sessionID: "ses_1", limit: 30, complete: true, at: 3 })
|
||||
|
||||
clearSessionPrefetchDirectory("/tmp/d")
|
||||
|
||||
expect(getSessionPrefetch("/tmp/d", "ses_1")).toBeUndefined()
|
||||
expect(getSessionPrefetch("/tmp/d", "ses_2")).toBeUndefined()
|
||||
expect(getSessionPrefetch("/tmp/e", "ses_1")).toEqual({ limit: 30, cursor: "c", complete: true, at: 3 })
|
||||
})
|
||||
|
||||
test("refreshes stale first-page prefetched history", () => {
|
||||
expect(
|
||||
shouldSkipSessionPrefetch({
|
||||
message: true,
|
||||
info: { limit: 200, cursor: "x", complete: false, at: 1 },
|
||||
chunk: 200,
|
||||
now: 1 + 15_001,
|
||||
}),
|
||||
).toBe(false)
|
||||
})
|
||||
|
||||
test("keeps deeper or complete history cached", () => {
|
||||
expect(
|
||||
shouldSkipSessionPrefetch({
|
||||
message: true,
|
||||
info: { limit: 400, cursor: "x", complete: false, at: 1 },
|
||||
chunk: 200,
|
||||
now: 1 + 15_001,
|
||||
}),
|
||||
).toBe(true)
|
||||
|
||||
expect(
|
||||
shouldSkipSessionPrefetch({
|
||||
message: true,
|
||||
info: { limit: 120, complete: true, at: 1 },
|
||||
chunk: 200,
|
||||
now: 1 + 15_001,
|
||||
}),
|
||||
).toBe(true)
|
||||
expect(getSessionPrefetch("/tmp/e", "ses_1")).toEqual({ limit: 30, complete: true, at: 3 })
|
||||
})
|
||||
})
|
||||
|
||||
@@ -4,23 +4,10 @@ export const SESSION_PREFETCH_TTL = 15_000
|
||||
|
||||
type Meta = {
|
||||
limit: number
|
||||
cursor?: string
|
||||
complete: boolean
|
||||
at: number
|
||||
}
|
||||
|
||||
export function shouldSkipSessionPrefetch(input: { message: boolean; info?: Meta; chunk: number; now?: number }) {
|
||||
if (input.message) {
|
||||
if (!input.info) return true
|
||||
if (input.info.complete) return true
|
||||
if (input.info.limit > input.chunk) return true
|
||||
} else {
|
||||
if (!input.info) return false
|
||||
}
|
||||
|
||||
return (input.now ?? Date.now()) - input.info.at < SESSION_PREFETCH_TTL
|
||||
}
|
||||
|
||||
const cache = new Map<string, Meta>()
|
||||
const inflight = new Map<string, Promise<Meta | undefined>>()
|
||||
const rev = new Map<string, number>()
|
||||
@@ -66,13 +53,11 @@ export function setSessionPrefetch(input: {
|
||||
directory: string
|
||||
sessionID: string
|
||||
limit: number
|
||||
cursor?: string
|
||||
complete: boolean
|
||||
at?: number
|
||||
}) {
|
||||
cache.set(key(input.directory, input.sessionID), {
|
||||
limit: input.limit,
|
||||
cursor: input.cursor,
|
||||
complete: input.complete,
|
||||
at: input.at ?? Date.now(),
|
||||
})
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { describe, expect, test } from "bun:test"
|
||||
import type { Message, Part } from "@opencode-ai/sdk/v2/client"
|
||||
import { applyOptimisticAdd, applyOptimisticRemove, mergeOptimisticPage } from "./sync"
|
||||
|
||||
type Text = Extract<Part, { type: "text" }>
|
||||
import { applyOptimisticAdd, applyOptimisticRemove } from "./sync"
|
||||
|
||||
const userMessage = (id: string, sessionID: string): Message => ({
|
||||
id,
|
||||
@@ -13,7 +11,7 @@ const userMessage = (id: string, sessionID: string): Message => ({
|
||||
model: { providerID: "openai", modelID: "gpt" },
|
||||
})
|
||||
|
||||
const textPart = (id: string, sessionID: string, messageID: string): Text => ({
|
||||
const textPart = (id: string, sessionID: string, messageID: string): Part => ({
|
||||
id,
|
||||
sessionID,
|
||||
messageID,
|
||||
@@ -55,69 +53,4 @@ describe("sync optimistic reducers", () => {
|
||||
expect(draft.part.msg_1).toBeUndefined()
|
||||
expect(draft.part.msg_2).toHaveLength(1)
|
||||
})
|
||||
|
||||
test("mergeOptimisticPage keeps pending messages in fetched timelines", () => {
|
||||
const sessionID = "ses_1"
|
||||
const page = mergeOptimisticPage(
|
||||
{
|
||||
session: [userMessage("msg_1", sessionID)],
|
||||
part: [{ id: "msg_1", part: [textPart("prt_1", sessionID, "msg_1")] }],
|
||||
complete: true,
|
||||
},
|
||||
[{ message: userMessage("msg_2", sessionID), parts: [textPart("prt_2", sessionID, "msg_2")] }],
|
||||
)
|
||||
|
||||
expect(page.session.map((x) => x.id)).toEqual(["msg_1", "msg_2"])
|
||||
expect(page.part.find((x) => x.id === "msg_2")?.part.map((x) => x.id)).toEqual(["prt_2"])
|
||||
expect(page.confirmed).toEqual([])
|
||||
expect(page.complete).toBe(true)
|
||||
})
|
||||
|
||||
test("mergeOptimisticPage keeps missing optimistic parts until the server has them", () => {
|
||||
const sessionID = "ses_1"
|
||||
const page = mergeOptimisticPage(
|
||||
{
|
||||
session: [userMessage("msg_2", sessionID)],
|
||||
part: [{ id: "msg_2", part: [textPart("prt_2", sessionID, "msg_2")] }],
|
||||
complete: true,
|
||||
},
|
||||
[
|
||||
{
|
||||
message: userMessage("msg_2", sessionID),
|
||||
parts: [textPart("prt_1", sessionID, "msg_2"), textPart("prt_2", sessionID, "msg_2")],
|
||||
},
|
||||
],
|
||||
)
|
||||
|
||||
expect(page.part.find((x) => x.id === "msg_2")?.part.map((x) => x.id)).toEqual(["prt_1", "prt_2"])
|
||||
expect(page.confirmed).toEqual([])
|
||||
})
|
||||
|
||||
test("mergeOptimisticPage confirms echoed messages once all parts arrive", () => {
|
||||
const sessionID = "ses_1"
|
||||
const page = mergeOptimisticPage(
|
||||
{
|
||||
session: [userMessage("msg_2", sessionID)],
|
||||
part: [
|
||||
{
|
||||
id: "msg_2",
|
||||
part: [{ ...textPart("prt_1", sessionID, "msg_2"), text: "server" }, textPart("prt_2", sessionID, "msg_2")],
|
||||
},
|
||||
],
|
||||
complete: true,
|
||||
},
|
||||
[
|
||||
{
|
||||
message: userMessage("msg_2", sessionID),
|
||||
parts: [textPart("prt_1", sessionID, "msg_2"), textPart("prt_2", sessionID, "msg_2")],
|
||||
},
|
||||
],
|
||||
)
|
||||
|
||||
expect(page.confirmed).toEqual(["msg_2"])
|
||||
expect(page.part.find((x) => x.id === "msg_2")?.part).toMatchObject([
|
||||
{ id: "prt_1", type: "text", text: "server" },
|
||||
{ id: "prt_2", type: "text", text: "prt_2" },
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
@@ -32,12 +32,6 @@ const keyFor = (directory: string, id: string) => `${directory}\n${id}`
|
||||
|
||||
const cmp = (a: string, b: string) => (a < b ? -1 : a > b ? 1 : 0)
|
||||
|
||||
function merge<T extends { id: string }>(a: readonly T[], b: readonly T[]) {
|
||||
const map = new Map(a.map((item) => [item.id, item] as const))
|
||||
for (const item of b) map.set(item.id, item)
|
||||
return [...map.values()].sort((x, y) => cmp(x.id, y.id))
|
||||
}
|
||||
|
||||
type OptimisticStore = {
|
||||
message: Record<string, Message[] | undefined>
|
||||
part: Record<string, Part[] | undefined>
|
||||
@@ -54,67 +48,6 @@ type OptimisticRemoveInput = {
|
||||
messageID: string
|
||||
}
|
||||
|
||||
type OptimisticItem = {
|
||||
message: Message
|
||||
parts: Part[]
|
||||
}
|
||||
|
||||
type MessagePage = {
|
||||
session: Message[]
|
||||
part: { id: string; part: Part[] }[]
|
||||
cursor?: string
|
||||
complete: boolean
|
||||
}
|
||||
|
||||
const hasParts = (parts: Part[] | undefined, want: Part[]) => {
|
||||
if (!parts) return want.length === 0
|
||||
return want.every((part) => Binary.search(parts, part.id, (item) => item.id).found)
|
||||
}
|
||||
|
||||
const mergeParts = (parts: Part[] | undefined, want: Part[]) => {
|
||||
if (!parts) return sortParts(want)
|
||||
const next = [...parts]
|
||||
let changed = false
|
||||
for (const part of want) {
|
||||
const result = Binary.search(next, part.id, (item) => item.id)
|
||||
if (result.found) continue
|
||||
next.splice(result.index, 0, part)
|
||||
changed = true
|
||||
}
|
||||
if (!changed) return parts
|
||||
return next
|
||||
}
|
||||
|
||||
export function mergeOptimisticPage(page: MessagePage, items: OptimisticItem[]) {
|
||||
if (items.length === 0) return { ...page, confirmed: [] as string[] }
|
||||
|
||||
const session = [...page.session]
|
||||
const part = new Map(page.part.map((item) => [item.id, sortParts(item.part)]))
|
||||
const confirmed: string[] = []
|
||||
|
||||
for (const item of items) {
|
||||
const result = Binary.search(session, item.message.id, (message) => message.id)
|
||||
const found = result.found
|
||||
if (!found) session.splice(result.index, 0, item.message)
|
||||
|
||||
const current = part.get(item.message.id)
|
||||
if (found && hasParts(current, item.parts)) {
|
||||
confirmed.push(item.message.id)
|
||||
continue
|
||||
}
|
||||
|
||||
part.set(item.message.id, mergeParts(current, item.parts))
|
||||
}
|
||||
|
||||
return {
|
||||
cursor: page.cursor,
|
||||
complete: page.complete,
|
||||
session,
|
||||
part: [...part.entries()].sort((a, b) => cmp(a[0], b[0])).map(([id, part]) => ({ id, part })),
|
||||
confirmed,
|
||||
}
|
||||
}
|
||||
|
||||
export function applyOptimisticAdd(draft: OptimisticStore, input: OptimisticAddInput) {
|
||||
const messages = draft.message[input.sessionID]
|
||||
if (messages) {
|
||||
@@ -182,12 +115,10 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
|
||||
const inflight = new Map<string, Promise<void>>()
|
||||
const inflightDiff = new Map<string, Promise<void>>()
|
||||
const inflightTodo = new Map<string, Promise<void>>()
|
||||
const optimistic = new Map<string, Map<string, OptimisticItem>>()
|
||||
const maxDirs = 30
|
||||
const seen = new Map<string, Set<string>>()
|
||||
const [meta, setMeta] = createStore({
|
||||
limit: {} as Record<string, number>,
|
||||
cursor: {} as Record<string, string | undefined>,
|
||||
complete: {} as Record<string, boolean>,
|
||||
loading: {} as Record<string, boolean>,
|
||||
})
|
||||
@@ -199,33 +130,6 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
|
||||
return undefined
|
||||
}
|
||||
|
||||
const setOptimistic = (directory: string, sessionID: string, item: OptimisticItem) => {
|
||||
const key = keyFor(directory, sessionID)
|
||||
const list = optimistic.get(key)
|
||||
if (list) {
|
||||
list.set(item.message.id, { message: item.message, parts: sortParts(item.parts) })
|
||||
return
|
||||
}
|
||||
optimistic.set(key, new Map([[item.message.id, { message: item.message, parts: sortParts(item.parts) }]]))
|
||||
}
|
||||
|
||||
const clearOptimistic = (directory: string, sessionID: string, messageID?: string) => {
|
||||
const key = keyFor(directory, sessionID)
|
||||
if (!messageID) {
|
||||
optimistic.delete(key)
|
||||
return
|
||||
}
|
||||
|
||||
const list = optimistic.get(key)
|
||||
if (!list) return
|
||||
list.delete(messageID)
|
||||
if (list.size === 0) optimistic.delete(key)
|
||||
}
|
||||
|
||||
const getOptimistic = (directory: string, sessionID: string) => [
|
||||
...(optimistic.get(keyFor(directory, sessionID))?.values() ?? []),
|
||||
]
|
||||
|
||||
const seenFor = (directory: string) => {
|
||||
const existing = seen.get(directory)
|
||||
if (existing) {
|
||||
@@ -248,15 +152,11 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
|
||||
|
||||
const clearMeta = (directory: string, sessionIDs: string[]) => {
|
||||
if (sessionIDs.length === 0) return
|
||||
for (const sessionID of sessionIDs) {
|
||||
clearOptimistic(directory, sessionID)
|
||||
}
|
||||
setMeta(
|
||||
produce((draft) => {
|
||||
for (const sessionID of sessionIDs) {
|
||||
const key = keyFor(directory, sessionID)
|
||||
delete draft.limit[key]
|
||||
delete draft.cursor[key]
|
||||
delete draft.complete[key]
|
||||
delete draft.loading[key]
|
||||
}
|
||||
@@ -287,24 +187,17 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
|
||||
evict(directory, setStore, stale)
|
||||
}
|
||||
|
||||
const fetchMessages = async (input: {
|
||||
client: typeof sdk.client
|
||||
sessionID: string
|
||||
limit: number
|
||||
before?: string
|
||||
}) => {
|
||||
const fetchMessages = async (input: { client: typeof sdk.client; sessionID: string; limit: number }) => {
|
||||
const messages = await retry(() =>
|
||||
input.client.session.messages({ sessionID: input.sessionID, limit: input.limit, before: input.before }),
|
||||
input.client.session.messages({ sessionID: input.sessionID, limit: input.limit }),
|
||||
)
|
||||
const items = (messages.data ?? []).filter((x) => !!x?.info?.id)
|
||||
const session = items.map((x) => x.info).sort((a, b) => cmp(a.id, b.id))
|
||||
const part = items.map((message) => ({ id: message.info.id, part: sortParts(message.parts) }))
|
||||
const cursor = messages.response.headers.get("x-next-cursor") ?? undefined
|
||||
return {
|
||||
session,
|
||||
part,
|
||||
cursor,
|
||||
complete: !cursor,
|
||||
complete: session.length < input.limit,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -316,36 +209,25 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
|
||||
setStore: Setter
|
||||
sessionID: string
|
||||
limit: number
|
||||
before?: string
|
||||
mode?: "replace" | "prepend"
|
||||
}) => {
|
||||
const key = keyFor(input.directory, input.sessionID)
|
||||
if (meta.loading[key]) return
|
||||
|
||||
setMeta("loading", key, true)
|
||||
await fetchMessages(input)
|
||||
.then((page) => {
|
||||
.then((next) => {
|
||||
if (!tracked(input.directory, input.sessionID)) return
|
||||
const next = mergeOptimisticPage(page, getOptimistic(input.directory, input.sessionID))
|
||||
for (const messageID of next.confirmed) {
|
||||
clearOptimistic(input.directory, input.sessionID, messageID)
|
||||
}
|
||||
const [store] = globalSync.child(input.directory, { bootstrap: false })
|
||||
const cached = input.mode === "prepend" ? (store.message[input.sessionID] ?? []) : []
|
||||
const message = input.mode === "prepend" ? merge(cached, next.session) : next.session
|
||||
batch(() => {
|
||||
input.setStore("message", input.sessionID, reconcile(message, { key: "id" }))
|
||||
input.setStore("message", input.sessionID, reconcile(next.session, { key: "id" }))
|
||||
for (const p of next.part) {
|
||||
input.setStore("part", p.id, p.part)
|
||||
}
|
||||
setMeta("limit", key, message.length)
|
||||
setMeta("cursor", key, next.cursor)
|
||||
setMeta("limit", key, input.limit)
|
||||
setMeta("complete", key, next.complete)
|
||||
setSessionPrefetch({
|
||||
directory: input.directory,
|
||||
sessionID: input.sessionID,
|
||||
limit: message.length,
|
||||
cursor: next.cursor,
|
||||
limit: input.limit,
|
||||
complete: next.complete,
|
||||
})
|
||||
})
|
||||
@@ -386,15 +268,11 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
|
||||
get: getSession,
|
||||
optimistic: {
|
||||
add(input: { directory?: string; sessionID: string; message: Message; parts: Part[] }) {
|
||||
const directory = input.directory ?? sdk.directory
|
||||
const [, setStore] = target(input.directory)
|
||||
setOptimistic(directory, input.sessionID, { message: input.message, parts: input.parts })
|
||||
setOptimisticAdd(setStore as (...args: unknown[]) => void, input)
|
||||
},
|
||||
remove(input: { directory?: string; sessionID: string; messageID: string }) {
|
||||
const directory = input.directory ?? sdk.directory
|
||||
const [, setStore] = target(input.directory)
|
||||
clearOptimistic(directory, input.sessionID, input.messageID)
|
||||
setOptimisticRemove(setStore as (...args: unknown[]) => void, input)
|
||||
},
|
||||
},
|
||||
@@ -416,7 +294,6 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
|
||||
variant: input.variant,
|
||||
}
|
||||
const [, setStore] = target()
|
||||
setOptimistic(sdk.directory, input.sessionID, { message, parts: input.parts })
|
||||
setOptimisticAdd(setStore as (...args: unknown[]) => void, {
|
||||
sessionID: input.sessionID,
|
||||
message,
|
||||
@@ -435,7 +312,6 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
|
||||
if (seeded && store.message[sessionID] !== undefined && meta.limit[key] === undefined) {
|
||||
batch(() => {
|
||||
setMeta("limit", key, seeded.limit)
|
||||
setMeta("cursor", key, seeded.cursor)
|
||||
setMeta("complete", key, seeded.complete)
|
||||
setMeta("loading", key, false)
|
||||
})
|
||||
@@ -449,7 +325,6 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
|
||||
if (seeded && store.message[sessionID] !== undefined && meta.limit[key] === undefined) {
|
||||
batch(() => {
|
||||
setMeta("limit", key, seeded.limit)
|
||||
setMeta("cursor", key, seeded.cursor)
|
||||
setMeta("complete", key, seeded.complete)
|
||||
setMeta("loading", key, false)
|
||||
})
|
||||
@@ -545,7 +420,7 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
|
||||
if (store.message[sessionID] === undefined) return false
|
||||
if (meta.limit[key] === undefined) return false
|
||||
if (meta.complete[key]) return false
|
||||
return !!meta.cursor[key]
|
||||
return true
|
||||
},
|
||||
loading(sessionID: string) {
|
||||
const key = keyFor(sdk.directory, sessionID)
|
||||
@@ -560,17 +435,14 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
|
||||
const step = count ?? messagePageSize
|
||||
if (meta.loading[key]) return
|
||||
if (meta.complete[key]) return
|
||||
const before = meta.cursor[key]
|
||||
if (!before) return
|
||||
|
||||
const currentLimit = meta.limit[key] ?? messagePageSize
|
||||
await loadMessages({
|
||||
directory,
|
||||
client,
|
||||
setStore,
|
||||
sessionID,
|
||||
limit: step,
|
||||
before,
|
||||
mode: "prepend",
|
||||
limit: currentLimit + step,
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
import { dict as ar } from "@/i18n/ar"
|
||||
import { dict as br } from "@/i18n/br"
|
||||
import { dict as bs } from "@/i18n/bs"
|
||||
import { dict as da } from "@/i18n/da"
|
||||
import { dict as de } from "@/i18n/de"
|
||||
import { dict as en } from "@/i18n/en"
|
||||
import { dict as es } from "@/i18n/es"
|
||||
import { dict as fr } from "@/i18n/fr"
|
||||
import { dict as ja } from "@/i18n/ja"
|
||||
import { dict as ko } from "@/i18n/ko"
|
||||
import { dict as no } from "@/i18n/no"
|
||||
import { dict as pl } from "@/i18n/pl"
|
||||
import { dict as ru } from "@/i18n/ru"
|
||||
import { dict as th } from "@/i18n/th"
|
||||
import { dict as tr } from "@/i18n/tr"
|
||||
import { dict as zh } from "@/i18n/zh"
|
||||
import { dict as zht } from "@/i18n/zht"
|
||||
|
||||
const numbered = Array.from(
|
||||
new Set([
|
||||
en["terminal.title.numbered"],
|
||||
ar["terminal.title.numbered"],
|
||||
br["terminal.title.numbered"],
|
||||
bs["terminal.title.numbered"],
|
||||
da["terminal.title.numbered"],
|
||||
de["terminal.title.numbered"],
|
||||
es["terminal.title.numbered"],
|
||||
fr["terminal.title.numbered"],
|
||||
ja["terminal.title.numbered"],
|
||||
ko["terminal.title.numbered"],
|
||||
no["terminal.title.numbered"],
|
||||
pl["terminal.title.numbered"],
|
||||
ru["terminal.title.numbered"],
|
||||
th["terminal.title.numbered"],
|
||||
tr["terminal.title.numbered"],
|
||||
zh["terminal.title.numbered"],
|
||||
zht["terminal.title.numbered"],
|
||||
]),
|
||||
)
|
||||
|
||||
export function defaultTitle(number: number) {
|
||||
return en["terminal.title.numbered"].replace("{{number}}", String(number))
|
||||
}
|
||||
|
||||
export function isDefaultTitle(title: string, number: number) {
|
||||
return numbered.some((text) => title === text.replace("{{number}}", String(number)))
|
||||
}
|
||||
|
||||
export function titleNumber(title: string, max: number) {
|
||||
return Array.from({ length: max }, (_, idx) => idx + 1).find((number) => isDefaultTitle(title, number))
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import { batch, createEffect, createMemo, createRoot, on, onCleanup } from "soli
|
||||
import { useParams } from "@solidjs/router"
|
||||
import { useSDK } from "./sdk"
|
||||
import type { Platform } from "./platform"
|
||||
import { defaultTitle, titleNumber } from "./terminal-title"
|
||||
import { Persist, persisted, removePersisted } from "@/utils/persist"
|
||||
|
||||
export type LocalPTY = {
|
||||
@@ -34,7 +33,11 @@ function num(value: unknown) {
|
||||
}
|
||||
|
||||
function numberFromTitle(title: string) {
|
||||
return titleNumber(title, MAX_TERMINAL_SESSIONS)
|
||||
const match = title.match(/^Terminal (\d+)$/)
|
||||
if (!match) return
|
||||
const value = Number(match[1])
|
||||
if (!Number.isFinite(value) || value <= 0) return
|
||||
return value
|
||||
}
|
||||
|
||||
function pty(value: unknown): LocalPTY | undefined {
|
||||
@@ -199,13 +202,13 @@ function createWorkspaceTerminalSession(sdk: ReturnType<typeof useSDK>, dir: str
|
||||
const nextNumber = pickNextTerminalNumber()
|
||||
|
||||
sdk.client.pty
|
||||
.create({ title: defaultTitle(nextNumber) })
|
||||
.create({ title: `Terminal ${nextNumber}` })
|
||||
.then((pty: { data?: { id?: string; title?: string } }) => {
|
||||
const id = pty.data?.id
|
||||
if (!id) return
|
||||
const newTerminal = {
|
||||
id,
|
||||
title: pty.data?.title ?? defaultTitle(nextNumber),
|
||||
title: pty.data?.title ?? "Terminal",
|
||||
titleNumber: nextNumber,
|
||||
}
|
||||
setStore("all", store.all.length, newTerminal)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// @refresh reload
|
||||
|
||||
import { iife } from "@opencode-ai/util/iife"
|
||||
import { render } from "solid-js/web"
|
||||
import { AppBaseProviders, AppInterface } from "@/app"
|
||||
import { type Platform, PlatformProvider } from "@/context/platform"
|
||||
@@ -131,11 +132,7 @@ if (root instanceof HTMLElement) {
|
||||
() => (
|
||||
<PlatformProvider value={platform}>
|
||||
<AppBaseProviders>
|
||||
<AppInterface
|
||||
defaultServer={ServerConnection.Key.make(getDefaultUrl())}
|
||||
servers={[server]}
|
||||
disableHealthCheck
|
||||
/>
|
||||
<AppInterface defaultServer={ServerConnection.Key.make(getDefaultUrl())} servers={[server]} />
|
||||
</AppBaseProviders>
|
||||
</PlatformProvider>
|
||||
),
|
||||
|
||||
@@ -244,7 +244,7 @@ export const dict = {
|
||||
"prompt.example.25": "كيف تعمل متغيرات البيئة هنا؟",
|
||||
"prompt.popover.emptyResults": "لا توجد نتائج مطابقة",
|
||||
"prompt.popover.emptyCommands": "لا توجد أوامر مطابقة",
|
||||
"prompt.dropzone.label": "أفلت الصور أو ملفات PDF أو الملفات النصية هنا",
|
||||
"prompt.dropzone.label": "أفلت الصور أو ملفات PDF هنا",
|
||||
"prompt.dropzone.file.label": "أفلت لإشارة @ للملف",
|
||||
"prompt.slash.badge.custom": "مخصص",
|
||||
"prompt.slash.badge.skill": "مهارة",
|
||||
@@ -257,8 +257,8 @@ export const dict = {
|
||||
"prompt.attachment.remove": "إزالة المرفق",
|
||||
"prompt.action.send": "إرسال",
|
||||
"prompt.action.stop": "توقف",
|
||||
"prompt.toast.pasteUnsupported.title": "مرفق غير مدعوم",
|
||||
"prompt.toast.pasteUnsupported.description": "يمكن إرفاق الصور أو ملفات PDF أو الملفات النصية فقط هنا.",
|
||||
"prompt.toast.pasteUnsupported.title": "لصق غير مدعوم",
|
||||
"prompt.toast.pasteUnsupported.description": "يمكن لصق الصور أو ملفات PDF فقط هنا.",
|
||||
"prompt.toast.modelAgentRequired.title": "حدد وكيلاً ونموذجاً",
|
||||
"prompt.toast.modelAgentRequired.description": "اختر وكيلاً ونموذجاً قبل إرسال الموجه.",
|
||||
"prompt.toast.worktreeCreateFailed.title": "فشل إنشاء شجرة العمل",
|
||||
@@ -778,77 +778,4 @@ export const dict = {
|
||||
"common.time.daysAgo.short": "قبل {{count}} ي",
|
||||
"settings.providers.connected.environmentDescription": "متصل من متغيرات البيئة الخاصة بك",
|
||||
"settings.providers.custom.description": "أضف مزود متوافق مع OpenAI بواسطة عنوان URL الأساسي.",
|
||||
|
||||
"app.server.unreachable": "تعذر الوصول إلى {{server}}",
|
||||
"app.server.retrying": "جاري إعادة المحاولة تلقائيًا...",
|
||||
"app.server.otherServers": "خوادم أخرى",
|
||||
"dialog.server.add.usernamePlaceholder": "اسم المستخدم",
|
||||
"dialog.server.add.passwordPlaceholder": "كلمة المرور",
|
||||
"server.row.noUsername": "لا يوجد اسم مستخدم",
|
||||
"session.review.noVcs.createGit.title": "إنشاء مستودع Git",
|
||||
"session.review.noVcs.createGit.description": "تتبع ومراجعة والتراجع عن التغييرات في هذا المشروع",
|
||||
"session.review.noVcs.createGit.actionLoading": "جاري إنشاء مستودع Git...",
|
||||
"session.review.noVcs.createGit.action": "إنشاء مستودع Git",
|
||||
"session.todo.progress": "تم إكمال {{done}} من {{total}} مهام",
|
||||
"session.question.progress": "{{current}} من {{total}} أسئلة",
|
||||
"session.header.open.finder": "Finder",
|
||||
"session.header.open.fileExplorer": "مستكشف الملفات",
|
||||
"session.header.open.fileManager": "مدير الملفات",
|
||||
"session.header.open.app.vscode": "VS Code",
|
||||
"session.header.open.app.cursor": "Cursor",
|
||||
"session.header.open.app.zed": "Zed",
|
||||
"session.header.open.app.textmate": "TextMate",
|
||||
"session.header.open.app.antigravity": "Antigravity",
|
||||
"session.header.open.app.terminal": "المحطة الطرفية",
|
||||
"session.header.open.app.iterm2": "iTerm2",
|
||||
"session.header.open.app.ghostty": "Ghostty",
|
||||
"session.header.open.app.warp": "Warp",
|
||||
"session.header.open.app.xcode": "Xcode",
|
||||
"session.header.open.app.androidStudio": "Android Studio",
|
||||
"session.header.open.app.powershell": "PowerShell",
|
||||
"session.header.open.app.sublimeText": "Sublime Text",
|
||||
"debugBar.ariaLabel": "تشخيص أداء التطوير",
|
||||
"debugBar.na": "غير متاح",
|
||||
"debugBar.nav.label": "NAV",
|
||||
"debugBar.nav.tip": "آخر انتقال مكتمل للمسار يمس صفحة جلسة، مُقاسًا من بدء التوجيه حتى أول رسم بعد استقراره.",
|
||||
"debugBar.fps.label": "FPS",
|
||||
"debugBar.fps.tip": "الإطارات المتجددة في الثانية خلال آخر 5 ثوانٍ.",
|
||||
"debugBar.frame.label": "FRAME",
|
||||
"debugBar.frame.tip": "أسوأ وقت للإطار خلال آخر 5 ثوانٍ.",
|
||||
"debugBar.jank.label": "JANK",
|
||||
"debugBar.jank.tip": "الإطارات التي تزيد عن 32 مللي ثانية في آخر 5 ثوانٍ.",
|
||||
"debugBar.long.label": "LONG",
|
||||
"debugBar.long.tip": "الوقت المحظور وعدد المهام الطويلة في آخر 5 ثوانٍ. أقصى مهمة: {{max}}.",
|
||||
"debugBar.delay.label": "DELAY",
|
||||
"debugBar.delay.tip": "أسوأ تأخير إدخال تمت ملاحظته في آخر 5 ثوانٍ.",
|
||||
"debugBar.inp.label": "INP",
|
||||
"debugBar.inp.tip": "مدة التفاعل التقريبية خلال آخر 5 ثوانٍ. هذا يشبه INP، وليس Web Vitals INP الرسمي.",
|
||||
"debugBar.cls.label": "CLS",
|
||||
"debugBar.cls.tip": "التحول التخطيطي التراكمي لعمر التطبيق الحالي.",
|
||||
"debugBar.mem.label": "MEM",
|
||||
"debugBar.mem.tipUnavailable": "كومة JS المستخدمة مقابل حد الكومة. Chromium فقط.",
|
||||
"debugBar.mem.tip": "كومة JS المستخدمة مقابل حد الكومة. {{used}} من {{limit}}.",
|
||||
"common.key.ctrl": "Ctrl",
|
||||
"common.key.alt": "Alt",
|
||||
"common.key.shift": "Shift",
|
||||
"common.key.meta": "Meta",
|
||||
"common.key.space": "Space",
|
||||
"common.key.backspace": "Backspace",
|
||||
"common.key.enter": "Enter",
|
||||
"common.key.tab": "Tab",
|
||||
"common.key.delete": "Delete",
|
||||
"common.key.home": "Home",
|
||||
"common.key.end": "End",
|
||||
"common.key.pageUp": "Page Up",
|
||||
"common.key.pageDown": "Page Down",
|
||||
"common.key.insert": "Insert",
|
||||
"common.unknown": "غير معروف",
|
||||
"error.page.circular": "[دائري]",
|
||||
"error.globalSDK.noServerAvailable": "لا يوجد خادم متاح",
|
||||
"error.globalSDK.serverNotAvailable": "الخادم غير متاح",
|
||||
"error.childStore.persistedCacheCreateFailed": "فشل إنشاء ذاكرة التخزين المؤقت الدائمة",
|
||||
"error.childStore.persistedProjectMetadataCreateFailed": "فشل إنشاء بيانات تعريف المشروع الدائمة",
|
||||
"error.childStore.persistedProjectIconCreateFailed": "فشل إنشاء أيقونة المشروع الدائمة",
|
||||
"error.childStore.storeCreateFailed": "فشل إنشاء المخزن",
|
||||
"terminal.connectionLost.abnormalClose": "تم إغلاق WebSocket بشكل غير طبيعي: {{code}}",
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ export const dict = {
|
||||
"prompt.example.25": "Como funcionam as variáveis de ambiente aqui?",
|
||||
"prompt.popover.emptyResults": "Nenhum resultado correspondente",
|
||||
"prompt.popover.emptyCommands": "Nenhum comando correspondente",
|
||||
"prompt.dropzone.label": "Arraste imagens, PDFs ou arquivos de texto aqui",
|
||||
"prompt.dropzone.label": "Solte imagens ou PDFs aqui",
|
||||
"prompt.dropzone.file.label": "Solte para @mencionar arquivo",
|
||||
"prompt.slash.badge.custom": "personalizado",
|
||||
"prompt.slash.badge.skill": "skill",
|
||||
@@ -257,8 +257,8 @@ export const dict = {
|
||||
"prompt.attachment.remove": "Remover anexo",
|
||||
"prompt.action.send": "Enviar",
|
||||
"prompt.action.stop": "Parar",
|
||||
"prompt.toast.pasteUnsupported.title": "Anexo não suportado",
|
||||
"prompt.toast.pasteUnsupported.description": "Apenas imagens, PDFs ou arquivos de texto podem ser anexados aqui.",
|
||||
"prompt.toast.pasteUnsupported.title": "Colagem não suportada",
|
||||
"prompt.toast.pasteUnsupported.description": "Somente imagens ou PDFs podem ser colados aqui.",
|
||||
"prompt.toast.modelAgentRequired.title": "Selecione um agente e modelo",
|
||||
"prompt.toast.modelAgentRequired.description": "Escolha um agente e modelo antes de enviar um prompt.",
|
||||
"prompt.toast.worktreeCreateFailed.title": "Falha ao criar worktree",
|
||||
@@ -788,79 +788,4 @@ export const dict = {
|
||||
"common.time.daysAgo.short": "{{count}}d atrás",
|
||||
"settings.providers.connected.environmentDescription": "Conectado a partir de suas variáveis de ambiente",
|
||||
"settings.providers.custom.description": "Adicionar um provedor compatível com a OpenAI através do URL base.",
|
||||
|
||||
"app.server.unreachable": "Não foi possível conectar a {{server}}",
|
||||
"app.server.retrying": "Tentando novamente automaticamente...",
|
||||
"app.server.otherServers": "Outros servidores",
|
||||
"dialog.server.add.usernamePlaceholder": "nome de usuário",
|
||||
"dialog.server.add.passwordPlaceholder": "senha",
|
||||
"server.row.noUsername": "sem nome de usuário",
|
||||
"session.review.noVcs.createGit.title": "Criar um repositório Git",
|
||||
"session.review.noVcs.createGit.description": "Rastreie, revise e desfaça alterações neste projeto",
|
||||
"session.review.noVcs.createGit.actionLoading": "Criando repositório Git...",
|
||||
"session.review.noVcs.createGit.action": "Criar repositório Git",
|
||||
"session.todo.progress": "{{done}} de {{total}} tarefas concluídas",
|
||||
"session.question.progress": "{{current}} de {{total}} perguntas",
|
||||
"session.header.open.finder": "Finder",
|
||||
"session.header.open.fileExplorer": "Explorador de Arquivos",
|
||||
"session.header.open.fileManager": "Gerenciador de Arquivos",
|
||||
"session.header.open.app.vscode": "VS Code",
|
||||
"session.header.open.app.cursor": "Cursor",
|
||||
"session.header.open.app.zed": "Zed",
|
||||
"session.header.open.app.textmate": "TextMate",
|
||||
"session.header.open.app.antigravity": "Antigravity",
|
||||
"session.header.open.app.terminal": "Terminal",
|
||||
"session.header.open.app.iterm2": "iTerm2",
|
||||
"session.header.open.app.ghostty": "Ghostty",
|
||||
"session.header.open.app.warp": "Warp",
|
||||
"session.header.open.app.xcode": "Xcode",
|
||||
"session.header.open.app.androidStudio": "Android Studio",
|
||||
"session.header.open.app.powershell": "PowerShell",
|
||||
"session.header.open.app.sublimeText": "Sublime Text",
|
||||
"debugBar.ariaLabel": "Diagnóstico de desempenho de desenvolvimento",
|
||||
"debugBar.na": "n/a",
|
||||
"debugBar.nav.label": "NAV",
|
||||
"debugBar.nav.tip":
|
||||
"Última transição de rota concluída tocando em uma página de sessão, medida desde o início do roteador até a primeira pintura após o estabelecimento.",
|
||||
"debugBar.fps.label": "FPS",
|
||||
"debugBar.fps.tip": "Quadros por segundo nos últimos 5 segundos.",
|
||||
"debugBar.frame.label": "FRAME",
|
||||
"debugBar.frame.tip": "Pior tempo de quadro nos últimos 5 segundos.",
|
||||
"debugBar.jank.label": "JANK",
|
||||
"debugBar.jank.tip": "Quadros acima de 32ms nos últimos 5 segundos.",
|
||||
"debugBar.long.label": "LONG",
|
||||
"debugBar.long.tip": "Tempo bloqueado e contagem de tarefas longas nos últimos 5 segundos. Tarefa máx: {{max}}.",
|
||||
"debugBar.delay.label": "DELAY",
|
||||
"debugBar.delay.tip": "Pior atraso de entrada observado nos últimos 5 segundos.",
|
||||
"debugBar.inp.label": "INP",
|
||||
"debugBar.inp.tip":
|
||||
"Duração aproximada da interação nos últimos 5 segundos. Isso é semelhante ao INP, não o INP oficial do Web Vitals.",
|
||||
"debugBar.cls.label": "CLS",
|
||||
"debugBar.cls.tip": "Mudança cumulativa de layout para o tempo de vida atual do aplicativo.",
|
||||
"debugBar.mem.label": "MEM",
|
||||
"debugBar.mem.tipUnavailable": "Heap JS usado vs limite de heap. Apenas Chromium.",
|
||||
"debugBar.mem.tip": "Heap JS usado vs limite de heap. {{used}} de {{limit}}.",
|
||||
"common.key.ctrl": "Ctrl",
|
||||
"common.key.alt": "Alt",
|
||||
"common.key.shift": "Shift",
|
||||
"common.key.meta": "Meta",
|
||||
"common.key.space": "Espaço",
|
||||
"common.key.backspace": "Backspace",
|
||||
"common.key.enter": "Enter",
|
||||
"common.key.tab": "Tab",
|
||||
"common.key.delete": "Delete",
|
||||
"common.key.home": "Home",
|
||||
"common.key.end": "End",
|
||||
"common.key.pageUp": "Page Up",
|
||||
"common.key.pageDown": "Page Down",
|
||||
"common.key.insert": "Insert",
|
||||
"common.unknown": "desconhecido",
|
||||
"error.page.circular": "[Circular]",
|
||||
"error.globalSDK.noServerAvailable": "Nenhum servidor disponível",
|
||||
"error.globalSDK.serverNotAvailable": "Servidor indisponível",
|
||||
"error.childStore.persistedCacheCreateFailed": "Falha ao criar cache persistente",
|
||||
"error.childStore.persistedProjectMetadataCreateFailed": "Falha ao criar metadados de projeto persistentes",
|
||||
"error.childStore.persistedProjectIconCreateFailed": "Falha ao criar ícone de projeto persistente",
|
||||
"error.childStore.storeCreateFailed": "Falha ao criar armazenamento",
|
||||
"terminal.connectionLost.abnormalClose": "WebSocket fechado anormalmente: {{code}}",
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ export const dict = {
|
||||
|
||||
"prompt.popover.emptyResults": "Nema rezultata",
|
||||
"prompt.popover.emptyCommands": "Nema komandi",
|
||||
"prompt.dropzone.label": "Ovdje prevucite slike, PDF-ove ili tekstualne datoteke",
|
||||
"prompt.dropzone.label": "Spusti slike ili PDF-ove ovdje",
|
||||
"prompt.dropzone.file.label": "Spusti za @spominjanje datoteke",
|
||||
"prompt.slash.badge.custom": "prilagođeno",
|
||||
"prompt.slash.badge.skill": "skill",
|
||||
@@ -278,8 +278,8 @@ export const dict = {
|
||||
"prompt.action.send": "Pošalji",
|
||||
"prompt.action.stop": "Zaustavi",
|
||||
|
||||
"prompt.toast.pasteUnsupported.title": "Nepodržan prilog",
|
||||
"prompt.toast.pasteUnsupported.description": "Ovdje se mogu priložiti samo slike, PDF-ovi ili tekstualne datoteke.",
|
||||
"prompt.toast.pasteUnsupported.title": "Nepodržano lijepljenje",
|
||||
"prompt.toast.pasteUnsupported.description": "Ovdje se mogu zalijepiti samo slike ili PDF-ovi.",
|
||||
"prompt.toast.modelAgentRequired.title": "Odaberi agenta i model",
|
||||
"prompt.toast.modelAgentRequired.description": "Odaberi agenta i model prije slanja upita.",
|
||||
"prompt.toast.worktreeCreateFailed.title": "Neuspješno kreiranje worktree-a",
|
||||
@@ -864,79 +864,4 @@ export const dict = {
|
||||
"common.time.daysAgo.short": "prije {{count}} d",
|
||||
"settings.providers.connected.environmentDescription": "Povezano sa vašim varijablama okruženja",
|
||||
"settings.providers.custom.description": "Dodajte provajdera kompatibilnog s OpenAI putem osnovnog URL-a.",
|
||||
|
||||
"app.server.unreachable": "Nije moguće pristupiti {{server}}",
|
||||
"app.server.retrying": "Automatski ponovni pokušaj...",
|
||||
"app.server.otherServers": "Drugi serveri",
|
||||
"dialog.server.add.usernamePlaceholder": "korisničko ime",
|
||||
"dialog.server.add.passwordPlaceholder": "lozinka",
|
||||
"server.row.noUsername": "nema korisničkog imena",
|
||||
"session.review.noVcs.createGit.title": "Kreiraj Git repozitorij",
|
||||
"session.review.noVcs.createGit.description": "Pratite, pregledajte i poništite promjene u ovom projektu",
|
||||
"session.review.noVcs.createGit.actionLoading": "Kreiranje Git repozitorija...",
|
||||
"session.review.noVcs.createGit.action": "Kreiraj Git repozitorij",
|
||||
"session.todo.progress": "{{done}} od {{total}} zadataka završeno",
|
||||
"session.question.progress": "{{current}} od {{total}} pitanja",
|
||||
"session.header.open.finder": "Finder",
|
||||
"session.header.open.fileExplorer": "File Explorer",
|
||||
"session.header.open.fileManager": "File Manager",
|
||||
"session.header.open.app.vscode": "VS Code",
|
||||
"session.header.open.app.cursor": "Cursor",
|
||||
"session.header.open.app.zed": "Zed",
|
||||
"session.header.open.app.textmate": "TextMate",
|
||||
"session.header.open.app.antigravity": "Antigravity",
|
||||
"session.header.open.app.terminal": "Terminal",
|
||||
"session.header.open.app.iterm2": "iTerm2",
|
||||
"session.header.open.app.ghostty": "Ghostty",
|
||||
"session.header.open.app.warp": "Warp",
|
||||
"session.header.open.app.xcode": "Xcode",
|
||||
"session.header.open.app.androidStudio": "Android Studio",
|
||||
"session.header.open.app.powershell": "PowerShell",
|
||||
"session.header.open.app.sublimeText": "Sublime Text",
|
||||
"debugBar.ariaLabel": "Dijagnostika performansi razvoja",
|
||||
"debugBar.na": "n/a",
|
||||
"debugBar.nav.label": "NAV",
|
||||
"debugBar.nav.tip":
|
||||
"Posljednji završeni prelazak rute koji dotiče stranicu sesije, mjeren od početka rutera do prvog iscrtavanja nakon smirivanja.",
|
||||
"debugBar.fps.label": "FPS",
|
||||
"debugBar.fps.tip": "Kadrovi u sekundi tokom posljednjih 5 sekundi.",
|
||||
"debugBar.frame.label": "FRAME",
|
||||
"debugBar.frame.tip": "Najgore vrijeme kadra u posljednjih 5 sekundi.",
|
||||
"debugBar.jank.label": "JANK",
|
||||
"debugBar.jank.tip": "Kadrovi duži od 32ms u posljednjih 5 sekundi.",
|
||||
"debugBar.long.label": "LONG",
|
||||
"debugBar.long.tip": "Blokirano vrijeme i broj dugih zadataka u posljednjih 5 sekundi. Maks zadatak: {{max}}.",
|
||||
"debugBar.delay.label": "DELAY",
|
||||
"debugBar.delay.tip": "Najgore zabilježeno kašnjenje unosa u posljednjih 5 sekundi.",
|
||||
"debugBar.inp.label": "INP",
|
||||
"debugBar.inp.tip":
|
||||
"Približno trajanje interakcije tokom posljednjih 5 sekundi. Ovo je slično INP-u, nije službeni Web Vitals INP.",
|
||||
"debugBar.cls.label": "CLS",
|
||||
"debugBar.cls.tip": "Kumulativni pomak rasporeda za trenutni životni vijek aplikacije.",
|
||||
"debugBar.mem.label": "MEM",
|
||||
"debugBar.mem.tipUnavailable": "Korišteni JS heap naspram limita heapa. Samo Chromium.",
|
||||
"debugBar.mem.tip": "Korišteni JS heap naspram limita heapa. {{used}} od {{limit}}.",
|
||||
"common.key.ctrl": "Ctrl",
|
||||
"common.key.alt": "Alt",
|
||||
"common.key.shift": "Shift",
|
||||
"common.key.meta": "Meta",
|
||||
"common.key.space": "Space",
|
||||
"common.key.backspace": "Backspace",
|
||||
"common.key.enter": "Enter",
|
||||
"common.key.tab": "Tab",
|
||||
"common.key.delete": "Delete",
|
||||
"common.key.home": "Home",
|
||||
"common.key.end": "End",
|
||||
"common.key.pageUp": "Page Up",
|
||||
"common.key.pageDown": "Page Down",
|
||||
"common.key.insert": "Insert",
|
||||
"common.unknown": "nepoznato",
|
||||
"error.page.circular": "[Kružno]",
|
||||
"error.globalSDK.noServerAvailable": "Nema dostupnog servera",
|
||||
"error.globalSDK.serverNotAvailable": "Server nije dostupan",
|
||||
"error.childStore.persistedCacheCreateFailed": "Nije uspjelo kreiranje trajnog keša",
|
||||
"error.childStore.persistedProjectMetadataCreateFailed": "Nije uspjelo kreiranje trajnih metapodataka projekta",
|
||||
"error.childStore.persistedProjectIconCreateFailed": "Nije uspjelo kreiranje trajne ikone projekta",
|
||||
"error.childStore.storeCreateFailed": "Nije uspjelo kreiranje skladišta",
|
||||
"terminal.connectionLost.abnormalClose": "WebSocket zatvoren nenormalno: {{code}}",
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ export const dict = {
|
||||
|
||||
"prompt.popover.emptyResults": "Ingen matchende resultater",
|
||||
"prompt.popover.emptyCommands": "Ingen matchende kommandoer",
|
||||
"prompt.dropzone.label": "Slip billeder, PDF'er eller tekstfiler her",
|
||||
"prompt.dropzone.label": "Slip billeder eller PDF'er her",
|
||||
"prompt.dropzone.file.label": "Slip for at @nævne fil",
|
||||
"prompt.slash.badge.custom": "brugerdefineret",
|
||||
"prompt.slash.badge.skill": "skill",
|
||||
@@ -276,8 +276,8 @@ export const dict = {
|
||||
"prompt.action.send": "Send",
|
||||
"prompt.action.stop": "Stop",
|
||||
|
||||
"prompt.toast.pasteUnsupported.title": "Ikke understøttet vedhæftning",
|
||||
"prompt.toast.pasteUnsupported.description": "Kun billeder, PDF'er eller tekstfiler kan vedhæftes her.",
|
||||
"prompt.toast.pasteUnsupported.title": "Ikke understøttet indsæt",
|
||||
"prompt.toast.pasteUnsupported.description": "Kun billeder eller PDF'er kan indsættes her.",
|
||||
"prompt.toast.modelAgentRequired.title": "Vælg en agent og model",
|
||||
"prompt.toast.modelAgentRequired.description": "Vælg en agent og model før du sender en forespørgsel.",
|
||||
"prompt.toast.worktreeCreateFailed.title": "Kunne ikke oprette worktree",
|
||||
@@ -858,79 +858,4 @@ export const dict = {
|
||||
"common.time.daysAgo.short": "{{count}}d siden",
|
||||
"settings.providers.connected.environmentDescription": "Tilsluttet fra dine miljøvariabler",
|
||||
"settings.providers.custom.description": "Tilføj en OpenAI-kompatibel udbyder via basis-URL.",
|
||||
|
||||
"app.server.unreachable": "Kunne ikke nå {{server}}",
|
||||
"app.server.retrying": "Prøver igen automatisk...",
|
||||
"app.server.otherServers": "Andre servere",
|
||||
"dialog.server.add.usernamePlaceholder": "brugernavn",
|
||||
"dialog.server.add.passwordPlaceholder": "adgangskode",
|
||||
"server.row.noUsername": "intet brugernavn",
|
||||
"session.review.noVcs.createGit.title": "Opret et Git-repository",
|
||||
"session.review.noVcs.createGit.description": "Spor, gennemgå og fortryd ændringer i dette projekt",
|
||||
"session.review.noVcs.createGit.actionLoading": "Opretter Git-repository...",
|
||||
"session.review.noVcs.createGit.action": "Opret Git-repository",
|
||||
"session.todo.progress": "{{done}} af {{total}} opgaver fuldført",
|
||||
"session.question.progress": "{{current}} af {{total}} spørgsmål",
|
||||
"session.header.open.finder": "Finder",
|
||||
"session.header.open.fileExplorer": "Stifinder",
|
||||
"session.header.open.fileManager": "Filhåndtering",
|
||||
"session.header.open.app.vscode": "VS Code",
|
||||
"session.header.open.app.cursor": "Cursor",
|
||||
"session.header.open.app.zed": "Zed",
|
||||
"session.header.open.app.textmate": "TextMate",
|
||||
"session.header.open.app.antigravity": "Antigravity",
|
||||
"session.header.open.app.terminal": "Terminal",
|
||||
"session.header.open.app.iterm2": "iTerm2",
|
||||
"session.header.open.app.ghostty": "Ghostty",
|
||||
"session.header.open.app.warp": "Warp",
|
||||
"session.header.open.app.xcode": "Xcode",
|
||||
"session.header.open.app.androidStudio": "Android Studio",
|
||||
"session.header.open.app.powershell": "PowerShell",
|
||||
"session.header.open.app.sublimeText": "Sublime Text",
|
||||
"debugBar.ariaLabel": "Udviklingsydelsesdiagnostik",
|
||||
"debugBar.na": "n/a",
|
||||
"debugBar.nav.label": "NAV",
|
||||
"debugBar.nav.tip":
|
||||
"Sidste gennemførte ruteovergang, der berører en sessionsside, målt fra routerstart til den første optegning efter den falder til ro.",
|
||||
"debugBar.fps.label": "FPS",
|
||||
"debugBar.fps.tip": "Rullende billeder pr. sekund over de sidste 5 sekunder.",
|
||||
"debugBar.frame.label": "FRAME",
|
||||
"debugBar.frame.tip": "Værste billedtid over de sidste 5 sekunder.",
|
||||
"debugBar.jank.label": "JANK",
|
||||
"debugBar.jank.tip": "Billeder over 32ms i de sidste 5 sekunder.",
|
||||
"debugBar.long.label": "LONG",
|
||||
"debugBar.long.tip": "Blokeret tid og antal lange opgaver i de sidste 5 sekunder. Maks opgave: {{max}}.",
|
||||
"debugBar.delay.label": "DELAY",
|
||||
"debugBar.delay.tip": "Værste observerede inputforsinkelse i de sidste 5 sekunder.",
|
||||
"debugBar.inp.label": "INP",
|
||||
"debugBar.inp.tip":
|
||||
"Omtrentlig interaktionsvarighed over de sidste 5 sekunder. Dette er INP-lignende, ikke den officielle Web Vitals INP.",
|
||||
"debugBar.cls.label": "CLS",
|
||||
"debugBar.cls.tip": "Kumulativt layoutskift for den nuværende app-levetid.",
|
||||
"debugBar.mem.label": "MEM",
|
||||
"debugBar.mem.tipUnavailable": "Brugt JS-heap vs heap-grænse. Kun Chromium.",
|
||||
"debugBar.mem.tip": "Brugt JS-heap vs heap-grænse. {{used}} af {{limit}}.",
|
||||
"common.key.ctrl": "Ctrl",
|
||||
"common.key.alt": "Alt",
|
||||
"common.key.shift": "Shift",
|
||||
"common.key.meta": "Meta",
|
||||
"common.key.space": "Mellemrum",
|
||||
"common.key.backspace": "Backspace",
|
||||
"common.key.enter": "Enter",
|
||||
"common.key.tab": "Tab",
|
||||
"common.key.delete": "Delete",
|
||||
"common.key.home": "Home",
|
||||
"common.key.end": "End",
|
||||
"common.key.pageUp": "Page Up",
|
||||
"common.key.pageDown": "Page Down",
|
||||
"common.key.insert": "Insert",
|
||||
"common.unknown": "ukendt",
|
||||
"error.page.circular": "[Cirkulær]",
|
||||
"error.globalSDK.noServerAvailable": "Ingen server tilgængelig",
|
||||
"error.globalSDK.serverNotAvailable": "Server ikke tilgængelig",
|
||||
"error.childStore.persistedCacheCreateFailed": "Kunne ikke oprette vedvarende cache",
|
||||
"error.childStore.persistedProjectMetadataCreateFailed": "Kunne ikke oprette vedvarende projektmetadata",
|
||||
"error.childStore.persistedProjectIconCreateFailed": "Kunne ikke oprette vedvarende projektikon",
|
||||
"error.childStore.storeCreateFailed": "Kunne ikke oprette lager",
|
||||
"terminal.connectionLost.abnormalClose": "WebSocket lukkede unormalt: {{code}}",
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ export const dict = {
|
||||
"prompt.example.25": "Wie funktionieren Umgebungsvariablen hier?",
|
||||
"prompt.popover.emptyResults": "Keine passenden Ergebnisse",
|
||||
"prompt.popover.emptyCommands": "Keine passenden Befehle",
|
||||
"prompt.dropzone.label": "Bilder, PDFs oder Textdateien hier ablegen",
|
||||
"prompt.dropzone.label": "Bilder oder PDFs hier ablegen",
|
||||
"prompt.dropzone.file.label": "Ablegen zum @Erwähnen der Datei",
|
||||
"prompt.slash.badge.custom": "benutzerdefiniert",
|
||||
"prompt.slash.badge.skill": "Skill",
|
||||
@@ -262,8 +262,8 @@ export const dict = {
|
||||
"prompt.attachment.remove": "Anhang entfernen",
|
||||
"prompt.action.send": "Senden",
|
||||
"prompt.action.stop": "Stopp",
|
||||
"prompt.toast.pasteUnsupported.title": "Nicht unterstützter Anhang",
|
||||
"prompt.toast.pasteUnsupported.description": "Hier können nur Bilder, PDFs oder Textdateien angehängt werden.",
|
||||
"prompt.toast.pasteUnsupported.title": "Nicht unterstütztes Einfügen",
|
||||
"prompt.toast.pasteUnsupported.description": "Hier können nur Bilder oder PDFs eingefügt werden.",
|
||||
"prompt.toast.modelAgentRequired.title": "Wählen Sie einen Agenten und ein Modell",
|
||||
"prompt.toast.modelAgentRequired.description":
|
||||
"Wählen Sie einen Agenten und ein Modell, bevor Sie eine Eingabe senden.",
|
||||
@@ -799,80 +799,4 @@ export const dict = {
|
||||
"common.time.daysAgo.short": "vor {{count}} Tg",
|
||||
"settings.providers.connected.environmentDescription": "Verbunden aus Ihren Umgebungsvariablen",
|
||||
"settings.providers.custom.description": "Fügen Sie einen OpenAI-kompatiblen Anbieter per Basis-URL hinzu.",
|
||||
|
||||
"app.server.unreachable": "Konnte {{server}} nicht erreichen",
|
||||
"app.server.retrying": "Automatische erneute Verbindung...",
|
||||
"app.server.otherServers": "Andere Server",
|
||||
"dialog.server.add.usernamePlaceholder": "Benutzername",
|
||||
"dialog.server.add.passwordPlaceholder": "Passwort",
|
||||
"server.row.noUsername": "Kein Benutzername",
|
||||
"session.review.noVcs.createGit.title": "Git-Repository erstellen",
|
||||
"session.review.noVcs.createGit.description":
|
||||
"Änderungen in diesem Projekt verfolgen, überprüfen und rückgängig machen",
|
||||
"session.review.noVcs.createGit.actionLoading": "Git-Repository wird erstellt...",
|
||||
"session.review.noVcs.createGit.action": "Git-Repository erstellen",
|
||||
"session.todo.progress": "{{done}} von {{total}} Aufgaben erledigt",
|
||||
"session.question.progress": "{{current}} von {{total}} Fragen",
|
||||
"session.header.open.finder": "Finder",
|
||||
"session.header.open.fileExplorer": "Datei-Explorer",
|
||||
"session.header.open.fileManager": "Dateimanager",
|
||||
"session.header.open.app.vscode": "VS Code",
|
||||
"session.header.open.app.cursor": "Cursor",
|
||||
"session.header.open.app.zed": "Zed",
|
||||
"session.header.open.app.textmate": "TextMate",
|
||||
"session.header.open.app.antigravity": "Antigravity",
|
||||
"session.header.open.app.terminal": "Terminal",
|
||||
"session.header.open.app.iterm2": "iTerm2",
|
||||
"session.header.open.app.ghostty": "Ghostty",
|
||||
"session.header.open.app.warp": "Warp",
|
||||
"session.header.open.app.xcode": "Xcode",
|
||||
"session.header.open.app.androidStudio": "Android Studio",
|
||||
"session.header.open.app.powershell": "PowerShell",
|
||||
"session.header.open.app.sublimeText": "Sublime Text",
|
||||
"debugBar.ariaLabel": "Entwicklungs-Leistungsdiagnose",
|
||||
"debugBar.na": "n.v.",
|
||||
"debugBar.nav.label": "NAV",
|
||||
"debugBar.nav.tip":
|
||||
"Letzter abgeschlossener Routenübergang, der eine Sitzungsseite berührt, gemessen vom Start des Routers bis zum ersten Rendern nach dem Einschwingen.",
|
||||
"debugBar.fps.label": "FPS",
|
||||
"debugBar.fps.tip": "Gleitende Bilder pro Sekunde in den letzten 5 Sekunden.",
|
||||
"debugBar.frame.label": "FRAME",
|
||||
"debugBar.frame.tip": "Schlechteste Frame-Zeit in den letzten 5 Sekunden.",
|
||||
"debugBar.jank.label": "JANK",
|
||||
"debugBar.jank.tip": "Frames über 32ms in den letzten 5 Sekunden.",
|
||||
"debugBar.long.label": "LONG",
|
||||
"debugBar.long.tip": "Blockierte Zeit und Anzahl langer Aufgaben in den letzten 5 Sekunden. Max Aufgabe: {{max}}.",
|
||||
"debugBar.delay.label": "DELAY",
|
||||
"debugBar.delay.tip": "Schlechteste beobachtete Eingabeverzögerung in den letzten 5 Sekunden.",
|
||||
"debugBar.inp.label": "INP",
|
||||
"debugBar.inp.tip":
|
||||
"Ungefähre Interaktionsdauer in den letzten 5 Sekunden. Dies ist INP-ähnlich, nicht das offizielle Web Vitals INP.",
|
||||
"debugBar.cls.label": "CLS",
|
||||
"debugBar.cls.tip": "Kumulative Layoutverschiebung für die aktuelle App-Lebensdauer.",
|
||||
"debugBar.mem.label": "MEM",
|
||||
"debugBar.mem.tipUnavailable": "Verwendeter JS-Heap vs Heap-Limit. Nur Chromium.",
|
||||
"debugBar.mem.tip": "Verwendeter JS-Heap vs Heap-Limit. {{used}} von {{limit}}.",
|
||||
"common.key.ctrl": "Strg",
|
||||
"common.key.alt": "Alt",
|
||||
"common.key.shift": "Umschalt",
|
||||
"common.key.meta": "Meta",
|
||||
"common.key.space": "Leertaste",
|
||||
"common.key.backspace": "Rücktaste",
|
||||
"common.key.enter": "Eingabe",
|
||||
"common.key.tab": "Tab",
|
||||
"common.key.delete": "Entf",
|
||||
"common.key.home": "Pos1",
|
||||
"common.key.end": "Ende",
|
||||
"common.key.pageUp": "Bild auf",
|
||||
"common.key.pageDown": "Bild ab",
|
||||
"common.key.insert": "Einfg",
|
||||
"common.unknown": "unbekannt",
|
||||
"error.page.circular": "[Zirkulär]",
|
||||
"error.globalSDK.noServerAvailable": "Kein Server verfügbar",
|
||||
"error.globalSDK.serverNotAvailable": "Server nicht verfügbar",
|
||||
"error.childStore.persistedCacheCreateFailed": "Dauerhafter Cache konnte nicht erstellt werden",
|
||||
"error.childStore.persistedProjectMetadataCreateFailed": "Dauerhafte Projektmetadaten konnten nicht erstellt werden",
|
||||
"error.childStore.persistedProjectIconCreateFailed": "Dauerhaftes Projekticon konnte nicht erstellt werden",
|
||||
"error.childStore.storeCreateFailed": "Speicher konnte nicht erstellt werden",
|
||||
"terminal.connectionLost.abnormalClose": "WebSocket abnormal geschlossen: {{code}}",
|
||||
} satisfies Partial<Record<Keys, string>>
|
||||
|
||||
@@ -264,7 +264,7 @@ export const dict = {
|
||||
|
||||
"prompt.popover.emptyResults": "No matching results",
|
||||
"prompt.popover.emptyCommands": "No matching commands",
|
||||
"prompt.dropzone.label": "Drop images, PDFs, or text files here",
|
||||
"prompt.dropzone.label": "Drop images or PDFs here",
|
||||
"prompt.dropzone.file.label": "Drop to @mention file",
|
||||
"prompt.slash.badge.custom": "custom",
|
||||
"prompt.slash.badge.skill": "skill",
|
||||
@@ -278,8 +278,8 @@ export const dict = {
|
||||
"prompt.action.send": "Send",
|
||||
"prompt.action.stop": "Stop",
|
||||
|
||||
"prompt.toast.pasteUnsupported.title": "Unsupported attachment",
|
||||
"prompt.toast.pasteUnsupported.description": "Only images, PDFs, or text files can be attached here.",
|
||||
"prompt.toast.pasteUnsupported.title": "Unsupported paste",
|
||||
"prompt.toast.pasteUnsupported.description": "Only images or PDFs can be pasted here.",
|
||||
"prompt.toast.modelAgentRequired.title": "Select an agent and model",
|
||||
"prompt.toast.modelAgentRequired.description": "Choose an agent and model before sending a prompt.",
|
||||
"prompt.toast.worktreeCreateFailed.title": "Failed to create worktree",
|
||||
@@ -306,10 +306,6 @@ export const dict = {
|
||||
"dialog.directory.search.placeholder": "Search folders",
|
||||
"dialog.directory.empty": "No folders found",
|
||||
|
||||
"app.server.unreachable": "Could not reach {{server}}",
|
||||
"app.server.retrying": "Retrying automatically...",
|
||||
"app.server.otherServers": "Other servers",
|
||||
|
||||
"dialog.server.title": "Servers",
|
||||
"dialog.server.description": "Switch which OpenCode server this app connects to.",
|
||||
"dialog.server.search.placeholder": "Search servers",
|
||||
@@ -323,9 +319,7 @@ export const dict = {
|
||||
"dialog.server.add.name": "Server name (optional)",
|
||||
"dialog.server.add.namePlaceholder": "Localhost",
|
||||
"dialog.server.add.username": "Username (optional)",
|
||||
"dialog.server.add.usernamePlaceholder": "username",
|
||||
"dialog.server.add.password": "Password (optional)",
|
||||
"dialog.server.add.passwordPlaceholder": "password",
|
||||
"dialog.server.edit.title": "Edit server",
|
||||
"dialog.server.default.title": "Default server",
|
||||
"dialog.server.default.description":
|
||||
@@ -341,7 +335,6 @@ export const dict = {
|
||||
"dialog.server.menu.delete": "Delete",
|
||||
"dialog.server.current": "Current Server",
|
||||
"dialog.server.status.default": "Default",
|
||||
"server.row.noUsername": "no username",
|
||||
|
||||
"dialog.project.edit.title": "Edit project",
|
||||
"dialog.project.edit.name": "Name",
|
||||
@@ -463,7 +456,6 @@ export const dict = {
|
||||
"error.page.action.checking": "Checking...",
|
||||
"error.page.action.checkUpdates": "Check for updates",
|
||||
"error.page.action.updateTo": "Update to {{version}}",
|
||||
"error.page.circular": "[Circular]",
|
||||
"error.page.report.prefix": "Please report this error to the OpenCode team",
|
||||
"error.page.report.discord": "on Discord",
|
||||
"error.page.version": "Version: {{version}}",
|
||||
@@ -472,12 +464,6 @@ export const dict = {
|
||||
"Root element not found. Did you forget to add it to your index.html? Or maybe the id attribute got misspelled?",
|
||||
|
||||
"error.globalSync.connectFailed": "Could not connect to server. Is there a server running at `{{url}}`?",
|
||||
"error.globalSDK.noServerAvailable": "No server available",
|
||||
"error.globalSDK.serverNotAvailable": "Server not available",
|
||||
"error.childStore.persistedCacheCreateFailed": "Failed to create persisted cache",
|
||||
"error.childStore.persistedProjectMetadataCreateFailed": "Failed to create persisted project metadata",
|
||||
"error.childStore.persistedProjectIconCreateFailed": "Failed to create persisted project icon",
|
||||
"error.childStore.storeCreateFailed": "Failed to create store",
|
||||
"directory.error.invalidUrl": "Invalid directory in URL.",
|
||||
|
||||
"error.chain.unknown": "Unknown error",
|
||||
@@ -526,10 +512,6 @@ export const dict = {
|
||||
"session.review.loadingChanges": "Loading changes...",
|
||||
"session.review.empty": "No changes in this session yet",
|
||||
"session.review.noVcs": "No Git Version Control System detected, changes not displayed",
|
||||
"session.review.noVcs.createGit.title": "Create a Git repository",
|
||||
"session.review.noVcs.createGit.description": "Track, review, and undo changes in this project",
|
||||
"session.review.noVcs.createGit.actionLoading": "Creating Git repository...",
|
||||
"session.review.noVcs.createGit.action": "Create Git repository",
|
||||
"session.review.noSnapshot": "Snapshot tracking is disabled in config, so session changes are unavailable",
|
||||
"session.review.noChanges": "No changes",
|
||||
|
||||
@@ -548,8 +530,6 @@ export const dict = {
|
||||
"session.todo.title": "Todos",
|
||||
"session.todo.collapse": "Collapse",
|
||||
"session.todo.expand": "Expand",
|
||||
"session.todo.progress": "{{done}} of {{total}} todos completed",
|
||||
"session.question.progress": "{{current}} of {{total}} questions",
|
||||
"session.followupDock.summary.one": "{{count}} queued message",
|
||||
"session.followupDock.summary.other": "{{count}} queued messages",
|
||||
"session.followupDock.sendNow": "Send now",
|
||||
@@ -575,22 +555,6 @@ export const dict = {
|
||||
"session.header.open.ariaLabel": "Open in {{app}}",
|
||||
"session.header.open.menu": "Open options",
|
||||
"session.header.open.copyPath": "Copy path",
|
||||
"session.header.open.finder": "Finder",
|
||||
"session.header.open.fileExplorer": "File Explorer",
|
||||
"session.header.open.fileManager": "File Manager",
|
||||
"session.header.open.app.vscode": "VS Code",
|
||||
"session.header.open.app.cursor": "Cursor",
|
||||
"session.header.open.app.zed": "Zed",
|
||||
"session.header.open.app.textmate": "TextMate",
|
||||
"session.header.open.app.antigravity": "Antigravity",
|
||||
"session.header.open.app.terminal": "Terminal",
|
||||
"session.header.open.app.iterm2": "iTerm2",
|
||||
"session.header.open.app.ghostty": "Ghostty",
|
||||
"session.header.open.app.warp": "Warp",
|
||||
"session.header.open.app.xcode": "Xcode",
|
||||
"session.header.open.app.androidStudio": "Android Studio",
|
||||
"session.header.open.app.powershell": "PowerShell",
|
||||
"session.header.open.app.sublimeText": "Sublime Text",
|
||||
|
||||
"status.popover.trigger": "Status",
|
||||
"status.popover.ariaLabel": "Server configurations",
|
||||
@@ -623,7 +587,6 @@ export const dict = {
|
||||
"terminal.title.numbered": "Terminal {{number}}",
|
||||
"terminal.close": "Close terminal",
|
||||
"terminal.connectionLost.title": "Connection Lost",
|
||||
"terminal.connectionLost.abnormalClose": "WebSocket closed abnormally: {{code}}",
|
||||
"terminal.connectionLost.description":
|
||||
"The terminal connection was interrupted. This can happen when the server restarts.",
|
||||
|
||||
@@ -641,21 +604,6 @@ export const dict = {
|
||||
"common.edit": "Edit",
|
||||
"common.loadMore": "Load more",
|
||||
"common.key.esc": "ESC",
|
||||
"common.key.ctrl": "Ctrl",
|
||||
"common.key.alt": "Alt",
|
||||
"common.key.shift": "Shift",
|
||||
"common.key.meta": "Meta",
|
||||
"common.key.space": "Space",
|
||||
"common.key.backspace": "Backspace",
|
||||
"common.key.enter": "Enter",
|
||||
"common.key.tab": "Tab",
|
||||
"common.key.delete": "Delete",
|
||||
"common.key.home": "Home",
|
||||
"common.key.end": "End",
|
||||
"common.key.pageUp": "Page Up",
|
||||
"common.key.pageDown": "Page Down",
|
||||
"common.key.insert": "Insert",
|
||||
"common.unknown": "unknown",
|
||||
|
||||
"common.time.justNow": "Just now",
|
||||
"common.time.minutesAgo.short": "{{count}}m ago",
|
||||
@@ -675,30 +623,6 @@ export const dict = {
|
||||
"sidebar.project.viewAllSessions": "View all sessions",
|
||||
"sidebar.project.clearNotifications": "Clear notifications",
|
||||
|
||||
"debugBar.ariaLabel": "Development performance diagnostics",
|
||||
"debugBar.na": "n/a",
|
||||
"debugBar.nav.label": "NAV",
|
||||
"debugBar.nav.tip":
|
||||
"Last completed route transition touching a session page, measured from router start until the first paint after it settles.",
|
||||
"debugBar.fps.label": "FPS",
|
||||
"debugBar.fps.tip": "Rolling frames per second over the last 5 seconds.",
|
||||
"debugBar.frame.label": "FRAME",
|
||||
"debugBar.frame.tip": "Worst frame time over the last 5 seconds.",
|
||||
"debugBar.jank.label": "JANK",
|
||||
"debugBar.jank.tip": "Frames over 32ms in the last 5 seconds.",
|
||||
"debugBar.long.label": "LONG",
|
||||
"debugBar.long.tip": "Blocked time and long-task count in the last 5 seconds. Max task: {{max}}.",
|
||||
"debugBar.delay.label": "DELAY",
|
||||
"debugBar.delay.tip": "Worst observed input delay in the last 5 seconds.",
|
||||
"debugBar.inp.label": "INP",
|
||||
"debugBar.inp.tip":
|
||||
"Approximate interaction duration over the last 5 seconds. This is INP-like, not the official Web Vitals INP.",
|
||||
"debugBar.cls.label": "CLS",
|
||||
"debugBar.cls.tip": "Cumulative layout shift for the current app lifetime.",
|
||||
"debugBar.mem.label": "MEM",
|
||||
"debugBar.mem.tipUnavailable": "Used JS heap vs heap limit. Chromium only.",
|
||||
"debugBar.mem.tip": "Used JS heap vs heap limit. {{used}} of {{limit}}.",
|
||||
|
||||
"app.name.desktop": "OpenCode Desktop",
|
||||
|
||||
"settings.section.desktop": "Desktop",
|
||||
|
||||
@@ -263,7 +263,7 @@ export const dict = {
|
||||
|
||||
"prompt.popover.emptyResults": "Sin resultados coincidentes",
|
||||
"prompt.popover.emptyCommands": "Sin comandos coincidentes",
|
||||
"prompt.dropzone.label": "Suelta imágenes, PDFs o archivos de texto aquí",
|
||||
"prompt.dropzone.label": "Suelta imágenes o PDFs aquí",
|
||||
"prompt.dropzone.file.label": "Suelta para @mencionar archivo",
|
||||
"prompt.slash.badge.custom": "personalizado",
|
||||
"prompt.slash.badge.skill": "skill",
|
||||
@@ -277,8 +277,8 @@ export const dict = {
|
||||
"prompt.action.send": "Enviar",
|
||||
"prompt.action.stop": "Detener",
|
||||
|
||||
"prompt.toast.pasteUnsupported.title": "Adjunto no compatible",
|
||||
"prompt.toast.pasteUnsupported.description": "Solo se pueden adjuntar imágenes, PDFs o archivos de texto aquí.",
|
||||
"prompt.toast.pasteUnsupported.title": "Pegado no soportado",
|
||||
"prompt.toast.pasteUnsupported.description": "Solo se pueden pegar imágenes o PDFs aquí.",
|
||||
"prompt.toast.modelAgentRequired.title": "Selecciona un agente y modelo",
|
||||
"prompt.toast.modelAgentRequired.description": "Elige un agente y modelo antes de enviar un prompt.",
|
||||
"prompt.toast.worktreeCreateFailed.title": "Fallo al crear el árbol de trabajo",
|
||||
@@ -871,79 +871,4 @@ export const dict = {
|
||||
"common.time.daysAgo.short": "hace {{count}} d",
|
||||
"settings.providers.connected.environmentDescription": "Conectado desde tus variables de entorno",
|
||||
"settings.providers.custom.description": "Añade un proveedor compatible con OpenAI por su URL base.",
|
||||
|
||||
"app.server.unreachable": "No se pudo conectar con {{server}}",
|
||||
"app.server.retrying": "Reintentando automáticamente...",
|
||||
"app.server.otherServers": "Otros servidores",
|
||||
"dialog.server.add.usernamePlaceholder": "usuario",
|
||||
"dialog.server.add.passwordPlaceholder": "contraseña",
|
||||
"server.row.noUsername": "sin usuario",
|
||||
"session.review.noVcs.createGit.title": "Crear repositorio Git",
|
||||
"session.review.noVcs.createGit.description": "Rastrea, revisa y deshaz cambios en este proyecto",
|
||||
"session.review.noVcs.createGit.actionLoading": "Creando repositorio Git...",
|
||||
"session.review.noVcs.createGit.action": "Crear repositorio Git",
|
||||
"session.todo.progress": "{{done}} de {{total}} tareas completadas",
|
||||
"session.question.progress": "{{current}} de {{total}} preguntas",
|
||||
"session.header.open.finder": "Finder",
|
||||
"session.header.open.fileExplorer": "Explorador de archivos",
|
||||
"session.header.open.fileManager": "Gestor de archivos",
|
||||
"session.header.open.app.vscode": "VS Code",
|
||||
"session.header.open.app.cursor": "Cursor",
|
||||
"session.header.open.app.zed": "Zed",
|
||||
"session.header.open.app.textmate": "TextMate",
|
||||
"session.header.open.app.antigravity": "Antigravity",
|
||||
"session.header.open.app.terminal": "Terminal",
|
||||
"session.header.open.app.iterm2": "iTerm2",
|
||||
"session.header.open.app.ghostty": "Ghostty",
|
||||
"session.header.open.app.warp": "Warp",
|
||||
"session.header.open.app.xcode": "Xcode",
|
||||
"session.header.open.app.androidStudio": "Android Studio",
|
||||
"session.header.open.app.powershell": "PowerShell",
|
||||
"session.header.open.app.sublimeText": "Sublime Text",
|
||||
"debugBar.ariaLabel": "Diagnóstico de rendimiento de desarrollo",
|
||||
"debugBar.na": "n/d",
|
||||
"debugBar.nav.label": "NAV",
|
||||
"debugBar.nav.tip":
|
||||
"Última transición de ruta completada tocando una página de sesión, medida desde el inicio del router hasta el primer pintado después de asentarse.",
|
||||
"debugBar.fps.label": "FPS",
|
||||
"debugBar.fps.tip": "Cuadros por segundo en los últimos 5 segundos.",
|
||||
"debugBar.frame.label": "FRAME",
|
||||
"debugBar.frame.tip": "Peor tiempo de cuadro en los últimos 5 segundos.",
|
||||
"debugBar.jank.label": "JANK",
|
||||
"debugBar.jank.tip": "Cuadros superiores a 32ms en los últimos 5 segundos.",
|
||||
"debugBar.long.label": "LONG",
|
||||
"debugBar.long.tip": "Tiempo bloqueado y recuento de tareas largas en los últimos 5 segundos. Tarea máx: {{max}}.",
|
||||
"debugBar.delay.label": "DELAY",
|
||||
"debugBar.delay.tip": "Peor retraso de entrada observado en los últimos 5 segundos.",
|
||||
"debugBar.inp.label": "INP",
|
||||
"debugBar.inp.tip":
|
||||
"Duración aproximada de la interacción en los últimos 5 segundos. Esto es similar a INP, no el INP oficial de Web Vitals.",
|
||||
"debugBar.cls.label": "CLS",
|
||||
"debugBar.cls.tip": "Cambio de diseño acumulativo para la vida útil actual de la aplicación.",
|
||||
"debugBar.mem.label": "MEM",
|
||||
"debugBar.mem.tipUnavailable": "Heap JS usado vs límite de heap. Solo Chromium.",
|
||||
"debugBar.mem.tip": "Heap JS usado vs límite de heap. {{used}} de {{limit}}.",
|
||||
"common.key.ctrl": "Ctrl",
|
||||
"common.key.alt": "Alt",
|
||||
"common.key.shift": "Mayús",
|
||||
"common.key.meta": "Meta",
|
||||
"common.key.space": "Espacio",
|
||||
"common.key.backspace": "Retroceso",
|
||||
"common.key.enter": "Intro",
|
||||
"common.key.tab": "Tab",
|
||||
"common.key.delete": "Supr",
|
||||
"common.key.home": "Inicio",
|
||||
"common.key.end": "Fin",
|
||||
"common.key.pageUp": "RePág",
|
||||
"common.key.pageDown": "AvPág",
|
||||
"common.key.insert": "Insert",
|
||||
"common.unknown": "desconocido",
|
||||
"error.page.circular": "[Circular]",
|
||||
"error.globalSDK.noServerAvailable": "Ningún servidor disponible",
|
||||
"error.globalSDK.serverNotAvailable": "Servidor no disponible",
|
||||
"error.childStore.persistedCacheCreateFailed": "Error al crear caché persistente",
|
||||
"error.childStore.persistedProjectMetadataCreateFailed": "Error al crear metadatos de proyecto persistentes",
|
||||
"error.childStore.persistedProjectIconCreateFailed": "Error al crear icono de proyecto persistente",
|
||||
"error.childStore.storeCreateFailed": "Error al crear almacén",
|
||||
"terminal.connectionLost.abnormalClose": "WebSocket cerrado anormalmente: {{code}}",
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ export const dict = {
|
||||
"prompt.example.25": "Comment fonctionnent les variables d'environnement ici ?",
|
||||
"prompt.popover.emptyResults": "Aucun résultat correspondant",
|
||||
"prompt.popover.emptyCommands": "Aucune commande correspondante",
|
||||
"prompt.dropzone.label": "Déposez des images, des PDF ou des fichiers texte ici",
|
||||
"prompt.dropzone.label": "Déposez des images ou des PDF ici",
|
||||
"prompt.dropzone.file.label": "Déposez pour @mentionner le fichier",
|
||||
"prompt.slash.badge.custom": "personnalisé",
|
||||
"prompt.slash.badge.skill": "skill",
|
||||
@@ -257,9 +257,8 @@ export const dict = {
|
||||
"prompt.attachment.remove": "Supprimer la pièce jointe",
|
||||
"prompt.action.send": "Envoyer",
|
||||
"prompt.action.stop": "Arrêter",
|
||||
"prompt.toast.pasteUnsupported.title": "Pièce jointe non prise en charge",
|
||||
"prompt.toast.pasteUnsupported.description":
|
||||
"Seules les images, les PDF ou les fichiers texte peuvent être joints ici.",
|
||||
"prompt.toast.pasteUnsupported.title": "Collage non supporté",
|
||||
"prompt.toast.pasteUnsupported.description": "Seules les images ou les PDF peuvent être collés ici.",
|
||||
"prompt.toast.modelAgentRequired.title": "Sélectionnez un agent et un modèle",
|
||||
"prompt.toast.modelAgentRequired.description": "Choisissez un agent et un modèle avant d'envoyer un message.",
|
||||
"prompt.toast.worktreeCreateFailed.title": "Échec de la création de l'arbre de travail",
|
||||
@@ -797,81 +796,4 @@ export const dict = {
|
||||
"common.time.daysAgo.short": "il y a {{count}}j",
|
||||
"settings.providers.connected.environmentDescription": "Connecté à partir de vos variables d'environnement",
|
||||
"settings.providers.custom.description": "Ajouter un fournisseur compatible avec OpenAI via l'URL de base.",
|
||||
|
||||
"app.server.unreachable": "Impossible de joindre {{server}}",
|
||||
"app.server.retrying": "Nouvelle tentative automatique...",
|
||||
"app.server.otherServers": "Autres serveurs",
|
||||
"dialog.server.add.usernamePlaceholder": "nom d'utilisateur",
|
||||
"dialog.server.add.passwordPlaceholder": "mot de passe",
|
||||
"server.row.noUsername": "aucun nom d'utilisateur",
|
||||
"session.review.noVcs.createGit.title": "Créer un dépôt Git",
|
||||
"session.review.noVcs.createGit.description": "Suivre, examiner et annuler les modifications dans ce projet",
|
||||
"session.review.noVcs.createGit.actionLoading": "Création du dépôt Git...",
|
||||
"session.review.noVcs.createGit.action": "Créer un dépôt Git",
|
||||
"session.todo.progress": "{{done}} tâches sur {{total}} terminées",
|
||||
"session.question.progress": "{{current}} questions sur {{total}}",
|
||||
"session.header.open.finder": "Finder",
|
||||
"session.header.open.fileExplorer": "Explorateur de fichiers",
|
||||
"session.header.open.fileManager": "Gestionnaire de fichiers",
|
||||
"session.header.open.app.vscode": "VS Code",
|
||||
"session.header.open.app.cursor": "Cursor",
|
||||
"session.header.open.app.zed": "Zed",
|
||||
"session.header.open.app.textmate": "TextMate",
|
||||
"session.header.open.app.antigravity": "Antigravity",
|
||||
"session.header.open.app.terminal": "Terminal",
|
||||
"session.header.open.app.iterm2": "iTerm2",
|
||||
"session.header.open.app.ghostty": "Ghostty",
|
||||
"session.header.open.app.warp": "Warp",
|
||||
"session.header.open.app.xcode": "Xcode",
|
||||
"session.header.open.app.androidStudio": "Android Studio",
|
||||
"session.header.open.app.powershell": "PowerShell",
|
||||
"session.header.open.app.sublimeText": "Sublime Text",
|
||||
"debugBar.ariaLabel": "Diagnostics de performance de développement",
|
||||
"debugBar.na": "n/a",
|
||||
"debugBar.nav.label": "NAV",
|
||||
"debugBar.nav.tip":
|
||||
"Dernière transition de route terminée touchant une page de session, mesurée du début du routeur jusqu'au premier affichage après stabilisation.",
|
||||
"debugBar.fps.label": "FPS",
|
||||
"debugBar.fps.tip": "Images par seconde glissantes sur les 5 dernières secondes.",
|
||||
"debugBar.frame.label": "FRAME",
|
||||
"debugBar.frame.tip": "Pire temps d'image sur les 5 dernières secondes.",
|
||||
"debugBar.jank.label": "JANK",
|
||||
"debugBar.jank.tip": "Images de plus de 32ms au cours des 5 dernières secondes.",
|
||||
"debugBar.long.label": "LONG",
|
||||
"debugBar.long.tip":
|
||||
"Temps bloqué et nombre de tâches longues au cours des 5 dernières secondes. Tâche max : {{max}}.",
|
||||
"debugBar.delay.label": "DELAY",
|
||||
"debugBar.delay.tip": "Pire délai d'entrée observé au cours des 5 dernières secondes.",
|
||||
"debugBar.inp.label": "INP",
|
||||
"debugBar.inp.tip":
|
||||
"Durée approximative d'interaction au cours des 5 dernières secondes. Ceci est similaire à INP, pas le INP officiel des Web Vitals.",
|
||||
"debugBar.cls.label": "CLS",
|
||||
"debugBar.cls.tip": "Décalage cumulatif de la mise en page pour la durée de vie actuelle de l'application.",
|
||||
"debugBar.mem.label": "MEM",
|
||||
"debugBar.mem.tipUnavailable": "Tas JS utilisé vs limite de tas. Chromium uniquement.",
|
||||
"debugBar.mem.tip": "Tas JS utilisé vs limite de tas. {{used}} sur {{limit}}.",
|
||||
"common.key.ctrl": "Ctrl",
|
||||
"common.key.alt": "Alt",
|
||||
"common.key.shift": "Maj",
|
||||
"common.key.meta": "Méta",
|
||||
"common.key.space": "Espace",
|
||||
"common.key.backspace": "Retour arrière",
|
||||
"common.key.enter": "Entrée",
|
||||
"common.key.tab": "Tab",
|
||||
"common.key.delete": "Suppr",
|
||||
"common.key.home": "Début",
|
||||
"common.key.end": "Fin",
|
||||
"common.key.pageUp": "Page précédente",
|
||||
"common.key.pageDown": "Page suivante",
|
||||
"common.key.insert": "Inser",
|
||||
"common.unknown": "inconnu",
|
||||
"error.page.circular": "[Circulaire]",
|
||||
"error.globalSDK.noServerAvailable": "Aucun serveur disponible",
|
||||
"error.globalSDK.serverNotAvailable": "Serveur non disponible",
|
||||
"error.childStore.persistedCacheCreateFailed": "Échec de la création du cache persistant",
|
||||
"error.childStore.persistedProjectMetadataCreateFailed":
|
||||
"Échec de la création des métadonnées de projet persistantes",
|
||||
"error.childStore.persistedProjectIconCreateFailed": "Échec de la création de l'icône de projet persistante",
|
||||
"error.childStore.storeCreateFailed": "Échec de la création du stockage",
|
||||
"terminal.connectionLost.abnormalClose": "WebSocket fermé anormalement : {{code}}",
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ export const dict = {
|
||||
"prompt.example.25": "ここでは環境変数はどう機能しますか?",
|
||||
"prompt.popover.emptyResults": "一致する結果がありません",
|
||||
"prompt.popover.emptyCommands": "一致するコマンドがありません",
|
||||
"prompt.dropzone.label": "画像、PDF、またはテキストファイルをここにドロップしてください",
|
||||
"prompt.dropzone.label": "画像またはPDFをここにドロップ",
|
||||
"prompt.dropzone.file.label": "ドロップして@メンションファイルを追加",
|
||||
"prompt.slash.badge.custom": "カスタム",
|
||||
"prompt.slash.badge.skill": "スキル",
|
||||
@@ -256,8 +256,8 @@ export const dict = {
|
||||
"prompt.attachment.remove": "添付ファイルを削除",
|
||||
"prompt.action.send": "送信",
|
||||
"prompt.action.stop": "停止",
|
||||
"prompt.toast.pasteUnsupported.title": "サポートされていない添付ファイル",
|
||||
"prompt.toast.pasteUnsupported.description": "画像、PDF、またはテキストファイルのみ添付できます。",
|
||||
"prompt.toast.pasteUnsupported.title": "サポートされていない貼り付け",
|
||||
"prompt.toast.pasteUnsupported.description": "ここでは画像またはPDFのみ貼り付け可能です。",
|
||||
"prompt.toast.modelAgentRequired.title": "エージェントとモデルを選択",
|
||||
"prompt.toast.modelAgentRequired.description": "プロンプトを送信する前にエージェントとモデルを選択してください。",
|
||||
"prompt.toast.worktreeCreateFailed.title": "ワークツリーの作成に失敗しました",
|
||||
@@ -783,78 +783,4 @@ export const dict = {
|
||||
"common.time.daysAgo.short": "{{count}} 日前",
|
||||
"settings.providers.connected.environmentDescription": "環境変数から接続されました",
|
||||
"settings.providers.custom.description": "ベース URL を指定して OpenAI 互換のプロバイダーを追加します。",
|
||||
|
||||
"app.server.unreachable": "{{server}} に到達できませんでした",
|
||||
"app.server.retrying": "自動的に再試行中...",
|
||||
"app.server.otherServers": "その他のサーバー",
|
||||
"dialog.server.add.usernamePlaceholder": "ユーザー名",
|
||||
"dialog.server.add.passwordPlaceholder": "パスワード",
|
||||
"server.row.noUsername": "ユーザー名なし",
|
||||
"session.review.noVcs.createGit.title": "Git リポジトリを作成",
|
||||
"session.review.noVcs.createGit.description": "このプロジェクトの変更を追跡、レビュー、元に戻す",
|
||||
"session.review.noVcs.createGit.actionLoading": "Git リポジトリを作成中...",
|
||||
"session.review.noVcs.createGit.action": "Git リポジトリを作成",
|
||||
"session.todo.progress": "{{done}} 個中 {{total}} 個の Todo が完了",
|
||||
"session.question.progress": "{{total}} 問中 {{current}} 問",
|
||||
"session.header.open.finder": "Finder",
|
||||
"session.header.open.fileExplorer": "エクスプローラー",
|
||||
"session.header.open.fileManager": "ファイルマネージャー",
|
||||
"session.header.open.app.vscode": "VS Code",
|
||||
"session.header.open.app.cursor": "Cursor",
|
||||
"session.header.open.app.zed": "Zed",
|
||||
"session.header.open.app.textmate": "TextMate",
|
||||
"session.header.open.app.antigravity": "Antigravity",
|
||||
"session.header.open.app.terminal": "ターミナル",
|
||||
"session.header.open.app.iterm2": "iTerm2",
|
||||
"session.header.open.app.ghostty": "Ghostty",
|
||||
"session.header.open.app.warp": "Warp",
|
||||
"session.header.open.app.xcode": "Xcode",
|
||||
"session.header.open.app.androidStudio": "Android Studio",
|
||||
"session.header.open.app.powershell": "PowerShell",
|
||||
"session.header.open.app.sublimeText": "Sublime Text",
|
||||
"debugBar.ariaLabel": "開発パフォーマンス診断",
|
||||
"debugBar.na": "n/a",
|
||||
"debugBar.nav.label": "NAV",
|
||||
"debugBar.nav.tip": "セッションページに触れる最後に完了したルート遷移。ルーター開始から安定後の最初の描画まで測定。",
|
||||
"debugBar.fps.label": "FPS",
|
||||
"debugBar.fps.tip": "過去5秒間のローリングフレーム/秒。",
|
||||
"debugBar.frame.label": "FRAME",
|
||||
"debugBar.frame.tip": "過去5秒間の最悪フレーム時間。",
|
||||
"debugBar.jank.label": "JANK",
|
||||
"debugBar.jank.tip": "過去5秒間で32msを超えたフレーム。",
|
||||
"debugBar.long.label": "LONG",
|
||||
"debugBar.long.tip": "過去5秒間のブロック時間と長時間タスク数。最大タスク: {{max}}。",
|
||||
"debugBar.delay.label": "DELAY",
|
||||
"debugBar.delay.tip": "過去5秒間で観測された最悪の入力遅延。",
|
||||
"debugBar.inp.label": "INP",
|
||||
"debugBar.inp.tip":
|
||||
"過去5秒間の概算インタラクション時間。これは INP に似ていますが、公式の Web Vitals INP ではありません。",
|
||||
"debugBar.cls.label": "CLS",
|
||||
"debugBar.cls.tip": "現在のアプリ寿命の累積レイアウトシフト。",
|
||||
"debugBar.mem.label": "MEM",
|
||||
"debugBar.mem.tipUnavailable": "使用中の JS ヒープ対ヒープ制限。Chromium のみ。",
|
||||
"debugBar.mem.tip": "使用中の JS ヒープ対ヒープ制限。{{limit}} 中 {{used}}。",
|
||||
"common.key.ctrl": "Ctrl",
|
||||
"common.key.alt": "Alt",
|
||||
"common.key.shift": "Shift",
|
||||
"common.key.meta": "Meta",
|
||||
"common.key.space": "Space",
|
||||
"common.key.backspace": "Backspace",
|
||||
"common.key.enter": "Enter",
|
||||
"common.key.tab": "Tab",
|
||||
"common.key.delete": "Delete",
|
||||
"common.key.home": "Home",
|
||||
"common.key.end": "End",
|
||||
"common.key.pageUp": "Page Up",
|
||||
"common.key.pageDown": "Page Down",
|
||||
"common.key.insert": "Insert",
|
||||
"common.unknown": "不明",
|
||||
"error.page.circular": "[循環]",
|
||||
"error.globalSDK.noServerAvailable": "利用可能なサーバーがありません",
|
||||
"error.globalSDK.serverNotAvailable": "サーバーが利用できません",
|
||||
"error.childStore.persistedCacheCreateFailed": "永続キャッシュの作成に失敗しました",
|
||||
"error.childStore.persistedProjectMetadataCreateFailed": "永続プロジェクトメタデータの作成に失敗しました",
|
||||
"error.childStore.persistedProjectIconCreateFailed": "永続プロジェクトアイコンの作成に失敗しました",
|
||||
"error.childStore.storeCreateFailed": "ストアの作成に失敗しました",
|
||||
"terminal.connectionLost.abnormalClose": "WebSocket が異常終了しました: {{code}}",
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ export const dict = {
|
||||
"prompt.example.25": "여기서 환경 변수는 어떻게 작동하나요?",
|
||||
"prompt.popover.emptyResults": "일치하는 결과 없음",
|
||||
"prompt.popover.emptyCommands": "일치하는 명령어 없음",
|
||||
"prompt.dropzone.label": "이미지, PDF 또는 텍스트 파일을 이곳에 드롭하세요",
|
||||
"prompt.dropzone.label": "이미지나 PDF를 여기에 드롭하세요",
|
||||
"prompt.dropzone.file.label": "드롭하여 파일 @멘션 추가",
|
||||
"prompt.slash.badge.custom": "사용자 지정",
|
||||
"prompt.slash.badge.skill": "스킬",
|
||||
@@ -260,8 +260,8 @@ export const dict = {
|
||||
"prompt.attachment.remove": "첨부 파일 제거",
|
||||
"prompt.action.send": "전송",
|
||||
"prompt.action.stop": "중지",
|
||||
"prompt.toast.pasteUnsupported.title": "지원되지 않는 첨부 파일",
|
||||
"prompt.toast.pasteUnsupported.description": "이미지, PDF 또는 텍스트 파일만 첨부할 수 있습니다.",
|
||||
"prompt.toast.pasteUnsupported.title": "지원되지 않는 붙여넣기",
|
||||
"prompt.toast.pasteUnsupported.description": "이미지나 PDF만 붙여넣을 수 있습니다.",
|
||||
"prompt.toast.modelAgentRequired.title": "에이전트 및 모델 선택",
|
||||
"prompt.toast.modelAgentRequired.description": "프롬프트를 보내기 전에 에이전트와 모델을 선택하세요.",
|
||||
"prompt.toast.worktreeCreateFailed.title": "작업 트리 생성 실패",
|
||||
@@ -782,78 +782,4 @@ export const dict = {
|
||||
"common.time.daysAgo.short": "{{count}}일 전",
|
||||
"settings.providers.connected.environmentDescription": "환경 변수에서 연결됨",
|
||||
"settings.providers.custom.description": "기본 URL로 OpenAI 호환 공급자를 추가합니다.",
|
||||
|
||||
"app.server.unreachable": "{{server}}에 연결할 수 없습니다",
|
||||
"app.server.retrying": "자동으로 재시도 중...",
|
||||
"app.server.otherServers": "다른 서버",
|
||||
"dialog.server.add.usernamePlaceholder": "사용자 이름",
|
||||
"dialog.server.add.passwordPlaceholder": "비밀번호",
|
||||
"server.row.noUsername": "사용자 이름 없음",
|
||||
"session.review.noVcs.createGit.title": "Git 저장소 생성",
|
||||
"session.review.noVcs.createGit.description": "이 프로젝트의 변경 사항을 추적, 검토 및 실행 취소",
|
||||
"session.review.noVcs.createGit.actionLoading": "Git 저장소 생성 중...",
|
||||
"session.review.noVcs.createGit.action": "Git 저장소 생성",
|
||||
"session.todo.progress": "{{total}}개의 할 일 중 {{done}}개 완료",
|
||||
"session.question.progress": "{{total}}개의 질문 중 {{current}}개",
|
||||
"session.header.open.finder": "Finder",
|
||||
"session.header.open.fileExplorer": "파일 탐색기",
|
||||
"session.header.open.fileManager": "파일 관리자",
|
||||
"session.header.open.app.vscode": "VS Code",
|
||||
"session.header.open.app.cursor": "Cursor",
|
||||
"session.header.open.app.zed": "Zed",
|
||||
"session.header.open.app.textmate": "TextMate",
|
||||
"session.header.open.app.antigravity": "Antigravity",
|
||||
"session.header.open.app.terminal": "터미널",
|
||||
"session.header.open.app.iterm2": "iTerm2",
|
||||
"session.header.open.app.ghostty": "Ghostty",
|
||||
"session.header.open.app.warp": "Warp",
|
||||
"session.header.open.app.xcode": "Xcode",
|
||||
"session.header.open.app.androidStudio": "Android Studio",
|
||||
"session.header.open.app.powershell": "PowerShell",
|
||||
"session.header.open.app.sublimeText": "Sublime Text",
|
||||
"debugBar.ariaLabel": "개발 성능 진단",
|
||||
"debugBar.na": "해당 없음",
|
||||
"debugBar.nav.label": "NAV",
|
||||
"debugBar.nav.tip":
|
||||
"세션 페이지에 닿은 마지막 완료된 라우트 전환. 라우터 시작부터 정착 후 첫 번째 페인트까지 측정됨.",
|
||||
"debugBar.fps.label": "FPS",
|
||||
"debugBar.fps.tip": "지난 5초간의 초당 프레임 수.",
|
||||
"debugBar.frame.label": "FRAME",
|
||||
"debugBar.frame.tip": "지난 5초간의 최악의 프레임 시간.",
|
||||
"debugBar.jank.label": "JANK",
|
||||
"debugBar.jank.tip": "지난 5초간 32ms를 초과한 프레임.",
|
||||
"debugBar.long.label": "LONG",
|
||||
"debugBar.long.tip": "지난 5초간의 차단된 시간 및 긴 작업 수. 최대 작업: {{max}}.",
|
||||
"debugBar.delay.label": "DELAY",
|
||||
"debugBar.delay.tip": "지난 5초간 관찰된 최악의 입력 지연.",
|
||||
"debugBar.inp.label": "INP",
|
||||
"debugBar.inp.tip": "지난 5초간의 대략적인 상호작용 지속 시간. 이것은 공식 Web Vitals INP가 아닌 INP와 유사합니다.",
|
||||
"debugBar.cls.label": "CLS",
|
||||
"debugBar.cls.tip": "현재 앱 수명 동안의 누적 레이아웃 이동.",
|
||||
"debugBar.mem.label": "MEM",
|
||||
"debugBar.mem.tipUnavailable": "사용된 JS 힙 대 힙 제한. Chromium 전용.",
|
||||
"debugBar.mem.tip": "사용된 JS 힙 대 힙 제한. {{limit}} 중 {{used}}.",
|
||||
"common.key.ctrl": "Ctrl",
|
||||
"common.key.alt": "Alt",
|
||||
"common.key.shift": "Shift",
|
||||
"common.key.meta": "Meta",
|
||||
"common.key.space": "Space",
|
||||
"common.key.backspace": "Backspace",
|
||||
"common.key.enter": "Enter",
|
||||
"common.key.tab": "Tab",
|
||||
"common.key.delete": "Delete",
|
||||
"common.key.home": "Home",
|
||||
"common.key.end": "End",
|
||||
"common.key.pageUp": "Page Up",
|
||||
"common.key.pageDown": "Page Down",
|
||||
"common.key.insert": "Insert",
|
||||
"common.unknown": "알 수 없음",
|
||||
"error.page.circular": "[순환]",
|
||||
"error.globalSDK.noServerAvailable": "사용 가능한 서버 없음",
|
||||
"error.globalSDK.serverNotAvailable": "서버를 사용할 수 없음",
|
||||
"error.childStore.persistedCacheCreateFailed": "영구 캐시 생성 실패",
|
||||
"error.childStore.persistedProjectMetadataCreateFailed": "영구 프로젝트 메타데이터 생성 실패",
|
||||
"error.childStore.persistedProjectIconCreateFailed": "영구 프로젝트 아이콘 생성 실패",
|
||||
"error.childStore.storeCreateFailed": "저장소 생성 실패",
|
||||
"terminal.connectionLost.abnormalClose": "WebSocket이 비정상적으로 닫힘: {{code}}",
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ export const dict = {
|
||||
|
||||
"prompt.popover.emptyResults": "Ingen matchende resultater",
|
||||
"prompt.popover.emptyCommands": "Ingen matchende kommandoer",
|
||||
"prompt.dropzone.label": "Slipp bilder, PDF-er eller tekstfiler her",
|
||||
"prompt.dropzone.label": "Slipp bilder eller PDF-er her",
|
||||
"prompt.dropzone.file.label": "Slipp for å @nevne fil",
|
||||
"prompt.slash.badge.custom": "egendefinert",
|
||||
"prompt.slash.badge.skill": "skill",
|
||||
@@ -280,8 +280,8 @@ export const dict = {
|
||||
"prompt.action.send": "Send",
|
||||
"prompt.action.stop": "Stopp",
|
||||
|
||||
"prompt.toast.pasteUnsupported.title": "Ikke støttet vedlegg",
|
||||
"prompt.toast.pasteUnsupported.description": "Kun bilder, PDF-er eller tekstfiler kan legges ved her.",
|
||||
"prompt.toast.pasteUnsupported.title": "Liming ikke støttet",
|
||||
"prompt.toast.pasteUnsupported.description": "Kun bilder eller PDF-er kan limes inn her.",
|
||||
"prompt.toast.modelAgentRequired.title": "Velg en agent og modell",
|
||||
"prompt.toast.modelAgentRequired.description": "Velg en agent og modell før du sender en forespørsel.",
|
||||
"prompt.toast.worktreeCreateFailed.title": "Kunne ikke opprette worktree",
|
||||
@@ -865,79 +865,4 @@ export const dict = {
|
||||
"common.time.daysAgo.short": "{{count}} d siden",
|
||||
"settings.providers.connected.environmentDescription": "Koblet til fra miljøvariablene dine",
|
||||
"settings.providers.custom.description": "Legg til en OpenAI-kompatibel leverandør via basis-URL.",
|
||||
|
||||
"app.server.unreachable": "Kunne ikke nå {{server}}",
|
||||
"app.server.retrying": "Prøver på nytt automatisk...",
|
||||
"app.server.otherServers": "Andre servere",
|
||||
"dialog.server.add.usernamePlaceholder": "brukernavn",
|
||||
"dialog.server.add.passwordPlaceholder": "passord",
|
||||
"server.row.noUsername": "inget brukernavn",
|
||||
"session.review.noVcs.createGit.title": "Opprett et Git-depot",
|
||||
"session.review.noVcs.createGit.description": "Spor, gjennomgå og angre endringer i dette prosjektet",
|
||||
"session.review.noVcs.createGit.actionLoading": "Oppretter Git-depot...",
|
||||
"session.review.noVcs.createGit.action": "Opprett Git-depot",
|
||||
"session.todo.progress": "{{done}} av {{total}} oppgaver fullført",
|
||||
"session.question.progress": "{{current}} av {{total}} spørsmål",
|
||||
"session.header.open.finder": "Finder",
|
||||
"session.header.open.fileExplorer": "Filutforsker",
|
||||
"session.header.open.fileManager": "Filbehandler",
|
||||
"session.header.open.app.vscode": "VS Code",
|
||||
"session.header.open.app.cursor": "Cursor",
|
||||
"session.header.open.app.zed": "Zed",
|
||||
"session.header.open.app.textmate": "TextMate",
|
||||
"session.header.open.app.antigravity": "Antigravity",
|
||||
"session.header.open.app.terminal": "Terminal",
|
||||
"session.header.open.app.iterm2": "iTerm2",
|
||||
"session.header.open.app.ghostty": "Ghostty",
|
||||
"session.header.open.app.warp": "Warp",
|
||||
"session.header.open.app.xcode": "Xcode",
|
||||
"session.header.open.app.androidStudio": "Android Studio",
|
||||
"session.header.open.app.powershell": "PowerShell",
|
||||
"session.header.open.app.sublimeText": "Sublime Text",
|
||||
"debugBar.ariaLabel": "Utviklingsytelsesdiagnostikk",
|
||||
"debugBar.na": "i/t",
|
||||
"debugBar.nav.label": "NAV",
|
||||
"debugBar.nav.tip":
|
||||
"Siste fullførte ruteovergang som berører en sesjonsside, målt fra ruterstart til første opptegning etter at den har roet seg.",
|
||||
"debugBar.fps.label": "FPS",
|
||||
"debugBar.fps.tip": "Rullende bilder per sekund over de siste 5 sekundene.",
|
||||
"debugBar.frame.label": "FRAME",
|
||||
"debugBar.frame.tip": "Verste bildetid over de siste 5 sekundene.",
|
||||
"debugBar.jank.label": "JANK",
|
||||
"debugBar.jank.tip": "Bilder over 32ms i de siste 5 sekundene.",
|
||||
"debugBar.long.label": "LONG",
|
||||
"debugBar.long.tip": "Blokkert tid og antall lange oppgaver i de siste 5 sekundene. Maks oppgave: {{max}}.",
|
||||
"debugBar.delay.label": "DELAY",
|
||||
"debugBar.delay.tip": "Verste observerte inndataforsinkelse i de siste 5 sekundene.",
|
||||
"debugBar.inp.label": "INP",
|
||||
"debugBar.inp.tip":
|
||||
"Omtrentlig interaksjonsvarighet over de siste 5 sekundene. Dette er INP-lignende, ikke den offisielle Web Vitals INP.",
|
||||
"debugBar.cls.label": "CLS",
|
||||
"debugBar.cls.tip": "Kumulativ layoutforskyvning for gjeldende app-levetid.",
|
||||
"debugBar.mem.label": "MEM",
|
||||
"debugBar.mem.tipUnavailable": "Brukt JS-heap vs heap-grense. Kun Chromium.",
|
||||
"debugBar.mem.tip": "Brukt JS-heap vs heap-grense. {{used}} av {{limit}}.",
|
||||
"common.key.ctrl": "Ctrl",
|
||||
"common.key.alt": "Alt",
|
||||
"common.key.shift": "Shift",
|
||||
"common.key.meta": "Meta",
|
||||
"common.key.space": "Mellomrom",
|
||||
"common.key.backspace": "Backspace",
|
||||
"common.key.enter": "Enter",
|
||||
"common.key.tab": "Tab",
|
||||
"common.key.delete": "Delete",
|
||||
"common.key.home": "Home",
|
||||
"common.key.end": "End",
|
||||
"common.key.pageUp": "Page Up",
|
||||
"common.key.pageDown": "Page Down",
|
||||
"common.key.insert": "Insert",
|
||||
"common.unknown": "ukjent",
|
||||
"error.page.circular": "[Sirkulær]",
|
||||
"error.globalSDK.noServerAvailable": "Ingen server tilgjengelig",
|
||||
"error.globalSDK.serverNotAvailable": "Server ikke tilgjengelig",
|
||||
"error.childStore.persistedCacheCreateFailed": "Kunne ikke opprette vedvarende hurtigbuffer",
|
||||
"error.childStore.persistedProjectMetadataCreateFailed": "Kunne ikke opprette vedvarende prosjektmetadata",
|
||||
"error.childStore.persistedProjectIconCreateFailed": "Kunne ikke opprette vedvarende prosjektikon",
|
||||
"error.childStore.storeCreateFailed": "Kunne ikke opprette lager",
|
||||
"terminal.connectionLost.abnormalClose": "WebSocket lukket unormalt: {{code}}",
|
||||
} satisfies Partial<Record<Keys, string>>
|
||||
|
||||
@@ -245,7 +245,7 @@ export const dict = {
|
||||
"prompt.example.25": "Jak działają tutaj zmienne środowiskowe?",
|
||||
"prompt.popover.emptyResults": "Brak pasujących wyników",
|
||||
"prompt.popover.emptyCommands": "Brak pasujących poleceń",
|
||||
"prompt.dropzone.label": "Upuść tutaj obrazy, pliki PDF lub pliki tekstowe",
|
||||
"prompt.dropzone.label": "Upuść obrazy lub pliki PDF tutaj",
|
||||
"prompt.dropzone.file.label": "Upuść, aby @wspomnieć plik",
|
||||
"prompt.slash.badge.custom": "własne",
|
||||
"prompt.slash.badge.skill": "skill",
|
||||
@@ -258,8 +258,8 @@ export const dict = {
|
||||
"prompt.attachment.remove": "Usuń załącznik",
|
||||
"prompt.action.send": "Wyślij",
|
||||
"prompt.action.stop": "Zatrzymaj",
|
||||
"prompt.toast.pasteUnsupported.title": "Nieobsługiwany załącznik",
|
||||
"prompt.toast.pasteUnsupported.description": "Można tutaj załączać tylko obrazy, pliki PDF lub pliki tekstowe.",
|
||||
"prompt.toast.pasteUnsupported.title": "Nieobsługiwane wklejanie",
|
||||
"prompt.toast.pasteUnsupported.description": "Tylko obrazy lub pliki PDF mogą być tutaj wklejane.",
|
||||
"prompt.toast.modelAgentRequired.title": "Wybierz agenta i model",
|
||||
"prompt.toast.modelAgentRequired.description": "Wybierz agenta i model przed wysłaniem zapytania.",
|
||||
"prompt.toast.worktreeCreateFailed.title": "Nie udało się utworzyć drzewa roboczego",
|
||||
@@ -785,80 +785,4 @@ export const dict = {
|
||||
"common.time.daysAgo.short": "{{count}} dni temu",
|
||||
"settings.providers.connected.environmentDescription": "Połączono ze zmiennymi środowiskowymi",
|
||||
"settings.providers.custom.description": "Dodaj dostawcę zgodnego z OpenAI poprzez podstawowy URL.",
|
||||
|
||||
"app.server.unreachable": "Nie można połączyć z {{server}}",
|
||||
"app.server.retrying": "Ponawianie automatycznie...",
|
||||
"app.server.otherServers": "Inne serwery",
|
||||
"dialog.server.add.usernamePlaceholder": "nazwa użytkownika",
|
||||
"dialog.server.add.passwordPlaceholder": "hasło",
|
||||
"server.row.noUsername": "brak nazwy użytkownika",
|
||||
"session.review.noVcs.createGit.title": "Utwórz repozytorium Git",
|
||||
"session.review.noVcs.createGit.description": "Śledź, przeglądaj i cofaj zmiany w tym projekcie",
|
||||
"session.review.noVcs.createGit.actionLoading": "Tworzenie repozytorium Git...",
|
||||
"session.review.noVcs.createGit.action": "Utwórz repozytorium Git",
|
||||
"session.todo.progress": "Ukończono {{done}} z {{total}} zadań",
|
||||
"session.question.progress": "{{current}} z {{total}} pytań",
|
||||
"session.header.open.finder": "Finder",
|
||||
"session.header.open.fileExplorer": "Eksplorator plików",
|
||||
"session.header.open.fileManager": "Menedżer plików",
|
||||
"session.header.open.app.vscode": "VS Code",
|
||||
"session.header.open.app.cursor": "Cursor",
|
||||
"session.header.open.app.zed": "Zed",
|
||||
"session.header.open.app.textmate": "TextMate",
|
||||
"session.header.open.app.antigravity": "Antigravity",
|
||||
"session.header.open.app.terminal": "Terminal",
|
||||
"session.header.open.app.iterm2": "iTerm2",
|
||||
"session.header.open.app.ghostty": "Ghostty",
|
||||
"session.header.open.app.warp": "Warp",
|
||||
"session.header.open.app.xcode": "Xcode",
|
||||
"session.header.open.app.androidStudio": "Android Studio",
|
||||
"session.header.open.app.powershell": "PowerShell",
|
||||
"session.header.open.app.sublimeText": "Sublime Text",
|
||||
"debugBar.ariaLabel": "Diagnostyka wydajności deweloperskiej",
|
||||
"debugBar.na": "n.d.",
|
||||
"debugBar.nav.label": "NAV",
|
||||
"debugBar.nav.tip":
|
||||
"Ostatnie zakończone przejście trasy dotykające strony sesji, mierzone od startu routera do pierwszego odrysowania po ustaleniu.",
|
||||
"debugBar.fps.label": "FPS",
|
||||
"debugBar.fps.tip": "Średnia liczba klatek na sekundę w ciągu ostatnich 5 sekund.",
|
||||
"debugBar.frame.label": "FRAME",
|
||||
"debugBar.frame.tip": "Najgorszy czas klatki w ciągu ostatnich 5 sekund.",
|
||||
"debugBar.jank.label": "JANK",
|
||||
"debugBar.jank.tip": "Klatki powyżej 32ms w ciągu ostatnich 5 sekund.",
|
||||
"debugBar.long.label": "LONG",
|
||||
"debugBar.long.tip":
|
||||
"Zablokowany czas i liczba długich zadań w ciągu ostatnich 5 sekund. Maksymalne zadanie: {{max}}.",
|
||||
"debugBar.delay.label": "DELAY",
|
||||
"debugBar.delay.tip": "Najgorsze zaobserwowane opóźnienie wejścia w ciągu ostatnich 5 sekund.",
|
||||
"debugBar.inp.label": "INP",
|
||||
"debugBar.inp.tip":
|
||||
"Przybliżony czas trwania interakcji w ciągu ostatnich 5 sekund. Jest to podobne do INP, a nie oficjalne Web Vitals INP.",
|
||||
"debugBar.cls.label": "CLS",
|
||||
"debugBar.cls.tip": "Skumulowane przesunięcie układu dla bieżącego czasu życia aplikacji.",
|
||||
"debugBar.mem.label": "MEM",
|
||||
"debugBar.mem.tipUnavailable": "Użyta sterta JS vs limit sterty. Tylko Chromium.",
|
||||
"debugBar.mem.tip": "Użyta sterta JS vs limit sterty. {{used}} z {{limit}}.",
|
||||
"common.key.ctrl": "Ctrl",
|
||||
"common.key.alt": "Alt",
|
||||
"common.key.shift": "Shift",
|
||||
"common.key.meta": "Meta",
|
||||
"common.key.space": "Spacja",
|
||||
"common.key.backspace": "Backspace",
|
||||
"common.key.enter": "Enter",
|
||||
"common.key.tab": "Tab",
|
||||
"common.key.delete": "Delete",
|
||||
"common.key.home": "Home",
|
||||
"common.key.end": "End",
|
||||
"common.key.pageUp": "Page Up",
|
||||
"common.key.pageDown": "Page Down",
|
||||
"common.key.insert": "Insert",
|
||||
"common.unknown": "nieznany",
|
||||
"error.page.circular": "[Cykliczne]",
|
||||
"error.globalSDK.noServerAvailable": "Brak dostępnego serwera",
|
||||
"error.globalSDK.serverNotAvailable": "Serwer niedostępny",
|
||||
"error.childStore.persistedCacheCreateFailed": "Nie udało się utworzyć trwałej pamięci podręcznej",
|
||||
"error.childStore.persistedProjectMetadataCreateFailed": "Nie udało się utworzyć trwałych metadanych projektu",
|
||||
"error.childStore.persistedProjectIconCreateFailed": "Nie udało się utworzyć trwałej ikony projektu",
|
||||
"error.childStore.storeCreateFailed": "Nie udało się utworzyć magazynu",
|
||||
"terminal.connectionLost.abnormalClose": "WebSocket zamknięty nieprawidłowo: {{code}}",
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ export const dict = {
|
||||
|
||||
"prompt.popover.emptyResults": "Нет совпадений",
|
||||
"prompt.popover.emptyCommands": "Нет совпадающих команд",
|
||||
"prompt.dropzone.label": "Перетащите сюда изображения, PDF или текстовые файлы",
|
||||
"prompt.dropzone.label": "Перетащите изображения или PDF сюда",
|
||||
"prompt.dropzone.file.label": "Отпустите для @упоминания файла",
|
||||
"prompt.slash.badge.custom": "своё",
|
||||
"prompt.slash.badge.skill": "навык",
|
||||
@@ -277,8 +277,8 @@ export const dict = {
|
||||
"prompt.action.send": "Отправить",
|
||||
"prompt.action.stop": "Остановить",
|
||||
|
||||
"prompt.toast.pasteUnsupported.title": "Неподдерживаемое вложение",
|
||||
"prompt.toast.pasteUnsupported.description": "Здесь можно прикрепить только изображения, PDF или текстовые файлы.",
|
||||
"prompt.toast.pasteUnsupported.title": "Неподдерживаемая вставка",
|
||||
"prompt.toast.pasteUnsupported.description": "Сюда можно вставлять только изображения или PDF.",
|
||||
"prompt.toast.modelAgentRequired.title": "Выберите агента и модель",
|
||||
"prompt.toast.modelAgentRequired.description": "Выберите агента и модель перед отправкой запроса.",
|
||||
"prompt.toast.worktreeCreateFailed.title": "Не удалось создать worktree",
|
||||
@@ -867,79 +867,4 @@ export const dict = {
|
||||
"common.time.daysAgo.short": "{{count}} д назад",
|
||||
"settings.providers.connected.environmentDescription": "Подключено из ваших переменных окружения",
|
||||
"settings.providers.custom.description": "Добавить провайдера, совместимого с OpenAI, по базовому URL.",
|
||||
|
||||
"app.server.unreachable": "Не удалось связаться с {{server}}",
|
||||
"app.server.retrying": "Автоматическая повторная попытка...",
|
||||
"app.server.otherServers": "Другие серверы",
|
||||
"dialog.server.add.usernamePlaceholder": "имя пользователя",
|
||||
"dialog.server.add.passwordPlaceholder": "пароль",
|
||||
"server.row.noUsername": "нет имени пользователя",
|
||||
"session.review.noVcs.createGit.title": "Создать репозиторий Git",
|
||||
"session.review.noVcs.createGit.description": "Отслеживайте, просматривайте и отменяйте изменения в этом проекте",
|
||||
"session.review.noVcs.createGit.actionLoading": "Создание репозитория Git...",
|
||||
"session.review.noVcs.createGit.action": "Создать репозиторий Git",
|
||||
"session.todo.progress": "Выполнено {{done}} из {{total}} задач",
|
||||
"session.question.progress": "{{current}} из {{total}} вопросов",
|
||||
"session.header.open.finder": "Finder",
|
||||
"session.header.open.fileExplorer": "Проводник",
|
||||
"session.header.open.fileManager": "Файловый менеджер",
|
||||
"session.header.open.app.vscode": "VS Code",
|
||||
"session.header.open.app.cursor": "Cursor",
|
||||
"session.header.open.app.zed": "Zed",
|
||||
"session.header.open.app.textmate": "TextMate",
|
||||
"session.header.open.app.antigravity": "Antigravity",
|
||||
"session.header.open.app.terminal": "Терминал",
|
||||
"session.header.open.app.iterm2": "iTerm2",
|
||||
"session.header.open.app.ghostty": "Ghostty",
|
||||
"session.header.open.app.warp": "Warp",
|
||||
"session.header.open.app.xcode": "Xcode",
|
||||
"session.header.open.app.androidStudio": "Android Studio",
|
||||
"session.header.open.app.powershell": "PowerShell",
|
||||
"session.header.open.app.sublimeText": "Sublime Text",
|
||||
"debugBar.ariaLabel": "Диагностика производительности разработки",
|
||||
"debugBar.na": "н/д",
|
||||
"debugBar.nav.label": "NAV",
|
||||
"debugBar.nav.tip":
|
||||
"Последний завершенный переход маршрута, затрагивающий страницу сеанса, измеренный от запуска маршрутизатора до первой отрисовки после стабилизации.",
|
||||
"debugBar.fps.label": "FPS",
|
||||
"debugBar.fps.tip": "Скользящая частота кадров в секунду за последние 5 секунд.",
|
||||
"debugBar.frame.label": "FRAME",
|
||||
"debugBar.frame.tip": "Худшее время кадра за последние 5 секунд.",
|
||||
"debugBar.jank.label": "JANK",
|
||||
"debugBar.jank.tip": "Кадры более 32 мс за последние 5 секунд.",
|
||||
"debugBar.long.label": "LONG",
|
||||
"debugBar.long.tip": "Заблокированное время и количество длинных задач за последние 5 секунд. Макс. задача: {{max}}.",
|
||||
"debugBar.delay.label": "DELAY",
|
||||
"debugBar.delay.tip": "Худшая наблюдаемая задержка ввода за последние 5 секунд.",
|
||||
"debugBar.inp.label": "INP",
|
||||
"debugBar.inp.tip":
|
||||
"Приблизительная продолжительность взаимодействия за последние 5 секунд. Это похоже на INP, а не официальный Web Vitals INP.",
|
||||
"debugBar.cls.label": "CLS",
|
||||
"debugBar.cls.tip": "Кумулятивный сдвиг макета за текущее время жизни приложения.",
|
||||
"debugBar.mem.label": "MEM",
|
||||
"debugBar.mem.tipUnavailable": "Используемая куча JS по сравнению с лимитом кучи. Только Chromium.",
|
||||
"debugBar.mem.tip": "Используемая куча JS по сравнению с лимитом кучи. {{used}} из {{limit}}.",
|
||||
"common.key.ctrl": "Ctrl",
|
||||
"common.key.alt": "Alt",
|
||||
"common.key.shift": "Shift",
|
||||
"common.key.meta": "Meta",
|
||||
"common.key.space": "Пробел",
|
||||
"common.key.backspace": "Backspace",
|
||||
"common.key.enter": "Enter",
|
||||
"common.key.tab": "Tab",
|
||||
"common.key.delete": "Delete",
|
||||
"common.key.home": "Home",
|
||||
"common.key.end": "End",
|
||||
"common.key.pageUp": "Page Up",
|
||||
"common.key.pageDown": "Page Down",
|
||||
"common.key.insert": "Insert",
|
||||
"common.unknown": "неизвестно",
|
||||
"error.page.circular": "[Циклично]",
|
||||
"error.globalSDK.noServerAvailable": "Нет доступного сервера",
|
||||
"error.globalSDK.serverNotAvailable": "Сервер недоступен",
|
||||
"error.childStore.persistedCacheCreateFailed": "Не удалось создать постоянный кэш",
|
||||
"error.childStore.persistedProjectMetadataCreateFailed": "Не удалось создать постоянные метаданные проекта",
|
||||
"error.childStore.persistedProjectIconCreateFailed": "Не удалось создать постоянный значок проекта",
|
||||
"error.childStore.storeCreateFailed": "Не удалось создать хранилище",
|
||||
"terminal.connectionLost.abnormalClose": "WebSocket закрыт аварийно: {{code}}",
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ export const dict = {
|
||||
|
||||
"prompt.popover.emptyResults": "ไม่พบผลลัพธ์ที่ตรงกัน",
|
||||
"prompt.popover.emptyCommands": "ไม่พบคำสั่งที่ตรงกัน",
|
||||
"prompt.dropzone.label": "ลากรูปภาพ, PDF หรือไฟล์ข้อความมาวางที่นี่",
|
||||
"prompt.dropzone.label": "วางรูปภาพหรือ PDF ที่นี่",
|
||||
"prompt.dropzone.file.label": "วางเพื่อ @กล่าวถึงไฟล์",
|
||||
"prompt.slash.badge.custom": "กำหนดเอง",
|
||||
"prompt.slash.badge.skill": "ทักษะ",
|
||||
@@ -277,8 +277,8 @@ export const dict = {
|
||||
"prompt.action.send": "ส่ง",
|
||||
"prompt.action.stop": "หยุด",
|
||||
|
||||
"prompt.toast.pasteUnsupported.title": "ไฟล์แนบที่ไม่รองรับ",
|
||||
"prompt.toast.pasteUnsupported.description": "แนบได้เฉพาะรูปภาพ, PDF หรือไฟล์ข้อความเท่านั้น",
|
||||
"prompt.toast.pasteUnsupported.title": "การวางไม่รองรับ",
|
||||
"prompt.toast.pasteUnsupported.description": "สามารถวางรูปภาพหรือ PDF เท่านั้น",
|
||||
"prompt.toast.modelAgentRequired.title": "เลือกเอเจนต์และโมเดล",
|
||||
"prompt.toast.modelAgentRequired.description": "เลือกเอเจนต์และโมเดลก่อนส่งพร้อมท์",
|
||||
"prompt.toast.worktreeCreateFailed.title": "ไม่สามารถสร้าง worktree",
|
||||
@@ -854,79 +854,4 @@ export const dict = {
|
||||
"common.time.daysAgo.short": "{{count}} วันที่แล้ว",
|
||||
"settings.providers.connected.environmentDescription": "เชื่อมต่อจากตัวแปรสภาพแวดล้อมของคุณ",
|
||||
"settings.providers.custom.description": "เพิ่มผู้ให้บริการที่รองรับ OpenAI ด้วย URL หลัก",
|
||||
|
||||
"app.server.unreachable": "ไม่สามารถติดต่อ {{server}}",
|
||||
"app.server.retrying": "กำลังลองใหม่โดยอัตโนมัติ...",
|
||||
"app.server.otherServers": "เซิร์ฟเวอร์อื่น ๆ",
|
||||
"dialog.server.add.usernamePlaceholder": "ชื่อผู้ใช้",
|
||||
"dialog.server.add.passwordPlaceholder": "รหัสผ่าน",
|
||||
"server.row.noUsername": "ไม่มีชื่อผู้ใช้",
|
||||
"session.review.noVcs.createGit.title": "สร้าง Git repository",
|
||||
"session.review.noVcs.createGit.description": "ติดตาม ตรวจสอบ และเลิกทำสิ่งเปลี่ยนแปลงในโปรเจกต์นี้",
|
||||
"session.review.noVcs.createGit.actionLoading": "กำลังสร้าง Git repository...",
|
||||
"session.review.noVcs.createGit.action": "สร้าง Git repository",
|
||||
"session.todo.progress": "เสร็จสิ้น {{done}} จาก {{total}} รายการ",
|
||||
"session.question.progress": "{{current}} จาก {{total}} คำถาม",
|
||||
"session.header.open.finder": "Finder",
|
||||
"session.header.open.fileExplorer": "File Explorer",
|
||||
"session.header.open.fileManager": "File Manager",
|
||||
"session.header.open.app.vscode": "VS Code",
|
||||
"session.header.open.app.cursor": "Cursor",
|
||||
"session.header.open.app.zed": "Zed",
|
||||
"session.header.open.app.textmate": "TextMate",
|
||||
"session.header.open.app.antigravity": "Antigravity",
|
||||
"session.header.open.app.terminal": "Terminal",
|
||||
"session.header.open.app.iterm2": "iTerm2",
|
||||
"session.header.open.app.ghostty": "Ghostty",
|
||||
"session.header.open.app.warp": "Warp",
|
||||
"session.header.open.app.xcode": "Xcode",
|
||||
"session.header.open.app.androidStudio": "Android Studio",
|
||||
"session.header.open.app.powershell": "PowerShell",
|
||||
"session.header.open.app.sublimeText": "Sublime Text",
|
||||
"debugBar.ariaLabel": "การวินิจฉัยประสิทธิภาพการพัฒนา",
|
||||
"debugBar.na": "n/a",
|
||||
"debugBar.nav.label": "NAV",
|
||||
"debugBar.nav.tip":
|
||||
"การเปลี่ยนเส้นทางที่เสร็จสมบูรณ์ล่าสุดที่สัมผัสหน้าเซสชัน วัดจากจุดเริ่มต้นเราเตอร์จนถึงการวาดครั้งแรกหลังจากที่นิ่ง",
|
||||
"debugBar.fps.label": "FPS",
|
||||
"debugBar.fps.tip": "เฟรมต่อวินาทีแบบต่อเนื่องในช่วง 5 วินาทีที่ผ่านมา",
|
||||
"debugBar.frame.label": "FRAME",
|
||||
"debugBar.frame.tip": "เวลาเฟรมที่แย่ที่สุดในช่วง 5 วินาทีที่ผ่านมา",
|
||||
"debugBar.jank.label": "JANK",
|
||||
"debugBar.jank.tip": "เฟรมที่เกิน 32ms ในช่วง 5 วินาทีที่ผ่านมา",
|
||||
"debugBar.long.label": "LONG",
|
||||
"debugBar.long.tip": "เวลาที่ถูกบล็อกและจำนวนงานยาวในช่วง 5 วินาทีที่ผ่านมา งานสูงสุด: {{max}}",
|
||||
"debugBar.delay.label": "DELAY",
|
||||
"debugBar.delay.tip": "ความล่าช้าในการป้อนข้อมูลที่แย่ที่สุดที่สังเกตได้ในช่วง 5 วินาทีที่ผ่านมา",
|
||||
"debugBar.inp.label": "INP",
|
||||
"debugBar.inp.tip":
|
||||
"ระยะเวลาการโต้ตอบโดยประมาณในช่วง 5 วินาทีที่ผ่านมา นี่เป็นเหมือน INP ไม่ใช่ Web Vitals INP อย่างเป็นทางการ",
|
||||
"debugBar.cls.label": "CLS",
|
||||
"debugBar.cls.tip": "การเลื่อนเลย์เอาต์สะสมสำหรับอายุการใช้งานของแอปปัจจุบัน",
|
||||
"debugBar.mem.label": "MEM",
|
||||
"debugBar.mem.tipUnavailable": "JS heap ที่ใช้เทียบกับขีดจำกัด heap เฉพาะ Chromium",
|
||||
"debugBar.mem.tip": "JS heap ที่ใช้เทียบกับขีดจำกัด heap {{used}} จาก {{limit}}",
|
||||
"common.key.ctrl": "Ctrl",
|
||||
"common.key.alt": "Alt",
|
||||
"common.key.shift": "Shift",
|
||||
"common.key.meta": "Meta",
|
||||
"common.key.space": "Space",
|
||||
"common.key.backspace": "Backspace",
|
||||
"common.key.enter": "Enter",
|
||||
"common.key.tab": "Tab",
|
||||
"common.key.delete": "Delete",
|
||||
"common.key.home": "Home",
|
||||
"common.key.end": "End",
|
||||
"common.key.pageUp": "Page Up",
|
||||
"common.key.pageDown": "Page Down",
|
||||
"common.key.insert": "Insert",
|
||||
"common.unknown": "ไม่ทราบ",
|
||||
"error.page.circular": "[วงกลม]",
|
||||
"error.globalSDK.noServerAvailable": "ไม่มีเซิร์ฟเวอร์",
|
||||
"error.globalSDK.serverNotAvailable": "เซิร์ฟเวอร์ไม่พร้อมใช้งาน",
|
||||
"error.childStore.persistedCacheCreateFailed": "ไม่สามารถสร้างแคชถาวร",
|
||||
"error.childStore.persistedProjectMetadataCreateFailed": "ไม่สามารถสร้างเมตาดาต้าโปรเจกต์ถาวร",
|
||||
"error.childStore.persistedProjectIconCreateFailed": "ไม่สามารถสร้างไอคอนโปรเจกต์ถาวร",
|
||||
"error.childStore.storeCreateFailed": "ไม่สามารถสร้างที่เก็บ",
|
||||
"terminal.connectionLost.abnormalClose": "WebSocket ปิดอย่างผิดปกติ: {{code}}",
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ export const dict = {
|
||||
|
||||
"prompt.popover.emptyResults": "Eşleşen sonuç yok",
|
||||
"prompt.popover.emptyCommands": "Eşleşen komut yok",
|
||||
"prompt.dropzone.label": "Resimleri, PDF'leri veya metin dosyalarını buraya bırakın",
|
||||
"prompt.dropzone.label": "Görsel veya PDF'leri buraya bırakın",
|
||||
"prompt.dropzone.file.label": "@bahsetmek için dosyayı bırakın",
|
||||
"prompt.slash.badge.custom": "özel",
|
||||
"prompt.slash.badge.skill": "beceri",
|
||||
@@ -282,8 +282,8 @@ export const dict = {
|
||||
"prompt.action.send": "Gönder",
|
||||
"prompt.action.stop": "Durdur",
|
||||
|
||||
"prompt.toast.pasteUnsupported.title": "Desteklenmeyen ek",
|
||||
"prompt.toast.pasteUnsupported.description": "Buraya yalnızca resimler, PDF'ler veya metin dosyaları eklenebilir.",
|
||||
"prompt.toast.pasteUnsupported.title": "Desteklenmeyen yapıştırma",
|
||||
"prompt.toast.pasteUnsupported.description": "Buraya sadece görsel veya PDF yapıştırılabilir.",
|
||||
"prompt.toast.modelAgentRequired.title": "Bir ajan ve model seçin",
|
||||
"prompt.toast.modelAgentRequired.description": "Komut göndermeden önce bir ajan ve model seçin.",
|
||||
"prompt.toast.worktreeCreateFailed.title": "Çalışma ağacı oluşturulamadı",
|
||||
@@ -874,78 +874,4 @@ export const dict = {
|
||||
"common.time.daysAgo.short": "{{count}}g önce",
|
||||
"settings.providers.connected.environmentDescription": "Ortam değişkenlerinizden bağlandı",
|
||||
"settings.providers.custom.description": "Temel URL üzerinden OpenAI uyumlu bir sağlayıcı ekleyin.",
|
||||
|
||||
"app.server.unreachable": "{{server}} sunucusuna ulaşılamadı",
|
||||
"app.server.retrying": "Otomatik olarak tekrar deneniyor...",
|
||||
"app.server.otherServers": "Diğer sunucular",
|
||||
"dialog.server.add.usernamePlaceholder": "kullanıcı adı",
|
||||
"dialog.server.add.passwordPlaceholder": "parola",
|
||||
"server.row.noUsername": "kullanıcı adı yok",
|
||||
"session.review.noVcs.createGit.title": "Git deposu oluştur",
|
||||
"session.review.noVcs.createGit.description": "Bu projedeki değişiklikleri takip et, incele ve geri al",
|
||||
"session.review.noVcs.createGit.actionLoading": "Git deposu oluşturuluyor...",
|
||||
"session.review.noVcs.createGit.action": "Git deposu oluştur",
|
||||
"session.todo.progress": "{{total}} görevin {{done}} tanesi tamamlandı",
|
||||
"session.question.progress": "{{total}} sorunun {{current}} tanesi",
|
||||
"session.header.open.finder": "Finder",
|
||||
"session.header.open.fileExplorer": "Dosya Gezgini",
|
||||
"session.header.open.fileManager": "Dosya Yöneticisi",
|
||||
"session.header.open.app.vscode": "VS Code",
|
||||
"session.header.open.app.cursor": "Cursor",
|
||||
"session.header.open.app.zed": "Zed",
|
||||
"session.header.open.app.textmate": "TextMate",
|
||||
"session.header.open.app.antigravity": "Antigravity",
|
||||
"session.header.open.app.terminal": "Terminal",
|
||||
"session.header.open.app.iterm2": "iTerm2",
|
||||
"session.header.open.app.ghostty": "Ghostty",
|
||||
"session.header.open.app.warp": "Warp",
|
||||
"session.header.open.app.xcode": "Xcode",
|
||||
"session.header.open.app.androidStudio": "Android Studio",
|
||||
"session.header.open.app.powershell": "PowerShell",
|
||||
"session.header.open.app.sublimeText": "Sublime Text",
|
||||
"debugBar.ariaLabel": "Geliştirme performansı teşhisi",
|
||||
"debugBar.na": "yok",
|
||||
"debugBar.nav.label": "NAV",
|
||||
"debugBar.nav.tip":
|
||||
"Yönlendirici başlangıcından yerleşme sonrası ilk boyamaya kadar ölçülen, bir oturum sayfasına dokunan son tamamlanmış rota geçişi.",
|
||||
"debugBar.fps.label": "FPS",
|
||||
"debugBar.fps.tip": "Son 5 saniyedeki kayan saniye başına kare sayısı.",
|
||||
"debugBar.frame.label": "FRAME",
|
||||
"debugBar.frame.tip": "Son 5 saniyedeki en kötü kare süresi.",
|
||||
"debugBar.jank.label": "JANK",
|
||||
"debugBar.jank.tip": "Son 5 saniyede 32ms üzerindeki kareler.",
|
||||
"debugBar.long.label": "LONG",
|
||||
"debugBar.long.tip": "Son 5 saniyedeki engellenen süre ve uzun görev sayısı. Maksimum görev: {{max}}.",
|
||||
"debugBar.delay.label": "DELAY",
|
||||
"debugBar.delay.tip": "Son 5 saniyede gözlemlenen en kötü giriş gecikmesi.",
|
||||
"debugBar.inp.label": "INP",
|
||||
"debugBar.inp.tip": "Son 5 saniyedeki yaklaşık etkileşim süresi. Bu INP benzeridir, resmi Web Vitals INP değildir.",
|
||||
"debugBar.cls.label": "CLS",
|
||||
"debugBar.cls.tip": "Mevcut uygulama ömrü için kümülatif düzen kayması.",
|
||||
"debugBar.mem.label": "MEM",
|
||||
"debugBar.mem.tipUnavailable": "Kullanılan JS yığını vs yığın sınırı. Yalnızca Chromium.",
|
||||
"debugBar.mem.tip": "Kullanılan JS yığını vs yığın sınırı. {{limit}} içinde {{used}}.",
|
||||
"common.key.ctrl": "Ctrl",
|
||||
"common.key.alt": "Alt",
|
||||
"common.key.shift": "Shift",
|
||||
"common.key.meta": "Meta",
|
||||
"common.key.space": "Boşluk",
|
||||
"common.key.backspace": "Geri",
|
||||
"common.key.enter": "Enter",
|
||||
"common.key.tab": "Tab",
|
||||
"common.key.delete": "Delete",
|
||||
"common.key.home": "Home",
|
||||
"common.key.end": "End",
|
||||
"common.key.pageUp": "Page Up",
|
||||
"common.key.pageDown": "Page Down",
|
||||
"common.key.insert": "Insert",
|
||||
"common.unknown": "bilinmiyor",
|
||||
"error.page.circular": "[Döngüsel]",
|
||||
"error.globalSDK.noServerAvailable": "Sunucu yok",
|
||||
"error.globalSDK.serverNotAvailable": "Sunucu mevcut değil",
|
||||
"error.childStore.persistedCacheCreateFailed": "Kalıcı önbellek oluşturulamadı",
|
||||
"error.childStore.persistedProjectMetadataCreateFailed": "Kalıcı proje meta verileri oluşturulamadı",
|
||||
"error.childStore.persistedProjectIconCreateFailed": "Kalıcı proje simgesi oluşturulamadı",
|
||||
"error.childStore.storeCreateFailed": "Depo oluşturulamadı",
|
||||
"terminal.connectionLost.abnormalClose": "WebSocket anormal şekilde kapandı: {{code}}",
|
||||
} satisfies Partial<Record<Keys, string>>
|
||||
|
||||
@@ -283,7 +283,7 @@ export const dict = {
|
||||
"prompt.example.25": "这里的环境变量是怎么工作的?",
|
||||
"prompt.popover.emptyResults": "没有匹配的结果",
|
||||
"prompt.popover.emptyCommands": "没有匹配的命令",
|
||||
"prompt.dropzone.label": "将图片、PDF 或文本文件拖放到此处",
|
||||
"prompt.dropzone.label": "将图片或 PDF 拖到这里",
|
||||
"prompt.dropzone.file.label": "拖放以 @提及文件",
|
||||
"prompt.slash.badge.custom": "自定义",
|
||||
"prompt.slash.badge.skill": "技能",
|
||||
@@ -296,8 +296,8 @@ export const dict = {
|
||||
"prompt.attachment.remove": "移除附件",
|
||||
"prompt.action.send": "发送",
|
||||
"prompt.action.stop": "停止",
|
||||
"prompt.toast.pasteUnsupported.title": "不支持的附件",
|
||||
"prompt.toast.pasteUnsupported.description": "此处仅能附加图片、PDF 或文本文件。",
|
||||
"prompt.toast.pasteUnsupported.title": "不支持的粘贴",
|
||||
"prompt.toast.pasteUnsupported.description": "这里只能粘贴图片或 PDF 文件。",
|
||||
"prompt.toast.modelAgentRequired.title": "请选择智能体和模型",
|
||||
"prompt.toast.modelAgentRequired.description": "发送提示前请先选择智能体和模型。",
|
||||
"prompt.toast.worktreeCreateFailed.title": "创建工作树失败",
|
||||
@@ -853,77 +853,4 @@ export const dict = {
|
||||
"common.time.daysAgo.short": "{{count}}天前",
|
||||
"settings.providers.connected.environmentDescription": "已通过环境变量连接",
|
||||
"settings.providers.custom.description": "通过基础 URL 添加与 OpenAI 兼容的提供商。",
|
||||
|
||||
"app.server.unreachable": "无法连接到 {{server}}",
|
||||
"app.server.retrying": "正在自动重试...",
|
||||
"app.server.otherServers": "其他服务器",
|
||||
"dialog.server.add.usernamePlaceholder": "用户名",
|
||||
"dialog.server.add.passwordPlaceholder": "密码",
|
||||
"server.row.noUsername": "无用户名",
|
||||
"session.review.noVcs.createGit.title": "创建 Git 仓库",
|
||||
"session.review.noVcs.createGit.description": "在此项目中跟踪、审查和撤消更改",
|
||||
"session.review.noVcs.createGit.actionLoading": "正在创建 Git 仓库...",
|
||||
"session.review.noVcs.createGit.action": "创建 Git 仓库",
|
||||
"session.todo.progress": "已完成 {{done}} 个任务(共 {{total}} 个)",
|
||||
"session.question.progress": "{{current}}/{{total}} 个问题",
|
||||
"session.header.open.finder": "访达",
|
||||
"session.header.open.fileExplorer": "文件资源管理器",
|
||||
"session.header.open.fileManager": "文件管理器",
|
||||
"session.header.open.app.vscode": "VS Code",
|
||||
"session.header.open.app.cursor": "Cursor",
|
||||
"session.header.open.app.zed": "Zed",
|
||||
"session.header.open.app.textmate": "TextMate",
|
||||
"session.header.open.app.antigravity": "Antigravity",
|
||||
"session.header.open.app.terminal": "终端",
|
||||
"session.header.open.app.iterm2": "iTerm2",
|
||||
"session.header.open.app.ghostty": "Ghostty",
|
||||
"session.header.open.app.warp": "Warp",
|
||||
"session.header.open.app.xcode": "Xcode",
|
||||
"session.header.open.app.androidStudio": "Android Studio",
|
||||
"session.header.open.app.powershell": "PowerShell",
|
||||
"session.header.open.app.sublimeText": "Sublime Text",
|
||||
"debugBar.ariaLabel": "开发性能诊断",
|
||||
"debugBar.na": "不适用",
|
||||
"debugBar.nav.label": "NAV",
|
||||
"debugBar.nav.tip": "最后一次完成的涉及会话页面的路由转换,从路由器启动到稳定后的第一次绘制。",
|
||||
"debugBar.fps.label": "FPS",
|
||||
"debugBar.fps.tip": "过去 5 秒内的滚动帧率。",
|
||||
"debugBar.frame.label": "FRAME",
|
||||
"debugBar.frame.tip": "过去 5 秒内最差的帧时间。",
|
||||
"debugBar.jank.label": "JANK",
|
||||
"debugBar.jank.tip": "过去 5 秒内超过 32ms 的帧。",
|
||||
"debugBar.long.label": "LONG",
|
||||
"debugBar.long.tip": "过去 5 秒内的阻塞时间和长任务计数。最大任务:{{max}}。",
|
||||
"debugBar.delay.label": "DELAY",
|
||||
"debugBar.delay.tip": "过去 5 秒内观察到的最差输入延迟。",
|
||||
"debugBar.inp.label": "INP",
|
||||
"debugBar.inp.tip": "过去 5 秒内的近似交互持续时间。这类似于 INP,而非官方的 Web Vitals INP。",
|
||||
"debugBar.cls.label": "CLS",
|
||||
"debugBar.cls.tip": "当前应用生命周期的累积布局偏移。",
|
||||
"debugBar.mem.label": "MEM",
|
||||
"debugBar.mem.tipUnavailable": "使用的 JS 堆与堆限制。仅限 Chromium。",
|
||||
"debugBar.mem.tip": "使用的 JS 堆与堆限制。{{used}} / {{limit}}。",
|
||||
"common.key.ctrl": "Ctrl",
|
||||
"common.key.alt": "Alt",
|
||||
"common.key.shift": "Shift",
|
||||
"common.key.meta": "Meta",
|
||||
"common.key.space": "空格",
|
||||
"common.key.backspace": "退格",
|
||||
"common.key.enter": "回车",
|
||||
"common.key.tab": "Tab",
|
||||
"common.key.delete": "Delete",
|
||||
"common.key.home": "Home",
|
||||
"common.key.end": "End",
|
||||
"common.key.pageUp": "Page Up",
|
||||
"common.key.pageDown": "Page Down",
|
||||
"common.key.insert": "Insert",
|
||||
"common.unknown": "未知",
|
||||
"error.page.circular": "[循环]",
|
||||
"error.globalSDK.noServerAvailable": "无可用服务器",
|
||||
"error.globalSDK.serverNotAvailable": "服务器不可用",
|
||||
"error.childStore.persistedCacheCreateFailed": "创建持久化缓存失败",
|
||||
"error.childStore.persistedProjectMetadataCreateFailed": "创建持久化项目元数据失败",
|
||||
"error.childStore.persistedProjectIconCreateFailed": "创建持久化项目图标失败",
|
||||
"error.childStore.storeCreateFailed": "创建存储失败",
|
||||
"terminal.connectionLost.abnormalClose": "WebSocket 异常关闭:{{code}}",
|
||||
} satisfies Partial<Record<Keys, string>>
|
||||
|
||||
@@ -263,7 +263,7 @@ export const dict = {
|
||||
|
||||
"prompt.popover.emptyResults": "沒有符合的結果",
|
||||
"prompt.popover.emptyCommands": "沒有符合的命令",
|
||||
"prompt.dropzone.label": "將圖片、PDF 或文字檔案拖放到此處",
|
||||
"prompt.dropzone.label": "將圖片或 PDF 拖到這裡",
|
||||
"prompt.dropzone.file.label": "拖放以 @提及檔案",
|
||||
"prompt.slash.badge.custom": "自訂",
|
||||
"prompt.slash.badge.skill": "技能",
|
||||
@@ -277,8 +277,8 @@ export const dict = {
|
||||
"prompt.action.send": "傳送",
|
||||
"prompt.action.stop": "停止",
|
||||
|
||||
"prompt.toast.pasteUnsupported.title": "不支援的附件",
|
||||
"prompt.toast.pasteUnsupported.description": "此處僅能附加圖片、PDF 或文字檔案。",
|
||||
"prompt.toast.pasteUnsupported.title": "不支援的貼上",
|
||||
"prompt.toast.pasteUnsupported.description": "這裡只能貼上圖片或 PDF 檔案。",
|
||||
"prompt.toast.modelAgentRequired.title": "請選擇代理程式和模型",
|
||||
"prompt.toast.modelAgentRequired.description": "傳送提示前請先選擇代理程式和模型。",
|
||||
"prompt.toast.worktreeCreateFailed.title": "建立工作樹失敗",
|
||||
@@ -848,77 +848,4 @@ export const dict = {
|
||||
"common.time.daysAgo.short": "{{count}}天前",
|
||||
"settings.providers.connected.environmentDescription": "已從環境變數連線",
|
||||
"settings.providers.custom.description": "透過基本 URL 新增與 OpenAI 相容的提供者。",
|
||||
|
||||
"app.server.unreachable": "無法連線至 {{server}}",
|
||||
"app.server.retrying": "正在自動重試...",
|
||||
"app.server.otherServers": "其他伺服器",
|
||||
"dialog.server.add.usernamePlaceholder": "使用者名稱",
|
||||
"dialog.server.add.passwordPlaceholder": "密碼",
|
||||
"server.row.noUsername": "無使用者名稱",
|
||||
"session.review.noVcs.createGit.title": "建立 Git 儲存庫",
|
||||
"session.review.noVcs.createGit.description": "追蹤、檢閱及復原此專案中的變更",
|
||||
"session.review.noVcs.createGit.actionLoading": "正在建立 Git 儲存庫...",
|
||||
"session.review.noVcs.createGit.action": "建立 Git 儲存庫",
|
||||
"session.todo.progress": "已完成 {{done}} 個待辦事項(共 {{total}} 個)",
|
||||
"session.question.progress": "{{current}}/{{total}} 個問題",
|
||||
"session.header.open.finder": "Finder",
|
||||
"session.header.open.fileExplorer": "檔案總管",
|
||||
"session.header.open.fileManager": "檔案管理員",
|
||||
"session.header.open.app.vscode": "VS Code",
|
||||
"session.header.open.app.cursor": "Cursor",
|
||||
"session.header.open.app.zed": "Zed",
|
||||
"session.header.open.app.textmate": "TextMate",
|
||||
"session.header.open.app.antigravity": "Antigravity",
|
||||
"session.header.open.app.terminal": "終端機",
|
||||
"session.header.open.app.iterm2": "iTerm2",
|
||||
"session.header.open.app.ghostty": "Ghostty",
|
||||
"session.header.open.app.warp": "Warp",
|
||||
"session.header.open.app.xcode": "Xcode",
|
||||
"session.header.open.app.androidStudio": "Android Studio",
|
||||
"session.header.open.app.powershell": "PowerShell",
|
||||
"session.header.open.app.sublimeText": "Sublime Text",
|
||||
"debugBar.ariaLabel": "開發效能診斷",
|
||||
"debugBar.na": "不適用",
|
||||
"debugBar.nav.label": "NAV",
|
||||
"debugBar.nav.tip": "最後一次完成的涉及工作階段頁面的路由轉換,從路由器啟動到穩定後的第一次繪製。",
|
||||
"debugBar.fps.label": "FPS",
|
||||
"debugBar.fps.tip": "過去 5 秒內的滾動幀率。",
|
||||
"debugBar.frame.label": "FRAME",
|
||||
"debugBar.frame.tip": "過去 5 秒內最差的幀時間。",
|
||||
"debugBar.jank.label": "JANK",
|
||||
"debugBar.jank.tip": "過去 5 秒內超過 32ms 的幀。",
|
||||
"debugBar.long.label": "LONG",
|
||||
"debugBar.long.tip": "過去 5 秒內的阻塞時間和長任務計數。最大任務:{{max}}。",
|
||||
"debugBar.delay.label": "DELAY",
|
||||
"debugBar.delay.tip": "過去 5 秒內觀察到的最差輸入延遲。",
|
||||
"debugBar.inp.label": "INP",
|
||||
"debugBar.inp.tip": "過去 5 秒內的近似互動持續時間。這類似於 INP,而非官方的 Web Vitals INP。",
|
||||
"debugBar.cls.label": "CLS",
|
||||
"debugBar.cls.tip": "目前應用程式生命週期的累積版面配置位移。",
|
||||
"debugBar.mem.label": "MEM",
|
||||
"debugBar.mem.tipUnavailable": "使用的 JS 堆積與堆積限制。僅限 Chromium。",
|
||||
"debugBar.mem.tip": "使用的 JS 堆積與堆積限制。{{used}} / {{limit}}。",
|
||||
"common.key.ctrl": "Ctrl",
|
||||
"common.key.alt": "Alt",
|
||||
"common.key.shift": "Shift",
|
||||
"common.key.meta": "Meta",
|
||||
"common.key.space": "空白鍵",
|
||||
"common.key.backspace": "退格鍵",
|
||||
"common.key.enter": "Enter",
|
||||
"common.key.tab": "Tab",
|
||||
"common.key.delete": "Delete",
|
||||
"common.key.home": "Home",
|
||||
"common.key.end": "End",
|
||||
"common.key.pageUp": "Page Up",
|
||||
"common.key.pageDown": "Page Down",
|
||||
"common.key.insert": "Insert",
|
||||
"common.unknown": "未知",
|
||||
"error.page.circular": "[循環]",
|
||||
"error.globalSDK.noServerAvailable": "無可用的伺服器",
|
||||
"error.globalSDK.serverNotAvailable": "伺服器無法使用",
|
||||
"error.childStore.persistedCacheCreateFailed": "建立持續性快取失敗",
|
||||
"error.childStore.persistedProjectMetadataCreateFailed": "建立持續性專案中繼資料失敗",
|
||||
"error.childStore.persistedProjectIconCreateFailed": "建立持續性專案圖示失敗",
|
||||
"error.childStore.storeCreateFailed": "建立儲存區失敗",
|
||||
"terminal.connectionLost.abnormalClose": "WebSocket 異常關閉:{{code}}",
|
||||
} satisfies Partial<Record<Keys, string>>
|
||||
|
||||
@@ -35,14 +35,14 @@ function isInitError(error: unknown): error is InitError {
|
||||
)
|
||||
}
|
||||
|
||||
function safeJson(value: unknown, circular: string): string {
|
||||
function safeJson(value: unknown): string {
|
||||
const seen = new WeakSet<object>()
|
||||
const json = JSON.stringify(
|
||||
value,
|
||||
(_key, val) => {
|
||||
if (typeof val === "bigint") return val.toString()
|
||||
if (typeof val === "object" && val) {
|
||||
if (seen.has(val)) return circular
|
||||
if (seen.has(val)) return "[Circular]"
|
||||
seen.add(val)
|
||||
}
|
||||
return val
|
||||
@@ -54,15 +54,14 @@ function safeJson(value: unknown, circular: string): string {
|
||||
|
||||
function formatInitError(error: InitError, t: Translator): string {
|
||||
const data = error.data
|
||||
const json = (value: unknown) => safeJson(value, t("error.page.circular"))
|
||||
switch (error.name) {
|
||||
case "MCPFailed": {
|
||||
const name = typeof data.name === "string" ? data.name : ""
|
||||
return t("error.chain.mcpFailed", { name })
|
||||
}
|
||||
case "ProviderAuthError": {
|
||||
const providerID = typeof data.providerID === "string" ? data.providerID : t("common.unknown")
|
||||
const message = typeof data.message === "string" ? data.message : json(data.message)
|
||||
const providerID = typeof data.providerID === "string" ? data.providerID : "unknown"
|
||||
const message = typeof data.message === "string" ? data.message : safeJson(data.message)
|
||||
return t("error.chain.providerAuthFailed", { provider: providerID, message })
|
||||
}
|
||||
case "APIError": {
|
||||
@@ -102,24 +101,24 @@ function formatInitError(error: InitError, t: Translator): string {
|
||||
].join("\n")
|
||||
}
|
||||
case "ProviderInitError": {
|
||||
const providerID = typeof data.providerID === "string" ? data.providerID : t("common.unknown")
|
||||
const providerID = typeof data.providerID === "string" ? data.providerID : "unknown"
|
||||
return t("error.chain.providerInitFailed", { provider: providerID })
|
||||
}
|
||||
case "ConfigJsonError": {
|
||||
const path = typeof data.path === "string" ? data.path : json(data.path)
|
||||
const path = typeof data.path === "string" ? data.path : safeJson(data.path)
|
||||
const message = typeof data.message === "string" ? data.message : ""
|
||||
if (message) return t("error.chain.configJsonInvalidWithMessage", { path, message })
|
||||
return t("error.chain.configJsonInvalid", { path })
|
||||
}
|
||||
case "ConfigDirectoryTypoError": {
|
||||
const path = typeof data.path === "string" ? data.path : json(data.path)
|
||||
const dir = typeof data.dir === "string" ? data.dir : json(data.dir)
|
||||
const suggestion = typeof data.suggestion === "string" ? data.suggestion : json(data.suggestion)
|
||||
const path = typeof data.path === "string" ? data.path : safeJson(data.path)
|
||||
const dir = typeof data.dir === "string" ? data.dir : safeJson(data.dir)
|
||||
const suggestion = typeof data.suggestion === "string" ? data.suggestion : safeJson(data.suggestion)
|
||||
return t("error.chain.configDirectoryTypo", { dir, path, suggestion })
|
||||
}
|
||||
case "ConfigFrontmatterError": {
|
||||
const path = typeof data.path === "string" ? data.path : json(data.path)
|
||||
const message = typeof data.message === "string" ? data.message : json(data.message)
|
||||
const path = typeof data.path === "string" ? data.path : safeJson(data.path)
|
||||
const message = typeof data.message === "string" ? data.message : safeJson(data.message)
|
||||
return t("error.chain.configFrontmatterError", { path, message })
|
||||
}
|
||||
case "ConfigInvalidError": {
|
||||
@@ -127,7 +126,7 @@ function formatInitError(error: InitError, t: Translator): string {
|
||||
? data.issues.filter(isIssue).map((issue) => "↳ " + issue.message + " " + issue.path.join("."))
|
||||
: []
|
||||
const message = typeof data.message === "string" ? data.message : ""
|
||||
const path = typeof data.path === "string" ? data.path : json(data.path)
|
||||
const path = typeof data.path === "string" ? data.path : safeJson(data.path)
|
||||
|
||||
const line = message
|
||||
? t("error.chain.configInvalidWithMessage", { path, message })
|
||||
@@ -136,15 +135,14 @@ function formatInitError(error: InitError, t: Translator): string {
|
||||
return [line, ...issues].join("\n")
|
||||
}
|
||||
case "UnknownError":
|
||||
return typeof data.message === "string" ? data.message : json(data)
|
||||
return typeof data.message === "string" ? data.message : safeJson(data)
|
||||
default:
|
||||
if (typeof data.message === "string") return data.message
|
||||
return json(data)
|
||||
return safeJson(data)
|
||||
}
|
||||
}
|
||||
|
||||
function formatErrorChain(error: unknown, t: Translator, depth = 0, parentMessage?: string): string {
|
||||
const json = (value: unknown) => safeJson(value, t("error.page.circular"))
|
||||
if (!error) return t("error.chain.unknown")
|
||||
|
||||
if (isInitError(error)) {
|
||||
@@ -206,7 +204,7 @@ function formatErrorChain(error: unknown, t: Translator, depth = 0, parentMessag
|
||||
}
|
||||
|
||||
const indent = depth > 0 ? `\n${CHAIN_SEPARATOR}${t("error.chain.causedBy")}\n` : ""
|
||||
return indent + json(error)
|
||||
return indent + safeJson(error)
|
||||
}
|
||||
|
||||
function formatError(error: unknown, t: Translator): string {
|
||||
|
||||
@@ -1,4 +1,16 @@
|
||||
import { batch, createEffect, createMemo, For, on, onCleanup, onMount, ParentProps, Show, untrack } from "solid-js"
|
||||
import {
|
||||
batch,
|
||||
createEffect,
|
||||
createMemo,
|
||||
createSignal,
|
||||
For,
|
||||
on,
|
||||
onCleanup,
|
||||
onMount,
|
||||
ParentProps,
|
||||
Show,
|
||||
untrack,
|
||||
} from "solid-js"
|
||||
import { useNavigate, useParams } from "@solidjs/router"
|
||||
import { useLayout, LocalProject } from "@/context/layout"
|
||||
import { useGlobalSync } from "@/context/global-sync"
|
||||
@@ -29,8 +41,8 @@ import {
|
||||
getSessionPrefetch,
|
||||
isSessionPrefetchCurrent,
|
||||
runSessionPrefetch,
|
||||
SESSION_PREFETCH_TTL,
|
||||
setSessionPrefetch,
|
||||
shouldSkipSessionPrefetch,
|
||||
} from "@/context/global-sync/session-prefetch"
|
||||
import { useNotification } from "@/context/notification"
|
||||
import { usePermission } from "@/context/permission"
|
||||
@@ -128,20 +140,14 @@ export default function Layout(props: ParentProps) {
|
||||
|
||||
const [state, setState] = createStore({
|
||||
autoselect: !initialDirectory,
|
||||
routing: false,
|
||||
busyWorkspaces: {} as Record<string, boolean>,
|
||||
hoverSession: undefined as string | undefined,
|
||||
hoverProject: undefined as string | undefined,
|
||||
scrollSessionKey: undefined as string | undefined,
|
||||
nav: undefined as HTMLElement | undefined,
|
||||
sortNow: Date.now(),
|
||||
sizing: false,
|
||||
peek: undefined as LocalProject | undefined,
|
||||
peeked: false,
|
||||
})
|
||||
|
||||
const editor = createInlineEditorController()
|
||||
let token = 0
|
||||
const setBusy = (directory: string, value: boolean) => {
|
||||
const key = workspaceKey(directory)
|
||||
if (value) {
|
||||
@@ -157,13 +163,14 @@ export default function Layout(props: ParentProps) {
|
||||
}
|
||||
const isBusy = (directory: string) => !!state.busyWorkspaces[workspaceKey(directory)]
|
||||
const navLeave = { current: undefined as number | undefined }
|
||||
const sortNow = () => state.sortNow
|
||||
const [sortNow, setSortNow] = createSignal(Date.now())
|
||||
const [sizing, setSizing] = createSignal(false)
|
||||
let sizet: number | undefined
|
||||
let sortNowInterval: ReturnType<typeof setInterval> | undefined
|
||||
const sortNowTimeout = setTimeout(
|
||||
() => {
|
||||
setState("sortNow", Date.now())
|
||||
sortNowInterval = setInterval(() => setState("sortNow", Date.now()), 60_000)
|
||||
setSortNow(Date.now())
|
||||
sortNowInterval = setInterval(() => setSortNow(Date.now()), 60_000)
|
||||
},
|
||||
60_000 - (Date.now() % 60_000),
|
||||
)
|
||||
@@ -189,7 +196,7 @@ export default function Layout(props: ParentProps) {
|
||||
})
|
||||
|
||||
onMount(() => {
|
||||
const stop = () => setState("sizing", false)
|
||||
const stop = () => setSizing(false)
|
||||
window.addEventListener("pointerup", stop)
|
||||
window.addEventListener("pointercancel", stop)
|
||||
window.addEventListener("blur", stop)
|
||||
@@ -227,6 +234,8 @@ export default function Layout(props: ParentProps) {
|
||||
}, 300)
|
||||
}
|
||||
|
||||
const [peek, setPeek] = createSignal<LocalProject | undefined>(undefined)
|
||||
const [peeked, setPeeked] = createSignal(false)
|
||||
let peekt: number | undefined
|
||||
|
||||
const hoverProjectData = createMemo(() => {
|
||||
@@ -242,17 +251,17 @@ export default function Layout(props: ParentProps) {
|
||||
clearTimeout(peekt)
|
||||
peekt = undefined
|
||||
}
|
||||
setState("peek", p)
|
||||
setState("peeked", true)
|
||||
setPeek(p)
|
||||
setPeeked(true)
|
||||
return
|
||||
}
|
||||
|
||||
setState("peeked", false)
|
||||
if (state.peek === undefined) return
|
||||
setPeeked(false)
|
||||
if (peek() === undefined) return
|
||||
if (peekt !== undefined) clearTimeout(peekt)
|
||||
peekt = window.setTimeout(() => {
|
||||
peekt = undefined
|
||||
setState("peek", undefined)
|
||||
setPeek(undefined)
|
||||
}, 180)
|
||||
})
|
||||
|
||||
@@ -263,7 +272,6 @@ export default function Layout(props: ParentProps) {
|
||||
|
||||
const autoselecting = createMemo(() => {
|
||||
if (params.dir) return false
|
||||
if (state.routing) return true
|
||||
if (!state.autoselect) return false
|
||||
if (!pageReady()) return true
|
||||
if (!layoutReady()) return true
|
||||
@@ -273,16 +281,12 @@ export default function Layout(props: ParentProps) {
|
||||
})
|
||||
|
||||
createEffect(() => {
|
||||
if (!state.autoselect && !state.routing) return
|
||||
if (!state.autoselect) return
|
||||
const dir = params.dir
|
||||
if (!dir) return
|
||||
const directory = decode64(dir)
|
||||
if (!directory) return
|
||||
token += 1
|
||||
batch(() => {
|
||||
setState("autoselect", false)
|
||||
setState("routing", false)
|
||||
})
|
||||
setState("autoselect", false)
|
||||
})
|
||||
|
||||
const editorOpen = editor.editorOpen
|
||||
@@ -568,32 +572,23 @@ export default function Layout(props: ParentProps) {
|
||||
if (!value.ready) return
|
||||
if (!value.layoutReady) return
|
||||
if (!state.autoselect) return
|
||||
if (state.routing) return
|
||||
if (value.dir) return
|
||||
|
||||
const last = server.projects.last()
|
||||
const next =
|
||||
value.list.length === 0
|
||||
? last
|
||||
: (value.list.find((project) => project.worktree === last)?.worktree ?? value.list[0]?.worktree)
|
||||
if (!next) return
|
||||
|
||||
const id = ++token
|
||||
batch(() => {
|
||||
if (value.list.length === 0) {
|
||||
if (!last) return
|
||||
setState("autoselect", false)
|
||||
setState("routing", true)
|
||||
})
|
||||
void navigateToProject(next, () => id === token && !params.dir).then(
|
||||
(navigated) => {
|
||||
if (id !== token) return
|
||||
if (navigated) return
|
||||
setState("routing", false)
|
||||
},
|
||||
() => {
|
||||
if (id !== token) return
|
||||
setState("routing", false)
|
||||
},
|
||||
)
|
||||
openProject(last, false)
|
||||
navigateToProject(last)
|
||||
return
|
||||
}
|
||||
|
||||
const next = value.list.find((project) => project.worktree === last) ?? value.list[0]
|
||||
if (!next) return
|
||||
setState("autoselect", false)
|
||||
openProject(next.worktree, false)
|
||||
navigateToProject(next.worktree)
|
||||
},
|
||||
),
|
||||
)
|
||||
@@ -775,11 +770,9 @@ export default function Layout(props: ParentProps) {
|
||||
const next = items.map((x) => x.info).filter((m): m is Message => !!m?.id)
|
||||
const sorted = mergeByID([], next)
|
||||
const stale = markPrefetched(directory, sessionID)
|
||||
const cursor = messages.response.headers.get("x-next-cursor") ?? undefined
|
||||
const meta = {
|
||||
limit: sorted.length,
|
||||
cursor,
|
||||
complete: !cursor,
|
||||
limit: prefetchChunk,
|
||||
complete: sorted.length < prefetchChunk,
|
||||
at: Date.now(),
|
||||
}
|
||||
|
||||
@@ -853,12 +846,10 @@ export default function Layout(props: ParentProps) {
|
||||
|
||||
const [store] = globalSync.child(directory, { bootstrap: false })
|
||||
const cached = untrack(() => {
|
||||
if (store.message[session.id] === undefined) return false
|
||||
const info = getSessionPrefetch(directory, session.id)
|
||||
return shouldSkipSessionPrefetch({
|
||||
message: store.message[session.id] !== undefined,
|
||||
info,
|
||||
chunk: prefetchChunk,
|
||||
})
|
||||
if (!info) return false
|
||||
return Date.now() - info.at < SESSION_PREFETCH_TTL
|
||||
})
|
||||
if (cached) return
|
||||
|
||||
@@ -1227,19 +1218,14 @@ export default function Layout(props: ParentProps) {
|
||||
return root
|
||||
}
|
||||
|
||||
async function navigateToProject(directory: string | undefined, live = () => true) {
|
||||
if (!directory || !live()) return false
|
||||
async function navigateToProject(directory: string | undefined) {
|
||||
if (!directory) return
|
||||
const root = projectRoot(directory)
|
||||
const touch = () => {
|
||||
if (!live()) return false
|
||||
layout.projects.open(root)
|
||||
server.projects.touch(root)
|
||||
return true
|
||||
}
|
||||
server.projects.touch(root)
|
||||
const project = layout.projects.list().find((item) => item.worktree === root)
|
||||
const sandboxes =
|
||||
project?.sandboxes ?? globalSync.data.project.find((item) => item.worktree === root)?.sandboxes ?? []
|
||||
let dirs = effectiveWorkspaceOrder(root, [root, ...sandboxes], store.workspaceOrder[root])
|
||||
let dirs = project
|
||||
? effectiveWorkspaceOrder(root, [root, ...(project.sandboxes ?? [])], store.workspaceOrder[root])
|
||||
: [root]
|
||||
const canOpen = (value: string | undefined) => {
|
||||
if (!value) return false
|
||||
return dirs.some((item) => workspaceKey(item) === workspaceKey(value))
|
||||
@@ -1250,16 +1236,13 @@ export default function Layout(props: ParentProps) {
|
||||
.list({ directory: root })
|
||||
.then((x) => x.data ?? [])
|
||||
.catch(() => [] as string[])
|
||||
if (!live()) return false
|
||||
dirs = effectiveWorkspaceOrder(root, [root, ...listed], store.workspaceOrder[root])
|
||||
return canOpen(target)
|
||||
}
|
||||
const openSession = async (target: { directory: string; id: string }) => {
|
||||
if (!live()) return false
|
||||
if (!canOpen(target.directory)) return false
|
||||
const [data] = globalSync.child(target.directory, { bootstrap: false })
|
||||
if (data.session.some((item) => item.id === target.id)) {
|
||||
if (!touch()) return false
|
||||
setStore("lastProjectSession", root, { directory: target.directory, id: target.id, at: Date.now() })
|
||||
navigateWithSidebarReset(`/${base64Encode(target.directory)}/session/${target.id}`)
|
||||
return true
|
||||
@@ -1268,10 +1251,8 @@ export default function Layout(props: ParentProps) {
|
||||
.get({ sessionID: target.id })
|
||||
.then((x) => x.data)
|
||||
.catch(() => undefined)
|
||||
if (!live()) return false
|
||||
if (!resolved?.directory) return false
|
||||
if (!canOpen(resolved.directory)) return false
|
||||
if (!touch()) return false
|
||||
setStore("lastProjectSession", root, { directory: resolved.directory, id: resolved.id, at: Date.now() })
|
||||
navigateWithSidebarReset(`/${base64Encode(resolved.directory)}/session/${resolved.id}`)
|
||||
return true
|
||||
@@ -1280,23 +1261,19 @@ export default function Layout(props: ParentProps) {
|
||||
const projectSession = store.lastProjectSession[root]
|
||||
if (projectSession?.id) {
|
||||
await refreshDirs(projectSession.directory)
|
||||
if (!live()) return false
|
||||
const opened = await openSession(projectSession)
|
||||
if (opened) return true
|
||||
if (!live()) return false
|
||||
if (opened) return
|
||||
clearLastProjectSession(root)
|
||||
}
|
||||
|
||||
if (!live()) return false
|
||||
const latest = latestRootSession(
|
||||
dirs.map((item) => globalSync.child(item, { bootstrap: false })[0]),
|
||||
Date.now(),
|
||||
)
|
||||
if (latest && (await openSession(latest))) {
|
||||
return true
|
||||
return
|
||||
}
|
||||
|
||||
if (!live()) return false
|
||||
const fetched = latestRootSession(
|
||||
await Promise.all(
|
||||
dirs.map(async (item) => ({
|
||||
@@ -1309,14 +1286,11 @@ export default function Layout(props: ParentProps) {
|
||||
),
|
||||
Date.now(),
|
||||
)
|
||||
if (!live()) return false
|
||||
if (fetched && (await openSession(fetched))) {
|
||||
return true
|
||||
return
|
||||
}
|
||||
|
||||
if (!touch()) return false
|
||||
navigateWithSidebarReset(`/${base64Encode(root)}/session`)
|
||||
return true
|
||||
}
|
||||
|
||||
function navigateToSession(session: Session | undefined) {
|
||||
@@ -1994,7 +1968,7 @@ export default function Layout(props: ParentProps) {
|
||||
return (
|
||||
<div
|
||||
classList={{
|
||||
"flex flex-col min-h-0 min-w-0 box-border rounded-tl-[12px] px-3": true,
|
||||
"flex flex-col min-h-0 min-w-0 box-border rounded-tl-[12px] px-2": true,
|
||||
"border border-b-0 border-border-weak-base": !merged(),
|
||||
"border-l border-t border-border-weaker-base": merged(),
|
||||
"bg-background-base": merged() || hover(),
|
||||
@@ -2009,8 +1983,8 @@ export default function Layout(props: ParentProps) {
|
||||
<Show when={panelProps.project}>
|
||||
{(p) => (
|
||||
<>
|
||||
<div class="shrink-0 pl-1 py-1">
|
||||
<div class="group/project flex items-start justify-between gap-2 py-2 pl-2 pr-0">
|
||||
<div class="shrink-0 px-2 py-1">
|
||||
<div class="group/project flex items-start justify-between gap-2 p-2 pr-1">
|
||||
<div class="flex flex-col min-w-0">
|
||||
<InlineEditor
|
||||
id={`project:${projectId()}`}
|
||||
@@ -2096,7 +2070,7 @@ export default function Layout(props: ParentProps) {
|
||||
when={workspacesEnabled()}
|
||||
fallback={
|
||||
<>
|
||||
<div class="shrink-0 py-4">
|
||||
<div class="shrink-0 py-4 px-3">
|
||||
<Button
|
||||
size="large"
|
||||
icon="plus-small"
|
||||
@@ -2119,7 +2093,7 @@ export default function Layout(props: ParentProps) {
|
||||
}
|
||||
>
|
||||
<>
|
||||
<div class="shrink-0 py-4">
|
||||
<div class="shrink-0 py-4 px-3">
|
||||
<Button size="large" icon="plus-small" class="w-full" onClick={() => createWorkspace(p())}>
|
||||
{language.t("workspace.new")}
|
||||
</Button>
|
||||
@@ -2192,7 +2166,7 @@ export default function Layout(props: ParentProps) {
|
||||
{language.t("command.provider.connect")}
|
||||
</Button>
|
||||
<Button size="large" variant="ghost" onClick={() => setStore("gettingStartedDismissed", true)}>
|
||||
{language.t("toast.update.action.notYet")}
|
||||
Not yet
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2267,7 +2241,7 @@ export default function Layout(props: ParentProps) {
|
||||
>
|
||||
<div class="@container w-full h-full contain-strict">{sidebarContent()}</div>
|
||||
<Show when={layout.sidebar.opened()}>
|
||||
<div onPointerDown={() => setState("sizing", true)}>
|
||||
<div onPointerDown={() => setSizing(true)}>
|
||||
<ResizeHandle
|
||||
direction="horizontal"
|
||||
size={layout.sidebar.width()}
|
||||
@@ -2275,9 +2249,9 @@ export default function Layout(props: ParentProps) {
|
||||
max={typeof window === "undefined" ? 1000 : window.innerWidth * 0.3 + 64}
|
||||
collapseThreshold={244}
|
||||
onResize={(w) => {
|
||||
setState("sizing", true)
|
||||
setSizing(true)
|
||||
if (sizet !== undefined) clearTimeout(sizet)
|
||||
sizet = window.setTimeout(() => setState("sizing", false), 120)
|
||||
sizet = window.setTimeout(() => setSizing(false), 120)
|
||||
layout.sidebar.resize(w)
|
||||
}}
|
||||
onCollapse={layout.sidebar.close}
|
||||
@@ -2322,7 +2296,7 @@ export default function Layout(props: ParentProps) {
|
||||
"xl:inset-y-0 xl:right-0 xl:left-[var(--main-left)]": true,
|
||||
"z-20": true,
|
||||
"transition-[left] duration-200 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-[left] motion-reduce:transition-none":
|
||||
!state.sizing,
|
||||
!sizing(),
|
||||
}}
|
||||
style={{
|
||||
"--main-left": layout.sidebar.opened() ? `${Math.max(layout.sidebar.width(), 244)}px` : "4rem",
|
||||
@@ -2342,11 +2316,11 @@ export default function Layout(props: ParentProps) {
|
||||
<div
|
||||
classList={{
|
||||
"hidden xl:flex absolute inset-y-0 left-16 z-30": true,
|
||||
"opacity-100 translate-x-0 pointer-events-auto": state.peeked && !layout.sidebar.opened(),
|
||||
"opacity-0 -translate-x-2 pointer-events-none": !state.peeked || layout.sidebar.opened(),
|
||||
"opacity-100 translate-x-0 pointer-events-auto": peeked() && !layout.sidebar.opened(),
|
||||
"opacity-0 -translate-x-2 pointer-events-none": !peeked() || layout.sidebar.opened(),
|
||||
"transition-[opacity,transform] motion-reduce:transition-none": true,
|
||||
"duration-180 ease-out": state.peeked && !layout.sidebar.opened(),
|
||||
"duration-120 ease-in": !state.peeked || layout.sidebar.opened(),
|
||||
"duration-180 ease-out": peeked() && !layout.sidebar.opened(),
|
||||
"duration-120 ease-in": !peeked() || layout.sidebar.opened(),
|
||||
}}
|
||||
onMouseMove={disarm}
|
||||
onMouseEnter={() => {
|
||||
@@ -2358,19 +2332,19 @@ export default function Layout(props: ParentProps) {
|
||||
arm()
|
||||
}}
|
||||
>
|
||||
<Show when={state.peek}>
|
||||
<SidebarPanel project={state.peek} merged={false} />
|
||||
<Show when={peek()}>
|
||||
<SidebarPanel project={peek()} merged={false} />
|
||||
</Show>
|
||||
</div>
|
||||
|
||||
<div
|
||||
classList={{
|
||||
"hidden xl:block pointer-events-none absolute inset-y-0 right-0 z-25 overflow-hidden": true,
|
||||
"opacity-100 translate-x-0": state.peeked && !layout.sidebar.opened(),
|
||||
"opacity-0 -translate-x-2": !state.peeked || layout.sidebar.opened(),
|
||||
"opacity-100 translate-x-0": peeked() && !layout.sidebar.opened(),
|
||||
"opacity-0 -translate-x-2": !peeked() || layout.sidebar.opened(),
|
||||
"transition-[opacity,transform] motion-reduce:transition-none": true,
|
||||
"duration-180 ease-out": state.peeked && !layout.sidebar.opened(),
|
||||
"duration-120 ease-in": !state.peeked || layout.sidebar.opened(),
|
||||
"duration-180 ease-out": peeked() && !layout.sidebar.opened(),
|
||||
"duration-120 ease-in": !peeked() || layout.sidebar.opened(),
|
||||
}}
|
||||
style={{ left: `calc(4rem + ${Math.max(Math.max(layout.sidebar.width(), 244) - 64, 0)}px)` }}
|
||||
>
|
||||
|
||||
@@ -9,8 +9,7 @@ import { Tooltip } from "@opencode-ai/ui/tooltip"
|
||||
import { base64Encode } from "@opencode-ai/util/encode"
|
||||
import { getFilename } from "@opencode-ai/util/path"
|
||||
import { A, useNavigate, useParams } from "@solidjs/router"
|
||||
import { type Accessor, createEffect, createMemo, For, type JSX, on, onCleanup, Show } from "solid-js"
|
||||
import { createStore } from "solid-js/store"
|
||||
import { type Accessor, createMemo, For, type JSX, Match, onCleanup, Show, Switch } from "solid-js"
|
||||
import { useGlobalSync } from "@/context/global-sync"
|
||||
import { useLanguage } from "@/context/language"
|
||||
import { getAvatarColors, type LocalProject, useLayout } from "@/context/layout"
|
||||
@@ -102,94 +101,46 @@ const SessionRow = (props: {
|
||||
warmPress: () => void
|
||||
warmFocus: () => void
|
||||
cancelHoverPrefetch: () => void
|
||||
}): JSX.Element => {
|
||||
const [slot, setSlot] = createStore({
|
||||
open: false,
|
||||
show: false,
|
||||
fade: false,
|
||||
})
|
||||
|
||||
let f: number | undefined
|
||||
const clear = () => {
|
||||
if (f !== undefined) window.clearTimeout(f)
|
||||
f = undefined
|
||||
}
|
||||
|
||||
onCleanup(clear)
|
||||
createEffect(
|
||||
on(
|
||||
() => props.isWorking(),
|
||||
(on, prev) => {
|
||||
clear()
|
||||
if (on) {
|
||||
setSlot({ open: true, show: true, fade: false })
|
||||
return
|
||||
}
|
||||
if (prev) {
|
||||
setSlot({ open: false, show: true, fade: true })
|
||||
f = window.setTimeout(() => setSlot({ show: false, fade: false }), 260)
|
||||
return
|
||||
}
|
||||
setSlot({ open: false, show: false, fade: false })
|
||||
},
|
||||
{ defer: true },
|
||||
),
|
||||
)
|
||||
|
||||
return (
|
||||
<A
|
||||
href={`/${props.slug}/session/${props.session.id}`}
|
||||
class={`relative flex items-center min-w-0 text-left w-full focus:outline-none transition-[padding] ${props.mobile ? "pr-7" : ""} group-hover/session:pr-7 group-focus-within/session:pr-7 group-active/session:pr-7 ${props.dense ? "py-0.5" : "py-1"}`}
|
||||
onPointerDown={props.warmPress}
|
||||
onPointerEnter={props.warmHover}
|
||||
onPointerLeave={props.cancelHoverPrefetch}
|
||||
onFocus={props.warmFocus}
|
||||
onClick={() => {
|
||||
props.setHoverSession(undefined)
|
||||
if (props.sidebarOpened()) return
|
||||
props.clearHoverProjectSoon()
|
||||
}}
|
||||
>
|
||||
<Show when={!props.isWorking() && (props.hasPermissions() || props.hasError() || props.unseenCount() > 0)}>
|
||||
<div
|
||||
classList={{
|
||||
"absolute left-0 top-1/2 -translate-y-1/2 size-1.5 rounded-full": true,
|
||||
"bg-surface-warning-strong": props.hasPermissions(),
|
||||
"bg-text-diff-delete-base": !props.hasPermissions() && props.hasError(),
|
||||
"bg-text-interactive-base": !props.hasPermissions() && !props.hasError() && props.unseenCount() > 0,
|
||||
}}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
</Show>
|
||||
|
||||
<div class="flex items-center min-w-0 grow-1">
|
||||
<div
|
||||
class="shrink-0 flex items-center justify-center overflow-hidden transition-[width,margin] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)]"
|
||||
style={{
|
||||
width: slot.open ? "16px" : "0px",
|
||||
"margin-right": slot.open ? "8px" : "0px",
|
||||
}}
|
||||
aria-hidden="true"
|
||||
>
|
||||
<Show when={slot.show}>
|
||||
<div
|
||||
class="transition-opacity duration-200 ease-out"
|
||||
classList={{
|
||||
"opacity-0": slot.fade,
|
||||
}}
|
||||
>
|
||||
<Spinner class="size-4" style={{ color: props.tint() ?? "var(--icon-interactive-base)" }} />
|
||||
</div>
|
||||
</Show>
|
||||
</div>
|
||||
|
||||
<span class="text-14-regular text-text-strong grow-1 min-w-0 overflow-hidden text-ellipsis truncate">
|
||||
{props.session.title}
|
||||
</span>
|
||||
}): JSX.Element => (
|
||||
<A
|
||||
href={`/${props.slug}/session/${props.session.id}`}
|
||||
class={`flex items-center justify-between gap-3 min-w-0 text-left w-full focus:outline-none transition-[padding] ${props.mobile ? "pr-7" : ""} group-hover/session:pr-7 group-focus-within/session:pr-7 group-active/session:pr-7 ${props.dense ? "py-0.5" : "py-1"}`}
|
||||
onPointerDown={props.warmPress}
|
||||
onPointerEnter={props.warmHover}
|
||||
onPointerLeave={props.cancelHoverPrefetch}
|
||||
onFocus={props.warmFocus}
|
||||
onClick={() => {
|
||||
props.setHoverSession(undefined)
|
||||
if (props.sidebarOpened()) return
|
||||
props.clearHoverProjectSoon()
|
||||
}}
|
||||
>
|
||||
<div class="flex items-center gap-1 w-full">
|
||||
<div
|
||||
class="shrink-0 size-6 flex items-center justify-center"
|
||||
style={{ color: props.tint() ?? "var(--icon-interactive-base)" }}
|
||||
>
|
||||
<Switch fallback={<Icon name="dash" size="small" class="text-icon-weak" />}>
|
||||
<Match when={props.isWorking()}>
|
||||
<Spinner class="size-[15px]" />
|
||||
</Match>
|
||||
<Match when={props.hasPermissions()}>
|
||||
<div class="size-1.5 rounded-full bg-surface-warning-strong" />
|
||||
</Match>
|
||||
<Match when={props.hasError()}>
|
||||
<div class="size-1.5 rounded-full bg-text-diff-delete-base" />
|
||||
</Match>
|
||||
<Match when={props.unseenCount() > 0}>
|
||||
<div class="size-1.5 rounded-full bg-text-interactive-base" />
|
||||
</Match>
|
||||
</Switch>
|
||||
</div>
|
||||
</A>
|
||||
)
|
||||
}
|
||||
<span class="text-14-regular text-text-strong grow-1 min-w-0 overflow-hidden text-ellipsis truncate">
|
||||
{props.session.title}
|
||||
</span>
|
||||
</div>
|
||||
</A>
|
||||
)
|
||||
|
||||
const SessionHoverPreview = (props: {
|
||||
mobile?: boolean
|
||||
@@ -253,18 +204,8 @@ export const SessionItem = (props: SessionItemProps): JSX.Element => {
|
||||
})
|
||||
const isWorking = createMemo(() => {
|
||||
if (hasPermissions()) return false
|
||||
const pending = (sessionStore.message[props.session.id] ?? []).findLast(
|
||||
(message) =>
|
||||
message.role === "assistant" &&
|
||||
typeof (message as { time?: { completed?: unknown } }).time?.completed !== "number",
|
||||
)
|
||||
const status = sessionStore.session_status[props.session.id]
|
||||
return (
|
||||
pending !== undefined ||
|
||||
status?.type === "busy" ||
|
||||
status?.type === "retry" ||
|
||||
(status !== undefined && status.type !== "idle")
|
||||
)
|
||||
return status?.type === "busy" || status?.type === "retry"
|
||||
})
|
||||
|
||||
const tint = createMemo(() => {
|
||||
@@ -359,7 +300,7 @@ export const SessionItem = (props: SessionItemProps): JSX.Element => {
|
||||
return (
|
||||
<div
|
||||
data-session-id={props.session.id}
|
||||
class="group/session relative w-full rounded-md cursor-default pl-3 pr-3 transition-colors
|
||||
class="group/session relative w-full rounded-md cursor-default transition-colors pl-2 pr-3
|
||||
hover:bg-surface-raised-base-hover [&:has(:focus-visible)]:bg-surface-raised-base-hover has-[[data-expanded]]:bg-surface-raised-base-hover has-[.active]:bg-surface-base-active"
|
||||
>
|
||||
<Show
|
||||
|
||||
@@ -249,7 +249,7 @@ const WorkspaceSessionList = (props: {
|
||||
loadMore: () => Promise<void>
|
||||
language: ReturnType<typeof useLanguage>
|
||||
}): JSX.Element => (
|
||||
<nav class="flex flex-col gap-1">
|
||||
<nav class="flex flex-col gap-1 px-3">
|
||||
<Show when={props.showNew()}>
|
||||
<NewSessionItem
|
||||
slug={props.slug()}
|
||||
@@ -382,7 +382,7 @@ export const SortableWorkspace = (props: {
|
||||
}}
|
||||
>
|
||||
<Collapsible variant="ghost" open={open()} class="shrink-0" onOpenChange={openWrapper}>
|
||||
<div class="py-1">
|
||||
<div class="px-2 py-1">
|
||||
<div
|
||||
class="group/workspace relative"
|
||||
data-component="workspace-item"
|
||||
|
||||
@@ -956,15 +956,13 @@ export default function Page() {
|
||||
return (
|
||||
<div class={input.emptyClass}>
|
||||
<div class="flex flex-col gap-3">
|
||||
<div class="text-14-medium text-text-strong">{language.t("session.review.noVcs.createGit.title")}</div>
|
||||
<div class="text-14-medium text-text-strong">Create a Git repository</div>
|
||||
<div class="text-14-regular text-text-base max-w-md" style={{ "line-height": "var(--line-height-normal)" }}>
|
||||
{language.t("session.review.noVcs.createGit.description")}
|
||||
Track, review, and undo changes in this project
|
||||
</div>
|
||||
</div>
|
||||
<Button size="large" disabled={ui.git} onClick={initGit}>
|
||||
{ui.git
|
||||
? language.t("session.review.noVcs.createGit.actionLoading")
|
||||
: language.t("session.review.noVcs.createGit.action")}
|
||||
{ui.git ? "Creating Git repository..." : "Create Git repository"}
|
||||
</Button>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -44,9 +44,9 @@ export function SessionComposerRegion(props: {
|
||||
}) {
|
||||
const prompt = usePrompt()
|
||||
const language = useLanguage()
|
||||
const route = useSessionKey()
|
||||
const { sessionKey } = useSessionKey()
|
||||
|
||||
const handoffPrompt = createMemo(() => getSessionHandoff(route.sessionKey())?.prompt)
|
||||
const handoffPrompt = createMemo(() => getSessionHandoff(sessionKey())?.prompt)
|
||||
|
||||
const previewPrompt = () =>
|
||||
prompt
|
||||
@@ -62,7 +62,7 @@ export function SessionComposerRegion(props: {
|
||||
|
||||
createEffect(() => {
|
||||
if (!prompt.ready()) return
|
||||
setSessionHandoff(route.sessionKey(), { prompt: previewPrompt() })
|
||||
setSessionHandoff(sessionKey(), { prompt: previewPrompt() })
|
||||
})
|
||||
|
||||
const [store, setStore] = createStore({
|
||||
@@ -85,7 +85,7 @@ export function SessionComposerRegion(props: {
|
||||
}
|
||||
|
||||
createEffect(() => {
|
||||
route.sessionKey()
|
||||
sessionKey()
|
||||
const ready = props.ready
|
||||
const delay = 140
|
||||
|
||||
@@ -194,8 +194,8 @@ export function SessionComposerRegion(props: {
|
||||
>
|
||||
<div ref={(el) => setStore("body", el)}>
|
||||
<SessionTodoDock
|
||||
sessionID={route.params.id}
|
||||
todos={props.state.todos()}
|
||||
title={language.t("session.todo.title")}
|
||||
collapseLabel={language.t("session.todo.collapse")}
|
||||
expandLabel={language.t("session.todo.expand")}
|
||||
dockProgress={value()}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createEffect, createMemo, on, onCleanup, onMount } from "solid-js"
|
||||
import { createEffect, createMemo, on, onCleanup } from "solid-js"
|
||||
import { createStore } from "solid-js/store"
|
||||
import type { PermissionRequest, QuestionRequest, Todo } from "@opencode-ai/sdk/v2"
|
||||
import { useParams } from "@solidjs/router"
|
||||
@@ -8,7 +8,6 @@ import { useLanguage } from "@/context/language"
|
||||
import { usePermission } from "@/context/permission"
|
||||
import { useSDK } from "@/context/sdk"
|
||||
import { useSync } from "@/context/sync"
|
||||
import { composerDriver, composerEnabled, composerEvent } from "@/testing/session-composer"
|
||||
import { sessionPermissionRequest, sessionQuestionRequest } from "./session-request-tree"
|
||||
|
||||
export const todoState = (input: {
|
||||
@@ -48,50 +47,7 @@ export function createSessionComposerState(options?: { closeMs?: number | (() =>
|
||||
return !!permissionRequest() || !!questionRequest()
|
||||
})
|
||||
|
||||
const [test, setTest] = createStore({
|
||||
on: false,
|
||||
live: undefined as boolean | undefined,
|
||||
todos: undefined as Todo[] | undefined,
|
||||
})
|
||||
|
||||
const pull = () => {
|
||||
const id = params.id
|
||||
if (!id) {
|
||||
setTest({ on: false, live: undefined, todos: undefined })
|
||||
return
|
||||
}
|
||||
|
||||
const next = composerDriver(id)
|
||||
if (!next) {
|
||||
setTest({ on: false, live: undefined, todos: undefined })
|
||||
return
|
||||
}
|
||||
|
||||
setTest({
|
||||
on: true,
|
||||
live: next.live,
|
||||
todos: next.todos?.map((todo) => ({ ...todo })),
|
||||
})
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
if (!composerEnabled()) return
|
||||
|
||||
pull()
|
||||
createEffect(on(() => params.id, pull, { defer: true }))
|
||||
|
||||
const onEvent = (event: Event) => {
|
||||
const detail = (event as CustomEvent<{ sessionID?: string }>).detail
|
||||
if (detail?.sessionID !== params.id) return
|
||||
pull()
|
||||
}
|
||||
|
||||
window.addEventListener(composerEvent, onEvent)
|
||||
onCleanup(() => window.removeEventListener(composerEvent, onEvent))
|
||||
})
|
||||
|
||||
const todos = createMemo((): Todo[] => {
|
||||
if (test.on && test.todos !== undefined) return test.todos
|
||||
const id = params.id
|
||||
if (!id) return []
|
||||
return globalSync.data.session_todo[id] ?? []
|
||||
@@ -108,10 +64,7 @@ export function createSessionComposerState(options?: { closeMs?: number | (() =>
|
||||
})
|
||||
|
||||
const busy = createMemo(() => status().type !== "idle")
|
||||
const live = createMemo(() => {
|
||||
if (test.on && test.live !== undefined) return test.live
|
||||
return busy() || blocked()
|
||||
})
|
||||
const live = createMemo(() => busy() || blocked())
|
||||
|
||||
const [store, setStore] = createStore({
|
||||
responding: undefined as string | undefined,
|
||||
@@ -163,10 +116,6 @@ export function createSessionComposerState(options?: { closeMs?: number | (() =>
|
||||
|
||||
// Keep stale turn todos from reopening if the model never clears them.
|
||||
const clear = () => {
|
||||
if (test.on && test.todos !== undefined) {
|
||||
setTest("todos", [])
|
||||
return
|
||||
}
|
||||
const id = params.id
|
||||
if (!id) return
|
||||
globalSync.todo.set(id, [])
|
||||
|
||||
@@ -38,7 +38,7 @@ export const SessionQuestionDock: Component<{ request: QuestionRequest; onSubmit
|
||||
|
||||
const summary = createMemo(() => {
|
||||
const n = Math.min(store.tab + 1, total())
|
||||
return language.t("session.question.progress", { current: n, total: total() })
|
||||
return `${n} of ${total()} questions`
|
||||
})
|
||||
|
||||
const last = createMemo(() => store.tab >= total() - 1)
|
||||
|
||||
@@ -8,11 +8,6 @@ import { TextReveal } from "@opencode-ai/ui/text-reveal"
|
||||
import { TextStrikethrough } from "@opencode-ai/ui/text-strikethrough"
|
||||
import { Index, createEffect, createMemo, on, onCleanup } from "solid-js"
|
||||
import { createStore } from "solid-js/store"
|
||||
import { composerEnabled, composerProbe } from "@/testing/session-composer"
|
||||
import { useLanguage } from "@/context/language"
|
||||
|
||||
const doneToken = "\u0000done\u0000"
|
||||
const totalToken = "\u0000total\u0000"
|
||||
|
||||
function dot(status: Todo["status"]) {
|
||||
if (status !== "in_progress") return undefined
|
||||
@@ -40,13 +35,12 @@ function dot(status: Todo["status"]) {
|
||||
}
|
||||
|
||||
export function SessionTodoDock(props: {
|
||||
sessionID?: string
|
||||
todos: Todo[]
|
||||
title: string
|
||||
collapseLabel: string
|
||||
expandLabel: string
|
||||
dockProgress: number
|
||||
}) {
|
||||
const language = useLanguage()
|
||||
const [store, setStore] = createStore({
|
||||
collapsed: false,
|
||||
height: 320,
|
||||
@@ -56,12 +50,7 @@ export function SessionTodoDock(props: {
|
||||
|
||||
const total = createMemo(() => props.todos.length)
|
||||
const done = createMemo(() => props.todos.filter((todo) => todo.status === "completed").length)
|
||||
const label = createMemo(() => language.t("session.todo.progress", { done: done(), total: total() }))
|
||||
const progress = createMemo(() =>
|
||||
language
|
||||
.t("session.todo.progress", { done: doneToken, total: totalToken })
|
||||
.split(/(\u0000done\u0000|\u0000total\u0000)/),
|
||||
)
|
||||
const label = createMemo(() => `${done()} of ${total()} ${props.title.toLowerCase()} completed`)
|
||||
|
||||
const active = createMemo(
|
||||
() =>
|
||||
@@ -80,8 +69,6 @@ export function SessionTodoDock(props: {
|
||||
const off = createMemo(() => hide() > 0.98)
|
||||
const turn = createMemo(() => Math.max(0, Math.min(1, value())))
|
||||
const full = createMemo(() => Math.max(78, store.height))
|
||||
const e2e = composerEnabled()
|
||||
const probe = composerProbe(props.sessionID)
|
||||
let contentRef: HTMLDivElement | undefined
|
||||
|
||||
createEffect(() => {
|
||||
@@ -96,23 +83,6 @@ export function SessionTodoDock(props: {
|
||||
onCleanup(() => observer.disconnect())
|
||||
})
|
||||
|
||||
createEffect(() => {
|
||||
if (!e2e) return
|
||||
|
||||
probe.set({
|
||||
mounted: true,
|
||||
collapsed: store.collapsed,
|
||||
hidden: store.collapsed || off(),
|
||||
count: props.todos.length,
|
||||
states: props.todos.map((todo) => todo.status),
|
||||
})
|
||||
})
|
||||
|
||||
onCleanup(() => {
|
||||
if (!e2e) return
|
||||
probe.drop()
|
||||
})
|
||||
|
||||
return (
|
||||
<DockTray
|
||||
data-component="session-todo-dock"
|
||||
@@ -136,28 +106,20 @@ export function SessionTodoDock(props: {
|
||||
}}
|
||||
>
|
||||
<span
|
||||
class="text-14-regular text-text-strong cursor-default inline-flex items-baseline shrink-0 overflow-visible"
|
||||
class="text-14-regular text-text-strong cursor-default inline-flex items-baseline shrink-0 whitespace-nowrap overflow-visible"
|
||||
aria-label={label()}
|
||||
style={{
|
||||
"--tool-motion-odometer-ms": "600ms",
|
||||
"--tool-motion-mask": "18%",
|
||||
"--tool-motion-mask-height": "0px",
|
||||
"--tool-motion-spring-ms": "560ms",
|
||||
"white-space": "pre",
|
||||
opacity: `${Math.max(0, Math.min(1, 1 - shut()))}`,
|
||||
}}
|
||||
>
|
||||
<Index each={progress()}>
|
||||
{(item) =>
|
||||
item() === doneToken ? (
|
||||
<AnimatedNumber value={done()} />
|
||||
) : item() === totalToken ? (
|
||||
<AnimatedNumber value={total()} />
|
||||
) : (
|
||||
<span>{item()}</span>
|
||||
)
|
||||
}
|
||||
</Index>
|
||||
<AnimatedNumber value={done()} />
|
||||
<span class="mx-1">of</span>
|
||||
<AnimatedNumber value={total()} />
|
||||
<span> {props.title.toLowerCase()} completed</span>
|
||||
</span>
|
||||
<div
|
||||
data-slot="session-todo-preview"
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { isDefaultTitle as isDefaultTerminalTitle } from "@/context/terminal-title"
|
||||
|
||||
export const terminalTabLabel = (input: {
|
||||
title?: string
|
||||
titleNumber?: number
|
||||
@@ -7,7 +5,9 @@ export const terminalTabLabel = (input: {
|
||||
}) => {
|
||||
const title = input.title ?? ""
|
||||
const number = input.titleNumber ?? 0
|
||||
const isDefaultTitle = Number.isFinite(number) && number > 0 && isDefaultTerminalTitle(title, number)
|
||||
const match = title.match(/^Terminal (\d+)$/)
|
||||
const parsed = match ? Number(match[1]) : undefined
|
||||
const isDefaultTitle = Number.isFinite(number) && number > 0 && Number.isFinite(parsed) && parsed === number
|
||||
|
||||
if (title && !isDefaultTitle) return title
|
||||
if (number > 0) return input.t("terminal.title.numbered", { number })
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
import type { Todo } from "@opencode-ai/sdk/v2"
|
||||
|
||||
export const composerEvent = "opencode:e2e:composer"
|
||||
|
||||
export type ComposerDriverState = {
|
||||
live?: boolean
|
||||
todos?: Array<Pick<Todo, "content" | "status" | "priority">>
|
||||
}
|
||||
|
||||
export type ComposerProbeState = {
|
||||
mounted: boolean
|
||||
collapsed: boolean
|
||||
hidden: boolean
|
||||
count: number
|
||||
states: Todo["status"][]
|
||||
}
|
||||
|
||||
type ComposerState = {
|
||||
driver?: ComposerDriverState
|
||||
probe?: ComposerProbeState
|
||||
}
|
||||
|
||||
export type ComposerWindow = Window & {
|
||||
__opencode_e2e?: {
|
||||
composer?: {
|
||||
enabled?: boolean
|
||||
sessions?: Record<string, ComposerState>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const clone = (driver: ComposerDriverState) => ({
|
||||
live: driver.live,
|
||||
todos: driver.todos?.map((todo) => ({ ...todo })),
|
||||
})
|
||||
|
||||
export const composerEnabled = () => {
|
||||
if (typeof window === "undefined") return false
|
||||
return (window as ComposerWindow).__opencode_e2e?.composer?.enabled === true
|
||||
}
|
||||
|
||||
const root = () => {
|
||||
if (!composerEnabled()) return
|
||||
const state = (window as ComposerWindow).__opencode_e2e?.composer
|
||||
if (!state) return
|
||||
state.sessions ??= {}
|
||||
return state.sessions
|
||||
}
|
||||
|
||||
export const composerDriver = (sessionID?: string) => {
|
||||
if (!sessionID) return
|
||||
const state = root()?.[sessionID]?.driver
|
||||
if (!state) return
|
||||
return clone(state)
|
||||
}
|
||||
|
||||
export const composerProbe = (sessionID?: string) => {
|
||||
const set = (next: ComposerProbeState) => {
|
||||
if (!sessionID) return
|
||||
const sessions = root()
|
||||
if (!sessions) return
|
||||
const prev = sessions[sessionID] ?? {}
|
||||
sessions[sessionID] = {
|
||||
...prev,
|
||||
probe: {
|
||||
...next,
|
||||
states: [...next.states],
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
set,
|
||||
drop() {
|
||||
set({
|
||||
mounted: false,
|
||||
collapsed: false,
|
||||
hidden: true,
|
||||
count: 0,
|
||||
states: [],
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -2,28 +2,21 @@ export const terminalAttr = "data-pty-id"
|
||||
|
||||
export type TerminalProbeState = {
|
||||
connected: boolean
|
||||
connects: number
|
||||
rendered: string
|
||||
settled: number
|
||||
}
|
||||
|
||||
type TerminalProbeControl = {
|
||||
disconnect?: VoidFunction
|
||||
}
|
||||
|
||||
export type E2EWindow = Window & {
|
||||
__opencode_e2e?: {
|
||||
terminal?: {
|
||||
enabled?: boolean
|
||||
terminals?: Record<string, TerminalProbeState>
|
||||
controls?: Record<string, TerminalProbeControl>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const seed = (): TerminalProbeState => ({
|
||||
connected: false,
|
||||
connects: 0,
|
||||
rendered: "",
|
||||
settled: 0,
|
||||
})
|
||||
@@ -32,28 +25,15 @@ const root = () => {
|
||||
if (typeof window === "undefined") return
|
||||
const state = (window as E2EWindow).__opencode_e2e?.terminal
|
||||
if (!state?.enabled) return
|
||||
return state
|
||||
}
|
||||
|
||||
const terms = () => {
|
||||
const state = root()
|
||||
if (!state) return
|
||||
state.terminals ??= {}
|
||||
return state.terminals
|
||||
}
|
||||
|
||||
const controls = () => {
|
||||
const state = root()
|
||||
if (!state) return
|
||||
state.controls ??= {}
|
||||
return state.controls
|
||||
}
|
||||
|
||||
export const terminalProbe = (id: string) => {
|
||||
const set = (next: Partial<TerminalProbeState>) => {
|
||||
const state = terms()
|
||||
if (!state) return
|
||||
state[id] = { ...(state[id] ?? seed()), ...next }
|
||||
const terms = root()
|
||||
if (!terms) return
|
||||
terms[id] = { ...(terms[id] ?? seed()), ...next }
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -61,37 +41,24 @@ export const terminalProbe = (id: string) => {
|
||||
set(seed())
|
||||
},
|
||||
connect() {
|
||||
const state = terms()
|
||||
if (!state) return
|
||||
const prev = state[id] ?? seed()
|
||||
state[id] = {
|
||||
...prev,
|
||||
connected: true,
|
||||
connects: prev.connects + 1,
|
||||
}
|
||||
set({ connected: true })
|
||||
},
|
||||
render(data: string) {
|
||||
const state = terms()
|
||||
if (!state) return
|
||||
const prev = state[id] ?? seed()
|
||||
state[id] = { ...prev, rendered: prev.rendered + data }
|
||||
const terms = root()
|
||||
if (!terms) return
|
||||
const prev = terms[id] ?? seed()
|
||||
terms[id] = { ...prev, rendered: prev.rendered + data }
|
||||
},
|
||||
settle() {
|
||||
const state = terms()
|
||||
if (!state) return
|
||||
const prev = state[id] ?? seed()
|
||||
state[id] = { ...prev, settled: prev.settled + 1 }
|
||||
},
|
||||
control(next: Partial<TerminalProbeControl>) {
|
||||
const state = controls()
|
||||
if (!state) return
|
||||
state[id] = { ...(state[id] ?? {}), ...next }
|
||||
const terms = root()
|
||||
if (!terms) return
|
||||
const prev = terms[id] ?? seed()
|
||||
terms[id] = { ...prev, settled: prev.settled + 1 }
|
||||
},
|
||||
drop() {
|
||||
const state = terms()
|
||||
if (state) delete state[id]
|
||||
const control = controls()
|
||||
if (control) delete control[id]
|
||||
const terms = root()
|
||||
if (!terms) return
|
||||
delete terms[id]
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,14 +76,6 @@ export function IconAlipay(props: JSX.SvgSVGAttributes<SVGSVGElement>) {
|
||||
)
|
||||
}
|
||||
|
||||
export function IconWechat(props: JSX.SvgSVGAttributes<SVGSVGElement>) {
|
||||
return (
|
||||
<svg {...props} viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9.27099 14.6689C8.9532 14.8312 8.56403 14.7122 8.39132 14.4L8.3477 14.3054L6.53019 10.3069C6.52269 10.2588 6.52269 10.2097 6.53019 10.1615C6.53017 10.0735 6.56564 9.98916 6.62857 9.9276C6.6915 9.86603 6.7766 9.83243 6.86462 9.83438C6.93567 9.83269 7.00508 9.85582 7.06091 9.89981L9.24191 11.4265C9.40329 11.5346 9.59293 11.5928 9.78716 11.5937C9.90424 11.5945 10.0203 11.5723 10.1289 11.5283L20.176 7.02816C18.091 4.72544 15.1103 3.43931 12.0045 3.5022C6.4793 3.5022 2.00098 7.23172 2.00098 11.87C2.06681 14.4052 3.35646 16.7515 5.4615 18.1658C5.6878 18.3326 5.78402 18.6241 5.70141 18.8928L5.25067 20.594C5.22336 20.6714 5.20625 20.7521 5.19978 20.8339C5.19777 20.9232 5.23236 21.0094 5.29552 21.0726C5.35868 21.1358 5.44491 21.1703 5.5342 21.1684C5.60098 21.1645 5.66583 21.1445 5.72322 21.1102L7.90423 19.8452C8.06383 19.7467 8.2474 19.6939 8.43494 19.6925C8.53352 19.6923 8.63157 19.707 8.72574 19.7361C9.78781 20.0363 10.8863 20.188 11.99 20.1869C17.5152 20.1869 22.001 16.4574 22.001 11.8554C22.0108 10.4834 21.6301 9.13687 20.903 7.97326L9.35096 14.6253L9.27099 14.6689Z" />
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
||||
export function IconChevron(props: JSX.SvgSVGAttributes<SVGSVGElement>) {
|
||||
return (
|
||||
<svg {...props} width="8" height="6" viewBox="0 0 8 6" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
|
||||
@@ -541,7 +541,6 @@ export const dict = {
|
||||
"workspace.billing.addAction": "إضافة",
|
||||
"workspace.billing.addBalance": "إضافة رصيد",
|
||||
"workspace.billing.alipay": "Alipay",
|
||||
"workspace.billing.wechat": "WeChat Pay",
|
||||
"workspace.billing.linkedToStripe": "مرتبط بـ Stripe",
|
||||
"workspace.billing.manage": "إدارة",
|
||||
"workspace.billing.enable": "تمكين الفوترة",
|
||||
|
||||
@@ -550,7 +550,6 @@ export const dict = {
|
||||
"workspace.billing.addAction": "Adicionar",
|
||||
"workspace.billing.addBalance": "Adicionar Saldo",
|
||||
"workspace.billing.alipay": "Alipay",
|
||||
"workspace.billing.wechat": "WeChat Pay",
|
||||
"workspace.billing.linkedToStripe": "Vinculado ao Stripe",
|
||||
"workspace.billing.manage": "Gerenciar",
|
||||
"workspace.billing.enable": "Ativar Faturamento",
|
||||
|
||||
@@ -546,7 +546,6 @@ export const dict = {
|
||||
"workspace.billing.addAction": "Tilføj",
|
||||
"workspace.billing.addBalance": "Tilføj saldo",
|
||||
"workspace.billing.alipay": "Alipay",
|
||||
"workspace.billing.wechat": "WeChat Pay",
|
||||
"workspace.billing.linkedToStripe": "Forbundet til Stripe",
|
||||
"workspace.billing.manage": "Administrer",
|
||||
"workspace.billing.enable": "Aktiver fakturering",
|
||||
|
||||
@@ -549,7 +549,6 @@ export const dict = {
|
||||
"workspace.billing.addAction": "Hinzufügen",
|
||||
"workspace.billing.addBalance": "Guthaben aufladen",
|
||||
"workspace.billing.alipay": "Alipay",
|
||||
"workspace.billing.wechat": "WeChat Pay",
|
||||
"workspace.billing.linkedToStripe": "Mit Stripe verbunden",
|
||||
"workspace.billing.manage": "Verwalten",
|
||||
"workspace.billing.enable": "Abrechnung aktivieren",
|
||||
|
||||
@@ -541,7 +541,6 @@ export const dict = {
|
||||
"workspace.billing.addAction": "Add",
|
||||
"workspace.billing.addBalance": "Add Balance",
|
||||
"workspace.billing.alipay": "Alipay",
|
||||
"workspace.billing.wechat": "WeChat Pay",
|
||||
"workspace.billing.linkedToStripe": "Linked to Stripe",
|
||||
"workspace.billing.manage": "Manage",
|
||||
"workspace.billing.enable": "Enable Billing",
|
||||
|
||||
@@ -550,7 +550,6 @@ export const dict = {
|
||||
"workspace.billing.addAction": "Añadir",
|
||||
"workspace.billing.addBalance": "Añadir Saldo",
|
||||
"workspace.billing.alipay": "Alipay",
|
||||
"workspace.billing.wechat": "WeChat Pay",
|
||||
"workspace.billing.linkedToStripe": "Vinculado con Stripe",
|
||||
"workspace.billing.manage": "Gestionar",
|
||||
"workspace.billing.enable": "Habilitar Facturación",
|
||||
|
||||
@@ -552,7 +552,6 @@ export const dict = {
|
||||
"workspace.billing.addAction": "Ajouter",
|
||||
"workspace.billing.addBalance": "Ajouter un solde",
|
||||
"workspace.billing.alipay": "Alipay",
|
||||
"workspace.billing.wechat": "WeChat Pay",
|
||||
"workspace.billing.linkedToStripe": "Lié à Stripe",
|
||||
"workspace.billing.manage": "Gérer",
|
||||
"workspace.billing.enable": "Activer la facturation",
|
||||
|
||||
@@ -548,7 +548,6 @@ export const dict = {
|
||||
"workspace.billing.addAction": "Aggiungi",
|
||||
"workspace.billing.addBalance": "Aggiungi Saldo",
|
||||
"workspace.billing.alipay": "Alipay",
|
||||
"workspace.billing.wechat": "WeChat Pay",
|
||||
"workspace.billing.linkedToStripe": "Collegato a Stripe",
|
||||
"workspace.billing.manage": "Gestisci",
|
||||
"workspace.billing.enable": "Abilita Fatturazione",
|
||||
|
||||
@@ -547,7 +547,6 @@ export const dict = {
|
||||
"workspace.billing.addAction": "追加",
|
||||
"workspace.billing.addBalance": "残高を追加",
|
||||
"workspace.billing.alipay": "Alipay",
|
||||
"workspace.billing.wechat": "WeChat Pay",
|
||||
"workspace.billing.linkedToStripe": "Stripeと連携済み",
|
||||
"workspace.billing.manage": "管理",
|
||||
"workspace.billing.enable": "課金を有効にする",
|
||||
|
||||
@@ -541,7 +541,6 @@ export const dict = {
|
||||
"workspace.billing.addAction": "추가",
|
||||
"workspace.billing.addBalance": "잔액 추가",
|
||||
"workspace.billing.alipay": "Alipay",
|
||||
"workspace.billing.wechat": "WeChat Pay",
|
||||
"workspace.billing.linkedToStripe": "Stripe에 연결됨",
|
||||
"workspace.billing.manage": "관리",
|
||||
"workspace.billing.enable": "결제 활성화",
|
||||
|
||||
@@ -547,7 +547,6 @@ export const dict = {
|
||||
"workspace.billing.addAction": "Legg til",
|
||||
"workspace.billing.addBalance": "Legg til saldo",
|
||||
"workspace.billing.alipay": "Alipay",
|
||||
"workspace.billing.wechat": "WeChat Pay",
|
||||
"workspace.billing.linkedToStripe": "Koblet til Stripe",
|
||||
"workspace.billing.manage": "Administrer",
|
||||
"workspace.billing.enable": "Aktiver fakturering",
|
||||
|
||||
@@ -548,7 +548,6 @@ export const dict = {
|
||||
"workspace.billing.addAction": "Dodaj",
|
||||
"workspace.billing.addBalance": "Doładuj saldo",
|
||||
"workspace.billing.alipay": "Alipay",
|
||||
"workspace.billing.wechat": "WeChat Pay",
|
||||
"workspace.billing.linkedToStripe": "Połączono ze Stripe",
|
||||
"workspace.billing.manage": "Zarządzaj",
|
||||
"workspace.billing.enable": "Włącz rozliczenia",
|
||||
|
||||
@@ -554,7 +554,6 @@ export const dict = {
|
||||
"workspace.billing.addAction": "Пополнить",
|
||||
"workspace.billing.addBalance": "Пополнить баланс",
|
||||
"workspace.billing.alipay": "Alipay",
|
||||
"workspace.billing.wechat": "WeChat Pay",
|
||||
"workspace.billing.linkedToStripe": "Привязано к Stripe",
|
||||
"workspace.billing.manage": "Управление",
|
||||
"workspace.billing.enable": "Включить оплату",
|
||||
|
||||
@@ -543,7 +543,6 @@ export const dict = {
|
||||
"workspace.billing.addAction": "เพิ่ม",
|
||||
"workspace.billing.addBalance": "เพิ่มยอดคงเหลือ",
|
||||
"workspace.billing.alipay": "Alipay",
|
||||
"workspace.billing.wechat": "WeChat Pay",
|
||||
"workspace.billing.linkedToStripe": "เชื่อมโยงกับ Stripe",
|
||||
"workspace.billing.manage": "จัดการ",
|
||||
"workspace.billing.enable": "เปิดใช้งานการเรียกเก็บเงิน",
|
||||
|
||||
@@ -550,7 +550,6 @@ export const dict = {
|
||||
"workspace.billing.addAction": "Ekle",
|
||||
"workspace.billing.addBalance": "Bakiye Ekle",
|
||||
"workspace.billing.alipay": "Alipay",
|
||||
"workspace.billing.wechat": "WeChat Pay",
|
||||
"workspace.billing.linkedToStripe": "Stripe'a bağlı",
|
||||
"workspace.billing.manage": "Yönet",
|
||||
"workspace.billing.enable": "Faturalandırmayı Etkinleştir",
|
||||
|
||||
@@ -524,7 +524,6 @@ export const dict = {
|
||||
"workspace.billing.addAction": "充值",
|
||||
"workspace.billing.addBalance": "充值余额",
|
||||
"workspace.billing.alipay": "支付宝",
|
||||
"workspace.billing.wechat": "微信支付",
|
||||
"workspace.billing.linkedToStripe": "已关联 Stripe",
|
||||
"workspace.billing.manage": "管理",
|
||||
"workspace.billing.enable": "启用计费",
|
||||
|
||||
@@ -524,7 +524,6 @@ export const dict = {
|
||||
"workspace.billing.addAction": "儲值",
|
||||
"workspace.billing.addBalance": "儲值餘額",
|
||||
"workspace.billing.alipay": "支付寶",
|
||||
"workspace.billing.wechat": "微信支付",
|
||||
"workspace.billing.linkedToStripe": "已連結 Stripe",
|
||||
"workspace.billing.manage": "管理",
|
||||
"workspace.billing.enable": "啟用帳務",
|
||||
|
||||
@@ -3,7 +3,7 @@ import { createMemo, Match, Show, Switch, createEffect } from "solid-js"
|
||||
import { createStore } from "solid-js/store"
|
||||
import { Billing } from "@opencode-ai/console-core/billing.js"
|
||||
import { withActor } from "~/context/auth.withActor"
|
||||
import { IconAlipay, IconCreditCard, IconStripe, IconWechat } from "~/component/icon"
|
||||
import { IconAlipay, IconCreditCard, IconStripe } from "~/component/icon"
|
||||
import styles from "./billing-section.module.css"
|
||||
import { createCheckoutUrl, formatBalance, queryBillingInfo } from "../../common"
|
||||
import { useI18n } from "~/context/i18n"
|
||||
@@ -208,9 +208,6 @@ export function BillingSection() {
|
||||
<Match when={billingInfo()?.paymentMethodType === "alipay"}>
|
||||
<IconAlipay style={{ width: "24px", height: "24px" }} />
|
||||
</Match>
|
||||
<Match when={billingInfo()?.paymentMethodType === "wechat_pay"}>
|
||||
<IconWechat style={{ width: "24px", height: "24px" }} />
|
||||
</Match>
|
||||
</Switch>
|
||||
</div>
|
||||
<div data-slot="card-details">
|
||||
@@ -227,9 +224,6 @@ export function BillingSection() {
|
||||
<Match when={billingInfo()?.paymentMethodType === "alipay"}>
|
||||
<span data-slot="type">{i18n.t("workspace.billing.alipay")}</span>
|
||||
</Match>
|
||||
<Match when={billingInfo()?.paymentMethodType === "wechat_pay"}>
|
||||
<span data-slot="type">{i18n.t("workspace.billing.wechat")}</span>
|
||||
</Match>
|
||||
</Switch>
|
||||
</div>
|
||||
<button
|
||||
|
||||
@@ -213,10 +213,12 @@ export namespace Billing {
|
||||
enabled: true,
|
||||
},
|
||||
payment_method_options: {
|
||||
alipay: {},
|
||||
card: {
|
||||
setup_future_usage: "on_session",
|
||||
},
|
||||
},
|
||||
payment_method_types: ["card", "alipay"],
|
||||
//payment_method_data: {
|
||||
// allow_redisplay: "always",
|
||||
//},
|
||||
@@ -267,6 +269,7 @@ export namespace Billing {
|
||||
customer_email: email!,
|
||||
}),
|
||||
currency: "usd",
|
||||
payment_method_types: ["card", "alipay"],
|
||||
tax_id_collection: {
|
||||
enabled: true,
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createServer } from "node:net"
|
||||
import { homedir } from "node:os"
|
||||
import { join } from "node:path"
|
||||
import type { Event } from "electron"
|
||||
import { app, BrowserWindow, dialog } from "electron"
|
||||
import { app, type BrowserWindow, dialog } from "electron"
|
||||
import pkg from "electron-updater"
|
||||
|
||||
const APP_NAMES: Record<string, string> = {
|
||||
@@ -32,7 +32,7 @@ import { initLogging } from "./logging"
|
||||
import { parseMarkdown } from "./markdown"
|
||||
import { createMenu } from "./menu"
|
||||
import { getDefaultServerUrl, getWslConfig, setDefaultServerUrl, setWslConfig, spawnLocalServer } from "./server"
|
||||
import { createLoadingWindow, createMainWindow, setBackgroundColor, setDockIcon } from "./windows"
|
||||
import { createLoadingWindow, createMainWindow, setDockIcon } from "./windows"
|
||||
|
||||
const initEmitter = new EventEmitter()
|
||||
let initStep: InitStep = { phase: "server_waiting" }
|
||||
@@ -156,9 +156,12 @@ async function initialize() {
|
||||
|
||||
const globals = {
|
||||
updaterEnabled: UPDATER_ENABLED,
|
||||
wsl: getWslConfig().enabled,
|
||||
deepLinks: pendingDeepLinks,
|
||||
}
|
||||
|
||||
wireMenu()
|
||||
|
||||
if (needsMigration) {
|
||||
const show = await Promise.race([loadingTask.then(() => false), delay(1_000).then(() => true)])
|
||||
if (show) {
|
||||
@@ -175,7 +178,6 @@ async function initialize() {
|
||||
}
|
||||
|
||||
mainWindow = createMainWindow(globals)
|
||||
wireMenu()
|
||||
|
||||
overlay?.close()
|
||||
}
|
||||
@@ -229,7 +231,6 @@ registerIpcHandlers({
|
||||
runUpdater: async (alertOnFail) => checkForUpdates(alertOnFail),
|
||||
checkUpdate: async () => checkUpdate(),
|
||||
installUpdate: async () => installUpdate(),
|
||||
setBackgroundColor: (color) => setBackgroundColor(color),
|
||||
})
|
||||
|
||||
function killSidecar() {
|
||||
|
||||
@@ -24,7 +24,6 @@ type Deps = {
|
||||
runUpdater: (alertOnFail: boolean) => Promise<void> | void
|
||||
checkUpdate: () => Promise<{ updateAvailable: boolean; version?: string }>
|
||||
installUpdate: () => Promise<void> | void
|
||||
setBackgroundColor: (color: string) => void
|
||||
}
|
||||
|
||||
export function registerIpcHandlers(deps: Deps) {
|
||||
@@ -54,7 +53,6 @@ export function registerIpcHandlers(deps: Deps) {
|
||||
ipcMain.handle("run-updater", (_event: IpcMainInvokeEvent, alertOnFail: boolean) => deps.runUpdater(alertOnFail))
|
||||
ipcMain.handle("check-update", () => deps.checkUpdate())
|
||||
ipcMain.handle("install-update", () => deps.installUpdate())
|
||||
ipcMain.handle("set-background-color", (_event: IpcMainInvokeEvent, color: string) => deps.setBackgroundColor(color))
|
||||
ipcMain.handle("store-get", (_event: IpcMainInvokeEvent, name: string, key: string) => {
|
||||
const store = getStore(name)
|
||||
const value = store.get(key)
|
||||
@@ -142,8 +140,6 @@ export function registerIpcHandlers(deps: Deps) {
|
||||
new Notification({ title, body }).show()
|
||||
})
|
||||
|
||||
ipcMain.handle("get-window-count", () => BrowserWindow.getAllWindows().length)
|
||||
|
||||
ipcMain.handle("get-window-focused", (event: IpcMainInvokeEvent) => {
|
||||
const win = BrowserWindow.fromWebContents(event.sender)
|
||||
return win?.isFocused() ?? false
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { BrowserWindow, Menu, shell } from "electron"
|
||||
|
||||
import { UPDATER_ENABLED } from "./constants"
|
||||
import { createMainWindow } from "./windows"
|
||||
|
||||
type Deps = {
|
||||
trigger: (id: string) => void
|
||||
@@ -49,11 +48,6 @@ export function createMenu(deps: Deps) {
|
||||
submenu: [
|
||||
{ label: "New Session", accelerator: "Shift+Cmd+S", click: () => deps.trigger("session.new") },
|
||||
{ label: "Open Project...", accelerator: "Cmd+O", click: () => deps.trigger("project.open") },
|
||||
{
|
||||
label: "New Window",
|
||||
accelerator: "Cmd+Shift+N",
|
||||
click: () => createMainWindow({ updaterEnabled: UPDATER_ENABLED }),
|
||||
},
|
||||
{ type: "separator" },
|
||||
{ role: "close" },
|
||||
],
|
||||
|
||||
@@ -6,21 +6,12 @@ import type { TitlebarTheme } from "../preload/types"
|
||||
|
||||
type Globals = {
|
||||
updaterEnabled: boolean
|
||||
wsl: boolean
|
||||
deepLinks?: string[]
|
||||
}
|
||||
|
||||
const root = dirname(fileURLToPath(import.meta.url))
|
||||
|
||||
let backgroundColor: string | undefined
|
||||
|
||||
export function setBackgroundColor(color: string) {
|
||||
backgroundColor = color
|
||||
}
|
||||
|
||||
export function getBackgroundColor(): string | undefined {
|
||||
return backgroundColor
|
||||
}
|
||||
|
||||
function iconsDir() {
|
||||
return app.isPackaged ? join(process.resourcesPath, "icons") : join(root, "../../resources/icons")
|
||||
}
|
||||
@@ -68,7 +59,6 @@ export function createMainWindow(globals: Globals) {
|
||||
show: true,
|
||||
title: "OpenCode",
|
||||
icon: iconPath(),
|
||||
backgroundColor,
|
||||
...(process.platform === "darwin"
|
||||
? {
|
||||
titleBarStyle: "hidden" as const,
|
||||
@@ -105,7 +95,6 @@ export function createLoadingWindow(globals: Globals) {
|
||||
center: true,
|
||||
show: true,
|
||||
icon: iconPath(),
|
||||
backgroundColor,
|
||||
...(process.platform === "darwin" ? { titleBarStyle: "hidden" as const } : {}),
|
||||
...(process.platform === "win32"
|
||||
? {
|
||||
@@ -142,6 +131,7 @@ function injectGlobals(win: BrowserWindow, globals: Globals) {
|
||||
const deepLinks = globals.deepLinks ?? []
|
||||
const data = {
|
||||
updaterEnabled: globals.updaterEnabled,
|
||||
wsl: globals.wsl,
|
||||
deepLinks: Array.isArray(deepLinks) ? deepLinks.splice(0) : deepLinks,
|
||||
}
|
||||
void win.webContents.executeJavaScript(
|
||||
|
||||
@@ -28,7 +28,6 @@ const api: ElectronAPI = {
|
||||
storeKeys: (name) => ipcRenderer.invoke("store-keys", name),
|
||||
storeLength: (name) => ipcRenderer.invoke("store-length", name),
|
||||
|
||||
getWindowCount: () => ipcRenderer.invoke("get-window-count"),
|
||||
onSqliteMigrationProgress: (cb) => {
|
||||
const handler = (_: unknown, progress: SqliteMigrationProgress) => cb(progress)
|
||||
ipcRenderer.on("sqlite-migration-progress", handler)
|
||||
@@ -63,7 +62,6 @@ const api: ElectronAPI = {
|
||||
runUpdater: (alertOnFail) => ipcRenderer.invoke("run-updater", alertOnFail),
|
||||
checkUpdate: () => ipcRenderer.invoke("check-update"),
|
||||
installUpdate: () => ipcRenderer.invoke("install-update"),
|
||||
setBackgroundColor: (color: string) => ipcRenderer.invoke("set-background-color", color),
|
||||
}
|
||||
|
||||
contextBridge.exposeInMainWorld("api", api)
|
||||
|
||||
@@ -36,7 +36,6 @@ export type ElectronAPI = {
|
||||
storeKeys: (name: string) => Promise<string[]>
|
||||
storeLength: (name: string) => Promise<number>
|
||||
|
||||
getWindowCount: () => Promise<number>
|
||||
onSqliteMigrationProgress: (cb: (progress: SqliteMigrationProgress) => void) => () => void
|
||||
onMenuCommand: (cb: (id: string) => void) => () => void
|
||||
onDeepLink: (cb: (urls: string[]) => void) => () => void
|
||||
@@ -67,5 +66,4 @@ export type ElectronAPI = {
|
||||
runUpdater: (alertOnFail: boolean) => Promise<void>
|
||||
checkUpdate: () => Promise<{ updateAvailable: boolean; version?: string }>
|
||||
installUpdate: () => Promise<void>
|
||||
setBackgroundColor: (color: string) => Promise<void>
|
||||
}
|
||||
|
||||
@@ -10,15 +10,14 @@ import {
|
||||
useCommand,
|
||||
} from "@opencode-ai/app"
|
||||
import type { AsyncStorage } from "@solid-primitives/storage"
|
||||
import { MemoryRouter } from "@solidjs/router"
|
||||
import { createEffect, createResource, onCleanup, onMount, Show } from "solid-js"
|
||||
import { createResource, onCleanup, onMount, Show } from "solid-js"
|
||||
import { render } from "solid-js/web"
|
||||
import { MemoryRouter } from "@solidjs/router"
|
||||
import pkg from "../../package.json"
|
||||
import { initI18n, t } from "./i18n"
|
||||
import { UPDATER_ENABLED } from "./updater"
|
||||
import { webviewZoom } from "./webview-zoom"
|
||||
import "./styles.css"
|
||||
import { useTheme } from "@opencode-ai/ui/theme"
|
||||
|
||||
const root = document.getElementById("root")
|
||||
if (import.meta.env.DEV && !(root instanceof HTMLElement)) {
|
||||
@@ -227,9 +226,7 @@ const createPlatform = (): Platform => {
|
||||
const image = await window.api.readClipboardImage().catch(() => null)
|
||||
if (!image) return null
|
||||
const blob = new Blob([image.buffer], { type: "image/png" })
|
||||
return new File([blob], `pasted-image-${Date.now()}.png`, {
|
||||
type: "image/png",
|
||||
})
|
||||
return new File([blob], `pasted-image-${Date.now()}.png`, { type: "image/png" })
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -243,8 +240,6 @@ listenForDeepLinks()
|
||||
render(() => {
|
||||
const platform = createPlatform()
|
||||
|
||||
const [windowCount] = createResource(() => window.api.getWindowCount())
|
||||
|
||||
// Fetch sidecar credentials (available immediately, before health check)
|
||||
const [sidecar] = createResource(() => window.api.awaitInitialization(() => undefined))
|
||||
|
||||
@@ -281,18 +276,6 @@ render(() => {
|
||||
function Inner() {
|
||||
const cmd = useCommand()
|
||||
menuTrigger = (id) => cmd.trigger(id)
|
||||
|
||||
const theme = useTheme()
|
||||
|
||||
createEffect(() => {
|
||||
theme.themeId()
|
||||
theme.mode()
|
||||
const bg = getComputedStyle(document.documentElement).getPropertyValue("--background-base").trim()
|
||||
if (bg) {
|
||||
void window.api.setBackgroundColor(bg)
|
||||
}
|
||||
})
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -306,14 +289,13 @@ render(() => {
|
||||
return (
|
||||
<PlatformProvider value={platform}>
|
||||
<AppBaseProviders>
|
||||
<Show when={!defaultServer.loading && !sidecar.loading && !windowCount.loading}>
|
||||
<Show when={!defaultServer.loading && !sidecar.loading}>
|
||||
{(_) => {
|
||||
return (
|
||||
<AppInterface
|
||||
defaultServer={defaultServer.latest ?? ServerConnection.Key.make("sidecar")}
|
||||
servers={servers()}
|
||||
router={MemoryRouter}
|
||||
disableHealthCheck={(windowCount() ?? 0) > 1}
|
||||
>
|
||||
<Inner />
|
||||
</AppInterface>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { Menu, MenuItem, PredefinedMenuItem, Submenu } from "@tauri-apps/api/menu"
|
||||
import { openUrl } from "@tauri-apps/plugin-opener"
|
||||
import { type as ostype } from "@tauri-apps/plugin-os"
|
||||
import { relaunch } from "@tauri-apps/plugin-process"
|
||||
import { commands } from "./bindings"
|
||||
import { openUrl } from "@tauri-apps/plugin-opener"
|
||||
|
||||
import { runUpdater, UPDATER_ENABLED } from "./updater"
|
||||
import { installCli } from "./cli"
|
||||
import { initI18n, t } from "./i18n"
|
||||
import { runUpdater, UPDATER_ENABLED } from "./updater"
|
||||
import { commands } from "./bindings"
|
||||
|
||||
export async function createMenu(trigger: (id: string) => void) {
|
||||
if (ostype() !== "macos") return
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
DROP INDEX IF EXISTS `message_session_idx`;--> statement-breakpoint
|
||||
DROP INDEX IF EXISTS `part_message_idx`;--> statement-breakpoint
|
||||
CREATE INDEX `message_session_time_created_id_idx` ON `message` (`session_id`,`time_created`,`id`);--> statement-breakpoint
|
||||
CREATE INDEX `part_message_id_id_idx` ON `part` (`message_id`,`id`);
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user