Files
archived-orca/src/shared/workspace-setup/setup-script-import-cursor-environment.ts
T
Neil 83a2d506b2 feat(setup): import setup scripts from .conductor/settings.toml, dev containers, Cursor, Copilot and Capy configs (#40125)
* feat(setup): import setup scripts from more workspace config formats

* fix(setup): isolate imported Copilot steps and harden config parsing

* chore(setup): drop type assertions flagged by the quality gate

* fix(setup): keep the orcad bundle ASCII and skip unrewritable dev container variables
2026-11-08 21:26:03 -08:00

25 lines
1.0 KiB
TypeScript

import type { SetupScriptImportCandidate, SetupScriptImportFileRead } from './setup-script-imports'
import { normalizeSetupScriptImportCommand } from './setup-script-import-command-limits'
import { collectPresentFields, parseJsoncObject } from './setup-script-import-parsers'
const CURSOR_ENVIRONMENT_PATH = '.cursor/environment.json'
// Boot commands, terminals and image sources describe the cloud machine, not per-workspace setup.
const UNSUPPORTED_FIELDS = ['start', 'terminals', 'build', 'image', 'snapshot'] as const
export async function inspectCursorEnvironmentConfig(
readFile: SetupScriptImportFileRead
): Promise<SetupScriptImportCandidate | null> {
const config = parseJsoncObject(await readFile(CURSOR_ENVIRONMENT_PATH))
const setup = config ? normalizeSetupScriptImportCommand(config.install) : ''
if (!config || !setup) {
return null
}
return {
provider: 'cursor',
label: 'Cursor',
files: [CURSOR_ENVIRONMENT_PATH],
setup,
unsupportedFields: collectPresentFields(config, UNSUPPORTED_FIELDS)
}
}