export type WorkspaceManifestSchemaVersion = 'dx-workspace/v1' | 'nexus-project/v2' | 'workspace-template/v1'; export type WorkspaceSourceRootKind = 'metadata-runtime' | 'code-extension' | 'local-package'; export interface WorkspaceSourceRootDefinition { path: string; kind: WorkspaceSourceRootKind; writeTarget?: boolean; metadataKinds?: string[]; sourceOfTruthMode?: 'source-wins' | 'runtime-wins' | 'require-explicit'; orphanPolicy?: 'delete' | 'keep' | 'prompt'; } export interface WorkspacePackageRef { packageName: string; version?: string; packageType?: string; source?: 'local' | 'registry' | 'workspace'; directory?: string; } export interface WorkspaceLocalPackageRef { name: string; path: string; packageClass?: 'metadata' | 'seed-data' | 'asset' | 'code-extension'; } export interface WorkspaceRegistryDescriptor { url?: string; channel?: string; rootDirectory?: string; } export interface WorkspaceEnvironmentRef { name: string; path: string; } export interface WorkspaceManifestV1 { schemaVersion: WorkspaceManifestSchemaVersion; projectName: string; apiVersion?: string; compatibleCoreVersion: string; packageDirectories?: Array<{ path: string; default?: boolean; }>; sourceRoot?: string; sourceRoots: WorkspaceSourceRootDefinition[]; localPackages: WorkspaceLocalPackageRef[]; registry?: WorkspaceRegistryDescriptor; defaultOrg?: string; defaultEnvironment?: string; environments: WorkspaceEnvironmentRef[]; packageRefs?: Array; starterTemplate?: string; features?: Record; } export interface EnvironmentPackageStack { baseline: WorkspacePackageRef; genericOverlay?: WorkspacePackageRef | null; industryOverlay?: WorkspacePackageRef | null; extensionPacks?: WorkspacePackageRef[]; demoPack?: WorkspacePackageRef | null; environmentProfile?: WorkspacePackageRef | null; } export interface EnvironmentDescriptorV1 { schemaVersion: 'dx-environment/v1'; name: string; type: 'dev-sandbox' | 'uat-sandbox' | 'prod-install' | 'custom'; target: { workspaceId?: string; orgAlias?: string; sandboxId?: string; installMode?: 'workspace' | 'sandbox' | 'production'; }; releaseChannel?: string; packageStack: EnvironmentPackageStack; codePackages?: WorkspacePackageRef[]; runtimePolicyRef?: string; installPolicy?: { validateBeforeApply?: boolean; allowDestructiveChanges?: boolean; rebuildSourceBaseline?: boolean; }; promotePolicy?: { sandboxId?: string; promoteFrontend?: boolean; promoteBackend?: boolean; reason?: string; sourceEnvironment?: string; allowPartialFailure?: boolean; }; } export interface WorkspaceContractLoadResult { workspaceRoot: string; manifestPath: string; format: 'json' | 'yaml'; migrated: boolean; warnings: string[]; manifest: WorkspaceManifestV1; } export declare const NEXUS_APP_SOURCE_ROOT = "nexus-app/main/default"; export declare const NEXUS_APP_METADATA_ROOTS: string[]; export declare const NEXUS_APP_REQUIRED_ROOTS: string[]; export declare function findWorkspaceRoot(startDir?: string): string; export declare function getWorkspaceManifestPath(startDir?: string): string | null; export declare function validateWorkspaceManifest(manifest: WorkspaceManifestV1): { valid: boolean; errors: string[]; warnings: string[]; }; export type WorkspaceSourceLayoutDiagnosticCode = 'SOURCE_ROOT_MISSING' | 'SOURCE_REQUIRED_DIRECTORY_MISSING' | 'SOURCE_ROOT_DUPLICATE_TRUTH' | 'SOURCE_TAXONOMY_UNKNOWN' | 'SOURCE_LEGACY_TAXONOMY' | 'SOURCE_PATH_CASE_COLLISION' | 'SOURCE_PATH_ESCAPE' | 'SOURCE_PATH_HARDLINK' | 'GENERATED_FILE_IN_SOURCE_ROOT' | 'EMPLOYEE_IDENTITY_MISMATCH' | 'EMPLOYEE_SOURCE_INCOMPLETE'; export interface WorkspaceSourceLayoutDiagnostic { severity: 'error'; code: WorkspaceSourceLayoutDiagnosticCode; path: string; message: string; relatedPaths?: string[]; } export declare function findCaseCollidingPaths(sourcePaths: string[]): string[][]; export declare function validateWorkspaceSourceLayout(workspaceRoot: string, manifest: WorkspaceManifestV1): { valid: boolean; errors: string[]; warnings: string[]; diagnostics: WorkspaceSourceLayoutDiagnostic[]; }; export declare function loadWorkspaceManifest(startDir?: string): WorkspaceContractLoadResult; export declare function renderWorkspaceManifestYaml(manifest: WorkspaceManifestV1): string; export declare function saveWorkspaceManifest(workspaceRoot: string, manifest: WorkspaceManifestV1, preferredFormat?: 'json' | 'yaml'): void; export interface ManifestDriftResult { inSync: boolean; yamlMissing: boolean; jsonMissing: boolean; message: string; } export declare function checkManifestSingleSource(workspaceRoot: string): ManifestDriftResult; export declare function syncWorkspaceManifestJson(workspaceRoot: string): { yamlPath: string; jsonPath: string; }; export declare function upsertWorkspacePackageRef(startDir: string, packageRef: WorkspacePackageRef): WorkspaceManifestV1; export declare function removeWorkspacePackageRef(startDir: string, packageName: string): WorkspaceManifestV1; export declare function getMetadataSourceRoots(startDir?: string): WorkspaceSourceRootDefinition[]; export declare function getCodeSourceRoots(startDir?: string): WorkspaceSourceRootDefinition[]; export declare function resolvePreferredMetadataRoot(startDir?: string): WorkspaceSourceRootDefinition; export declare function resolvePhysicalSourcePath(workspaceRoot: string, trackedPath: string, preferredRoot?: WorkspaceSourceRootDefinition): string; export declare function normalizeTrackedMetadataPath(workspaceRoot: string, absolutePath: string): string | null; export declare function loadEnvironmentDescriptor(startDir?: string, environmentNameOrPath?: string): { descriptorPath: string; descriptor: EnvironmentDescriptorV1; }; export declare function validateEnvironmentDescriptor(descriptor: EnvironmentDescriptorV1): { valid: boolean; errors: string[]; warnings: string[]; };