Files
orca/src/shared/project-group-setup-example.ts
T
Brennan Benson 03c828eece Run setup scripts for project group folder workspaces (#41744)
* Add setup scripts for project group folder workspaces

* Align setup regression fixtures and catalog read validation

* Target the Advanced disclosure in group setup regression

* test: initialize project groups in worktree slice fixture

* Preserve group setup startup input across paired hosts

* Check paired group startup regression in cross-layer project

* Restore group setup settings when saving fails

* Wait for group agents to accept startup input

* Type the group startup readiness fixture foreground state

* Give group startup fixture mocks portable public types

* Reuse worktree startup for group folder setup

* Keep example shell regression while removing obsolete observer tests

* Complete launch runtime fixture PTY options

* Exercise terminal startup failure and worktree draft paste in parity tests

* Preserve repository type defaults for setup commands
2026-11-13 15:37:54 -08:00

21 lines
911 B
TypeScript

import type { Repo } from './repo-types'
import { quoteStartupArg } from './agent-launch/startup/tui-agent-startup-shell'
export function projectGroupSetupExample(
repos: readonly Pick<Repo, 'id' | 'displayName'>[],
platform: NodeJS.Platform
): string {
const windows = platform === 'win32'
const comment = windows ? 'REM' : '#'
const shell = windows ? 'cmd' : 'posix'
const command = windows ? 'orca' : '"${ORCA_CLI_COMMAND:-orca}"'
const workspaceName = windows ? '"%ORCA_WORKSPACE_NAME%"' : '"$ORCA_WORKSPACE_NAME"'
return [
`${comment} Repo IDs are local to this machine; review them before sharing this script.`,
...repos.flatMap((repo) => [
`${comment} ${repo.displayName.replace(windows ? /[^\p{L}\p{N} ._/-]/gu : /[\r\n]/g, ' ')}`,
`${command} worktree create --repo ${quoteStartupArg(`id:${repo.id}`, shell)} --name ${workspaceName} --json`
])
].join('\n')
}