mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-16 14:33:23 +00:00
chore: generate
This commit is contained in:
parent
154f298fe9
commit
1288161528
9 changed files with 25 additions and 39 deletions
|
|
@ -68,9 +68,7 @@ test("moves blocking work to the background with Ctrl+B", async ({ page }) => {
|
|||
await expect(page.locator('[data-component="task-tool-card"]')).toBeVisible()
|
||||
await expect(page.getByText("Called `subagent`", { exact: false })).toHaveCount(0)
|
||||
await expect(page.locator('[data-component="background-tool-control"]')).toHaveCount(0)
|
||||
await expect(page.locator('[data-action="session-background-toggle"]')).toContainText(
|
||||
"Move 1 subagent to background",
|
||||
)
|
||||
await expect(page.locator('[data-action="session-background-toggle"]')).toContainText("Move 1 subagent to background")
|
||||
|
||||
const request = page.waitForRequest(
|
||||
(request) =>
|
||||
|
|
@ -88,9 +86,7 @@ test("navigates from a running subagent card and hides background controls in th
|
|||
sessionStatus: { [sessionID]: { type: "busy" }, [childID]: { type: "busy" } },
|
||||
})
|
||||
|
||||
await expect(page.locator('[data-action="session-background-toggle"]')).toContainText(
|
||||
"Move 1 subagent to background",
|
||||
)
|
||||
await expect(page.locator('[data-action="session-background-toggle"]')).toContainText("Move 1 subagent to background")
|
||||
await page.locator('[data-component="task-tool-card"]').click()
|
||||
await expect(page).toHaveURL(new RegExp(`/session/${childID}$`))
|
||||
await expect(page.locator('[data-component="session-background-dock"]')).toHaveCount(0)
|
||||
|
|
|
|||
|
|
@ -383,10 +383,7 @@ export async function mockOpenCodeServer(page: Page, config: MockServerConfig) {
|
|||
const sessionForm = path.match(/^\/api\/session\/([^/]+)\/form$/)?.[1]
|
||||
if (sessionForm && route.request().method() === "GET") {
|
||||
const forms = typeof config.forms === "function" ? config.forms() : (config.forms ?? [])
|
||||
return json(
|
||||
route,
|
||||
{ data: forms.filter((form) => (form as { sessionID?: string }).sessionID === sessionForm) },
|
||||
)
|
||||
return json(route, { data: forms.filter((form) => (form as { sessionID?: string }).sessionID === sessionForm) })
|
||||
}
|
||||
if (/^\/api\/session\/[^/]+\/form\/[^/]+\/(reply|cancel)$/.test(path) && route.request().method() === "POST") {
|
||||
return route.fulfill({ status: 204, headers: { "access-control-allow-origin": "*" } })
|
||||
|
|
|
|||
|
|
@ -383,16 +383,14 @@ function ProviderConnection(props: {
|
|||
})
|
||||
},
|
||||
})
|
||||
const provider = createMemo(
|
||||
() => ({
|
||||
id: props.provider,
|
||||
name:
|
||||
providers.all().get(props.provider)?.name ??
|
||||
serverSync().data.provider.all.get(props.provider)?.name ??
|
||||
controller.integration()?.name ??
|
||||
props.provider,
|
||||
}),
|
||||
)
|
||||
const provider = createMemo(() => ({
|
||||
id: props.provider,
|
||||
name:
|
||||
providers.all().get(props.provider)?.name ??
|
||||
serverSync().data.provider.all.get(props.provider)?.name ??
|
||||
controller.integration()?.name ??
|
||||
props.provider,
|
||||
}))
|
||||
const methodLabel = (value?: { type?: string; label?: string }) => {
|
||||
if (!value) return ""
|
||||
if (value.type === "key") return language.t("provider.connect.method.apiKey")
|
||||
|
|
|
|||
|
|
@ -974,9 +974,7 @@ export function createServerSession(
|
|||
}
|
||||
if (event.type === "session.inbox.delivery.changed")
|
||||
setData("pending", sessionID, (items) =>
|
||||
items?.map((item) =>
|
||||
item.id === event.data.inboxID ? { ...item, delivery: event.data.delivery } : item,
|
||||
),
|
||||
items?.map((item) => (item.id === event.data.inboxID ? { ...item, delivery: event.data.delivery } : item)),
|
||||
)
|
||||
if (event.type === "session.inbox.cancelled" || event.type === "session.inbox.delivered") {
|
||||
setData("pending", sessionID, (items) => items?.filter((item) => item.id !== event.data.inboxID))
|
||||
|
|
@ -1386,10 +1384,7 @@ export function createServerSession(
|
|||
},
|
||||
},
|
||||
sync,
|
||||
async hydrateTransient(
|
||||
sessionID: string,
|
||||
load: () => Promise<{ pending: SessionInboxInfo[]; forms: FormInfo[] }>,
|
||||
) {
|
||||
async hydrateTransient(sessionID: string, load: () => Promise<{ pending: SessionInboxInfo[]; forms: FormInfo[] }>) {
|
||||
while (true) {
|
||||
const pendingAt = pendingRevision.get(sessionID) ?? 0
|
||||
const formAt = formRevision.get(sessionID) ?? 0
|
||||
|
|
|
|||
|
|
@ -630,8 +630,7 @@ export function createServerSyncContextInner(serverSDK: ServerSDK) {
|
|||
eventType === "project.directories.updated"
|
||||
)
|
||||
bootstrap.refetch()
|
||||
if (eventType === "global.disposed")
|
||||
Object.keys(children.children).filter(children.active).forEach(queue.push)
|
||||
if (eventType === "global.disposed") Object.keys(children.children).filter(children.active).forEach(queue.push)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -661,8 +661,7 @@ export default function Page() {
|
|||
)
|
||||
const vcsQuery = createQuery(() => {
|
||||
const mode = vcsMode()
|
||||
const enabled =
|
||||
serverSDK().connection.status() === "connected" && wantsReview() && sync().project?.vcs === "git"
|
||||
const enabled = serverSDK().connection.status() === "connected" && wantsReview() && sync().project?.vcs === "git"
|
||||
|
||||
return {
|
||||
queryKey: [...vcsKey(), mode] as const,
|
||||
|
|
|
|||
|
|
@ -72,9 +72,7 @@ export function SessionBackgroundDock(props: {
|
|||
{(task) => (
|
||||
<div class="flex min-w-0 items-baseline gap-2 text-13-regular">
|
||||
<span class="shrink-0 text-13-medium text-text-strong">
|
||||
{language.t(
|
||||
task.type === "shell" ? "ui.tool.shell" : "ui.tool.agent.default",
|
||||
)}
|
||||
{language.t(task.type === "shell" ? "ui.tool.shell" : "ui.tool.agent.default")}
|
||||
</span>
|
||||
<span class="truncate text-text-weak">{task.label}</span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -135,7 +135,13 @@ export function createSessionComposerController(options?: { closeMs?: number | (
|
|||
const sessionID = part.state.metadata.sessionID
|
||||
if (typeof sessionID !== "string" || completed.has(sessionID)) return []
|
||||
const description = part.state.input.description
|
||||
return [{ id: sessionID, type: "subagent" as const, label: typeof description === "string" ? description : sessionID }]
|
||||
return [
|
||||
{
|
||||
id: sessionID,
|
||||
type: "subagent" as const,
|
||||
label: typeof description === "string" ? description : sessionID,
|
||||
},
|
||||
]
|
||||
})
|
||||
})
|
||||
const active = Object.values(serverSync().session.data.info).flatMap((info) => {
|
||||
|
|
|
|||
|
|
@ -285,16 +285,14 @@ function MessageTimelineView(
|
|||
return { label: language.t("ui.patch.action.moved"), data: message.location.directory }
|
||||
if (message.type === "skill") return { label: language.t("ui.tool.skill"), data: message.name }
|
||||
if (message.type === "system") return { label: message.description ?? message.text }
|
||||
if (message.type === "compaction")
|
||||
return { label: language.t("ui.messagePart.compaction"), data: message.status }
|
||||
if (message.type === "compaction") return { label: language.t("ui.messagePart.compaction"), data: message.status }
|
||||
if (message.type !== "synthetic") return
|
||||
if (message.description === "Continuing after restart") return { label: message.description }
|
||||
const source = typeof message.metadata?.source === "string" ? message.metadata.source : undefined
|
||||
const state = typeof message.metadata?.state === "string" ? message.metadata.state : undefined
|
||||
if (source === "subagent" || source === "shell") {
|
||||
const agent = typeof message.metadata?.agent === "string" ? message.metadata.agent : undefined
|
||||
const actor =
|
||||
source === "shell" ? language.t("ui.tool.shell") : (agent ?? language.t("ui.tool.agent.default"))
|
||||
const actor = source === "shell" ? language.t("ui.tool.shell") : (agent ?? language.t("ui.tool.agent.default"))
|
||||
const label = language.t(
|
||||
state === "error"
|
||||
? "session.timeline.notice.failed"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue