/** Compile targets supported by player-authored projects. */ export type CrowdyStudioTarget = 'SERVER' | 'CLIENT'; /** The target layout selected when a project is created. */ export type CrowdyStudioProjectKind = 'SERVER' | 'CLIENT' | 'FULL_STACK'; /** * Whether a full-stack server should advertise its client companion. * `OPTIONAL` records author intent without creating a runtime requirement; * `REQUIRED` is applied with `playerCompute.setRequires` after both targets * compile successfully. */ export type CrowdyStudioPairingPreference = 'NONE' | 'OPTIONAL' | 'REQUIRED'; /** A source file in one project target. Paths are relative to that target. */ export interface CrowdyStudioProjectFile { target: CrowdyStudioTarget; path: string; content: string; } /** A read-only source file made available to the browser language worker. */ export interface CrowdyStudioReferenceFile { id: string; source: 'PERSONAL_LIBRARY' | 'COMMON'; title: string; /** Optional target fence. Omitted files are useful from either target. */ target?: CrowdyStudioTarget; path: string; content: string; tags?: string[]; updatedAt?: string; } export interface CrowdyStudioProjectMetadata { name: string; description?: string; serverModuleName?: string; clientModuleName?: string; pairingPreference: CrowdyStudioPairingPreference; } /** Immutable revision identity returned by the cloud project service. */ export interface CrowdyStudioProjectRevision { id: string; savedAt: string; } /** * One atomic cloud project snapshot. SERVER and CLIENT files intentionally * share a project revision so a full-stack save cannot persist half a pair. */ export interface CrowdyStudioProject { projectId: string; appId: string; gridId: string; kind: CrowdyStudioProjectKind; metadata: CrowdyStudioProjectMetadata; files: CrowdyStudioProjectFile[]; sdkVersion: string; abiVersion: number; revision: CrowdyStudioProjectRevision; createdAt: string; updatedAt: string; } export interface CrowdyStudioProjectSummary { projectId: string; name: string; kind: CrowdyStudioProjectKind; revisionId: string; serverModuleName?: string; clientModuleName?: string; updatedAt: string; } /** Explicit persistence state rendered by Crowdy Studio. */ export type CrowdyStudioSaveState = 'SAVING' | 'SAVED' | 'CONFLICT' | 'OFFLINE'; export interface CrowdyStudioFileRef { source: 'PROJECT' | 'PERSONAL_LIBRARY' | 'COMMON'; target?: CrowdyStudioTarget; path: string; referenceId?: string; } export interface CreateCrowdyStudioProjectInput { appId: string; gridId: string; kind: CrowdyStudioProjectKind; metadata: CrowdyStudioProjectMetadata; files: CrowdyStudioProjectFile[]; } export interface SaveCrowdyStudioProjectInput { appId: string; gridId: string; projectId: string; /** Optimistic-concurrency precondition for the atomic project write. */ expectedRevisionId: string; metadata: CrowdyStudioProjectMetadata; files: CrowdyStudioProjectFile[]; } export interface CrowdyStudioProjectScope { appId: string; gridId: string; } export interface ImportCrowdyStudioReferenceFileInput extends CrowdyStudioProjectScope { projectId: string; expectedRevisionId: string; source: 'PERSONAL_LIBRARY' | 'COMMON'; referenceId: string; destinationPath?: string; } export interface SaveCrowdyStudioLibraryFileInput extends CrowdyStudioProjectScope { title: string; target: CrowdyStudioTarget; path: string; content: string; tags?: string[]; } /** * Storage contract consumed by Crowdy Studio. It deliberately has no generated * GraphQL types, JSON source maps, or transport-specific errors. */ export interface CrowdyStudioProjectProvider { listProjects(scope: CrowdyStudioProjectScope): Promise; getProject(scope: CrowdyStudioProjectScope & { projectId: string; }): Promise; createProject(input: CreateCrowdyStudioProjectInput): Promise; saveProject(input: SaveCrowdyStudioProjectInput): Promise; listPersonalLibraryFiles(scope: CrowdyStudioProjectScope): Promise; listCommonFiles(scope: CrowdyStudioProjectScope): Promise; importReferenceFile(input: ImportCrowdyStudioReferenceFileInput): Promise; savePersonalLibraryFile(input: SaveCrowdyStudioLibraryFileInput): Promise; } export type CrowdyStudioPatchOperation = 'CREATE' | 'REPLACE'; /** One routine, non-destructive file replacement in an atomic agent patch. */ export interface CrowdyStudioAtomicFileChange { target: CrowdyStudioTarget; path: string; operation: CrowdyStudioPatchOperation; content: string; /** `ABSENT` for CREATE, otherwise the exact current sha256 digest. */ expectedContentHash: string | 'ABSENT'; } export interface CrowdyStudioAtomicPatchInput { expectedRevisionId: string; changes: readonly CrowdyStudioAtomicFileChange[]; } export interface CrowdyStudioCheckpointFile { target: CrowdyStudioTarget; path: string; contentHash: string; byteLength: number; } /** Source-free checkpoint metadata safe for Studio state and agent events. */ export interface CrowdyStudioCheckpointMetadata { checkpointId: string; projectRevisionId: string; contentHash: string; reason: 'AGENT_WRITE' | 'RESTORE_PREIMAGE' | 'MANUAL'; files: readonly CrowdyStudioCheckpointFile[]; createdAt: string; restoredAt?: string; } export interface CrowdyStudioAtomicPatchResult { project: CrowdyStudioProject; checkpoint: CrowdyStudioCheckpointMetadata; changedFiles: readonly CrowdyStudioCheckpointFile[]; } export interface CrowdyStudioCheckpointRestoreInput { projectId: string; checkpointId: string; expectedRevisionId: string; /** Opaque single-use grant from the durable orchestrator. */ approvalGrant: string; } export interface CrowdyStudioCheckpointRestoreResult { project: CrowdyStudioProject; preRestoreCheckpoint: CrowdyStudioCheckpointMetadata; } /** * Optional durable synchronization hooks. A generated Game API adapter can * implement these after schema reconciliation; the headless kernel stays * transport-neutral and tests can inject deterministic fakes. */ export interface CrowdyStudioSynchronizationProvider { applyAtomicPatch(input: CrowdyStudioProjectScope & { projectId: string; expectedRevisionId: string; changes: readonly CrowdyStudioAtomicFileChange[]; }): Promise; listCheckpoints(input: CrowdyStudioProjectScope & { projectId: string; }): Promise; restoreCheckpoint(input: CrowdyStudioProjectScope & CrowdyStudioCheckpointRestoreInput): Promise; } export interface CrowdyStudioProjectSynchronization { source: 'AGENT' | 'REMOTE'; expectedPreviousRevisionId?: string; checkpoint?: CrowdyStudioCheckpointMetadata; } /** Provider error indicating that the expected revision lost a save race. */ export declare class CrowdyStudioRevisionConflictError extends Error { readonly remoteProject?: CrowdyStudioProject | undefined; readonly code = "PROJECT_REVISION_CONFLICT"; constructor(message?: string, remoteProject?: CrowdyStudioProject | undefined); } /** Provider error indicating that the write should be retried when online. */ export declare class CrowdyStudioOfflineError extends Error { readonly code = "PROJECT_OFFLINE"; readonly cause?: unknown; constructor(message?: string, cause?: unknown); } /** Validate and normalize a target-relative project path. */ export declare function normalizeCrowdyStudioPath(path: string): string; /** Stable key for maps, tabs, diagnostics, and tests. */ export declare function crowdyStudioFileKey(target: CrowdyStudioTarget, path: string): string; /** * Target-prefixed URI used by Monaco and the browser VFS. Both targets can * therefore load `Cargo.toml` and `src/lib.rs` at the same time. */ export declare function crowdyStudioFileUri(workspaceUri: string, target: CrowdyStudioTarget, path: string): string; export declare function projectTargets(kind: CrowdyStudioProjectKind): CrowdyStudioTarget[]; export declare function cloneCrowdyStudioProject(project: CrowdyStudioProject): CrowdyStudioProject; //# sourceMappingURL=models.d.ts.map