Merge origin/main into cloud/integration

Upstream landed EnvironmentProviderDriver (#40315, #40332). Kept upstream's interface (EnvironmentReady.result)
and added the hosted-only extensions as optional members (renewLease, rollover, leaseExpiresAt, egressInjection,
entitlement_denied, the entitlement/renew/rollover phases); ported the hosted driver, registry and recipe adapter
to result. #40313 moved agent-catalog: fixed the #40228/#40303 imports.
This commit is contained in:
Neil
2026-11-09 04:35:17 -08:00
576 changed files with 3326 additions and 2197 deletions
File diff suppressed because one or more lines are too long
@@ -6377,8 +6377,8 @@
"src/renderer/src/lib/activate-ai-vault-structured-session-host.test.ts": 589,
"src/renderer/src/lib/activate-ai-vault-structured-session-reveal.test.ts": 2099,
"src/renderer/src/lib/workspace/tabs/activate-tab-and-focus-pane.test.ts": 54,
"src/renderer/src/lib/active-agent-note-send-explicit-target.test.ts": 980,
"src/renderer/src/lib/active-agent-note-send-focused-session.test.ts": 536,
"src/renderer/src/lib/agent-session/messaging/terminal/active-agent-note-send-explicit-target.test.ts": 980,
"src/renderer/src/lib/agent-session/messaging/terminal/active-agent-note-send-focused-session.test.ts": 536,
"src/renderer/src/lib/activity-thread-display.test.ts": 134,
"src/renderer/src/lib/agent-account-restart-startup.test.ts": 1780,
"src/renderer/src/lib/agent-session/launch/background/agent-background-session-launch-host.test.ts": 1910,
@@ -6395,10 +6395,10 @@
"src/renderer/src/lib/agent-session/launch/pane/agent-launch-tab-main-written.test.ts": 2084,
"src/renderer/src/lib/agent-session/launch/pane/agent-launch-tab-publication.test.ts": 1855,
"src/renderer/src/lib/agent-session/launch/pane/agent-launch-through-host.test.ts": 1975,
"src/renderer/src/lib/agent-message-send.test.ts": 182,
"src/renderer/src/lib/agent-paste-draft-submit-retry.test.ts": 315,
"src/renderer/src/lib/agent-paste-draft.test.ts": 445,
"src/renderer/src/lib/agent-resume-launch-target.test.ts": 3911,
"src/renderer/src/lib/agent-session/messaging/agent-message-send.test.ts": 182,
"src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft-submit-retry.test.ts": 315,
"src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft.test.ts": 445,
"src/renderer/src/lib/agent-session/resume/agent-resume-launch-target.test.ts": 3911,
"src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-after-failure.test.ts": 870,
"src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-close-race.test.ts": 983,
"src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-create-message.test.ts": 2521,
@@ -6417,10 +6417,10 @@
"src/renderer/src/lib/agent-session/structured-agent-session-draft-position-lifetime.test.tsx": 3166,
"src/renderer/src/lib/agent-session/structured-agent-session-ordinary-draft.test.tsx": 9907,
"src/renderer/src/lib/agent-session/structured-agent-session-provisional-tab.test.ts": 3672,
"src/renderer/src/lib/agent-skill-cli-prerequisite.test.ts": 219,
"src/renderer/src/lib/agent-startup-delayed-delivery-perf.test.ts": 1708,
"src/renderer/src/lib/agent-status-evidence-clock.test.ts": 88,
"src/renderer/src/lib/agent-status.test.ts": 172,
"src/renderer/src/lib/skills/installation/agent-skill-cli-prerequisite.test.ts": 219,
"src/renderer/src/lib/agent-session/launch/startup/agent-startup-delayed-delivery-perf.test.ts": 1708,
"src/shared/agent-status/contracts/agent-status-evidence-clock.test.ts": 88,
"src/shared/agent-status/title/agent-title-tracker.test.ts": 172,
"src/renderer/src/lib/agent-session/resume/history/ai-vault-antigravity-reference-host.test.ts": 678,
"src/renderer/src/lib/agent-session/resume/history/ai-vault-resume-command.drop-repin.test.ts": 541,
"src/renderer/src/lib/agent-session/resume/history/ai-vault-resume-command.test.ts": 665,
+4 -4
View File
@@ -1,5 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="113" height="20" role="img" aria-label="downloads: 160m">
<title>downloads: 160m</title>
<svg xmlns="http://www.w3.org/2000/svg" width="113" height="20" role="img" aria-label="downloads: 161m">
<title>downloads: 161m</title>
<linearGradient id="s" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
<stop offset="1" stop-opacity=".1"/>
@@ -15,7 +15,7 @@
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="11">
<text x="37" y="15" fill="#010101" fill-opacity=".3">downloads</text>
<text x="37" y="14">downloads</text>
<text x="93.5" y="15" fill="#010101" fill-opacity=".3">160m</text>
<text x="93.5" y="14">160m</text>
<text x="93.5" y="15" fill="#010101" fill-opacity=".3">161m</text>
<text x="93.5" y="14">161m</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 943 B

After

Width:  |  Height:  |  Size: 943 B

@@ -118,6 +118,32 @@ describe('readTerminalCursorLineContext', () => {
}
})
it.each([
{ typed: '', caret: 'T', dim: 'ry "how do I log an error?"', draft: null, typedText: '' },
{ typed: '', caret: 'f', dim: 'ix the login bug', draft: 'fix the login bug', typedText: '' },
{ typed: '', caret: 'a', dim: ' quick fix', draft: 'a quick fix', typedText: '' },
{ typed: '/mo', caret: 'd', dim: 'el', draft: '/model', typedText: '/mo' },
{ typed: '/commi', caret: 't', dim: ' [message]', draft: '/commit', typedText: '/commit' }
])(
"reads Claude's caret glyph $caret after '$typed' before dim '$dim'",
({ typed, caret, dim, draft, typedText }) => {
const cols = 80
const terminal = new Terminal({ cols, rows: 8, allowProposedApi: true })
try {
writeSync(
terminal,
`\x1b[?25l${'─'.repeat(cols)}\r\n❯ ${typed}\x1b7\x1b[7m${caret}\x1b[27m\x1b[2m${dim}\x1b[22m\r\n${'─'.repeat(cols)}\x1b8`
)
const context = readTerminalCursorLineContext(terminal, terminal.rows)
expect(context).toMatchObject({ cursorHidden: true, cursorInverse: true })
expect(detectTerminalComposerDraft(context)?.text ?? null).toBe(draft)
expect(readTerminalComposerTypedText(context)).toBe(typedText)
} finally {
terminal.dispose()
}
}
)
it.each([
{ cols: 19, cursorRowTail: 'proceed with the ', continuation: 'release' },
{ cols: 18, cursorRowTail: 'proceed with the', continuation: ' release' }
@@ -1,5 +1,10 @@
// Shared lifecycle contract every EnvironmentProviderDriver must pass; drivers call it from their test.
import { describe, expect, it } from 'vitest'
import {
getEphemeralVmRecipeResultConnection,
getEphemeralVmRecipeResultProjectRoot,
isAbsoluteRuntimePath
} from '../../shared/ephemeral-vm-recipes'
import {
ENVIRONMENT_PROVIDER_ERROR_CODES,
isEnvironmentProviderError,
@@ -12,6 +17,13 @@ export type EnvironmentProviderDriverContractHarness = {
driver: EnvironmentProviderDriver
/** Ids the backing provider still holds; destroy must leave none behind. */
liveEnvironmentIds: () => Promise<readonly string[]>
/** A fresh driver over the same backing provider, as after an Orca restart. */
reopenDriver: () => EnvironmentProviderDriver
}
// Handles are persisted with the runtime record, so later calls only ever see the JSON form.
function reload<T>(handle: T): T {
return JSON.parse(JSON.stringify(handle))
}
export function runEnvironmentProviderDriverContract(
@@ -23,9 +35,10 @@ export function runEnvironmentProviderDriverContract(
function expectReady(driver: EnvironmentProviderDriver, ready: EnvironmentReady): void {
expect(ready.handle.driverId).toBe(driver.id)
expect(ready.handle.environmentId).not.toBe('')
expect(ready.connection.type).toBe('orca-server')
expect(ready.connection.pairingCode).not.toBe('')
expect(ready.connection.projectRoot.startsWith('/')).toBe(true)
expect(['orca-server', 'ssh']).toContain(
getEphemeralVmRecipeResultConnection(ready.result).type
)
expect(isAbsoluteRuntimePath(getEphemeralVmRecipeResultProjectRoot(ready.result))).toBe(true)
if (driver.capabilities.maxSessionMs !== null) {
expect(ready.session.deadlineAt).not.toBeNull()
expect(ready.session.deadlineAt! - ready.session.startedAt).toBeLessThanOrEqual(
@@ -35,13 +48,14 @@ export function runEnvironmentProviderDriverContract(
}
it('creates, suspends, resumes and destroys one environment without leaking it', async () => {
const { driver, liveEnvironmentIds } = await makeHarness()
const { driver, liveEnvironmentIds, reopenDriver } = await makeHarness()
const phases: string[] = []
const created = await driver.create(spec('ws-contract-1'), {
onProgress: ({ phase }) => phases.push(phase)
})
expectReady(driver, created)
expect(phases.length).toBeGreaterThan(0)
expect(await liveEnvironmentIds()).toContain(created.handle.environmentId)
expect((await driver.status(created.handle)).status).toBe('running')
const suspended = await driver.suspend(created.handle)
@@ -55,26 +69,26 @@ export function runEnvironmentProviderDriverContract(
await driver.destroy(created.handle)
expect(await liveEnvironmentIds()).not.toContain(created.handle.environmentId)
// Idempotent: cleanup retries after a lost response must not fail.
await driver.destroy(created.handle)
// Idempotent: cleanup retries after a lost response or a restart must not fail.
await reopenDriver().destroy(reload(created.handle))
})
it('refuses to resume a destroyed environment with a catalogued error', async () => {
const { driver } = await makeHarness()
it('refuses to bring back a destroyed environment, even after a restart', async () => {
const { driver, liveEnvironmentIds, reopenDriver } = await makeHarness()
const created = await driver.create(spec('ws-contract-2'))
await driver.destroy(created.handle)
const error = await driver.resume(created.handle).then(
() => null,
(caught: unknown) => caught
)
const error = await reopenDriver()
.resume(reload(created.handle))
.then(
() => null,
(caught: unknown) => caught
)
expect(isEnvironmentProviderError(error)).toBe(true)
expect(['not_found', 'conflict']).toContain(
isEnvironmentProviderError(error) ? error.code : null
)
expect(await liveEnvironmentIds()).not.toContain(created.handle.environmentId)
})
it('rejects a cancelled create with a catalogued error', async () => {
const { driver } = await makeHarness()
it('rejects a cancelled create with a catalogued error and leaks nothing', async () => {
const { driver, liveEnvironmentIds } = await makeHarness()
const controller = new AbortController()
controller.abort()
const error = await driver.create(spec('ws-contract-3'), { signal: controller.signal }).then(
@@ -85,25 +99,7 @@ export function runEnvironmentProviderDriverContract(
expect(ENVIRONMENT_PROVIDER_ERROR_CODES).toContain(
isEnvironmentProviderError(error) ? error.code : null
)
})
it('keeps a capped session alive and rolls it over onto the same disk', async () => {
const { driver } = await makeHarness()
if (driver.capabilities.maxSessionMs === null) {
return
}
expect(driver.renewLease).toBeTypeOf('function')
expect(driver.rollover).toBeTypeOf('function')
const created = await driver.create(spec('ws-contract-4'))
const renewed = await driver.renewLease!(created.handle, 10 * 60_000)
expect(renewed.status).toBe('running')
expect(renewed.session!.leaseExpiresAt!).toBeLessThanOrEqual(renewed.session!.deadlineAt!)
const rolled = await driver.rollover!(created.handle)
expectReady(driver, rolled)
expect(rolled.handle.environmentId).toBe(created.handle.environmentId)
expect(rolled.session.startedAt).toBeGreaterThan(created.session.startedAt)
await driver.destroy(created.handle)
expect(await liveEnvironmentIds()).toEqual([])
})
})
}
@@ -1,6 +1,6 @@
// One lifecycle seam for VM-backed workspaces: shell recipes, hosted Orca Cloud sandboxes and later
// plugin providers all answer the same calls, and capability flags (not provider ids) drive the UX.
import type { JsonValue } from '../../shared/ephemeral-vm-recipes'
// One lifecycle seam for VM-backed workspaces: every environment provider answers the same calls,
// and capability flags (not provider ids) decide what the UI offers.
import type { EphemeralVmRecipeResult, JsonValue } from '../../shared/ephemeral-vm-recipes'
export type EnvironmentProviderCapabilities = Readonly<{
/** Suspend keeps memory and processes; false means suspend/resume is a reboot from disk. */
@@ -9,10 +9,10 @@ export type EnvironmentProviderCapabilities = Readonly<{
maxSessionMs: number | null
/** The filesystem (worktree, auth homes, orcad identity) survives suspend. */
fsPersistOnStop: boolean
/** Secrets can be injected at the egress proxy instead of living in the VM. */
egressInjection: boolean
/** Orca-owned idle stop; null when the provider has none. */
idleStopMs: number | null
/** Secrets can be injected at the egress proxy instead of living in the VM. */
egressInjection?: boolean
}>
export type EnvironmentProviderPhase =
@@ -34,30 +34,26 @@ export type EnvironmentProviderCallContext = {
export type EnvironmentCreateSpec = {
/** Orca's workspace id; one environment per workspace. */
workspaceId: string
workspaceName?: string
projectId?: string
machineSize?: string
region?: string
repo?: { url: string; ref?: string }
}
/** Persisted in the runtime record; `driverState` is opaque to everything but the driver. */
/** Persisted with the runtime record; `driverState` is opaque to everything but the driver. */
export type EnvironmentHandle = {
driverId: string
environmentId: string
driverState: Record<string, JsonValue>
}
export type EnvironmentConnection = {
type: 'orca-server'
pairingCode: string
projectRoot: string
}
export type EnvironmentSessionInfo = {
startedAt: number
/** When the provider will end this session regardless of activity. */
deadlineAt: number | null
/** When the current Orca lease lapses unless renewed. */
leaseExpiresAt: number | null
/** Session-capped providers: when the current Orca lease lapses unless renewed. */
leaseExpiresAt?: number | null
}
export type EnvironmentStatus =
@@ -77,7 +73,8 @@ export type EnvironmentStatusSnapshot = {
export type EnvironmentReady = {
handle: EnvironmentHandle
connection: EnvironmentConnection
/** Same document a shell recipe prints, so runtime records, pairing and resume keep one path. */
result: EphemeralVmRecipeResult
session: EnvironmentSessionInfo
}
@@ -114,21 +111,21 @@ export type EnvironmentProviderDriver = {
export const ENVIRONMENT_PROVIDER_ERROR_CODES = [
'unauthorized',
'entitlement_denied',
'not_found',
'conflict',
'invalid_request',
'unavailable',
'timeout',
'aborted',
'invalid_response'
'invalid_response',
'entitlement_denied'
] as const
export type EnvironmentProviderErrorCode = (typeof ENVIRONMENT_PROVIDER_ERROR_CODES)[number]
export class EnvironmentProviderError extends Error {
readonly code: EnvironmentProviderErrorCode
/** Machine-readable detail, e.g. the billing deny reason for `entitlement_denied`. */
/** Machine-readable provider detail, e.g. the Orca failure-copy code behind the message. */
readonly reason: string | null
constructor(code: EnvironmentProviderErrorCode, message: string, reason: string | null = null) {
@@ -30,7 +30,7 @@ export function environmentReadyToRecipeResult(
driverState: ready.handle.driverState
}
}
const connection = { ...ready.connection }
const connection = getEphemeralVmRecipeResultConnection(ready.result)
return checkoutMode === 'provisioned-root'
? { schemaVersion: 2, checkoutMode: 'provisioned-root', connection, userData }
: { schemaVersion: 1, connection, userData }
@@ -0,0 +1,68 @@
import { mkdirSync, mkdtempSync, readdirSync, rmSync, writeFileSync } from 'node:fs'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { afterEach } from 'vitest'
import { encodePairingOffer } from '../../shared/remote-runtime/pairing/pairing'
import { PAIRING_OFFER_VERSION } from '../../shared/remote-runtime/pairing/mobile-relay-pairing-offer'
import type { OrcaVmRecipe } from '../../shared/orca-yaml-hook-types'
import { runEnvironmentProviderDriverContract } from './environment-provider-driver-contract.test-support'
import { ShellRecipeDriver } from './shell-recipe-driver'
const tmpRoots: string[] = []
afterEach(() => {
for (const root of tmpRoots.splice(0)) {
rmSync(root, { recursive: true, force: true })
}
})
// A recipe whose "VMs" are files in a state dir, so the contract can see what destroy left behind.
function makeFileBackedRecipe(): { repoPath: string; stateDir: string; recipe: OrcaVmRecipe } {
const repoPath = mkdtempSync(join(tmpdir(), 'orca-shell-recipe-driver-'))
tmpRoots.push(repoPath)
const stateDir = join(repoPath, 'vms')
mkdirSync(stateDir)
const pairingCode = encodePairingOffer({
v: PAIRING_OFFER_VERSION,
endpoint: 'wss://vm.example.com',
deviceToken: 'token',
publicKeyB64: 'public-key'
})
const vmFile = `require('node:path').join(${JSON.stringify(stateDir)}, process.env.ORCA_VM_INSTANCE_ID)`
const printResult = `console.log(JSON.stringify({ schemaVersion: 1, pairingCode: ${JSON.stringify(pairingCode)}, projectRoot: '/workspace/repo' }))`
const scripts = {
create: `require('node:fs').writeFileSync(${vmFile}, 'running'); ${printResult}`,
suspend: `require('node:fs').writeFileSync(${vmFile}, 'suspended')`,
// Like a real provider: a destroyed VM cannot be woken.
resume: `const fs = require('node:fs'); if (!fs.existsSync(${vmFile})) process.exit(1); fs.writeFileSync(${vmFile}, 'running'); ${printResult}`,
destroy: `require('node:fs').rmSync(${vmFile}, { force: true })`
}
const commands = Object.fromEntries(
Object.entries(scripts).map(([mode, source]) => {
const scriptPath = join(repoPath, `${mode}.js`)
writeFileSync(scriptPath, source)
return [mode, `"${process.execPath}" "${scriptPath}"`]
})
)
return {
repoPath,
stateDir,
recipe: {
id: 'file-backed',
name: 'File-backed VM',
create: commands.create,
suspend: commands.suspend,
resume: commands.resume,
destroy: commands.destroy
}
}
}
runEnvironmentProviderDriverContract('ShellRecipeDriver', async () => {
const { repoPath, stateDir, recipe } = makeFileBackedRecipe()
return {
driver: new ShellRecipeDriver(recipe, repoPath),
liveEnvironmentIds: async () => readdirSync(stateDir),
reopenDriver: () => new ShellRecipeDriver(recipe, repoPath)
}
})
@@ -0,0 +1,286 @@
// orca.yaml environment recipes and plugin VM recipes as an environment provider: each lifecycle
// call runs the recipe's shell step, exactly as the runtime service did before the driver seam.
import { z } from 'zod'
import type { OrcaVmRecipe } from '../../shared/orca-yaml-hook-types'
import {
EphemeralVmRecipeResultSchema,
type EphemeralVmRecipeResult,
type JsonValue
} from '../../shared/ephemeral-vm-recipes'
import {
runEphemeralVmRecipeCleanup,
runEphemeralVmRecipeResume,
runEphemeralVmRecipeStart,
runEphemeralVmRecipeSuspend,
type EphemeralVmRecipeCleanupArgs,
type EphemeralVmRecipeContext,
type EphemeralVmRecipeLifecycleArgs,
type EphemeralVmRecipeStartArgs
} from '../../shared/ephemeral-vm-recipe-runner'
import { EPHEMERAL_VM_FAILURE_COPY } from '../../shared/ephemeral-vm-failure-copy'
import { getProvisionedRootResumeIntegrityError } from '../ephemeral-vm/resume-integrity'
import {
EnvironmentProviderError,
isEnvironmentProviderError,
type EnvironmentCreateSpec,
type EnvironmentHandle,
type EnvironmentProviderCallContext,
type EnvironmentProviderCapabilities,
type EnvironmentProviderDriver,
type EnvironmentReady,
type EnvironmentStatus,
type EnvironmentStatusSnapshot
} from './environment-provider-driver'
export const SHELL_RECIPE_DRIVER_ID = 'shell-recipe'
type RecipeStepArgs<T> = Omit<T, 'recipe' | 'repoPath'>
type RecipeStepFailure = {
error?: string
errorCode?: string
exitCode: number | null
aborted?: true
timedOut?: true
}
const DriverStateSchema = z.object({
recipeResult: EphemeralVmRecipeResultSchema,
projectId: z.string().optional(),
workspaceId: z.string().optional(),
workspaceName: z.string().optional()
})
export class ShellRecipeDriver implements EnvironmentProviderDriver {
readonly id = SHELL_RECIPE_DRIVER_ID
readonly capabilities: EnvironmentProviderCapabilities
// Recipes have no status step, so status only covers calls this instance ran; the runtime
// record stays the persisted source of truth.
private readonly statuses = new Map<string, EnvironmentStatus>()
constructor(
private readonly recipe: OrcaVmRecipe,
private readonly repoPath: string
) {
this.capabilities = {
memoryPause: false,
maxSessionMs: null,
fsPersistOnStop: Boolean(recipe.suspend && recipe.resume),
idleStopMs: null
}
}
// Recipe-shaped steps keep stdout/stderr and failure copy for runtime records and diagnostics.
runCreate(args: RecipeStepArgs<EphemeralVmRecipeStartArgs>) {
return runEphemeralVmRecipeStart({ ...args, recipe: this.recipe, repoPath: this.repoPath })
}
runSuspend(args: RecipeStepArgs<EphemeralVmRecipeLifecycleArgs>) {
return runEphemeralVmRecipeSuspend({ ...args, recipe: this.recipe, repoPath: this.repoPath })
}
runResume(args: RecipeStepArgs<EphemeralVmRecipeLifecycleArgs>) {
return runEphemeralVmRecipeResume({ ...args, recipe: this.recipe, repoPath: this.repoPath })
}
runDestroy(args: RecipeStepArgs<EphemeralVmRecipeCleanupArgs>) {
return runEphemeralVmRecipeCleanup({ ...args, recipe: this.recipe, repoPath: this.repoPath })
}
create(spec: EnvironmentCreateSpec, ctx: EnvironmentProviderCallContext = {}) {
return catalogued(() => this.createOnce(spec, ctx))
}
suspend(handle: EnvironmentHandle, ctx: EnvironmentProviderCallContext = {}) {
return catalogued(() => this.suspendOnce(handle, ctx))
}
resume(handle: EnvironmentHandle, ctx: EnvironmentProviderCallContext = {}) {
return catalogued(() => this.resumeOnce(handle, ctx))
}
destroy(handle: EnvironmentHandle, ctx: EnvironmentProviderCallContext = {}) {
return catalogued(() => this.destroyOnce(handle, ctx))
}
private async createOnce(
spec: EnvironmentCreateSpec,
ctx: EnvironmentProviderCallContext
): Promise<EnvironmentReady> {
ctx.onProgress?.({ phase: 'provisioning' })
const start = await this.runCreate({
context: {
projectId: spec.projectId,
workspaceId: spec.workspaceId,
workspaceName: spec.workspaceName,
repoUrl: spec.repo?.url,
ref: spec.repo?.ref
},
signal: ctx.signal
})
if (!start.ok) {
const error = toProviderError(start)
if (start.recipeResult) {
// The VM exists even though Orca rejected its result; release it rather than leak it.
const cleanup = await this.runDestroy({
context: start.context,
recipeResult: start.recipeResult
})
if (!cleanup.ok || cleanup.skipped) {
const detail = cleanup.error ?? EPHEMERAL_VM_FAILURE_COPY.destroyDisabled
throw new EnvironmentProviderError(error.code, `${error.message} ${detail}`, error.reason)
}
}
throw error
}
const handle = toHandle(start.context, start.result)
this.statuses.set(handle.environmentId, 'running')
return toReady(handle, start.result)
}
private async suspendOnce(
handle: EnvironmentHandle,
ctx: EnvironmentProviderCallContext
): Promise<EnvironmentStatusSnapshot> {
const { context, recipeResult } = this.readHandle(handle)
ctx.onProgress?.({ phase: 'suspending' })
const suspend = await this.runSuspend({ context, recipeResult, signal: ctx.signal })
if (!suspend.ok) {
throw toProviderError(suspend)
}
// No suspend step: the VM keeps running.
const status = suspend.skipped ? 'running' : 'suspended'
this.statuses.set(handle.environmentId, status)
return { status, session: null }
}
private async resumeOnce(
handle: EnvironmentHandle,
ctx: EnvironmentProviderCallContext
): Promise<EnvironmentReady> {
const { context, recipeResult } = this.readHandle(handle)
ctx.onProgress?.({ phase: 'resuming' })
const resume = await this.runResume({ context, recipeResult, signal: ctx.signal })
if (!resume.ok) {
throw toProviderError(resume)
}
const result = resume.skipped ? recipeResult : resume.result
const integrityError = getProvisionedRootResumeIntegrityError(recipeResult, result)
if (integrityError) {
throw new EnvironmentProviderError('conflict', integrityError)
}
this.statuses.set(handle.environmentId, 'running')
return toReady(toHandle(context, result), result)
}
private async destroyOnce(
handle: EnvironmentHandle,
ctx: EnvironmentProviderCallContext
): Promise<void> {
if (this.statuses.get(handle.environmentId) === 'destroyed') {
return
}
const { context, recipeResult } = this.readHandle(handle)
ctx.onProgress?.({ phase: 'destroying' })
const cleanup = await this.runDestroy({ context, recipeResult, signal: ctx.signal })
if (!cleanup.ok) {
throw toProviderError(cleanup)
}
if (cleanup.skipped) {
throw new EnvironmentProviderError(
'invalid_request',
EPHEMERAL_VM_FAILURE_COPY.destroyDisabled,
'destroyDisabled'
)
}
this.statuses.set(handle.environmentId, 'destroyed')
}
async status(handle: EnvironmentHandle): Promise<EnvironmentStatusSnapshot> {
const status = this.statuses.get(handle.environmentId)
if (!status) {
throw new EnvironmentProviderError('not_found', 'This driver has not run that environment.')
}
return { status, session: null }
}
private readHandle(handle: EnvironmentHandle): {
context: EphemeralVmRecipeContext
recipeResult: EphemeralVmRecipeResult
} {
if (handle.driverId !== this.id) {
throw new EnvironmentProviderError('invalid_request', 'Handle belongs to another driver.')
}
if (this.statuses.get(handle.environmentId) === 'destroyed') {
throw new EnvironmentProviderError('not_found', 'Environment was destroyed.')
}
const state = DriverStateSchema.safeParse(handle.driverState)
if (!state.success) {
throw new EnvironmentProviderError('invalid_request', 'Handle has no recipe result.')
}
const { recipeResult, ...fields } = state.data
return {
context: {
...fields,
instanceId: handle.environmentId,
recipeId: this.recipe.id,
repoPath: this.repoPath
},
recipeResult
}
}
}
function toHandle(
context: EphemeralVmRecipeContext,
recipeResult: EphemeralVmRecipeResult
): EnvironmentHandle {
const { instanceId, projectId, workspaceId, workspaceName } = context
if (!instanceId) {
throw new EnvironmentProviderError('invalid_response', 'Recipe run has no instance id.')
}
// Round-trip through JSON so the persisted state is plain data (drops undefined fields).
const driverState: Record<string, JsonValue> = JSON.parse(
JSON.stringify({ recipeResult, projectId, workspaceId, workspaceName })
)
return {
driverId: SHELL_RECIPE_DRIVER_ID,
environmentId: instanceId,
driverState
}
}
function toReady(handle: EnvironmentHandle, result: EphemeralVmRecipeResult): EnvironmentReady {
return { handle, result, session: { startedAt: Date.now(), deadlineAt: null } }
}
// Spawn errors and a missing repo dir surface as plain errors; the contract promises catalogued ones.
async function catalogued<T>(run: () => Promise<T>): Promise<T> {
try {
return await run()
} catch (error) {
if (isEnvironmentProviderError(error)) {
throw error
}
throw new EnvironmentProviderError(
'unavailable',
error instanceof Error ? error.message : String(error)
)
}
}
function toProviderError(failure: RecipeStepFailure): EnvironmentProviderError {
const code = failure.aborted
? 'aborted'
: failure.timedOut
? 'timeout'
: // The step exited cleanly but Orca rejected what it printed.
failure.exitCode === 0
? 'invalid_response'
: 'unavailable'
return new EnvironmentProviderError(
code,
failure.error ?? 'Recipe step failed.',
failure.errorCode ?? null
)
}
@@ -16,10 +16,8 @@ import {
type EphemeralVmFailure
} from '../../shared/ephemeral-vm-failure-copy'
import type { ProvisionEphemeralVmRuntimeArgs } from './runtime-service'
import {
runEphemeralVmRecipeCleanup,
type EphemeralVmRecipeContext
} from '../../shared/ephemeral-vm-recipe-runner'
import type { EphemeralVmRecipeContext } from '../../shared/ephemeral-vm-recipe-runner'
import { ShellRecipeDriver } from '../environment-providers/shell-recipe-driver'
type FailedStart = {
context: EphemeralVmRecipeContext
@@ -74,9 +72,7 @@ async function getCleanupError(
start: FailedStart
): Promise<EphemeralVmFailure | null> {
try {
const cleanup = await runEphemeralVmRecipeCleanup({
repoPath: args.repoPath,
recipe: args.recipe,
const cleanup = await new ShellRecipeDriver(args.recipe, args.repoPath).runDestroy({
context: start.context,
recipeResult: start.recipeResult,
signal: args.signal,
+9 -20
View File
@@ -4,15 +4,12 @@ import {
updateEphemeralVmRuntimeStatus
} from '../../shared/ephemeral-vm-runtime-store'
import type { EphemeralVmRuntimeRecord } from '../../shared/ephemeral-vm-runtimes'
import {
runEphemeralVmRecipeCleanup,
runEphemeralVmRecipeResume,
runEphemeralVmRecipeSuspend,
runEphemeralVmRecipeStart,
type EphemeralVmRecipeContext,
type EphemeralVmRecipeStartFailure,
type EphemeralVmRecipeStartSuccess
import type {
EphemeralVmRecipeContext,
EphemeralVmRecipeStartFailure,
EphemeralVmRecipeStartSuccess
} from '../../shared/ephemeral-vm-recipe-runner'
import { ShellRecipeDriver } from '../environment-providers/shell-recipe-driver'
import {
beginEphemeralVmProvisioning,
endEphemeralVmProvisioning,
@@ -109,9 +106,7 @@ export async function provisionEphemeralVmRuntime(
): Promise<ProvisionEphemeralVmRuntimeResult> {
const writeAhead = beginEphemeralVmProvisioning(args)
try {
const start = await runEphemeralVmRecipeStart({
repoPath: args.repoPath,
recipe: args.recipe,
const start = await new ShellRecipeDriver(args.recipe, args.repoPath).runCreate({
context: {
projectId: args.projectId,
workspaceId: args.workspaceId,
@@ -183,9 +178,7 @@ async function cleanupEphemeralVmRuntimeOnce(
cleanupLastError: null,
updatedAt: now
})
const cleanup = await runEphemeralVmRecipeCleanup({
repoPath: args.repoPath,
recipe: args.recipe,
const cleanup = await new ShellRecipeDriver(args.recipe, args.repoPath).runDestroy({
context: contextFromRuntime(args.repoPath, running),
recipeResult: running.recipeResult,
signal: args.signal,
@@ -227,9 +220,7 @@ export async function suspendEphemeralVmRuntime(
if (!existing.recipeResult) {
throw new Error(`Ephemeral VM runtime never finished provisioning: ${args.runtimeId}`)
}
const suspend = await runEphemeralVmRecipeSuspend({
repoPath: args.repoPath,
recipe: args.recipe,
const suspend = await new ShellRecipeDriver(args.recipe, args.repoPath).runSuspend({
context: contextFromRuntime(args.repoPath, existing),
recipeResult: existing.recipeResult,
signal: args.signal,
@@ -264,9 +255,7 @@ export async function resumeEphemeralVmRuntime(
if (!existing.recipeResult) {
throw new Error(`Ephemeral VM runtime never finished provisioning: ${args.runtimeId}`)
}
const resume = await runEphemeralVmRecipeResume({
repoPath: args.repoPath,
recipe: args.recipe,
const resume = await new ShellRecipeDriver(args.recipe, args.repoPath).runResume({
context: contextFromRuntime(args.repoPath, existing),
recipeResult: existing.recipeResult,
signal: args.signal,
@@ -17,7 +17,7 @@ function setup(options: { token?: string; fetch?: typeof fetch } = {}) {
getAccessToken: async () => options.token ?? plane.token,
fetch: options.fetch ?? plane.fetch
})
return { plane, driver: createHostedSandboxDriver(client) }
return { plane, client, driver: createHostedSandboxDriver(client) }
}
async function rejection(promise: Promise<unknown>): Promise<unknown> {
@@ -28,9 +28,10 @@ async function rejection(promise: Promise<unknown>): Promise<unknown> {
}
runEnvironmentProviderDriverContract('HostedSandboxDriver', async () => {
const { plane, driver } = setup()
const { plane, client, driver } = setup()
return {
driver,
reopenDriver: () => createHostedSandboxDriver(client),
liveEnvironmentIds: async () =>
[...plane.sandboxes.values()].filter((s) => s.status !== 'destroyed').map((s) => s.id)
}
@@ -154,7 +154,7 @@ function toReady(ready: HostedSandboxReadyResponse): EnvironmentReady {
environmentId: ready.sandbox.id,
driverState: { sandboxId: ready.sandbox.id }
},
connection: ready.connection,
result: { schemaVersion: 1, connection: ready.connection },
session
}
}
@@ -67,10 +67,11 @@ export function decideHostedLeaseAction(input: {
return { kind: 'rollover', reason: 'opportunistic' }
}
}
const leaseExpiresAt = session.leaseExpiresAt ?? null
if (
session.leaseExpiresAt !== null &&
session.leaseExpiresAt - now <= HOSTED_LEASE_POLICY.renewWhenRemainingMs &&
(deadlineAt === null || session.leaseExpiresAt < deadlineAt)
leaseExpiresAt !== null &&
leaseExpiresAt - now <= HOSTED_LEASE_POLICY.renewWhenRemainingMs &&
(deadlineAt === null || leaseExpiresAt < deadlineAt)
) {
return { kind: 'renew', extendMs: HOSTED_LEASE_POLICY.renewByMs }
}
@@ -15,7 +15,11 @@ import { callRuntimeEnvironment } from '../ipc/runtime-environments/runtime-envi
import { invalidateRuntimeEnvironmentTransport } from '../ipc/runtime-environments/runtime-environments'
import { applyResumedRuntimePairing } from '../ephemeral-vm/runtime-resume-pairing'
import { noteRecipeVmWakePairing } from '../ephemeral-vm/recipe-vm-wake-pairings'
import type { EnvironmentProviderDriver } from '../environment-providers/environment-provider-driver'
import type {
EnvironmentProviderDriver,
EnvironmentReady
} from '../environment-providers/environment-provider-driver'
import { getEphemeralVmRecipeResultConnection } from '../../shared/ephemeral-vm-recipes'
import {
environmentHandleFromRecipeResult,
environmentReadyToRecipeResult
@@ -105,7 +109,7 @@ export function createHostedSessionRegistry(deps: {
const { environment } = await applyResumedRuntimePairing({
userDataPath: deps.userDataPath,
environmentId: runtimeEnvironmentId,
pairingCode: ready.connection.pairingCode,
pairingCode: hostedPairingCode(ready),
invalidateTransport: invalidateRuntimeEnvironmentTransport
})
noteRecipeVmWakePairing(
@@ -169,3 +173,11 @@ export function createHostedSessionRegistry(deps: {
}
}
}
function hostedPairingCode(ready: EnvironmentReady): string {
const connection = getEphemeralVmRecipeResultConnection(ready.result)
if (connection.type !== 'orca-server') {
throw new Error('Orca Cloud returned a connection that is not an Orca server.')
}
return connection.pairingCode
}
@@ -1,7 +1,7 @@
// Compare window startup from disk with the Loader round trip. Enumerate each divergence as a known defect or accepted difference with its reason.
import { describe, expect, it, vi } from 'vitest'
import type * as AgentStatusModule from '@/lib/agent-status'
import type * as AgentStatusModule from '@/lib/agent-status/aggregation/worktree-agent-status'
import type { ExecutionHostId } from '../../../shared/execution-host'
import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types'
import { LEGACY_WORKSPACE_LAYOUT_PROFILES } from '../../../shared/workspace-layout/workspace-layout-legacy-profile.test-fixture'
@@ -24,7 +24,7 @@ vi.mock('../../../shared/layout-owner-switch', () => ({
}
}))
vi.mock('sonner', () => ({ toast: { info: vi.fn(), success: vi.fn(), error: vi.fn() } }))
vi.mock('@/lib/agent-status', async (importOriginal) => {
vi.mock('@/lib/agent-status/aggregation/worktree-agent-status', async (importOriginal) => {
const actual = await importOriginal<typeof AgentStatusModule>()
return { ...actual, detectAgentStatusFromTitle: vi.fn().mockReturnValue(null) }
})
@@ -2,7 +2,7 @@ import { Fragment, useLayoutEffect, useRef, useState } from 'react'
import { Folder, GitBranch } from 'lucide-react'
import { translate } from '@/i18n/i18n'
import { useTranslate, type Translate } from '@/i18n/use-translate'
import { AgentIcon } from '@/lib/agent-catalog'
import { AgentIcon } from '@/components/agent/icons/AgentIcon'
import { formatAgentTypeLabel } from '../../../shared/agent-status/presentation/agent-type-label'
import type { ClaudeAccountSwitchPromptSessions } from '@/lib/provider-accounts/claude-account-switch-sessions'
import {
@@ -1,5 +1,5 @@
import { useContext } from 'react'
import { AgentIcon } from '@/lib/agent-catalog'
import { AgentIcon } from '@/components/agent/icons/AgentIcon'
import { agentTypeToIconAgent } from '../../../shared/agent-status/presentation/agent-type-icon-agent'
import { formatAgentTypeLabel } from '../../../shared/agent-status/presentation/agent-type-label'
import { formatShortTimeAgo } from '@/lib/short-time-ago'
@@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next'
import { toast } from 'sonner'
import { useAppStore } from '@/store'
import { cn } from '@/lib/utils'
import { getAgentCatalog } from '@/lib/agent-catalog'
import { getAgentCatalog } from '@/lib/agent-catalog/agent-catalog'
import { getScreenSubmitModifierLabel } from '@/lib/screen-submit-shortcut'
import { resolveProjectCloneUrlPrefill } from '@/lib/project-clone-url-prefill'
import { useContextualTour } from '@/components/contextual-tours/use-contextual-tour'
@@ -1,5 +1,8 @@
import { isExplicitAgentStatusFresh } from '@/lib/pane-agent-evidence'
import { AGENT_STATUS_STALE_AFTER_MS } from '../../../../shared/agent-status/contracts/agent-status-freshness'
import {
isAgentStatusFresh,
AGENT_STATUS_STALE_AFTER_MS
} from '../../../../shared/agent-status/contracts/agent-status-freshness'
import type {
AgentStatusEntry,
AgentStatusState,
@@ -20,7 +23,7 @@ export function freshActivityLiveAgentState(
): ActivityLiveAgentState | null {
if (
!isActivityHookLiveAgentState(entry.state) ||
!isExplicitAgentStatusFresh(entry, now, AGENT_STATUS_STALE_AFTER_MS)
!isAgentStatusFresh(entry, now, AGENT_STATUS_STALE_AFTER_MS)
) {
return null
}
@@ -1,6 +1,6 @@
import React from 'react'
import { MessageSquareText, TerminalSquare } from 'lucide-react'
import { AgentTypeIcon } from '@/lib/agent-type-icon'
import { AgentTypeIcon } from '@/components/agent/icons/agent-type-icon'
import { cn } from '@/lib/utils'
import { useTranslate } from '@/i18n/use-translate'
import { EventRepoBadge, ThreadAgentStateIndicator } from './activity-thread-controls'
@@ -3,7 +3,7 @@ import { Cloud, Copy, FolderGit2, GitBranch, Laptop, LocateFixed, Server } from
import { toast } from 'sonner'
import { useAppStore } from '@/store'
import { RepoBadgeMark } from '@/components/repo/RepoBadgeLabel'
import { AgentTypeIcon } from '@/lib/agent-type-icon'
import { AgentTypeIcon } from '@/components/agent/icons/agent-type-icon'
import { formatAgentTypeLabel } from '../../../../shared/agent-status/presentation/agent-type-label'
import { getWorktreeGitIdentityDisplay } from '../../../../shared/worktree/git-identity-display'
import { jumpToWorktreeFromSidebar } from '@/lib/workspace/activation/worktree-jump-navigation'
@@ -1,7 +1,7 @@
import type { AgentDotState } from '@/components/AgentStateDot'
import { formatAgentTypeLabel } from '../../../../shared/agent-status/presentation/agent-type-label'
import { getAgentRowPrimaryText } from '../../../../shared/agent-status/presentation/agent-row-primary-text'
import { showsAgentToolPreview } from '@/lib/agent-row-tool-preview'
import { showsAgentToolPreview } from '@/lib/agent-status/presentation/agent-row-tool-preview'
import {
agentMainAgentVerdict,
agentVerdictDisplayMark
@@ -1,6 +1,6 @@
import React from 'react'
import { Bell, ExternalLink, X } from 'lucide-react'
import { AgentTypeIcon } from '@/lib/agent-type-icon'
import { AgentTypeIcon } from '@/components/agent/icons/agent-type-icon'
import { formatAgentTypeLabel } from '../../../../shared/agent-status/presentation/agent-type-label'
import { Button } from '@/components/ui/button'
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'
@@ -2,7 +2,7 @@ import { useState } from 'react'
import { migrationUnsupportedToAgentStatusEntry } from '../../../../shared/migration-unsupported-agent-entry'
import { useAppStore } from '@/store'
import { createAgentStatusEpochSelector } from '@/lib/agent-status-epoch-selector'
import { createAgentStatusEpochSelector } from '@/lib/agent-status/evidence/agent-status-epoch-selector'
import type { AppState } from '@/store/types'
import type { AgentStatusEntry } from '../../../../shared/agent-status/contracts/agent-status-types'
@@ -29,13 +29,13 @@ import {
SelectValue
} from '@/components/ui/select'
import { useTranslate } from '@/i18n/use-translate'
import { getAgentCatalog, getAgentLabel } from '@/lib/agent-catalog'
import { getAgentCatalog, getAgentLabel } from '@/lib/agent-catalog/agent-catalog'
import {
buildAgentSessionContinuationPrompt,
hasFullAgentSessionContext,
type AgentSessionContinuationContextMode,
type AgentSessionContinuationRequest
} from '@/lib/agent-session-continuation'
} from '@/lib/agent-session/context/agent-session-continuation'
import { launchAgentSessionContinuation } from '@/lib/agent-session/launch/continuation/launch-agent-session-continuation'
import { useAppStore } from '@/store'
import { isTuiAgentEnabled } from '../../../../shared/agent-launch/catalog/tui-agent-selection'
@@ -1,6 +1,6 @@
import { CircleAlert, Copy, ExternalLink } from 'lucide-react'
import { useTranslate } from '@/i18n/use-translate'
import { AgentIcon } from '@/lib/agent-catalog'
import { AgentIcon } from '@/components/agent/icons/AgentIcon'
import { Button } from '@/components/ui/button'
import { LoadingSpinner } from '@/components/LoadingSpinner'
import { PasteCodeForm } from './AgentSignInPasteCodeForm'
@@ -4,12 +4,13 @@ import { Button } from '@/components/ui/button'
import { Command, CommandEmpty, CommandInput, CommandList } from '@/components/ui/command'
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
import { AgentIcon, type AgentCatalogEntry } from '@/lib/agent-catalog'
import type { AgentCatalogEntry } from '@/lib/agent-catalog/agent-catalog'
import { AgentIcon } from '@/components/agent/icons/AgentIcon'
import {
agentPickerBlankTerminalMatches,
getAgentPickerCommandValue,
searchAgentPickerEntries
} from '@/lib/agent-picker-search'
} from '@/lib/agent-catalog/agent-picker-search'
import { cn } from '@/lib/utils'
import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent'
import * as state from './agent-combobox-command-state'
@@ -21,7 +21,8 @@ import {
DropdownMenuItem,
DropdownMenuTrigger
} from '@/components/ui/dropdown-menu'
import { AgentIcon, getAgentLabel } from '@/lib/agent-catalog'
import { getAgentLabel } from '@/lib/agent-catalog/agent-catalog'
import { AgentIcon } from '@/components/agent/icons/AgentIcon'
import { useTranslate } from '@/i18n/use-translate'
import { rowLabel } from '../tab-bar/tab-agent-row-presentation'
import type { NewTabAgentMenuModel } from '../tab-bar/use-new-tab-agent-menu-rows'
@@ -7,7 +7,7 @@ import { useAppStore } from '@/store/index'
import { parseExecutionHostId } from '../../../../shared/execution-host'
import { Input } from '@/components/ui/input'
import { Terminal } from 'lucide-react'
import { agentPickerBlankTerminalMatches } from '@/lib/agent-picker-search'
import { agentPickerBlankTerminalMatches } from '@/lib/agent-catalog/agent-picker-search'
import { AgentDefaultContextMenu } from './agent-combobox-items'
import { AgentPickerMenuRow, type AgentPickerMenuLaunch } from './AgentLaunchPickerMenuRow'
import { DropdownMenuItem } from '@/components/ui/dropdown-menu'
@@ -6,7 +6,7 @@ import {
DropdownMenuShortcut,
useDropdownMenuClose
} from '@/components/ui/dropdown-menu'
import { AgentIcon } from '@/lib/agent-catalog'
import { AgentIcon } from '@/components/agent/icons/AgentIcon'
import { useUiLanguageRevision } from '@/i18n/use-ui-language-revision'
import { AgentDefaultContextMenu } from './agent-combobox-items'
import { AgentLaunchSetupButton, type AgentPickerSetupIdentity } from './AgentLaunchSetupButton'
@@ -1,8 +1,9 @@
import { terminalPendingLabel, terminalPendingReason } from '../tab-bar/new-tab-agent-menu-model'
import React, { useState } from 'react'
import { CommandItem, CommandSeparator } from '@/components/ui/command'
import { AgentIcon, getAgentCatalog, type AgentCatalogEntry } from '@/lib/agent-catalog'
import { searchAgentPickerEntries } from '@/lib/agent-picker-search'
import { getAgentCatalog, type AgentCatalogEntry } from '@/lib/agent-catalog/agent-catalog'
import { AgentIcon } from '@/components/agent/icons/AgentIcon'
import { searchAgentPickerEntries } from '@/lib/agent-catalog/agent-picker-search'
import type { AgentLaunchSurface } from '@/lib/agent-session/launch/routing/agent-session-launch-plan'
import type { NewTabAgentMenuRow } from '../../../../shared/agent-launch/picker/agent-launch-picker-rows'
import type { NewTabAgentMenuModel } from '@/components/tab-bar/use-new-tab-agent-menu-rows'
@@ -16,7 +17,7 @@ import { cn } from '@/lib/utils'
import { translate } from '@/i18n/i18n'
import { useTranslate, type Translate } from '@/i18n/use-translate'
import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent'
import type { resolveAgentMenuSelection } from '@/lib/agent-menu-selection'
import type { resolveAgentMenuSelection } from '@/lib/agent-session/launch/routing/agent-menu-selection'
import { renderAgentComboboxItem } from './agent-combobox-items'
import { AgentSurfaceLaunchButton } from './AgentSurfaceLaunchButton'
@@ -1,8 +1,7 @@
import type React from 'react'
import { getAgentCatalog, getAgentLabel } from '../../../lib/agent-catalog/agent-catalog'
import { ClaudeIcon, DroidIcon, OpenAIIcon } from '@/components/status-bar/icons'
import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent'
import type { TerminalAgent } from '../../../shared/agent-status/identity/terminal-agent'
import { formatAgentTypeLabel } from '../../../shared/agent-status/presentation/agent-type-label'
import type { TerminalAgent } from '../../../../../shared/agent-status/identity/terminal-agent'
import {
AgentLetterIcon,
AiderIcon,
@@ -12,32 +11,7 @@ import {
OpenCodeIcon,
PiIcon
} from './agent-icon-glyphs'
import { createLocalizedCatalog } from '@/i18n/localized-catalog'
import { AGENT_FAVICON_ASSETS } from './agent-favicon-assets'
import { buildAgentCatalogEntries } from './agent-catalog-entries'
export type AgentCatalogEntry = {
id: TuiAgent
label: string
/** Default CLI binary name used for PATH detection. */
cmd: string
searchAliases?: readonly string[]
/** Direct or bundled image URL for agents whose project identity is not represented by a favicon service. */
iconUrl?: string
/** Domain for Google's favicon service — used for agents without an SVG icon. */
faviconDomain?: string
/** Homepage/install docs URL, sourced from the README agent badge list. */
homepageUrl: string
}
export const getAgentCatalog = createLocalizedCatalog(buildAgentCatalogEntries)
// Why: tests and a few legacy call sites still import a catalog snapshot.
export const AGENT_CATALOG: AgentCatalogEntry[] = getAgentCatalog()
export function getAgentLabel(agent: TerminalAgent): string {
return getAgentCatalog().find((entry) => entry.id === agent)?.label ?? formatAgentTypeLabel(agent)
}
export function AgentIcon({
agent,
@@ -0,0 +1,70 @@
import qoderUrl from '../../../../../shared/agent-icons/qoder.png?url'
import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent'
import grokUrl from '../../../../../shared/agent-icons/grok.png?url'
import mimoCodeUrl from '../../../../../shared/agent-icons/mimo-code.png?url'
import anteUrl from '../../../../../shared/agent-icons/ante.png?url'
import traeUrl from '../../../../../shared/agent-icons/trae.png?url'
import primeAgentUrl from '../../../../../shared/agent-icons/prime-agent.png?url'
import geminiUrl from '../../../../../shared/agent-icons/gemini.png?url'
import antigravityUrl from '../../../../../shared/agent-icons/antigravity.png?url'
import gooseUrl from '../../../../../shared/agent-icons/goose.png?url'
import ampUrl from '../../../../../shared/agent-icons/amp.png?url'
import kiroUrl from '../../../../../shared/agent-icons/kiro.png?url'
import crushUrl from '../../../../../shared/agent-icons/crush.png?url'
import augUrl from '../../../../../shared/agent-icons/aug.png?url'
import autohandUrl from '../../../../../shared/agent-icons/autohand.png?url'
import clineUrl from '../../../../../shared/agent-icons/cline.png?url'
import freebuffUrl from '../../../../../shared/agent-icons/freebuff.png?url'
import codebuffUrl from '../../../../../shared/agent-icons/codebuff.png?url'
import commandCodeUrl from '../../../../../shared/agent-icons/command-code.png?url'
import continueUrl from '../../../../../shared/agent-icons/continue.png?url'
import cursorUrl from '../../../../../shared/agent-icons/cursor.png?url'
import kimiUrl from '../../../../../shared/agent-icons/kimi.png?url'
import mistralVibeUrl from '../../../../../shared/agent-icons/mistral-vibe.png?url'
import qwenCodeUrl from '../../../../../shared/agent-icons/qwen-code.png?url'
import rovoUrl from '../../../../../shared/agent-icons/rovo.png?url'
import hermesUrl from '../../../../../shared/agent-icons/hermes.png?url'
import devinUrl from '../../../../../shared/agent-icons/devin.png?url'
import museUrl from '../../../../../shared/agent-icons/muse.png?url'
import zcodeUrl from '../../../../../shared/agent-icons/zcode.png?url'
import openclawUrl from '../../../../../shared/agent-icons/openclaw.png?url'
import dshUrl from '../../../../../shared/agent-icons/dsh.png?url'
import jcodeUrl from '../../../../../shared/agent-icons/jcode.png?url'
import codebuddyUrl from '../../../../../shared/agent-icons/codebuddy.png?url'
// Bundle favicons for offline/Google-blocked regions (#8451); shared/agent-icons also supplies mobile-agent-icon-assets.ts.
export const AGENT_FAVICON_ASSETS: Partial<Record<TuiAgent, string>> = {
grok: grokUrl,
'mimo-code': mimoCodeUrl,
ante: anteUrl,
trae: traeUrl,
'prime-agent': primeAgentUrl,
qoder: qoderUrl,
'qoder-cn': qoderUrl,
gemini: geminiUrl,
antigravity: antigravityUrl,
goose: gooseUrl,
amp: ampUrl,
kiro: kiroUrl,
crush: crushUrl,
aug: augUrl,
autohand: autohandUrl,
cline: clineUrl,
codebuff: codebuffUrl,
freebuff: freebuffUrl,
'command-code': commandCodeUrl,
continue: continueUrl,
cursor: cursorUrl,
kimi: kimiUrl,
'mistral-vibe': mistralVibeUrl,
'qwen-code': qwenCodeUrl,
rovo: rovoUrl,
hermes: hermesUrl,
devin: devinUrl,
muse: museUrl,
dsh: dshUrl,
zcode: zcodeUrl,
openclaw: openclawUrl,
jcode: jcodeUrl,
codebuddy: codebuddyUrl
}
@@ -1,5 +1,5 @@
import React from 'react'
import { cn } from './utils'
import { cn } from '../../../lib/utils'
export function PiIcon({
size = 14,
@@ -1,8 +1,8 @@
import type React from 'react'
import type { AgentType } from '../../../shared/agent-status/contracts/agent-status-types'
import { AgentIcon } from './agent-catalog'
import type { AgentType } from '../../../../../shared/agent-status/contracts/agent-status-types'
import { AgentIcon } from './AgentIcon'
import { AgentLetterIcon } from './agent-icon-glyphs'
import { agentTypeToIconAgent } from '../../../shared/agent-status/presentation/agent-type-icon-agent'
import { agentTypeToIconAgent } from '../../../../../shared/agent-status/presentation/agent-type-icon-agent'
/** Status-row icon: known agents get their brand icon, any other OSC 7501 program its first letter. */
export function AgentTypeIcon({
@@ -16,7 +16,7 @@ import {
import { composeActiveTerminalTheme } from '@/components/terminal-pane/appearance/terminal-appearance'
import { useSystemPrefersDark } from '@/hooks/theme/use-system-prefers-dark'
import { useIntlLocale, useTranslate } from '@/i18n/use-translate'
import { AgentIcon } from '@/lib/agent-catalog'
import { AgentIcon } from '@/components/agent/icons/AgentIcon'
import { buildFontFamily } from '@/lib/monospace-font-family'
import { resolveEffectiveTerminalAppearance } from '@/lib/terminal-theme'
import { cn } from '@/lib/utils'
@@ -10,7 +10,7 @@ import {
resolveHostCapabilities,
type ProspectiveWorkspace
} from '@/lib/agent-session/launch/routing/agent-launch-route-input'
import type { AgentCatalogEntry } from '@/lib/agent-catalog'
import type { AgentCatalogEntry } from '@/lib/agent-catalog/agent-catalog'
import { parseExecutionHostId } from '../../../../shared/execution-host'
import { AUTOMATION_LAUNCH_SETUP_RUNTIME_CAPABILITY } from '../../../../shared/automations/automation-runtime-capabilities'
import { automationLegacyArguments } from '../../../../shared/automations/launch/automation-legacy-arguments'
@@ -3,7 +3,8 @@ import { Pencil, Pause, Play, Trash2 } from 'lucide-react'
import { Button } from '@/components/ui/button'
import { Badge } from '@/components/ui/badge'
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
import { getAgentCatalog, AgentIcon } from '@/lib/agent-catalog'
import { getAgentCatalog } from '@/lib/agent-catalog/agent-catalog'
import { AgentIcon } from '@/components/agent/icons/AgentIcon'
import type { Automation } from '../../../../shared/automations/automation-definition'
import type { AutomationRun } from '../../../../shared/automations/history/automation-run'
import { formatUiAutomationSchedule } from './automation-schedule-label'
@@ -9,7 +9,7 @@ import {
automationLaunchWorkspace
} from './automation-launch-surface'
import { Dialog, DialogContent } from '@/components/ui/dialog'
import { getAgentCatalog } from '@/lib/agent-catalog'
import { getAgentCatalog } from '@/lib/agent-catalog/agent-catalog'
import { filterEnabledTuiAgents } from '../../../../shared/agent-launch/catalog/tui-agent-selection'
import type {
AutomationLaunchPreferences,
@@ -3,7 +3,7 @@
import { act, cleanup, fireEvent, render, screen } from '@testing-library/react'
import { useState } from 'react'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { AGENT_CATALOG } from '@/lib/agent-catalog'
import { AGENT_CATALOG } from '@/lib/agent-catalog/agent-catalog'
import { TooltipProvider } from '@/components/ui/tooltip'
import { useAppStore } from '@/store'
import { createCompatibleRuntimeStatusResponse } from '@/runtime/rpc/testing/runtime-compatibility-test-fixture'
@@ -8,7 +8,7 @@ import type { OrcaHooks } from '../../../../shared/orca-yaml-hook-types'
import type { ProjectHostSetup } from '../../../../shared/project-types'
import type { Repo } from '../../../../shared/repo-types'
import type { Worktree } from '../../../../shared/worktree/types'
import type { AgentCatalogEntry } from '@/lib/agent-catalog'
import type { AgentCatalogEntry } from '@/lib/agent-catalog/agent-catalog'
import { AUTOMATION_EDITOR_SECTION_LABEL_CLASS, Field } from './automation-page-parts'
import { AutomationMissedRunGraceField } from './AutomationMissedRunGraceField'
import { AutomationPrecheckFields } from './AutomationPrecheckFields'
@@ -16,8 +16,9 @@ import {
DropdownMenuSubTrigger,
DropdownMenuTrigger
} from '@/components/ui/dropdown-menu'
import { AgentIcon, getAgentCatalog } from '@/lib/agent-catalog'
import { searchAgentPickerEntries } from '@/lib/agent-picker-search'
import { getAgentCatalog } from '@/lib/agent-catalog/agent-catalog'
import { AgentIcon } from '@/components/agent/icons/AgentIcon'
import { searchAgentPickerEntries } from '@/lib/agent-catalog/agent-picker-search'
import { useTranslate } from '@/i18n/use-translate'
import { useBoundedHostRows } from '@/components/host-picker/use-bounded-host-rows'
import { HostListSearchField } from '@/components/host-picker/HostListSearchField'
@@ -19,7 +19,7 @@ import {
} from '@/components/ui/dropdown-menu'
import { Button } from '@/components/ui/button'
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
import { AgentIcon } from '@/lib/agent-catalog'
import { AgentIcon } from '@/components/agent/icons/AgentIcon'
import { cn } from '@/lib/utils'
import type { AutomationRun } from '../../../../shared/automations/history/automation-run'
import { getAutomationRunRepoId } from '../../../../shared/automations/history/automation-run-identity'
@@ -1,6 +1,6 @@
import { buildAutomationRrule } from '../../../../shared/automations/scheduling/automation-schedule-occurrences'
import { automationLaunchInputs } from '../../../../shared/automations/launch/automation-launch-choices'
import { getAgentCatalog } from '@/lib/agent-catalog'
import { getAgentCatalog } from '@/lib/agent-catalog/agent-catalog'
import type { AutomationPrecheck } from '../../../../shared/automations/automation-definition'
import type { Worktree } from '../../../../shared/worktree/types'
import {
@@ -1,6 +1,6 @@
import { useCallback, useMemo } from 'react'
import { shallow } from 'zustand/shallow'
import type { AgentCatalogEntry } from '@/lib/agent-catalog'
import type { AgentCatalogEntry } from '@/lib/agent-catalog/agent-catalog'
import type {
AgentLaunchRouteStore,
ProspectiveWorkspace
@@ -5,7 +5,7 @@ import {
} from '../../../../shared/agent-launch/catalog/tui-agent-selection'
import type { Repo } from '../../../../shared/repo-types'
import type { Worktree } from '../../../../shared/worktree/types'
import { getAgentCatalog } from '@/lib/agent-catalog'
import { getAgentCatalog } from '@/lib/agent-catalog/agent-catalog'
import { useAppStore } from '@/store'
import { useRepoMap } from '@/store/repos/use-repository-catalog'
import { useWorktreeMap } from '@/store/slices/worktrees/listing/use-worktree-catalog'
@@ -11,7 +11,10 @@ import {
buildExplicitEntriesByTabId,
type TabPaneInputSources
} from '../../../../shared/sidebar-list/smart-attention'
import { isExplicitAgentStatusFresh } from '@/lib/pane-agent-evidence'
import {
isAgentStatusFresh,
AGENT_STATUS_STALE_AFTER_MS
} from '../../../../shared/agent-status/contracts/agent-status-freshness'
import {
getLiveAgentStatusByWorktreeId,
type LiveAgentWorktreeStatus
@@ -32,7 +35,6 @@ import {
} from '@/components/tab-bar/terminal-tab-activity-status'
import { useTranslate } from '@/i18n/use-translate'
import { AGENT_STATUS_STALE_AFTER_MS } from '../../../../shared/agent-status/contracts/agent-status-freshness'
import type { AgentStatusEntry } from '../../../../shared/agent-status/contracts/agent-status-types'
import { parsePaneKey } from '../../../../shared/workspace-layout/stable-pane-id'
import type { BrowserWorkspace } from '../../../../shared/browser-workspace-types'
@@ -162,7 +164,7 @@ function buildLiveAgentStatusPaneIdsByTabId(
}
if (
entry.restoredUnconfirmed !== true &&
!isExplicitAgentStatusFresh(entry, now, AGENT_STATUS_STALE_AFTER_MS)
!isAgentStatusFresh(entry, now, AGENT_STATUS_STALE_AFTER_MS)
) {
stalePaneIds.add(paneId)
continue
@@ -7,7 +7,7 @@ import {
GitPullRequestClosed,
GitPullRequestDraft
} from 'lucide-react'
import { AgentTypeIcon } from '@/lib/agent-type-icon'
import { AgentTypeIcon } from '@/components/agent/icons/agent-type-icon'
import { AgentQuestionIcon } from '@/components/AgentQuestionIcon'
import { AgentStateDot } from '@/components/AgentStateDot'
import { RepoIconGlyph } from '@/components/repo/repo-icon'
@@ -1,6 +1,6 @@
import { useEffect, useId, useRef } from 'react'
import { SquareArrowOutUpRight, XIcon } from 'lucide-react'
import { AgentTypeIcon } from '@/lib/agent-type-icon'
import { AgentTypeIcon } from '@/components/agent/icons/agent-type-icon'
import { formatAgentTypeLabel } from '../../../../shared/agent-status/presentation/agent-type-label'
import { agentStateLabel } from '@/components/AgentStateDot'
import { Dialog, DialogContent, DialogTitle } from '@/components/ui/dialog'
@@ -1,6 +1,9 @@
import React, { useState, useCallback } from 'react'
import { cn } from '@/lib/utils'
import { opensClaudeParentConversation, viewClaudeAgentFromRow } from '@/lib/claude-agent-row-view'
import {
opensClaudeParentConversation,
viewClaudeAgentFromRow
} from '@/lib/agent-session/navigation/claude-agent-row-view'
import { useClaudeAgentRowView } from './use-claude-agent-row-view'
import {
AgentStateDot,
@@ -8,26 +11,32 @@ import {
agentStateProgressLabel,
type AgentDotState
} from '@/components/AgentStateDot'
import { AgentTypeIcon } from '@/lib/agent-type-icon'
import { AgentTypeIcon } from '@/components/agent/icons/agent-type-icon'
import { formatAgentTypeLabel } from '../../../../shared/agent-status/presentation/agent-type-label'
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
import { DashboardAgentRowMessage } from './DashboardAgentRowMessage'
import { DashboardAgentRowTrailingControls } from './DashboardAgentRowTrailingControls'
import { DashboardAgentRowToolStep } from './DashboardAgentRowToolStep'
import { programStatusAttentionLine } from '../../../../shared/program-status/presentation'
import { agentRowToolInput, showsAgentToolPreview } from '@/lib/agent-row-tool-preview'
import {
agentRowToolInput,
showsAgentToolPreview
} from '@/lib/agent-status/presentation/agent-row-tool-preview'
import { resolveRowProgramStatus } from '@/lib/program-status/agent-row-presentation'
import { agentRowStoppingLabel } from '@/lib/agent-row-stopping-label'
import { agentRowStoppingLabel } from '@/lib/agent-status/presentation/agent-row-stopping-label'
import {
agentNoUpdateLabel,
formatCompactDuration
} from '../../../../shared/agent-status/presentation/agent-row-decay-state'
import { agentRowDisplayDotState, agentRowDotState as asDotState } from '@/lib/agent-row-dot-state'
import {
agentRowDisplayDotState,
agentRowDotState as asDotState
} from '@/lib/agent-status/presentation/agent-row-dot-state'
import {
agentMainAgentVerdict,
agentVerdictDisplayMark
} from '../../../../shared/agent-status/lifecycle/agent-main-agent-verdict'
import { agentVerdictStatusLine } from '@/lib/agent-verdict-status-line'
import { agentVerdictStatusLine } from '@/lib/agent-status/presentation/agent-verdict-status-line'
import type { DashboardAgentRow as DashboardAgentRowData } from './useDashboardData'
import { getAgentRowPrimaryText } from '../../../../shared/agent-status/presentation/agent-row-primary-text'
import { useAgentRowConversationName } from './use-agent-row-conversation-name'
@@ -2,7 +2,10 @@ import { agentEntrySessionStartedAt } from '../../../../shared/agent-session/lif
import { useEffect, useRef } from 'react'
import { useShallow } from 'zustand/react/shallow'
import { useAppStore } from '@/store'
import { isExplicitAgentStatusFresh } from '@/lib/pane-agent-evidence'
import {
isAgentStatusFresh,
AGENT_STATUS_STALE_AFTER_MS
} from '../../../../shared/agent-status/contracts/agent-status-freshness'
import type { DashboardAgentRow } from './useDashboardData'
import type { RetainedAgentEntry } from '@/store/slices/agent-status/agent-status-contract'
import type { FolderWorkspace } from '../../../../shared/folder-workspaces/folder-workspace-types'
@@ -11,7 +14,7 @@ import type { TerminalTab } from '../../../../shared/workspace-layout/terminal-t
import type { Worktree } from '../../../../shared/worktree/types'
import { folderWorkspaceKey } from '../../../../shared/workspace-scope'
import { resolveAgentPaneAuthorityKey } from '@/store/slices/agent-status/agent-pane-authority'
import { AGENT_STATUS_STALE_AFTER_MS } from '../../../../shared/agent-status/contracts/agent-status-freshness'
import type { AgentStatusEntry } from '../../../../shared/agent-status/contracts/agent-status-types'
import { parsePaneKey } from '../../../../shared/workspace-layout/stable-pane-id'
import { agentTurnEndedOnPurpose } from '../../../../shared/agent-status/lifecycle/agent-main-agent-verdict'
@@ -116,7 +119,7 @@ export function buildRetainedAgentsSyncSnapshot(args: RetainedAgentsSyncSnapshot
if (!owner) {
continue
}
const isFresh = isExplicitAgentStatusFresh(entry, args.now, AGENT_STATUS_STALE_AFTER_MS)
const isFresh = isAgentStatusFresh(entry, args.now, AGENT_STATUS_STALE_AFTER_MS)
const shouldDecay =
!isFresh &&
(entry.state === 'working' || entry.state === 'blocked' || entry.state === 'waiting')
@@ -22,24 +22,24 @@ import {
} from '@/runtime/native-chat/naming/structured-chat-name-observation'
import { QuickLaunchAgentMenuItems } from '@/components/tab-bar/QuickLaunchButton'
import { AgentStateDot, agentStateLabel } from '@/components/AgentStateDot'
import { AgentTypeIcon } from '@/lib/agent-type-icon'
import { AgentTypeIcon } from '@/components/agent/icons/agent-type-icon'
import {
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator
} from '@/components/ui/dropdown-menu'
import { focusTerminalTabSurface } from '@/lib/focus-terminal-tab-surface'
import '@/lib/active-agent-note-send'
import '@/lib/agent-session/messaging/terminal/active-agent-note-send'
import {
activeAgentNotesSendFailureMessage,
type ActiveAgentNotesSendResult
} from '@/lib/active-agent-note-send-result'
import { sendMessageToAgent } from '@/lib/agent-message-send'
} from '@/lib/agent-session/messaging/terminal/active-agent-note-send-result'
import { sendMessageToAgent } from '@/lib/agent-session/messaging/agent-message-send'
import {
deriveNotesSendAgentTargets,
type NotesSendAgentTarget
} from '@/lib/notes-send-agent-targets'
import { agentKindForAgentType } from '@/lib/agent-status'
} from '@/lib/agent-session/messaging/notes-send-agent-targets'
import { agentKindForAgentType } from '@/lib/agent-status/aggregation/worktree-agent-status'
import { formatAgentTypeLabel } from '../../../../../shared/agent-status/presentation/agent-type-label'
import { track } from '@/lib/telemetry'
import { useNow } from '@/hooks/use-now'
@@ -49,10 +49,10 @@ import { useWorktreeAgentRows } from '@/components/sidebar/workspace-card/activi
import { useAgentRowConversationName } from '@/components/dashboard/use-agent-row-conversation-name'
import { getAgentRowPrimaryText } from '../../../../../shared/agent-status/presentation/agent-row-primary-text'
import type { LaunchSource } from '../../../../../shared/telemetry-property-schemas'
import { agentRowDisplayDotState } from '@/lib/agent-row-dot-state'
import { agentRowDisplayDotState } from '@/lib/agent-status/presentation/agent-row-dot-state'
import { translate } from '@/i18n/i18n'
import { useTranslate, type Translate } from '@/i18n/use-translate'
import { agentSendDisabledReasonLabel } from '@/lib/agent-send-disabled-reason-label'
import { agentSendDisabledReasonLabel } from '@/lib/agent-session/messaging/agent-send-disabled-reason-label'
import { addQuoteToAgent } from '@/components/native-chat/selection-quotes/native-chat-workspace-selection'
import React, { useCallback, useMemo } from 'react'
import { orderSendTargetsByWorktreeAgentRows } from './review-notes-send-target-order'
@@ -1,5 +1,5 @@
import type { DashboardAgentRow as DashboardAgentRowData } from '@/components/dashboard/useDashboardData'
import type { NotesSendAgentTarget } from '@/lib/notes-send-agent-targets'
import type { NotesSendAgentTarget } from '@/lib/agent-session/messaging/notes-send-agent-targets'
export type OrderedSendTarget = {
target: NotesSendAgentTarget
@@ -1,5 +1,5 @@
import { useAppStore } from '@/store'
import { ORCA_CLI_SKILL_NAME } from '@/lib/agent-feature-skill-names'
import { ORCA_CLI_SKILL_NAME } from '@/lib/skills/installation/agent-feature-skill-names'
import { AgentSkillSetupPanel } from '../skills/setup/AgentSkillSetupPanel'
import type { useMobileEmulatorAgentSetupState } from './use-mobile-emulator-agent-setup-state'
import { useTranslate } from '@/i18n/use-translate'
@@ -1,7 +1,7 @@
import { useActiveProjectSkillRuntime } from '@/hooks/useActiveProjectSkillRuntime'
import { useCallback, useEffect, useState } from 'react'
import { toast } from 'sonner'
import { ORCA_CLI_SKILL_NAME } from '@/lib/agent-feature-skill-names'
import { ORCA_CLI_SKILL_NAME } from '@/lib/skills/installation/agent-feature-skill-names'
import {
GLOBAL_AGENT_SKILL_SOURCE_KINDS,
useInstalledAgentSkill
@@ -5,7 +5,7 @@ import { usePrefersReducedMotion } from '@/components/feature-wall/feature-wall-
import { nativeChatPermissionModeLabel } from '@/components/native-chat/session/options/controls/native-chat-permission-mode-labels'
import { nativeChatToolRowVerb } from '@/components/native-chat/tools/lines/native-chat-tool-line-label'
import { useIntlLocale, useTranslate } from '@/i18n/use-translate'
import { AgentIcon } from '@/lib/agent-catalog'
import { AgentIcon } from '@/components/agent/icons/AgentIcon'
import { cn } from '@/lib/utils'
import {
CHAT_DEMO_FILE,
@@ -1,6 +1,9 @@
import { CliSkillSetupTerminal } from './CliSkillSetupTerminal'
import { AgentSkillSetupPanel } from '@/components/skills/setup/AgentSkillSetupPanel'
import { ORCA_CLI_SKILL_NAME, ORCHESTRATION_SKILL_NAME } from '@/lib/agent-feature-skill-names'
import {
ORCA_CLI_SKILL_NAME,
ORCHESTRATION_SKILL_NAME
} from '@/lib/skills/installation/agent-feature-skill-names'
import { useActiveProjectSkillRuntime } from '@/hooks/useActiveProjectSkillRuntime'
import {
GLOBAL_AGENT_SKILL_SOURCE_KINDS,
@@ -8,7 +8,7 @@ import {
buildSkillCommandForRuntime,
buildSkillSetupTerminalCommand
} from '@/lib/skill-runtime-command'
import { ORCA_CLI_ORCHESTRATION_SKILL_INSTALL_COMMAND } from '@/lib/agent-feature-install-commands'
import { ORCA_CLI_ORCHESTRATION_SKILL_INSTALL_COMMAND } from '@/lib/skills/installation/agent-feature-install-commands'
import { useActiveProjectSkillRuntime } from '@/hooks/useActiveProjectSkillRuntime'
import { useTranslate } from '@/i18n/use-translate'
@@ -16,7 +16,7 @@ import {
DEFAULT_AI_VAULT_GROUP,
DEFAULT_AI_VAULT_HIDE_EMPTY_SESSIONS
} from '@/components/right-sidebar/ai-vault/scope/ai-vault-view-defaults'
import { AgentIcon } from '@/lib/agent-catalog'
import { AgentIcon } from '@/components/agent/icons/AgentIcon'
import { useTranslate } from '@/i18n/use-translate'
import type { SessionSearchDemoRow } from './session-search-feature-tip-demo'
@@ -5,7 +5,7 @@ import {
import { bundledSkillSetupActionLabel } from '../skills/setup/bundled-skill-setup-copy'
import { useOnboardingSkillRuntime } from '@/hooks/use-onboarding-skill-runtime'
import { FeatureSetupInlineTerminal } from '../onboarding/FeatureSetupInlineTerminal'
import { buildAgentFeatureSkillInstallCommand } from '@/lib/agent-feature-install-commands'
import { buildAgentFeatureSkillInstallCommand } from '@/lib/skills/installation/agent-feature-install-commands'
import { buildSkillCommandForRuntime } from '../../lib/skill-runtime-command'
import type { OnboardingFeatureSetupRuntimeContext } from '../onboarding/onboarding-feature-setup-runtime'
import { useCallback, useEffect, useRef, useState } from 'react'
@@ -1,5 +1,5 @@
import type { JSX } from 'react'
import { ORCA_CLI_SKILL_NAME } from '@/lib/agent-feature-skill-names'
import { ORCA_CLI_SKILL_NAME } from '@/lib/skills/installation/agent-feature-skill-names'
import { BROWSER_USE_ENABLED_STORAGE_KEY } from '@/lib/browser/browser-use-setup-state'
import type { InstalledAgentSkillState } from '@/hooks/useInstalledAgentSkills'
import { useActiveProjectSkillRuntime } from '@/hooks/useActiveProjectSkillRuntime'
@@ -1,9 +1,9 @@
import { useBundledSkillInstallAction } from '@/hooks/use-bundled-skill-install-action'
import { bundledSkillSetupActionLabel } from '../skills/setup/bundled-skill-setup-copy'
import { ORCA_CLI_SKILL_NAME } from '@/lib/agent-feature-skill-names'
import { ORCA_CLI_SKILL_NAME } from '@/lib/skills/installation/agent-feature-skill-names'
import { useOnboardingSkillRuntime } from '@/hooks/use-onboarding-skill-runtime'
import { FeatureSetupInlineTerminal } from '../onboarding/FeatureSetupInlineTerminal'
import { buildAgentFeatureSkillInstallCommand } from '@/lib/agent-feature-install-commands'
import { buildAgentFeatureSkillInstallCommand } from '@/lib/skills/installation/agent-feature-install-commands'
import { buildSkillCommandForRuntime } from '../../lib/skill-runtime-command'
import type { OnboardingFeatureSetupRuntimeContext } from '../onboarding/onboarding-feature-setup-runtime'
import { useCallback, useState } from 'react'
@@ -1,5 +1,5 @@
import type { JSX } from 'react'
import { ORCHESTRATION_SKILL_NAME } from '@/lib/agent-feature-skill-names'
import { ORCHESTRATION_SKILL_NAME } from '@/lib/skills/installation/agent-feature-skill-names'
import type { InstalledAgentSkillState } from '@/hooks/useInstalledAgentSkills'
import { useActiveProjectSkillRuntime } from '@/hooks/useActiveProjectSkillRuntime'
import { AgentSkillSetupPanel } from '../skills/setup/AgentSkillSetupPanel'
@@ -7,7 +7,7 @@ import {
COMPUTER_USE_SKILL_NAME,
ORCA_CLI_SKILL_NAME,
ORCHESTRATION_SKILL_NAME
} from '@/lib/agent-feature-skill-names'
} from '@/lib/skills/installation/agent-feature-skill-names'
import {
GLOBAL_AGENT_SKILL_SOURCE_KINDS,
useInstalledAgentSkill
@@ -2,7 +2,8 @@ import { useEffect, useRef, useState } from 'react'
import type { JSX, ReactNode } from 'react'
import { Wrench } from 'lucide-react'
import { AgentStateDot } from '@/components/AgentStateDot'
import { getAgentCatalog, AgentIcon, type AgentCatalogEntry } from '@/lib/agent-catalog'
import { getAgentCatalog, type AgentCatalogEntry } from '@/lib/agent-catalog/agent-catalog'
import { AgentIcon } from '@/components/agent/icons/AgentIcon'
import { ClaudeIcon, OpenAIIcon } from '../../status-bar/icons'
import { installWindowVisibilityInterval } from '@/lib/window-visibility-interval'
import { cn } from '@/lib/utils'
@@ -8,7 +8,7 @@ import {
type CommitMessageAgentChoice,
type CommitMessageModelCapability
} from '../../../../shared/source-control/ai/generation/commit-message-agent-spec'
import { getAgentCatalog } from '@/lib/agent-catalog'
import { getAgentCatalog } from '@/lib/agent-catalog/agent-catalog'
export const EMPTY_COMMIT_MESSAGE_AI_SETTINGS: CommitMessageAiSettings = {
enabled: false,
@@ -1,4 +1,7 @@
import { ORCA_CLI_SKILL_NAME, ORCHESTRATION_SKILL_NAME } from '@/lib/agent-feature-skill-names'
import {
ORCA_CLI_SKILL_NAME,
ORCHESTRATION_SKILL_NAME
} from '@/lib/skills/installation/agent-feature-skill-names'
import {
GLOBAL_AGENT_SKILL_SOURCE_KINDS,
useInstalledAgentSkill
@@ -11,7 +11,7 @@ import { LOCAL_COMMIT_MESSAGE_HOST_KEY } from '../../../../shared/source-control
import { getDefaultSourceControlAiSettings } from '../../../../shared/source-control/ai/settings/source-control-ai-settings'
import { getTextGenerationModels } from '../../../../shared/source-control/ai/settings/source-control-ai-model-selection'
import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config'
import { getAgentCatalog } from '@/lib/agent-catalog'
import { getAgentCatalog } from '@/lib/agent-catalog/agent-catalog'
import { useAppStore } from '@/store/index'
import type {
AgentPickerDraft,
@@ -9,7 +9,7 @@ import {
import { AgentSkillSetupPanel } from '@/components/skills/setup/AgentSkillSetupPanel'
import { IntegrationStatusPill } from '@/components/integration-status-pill'
import { SkillFreshnessStatusPill } from '@/components/skills/SkillFreshnessStatusPill'
import { ORCHESTRATION_SKILL_NAME } from '@/lib/agent-feature-skill-names'
import { ORCHESTRATION_SKILL_NAME } from '@/lib/skills/installation/agent-feature-skill-names'
import {
GLOBAL_AGENT_SKILL_SOURCE_KINDS,
useInstalledAgentSkill
@@ -2,7 +2,8 @@ import { useCallback, useMemo } from 'react'
import { Maximize2, Minimize2, Minus } from 'lucide-react'
import { Button } from '@/components/ui/button'
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
import { getAgentCatalog, AgentIcon } from '@/lib/agent-catalog'
import { getAgentCatalog } from '@/lib/agent-catalog/agent-catalog'
import { AgentIcon } from '@/components/agent/icons/AgentIcon'
import { focusTerminalTabSurface } from '@/lib/focus-terminal-tab-surface'
import { launchAgentInNewTab } from '@/lib/agent-session/launch/new-tab/launch-agent-in-new-tab'
import { newAgentLaunchRequestId } from '@/lib/agent-session/launch/routing/agent-launch-request-id'
@@ -1,5 +1,5 @@
import { useCallback, useEffect } from 'react'
import { isOrcaCliAvailableOnPath } from '@/lib/agent-skill-cli-prerequisite'
import { isOrcaCliAvailableOnPath } from '@/lib/skills/installation/agent-skill-cli-prerequisite'
import {
ORCHESTRATION_SETUP_STATE_EVENT,
hasOrchestrationSetupMarker,
@@ -4,7 +4,7 @@ import {
captureNativeChatStagedInput
} from '../../drafts/native-chat-draft-attachment-staging'
import { mayHoldAgentReferences } from '../../../../../../shared/orchestration/mailbox/orchestration-agent-reference'
import { getAgentLabel } from '@/lib/agent-catalog'
import { getAgentLabel } from '@/lib/agent-catalog/agent-catalog'
import { formatAgentTypeLabel } from '../../../../../../shared/agent-status/presentation/agent-type-label'
import { isTuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent-config'
import { MAX_SKILL_REFS } from '../../../../../../shared/rpc-contract/structured-agent-session-message-params'
@@ -1,5 +1,5 @@
import { TriangleAlert } from 'lucide-react'
import { AgentIcon } from '@/lib/agent-catalog'
import { AgentIcon } from '@/components/agent/icons/AgentIcon'
import { agentTypeToIconAgent } from '../../../../../shared/agent-status/presentation/agent-type-icon-agent'
import { cn } from '@/lib/utils'
import type { AgentType } from '../../../../../shared/agent-status/contracts/agent-status-types'
@@ -9,7 +9,7 @@ import {
import { createWorktreeAgentFreshnessSelector } from '@/components/sidebar/workspace-card/activity/worktree-agent-freshness-selector'
import '@/components/sidebar/workspace-card/activity/worktree-agent-row-selectors'
import { selectWorktreeAgentOrchestration as selectRuntimeAgentOrchestrationForWorktree } from '@/components/sidebar/workspace-card/activity/worktree-agent-orchestration-index'
import { agentRowDisplayDotState } from '@/lib/agent-row-dot-state'
import { agentRowDisplayDotState } from '@/lib/agent-status/presentation/agent-row-dot-state'
import { resolveRowProgramStatus } from '@/lib/program-status/agent-row-presentation'
import {
agentMessageSenderView,
@@ -1,7 +1,7 @@
import { useId } from 'react'
import { ChevronDown } from 'lucide-react'
import { AgentStateDot } from '@/components/AgentStateDot'
import { AgentTypeIcon } from '@/lib/agent-type-icon'
import { AgentTypeIcon } from '@/components/agent/icons/agent-type-icon'
import { translate } from '@/i18n/i18n'
import { useTranslate, type Translate } from '@/i18n/use-translate'
import { cn } from '@/lib/utils'
@@ -9,7 +9,7 @@ import { AgentSessionContinuationDialog } from '@/components/agent-session-conti
import {
buildAgentSessionContinuationPrompt,
type AgentSessionContinuationRequest
} from '@/lib/agent-session-continuation'
} from '@/lib/agent-session/context/agent-session-continuation'
import { isTuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent-config'
import { callStructuredAgentSession } from '@/runtime/native-chat/requests/structured-agent-session-call'
import { supportsStructuredAgentSessionContinuationContext } from '@/runtime/native-chat/host-capabilities/structured-agent-session-host-support'
@@ -2,7 +2,7 @@ import { useCallback, useLayoutEffect, useRef, useState } from 'react'
import { executionHostIdForStructuredTarget } from '@/runtime/native-chat/session-ownership/structured-agent-session-owner'
import { useTranslate } from '@/i18n/use-translate'
import type { AgentType } from '../../../../../../shared/agent-status/contracts/agent-status-types'
import { copyAgentSessionContext } from '@/lib/copy-agent-session-context'
import { copyAgentSessionContext } from '@/lib/agent-session/context/copy-agent-session-context'
import {
resolveNativeChatSessionContext,
type NativeChatSessionContextSource
@@ -7,9 +7,9 @@ import {
} from '../../../../../shared/workspace-layout/stable-pane-id'
import type { AppState } from '@/store/types'
import { useAppStore } from '@/store'
import type { AgentMessageTarget } from '@/lib/agent-message-target'
import { sendMessageToAgent } from '@/lib/agent-message-send'
import type { ActiveAgentNotesSendResult } from '@/lib/active-agent-note-send-result'
import type { AgentMessageTarget } from '@/lib/agent-session/messaging/agent-message-target'
import { sendMessageToAgent } from '@/lib/agent-session/messaging/agent-message-send'
import type { ActiveAgentNotesSendResult } from '@/lib/agent-session/messaging/terminal/active-agent-note-send-result'
import { activateStructuredAgentSessionTab } from '@/lib/agent-session/structured-agent-session-tab-activation'
import { activateTabAndFocusPane } from '@/lib/workspace/tabs/activate-tab-and-focus-pane'
import { activateTerminalTabOnOwner } from '@/lib/workspace/tabs/terminal-tab-owner-activation'
@@ -3,7 +3,7 @@ import { describe, expect, it } from 'vitest'
import { Terminal } from '@xterm/headless'
import { SerializeAddon } from '@xterm/addon-serialize'
import { readClaudeSessionOptionsFromTerminalScreen } from './claude-terminal-session-options'
import { buildBoundedSessionTranscript } from '@/lib/agent-session-fork-context'
import { buildBoundedSessionTranscript } from '@/lib/agent-session/context/agent-session-fork-context'
const CLAUDE_FRAME = [
'╭─ Claude Code ───╮',
@@ -3,10 +3,13 @@ import {
agentChildRowContextForParent,
type AgentChildRowContext
} from '../../../../../../shared/agent-status/presentation/agent-child-row-model'
import { AGENT_STATUS_STALE_AFTER_MS } from '../../../../../../shared/agent-status/contracts/agent-status-freshness'
import {
AGENT_STATUS_STALE_AFTER_MS,
isAgentStatusFresh
} from '../../../../../../shared/agent-status/contracts/agent-status-freshness'
import type { AgentStatusEntry } from '../../../../../../shared/agent-status/contracts/agent-status-types'
import { useNow } from '@/hooks/use-now'
import { isExplicitAgentStatusFresh } from '@/lib/pane-agent-evidence'
import { useAppStore } from '@/store'
/** The verdict a session's status row gives its children, exactly as the sidebar derives it. */
@@ -16,7 +19,7 @@ export function structuredSessionChildRowContext(
): AgentChildRowContext {
return agentChildRowContextForParent(
parent,
isExplicitAgentStatusFresh(parent, now, AGENT_STATUS_STALE_AFTER_MS)
isAgentStatusFresh(parent, now, AGENT_STATUS_STALE_AFTER_MS)
)
}
@@ -18,7 +18,7 @@ import { AgentSessionContinuationDialog } from '@/components/agent-session-conti
import {
buildAgentSessionContinuationPrompt,
type AgentSessionContinuationRequest
} from '@/lib/agent-session-continuation'
} from '@/lib/agent-session/context/agent-session-continuation'
import { ClaudeSwitcherMenu } from '@/components/status-bar/ClaudeSwitcherMenu'
import { ProviderAccountChatButton } from '@/components/status-bar/ProviderAccountChatButton'
import { isTuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent-config'
@@ -1,5 +1,6 @@
import { Check } from 'lucide-react'
import { AgentIcon, type AgentCatalogEntry } from '@/lib/agent-catalog'
import type { AgentCatalogEntry } from '@/lib/agent-catalog/agent-catalog'
import { AgentIcon } from '@/components/agent/icons/AgentIcon'
import { cn } from '@/lib/utils'
export function AgentSectionHeader({
@@ -1,7 +1,7 @@
import { useState } from 'react'
import { ExternalLink } from 'lucide-react'
import { Trans } from 'react-i18next'
import { getAgentCatalog, type AgentCatalogEntry } from '@/lib/agent-catalog'
import { getAgentCatalog, type AgentCatalogEntry } from '@/lib/agent-catalog/agent-catalog'
import { Button } from '@/components/ui/button'
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible'
import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent'
@@ -1,5 +1,6 @@
import { MessagesSquare, SquareTerminal } from 'lucide-react'
import { AgentIcon, getAgentLabel } from '@/lib/agent-catalog'
import { getAgentLabel } from '@/lib/agent-catalog/agent-catalog'
import { AgentIcon } from '@/components/agent/icons/AgentIcon'
import { useTranslate } from '@/i18n/use-translate'
// Shell text, not prose: what a terminal shows when the agent's CLI starts.
@@ -2,7 +2,7 @@ import { useId, useState } from 'react'
import { Button } from '@/components/ui/button'
import { Switch } from '@/components/ui/switch'
import { useTranslate } from '@/i18n/use-translate'
import { getAgentLabel } from '@/lib/agent-catalog'
import { getAgentLabel } from '@/lib/agent-catalog/agent-catalog'
import { useAppStore } from '@/store'
import {
applyAgentPermissionOverrides,
@@ -1,5 +1,5 @@
import { useAppStore } from '@/store'
import { resolveDefaultAgentForWorktree } from '@/lib/agent-tab-shortcuts'
import { resolveDefaultAgentForWorktree } from '@/lib/agent-session/launch/shortcuts/agent-tab-shortcuts'
import { agentTabLaunchStore } from '@/lib/agent-session/launch/new-tab/launch-agent-execution-context'
import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent'
import type { ExecutionHostId } from '../../../../shared/execution-host'
@@ -3,7 +3,7 @@ import type {
ComputerUsePermissionSetupResult,
ComputerUsePermissionStatusResult
} from '../../../../shared/computer-use-permissions-types'
import { ORCHESTRATION_SKILL_NAME } from '@/lib/agent-feature-skill-names'
import { ORCHESTRATION_SKILL_NAME } from '@/lib/skills/installation/agent-feature-skill-names'
import { BROWSER_USE_ENABLED_STORAGE_KEY } from '@/lib/browser/browser-use-setup-state'
import { ORCHESTRATION_ENABLED_STORAGE_KEY } from '@/lib/orchestration-setup-state'
import {
@@ -7,7 +7,7 @@ import {
ORCA_LINEAR_SKILL_NAME,
ORCA_CLI_SKILL_NAME,
ORCHESTRATION_SKILL_NAME
} from '@/lib/agent-feature-skill-names'
} from '@/lib/skills/installation/agent-feature-skill-names'
import { BROWSER_USE_ENABLED_STORAGE_KEY } from '@/lib/browser/browser-use-setup-state'
import { e2eConfig } from '@/lib/e2e-config'
import {
@@ -3,7 +3,10 @@ import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host'
import type { GlobalSettings } from '../../../../shared/global-settings-types'
import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent'
import { nativeChatPreferenceFor } from '../../../../shared/structured-native-chat-launch-route'
import { chatProviderAgents, useHostStructuredAgentsVersion } from '@/lib/chat-provider-agents'
import {
chatProviderAgents,
useHostStructuredAgentsVersion
} from '@/runtime/native-chat/agent-catalogs/chat-provider-agents'
import { recomputeOn } from '@/lib/recompute-on'
import type { ProspectiveWorkspace } from '@/lib/agent-session/launch/routing/agent-launch-route-input'
import { readChatProgram, resolveChatProgramContext } from '@/lib/host-chat-program'
@@ -54,7 +54,9 @@ vi.mock('@/components/agent-tab-launch-context', () => ({
captureAgentTabLaunchContext: () => ({ groupId: 'group', focusIntent })
}))
vi.mock('@/lib/telemetry', () => ({ track }))
vi.mock('@/lib/agent-detection-target-inventory', () => ({ loadDetectedAgentsForWorktree: detect }))
vi.mock('@/lib/agent-session/launch/inventory/agent-detection-target-inventory', () => ({
loadDetectedAgentsForWorktree: detect
}))
vi.mock('@/lib/host-chat-program-acquisition', () => ({
acquireAgentLaunchChoices: acquireChoices
}))
@@ -1,6 +1,6 @@
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { toast } from 'sonner'
import { getAgentCatalog } from '@/lib/agent-catalog'
import { getAgentCatalog } from '@/lib/agent-catalog/agent-catalog'
import { useAppStore } from '@/store'
import { selectOnboardingWorkspaceId } from './onboarding-workspace-selection'
import { applyDocumentTheme } from '@/lib/document-theme'
@@ -1,10 +1,10 @@
import { useMemo } from 'react'
import StatusIndicator from '@/components/sidebar/workspace-card/surface/StatusIndicator'
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
import { AgentTypeIcon } from '@/lib/agent-type-icon'
import { AgentTypeIcon } from '@/components/agent/icons/agent-type-icon'
import { cn } from '@/lib/utils'
import { getAgentLabel } from '@/lib/agent-catalog'
import { mapAgentStatusStateToVisualStatus } from '@/lib/agent-status'
import { getAgentLabel } from '@/lib/agent-catalog/agent-catalog'
import { mapAgentStatusStateToVisualStatus } from '@/lib/agent-status/aggregation/worktree-agent-status'
import { getWorktreeStatusLabel, type WorktreeStatus } from '@/lib/worktree-status'
import {
useAgentMessageSenderViews,
@@ -4,7 +4,7 @@ import { usePetUrl } from './usePetUrl'
import type { DetectedSpriteCacheEntry } from './pet-blob-cache'
import type { CustomPet } from '../../../../shared/pet-types'
import { useAppStore } from '../../store'
import { getAgentStatusEpochNow } from '@/lib/agent-status-epoch-clock'
import { getAgentStatusEpochNow } from '@/lib/agent-status/evidence/agent-status-epoch-clock'
import { AGENT_STATUS_STALE_AFTER_MS } from '../../../../shared/agent-status/contracts/agent-status-freshness'
import {
selectPetAnimationName,
@@ -1,5 +1,5 @@
import type { AgentStatusEntry } from '../../../../shared/agent-status/contracts/agent-status-types'
import { isExplicitAgentStatusFresh } from '@/lib/pane-agent-evidence'
import { isAgentStatusFresh } from '../../../../shared/agent-status/contracts/agent-status-freshness'
export type PetAnimationName =
| 'idle'
@@ -46,7 +46,7 @@ function agentStateAnimation(
let hasDone = false
for (const entry of entries) {
if (!isExplicitAgentStatusFresh(entry, now, staleAfterMs)) {
if (!isAgentStatusFresh(entry, now, staleAfterMs)) {
continue
}
if (entry.state === 'blocked' || entry.state === 'waiting') {
@@ -1,4 +1,7 @@
import { agentLaunchRecoveryMessage, notifyAgentLaunchFailure } from '@/lib/agent-launch-failure'
import {
agentLaunchRecoveryMessage,
notifyAgentLaunchFailure
} from '@/lib/agent-session/launch/failure/agent-launch-failure'
import type { DirectWorkItemLaunchResult } from '@/lib/workspace/creation/work-item/direct-work-item-setup'
import { toast } from 'sonner'
import { useAppStore } from '@/store'
@@ -21,7 +21,7 @@ import {
DropdownMenuTrigger
} from '@/components/ui/dropdown-menu'
import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group'
import { AgentIcon } from '@/lib/agent-catalog'
import { AgentIcon } from '@/components/agent/icons/AgentIcon'
import { cn } from '@/lib/utils'
import {
AI_VAULT_AGENTS,
@@ -6,7 +6,7 @@ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/component
import { useNow } from '@/hooks/use-now'
import { getIntlLocale, translate } from '@/i18n/i18n'
import { useIntlLocale, useTranslate, type Translate } from '@/i18n/use-translate'
import { AgentIcon } from '@/lib/agent-catalog'
import { AgentIcon } from '@/components/agent/icons/AgentIcon'
import { cn } from '@/lib/utils'
import type {
AiVaultScanAgentProgress,
@@ -1,4 +1,4 @@
import { agentRowDisplayDotState } from '@/lib/agent-row-dot-state'
import { agentRowDisplayDotState } from '@/lib/agent-status/presentation/agent-row-dot-state'
import type { AgentDotState } from '@/components/AgentStateDot'
import type { AiVaultSession } from '../../../../../../shared/ai-vault/contracts/ai-vault-types'
import {
@@ -1,4 +1,4 @@
import { agentRowDisplayDotState } from '@/lib/agent-row-dot-state'
import { agentRowDisplayDotState } from '@/lib/agent-status/presentation/agent-row-dot-state'
import type { AppState } from '@/store/types'
import { resolveRuntimePaneTitleLeafId } from '../../../../../../shared/runtime-pane-title-leaf-id'
import type { AgentDotState } from '@/components/AgentStateDot'

Some files were not shown because too many files have changed in this diff Show More