createWorkspace
Purpose and behavior
Section titled “Purpose and behavior”Creates an owned Git, copied-directory, mounted-directory or ephemeral workspace. File modes allocate no Git repository and publish nothing on closure.
Complete example and detailed rules.
Parameters and properties
Section titled “Parameters and properties”Variant 1 — GitWorkspaceOptions
Section titled “Variant 1 — GitWorkspaceOptions”optionsRequiredGitWorkspaceOptionsSelect the Git branch or file source, runtime location and ownership policy for the new workspace.options.sourceRequiredGitWorkspaceSourceDeclared source for an owned resource; mutually exclusive with borrowing an open workspace.options.signalOptionalAbortSignal | undefinedCancels opening: checked before allocation and passed to the storage reservation and workspaceReady commands. An open workspace ignores it.options.hooksOptionalLifecycleHooks | undefinedSetup commands: workspaceReady once when the workspace opens, then hostReady and sandboxReady for each sandbox on it unless that sandbox passes its own hooks. Each command stops after 600000 (10 minutes) unless it sets deadlineMs; a nonzero exit fails with code process.options.storageQuotaOptionalOmit<StorageReservationOptions, "signal"> | undefinedStorage admission checked before the workspace opens: reserves reserveBytes and fails with code configuration when usage under .outpost plus active reservations would exceed maxBytes. The reservation is released when the workspace closes.options.observationOptionalObservationHub | undefinedHub that receives this workspace’s Git, copy, hook, integration and cleanup operations. The caller keeps ownership; the workspace never closes it.options.limitsOptionalStageLimits | undefinedDeadlines in milliseconds for copying, Git preparation, commit collection and integration. Past a deadline the stage fails with code timeout, or conflict for integration. collectMs also bounds each Git command inspecting a diff guard; incomplete inspection fails with code guard.options.labelOptionalstring | undefinedName used in the integrate branch (outpost/<label>-<id>), the worktree directory under .outpost/workspaces and the startup-failure journal; lowercased, other characters replaced by -, cut to 48.
Variant 2 — FileWorkspaceOptions
Section titled “Variant 2 — FileWorkspaceOptions”optionsRequiredFileWorkspaceOptionsSelect the Git branch or file source, runtime location and ownership policy for the new workspace.options.hooksOptionalLifecycleHooks | undefinedDeclared workspaceReady, hostReady and sandboxReady preparation commands.options.storageQuotaOptionalOmit<StorageReservationOptions, "signal"> | undefinedAdmission reservation through Transport; coordinates cooperating writers without enforcing a physical disk quota.options.recoveryOptionalFileWorkspaceRecoveryAuthorization | undefinedExplicit stopped-process recovery authorization; interrupted replay remains a separate workflow decision.options.inputsOptionalreadonly WorkspaceInput[] | undefinedExplicit file inputs; JSON workflow parameters are never implicitly written to disk.options.sourceRequiredFileWorkspaceSourceDeclared source for an owned resource; mutually exclusive with borrowing an open workspace.options.runtimeOptionalWorkspaceRuntimeOptions | undefinedControl directory and logical namespace, separate from the workspace files.options.pathsOptionalreadonly string[] | undefinedExplicit relative path selection; copy selection does not implicitly apply .gitignore.options.retentionOptionalWorkspaceRetention | undefinedrun cleans successful owned work, local retains it, portable additionally requires an explicit Transport and namespace.options.signalOptionalAbortSignal | undefinedCancellation signal propagated to the operation and its process group; reusable sandboxes remain usable.
Returns
Section titled “Returns”Promise<GitWorkspace> · Promise<FileWorkspace>

