From 3134e2a94a81ecf1ac8dc33492f9f28ccdcdc529 Mon Sep 17 00:00:00 2001 From: heunghingwan Date: Sat, 14 Nov 2026 00:33:38 +0800 Subject: [PATCH 01/25] fix(ui): keep session deletion responsive on long-context projects (#1484) Deleting one session scanned all resident instance messages through store proxies. Clearing a family repeated that scan for every member, and retained transcript measurement also paid proxy-trap costs across every field. Clear a session through its own messageIds index, retaining the whole-store fallback for missing session records. Walk raw store targets for incremental retention measurement and canonicalize every visited proxy/raw alias before identity deduplication, including display/global cache references. This keeps byte accounting unchanged and avoids falsely exceeding the retention cap. Add real-browser deletion scaling and cached-tool-output accounting regressions alongside the existing retention/LRU tests. --- packages/ui/src/lib/retained-size.ts | 12 +- .../src/stores/message-v2/instance-store.ts | 56 +++-- .../browser/fixtures/session-delete-scale.tsx | 209 ++++++++++++++++++ .../session-delete-responsiveness.test.ts | 78 +++++++ .../session-retention-accounting.test.ts | 69 ++++++ 5 files changed, 407 insertions(+), 17 deletions(-) create mode 100644 packages/ui/tests/browser/fixtures/session-delete-scale.tsx create mode 100644 packages/ui/tests/browser/session-delete-responsiveness.test.ts create mode 100644 packages/ui/tests/browser/session-retention-accounting.test.ts diff --git a/packages/ui/src/lib/retained-size.ts b/packages/ui/src/lib/retained-size.ts index a7bb9f0102..d9afbdabfd 100644 --- a/packages/ui/src/lib/retained-size.ts +++ b/packages/ui/src/lib/retained-size.ts @@ -73,6 +73,10 @@ export async function estimateRetainedBytesIncrementally( rootIterable?: boolean maxBytes?: number maxNodes?: number + /** Maps a value to its canonical identity before the seen-check, so the + * same data reached through different references (a raw object and a + * reactive proxy of it) is counted once. */ + canonicalize?: (value: object) => object } = {}, ): Promise { const seen = new WeakSet() @@ -80,6 +84,10 @@ export async function estimateRetainedBytesIncrementally( const children: Iterator[] = [] const roots = options.rootIterable ? (value as Iterable)[Symbol.iterator]() : undefined if (!roots) pending.push(value) + const canonicalize = options.canonicalize + const ingest = (item: unknown) => { + pending.push(item && typeof item === "object" && canonicalize ? canonicalize(item as object) : item) + } const yieldEvery = Math.max(1, options.yieldEvery ?? 500) const maxBytes = options.maxBytes ?? Number.POSITIVE_INFINITY const maxNodes = options.maxNodes ?? Number.POSITIVE_INFINITY @@ -93,14 +101,14 @@ export async function estimateRetainedBytesIncrementally( if (child && !child.done) { total += child.value.keyBytes if (total > maxBytes) return Number.POSITIVE_INFINITY - pending.push(child.value.value) + ingest(child.value.value) } else if (child) { children.pop() continue } else { const next = roots!.next() if (next.done) break - pending.push(next.value) + ingest(next.value) } } if (++processed > maxNodes) return Number.POSITIVE_INFINITY diff --git a/packages/ui/src/stores/message-v2/instance-store.ts b/packages/ui/src/stores/message-v2/instance-store.ts index ae7b05a153..f0e53e89e3 100644 --- a/packages/ui/src/stores/message-v2/instance-store.ts +++ b/packages/ui/src/stores/message-v2/instance-store.ts @@ -1,5 +1,5 @@ import { batch } from "solid-js" -import { createStore, produce, reconcile } from "solid-js/store" +import { $RAW, createStore, produce, reconcile, unwrap } from "solid-js/store" import type { SetStoreFunction } from "solid-js/store" import { getLogger } from "../../lib/logger" import { getCacheRetainedEntriesForSession } from "../../lib/global-cache" @@ -462,28 +462,46 @@ export function createInstanceMessageStore(instanceId: string, hooks?: MessageSt if ((!session || (session.messageIds.length === 0 && !session.revert)) && !renderCache && globalCacheEntries.length === 0) { return Promise.resolve(0) } + // Walk the store's raw data: unwrap() on a store proxy returns the + // underlying target through its $RAW fast path, so the byte estimate does + // not pay Solid's per-access proxy traps for every field of every resident + // record — a proxied pass over one long-context transcript cost seconds of + // main-thread time, and the measurement runs after every session revision + // change (open, hydrate, delete). + const rawSession = session ? unwrap(session) : undefined + const rawMessages = unwrap(state.messages) + const rawMessageInfoVersion = unwrap(state.messageInfoVersion) + const rawPermissions = unwrap(state.permissions) + const rawUsage = unwrap(state.usage) + const rawSessionRevisions = unwrap(state.sessionRevisions) + const rawLastAssistantMessageIds = unwrap(state.lastAssistantMessageIds) + const rawLatestTodos = unwrap(state.latestTodos) function* retainedValues(): Generator { - if (session) yield session - for (const messageId of session?.messageIds ?? []) { - yield state.messages[messageId] + if (rawSession) yield rawSession + for (const messageId of rawSession?.messageIds ?? []) { + yield rawMessages[messageId] yield messageInfoCache.get(messageId) - yield state.messageInfoVersion[messageId] + yield rawMessageInfoVersion[messageId] } - for (const entry of state.permissions.queue) if (entry.permission.sessionID === sessionId) yield entry - if (session) { - yield state.usage[sessionId] - yield state.sessionRevisions[sessionId] - yield state.lastAssistantMessageIds[sessionId] - yield state.latestTodos[sessionId] + for (const entry of rawPermissions.queue) if (entry.permission.sessionID === sessionId) yield entry + if (rawSession) { + yield rawUsage[sessionId] + yield rawSessionRevisions[sessionId] + yield rawLastAssistantMessageIds[sessionId] + yield rawLatestTodos[sessionId] } yield renderCache - if (session) yield* getRecordDisplayCacheEntries(instanceId, session.messageIds) + if (rawSession) yield* getRecordDisplayCacheEntries(instanceId, rawSession.messageIds) for (const entry of globalCacheEntries) yield entry.value } if (globalCacheKeyBytes > MAX_TRANSCRIPT_MEASUREMENT_BYTES) return Promise.resolve(Number.POSITIVE_INFINITY) return estimateRetainedBytesIncrementally(retainedValues(), { signal, rootIterable: true, + // Display and global caches reference record data through store + // proxies; canonicalizing every visited object to its raw target keeps + // the identity-based deduplication from counting those aliases twice. + canonicalize: (value: object) => (value as Record)[$RAW] ?? value, maxBytes: MAX_TRANSCRIPT_MEASUREMENT_BYTES - globalCacheKeyBytes, maxNodes: MAX_TRANSCRIPT_MEASUREMENT_NODES, }).then((bytes) => Number.isFinite(bytes) ? bytes + globalCacheKeyBytes : bytes) @@ -1395,9 +1413,17 @@ export function createInstanceMessageStore(instanceId: string, hooks?: MessageSt if (!options?.preservePromptDisplayOverrides) clearPromptDisplayOverridesForSession(instanceId, sessionId) - const messageIds = Object.values(state.messages) - .filter((record) => record.sessionId === sessionId) - .map((record) => record.id) + // The session record owns its message ids (insertMessageIntoSession keeps + // record and list in sync). Reading them from the record keeps clearing one + // session linear in its own size; scanning every resident message of the + // instance through store proxies made an N-session deletion burst + // quadratic. The scan remains the fallback for a session without a record. + const sessionRecord = state.sessions[sessionId] + const messageIds = sessionRecord + ? sessionRecord.messageIds.filter((id) => Boolean(state.messages[id])) + : Object.values(state.messages) + .filter((record) => record.sessionId === sessionId) + .map((record) => record.id) const messageIdSet = new Set(messageIds) storeLog.info("Clearing session data", { instanceId, sessionId, messageCount: messageIds.length }) diff --git a/packages/ui/tests/browser/fixtures/session-delete-scale.tsx b/packages/ui/tests/browser/fixtures/session-delete-scale.tsx new file mode 100644 index 0000000000..248b0a5ab1 --- /dev/null +++ b/packages/ui/tests/browser/fixtures/session-delete-scale.tsx @@ -0,0 +1,209 @@ +import { createEffect, createMemo, createSignal, Show } from "solid-js" +import { render } from "solid-js/web" +import SessionList from "../../../src/components/session-list" +import SessionView from "../../../src/components/session/session-view" +import AlertDialog from "../../../src/components/alert-dialog" +import { ConfigProvider } from "../../../src/stores/preferences" +import { I18nProvider } from "../../../src/lib/i18n" +import { ThemeProvider } from "../../../src/lib/theme" +import { sdkManager } from "../../../src/lib/sdk-manager" +import { serverApi } from "../../../src/lib/api-client" +import { addInstance } from "../../../src/stores/instances" +import { sessions, setActiveSession, setProviders, setSessionPage, setSessions, activeSessionId } from "../../../src/stores/session-state" +import { messageStoreBus } from "../../../src/stores/message-v2/bus" +import { sseManager } from "../../../src/lib/sse-manager" +import { loadMessages } from "../../../src/stores/session-api" +import { buildRecordDisplayData } from "../../../src/stores/message-v2/record-display-cache" +import { buildSessionThreadsFromMap } from "../../../src/stores/session-tree" +import type { Session } from "../../../src/types/session" +import "../../../src/index.css" + +// PROBE FIXTURE (temporary, performance evidence gathering): real session list, +// conversation view and native event dispatcher over a synthetic long-context +// transcript that lives in a worktree. Only HTTP is fake. +const id = "session-delete-scale" +const model = { providerID: "fixture", id: "fixture" } +const worktreeDirectory = "/repo/.codenomad/worktrees/wt-a" +let time = Date.now() + +function make(sessionId: string, updated: number, directory: string, parentId: string | null = null): Session { + return { + id: sessionId, title: sessionId, instanceId: id, parentId, location: { directory }, status: "idle", agent: "build", + retry: null, idleSince: null, generationRecovery: null, runtimeStatusKnown: true, version: "1", + projectID: "fixture", cost: 0, tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, + time: { created: 1, updated, idle: 10 }, model: { providerId: "fixture", modelId: "fixture" }, + } as Session +} + +// Synthetic transcripts: an agentic session alternates user prompts with +// assistant answers; long ones carry big text bodies. +const transcripts = new Map() +function seedTranscript(sessionId: string, count: number, textSize: number, withTools = false) { + const rows: any[] = [] + for (let index = 0; index < count; index++) { + const role = index % 2 === 0 ? "user" : "assistant" + if (role === "user") { + rows.push({ + id: `${sessionId}_msg_${String(index).padStart(5, "0")}`, type: "user", + text: `${sessionId} prompt ${index} ${"probe prompt ".repeat(textSize / 24)}`, + time: { created: index + 1, completed: index + 1 }, + }) + } else { + const content: any[] = [{ type: "text", text: `${sessionId} ${index} ${"probe text ".repeat(textSize / 12)}` }] + if (withTools) { + content.push({ + type: "tool", id: `${sessionId}_tool_${index}_a`, name: "bash", time: { created: index + 1, completed: index + 1 }, + state: { status: "completed", input: { command: `echo probe ${index}` }, + content: [{ type: "text", text: "probe output\n".repeat(120) }], time: { created: index + 1, completed: index + 1 } }, + }) + content.push({ + type: "tool", id: `${sessionId}_tool_${index}_b`, name: "read", time: { created: index + 1, completed: index + 1 }, + state: { status: "completed", input: { filePath: `src/file-${index}.ts` }, + content: [{ type: "text", text: "export const probe = 1\n".repeat(80) }], time: { created: index + 1, completed: index + 1 } }, + }) + } + rows.push({ + id: `${sessionId}_msg_${String(index).padStart(5, "0")}`, type: "assistant", agent: "build", model, + time: { created: index + 1, completed: index + 1 }, + content, + }) + } + } + transcripts.set(sessionId, rows) +} +seedTranscript("long-context", Number(new URLSearchParams(location.search).get("messages") ?? 2000), 800, true) +for (let index = 0; index < 20; index++) seedTranscript(`sub-${index}`, 120, 300, true) +for (let index = 0; index < 6; index++) seedTranscript(`sibling-${index}`, 30, 300) + +const rows = new Map([ + ["long-context", { ...make("long-context", 9, worktreeDirectory), title: "long-context-a-very-long-mission-conversation-title-that-needs-overflow-actions" }], + ...Array.from({ length: 20 }, (_, index) => [`sub-${index}`, make(`sub-${index}`, 8 - index * 0.01, worktreeDirectory, "long-context")] as const), + ...Array.from({ length: 6 }, (_, index) => [`sibling-${index}`, make(`sibling-${index}`, 7 - index * 0.01, "/repo")] as const), +]) +const extraRows = Number(new URLSearchParams(location.search).get("rows") ?? 0) +if (extraRows > 0) { + for (let index = 0; index < extraRows; index++) { + const sessionId = `bulk-${index}` + seedTranscript(sessionId, 10, 200) + rows.set(sessionId, make(sessionId, 6 - index * 0.001, index % 2 === 0 ? worktreeDirectory : "/repo")) + } +} +const roots = ["long-context", ...Array.from({ length: 6 }, (_, index) => `sibling-${index}`), + ...Array.from({ length: extraRows }, (_, index) => `bulk-${index}`)] + +const client: any = { + session: { + active: async () => ({}), inbox: { list: async () => ({ data: [] }) }, + get: async ({ sessionID }: any) => sessions().get(id)?.get(sessionID), + remove: async () => ({}), + instructions: { entry: { remove: async () => {}, put: async () => {} } }, + }, + model: { default: async () => ({ data: model }) }, + permission: { list: async () => [] }, + message: { + list: async ({ sessionID, cursor, limit = 200, order }: any = {}) => { + const rows = transcripts.get(sessionID) ?? [] + if (order === "asc" || cursor?.startsWith("asc:")) { + const offset = Number(cursor?.slice(4) ?? 0) + return { data: rows.slice(offset, offset + limit), cursor: { + previous: "asc-boundary", + ...(offset + limit < rows.length ? { next: `asc:${offset + limit}` } : {}), + } } + } + const offset = Number(cursor ?? 0), reversed = rows.slice().reverse() + return { data: reversed.slice(offset, offset + limit), cursor: offset + limit < reversed.length ? { next: String(offset + limit) } : {} } + }, + }, +} +serverApi.fetchConfigOwner = async () => ({ settings: { locale: "en" } }) as any +serverApi.fetchStateOwner = async () => ({} as any) +serverApi.fetchWorktrees = async () => ({ + isGitRepo: true, + worktrees: [ + { slug: "root", directory: "/repo", kind: "root" as const }, + { slug: "wt-a", directory: worktreeDirectory, kind: "worktree" as const, branch: "wt-a", removable: true }, + ], +}) +;(sdkManager as any).clients.set(`${id}:/workspaces/${id}/instance`, client) +addInstance({ id, folder: "/repo", port: 0, pid: 0, proxyPath: `/workspaces/${id}/instance`, status: "ready", client }) +setSessions(previous => new Map(previous).set(id, new Map(rows))) +setProviders(prev => new Map(prev).set(id, [{ id: "fixture", name: "Fixture", models: [{ id: "fixture", name: "Fixture", providerId: "fixture", limit: { context: 200000, output: 4000 }, cost: { input: 0, output: 0 } }] }])) +setSessionPage(id, [...roots], false, true) +setActiveSession(id, "long-context") +// The viewed session follows the store's active session, as the real shell +// does; user row clicks in this fixture set the store directly too. +const [active, setActive] = createSignal("long-context") +createEffect(() => { + const current = activeSessionId().get(id) + if (current && current !== active()) setActive(current) +}) +const store = messageStoreBus.getOrCreate(id) + +function Fixture() { + const threads = createMemo(() => buildSessionThreadsFromMap(sessions().get(id)!, roots)) + return
+ +
+ { setActive(value); setActiveSession(id, value) }} + onNew={() => {}} enableFilterBar={false} showHeader={false} showFooter={false} /> +
+
+ + + +
+
+} +render(() => , document.getElementById("root")!) + +;(window as any).fixture = { + activeId: () => active(), + loaded: (sessionId: string) => store.getSessionMessageIds(sessionId).length, + residentMessages: () => Object.keys((store as any).state?.messages ?? {}).length, + select: (sessionId: string) => { setActive(sessionId); setActiveSession(id, sessionId) }, + load: async (sessionId: string) => { await loadMessages(id, sessionId, { force: true }) }, + /** Direct store hydration without HTTP, for scale that paging would make slow. */ + hydrateMany: (sessionId: string, count: number) => { + store.hydrateMessages(sessionId, Array.from({ length: count }, (_, index) => ({ + id: `${sessionId}_bulk_${String(index).padStart(6, "0")}`, sessionId, role: index % 2 === 0 ? "user" : "assistant", + status: "complete" as const, createdAt: index + 1, updatedAt: index + 1, + parts: [{ type: "text" as const, text: `bulk ${index} ${"hydration ".repeat(8)}` }], + }))) + }, + /** Direct hydration of assistant messages whose tool parts carry large outputs. */ + hydrateTools: (sessionId: string, outputs: number[]) => { + store.hydrateMessages(sessionId, outputs.map((size, index) => ({ + id: `${sessionId}_tool_msg_${index}`, sessionId, role: "assistant" as const, status: "complete" as const, + parts: [{ type: "tool" as any, id: `${sessionId}_tool_${index}`, tool: "bash", callID: `${sessionId}_tool_${index}`, + sessionID: sessionId, messageID: `${sessionId}_tool_msg_${index}`, time: { created: index + 1, completed: index + 1 }, + state: { status: "completed", input: { command: "cat" }, output: "x".repeat(size), time: { created: index + 1, completed: index + 1 } } }], + }))) + }, + /** Materializes the record display cache, which references tool state through store proxies. */ + materializeDisplay: (sessionId: string) => { + for (const messageId of store.getSessionMessageIds(sessionId)) { + buildRecordDisplayData(id, store.getMessage(messageId)!) + } + }, + estimate: (sessionId: string) => store.estimateSessionRetainedBytes(sessionId), + /** Synchronous duration of one native session.deleted dispatch. */ + emitDeleteMeasured: (sessionId: string) => { + const started = performance.now() + ;(sseManager as any).handleEvent(id, { + id: `evt_del_${++time}`, type: "session.deleted", created: time, location: { directory: worktreeDirectory }, + durable: { aggregateID: sessionId, seq: time, version: 2 }, + data: { sessionID: sessionId }, + }) + return Math.round((performance.now() - started) * 100) / 100 + }, + emitDelete: (sessionIds: string[]) => { + for (const sessionId of sessionIds) { + ;(sseManager as any).handleEvent(id, { + id: `evt_del_${++time}`, type: "session.deleted", created: time, location: { directory: worktreeDirectory }, + durable: { aggregateID: sessionId, seq: time, version: 2 }, + data: { sessionID: sessionId }, + }) + } + }, +} diff --git a/packages/ui/tests/browser/session-delete-responsiveness.test.ts b/packages/ui/tests/browser/session-delete-responsiveness.test.ts new file mode 100644 index 0000000000..5ac11f70fe --- /dev/null +++ b/packages/ui/tests/browser/session-delete-responsiveness.test.ts @@ -0,0 +1,78 @@ +import assert from "node:assert/strict" +import { after, before, test } from "node:test" +import { borrowFixture } from "./fixture-borrow" +import { armFixtureNavigationBudget } from "./fixture-navigation-budget" +import { chromium, type Browser, type Page } from "playwright" + +// Deleting one conversation must not pay for every other conversation resident +// in the instance store. Clearing a session collects its message ids from the +// session record; a scan of every resident message through store proxies made +// each deletion cost O(all resident messages) — a mission cleanup deleting a +// task family then blocked the main thread for seconds, up to the browser's +// page-unresponsive dialog. The control is a scaling comparison, not an +// absolute bound: a scan's cost grows with the unrelated sibling's transcript +// size on any machine, the record-based collection does not. +let browser: Browser, url: string +before(async () => { + const fixture = await borrowFixture({ + name: "session-delete-scale", + routes: [ + { path: "/fixture", html: "
" }, + ], + }) + url = fixture.url + browser = await chromium.launch({ executablePath: process.env.CODENOMAD_BROWSER_PATH || undefined }) + armFixtureNavigationBudget(browser) +}) +after(async () => { await browser?.close() }) + +async function openPage(): Promise<{ page: Page, errors: string[] }> { + const page = await browser.newPage({ viewport: { width: 1400, height: 850 }, locale: "en-US" }) + const errors: string[] = [] + page.on("pageerror", error => errors.push(error.message)) + await page.addInitScript(() => { window.EventSource = class extends EventTarget { close() {} } as any }) + await page.route("**/api/**", route => route.fulfill({ json: {} })) + await page.goto(url, { timeout: 120_000 }) + await page.waitForFunction(() => Boolean((window as any).fixture), undefined, { timeout: 120_000 }) + // The viewed session stays a small one; a huge sibling stays resident but + // not mounted, exactly like inactive mission task transcripts. + await page.evaluate(`window.fixture.select("sibling-0")`) + await page.waitForFunction(`window.fixture.loaded("sibling-0") >= 30`, undefined, { timeout: 60_000 }) + return { page, errors } +} + +async function loadDeletionTargets(page: Page) { + for (const sessionId of ["sibling-2", "sibling-3", "sibling-4"]) { + await page.evaluate(`window.fixture.load("${sessionId}")`) + await page.waitForFunction(`window.fixture.loaded("${sessionId}") >= 30`, undefined, { timeout: 60_000 }) + } +} + +const cheapestOfThreeDispatches = (page: Page) => page.evaluate(`(() => { + const dispatches = ["sibling-2", "sibling-3", "sibling-4"].map((sessionId) => window.fixture.emitDeleteMeasured(sessionId)) + return Math.min(...dispatches) +})()`) + +test("deleting a small session is independent of other sessions' transcript size", async () => { + const withoutHuge = await openPage() + const big = await openPage() + try { + await loadDeletionTargets(withoutHuge.page) + const baseline = await cheapestOfThreeDispatches(withoutHuge.page) + + await big.page.evaluate(`window.fixture.hydrateMany("sibling-1", 60000)`) + await big.page.waitForFunction(`window.fixture.loaded("sibling-1") >= 60000`, undefined, { timeout: 120_000 }) + await loadDeletionTargets(big.page) + const withHuge = await cheapestOfThreeDispatches(big.page) + + console.log(JSON.stringify({ scenario: "delete-cost-independence", withoutHugeSiblingMs: baseline, withHugeSiblingMs: withHuge })) + assert.ok(withHuge < 3 * Math.max(baseline, 10) + 30, + `deleting a small session scaled with an unrelated sibling's transcript size: ${withHuge}ms with a 60k-message sibling vs ${baseline}ms without`) + assert.equal(await big.page.evaluate(`window.fixture.loaded("sibling-2")`), 0, "the deleted session's transcript leaves the store") + assert.ok((await big.page.evaluate(`window.fixture.loaded("sibling-1")`)) >= 60000, "other sessions keep their transcripts") + assert.deepEqual([...withoutHuge.errors, ...big.errors], []) + } finally { + await withoutHuge.page.close() + await big.page.close() + } +}) diff --git a/packages/ui/tests/browser/session-retention-accounting.test.ts b/packages/ui/tests/browser/session-retention-accounting.test.ts new file mode 100644 index 0000000000..134617aad2 --- /dev/null +++ b/packages/ui/tests/browser/session-retention-accounting.test.ts @@ -0,0 +1,69 @@ +import assert from "node:assert/strict" +import { after, before, test } from "node:test" +import { borrowFixture } from "./fixture-borrow" +import { armFixtureNavigationBudget } from "./fixture-navigation-budget" +import { chromium, type Browser } from "playwright" + +// Transcript retention accounting must deduplicate raw/proxy aliases before +// counting bytes. The raw store walk visits records' data as raw targets while +// display caches reference the same tool state through Solid store proxies; +// the estimator's identity-based deduplication then counts both, and long +// tool transcripts cross the 64 MiB measurement cap, report Infinity, and make +// the LRU evict unrelated inactive transcripts. Runs in the browser rig so the +// client solid-js/store build (real proxies) is active — the server build used +// by plain node tests never creates proxies. +let browser: Browser, url: string +before(async () => { + const fixture = await borrowFixture({ + name: "session-delete-scale", + routes: [ + { path: "/fixture", html: "
" }, + ], + }) + url = fixture.url + browser = await chromium.launch({ executablePath: process.env.CODENOMAD_BROWSER_PATH || undefined }) + armFixtureNavigationBudget(browser) +}) +after(async () => { await browser?.close() }) + +test("retention estimate does not double-count tool state aliased by display caches", async () => { + const page = await browser.newPage({ viewport: { width: 1400, height: 850 }, locale: "en-US" }) + const errors: string[] = [] + page.on("pageerror", error => errors.push(error.message)) + try { + await page.addInitScript(() => { window.EventSource = class extends EventTarget { close() {} } as any }) + await page.route("**/api/**", route => route.fulfill({ json: {} })) + await page.goto(url, { timeout: 120_000 }) + await page.waitForFunction(() => Boolean((window as any).fixture), undefined, { timeout: 120_000 }) + await page.evaluate(`window.fixture.select("sibling-0")`) + await page.waitForFunction(`window.fixture.loaded("sibling-0") >= 30`, undefined, { timeout: 60_000 }) + + const result = await page.evaluate(`(async () => { + const fixture = window.fixture + fixture.hydrateTools("sibling-1", [1_000_000]) + const withoutCache = await fixture.estimate("sibling-1") + fixture.materializeDisplay("sibling-1") + const withCache = await fixture.estimate("sibling-1") + return { withoutCache, withCache, delta: withCache - withoutCache } + })()`) + console.log(JSON.stringify({ scenario: "retention-alias-delta", ...result })) + assert.ok(result.delta < 64_000, + `display caches added ${result.delta} bytes of duplicate tool state (without=${result.withoutCache}, with=${result.withCache})`) + + // Two ~9.5 MiB counted outputs with materialized display caches: counting + // the proxy aliases a second time crosses the 64 MiB measurement cap and + // reports Infinity, which the LRU treats as over-budget. + const cap = await page.evaluate(`(async () => { + const fixture = window.fixture + fixture.hydrateTools("sibling-2", [4_700_000, 4_700_000]) + fixture.materializeDisplay("sibling-2") + return await fixture.estimate("sibling-2") + })()`) + console.log(JSON.stringify({ scenario: "retention-alias-cap", estimate: cap })) + assert.ok(Number.isFinite(cap), `estimate exceeded the measurement cap: ${cap}`) + assert.ok(cap < 48_000_000, `estimate double-counted cached tool state: ${cap}`) + assert.deepEqual(errors, []) + } finally { + await page.close() + } +}) From 760a55107fbced026ff1534535bac9cafee2c169 Mon Sep 17 00:00:00 2001 From: heunghingwan Date: Sat, 14 Nov 2026 00:33:42 +0800 Subject: [PATCH 02/25] feat(ui): open project-file links from replies in the file reader (#1485) Plain clicks on relative or absolute file links inside a conversation's worktree open the existing file reader instead of a dead external tab. Preserve loopback-preview routing, browser handling of modified clicks, and normal handling of links outside the worktree. Resolve against the session's own directory, matching worktree inventory by directory rather than a fallback root slug. Independently moved children and sessions absent from a populated inventory keep their own locations. Reject URL-shaped and escaping paths after decoding and normalization. Extract shared session-link routing and decoration, preserve author-supplied titles, refresh owned tooltips with locale changes, and document the behavior in all ten locales. Cover classification and real-component file/loopback routing, unmatched inventories and independently moved children. --- docs/help/de/conversations.md | 6 + docs/help/en/conversations.md | 6 + docs/help/es/conversations.md | 6 + docs/help/fr/conversations.md | 6 + docs/help/he/conversations.md | 6 + docs/help/ja/conversations.md | 6 + docs/help/ne/conversations.md | 6 + docs/help/ru/conversations.md | 6 + docs/help/tr/conversations.md | 6 + docs/help/zh-Hans/conversations.md | 6 + .../src/components/markdown-session-links.ts | 150 ++++++++++++++++++ packages/ui/src/components/markdown.tsx | 77 ++------- .../ui/src/lib/i18n/messages/de/markdown.ts | 1 + .../ui/src/lib/i18n/messages/en/markdown.ts | 1 + .../ui/src/lib/i18n/messages/es/markdown.ts | 1 + .../ui/src/lib/i18n/messages/fr/markdown.ts | 1 + .../ui/src/lib/i18n/messages/he/markdown.ts | 1 + .../ui/src/lib/i18n/messages/ja/markdown.ts | 1 + .../ui/src/lib/i18n/messages/ne/markdown.ts | 1 + .../ui/src/lib/i18n/messages/ru/markdown.ts | 1 + .../ui/src/lib/i18n/messages/tr/markdown.ts | 1 + .../src/lib/i18n/messages/zh-Hans/markdown.ts | 1 + .../ui/src/lib/markdown-project-links.test.ts | 44 +++++ packages/ui/src/lib/markdown-project-links.ts | 71 +++++++++ .../fixtures/markdown-session-links.tsx | 85 ++++++++++ .../browser/markdown-session-links.test.ts | 114 +++++++++++++ 26 files changed, 551 insertions(+), 60 deletions(-) create mode 100644 packages/ui/src/components/markdown-session-links.ts create mode 100644 packages/ui/src/lib/markdown-project-links.test.ts create mode 100644 packages/ui/src/lib/markdown-project-links.ts create mode 100644 packages/ui/tests/browser/fixtures/markdown-session-links.tsx create mode 100644 packages/ui/tests/browser/markdown-session-links.test.ts diff --git a/docs/help/de/conversations.md b/docs/help/de/conversations.md index 7bfd54f6e6..067b961f48 100644 --- a/docs/help/de/conversations.md +++ b/docs/help/de/conversations.md @@ -60,6 +60,12 @@ Auf dem Desktop verschiebt Senden den Tastaturfokus in die Unterhaltung, sodass Entwürfe sind clientseitiger Arbeitszustand, keine gemeinsamen nativen Nachrichten. Die Startwiederherstellung kann unterstützten Eingabezustand behalten; behandeln Sie einen ungesendeten Entwurf oder Anhang aber nicht als Sicherung und nehmen Sie nicht an, dass er auf einem anderen Gerät erscheint. Sichern Sie wichtigen Text vor dem Löschen von Startdaten oder dem Schließen eines Clients mit deaktivierter Wiederherstellung; siehe [Desktop](desktop.md). +## Dateien aus Antworten öffnen {#open-files-from-replies} + +1. Agent-Antworten verlinken Projektdateien mit relativen und absoluten Pfaden. +2. Ein einfacher Klick öffnet die verlinkte Datei in der Dateivorschau, gelesen aus dem Worktree der Unterhaltung. +3. Klicks mit Zusatztasten (Strg/⌘-Klick, Umschalt-Klick, Mittelklick) und Links außerhalb des Session-Worktrees behalten das normale Linkverhalten. + ## Befehle und Shell-Modus {#commands-shell} 1. Geben Sie `/` ein, wählen Sie einen gefundenen benutzerdefinierten Befehl und geben Sie dessen Argumente an. diff --git a/docs/help/en/conversations.md b/docs/help/en/conversations.md index 112525ecb5..e6fb647258 100644 --- a/docs/help/en/conversations.md +++ b/docs/help/en/conversations.md @@ -60,6 +60,12 @@ On desktop, sending moves keyboard focus to the conversation, so arrows, paging Drafts are client-side working state, not shared native messages. Startup restoration can retain supported composer state, but do not treat an unsent draft or attachment as a backup or assume it appears on another device. Save important text before clearing startup data or closing a client whose restore policy is disabled; see [Desktop](desktop.md). +## Open files from replies {#open-files-from-replies} + +1. Agent replies link project files with relative and absolute paths. +2. A plain click opens the linked file in the file preview, read from the conversation’s worktree. +3. Modified clicks (Ctrl/Cmd-click, Shift-click, middle-click) and links outside the session’s worktree keep normal link behavior. + ## Commands and Shell mode {#commands-shell} 1. Type `/` and select a discovered custom command, then supply its arguments. diff --git a/docs/help/es/conversations.md b/docs/help/es/conversations.md index 49d00efda6..ff1dd2600c 100644 --- a/docs/help/es/conversations.md +++ b/docs/help/es/conversations.md @@ -60,6 +60,12 @@ En el escritorio, enviar mueve el foco del teclado a la conversación, de modo q Los borradores son estado de trabajo del cliente, no mensajes nativos compartidos. La restauración al iniciar puede conservar el estado compatible del editor, pero no trates un borrador o adjunto sin enviar como una copia de seguridad ni supongas que aparece en otro dispositivo. Guarda el texto importante antes de borrar los datos de inicio o cerrar un cliente cuya política de restauración esté desactivada; consulta [Escritorio](desktop.md). +## Abrir archivos desde las respuestas {#open-files-from-replies} + +1. Las respuestas del agente enlazan archivos del proyecto con rutas relativas y absolutas. +2. Un clic normal abre el archivo enlazado en la vista previa del archivo, leído del worktree de la conversación. +3. Los clics con modificadores (Ctrl/⌘-clic, Mayús-clic, clic central) y los enlaces fuera del worktree de la sesión mantienen el comportamiento normal de los enlaces. + ## Comandos y modo shell {#commands-shell} 1. Escribe `/` y selecciona un comando personalizado descubierto; después, proporciona sus argumentos. diff --git a/docs/help/fr/conversations.md b/docs/help/fr/conversations.md index 7766b5d3ef..9dc4c76f94 100644 --- a/docs/help/fr/conversations.md +++ b/docs/help/fr/conversations.md @@ -60,6 +60,12 @@ Sur ordinateur, l’envoi place le focus clavier sur la conversation : les flèc Les brouillons sont un état de travail côté client, pas des messages natifs partagés. La restauration au démarrage peut conserver l’état de saisie pris en charge, mais ne considérez pas un brouillon non envoyé ou une pièce jointe comme une sauvegarde, ni comme disponible sur un autre appareil. Enregistrez le texte important avant d’effacer les données de démarrage ou de fermer un client dont la restauration est désactivée ; voir [Bureau](desktop.md). +## Ouvrir des fichiers depuis les réponses {#open-files-from-replies} + +1. Les réponses de l’agent lient des fichiers du projet par des chemins relatifs et absolus. +2. Un clic simple ouvre le fichier lié dans l’aperçu du fichier, lu depuis le worktree de la conversation. +3. Les clics modifiés (Ctrl/⌘-clic, Maj-clic, clic milieu) et les liens hors du worktree de la session conservent le comportement normal des liens. + ## Commandes et mode shell {#commands-shell} 1. Tapez `/` et sélectionnez une commande personnalisée découverte, puis fournissez ses arguments. diff --git a/docs/help/he/conversations.md b/docs/help/he/conversations.md index 9802b22c5e..f0675f7c9d 100644 --- a/docs/help/he/conversations.md +++ b/docs/help/he/conversations.md @@ -60,6 +60,12 @@ CodeNomad מציג סשנים מקוריים של OpenCode כשיחות, עם ה טיוטות הן מצב עבודה בצד הלקוח, לא הודעות מקוריות משותפות. שחזור בהפעלה יכול לשמר מצב נתמך של שדה הקלט, אך אל תתייחסו לטיוטה או לצירוף שלא נשלחו כאל גיבוי ואל תניחו שהם מופיעים במכשיר אחר. שמרו טקסט חשוב לפני ניקוי נתוני הפעלה או סגירת לקוח שמדיניות השחזור שלו מושבתת; ראו [שולחן עבודה](desktop.md). +## פתיחת קבצים מתשובות {#open-files-from-replies} + +1. תשובות הסוכן מקשרות קבצי פרויקט בנתיבים יחסיים ומוחלטים. +2. לחיצה רגילה פותחת את הקובץ המקושר בתצוגה המקדימה של הקובץ, בקריאה מעץ העבודה של השיחה. +3. לחיצות עם מקשים נוספים (Ctrl/⌘, Shift, לחיצה אמצעית) וקישורים מחוץ לעץ העבודה של ההפעלה שומרים על התנהגות קישור רגילה. + ## פקודות ומצב מעטפת {#commands-shell} 1. הקלידו `/`, בחרו פקודה מותאמת שהתגלתה וספקו את הארגומנטים שלה. diff --git a/docs/help/ja/conversations.md b/docs/help/ja/conversations.md index e36d424760..49e0a5de29 100644 --- a/docs/help/ja/conversations.md +++ b/docs/help/ja/conversations.md @@ -60,6 +60,12 @@ CodeNomad は、OpenCode ネイティブのセッションを会話として表 下書きはクライアント側の作業状態であり、共有ネイティブメッセージではありません。起動時の復元で、対応する入力状態を保持できる場合はありますが、未送信の下書きや添付をバックアップと考えたり、別の端末にも表示されると想定したりしないでください。起動データを消去する前や、復元ポリシーが無効なクライアントを閉じる前に、重要なテキストを保存してください。[デスクトップ](desktop.md)を参照してください。 +## 返信からファイルを開く {#open-files-from-replies} + +1. エージェントの返信は、相対パスと絶対パスでプロジェクトファイルにリンクします。 +2. 通常クリックで、リンクされたファイルを会話のワークツリーから読み取り、ファイルのプレビューで開きます。 +3. 修飾キー付きクリック(Ctrl/⌘、Shift、中クリック)と、セッションのワークツリー外へのリンクは通常のリンク動作のままです。 + ## コマンドとシェルモード {#commands-shell} 1. `/` を入力して検出されたカスタムコマンドを選び、引数を指定します。 diff --git a/docs/help/ne/conversations.md b/docs/help/ne/conversations.md index 1fe28ecf76..302e7f17d6 100644 --- a/docs/help/ne/conversations.md +++ b/docs/help/ne/conversations.md @@ -60,6 +60,12 @@ skill रोज्दा `@query` token हटेर chip थपिन्छ। मस्यौदा क्लाइन्टको कामचलाउ अवस्था हुन्, साझा नेटिभ सन्देश होइनन्। startup restoration ले समर्थित कम्पोजर अवस्था राख्न सक्छ, तर नपठाइएको मस्यौदा वा संलग्नकलाई backup नमान्नुहोस् वा अर्को उपकरणमा देखिन्छ नठान्नुहोस्। startup डेटा खाली गर्नुअघि वा restore नीति बन्द भएको क्लाइन्ट बन्द गर्नुअघि महत्त्वपूर्ण पाठ बचत गर्नुहोस्; [डेस्कटप](desktop.md) हेर्नुहोस्। +## जवाफबाट फाइल खोल्ने {#open-files-from-replies} + +1. एजेन्टका जवाफले सापेक्ष र निरपेक्ष मार्गहरूसँग परियोजना फाइलहरू लिंक गर्छन्। +2. सामान्य क्लिकले कुराकानीको वर्कट्रीबाट लिंक गरिएको फाइल पढेर फाइल पूर्वावलोकनमा खोल्छ। +3. मोडिफाइड क्लिक (Ctrl/⌘, Shift, मध्य-क्लिक) र सेसनको वर्कट्री बाहिरका लिंकहरूले सामान्य लिंक व्यवहार राख्छन्। + ## आदेश र Shell मोड {#commands-shell} 1. `/` टाइप गरी भेटिएको custom command चयन गर्नुहोस्, त्यसपछि argument दिनुहोस्। diff --git a/docs/help/ru/conversations.md b/docs/help/ru/conversations.md index e1155b6d47..f3947ac525 100644 --- a/docs/help/ru/conversations.md +++ b/docs/help/ru/conversations.md @@ -60,6 +60,12 @@ CodeNomad представляет нативные сессии OpenCode как Черновики — клиентское рабочее состояние, а не общие нативные сообщения. Восстановление при запуске может сохранять поддерживаемое состояние поля ввода, но не считайте неотправленный черновик или вложение резервной копией и не предполагайте их наличие на другом устройстве. Сохраните важный текст перед очисткой данных запуска или закрытием клиента с отключённым восстановлением; см. [настольное приложение](desktop.md). +## Открытие файлов из ответов {#open-files-from-replies} + +1. Ответы агента ссылаются на файлы проекта относительными и абсолютными путями. +2. Обычный щелчок открывает связанный файл в просмотре файла, читая его из рабочего дерева беседы. +3. Щелчки с модификаторами (Ctrl/⌘, Shift, средняя кнопка) и ссылки вне рабочего дерева сессии сохраняют обычное поведение ссылок. + ## Команды и режим Shell {#commands-shell} 1. Введите `/`, выберите обнаруженную пользовательскую команду и укажите аргументы. diff --git a/docs/help/tr/conversations.md b/docs/help/tr/conversations.md index ba5be4dd9e..1b8252d95f 100644 --- a/docs/help/tr/conversations.md +++ b/docs/help/tr/conversations.md @@ -60,6 +60,12 @@ Masaüstünde gönderme, klavye odağını konuşmaya taşır; böylece oklar, s Taslaklar paylaşılan OpenCode mesajları değil, istemci çalışma durumudur. Başlangıçta geri yükleme desteklenen ileti düzenleyicisi durumunu koruyabilir; ancak gönderilmemiş taslak veya eki yedek saymayın ve başka cihazda göründüğünü varsaymayın. Başlangıç verilerini temizlemeden veya geri yüklemesi kapalı istemciyi kapatmadan önce önemli metni kaydedin; bkz. [Masaüstü](desktop.md). +## Yanıtlardan dosya açma {#open-files-from-replies} + +1. Aracı yanıtları proje dosyalarına göreli ve mutlak yollarla bağlantı verir. +2. Düz bir tıklama, bağlantılı dosyayı sohbetin worktree’sinden okuyarak dosya önizlemesinde açar. +3. Değiştirici tıklamalar (Ctrl/⌘, Shift, orta tıklama) ve oturumun worktree’si dışındaki bağlantılar normal bağlantı davranışını korur. + ## Komutlar ve Shell modu {#commands-shell} 1. `/` yazın ve bulunan özel bir komutu seçin, ardından bağımsız değişkenlerini sağlayın. diff --git a/docs/help/zh-Hans/conversations.md b/docs/help/zh-Hans/conversations.md index 5eedb3b0c0..5136b84e84 100644 --- a/docs/help/zh-Hans/conversations.md +++ b/docs/help/zh-Hans/conversations.md @@ -60,6 +60,12 @@ CodeNomad 将原生 OpenCode 会话呈现为对话,为委派工作提供层级 草稿是客户端工作状态,而非共享原生消息。启动恢复可以保留受支持的输入框状态,但不要将未发送草稿或附件视为备份,也不要假定它会出现在另一台设备。清除启动数据或关闭禁用了恢复策略的客户端之前,请保存重要文本;参阅[桌面](desktop.md)。 +## 从回复打开文件 {#open-files-from-replies} + +1. 智能体回复会用相对路径和绝对路径链接项目文件。 +2. 普通点击会在文件预览中打开链接的文件,内容从对话的工作树读取。 +3. 修饰键点击(Ctrl/Cmd、Shift、中键)以及指向会话工作树之外的链接保持普通链接行为。 + ## 命令和 Shell 模式 {#commands-shell} 1. 输入 `/` 并选择已发现的自定义命令,然后提供参数。 diff --git a/packages/ui/src/components/markdown-session-links.ts b/packages/ui/src/components/markdown-session-links.ts new file mode 100644 index 0000000000..1f037074bc --- /dev/null +++ b/packages/ui/src/components/markdown-session-links.ts @@ -0,0 +1,150 @@ +import { tGlobal } from "../lib/i18n" +import { previewsUnavailable, previewsAvailabilityResolved, getServerMeta } from "../lib/server-meta" +import { resolveProjectLinkPath } from "../lib/markdown-project-links" +import { showAlertDialog } from "../stores/alerts" +import { instances } from "../stores/instances" +import { openFilePreview } from "../stores/files-preview" +import { getWorktreeForDirectory } from "../stores/worktrees" +import { openSessionPreview, getSessionPreview, showSessionChat } from "../stores/session-previews" +import { sessions } from "../stores/session-state" +import { isLoopbackHttpUrl } from "./browser-frame-security" + +// One session-bound Markdown instance asks for the server meta; the answer +// decides whether loopback links may open the web preview on this client. +let loopbackPreviewMetaRequested = false + +/** Whether clicking a loopback link opens the web preview on this client. + * Availability must be known first: through Remote Control with previews off + * the default false would otherwise open a dead preview before the server + * meta answers. */ +const loopbackLinksOpenPreview = () => previewsAvailabilityResolved() && !previewsUnavailable() + +/** Asks for the server meta once until it answers, so loopback availability + * resolves without waiting for a click. */ +export function warmLoopbackPreviewMeta(instanceId: string | undefined, sessionId: string | undefined): void { + if (instanceId && sessionId && !previewsAvailabilityResolved() && !loopbackPreviewMetaRequested) { + loopbackPreviewMetaRequested = true + void getServerMeta().catch(() => { + loopbackPreviewMetaRequested = false + }) + } +} + +// A loopback link click opens the session preview on the instance owning +// the session; failures surface through the shared alert dialog. +const openLoopbackPreview = (instanceId: string, sessionId: string, url: string) => { + const folder = instances().get(instanceId)?.folder ?? "" + void openSessionPreview(sessionId, url, folder).catch((error) => { + showAlertDialog(tGlobal("sessionPreview.open.title"), { + title: tGlobal("sessionPreview.open.title"), + detail: error instanceof Error ? error.message : String(error), + variant: "error", + }) + }) +} + +export interface SessionProjectLink { + slug: string + directory: string + serviceDirectory?: string + path: string +} + +/** Where session links resolve: the session's worktree root, the session's own + * directory while the worktree inventory does not know it yet, or the instance + * folder. Reads the stores synchronously, so calling it inside an effect also + * tracks inventory loads for the decoration pass. */ +export interface SessionLinkBase { + slug: string + directory: string + serviceDirectory?: string + /** The root hrefs resolve against: the service namespace path when the + * worktree is known (notably WSL), else the directory itself. */ + base: string +} + +export function sessionLinkBase(instanceId: string, sessionId: string): SessionLinkBase | undefined { + // The session's own location: an independently moved child carries its own + // directory, never its parent's. + const sessionDirectory = sessions().get(instanceId)?.get(sessionId)?.location.directory + // Inventory by directory, never by a fallback slug: a populated inventory + // holding only the root checkout must not capture unmatched sessions. + const worktree = sessionDirectory !== undefined ? getWorktreeForDirectory(instanceId, sessionDirectory) : undefined + const directory = worktree?.directory + ?? sessionDirectory + ?? instances().get(instanceId)?.folder + if (!directory) return undefined + return { slug: worktree?.slug ?? "root", directory, serviceDirectory: worktree?.serviceDirectory, base: worktree?.serviceDirectory ?? directory } +} + +/** The file-reader target a link href resolves to inside the session's + * worktree, or undefined when it points anywhere else. */ +export function resolveSessionProjectLink(instanceId: string, sessionId: string, href: string): SessionProjectLink | undefined { + const root = sessionLinkBase(instanceId, sessionId) + if (root === undefined) return undefined + const path = resolveProjectLinkPath(href, root.base) + if (path === undefined) return undefined + return { slug: root.slug, directory: root.directory, serviceDirectory: root.serviceDirectory, path } +} + +/** The plain-click dispatch for session-bound markdown links: a loopback URL + * opens the session preview on the instance owning the session (browser-accessed + * frontends cannot reach the backend host's localhost), and a path inside the + * session's worktree opens the file reader. Returns whether the click was + * handled; modified clicks never reach this. */ +export function routeSessionLink(instanceId: string, sessionId: string, href: string): boolean { + if (loopbackLinksOpenPreview() && isLoopbackHttpUrl(href)) { + openLoopbackPreview(instanceId, sessionId, href) + return true + } + const resolution = resolveSessionProjectLink(instanceId, sessionId, href) + if (resolution) { + // A browser preview owning the central surface steps aside for the reader. + const instanceFolder = instances().get(instanceId)?.folder ?? "" + const preview = getSessionPreview(sessionId, instanceFolder) + if (preview) showSessionChat(preview.storageKey) + openFilePreview(instanceId, { kind: "workspace", sessionId, ...resolution }) + return true + } + return false +} + +/** The titles decorated links carry, computed from the reactive availability + * and locale signals: call this synchronously inside an effect so their + * changes re-run the decoration pass. */ +export function sessionLinkTitles(instanceId: string | undefined, sessionId: string | undefined): { preview: string; file: string } { + const sessionBound = Boolean(instanceId && sessionId) + return { + preview: sessionBound && loopbackLinksOpenPreview() ? tGlobal("markdown.link.previewOpens") : "", + file: sessionBound ? tGlobal("markdown.link.fileOpens") : "", + } +} + +/** Decorates exactly the links that intercept: loopback links while previews + * are known available, and links resolving inside the session's worktree; + * never over an author's own title attribute. Pure DOM pass: the caller + * computes `titles` and `base` inside its reactive effect, so availability, + * locale and inventory changes re-run it. */ +export function decorateSessionLinks(container: ParentNode, titles: { preview: string; file: string }, + base: SessionLinkBase | undefined): void { + const previewTitle = titles.preview + const fileTitle = Boolean(base) && titles.file + for (const anchor of container.querySelectorAll("a[href]")) { + const href = anchor.getAttribute("href") ?? "" + const loopback = Boolean(previewTitle) && isLoopbackHttpUrl(href) + const file = Boolean(fileTitle) && resolveProjectLinkPath(href, base!.base) !== undefined + const title = loopback ? previewTitle : file ? titles.file : "" + if (title) { + if (anchor.getAttribute("data-preview-link-title") === "true") { + // Our own tooltip follows locale changes; an author's title never does. + if (anchor.getAttribute("title") !== title) anchor.setAttribute("title", title) + } else if (!anchor.hasAttribute("title")) { + anchor.setAttribute("title", title) + anchor.setAttribute("data-preview-link-title", "true") + } + } else if (anchor.getAttribute("data-preview-link-title") === "true") { + anchor.removeAttribute("title") + anchor.removeAttribute("data-preview-link-title") + } + } +} diff --git a/packages/ui/src/components/markdown.tsx b/packages/ui/src/components/markdown.tsx index 1724a9c2f7..c1878d1484 100644 --- a/packages/ui/src/components/markdown.tsx +++ b/packages/ui/src/components/markdown.tsx @@ -13,21 +13,13 @@ import { } from "../lib/render-text-window" import type { RecordTextRevealTarget } from "../stores/message-v2/record-display-cache" import { HiddenTextNotice, createTextWindow } from "./hidden-text" -import { isLoopbackHttpUrl } from "./browser-frame-security" +import { decorateSessionLinks, routeSessionLink, sessionLinkBase, sessionLinkTitles, warmLoopbackPreviewMeta } from "./markdown-session-links" import { messageImageCandidates, resolveLocalImages } from "../lib/markdown-local-images" import { messageStoreBus } from "../stores/message-v2/bus" -import { openSessionPreview } from "../stores/session-previews" -import { instances } from "../stores/instances" -import { showAlertDialog } from "../stores/alerts" -import { previewsUnavailable, previewsAvailabilityResolved, getServerMeta } from "../lib/server-meta" import { useMarkdownMermaid } from "./markdown-mermaid" const log = getLogger("session") -// One session-bound Markdown instance asks for the server meta; the answer -// decides whether loopback links may open the web preview on this client. -let loopbackPreviewMetaRequested = false - type MarkdownModule = typeof import("../lib/markdown") interface ResolvedMarkdownSnapshot { @@ -141,31 +133,8 @@ interface MarkdownProps { export function Markdown(props: MarkdownProps) { const { t } = useI18n() - // A loopback link click opens the session preview on the instance owning - // the session; failures surface through the shared alert dialog. - const openLoopbackPreview = (instanceId: string, sessionId: string, url: string) => { - const folder = instances().get(instanceId)?.folder ?? "" - void openSessionPreview(sessionId, url, folder).catch((error) => { - showAlertDialog(t("sessionPreview.open.title"), { - title: t("sessionPreview.open.title"), - detail: error instanceof Error ? error.message : String(error), - variant: "error", - }) - }) - } - - // Whether clicking a loopback link opens the web preview on this client. - // Availability must be known first: through Remote Control with previews - // off the default false would otherwise open a dead preview before the - // server meta answers. Other callers (update checks, settings) usually - // resolve the meta earlier. - const loopbackLinksOpenPreview = () => previewsAvailabilityResolved() && !previewsUnavailable() - if (props.instanceId && props.sessionId && !previewsAvailabilityResolved() && !loopbackPreviewMetaRequested) { - loopbackPreviewMetaRequested = true - void getServerMeta().catch(() => { - loopbackPreviewMetaRequested = false - }) - } + // Loopback-link availability resolves without waiting for a click. + warmLoopbackPreviewMeta(props.instanceId, props.sessionId) const [html, setHtml] = createSignal("") // Whether `html` is the Markdown render rather than its plain-text fallback. The @@ -419,29 +388,19 @@ export function Markdown(props: MarkdownProps) { createEffect(() => { html() - // Decorate exactly the links that intercept: only session-bound loopback - // links while previews are known available, and never over an author's - // own title attribute. - const decorate = Boolean(props.instanceId && props.sessionId) && loopbackLinksOpenPreview() - const title = decorate ? t("markdown.link.previewOpens") : "" + // Decorate exactly the links that intercept (see markdown-session-links): + // loopback links while previews are known available, and project-file + // links; never over an author's own title attribute. The titles and the + // resolution base are read synchronously so availability, locale and + // worktree-inventory changes re-run this pass. + const sessionBound = Boolean(props.instanceId && props.sessionId) + const titles = sessionLinkTitles(props.instanceId, props.sessionId) + const base = sessionBound ? sessionLinkBase(props.instanceId!, props.sessionId!) : undefined Promise.resolve().then(() => { if (disposed || !containerRef) { return } - for (const anchor of containerRef.querySelectorAll("a[href]")) { - if (!isLoopbackHttpUrl(anchor.getAttribute("href") ?? "")) { - continue - } - if (title) { - if (!anchor.hasAttribute("title")) { - anchor.setAttribute("title", title) - anchor.setAttribute("data-preview-link-title", "true") - } - } else if (anchor.getAttribute("data-preview-link-title") === "true") { - anchor.removeAttribute("title") - anchor.removeAttribute("data-preview-link-title") - } - } + decorateSessionLinks(containerRef, titles, base) }) }) @@ -461,20 +420,18 @@ export function Markdown(props: MarkdownProps) { onMount(() => { const handleClick = async (event: Event) => { const target = event.target as HTMLElement - // A plain click on a loopback URL opens the session preview instead of - // a dead browser tab: browser-accessed frontends cannot reach the - // backend host's localhost. Modified clicks keep browser defaults, and - // clients without a working preview surface keep the link behavior. const anchor = target.closest("a[href]") as HTMLAnchorElement | null if (anchor && props.instanceId && props.sessionId) { const href = anchor.getAttribute("href") ?? "" const mouseEvent = event as MouseEvent // Firefox fires `click` for the middle button too; only a primary - // left click without modifiers opens the preview. + // left click without modifiers routes to an app surface. const plainClick = mouseEvent.button === 0 && !mouseEvent.ctrlKey && !mouseEvent.metaKey && !mouseEvent.shiftKey && !mouseEvent.altKey - if (plainClick && loopbackLinksOpenPreview() && isLoopbackHttpUrl(href)) { + // A plain click on a loopback URL opens the session preview, and one + // on a path inside the session's worktree opens the file reader; + // modified clicks keep browser defaults (see markdown-session-links). + if (plainClick && routeSessionLink(props.instanceId, props.sessionId, href)) { event.preventDefault() - openLoopbackPreview(props.instanceId, props.sessionId, href) return } } diff --git a/packages/ui/src/lib/i18n/messages/de/markdown.ts b/packages/ui/src/lib/i18n/messages/de/markdown.ts index ed4b23c1fc..3de71cc46e 100644 --- a/packages/ui/src/lib/i18n/messages/de/markdown.ts +++ b/packages/ui/src/lib/i18n/messages/de/markdown.ts @@ -12,4 +12,5 @@ export const markdownMessages = { "markdown.copy": "Kopieren", "markdown.link.previewOpens": "Wird in der Web-Vorschau geöffnet. Strg+Klick (⌘-Klick auf macOS) oder Mittelklick öffnet ihn im Browser.", + "markdown.link.fileOpens": "Wird in der Dateivorschau geöffnet. Strg+Klick (⌘-Klick auf macOS) oder Mittelklick öffnet ihn im Browser.", } as const diff --git a/packages/ui/src/lib/i18n/messages/en/markdown.ts b/packages/ui/src/lib/i18n/messages/en/markdown.ts index a292996d02..af1cc72222 100644 --- a/packages/ui/src/lib/i18n/messages/en/markdown.ts +++ b/packages/ui/src/lib/i18n/messages/en/markdown.ts @@ -12,4 +12,5 @@ export const markdownMessages = { "markdown.copy": "Copy", "markdown.link.previewOpens": "Opens in the web preview. Ctrl+click (⌘-click on macOS) or middle-click opens it in your browser.", + "markdown.link.fileOpens": "Opens in the file preview. Ctrl+click (⌘-click on macOS) or middle-click opens it in your browser.", } as const diff --git a/packages/ui/src/lib/i18n/messages/es/markdown.ts b/packages/ui/src/lib/i18n/messages/es/markdown.ts index 7aa5c34665..d4ef75c76e 100644 --- a/packages/ui/src/lib/i18n/messages/es/markdown.ts +++ b/packages/ui/src/lib/i18n/messages/es/markdown.ts @@ -12,4 +12,5 @@ export const markdownMessages = { "markdown.copy": "Copiar", "markdown.link.previewOpens": "Se abre en la vista previa web. Ctrl+clic (⌘-clic en macOS) o clic central lo abre en tu navegador.", + "markdown.link.fileOpens": "Se abre en la vista previa del archivo. Ctrl+clic (⌘-clic en macOS) o clic central lo abre en tu navegador.", } as const diff --git a/packages/ui/src/lib/i18n/messages/fr/markdown.ts b/packages/ui/src/lib/i18n/messages/fr/markdown.ts index 4661fcc038..a1aee6808b 100644 --- a/packages/ui/src/lib/i18n/messages/fr/markdown.ts +++ b/packages/ui/src/lib/i18n/messages/fr/markdown.ts @@ -12,4 +12,5 @@ export const markdownMessages = { "markdown.copy": "Copier", "markdown.link.previewOpens": "S'ouvre dans l'aperçu web. Ctrl+clic (⌘-clic sur macOS) ou clic milieu l'ouvre dans votre navigateur.", + "markdown.link.fileOpens": "S'ouvre dans l'aperçu du fichier. Ctrl+clic (⌘-clic sur macOS) ou clic milieu l'ouvre dans votre navigateur.", } as const diff --git a/packages/ui/src/lib/i18n/messages/he/markdown.ts b/packages/ui/src/lib/i18n/messages/he/markdown.ts index aa362fc26b..693b1c49f5 100644 --- a/packages/ui/src/lib/i18n/messages/he/markdown.ts +++ b/packages/ui/src/lib/i18n/messages/he/markdown.ts @@ -12,4 +12,5 @@ export const markdownMessages = { "markdown.copy": "העתק", "markdown.link.previewOpens": "נפתח בתצוגה המקדימה באינטרנט. Ctrl+לחיצה (⌘+לחיצה ב-macOS) או לחיצה אמצעית פותחת אותו בדפדפן.", + "markdown.link.fileOpens": "נפתח בתצוגה המקדימה של הקובץ. Ctrl+לחיצה (⌘-לחיצה ב-macOS) או לחיצה אמצעית פותחת אותו בדפדפן.", } as const diff --git a/packages/ui/src/lib/i18n/messages/ja/markdown.ts b/packages/ui/src/lib/i18n/messages/ja/markdown.ts index ad451da6b2..63b0497920 100644 --- a/packages/ui/src/lib/i18n/messages/ja/markdown.ts +++ b/packages/ui/src/lib/i18n/messages/ja/markdown.ts @@ -12,4 +12,5 @@ export const markdownMessages = { "markdown.copy": "コピー", "markdown.link.previewOpens": "Web プレビューで開きます。Ctrl+クリック(macOS では ⌘+クリック)または中クリックでブラウザーで開きます。", + "markdown.link.fileOpens": "ファイルのプレビューで開きます。Ctrl+クリック(macOS では ⌘+クリック)または中クリックでブラウザーで開きます。", } as const diff --git a/packages/ui/src/lib/i18n/messages/ne/markdown.ts b/packages/ui/src/lib/i18n/messages/ne/markdown.ts index a10318546d..8a25b7ae3e 100644 --- a/packages/ui/src/lib/i18n/messages/ne/markdown.ts +++ b/packages/ui/src/lib/i18n/messages/ne/markdown.ts @@ -12,4 +12,5 @@ export const markdownMessages = { "markdown.copy": "प्रतिलिपि गर्नुहोस्", "markdown.link.previewOpens": "वेब पूर्वावलोकनमा खुल्छ। Ctrl+क्लिक (macOS मा ⌘+क्लिक) वा मध्य-क्लिकले यसलाई browser मा खोल्छ।", + "markdown.link.fileOpens": "फाइल पूर्वावलोकनमा खुल्छ। Ctrl+क्लिक (macOS मा ⌘+क्लिक) वा मध्य-क्लिकले यसलाई browser मा खोल्छ।", } as const diff --git a/packages/ui/src/lib/i18n/messages/ru/markdown.ts b/packages/ui/src/lib/i18n/messages/ru/markdown.ts index 12abfc4833..dcdd43341a 100644 --- a/packages/ui/src/lib/i18n/messages/ru/markdown.ts +++ b/packages/ui/src/lib/i18n/messages/ru/markdown.ts @@ -12,4 +12,5 @@ export const markdownMessages = { "markdown.copy": "Копировать", "markdown.link.previewOpens": "Открывается в веб-предпросмотре. Ctrl+щелчок (⌘-щелчок на macOS) или щелчок средней кнопкой открывает ссылку в браузере.", + "markdown.link.fileOpens": "Открывается в просмотре файла. Ctrl+щелчок (⌘-щелчок на macOS) или щелчок средней кнопкой открывает ссылку в браузере.", } as const diff --git a/packages/ui/src/lib/i18n/messages/tr/markdown.ts b/packages/ui/src/lib/i18n/messages/tr/markdown.ts index 05a9e6fc54..abd5c702d6 100644 --- a/packages/ui/src/lib/i18n/messages/tr/markdown.ts +++ b/packages/ui/src/lib/i18n/messages/tr/markdown.ts @@ -11,4 +11,5 @@ export const markdownMessages = { "markdown.copy": "Kopyala", "markdown.link.previewOpens": "Web önizlemede açılır. Ctrl+tıklama (macOS'ta ⌘+tıklama) veya orta tıklama bunu tarayıcınızda açar.", + "markdown.link.fileOpens": "Dosya önizlemesinde açılır. Ctrl+tıklama (macOS'ta ⌘+tıklama) veya orta tıklama bunu tarayıcınızda açar.", } as const diff --git a/packages/ui/src/lib/i18n/messages/zh-Hans/markdown.ts b/packages/ui/src/lib/i18n/messages/zh-Hans/markdown.ts index 4cac2ba084..49ce775e34 100644 --- a/packages/ui/src/lib/i18n/messages/zh-Hans/markdown.ts +++ b/packages/ui/src/lib/i18n/messages/zh-Hans/markdown.ts @@ -12,4 +12,5 @@ export const markdownMessages = { "markdown.copy": "复制", "markdown.link.previewOpens": "在网页预览中打开。Ctrl+点击(macOS 上为 ⌘+点击)或鼠标中键点击可在浏览器中打开。", + "markdown.link.fileOpens": "在文件预览中打开。Ctrl+点击(macOS 上为 ⌘+点击)或鼠标中键点击可在浏览器中打开。", } as const diff --git a/packages/ui/src/lib/markdown-project-links.test.ts b/packages/ui/src/lib/markdown-project-links.test.ts new file mode 100644 index 0000000000..a633ff0ef9 --- /dev/null +++ b/packages/ui/src/lib/markdown-project-links.test.ts @@ -0,0 +1,44 @@ +import assert from "node:assert/strict" +import { describe, it } from "node:test" + +import { projectLinkPath, resolveProjectLinkPath } from "./markdown-project-links" + +describe("project-file link paths", () => { + it("classifies project-file link candidates", () => { + assert.equal(projectLinkPath("./README.md"), "README.md") + assert.equal(projectLinkPath("README.md"), "README.md") + assert.equal(projectLinkPath("docs/guide.md#intro"), "docs/guide.md") + assert.equal(projectLinkPath("docs\\guide.md"), "docs/guide.md") + assert.equal(projectLinkPath("src/a%20b.md"), "src/a b.md") + assert.equal(projectLinkPath("C:\\Users\\me\\report.md"), "C:/Users/me/report.md") + assert.equal(projectLinkPath("/home/me/repo/src/app.ts"), "/home/me/repo/src/app.ts") + // Percent-encoded schemes and scheme-relative values must not survive decoding. + assert.equal(projectLinkPath("%2F%2Fcdn.example.com/a.png"), undefined) + assert.equal(projectLinkPath("javascript%3Aalert(1)"), undefined) + assert.equal(projectLinkPath("data%3Atext/plain,x"), undefined) + assert.equal(projectLinkPath("C%3A/Users/me/report.md"), "C:/Users/me/report.md") + for (const source of ["", "#", "#section", "https://example.com/x", "http://x", "mailto:a@b.c", + "javascript:alert(1)", "data:text/plain,x", "//cdn.example.com/a.png", "\\\\server\\share\\x.png"]) { + assert.equal(projectLinkPath(source), undefined, source) + } + }) + + it("resolves containment and rejects escapes", () => { + const base = "/home/me/repo" + assert.equal(resolveProjectLinkPath("./README.md", base), "README.md") + assert.equal(resolveProjectLinkPath("docs/guide.md#intro", base), "docs/guide.md") + assert.equal(resolveProjectLinkPath("/home/me/repo/src/app.ts", base), "src/app.ts") + assert.equal(resolveProjectLinkPath("/etc/passwd", base), undefined) + assert.equal(resolveProjectLinkPath("../outside.md", base), undefined) + assert.equal(resolveProjectLinkPath("%2e%2e/outside.md", base), undefined) + assert.equal(resolveProjectLinkPath("a/../b.md", base), "b.md") + assert.equal(resolveProjectLinkPath("./", base), undefined) + }) + + it("resolves Windows paths case-insensitively", () => { + const base = "C:/Users/me/repo" + assert.equal(resolveProjectLinkPath("src\\app.ts", base), "src/app.ts") + assert.equal(resolveProjectLinkPath("c:/users/ME/repo/src/app.ts", base), "src/app.ts") + assert.equal(resolveProjectLinkPath("C:/Users/other/x.md", base), undefined) + }) +}) diff --git a/packages/ui/src/lib/markdown-project-links.ts b/packages/ui/src/lib/markdown-project-links.ts new file mode 100644 index 0000000000..2f0a3ab8d9 --- /dev/null +++ b/packages/ui/src/lib/markdown-project-links.ts @@ -0,0 +1,71 @@ +/** Classification and lexical resolution for agent-reply links that point at + * files inside the session's worktree. Pure helpers only: the store-backed + * routing lives in components/markdown-session-links.ts. */ + +const SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*:/ +const WINDOWS_DRIVE = /^[A-Za-z]:[\\/]/ +const WINDOWS_ROOT = /^[A-Za-z]:\// + +/** A project-file link candidate's normalized path, or undefined when the href + * cannot point at a workspace file (URL schemes, scheme-relative and UNC + * values, pure fragments, empty). */ +export function projectLinkPath(href: string): string | undefined { + const trimmed = href.trim() + if (!trimmed || trimmed.startsWith("#")) return undefined + const fragment = trimmed.indexOf("#") + const withoutFragment = fragment >= 0 ? trimmed.slice(0, fragment) : trimmed + // A Windows drive letter (`C:\…`, `C:/…`) is a path, not a scheme. + if (!WINDOWS_DRIVE.test(withoutFragment) && SCHEME.test(withoutFragment)) return undefined + let path = withoutFragment.replace(/\\/g, "/") + if (path.startsWith("//")) return undefined + try { + const decoded = decodeURIComponent(path) + if (decoded !== path) path = decoded + } catch { + // A literal percent sign is a legal file name character; keep it. + } + // Decoding can reveal a scheme, a scheme-relative or a UNC value the literal + // form hid; such a value is a URL, not a workspace file path. + if (path.startsWith("//")) return undefined + if (!WINDOWS_DRIVE.test(path) && SCHEME.test(path)) return undefined + path = path.replace(/^(?:\.\/)+/, "").replace(/\/+$/, "") + return path || undefined +} + +const normalizeSegments = (path: string, rooted: boolean): string => { + const stack: string[] = [] + for (const segment of path.split("/")) { + if (!segment || segment === ".") continue + if (segment === "..") { + if (stack.length) stack.pop() + continue + } + stack.push(segment) + } + return (rooted ? "/" : "") + stack.join("/") +} + +const normalizeBase = (directory: string): string => directory.replace(/\\/g, "/").replace(/\/+$/, "") + +/** The worktree-relative path (forward slashes, no leading `./`) when the href + * resolves inside `baseDirectory`, else undefined. Lexical resolution only; + * `..` never fabricates containment because it is re-checked against the base. */ +export function resolveProjectLinkPath(href: string, baseDirectory: string): string | undefined { + const base = normalizeBase(baseDirectory) + if (!base) return undefined + const path = projectLinkPath(href) + if (path === undefined) return undefined + const absolute = path.startsWith("/") || WINDOWS_ROOT.test(path) + const resolved = absolute + ? normalizeSegments(path, path.startsWith("/")) + : normalizeSegments(`${base}/${path}`, base.startsWith("/")) + const comparable = WINDOWS_ROOT.test(base) + ? (value: string) => value.toLowerCase() + : (value: string) => value + const resolvedKey = comparable(resolved) + const baseKey = comparable(base) + // The root itself is not a file target. + if (resolvedKey === baseKey) return undefined + if (!resolvedKey.startsWith(`${baseKey}/`)) return undefined + return resolved.slice(base.length + 1) +} diff --git a/packages/ui/tests/browser/fixtures/markdown-session-links.tsx b/packages/ui/tests/browser/fixtures/markdown-session-links.tsx new file mode 100644 index 0000000000..bd004eb22d --- /dev/null +++ b/packages/ui/tests/browser/fixtures/markdown-session-links.tsx @@ -0,0 +1,85 @@ +// The real Markdown component with a session context: plain clicks on links +// that point inside the session's worktree must open the file reader, loopback +// links must keep opening the session preview, and everything else keeps +// default link behavior. +import { render } from "solid-js/web" +import { Markdown } from "../../../src/components/markdown" +import { ConfigProvider } from "../../../src/stores/preferences" +import { I18nProvider, tGlobal } from "../../../src/lib/i18n" +import { addInstance } from "../../../src/stores/instances" +import { setSessions } from "../../../src/stores/session-state" +import type { Session } from "../../../src/types/session" +import { getFilePreview } from "../../../src/stores/files-preview" +import { serverApi } from "../../../src/lib/api-client" +import { sdkManager } from "../../../src/lib/sdk-manager" +import { getServerMeta } from "../../../src/lib/server-meta" +import { ensureWorktreesLoaded } from "../../../src/stores/worktrees" + +const id = "markdown-session-links", scope = "/fixture-root" +const client = sdkManager.createClient(id, `/workspaces/${id}/instance`, () => true) +const createPreviewCalls: Array<{ sessionId: string; url: string }> = [] +serverApi.createPreview = async (input: { sessionId: string; url: string }) => { + createPreviewCalls.push({ sessionId: input.sessionId, url: input.url }) + return { token: "t", targetUrl: input.url, proxyUrl: "/preview" } as never +} +serverApi.fetchServerMeta = async () => ({ previewsUnavailable: false }) as never +addInstance({ id, folder: scope, port: 0, pid: 0, proxyPath: `/workspaces/${id}/instance`, status: "ready", client, + metadata: { project: { id: "project", directory: scope, canonical: scope } } }) +const session = { id: "ses_link", instanceId: id, parentId: null, title: "Links", agent: "build", + model: { providerId: "private", modelId: "private" }, projectID: "project", cost: 0, + tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, status: "idle", runtimeStatusKnown: true, + location: { directory: scope }, time: { created: 1, updated: 1 } } satisfies Session +// Lives in a worktree the (empty) inventory does not know: links must resolve +// against this session's directory, not the instance folder. +const subSession = { ...session, id: "ses_sub", title: "Sub", location: { directory: "/fixture-root/wt-a" } } satisfies Session +// Independently moved child: its own location wins, never the parent's. +const childSession = { ...session, id: "ses_child", parentId: "ses_link", title: "Child", location: { directory: "/fixture-root/wt-b" } } satisfies Session +setSessions(previous => new Map(previous).set(id, new Map( + [[session.id, session], [subSession.id, subSession], [childSession.id, childSession]]))) +// A populated inventory holding only the root checkout must not capture +// sessions whose directories it does not contain. +if (new URLSearchParams(location.search).has("inventory")) { + serverApi.fetchWorktrees = async () => ({ gitAvailable: true, worktrees: [ + { slug: "root", kind: "root" as const, directory: scope }] }) as never + await ensureWorktreesLoaded(id) +} +await getServerMeta() + +let renderCount = 0 +const clicks: Array<{ href: string; prevented: boolean }> = [] +// Registered before render so it sits above the component's own listener: +// by the time this bubble listener runs, the component has claimed or not. +window.addEventListener("click", (event) => { + const anchor = (event.target as Element | null)?.closest?.("a") + clicks.push({ href: anchor?.getAttribute("href") ?? "", prevented: event.defaultPrevented }) + event.preventDefault() +}) + +const dispose = render(() => +
+
+ { renderCount++ }} /> +
+
+ +
+
+ +
+
+
, document.getElementById("root")!) + +;(window as any).fixture = { + target: () => getFilePreview(id)?.path ?? null, + targetFull: () => { const target = getFilePreview(id); return target ? { path: target.path, directory: target.directory } : null }, + previews: () => [...createPreviewCalls], + clicks: () => [...clicks], + rendered: () => renderCount, + label: (key: string) => tGlobal(key), + title: (selector: string) => document.querySelector(selector)?.getAttribute("title") ?? null, + dispose, +} diff --git a/packages/ui/tests/browser/markdown-session-links.test.ts b/packages/ui/tests/browser/markdown-session-links.test.ts new file mode 100644 index 0000000000..36cf649b82 --- /dev/null +++ b/packages/ui/tests/browser/markdown-session-links.test.ts @@ -0,0 +1,114 @@ +import assert from "node:assert/strict" +import { after, before, test } from "node:test" +import { borrowFixture } from "./fixture-borrow" +import { armFixtureNavigationBudget } from "./fixture-navigation-budget" +import { chromium, type Browser } from "playwright" + +let browser: Browser, url: string +before(async () => { + const fixture = await borrowFixture({ + name: "markdown-session-links", + routes: [ + { path: "/markdown-session-links", html: "
" }, + ], + }) + url = fixture.url + browser = await chromium.launch({ executablePath: process.env.CODENOMAD_BROWSER_PATH || undefined }) + armFixtureNavigationBudget(browser) +}) +after(async () => { await browser?.close() }) + +test("session links route to the preview and the file reader", { timeout: 60_000 }, async () => { + const page = await browser.newPage() + const errors: string[] = [] + page.on("pageerror", error => errors.push(error.message)) + try { + await page.goto(url) + await page.waitForFunction(() => Boolean((window as any).fixture)) + await page.waitForFunction(() => (window as any).fixture.rendered() > 0) + + // Project-file routing: each plain click opens the file reader on the resolved path. + await page.click('#main-root a[href="./README.md"]') + assert.equal(await page.evaluate(() => (window as any).fixture.target()), "README.md") + await page.click('#main-root a[href="docs/guide.md#intro"]') + assert.equal(await page.evaluate(() => (window as any).fixture.target()), "docs/guide.md") + await page.click('#main-root a[href="/fixture-root/src/app.ts"]') + assert.equal(await page.evaluate(() => (window as any).fixture.target()), "src/app.ts") + + // A session living in a not-yet-inventoried worktree resolves against its + // own directory, never the instance folder (the repository root). + await page.click('#sub-root a[href="./README.md"]') + assert.deepEqual(await page.evaluate(() => (window as any).fixture.targetFull()), + { path: "README.md", directory: "/fixture-root/wt-a" }) + + // An independently moved child keeps its own directory, never the parent's. + await page.click('#child-root a[href="./README.md"]') + assert.deepEqual(await page.evaluate(() => (window as any).fixture.targetFull()), + { path: "README.md", directory: "/fixture-root/wt-b" }) + + // Loopback routing: a plain click opens the session preview instead. + await page.click('#main-root a[href="http://localhost:3000/x"]') + assert.deepEqual(await page.evaluate(() => (window as any).fixture.previews()), + [{ sessionId: "ses_link", url: "http://localhost:3000/x" }]) + const loopbackClick = await page.evaluate(() => (window as any).fixture.clicks().at(-1)) + assert.equal(loopbackClick.href, "http://localhost:3000/x") + assert.equal(loopbackClick.prevented, true) + + // Not intercepted: escapes, external URLs and modified clicks keep default behavior. + const clicksBefore = await page.evaluate(() => (window as any).fixture.clicks().length) + const previewsBefore = await page.evaluate(() => (window as any).fixture.previews().length) + await page.click('#main-root a[href="../outside.md"]') + await page.click('#main-root a[href="https://example.com/x"]') + await page.click('#main-root a[href="./README.md"]', { modifiers: ["Control"] }) + await page.click('#main-root a[href="http://localhost:3000/x"]', { modifiers: ["Control"] }) + await page.waitForFunction(count => (window as any).fixture.clicks().length === count, clicksBefore + 4) + assert.deepEqual(await page.evaluate(() => (window as any).fixture.targetFull()), + { path: "README.md", directory: "/fixture-root/wt-b" }) + assert.equal(await page.evaluate(() => (window as any).fixture.previews().length), previewsBefore) + for (const click of await page.evaluate(() => (window as any).fixture.clicks().slice(-4))) { + assert.equal(click.prevented, false, click.href) + } + + // Decoration: intercepted anchors carry a hint; untouched anchors keep none. + await page.waitForFunction(() => { + const loop = document.querySelector('a[href="http://localhost:3000/x"]')?.getAttribute("title") + const file = document.querySelector('a[href="./README.md"]')?.getAttribute("title") + return Boolean(loop && file) + }) + assert.equal(await page.evaluate(() => (window as any).fixture.title('a[href="http://localhost:3000/x"]')), + await page.evaluate(() => (window as any).fixture.label("markdown.link.previewOpens"))) + assert.equal(await page.evaluate(() => (window as any).fixture.title('a[href="./README.md"]')), + await page.evaluate(() => (window as any).fixture.label("markdown.link.fileOpens"))) + assert.equal(await page.evaluate(() => (window as any).fixture.title('a[href="https://example.com/x"]')), null) + } finally { + await page.close() + } + assert.deepEqual(errors, []) +}) + +test("a populated but unmatched inventory never captures session links", async () => { + const page = await browser.newPage() + const errors: string[] = [] + page.on("pageerror", error => errors.push(error.message)) + try { + await page.goto(`${url}?inventory=1`) + await page.waitForFunction(() => Boolean((window as any).fixture)) + await page.waitForFunction(() => (window as any).fixture.rendered() > 0) + + // The root inventory entry exists but holds neither session's directory. + await page.click('#sub-root a[href="./README.md"]') + assert.deepEqual(await page.evaluate(() => (window as any).fixture.targetFull()), + { path: "README.md", directory: "/fixture-root/wt-a" }) + await page.click('#child-root a[href="./README.md"]') + assert.deepEqual(await page.evaluate(() => (window as any).fixture.targetFull()), + { path: "README.md", directory: "/fixture-root/wt-b" }) + + // A session the inventory does contain still resolves through its entry. + await page.click('#main-root a[href="./README.md"]') + assert.deepEqual(await page.evaluate(() => (window as any).fixture.targetFull()), + { path: "README.md", directory: "/fixture-root" }) + } finally { + await page.close() + } + assert.deepEqual(errors, []) +}) From 7f0dec7722762b510edcda1217910ba4b899a345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Andr=C3=A9?= Date: Fri, 13 Nov 2026 17:38:29 +0100 Subject: [PATCH 03/25] feat(opencode): require OpenCode 2.3.0 and adapt subagent, Code Mode and shell results (#1491) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OpenCode 2.3 runs every subagent in the background: the call returns at once (`metadata.status: "running"`) and the child reports to its parent through synthetic `` messages, one per idle period, tagged `running` while background work remains. Runtime contracts on `latest` failed for every PR since 2.3.0 because two native fixtures assumed a foreground subagent, and the subagent card showed the model-facing "working in the background" instruction instead of the child's result. OpenCode 2.3.0 becomes the minimum and recommended runtime, so CodeNomad maintains a single subagent delivery model. Daemons below it are refused with `native_contract`. The client, schema and plugin pins move to 2.3.0 with the `effect` 4.1.0 they require; the lockfile is regenerated with the CI's npm so root overrides hold. Docs, the architecture skill, README, CONTRIBUTING and the install, OpenCode, server and troubleshooting help in ten languages state the new minimum. - Native fixtures (missions-trajectory, subagent-nesting) require the launch acknowledgement, an intermediate running report (metadata still `completed`), the final report and lasting quiescence without late wakes. Wayfinder and compare read briefs, run outputs and the judge artifact from the final report. - The subagent card shows the latest report delivered to that call (after its execution start, before the next continuation of the same child; a call continued before any report joins the next reporting period) with a running/completed/error indicator. One reference-only index per session revision serves every card; report bodies stay in the message store. - Code Mode's compact JSON object/array results are displayed indented within size and depth bounds, keeping Warnings/Logs; copy keeps the native text. - An interrupted shell call shows its output so far as output and only the notice under the error label, through an optional `getErrorText` hook. Five independent review passes closed listing-order, continuation, JSON depth, fixture timing, cache staleness, execution-start boundary, joined-period, retention and lockfile-override findings and ended with zero findings. CI on the exact head: 26 jobs passed, including runtime contracts at minimum and latest (2.3.0), OpenCode compatibility and native pruning on Windows, Ubuntu and macOS, four browser shards and all desktop builds. Locally: 30/30 native fixtures against an isolated 2.3.0 CLI, the full server suite under Node 24, and the pruning fixtures on the rebuilt bundle bytes; new unit and browser tests each fail without their change. --- .github/workflows/pr-build.yml | 3 + .../codenomad-architecture-guide/SKILL.md | 4 +- .../references/architecture-overview.md | 2 +- .../references/sdk-api-reference.md | 4 +- .../references/sdk-critical-behaviors.md | 4 +- CONTRIBUTING.md | 2 +- README.md | 4 +- dev-docs/OPENCODE_COMPATIBILITY.md | 10 +- dev-docs/OPENCODE_INTEGRATIONS.md | 4 +- dev-docs/TRANSCRIPT.md | 4 +- docs/help/de/install.md | 2 +- docs/help/de/opencode.md | 4 +- docs/help/de/server.md | 2 +- docs/help/de/troubleshooting.md | 2 +- docs/help/en/install.md | 2 +- docs/help/en/opencode.md | 4 +- docs/help/en/server.md | 2 +- docs/help/en/troubleshooting.md | 2 +- docs/help/es/install.md | 2 +- docs/help/es/opencode.md | 4 +- docs/help/es/server.md | 2 +- docs/help/es/troubleshooting.md | 2 +- docs/help/fr/install.md | 2 +- docs/help/fr/opencode.md | 4 +- docs/help/fr/server.md | 2 +- docs/help/fr/troubleshooting.md | 2 +- docs/help/he/install.md | 2 +- docs/help/he/opencode.md | 4 +- docs/help/he/server.md | 2 +- docs/help/he/troubleshooting.md | 2 +- docs/help/ja/install.md | 2 +- docs/help/ja/opencode.md | 4 +- docs/help/ja/server.md | 2 +- docs/help/ja/troubleshooting.md | 2 +- docs/help/ne/install.md | 2 +- docs/help/ne/opencode.md | 4 +- docs/help/ne/server.md | 2 +- docs/help/ne/troubleshooting.md | 2 +- docs/help/ru/install.md | 2 +- docs/help/ru/opencode.md | 4 +- docs/help/ru/server.md | 2 +- docs/help/ru/troubleshooting.md | 2 +- docs/help/tr/install.md | 2 +- docs/help/tr/opencode.md | 4 +- docs/help/tr/server.md | 2 +- docs/help/tr/troubleshooting.md | 2 +- docs/help/zh-Hans/install.md | 2 +- docs/help/zh-Hans/opencode.md | 4 +- docs/help/zh-Hans/server.md | 2 +- docs/help/zh-Hans/troubleshooting.md | 2 +- package-lock.json | 1244 ++++++----------- packages/server/package.json | 8 +- .../legacy-installation.test.ts | 40 +- .../opencode-update/native-upgrade.test.ts | 8 +- .../src/opencode-update/service.test.ts | 29 +- .../opencode-update/setup-reconnect.test.ts | 16 +- .../shared-installation.test.ts | 16 +- .../opencode/compatibility/negotiate.test.ts | 4 +- .../src/opencode/compatibility/runtime.ts | 2 +- .../opencode/compatibility/transport.test.ts | 10 +- .../src/opencode/runtime-support.test.ts | 14 +- .../server/src/opencode/runtime-support.ts | 9 +- .../src/opencode/session-pruning/package.json | 4 +- .../__tests__/instance-proxy-legacy.test.ts | 4 +- .../server/routes/pending-requests.test.ts | 2 +- .../src/workspaces/instance-events.test.ts | 10 +- packages/ui/package.json | 2 +- packages/ui/src/components/tool-call.tsx | 7 +- .../tool-call/renderers/bash-data.test.ts | 34 + .../tool-call/renderers/bash-data.ts | 25 + .../components/tool-call/renderers/bash.tsx | 28 +- .../tool-call/renderers/execute-data.test.ts | 36 + .../tool-call/renderers/execute-data.ts | 40 + .../tool-call/renderers/execute.tsx | 12 +- .../renderers/subagent-report.test.ts | 125 ++ .../tool-call/renderers/subagent-report.ts | 137 ++ .../components/tool-call/renderers/task.tsx | 66 +- packages/ui/src/components/tool-call/types.ts | 2 + .../src/stores/legacy-runtime-cache.test.ts | 2 +- .../ui/tests/browser/fixtures/task-copy.tsx | 34 + .../ui/tests/browser/fixtures/tool-images.tsx | 16 + packages/ui/tests/browser/task-copy.test.ts | 42 + packages/ui/tests/browser/tool-images.test.ts | 21 + .../test-integrations-attachments-native.mjs | 3 +- .../test-integrations-host-install-native.mjs | 5 +- scripts/test-missions-native-trajectory.mjs | 114 +- scripts/test-subagent-nesting-native.mjs | 32 +- 87 files changed, 1346 insertions(+), 998 deletions(-) create mode 100644 packages/ui/src/components/tool-call/renderers/bash-data.test.ts create mode 100644 packages/ui/src/components/tool-call/renderers/bash-data.ts create mode 100644 packages/ui/src/components/tool-call/renderers/execute-data.test.ts create mode 100644 packages/ui/src/components/tool-call/renderers/subagent-report.test.ts create mode 100644 packages/ui/src/components/tool-call/renderers/subagent-report.ts diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 225b43fdb3..60bc75e5e3 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -565,6 +565,9 @@ jobs: packages/ui/src/components/tool-call/diff-payload.test.ts packages/ui/src/components/tool-call/renderers/edit.test.ts packages/ui/src/components/tool-call/renderers/task-title.test.ts + packages/ui/src/components/tool-call/renderers/subagent-report.test.ts + packages/ui/src/components/tool-call/renderers/execute-data.test.ts + packages/ui/src/components/tool-call/renderers/bash-data.test.ts packages/ui/src/components/prompt-input/usePromptState.test.ts packages/ui/src/components/session/provider-usage-panel.test.ts packages/ui/src/lib/hooks/use-active-session-message-load.test.ts diff --git a/.opencode/skills/codenomad-architecture-guide/SKILL.md b/.opencode/skills/codenomad-architecture-guide/SKILL.md index afd950a4cc..cca4410fce 100644 --- a/.opencode/skills/codenomad-architecture-guide/SKILL.md +++ b/.opencode/skills/codenomad-architecture-guide/SKILL.md @@ -17,9 +17,9 @@ description: | ## Native OpenCode V2 Baseline -- Runtime requirements live in `opencode/runtime-support.ts`: OpenCode 2.2.3 is the minimum, required by the `experimental_image_generate` image tool contract (upstream #60258) that the Images gallery, Design agent and Images settings consume; it also provides Code Mode's JavaScript job ordering (`scripts/test-codemode-jobs-native.mjs`) and the `native`/`metadata.keepID` replay contract consumed by the pinned client reducer; 2.2.7 is the recommendation. Each blocking requirement needs demonstrated API/behavior evidence; distinguish technically incompatible, recommended/tested and unverified versions. Shared-daemon restart is explicit and uses the native-parent launch bridge. See `dev-docs/OPENCODE_COMPATIBILITY.md` for the version boundaries and `dev-docs/OPENCODE_RUNTIME_SETUP.md` for setup, installation and admission. +- Runtime requirements live in `opencode/runtime-support.ts`: OpenCode 2.3.0 is the minimum and the recommendation, required by the background subagent report contract (every subagent call returns at once and the child reports through synthetic `` messages) and by the `experimental_image_generate` image tool contract (upstream #60258) that the Images gallery, Design agent and Images settings consume; it also provides Code Mode's JavaScript job ordering (`scripts/test-codemode-jobs-native.mjs`) and the `native`/`metadata.keepID` replay contract consumed by the pinned client reducer. Each blocking requirement needs demonstrated API/behavior evidence; distinguish technically incompatible, recommended/tested and unverified versions. Shared-daemon restart is explicit and uses the native-parent launch bridge. See `dev-docs/OPENCODE_COMPATIBILITY.md` for the version boundaries and `dev-docs/OPENCODE_RUNTIME_SETUP.md` for setup, installation and admission. -- Server and UI pin the official `@opencode/client@2.2.3` together; native plugins pin `@opencode/plugin@2.2.3` for authoring and use `packages/server/scripts/native-plugin-build.mjs` to keep Effect/public SDK modules external. The daemon supplies their runtime instances. The canonical server-info client is `server.info()`, adapted to the authenticated discovered route. Review official V2 docs, installed declarations, generated wire paths and native integration tests when upgrading. Never infer a minimum from the latest publication or dependency pin alone. Update `dev-docs/OPENCODE_COMPATIBILITY.md` in place and retain detailed evidence in PR/CI logs. The runtime CLI is managed independently. +- Server and UI pin the official `@opencode/client@2.3.0` together; native plugins pin `@opencode/plugin@2.3.0` for authoring and use `packages/server/scripts/native-plugin-build.mjs` to keep Effect/public SDK modules external. The daemon supplies their runtime instances. The canonical server-info client is `server.info()`, adapted to the authenticated discovered route. Review official V2 docs, installed declarations, generated wire paths and native integration tests when upgrading. Never infer a minimum from the latest publication or dependency pin alone. Update `dev-docs/OPENCODE_COMPATIBILITY.md` in place and retain detailed evidence in PR/CI logs. The runtime CLI is managed independently. - Do not use `@opencode-ai/sdk`, `@opencode-ai/sdk/v2/client`, or `createOpencodeClient()`; follow installed `@opencode/client` declarations. - Never add general plugin extension points. The narrow native integrations are the bundled `codenomad.automation` plugin, project-local native session coordination (`codenomad.missions`) and the bundled session-pruning RPC; see `dev-docs/BROWSER_AUTOMATION.md`, `dev-docs/MISSIONS.md` and `dev-docs/SESSION_PRUNING_RPC.md`. All automation tools follow backend presence, sharing the authenticated native transport and execution-time session/window fences. - The server uses the selected host or WSL CLI's official `service status`, `service start`, and `service get password` lifecycle to connect to one externally owned global OpenCode daemon. It owns no private port/database/registration/PID and never stops the daemon on backend shutdown. WSL requires Windows localhost forwarding and uses no cross-namespace PID operations. diff --git a/.opencode/skills/codenomad-architecture-guide/references/architecture-overview.md b/.opencode/skills/codenomad-architecture-guide/references/architecture-overview.md index 83c6933934..1a39fefc3e 100644 --- a/.opencode/skills/codenomad-architecture-guide/references/architecture-overview.md +++ b/.opencode/skills/codenomad-architecture-guide/references/architecture-overview.md @@ -20,7 +20,7 @@ Client-state V3 is a per-window envelope over the V2 content-addressed partition | Owner | Responsibilities | Main paths | |---|---|---| -| OpenCode V2 | Sessions, messages, permissions, Forms, files, session Shell/instructions, background Shells, interactive PTYs | pinned `@opencode/client@2.2.3` contract across server and UI; host-owned native plugin runtime | +| OpenCode V2 | Sessions, messages, permissions, Forms, files, session Shell/instructions, background Shells, interactive PTYs | pinned `@opencode/client@2.3.0` contract across server and UI; host-owned native plugin runtime | | CodeNomad server | Shared service lifecycle, locations, proxy authorization, Git mutations, Yolo, auth, storage, speech, SSE multiplexing, desktop automation bridge | `packages/server/src/` | | CodeNomad UI | Generated Promise clients, state reconciliation, interaction and rendering | `packages/ui/src/` | | Desktop hosts | Start CodeNomad and provide native OS integration | `packages/electron-app/`, `packages/tauri-app/` | diff --git a/.opencode/skills/codenomad-architecture-guide/references/sdk-api-reference.md b/.opencode/skills/codenomad-architecture-guide/references/sdk-api-reference.md index a2d8511ae2..47f55c8e3a 100644 --- a/.opencode/skills/codenomad-architecture-guide/references/sdk-api-reference.md +++ b/.opencode/skills/codenomad-architecture-guide/references/sdk-api-reference.md @@ -2,9 +2,9 @@ ## Package -CodeNomad server and UI pin `@opencode/client@2.2.3`. The runtime CLI is managed independently; startup validates authenticated loopback `/api/info`, then (only to identify an outdated daemon) `/api/status`, then `/api/health`, advancing only on HTTP 404 with the same endpoint, credentials and deadline. Each response has its own validated schema and a 64 KiB bound. The shared transport forwards canonical `server.info()` unchanged. Review official V2 docs, installed declarations, generated routes and native regression tests together when upgrading. +CodeNomad server and UI pin `@opencode/client@2.3.0`. The runtime CLI is managed independently; startup validates authenticated loopback `/api/info`, then (only to identify an outdated daemon) `/api/status`, then `/api/health`, advancing only on HTTP 404 with the same endpoint, credentials and deadline. Each response has its own validated schema and a 64 KiB bound. The shared transport forwards canonical `server.info()` unchanged. Review official V2 docs, installed declarations, generated routes and native regression tests together when upgrading. -Runtime requirements live in `packages/server/src/opencode/runtime-support.ts`: minimum 2.2.3 (the `experimental_image_generate` image tool contract, Code Mode JavaScript job ordering and the `native`/`metadata.keepID` replay contract), with the recommendation (2.2.7) tracked separately. Native builds share the daemon's Effect/public SDK instead of bundling a second runtime. The shared connection binds authenticated runtime identity, the canonical client and forwarding transport. Admission precedes functional requests/plugin provisioning; unlisted custom/prerelease/future labels require authenticated bounded API recognition. Never add operation-specific retry fallbacks. See `dev-docs/OPENCODE_COMPATIBILITY.md` for the version boundaries and `dev-docs/OPENCODE_RUNTIME_SETUP.md` for admission. +Runtime requirements live in `packages/server/src/opencode/runtime-support.ts`: minimum 2.3.0 (the background subagent report contract, the `experimental_image_generate` image tool contract, Code Mode JavaScript job ordering and the `native`/`metadata.keepID` replay contract), with the recommendation (also 2.3.0) tracked separately. Native builds share the daemon's Effect/public SDK instead of bundling a second runtime. The shared connection binds authenticated runtime identity, the canonical client and forwarding transport. Admission precedes functional requests/plugin provisioning; unlisted custom/prerelease/future labels require authenticated bounded API recognition. Never add operation-specific retry fallbacks. See `dev-docs/OPENCODE_COMPATIBILITY.md` for the version boundaries and `dev-docs/OPENCODE_RUNTIME_SETUP.md` for admission. The Promise client preserves the full `baseUrl` path prefix. Forward its generated URL unchanged through `createInstanceFetch`; remove the proxy prefix only when classifying reads for scheduling. Declared API errors are `Error` instances retaining their native `_tag`/data fields. Client errors retain structured `reason`/`cause`, and their `message` may add status, content type or cause detail: classify by structured fields, never exact message text. diff --git a/.opencode/skills/codenomad-architecture-guide/references/sdk-critical-behaviors.md b/.opencode/skills/codenomad-architecture-guide/references/sdk-critical-behaviors.md index 17925e6244..24fee3cdd2 100644 --- a/.opencode/skills/codenomad-architecture-guide/references/sdk-critical-behaviors.md +++ b/.opencode/skills/codenomad-architecture-guide/references/sdk-critical-behaviors.md @@ -2,12 +2,12 @@ ## Contract -- Server and UI pin `@opencode/client@2.2.3`. Manage the runtime CLI independently: startup checks authenticated loopback `/api/info`, then (only to identify an outdated daemon) `/api/status`, then `/api/health`, advancing only on HTTP 404. All probes share the endpoint, credentials, 64 KiB response bound and absolute deadline; authentication, transport and malformed response failures end discovery without fallback. The shared transport forwards canonical `server.info()` unchanged. Review documentation, installed declarations and proxy/API parity whenever the client contract changes. +- Server and UI pin `@opencode/client@2.3.0`. Manage the runtime CLI independently: startup checks authenticated loopback `/api/info`, then (only to identify an outdated daemon) `/api/status`, then `/api/health`, advancing only on HTTP 404. All probes share the endpoint, credentials, 64 KiB response bound and absolute deadline; authentication, transport and malformed response failures end discovery without fallback. The shared transport forwards canonical `server.info()` unchanged. Review documentation, installed declarations and proxy/API parity whenever the client contract changes. - The package root is the generated zero-Effect Promise client. Use installed declarations; never follow `@opencode-ai/sdk` examples. - Native routes are `/api/*`; CodeNomad exposes them only through the authorized `/workspaces/:id/instance` proxy. - That proxy is an explicit method/path allowlist: expose each new upstream API only after review. - Proxy authorization and forwarding share one acquired connection. A stale generation must be rejected at actual HTTP dispatch, including after asynchronous body preparation; late streams cannot invalidate a replacement connection. -- The technical minimum is 2.2.3 for the `experimental_image_generate` image tool contract (upstream #60258: tool, permission action, job type and notice `metadata.source` share that name; on unless `experimental.image_generate` is `false`), alongside Code Mode's JavaScript job ordering and the `native` replay and `metadata.keepID` compaction shapes consumed by the pinned client reducer; the recommendation, 2.2.7, is a separate constant. Plugins use host-owned Effect/public SDK modules through the shared native build settings. Unknown version labels, prereleases and future majors undergo bounded authenticated API recognition, including session environment support. Native `session.inbox.enqueued` has its own shape: its timestamp lives in event metadata, unlike an HTTP inbox record. +- The technical minimum is 2.3.0 for the background subagent report contract (calls return at once; children report through synthetic `` messages) and the `experimental_image_generate` image tool contract (upstream #60258: tool, permission action, job type and notice `metadata.source` share that name; on unless `experimental.image_generate` is `false`), alongside Code Mode's JavaScript job ordering and the `native` replay and `metadata.keepID` compaction shapes consumed by the pinned client reducer; the recommendation, also 2.3.0, is a separate constant. Plugins use host-owned Effect/public SDK modules through the shared native build settings. Unknown version labels, prereleases and future majors undergo bounded authenticated API recognition, including session environment support. Native `session.inbox.enqueued` has its own shape: its timestamp lives in event metadata, unlike an HTTP inbox record. - Never retry a write using another contract after a 400/404/transport failure. Keep the setup/recovery path distinct from functional transport and never replay prompts. ## Location Is Authority diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 58ed18714e..267eaf43cc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -114,7 +114,7 @@ Then open a pull request on GitHub targeting the `dev` branch. ### OpenCode V2 Boundaries -- Server and UI pin `@opencode/client@2.2.3`; native plugins pin `@opencode/plugin@2.2.3` for authoring but resolve Effect and the public SDK from the daemon at runtime. Upgrade pins together with the lockfile and isolated native validation. The runtime CLI is managed independently; its demonstrated minimum and recommended/tested versions remain separate constants in `packages/server/src/opencode/runtime-support.ts` (minimum 2.2.3 for the `experimental_image_generate` image tool contract of upstream #60258, consumed by the Images gallery, Design agent and Images settings; recommended 2.2.5). A build pin alone is never a runtime requirement, and unfamiliar newer/custom labels retain authenticated contract recognition. Review current OpenCode documentation, installed declarations, and proxy/API parity whenever the client contract changes. +- Server and UI pin `@opencode/client@2.3.0`; native plugins pin `@opencode/plugin@2.3.0` for authoring but resolve Effect and the public SDK from the daemon at runtime. Upgrade pins together with the lockfile and isolated native validation. The runtime CLI is managed independently; its demonstrated minimum and recommended/tested versions remain separate constants in `packages/server/src/opencode/runtime-support.ts` (minimum 2.3.0 for the background subagent report contract and the `experimental_image_generate` image tool contract of upstream #60258, consumed by the subagent cards, Missions, the Images gallery, Design agent and Images settings; recommended 2.3.0). A build pin alone is never a runtime requirement, and unfamiliar newer/custom labels retain authenticated contract recognition. Review current OpenCode documentation, installed declarations, and proxy/API parity whenever the client contract changes. - Upgrade references: [OpenCode V2 changelog](https://opencode.ai/changelog) (GitHub Releases list V1), the exact release tags (`vX.Y.Z`) or published npm packages for source/declaration deltas, [OpenCode V2 documentation](https://opencode.ai/v2/docs/), and `node_modules/@opencode/client/dist/promise/`. - `packages/server/src/workspaces/opencode-service.ts` uses the selected host or WSL CLI's official `service status`, `service start`, and `service get password` lifecycle to connect to one externally owned global daemon. CodeNomad owns no private port, database, registration, or daemon PID and never stops the daemon on backend shutdown. - WSL requires Windows localhost forwarding and runs the Linux CLI lifecycle inside the distribution; never inspect or signal Linux PIDs from Windows. diff --git a/README.md b/README.md index 1449202ffb..6b9cf7d23d 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ npx @neuralnomads/codenomad-dev --password "your-password" --launch ## OpenCode V2 and upgrading from 0.19.x -CodeNomad **1.0.0 requires OpenCode V2**: **2.2.3 minimum, 2.2.5 recommended**; the minimum provides the image generation tool used by the Images settings and the Design extension. OpenCode V1 and the former V2 beta protocol are not supported. The current requirements are maintained in [`runtime-support.ts`](packages/server/src/opencode/runtime-support.ts). +CodeNomad **requires OpenCode V2 2.3.0 or later** (also the recommended version); it provides the background subagent reports shown in subagent cards and used by Missions, and the image generation tool used by the Images settings and the Design extension. OpenCode V1 and the former V2 beta protocol are not supported. The current requirements are maintained in [`runtime-support.ts`](packages/server/src/opencode/runtime-support.ts). - **One shared OpenCode service** owns sessions and messages. Closing a CodeNomad tab, window, or backend leaves that service running. Desktop tabs, drafts, and layout are restored separately for each window. - **Use an existing CLI or install from CodeNomad.** Executables on `PATH` are preferred; the setup screen also supports a selected executable and a shared user npm installation. The former private CodeNomad OpenCode installation is no longer used. @@ -166,7 +166,7 @@ Add SideCar as: ## Requirements -- **[OpenCode V2](https://opencode.ai/v2/docs/)** — 2.2.3 minimum and 2.2.5 recommended for CodeNomad 1.0.0. Install/select it through desktop setup or provide a compatible CLI on the server host. +- **[OpenCode V2](https://opencode.ai/v2/docs/)** — 2.3.0 minimum and recommended. Install/select it through desktop setup or provide a compatible CLI on the server host. - **[Git](https://git-scm.com/downloads)** — a prerequisite for full functionality (repository identity, Git operations and worktrees). Git must be executable in the CodeNomad backend's `PATH`; it is not bundled with the desktop installers. - **Node.js and npm** — required for the standalone npm server and source builds; desktop releases include their own (Electron's integrated Node or Tauri's bundled Node, with npm). Use **Node.js 24 LTS**; development and release builds use the version in [`.node-version`](.node-version). diff --git a/dev-docs/OPENCODE_COMPATIBILITY.md b/dev-docs/OPENCODE_COMPATIBILITY.md index f13fc1346d..02bb34aa8d 100644 --- a/dev-docs/OPENCODE_COMPATIBILITY.md +++ b/dev-docs/OPENCODE_COMPATIBILITY.md @@ -21,8 +21,14 @@ view; release notes are at [opencode.ai/changelog](https://opencode.ai/changelog (GitHub Releases cover V1 only). Keep results in the PR and CI logs, never as per-version sections here. -Minimum runtime **2.2.3**, recommended **2.2.7** (`runtime-support.ts`), with -**2.2.3** client/schema/plugin pins. The minimum carries the image tool contract of +Minimum and recommended runtime **2.3.0** (`runtime-support.ts`), with **2.3.0** +client/schema/plugin pins and the matching `effect` **4.1.0**. CodeNomad +qualifies only the 2.3 subagent contract: every subagent call returns at once +(`metadata.status: "running"`) and the child reports to its parent through +synthetic `` messages, one per idle period, tagged +`running` while background work remains (the subagent card in `TRANSCRIPT.md`, +`scripts/test-missions-native-trajectory.mjs`, +`scripts/test-subagent-nesting-native.mjs`). The minimum also carries the image tool contract of upstream [#60258](https://github.com/anomalyco/opencode/pull/60258), consumed by the Images gallery, the Design agent and skills and the Images settings: one name, `experimental_image_generate`, for the tool, its permission action, its job diff --git a/dev-docs/OPENCODE_INTEGRATIONS.md b/dev-docs/OPENCODE_INTEGRATIONS.md index fe1fcbdc10..2bb7b9f16e 100644 --- a/dev-docs/OPENCODE_INTEGRATIONS.md +++ b/dev-docs/OPENCODE_INTEGRATIONS.md @@ -387,7 +387,7 @@ Commands: visibility, Cancel-first shared confirmation with machine/package-version text, preconsent navigation/event fences, all projected outcomes, unsupported WSL and uncertain errors without automatic replay. - `node --import tsx scripts/test-integrations-attachments-native.mjs [pilot-checkout] [blender-executable]`: - OpenCode 2.2.5 with actual Fastify attachment/read/SSE routes, native sessions and metadata, a loopback + A supported OpenCode runtime (at or above the minimum) with actual Fastify attachment/read/SSE routes, native sessions and metadata, a loopback `IntegrationCatalogSource`, and the real relay feeding `createIntegrationsStore` through SSE. Checks a 60-second event-free demand and ten native plugin events inside 300 ms, strict inputs and cross-Location refusals. The Blender pilot extracts the immutable pin recorded in `VENDORED.json` from the supplied checkout read-only, @@ -400,7 +400,7 @@ Commands: logger and an adversarial opaque session ID. Every child uses the fixture environment. Manual AC-B4 has its own acceptance run. - `node --import tsx scripts/test-integrations-host-install-native.mjs [integration-checkout]`: - actual Fastify installation route and OpenCode 2.2.5 RPCs using the real built integration kit. Environment and + actual Fastify installation route and a supported OpenCode runtime's RPCs using the real built integration kit. Environment and kernel WSL detections run with and without authenticated validated offers; selected/backend WSL refuses before catalog or native RPC reads. Mirrored-offer kit refusals preserve every protected fixture file, including the preloaded catalog. A Linux positive control invokes exactly one installer callback and private sentinel write. diff --git a/dev-docs/TRANSCRIPT.md b/dev-docs/TRANSCRIPT.md index 6a8fb229d5..32f7fce9e2 100644 --- a/dev-docs/TRANSCRIPT.md +++ b/dev-docs/TRANSCRIPT.md @@ -15,7 +15,9 @@ Message content visibility and presets, token lines, tool renderers, native sess - Tool-result images retain native `state.content` and render through the shared `components/tool-call/output-images.tsx` surface, including MCP and specialized tools. Keep image bytes out of text projections (copy/search/speech); image styles live in `styles/messaging/tool-call/images.css`. - Transcript pages carry large tool images by reference: the UI's native message list reads (`lib/sdk-manager.ts`) and history windows (`fetchHistoryWindow`) send the `x-codenomad-media: deferred` opt-in (`server/src/opencode/session-media-contract.ts`), and the server replaces each tool image data URI over `INLINE_MEDIA_LIMIT` (32 KiB) with a `/api/workspaces//session-media/////` path (`opencode/session-media.ts`). `toolImageSource` resolves that path on the API base, so the lazy `` loads only shown images; `routes/session-media.ts` serves the bytes of the owned session's native message, pinned by the digest and refused at or after an undo boundary, as an immutable sandboxed image. Single-message reads (`session.message.get`: pruning revisions, previews), live events, user attachments and requests without the opt-in stay whole, so revisions hash native content. - Markdown images of local file paths (`C:/…`, `file://`, absolute or relative POSIX paths) cannot load in the renderer. `lib/markdown.ts` renders them as their alt text in a `span.markdown-local-image`, and `components/markdown.tsx` swaps the label for an `` with the source of a completed tool image of the same path already in the session's loaded messages (`lib/markdown-local-images.ts`: the image's file name or its single-image tool's `filePath`; Windows paths compare case-insensitively, a relative path must match one known path's end). Only blocks containing such a label read and track the session's tool parts. Never fetch local paths through a backend route for this; an unmatched path keeps its alt text. -- Code Mode reads native `metadata.toolCalls` in `tool-call/renderers/execute-data.ts`; keep call-list styling in `styles/messaging/tool-call/execute.css`, with native image/output ownership in the shared tool shell. +- Code Mode reads native `metadata.toolCalls` in `tool-call/renderers/execute-data.ts`; keep call-list styling in `styles/messaging/tool-call/execute.css`, with native image/output ownership in the shared tool shell. A completed object or array result arrives as compact JSON (with optional `Warnings:`/`Logs:` blocks): `executeOutputForRender` displays it indented within size and nesting-depth bounds, while copy keeps the native text; strings, errors and other output use the shared rendering. +- Subagent cards (`tool-call/renderers/task.tsx`) treat a completed call whose `metadata.status` is `running` as a background launch acknowledgement, never as its result. `tool-call/renderers/subagent-report.ts` shows instead the child's latest hidden synthetic `` report delivered to that call: created at or after the call's execution start (`time.ran`, else its creation) and before the next call continuing the same child, chosen by creation time then message id (never list position), with its state: a `running` tag means the child still owns background work. Every idle period reports, so a call continued before any report joins the next period that reports. One index of reports and call times per parent-session revision serves every card; it is owned by the message store and tied to the session's message-id list, so eviction, reload or store replacement rebuild it. A call stored with its result in the tool output (earlier runtimes) shows that output. Covered by `subagent-report.test.ts` and `tests/browser/task-copy.test.ts`. +- A shell call the user interrupted fails with its output so far followed by `metadata.notice`, flagged `metadata.interrupted`. `tool-call/renderers/bash-data.ts` renders the part before the notice like a finished call's output and the shell's `getErrorText` hook shows only the notice under the error label; other failures keep the whole error. Covered by `bash-data.test.ts` and `tests/browser/tool-images.test.ts`. - Native websearch text is parsed conservatively by `tool-call/renderers/websearch-data.ts`; unknown/oversized responses use the shared raw renderer. Recognized provider-consent Forms retain the generic schema/answer path, with layout in `styles/messaging/tool-call/websearch.css`. - Session lifecycle features use OpenCode V2's published signals: one `session.execution.{succeeded,failed,interrupted}` per busy period (`lib/native-execution-events.ts`) and `session.retry.scheduled` for provider backoff. The schema-declared `session.idle`/`session.status` are never published; never wire a feature only to them. A terminal event is a hint until `session.active` confirms settlement, which alone announces "A session finished", only for root sessions ending in success, failure or an inactivity stop. Transcript reducers retire at settlement, deferred while prompts stay parked in their inbox or a user shell or unsettled tool call still needs reconciling there. A tool part still `streaming` (rendered "pending") once a settlement drained has lost its `called` transition: `session.tool.success` reduces solely from the running status (a later `failed` can still settle it). Symmetrically, admission drops a `session.tool.called` whose newest matching part already holds a terminal status: the reducer would overwrite the settled state wholesale (flipping completed tool images back to "running" until a settlement read healed them), while a legitimate re-call is always preceded by a fresh `session.tool.input.started` part that becomes the reducer's match. The SDK reducer already answers a terminal event whose transcript holds a streaming or running tool by invalidating and re-reading messages, but that refresh is dropped while the stream is not connected and never publishes its result; the terminal event therefore finishes the read itself (`finishOpenCodeDataEvent`: one `message.sync` that shares the SDK's in-flight read when connected and starts it when not) and projects the reconciled page, which keeps the display window's membership. Only a newer admitted execution suppresses that publication — same-round activity such as a late terminal tool event must not leave the repair unpublished. Non-event settlement evidence finishes the same read through the same fence: the liveness activity read observing that a run the UI still believed working has settled (`observeNonEventSettlement`, reported by `session-api`), and an authoritative inbox sync that drops an item the reducer admitted (a delivery or cancellation without events, whose user message may never be admitted either). A tool still streaming or running in a finished round once a later `session.step.started` reduced (`reconcileStrandedRoundTools`, hooked after both the direct emit and the queued replay, where the scan runs at the task boundary between replay chunks) lost its terminal event mid-execution: the loop feeds every tool result back before it continues, so waiting for the settlement read would keep its spinner live through later rounds (and a quickly following execution would suppress that repair). That reconcile and every settlement read share one in-flight reconciliation per transcript (`settlementReadPending`); covered by `opencode-data-settlement.test.ts`. Token/cost lines (`components/message-usage.tsx`) appear once per agent message: the row of an assistant message's final text (the one carrying "delete tools and reasoning") renders, once that message has native usage, the sum (`sumMessageUsage`) of its own usage and of every message holding a tool or reasoning part that cleanup selects (`technicalCleanupParts`). Reuse that selection rather than a separate projection. The line renders inside the content row, so it never shifts `` items or splits a technical group (whose Delete needs two tools); tool-only steps get no line. A message whose text is followed by tools also counts in the next message's line, as its tools belong to that selection. Sums cover the loaded transcript window only, like cleanup. Capture real streams with `scripts/test-session-lifecycle-native.mjs`. - Native transcript events reduce only through `stores/opencode-data.ts` (never add another partial-part reducer), which publishes bounded snapshots through `hydrateMessages` (message-v2/instance-store.ts); these per-event re-projections must not invalidate unchanged messages: `hydrateMessages` reuses the resident `MessageRecord` object whenever content, explicit timestamps and prompt-display metadata are unchanged, and an identical whole snapshot returns before any store write or session-revision bump. Part/info comparisons use allocation-free structural equality (`partDataEqual`), never `JSON.stringify`. The SDK reduce mutates rows in place, so reference identity can never prove a session unchanged — never add a reference-anchored projection skip. A session's reducer is replaced (authoritative resync after an overflow, rotation failure or reconnect; pruning invalidation) only through `replaceTranscriptEntry`, which bumps the transcript's `entryRevision`; reactive readers of the reducer, such as the inbox behind queued badges (`getOpenCodeSessionInbox`), track it so they rebind instead of keeping the disposed reducer's last state (`opencode-inbox-rebinding.test.ts`, `tests/browser/session-rendering.test.ts`). diff --git a/docs/help/de/install.md b/docs/help/de/install.md index 0846766cdf..c5d2797307 100644 --- a/docs/help/de/install.md +++ b/docs/help/de/install.md @@ -45,7 +45,7 @@ Die Electron-Debian-Installation richtet die Chromium-Sandbox ein. Deaktivieren | Anforderung | Wo sie verfügbar sein muss | Aktuelle Anforderung | | --- | --- | --- | -| OpenCode-CLI | Ausgewählter Ausführungshost, gegebenenfalls einschließlich der ausgewählten WSL-Distribution | Mindestens **2.2.3**; **2.2.7** ist das empfohlene/qualifizierte Ziel. Neuere oder angepasste Versionen werden anhand der Schnittstellenverträge geprüft, nicht wegen fehlender Tests ausgeschlossen. | +| OpenCode-CLI | Ausgewählter Ausführungshost, gegebenenfalls einschließlich der ausgewählten WSL-Distribution | Mindestens **2.3.0**; **2.3.0** ist das empfohlene/qualifizierte Ziel. Neuere oder angepasste Versionen werden anhand der Schnittstellenverträge geprüft, nicht wegen fehlender Tests ausgeschlossen. | | Git | Im `PATH` des CodeNomad-Backend-Kontos | Erforderlich für Repository-Identität, Git-Vorgänge und Worktrees. | | Node.js/npm | Host für eigenständigen Server und Quellcode-Builds | Node.js 24 LTS; reproduzierbare Quellcode-Builds verwenden die in `.node-version` festgelegte Version. Desktop-Releases bringen ihre eigene Laufzeit mit: das integrierte Node von Electron oder das gebündelte Node von Tauri, jeweils mit npm. | | Arbeitsbereichsordner | Für das Backend zugänglicher Datenträger | Ein ausdrücklich geöffneter physischer Ordner, kein von einem Remote-Browser angenommener gerätelokaler Ordner. | diff --git a/docs/help/de/opencode.md b/docs/help/de/opencode.md index 2456a14342..8235d36b33 100644 --- a/docs/help/de/opencode.md +++ b/docs/help/de/opencode.md @@ -19,8 +19,8 @@ Installierte Programmdatei und laufender Dienst können unterschiedliche Version | Einstufung | Aktuelle Anforderung | Bedeutung | | --- | --- | --- | -| Minimum | OpenCode **2.2.3** | Das Bildgenerierungswerkzeug, das die Einstellungen unter **Bilder** und die Design-Erweiterung nutzen, sowie die korrekte Reihenfolge von JavaScript-Jobs in Code Mode und das native Wiedergabe- und Komprimierungsformat; mit früheren Versionen gespeicherte Unterhaltungen bleiben nach dem Update lesbar. | -| Empfohlen | OpenCode **2.2.7** | Qualifiziertes Ziel, getrennt vom technischen Minimum. | +| Minimum | OpenCode **2.3.0** | Das Bildgenerierungswerkzeug, das die Einstellungen unter **Bilder** und die Design-Erweiterung nutzen, sowie die korrekte Reihenfolge von JavaScript-Jobs in Code Mode und das native Wiedergabe- und Komprimierungsformat; mit früheren Versionen gespeicherte Unterhaltungen bleiben nach dem Update lesbar. Außerdem liefert sie Subagent-Ergebnisse als Hintergrundberichte, die Subagent-Karten und Missionen lesen. | +| Empfohlen | OpenCode **2.3.0** | Qualifiziertes Ziel; derzeit dieselbe Version wie das Minimum. | | Ungeprüft | Neuere oder angepasste, nicht vollständig validierte Version | Nicht allein wegen fehlender Tests abgelehnt; geprüft werden die tatsächlichen API-Verträge des verbundenen Dienstes. | Der verbundene Dienst muss die erforderlichen Verträge für Sitzungen, Berechtigungen, Forms, Posteingang und Sitzungsumgebung bereitstellen. Native Missionszeitplanung prüft auch die Zeitplan-APIs, das Plugin-/Anbieterpaket und die wirksame Einstellung `experimental.schedules`. Die Verfügbarkeit richtet sich nach diesen genutzten Fähigkeiten, auch bei kompatiblen künftigen Versionen. Meldet die Einrichtung einen nicht unterstützten laufenden Dienst, wählen/installieren Sie eine unterstützte CLI und führen Sie bei Bereitschaft den expliziten Neustart des gemeinsamen Dienstes aus. diff --git a/docs/help/de/server.md b/docs/help/de/server.md index cab3c3db79..6f695cb535 100644 --- a/docs/help/de/server.md +++ b/docs/help/de/server.md @@ -8,7 +8,7 @@ Dieselbe Oberfläche unterstützt [mehrere Projekt-Tabs und Worktrees](projects. 1. Installieren Sie Node.js 24 LTS und npm; die Build-Laufzeit des Repositorys ist in `.node-version` festgelegt. Desktop-Pakete liefern ihre eigene Laufzeit: Electron nutzt sein integriertes Node, Tauri bündelt Node, und beide enthalten npm. 2. Stellen Sie Git im **PATH des Backend-Prozesses** bereit. Git allein in WSL genügt für ein Windows-Backend nicht. -3. Installieren oder wählen Sie OpenCode: **2.2.3** ist das erforderliche Minimum, **2.2.7** das empfohlene Qualifizierungsziel. Neuere/angepasste Builds durchlaufen Kompatibilitätsprüfungen, keine Positivliste getesteter Versionen. Siehe [OpenCode-Einrichtung](opencode.md). +3. Installieren oder wählen Sie OpenCode: **2.3.0** ist das erforderliche Minimum, **2.3.0** das empfohlene Qualifizierungsziel. Neuere/angepasste Builds durchlaufen Kompatibilitätsprüfungen, keine Positivliste getesteter Versionen. Siehe [OpenCode-Einrichtung](opencode.md). 4. Wählen Sie den Startordner des Servers oder übergeben Sie `--workspace-root` ausdrücklich. Ohne Git bleiben Unterhaltungen nur im ausdrücklich geöffneten physischen Ordner verfügbar; Git- und Worktree-Vorgänge schlagen fehl. Installieren Sie Git und starten Sie das Backend nach einer PATH-Änderung neu. Das Arbeitsbereichs-Stammverzeichnis begrenzt Öffnen/Durchsuchen, nicht Agentenausführung: siehe [Sicherheit](security.md). diff --git a/docs/help/de/troubleshooting.md b/docs/help/de/troubleshooting.md index 942b613be0..8baf919cb3 100644 --- a/docs/help/de/troubleshooting.md +++ b/docs/help/de/troubleshooting.md @@ -42,7 +42,7 @@ Lässt sich ein zugehöriger Worktree oder Unterhaltungsort nicht überprüfen, ## OpenCode-Laufzeit und WSL {#opencode-runtime} 1. Öffnen Sie **Einstellungen → OpenCode** und prüfen Sie die Karte **OpenCode-Version** (installierte Version und Status des laufenden Dienstes), dann die gewählte Programmdatei unter **OpenCode-Binärdatei**. -2. Verwenden Sie die unterstützte Installation/Aktualisierung, falls die erforderliche Laufzeit fehlt. Aktuelles Minimum: **2.2.3**; empfohlene/qualifizierte Version: **2.2.7**. +2. Verwenden Sie die unterstützte Installation/Aktualisierung, falls die erforderliche Laufzeit fehlt. Aktuelles Minimum: **2.3.0**; empfohlene/qualifizierte Version: **2.3.0**. 3. Weicht die installierte CLI vom laufenden Dienst ab, entscheiden Sie ausdrücklich über einen Neustart des gemeinsamen Dienstes. **OpenCode-Dienst neu starten** ist unter **Fehlerbehebung** verfügbar und benötigt Bestätigung. Es unterbricht aktive Arbeit in jedem verbundenen Client, behält aber Sitzungsverlauf. Konfigurationsneuladen ist separat: Es behält den Prozess, erstellt aber geladene Locations neu und storniert offene Fragen/Berechtigungen. Beides ist keine harmlose Aktualisierung. diff --git a/docs/help/en/install.md b/docs/help/en/install.md index dd42c24684..4e9eb95e7d 100644 --- a/docs/help/en/install.md +++ b/docs/help/en/install.md @@ -45,7 +45,7 @@ The Electron Debian installation configures Chromium's sandbox. Do not disable t | Requirement | Where it must be available | Current requirement | | --- | --- | --- | -| OpenCode CLI | Selected execution host, including the selected WSL distribution where applicable | Minimum **2.2.3**; **2.2.7** is the recommended/qualified target. Newer or custom versions undergo contract validation rather than an untested-version ban. | +| OpenCode CLI | Selected execution host, including the selected WSL distribution where applicable | Minimum **2.3.0**; **2.3.0** is the recommended/qualified target. Newer or custom versions undergo contract validation rather than an untested-version ban. | | Git | CodeNomad backend account's `PATH` | Required for repository identity, Git operations and worktrees. | | Node.js/npm | Standalone-server and source-build host | Node.js 24 LTS; reproducible source builds use the version pinned in `.node-version`. Desktop releases include their own: Electron's integrated Node or Tauri's bundled Node, with npm. | | Workspace folder | Backend-accessible disk | An explicitly opened physical folder, not a device-local folder inferred by a remote browser. | diff --git a/docs/help/en/opencode.md b/docs/help/en/opencode.md index 10dbf3b6c4..b49892a5ba 100644 --- a/docs/help/en/opencode.md +++ b/docs/help/en/opencode.md @@ -19,8 +19,8 @@ The installed executable and the running service can have different versions. Co | Classification | Current requirement | Meaning | | --- | --- | --- | -| Minimum | OpenCode **2.2.3** | The image generation tool used by the **Images** settings and the Design extension, alongside correct JavaScript job ordering in Code Mode and the native replay and compaction format; conversations saved by earlier versions stay readable after updating. | -| Recommended | OpenCode **2.2.7** | Qualified target, distinct from the technical minimum. | +| Minimum | OpenCode **2.3.0** | The image generation tool used by the **Images** settings and the Design extension, alongside correct JavaScript job ordering in Code Mode and the native replay and compaction format; conversations saved by earlier versions stay readable after updating. It also delivers subagent results as background reports, which subagent cards and Missions read. | +| Recommended | OpenCode **2.3.0** | Qualified target; currently the same version as the minimum. | | Unverified | A newer or custom version not fully validated | Not rejected merely for being untested; the connected service's actual API contracts are checked. | The connected service must expose the required session, permission, Form, inbox and session-environment contracts. Native Mission scheduling also checks the schedule APIs, plugin/provider bundle and effective `experimental.schedules` setting. Availability follows those consumed capabilities, including on compatible future versions. If setup reports an unsupported running service, select/install a supported CLI and use the explicit shared-service restart when ready. diff --git a/docs/help/en/server.md b/docs/help/en/server.md index db2515cb90..fdf95489ce 100644 --- a/docs/help/en/server.md +++ b/docs/help/en/server.md @@ -8,7 +8,7 @@ The same UI supports [multiple project tabs and worktrees](projects.md), [conver 1. Install Node.js 24 LTS and npm; the repository pins its build runtime in `.node-version`. Desktop packages provide their own runtime: Electron uses its integrated Node, Tauri bundles Node, and both include npm. 2. Put Git on the **backend process's PATH**. Git inside WSL alone does not satisfy a Windows backend. -3. Install or select OpenCode: **2.2.3** is the required minimum and **2.2.7** the recommended qualification target. Newer or custom builds undergo compatibility checks, not a tested-version allowlist. See [OpenCode setup](opencode.md). +3. Install or select OpenCode: **2.3.0** is the required minimum and **2.3.0** the recommended qualification target. Newer or custom builds undergo compatibility checks, not a tested-version allowlist. See [OpenCode setup](opencode.md). 4. Choose the folder from which to start the server, or pass `--workspace-root` explicitly. Without Git, conversations remain available only in the explicitly opened physical folder; Git and worktree operations fail. Install Git and restart the backend after a PATH change. A workspace root limits opening/browsing, not agent execution: see [Security](security.md). diff --git a/docs/help/en/troubleshooting.md b/docs/help/en/troubleshooting.md index 3bc5c4a858..f8e8704627 100644 --- a/docs/help/en/troubleshooting.md +++ b/docs/help/en/troubleshooting.md @@ -42,7 +42,7 @@ If an owned worktree or conversation placement cannot be verified, open its phys ## OpenCode runtime and WSL {#opencode-runtime} 1. Open **Preferences → OpenCode** and check the **OpenCode version** card (installed version and running service status), then the selected executable under **OpenCode Binary**. -2. Use the supported installation/update action when the required runtime is missing. Current minimum: **2.2.3**; recommended/qualified version: **2.2.7**. +2. Use the supported installation/update action when the required runtime is missing. Current minimum: **2.3.0**; recommended/qualified version: **2.3.0**. 3. If the installed CLI differs from the running service, decide explicitly whether to restart the shared service. **Restart OpenCode service** is available under **Troubleshooting** and requires confirmation. It interrupts active work in every connected client, but retains session history. Configuration reload is a separate action: it keeps the process but rebuilds loaded Locations and cancels pending questions/permissions. Neither is a harmless refresh. diff --git a/docs/help/es/install.md b/docs/help/es/install.md index fed5f93e11..218b6a7a5b 100644 --- a/docs/help/es/install.md +++ b/docs/help/es/install.md @@ -45,7 +45,7 @@ La instalación Debian de Electron configura el aislamiento de Chromium. No desa | Requisito | Dónde debe estar disponible | Requisito actual | | --- | --- | --- | -| CLI de OpenCode | Equipo de ejecución seleccionado, incluida la distribución WSL seleccionada cuando corresponda | Mínimo **2.2.3**; **2.2.7** es la versión recomendada/verificada. Las versiones más nuevas o personalizadas pasan una validación de contratos en lugar de prohibirse por no haberse probado. | +| CLI de OpenCode | Equipo de ejecución seleccionado, incluida la distribución WSL seleccionada cuando corresponda | Mínimo **2.3.0**; **2.3.0** es la versión recomendada/verificada. Las versiones más nuevas o personalizadas pasan una validación de contratos en lugar de prohibirse por no haberse probado. | | Git | `PATH` de la cuenta del backend de CodeNomad | Necesario para la identidad del repositorio, las operaciones Git y los worktrees. | | Node.js/npm | Equipo del servidor independiente y de compilación desde el código fuente | Node.js 24 LTS; las compilaciones reproducibles desde el código fuente usan la versión fijada en `.node-version`. Las versiones de escritorio incluyen el suyo: el Node integrado de Electron o el Node que incluye Tauri, con npm. | | Carpeta del espacio de trabajo | Disco accesible para el backend | Una carpeta física abierta explícitamente, no una carpeta local del dispositivo deducida por un navegador remoto. | diff --git a/docs/help/es/opencode.md b/docs/help/es/opencode.md index 40f4ad8d5f..b73466b3ad 100644 --- a/docs/help/es/opencode.md +++ b/docs/help/es/opencode.md @@ -19,8 +19,8 @@ El ejecutable instalado y el servicio en ejecución pueden tener versiones disti | Clasificación | Requisito actual | Significado | | --- | --- | --- | -| Mínima | OpenCode **2.2.3** | La herramienta de generación de imágenes que usan los ajustes de **Imágenes** y la extensión Design, además del orden correcto de las tareas JavaScript en Code Mode y el formato nativo de reproducción y compactación; las conversaciones guardadas con versiones anteriores siguen siendo legibles tras actualizar. | -| Recomendada | OpenCode **2.2.7** | Objetivo verificado, distinto del mínimo técnico. | +| Mínima | OpenCode **2.3.0** | La herramienta de generación de imágenes que usan los ajustes de **Imágenes** y la extensión Design, además del orden correcto de las tareas JavaScript en Code Mode y el formato nativo de reproducción y compactación; las conversaciones guardadas con versiones anteriores siguen siendo legibles tras actualizar. También entrega los resultados de los subagentes como informes en segundo plano, que leen las tarjetas de subagente y las Misiones. | +| Recomendada | OpenCode **2.3.0** | Objetivo verificado; actualmente la misma versión que la mínima. | | No verificada | Una versión más nueva o personalizada no validada por completo | No se rechaza simplemente por no estar probada; se comprueban los contratos API reales del servicio conectado. | El servicio conectado debe exponer los contratos requeridos de sesiones, permisos, formularios, bandeja de entrada y entorno de sesión. La programación nativa de Misiones también comprueba las API de programación, el paquete de plugin/proveedor y el ajuste efectivo `experimental.schedules`. La disponibilidad depende de esas capacidades utilizadas, también en versiones futuras compatibles. Si la configuración inicial informa de un servicio en ejecución no compatible, selecciona/instala una CLI compatible y usa el reinicio explícito del servicio compartido cuando estés listo. diff --git a/docs/help/es/server.md b/docs/help/es/server.md index 4a82a97b94..5c57ed5cf1 100644 --- a/docs/help/es/server.md +++ b/docs/help/es/server.md @@ -8,7 +8,7 @@ La misma interfaz admite [varias pestañas de proyecto y worktrees](projects.md) 1. Instala Node.js 24 LTS y npm; el repositorio fija su entorno de compilación en `.node-version`. Los paquetes de escritorio proporcionan su propio entorno: Electron usa su Node integrado, Tauri incluye Node y ambos incluyen npm. 2. Pon Git en el **PATH del proceso del backend**. Git solo dentro de WSL no satisface a un backend Windows. -3. Instala o selecciona OpenCode: **2.2.3** es el mínimo requerido y **2.2.7**, el objetivo recomendado de verificación. Las compilaciones más nuevas o personalizadas pasan comprobaciones de compatibilidad, no una lista de versiones probadas permitidas. Consulta [configuración de OpenCode](opencode.md). +3. Instala o selecciona OpenCode: **2.3.0** es el mínimo requerido y **2.3.0**, el objetivo recomendado de verificación. Las compilaciones más nuevas o personalizadas pasan comprobaciones de compatibilidad, no una lista de versiones probadas permitidas. Consulta [configuración de OpenCode](opencode.md). 4. Elige la carpeta desde la que iniciar el servidor o pasa `--workspace-root` explícitamente. Sin Git, las conversaciones siguen disponibles solo en la carpeta física abierta explícitamente; las operaciones Git y worktree fallan. Instala Git y reinicia el backend tras cambiar PATH. Una raíz de espacio de trabajo limita la apertura/exploración, no la ejecución del agente: consulta [Seguridad](security.md). diff --git a/docs/help/es/troubleshooting.md b/docs/help/es/troubleshooting.md index 0d5b8e37ba..c2ca0c68f2 100644 --- a/docs/help/es/troubleshooting.md +++ b/docs/help/es/troubleshooting.md @@ -42,7 +42,7 @@ Si no puede verificarse un worktree propio o la ubicación de una conversación, ## Entorno de ejecución OpenCode y WSL {#opencode-runtime} 1. Abre **Preferencias → OpenCode** y comprueba la tarjeta **Versión de OpenCode** (versión instalada y estado del servicio en ejecución) y después el ejecutable seleccionado en **Binario de OpenCode**. -2. Usa la acción compatible de instalación/actualización si falta el entorno requerido. Mínimo actual: **2.2.3**; versión recomendada/verificada: **2.2.7**. +2. Usa la acción compatible de instalación/actualización si falta el entorno requerido. Mínimo actual: **2.3.0**; versión recomendada/verificada: **2.3.0**. 3. Si la CLI instalada difiere del servicio en ejecución, decide explícitamente si reiniciar el servicio compartido. **Reiniciar servicio OpenCode** está disponible en **Solución de problemas** y requiere confirmación. Interrumpe el trabajo activo de todos los clientes conectados, pero conserva el historial de sesiones. Recargar la configuración es una acción separada: mantiene el proceso, pero reconstruye las Locations cargadas y cancela preguntas/permisos pendientes. Ninguna es una actualización inofensiva. diff --git a/docs/help/fr/install.md b/docs/help/fr/install.md index 54f1bbe410..3e6fe4e04c 100644 --- a/docs/help/fr/install.md +++ b/docs/help/fr/install.md @@ -45,7 +45,7 @@ L’installation Debian d’Electron configure le bac à sable Chromium. Ne dés | Prérequis | Où il doit être disponible | Exigence actuelle | | --- | --- | --- | -| CLI OpenCode | Hôte d’exécution sélectionné, y compris la distribution WSL choisie le cas échéant | Minimum **2.2.3** ; **2.2.7** est la cible recommandée/qualifiée. Les versions plus récentes ou personnalisées passent une validation des contrats plutôt qu’une interdiction des versions non testées. | +| CLI OpenCode | Hôte d’exécution sélectionné, y compris la distribution WSL choisie le cas échéant | Minimum **2.3.0** ; **2.3.0** est la cible recommandée/qualifiée. Les versions plus récentes ou personnalisées passent une validation des contrats plutôt qu’une interdiction des versions non testées. | | Git | `PATH` du compte du backend CodeNomad | Requis pour l’identité des dépôts, les opérations Git et les worktrees. | | Node.js/npm | Hôte du serveur autonome et de compilation depuis les sources | Node.js 24 LTS ; les compilations reproductibles utilisent la version épinglée dans `.node-version`. Les versions de bureau fournissent le leur : le Node intégré d’Electron ou le Node embarqué par Tauri, avec npm. | | Dossier de travail | Disque accessible au backend | Dossier physique explicitement ouvert, pas un dossier local à l’appareil déduit par un navigateur distant. | diff --git a/docs/help/fr/opencode.md b/docs/help/fr/opencode.md index 99b08c28df..ec005dbe07 100644 --- a/docs/help/fr/opencode.md +++ b/docs/help/fr/opencode.md @@ -19,8 +19,8 @@ L’exécutable installé et le service actif peuvent avoir des versions différ | Classification | Exigence actuelle | Signification | | --- | --- | --- | -| Minimum | OpenCode **2.2.3** | L’outil de génération d’images qu’utilisent les réglages **Images** et l’extension Design, ainsi que l’ordre correct d’exécution des tâches JavaScript dans Code Mode et le format natif de rejeu et de compaction ; les conversations enregistrées par les versions antérieures restent lisibles après la mise à jour. | -| Recommandée | OpenCode **2.2.7** | Cible qualifiée, distincte du minimum technique. | +| Minimum | OpenCode **2.3.0** | L’outil de génération d’images qu’utilisent les réglages **Images** et l’extension Design, ainsi que l’ordre correct d’exécution des tâches JavaScript dans Code Mode et le format natif de rejeu et de compaction ; les conversations enregistrées par les versions antérieures restent lisibles après la mise à jour. Elle fournit aussi les résultats des sous-agents sous forme de rapports en arrière-plan, que lisent les cartes de sous-agent et les Missions. | +| Recommandée | OpenCode **2.3.0** | Cible qualifiée ; actuellement la même version que le minimum. | | Non vérifiée | Version plus récente ou personnalisée non entièrement validée | Non rejetée simplement parce que non testée ; les contrats API réels du service connecté sont vérifiés. | Le service connecté doit exposer les contrats requis de session, permission, Form, boîte de réception et environnement de session. La programmation native des Missions vérifie aussi les API de programmation, l’ensemble plugin/fournisseur et le réglage effectif `experimental.schedules`. La disponibilité suit les capacités consommées, y compris sur les versions futures compatibles. Si la configuration signale un service actif non pris en charge, sélectionnez/installez une CLI prise en charge et utilisez le redémarrage explicite du service partagé lorsque vous êtes prêt. diff --git a/docs/help/fr/server.md b/docs/help/fr/server.md index 73c0203ab9..f45c12d7a8 100644 --- a/docs/help/fr/server.md +++ b/docs/help/fr/server.md @@ -8,7 +8,7 @@ La même interface prend en charge [plusieurs onglets de projet et worktrees](pr 1. Installez Node.js 24 LTS et npm ; la version d’exécution du dépôt pour la compilation est épinglée dans `.node-version`. Les paquets de bureau fournissent leur propre environnement : Electron utilise son Node intégré, Tauri embarque Node et les deux incluent npm. 2. Placez Git dans le **PATH du processus backend**. Git dans WSL seul ne suffit pas pour un backend Windows. -3. Installez ou sélectionnez OpenCode : **2.2.3** est le minimum requis et **2.2.7** la cible de qualification recommandée. Les versions plus récentes ou personnalisées passent des contrôles de compatibilité, pas une liste de versions testées autorisées. Consultez la [configuration d’OpenCode](opencode.md). +3. Installez ou sélectionnez OpenCode : **2.3.0** est le minimum requis et **2.3.0** la cible de qualification recommandée. Les versions plus récentes ou personnalisées passent des contrôles de compatibilité, pas une liste de versions testées autorisées. Consultez la [configuration d’OpenCode](opencode.md). 4. Choisissez le dossier depuis lequel démarrer le serveur, ou passez explicitement `--workspace-root`. Sans Git, les conversations restent disponibles uniquement dans le dossier physique explicitement ouvert ; les opérations Git et worktree échouent. Installez Git et redémarrez le backend après une modification de PATH. Une racine d’espace de travail limite l’ouverture/la navigation, pas l’exécution de l’agent : voir [Sécurité](security.md). diff --git a/docs/help/fr/troubleshooting.md b/docs/help/fr/troubleshooting.md index 822e11a07b..6c202937eb 100644 --- a/docs/help/fr/troubleshooting.md +++ b/docs/help/fr/troubleshooting.md @@ -42,7 +42,7 @@ Si un worktree détenu ou l’emplacement d’une conversation ne peut être vé ## Environnement OpenCode et WSL {#opencode-runtime} 1. Ouvrez **Préférences → OpenCode** et vérifiez la carte **Version d’OpenCode** (version installée et état du service actif), puis l’exécutable sélectionné sous **Binaire OpenCode**. -2. Utilisez l’action d’installation/mise à jour prise en charge si l’environnement requis manque. Minimum actuel : **2.2.3** ; version recommandée/qualifiée : **2.2.7**. +2. Utilisez l’action d’installation/mise à jour prise en charge si l’environnement requis manque. Minimum actuel : **2.3.0** ; version recommandée/qualifiée : **2.3.0**. 3. Si la CLI installée diffère du service actif, décidez explicitement s’il faut redémarrer le service partagé. **Redémarrer le service OpenCode** est disponible sous **Dépannage** et exige confirmation. Cela interrompt le travail actif de tous les clients connectés mais conserve l’historique. Le rechargement de configuration est distinct : il garde le processus mais reconstruit les Locations chargées et annule les questions/autorisations en attente. Aucun n’est une actualisation anodine. diff --git a/docs/help/he/install.md b/docs/help/he/install.md index 292709e4e1..452af2a97a 100644 --- a/docs/help/he/install.md +++ b/docs/help/he/install.md @@ -45,7 +45,7 @@ chmod +x CodeNomad-Tauri-linux-x64-.AppImage | דרישה | היכן עליה להיות זמינה | הדרישה הנוכחית | | --- | --- | --- | -| OpenCode CLI | מארח ההרצה שנבחר, לרבות הפצת WSL שנבחרה כשמתאים | מינימום **2.2.3**; **2.2.7** היא הגרסה המומלצת/שנבדקה. גרסאות חדשות או מותאמות עוברות אימות חוזים ולא חסימה מפני שלא נבדקו. | +| OpenCode CLI | מארח ההרצה שנבחר, לרבות הפצת WSL שנבחרה כשמתאים | מינימום **2.3.0**; **2.3.0** היא הגרסה המומלצת/שנבדקה. גרסאות חדשות או מותאמות עוברות אימות חוזים ולא חסימה מפני שלא נבדקו. | | Git | ב־`PATH` של חשבון שרת הקצה של CodeNomad | נדרש לזהות מאגר, לפעולות Git ול־worktrees. | | Node.js/npm | מארח שרת עצמאי ובנייה מקוד מקור | Node.js 24 LTS; בניות שחזוריות מקוד מקור משתמשות בגרסה המקובעת ב־`.node-version`. גרסאות שולחן העבודה כוללות סביבה משלהן: ה־Node המשולב של Electron או ה־Node ש־Tauri כולל, עם npm. | | תיקיית סביבת עבודה | דיסק נגיש לשרת הקצה | תיקייה פיזית שנפתחה במפורש, לא תיקייה מקומית למכשיר שהוסקה מדפדפן מרוחק. | diff --git a/docs/help/he/opencode.md b/docs/help/he/opencode.md index abde6dbfec..58b2faf4d0 100644 --- a/docs/help/he/opencode.md +++ b/docs/help/he/opencode.md @@ -19,8 +19,8 @@ CodeNomad מתחבר לשירות OpenCode משותף במארח ההרצה. ב | סיווג | דרישה נוכחית | משמעות | | --- | --- | --- | -| מינימום | OpenCode **2.2.3** | כלי יצירת התמונות שמשמש את הגדרות **תמונות** ואת הרחבת Design, לצד סדר ביצוע תקין של משימות JavaScript ב־Code Mode ופורמט ההפעלה החוזרת והדחיסה המקורי; שיחות שנשמרו בגרסאות קודמות נשארות קריאות לאחר העדכון. | -| מומלצת | OpenCode **2.2.7** | יעד שנבדק, בנפרד מהמינימום הטכני. | +| מינימום | OpenCode **2.3.0** | כלי יצירת התמונות שמשמש את הגדרות **תמונות** ואת הרחבת Design, לצד סדר ביצוע תקין של משימות JavaScript ב־Code Mode ופורמט ההפעלה החוזרת והדחיסה המקורי; שיחות שנשמרו בגרסאות קודמות נשארות קריאות לאחר העדכון. היא גם מעבירה את תוצאות סוכני־המשנה כדוחות ברקע, שאותם קוראים כרטיסי סוכני־המשנה והמשימות. | +| מומלצת | OpenCode **2.3.0** | יעד שנבדק; כרגע אותה גרסה כמו המינימום. | | לא מאומתת | גרסה חדשה או מותאמת שלא אומתה במלואה | אינה נדחית רק מפני שלא נבדקה; חוזי ה־API בפועל של השירות המחובר נבדקים. | השירות המחובר חייב לחשוף את החוזים הנדרשים לסשנים, אישורים, טפסים, תיבת קלט וסביבת סשן. תזמון משימות מקורי בודק גם את ממשקי ה־API של התזמון, חבילת התוסף/הספק ואת הגדרת `experimental.schedules` שבתוקף. הזמינות נקבעת לפי היכולות הנצרכות האלה, גם בגרסאות עתידיות תואמות. אם ההגדרה מדווחת על שירות פועל לא נתמך, בחרו/התקינו CLI נתמך והשתמשו בהפעלה מחדש מפורשת של השירות המשותף כשתהיו מוכנים. diff --git a/docs/help/he/server.md b/docs/help/he/server.md index 84e5d9f6a8..f5ea316cd6 100644 --- a/docs/help/he/server.md +++ b/docs/help/he/server.md @@ -8,7 +8,7 @@ 1. התקינו Node.js 24 LTS ו־npm; סביבת הבנייה של המאגר מקובעת ב־`.node-version`. חבילות שולחן העבודה מספקות סביבת ריצה משלהן: Electron משתמש ב־Node המשולב בו, Tauri כולל Node, ושניהם כוללים npm. 2. הוסיפו Git ל־**PATH של תהליך שרת הקצה**. Git בתוך WSL בלבד אינו מספיק לשרת קצה ב־Windows. -3. התקינו או בחרו OpenCode: המינימום הנדרש הוא **2.2.3**, ו־**2.2.7** היא הגרסה המומלצת לבדיקה. בניות חדשות או מותאמות עוברות בדיקות תאימות, לא רשימת היתר של גרסאות שנבדקו. ראו [הגדרת OpenCode](opencode.md). +3. התקינו או בחרו OpenCode: המינימום הנדרש הוא **2.3.0**, ו־**2.3.0** היא הגרסה המומלצת לבדיקה. בניות חדשות או מותאמות עוברות בדיקות תאימות, לא רשימת היתר של גרסאות שנבדקו. ראו [הגדרת OpenCode](opencode.md). 4. בחרו את התיקייה שממנה תפעילו את השרת, או העבירו `--workspace-root` במפורש. ללא Git, שיחות נשארות זמינות רק בתיקייה הפיזית שנפתחה במפורש; פעולות Git ו־worktree נכשלות. התקינו Git והפעילו מחדש את שרת הקצה לאחר שינוי PATH. שורש סביבת עבודה מגביל פתיחה/עיון, לא הרצת סוכן: ראו [אבטחה](security.md). diff --git a/docs/help/he/troubleshooting.md b/docs/help/he/troubleshooting.md index ece36b005e..8a7347b0f9 100644 --- a/docs/help/he/troubleshooting.md +++ b/docs/help/he/troubleshooting.md @@ -42,7 +42,7 @@ Electron משתמש ב־Chromium ומהווה חלופה באותו מארח. א ## סביבת ריצה של OpenCode ו־WSL {#opencode-runtime} 1. פתחו **העדפות → OpenCode** ובדקו את הכרטיס **גרסת OpenCode** (הגרסה המותקנת ומצב השירות הפועל), ואז את קובץ ההרצה שנבחר תחת **קובץ בינארי של OpenCode**. -2. השתמשו בפעולת ההתקנה/העדכון הנתמכת כשסביבת הריצה הנדרשת חסרה. מינימום נוכחי: **2.2.3**; גרסה מומלצת/שנבדקה: **2.2.7**. +2. השתמשו בפעולת ההתקנה/העדכון הנתמכת כשסביבת הריצה הנדרשת חסרה. מינימום נוכחי: **2.3.0**; גרסה מומלצת/שנבדקה: **2.3.0**. 3. אם ה־CLI המותקן שונה מהשירות הפועל, החליטו במפורש אם להפעיל מחדש את השירות המשותף. **הפעל מחדש את שירות OpenCode** זמין תחת **פתרון בעיות** ודורש אישור. הוא קוטע עבודה פעילה בכל הלקוחות המחוברים, אך משמר היסטוריית סשנים. טעינת תצורה מחדש היא פעולה נפרדת: היא משמרת את התהליך אך בונה מחדש Locations טעונים ומבטלת שאלות/אישורים ממתינים. אף אחת אינה רענון תמים. diff --git a/docs/help/ja/install.md b/docs/help/ja/install.md index 3f63b3052e..b5f0a8a2dc 100644 --- a/docs/help/ja/install.md +++ b/docs/help/ja/install.md @@ -45,7 +45,7 @@ Electron の Debian インストールでは Chromium のサンドボックス | 要件 | 必要な場所 | 現在の要件 | | --- | --- | --- | -| OpenCode CLI | 該当する場合は選択した WSL ディストリビューションを含む、選択した実行ホスト | 最低 **2.2.3**。推奨/検証済みの対象は **2.2.7**。新しいバージョンやカスタム版は、未テストという理由で禁止せず、契約を検証します。 | +| OpenCode CLI | 該当する場合は選択した WSL ディストリビューションを含む、選択した実行ホスト | 最低 **2.3.0**。推奨/検証済みの対象は **2.3.0**。新しいバージョンやカスタム版は、未テストという理由で禁止せず、契約を検証します。 | | Git | CodeNomad バックエンドのアカウントの `PATH` | リポジトリの識別、Git 操作、ワークツリーに必要です。 | | Node.js/npm | スタンドアロンサーバーおよびソースビルドのホスト | Node.js 24 LTS。再現可能なソースビルドは `.node-version` に固定されたバージョンを使用します。デスクトップリリースは独自のものを含みます(Electron 内蔵の Node または Tauri 同梱の Node、いずれも npm 付き)。 | | ワークスペースフォルダー | バックエンドからアクセスできるディスク | 明示的に開いた物理フォルダー。リモートブラウザーから推測した端末ローカルのフォルダーではありません。 | diff --git a/docs/help/ja/opencode.md b/docs/help/ja/opencode.md index 956ad1cf38..1b504b0a87 100644 --- a/docs/help/ja/opencode.md +++ b/docs/help/ja/opencode.md @@ -19,8 +19,8 @@ PATH の先頭に古い OpenCode がある場合、提示される操作はそ | 分類 | 現在の要件 | 意味 | | --- | --- | --- | -| 最低 | OpenCode **2.2.3** | **画像** の設定と Design 拡張機能が使う画像生成ツール、Code Mode の JavaScript ジョブの正しい実行順序、ネイティブ再生・圧縮形式。以前のバージョンで保存した会話は、更新後も読み込めます。 | -| 推奨 | OpenCode **2.2.7** | 検証済みの対象。技術的な最低要件とは別です。 | +| 最低 | OpenCode **2.3.0** | **画像** の設定と Design 拡張機能が使う画像生成ツール、Code Mode の JavaScript ジョブの正しい実行順序、ネイティブ再生・圧縮形式。以前のバージョンで保存した会話は、更新後も読み込めます。サブエージェントの結果をバックグラウンドのレポートとして届け、サブエージェントのカードとミッションがそれを読み取ります。 | +| 推奨 | OpenCode **2.3.0** | 検証済みの対象。現在は最低要件と同じバージョンです。 | | 未検証 | 完全には検証していない、新しいまたはカスタムのバージョン | 未テストという理由だけで拒否せず、接続先サービスの実際の API 契約を確認します。 | 接続先サービスは、必要なセッション、権限、フォーム、受信箱、セッション環境の契約を提供する必要があります。ネイティブのミッションスケジュールは、スケジュール API、プラグイン/プロバイダーのバンドル、有効な `experimental.schedules` 設定も確認します。利用可否はこれらの使用する機能で決まり、互換性のある将来のバージョンにも適用されます。セットアップが実行中のサービスを未対応と報告した場合は、対応する CLI を選択/インストールし、準備ができたら明示的に共有サービスを再起動します。 diff --git a/docs/help/ja/server.md b/docs/help/ja/server.md index a9543dc9a6..71bcbadd74 100644 --- a/docs/help/ja/server.md +++ b/docs/help/ja/server.md @@ -8,7 +8,7 @@ 1. Node.js 24 LTS と npm をインストールします。リポジトリのビルドランタイムは `.node-version` で固定されています。デスクトップパッケージは独自のランタイムを提供します。Electron は内蔵の Node を使用し、Tauri は Node を同梱し、どちらも npm を含みます。 2. **バックエンドプロセスの PATH** に Git を配置します。WSL 内だけの Git では Windows バックエンドの要件を満たしません。 -3. OpenCode をインストールまたは選択します。必須の最低バージョンは **2.2.3**、推奨検証対象は **2.2.7** です。新しい/カスタムビルドは、テスト済みバージョンの許可リストではなく、互換性チェックを受けます。[OpenCode のセットアップ](opencode.md)を参照してください。 +3. OpenCode をインストールまたは選択します。必須の最低バージョンは **2.3.0**、推奨検証対象は **2.3.0** です。新しい/カスタムビルドは、テスト済みバージョンの許可リストではなく、互換性チェックを受けます。[OpenCode のセットアップ](opencode.md)を参照してください。 4. サーバーを起動するフォルダーを選ぶか、`--workspace-root` を明示します。 Git がない場合、会話は明示的に開いた物理フォルダー内だけで利用でき、Git とワークツリー操作は失敗します。Git をインストールし、PATH 変更後にバックエンドを再起動してください。ワークスペースルートは開く/参照する範囲の制限であり、エージェント実行の制限ではありません。[セキュリティ](security.md)を参照してください。 diff --git a/docs/help/ja/troubleshooting.md b/docs/help/ja/troubleshooting.md index 836235c838..db759dce3d 100644 --- a/docs/help/ja/troubleshooting.md +++ b/docs/help/ja/troubleshooting.md @@ -42,7 +42,7 @@ Git がなくてもディレクトリ専用の会話は使えますが、ワー ## OpenCode ランタイムと WSL {#opencode-runtime} 1. **設定 → OpenCode** を開き、**OpenCode バージョン** カード(インストール済みバージョンと稼働中サービスの状態)、続いて **OpenCode バイナリ** で選択した実行ファイルを確認します。 -2. 必要なランタイムがなければ、サポートされるインストール/更新操作を使用します。現在の最低要件は **2.2.3**、推奨/検証済みバージョンは **2.2.7** です。 +2. 必要なランタイムがなければ、サポートされるインストール/更新操作を使用します。現在の最低要件は **2.3.0**、推奨/検証済みバージョンは **2.3.0** です。 3. インストール済み CLI と稼働中サービスが異なる場合は、共有サービスを再起動するか明示的に判断します。 **OpenCode サービスを再起動** は **トラブルシューティング** にあり、確認が必要です。接続中の全クライアントの作業を中断しますが、セッション履歴は保持します。設定の再読み込みは別操作であり、プロセスを保ちつつ、読み込み済み Location を再構築し、保留中の質問/権限をキャンセルします。どちらも無害な更新ではありません。 diff --git a/docs/help/ne/install.md b/docs/help/ne/install.md index 64cab5236f..5e96dce3c3 100644 --- a/docs/help/ne/install.md +++ b/docs/help/ne/install.md @@ -45,7 +45,7 @@ Electron Debian स्थापनाले Chromium sandbox कन्फिग | आवश्यकता | कहाँ उपलब्ध हुनुपर्छ | हालको आवश्यकता | | --- | --- | --- | -| OpenCode CLI | चयन गरिएको कार्यान्वयन होस्ट, लागू भए चयन गरिएको WSL वितरणसमेत | न्यूनतम **2.2.3**; **2.2.7** सिफारिस/योग्यता जाँच गरिएको लक्ष्य हो। नयाँ वा अनुकूलित संस्करणलाई परीक्षण नभएको भन्दै निषेध नगरी contract जाँच गरिन्छ। | +| OpenCode CLI | चयन गरिएको कार्यान्वयन होस्ट, लागू भए चयन गरिएको WSL वितरणसमेत | न्यूनतम **2.3.0**; **2.3.0** सिफारिस/योग्यता जाँच गरिएको लक्ष्य हो। नयाँ वा अनुकूलित संस्करणलाई परीक्षण नभएको भन्दै निषेध नगरी contract जाँच गरिन्छ। | | Git | CodeNomad ब्याकएन्ड खाताको `PATH` | रिपोजिटरी पहिचान, Git कार्य र worktree का लागि आवश्यक। | | Node.js/npm | स्वतन्त्र सर्भर र स्रोत-build होस्ट | Node.js 24 LTS; पुनरुत्पादनयोग्य स्रोत build ले `.node-version` मा pinned संस्करण प्रयोग गर्छन्। डेस्कटप रिलिजमा आफ्नै हुन्छ: Electron को integrated Node वा Tauri को bundled Node, npm सहित। | | कार्यस्थान फोल्डर | ब्याकएन्डले पहुँच गर्न सक्ने डिस्क | स्पष्ट रूपमा खोलिएको भौतिक फोल्डर, रिमोट ब्राउजरले अनुमान गरेको उपकरण-स्थानीय फोल्डर होइन। | diff --git a/docs/help/ne/opencode.md b/docs/help/ne/opencode.md index 2ef3711f46..0e0fb7b3a3 100644 --- a/docs/help/ne/opencode.md +++ b/docs/help/ne/opencode.md @@ -19,8 +19,8 @@ PATH मा पुरानो OpenCode पहिले आउँदा दि | वर्ग | हालको आवश्यकता | अर्थ | | --- | --- | --- | -| न्यूनतम | OpenCode **2.2.3** | **छविहरू** सेटिङहरू र Design विस्तारले प्रयोग गर्ने छवि सिर्जना उपकरण, Code Mode मा JavaScript कार्यहरूको सही कार्यान्वयन क्रम र मूल रिप्ले तथा कम्प्याक्सन ढाँचा; पुराना संस्करणले सुरक्षित गरेका कुराकानीहरू अद्यावधिक गरेपछि पनि पढ्न सकिन्छ। | -| सिफारिस | OpenCode **2.2.7** | योग्य ठहरिएको लक्ष्य, प्राविधिक न्यूनतमभन्दा फरक। | +| न्यूनतम | OpenCode **2.3.0** | **छविहरू** सेटिङहरू र Design विस्तारले प्रयोग गर्ने छवि सिर्जना उपकरण, Code Mode मा JavaScript कार्यहरूको सही कार्यान्वयन क्रम र मूल रिप्ले तथा कम्प्याक्सन ढाँचा; पुराना संस्करणले सुरक्षित गरेका कुराकानीहरू अद्यावधिक गरेपछि पनि पढ्न सकिन्छ। यसले सबएजेन्टका नतिजा पृष्ठभूमि रिपोर्टका रूपमा पनि पठाउँछ, जुन सबएजेन्ट कार्ड र मिसनहरूले पढ्छन्। | +| सिफारिस | OpenCode **2.3.0** | योग्य ठहरिएको लक्ष्य; हाल न्यूनतमसँग एउटै संस्करण। | | अप्रमाणित | पूर्ण जाँच नभएको नयाँ वा custom संस्करण | परीक्षण नभएकै कारण अस्वीकार हुँदैन; जोडिएको सेवाका वास्तविक API contract जाँचिन्छन्। | जडित सेवाले आवश्यक सत्र, अनुमति, फारम, आगमन-पेटिका र सत्र-वातावरण सम्झौता दिनुपर्छ। नेटिभ मिसन समयतालिकाले तालिका API, प्लगइन/प्रदायक प्याकेज र प्रभावकारी `experimental.schedules` सेटिङ पनि जाँच्छ। मिल्ने भावी संस्करणमा समेत उपलब्धता यी प्रयोग गरिने क्षमतामा निर्भर हुन्छ। सेटअपले चलिरहेको सेवा असमर्थित भने समर्थित CLI छानेर/स्थापना गरेर तयार हुँदा साझा सेवा स्पष्ट रूपमा पुनः सुरु गर्नुहोस्। diff --git a/docs/help/ne/server.md b/docs/help/ne/server.md index 28d277c2b5..9e6de11698 100644 --- a/docs/help/ne/server.md +++ b/docs/help/ne/server.md @@ -8,7 +8,7 @@ project र tool भएको ठाउँमा CodeNomad चलाएर स 1. Node.js 24 LTS र npm स्थापना गर्नुहोस्; repository को build runtime `.node-version` मा pinned छ। desktop package ले आफ्नै runtime दिन्छ: Electron ले यसको integrated Node प्रयोग गर्छ, Tauri ले Node समावेश गर्छ र दुवैमा npm हुन्छ। 2. Git लाई **backend प्रक्रियाको PATH** मा राख्नुहोस्। WSL भित्रको Git मात्र Windows backend का लागि पुग्दैन। -3. OpenCode स्थापना वा चयन गर्नुहोस्: आवश्यक न्यूनतम **2.2.3**, सिफारिस qualification लक्ष्य **2.2.7**। नयाँ/custom build मा compatibility जाँच हुन्छ, tested-version allowlist होइन। [OpenCode सेटअप](opencode.md) हेर्नुहोस्। +3. OpenCode स्थापना वा चयन गर्नुहोस्: आवश्यक न्यूनतम **2.3.0**, सिफारिस qualification लक्ष्य **2.3.0**। नयाँ/custom build मा compatibility जाँच हुन्छ, tested-version allowlist होइन। [OpenCode सेटअप](opencode.md) हेर्नुहोस्। 4. server सुरु गर्ने फोल्डर रोज्नुहोस्, वा `--workspace-root` स्पष्ट दिनुहोस्। Git बिना स्पष्ट खोलिएको physical folder मा मात्र कुराकानी उपलब्ध हुन्छन्; Git र worktree कार्य असफल हुन्छन्। Git स्थापना र PATH परिवर्तनपछि backend restart गर्नुहोस्। workspace root ले opening/browsing सीमित गर्छ, agent execution होइन: [सुरक्षा](security.md) हेर्नुहोस्। diff --git a/docs/help/ne/troubleshooting.md b/docs/help/ne/troubleshooting.md index f9cfcccd47..16ec513def 100644 --- a/docs/help/ne/troubleshooting.md +++ b/docs/help/ne/troubleshooting.md @@ -42,7 +42,7 @@ owned worktree वा conversation placement verify गर्न नसके ## OpenCode runtime र WSL {#opencode-runtime} 1. **प्राथमिकताहरू → OpenCode** खोली **OpenCode संस्करण** card (installed version र running service status), त्यसपछि **OpenCode बाइनरी** अन्तर्गतको selected executable जाँच्नुहोस्। -2. आवश्यक runtime नभए समर्थित installation/update प्रयोग गर्नुहोस्। हालको minimum: **2.2.3**; recommended/qualified संस्करण: **2.2.7**। +2. आवश्यक runtime नभए समर्थित installation/update प्रयोग गर्नुहोस्। हालको minimum: **2.3.0**; recommended/qualified संस्करण: **2.3.0**। 3. installed CLI running service भन्दा फरक भए shared service restart गर्ने कि स्पष्ट निर्णय गर्नुहोस्। **OpenCode सेवा पुनः सुरु गर्नुहोस्** **समस्या समाधान** अन्तर्गत उपलब्ध छ र पुष्टि चाहिन्छ। हरेक connected client को सक्रिय काम interrupt गर्छ, तर session history राख्छ। configuration reload छुट्टै हो: process राख्छ तर loaded Location पुनर्निर्माण र pending question/permission रद्द गर्छ। कुनै हानिरहित refresh होइन। diff --git a/docs/help/ru/install.md b/docs/help/ru/install.md index 2a9161165b..ee83cd29e1 100644 --- a/docs/help/ru/install.md +++ b/docs/help/ru/install.md @@ -45,7 +45,7 @@ chmod +x CodeNomad-Tauri-linux-x64-.AppImage | Требование | Где должно быть доступно | Текущее требование | | --- | --- | --- | -| OpenCode CLI | Выбранный хост выполнения, включая выбранный дистрибутив WSL, если применимо | Минимум **2.2.3**; **2.2.7** — рекомендуемая/проверенная цель. Для новых и пользовательских версий проверяются контракты, а не вводится запрет на непроверенные версии. | +| OpenCode CLI | Выбранный хост выполнения, включая выбранный дистрибутив WSL, если применимо | Минимум **2.3.0**; **2.3.0** — рекомендуемая/проверенная цель. Для новых и пользовательских версий проверяются контракты, а не вводится запрет на непроверенные версии. | | Git | `PATH` учётной записи серверной части CodeNomad | Необходим для идентификации репозитория, операций Git и worktree. | | Node.js/npm | Хост отдельного сервера и сборки из исходников | Node.js 24 LTS; воспроизводимые сборки из исходников используют версию, закреплённую в `.node-version`. Настольные релизы содержат свою среду: встроенный Node Electron или Node из комплекта Tauri, с npm. | | Папка рабочего пространства | Диск, доступный серверной части | Явно открытая физическая папка, а не локальная папка устройства, предполагаемая удалённым браузером. | diff --git a/docs/help/ru/opencode.md b/docs/help/ru/opencode.md index 2ce45a483a..505b96936d 100644 --- a/docs/help/ru/opencode.md +++ b/docs/help/ru/opencode.md @@ -19,8 +19,8 @@ CodeNomad подключается к общей службе OpenCode на хо | Классификация | Текущее требование | Значение | | --- | --- | --- | -| Минимум | OpenCode **2.2.3** | Инструмент генерации изображений, который используют настройки **Изображения** и расширение Design, а также правильный порядок выполнения задач JavaScript в Code Mode и нативный формат воспроизведения и сжатия; беседы, сохранённые более ранними версиями, остаются доступными после обновления. | -| Рекомендуемая | OpenCode **2.2.7** | Проверенная цель, отличная от технического минимума. | +| Минимум | OpenCode **2.3.0** | Инструмент генерации изображений, который используют настройки **Изображения** и расширение Design, а также правильный порядок выполнения задач JavaScript в Code Mode и нативный формат воспроизведения и сжатия; беседы, сохранённые более ранними версиями, остаются доступными после обновления. Она также передаёт результаты субагентов фоновыми отчётами, которые читают карточки субагентов и Миссии. | +| Рекомендуемая | OpenCode **2.3.0** | Проверенная цель; сейчас та же версия, что и минимум. | | Непроверенная | Новая или пользовательская версия, не прошедшая полную проверку | Не отклоняется лишь из-за отсутствия тестирования; проверяются реальные API-контракты подключённой службы. | Подключённая служба должна предоставлять необходимые контракты сессий, разрешений, форм, входящих и окружения сессий. Нативное расписание Миссий также проверяет API расписаний, комплект плагина/провайдера и действующую настройку `experimental.schedules`. Доступность определяется этими используемыми возможностями, включая совместимые будущие версии. Если настройка сообщает о неподдерживаемой работающей службе, выберите/установите поддерживаемый CLI и выполните явный перезапуск общей службы, когда будете готовы. diff --git a/docs/help/ru/server.md b/docs/help/ru/server.md index 6aca677732..d2a8735f89 100644 --- a/docs/help/ru/server.md +++ b/docs/help/ru/server.md @@ -8,7 +8,7 @@ 1. Установите Node.js 24 LTS и npm; среда сборки репозитория закреплена в `.node-version`. Настольные пакеты предоставляют свою среду: Electron использует встроенный Node, Tauri включает Node, оба включают npm. 2. Добавьте Git в **PATH процесса серверной части**. Одного Git внутри WSL недостаточно для серверной части Windows. -3. Установите или выберите OpenCode: минимум **2.2.3**, рекомендуемая проверенная цель — **2.2.7**. Новые или пользовательские сборки проходят проверку совместимости, а не список разрешённых проверенных версий. См. [настройку OpenCode](opencode.md). +3. Установите или выберите OpenCode: минимум **2.3.0**, рекомендуемая проверенная цель — **2.3.0**. Новые или пользовательские сборки проходят проверку совместимости, а не список разрешённых проверенных версий. См. [настройку OpenCode](opencode.md). 4. Выберите папку запуска сервера или явно передайте `--workspace-root`. Без Git разговоры доступны только в явно открытой физической папке; операции Git и worktree не работают. Установите Git и перезапустите серверную часть после изменения PATH. Корень рабочего пространства ограничивает открытие/просмотр, не выполнение агента: см. [безопасность](security.md). diff --git a/docs/help/ru/troubleshooting.md b/docs/help/ru/troubleshooting.md index 95f73d9824..9d6e6fd417 100644 --- a/docs/help/ru/troubleshooting.md +++ b/docs/help/ru/troubleshooting.md @@ -42,7 +42,7 @@ Electron использует Chromium и служит альтернативо ## Среда OpenCode и WSL {#opencode-runtime} 1. Откройте **Настройки → OpenCode** и проверьте карточку **Версия OpenCode** (установленная версия и статус работающей службы), затем выбранный исполняемый файл в **Бинарник OpenCode**. -2. При отсутствии нужной среды используйте поддерживаемую установку/обновление. Текущий минимум: **2.2.3**; рекомендуемая/проверенная версия: **2.2.7**. +2. При отсутствии нужной среды используйте поддерживаемую установку/обновление. Текущий минимум: **2.3.0**; рекомендуемая/проверенная версия: **2.3.0**. 3. Если установленный CLI отличается от службы, явно решите, перезапускать ли общую службу. **Перезапустить службу OpenCode** находится в **Устранение неполадок** и требует подтверждения. Прерывает активную работу всех клиентов, но сохраняет историю сессий. Перезагрузка конфигурации — отдельное действие: сохраняет процесс, но пересоздаёт загруженные Location и отменяет ожидающие вопросы/разрешения. Ни одно не является безобидным обновлением. diff --git a/docs/help/tr/install.md b/docs/help/tr/install.md index 0486796f41..6c1520bdbe 100644 --- a/docs/help/tr/install.md +++ b/docs/help/tr/install.md @@ -45,7 +45,7 @@ Electron Debian kurulumu, Chromium'un korumalı alanını yapılandırır. Kurul | Gereksinim | Nerede bulunması gerektiği | Mevcut gereksinim | | --- | --- | --- | -| OpenCode CLI | Geçerli olduğu yerde seçilen WSL dağıtımı da dahil olmak üzere seçilen yürütme ana bilgisayarı | Minimum **2.2.3**; **2.2.7** önerilen/uygun hedeftir. Daha yeni veya özel sürümler, test edilmemiş sürüm yasağı yerine sözleşme doğrulamasından geçer. | +| OpenCode CLI | Geçerli olduğu yerde seçilen WSL dağıtımı da dahil olmak üzere seçilen yürütme ana bilgisayarı | Minimum **2.3.0**; **2.3.0** önerilen/uygun hedeftir. Daha yeni veya özel sürümler, test edilmemiş sürüm yasağı yerine sözleşme doğrulamasından geçer. | | Git | CodeNomad arka uç hesabının `PATH`'si | Depo kimliği, Git işlemleri ve çalışma ağaçları için gereklidir. | | Node.js/npm | Bağımsız sunucu ve kaynak derleme ana bilgisayarı | Node.js 24 LTS; tekrarlanabilir kaynak derlemeleri `.node-version` dosyasında sabitlenen sürümü kullanır. Masaüstü sürümleri kendi çalışma zamanlarını içerir: Electron'un yerleşik Node'u veya Tauri'nin paketlediği Node, npm ile. | | Çalışma alanı klasörü | Arka uçtan erişilebilen disk | Uzak bir tarayıcı tarafından çıkarılan yerel cihaz klasörü değil, açıkça açılmış bir fiziksel klasör. | diff --git a/docs/help/tr/opencode.md b/docs/help/tr/opencode.md index 4c7d239531..05eb6f6b22 100644 --- a/docs/help/tr/opencode.md +++ b/docs/help/tr/opencode.md @@ -19,8 +19,8 @@ Yüklü yürütülebilir dosya ve çalışan hizmetin farklı sürümleri olabil | Sınıflandırma | Mevcut gereksinim | Anlamı | | --- | --- | --- | -| Asgari | OpenCode **2.2.3** | **Görseller** ayarlarının ve Design uzantısının kullandığı görsel oluşturma aracı, Code Mode içindeki JavaScript görevlerinin doğru yürütme sırası ve yerel yeniden oynatma ve sıkıştırma biçimi; önceki sürümlerle kaydedilen konuşmalar güncellemeden sonra da okunabilir. | -| Önerilen | OpenCode **2.2.7** | Teknik alt sınırdan farklı, doğrulanan hedef. | +| Asgari | OpenCode **2.3.0** | **Görseller** ayarlarının ve Design uzantısının kullandığı görsel oluşturma aracı, Code Mode içindeki JavaScript görevlerinin doğru yürütme sırası ve yerel yeniden oynatma ve sıkıştırma biçimi; önceki sürümlerle kaydedilen konuşmalar güncellemeden sonra da okunabilir. Ayrıca alt ajan sonuçlarını arka plan raporları olarak iletir; bunları alt ajan kartları ve Görevler okur. | +| Önerilen | OpenCode **2.3.0** | Doğrulanan hedef; şu anda asgari sürümle aynı. | | Doğrulanmamış | Tam olarak doğrulanmamış daha yeni veya özel bir sürüm | Yalnızca denenmemiş olduğu için reddedilmez; bağlı hizmetin gerçek API sözleşmeleri kontrol edilir. | Bağlı hizmet gerekli oturum, izin, Form, gelen kutusu ve oturum ortamı sözleşmelerini sunmalıdır. Yerel Görev zamanlaması ayrıca zamanlama API'lerini, eklenti/sağlayıcı paketini ve etkin `experimental.schedules` ayarını denetler. Kullanılabilirlik, uyumlu gelecek sürümler dahil, kullanılan bu yeteneklere bağlıdır. Kurulum desteklenmeyen bir çalışan hizmet bildirirse desteklenen bir CLI seçin/yükleyin ve hazır olduğunuzda paylaşılan hizmeti açıkça yeniden başlatın. diff --git a/docs/help/tr/server.md b/docs/help/tr/server.md index 93d08eec1a..91f58d96c6 100644 --- a/docs/help/tr/server.md +++ b/docs/help/tr/server.md @@ -8,7 +8,7 @@ Aynı kullanıcı arayüzü [çoklu proje sekmeleri ve çalışma ağaçları](p 1. Node.js 24 LTS ve npm'yi yükleyin; havuzun derleme çalışma zamanı `.node-version` dosyasında sabitlenmiştir. Masaüstü paketleri kendi çalışma zamanlarını sağlar: Electron yerleşik Node'unu kullanır, Tauri Node'u paketler ve ikisi de npm içerir. 2. Git'i **arka uç sürecinin PATH** değişkenine ekleyin. Yalnızca WSL içindeki Git, Windows arka ucu için yeterli değildir. -3. OpenCode'u yükleyin veya seçin: **2.2.3** gerekli minimum değer, **2.2.7** ise önerilen yeterlilik hedefidir. Daha yeni veya özel derlemeler, test edilmiş sürüm izin verilenler listesine değil, uyumluluk denetimlerine tabi tutulur. Bkz. [OpenCode kurulumu](opencode.md). +3. OpenCode'u yükleyin veya seçin: **2.3.0** gerekli minimum değer, **2.3.0** ise önerilen yeterlilik hedefidir. Daha yeni veya özel derlemeler, test edilmiş sürüm izin verilenler listesine değil, uyumluluk denetimlerine tabi tutulur. Bkz. [OpenCode kurulumu](opencode.md). 4. Sunucunun başlatılacağı klasörü seçin veya `--workspace-root`'yi açıkça iletin. Git olmadan, konuşmalar yalnızca açıkça açılan fiziksel klasörde kullanılabilir durumda kalır; Git ve çalışma ağacı işlemleri başarısız oluyor. Git'i yükleyin ve PATH değişikliğinden sonra arka ucu yeniden başlatın. Çalışma alanı kökü, aracının yürütülmesini değil, açmayı/göz atmayı sınırlar: bkz. [Güvenlik](security.md). diff --git a/docs/help/tr/troubleshooting.md b/docs/help/tr/troubleshooting.md index b04869b968..9a909ee9f7 100644 --- a/docs/help/tr/troubleshooting.md +++ b/docs/help/tr/troubleshooting.md @@ -42,7 +42,7 @@ Sahip olunan bir çalışma ağacı veya konuşma yerleşimi doğrulanamıyorsa, ## OpenCode çalışma zamanı ve WSL {#opencode-runtime} 1. **Preferences → OpenCode** öğesini açın ve **OpenCode sürümü** kartını (kurulu sürüm ve çalışan hizmet durumu), ardından **OpenCode Binary** altındaki seçili yürütülebilir dosyayı kontrol edin. -2. Gerekli çalışma zamanı yoksa desteklenen kurulum/güncelleme eylemini kullanın. Güncel alt sınır: **2.2.3**; önerilen/doğrulanan sürüm: **2.2.7**. +2. Gerekli çalışma zamanı yoksa desteklenen kurulum/güncelleme eylemini kullanın. Güncel alt sınır: **2.3.0**; önerilen/doğrulanan sürüm: **2.3.0**. 3. Kurulu CLI, çalışan hizmetten farklıysa, paylaşılan hizmetin yeniden başlatılıp başlatılmayacağına açıkça karar verin. **OpenCode hizmetini yeniden başlat**, **Sorun giderme** altında mevcuttur ve onay gerektirir. Bağlı her istemcideki aktif çalışmayı kesintiye uğratır ancak oturum geçmişini korur. Yapılandırmanın yeniden yüklenmesi ayrı bir eylemdir: süreci korur ancak yüklenen Konumları yeniden oluşturur ve bekleyen soruları/izinleri iptal eder. Zararsız bir yenileme de değildir. diff --git a/docs/help/zh-Hans/install.md b/docs/help/zh-Hans/install.md index 0724ac7401..2d888d6298 100644 --- a/docs/help/zh-Hans/install.md +++ b/docs/help/zh-Hans/install.md @@ -45,7 +45,7 @@ Electron Debian 安装过程会配置 Chromium 沙箱。不要通过禁用沙箱 | 要求 | 必须可用的位置 | 当前要求 | | --- | --- | --- | -| OpenCode CLI | 所选执行主机,适用时包括所选 WSL 发行版 | 最低 **2.2.3**;建议/已验证目标为 **2.2.7**。更新版本或自定义版本会接受契约验证,而非因未经测试就被禁止。 | +| OpenCode CLI | 所选执行主机,适用时包括所选 WSL 发行版 | 最低 **2.3.0**;建议/已验证目标为 **2.3.0**。更新版本或自定义版本会接受契约验证,而非因未经测试就被禁止。 | | Git | CodeNomad 后端账户的 `PATH` | 仓库身份识别、Git 操作和工作树必需。 | | Node.js/npm | 独立服务器和源码构建主机 | Node.js 24 LTS;可重现的源码构建使用 `.node-version` 中固定的版本。桌面发行包自带:Electron 内置 Node 或 Tauri 附带 Node,均含 npm。 | | 工作区文件夹 | 后端可访问的磁盘 | 显式打开的物理文件夹,而非远程浏览器推断出的设备本地文件夹。 | diff --git a/docs/help/zh-Hans/opencode.md b/docs/help/zh-Hans/opencode.md index f3fb79882d..c6369d57e7 100644 --- a/docs/help/zh-Hans/opencode.md +++ b/docs/help/zh-Hans/opencode.md @@ -19,8 +19,8 @@ CodeNomad 连接到执行主机上的共享 OpenCode 服务。选择 CLI、更 | 分类 | 当前要求 | 含义 | | --- | --- | --- | -| 最低 | OpenCode **2.2.3** | **图像**设置和 Design 扩展使用的图像生成工具、Code Mode 中 JavaScript 任务的正确执行顺序,以及原生重放和压缩格式;旧版本保存的对话在更新后仍可读取。 | -| 推荐 | OpenCode **2.2.7** | 已验证目标,与技术最低要求不同。 | +| 最低 | OpenCode **2.3.0** | **图像**设置和 Design 扩展使用的图像生成工具、Code Mode 中 JavaScript 任务的正确执行顺序,以及原生重放和压缩格式;旧版本保存的对话在更新后仍可读取。它还以后台报告的形式传递子代理结果,供子代理卡片和任务读取。 | +| 推荐 | OpenCode **2.3.0** | 已验证目标;目前与最低版本相同。 | | 未验证 | 尚未完整验证的更新版本或自定义版本 | 不会仅因未经测试而拒绝;会检查所连接服务的实际 API 契约。 | 所连接的服务必须提供所需的会话、权限、Form、收件箱和会话环境契约。原生任务计划还会检查计划 API、插件/提供商包和实际生效的 `experimental.schedules` 设置。可用性取决于这些实际使用的能力,也适用于兼容的未来版本。如果设置报告运行中的服务不受支持,请选择/安装受支持的 CLI,并在准备好后显式重启共享服务。 diff --git a/docs/help/zh-Hans/server.md b/docs/help/zh-Hans/server.md index 1a739c843a..c168bdd5ae 100644 --- a/docs/help/zh-Hans/server.md +++ b/docs/help/zh-Hans/server.md @@ -8,7 +8,7 @@ 1. 安装 Node.js 24 LTS 和 npm;仓库构建运行时固定在 `.node-version` 中。桌面包提供自己的运行时:Electron 使用内置 Node,Tauri 附带 Node,两者均包含 npm。 2. 将 Git 加入**后端进程的 PATH**。仅 WSL 内的 Git 不满足 Windows 后端。 -3. 安装或选择 OpenCode:必需最低版本为 **2.2.3**,推荐验证目标为 **2.2.7**。更新或自定义构建会接受兼容检查,而非已测试版本白名单。参阅 [OpenCode 设置](opencode.md)。 +3. 安装或选择 OpenCode:必需最低版本为 **2.3.0**,推荐验证目标为 **2.3.0**。更新或自定义构建会接受兼容检查,而非已测试版本白名单。参阅 [OpenCode 设置](opencode.md)。 4. 选择启动服务器的文件夹,或显式传入 `--workspace-root`。 没有 Git 时,对话仅在显式打开的物理文件夹内可用;Git 和工作树操作失败。安装 Git,更改 PATH 后重启后端。工作区根目录限制打开/浏览,而非智能体执行:参阅[安全](security.md)。 diff --git a/docs/help/zh-Hans/troubleshooting.md b/docs/help/zh-Hans/troubleshooting.md index 517ae9c2b7..9281740634 100644 --- a/docs/help/zh-Hans/troubleshooting.md +++ b/docs/help/zh-Hans/troubleshooting.md @@ -42,7 +42,7 @@ Electron 使用 Chromium,可作为同一主机上的替代方案。如果 AppI ## OpenCode 运行时与 WSL {#opencode-runtime} 1. 打开**偏好设置 → OpenCode**,检查 **OpenCode 版本**卡片(已安装版本和运行服务状态),然后检查 **OpenCode 可执行文件**下所选的可执行文件。 -2. 缺少必需运行时时,使用受支持安装/更新操作。当前最低版本:**2.2.3**;推荐/已验证版本:**2.2.7**。 +2. 缺少必需运行时时,使用受支持安装/更新操作。当前最低版本:**2.3.0**;推荐/已验证版本:**2.3.0**。 3. 已安装 CLI 与运行服务不同时,显式决定是否重启共享服务。 **故障排查**下提供**重启 OpenCode 服务**,需要确认。会中断所有已连接客户端的活动工作,但保留会话历史。重新加载配置是独立操作:保留进程,但重建已加载 Location 并取消待处理问题/权限。两者都不是无害刷新。 diff --git a/package-lock.json b/package-lock.json index 0dbd0f1b9a..a5f07e597f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,12 +33,6 @@ ] } }, - "node_modules/7zip-bin": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/7zip-bin/-/7zip-bin-5.2.0.tgz", - "integrity": "sha512-ukTPVhqG4jNzMro2qA9HSCSSVJN3aN7tlb+hfqYCt3ER0yWroeA2VR38MNrOHLQ/cVj+DaIMad0kFCtWWowh/A==", - "license": "MIT" - }, "node_modules/@ai-sdk/provider": { "version": "3.0.8", "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-3.0.8.tgz", @@ -212,18 +206,18 @@ } }, "node_modules/@aws-sdk/core": { - "version": "3.979.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.979.0.tgz", - "integrity": "sha512-E3eeLhIOxlIc9NPsZbtpHuk8W/gEZ3YvFauNPrrrtNtF7Pq1cwSrFwA51Z1EIoUY6VFvTyltyLRNUhaa0aSKSA==", + "version": "3.981.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.981.0.tgz", + "integrity": "sha512-Mnu7gaDrC5UCdyH8uLxLfB2eWbjE/HbjKX1U1J2VQxG3TTATUDObW2wU3I8iH3e9YH5NN2CY6w1mlAIe2XJ3jg==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "^3.975.0", - "@aws-sdk/xml-builder": "^3.972.42", + "@aws-sdk/types": "^3.975.1", + "@aws-sdk/xml-builder": "^3.972.43", "@aws/lambda-invoke-store": "^0.3.0", - "@smithy/core": "^3.37.0", - "@smithy/signature-v4": "^5.7.4", - "@smithy/types": "^4.19.0", + "@smithy/core": "^3.40.0", + "@smithy/signature-v4": "^5.7.5", + "@smithy/types": "^4.20.0", "bowser": "^2.11.0", "tslib": "^2.6.2" }, @@ -232,16 +226,16 @@ } }, "node_modules/@aws-sdk/credential-provider-cognito-identity": { - "version": "3.972.78", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.972.78.tgz", - "integrity": "sha512-oFab6FAl8EHhMkUR4VOOgVMYCSq0QSLTY3UpYXXAyoIYMinm0vYqTtfDWQuvWN2VjohTppeDPht1L7sCr7MnFg==", + "version": "3.972.83", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.972.83.tgz", + "integrity": "sha512-yaHdWS2q6N2eKG9yNftDB/W7uG0OqfViXBihZwb5XPyVIMXYffpEgWp/4haIURrMSCYkLfmfMrHZhFSoPKgmQA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/nested-clients": "^3.997.53", - "@aws-sdk/types": "^3.975.0", - "@smithy/core": "^3.37.0", - "@smithy/types": "^4.19.0", + "@aws-sdk/nested-clients": "^3.998.3", + "@aws-sdk/types": "^3.975.1", + "@smithy/core": "^3.40.0", + "@smithy/types": "^4.20.0", "tslib": "^2.6.2" }, "engines": { @@ -249,16 +243,16 @@ } }, "node_modules/@aws-sdk/credential-provider-env": { - "version": "3.972.79", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.972.79.tgz", - "integrity": "sha512-fhfGcGiY70EcH9H8N/K+K2NMW3wF2J/7slHYJo0u1mF7XBpU7dlaJ8xmc0jBYUzJLRbKz4+BtVwwqrH7eZNTNw==", + "version": "3.972.84", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.972.84.tgz", + "integrity": "sha512-akZJetiMVeLRHsKzYh3LamDCo74ZUCeo0XoyRKMEMZT5qP7ReM6LhpioBCyuqKP5Vav5gEOeCmaQV0VVQr1Meg==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "^3.979.0", - "@aws-sdk/types": "^3.975.0", - "@smithy/core": "^3.37.0", - "@smithy/types": "^4.19.0", + "@aws-sdk/core": "^3.981.0", + "@aws-sdk/types": "^3.975.1", + "@smithy/core": "^3.40.0", + "@smithy/types": "^4.20.0", "tslib": "^2.6.2" }, "engines": { @@ -266,18 +260,18 @@ } }, "node_modules/@aws-sdk/credential-provider-http": { - "version": "3.972.81", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.972.81.tgz", - "integrity": "sha512-bp2TG0g2seN4LMEOjIVxkDpb/ls4GsDiguteIFxxQUxFBoyhf0pmfGbZCddHORrg58K72c+7CMlaDEw921c/3Q==", + "version": "3.972.86", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.972.86.tgz", + "integrity": "sha512-U4mHaDRPWAn63yhl7FXIzbppNmW1F+4dSLeuiUpej2v3Xb6rGwvayEJ8SdlrdMV+/mZtd+GStTEP2HqurEzXtw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "^3.979.0", - "@aws-sdk/types": "^3.975.0", - "@smithy/core": "^3.37.0", - "@smithy/fetch-http-handler": "^5.8.0", - "@smithy/node-http-handler": "^4.13.0", - "@smithy/types": "^4.19.0", + "@aws-sdk/core": "^3.981.0", + "@aws-sdk/types": "^3.975.1", + "@smithy/core": "^3.40.0", + "@smithy/fetch-http-handler": "^5.8.1", + "@smithy/node-http-handler": "^4.14.2", + "@smithy/types": "^4.20.0", "tslib": "^2.6.2" }, "engines": { @@ -285,24 +279,24 @@ } }, "node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.973.24", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.973.24.tgz", - "integrity": "sha512-ULdPVLKR46qGsVCmbilDWWcry5qAR8nYm7RZewaNtCvVLPSIyb9zSWabTA9M07s10ZpEPUl67rcORyXE50Obog==", + "version": "3.973.30", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.973.30.tgz", + "integrity": "sha512-r6r6499GWoGN943NA5YEhBEQ6TEOGTf7tTOBhHd/zw0UbNvSzd1/zPCNcDkPmRarA+e24X7KgxutqxjoWcskBg==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "^3.979.0", - "@aws-sdk/credential-provider-env": "^3.972.79", - "@aws-sdk/credential-provider-http": "^3.972.81", - "@aws-sdk/credential-provider-login": "^3.972.86", - "@aws-sdk/credential-provider-process": "^3.972.79", - "@aws-sdk/credential-provider-sso": "^3.973.23", - "@aws-sdk/credential-provider-web-identity": "^3.972.85", - "@aws-sdk/nested-clients": "^3.997.53", - "@aws-sdk/types": "^3.975.0", - "@smithy/core": "^3.37.0", + "@aws-sdk/core": "^3.981.0", + "@aws-sdk/credential-provider-env": "^3.972.84", + "@aws-sdk/credential-provider-http": "^3.972.86", + "@aws-sdk/credential-provider-login": "^3.972.92", + "@aws-sdk/credential-provider-process": "^3.972.84", + "@aws-sdk/credential-provider-sso": "^3.973.28", + "@aws-sdk/credential-provider-web-identity": "^3.972.90", + "@aws-sdk/nested-clients": "^3.998.3", + "@aws-sdk/types": "^3.975.1", + "@smithy/core": "^3.40.0", "@smithy/credential-provider-imds": "^4.5.2", - "@smithy/types": "^4.19.0", + "@smithy/types": "^4.20.0", "tslib": "^2.6.2" }, "engines": { @@ -310,17 +304,17 @@ } }, "node_modules/@aws-sdk/credential-provider-login": { - "version": "3.972.86", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-login/-/credential-provider-login-3.972.86.tgz", - "integrity": "sha512-e6cD5PUesauIYxV4IaOLNfEh0FnhUeIxnY4AZzmEH9PsPGpScROmrdzA0MaaCxiDVzGPtxcJW7Ku7vKU+w2p9Q==", + "version": "3.972.92", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-login/-/credential-provider-login-3.972.92.tgz", + "integrity": "sha512-96bcp9Pe/Xd60OEwncZ+kAQTQSu+fJnpUGz1qE6ghF5jnETmrk8XMU86mIP3lolvnCgR61XbZ+Ht6hdBjiQOmQ==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "^3.979.0", - "@aws-sdk/nested-clients": "^3.997.53", - "@aws-sdk/types": "^3.975.0", - "@smithy/core": "^3.37.0", - "@smithy/types": "^4.19.0", + "@aws-sdk/core": "^3.981.0", + "@aws-sdk/nested-clients": "^3.998.3", + "@aws-sdk/types": "^3.975.1", + "@smithy/core": "^3.40.0", + "@smithy/types": "^4.20.0", "tslib": "^2.6.2" }, "engines": { @@ -328,22 +322,22 @@ } }, "node_modules/@aws-sdk/credential-provider-node": { - "version": "3.972.91", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.972.91.tgz", - "integrity": "sha512-0j1oy7cFwsMaIpueqFGeQG0VpulcF61ucKKqZUha9rZXvRK91chmAxFfov6Q155TerBGgt1dvy9n9Y3O4HD/UQ==", + "version": "3.972.97", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.972.97.tgz", + "integrity": "sha512-E4a0IXXJVsIdo/K9roX4JAEfI0JJr7KTPymkbKgETRDqEcLygE4ZlLTe24+7Qkh8Dl5YpnPd+Tt0DOPJDFXIwA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/credential-provider-env": "^3.972.79", - "@aws-sdk/credential-provider-http": "^3.972.81", - "@aws-sdk/credential-provider-ini": "^3.973.24", - "@aws-sdk/credential-provider-process": "^3.972.79", - "@aws-sdk/credential-provider-sso": "^3.973.23", - "@aws-sdk/credential-provider-web-identity": "^3.972.85", - "@aws-sdk/types": "^3.975.0", - "@smithy/core": "^3.37.0", + "@aws-sdk/credential-provider-env": "^3.972.84", + "@aws-sdk/credential-provider-http": "^3.972.86", + "@aws-sdk/credential-provider-ini": "^3.973.30", + "@aws-sdk/credential-provider-process": "^3.972.84", + "@aws-sdk/credential-provider-sso": "^3.973.28", + "@aws-sdk/credential-provider-web-identity": "^3.972.90", + "@aws-sdk/types": "^3.975.1", + "@smithy/core": "^3.40.0", "@smithy/credential-provider-imds": "^4.5.2", - "@smithy/types": "^4.19.0", + "@smithy/types": "^4.20.0", "tslib": "^2.6.2" }, "engines": { @@ -351,16 +345,16 @@ } }, "node_modules/@aws-sdk/credential-provider-process": { - "version": "3.972.79", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.972.79.tgz", - "integrity": "sha512-b9QnxJiZSccqpkSNNWkHRwU0XKbybD1p+j02m/qJc4mIwLkwQpJYfA/cbjg6hgGOoD7W1/imi+obSzDk/T1oNg==", + "version": "3.972.84", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.972.84.tgz", + "integrity": "sha512-199C6OpNejd0nq9GFAkEFIKids1FL0R6LJtL9c1OTiDOXki7S1OduuPxW4+hE0LwndcYJ7YHOuYTlqScfpCocA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "^3.979.0", - "@aws-sdk/types": "^3.975.0", - "@smithy/core": "^3.37.0", - "@smithy/types": "^4.19.0", + "@aws-sdk/core": "^3.981.0", + "@aws-sdk/types": "^3.975.1", + "@smithy/core": "^3.40.0", + "@smithy/types": "^4.20.0", "tslib": "^2.6.2" }, "engines": { @@ -368,18 +362,18 @@ } }, "node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.973.23", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.973.23.tgz", - "integrity": "sha512-KZiZ6RUQY4mahZVreo1pp5usUDOJAf613NLicgC0MQWA0rfdkRDaeT2K0WClYEHjMy9BKvXRxc087Kr1QjV9MA==", + "version": "3.973.28", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.973.28.tgz", + "integrity": "sha512-bGg7wH8wVDJQIcJggO9lg1ZYbG7l+PbLwHuM3Bi/e1TlCZhU712JS1W3tdRpyptdJD1UGyhBNGO/YrhrQCHKbg==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "^3.979.0", - "@aws-sdk/nested-clients": "^3.997.53", - "@aws-sdk/token-providers": "3.1160.0", - "@aws-sdk/types": "^3.975.0", - "@smithy/core": "^3.37.0", - "@smithy/types": "^4.19.0", + "@aws-sdk/core": "^3.981.0", + "@aws-sdk/nested-clients": "^3.998.3", + "@aws-sdk/token-providers": "3.1166.0", + "@aws-sdk/types": "^3.975.1", + "@smithy/core": "^3.40.0", + "@smithy/types": "^4.20.0", "tslib": "^2.6.2" }, "engines": { @@ -387,17 +381,17 @@ } }, "node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.972.85", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.972.85.tgz", - "integrity": "sha512-r9bZrCczKj0V46yRpFZavTmPlqBPtziEBZnKVHcGZ5NwpUrzHwhzizc7ntMfw5KPWHmL35C2tChwPH3MIy2TMQ==", + "version": "3.972.90", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.972.90.tgz", + "integrity": "sha512-duLeE3xlf0viHeH+1RM4z5duR3b32BCZTWVMu+MbxFPjQBxy7hmIGEqt5hekuFPRuXoyhMovjNl+PNNsb5oiGQ==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "^3.979.0", - "@aws-sdk/nested-clients": "^3.997.53", - "@aws-sdk/types": "^3.975.0", - "@smithy/core": "^3.37.0", - "@smithy/types": "^4.19.0", + "@aws-sdk/core": "^3.981.0", + "@aws-sdk/nested-clients": "^3.998.3", + "@aws-sdk/types": "^3.975.1", + "@smithy/core": "^3.40.0", + "@smithy/types": "^4.20.0", "tslib": "^2.6.2" }, "engines": { @@ -434,19 +428,19 @@ } }, "node_modules/@aws-sdk/nested-clients": { - "version": "3.997.53", - "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.997.53.tgz", - "integrity": "sha512-JRcs7wwU/cMw62hbLUxlh/wyrHaL/4KOnJs/Hny0ZIo4GY8biBMEfLJrYDEBMF8wDIewtDZsBWT9Rna4uaRemw==", + "version": "3.998.3", + "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.998.3.tgz", + "integrity": "sha512-acHTTzMB13CU6dU4sxABYExMI3PQM2zStWH2MiUwJp/7QKTrLg2f7mbzSXoegW2kYOk2tdqQYagsZrWB8Xv7eA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "^3.979.0", - "@aws-sdk/signature-v4-multi-region": "^3.996.50", - "@aws-sdk/types": "^3.975.0", - "@smithy/core": "^3.37.0", - "@smithy/fetch-http-handler": "^5.8.0", - "@smithy/node-http-handler": "^4.13.0", - "@smithy/types": "^4.19.0", + "@aws-sdk/core": "^3.981.0", + "@aws-sdk/signature-v4-multi-region": "^3.996.52", + "@aws-sdk/types": "^3.975.1", + "@smithy/core": "^3.40.0", + "@smithy/fetch-http-handler": "^5.8.1", + "@smithy/node-http-handler": "^4.14.2", + "@smithy/types": "^4.20.0", "tslib": "^2.6.2" }, "engines": { @@ -454,15 +448,15 @@ } }, "node_modules/@aws-sdk/signature-v4-multi-region": { - "version": "3.996.50", - "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.996.50.tgz", - "integrity": "sha512-Ob9GCZ3YnGPws696zTYW/rLFYHa9QLh6DgTCnkHb+0jhHNBgHWM8Ui2b+yrIjkfDsRVsglyrOey6tOOG/VWxMA==", + "version": "3.996.52", + "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.996.52.tgz", + "integrity": "sha512-6W6SjGc8OXUhMzNxU1X922ghD+PP1XvzmCk5Scui0jaYsLezycMYR1RaLp5xTIOUrhTXyb4DnAbPr3fBgmdnzg==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "^3.975.0", - "@smithy/signature-v4": "^5.7.4", - "@smithy/types": "^4.19.0", + "@aws-sdk/types": "^3.975.1", + "@smithy/signature-v4": "^5.7.5", + "@smithy/types": "^4.20.0", "tslib": "^2.6.2" }, "engines": { @@ -470,17 +464,17 @@ } }, "node_modules/@aws-sdk/token-providers": { - "version": "3.1160.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.1160.0.tgz", - "integrity": "sha512-KHT4W6fRqXEDYM0lIPQD55bvZSk1xmzShUcEcw0dZYiUsgFVmilnfwY8K+tn2V/MG1Lv+SX7wkbzq/ld4XiygQ==", + "version": "3.1166.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.1166.0.tgz", + "integrity": "sha512-ngJ8mxXqtQ9mnp7QV6TWKJCxkpjVfPWxKQSc2FYhCyCfOVFIGdFv7P+/RqVffFrJAorwBPpktnv32gNlcEgF4g==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws-sdk/core": "^3.979.0", - "@aws-sdk/nested-clients": "^3.997.53", - "@aws-sdk/types": "^3.975.0", - "@smithy/core": "^3.37.0", - "@smithy/types": "^4.19.0", + "@aws-sdk/core": "^3.981.0", + "@aws-sdk/nested-clients": "^3.998.3", + "@aws-sdk/types": "^3.975.1", + "@smithy/core": "^3.40.0", + "@smithy/types": "^4.20.0", "tslib": "^2.6.2" }, "engines": { @@ -488,13 +482,13 @@ } }, "node_modules/@aws-sdk/types": { - "version": "3.975.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.975.0.tgz", - "integrity": "sha512-WQlhs6juByzWOzj5fwxOx0mPJaEqMcG/sDpl3Id61B3XhKE63xY+0QWcnG+sWR/sCfprmreyUo1lM7IKZmHMzw==", + "version": "3.975.1", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.975.1.tgz", + "integrity": "sha512-7rGxUkCB2QPoQOeJmonmAICTN2zrH+fpmi1p4Iwu72lnxNaMhOgqcbpyddifnM1DBb19TWQ1u6z/XjkaFNEDWw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.19.0", + "@smithy/types": "^4.20.0", "tslib": "^2.6.2" }, "engines": { @@ -515,13 +509,13 @@ } }, "node_modules/@aws-sdk/xml-builder": { - "version": "3.972.42", - "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.972.42.tgz", - "integrity": "sha512-smX8/gNP8Kjq+CWTBMZQLQ912vOQjiWExzwzvMO+eujPB5RY8IbtF0AGdUUXHKN7KoDWK9dIcuW0WG269kiP6w==", + "version": "3.972.43", + "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.972.43.tgz", + "integrity": "sha512-rG8QVx4DOrJWptsogu1Aq+CDsnPKaBrAlJpKLxrJrIDXAq1ElnW0yQjjBnlWSXll0cDakCG6UDvaqwz0A9d9Og==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.19.0", + "@smithy/types": "^4.20.0", "tslib": "^2.6.2" }, "engines": { @@ -2110,13 +2104,13 @@ } }, "node_modules/@effect/opentelemetry": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@effect/opentelemetry/-/opentelemetry-4.0.6.tgz", - "integrity": "sha512-xhLR1EN4ZNaKM7Bx59SCFiRNduFzgH8LZXDrCpPN8MpQ93V0GQcFHTBah5T3EXO2v+5HTEacdTgetIA0Creqvw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@effect/opentelemetry/-/opentelemetry-4.1.0.tgz", + "integrity": "sha512-j9bNzQaoQvcnimBFMG0i3piEW20E8HjkXAQHTJN/XqG2e4uJ9zCv53/HCNzD7+ooFn5S4nwQy/BOXeNReMIe+A==", "dev": true, "license": "MIT", "engines": { - "node": ">=18.0.0" + "node": ">=22.19.0" }, "peerDependencies": { "@opentelemetry/api": ">=1.9.0 <2.0.0", @@ -2128,7 +2122,7 @@ "@opentelemetry/sdk-trace-node": ">=2.0.0 <3.0.0", "@opentelemetry/sdk-trace-web": ">=2.0.0 <3.0.0", "@opentelemetry/semantic-conventions": ">=1.33.0 <2.0.0", - "effect": "^4.0.6" + "effect": "^4.1.0" }, "peerDependenciesMeta": { "@opentelemetry/api": { @@ -2158,27 +2152,27 @@ } }, "node_modules/@effect/platform-node": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@effect/platform-node/-/platform-node-4.0.6.tgz", - "integrity": "sha512-gXvGHAy0/8PZbWvMMguloDUyeSP+rzYEo3FSEqUuGduxo9ORcGioDxPI+GOLCIFfam7VuNkmSUxBOiRMIrMrBw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@effect/platform-node/-/platform-node-4.1.0.tgz", + "integrity": "sha512-v+X7moGVF9k5oMVvz0slA+NgtEod+W+oygeI285MDJgSlUCW3JcqElj+cD3rlijFZtpKhC7RLkU1GuCxjGHTpA==", "dev": true, "license": "MIT", "dependencies": { - "@effect/platform-node-shared": "^4.0.6", + "@effect/platform-node-shared": "^4.1.0", "undici": "^8.12.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=22.19.0" }, "peerDependencies": { - "effect": "^4.0.6", + "effect": "^4.1.0", "redis": ">=5.0.0 <7.0.0" } }, "node_modules/@effect/platform-node-shared": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@effect/platform-node-shared/-/platform-node-shared-4.0.6.tgz", - "integrity": "sha512-0PhyC4uG30xGtsajnxjkcBWfTjNRzUh4ZKl1Kvo/MNyCTb+W2O+fBzf7wCRCoqt+nLudiq4V7vX40Q8XIBuMaQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@effect/platform-node-shared/-/platform-node-shared-4.1.0.tgz", + "integrity": "sha512-uYQfFRoxWLo8fIhiSeBcmz/R1ooOfE3HF3cWHFgxz82tZMk2Wn02BGABcdLmaAch9VpDLbtWnuhSxNyBsGMUFg==", "dev": true, "license": "MIT", "dependencies": { @@ -2186,16 +2180,16 @@ "ws": "^8.22.0" }, "engines": { - "node": ">=18.0.0" + "node": ">=22.19.0" }, "peerDependencies": { - "effect": "^4.0.6" + "effect": "^4.1.0" } }, "node_modules/@effect/platform-node/node_modules/undici": { - "version": "8.12.3", - "resolved": "https://registry.npmjs.org/undici/-/undici-8.12.3.tgz", - "integrity": "sha512-+fdndUTwBP86cVjihTp21hZHo7d6oj1c/47XPA3lL8mM0XHs+C4EkcjmgRsFnFk2f/UONGDy9ItBItmXsLOQHw==", + "version": "8.12.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-8.12.4.tgz", + "integrity": "sha512-8Mx+uNKKER2bA4AdtedkqRbwUCIJFr2nJckXRe5yrDqzePqwLP7VNcctN8/XdmDSbF7mS+jJKIszlL+vbam1VA==", "dev": true, "license": "MIT", "engines": { @@ -3329,15 +3323,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@fastify/static/node_modules/lru-cache": { - "version": "11.5.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz", - "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==", - "license": "BlueOak-1.0.0", - "engines": { - "node": "20 || >=22" - } - }, "node_modules/@fastify/static/node_modules/minimatch": { "version": "11.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.5.tgz", @@ -3363,22 +3348,6 @@ "node": ">=16 || 14 >=14.17" } }, - "node_modules/@fastify/static/node_modules/path-scurry": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-3.0.0.tgz", - "integrity": "sha512-1pTbQqH1wIwMi/eleQ5leFTTCkzFsPcgXNjwOA8YGGW/W4/kHT3dssE7Z6NH+zuqNLOzOB0uaD61yl7cAcVhgg==", - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/@floating-ui/core": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.3.tgz", @@ -4262,14 +4231,6 @@ "node": ">=10" } }, - "node_modules/@neuralnomads/codenomad": { - "resolved": "packages/server", - "link": true - }, - "node_modules/@neuralnomads/codenomad-electron-app": { - "resolved": "packages/electron-app", - "link": true - }, "node_modules/@mermaid-js/tiny": { "version": "12.3.0", "resolved": "https://registry.npmjs.org/@mermaid-js/tiny/-/tiny-12.3.0.tgz", @@ -4279,6 +4240,14 @@ "node": ">=22.12.0" } }, + "node_modules/@neuralnomads/codenomad": { + "resolved": "packages/server", + "link": true + }, + "node_modules/@neuralnomads/codenomad-electron-app": { + "resolved": "packages/electron-app", + "link": true + }, "node_modules/@noble/hashes": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.4.0.tgz", @@ -4346,44 +4315,6 @@ "node": "^20.17.0 || >=22.9.0" } }, - "node_modules/@npmcli/agent/node_modules/agent-base": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", - "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14" - } - }, - "node_modules/@npmcli/agent/node_modules/http-proxy-agent": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", - "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.0", - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/@npmcli/agent/node_modules/https-proxy-agent": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", - "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, "node_modules/@npmcli/agent/node_modules/lru-cache": { "version": "11.5.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz", @@ -4453,9 +4384,9 @@ } }, "node_modules/@npmcli/arborist/node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "version": "5.0.13", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.13.tgz", + "integrity": "sha512-Vh3dmFbc4wZeox7M9I/0L9GfFd83Su4+yCck/OF9Gi/P/dAHn0RT7X4K9R7gMNMhDck3DvhR6QXsnQdjjgwNvQ==", "dev": true, "license": "MIT", "dependencies": { @@ -4506,9 +4437,9 @@ } }, "node_modules/@npmcli/arborist/node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", "dev": true, "license": "ISC", "bin": { @@ -4538,26 +4469,10 @@ "node": "^20.17.0 || >=22.9.0" } }, - "node_modules/@npmcli/config/node_modules/ci-info": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.4.0.tgz", - "integrity": "sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/@npmcli/config/node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", "dev": true, "license": "ISC", "bin": { @@ -4581,9 +4496,9 @@ } }, "node_modules/@npmcli/fs/node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", "dev": true, "license": "ISC", "bin": { @@ -4634,9 +4549,9 @@ } }, "node_modules/@npmcli/git/node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", "dev": true, "license": "ISC", "bin": { @@ -4706,9 +4621,9 @@ } }, "node_modules/@npmcli/map-workspaces/node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "version": "5.0.13", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.13.tgz", + "integrity": "sha512-Vh3dmFbc4wZeox7M9I/0L9GfFd83Su4+yCck/OF9Gi/P/dAHn0RT7X4K9R7gMNMhDck3DvhR6QXsnQdjjgwNvQ==", "dev": true, "license": "MIT", "dependencies": { @@ -4736,16 +4651,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@npmcli/map-workspaces/node_modules/lru-cache": { - "version": "11.5.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz", - "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": "20 || >=22" - } - }, "node_modules/@npmcli/map-workspaces/node_modules/minimatch": { "version": "11.0.6", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.6.tgz", @@ -4763,33 +4668,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@npmcli/map-workspaces/node_modules/minipass": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", - "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/@npmcli/map-workspaces/node_modules/path-scurry": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-3.0.0.tgz", - "integrity": "sha512-1pTbQqH1wIwMi/eleQ5leFTTCkzFsPcgXNjwOA8YGGW/W4/kHT3dssE7Z6NH+zuqNLOzOB0uaD61yl7cAcVhgg==", - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "dev": true - }, "node_modules/@npmcli/metavuln-calculator": { "version": "9.0.3", "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-9.0.3.tgz", @@ -4808,9 +4686,9 @@ } }, "node_modules/@npmcli/metavuln-calculator/node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", "dev": true, "license": "ISC", "bin": { @@ -4870,9 +4748,9 @@ } }, "node_modules/@npmcli/package-json/node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "version": "5.0.13", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.13.tgz", + "integrity": "sha512-Vh3dmFbc4wZeox7M9I/0L9GfFd83Su4+yCck/OF9Gi/P/dAHn0RT7X4K9R7gMNMhDck3DvhR6QXsnQdjjgwNvQ==", "dev": true, "license": "MIT", "dependencies": { @@ -4924,9 +4802,9 @@ } }, "node_modules/@npmcli/package-json/node_modules/minimatch": { - "version": "11.0.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.6.tgz", - "integrity": "sha512-6NZbDPQIRnsJFjJ9wbd5659OKaTHCqpPHdldE3WwArjxr5wLxHIwnx4eTGcPebpVBZZQbITvQQIx8K0VGXoT3Q==", + "version": "11.0.8", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.8.tgz", + "integrity": "sha512-nFQuYSTVrGvysVBps5Ih+0BdnYFN/Cj3C816r6+p7yK+FHrVLGE4O4N9AFwykrlNlvM2HYt+Rad1Uiro6h88Ig==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -4940,37 +4818,10 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@npmcli/package-json/node_modules/minipass": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", - "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/@npmcli/package-json/node_modules/path-scurry": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-3.0.0.tgz", - "integrity": "sha512-1pTbQqH1wIwMi/eleQ5leFTTCkzFsPcgXNjwOA8YGGW/W4/kHT3dssE7Z6NH+zuqNLOzOB0uaD61yl7cAcVhgg==", - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "dev": true - }, "node_modules/@npmcli/package-json/node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", "dev": true, "license": "ISC", "bin": { @@ -5033,13 +4884,12 @@ } }, "node_modules/@npmcli/query/node_modules/postcss-selector-parser": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.7.tgz", - "integrity": "sha512-wWBro/7hJ40ye6TPiXkUQoXKCw23xSsjriUvqd7Uls9Sso3oLiON1flc18cCdnjgCRXw4fBVqUJJeOdDTh3P3g==", + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.2.1.tgz", + "integrity": "sha512-GwxlMgTTXwIom+ebC7an3k6RaJDwklRQQnfiXsLPGicu8FYV/k/+1/9YY2OU2+r938H2t4X0TDxoif+HP2rjzQ==", "dev": true, "license": "MIT", "dependencies": { - "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" }, "engines": { @@ -5074,32 +4924,32 @@ } }, "node_modules/@opencode/ai": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@opencode/ai/-/ai-2.2.3.tgz", - "integrity": "sha512-fUMZmeRCK/lqjKtYlWu+3JvQ46U7x3kNwgyhB1wfR0GhXRX5KeXf/vfYupjS4IkOHWay/zBTP1ZUsRDmOGmlOA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@opencode/ai/-/ai-2.3.0.tgz", + "integrity": "sha512-CsaY18G5cXtNvOgvONaxguFeaWf+gENSYKzDnYIIREpoSLjLm9oF2v+adaE4nUozM1qIMR4+s23VOViaRypFLw==", "dev": true, "license": "MIT", "dependencies": { "@aws-sdk/credential-providers": "3.1057.0", - "@opencode/schema": "2.2.3", + "@opencode/schema": "2.3.0", "@smithy/eventstream-codec": "4.2.14", "@smithy/util-utf8": "4.2.2", "aws4fetch": "1.0.20", - "effect": "4.0.6", + "effect": "4.1.0", "google-auth-library": "10.5.0" } }, "node_modules/@opencode/client": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@opencode/client/-/client-2.2.3.tgz", - "integrity": "sha512-ph1uIGrQl1bO6jZ9RCVfa/aBsz0nCq3pnpikExQ0W8oKUwS9mH5tQfpwG0e85V6W4KPeOQCwGUWB0WTzXnYO/Q==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@opencode/client/-/client-2.3.0.tgz", + "integrity": "sha512-xu74XGiYIqLZ2FzIrtjaR5UNWWXY3fRln0WLgZoQTR/wWMgG+T9XGQQGCl8ry8jnCFsJVokiHemBqft9oMzC1A==", "license": "MIT", "dependencies": { - "@opencode/protocol": "2.2.3", - "@opencode/schema": "2.2.3" + "@opencode/protocol": "2.3.0", + "@opencode/schema": "2.3.0" }, "peerDependencies": { - "effect": "4.0.6", + "effect": "4.1.0", "solid-js": ">=1.9.0" }, "peerDependenciesMeta": { @@ -5112,24 +4962,24 @@ } }, "node_modules/@opencode/plugin": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@opencode/plugin/-/plugin-2.2.3.tgz", - "integrity": "sha512-JK8FW4VHPHkQKgKi9m7kKdx9L1CRSNYpxNR1DtXC9SAe7f8huWoXEN+LH2vv38KEanOfY5OdcUhBUHKAwidyeg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@opencode/plugin/-/plugin-2.3.0.tgz", + "integrity": "sha512-wfBz8UKpy1jb8EAuFqvqbmVG6+6X6B5B+54UAGmofuT7vZ6F6cC3OQwlw1ObEi4NTKG66y0x6Z6zz4AG0H2N9Q==", "dev": true, "license": "MIT", "dependencies": { "@ai-sdk/provider": "3.0.8", - "@opencode/ai": "2.2.3", - "@opencode/client": "2.2.3", - "@opencode/protocol": "2.2.3", - "@opencode/schema": "2.2.3", - "@opencode/util": "2.2.3", - "effect": "4.0.6" + "@opencode/ai": "2.3.0", + "@opencode/client": "2.3.0", + "@opencode/protocol": "2.3.0", + "@opencode/schema": "2.3.0", + "@opencode/util": "2.3.0", + "effect": "4.1.0" }, "peerDependencies": { - "@opencode/theme": "2.2.3", - "@opentui/core": ">=0.8.0", - "@opentui/solid": ">=0.8.0", + "@opencode/theme": "2.3.0", + "@opentui/core": ">=0.8.4", + "@opentui/solid": ">=0.8.4", "electron": "*", "solid-js": ">=1.9.0", "vite": ">=6", @@ -5160,35 +5010,35 @@ } }, "node_modules/@opencode/protocol": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@opencode/protocol/-/protocol-2.2.3.tgz", - "integrity": "sha512-4SBCchbfwMb2AK27vH+Qlwrnnbzw4tMT7LsFJRNwO/H7LPKbsMJJsAlRYjcyxQYEPDNYVXyFCF1rCkrA3OeCJg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@opencode/protocol/-/protocol-2.3.0.tgz", + "integrity": "sha512-V37zTGXVa1j9aXUvUY01YN1EtfMMSWoT5pSCc6M0UsGdTUZX6QL/vMgGVGzPvbt7+Z8Vo40/0DFRPyqT4sdvnw==", "license": "MIT", "dependencies": { - "@opencode/schema": "2.2.3", - "effect": "4.0.6" + "@opencode/schema": "2.3.0", + "effect": "4.1.0" } }, "node_modules/@opencode/schema": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@opencode/schema/-/schema-2.2.3.tgz", - "integrity": "sha512-5Lm6Aw6E3nHigLJcSOteontUKv/9fzjfEXaBvaIHAageNvq0hYBgWSBv0ZikaAj1pJr5e1y9TSW6cbWqQcjMjg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@opencode/schema/-/schema-2.3.0.tgz", + "integrity": "sha512-9CPS4+BXWUs3ELIWo68AA2q4XEPMkRYwpGYdqd/wNz3jRTOB8swef+2/z+igkCel+UtlX+dAlGTmSnid/JcoKw==", "license": "MIT", "dependencies": { "@standard-schema/spec": "1.1.0", - "effect": "4.0.6" + "effect": "4.1.0" } }, "node_modules/@opencode/util": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@opencode/util/-/util-2.2.3.tgz", - "integrity": "sha512-Xp9hb909LaYJ667Yzg5LkCBrj9h44umOiH9WF7Mj4ZZlOKQDr5H3a3LEw0r7a8ED8yfnXMrN8xFMeL6EojBmGQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@opencode/util/-/util-2.3.0.tgz", + "integrity": "sha512-0OIjkq9EQ/p50Wft57yr2NIyuzz1zqaBydwu/5rzEy1+Bu5hJkr5oUqAvt1ye6zZdBW3K8kiFGXFQsChX4cNPg==", "dev": true, "license": "MIT", "dependencies": { - "@effect/opentelemetry": "4.0.6", - "@effect/platform-node": "4.0.6", - "@effect/platform-node-shared": "4.0.6", + "@effect/opentelemetry": "4.1.0", + "@effect/platform-node": "4.1.0", + "@effect/platform-node-shared": "4.1.0", "@npmcli/arborist": "9.4.0", "@npmcli/config": "10.8.1", "@opentelemetry/api": "1.9.0", @@ -5201,7 +5051,7 @@ "@opentelemetry/sdk-trace-base": "2.8.0", "@opentelemetry/sdk-trace-node": "2.8.0", "cross-spawn": "7.0.6", - "effect": "4.0.6", + "effect": "4.1.0", "glob": "13.0.5", "mime-types": "3.0.2", "minimatch": "10.2.5", @@ -5221,9 +5071,9 @@ } }, "node_modules/@opencode/util/node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "version": "5.0.13", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.13.tgz", + "integrity": "sha512-Vh3dmFbc4wZeox7M9I/0L9GfFd83Su4+yCck/OF9Gi/P/dAHn0RT7X4K9R7gMNMhDck3DvhR6QXsnQdjjgwNvQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5251,16 +5101,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@opencode/util/node_modules/lru-cache": { - "version": "11.5.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz", - "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": "20 || >=22" - } - }, "node_modules/@opencode/util/node_modules/mime-db": { "version": "1.54.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", @@ -5305,33 +5145,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@opencode/util/node_modules/minipass": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", - "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/@opencode/util/node_modules/path-scurry": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-3.0.0.tgz", - "integrity": "sha512-1pTbQqH1wIwMi/eleQ5leFTTCkzFsPcgXNjwOA8YGGW/W4/kHT3dssE7Z6NH+zuqNLOzOB0uaD61yl7cAcVhgg==", - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "dev": true - }, "node_modules/@opentelemetry/api": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", @@ -5534,9 +5347,9 @@ } }, "node_modules/@opentelemetry/semantic-conventions": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.44.0.tgz", - "integrity": "sha512-E3JkOlMBi3N8OGGkbl7tFyqk2MAS6/lySRZBK3Mu7AzjF1fT8oIChH9ChE48SUWzDn9Kdwta+G/p5LJ4xW4CLQ==", + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.45.0.tgz", + "integrity": "sha512-aOP45mbcOKbQVvFWfQmgoOPT8R2iwbbbgl83k4CujGV9BrJhFr3qG55MFpwFs4YLabpuW3HhzUY9eQxPlDqaZw==", "dev": true, "license": "Apache-2.0", "engines": { @@ -5641,16 +5454,6 @@ "integrity": "sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg==", "license": "MIT" }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=14" - } - }, "node_modules/@popperjs/core": { "version": "2.11.8", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", @@ -5674,6 +5477,85 @@ "url": "https://github.com/sponsors/sxzz" } }, + "node_modules/@redis/bloom": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/@redis/bloom/-/bloom-6.3.1.tgz", + "integrity": "sha512-dpF9j2yJDoPzSCaZn0MSB3xzmnXQVJeTSAWJcQVcgbmluwhpFeemmII0cF1t+WYfoVS+shEFq79+MmUItgzJLg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 20.0.0" + }, + "peerDependencies": { + "@redis/client": "^6.3.1" + } + }, + "node_modules/@redis/client": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/@redis/client/-/client-6.3.1.tgz", + "integrity": "sha512-masbfVKULdoAofwddepZxRhWa4w6zvBHn6TRn90TRPrRkVIlGCur3pFqwWaCbMxtYI9twepkz63e/T/tEH8GjA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 20.0.0" + }, + "peerDependencies": { + "@node-rs/xxhash": "^1.1.0", + "@opentelemetry/api": ">=1 <2" + }, + "peerDependenciesMeta": { + "@node-rs/xxhash": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + } + } + }, + "node_modules/@redis/json": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/@redis/json/-/json-6.3.1.tgz", + "integrity": "sha512-fMz4kUwJzEftcU9EMaqsjZcUwzpTQLOYRqhQsAD6uKvZWeamblK13ZhgO5SzVSZVk31jmwLeTRpU5GAl5egfUw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 20.0.0" + }, + "peerDependencies": { + "@redis/client": "^6.3.1" + } + }, + "node_modules/@redis/search": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/@redis/search/-/search-6.3.1.tgz", + "integrity": "sha512-T67pvPUpW82VrZLvihO8O2DFMC7eY2oMAzMzapCbiPZn7mdWqHMEIlohYim12gIawT5kn6qT/Cvmm4WulKB+kQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 20.0.0" + }, + "peerDependencies": { + "@redis/client": "^6.3.1" + } + }, + "node_modules/@redis/time-series": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/@redis/time-series/-/time-series-6.3.1.tgz", + "integrity": "sha512-MNDgrm+i63M/1a+XA+HcDsScwt4uBh/fGGJ84swTQZTFK5K5wMmxdlTRa4ZgmNJzjxMaszW/ipPScMUGV3aAMg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 20.0.0" + }, + "peerDependencies": { + "@redis/client": "^6.3.1" + } + }, "node_modules/@rolldown/binding-android-arm-eabi": { "version": "1.2.16", "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.16.tgz", @@ -6645,13 +6527,13 @@ } }, "node_modules/@smithy/core": { - "version": "3.38.0", - "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.38.0.tgz", - "integrity": "sha512-aLyyCnK2p4yvNA2TaM+5owXqb+rZGSiUKEsNP329AzeYnERtAz7NrlTbRsaxqmZ0ooxwoID8LMm959UGQQDIsg==", + "version": "3.40.0", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.40.0.tgz", + "integrity": "sha512-DssGno52pzZ5m6RlDtyKuBIpZNPg9pqgs0CnNDKz9IatxCsmvNmJNn5Zn6rf77MthZo9wf89OvZFhTY/RwxhxQ==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.19.0", + "@smithy/types": "^4.20.0", "tslib": "^2.6.2" }, "engines": { @@ -6690,14 +6572,14 @@ } }, "node_modules/@smithy/fetch-http-handler": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.8.0.tgz", - "integrity": "sha512-ycSJu3tFAQ4v04CBB0agqFMVsSQ1iG3yw+SpgxRqKfaURpQD4CZ8Wn0zPMmSnOuTpTh65Vz+EA0rMrw089wvkA==", + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.8.1.tgz", + "integrity": "sha512-h8BdMUrUBhMhMaeK7QqAdINRZezCGuYOCpcOZZ1ewxbHST9rdTd09xwNpvLTYfzDRehxQiReK4SKbdYZxBA+ew==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@smithy/core": "^3.33.3", - "@smithy/types": "^4.18.0", + "@smithy/core": "^3.39.0", + "@smithy/types": "^4.20.0", "tslib": "^2.6.2" }, "engines": { @@ -6718,14 +6600,14 @@ } }, "node_modules/@smithy/node-http-handler": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.14.0.tgz", - "integrity": "sha512-j24RS5V9J52u0z81RpgF7H55p4bS6UCEIxF4ZYzTYh6M9hzXvjAIAYwgLobqf7vJq3xib5VXc7nX3YesV8Rx4A==", + "version": "4.14.2", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.14.2.tgz", + "integrity": "sha512-i1uORV1v3qBqP43ayRKzIdm1q5x14tf8N4Dd06/QUX1Szm6VxHMrTsu20X5E63UFsaNZCRjI4SXG0jDmqYa+3w==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@smithy/core": "^3.38.0", - "@smithy/types": "^4.19.0", + "@smithy/core": "^3.39.0", + "@smithy/types": "^4.20.0", "tslib": "^2.6.2" }, "engines": { @@ -6748,9 +6630,9 @@ } }, "node_modules/@smithy/types": { - "version": "4.19.0", - "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.19.0.tgz", - "integrity": "sha512-r7jh49VJxGerfAcTQA6gXcKc+98zOp/tqRwzYjgOE+iSQsP6cEU1hq2QzbuipmP68QtYdY9wKEhiCQZIzHgZ4Q==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.20.0.tgz", + "integrity": "sha512-lCA6QG22dPk9ecHbv91jDQZsmtPUjdS1aE2Il6NNPqe7DrYc0dZQi6DhcESk2KYXH2sp5xbAcGdYMZDFnuzA2A==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -7371,9 +7253,9 @@ } }, "node_modules/@tufjs/models/node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "version": "5.0.13", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.13.tgz", + "integrity": "sha512-Vh3dmFbc4wZeox7M9I/0L9GfFd83Su4+yCck/OF9Gi/P/dAHn0RT7X4K9R7gMNMhDck3DvhR6QXsnQdjjgwNvQ==", "dev": true, "license": "MIT", "dependencies": { @@ -7659,6 +7541,12 @@ "node": ">=10.0.0" } }, + "node_modules/7zip-bin": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/7zip-bin/-/7zip-bin-5.2.0.tgz", + "integrity": "sha512-ukTPVhqG4jNzMro2qA9HSCSSVJN3aN7tlb+hfqYCt3ER0yWroeA2VR38MNrOHLQ/cVj+DaIMad0kFCtWWowh/A==", + "license": "MIT" + }, "node_modules/abbrev": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-4.0.0.tgz", @@ -7692,6 +7580,7 @@ "version": "7.1.4", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, "license": "MIT", "engines": { "node": ">= 14" @@ -7701,6 +7590,7 @@ "version": "8.20.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", + "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", @@ -7772,6 +7662,7 @@ "version": "3.1.9", "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz", "integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==", + "dev": true, "funding": [ { "type": "github", @@ -8422,6 +8313,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, "license": "MIT" }, "node_modules/base64-js": { @@ -8523,6 +8415,7 @@ "version": "2.1.7", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.7.tgz", "integrity": "sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g==", + "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" @@ -8706,9 +8599,9 @@ } }, "node_modules/cacache/node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "version": "5.0.13", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.13.tgz", + "integrity": "sha512-Vh3dmFbc4wZeox7M9I/0L9GfFd83Su4+yCck/OF9Gi/P/dAHn0RT7X4K9R7gMNMhDck3DvhR6QXsnQdjjgwNvQ==", "dev": true, "license": "MIT", "dependencies": { @@ -8718,19 +8611,6 @@ "node": "20 || >=22" } }, - "node_modules/cacache/node_modules/fs-minipass": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz", - "integrity": "sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==", - "dev": true, - "license": "ISC", - "dependencies": { - "minipass": "^7.0.3" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/cacache/node_modules/glob": { "version": "14.0.4", "resolved": "https://registry.npmjs.org/glob/-/glob-14.0.4.tgz", @@ -8760,9 +8640,9 @@ } }, "node_modules/cacache/node_modules/minimatch": { - "version": "11.0.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.6.tgz", - "integrity": "sha512-6NZbDPQIRnsJFjJ9wbd5659OKaTHCqpPHdldE3WwArjxr5wLxHIwnx4eTGcPebpVBZZQbITvQQIx8K0VGXoT3Q==", + "version": "11.0.8", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.8.tgz", + "integrity": "sha512-nFQuYSTVrGvysVBps5Ih+0BdnYFN/Cj3C816r6+p7yK+FHrVLGE4O4N9AFwykrlNlvM2HYt+Rad1Uiro6h88Ig==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -8776,33 +8656,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/cacache/node_modules/minipass": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", - "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/cacache/node_modules/path-scurry": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-3.0.0.tgz", - "integrity": "sha512-1pTbQqH1wIwMi/eleQ5leFTTCkzFsPcgXNjwOA8YGGW/W4/kHT3dssE7Z6NH+zuqNLOzOB0uaD61yl7cAcVhgg==", - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "dev": true - }, "node_modules/cacheable-lookup": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", @@ -9285,6 +9138,7 @@ "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -9305,19 +9159,6 @@ "node": ">=8" } }, - "node_modules/cssesc": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", - "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", - "dev": true, - "license": "MIT", - "bin": { - "cssesc": "bin/cssesc" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/csstype": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", @@ -9790,9 +9631,9 @@ } }, "node_modules/effect": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/effect/-/effect-4.0.6.tgz", - "integrity": "sha512-Tc3mkzuLR6t6P9dhLt0D2GrxYtmU5td4XEJEiXCmILz53IRIfJyHsKZWjTA3xEjiwpNTtXBgI4iqYPxMztBDrw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/effect/-/effect-4.1.0.tgz", + "integrity": "sha512-lGx2MJJyrXA8RZb2UpQ/0Nkb5Utaimby7oD92+18noBxLPE85IFOvptdzau8dvcxAOwfwHo9iqapbKeFzqQM/Q==", "license": "MIT" }, "node_modules/ejs": { @@ -10642,6 +10483,19 @@ "node": ">=12" } }, + "node_modules/fs-minipass": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz", + "integrity": "sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -11319,6 +11173,7 @@ "version": "7.0.6", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, "license": "MIT", "dependencies": { "agent-base": "^7.1.2", @@ -11335,6 +11190,24 @@ "dev": true, "license": "MPL-2.0" }, + "node_modules/iconv-lite": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz", + "integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/idb": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz", @@ -11366,9 +11239,9 @@ } }, "node_modules/ignore-walk/node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "version": "5.0.13", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.13.tgz", + "integrity": "sha512-Vh3dmFbc4wZeox7M9I/0L9GfFd83Su4+yCck/OF9Gi/P/dAHn0RT7X4K9R7gMNMhDck3DvhR6QXsnQdjjgwNvQ==", "dev": true, "license": "MIT", "dependencies": { @@ -11439,9 +11312,9 @@ } }, "node_modules/ip-address": { - "version": "10.7.5", - "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.5.tgz", - "integrity": "sha512-t2v0rkILYv9WXmSL7TpAaU3HXgaFYOPUcH3QHgwQ++gpJuH3bqyMy4Fvt/DJCTKwzH3Cf+bAp5W/mFL39KPLzA==", + "version": "10.7.6", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.6.tgz", + "integrity": "sha512-00LYkM6byILa9eQIx6qoaXCM40xTLd56AZ4vyaPW3YTyb49VZYPo5xsiAq4tuQ54GH4R7gVdYScJ1B7B77PuTg==", "dev": true, "license": "MIT", "engines": { @@ -12012,6 +11885,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, "license": "ISC" }, "node_modules/jake": { @@ -12141,6 +12015,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, "license": "MIT" }, "node_modules/json-stringify-nice": { @@ -12453,16 +12328,6 @@ "node": "^20.17.0 || >=22.9.0" } }, - "node_modules/make-fetch-happen/node_modules/minipass": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", - "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, "node_modules/marked": { "version": "12.0.2", "resolved": "https://registry.npmjs.org/marked/-/marked-12.0.2.tgz", @@ -12750,16 +12615,6 @@ "node": ">=16 || 14 >=14.17" } }, - "node_modules/minipass-collect/node_modules/minipass": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", - "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, "node_modules/minipass-fetch": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-5.0.2.tgz", @@ -12778,47 +12633,6 @@ "iconv-lite": "^0.7.2" } }, - "node_modules/minipass-fetch/node_modules/iconv-lite": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz", - "integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/minipass-fetch/node_modules/minipass": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", - "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/minipass-fetch/node_modules/minizlib": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.1.0.tgz", - "integrity": "sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==", - "dev": true, - "license": "MIT", - "dependencies": { - "minipass": "^7.1.2" - }, - "engines": { - "node": ">= 18" - } - }, "node_modules/minipass-flush": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.7.tgz", @@ -12898,16 +12712,6 @@ "node": ">=8" } }, - "node_modules/minipass-sized/node_modules/minipass": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", - "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, "node_modules/minizlib": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.1.0.tgz", @@ -13297,9 +13101,9 @@ } }, "node_modules/npm-install-checks/node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", "dev": true, "license": "ISC", "bin": { @@ -13398,9 +13202,9 @@ } }, "node_modules/npm-pick-manifest/node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", "dev": true, "license": "ISC", "bin": { @@ -13430,29 +13234,6 @@ "node": "^20.17.0 || >=22.9.0" } }, - "node_modules/npm-registry-fetch/node_modules/minipass": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", - "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/npm-registry-fetch/node_modules/minizlib": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.1.0.tgz", - "integrity": "sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==", - "dev": true, - "license": "MIT", - "dependencies": { - "minipass": "^7.1.2" - }, - "engines": { - "node": ">= 18" - } - }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -13703,79 +13484,6 @@ "node": "^20.17.0 || >=22.9.0" } }, - "node_modules/pacote/node_modules/chownr": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", - "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=18" - } - }, - "node_modules/pacote/node_modules/fs-minipass": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz", - "integrity": "sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==", - "dev": true, - "license": "ISC", - "dependencies": { - "minipass": "^7.0.3" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/pacote/node_modules/minipass": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", - "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/pacote/node_modules/minizlib": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.1.0.tgz", - "integrity": "sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==", - "dev": true, - "license": "MIT", - "dependencies": { - "minipass": "^7.1.2" - }, - "engines": { - "node": ">= 18" - } - }, - "node_modules/pacote/node_modules/tar": { - "version": "7.5.22", - "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.22.tgz", - "integrity": "sha512-MFO/QzvtAOmJbkhOaCTvbGcFN9L9b+JunIsDwaKljSOdcLMea3NJ1k9Usz/rjdfSXTq4dfzfeS7W4p4YOAAHeA==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/fs-minipass": "^4.0.0", - "chownr": "^3.0.0", - "minipass": "^7.1.2", - "minizlib": "^3.1.0", - "yallist": "^5.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/pacote/node_modules/yallist": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", - "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=18" - } - }, "node_modules/parse-conflict-json": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/parse-conflict-json/-/parse-conflict-json-5.0.1.tgz", @@ -13827,6 +13535,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -13839,6 +13548,31 @@ "dev": true, "license": "MIT" }, + "node_modules/path-scurry": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-3.0.0.tgz", + "integrity": "sha512-1pTbQqH1wIwMi/eleQ5leFTTCkzFsPcgXNjwOA8YGGW/W4/kHT3dssE7Z6NH+zuqNLOzOB0uaD61yl7cAcVhgg==", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "11.5.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz", + "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==", + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, "node_modules/pe-library": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/pe-library/-/pe-library-0.4.1.tgz", @@ -14649,6 +14383,24 @@ "node": ">= 12.13.0" } }, + "node_modules/redis": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/redis/-/redis-6.3.1.tgz", + "integrity": "sha512-mV96ZKxQ4CGn3SyEGaY0Lb9YA443mdVey3c+mdr0NAUaBxiOZGoYCWX8PoM55kictSOmxlJRtZJxIsmZm3jL+w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@redis/bloom": "6.3.1", + "@redis/client": "6.3.1", + "@redis/json": "6.3.1", + "@redis/search": "6.3.1", + "@redis/time-series": "6.3.1" + }, + "engines": { + "node": ">= 20.0.0" + } + }, "node_modules/reflect.getprototypeof": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", @@ -14946,15 +14698,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/rimraf/node_modules/lru-cache": { - "version": "11.5.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz", - "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==", - "license": "BlueOak-1.0.0", - "engines": { - "node": "20 || >=22" - } - }, "node_modules/rimraf/node_modules/minimatch": { "version": "11.0.6", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.6.tgz", @@ -14980,22 +14723,6 @@ "node": ">=16 || 14 >=14.17" } }, - "node_modules/rimraf/node_modules/path-scurry": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-3.0.0.tgz", - "integrity": "sha512-1pTbQqH1wIwMi/eleQ5leFTTCkzFsPcgXNjwOA8YGGW/W4/kHT3dssE7Z6NH+zuqNLOzOB0uaD61yl7cAcVhgg==", - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/roarr": { "version": "2.15.4", "resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz", @@ -15508,6 +15235,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" @@ -15520,6 +15248,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -15621,6 +15350,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, "license": "ISC", "engines": { "node": ">=14" @@ -15721,16 +15451,6 @@ "node": ">= 14" } }, - "node_modules/socks-proxy-agent/node_modules/agent-base": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", - "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14" - } - }, "node_modules/solid-js": { "version": "1.9.18", "resolved": "https://registry.npmjs.org/solid-js/-/solid-js-1.9.18.tgz", @@ -15895,16 +15615,6 @@ "node": "^20.17.0 || >=22.9.0" } }, - "node_modules/ssri/node_modules/minipass": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", - "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, "node_modules/stat-mode": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/stat-mode/-/stat-mode-1.0.0.tgz", @@ -15938,6 +15648,23 @@ "node": ">= 0.4" } }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "license": "MIT" + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -16039,23 +15766,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/string_decoder/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true, - "license": "MIT" - }, "node_modules/stringify-entities": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", @@ -17332,6 +17042,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, "license": "ISC", "dependencies": { "isexe": "^2.0.0" @@ -17644,16 +17355,6 @@ "graceful-fs": "^4.1.6" } }, - "node_modules/workbox-build/node_modules/lru-cache": { - "version": "11.2.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.5.tgz", - "integrity": "sha512-vFrFJkWtJvJnD5hg+hJvVE8Lh/TcMzKnTgCWmtBipwI5yLX/iX+5UB2tfuyODF5E7k9xEzMdYgGqaSb1c0c5Yw==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": "20 || >=22" - } - }, "node_modules/workbox-build/node_modules/minimatch": { "version": "11.0.6", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.6.tgz", @@ -17675,28 +17376,11 @@ "version": "7.1.3", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "dev": true, "license": "BlueOak-1.0.0", "engines": { "node": ">=16 || 14 >=14.17" - }, - "dev": true - }, - "node_modules/workbox-build/node_modules/path-scurry": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-3.0.0.tgz", - "integrity": "sha512-1pTbQqH1wIwMi/eleQ5leFTTCkzFsPcgXNjwOA8YGGW/W4/kHT3dssE7Z6NH+zuqNLOzOB0uaD61yl7cAcVhgg==", - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "dev": true + } }, "node_modules/workbox-build/node_modules/pretty-bytes": { "version": "5.6.0", @@ -18188,11 +17872,11 @@ "@fastify/cors": "^11.4.1", "@fastify/reply-from": "^12.8.1", "@fastify/static": "^10.1.10", - "@opencode/client": "2.2.3", - "@opencode/schema": "2.2.3", + "@opencode/client": "2.3.0", + "@opencode/schema": "2.3.0", "commander": "^12.1.0", "dom-accessibility-api": "0.7.1", - "effect": "4.0.6", + "effect": "4.1.0", "fastify": "^5.12.8", "fuzzysort": "^2.0.4", "jsonc-parser": "^3.3.1", @@ -18210,7 +17894,7 @@ }, "devDependencies": { "@codenomad/remote-tunnel": "file:../remote-tunnel", - "@opencode/plugin": "2.2.3", + "@opencode/plugin": "2.3.0", "@types/node-forge": "^1.3.14", "@types/npm-package-arg": "^6.1.4", "@types/yauzl": "^2.10.0", @@ -18278,7 +17962,7 @@ "@kobalte/core": "0.13.11", "@mermaid-js/tiny": "12.3.0", "@noble/hashes": "2.4.0", - "@opencode/client": "2.2.3", + "@opencode/client": "2.3.0", "@solidjs/router": "^0.13.0", "@suid/material": "^0.19.0", "@suid/system": "^0.14.0", diff --git a/packages/server/package.json b/packages/server/package.json index 6de44c1ce3..27d47656c9 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -34,11 +34,11 @@ "@fastify/cors": "^11.4.1", "@fastify/reply-from": "^12.8.1", "@fastify/static": "^10.1.10", - "@opencode/client": "2.2.3", - "@opencode/schema": "2.2.3", + "@opencode/client": "2.3.0", + "@opencode/schema": "2.3.0", "commander": "^12.1.0", "dom-accessibility-api": "0.7.1", - "effect": "4.0.6", + "effect": "4.1.0", "fastify": "^5.12.8", "fuzzysort": "^2.0.4", "jsonc-parser": "^3.3.1", @@ -53,7 +53,7 @@ }, "devDependencies": { "@codenomad/remote-tunnel": "file:../remote-tunnel", - "@opencode/plugin": "2.2.3", + "@opencode/plugin": "2.3.0", "@types/node-forge": "^1.3.14", "@types/npm-package-arg": "^6.1.4", "@types/yauzl": "^2.10.0", diff --git a/packages/server/src/opencode-update/legacy-installation.test.ts b/packages/server/src/opencode-update/legacy-installation.test.ts index 0252709a41..069f7e1244 100644 --- a/packages/server/src/opencode-update/legacy-installation.test.ts +++ b/packages/server/src/opencode-update/legacy-installation.test.ts @@ -110,7 +110,7 @@ test("OpenCode 1.x npm shims are identified by package manifest and shim target assert.deepEqual(legacyNpmInstallation(command, prefix, directory, process.platform), { command, prefix, binary: path.join(legacyNpmPackageRoot(prefix, process.platform), "bin", "opencode.exe"), version: "1.18.10" }) const manifest = path.join(legacyNpmPackageRoot(prefix, process.platform), "package.json") - await writeFile(manifest, JSON.stringify({ name: "opencode-ai", version: "2.2.3", bin: { opencode: "bin/opencode.exe" } })) + await writeFile(manifest, JSON.stringify({ name: "opencode-ai", version: "2.3.0", bin: { opencode: "bin/opencode.exe" } })) assert.equal(legacyNpmInstallation(command, prefix, directory, process.platform), undefined, "a supported version is never replaced") await writeFile(manifest, JSON.stringify({ name: "other", version: "1.18.10", bin: { opencode: "bin/opencode.exe" } })) assert.equal(legacyNpmInstallation(command, prefix, directory, process.platform), undefined) @@ -140,19 +140,19 @@ test("legacy npm OpenCode is replaced in its prefix only after explicit consent, let registered = 0 const options = { ...host, node: process.execPath, npm: "fixture-npm.js", execute: installer(prefix, calls), probe, registerPath: async () => { registered++ } } - await assert.rejects(installSharedOpenCode("2.2.3", options), + await assert.rejects(installSharedOpenCode("2.3.0", options), (error: unknown) => error instanceof LegacyReplacementError && error.code === "legacy_replacement_required") assert.deepEqual(calls, []) assert.ok(existsSync(command), "nothing changes without consent") for (const stale of [{ path: command, version: "1.18.9" }, { path: path.join(home, "other", "opencode.cmd"), version: "1.18.10" }]) { - await assert.rejects(installSharedOpenCode("2.2.3", { ...options, replaceLegacy: stale }), + await assert.rejects(installSharedOpenCode("2.3.0", { ...options, replaceLegacy: stale }), (error: unknown) => error instanceof LegacyReplacementError && error.code === "legacy_replacement_required") } assert.deepEqual(calls, [], "consent applies only to the exact installation shown") - assert.equal(await installSharedOpenCode("2.2.3", { ...options, replaceLegacy: { path: command, version: "1.18.10" } }), npmExecutable(prefix)) - assert.deepEqual(calls, ["uninstall opencode-ai", "install @opencode/cli@2.2.3"]) + assert.equal(await installSharedOpenCode("2.3.0", { ...options, replaceLegacy: { path: command, version: "1.18.10" } }), npmExecutable(prefix)) + assert.deepEqual(calls, ["uninstall opencode-ai", "install @opencode/cli@2.3.0"]) assert.equal(registered, 1) assert.equal(existsSync(path.join(prefix, ".codenomad-opencode-install.lock")), false) assert.equal(resolveDefaultInstallation(host).source, "path") @@ -169,14 +169,14 @@ test("an OpenCode 2 installation failure after removing 1.x is reported and rema let offline = true const options = { ...host, node: process.execPath, npm: "fixture-npm.js", probe, registerPath: async () => {}, execute: installer(prefix, calls, () => offline ? new Error("ENOTFOUND registry.npmjs.org") : undefined) } - await assert.rejects(installSharedOpenCode("2.2.3", { ...options, replaceLegacy: { path: command, version: "1.18.10" } }), (error: unknown) => + await assert.rejects(installSharedOpenCode("2.3.0", { ...options, replaceLegacy: { path: command, version: "1.18.10" } }), (error: unknown) => error instanceof LegacyReplacementError && error.code === "legacy_removed_install_failed" && /ENOTFOUND/.test(error.message)) - assert.deepEqual(calls, ["uninstall opencode-ai", "install @opencode/cli@2.2.3"], "never retried through another mechanism") + assert.deepEqual(calls, ["uninstall opencode-ai", "install @opencode/cli@2.3.0"], "never retried through another mechanism") assert.equal(existsSync(path.join(prefix, ".codenomad-opencode-install.lock")), false) assert.deepEqual(sharedInstallationPlan(host), { prefix }, "retry is an ordinary installation without the removed package") offline = false - await installSharedOpenCode("2.2.3", options) - assert.deepEqual(calls.slice(2), ["install @opencode/cli@2.2.3"]) + await installSharedOpenCode("2.3.0", options) + assert.deepEqual(calls.slice(2), ["install @opencode/cli@2.3.0"]) } finally { await rm(home, { recursive: true, force: true }) } }) @@ -196,9 +196,9 @@ for (const form of ["symlink", "hardlink"] as const) test(`winget OpenCode 1.x ( ...(form === "symlink" ? { packageId: "SST.opencode" } : {}) } }) const calls: string[] = [] - await installSharedOpenCode("2.2.3", { ...wingetHost, node: process.execPath, npm: "fixture-npm.js", probe, + await installSharedOpenCode("2.3.0", { ...wingetHost, node: process.execPath, npm: "fixture-npm.js", probe, execute: installer(prefix, calls), registerPath: async () => {} }) - assert.deepEqual(calls, ["install @opencode/cli@2.2.3"]) + assert.deepEqual(calls, ["install @opencode/cli@2.3.0"]) assert.deepEqual(resolveDefaultInstallation(wingetHost), { path: npmExecutable(prefix), source: "managed" }) assert.equal(sharedInstallationPlan(wingetHost).prefix, prefix, "the managed installation keeps receiving updates") assert.equal(await readFile(winget.target, "utf8"), "1.19.0") @@ -221,9 +221,9 @@ test("winget OpenCode first on PATH with npm OpenCode 1.x behind it replaces onl assert.equal(plan.foreign?.source, "winget") const calls: string[] = [] const options = { ...wingetHost, node: process.execPath, npm: "fixture-npm.js", probe, execute: installer(prefix, calls), registerPath: async () => {} } - await assert.rejects(installSharedOpenCode("2.2.3", options), /explicit confirmation/) - await installSharedOpenCode("2.2.3", { ...options, replaceLegacy: { path: plan.legacy!.command, version: "1.18.10" } }) - assert.deepEqual(calls, ["uninstall opencode-ai", "install @opencode/cli@2.2.3"]) + await assert.rejects(installSharedOpenCode("2.3.0", options), /explicit confirmation/) + await installSharedOpenCode("2.3.0", { ...options, replaceLegacy: { path: plan.legacy!.command, version: "1.18.10" } }) + assert.deepEqual(calls, ["uninstall opencode-ai", "install @opencode/cli@2.3.0"]) assert.deepEqual(resolveDefaultInstallation(wingetHost), { path: npmExecutable(prefix), source: "managed" }) assert.equal(await readFile(winget.target, "utf8"), "1.19.0") } finally { await rm(home, { recursive: true, force: true }) } @@ -232,13 +232,13 @@ test("winget OpenCode first on PATH with npm OpenCode 1.x behind it replaces onl test("valid foreign OpenCode 2 keeps PATH precedence; unusable foreign commands yield to managed OpenCode 2", async () => { const { home, env, host, prefix } = await environment("foreign-") try { - await cliFixture(prefix, "2.2.3") + await cliFixture(prefix, "2.3.0") const foreign = path.join(home, "tools", windows ? "opencode.exe" : "opencode") await mkdir(path.dirname(foreign), { recursive: true }) await writeFile(foreign, "foreign", { mode: 0o755 }) env.PATH = [path.dirname(foreign), npmCommandDirectory(prefix)].join(path.delimiter) // Valid OpenCode 2, custom labels and unknown (not yet probed or timed out) keep PATH precedence. - for (const probeForeign of [() => ({ valid: true, version: "2.2.4" }), () => ({ valid: true, version: "local-build" }), () => undefined]) { + for (const probeForeign of [() => ({ valid: true, version: "2.3.1" }), () => ({ valid: true, version: "local-build" }), () => undefined]) { assert.deepEqual(resolveDefaultInstallation({ ...host, probeForeign }), { path: foreign, source: "path" }) assert.deepEqual(sharedInstallationPlan({ ...host, probeForeign }), {}) } @@ -343,7 +343,7 @@ test("opencode-ai 1.0-1.15.0 Node-launcher installs are recognized and every nat await chmod(nested, 0o444) const calls: string[] = [] try { - await assert.rejects(installSharedOpenCode("2.2.3", { ...host, node: process.execPath, npm: "fixture-npm.js", probe, + await assert.rejects(installSharedOpenCode("2.3.0", { ...host, node: process.execPath, npm: "fixture-npm.js", probe, execute: installer(prefix, calls), registerPath: async () => {}, replaceLegacy: { path: command, version: "1.15.0" } }), (error: unknown) => error instanceof InstallationBusyError && error.code === "installation_in_use") } finally { await chmod(nested, 0o644) } @@ -358,7 +358,7 @@ test("npm uninstall failures report whether OpenCode 1.x is still installed", as const command = await legacyFixture(prefix) env.PATH = npmCommandDirectory(prefix) const consent = { path: command, version: "1.18.10" } - const attempt = (execute: (node: string, args: string[]) => Promise) => installSharedOpenCode("2.2.3", { + const attempt = (execute: (node: string, args: string[]) => Promise) => installSharedOpenCode("2.3.0", { ...host, node: process.execPath, npm: "fixture-npm.js", probe, execute, registerPath: async () => {}, replaceLegacy: consent }) const failure = (npmCode?: string) => Object.assign(new Error("OpenCode installation failed (1)"), npmCode ? { npmCode } : {}) for (const code of ["EBUSY", "EPERM"]) { @@ -384,9 +384,9 @@ test("foreign version probes are asynchronous, bounded and kill the process tree assert.deepEqual(cachedForeignProbe(quick), undefined, "a cache miss reports unknown without spawning synchronously") assert.deepEqual(await probeForeignCommand(quick), { valid: true, version: "1.19.0" }) assert.deepEqual(cachedForeignProbe(quick), { valid: true, version: "1.19.0" }) - await writeFile(quick, windows ? "@echo opencode 2.2.3 \r\n" : "#!/bin/sh\necho opencode 2.2.3 \n", { mode: 0o755 }) + await writeFile(quick, windows ? "@echo opencode 2.3.0 \r\n" : "#!/bin/sh\necho opencode 2.3.0 \n", { mode: 0o755 }) assert.equal(cachedForeignProbe(quick), undefined, "a changed file invalidates the cached decision") - assert.deepEqual(await probeForeignCommand(quick), { valid: true, version: "2.2.3" }) + assert.deepEqual(await probeForeignCommand(quick), { valid: true, version: "2.3.0" }) const pidFile = path.join(home, "grandchild.pid") const script = path.join(home, "hang.js") diff --git a/packages/server/src/opencode-update/native-upgrade.test.ts b/packages/server/src/opencode-update/native-upgrade.test.ts index fa21c869ca..52c9c9e928 100644 --- a/packages/server/src/opencode-update/native-upgrade.test.ts +++ b/packages/server/src/opencode-update/native-upgrade.test.ts @@ -99,7 +99,7 @@ test("native upgrade npm/npx commands override hostile caller PATH and cwd witho const env: NodeJS.ProcessEnv = { PATH: [hostile, process.platform === "win32" ? path.join(process.env.SystemRoot ?? "C:\\Windows", "System32") : "/bin"].join(path.delimiter), ...(process.platform === "win32" ? { SystemRoot: process.env.SystemRoot, ComSpec: process.env.ComSpec } : {}) } const original = { ...env } - await upgradeSharedOpenCode({ binary: "verified-opencode", version: "2.2.5", prefix, node: process.execPath, + await upgradeSharedOpenCode({ binary: "verified-opencode", version: "2.3.2", prefix, node: process.execPath, npm: path.join(bundled, "npm-cli.js"), env, platform: process.platform, execute: async (_file, _args, childEnv, options) => { assert.notEqual(options!.cwd, hostile, "the native command owns cwd as well as PATH") @@ -108,7 +108,7 @@ test("native upgrade npm/npx commands override hostile caller PATH and cwd witho ? spawnSync(process.env.ComSpec || "cmd.exe", ["/d", "/s", "/c", name], { cwd: options?.cwd ?? hostile, env: childEnv, windowsHide: true, encoding: "utf8" }) : spawnSync(name, [], { cwd: options?.cwd ?? hostile, env: childEnv, windowsHide: true, encoding: "utf8" }) assert.equal(result.status, 0, result.stderr) - assert.deepEqual(JSON.parse(result.stdout), { execPath: process.execPath, cli: path.join(bundled, name + "-cli.js"), prefix, allow: "@opencode/cli@2.2.5" }) + assert.deepEqual(JSON.parse(result.stdout), { execPath: process.execPath, cli: path.join(bundled, name + "-cli.js"), prefix, allow: "@opencode/cli@2.3.2" }) } } }) assert.deepEqual(env, original) @@ -164,9 +164,9 @@ test("shared update delegates to native CLI, verifies publication, and never ret assert.equal(calls, 1, "no downgrade or same-version native invocation") assert.equal(registrations, 2) assert.equal(await readFile(binary, "utf8"), minimum) - await writeFile(binary, "2.2.4") + await writeFile(binary, "2.3.1") await installSharedOpenCode(minimum, options) - assert.equal(await readFile(binary, "utf8"), "2.2.4", "never downgrade a newer verified installation") + assert.equal(await readFile(binary, "utf8"), "2.3.1", "never downgrade a newer verified installation") assert.equal(calls, 1) } finally { await rm(home, { recursive: true, force: true }) } }) diff --git a/packages/server/src/opencode-update/service.test.ts b/packages/server/src/opencode-update/service.test.ts index e456ce39da..294de8f51f 100644 --- a/packages/server/src/opencode-update/service.test.ts +++ b/packages/server/src/opencode-update/service.test.ts @@ -118,10 +118,10 @@ test("user npm PATH repair remains available without an update and never downgra let migrated = false, installs = 0 const service = new OpenCodeUpdateService(deps({ resolveBinary: () => ({ path: migrated ? "common" : source, label: "OpenCode", source: migrated ? "path" : source }), - probeBinary: () => ({ valid: true, version: "2.2.4" }), + probeBinary: () => ({ valid: true, version: "2.3.1" }), resolveLatestVersion: async () => minimum, upgradeBinary: async (_binary, target) => { - assert.equal(target, "2.2.4") + assert.equal(target, "2.3.1") installs++; migrated = true return { success: true, version: target } }, @@ -244,7 +244,7 @@ test("coalesces overlapping installations and never downgrades a newer version", release() await Promise.all([first, second]) assert.equal(upgrades, 1) - version = "2.2.999" + version = "2.3.999" assert.equal((await service.getStatus()).updateAvailable, false) assert.equal((await service.upgrade()).version, version) assert.equal(upgrades, 1) @@ -332,8 +332,8 @@ test("optional upgrades retain explicit activation for an admitted but older dae return value } const service = new OpenCodeUpdateService(deps({ - probeBinary: () => ({ valid: true, version: installed }), resolveLatestVersion: async () => "2.2.4", - upgradeBinary: async () => { installed = "2.2.4"; return { success: true, version: installed } }, + probeBinary: () => ({ valid: true, version: installed }), resolveLatestVersion: async () => "2.3.1", + upgradeBinary: async () => { installed = "2.3.1"; return { success: true, version: installed } }, lifecycle: async () => ({ discover: async () => endpoint(), ensure: async () => endpoint(), restart: async () => { restarts++; daemon = installed; return endpoint() } }), })) @@ -383,7 +383,7 @@ test("same-version troubleshooting restart is explicit for host and WSL; reload }) test("troubleshooting restart refuses unknown identity/builds and a newer daemon", async () => { - for (const version of [undefined, "custom-build", "2.2.4"]) { + for (const version of [undefined, "custom-build", "2.3.1"]) { const endpoint: Endpoint = { url: "http://127.0.0.1:9876" } if (version) rememberRuntime(endpoint, { version, pid: 123, discovery: "info" }) const service = new OpenCodeUpdateService(deps({ @@ -473,7 +473,7 @@ test("an in-flight native reload holds shared-service authority across binary ch rememberRuntime(endpoint, { version: minimum, pid: 123, discovery: "info" }) const service = new OpenCodeUpdateService(deps({ resolveBinary: () => ({ path: selected, label: "Fixture" }), - probeBinary: () => ({ valid: true, version: "2.2.4" }), + probeBinary: () => ({ valid: true, version: "2.3.1" }), lifecycle: async () => ({ discover: async () => endpoint, ensure: async () => endpoint, restart: async () => { restarts++; return endpoint } }), reload: async (_binary, assertCurrent) => { assertCurrent(); entered(); await gate }, @@ -495,27 +495,28 @@ test("beta version comparison remains numeric", () => { }) test("the native contract floor admits current and newer runtimes without a tested-version allowlist", async () => { - for (const version of ["2.2.3", "2.2.4", "2.2.5", "2.2.6", "2.2.7", "2.3.0", "3.0.0"]) { + const latest = "2.4.0" + for (const version of ["2.3.0", "2.3.1", "2.3.4", latest, "3.0.0"]) { const endpoint: Endpoint = { url: "http://127.0.0.1:9876" } rememberRuntime(endpoint, { version, pid: 123, discovery: "info" }) const service = new OpenCodeUpdateService(deps({ - probeBinary: () => ({ valid: true, version }), resolveLatestVersion: async () => recommended, + probeBinary: () => ({ valid: true, version }), resolveLatestVersion: async () => latest, lifecycle: async () => ({ discover: async () => endpoint, ensure: async () => { throw new Error("must retain daemon") } }), })) const status = await service.start() - assert.equal(status.minimumVersion, "2.2.3") + assert.equal(status.minimumVersion, "2.3.0") assert.equal(status.recommendedVersion, recommended) assert.equal(status.state, "ready") assert.equal(status.serviceState, "ready") assert.equal(status.versionAssessment, version === recommended ? "tested" : "untested", "only the current recommendation is release-qualified") assert.equal(status.incompatibilityReason, undefined) - assert.equal(status.canUpgrade, ["2.2.3", "2.2.4", "2.2.5", "2.2.6"].includes(version), "offer an optional upgrade below the latest release; never downgrade current or newer runtimes") + assert.equal(status.canUpgrade, ["2.3.0", "2.3.1", "2.3.4"].includes(version), "offer an optional upgrade below the latest release; never downgrade current or newer runtimes") assert.equal(status.canRestart, false) } }) test("older daemons require the minimum's native contracts without being started or replaced", async () => { - for (const version of ["2.0.27", "2.0.32", "2.1.2", "2.2.1", "2.2.2"]) { + for (const version of ["2.0.27", "2.0.32", "2.1.2", "2.2.2", "2.2.3", "2.2.7"]) { const endpoint: Endpoint = { url: "http://127.0.0.1:9876" } rememberRuntime(endpoint, { version, pid: 123, discovery: "info" }) const service = new OpenCodeUpdateService(deps({ @@ -527,7 +528,7 @@ test("older daemons require the minimum's native contracts without being started assert.equal(status.incompatibilityReason, "native_contract") assert.equal(status.versionAssessment, "incompatible") // Admission refuses the daemon itself; it is never started, restarted or replaced implicitly. - await assert.rejects(service.start(), /opencode_update_required.*experimental_image_generate tool contract.*of 2\.2\.3/) + await assert.rejects(service.start(), /opencode_update_required.*background subagent report contract.*of 2\.3\.0/) } }) @@ -562,7 +563,7 @@ test("custom labels are unverified, not an update demand; optional reload follow }) test("production stdout parsing preserves custom labels through discovery and activation", async () => { - for (const [stdout, label] of [["custom-build\n", "custom-build"], ["opencode v2.2.3+custom-build\n", "2.2.3+custom-build"], + for (const [stdout, label] of [["custom-build\n", "custom-build"], ["opencode v2.3.0+custom-build\n", "2.3.0+custom-build"], ["opencode2 vendor-build\n", "vendor-build"], ["", "unknown"]]) { const endpoint: Endpoint = { url: "http://127.0.0.1:9876" } rememberRuntime(endpoint, { version: label!, pid: 123, discovery: "info" }) diff --git a/packages/server/src/opencode-update/setup-reconnect.test.ts b/packages/server/src/opencode-update/setup-reconnect.test.ts index 9c77670364..1f74a19bec 100644 --- a/packages/server/src/opencode-update/setup-reconnect.test.ts +++ b/packages/server/src/opencode-update/setup-reconnect.test.ts @@ -16,14 +16,14 @@ test("optional setup rebinds real workspace ownership without restarting the sup const parent = path.join(os.tmpdir(), "opencode") await mkdir(parent, { recursive: true }) const root = await mkdtemp(path.join(parent, "codenomad-setup-reconnect-")) - const originalBinary = path.join(root, "2.2.3", "opencode.exe") - const installedBinary = path.join(root, "2.2.4", "opencode.exe") + const originalBinary = path.join(root, "2.3.0", "opencode.exe") + const installedBinary = path.join(root, "2.3.1", "opencode.exe") let selected = originalBinary let starts = 0 let restarts = 0 let reloads = 0 const endpoint: Endpoint = { url: "http://127.0.0.1:1" } - rememberRuntime(endpoint, { version: "2.2.3", pid: 123, discovery: "info" }) + rememberRuntime(endpoint, { version: "2.3.0", pid: 123, discovery: "info" }) const lifecycle: OpenCodeServiceLifecycle = { discover: async () => endpoint, ensure: async () => { starts++; throw new Error("The existing daemon must not be started again") }, @@ -52,12 +52,12 @@ test("optional setup rebinds real workspace ownership without restarting the sup }) const updater = new OpenCodeUpdateService({ resolveBinary: () => ({ path: selected, label: "Fixture OpenCode" }), - probeBinary: binary => ({ valid: true, version: binary === installedBinary ? "2.2.4" : "2.2.3" }), - resolveLatestVersion: async () => "2.2.4", + probeBinary: binary => ({ valid: true, version: binary === installedBinary ? "2.3.1" : "2.3.0" }), + resolveLatestVersion: async () => "2.3.1", canUpgradeBinary: () => true, upgradeBinary: async () => { selected = installedBinary - return { success: true, version: "2.2.4" } + return { success: true, version: "2.3.1" } }, lifecycle: async binary => (await manager.setupServiceOptions(binary.path)).lifecycle, admitActivation: binary => manager.assertSetupExecutionHost(binary.path), @@ -78,8 +78,8 @@ test("optional setup rebinds real workspace ownership without restarting the sup const status = await updater.start(false) assert.equal(status.state, "ready") - assert.equal(status.currentVersion, "2.2.4") - assert.equal(status.daemonVersion, "2.2.3") + assert.equal(status.currentVersion, "2.3.1") + assert.equal(status.daemonVersion, "2.3.0") assert.equal(status.serviceState, "restart_available") assert.equal(status.canRestart, true, "non-disruptive reconnect retains explicit activation") assert.throws(() => originalConnection.assertCurrent(), /OpenCode connection changed/) diff --git a/packages/server/src/opencode-update/shared-installation.test.ts b/packages/server/src/opencode-update/shared-installation.test.ts index 91bbe6cad2..edeb3aa3f6 100644 --- a/packages/server/src/opencode-update/shared-installation.test.ts +++ b/packages/server/src/opencode-update/shared-installation.test.ts @@ -10,7 +10,7 @@ import { execFile } from "node:child_process" import { promisify } from "node:util" import { MINIMUM_OPENCODE_VERSION as minimum } from "../opencode/runtime-support" -const validV2 = () => ({ valid: true, version: "2.2.3" }) +const validV2 = () => ({ valid: true, version: "2.3.0" }) async function npmFixture(prefix: string, version: string) { const binary = npmExecutable(prefix) @@ -31,10 +31,10 @@ test("private copies and their receipts are ignored; PATH wins over the user npm const host = { home, env } try { const root = path.join(home, ".local/share/codenomad/opencode") - const legacy = path.join(root, "2.2.99/node_modules/@opencode/cli/bin/opencode.exe") + const legacy = path.join(root, "2.3.99/node_modules/@opencode/cli/bin/opencode.exe") await mkdir(path.dirname(legacy), { recursive: true }); await writeFile(legacy, "legacy") - await mkdir(path.join(root, "selected")); await writeFile(path.join(root, "selected/2.2.99"), "") - await writeFile(path.join(root, "current"), "2.2.99") + await mkdir(path.join(root, "selected")); await writeFile(path.join(root, "selected/2.3.99"), "") + await writeFile(path.join(root, "current"), "2.3.99") assert.deepEqual(resolveDefaultInstallation(host), { path: "opencode2" }) assert.equal(sharedInstallPrefix(host), userNpmPrefix(host)) const prefix = userNpmPrefix(host) @@ -58,7 +58,7 @@ test("normal global-user npm install publishes terminal command and retries PATH execute: async (_file: string, args: string[]) => { installs++ if (args[0] === "upgrade") { - assert.deepEqual(args, ["upgrade", "2.2.4", "--method", "npm"]) + assert.deepEqual(args, ["upgrade", "2.3.1", "--method", "npm"]) await npmFixture(prefix, args[1]!) return } @@ -86,15 +86,15 @@ test("normal global-user npm install publishes terminal command and retries PATH assert.equal(installs, 1) assert.equal(resolveDefaultInstallation(options).path, findPathOpenCode(options)) assert.equal(resolveDefaultInstallation(options).source, "path") - await installSharedOpenCode("2.2.4", options) + await installSharedOpenCode("2.3.1", options) assert.equal(installs, 2) await installSharedOpenCode(minimum, options) assert.equal(installs, 2, "never downgrade a newer common installation") - assert.equal((await options.probe(npmExecutable(prefix))).version, "2.2.4") + assert.equal((await options.probe(npmExecutable(prefix))).version, "2.3.1") await rm(findPathOpenCode(options)!) await installSharedOpenCode(minimum, options) assert.equal(installs, 3, "missing command is repaired at the newer installed version") - assert.equal((await options.probe(npmExecutable(prefix))).version, "2.2.4") + assert.equal((await options.probe(npmExecutable(prefix))).version, "2.3.1") } finally { await rm(home, { recursive: true, force: true }) } }) diff --git a/packages/server/src/opencode/compatibility/negotiate.test.ts b/packages/server/src/opencode/compatibility/negotiate.test.ts index 056c9f0e3e..0a7a98d413 100644 --- a/packages/server/src/opencode/compatibility/negotiate.test.ts +++ b/packages/server/src/opencode/compatibility/negotiate.test.ts @@ -8,7 +8,7 @@ import { UnsupportedOpenCodeError } from "../runtime-support" test("unknown contracts perform authenticated bounded read negotiation before any mutation", async () => { for (const kind of ["unauthorized", "unrecognized", "oversized"] as const) { const endpoint = { url: "http://127.0.0.1:4321", auth: { type: "basic" as const, username: "opencode", password: "fixture" } } - rememberRuntime(endpoint, { version: "2.2.100", pid: 1, discovery: "status" }) + rememberRuntime(endpoint, { version: "2.3.100", pid: 1, discovery: "status" }) let calls = 0, cancelled = false const transport = createRuntimeFetch(endpoint, async (input, init) => { calls++ @@ -53,7 +53,7 @@ test("unknown labels with an obsolete contract or missing environment fail for a test("shared negotiation has independent subscriber cancellation and never retries a mutation", async () => { const endpoint = { url: "http://127.0.0.1:4321" } - rememberRuntime(endpoint, { version: "2.2.100", pid: 1, discovery: "info" }) + rememberRuntime(endpoint, { version: "2.3.100", pid: 1, discovery: "info" }) let complete!: (response: Response) => void let negotiationSignal: AbortSignal | null | undefined const calls: string[] = [] diff --git a/packages/server/src/opencode/compatibility/runtime.ts b/packages/server/src/opencode/compatibility/runtime.ts index b77cab0782..180567c419 100644 --- a/packages/server/src/opencode/compatibility/runtime.ts +++ b/packages/server/src/opencode/compatibility/runtime.ts @@ -25,6 +25,6 @@ export function contractProfile(identity: RuntimeIdentity | undefined): Contract // Publication contract reviewed and exercised by the isolated native suites // (minimum and qualification target). Unlisted versions still negotiate their // authenticated schema. - if (identity.version === "2.2.3" || identity.version === "2.2.5") return "modern" + if (identity.version === "2.3.0") return "modern" return "unknown" } diff --git a/packages/server/src/opencode/compatibility/transport.test.ts b/packages/server/src/opencode/compatibility/transport.test.ts index f63585da0f..a99b93176b 100644 --- a/packages/server/src/opencode/compatibility/transport.test.ts +++ b/packages/server/src/opencode/compatibility/transport.test.ts @@ -6,8 +6,8 @@ import { createRuntimeFetch } from "./transport" import { modernContractFixture } from "./contract-fixture" test("current and future supported releases preserve info, authentication and bounded negotiation", async () => { - const reviewed = ["2.2.3", "2.2.5"] - for (const version of [...reviewed, "2.2.4", "2.3.0", "2.2.100", "3.0.0", "2.2.0-dev.1", "custom-build"]) { + const reviewed = ["2.3.0"] + for (const version of [...reviewed, "2.3.1", "2.3.2", "2.4.0", "2.3.100", "3.0.0", "2.2.0-dev.1", "custom-build"]) { const endpoint = { url: "http://127.0.0.1:4321", auth: { type: "basic" as const, username: "opencode", password: "fixture" } } rememberRuntime(endpoint, { version, pid: 123, discovery: "info" }) const seen: string[] = [] @@ -26,7 +26,7 @@ test("current and future supported releases preserve info, authentication and bo test("info and status routes are forwarded unchanged and never probe alternate routes on failure", async () => { const endpoint = { url: "http://127.0.0.1:4321" } - rememberRuntime(endpoint, { version: "2.2.3", pid: 123, discovery: "info" }) + rememberRuntime(endpoint, { version: "2.3.0", pid: 123, discovery: "info" }) const seen: string[] = [] const fetch = createRuntimeFetch(endpoint, async (input, init) => { const path = new URL(String(input)).pathname @@ -50,7 +50,7 @@ test("retired runtime contracts never dispatch even through the direct transport test("canonical mutations and inbox timestamps are forwarded unchanged", async () => { const endpoint = { url: "http://127.0.0.1:4321" } - rememberRuntime(endpoint, { version: "2.2.3", pid: 1, discovery: "info" }) + rememberRuntime(endpoint, { version: "2.3.0", pid: 1, discovery: "info" }) const calls: Array<{ path: string; method: string; body: unknown }> = [] const client = OpenCode.make({ baseUrl: endpoint.url, fetch: createRuntimeFetch(endpoint, async (input, init) => { const request = new Request(input, init) @@ -71,7 +71,7 @@ test("canonical mutations and inbox timestamps are forwarded unchanged", async ( test("errors never retry mutations; native error envelopes, abort and origin fencing survive", async () => { const endpoint = { url: "http://127.0.0.1:4321" } - rememberRuntime(endpoint, { version: "2.2.3", pid: 2, discovery: "info" }) + rememberRuntime(endpoint, { version: "2.3.0", pid: 2, discovery: "info" }) let calls = 0 for (const status of [400, 401, 404, 500]) { const envelope = { _tag: "NativeError", message: "fixture" } diff --git a/packages/server/src/opencode/runtime-support.test.ts b/packages/server/src/opencode/runtime-support.test.ts index 09f6a2e838..2b9bcc0641 100644 --- a/packages/server/src/opencode/runtime-support.test.ts +++ b/packages/server/src/opencode/runtime-support.test.ts @@ -6,16 +6,16 @@ import { rememberRuntime } from "./compatibility/runtime" import { OpenCodeSharedService } from "../workspaces/opencode-service" test("native plugin runtime minimum does not become an allowlist of tested labels", () => { - assert.equal(MINIMUM_OPENCODE_VERSION, "2.2.3") - assert.equal(RECOMMENDED_OPENCODE_VERSION, "2.2.7") - for (const version of ["2.2.3", "2.2.3+custom", "2.2.4", "2.2.5", "2.2.6", "2.2.7", "2.3.0", "2.2.0-dev.1", "3.0.0", "custom-build"]) { + assert.equal(MINIMUM_OPENCODE_VERSION, "2.3.0") + assert.equal(RECOMMENDED_OPENCODE_VERSION, "2.3.0") + for (const version of ["2.3.0", "2.3.0+custom", "2.3.1", "2.4.0", "2.2.0-dev.1", "3.0.0", "custom-build"]) { assert.equal(isBelowOpenCodeMinimum(version), false, version) } - for (const version of ["2.0.0", "2.0.32", "2.1.0", "2.1.2", "2.1.4", "2.2.0", "2.2.1", "2.2.2", "2.2.2+custom", "0.0.0-beta-19507"]) assert.equal(isBelowOpenCodeMinimum(version), true, version) + for (const version of ["2.0.0", "2.0.32", "2.1.4", "2.2.0", "2.2.2", "2.2.3", "2.2.7", "2.2.7+custom", "0.0.0-beta-19507"]) assert.equal(isBelowOpenCodeMinimum(version), true, version) }) test("refuses old authenticated daemons before client calls or plugin preparation", async () => { - for (const version of ["2.0.32", "2.1.2", "2.2.1", "2.2.2"]) { + for (const version of ["2.0.32", "2.1.2", "2.2.3", "2.2.7"]) { let constructed = 0, prepared = 0 const endpoint: Endpoint = { url: "http://127.0.0.1:4321" } rememberRuntime(endpoint, { version, pid: 1, discovery: "info" }) @@ -25,8 +25,8 @@ test("refuses old authenticated daemons before client calls or plugin preparatio prepareDesktopPlugins: async () => { prepared++; return true }, } await assert.rejects(service.client(options), (error: unknown) => error instanceof UnsupportedOpenCodeError - && error.actualVersion === version && error.minimumVersion === "2.2.3" && error.reason === "native_contract" - && /experimental_image_generate tool contract.*of 2\.2\.3/.test(error.message)) + && error.actualVersion === version && error.minimumVersion === "2.3.0" && error.reason === "native_contract" + && /background subagent report contract.*of 2\.3\.0/.test(error.message)) assert.equal(constructed, 0) assert.equal(prepared, 0) } diff --git a/packages/server/src/opencode/runtime-support.ts b/packages/server/src/opencode/runtime-support.ts index a0663ae514..c81df7f861 100644 --- a/packages/server/src/opencode/runtime-support.ts +++ b/packages/server/src/opencode/runtime-support.ts @@ -7,12 +7,15 @@ * replay contract read by the pinned client reducer and codecs (`native` provider * data, `metadata.keepID` compactions, `native.messages` windows) and Code Mode * jobs that keep JavaScript run-to-completion (scripts/test-codemode-jobs-native.mjs). + * CodeNomad qualifies only the 2.3 subagent contract: every subagent runs in the + * background and delivers synthetic `` reports to its parent + * (scripts/test-missions-native-trajectory.mjs, scripts/test-subagent-nesting-native.mjs). * OpenCode reads data stored by older releases. See * dev-docs/OPENCODE_COMPATIBILITY.md for the demonstrated boundary. */ -export const MINIMUM_OPENCODE_VERSION = "2.2.3" +export const MINIMUM_OPENCODE_VERSION = "2.3.0" /** Qualification target, independent of the technically required minimum. */ -export const RECOMMENDED_OPENCODE_VERSION = "2.2.7" +export const RECOMMENDED_OPENCODE_VERSION = "2.3.0" export const OPENCODE_UPDATE_REQUIRED = "opencode_update_required" export function isBelowOpenCodeMinimum(version: string): boolean { @@ -36,7 +39,7 @@ export class UnsupportedOpenCodeError extends Error { readonly minimumVersion = MINIMUM_OPENCODE_VERSION constructor(readonly actualVersion: string, readonly reason: OpenCodeIncompatibility = "native_contract") { super(`${OPENCODE_UPDATE_REQUIRED}: OpenCode ${actualVersion}; ${reason === "native_contract" - ? `requires the experimental_image_generate tool contract, native replay and compaction contract (native, metadata.keepID) and Code Mode job ordering of ${MINIMUM_OPENCODE_VERSION}` + ? `requires the background subagent report contract, experimental_image_generate tool contract, native replay and compaction contract (native, metadata.keepID) and Code Mode job ordering of ${MINIMUM_OPENCODE_VERSION}` : reason === "session_environment" ? "requires PUT /api/session/{sessionID}/environment with variables" : "does not expose the canonical session, permission, Form and inbox API contract"}`) this.name = "UnsupportedOpenCodeError" diff --git a/packages/server/src/opencode/session-pruning/package.json b/packages/server/src/opencode/session-pruning/package.json index bddc322775..71c9ed55c4 100644 --- a/packages/server/src/opencode/session-pruning/package.json +++ b/packages/server/src/opencode/session-pruning/package.json @@ -21,8 +21,8 @@ "transaction.ts", "message-storage.ts", "native-assistant-content.ts" ], "dependencies": { - "@opencode/plugin": "2.2.3", - "@opencode/schema": "2.2.3", + "@opencode/plugin": "2.3.0", + "@opencode/schema": "2.3.0", "zod": "^4.6.6" } } diff --git a/packages/server/src/server/__tests__/instance-proxy-legacy.test.ts b/packages/server/src/server/__tests__/instance-proxy-legacy.test.ts index 9c9e7402df..5fe933e772 100644 --- a/packages/server/src/server/__tests__/instance-proxy-legacy.test.ts +++ b/packages/server/src/server/__tests__/instance-proxy-legacy.test.ts @@ -17,7 +17,7 @@ test("modern proxy preserves Forms scope and rejects obsolete selectors in curso upstream.all("/*", async request => { forwarded++; return { method: request.method, url: request.url, body: request.body, headers: request.headers } }) await upstream.listen({ host: "127.0.0.1", port: 0 }) const endpoint: Endpoint = { url: `http://127.0.0.1:${(upstream.server.address() as { port: number }).port}`, auth: { type: "basic", username: "opencode", password: "fixture" } } - rememberRuntime(endpoint, { version: "2.2.3", pid: 1, discovery: "info" }) + rememberRuntime(endpoint, { version: "2.3.0", pid: 1, discovery: "info" }) const client = { session: { get: async ({ sessionID }: { sessionID: string }) => ({ location: { directory: sessionID === "foreign" ? "/foreign" : "/native" } }) } } as unknown as OpenCodeClient const connection = { endpoint, client, fetch: createRuntimeFetch(endpoint), assertCurrent() {}, invalidate() {}, profile: async () => "modern" as const } const directories = new Set(["/host", "/native"]) @@ -89,7 +89,7 @@ test("future releases advertising retired schemas are refused before functional }) await upstream.listen({ host: "127.0.0.1", port: 0 }) const endpoint = { url: `http://127.0.0.1:${(upstream.server.address() as { port: number }).port}` } - rememberRuntime(endpoint, { version: "2.2.100", pid: 1, discovery: "info" }) + rememberRuntime(endpoint, { version: "2.3.100", pid: 1, discovery: "info" }) const service = new OpenCodeSharedService() try { await assert.rejects(service.client({ kind: "lifecycle", identity: "isolated-test", lifecycle: { discover: async () => endpoint, ensure: async () => endpoint } }), { code: "opencode_update_required" }) diff --git a/packages/server/src/server/routes/pending-requests.test.ts b/packages/server/src/server/routes/pending-requests.test.ts index 0f53095902..312f943ffe 100644 --- a/packages/server/src/server/routes/pending-requests.test.ts +++ b/packages/server/src/server/routes/pending-requests.test.ts @@ -81,7 +81,7 @@ test("raw pending adapter retains the bound service authentication and fails clo const h = await harness() try { const endpoint = { url: "http://127.0.0.1:4321", auth: { type: "basic" as const, username: "opencode", password: "isolated-fixture" } } - rememberRuntime(endpoint, { version: "2.2.3", pid: 123, discovery: "info" }) + rememberRuntime(endpoint, { version: "2.3.0", pid: 123, discovery: "info" }) h.connection.endpoint = endpoint h.connection.fetch = createRuntimeFetch(endpoint, async (input, init) => { h.state.calls.push(new URL(String(input))) diff --git a/packages/server/src/workspaces/instance-events.test.ts b/packages/server/src/workspaces/instance-events.test.ts index 824911a47e..686b59ffd9 100644 --- a/packages/server/src/workspaces/instance-events.test.ts +++ b/packages/server/src/workspaces/instance-events.test.ts @@ -849,7 +849,7 @@ describe("InstanceEventBridge", () => { const connectionFor = (pid: number) => ({ endpoint: Object.assign( { url: "http://127.0.0.1:4010", auth: { username: "u", password: "p" } }, - { [runtimeKey]: Object.freeze({ version: "2.2.3", pid, contract: {} }) }, + { [runtimeKey]: Object.freeze({ version: "2.3.0", pid, contract: {} }) }, ), }) const first = serverConnected() @@ -888,7 +888,7 @@ describe("InstanceEventBridge", () => { // The relayed identity must not be a digest a subscriber can recompute // from known fields: that would be an offline verifier for the password. const verifiable = createHash("sha256").update(JSON.stringify([ - "http://127.0.0.1:4010", "2.2.3", 4242, "u", "p", + "http://127.0.0.1:4010", "2.3.0", 4242, "u", "p", ])).digest("hex") assert.notEqual(received[0].data.daemon, verifiable, "the token is server-held, not a recomputable digest") for (const digest of [received[0].data.daemon, received[2].data.daemon]) { @@ -904,7 +904,7 @@ describe("InstanceEventBridge", () => { const connection = { endpoint: Object.assign( { url: "http://127.0.0.1:4011" }, - { [runtimeKey]: Object.freeze({ version: "2.2.3", pid: 4242, contract: {} }) }, + { [runtimeKey]: Object.freeze({ version: "2.3.0", pid: 4242, contract: {} }) }, ), } const firstSubscription = serverConnected() @@ -944,7 +944,7 @@ describe("InstanceEventBridge", () => { const connectionFor = (pid: number) => ({ endpoint: Object.assign( { url: "http://127.0.0.1:4012" }, - { [runtimeKey]: Object.freeze({ version: "2.2.3", pid, contract: {} }) }, + { [runtimeKey]: Object.freeze({ version: "2.3.0", pid, contract: {} }) }, ), }) const before = serverConnected() @@ -982,7 +982,7 @@ describe("InstanceEventBridge", () => { const connection = { endpoint: Object.assign( { url: "http://127.0.0.1:4013" }, - { [runtimeKey]: Object.freeze({ version: "2.2.3", pid: 3333, contract: {} }) }, + { [runtimeKey]: Object.freeze({ version: "2.3.0", pid: 3333, contract: {} }) }, ), } const attributedStream = () => { diff --git a/packages/ui/package.json b/packages/ui/package.json index c0b9d2b43e..2276d9ff98 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -18,7 +18,7 @@ "@kobalte/core": "0.13.11", "@mermaid-js/tiny": "12.3.0", "@noble/hashes": "2.4.0", - "@opencode/client": "2.2.3", + "@opencode/client": "2.3.0", "@solidjs/router": "^0.13.0", "@suid/material": "^0.19.0", "@suid/system": "^0.14.0", diff --git a/packages/ui/src/components/tool-call.tsx b/packages/ui/src/components/tool-call.tsx index ea24dcbe76..7c96f6050a 100644 --- a/packages/ui/src/components/tool-call.tsx +++ b/packages/ui/src/components/tool-call.tsx @@ -321,15 +321,16 @@ function ToolCallDetails(props: { const renderError = () => { const state = props.toolState() if (state?.status === "error" && state.error) { - const truncated = state.error.length > TOOL_OUTPUT_RENDER_CHARACTER_LIMIT + const error = renderer().getErrorText?.(rendererContext) ?? state.error + const truncated = error.length > TOOL_OUTPUT_RENDER_CHARACTER_LIMIT return (
- + {(text) => (
{props.t("toolCall.error.label")} {text()} - diff --git a/packages/ui/src/components/tool-call/renderers/bash-data.test.ts b/packages/ui/src/components/tool-call/renderers/bash-data.test.ts new file mode 100644 index 0000000000..95902a6688 --- /dev/null +++ b/packages/ui/src/components/tool-call/renderers/bash-data.test.ts @@ -0,0 +1,34 @@ +import assert from "node:assert/strict" +import { describe, it } from "node:test" + +import type { ToolState } from "../../../types/tool-state" +import { interruptedShellOutput, shellOutput } from "./bash-data" + +const notice = "[full output saved to /tmp/out.txt]\n\nCommand interrupted by the user (shell ID: sh_1)." +const interrupted = (error: string, metadata: Record = { interrupted: true, truncated: false, shellID: "sh_1", notice }) => + ({ status: "error", input: { command: "npm test" }, error, metadata, time: { start: 1, end: 2 } }) as unknown as ToolState + +describe("shell output", () => { + it("splits an interrupted call into its output so far and the notice", () => { + const state = interrupted(`line 1\nline 2\n\n${notice}`) + assert.deepEqual(interruptedShellOutput(state), { output: "line 1\nline 2", notice }) + assert.equal(shellOutput(state), "line 1\nline 2") + }) + + it("keeps a notice-only interruption without inventing output", () => { + const only = "[no output; output file: /tmp/out.txt]\n\nCommand interrupted by the user (shell ID: sh_1)." + const state = interrupted(only, { interrupted: true, notice: only }) + assert.deepEqual(interruptedShellOutput(state), { output: "", notice: only }) + assert.equal(shellOutput(state), undefined) + }) + + it("leaves other failures, mismatched notices and older runtimes unchanged", () => { + assert.equal(interruptedShellOutput(interrupted("boom", { interrupted: true, notice })), undefined) + assert.equal(interruptedShellOutput(interrupted(`x\n\n${notice}`, { notice })), undefined) + const legacy = { status: "error", input: {}, error: "Aborted", metadata: { output: "partial" }, time: { start: 1, end: 2 } } as unknown as ToolState + assert.equal(interruptedShellOutput(legacy), undefined) + assert.equal(shellOutput(legacy), "partial") + assert.equal(shellOutput({ status: "completed", input: {}, output: "done", metadata: {}, title: "", time: { start: 1, end: 2 } } as unknown as ToolState), "done") + assert.equal(shellOutput({ status: "pending", input: {} } as unknown as ToolState), undefined) + }) +}) diff --git a/packages/ui/src/components/tool-call/renderers/bash-data.ts b/packages/ui/src/components/tool-call/renderers/bash-data.ts new file mode 100644 index 0000000000..663c491d56 --- /dev/null +++ b/packages/ui/src/components/tool-call/renderers/bash-data.ts @@ -0,0 +1,25 @@ +import type { ToolState } from "../../../types/tool-state" +import { isToolStateCompleted, isToolStateError, isToolStateRunning, readToolStatePayload } from "../utils" + +/** + * A shell call the user interrupted fails with `\n\n` and metadata + * `{ interrupted: true, notice }`: the output renders like a finished call's, the notice as the error. + */ +export function interruptedShellOutput(state: ToolState | undefined): { output: string; notice: string } | undefined { + if (!state || !isToolStateError(state)) return undefined + const { metadata } = readToolStatePayload(state) + const error = (state as { error?: unknown }).error + const notice = metadata.notice + if (metadata.interrupted !== true || typeof notice !== "string" || !notice || typeof error !== "string" || !error.endsWith(notice)) return undefined + return { output: error.slice(0, error.length - notice.length).replace(/\n\n$/, ""), notice } +} + +/** The output a shell call shows: its result, an interrupted call's output so far, or live progress output. */ +export function shellOutput(state: ToolState | undefined): unknown { + if (!state || state.status === "pending") return undefined + if (isToolStateCompleted(state)) return state.output + const interrupted = interruptedShellOutput(state) + if (interrupted) return interrupted.output || undefined + const { metadata } = readToolStatePayload(state) + return (isToolStateRunning(state) || isToolStateError(state)) && metadata.output ? metadata.output : undefined +} diff --git a/packages/ui/src/components/tool-call/renderers/bash.tsx b/packages/ui/src/components/tool-call/renderers/bash.tsx index 1fd9d042e6..ef39b493a9 100644 --- a/packages/ui/src/components/tool-call/renderers/bash.tsx +++ b/packages/ui/src/components/tool-call/renderers/bash.tsx @@ -1,7 +1,8 @@ import { Show, createEffect, createMemo, onCleanup, type Accessor } from "solid-js" import type { ToolState } from "../../../types/tool-state" import type { MarkdownRenderOptions, ToolRenderer, ToolScrollHelpers } from "../types" -import { formatUnknownForCopy, formatUnknownForRender, getToolName, isToolStateCompleted, isToolStateError, isToolStateRunning, readToolStatePayload, TOOL_OUTPUT_RENDER_CHARACTER_LIMIT } from "../utils" +import { formatUnknownForCopy, formatUnknownForRender, getToolName, readToolStatePayload, TOOL_OUTPUT_RENDER_CHARACTER_LIMIT } from "../utils" +import { interruptedShellOutput, shellOutput } from "./bash-data" import { tGlobal } from "../../../lib/i18n" import { createStableAnsiStreamUpdater } from "../ansi-render" import { ansiToHtml, hasAnsi } from "../../../lib/ansi" @@ -77,15 +78,9 @@ function FinalAnsiOutput(props: { function getBashCopyText(state: ToolState | undefined): string { if (!state || state.status === "pending") return "" - const { input, metadata } = readToolStatePayload(state) + const { input } = readToolStatePayload(state) const command = typeof input.command === "string" && input.command.length > 0 ? `$ ${input.command}` : "" - const outputResult = formatUnknownForCopy( - isToolStateCompleted(state) - ? state.output - : (isToolStateRunning(state) || isToolStateError(state)) && metadata.output - ? metadata.output - : undefined, - ) + const outputResult = formatUnknownForCopy(shellOutput(state)) return [command, outputResult?.text].filter(Boolean).join("\n") } @@ -103,15 +98,9 @@ function BashToolBody(props: { const current = state() if (!current || current.status === "pending") return [] - const { input, metadata } = readToolStatePayload(current) + const { input } = readToolStatePayload(current) const command = typeof input.command === "string" ? input.command : "" - const output = formatUnknownForRender( - isToolStateCompleted(current) - ? current.output - : (isToolStateRunning(current) || isToolStateError(current)) && metadata.output - ? metadata.output - : undefined, - )?.text ?? "" + const output = formatUnknownForRender(shellOutput(current))?.text ?? "" if (!command) return output ? [output] : [] return output ? ["$ ", command, "\n", output] : ["$ ", command] }) @@ -169,13 +158,14 @@ export const bashRenderer: ToolRenderer = { getOutputChrome({ toolState }) { const state = toolState() if (!state || state.status === "pending") return undefined - const { input, metadata } = readToolStatePayload(state) - const output = isToolStateCompleted(state) ? state.output : (isToolStateRunning(state) || isToolStateError(state)) ? metadata.output : undefined + const { input } = readToolStatePayload(state) + const output = shellOutput(state) const hasCopyText = (typeof input.command === "string" && input.command.length > 0) || (output !== undefined && output !== null && output !== "" && (!Array.isArray(output) || output.length > 0)) if (!hasCopyText) return undefined return { language: "bash", getCopyText: () => getBashCopyText(state), hasCopyText: true, wrapToggle: true, suppressInnerHeader: true } }, + getErrorText: ({ toolState }) => interruptedShellOutput(toolState())?.notice, renderBody({ toolState, renderMarkdown, scrollHelpers, textRevealTarget }) { return }, diff --git a/packages/ui/src/components/tool-call/renderers/execute-data.test.ts b/packages/ui/src/components/tool-call/renderers/execute-data.test.ts new file mode 100644 index 0000000000..317dc35fee --- /dev/null +++ b/packages/ui/src/components/tool-call/renderers/execute-data.test.ts @@ -0,0 +1,36 @@ +import assert from "node:assert/strict" +import { describe, it } from "node:test" + +import { executeOutputForRender } from "./execute-data" + +describe("Code Mode output rendering", () => { + it("indents a compact JSON object or array result", () => { + assert.deepEqual(executeOutputForRender('{"a":1,"b":[true,null]}'), { text: '{\n "a": 1,\n "b": [\n true,\n null\n ]\n}', language: "json" }) + assert.deepEqual(executeOutputForRender("[1,2]"), { text: "[\n 1,\n 2\n]", language: "json" }) + }) + + it("keeps already indented results stable", () => { + const pretty = '{\n "a": 1\n}' + assert.deepEqual(executeOutputForRender(pretty), { text: pretty, language: "json" }) + }) + + it("keeps warning and log blocks after the indented result", () => { + assert.deepEqual(executeOutputForRender('{"a":1}\n\nWarnings:\n- [unawaited] call\n\nLogs:\nhello'), + { text: '{\n "a": 1\n}\n\nWarnings:\n- [unawaited] call\n\nLogs:\nhello' }) + }) + + it("leaves deeply nested results to the shared rendering without throwing", () => { + assert.equal(executeOutputForRender(`${"[".repeat(5000)}0${"]".repeat(5000)}`), null) + assert.equal(executeOutputForRender(`${"[".repeat(1000)}0${"]".repeat(1000)}`), null) + // Brackets inside strings do not count as nesting. + assert.deepEqual(executeOutputForRender(`{"a":"${"[".repeat(500)}"}`), { text: `{\n "a": "${"[".repeat(500)}"\n}`, language: "json" }) + assert.notEqual(executeOutputForRender(`${"[".repeat(64)}0${"]".repeat(64)}`), null) + assert.equal(executeOutputForRender(`${"[".repeat(65)}0${"]".repeat(65)}`), null) + }) + + it("leaves strings, scalars, errors and oversized output to the shared rendering", () => { + for (const output of ["plain text", "42", "null", '"quoted"', "{not json", "Error: boom\n\nLogs:\nx", undefined, 7, `[${"1,".repeat(120_000)}1]`]) { + assert.equal(executeOutputForRender(output), null, String(output).slice(0, 40)) + } + }) +}) diff --git a/packages/ui/src/components/tool-call/renderers/execute-data.ts b/packages/ui/src/components/tool-call/renderers/execute-data.ts index bcff55df12..bcf10f8e3b 100644 --- a/packages/ui/src/components/tool-call/renderers/execute-data.ts +++ b/packages/ui/src/components/tool-call/renderers/execute-data.ts @@ -29,6 +29,46 @@ export function executeData(state: ToolState | undefined) { outputPath: typeof metadata.outputPath === "string" ? metadata.outputPath : undefined } } +/** Parsing bound: larger outputs keep the shared raw rendering. */ +const EXECUTE_OUTPUT_FORMAT_LIMIT = 200_000 +/** Indentation grows with depth (quadratically for nested arrays): deeper results keep the raw rendering. */ +const EXECUTE_OUTPUT_FORMAT_DEPTH = 64 + +/** Bracket nesting outside strings, stopping as soon as it passes `limit`. */ +function exceedsJsonDepth(text: string, limit: number): boolean { + let depth = 0, inString = false + for (let index = 0; index < text.length; index += 1) { + const char = text[index] + if (inString) { + if (char === "\\") index += 1 + else if (char === "\"") inString = false + } else if (char === "\"") inString = true + else if (char === "[" || char === "{") { if (++depth > limit) return true } + else if (char === "]" || char === "}") depth -= 1 + } + return false +} + +/** + * Native Code Mode sends an object or array result as compact JSON, optionally followed by + * blank-line separated `Warnings:` and `Logs:` blocks. Render that result indented; anything + * else (strings, errors, unparsable or oversized output) returns null for the shared rendering. + */ +export function executeOutputForRender(output: unknown): { text: string; language?: string } | null { + if (typeof output !== "string" || output.length > EXECUTE_OUTPUT_FORMAT_LIMIT) return null + const sections = output.search(/\n\n(?:Warnings|Logs):\n/) + const head = sections < 0 ? output : output.slice(0, sections) + if (!/^\s*[[{]/.test(head) || exceedsJsonDepth(head, EXECUTE_OUTPUT_FORMAT_DEPTH)) return null + let text: string + try { + const value: unknown = JSON.parse(head) + if (value === null || typeof value !== "object") return null + text = JSON.stringify(value, null, 2) + } catch { return null } + if (text.length > EXECUTE_OUTPUT_FORMAT_LIMIT * 4) return null + return sections < 0 ? { text, language: "json" } : { text: text + output.slice(sections) } +} + export function executeSummary(calls: readonly ExecuteCall[]): string { const counts = new Map() for (const call of calls) counts.set(call.tool, (counts.get(call.tool) ?? 0) + 1) diff --git a/packages/ui/src/components/tool-call/renderers/execute.tsx b/packages/ui/src/components/tool-call/renderers/execute.tsx index 22db8c73ae..bdaebf68cd 100644 --- a/packages/ui/src/components/tool-call/renderers/execute.tsx +++ b/packages/ui/src/components/tool-call/renderers/execute.tsx @@ -1,7 +1,7 @@ import { Index, Show, createMemo } from "solid-js" import type { ToolRenderer } from "../types" import { defaultRenderer } from "./default" -import { executeData, executeSummary } from "./execute-data" +import { executeData, executeOutputForRender, executeSummary } from "./execute-data" import { formatUnknownForCopy, formatUnknownForRender, hasVisibleText, limitToolTitleForRender } from "../utils" import { getDefaultToolSearchText } from "../search-text" @@ -20,6 +20,11 @@ export const executeRenderer: ToolRenderer = { getOutputChrome: defaultRenderer.getOutputChrome, renderBody(context) { const data = createMemo(() => executeData(context.toolState())) + // Completed results only: a running call's partial output keeps the shared rendering. + const formattedOutput = createMemo(() => { + const state = context.toolState() + return state?.status === "completed" ? executeOutputForRender((state as { output?: unknown }).output) : null + }) const markdown = (text: string, language: string, key: string) => hasVisibleText(text) ? context.renderMarkdown({ content: text, codeLanguage: language, cacheKey: `execute-${key}`, disableHighlight: context.toolState()?.status === "running", @@ -42,7 +47,10 @@ export const executeRenderer: ToolRenderer = {

{context.t("toolCall.status.error")}

- {defaultRenderer.renderBody(context)} + + {output => context.renderMarkdown({ content: output().text, codeLanguage: output().language ?? "", + cacheKey: "execute-output", wrap: context.outputWrapEnabled?.() ?? true })} +

{context.t("toolCall.execute.truncated")} {data().outputPath}

}, diff --git a/packages/ui/src/components/tool-call/renderers/subagent-report.test.ts b/packages/ui/src/components/tool-call/renderers/subagent-report.test.ts new file mode 100644 index 0000000000..352709c46a --- /dev/null +++ b/packages/ui/src/components/tool-call/renderers/subagent-report.test.ts @@ -0,0 +1,125 @@ +import assert from "node:assert/strict" +import { describe, it } from "node:test" + +import { cachedSubagentDeliveries, indexSubagentDeliveries, isBackgroundSubagentLaunch, latestReportForLaunch, parseSubagentReport, SUBAGENT_REPORT_SCAN_LIMIT } from "./subagent-report" + +const report = (child: string, state: string, body: string) => + `\n${body}\n` + +type Entry = { id: string; createdAt: number; text?: string; synthetic?: boolean; launch?: { child: string; created?: number; ran?: number } } + +function session(entries: Entry[]) { + const messages = new Map(entries.map(entry => { + const data = entry.launch + ? { type: "tool", tool: "subagent", ...(entry.launch.created === undefined ? {} : { time: { created: entry.launch.created, ...(entry.launch.ran ? { ran: entry.launch.ran } : {}) } }), + state: { status: "completed", metadata: { sessionID: entry.launch.child, status: "running" } } } + : entry.text === undefined ? undefined : { type: "text", synthetic: entry.synthetic ?? true, text: entry.text } + return [entry.id, { createdAt: entry.createdAt, partIds: data ? [`${entry.id}-part`] : [], parts: data ? { [`${entry.id}-part`]: { data } } : {} }] + })) + const index = indexSubagentDeliveries(entries.map(entry => entry.id), id => messages.get(id)) as Map & { read?: unknown } + const read = (messageId: string, partId: string) => (messages.get(messageId)?.parts[partId]?.data as { text?: string } | undefined)?.text + return Object.assign(index, { latest: (child: string, at: number) => latestReportForLaunch(index.get(child), at, read), messages }) +} + +describe("background subagent reports", () => { + it("recognizes only a background launch acknowledgement", () => { + assert.equal(isBackgroundSubagentLaunch({ status: "completed", metadata: { sessionID: "ses_child", status: "running" } }), true) + assert.equal(isBackgroundSubagentLaunch({ status: "completed", metadata: { sessionID: "ses_child", status: "completed" } }), false) + assert.equal(isBackgroundSubagentLaunch({ status: "running", metadata: { status: "running" } }), false) + assert.equal(isBackgroundSubagentLaunch(undefined), false) + }) + + it("parses the report tag, keeping a still-running list in the body", () => { + const body = "Partial\n\nBackground work still running:\n- subagent (general, sessionID: ses_leaf): Leaf" + assert.deepEqual(parseSubagentReport(report("ses_child", "running", body)), { childId: "ses_child", state: "running", body }) + assert.equal(parseSubagentReport("\nx\n"), null) + assert.equal(parseSubagentReport("plain text"), null) + }) + + it("picks the latest report after the launch by time, whatever the listing order", () => { + const index = session([ + // Listed before the launch yet delivered after it; an older one listed after it. + { id: "msg_4", createdAt: 6, text: report("ses_child", "completed", "Final") }, + { id: "msg_0", createdAt: 1, text: report("ses_child", "completed", "Before launch") }, + { id: "msg_1", createdAt: 2, launch: { child: "ses_child" } }, + { id: "msg_3", createdAt: 4, text: report("ses_child", "running", "Intermediate") }, + { id: "msg_5", createdAt: 7, text: report("ses_other", "completed", "Other child") }, + { id: "msg_6", createdAt: 8, text: report("ses_child", "completed", "Typed by a user"), synthetic: false }, + ]) + assert.deepEqual(index.latest("ses_child", 2), + { childId: "ses_child", state: "completed", body: "Final", createdAt: 6, messageId: "msg_4" }) + assert.equal(index.latest("ses_child", 9), null) + assert.equal(index.latest("ses_missing", 2), null) + }) + + it("keeps each call's own report when the same child is continued", () => { + const index = session([ + { id: "msg_1", createdAt: 1, launch: { child: "ses_child", created: 2 } }, + { id: "msg_2", createdAt: 3, text: report("ses_child", "completed", "Result A") }, + { id: "msg_3", createdAt: 4, launch: { child: "ses_child", created: 5 } }, + { id: "msg_4", createdAt: 6, text: report("ses_child", "completed", "Result B") }, + ]) + assert.equal(index.latest("ses_child", 2)?.body, "Result A") + assert.equal(index.latest("ses_child", 5)?.body, "Result B") + }) + + it("breaks creation-time ties by message id and bounds the scan", () => { + const tied = session([ + { id: "msg_a", createdAt: 3, text: report("ses_child", "running", "First") }, + { id: "msg_b", createdAt: 3, text: report("ses_child", "completed", "Second") }, + ]) + assert.equal(tied.latest("ses_child", 0)?.body, "Second") + const padding = Array.from({ length: SUBAGENT_REPORT_SCAN_LIMIT }, (_, index) => ({ id: `msg_p${index}`, createdAt: 10 + index })) + const bounded = session([{ id: "msg_old", createdAt: 1, text: report("ses_child", "completed", "Too old") }, ...padding]) + assert.equal(bounded.latest("ses_child", 0), null) + }) + + it("bounds a continuation at its execution start, not at its argument streaming", () => { + const index = session([ + { id: "msg_1", createdAt: 1, launch: { child: "ses_child", created: 1 } }, + // The continuation streamed its arguments from 2 and ran at 4; the child reported at 3. + { id: "msg_2", createdAt: 2, launch: { child: "ses_child", created: 2, ran: 4 } }, + { id: "msg_3", createdAt: 3, text: report("ses_child", "completed", "First period") }, + { id: "msg_4", createdAt: 5, text: report("ses_child", "completed", "Second period") }, + ]) + assert.equal(index.latest("ses_child", 1)?.body, "First period") + assert.equal(index.latest("ses_child", 4)?.body, "Second period") + }) + + it("joins a call continued before its first report to the next period that reports", () => { + const index = session([ + { id: "msg_1", createdAt: 1, launch: { child: "ses_child", created: 1 } }, + { id: "msg_2", createdAt: 2, launch: { child: "ses_child", created: 2 } }, + { id: "msg_3", createdAt: 3, launch: { child: "ses_child", created: 3 } }, + { id: "msg_4", createdAt: 4, text: report("ses_child", "completed", "Joined result") }, + ]) + assert.equal(index.latest("ses_child", 1)?.body, "Joined result") + assert.equal(index.latest("ses_child", 3)?.body, "Joined result") + }) + + it("builds one index per session revision and resident message list", () => { + let builds = 0 + const build = () => { builds += 1; return new Map() } + const ids = ["msg_1"] + const first = cachedSubagentDeliveries(ids, 1, build) + assert.equal(cachedSubagentDeliveries(ids, 1, build), first) + assert.equal(builds, 1) + // Eviction or reload restarts revisions: a new list, or a list that changed length, rebuilds. + cachedSubagentDeliveries(["msg_1"], 1, build) + ids.push("msg_2"); cachedSubagentDeliveries(ids, 1, build) + cachedSubagentDeliveries(ids, 2, build) + assert.equal(builds, 4) + }) + + it("keeps report bodies in the store: the index holds references and skips evicted reports", () => { + const index = session([ + { id: "msg_1", createdAt: 1, launch: { child: "ses_child", created: 1 } }, + { id: "msg_2", createdAt: 2, text: report("ses_child", "running", "Older") }, + { id: "msg_3", createdAt: 3, text: report("ses_child", "completed", "x".repeat(1_000)) }, + ]) + assert.equal(JSON.stringify([...index]).includes("x".repeat(100)), false, "no body retained by the index") + assert.equal(index.latest("ses_child", 1)?.body.length, 1_000) + index.messages.delete("msg_3") + assert.equal(index.latest("ses_child", 1)?.body, "Older") + }) +}) diff --git a/packages/ui/src/components/tool-call/renderers/subagent-report.ts b/packages/ui/src/components/tool-call/renderers/subagent-report.ts new file mode 100644 index 0000000000..03e8c19b44 --- /dev/null +++ b/packages/ui/src/components/tool-call/renderers/subagent-report.ts @@ -0,0 +1,137 @@ +/** + * Background subagent delivery. A subagent call completes at once with `metadata.status: "running"`; + * the child's result reaches the parent session later as hidden synthetic reports, one per idle + * period: `\n\n`. + * A report tagged `running` is intermediate: the child still owns background work. + */ +import type { ClientPart } from "../../../types/message" +import { getPartStartedAt } from "../../../lib/message-timing" + +export type SubagentReportState = "running" | "completed" | "error" | "cancelled" + +export interface SubagentReport { + childId: string + state: SubagentReportState + body: string + createdAt: number + messageId: string +} + +/** Where a report lives; its body stays in the message store, so eviction releases it. */ +export interface SubagentReportRef { + childId: string + state: SubagentReportState + createdAt: number + messageId: string + partId: string +} + +/** One child's reports and the execution start of every call that launched or continued it. */ +export interface SubagentDeliveries { + reports: SubagentReportRef[] + launches: number[] +} + +/** Bounded scan of the parent session's newest messages. */ +export const SUBAGENT_REPORT_SCAN_LIMIT = 500 + +const REPORT = /^\n([\s\S]*)\n<\/subagent>\s*$/ +const SUBAGENT_TOOLS = new Set(["subagent", "task"]) + +export function parseSubagentReport(text: string): Pick | null { + const match = REPORT.exec(text) + return match ? { childId: match[1], state: match[2] as SubagentReportState, body: match[3] } : null +} + +/** A tool state that only acknowledges a background launch. */ +export function isBackgroundSubagentLaunch(state: unknown): boolean { + const value = state as { status?: unknown; metadata?: { status?: unknown } } | null | undefined + return value?.status === "completed" && value.metadata?.status === "running" +} + +/** The child session a subagent call launched or continued. */ +export function subagentChildId(state: unknown): string { + const metadata = (state as { metadata?: { sessionID?: unknown; sessionId?: unknown } } | null | undefined)?.metadata + const id = metadata?.sessionId ?? metadata?.sessionID + return typeof id === "string" ? id : "" +} + +/** When a call started executing (`time.ran`, else its part or message creation): reports before it belong to earlier calls. */ +export function subagentCallTime(part: unknown, messageCreatedAt: number): number { + return getPartStartedAt(part as ClientPart) ?? messageCreatedAt +} + +type ReportMessage = { + createdAt: number + partIds: readonly string[] + parts: Record +} + +/** Every child's report references and call times in the parent session; listing order is irrelevant. */ +export function indexSubagentDeliveries( + messageIds: readonly string[], + getMessage: (messageId: string) => ReportMessage | undefined, +): Map { + const index = new Map() + const entry = (childId: string) => { + let value = index.get(childId) + if (!value) index.set(childId, value = { reports: [], launches: [] }) + return value + } + for (let position = Math.max(0, messageIds.length - SUBAGENT_REPORT_SCAN_LIMIT); position < messageIds.length; position += 1) { + const messageId = messageIds[position] + const record = getMessage(messageId) + if (!record) continue + for (const partId of record.partIds) { + const part = record.parts[partId]?.data as { type?: unknown; synthetic?: unknown; text?: unknown; tool?: unknown; state?: unknown } | undefined + if (part?.type === "tool" && typeof part.tool === "string" && SUBAGENT_TOOLS.has(part.tool)) { + const childId = subagentChildId(part.state) + if (childId) entry(childId).launches.push(subagentCallTime(part, record.createdAt)) + continue + } + if (part?.type !== "text" || !part.synthetic || typeof part.text !== "string") continue + const report = parseSubagentReport(part.text) + if (report) entry(report.childId).reports.push({ childId: report.childId, state: report.state, createdAt: record.createdAt, messageId, partId }) + } + } + return index +} + +const newer = (left: SubagentReportRef, right: SubagentReportRef) => + left.createdAt !== right.createdAt ? right.createdAt - left.createdAt : right.messageId < left.messageId ? -1 : right.messageId > left.messageId ? 1 : 0 + +/** + * The latest report delivered to the call started at `launchedAt`, chosen by creation time, then + * by monotonic message id, and read from the store (`readText`; an evicted report is skipped). + * A call's period ends at the next call continuing the same child; every idle period reports, so a + * period without a report was still running when continued and joins the next call's period. + */ +export function latestReportForLaunch(deliveries: SubagentDeliveries | undefined, launchedAt: number, + readText: (messageId: string, partId: string) => string | undefined): SubagentReport | null { + if (!deliveries) return null + const boundaries = [...deliveries.launches.filter(time => time > launchedAt).sort((left, right) => left - right), Infinity] + for (const end of boundaries) { + const candidates = deliveries.reports.filter(report => report.createdAt >= launchedAt && report.createdAt < end).sort(newer) + for (const candidate of candidates) { + const text = readText(candidate.messageId, candidate.partId) + const report = text === undefined ? null : parseSubagentReport(text) + if (report?.childId === candidate.childId) { + return { childId: report.childId, state: report.state, body: report.body, createdAt: candidate.createdAt, messageId: candidate.messageId } + } + } + if (candidates.length) return null + } + return null +} + +/** Weakly owned by the session's resident message-id list: a replaced or evicted list releases its index. */ +const indexes = new WeakMap }>() + +/** One index per session revision and message list, shared by every card of that session. */ +export function cachedSubagentDeliveries(messageIds: readonly string[], revision: number, build: () => Map) { + const cached = indexes.get(messageIds) + if (cached && cached.revision === revision && cached.length === messageIds.length) return cached.index + const index = build() + indexes.set(messageIds, { revision, length: messageIds.length, index }) + return index +} diff --git a/packages/ui/src/components/tool-call/renderers/task.tsx b/packages/ui/src/components/tool-call/renderers/task.tsx index f8dbfd55ce..4391f301a6 100644 --- a/packages/ui/src/components/tool-call/renderers/task.tsx +++ b/packages/ui/src/components/tool-call/renderers/task.tsx @@ -20,6 +20,7 @@ import { getMessageWindowPageKey } from "../../message-history-pagination" import { useTaskStepCopy } from "./task-copy" import { getCanonicalToolName } from "../tool-presentation" import { describeTaskTitle, readSubagentName } from "./task-title" +import { cachedSubagentDeliveries, indexSubagentDeliveries, isBackgroundSubagentLaunch, latestReportForLaunch, subagentCallTime, type SubagentReport } from "./subagent-report" const TASK_MESSAGE_SCAN_LIMIT = 10_000 @@ -42,6 +43,25 @@ function extractSessionIdFromTaskState(state?: ToolState): string { return typeof directId === "string" ? directId : "" } +/** A background launch's latest report in the parent session; null for foreground calls. */ +function readBackgroundReport(context: Pick): SubagentReport | null | undefined { + const state = context.toolState() + if (!isBackgroundSubagentLaunch(state)) return undefined + const childId = extractSessionIdFromTaskState(state) + if (!childId) return null + const store = messageStoreBus.getOrCreate(context.instanceId) + // Track the parent session's revision only; the index is shared by its cards. + const revision = store.getSessionRevision(context.sessionId) + const messageIds = store.getSessionMessageIds(context.sessionId) + const index = untrack(() => cachedSubagentDeliveries(messageIds, revision, () => indexSubagentDeliveries(messageIds, store.getMessage))) + const call = context.toolCall() + const launchedAt = subagentCallTime(call, untrack(() => call.messageID ? store.getMessage(call.messageID)?.createdAt : undefined) ?? 0) + return latestReportForLaunch(index.get(childId), launchedAt, (messageId, partId) => { + const text = (store.getMessage(messageId)?.parts[partId]?.data as { text?: unknown } | undefined)?.text + return typeof text === "string" ? text : undefined + }) +} + function splitToolKey(key: string): { messageId: string; partId: string } | null { const separator = "::" const index = key.lastIndexOf(separator) @@ -171,8 +191,9 @@ export const taskRenderer: ToolRenderer = { tools: ["task"], getSearchText: getTaskToolSearchText, getAction: ({ t }) => t("toolCall.task.action.delegating"), - getOutputChrome({ toolState }) { - const output = getTaskOutputCopyText(toolState()) + getOutputChrome(context) { + const report = readBackgroundReport(context) + const output = report === undefined ? getTaskOutputCopyText(context.toolState()) : report?.body || null return output ? { getCopyText: () => output, hasCopyText: true } : undefined }, getTitle({ toolState, toolName }) { @@ -181,7 +202,7 @@ export const taskRenderer: ToolRenderer = { const { input } = readToolStatePayload(state) return describeTaskTitle(input, toolName()) }, - renderBody({ toolState, instanceId, isActive, renderToolCall, messageVersion, partVersion, scrollHelpers, renderMarkdown, t, onContentRendered }) { + renderBody({ toolState, toolCall, sessionId, instanceId, isActive, renderToolCall, messageVersion, partVersion, scrollHelpers, renderMarkdown, t, onContentRendered }) { const store = messageStoreBus.getOrCreate(instanceId) const childSessionId = createMemo(() => { @@ -326,7 +347,17 @@ export const taskRenderer: ToolRenderer = { return hasVisibleText(prompt) ? prompt : null }) + // A background launch's tool output only acknowledges it: show the child's latest report instead. + const backgroundReport = createMemo(() => readBackgroundReport({ instanceId, sessionId, toolCall, toolState })) + const backgroundStatus = createMemo((): ToolState["status"] | undefined => { + const report = backgroundReport() + if (report === undefined) return undefined + return !report || report.state === "running" ? "running" : report.state === "completed" ? "completed" : "error" + }) + const outputContent = createMemo(() => { + const report = backgroundReport() + if (report !== undefined) return report && hasVisibleText(report.body) ? report.body : null const state = toolState() if (!state) return null const output = typeof (state as { output?: unknown }).output === "string" ? ((state as { output?: string }).output as string) : null @@ -562,22 +593,31 @@ export const taskRenderer: ToolRenderer = { - -
+ +
{t("toolCall.task.sections.output")} + + {(status) => ( + + {summarizeStatusIcon(status())} + + )} +
-
- {renderMarkdown({ - content: outputContent()!, - renderLimit: MARKDOWN_TEXT_RENDER_CHARACTER_LIMIT, - cacheKey: "task:output", - disableScrollTracking: true, - })} -
+ +
+ {renderMarkdown({ + content: outputContent()!, + renderLimit: MARKDOWN_TEXT_RENDER_CHARACTER_LIMIT, + cacheKey: "task:output", + disableScrollTracking: true, + })} +
+
diff --git a/packages/ui/src/components/tool-call/types.ts b/packages/ui/src/components/tool-call/types.ts index 447c319d8d..ff773de593 100644 --- a/packages/ui/src/components/tool-call/types.ts +++ b/packages/ui/src/components/tool-call/types.ts @@ -108,6 +108,8 @@ export interface ToolRenderer { * in sync with custom renderBody output when adding specialized tool UIs. */ getSearchText?(context: ToolSearchTextContext): string[] + /** Part of a failed call's error shown under the error label when the body already shows the rest; defaults to the whole error. */ + getErrorText?(context: ToolRendererContext): string | undefined renderBody(context: ToolRendererContext): JSXElement | null } diff --git a/packages/ui/src/stores/legacy-runtime-cache.test.ts b/packages/ui/src/stores/legacy-runtime-cache.test.ts index 9dd2b5f860..d9a79e9db5 100644 --- a/packages/ui/src/stores/legacy-runtime-cache.test.ts +++ b/packages/ui/src/stores/legacy-runtime-cache.test.ts @@ -9,7 +9,7 @@ import { normalizeSessionMessage } from "./message-v2/normalizers" test("native pending HTTP data and enqueued SSE retain their distinct shapes through the stable reducer", async () => { const endpoint = { url: "http://127.0.0.1:4321" } - rememberRuntime(endpoint, { version: "2.2.3", pid: 1, discovery: "info" }) + rememberRuntime(endpoint, { version: "2.3.0", pid: 1, discovery: "info" }) const item = { id: "inbox", sessionID: "session", type: "user", payload: { text: "Pending" }, delivery: "queue", time: { created: 123 } } const api = OpenCode.make({ baseUrl: endpoint.url, fetch: createRuntimeFetch(endpoint, async () => Response.json({ data: [item] })) }) let dispose!: () => void diff --git a/packages/ui/tests/browser/fixtures/task-copy.tsx b/packages/ui/tests/browser/fixtures/task-copy.tsx index 65e146c04d..d60dcb338b 100644 --- a/packages/ui/tests/browser/fixtures/task-copy.tsx +++ b/packages/ui/tests/browser/fixtures/task-copy.tsx @@ -30,6 +30,13 @@ function toolMessage(sessionID: string, index: number, target?: string) { content: [{ type: "text", text: target ? "Task completed" : `Untruncated ${id}: ${"長い output\n".repeat(500)}` }] } }] } } +function subagentReport(created: number, state: string, body: string) { + // Native message ids derive from event ids (`evt_…` → `msg_…`), so a reload finds the same row. + return { id: `msg_report${created}`, type: "synthetic", time: { created }, description: `Explore ${childId}`, + text: `\n${body}\n`, + metadata: { source: "subagent", childID: childId, agent: "explore", state: state === "running" ? "completed" : state } } +} + const scenario = new URLSearchParams(location.search).get("steps") const history: Record = { [parentId]: [toolMessage(parentId, 0, childId)], @@ -45,6 +52,14 @@ if (scenario) { message.content = Array.from({ length: scenario === "overflow" ? 201 : 200 }, (_, index) => ({ ...message.content[0], id: `overflow-${index}` })) history[childId] = [message] } + if (scenario === "background" || scenario === "background-quiet") { + // A background launch only acknowledges; the child reports through hidden synthetic messages. + history[childId] = [toolMessage(childId, 0)] + const launch = history[parentId][0].content[0] + launch.state.metadata = { sessionID: childId, status: "running" } + launch.state.content = [{ type: "text", text: "The subagent is working in the background (sessionID: child). You will receive a message when it goes idle." }] + if (scenario === "background") history[parentId].push(subagentReport(10, "running", "Partial findings\n\nBackground work still running:\n- subagent (explore, sessionID: grandchild): Deeper")) + } if (scenario === "text-tail") { history[childId] = [toolMessage(childId, 0), ...Array.from({ length: 200 }, (_, index) => ({ id: `child-text-${index}`, type: "assistant", agent: "build", model, @@ -100,6 +115,25 @@ render(() => , document.getElementById("root")!) ;(window as any).fixture = { probeOlder: () => loadOlderMessageWindow(instanceId, childId), + /** One later idle period's report, delivered as the native event stream does. */ + report: (state: string, body: string) => { + const message = subagentReport(10 + history[parentId].length, state, body) + history[parentId].push(message) + ;(sseManager as any).handleEvent(instanceId, { id: message.id.replace(/^msg_/, "evt_"), type: "session.synthetic", created: message.time.created, + durable: { aggregateID: parentId, seq: history[parentId].length, version: 1 }, location: { directory: "/fixture" }, + data: { sessionID: parentId, text: message.text, description: message.description, metadata: message.metadata } }) + }, + reload: () => loadMessages(instanceId, parentId, { force: true }), + /** The parent continues the same child with a second call, then gets that call's report. */ + continueChild: async (body: string) => { + const created = 10 + history[parentId].length + history[parentId].push({ id: `msg_continue${created}`, type: "assistant", agent: "build", model, time: { created, completed: created }, + content: [{ id: "continued-task", type: "tool", name: "subagent", time: { created, completed: created }, + state: { status: "completed", input: { agent: "explore", description: "Continue child" }, + metadata: { sessionID: childId, status: "running" }, content: [{ type: "text", text: "The subagent is working in the background (sessionID: child)." }] } }] }) + history[parentId].push(subagentReport(created + 1, "completed", body)) + await loadMessages(instanceId, parentId, { force: true }) + }, hold: () => { held = true }, release: () => { held = false; gates.splice(0).forEach(resolve => resolve()) }, selectSession: (id: string) => { setSelectedSession(id); setActiveSession(instanceId, id) }, diff --git a/packages/ui/tests/browser/fixtures/tool-images.tsx b/packages/ui/tests/browser/fixtures/tool-images.tsx index 8ac3af6b1f..01deb85168 100644 --- a/packages/ui/tests/browser/fixtures/tool-images.tsx +++ b/packages/ui/tests/browser/fixtures/tool-images.tsx @@ -55,6 +55,8 @@ function content(kind: string) { if (kind === "deferred") return [{ ...png, uri: deferredUri() }] if (kind === "deferred-missing") return [{ ...png, uri: deferredUri("b") }] if (kind === "empty") return [{ type: "text", text: "Text-only result" }] + // Native Code Mode result: compact JSON, then its logs block. + if (kind === "json") return [{ type: "text", text: '{"answer":42,"items":["a","b"]}\n\nLogs:\nhello' }] if (kind === "broken") return [{ ...png, uri: "data:image/png;base64,broken" }] if (kind === "unsafe") return [{ ...png, uri: "javascript:window.unexpectedNavigation=true" }] return [{ type: "text", text: "Generated 2 images. Saved successfully." }, png, jpeg] @@ -102,6 +104,14 @@ render(() => await loadMessages(instanceId, sessionId, { force: true }) }, deferred: () => ({ path: deferredUri(), base64: png.uri.slice(png.uri.indexOf(",") + 1) }), + /** A shell call the user interrupted, as OpenCode 2.3 settles it: output so far, then the notice. */ + interruptedShell: async () => { + const notice = "[full output saved to /fixture/out.txt]\n\nCommand interrupted by the user (shell ID: sh_1)." + messages = [{ ...completed("empty", "shell"), content: [{ id: "tool", type: "tool", name: "shell", time: { created: 1, completed: ++time }, + state: { status: "error", input: { command: "npm test" }, error: { message: `PARTIAL_LINE_1\nPARTIAL_LINE_2\n\n${notice}` }, + metadata: { interrupted: true, truncated: false, shellID: "sh_1", notice } } }] }] + await loadMessages(instanceId, sessionId, { force: true }) + }, execute: async (phase: string) => { const input = { code: "const results = await Promise.all([tools.paint({ prompt: 'sky' }), tools.fail({})]);\nreturn results" } const metadata = { toolCalls: [ @@ -113,6 +123,12 @@ render(() => emit("session.tool.progress", { id: "tool", metadata }) return } + if (phase === "json") { + messages = [{ ...completed("json", "execute"), content: [{ id: "tool", type: "tool", name: "execute", + time: { created: 1, completed: time }, state: { status: "completed", input, metadata: { toolCalls: [] }, content: content("json") } }] }] + await loadMessages(instanceId, sessionId, { force: true }) + return + } if (phase === "running") { emit("session.step.started", { agent: "build", model, started: 1 }) emit("session.tool.input.started", { id: "tool", name: "execute" }) diff --git a/packages/ui/tests/browser/task-copy.test.ts b/packages/ui/tests/browser/task-copy.test.ts index 879805e1d6..77a85e3a95 100644 --- a/packages/ui/tests/browser/task-copy.test.ts +++ b/packages/ui/tests/browser/task-copy.test.ts @@ -60,6 +60,48 @@ test("short native child boundary cursor does not invent render overflow", { tim assert.equal((await page.evaluate(() => (window as any).fixture.snapshot())).requests.filter((request: any) => request.sessionID === "child").length, 2) }, "short")) +test("a background subagent card shows the child's latest report instead of its launch acknowledgement", { timeout: 45_000 }, async () => withPage(async page => { + const tool = page.locator('.tool-call[data-part-id="parent-task"]') + const output = tool.locator('.tool-call-task-sections section[data-subagent-report]') + await output.waitFor() + assert.equal(await output.getAttribute("data-subagent-report"), "running") + assert.match(await output.textContent() ?? "", /Partial findings.*Background work still running/s) + assert.doesNotMatch(await tool.textContent() ?? "", /working in the background/) + // A later idle period's final report replaces it live, through the native event stream. + await page.evaluate(() => (window as any).fixture.report("completed", "Final answer: 42")) + await page.waitForFunction(() => document.querySelector('.tool-call[data-part-id="parent-task"] section[data-subagent-report]')?.getAttribute("data-subagent-report") === "completed") + assert.match(await output.textContent() ?? "", /Final answer: 42/) + assert.doesNotMatch(await output.textContent() ?? "", /Partial findings/) + // The synthetic reports stay hidden from the transcript: the result appears once, in the card. + assert.equal(((await page.locator("main").textContent()) ?? "").split("Final answer: 42").length - 1, 1) + // An authoritative reload keeps the same latest report. + await page.evaluate(() => (window as any).fixture.reload()) + assert.equal(await output.getAttribute("data-subagent-report"), "completed") + assert.match(await output.textContent() ?? "", /Final answer: 42/) + // Continuing the same child gives the new call its own report; the first card keeps its result. + await page.evaluate(() => (window as any).fixture.continueChild("Continued result")) + const continued = page.locator('.tool-call[data-part-id="continued-task"] section[data-subagent-report]') + await continued.waitFor() + assert.match(await continued.textContent() ?? "", /Continued result/) + assert.match(await output.textContent() ?? "", /Final answer: 42/) + assert.doesNotMatch(await output.textContent() ?? "", /Continued result/) + await page.evaluate(() => (window as any).fixture.report("error", "Child failed")) + await page.waitForFunction(() => document.querySelector('.tool-call[data-part-id="continued-task"] section[data-subagent-report]')?.getAttribute("data-subagent-report") === "error") + assert.equal(await output.getAttribute("data-subagent-report"), "completed") +}, "background")) + +test("a call continued before its first report shares the next report instead of running forever", { timeout: 45_000 }, async () => withPage(async page => { + const first = page.locator('.tool-call[data-part-id="parent-task"] section[data-subagent-report]') + await first.waitFor() + assert.equal(await first.getAttribute("data-subagent-report"), "running") + await page.evaluate(() => (window as any).fixture.continueChild("Joined result")) + const continued = page.locator('.tool-call[data-part-id="continued-task"] section[data-subagent-report]') + await continued.waitFor() + await page.waitForFunction(() => document.querySelector('.tool-call[data-part-id="parent-task"] section[data-subagent-report]')?.getAttribute("data-subagent-report") === "completed") + assert.match(await first.textContent() ?? "", /Joined result/) + assert.match(await continued.textContent() ?? "", /Joined result/) +}, "background-quiet")) + test("exactly 200 observed child rows are not render overflow", { timeout: 45_000 }, async () => withPage(async page => { const sections = page.locator('.tool-call[data-part-id="parent-task"] .tool-call-task-sections').first() const steps = sections.locator(':scope > section').filter({ has: page.locator('.tool-call-task-section-title', { hasText: /^Steps$/ }) }) diff --git a/packages/ui/tests/browser/tool-images.test.ts b/packages/ui/tests/browser/tool-images.test.ts index d9776b3afb..7ece9d7609 100644 --- a/packages/ui/tests/browser/tool-images.test.ts +++ b/packages/ui/tests/browser/tool-images.test.ts @@ -142,6 +142,27 @@ test("a tool image deferred by its transcript page loads from CodeNomad's sessio assert.equal(requested.length, 2) })) +test("an interrupted shell call shows its output so far as output and only the notice as error", async () => withPage(async page => { + await page.evaluate(() => (window as any).fixture.interruptedShell()) + const error = page.locator(".tool-call-error-content") + await error.waitFor() + assert.match(await error.textContent() ?? "", /Command interrupted by the user \(shell ID: sh_1\)/) + assert.doesNotMatch(await error.textContent() ?? "", /PARTIAL_LINE/) + const output = page.locator(".tool-call pre", { hasText: "PARTIAL_LINE_1" }).first() + await output.waitFor() + assert.match(await output.textContent() ?? "", /npm test\s+PARTIAL_LINE_1\nPARTIAL_LINE_2/) +})) + +test("Code Mode indents a compact JSON result and keeps its logs", async () => withPage(async page => { + await page.evaluate(() => (window as any).fixture.execute("json")) + const block = page.locator(".tool-call-execute pre", { hasText: '"answer"' }).first() + await block.waitFor() + const text = await block.textContent() ?? "" + assert.match(text, /\{\n\s+"answer": 42,\n\s+"items": \[\n\s+"a",/) + assert.match(text, /Logs:\nhello/) + assert.doesNotMatch(text, /\{"answer":42/) +})) + test("Code Mode renders native progress, nested errors, script, images and historical output", async () => withPage(async page => { await page.evaluate(() => (window as any).fixture.execute("running")) await page.locator(".execute-calls").waitFor() diff --git a/scripts/test-integrations-attachments-native.mjs b/scripts/test-integrations-attachments-native.mjs index 782d49c9e0..cccd7ddd17 100644 --- a/scripts/test-integrations-attachments-native.mjs +++ b/scripts/test-integrations-attachments-native.mjs @@ -110,7 +110,8 @@ try { }) const connection = { ...fixtureConnection, client } const info = await client.server.info() - assert.match(info.version, /^2\.2\.\d+$/, "Qualify the requested OpenCode 2.2.x runtime") + const { isBelowOpenCodeMinimum } = await tsImport("../packages/server/src/opencode/runtime-support.ts", import.meta.url) + assert(!isBelowOpenCodeMinimum(info.version), `Qualify a supported OpenCode runtime, not ${info.version}`) console.log(`Native runtime: ${info.version}`) await writeFixtureServiceRegistration(env, { ...info, url: connection.endpoint.url, password: connection.endpoint.auth.password }) const location = (await client.location.get({ location: { directory: root } })).directory diff --git a/scripts/test-integrations-host-install-native.mjs b/scripts/test-integrations-host-install-native.mjs index 9a3a218db4..17b1893162 100644 --- a/scripts/test-integrations-host-install-native.mjs +++ b/scripts/test-integrations-host-install-native.mjs @@ -1,4 +1,4 @@ -// Run: node --import tsx scripts/test-integrations-host-install-native.mjs [integration checkout] +// Run: node --import tsx scripts/test-integrations-host-install-native.mjs [integration checkout] // Uses the existing built kit read-only; never launches Blender or installs an application payload. import assert from "node:assert/strict" import { spawn } from "node:child_process" @@ -18,6 +18,7 @@ import { catalogEntry, catalogOf } from "../packages/server/src/opencode/integra import { IntegrationAttachments } from "../packages/server/src/opencode/integrations/attachments.ts" import { registerIntegrationAttachmentRoutes } from "../packages/server/src/server/routes/integration-attachments.ts" import { registerRequestLogging } from "../packages/server/src/server/request-logging.ts" +import { isBelowOpenCodeMinimum } from "../packages/server/src/opencode/runtime-support.ts" const checkout = path.resolve(process.argv[3] ?? "D:/opencode_bundles-work/opencode-integrations") const probes = { @@ -138,7 +139,7 @@ export default { id: marker.plugin, async setup(ctx) { }, async ({ root, env, requests, connection: fixtureConnection }) => { assert(Object.keys(env).every(key => !/^BLENDER_|^PYTHON(PATH|HOME)$/.test(key)), "Daemon inherits no user Blender or Python overrides") const info = await fixtureConnection.client.server.info() - assert.equal(info.version, "2.2.5") + assert(!isBelowOpenCodeMinimum(info.version), `Qualify a supported OpenCode runtime, not ${info.version}`) console.log(`Native runtime: ${info.version}`) const authorization = `Basic ${Buffer.from(`opencode:${fixtureConnection.endpoint.auth.password}`).toString("base64")}` const client = OpenCode.make({ baseUrl: fixtureConnection.endpoint.url, headers: { authorization }, fetch: (input, init) => diff --git a/scripts/test-missions-native-trajectory.mjs b/scripts/test-missions-native-trajectory.mjs index 78633c77c0..f30f1f22d8 100644 --- a/scripts/test-missions-native-trajectory.mjs +++ b/scripts/test-missions-native-trajectory.mjs @@ -39,7 +39,7 @@ let stage = "isolated setup", nativeToolBefore, rootAfterLaunch = false, rootRel let capture let decision = false, decisionStep = 0, assignment, storeAssignment, journalBefore, humanArtifact let compare = false, compareStep = 0, compareCalls = [], comparison -const compareAssignments = new Map(), runModels = new Set() +const compareAssignments = new Map(), runModels = new Set(), deliveries = new Map() const journal = () => { const db = new DatabaseSync(path.join(root, "fixture.db"), { readOnly: true }) try { return db.prepare("SELECT key,value FROM kv WHERE key LIKE '%codenomad-missions/v2/%' ORDER BY key").all() } finally { db.close() } @@ -63,6 +63,18 @@ const provider = createServer(async (request, response) => { const content = body.messages.findLast(message => message.role === "tool" && message.tool_call_id === id)?.content return typeof content === "string" ? content : content?.map(part => part.text ?? "").join("") } + /** A subagent call's delivered result: the child's final report after the call's launch acknowledgement. */ + const delivered = id => { + const child = result(id)?.match(/working in the background \(sessionID: (ses_[A-Za-z0-9]+)\)/)?.[1] + if (!child) return undefined + const reports = body.messages.map(message => typeof message.content === "string" ? message.content : (message.content ?? []).map(part => part.text ?? "").join("")) + .flatMap(value => [...value.matchAll(/]*>\n([\s\S]*?)\n<\/subagent>/g)]) + .filter(match => match[1] === child) + // A report tagged running is intermediate: the child still owns background work. + const final = reports.findLast(match => match[2] !== "running") + if (final) deliveries.set(id, { child, intermediate: reports.filter(match => match[2] === "running").length, state: final[2] }) + return final?.[3] + } if (compare) { if (sessionID !== coordinator) { const role = text.includes("Role: Model A (model-a)") ? "model-a" : text.includes("Role: Model B (model-b)") ? "model-b" : "comparator" @@ -70,22 +82,27 @@ const provider = createServer(async (request, response) => { if (role !== "comparator") runModels.add(body.model) answer = role === "comparator" ? JSON.stringify(comparison) : "RUN_OUTPUT: 4" } else { - const previous = compareCalls[compareStep - 1], returned = previous && result(previous.id) - if (previous?.reject) { - assert.match(returned, /byte-identical/) - assert.deepEqual(journal(), journalBefore, "Unequal-brief refusal leaves the journal unchanged") - } else if (previous?.tool === "mission_delegate") compareAssignments.set(previous.input.taskKey, JSON.parse(returned)) - else if (previous?.tool === "mission_report") assert.equal(JSON.parse(returned).disposition, previous.input.final ? "finished" : "reported") - else if (previous?.tool === "subagent") { - if (previous.id === "launch_judge") compareCalls[compareStep].input.artifact = JSON.parse(returned.match(/\{"version":1[^\n]+\}/)[0]) - else assert.match(returned, /RUN_OUTPUT: 4/) - } - answer = compareCalls[compareStep++] ?? "Done" - assert(compareStep <= compareCalls.length + 1) - if (answer.reject) journalBefore = journal() - if (answer.tool === "subagent") { - answer.input.prompt = compareAssignments.get(answer.taskKey).assignmentPrompt - if (answer.taskKey === "judge") assert(!/fixture\/model-[ab]/.test(answer.input.prompt), "Judge prompt hides model identities") + const previous = compareCalls[compareStep - 1] + const returned = previous && (previous.tool === "subagent" ? delivered(previous.id) : result(previous.id)) + // A background run acknowledges at once: end the round until its report wakes the coordinator. + if (previous?.tool === "subagent" && returned === undefined) answer = "Awaiting the run's report." + else { + if (previous?.reject) { + assert.match(returned, /byte-identical/) + assert.deepEqual(journal(), journalBefore, "Unequal-brief refusal leaves the journal unchanged") + } else if (previous?.tool === "mission_delegate") compareAssignments.set(previous.input.taskKey, JSON.parse(returned)) + else if (previous?.tool === "mission_report") assert.equal(JSON.parse(returned).disposition, previous.input.final ? "finished" : "reported") + else if (previous?.tool === "subagent") { + if (previous.id === "launch_judge") compareCalls[compareStep].input.artifact = JSON.parse(returned.match(/\{"version":1[^\n]+\}/)[0]) + else assert.match(returned, /RUN_OUTPUT: 4/) + } + answer = compareCalls[compareStep++] ?? "Done" + assert(compareStep <= compareCalls.length + 1) + if (answer.reject) journalBefore = journal() + if (answer.tool === "subagent") { + answer.input.prompt = compareAssignments.get(answer.taskKey).assignmentPrompt + if (answer.taskKey === "judge") assert(!/fixture\/model-[ab]/.test(answer.input.prompt), "Judge prompt hides model identities") + } } } } else if (decision) { @@ -93,6 +110,9 @@ const provider = createServer(async (request, response) => { // The decision worker returns a brief; only the coordinator asks the human. assert.match(text, /Never ask the human yourself/) answer = "DECISION_BRIEF: Module owns the boundary and is cheap to undo; Adapter adds a layer. Recommendation: Module." + } else if (decisionStep === 3 && delivered("launch") === undefined) { + // A background decision worker acknowledges at once; its brief arrives in a later report. + answer = "Awaiting the decision worker's brief." } else { if (decisionStep === 1) { assignment = JSON.parse(result("declare")); journalBefore = journal(); assert(journalBefore.length) } if (decisionStep === 2) { @@ -100,7 +120,7 @@ const provider = createServer(async (request, response) => { assert.deepEqual(journal(), journalBefore, "Refusal leaves every one-time journal row unchanged") } if (decisionStep === 3) { - assert.match(result("launch"), /DECISION_BRIEF/) + assert.match(delivered("launch"), /DECISION_BRIEF/) assert.match(assignment.questionTag, /^\[decision decision [0-9a-f]{8}\]$/) } if (decisionStep === 4) storeAssignment = JSON.parse(result("declare_store")) @@ -153,12 +173,12 @@ const provider = createServer(async (request, response) => { return value.assignmentPrompt } answer = ["alpha", "beta"].map(key => call("subagent", { agent: "trajectory_child", description: `Native ${key}`, - prompt: declared(key), background: true }, `trajectory_launch_${key}`)) + prompt: declared(key) }, `trajectory_launch_${key}`)) } else if (coordinatorStep === 4) { rootAfterLaunch = true await new Promise(resolve => { holds.set("coordinator", resolve); response.once("close", resolve) }) answer = "Private native work launched; await native returns." - } else if (text.includes("ALPHA_NATIVE_RETURN") && text.includes("BETA_NATIVE_RETURN")) { + } else if (delivered("trajectory_launch_alpha")?.includes("ALPHA_NATIVE_RETURN") && delivered("trajectory_launch_beta")?.includes("BETA_NATIVE_RETURN")) { if (coordinatorStep === 5) answer = call("mission_report", { taskKey: "alpha", outcome: "completed", summary: "Alpha returned recursive evidence", evidence: ["ALPHA_NATIVE_RETURN", "LEAF_NATIVE_RETURN"] }, "trajectory_report_alpha") else if (coordinatorStep === 6) answer = call("mission_report", { taskKey: "beta", outcome: "completed", @@ -176,7 +196,14 @@ const provider = createServer(async (request, response) => { } else if (assignment.includes("TRAJECTORY_ALPHA")) { if (first) answer = call("subagent", { agent: "trajectory_child", description: "Bounded recursive leaf", prompt: "TRAJECTORY_LEAF: Return only bounded helper evidence." }, "trajectory_recurse") - else { assert(text.includes("LEAF_NATIVE_RETURN")); answer = "ALPHA_NATIVE_RETURN: consumed LEAF_NATIVE_RETURN" } + else if (text.includes("LEAF_NATIVE_RETURN")) answer = "ALPHA_NATIVE_RETURN: consumed LEAF_NATIVE_RETURN" + else { + // A background launch returns before the leaf: wait (held, so alpha stays observably active) + // and end this round; the leaf's later `` report wakes alpha for its actual return. + assert(!holds.has("alpha"), "One awaiting round per launch") + await new Promise(resolve => { holds.set("alpha", resolve); response.once("close", resolve) }) + answer = "ALPHA_AWAITING_LEAF: launched the bounded recursive leaf" + } } else if (assignment.includes("TRAJECTORY_BETA")) { if (first) await new Promise(resolve => { holds.set("beta", resolve); response.once("close", resolve) }) answer = "BETA_NATIVE_RETURN: independent ready work evidence" @@ -306,6 +333,16 @@ try { console.log(`CHECKPOINT ${label}: ${snapshot.missions.map(value => `${value.runState}/${value.status}, ${value.tasks.length} tasks, ${value.reports.length} reports`).join("; ")}`) return record } + /** The family is done only once no conversation is active and none wakes again: no late report reaches the provider. */ + const quiesced = async label => { + const idle = async () => !Object.keys(await client.session.active({}, { signal: AbortSignal.timeout(20_000) })).length + await until(idle, `${label}: family quiescence`) + const seen = requests.length + await delay(1_500) + assert(await idle(), `${label}: a conversation became active again`) + assert.equal(requests.length, seen, `${label}: no late wake after the final delivery`) + receipt.quiescence = { ...receipt.quiescence, [label]: { providerRequests: seen } } + } await checkpoint("before") const missionURL = `/api/workspaces/${workspace.id}/missions` stage = "prepared create" @@ -341,7 +378,16 @@ try { gate("real OpenCode parallel siblings and recursive grandchild active simultaneously") gate("owned display route observes four genuine conversations without guessed task associations") stage = "native return and coordinator consumption" - release("leaf"); release("beta") + release("beta") + // Alpha's recursion is acknowledged at once and alpha holds an awaiting round. Ending that round + // while the leaf still runs yields an intermediate report. + await until(() => holds.has("alpha"), "alpha's launch acknowledgement") + release("alpha") + await until(async () => !(await client.session.active({}, { signal: AbortSignal.timeout(20_000) }))[alpha.id], "alpha's awaiting round ends") + assert(holds.has("leaf"), "The leaf still runs when alpha's awaiting round ends") + release("leaf") + // Alpha answers only after it actually received the leaf's evidence. + await until(() => requests.some(value => value.sessionID === alpha.id && JSON.stringify(value.body.messages).includes("LEAF_NATIVE_RETURN"))) await Promise.all([alpha.id, beta.id, leaf.id].map(sessionID => client.session.wait({ sessionID }, { signal: AbortSignal.timeout(20_000) }))) const returned = await checkpoint("returned-before-readout") assert.equal(returned.snapshot.missions[0].reports.length, 0) @@ -351,6 +397,7 @@ try { rootReleased = true; release("coordinator") await until(async () => (await rpc.snapshot({}, options())).missions[0]?.status === "completed") await client.session.wait({ sessionID: coordinator }, { signal: AbortSignal.timeout(20_000) }) + await quiesced("custom") const after = await checkpoint("completed") mission = after.snapshot.missions[0] assert(mission.tasks.every(value => value.status === "completed" && value.report.delivery === "coordinator-readout")) @@ -363,6 +410,25 @@ try { const consumed = requests.find(value => value.sessionID === coordinator && value.kind === "primary" && JSON.stringify(value.body.messages).includes("ALPHA_NATIVE_RETURN") && JSON.stringify(value.body.messages).includes("BETA_NATIVE_RETURN")) assert(consumed, "Provider actually saw both native returns before reports") receipt.consumedRequestIndex = consumed.index + // Each launch is only acknowledged. Alpha's first idle round left its leaf running, so its report is + // tagged running (intermediate) before the final report carries the return. + const alphaDelivery = deliveries.get("trajectory_launch_alpha"), betaDelivery = deliveries.get("trajectory_launch_beta") + assert(alphaDelivery && betaDelivery, JSON.stringify([...deliveries])) + assert.equal(alphaDelivery.child, alpha.id); assert.equal(betaDelivery.child, beta.id) + assert.equal(alphaDelivery.state, "completed"); assert.equal(betaDelivery.state, "completed") + assert(alphaDelivery.intermediate >= 1, "Alpha's leaf-awaiting round is reported as still running") + assert.equal(betaDelivery.intermediate, 0) + // The job finished its period, so the metadata says completed while the model-facing tag says running. + const reports = messages.data.filter(message => message.type === "synthetic" && message.metadata?.source === "subagent" && message.metadata.childID === alpha.id) + const intermediate = reports.find(message => message.text.includes('state="running"')) + assert(intermediate?.text.includes("Background work still running:") && intermediate.text.includes(leaf.id), JSON.stringify(reports)) + assert.equal(intermediate.metadata.state, "completed") + // Listing order need not follow delivery order: the final report is identified by its tag and content. + const final = reports.find(message => message.text.includes('state="completed"') && message.text.includes("ALPHA_NATIVE_RETURN")) + assert(final, JSON.stringify(reports.map(({ id, text, metadata }) => ({ id, text: text.slice(0, 120), metadata })))) + receipt.alphaReports = reports.map(message => ({ id: message.id, created: message.time.created, + tagRunning: message.text.includes('state="running"'), metadataState: message.metadata.state })) + receipt.deliveries = Object.fromEntries(deliveries) gate("coordinator consumes native returns then reports two tasks and terminal completion") assert.deepEqual(await client.rpc(definition).inspect({}, options()), nativeToolBefore) assert.equal((await client.server.info()).pid, info.pid) @@ -384,6 +450,8 @@ try { assert.equal(reply.statusCode, 204, reply.body) await until(() => decisionStep === 13) await client.session.wait({ sessionID: coordinator }, { signal: AbortSignal.timeout(20_000) }) + await quiesced("wayfinder") + assert.equal(deliveries.get("launch")?.state, "completed") const completed = (await rpc.snapshot({}, options())).missions.find(value => value.id === wayfinder.mission.id) assert.equal(completed.status, "completed"); assert(completed.tasks.every(task => task.status === "completed")) const report = completed.tasks.find(task => task.key === "decision").report @@ -430,6 +498,8 @@ try { assert.equal(comparePlay.statusCode, 200, comparePlay.body) await until(() => compareStep === compareCalls.length + 1) await client.session.wait({ sessionID: coordinator }, { signal: AbortSignal.timeout(20_000) }) + await quiesced("compare") + for (const id of ["launch_x", "launch_y", "launch_judge"]) assert(deliveries.has(id), `Delivered run result: ${id}`) const compared = (await rpc.snapshot({}, options())).missions.find(value => value.id === made.mission.id) assert.equal(compared.status, "completed"); assert.equal(runModels.size, 2) assert.deepEqual(compared.tasks.find(task => task.role === "comparator").report.artifact, comparison) diff --git a/scripts/test-subagent-nesting-native.mjs b/scripts/test-subagent-nesting-native.mjs index 14b9d6e9f3..e71ce3dded 100644 --- a/scripts/test-subagent-nesting-native.mjs +++ b/scripts/test-subagent-nesting-native.mjs @@ -27,8 +27,11 @@ const provider = createServer(async (request, response) => { for await (const chunk of request) raw += chunk const body = JSON.parse(raw), tools = (body.tools ?? []).map(tool => tool.function?.name) assert(++calls < 100, "Provider request budget") - // Launch one General subagent when offered the tool; conclude once its result returns. - const answer = !body.stream || body.messages?.at(-1)?.role === "tool" || !tools.includes("subagent") ? "DONE" + // Launch one General subagent when offered the tool; conclude once its launch is acknowledged (a tool + // message) or the child reports in a later `` message. + const last = body.messages?.at(-1) + const concluded = last?.role === "tool" || JSON.stringify(last?.content ?? "").includes(" (await client.message.list({ sessionID: parent, limit: { order: "asc", limit: 100 } })).data + .some(message => message.type === "synthetic" && message.metadata?.source === "subagent" + && message.metadata.childID === childID && message.metadata.state === "completed" && message.text.includes("DONE") + && !message.text.includes('state="running"')) let levels = 0 for (let frontier = [session.id]; frontier.length; levels++) { const next = [] - for (const id of frontier) next.push(...(await client.session.list({ location, parentID: id, limit: 32 })).data.map(item => item.id)) + for (const id of frontier) { + for (const item of (await client.session.list({ location, parentID: id, limit: 32 })).data) { + assert(await received(id, item.id), `level ${levels + 1}: ${item.id} delivered its final result to ${id}`) + next.push(item.id) + } + } if (!next.length) return levels frontier = next } From c0ea1dd6e9e04ed74f95fb1d108975543d020e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Andr=C3=A9?= Date: Fri, 13 Nov 2026 18:32:28 +0100 Subject: [PATCH 04/25] feat(integrations): manage integrations from their Plugins rows (#1492) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Manage each recognized OpenCode integration from its Status → Plugins row. Remove the separate per-integration sections and manual attachment picker; integrations attach conversations through their native first-use contract. Show catalogue names, package versions, integration-accent switches, conversation binding and application warnings. The chain button attaches to a compatible open document or detaches the captured conversation. Revoke pending enumeration and choices on navigation, invalidation, reconnect and disposal. Keep guarded application installation and one-shot native actions alongside existing package controls. Reads remain demand-driven and refresh on native events and reconnects. Explicit refresh also retries demanded bindings for the exact displayed conversation and Location. Preserve integration display and native actions for inherited, virtual and runtime-only plugins through an unambiguous runtime identity, separately from writable-source mutation authority. Keep revision checks, consent revocation and uncertain-outcome handling; never replay a mutation automatically. Update help and UI strings in ten locales, documentation and captures. Cover binding recovery, read-only origins, activation/removal scope and native-action guards through unit and real-panel browser regressions. Qualify the projected runtime identities with the isolated official daemon. --- .github/workflows/pr-build.yml | 3 +- dev-docs/CACHE_REFRESH_CONVENTIONS.md | 2 +- dev-docs/OPENCODE_INTEGRATIONS.md | 138 ++-- dev-docs/PLUGIN_CONTROLS.md | 6 +- dev-docs/UI_SHELL.md | 3 +- docs/help/de/integrations.md | 24 +- docs/help/de/settings.md | 2 +- docs/help/en/integrations.md | 24 +- docs/help/en/settings.md | 2 +- docs/help/es/integrations.md | 24 +- docs/help/es/settings.md | 2 +- docs/help/fr/integrations.md | 24 +- docs/help/fr/settings.md | 2 +- docs/help/he/integrations.md | 24 +- docs/help/he/settings.md | 2 +- docs/help/ja/integrations.md | 24 +- docs/help/ja/settings.md | 2 +- docs/help/ne/integrations.md | 24 +- docs/help/ne/settings.md | 2 +- docs/help/ru/integrations.md | 24 +- docs/help/ru/settings.md | 2 +- docs/help/tr/integrations.md | 24 +- docs/help/tr/settings.md | 2 +- docs/help/zh-Hans/integrations.md | 24 +- docs/help/zh-Hans/settings.md | 2 +- docs/screenshots/README.md | 10 +- docs/screenshots/integration-plugins-dark.png | Bin 0 -> 10215 bytes .../screenshots/integration-plugins-light.png | Bin 0 -> 10200 bytes .../integration-status-catalog.png | Bin 40482 -> 0 bytes .../integration-status-customization.png | Bin 44409 -> 0 bytes docs/screenshots/integration-status-dark.png | Bin 48788 -> 0 bytes docs/screenshots/integration-status-light.png | Bin 20239 -> 0 bytes packages/server/src/integration-types.ts | 7 +- .../src/opencode/integrations/integrations.ts | 1 + .../src/server/routes/integrations.test.ts | 27 +- .../instance/shell/right-panel/RightPanel.tsx | 9 +- .../right-panel/integration-sections.test.ts | 21 - .../shell/right-panel/integration-sections.ts | 20 - .../right-panel/integration-status-module.tsx | 164 ---- .../src/components/integration-attachment.tsx | 229 ------ .../components/integration-catalog-window.tsx | 2 +- .../components/integration-confirmation.ts | 4 +- .../src/components/integration-row-binding.ts | 138 ++++ .../components/integration-row-indicators.tsx | 71 ++ .../integration-section-state.test.ts | 146 ---- .../components/integration-section-state.ts | 118 --- .../ui/src/components/integration-section.tsx | 221 ------ .../components/plugin-activation-controls.tsx | 109 ++- .../components/plugin-activation-switch.tsx | 14 +- .../ui/src/components/plugin-row-actions.tsx | 89 ++- .../components/settings/settings-switch.tsx | 11 +- .../src/lib/i18n/messages/de/integrations.ts | 95 +-- .../ui/src/lib/i18n/messages/de/settings.ts | 2 + .../src/lib/i18n/messages/en/integrations.ts | 95 +-- .../ui/src/lib/i18n/messages/en/settings.ts | 2 + .../src/lib/i18n/messages/es/integrations.ts | 95 +-- .../ui/src/lib/i18n/messages/es/settings.ts | 2 + .../src/lib/i18n/messages/fr/integrations.ts | 95 +-- .../ui/src/lib/i18n/messages/fr/settings.ts | 2 + .../src/lib/i18n/messages/he/integrations.ts | 95 +-- .../ui/src/lib/i18n/messages/he/settings.ts | 2 + .../src/lib/i18n/messages/ja/integrations.ts | 95 +-- .../ui/src/lib/i18n/messages/ja/settings.ts | 2 + .../src/lib/i18n/messages/ne/integrations.ts | 95 +-- .../ui/src/lib/i18n/messages/ne/settings.ts | 2 + .../src/lib/i18n/messages/ru/integrations.ts | 95 +-- .../ui/src/lib/i18n/messages/ru/settings.ts | 2 + .../src/lib/i18n/messages/tr/integrations.ts | 95 +-- .../ui/src/lib/i18n/messages/tr/settings.ts | 2 + .../lib/i18n/messages/zh-Hans/integrations.ts | 95 +-- .../src/lib/i18n/messages/zh-Hans/settings.ts | 2 + .../ui/src/lib/integration-row-state.test.ts | 84 ++ packages/ui/src/lib/integration-row-state.ts | 72 ++ packages/ui/src/lib/integration-rows.test.ts | 22 +- packages/ui/src/lib/integration-rows.ts | 12 + .../stores/integration-bindings-store.test.ts | 21 + .../src/stores/integration-bindings-store.ts | 6 + packages/ui/src/styles/components/badges.css | 14 +- .../ui/src/styles/components/info-popover.css | 14 + .../components/integration-attachment.css | 22 - .../components/plugin-integration-row.css | 49 ++ .../components/plugin-package-action.css | 3 +- packages/ui/src/styles/controls.css | 3 +- packages/ui/src/styles/panels.css | 1 - .../src/styles/panels/integration-section.css | 119 --- .../fixtures/integration-attachment.tsx | 73 -- ...section.tsx => integration-plugin-row.tsx} | 23 +- .../integration-attachment-actions.test.ts | 457 ----------- .../browser/integration-attachment-harness.ts | 390 --------- .../integration-attachment-install.test.ts | 379 --------- .../browser/integration-attachment.test.ts | 539 ------------- ...del.ts => integration-plugin-row-model.ts} | 12 +- .../browser/integration-plugin-row.test.ts | 744 +++++++++++++++++ .../integration-status-section.test.ts | 745 ------------------ .../test-integrations-recognition-native.mjs | 4 +- 95 files changed, 1868 insertions(+), 4733 deletions(-) create mode 100644 docs/screenshots/integration-plugins-dark.png create mode 100644 docs/screenshots/integration-plugins-light.png delete mode 100644 docs/screenshots/integration-status-catalog.png delete mode 100644 docs/screenshots/integration-status-customization.png delete mode 100644 docs/screenshots/integration-status-dark.png delete mode 100644 docs/screenshots/integration-status-light.png delete mode 100644 packages/ui/src/components/instance/shell/right-panel/integration-sections.test.ts delete mode 100644 packages/ui/src/components/instance/shell/right-panel/integration-sections.ts delete mode 100644 packages/ui/src/components/instance/shell/right-panel/integration-status-module.tsx delete mode 100644 packages/ui/src/components/integration-attachment.tsx create mode 100644 packages/ui/src/components/integration-row-binding.ts create mode 100644 packages/ui/src/components/integration-row-indicators.tsx delete mode 100644 packages/ui/src/components/integration-section-state.test.ts delete mode 100644 packages/ui/src/components/integration-section-state.ts delete mode 100644 packages/ui/src/components/integration-section.tsx create mode 100644 packages/ui/src/lib/integration-row-state.test.ts create mode 100644 packages/ui/src/lib/integration-row-state.ts create mode 100644 packages/ui/src/styles/components/info-popover.css delete mode 100644 packages/ui/src/styles/components/integration-attachment.css create mode 100644 packages/ui/src/styles/components/plugin-integration-row.css delete mode 100644 packages/ui/src/styles/panels/integration-section.css delete mode 100644 packages/ui/tests/browser/fixtures/integration-attachment.tsx rename packages/ui/tests/browser/fixtures/{integration-status-section.tsx => integration-plugin-row.tsx} (86%) delete mode 100644 packages/ui/tests/browser/integration-attachment-actions.test.ts delete mode 100644 packages/ui/tests/browser/integration-attachment-harness.ts delete mode 100644 packages/ui/tests/browser/integration-attachment-install.test.ts delete mode 100644 packages/ui/tests/browser/integration-attachment.test.ts rename packages/ui/tests/browser/{integration-status-model.ts => integration-plugin-row-model.ts} (90%) create mode 100644 packages/ui/tests/browser/integration-plugin-row.test.ts delete mode 100644 packages/ui/tests/browser/integration-status-section.test.ts diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 60bc75e5e3..74f28f907d 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -602,8 +602,7 @@ jobs: packages/ui/src/lib/settings/behavior-registry.test.ts packages/ui/src/components/instance/shell/right-panel/core-plugin.test.ts packages/ui/src/components/instance/shell/right-panel/registry.test.ts - packages/ui/src/components/instance/shell/right-panel/integration-sections.test.ts - packages/ui/src/components/integration-section-state.test.ts + packages/ui/src/lib/integration-row-state.test.ts packages/ui/src/lib/i18n/messages/integrations-locales.test.ts packages/ui/src/stores/message-v2/empty-content.test.ts packages/ui/src/stores/permission-lifecycle.test.ts diff --git a/dev-docs/CACHE_REFRESH_CONVENTIONS.md b/dev-docs/CACHE_REFRESH_CONVENTIONS.md index 0e3f0c5bfa..9d2e82689d 100644 --- a/dev-docs/CACHE_REFRESH_CONVENTIONS.md +++ b/dev-docs/CACHE_REFRESH_CONVENTIONS.md @@ -40,7 +40,7 @@ content before promoting it, and retain the last good display on expiry. | Providers/models | Retained signals; shared in-flight catalogue load; dirty-bit trailing refresh; instance, location and request-generation checks. `fetchProviders` itself reuses only in-flight loads. | `packages/ui/src/stores/session-api.ts` | | Provider Usage | Panel-local snapshot; same-location `provider.updated` revalidates in place with one in-flight read and coalesced trailing demand. Window-label keys preserve quota DOM across responses. Duplicate transport statuses and instance/status/native-generation snapshots are no-ops. A changed native generation still fences quotas even if the disconnect was missed. Credential/integration/config events, native `server.connected`, real connection transitions and source changes clear the snapshot immediately and fence old responses/trailing demand. Failures revoke quotas, since the account may have changed. Only a visible panel reads, and quotas stay panel-local. | `components/session/provider-usage-panel.tsx`, `provider-usage-state.ts` | | Session goal | Per instance/session snapshot of the shown session's `/goal`. The goal line's demand (Status shown) reads through the secondary budget: one read plus one trailing follow-up. `rpc.opencode.goal.changed` publishes at once and fences replies requested before it (per-session version); an unreadable change reads again. Plugin activation (`plugin.updated`) and reconnects (`server.connected`, connected status, stream open) coalesce reads of demanded sessions; the line's commands read their outcome. A failed read keeps the last goal; deletion and workspace stop drop it. | `stores/session-goal-store.ts`, `session-goal.ts` | -| Integration binding | Demand-only authority for the shown instance/Location/session/integration, shared across Status sections and their picker through the secondary budget. Invalidations immediately publish `unknown` and fence older replies; events coalesce over 300 ms with one trailing follow-up. Reconnect/open reconcile demand, disconnect revokes authority, and read failures publish `unknown`. Last-demand release aborts and drops state. Every admitted attachment mutation invalidates and rereads its captured target in `finally` while demanded. | `stores/integration-bindings-store.ts`, `integrations.ts` | +| Integration binding | Demand-only authority for the shown instance/Location/session/integration, shared by the Plugins rows that show it through the secondary budget. Invalidations immediately publish `unknown` and fence older replies; events coalesce over 300 ms with one trailing follow-up. Reconnect/open reconcile demand, disconnect revokes authority, and read failures publish `unknown`. Last-demand release aborts and drops state. Every admitted attach or detach invalidates and rereads its captured target in `finally` while demanded. | `stores/integration-bindings-store.ts`, `integrations.ts` | | Stats | Backend-owned `state.ui.serviceUsage`; rules in [SETTINGS.md](SETTINGS.md), restoration below. Reads follow explicit demand, terminal hints (shared five-second activity cooldown), reconnect and visibility; never poll. Hiding/disposal fences in-flight publication. | server `opencode/service-usage-cache.ts`, `service-usage.ts`; UI `settings/usage-settings-section.tsx` | | Session model selection | Native selection events invalidate the displayed selection and never overwrite it, because SSE echoes can lag successful HTTP writes. Coalesced authoritative reads share the session admission queue with prompts and explicit selections; client/generation and captured-selection checks fence late responses. Catalog merges preserve pending optimistic choices; successful writes publish a fresh model object so pre-confirmation snapshots lose authority. Read failures retain display state until the next event or reconnect refresh. | `stores/session-model-reconciliation.ts`, `stores/session-action-queue.ts`, `stores/session-generation-recovery.ts` | | OpenCode setup | Shared in-flight status read plus coalesced trailing refresh for focus/visibility/reconnect demand. Executable changes and explicit actions fence old responses. Failed reads retain version/path diagnostics but revoke the connected claim and stale reload/restart controls; Continue checks again before retrying the pending workspace. Activation requires a successful pre-action status read. | UI `stores/opencode-setup.ts`, `components/settings/opencode-setup-panel.tsx` | diff --git a/dev-docs/OPENCODE_INTEGRATIONS.md b/dev-docs/OPENCODE_INTEGRATIONS.md index 2bb7b9f16e..a81800910f 100644 --- a/dev-docs/OPENCODE_INTEGRATIONS.md +++ b/dev-docs/OPENCODE_INTEGRATIONS.md @@ -95,7 +95,7 @@ it keeps its recognition ways, but neither those shared or foreign sources nor a (no `plugin` fact, `configuredSources` or version from them), and no RPC is called. `GET /api/workspaces/:id/integrations?directory=[&workspaceID=]` (`server/routes/integrations.ts`, -`IntegrationsReader`) answers every catalog entry for an owned Location, without the catalog's plugin ID, `rpc`, +`IntegrationsReader`) answers every catalog entry for an owned Location, without the catalog's `rpc`, `sources` and `package`. `docs` is present only when `isIntegrationDocsUrl` (`opencode/integrations/docs-url.ts`) accepts it: the raw canonical `https://github.com/NeuralNomadsAI/opencode-integrations/tree/main/integrations/` or `…/blob/main/integrations//plugin/README.md` of the same ID. Each entry carries the installation facts @@ -201,9 +201,8 @@ After an `attached` outcome, the session's `metadata["codenomad.integrationAttac `{ integration, label, attachedAt }`: catalog ID, offer's `label` for reattach matching and Unix milliseconds. The server reads the session afresh immediately before native `session.update`, whose whole metadata object replaces the stored object, retaining all unrelated keys from that read. Attach and detach serialize per session -within the backend. Both `detached` and `none` remove the hint. Q8 is a display hint for a confirmed reattach to a -matching integration and label; the plugin's live bindings retain authority. Concurrent writers in other clients -share native whole-object replacement semantics. +within the backend. Both `detached` and `none` remove the hint. The plugin's live bindings retain authority. Concurrent writers in other +clients share native whole-object replacement semantics. ### Confirmed source removal @@ -242,8 +241,8 @@ detected through `WSL_DISTRO_NAME` or the Microsoft kernel marker. Failure to es fails closed. A mirrored compatible application offer must never bypass this check. Installation is Location-scoped and works independently of sessions and offers. The installer acts on the OpenCode -machine, including a remote machine. Its outcome describes that request; application status and a separate explicit -attachment action establish application availability and conversation access. Never retry or replay an installation +machine, including a remote machine. Its outcome describes that request; application status establishes application availability, and the integration +attaches a conversation at its first use or through the row's chain button. Never retry or replay an installation request after an uncertain result: check the application, then require a fresh action and confirmation if needed. ## UI read model @@ -259,55 +258,63 @@ own. `stores/integrations.ts` owns the production singleton and forwards `instan and workspace-stop notifications. The event relay projects only the two payload-free integration notifications, retaining the native Location for ownership routing and dropping plugin-authored envelope fields. -`right-panel/integration-status-module.tsx` registers a native Status section per unambiguous integration with -`plugin.declared` or `plugin.runtime` facts. Stable `integration:` IDs follow catalog order after Plugins, with -persisted hiding/order and keyboard Up/Down customization. Retained activation rules alone leave the entry in the -installation catalog. `createIntegrationContext` shares the active Location with Plugins and supplies a conversation -only when its Location matches. Sections retain their objects across display refreshes. - -`integration-section-state.ts` derives section and Conversation labels from installation, activation, host and -authoritative binding facts. Headers keep the state visible, with Documentation beside the information Popover; -the body contains Plugin (version, switches and row actions), Application/Conversation for native integrations, -or Connection for the other families. Expected-action changes or an attached conversation expand the section once; -user collapse persists until the expected-action key changes. Each Status tab owns one grouped polite live region. - -The section's Conversation line opens the trusted application picker. It initially focuses Cancel, names its captured -target conversation and the daemon machine, and enables explicit confirmation after 600 ms. Navigation discards the -captured target; reconnect and relevant native invalidations discard offers. Admitted action receipts remain readable -for their unchanged target across native echoes. WSL-unsupported status shows help in the information Popover. -Saved Q8 hints offer confirmed reattachment only for matching integration and label. Action receipts describe the -completed request. **Detach** sends one request directly from the section for the authoritative current binding. - -Plugins retains its ordinary rows with update/remove/refresh actions. Its Add menu opens **Add an integration…**: -the reviewed catalog's installable entries, family label, summary Popover, Documentation, scope and Install. Native -integrations lock scope to Global. Catalog availability and the last valid fetch date appear here. Installation uses -the shared guarded confirmation and `pluginSourcesStore.installIntegration`, preserving its pending/reconciliation -semantics. Activation and plugin package updates use ordinary native mutations without confirmation. -Cancelling attachment or application installation restores the captured visible, enabled opener while its -owning view, conversation and integration context remain current. Navigation, invalidation and view disposal revoke restoration. +Integrations are managed only from their row in **Status → Plugins** (`components/plugin-activation-controls.tsx`). +A row whose plugin ID or declared target correlates with an unambiguous catalog entry is that integration's single +row. `integrationDisplayPlugin` uses the writable `integrationPlugin` correlations or the projected `plugin.runtimeId` +of one exact native inventory entry. Inherited, virtual and runtime-only declarations retain their integration +display and native actions; source mutations keep their writable document/revision checks. + +- its `displayName` followed by its muted installed version (every row with a known package version shows it + right after the name, its buttons at the row's end); +- Global/Project switches in the accent colour of Yolo and the settings switches (`ACCENT_SWITCH_SX`, + `var(--accent-primary)`): `PluginActivationSwitch`'s `integration` flag replaces the green variant that plain + plugin and MCP rows keep. A native integration's Project switch is locked to Global; +- the name tooltip's first line reads **Integration: ** where a plain plugin's reads **Plugin: **; +- for a loaded native integration, a chain button (`IntegrationLinkButton`, `components/integration-row-indicators.tsx`) + for the displayed conversation, framed like the row's menu button: linked and pressed (`aria-pressed`, the shared + `.icon-toggle` active state) with **Attached to: