import type { AiAuthoringContextLockV2, AiAuthoringContextSnapshotV2, AiAuthoringContextVerificationV1, AiContextSigningKeySetV1, DescribeAiAuthoringContextRequestV2, SignAiAuthoringContextLockRequestV2, ValidateExecutablePackageArtifactInputV1, ValidateExecutablePackageArtifactResultV1, VerifyAiAuthoringContextFreshnessRequestV2, WorkforceBundleSourceLockV1 } from '@nexusclaw/shared'; export interface CreateExecutablePackageUploadSessionInput { readonly schemaVersion: 'nexusclaw.create-executable-package-upload-session-input/v1'; readonly targetWorkspaceId: string; readonly archiveFormat: 'zip-store-v1'; readonly archiveDigest: `sha256:${string}`; readonly packageDigest: `sha256:${string}`; readonly archiveSizeBytes: number; readonly fileCount: number; readonly declaredSurfaces: ReadonlyArray<'config' | 'code' | 'flow' | 'employee'>; } export interface ExecutablePackageUploadSession { readonly uploadSessionId: string; readonly expiresAt: string; readonly receivedBytes: number; readonly chunkSizeBytes: number; } export interface WorkforceBundleArtifactOperationInput { readonly schemaVersion: string; readonly targetWorkspaceId: string; readonly stagedArtifactId: string; readonly expectedArchiveDigest: `sha256:${string}`; readonly expectedPackageDigest: `sha256:${string}`; readonly contextManifestContentDigest: `sha256:${string}`; readonly runtimeBindingsDigest: `sha256:${string}`; readonly expectedPortableBundleDigest: `sha256:${string}`; readonly targetAgentId?: string | null; } export type WorkforceBundleLockResult = WorkforceBundleSourceLockV1; export interface WorkforceBundlePlanResult { readonly schemaVersion: 'nexusclaw.executable-workforce-bundle-plan/v1'; readonly planDigest: `sha256:${string}`; readonly releaseItemSetDigest: `sha256:${string}`; readonly sourceLockDigest: `sha256:${string}`; readonly plannedItems: ReadonlyArray<{ readonly itemKind: string; readonly canonicalKey: string; readonly checksum: `sha256:${string}`; readonly descriptorHash: `sha256:${string}` | null; }>; readonly headAtPlan: { readonly activeReleaseSetId: string | null; readonly generation: number; }; readonly lock: WorkforceBundleSourceLockV1; } export interface CandidateStageReceiptResult { readonly schemaVersion: 'nexusclaw.candidate-stage-receipt/v1'; readonly candidateReleaseSetId: string; readonly agentApiName: string; readonly eligibilityStatus: 'staged'; readonly sourceLockDigest: `sha256:${string}`; readonly releaseItemSetDigest: `sha256:${string}`; readonly materializedItemRefsDigest: `sha256:${string}`; readonly releaseEnvelopeDigest: null; readonly previousReleaseSetId: string | null; readonly headAtStage: { readonly activeReleaseSetId: string | null; readonly generation: number; }; readonly planDigest: `sha256:${string}`; } export interface CandidateReplacementStageReceiptResult { readonly schemaVersion: 'nexusclaw.candidate-replacement-stage-receipt/v1'; readonly auditId: string; readonly replacementForCandidateReleaseSetId: string; readonly candidateReleaseSetId: string; readonly agentApiName: string; readonly eligibilityStatus: 'staged'; readonly packageDigest: `sha256:${string}`; readonly requestedPackageDigest: `sha256:${string}`; readonly sourceLockDigest: `sha256:${string}`; readonly releaseItemSetDigest: `sha256:${string}`; readonly materializedItemRefsDigest: `sha256:${string}`; readonly headAtStage: { readonly activeReleaseSetId: string | null; readonly generation: number; }; readonly policyVersion: string; readonly reason: string; readonly createdAt: string; readonly replayed: boolean; } export type WorkforceCandidateSelector = { readonly kind: 'action'; readonly exportId: string; readonly suites: readonly string[]; } | { readonly kind: 'flow'; readonly flowApiName: string; readonly suites: readonly string[]; } | { readonly kind: 'employee'; readonly suites: readonly string[]; }; export interface WorkforceCandidateReleaseItem { readonly itemKind: string; readonly selectorKey: string; } export interface CandidateTestRunResult { readonly evidenceRunId: string; readonly evidenceRunDigest: `sha256:${string}`; readonly status: 'PASSED' | 'FAILED' | 'ABORTED'; readonly failureCode: string | null; readonly passed: boolean; readonly refs: ReadonlyArray<{ readonly kind: string; readonly evidenceId: string; readonly digest: `sha256:${string}`; readonly producer: string; readonly createdAt: string; }>; readonly suiteResults: ReadonlyArray>; readonly isolationBindingId: string; readonly isolationSnapshotHash: `sha256:${string}`; readonly resetReceiptId: string; readonly resetReceiptDigest: `sha256:${string}`; readonly newAuthorizationGeneration: number | null; readonly observability: CandidateObservabilitySnapshot; } export interface CandidateObservabilitySnapshot { readonly schemaVersion: 'nexusclaw.candidate-observability/v1'; readonly build: { readonly coreVersion: string; readonly coreCommitSha: string; readonly cliCompatibilityVersion: string; }; readonly candidate: { readonly releaseSetId: string; readonly eligibilityStatus: string; }; readonly lifecycle: { readonly status: 'NOT_RUN' | 'RUNNING' | 'PASSED' | 'FAILED' | 'ABORTED'; readonly evidenceRunId: string | null; readonly evidenceRunDigest: `sha256:${string}` | null; readonly startedAt: string | null; readonly completedAt: string | null; readonly failureCode: string | null; readonly failureDetails: Readonly> | null; }; readonly sandbox: { readonly status: 'NOT_RUN' | 'PASSED' | 'FAILED'; readonly evidenceId: string | null; readonly evidenceDigest: `sha256:${string}` | null; readonly stages: Readonly>; }; readonly capacity: { readonly totalSlots: number; readonly readySlots: number; readonly leasedSlots: number; readonly resettingSlots: number; readonly unavailableSlots: number; }; readonly lease: { readonly status: 'NOT_ALLOCATED' | 'ACTIVE' | 'RELEASED' | 'REVOKED' | 'EXPIRED'; readonly leaseId: string | null; readonly leaseDigest: `sha256:${string}` | null; readonly released: boolean; readonly terminalAt: string | null; readonly expiresAt: string | null; }; readonly cleanup: { readonly status: 'NOT_RUN' | 'PASSED' | 'FAILED' | 'PENDING'; readonly resetReceiptId: string | null; readonly resetReceiptDigest: `sha256:${string}` | null; readonly completedAt: string | null; readonly deletedMutableCounts: Readonly>; readonly deletedMutableTotal: number; readonly failureCode: string | null; }; readonly isolation: { readonly sourceWorkspaceId: string; readonly executionWorkspaceId: string | null; readonly workspaceIsolated: boolean | null; readonly productionMutationCount: number | null; readonly passed: boolean | null; readonly bindingId: string | null; readonly bindingSnapshotHash: `sha256:${string}` | null; }; readonly runtime: { readonly providerId: string; readonly runtimeApi: string; readonly worker: string; readonly executionOwner: string; readonly readiness: Readonly>; }; readonly suites: ReadonlyArray>>; readonly evidence: ReadonlyArray<{ readonly kind: string; readonly evidenceId: string; readonly digest: `sha256:${string}`; readonly producer: string; readonly createdAt: string; }>; readonly diagnostics: ReadonlyArray<{ readonly code: string; readonly severity: 'info' | 'warning' | 'error'; readonly retryable: boolean; readonly details?: Readonly<{ [key: string]: unknown; dimension: string; callOrdinal: number; expectedOrdinal: number | null; expectedRequestDigest: string | null; actualRequestDigest: string | null; firstDivergingJsonPointer: string | null; unconsumedTailCount: number | null; }>; }>; } export interface WorkforceReleaseGateReceipt { readonly schemaVersion: string; readonly approvalId: string; readonly candidateReleaseSetId: string; readonly evidenceRunIds: readonly string[]; readonly expectedSourceLockDigest: `sha256:${string}`; readonly expectedReleaseItemSetDigest: `sha256:${string}`; readonly expectedMaterializedItemRefsDigest: `sha256:${string}`; readonly governanceContextDigest: `sha256:${string}`; readonly decision: string; readonly decisionVersion: number; readonly expiresAt: string; readonly consumedAt: string | null; readonly receiptDigest: `sha256:${string}`; } export interface WorkforceReleaseTransitionResult { readonly schemaVersion: string; readonly operation: 'promote' | 'rollback'; readonly beforeReleaseSetId: string | null; readonly afterReleaseSetId: string | null; readonly beforeGeneration: number; readonly afterGeneration: number; readonly receiptId: string; readonly outboxId: string; readonly alreadyApplied: boolean; readonly activationKind?: 'initial_promote' | 'rollback_repromote'; readonly reusedAuthorization?: boolean; readonly priorPromotionReceiptId?: string | null; readonly rollbackReceiptId?: string | null; readonly approvalId?: string | null; readonly releaseEnvelopeDigest?: `sha256:${string}` | null; } export interface SealedExecutablePackageArtifact { readonly stagedArtifactId: string; readonly status: 'sealed'; readonly archiveDigest: `sha256:${string}`; readonly packageDigest: `sha256:${string}`; readonly expiresAt: string; readonly receivedBytes: number; readonly nextOffset: number; } export interface ApiResponse { success: boolean; data?: T; error?: string; errors?: string[]; } export interface DeployResult { jobId: string; status: string; message?: string; } export interface DeployStatus { jobId: string; status: 'pending' | 'running' | 'success' | 'failed'; progress?: number; message?: string; errors?: string[]; } export interface ValidateResult { success: boolean; errors: string[]; warnings: string[]; } export interface ValidationReportIssue { code: string; severity: 'critical' | 'high' | 'medium' | 'low'; category: string; message: string; recommendation?: string; path?: string; line?: number; column?: number; componentId?: string; componentName?: string; componentType?: string; } export interface ValidationReport { schemaVersion: 'deployment-validation-report/v1'; operation: string; success: boolean; generatedAt: string; workspaceId?: string; targetEnvironment?: string; errors: ValidationReportIssue[]; warnings: ValidationReportIssue[]; suggestions: string[]; affectedComponents: Array>; compatibility?: Record; summary: { errorCount: number; warningCount: number; suggestionCount: number; affectedComponentCount: number; }; metadata?: Record; } export interface ManagedChangeSet { id: string; workspaceId: string; name: string; description?: string; sourceEnvironment: string; targetEnvironment: string; status: string; approvalRequired?: boolean; approvalStatus?: string; validationMessage?: string; createdBy?: string; createdAt: string; updatedAt: string; validatedAt?: string; deployedAt?: string; rolledBackAt?: string; metadata?: Record | null; components?: Array>; } export interface RetrieveResult { downloadUrl: string; filename: string; size: number; } export interface RuntimeSourceFile { path: string; content: string; } export interface RuntimeRenderedFile extends RuntimeSourceFile { hash: string; } export interface RuntimeValidationResult { validation: { valid: boolean; summary: string[]; }; } export interface RuntimePlanResult extends RuntimeValidationResult { dryRun?: boolean; destructiveSync?: boolean; diff: { humanSummary: string[]; summary: { objects: { created: number; updated: number; deleted: number; }; fields: { created: number; updated: number; deleted: number; }; }; }; } export interface RuntimeApplyResult { applied: boolean; dryRun: boolean; destructiveSync: boolean; beforeRevision?: string; afterRevision?: string; plan: RuntimePlanResult; } export interface RuntimeExportResult { snapshot: unknown; files: RuntimeRenderedFile[]; } export interface MetadataPackageDependency { name: string; versionRange: string; optional?: boolean; } export interface MetadataKindSupportEntry { kind: string; executionMode: string; notes?: string; } export interface CodeKindSupportEntry { kind: 'function' | 'trigger' | 'library' | 'test' | 'ui-component'; executionMode: 'sandboxed-runtime' | 'binding-only' | 'build-input' | 'workspace-only'; notes?: string; } export interface MetadataPackageManifest { schemaVersion: 'v1'; name: string; packageType: string; packageClass: 'metadata' | 'seed-data' | 'asset' | 'code-extension'; description: string; version: string; dependencies: MetadataPackageDependency[]; compatibleCoreVersion: string; installOrder: number; includedMetadataKinds: string[]; includedSeedKinds: string[]; includedCodeKinds?: Array<'function' | 'trigger' | 'library' | 'test' | 'ui-component'>; visibility: string; releaseChannel: string; kindSupport: MetadataKindSupportEntry[]; codeKindSupport?: CodeKindSupportEntry[]; runtimeProviderRequirement?: 'hardened-isolate' | 'nexusclaw-verified-isolate-v1'; codeExtensionGovernance?: { contractVersion: 'code-extension-governance/v1'; runtimeApiVersion: string; } | { contractVersion: 'code-extension-governance/v2'; runtimeApiVersion: 'runtime/v2'; }; agentToolCatalogPath?: string; trialEvidence?: { extensionRuntimeLogPath: string; dependencyReportPath: string; failedExtensionEvidencePath: string; debugAttributionPath?: string; rollbackEvidencePath?: string; trackedExtensions?: Array<{ packageName: string; extensionId: string; kind: 'function' | 'trigger'; }>; }; executableArtifacts?: Array<{ extensionId?: string; apiName: string; kind: 'function' | 'trigger'; sourcePath: string; dependsOn?: string[]; functionType?: 'ACTION'; entrypoint?: 'default'; actionContractVersion?: 'nexus-code-action/v1'; runtimeApiVersion?: 'runtime/v2'; }>; } export interface ExtensionGovernanceCheckedExtension { extensionId: string; kind: 'function' | 'trigger'; apiName: string; sourcePath: string; dependsOn: string[]; errors: string[]; warnings: string[]; } export interface ExtensionGovernanceValidationResult { schemaVersion: 'code-extension-governance-validation/v1'; status: 'passed' | 'warning' | 'failed'; packageName: string; packageVersion: string; contractVersion: string | null; runtimeApiVersion: string | null; checkedExtensions: ExtensionGovernanceCheckedExtension[]; errors: string[]; warnings: string[]; artifactRefs: string[]; evidenceRefs: string[]; comparedUpgradeFields: string[]; attributionSummary: Array<'extension' | 'runtime' | 'dependency' | 'config'>; } export interface MetadataPackageInstallPlanResult { packageNames: string[]; orderedSteps: Array<{ phase: string; packageName: string; executionTrack?: string; rollbackHint?: string; }>; warnings: string[]; summary?: string[]; dependencies?: { missingDependencies: string[]; circularDependencies?: string[]; versionConflicts?: string[]; coreVersionConflicts?: string[]; conflictSummary?: string[]; }; } export interface MetadataPackageInstallResult { packageName: string; status: string; appliedMetadataKinds: string[]; appliedSeedKinds: string[]; warnings: string[]; executionTrack?: string; installedStateId?: string; details?: Record; } export interface EmployeePackageInstallResult { status: 'queued' | 'installed' | 'updated' | 'rejected'; jobId?: string; agentId?: string; agentStatus?: 'draft' | 'active' | 'archived'; activated: boolean; guardrails: { upserted: number; }; knowledge: { upserted: number; embedded: number; skippedEmbeddings: number; }; evalCases: { upserted: number; ran: number; skippedMutating: number; }; gate: { passRate: number | null; minPassRate: number; baselinePassRate: number | null; regressed: boolean; passed: boolean; suiteRunId?: string; casesRun: number; failures: Array<{ testCaseId: string; name: string; failureReason?: string; }>; } | null; errors: string[]; deploymentReportId?: string; gateReportId?: string; auditId?: string; } export interface CoreHealthStatus { status: 'ok' | 'error'; build: { coreVersion: string; coreCommitSha: string; cliCompatibilityVersion: string; }; } export interface RuntimeDemoPreflightReport { id: string; workspaceId: string; actor?: string | null; overallStatus: 'REHEARSAL_READY' | 'REHEARSAL_BLOCKED'; coreVersion?: string | null; cliVersion?: string | null; frontendImageSha?: string | null; mobileImageSha?: string | null; backendImageSha?: string | null; cliImageSha?: string | null; metadataInstallIds: string[]; businessDataInstallIds: string[]; deploymentReportId?: string | null; gateReportId?: string | null; auditId?: string | null; agentId?: string | null; checks: Array<{ code: string; status: 'passed' | 'failed' | 'missing'; evidence?: Record | null; reason?: string | null; }>; blockers: string[]; createdAt: string; } export interface EmployeeDeploymentReportRecord { id: string; jobId?: string | null; workspaceId: string; agentId: string; gateReportId?: string | null; auditId?: string | null; packageName: string; packageVersion: string; status: 'queued' | 'running' | 'installed' | 'updated' | 'rejected' | 'failed'; activationStatus: 'draft' | 'active' | 'archived'; activated: boolean; gatePassed: boolean; gateFailureReason?: string | null; coreVersion?: string | null; cliVersion?: string | null; errors: string[]; createdAt: string; updatedAt: string; } export interface DeploymentJobRecord { id: string; workspaceId: string; phase: 'queued' | 'validating' | 'deploying' | 'verifying' | 'succeeded' | 'failed' | 'cancelled' | 'deployed_with_warnings'; progressPercent: number; successCount: number; failureCount: number; totalComponents: number; metadata?: Record; } export interface EmployeeGateReportRecord { id: string; deploymentReportId?: string | null; suiteRunId?: string | null; passRate: number | null; minPassRate: number; baselinePassRate: number | null; regressed: boolean; passed: boolean; casesRun: number; failures: Array<{ testCaseId: string; name: string; failureReason?: string; }>; } export interface InstallationContractRecord { installationId: string; workspaceId: string; packageName?: string; version?: string; contractName?: string; contractVersion?: string; compatibleCoreSha: string | null; auditId?: string | null; sourceUri?: string | null; installedAt?: string | null; createdAt?: string; summary?: Record | null; } export interface MetadataPackageUpgradeResult { packageName: string; status: string; warnings: string[]; destructiveChanges?: string[]; installResult?: MetadataPackageInstallResult; } export interface MetadataPackageRollbackResult { packageName: string; status: string; warnings: string[]; restoredStateId?: string; snapshotTimestamp?: string; restoredVersion?: string | null; details?: Record; } export interface MetadataPackageUninstallResult { packageName: string; status: string; warnings: string[]; blockedBy?: string[]; } export interface InstalledMetadataPackageRecord { id: string; workspaceId: string; packageName: string; version: string; packageDigest?: string | null; installSource: string; status: string; installedAt: string; updatedAt: string; manifest: MetadataPackageManifest; ownedCodeArtifacts?: Array> | null; runtimeProviderRequirement?: string | null; } export interface MetadataPackageInstallHistoryRecord { id: string; workspaceId: string; packageName: string; version: string; action: string; status: string; installSource: string; sourceUri?: string | null; manifest: MetadataPackageManifest; details?: Record | null; sourceStateId?: string | null; targetStateId?: string | null; rollbackDetails?: Record | null; createdAt: string; } export interface PromotionRecord { id: string; packageName: string; version: string; sourceChannel: string; targetChannel: string; promotedBy: string; promotedAt: string; approvalStatus: 'pending' | 'approved' | 'rejected'; approvedBy?: string | null; approvedAt?: string | null; rejectionReason?: string | null; metadata?: Record | null; } export interface RolloutStatusResult { packageName: string; version: string; channel: string; percentage: number; includedWorkspaceCount: number; totalEligibleWorkspaces: number; includedWorkspaceIds: string[]; rollout: Record; } export interface ChannelEntitlementRecord { id: string; workspaceId: string; channel: string; grantedBy: string; grantedAt: string; revokedBy?: string | null; revokedAt?: string | null; status: 'active' | 'revoked'; metadata?: Record | null; } export interface ChannelPolicyResult { path: string; policy: Record; } export interface CodeEnvironmentPromotionPackageInput { manifest: MetadataPackageManifest; packageDirectory?: string; archivePath?: string; serializerChangeSetId?: string; sourceUri?: string; } export interface CodeEnvironmentPromotionPlanResult { valid: boolean; targetWorkspaceId: string; sourceEnvironment?: string | null; runtimePolicyRef?: string | null; runtimeProviderId: string; allowPartialFailure: boolean; warnings: string[]; errors: string[]; packages: Array<{ packageName: string; version: string; packageClass?: string; action: 'install' | 'upgrade' | 'noop'; valid: boolean; warnings: string[]; errors: string[]; executionTrack?: string; installedVersion?: string | null; runtimeProviderRequirement?: string | null; }>; drift: { missingPackages: string[]; versionMismatches: string[]; extraCodePackages: string[]; }; } export interface CodeEnvironmentPromotionResult { success: boolean; targetWorkspaceId: string; sourceEnvironment?: string | null; runtimePolicyRef?: string | null; warnings: string[]; errors: string[]; precheck: CodeEnvironmentPromotionPlanResult; appliedPackages: Array<{ packageName: string; version: string; action: 'install' | 'upgrade' | 'noop'; status: string; warnings: string[]; executionTrack?: string; installedStateId?: string; deploymentHistoryId?: string | null; }>; rollbackResults: Array<{ packageName: string; status: string; warnings: string[]; details?: Record; }>; } export interface SourceMemberRecord { id: string; componentType: string; componentId: string; componentName: string; changeType: string; changeSource: string; changedAt: string; } export interface SourceStatusFileRecord { path: string; hash: string; componentKey?: string; baselineHash?: string | null; track?: 'metadata-runtime' | 'code-extension' | 'employee-source'; semanticHash?: string; aggregateDigest?: string; releaseSetId?: string; } export interface SourceDriftResult { baselineAvailable: boolean; baselineSource?: string | null; diff?: Record | null; totalChanges: number; humanSummary: string[]; } export interface SourceStatusResult { remoteRevision: string; remoteHash?: string; baselineRevision?: string | null; baselineHash?: string | null; baselineSource?: string | null; baselineAvailable: boolean; files: SourceStatusFileRecord[]; baselineFiles: SourceStatusFileRecord[]; drift: SourceDriftResult; changedComponentCount: number; tracking?: Record | null; } export interface SourceFilesResult { remoteRevision: string; files: Array; } export interface PushSourceFileInput { path: string; content?: string | null; deleted?: boolean; } export interface PushSourceResult { success: boolean; count: number; dryRun: boolean; beforeRevision?: string; afterRevision?: string; plan?: { humanSummary: string[]; summary: Record; }; } export interface SourceBaselineRebuildResult { success: boolean; baselineAvailable: boolean; baselineRevision?: string | null; baselineSource?: string | null; filesCount: number; warnings: string[]; } export interface RuntimeComposerPackageRef { packageName: string; version?: string; packageType: string; source?: 'local' | 'registry' | 'workspace'; } export interface RuntimeComposerInput { tenantId: string; baseline: RuntimeComposerPackageRef; genericOverlay?: RuntimeComposerPackageRef | null; industryOverlay?: RuntimeComposerPackageRef | null; extensionPacks: RuntimeComposerPackageRef[]; demoPack?: RuntimeComposerPackageRef | null; environmentProfile?: RuntimeComposerPackageRef | null; } export interface RuntimeComposerPreviewResult { plan: { tenantId: string; orderedPackages: RuntimeComposerPackageRef[]; warnings: string[]; }; effective: { warnings: string[]; destructiveSummary: string[]; diff: { humanSummary: string[]; changes: Array>; }; validation: { valid: boolean; summary: string[]; }; }; fromCache: boolean; materializedSnapshotId?: string; } export interface DeploymentRollbackResult { id: string; result?: string; errorMessage?: string | null; } export interface PromoteSandboxInput { sandboxId: string; promoteFrontend: boolean; promoteBackend: boolean; reason: string; } export interface SandboxPromotionPrecheckResult { canPromote: boolean; warnings: string[]; errors: string[]; frontendDiff: { from: string; to: string; changes: string[]; }; backendDiff: { from: string; to: string; changes: string[]; }; } export type MfaFactorType = 'totp' | 'webauthn' | 'recovery_code' | 'backup_email'; export interface MfaFactorView { id: string; userId: string; type: MfaFactorType; label: string; isVerified: boolean; isPrimary: boolean; createdAt?: string; lastUsedAt?: string | null; recoveryCodesRemaining?: number | null; } export interface GraphQLApiErrorDetail { message: string; code?: string; path?: ReadonlyArray | string; ruleId?: string; retryable?: boolean; details?: Readonly>; challengeId?: string; stepUpAction?: string; } export declare class GraphQLApiError extends Error { readonly errors: ReadonlyArray; constructor(errors: ReadonlyArray); } export declare function extractStepUpRequirement(error: unknown): { challengeId: string; action: string; } | null; export declare function resolveEmployeeDeployRequestTimeoutMs(input: { dryRun?: boolean; currentTimeoutMs: number; environment?: NodeJS.ProcessEnv; }): number; export declare function normalizeEmployeeDeployTimeoutError(error: unknown, input: { dryRun?: boolean; timeoutMs: number; }): unknown; export declare class ApiClient { private baseUrl; private token?; private orgAlias?; private requestTimeoutMs; private readonly tokenRefreshDisabled; private tokenRefreshInFlight?; constructor(baseUrl?: string, token?: string, orgAlias?: string, requestTimeoutMs?: number); ensureValidToken(): Promise; getCoreHealth(): Promise; private refreshOAuthTokenPair; private getHeaders; private request; private putRawBytes; uploadContentDocument(input: { filename: string; bytes: Uint8Array; idempotencyKey: string; }): Promise<{ documentId: string; currentVersionId?: string; scanStatus?: string; }>; isContentDocumentReady(documentId: string): Promise; get(endpoint: string): Promise>; post(endpoint: string, body?: unknown): Promise>; postSse(endpoint: string, body: unknown): Promise>; put(endpoint: string, body?: unknown): Promise>; delete(endpoint: string): Promise>; graphql(query: string, variables?: Record): Promise; graphqlWithStepUp(query: string, variables: Record, stepUpToken: string): Promise; getCurrentUser(): Promise<{ id: string; username?: string; email?: string; }>; listMfaFactors(): Promise; stepUpVerify(input: { challengeId: string; factorId: string; factorType: MfaFactorType; credential: unknown; }): Promise<{ challengeId: string; stepUpToken: string; expiresAt: Date; }>; getAiContextSigningKeys(): Promise; createExecutablePackageUploadSession(input: CreateExecutablePackageUploadSessionInput, idempotencyKey: string): Promise; uploadExecutablePackageArtifact(input: { readonly targetWorkspaceId: string; readonly uploadSessionId: string; readonly bytes: Uint8Array; readonly archiveDigest: `sha256:${string}`; readonly packageDigest: `sha256:${string}`; readonly idempotencyKey: string; readonly receivedBytes?: number; readonly chunkSizeBytes?: number; }): Promise; resolveWorkforceBundleLock(input: WorkforceBundleArtifactOperationInput): Promise; planExecutableWorkforceBundle(input: WorkforceBundleArtifactOperationInput & { readonly expectedActiveReleaseSetId: string; readonly expectedGeneration: number; }): Promise; stageExecutableWorkforceBundle(input: WorkforceBundleArtifactOperationInput & { readonly expectedActiveReleaseSetId: string; readonly expectedGeneration: number; readonly planDigest: `sha256:${string}`; readonly authoringContext: VerifyAiAuthoringContextFreshnessRequestV2; }, idempotencyKey: string): Promise; replacementStageWorkforceCandidate(input: { readonly schemaVersion: 'nexusclaw.replacement-stage-workforce-candidate-input/v1'; readonly targetWorkspaceId: string; readonly sourceCandidateReleaseSetId: string; readonly expectedSourceLockDigest: `sha256:${string}`; readonly expectedReleaseItemSetDigest: `sha256:${string}`; readonly expectedMaterializedItemRefsDigest: `sha256:${string}`; readonly expectedPackageDigest: `sha256:${string}`; readonly expectedActiveReleaseSetId: string; readonly expectedGeneration: number; readonly reason: string; }, idempotencyKey: string): Promise; workforceCandidateReplacementStatus(input: { readonly targetWorkspaceId: string; readonly sourceCandidateReleaseSetId: string; }): Promise; runWorkforceCandidateTests(input: { readonly targetWorkspaceId: string; readonly candidateReleaseSetId: string; readonly selectors: readonly WorkforceCandidateSelector[]; readonly expectedSourceLockDigest: `sha256:${string}`; readonly expectedReleaseItemSetDigest: `sha256:${string}`; readonly expectedMaterializedItemRefsDigest: `sha256:${string}`; }, idempotencyKey: string): Promise; getWorkforceCandidateStatus(input: { readonly targetWorkspaceId: string; readonly candidateReleaseSetId: string; readonly evidenceRunId?: string; }): Promise; getWorkforceCandidateDiagnostics(input: { readonly targetWorkspaceId: string; readonly candidateReleaseSetId: string; readonly evidenceRunId?: string; }): Promise; cancelWorkforceCandidateTestRun(input: { readonly targetWorkspaceId: string; readonly evidenceRunId: string; }, idempotencyKey: string): Promise<{ evidenceRunId: string; status: string; failureCode: string | null; completedAt: string | null; alreadyTerminal: boolean; capacityReleased: boolean; }>; getWorkforceCandidateReleaseItems(input: { readonly targetWorkspaceId: string; readonly candidateReleaseSetId: string; }): Promise; requestWorkforceReleaseApproval(input: { readonly targetWorkspaceId: string; readonly candidateReleaseSetId: string; readonly evidenceRunIds: readonly string[]; readonly expectedSourceLockDigest: `sha256:${string}`; readonly expectedReleaseItemSetDigest: `sha256:${string}`; readonly expectedMaterializedItemRefsDigest: `sha256:${string}`; }, idempotencyKey: string): Promise; getWorkforceReleaseApprovalStatus(input: { readonly targetWorkspaceId: string; readonly candidateReleaseSetId: string; readonly approvalId: string; }): Promise; evaluateAndSealWorkforceCandidateRelease(input: { readonly targetWorkspaceId: string; readonly candidateReleaseSetId: string; readonly evidenceRunIds: readonly string[]; readonly expectedSourceLockDigest: `sha256:${string}`; readonly expectedReleaseItemSetDigest: `sha256:${string}`; readonly expectedMaterializedItemRefsDigest: `sha256:${string}`; readonly approvalId: string; }, idempotencyKey: string): Promise<{ releaseSetId: string; evidenceId: string; eligibilityStatus: 'eligible' | 'rejected'; releaseEnvelopeDigest: `sha256:${string}`; alreadySealed: boolean; }>; promoteWorkforceRelease(input: Record, idempotencyKey: string): Promise; rollbackWorkforceRelease(input: Record, idempotencyKey: string): Promise; revokeExecutableToolExport(input: Record, idempotencyKey: string): Promise>; private workforceGateReceiptMutation; private workforceTransitionMutation; validateExecutablePackageArtifact(input: ValidateExecutablePackageArtifactInputV1): Promise; describeAiAuthoringContext(input: DescribeAiAuthoringContextRequestV2): Promise; verifyAiAuthoringContextFreshness(input: VerifyAiAuthoringContextFreshnessRequestV2): Promise; signAiAuthoringContextLock(input: SignAiAuthoringContextLockRequestV2): Promise; validate(changeSetId: string): Promise; validateDeploymentSource(input: { files: RuntimeSourceFile[]; targetEnvironment?: string; format?: 'json' | 'markdown'; }): Promise<{ report: ValidationReport; rendered: string; }>; validateDeploymentPackage(input: { manifest: MetadataPackageManifest; operation: 'install' | 'upgrade'; workspaceId?: string; targetEnvironment?: string; format?: 'json' | 'markdown'; }): Promise<{ report: ValidationReport; rendered: string; }>; createManagedChangeSet(input: Record): Promise; listManagedChangeSets(filters?: Record): Promise; getManagedChangeSet(id: string): Promise; validateManagedChangeSet(id: string): Promise<{ changeSet: ManagedChangeSet; report: ValidationReport; }>; deployManagedChangeSet(id: string): Promise>; rollbackManagedChangeSet(id: string): Promise>; getManagedChangeSetDependencies(id: string): Promise>; getManagedChangeSetConflicts(id: string): Promise>; approveManagedChangeSet(id: string, reason?: string): Promise; rejectManagedChangeSet(id: string, reason?: string): Promise; listDeploymentHistory(filters?: Record): Promise<{ records: Record[]; rendered: string; }>; compareDeployments(leftId: string, rightId: string): Promise>; deploy(changeSetId: string): Promise; getDeployStatus(jobId: string): Promise; retrieve(changeSetId: string): Promise; exportRuntimeMetadata(): Promise; validateRuntimeMetadata(files: RuntimeSourceFile[]): Promise; diffRuntimeMetadata(files: RuntimeSourceFile[]): Promise; getSourceStatus(): Promise; getRemoteChanges(workspaceId?: string): Promise; getLocalChanges(workspaceId?: string): Promise; getSourceFiles(input?: { paths?: string[]; recordAccess?: boolean; }): Promise; pushSource(input: { files: PushSourceFileInput[]; dryRun?: boolean; }): Promise; rebuildSourceBaseline(reason?: string): Promise; importRuntimeMetadata(files: RuntimeSourceFile[], options?: { dryRun?: boolean; destructiveSync?: boolean; }): Promise; getMetadataPackageInstallPlan(input: { workspaceId: string; manifests: MetadataPackageManifest[]; dryRun?: boolean; packageDirectory?: string; coreVersion?: string; }): Promise; installMetadataPackage(input: { workspaceId: string; manifest: MetadataPackageManifest; dryRun?: boolean; packageDirectory?: string; archivePath?: string; serializerChangeSetId?: string; sourceUri?: string; coreVersion?: string; }): Promise; deployEmployeePackage(input: { workspaceId: string; manifest: Record; dryRun?: boolean; allowMutatingEvals?: boolean; skipEmbeddings?: boolean; forceAdopt?: boolean; }): Promise; getEmployeeDeploymentReport(input: { workspaceId: string; deploymentReportId: string; }): Promise; listEmployeeDeploymentReports(workspaceId: string): Promise; getDeploymentJob(id: string): Promise; getEmployeeGateReport(input: { workspaceId: string; gateReportId: string; }): Promise; resumeEmployeePackageDeployment(id: string): Promise; runRuntimeDemoPreflight(input: { workspaceId: string; expectedCoreSha?: string | null; imageEvidence?: { backendImageSha?: string | null; frontendImageSha?: string | null; mobileImageSha?: string | null; cliImageSha?: string | null; } | null; }): Promise; getRuntimeDemoPreflightReport(input: { workspaceId: string; preflightReportId: string; }): Promise; registerMetadataInstall(input: { workspaceId: string; packageName: string; version: string; installedStateId: string; compatibleCoreSha: string; auditId?: string | null; sourceUri?: string | null; }): Promise; registerBusinessDataInstall(input: { workspaceId: string; contractName: string; contractVersion: string; compatibleCoreSha: string; sourceUri?: string | null; auditId?: string | null; summary?: Record | null; }): Promise; listMetadataInstallations(workspaceId: string): Promise; listBusinessDataInstallations(workspaceId: string): Promise; upgradeMetadataPackage(input: { workspaceId: string; manifest: MetadataPackageManifest; allowDestructiveChanges?: boolean; packageDirectory?: string; archivePath?: string; serializerChangeSetId?: string; coreVersion?: string; }): Promise; uninstallMetadataPackage(input: { workspaceId: string; packageName: string; force?: boolean; purgeMetadata?: boolean; }): Promise; rollbackMetadataPackageInstall(input: { workspaceId: string; manifest: MetadataPackageManifest; deploymentHistoryId?: string; targetStateId?: string; cascade?: boolean; dryRun?: boolean; }): Promise; runtimeComposerPreview(input: { input: RuntimeComposerInput; registryRootDirectories?: string[]; }): Promise; rollbackDeployment(input: { historyId: string; componentIds?: string[]; }): Promise; promoteSandbox(input: PromoteSandboxInput): Promise; getSandboxPromotionPrecheck(input: { sandboxId: string; }): Promise; codeEnvironmentPromotionPlan(input: { targetWorkspaceId: string; sourceEnvironment?: string | null; runtimePolicyRef?: string | null; allowPartialFailure?: boolean; packages: CodeEnvironmentPromotionPackageInput[]; }): Promise; promoteCodeEnvironment(input: { targetWorkspaceId: string; sourceEnvironment?: string | null; runtimePolicyRef?: string | null; allowPartialFailure?: boolean; reason?: string | null; packages: CodeEnvironmentPromotionPackageInput[]; }): Promise; listInstalledMetadataPackages(input: { workspaceId: string; includeUninstalled?: boolean; }): Promise; listMetadataPackageInstallHistory(input: { workspaceId: string; packageName?: string; }): Promise; verifyMetadataPackageSnapshots(input: { workspaceId: string; packageName: string; }): Promise<{ workspaceId: string; packageName: string; verification: Array<{ snapshotId: string; valid: boolean; status: string; }>; }>; promotePackage(input: { packageName: string; version: string; sourceChannel: string; targetChannel: string; rootDirectory?: string; }): Promise; getPromotionHistory(input: { packageName?: string; version?: string; channel?: string; status?: string; }): Promise; getPromotion(id: string): Promise; getRolloutStatus(input: { packageName: string; version: string; channel: string; }): Promise; updateRolloutPercentage(input: { packageName: string; version: string; channel: string; percentage: number; }): Promise>; getRolloutWorkspaces(input: { packageName: string; version: string; channel: string; limit?: number; }): Promise>; deprecatePackageVersion(input: { packageName: string; version: string; channel: string; reason: string; replacementVersion?: string; gracePeriodDays?: number; }): Promise>; getChannelPolicy(): Promise; grantChannelAccess(input: { workspaceId: string; channel: string; reason?: string; expiresAt?: string; }): Promise; revokeChannelAccess(input: { entitlementId: string; reason?: string; }): Promise; listChannelEntitlements(input: { workspaceId: string; status?: 'active' | 'revoked' | 'all'; }): Promise; } export declare class ApiClientConfigurationError extends Error { readonly code: 'CLI_TARGET_UNCONFIGURED' | 'CLI_TOKEN_WITHOUT_BASE_URL' | 'CLI_CREDENTIAL_NOT_FOUND'; constructor(code: 'CLI_TARGET_UNCONFIGURED' | 'CLI_TOKEN_WITHOUT_BASE_URL' | 'CLI_CREDENTIAL_NOT_FOUND', message: string); } export declare function createApiClient(targetOrg?: string, requestTimeoutMs?: number): ApiClient;