mirror of
https://github.com/stablyai/orca.git
synced 2026-11-15 10:27:33 +00:00
23 lines
822 B
TypeScript
23 lines
822 B
TypeScript
import type { TuiAgent } from './agent-launch/catalog/tui-agent'
|
|
import type { CliWorkspaceProvenance } from './worktree/types'
|
|
|
|
/** CLI create context is descriptive; host-stamped createdAt prevents skewed client clocks changing sort order. */
|
|
export type CliWorkspaceProvenanceRequest = {
|
|
callerTerminalHandle?: string
|
|
}
|
|
|
|
export function buildCliWorkspaceProvenance(
|
|
request: CliWorkspaceProvenanceRequest | undefined,
|
|
options: { startupAgent?: TuiAgent; createdAt: number }
|
|
): CliWorkspaceProvenance | undefined {
|
|
if (!request) {
|
|
return undefined
|
|
}
|
|
return {
|
|
kind: 'created-by-cli',
|
|
createdAt: options.createdAt,
|
|
...(request.callerTerminalHandle ? { callerTerminalHandle: request.callerTerminalHandle } : {}),
|
|
...(options.startupAgent ? { startupAgent: options.startupAgent } : {})
|
|
}
|
|
}
|