mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
* 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
25 lines
1.0 KiB
TypeScript
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)
|
|
}
|
|
}
|