refactor(renderer): group session tab activation and cancellation (#33100)

This commit is contained in:
Neil
2026-10-24 01:58:30 -07:00
committed by GitHub
parent 2a20d2de94
commit f6ae05898f
30 changed files with 54 additions and 55 deletions
+2 -2
View File
@@ -10129,8 +10129,8 @@
"src/renderer/src/lib/structured-agent-session-launch-unconfirmed-or-retried.test.ts": 656,
"src/renderer/src/lib/structured-agent-session-launch.test.ts": 822,
"src/renderer/src/lib/structured-agent-session-new-chat-own-launch.test.ts": 701,
"src/renderer/src/lib/structured-agent-session-provisional-tab.test.ts": 829,
"src/renderer/src/lib/structured-agent-session-tab-activation.test.ts": 50,
"src/renderer/src/lib/agent-session/structured-agent-session-provisional-tab.test.ts": 829,
"src/renderer/src/lib/agent-session/structured-agent-session-tab-activation.test.ts": 50,
"src/renderer/src/lib/structured-chat-tab-index.test.ts": 27,
"src/renderer/src/lib/syntax-highlighting/incremental-syntax-tokenizer.test.ts": 711,
"src/renderer/src/lib/syntax-highlighting/syntax-highlight-scheduler.test.ts": 133,
@@ -16,7 +16,7 @@ vi.mock('@/store', () => ({ useAppStore: { getState: mocks.getState } }))
vi.mock('@/lib/activate-tab-and-focus-pane', () => ({
activateTabAndFocusPane: mocks.activateTabAndFocusPane
}))
vi.mock('@/lib/structured-agent-session-tab-activation', () => ({
vi.mock('@/lib/agent-session/structured-agent-session-tab-activation', () => ({
activateStructuredAgentSessionTab: mocks.activateStructuredAgentSessionTab
}))
vi.mock('@/lib/worktree-activation', () => ({
@@ -1,6 +1,6 @@
import { activateTabAndFocusPane } from '@/lib/activate-tab-and-focus-pane'
import { revealFloatingWorkspacePanel } from '@/lib/floating-workspace-panel-reveal'
import { activateStructuredAgentSessionTab } from '@/lib/structured-agent-session-tab-activation'
import { activateStructuredAgentSessionTab } from '@/lib/agent-session/structured-agent-session-tab-activation'
import { activateAndRevealWorkspace } from '@/lib/worktree-activation'
import { jumpToWorktreeFromSidebar } from '@/lib/worktree-jump-navigation'
import { useAppStore } from '@/store'
@@ -15,7 +15,7 @@ vi.mock('@/lib/activate-tab-and-focus-pane', () => ({ activateTabAndFocusPane: v
vi.mock('@/lib/activate-ai-vault-structured-session', () => ({
activateAiVaultStructuredSession: vi.fn()
}))
vi.mock('@/lib/structured-agent-session-tab-activation', () => ({
vi.mock('@/lib/agent-session/structured-agent-session-tab-activation', () => ({
findStructuredAgentSessionTab: vi.fn(() => null)
}))
vi.mock('sonner', () => ({ toast: { error: mocks.toastError } }))
@@ -6,7 +6,7 @@ import { activateAndRevealWorkspace } from '@/lib/worktree-activation'
import { findFolderWorkspaceOwner } from '@/lib/folder-workspace-runtime-owner'
import { useAppStore } from '@/store'
import { activateAiVaultStructuredSession } from '@/lib/activate-ai-vault-structured-session'
import { findStructuredAgentSessionTab } from '@/lib/structured-agent-session-tab-activation'
import { findStructuredAgentSessionTab } from '@/lib/agent-session/structured-agent-session-tab-activation'
import type { AgentStatusState } from '../../../../shared/agent-status-types'
import type { AiVaultSession } from '../../../../shared/ai-vault-types'
import { translate } from '@/i18n/i18n'
@@ -21,7 +21,7 @@ const mocks = vi.hoisted(() => ({
activeWorktreeId: 'other-worktree'
}))
vi.mock('@/lib/structured-agent-session-provisional-tab', () => ({
vi.mock('@/lib/agent-session/structured-agent-session-provisional-tab', () => ({
beginStructuredAgentSessionProvisionalLaunch: mocks.beginStructuredAgentSessionProvisionalLaunch,
structuredLaunchOwner: () => ({ executionHostId: 'local', target: { kind: 'local' } })
}))
@@ -15,7 +15,7 @@ import { activateAndRevealWorkspace } from '@/lib/worktree-activation'
import {
beginStructuredAgentSessionProvisionalLaunch,
structuredLaunchOwner
} from '@/lib/structured-agent-session-provisional-tab'
} from '@/lib/agent-session/structured-agent-session-provisional-tab'
import { admitStructuredLaunchOnHost } from '@/lib/structured-agent-session-host-admission'
import { toRuntimeWorktreeSelector } from '@/runtime/runtime-worktree-selector'
import { cliConversationExitGuidance } from '@/lib/cli-conversation-exit-guidance'
@@ -136,7 +136,7 @@ vi.mock('../terminal-pane/stale-agent-row', () => ({
dismissStaleAgentRowByKey: staleAgentRowMocks.dismissStaleAgentRowByKey
}))
vi.mock('@/lib/structured-agent-session-tab-activation', () => ({
vi.mock('@/lib/agent-session/structured-agent-session-tab-activation', () => ({
activateStructuredAgentSessionTab: structuredActivationMocks.activateStructuredAgentSessionTab
}))
@@ -27,7 +27,7 @@ import { DEFAULT_AGENT_ACTIVITY_DISPLAY_MODE } from '../../../../shared/constant
import { revealElementInScrollContainer } from './worktree-sidebar-reveal'
import { useWorktreeAgentExpansionState } from './worktree-card-agents-expansion-state'
import { translate } from '@/i18n/i18n'
import { activateStructuredAgentSessionTab } from '@/lib/structured-agent-session-tab-activation'
import { activateStructuredAgentSessionTab } from '@/lib/agent-session/structured-agent-session-tab-activation'
import { selectAgentRowsUnread } from './worktree-card-agent-ack-inputs'
export const SUPPRESS_WORKTREE_LIST_SCROLL_ADJUSTMENT_EVENT =
@@ -21,7 +21,7 @@ import {
} from '@/lib/agent-session-launch-plan'
import type { AgentLaunchChoice } from '@/lib/agent-menu-selection'
import { newAgentLaunchRequestId } from '@/lib/agent-launch-request-id'
import { beginStructuredAgentSessionProvisionalLaunch } from '@/lib/structured-agent-session-provisional-tab'
import { beginStructuredAgentSessionProvisionalLaunch } from '@/lib/agent-session/structured-agent-session-provisional-tab'
import { getNewWorkspaceProjectGroupHostId } from '@/lib/new-workspace-project-options'
import { useAppStore } from '@/store'
import { resolveExecutionHostAgentStartupShell } from '@/lib/execution-host-facts'
@@ -65,7 +65,7 @@ vi.mock('@/runtime/runtime-layout-client', async (importOriginal) =>
import { adoptAgentSessionLaunchVerdict } from '@/lib/agent-session-launch-plan'
import { newAgentLaunchRequestId } from '@/lib/agent-launch-request-id'
import { beginStructuredAgentSessionProvisionalLaunch } from '@/lib/structured-agent-session-provisional-tab'
import { beginStructuredAgentSessionProvisionalLaunch } from '@/lib/agent-session/structured-agent-session-provisional-tab'
import {
getStructuredAgentSessionLaunchLifecycle,
retryStructuredAgentSessionLaunch
@@ -2,7 +2,7 @@ import { useSyncExternalStore } from 'react'
import { useAppStore } from '@/store'
import { newAgentLaunchRequestId } from '@/lib/agent-launch-request-id'
import { adoptAgentSessionLaunchVerdict } from '@/lib/agent-session-launch-plan'
import { beginStructuredAgentSessionProvisionalLaunch } from '@/lib/structured-agent-session-provisional-tab'
import { beginStructuredAgentSessionProvisionalLaunch } from '@/lib/agent-session/structured-agent-session-provisional-tab'
import { supportsStructuredAgentSessionCliSource } from '@/runtime/structured-agent-session-client'
import { structuredAgentSessionTargetForHost } from '@/runtime/structured-agent-session-owner'
import { waitForPromiseWithSignal } from '../../../../shared/abort-signal-reason'
@@ -7,7 +7,7 @@ import { activateWebRuntimeSessionTab } from '../../runtime/web-runtime-session-
import { isWebRuntimeSessionActive } from '../../runtime/web-runtime-session-environment'
import { runtimeEnvironmentIdOrLocalUnlessTwin } from '@/lib/worktree-runtime-owner'
import { browserWorkspaceHasRemoteOwner } from '@/runtime/remote-browser-tab-ownership'
import { activateStructuredAgentSessionTab } from '@/lib/structured-agent-session-tab-activation'
import { activateStructuredAgentSessionTab } from '@/lib/agent-session/structured-agent-session-tab-activation'
import type { TabGroupWorktreeSnapshot } from './useTabGroupItemProjections'
export function useTabGroupActivationCommands({
@@ -60,7 +60,7 @@ vi.mock('@/runtime/runtime-rpc-client', async (importOriginal) =>
)
import { useTerminalWatcherEffects } from '../use-terminal-watcher-effects'
import { beginStructuredAgentSessionProvisionalLaunch } from '@/lib/structured-agent-session-provisional-tab'
import { beginStructuredAgentSessionProvisionalLaunch } from '@/lib/agent-session/structured-agent-session-provisional-tab'
import { isEmptyWorkspaceDefaultSurfacePending } from '@/lib/empty-workspace-default-surface-claims'
import type { AgentSessionLaunchPlan } from '@/lib/agent-session-launch-plan'
import type { Tab } from '../../../../shared/tab-types'
@@ -2,7 +2,7 @@ import { toast } from 'sonner'
import type { AiVaultSession } from '../../../shared/ai-vault-types'
import { translate } from '@/i18n/i18n'
import { activateAndRevealWorktree } from './worktree-activation'
import { activateStructuredAgentSessionById } from './structured-agent-session-tab-activation'
import { activateStructuredAgentSessionById } from './agent-session/structured-agent-session-tab-activation'
import { useAppStore } from '@/store'
import { runtimeEnvironmentIdOrLocalUnlessTwin } from './worktree-runtime-owner'
import { callRuntimeRpc, runtimeEnvironmentSupportsCapability } from '@/runtime/runtime-rpc-client'
@@ -1,31 +1,31 @@
// @vitest-environment happy-dom
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { useAppStore } from '@/store'
import type * as launchModule from './launch-structured-agent-session'
import type { AgentSessionLaunchPlan } from './agent-session-launch-plan'
import { adoptAgentSessionLaunchVerdict } from './agent-session-launch-plan'
import { useAppStore } from '@/store/index'
import type * as launchModule from '../structured-agent-session-launch-create-call'
import type { AgentSessionLaunchPlan } from '../agent-session-launch-plan'
import { adoptAgentSessionLaunchVerdict } from '../agent-session-launch-plan'
import { beginStructuredAgentSessionProvisionalLaunch } from './structured-agent-session-provisional-tab'
import { StructuredAgentSessionCreateRefusalError } from './structured-agent-session-launch-errors'
import { StructuredAgentSessionCreateRefusalError } from '../structured-agent-session-launch-errors'
import { act, renderHook } from '@testing-library/react'
import { useNativeChatProvisionalLaunch } from '@/components/native-chat/use-native-chat-provisional-launch'
import {
getStructuredAgentSessionLaunchFailure,
resetStructuredAgentLaunchRegistryForTests
} from './structured-agent-session-launch-registry'
} from '../structured-agent-session-launch-registry'
import { structuredSessionNotices } from '@/components/native-chat/native-chat-structured-session-notices'
import type { AgentTerminalLaunchCompletion } from './structured-agent-session-launch-admission'
import type { AgentTerminalLaunchCompletion } from '../structured-agent-session-launch-admission'
import {
addNativeChatPendingAttachment,
clearNativeChatPendingAttachmentsForTests
} from '@/components/native-chat/native-chat-pending-attachment-cache'
import { applyStructuredSessionTabSnapshots } from '@/runtime/local-structured-session-tabs-sync/snapshot-apply'
import { makeEmptyHostSnapshot } from '@/runtime/host-session-mirror-frame-fixtures'
import * as unlisted from './structured-agent-session-unlisted-created-chats'
import * as unlisted from '../structured-agent-session-unlisted-created-chats'
import { buildFullWorktreePurgeState } from '@/store/slices/worktrees/teardown/worktree-purge-state'
import type { TerminalTab } from '../../../shared/terminal-tab-types'
import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../shared/layout-owner-switch'
import type { TerminalTab } from '../../../../shared/terminal-tab-types'
import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/layout-owner-switch'
import { sendLayoutCommandToOwner } from '@/runtime/layout-owner-command'
import { structuredAgentSessionTabId } from '../../../shared/structured-agent-session-projection'
import { structuredAgentSessionTabId } from '../../../../shared/structured-agent-session-projection'
import {
drawTabsFromMain,
type TabsDrawnFromMain
@@ -44,12 +44,12 @@ vi.mock('@/runtime/runtime-layout-client', async (importOriginal) =>
)
const mocks = vi.hoisted(() => ({ text: '', focus: vi.fn(), toast: vi.fn(), launch: vi.fn() }))
vi.mock('./launch-structured-agent-session', async (original) => ({
vi.mock('../structured-agent-session-launch-create-call', async (original) => ({
...(await original<typeof launchModule>()),
launchStructuredAgentSession: mocks.launch
}))
vi.mock('sonner', () => ({ toast: { info: mocks.toast, error: vi.fn() } }))
vi.mock('./focus-terminal-tab-surface', () => ({ focusTerminalTabSurface: vi.fn() }))
vi.mock('../focus-terminal-tab-surface', () => ({ focusTerminalTabSurface: vi.fn() }))
vi.mock('@/components/native-chat/native-chat-composer-draft-store', () => ({
readNativeChatComposerDraft: () => ({ text: mocks.text, images: [] }),
resolveNativeChatComposerDraftOwner: () => undefined,
@@ -7,8 +7,8 @@ import type {
StructuredAgentLaunchHandle,
StructuredAgentLaunchHooks
} from '@/lib/structured-agent-launch-settlement'
import { useAppStore } from '@/store'
import type { ExecutionHostId } from '../../../shared/execution-host'
import { useAppStore } from '@/store/index'
import type { ExecutionHostId } from '../../../../shared/execution-host'
import {
beginHostAdmittedStructuredLaunch,
type DeclinedStructuredLaunchTerminalOptions,
@@ -19,19 +19,18 @@ import {
resolveStructuredAgentSessionOwner,
structuredAgentSessionTargetForHost
} from '@/runtime/structured-agent-session-owner'
import type { RuntimeClientTarget } from '../../../shared/runtime-client-target'
import type { RuntimeClientTarget } from '../../../../shared/runtime-client-target'
import {
openTerminalForDeclinedChat,
openDeclinedTerminal,
opensAtAction
} from './structured-agent-session-action-launch'
import { holdEmptyWorkspaceDefaultSurfaceForLaunch } from './empty-workspace-default-surface-claims'
import type { OpenedAgentSessionTab } from './structured-agent-session-tab-open-through-layout-owner'
} from '../structured-agent-session-action-launch'
import { holdEmptyWorkspaceDefaultSurfaceForLaunch } from '../empty-workspace-default-surface-claims'
import type { OpenedAgentSessionTab } from '../structured-agent-session-tab-open-through-layout-owner'
import {
captureStructuredLaunchSurfaceAddress,
openStructuredAgentSessionProvisionalTab
} from './structured-agent-session-launch-surface'
export { openStructuredAgentSessionProvisionalTab } from './structured-agent-session-launch-surface'
} from '../structured-agent-session-launch-surface'
type LocalProvisionalLaunch = StructuredAgentLaunchHandle & { tab: OpenedAgentSessionTab }
@@ -1,5 +1,5 @@
import { beforeEach, describe, expect, it, vi } from 'vitest'
import type { Tab } from '../../../shared/tab-types'
import type { Tab } from '../../../../shared/tab-types'
const mocks = vi.hoisted(() => ({
activateTab: vi.fn(),
@@ -10,7 +10,7 @@ const mocks = vi.hoisted(() => ({
state: { unifiedTabsByWorktree: {} } as Record<string, unknown>
}))
vi.mock('@/store', () => ({
vi.mock('@/store/index', () => ({
useAppStore: { getState: () => mocks.state }
}))
@@ -18,7 +18,7 @@ vi.mock('@/components/native-chat/use-native-chat-composer-reveal-focus', () =>
requestNativeChatComposerFocus: mocks.requestNativeChatComposerFocus
}))
vi.mock('./worktree-runtime-owner', () => ({
vi.mock('../worktree-runtime-owner', () => ({
runtimeEnvironmentIdOrLocalUnlessTwin: () => 'env-1'
}))
@@ -1,15 +1,15 @@
import { runtimeEnvironmentIdOrLocalUnlessTwin } from './worktree-runtime-owner'
import { runtimeEnvironmentIdOrLocalUnlessTwin } from '../worktree-runtime-owner'
import { requestNativeChatComposerFocus } from '@/components/native-chat/use-native-chat-composer-reveal-focus'
import { useAppStore } from '@/store'
import { useAppStore } from '@/store/index'
import { callRuntimeRpc } from '@/runtime/runtime-rpc-client'
import type { RuntimeClientTarget } from '../../../shared/runtime-client-target'
import type { RuntimeClientTarget } from '../../../../shared/runtime-client-target'
import { runtimeTargetForOwnerEnvironment } from '@/runtime/runtime-client-target'
import {
executionHostIdForStructuredTarget,
structuredAgentSessionOwnerForTab
} from '@/runtime/structured-agent-session-owner'
import { toRuntimeWorktreeSelector } from '@/runtime/runtime-worktree-selector'
import type { Tab } from '../../../shared/tab-types'
import type { Tab } from '../../../../shared/tab-types'
export function findStructuredAgentSessionTab(
unifiedTabsByWorktree: Readonly<Record<string, readonly Tab[]>>,
@@ -6,7 +6,7 @@ import type { AgentLaunchSurface, LaunchAgentInNewTabArgs } from '@/lib/launch-a
import type { StructuredAgentLaunchSettlement } from '@/lib/structured-agent-launch-settlement'
import type { StructuredPromptDeliveryResult } from '@/lib/structured-agent-session-launch-prompt'
import type { StructuredLaunchTerminal } from '@/lib/structured-agent-session-launch-admission'
import { beginStructuredAgentSessionProvisionalLaunch } from '@/lib/structured-agent-session-provisional-tab'
import { beginStructuredAgentSessionProvisionalLaunch } from '@/lib/agent-session/structured-agent-session-provisional-tab'
import type { NativeChatComposerFocusIntent } from '@/components/native-chat/use-native-chat-composer-reveal-focus'
type StructuredFromNewTab = {
@@ -8,7 +8,7 @@ const mocks = vi.hoisted(() => ({
vi.fn<(args: BeginArgs) => { sessionId: string; tab: { id: string } } | null>()
}))
vi.mock('@/lib/structured-agent-session-provisional-tab', () => ({
vi.mock('@/lib/agent-session/structured-agent-session-provisional-tab', () => ({
beginStructuredAgentSessionProvisionalLaunch: mocks.beginStructuredAgentSessionProvisionalLaunch
}))
@@ -12,7 +12,7 @@ import {
resolveExecutionHostAgentStartupShell,
type KnownExecutionHostPlatform
} from '@/lib/execution-host-facts'
import { beginStructuredAgentSessionProvisionalLaunch } from '@/lib/structured-agent-session-provisional-tab'
import { beginStructuredAgentSessionProvisionalLaunch } from '@/lib/agent-session/structured-agent-session-provisional-tab'
import type { DeclinedStructuredLaunchTerminalOptions } from '@/lib/structured-agent-session-launch-admission'
import {
ensureDetectedAgentsForNewWorktree,
@@ -15,7 +15,7 @@ import {
type OnboardingFolderAgentStartup
} from '@/lib/onboarding-folder-agent-startup'
import { activateAndRevealWorktree } from '@/lib/worktree-activation'
import { beginStructuredAgentSessionProvisionalLaunch } from '@/lib/structured-agent-session-provisional-tab'
import { beginStructuredAgentSessionProvisionalLaunch } from '@/lib/agent-session/structured-agent-session-provisional-tab'
export type OnboardingFolderAgentLaunch = {
agent: TuiAgent | null
@@ -7,7 +7,7 @@ import {
import { focusTerminalTabSurface } from './focus-terminal-tab-surface'
import type { Tab } from '../../../shared/tab-types'
import type { StructuredAgentLaunchSettlement } from '@/lib/structured-agent-launch-settlement'
import type { ProvisionalLaunchArgs } from './structured-agent-session-provisional-tab'
import type { ProvisionalLaunchArgs } from './agent-session/structured-agent-session-provisional-tab'
import { insertUnifiedTabAfterAnchor } from './unified-tab-anchor-insertion'
import { useAppStore } from '@/store'
import type { OpenedAgentSessionTab } from './structured-agent-session-tab-open-through-layout-owner'
@@ -43,7 +43,7 @@ vi.mock('@/runtime/runtime-layout-client', async (importOriginal) =>
import { useAppStore } from '@/store'
import { adoptAgentSessionLaunchVerdict } from './agent-session-launch-plan'
import { beginStructuredAgentSessionProvisionalLaunch } from './structured-agent-session-provisional-tab'
import { beginStructuredAgentSessionProvisionalLaunch } from './agent-session/structured-agent-session-provisional-tab'
import { beginDirectWorkItemStructuredLaunch } from './launch-work-item-direct-agent-routing'
import { getStructuredAgentLaunchStatus } from './structured-agent-session-launch-status'
import { getStructuredAgentSessionLaunchSelection } from './structured-agent-session-launch-options'
@@ -161,7 +161,7 @@ import { adoptAgentSessionLaunchVerdict } from './agent-session-launch-plan'
import {
beginStructuredAgentSessionProvisionalLaunch,
type StructuredAgentSessionProvisionalLaunch
} from './structured-agent-session-provisional-tab'
} from './agent-session/structured-agent-session-provisional-tab'
import { getStructuredAgentSessionLaunchLifecycle } from './structured-agent-session-launch'
import {
discardStructuredLaunchPrompts,
@@ -38,7 +38,7 @@ vi.mock('@/store', () => ({
})
}))
vi.mock('@/lib/structured-agent-session-provisional-tab', () => ({
vi.mock('@/lib/agent-session/structured-agent-session-provisional-tab', () => ({
beginStructuredAgentSessionProvisionalLaunch: mocks.beginStructuredAgentSessionProvisionalLaunch
}))
@@ -3,7 +3,7 @@ import { activateAndRevealWorktree, type ActivateAndRevealResult } from '@/lib/w
import { adoptAgentSessionLaunchVerdict } from '@/lib/agent-session-launch-plan'
import type { AgentLaunchRoute } from '@/lib/agent-launch-routing'
import type { WorktreeCreationRequest } from '@/lib/pending-worktree-creation'
import { beginStructuredAgentSessionProvisionalLaunch } from '@/lib/structured-agent-session-provisional-tab'
import { beginStructuredAgentSessionProvisionalLaunch } from '@/lib/agent-session/structured-agent-session-provisional-tab'
import type { StructuredLaunchTerminal } from '@/lib/structured-agent-session-launch-admission'
import { buildWorktreeCreationStartupOpt } from '@/lib/worktree-creation-flow-startup'
import { ensureWebRuntimeWorktreeTerminalAfterWake } from '@/lib/web-runtime-worktree-terminal-after-wake'
@@ -40,7 +40,7 @@ vi.mock('@/lib/agent-status', async (importOriginal) => {
createStoreCascadesMockApi()
import { ensureSimulatorTab } from '@/lib/ensure-simulator-tab'
import { openStructuredAgentSessionProvisionalTab } from '@/lib/structured-agent-session-provisional-tab'
import { openStructuredAgentSessionProvisionalTab } from '@/lib/structured-agent-session-launch-surface'
import { applyStructuredSessionTabSnapshots } from '@/runtime/local-structured-session-tabs-sync/snapshot-apply'
import { resetLocalStructuredSessionVersionForTests } from '@/runtime/local-structured-session-tabs-sync/inventory-generation-fence'
@@ -46,7 +46,7 @@ vi.mock('sonner', () => ({
createStoreCascadesMockApi()
import { openStructuredAgentSessionProvisionalTab } from '@/lib/structured-agent-session-provisional-tab'
import { openStructuredAgentSessionProvisionalTab } from '@/lib/structured-agent-session-launch-surface'
import { resolveStructuredAgentSessionOwner } from '@/runtime/structured-agent-session-owner'
const SERVER = 'server-1'