mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
* fix: avoid blank shells beside new workspace chats * Carry promised agent chat through worktree creation * Use live agent launch inventory for new workspace surfaces * Type live agent launch owner from runtime contract * Assert one recovery shell after failed agent launch * Keep worktree activation adapters out of creation flow * Restore ordinary workspace setup handoff after launch correction * Cover the phone's agent.launch workspace create in the first-surface flow test
45 lines
1.6 KiB
TypeScript
45 lines
1.6 KiB
TypeScript
import type { RuntimeNavigationTarget } from '../../../shared/runtime-navigation'
|
|
import type { CreateWorktreeResult } from '../../../shared/worktree/create-types'
|
|
import type { WorktreeStartupLaunch } from '../../../shared/worktree/launch-types'
|
|
import type { createRuntimeFolderWorktree } from '../runtime-folder-worktree-create'
|
|
import type { startRuntimeLocalWorktreeTerminals } from '../runtime-local-worktree-terminal-startup'
|
|
|
|
type FolderActivation = Parameters<typeof createRuntimeFolderWorktree>[0]['deps']['activate']
|
|
type LocalActivation = Parameters<typeof startRuntimeLocalWorktreeTerminals>[0]['ports']['activate']
|
|
|
|
type NotifyActivation = (
|
|
repoId: string,
|
|
worktreeId: string,
|
|
setup?: CreateWorktreeResult['setup'],
|
|
startup?: WorktreeStartupLaunch,
|
|
defaultTabs?: CreateWorktreeResult['defaultTabs'],
|
|
navigation?: RuntimeNavigationTarget,
|
|
providesInitialSurface?: boolean
|
|
) => void
|
|
|
|
export function createdWorkspaceActivationCallbacks(
|
|
notify: NotifyActivation,
|
|
navigation?: RuntimeNavigationTarget
|
|
): { folder: FolderActivation; local: LocalActivation } {
|
|
const folder: FolderActivation = (repoId, worktreeId, setup, startup, providesInitialSurface) =>
|
|
notify(repoId, worktreeId, setup, startup, undefined, navigation, providesInitialSurface)
|
|
const local: LocalActivation = (
|
|
repoId,
|
|
worktreeId,
|
|
startup,
|
|
failedSetup,
|
|
failedDefaultTabs,
|
|
providesInitialSurface
|
|
) =>
|
|
notify(
|
|
repoId,
|
|
worktreeId,
|
|
failedSetup,
|
|
startup,
|
|
failedDefaultTabs,
|
|
navigation,
|
|
providesInitialSurface
|
|
)
|
|
return { folder, local }
|
|
}
|