import * as platform from 'platform';
import { runDeferredInit } from './deferred_init.js';
import { startMdmRawRead, startKeychainPrefetch, startProjectScan } from './prefetch.js';
export function buildWorkspaceSetup() {
    return {
        pythonVersion: `${platform.version}`,
        implementation: platform.name || 'unknown',
        platformName: platform.os?.toString() || 'unknown',
        testCommand: 'npm test',
        startupSteps: [
            'start top-level prefetch side effects',
            'build workspace context',
            'load mirrored command snapshot',
            'load mirrored tool snapshot',
            'prepare parity audit hooks',
            'apply trust-gated deferred init',
        ],
    };
}
export function runSetup(cwd, trusted = true) {
    const root = cwd || process.cwd();
    return {
        setup: buildWorkspaceSetup(),
        prefetches: [startMdmRawRead(), startKeychainPrefetch(), startProjectScan(root)],
        deferredInit: runDeferredInit(trusted),
        trusted,
        cwd: root,
    };
}
export { buildWorkspaceSetup as buildSetup };
