CreatedWorkspace
Parameters and properties
Section titled “Parameters and properties”The fields below cover all variants; the signature specifies their allowed combinations.
kindRequired"ephemeral" | "directory" | "git"Discriminant selecting Git, a directory source or an initially empty workspace.sourceVariant-dependentFileWorkspaceSourceDeclared source for an owned resource; mutually exclusive with borrowing an open workspace.checkpointVariant-dependent() => Promise<FileWorkspaceRecord>Synchronizes and verifies a settled generation before returning its durable description; refuses active operations.sandboxRequired(options: FileSandboxSettings) => Promise<FileSandbox> | (options?: Omit<SandboxOptions, Exclude<keyof WorkspaceOptions, "hooks" | "label"> | "workspace">) => Promise<Sandbox>Sandbox bound to this workspace; closing it leaves a borrowed workspace open.dispatchRequired<T = undefined>(options: FileSandboxSettings & DispatchOptions<T> & { readonly agent: DispatchAgent; }) => Promise<FileDispatchResult<T>> | <T = undefined>(options: Omit<SandboxOptions, Exclude<keyof WorkspaceOptions, "hooks" | "label"> | "workspace"> & DispatchOptions<T> & { readonly agent: DispatchAgent; }) => Promise<DispatchResult<T>>Runs an agent against the current files, preserving the workspace across repairs and steering passes.idRequiredstringStable identifier of this resource, independent of its materialization path.directoryRequiredstringAbsolute local materialization or source directory; it is not a portable resource identity.runtimeRequiredWorkspaceRuntimeControl directory and logical namespace, separate from the workspace files.closeRequired(options?: { readonly preserve?: boolean; }) => Promise<Disposal>Idempotent closure; preserves recoverable work and never removes a borrowed source.[Symbol.asyncDispose]Variant-dependent() => Promise<void>Idempotent closure; preserves recoverable work and never removes a borrowed source.gitVariant-dependentWorkspaceDedicated legacy Git capability, exposing branches, commits, guards and integration.attachVariant-dependent(options: Omit<SandboxOptions, Exclude<keyof WorkspaceOptions, "hooks" | "label"> | "workspace"> & AttachOptions & { readonly agent: Agent; }) => Promise<AttachResult>Open an interactive agent terminal in a new sandbox on this workspace. When the terminal exits with status 0 it merges an integrate branch; the sandbox closes and the workspace stays open.integrateVariant-dependent{ (): Promise<void>; (options: IntegrationOptions): Promise<ConflictResolution | void>; }Merge the work branch only in integrate mode. Without onConflict, uses the existing direct host merge and returns no value. With onConflict, requires a closed sandbox, preflights frozen commits, invokes the strategy only for an actual Git conflict, checks final ancestry and guard, then integrates the exact verified commit. Returns ConflictResolution when the strategy ran; refusals retain source and resolution worktrees.repositoryVariant-dependentstringReal path of the host checkout’s top-level directory.branchVariant-dependentstringWork branch name. In current mode, the checked-out branch, or HEAD when detached.baseBranchVariant-dependentstringBranch checked out in the host checkout when the workspace opened, and the target of integrate(). Empty when HEAD was detached.baselineVariant-dependentstringCommit checked out in the workspace when it opened. Each dispatch lists commits from its own starting commit, not from this one.gitDirectoriesVariant-dependentreadonly string[]Host paths of the worktree’s Git directory and the repository’s common Git directory. Container providers mount them unless repositoryMode is isolated.policyVariant-dependentBranchPolicyBranch policy in effect, { mode: “current” } when none was given.

