Skip to content

Interface: DatabricksWorkspaceOptions

Native Mastra workspace options plus Databricks path shortcuts.

  • Omit<WorkspaceConfig, "filesystem" | "mounts" | "sandbox" | "skills">

optional assistantPaths?: boolean

Start from DEFAULT_DATABRICKS_WORKSPACE_PATHS. Defaults to true.


optional autoIndexPaths?: string[]

Paths to auto-index on init(). Files in these directories will be indexed for search.

['docs', 'support']

Omit.autoIndexPaths


optional autoSync?: boolean

Auto-sync between fs and sandbox (default: false)

Omit.autoSync


optional bm25?: boolean | BM25Config | { bm25?: BM25Config; tokenize?: TokenizeOptions; }

Enable BM25 keyword search. Pass true for defaults, a BM25Config for custom k1/b parameters, or a { bm25?, tokenize? } object to also customise tokenization.

The tokenize field accepts a TokenizeOptions object that lets you tune how text is split into tokens (e.g. for CJK or other non-Latin scripts).

new Workspace({
bm25: {
k1: 1.5,
b: 0.75,
tokenize: { removePunctuation: false, minLength: 1 },
},
});

Omit.bm25


optional browser?: MastraBrowser

Browser provider for web automation.

Must be a MastraBrowser instance with providerType: 'cli' (e.g., BrowserViewer). SDK providers (AgentBrowser, StagehandBrowser) are not supported here — use Agent.browser for SDK providers.

The browser is launched via Playwright and exposes a CDP URL that CLI tools (agent-browser, browser-use, browse) can connect to.

import { BrowserViewer } from '@mastra/browser-viewer';
const workspace = new Workspace({
sandbox: new LocalSandbox({ cwd: './workspace' }),
browser: new BrowserViewer({
cli: 'agent-browser',
headless: false,
}),
});

Omit.browser


optional cache?: DatabricksWorkspaceCache

Filesystem cache filters. Ignored when the AppKit files-cache plugin is absent.


optional checkSkillFileMtime?: boolean

Check SKILL.md file mtime in addition to directory mtime for staleness detection.

When enabled, allows hot-reload detection of in-place SKILL.md edits (e.g., fixing a validation error or updating a skill description).

Trade-off: This doubles the stat() calls per skill during staleness checks. Recommended for local development only. Not recommended for cloud storage backends (S3, etc.) where stat() calls have higher latency.

false

Omit.checkSkillFileMtime


optional embedder?: Embedder

Embedder function for generating vectors. Required when vectorStore is provided.

Omit.embedder


optional extraSkillMounts?: LocalSkillMount[]

Extra LOCAL skill trees mounted read-only for every request’s skill discovery. Used by the plugin to expose remote skills from local backing storage at stable virtual paths (see remote-skills.ts). Databricks-hosted remote skills need no entry here because the built-in Assistant mount already scans them.


optional fallbackToTmp?: boolean

Add user-scoped /tmp only when no configured Databricks path mounts writable.


optional id?: string

Unique identifier (auto-generated if not provided)

Omit.id


optional instructions?: object

Controls how a resolver-backed sandbox contributes to workspace instructions. Defaults to dynamicSandbox: 'placeholder'. No effect on a static sandbox. See DynamicSandboxInstructions.

optional dynamicSandbox?: DynamicSandboxInstructions

Omit.instructions


optional lsp?: boolean | LSPConfig

Enable LSP diagnostics for edit tools.

When enabled, edit tools (edit_file, write_file, ast_edit) will append type errors, warnings, and other diagnostics from language servers after edits.

LSP requires a sandbox with a process manager (sandbox.processes) to spawn language server processes. It works with any sandbox backend (local, E2B, etc.).

Requires optional peer dependencies: vscode-jsonrpc, vscode-languageserver-protocol, and the relevant language server (e.g. typescript-language-server for TypeScript).

  • true — Enable with defaults
  • LSPConfig object — Enable with custom timeouts/settings
undefined (disabled)

Omit.lsp


optional mounts?: Record<string, WorkspaceFilesystem>

Native Mastra filesystems composed beside the Databricks paths.


optional name?: string

Human-readable name

Omit.name


optional onMount?: OnMountHook

Hook called before mounting each filesystem into the sandbox.

Return values:

  • false - Skip mount entirely (don’t mount this filesystem)
  • { success: true } - Hook handled the mount successfully
  • { success: false, error?: string } - Hook attempted mount but failed
  • undefined / no return - Use provider’s default mount behavior

This is useful for:

  • Skipping specific filesystems (e.g., local filesystems in remote sandbox)
  • Custom mount implementations
  • Syncing files instead of FUSE mounting

Note: If your hook handles the mount, you’re responsible for the entire implementation. The sandbox provider won’t do any additional tracking.

Skip local filesystems

const workspace = new Workspace({
sandbox: new E2BSandbox(),
mounts: {
'/data': new S3Filesystem({ bucket: 'data', ... }),
'/local': new LocalFilesystem({ basePath: './data' }),
},
onMount: ({ filesystem }) => {
if (filesystem.provider === 'local') return false;
},
});

Custom mount implementation

onMount: async ({ filesystem, mountPath, config, sandbox }) => {
if (config?.type === 's3') {
await sandbox.executeCommand?.('my-s3-mount', [mountPath]);
return { success: true };
}
}

Omit.onMount


optional operationTimeout?: number

Timeout for individual operations in milliseconds

Omit.operationTimeout


optional paths?: readonly DatabricksWorkspacePathValue[]

Databricks paths appended after the defaults. A string is shorthand for { path }; a resolver may return either form per request.


optional pluginContext?: PluginContextLike

AppKit plugin context used to discover optional sibling capabilities.


optional sandbox?: WorkspaceSandboxSelection

Command sandbox. Defaults to Monty. Pass false to disable it, or an explicit Mastra sandbox/provider resolver for a remote transport.


optional sandboxCacheKey?: WorkspaceSandboxCacheKey

Stable cache key for a resolver-backed sandbox, so background-process tools reach the same sandbox across requests. No effect on a static sandbox. See WorkspaceSandboxCacheKey.

Omit.sandboxCacheKey


optional searchIndexName?: string

Custom index name for the vector store. If not provided, defaults to a sanitized version of ${id}_search.

Must be a valid SQL identifier for SQL-based stores (PgVector, LibSQL):

  • Start with a letter or underscore
  • Contain only letters, numbers, or underscores
  • Maximum 63 characters
'my_workspace_vectors'

Omit.searchIndexName


optional skills?: SkillsResolver

Native Mastra skill paths or resolver composed with path-declared skills.


optional skillSource?: SkillSource

Custom SkillSource to use for skill discovery. When provided, this source is used instead of the workspace filesystem or LocalSkillSource.

Use VersionedSkillSource to read skills from the content-addressable blob store, serving a specific published version without touching the live filesystem.

import { VersionedSkillSource } from '@mastra/core/workspace';
const workspace = new Workspace({
skills: ['skills'],
skillSource: new VersionedSkillSource(tree, blobStore, versionCreatedAt),
});

Omit.skillSource


optional tools?: WorkspaceToolsConfig

Per-tool configuration for workspace tools. Controls which tools are enabled and their safety settings.

This replaces the provider-level requireApproval and requireReadBeforeWrite settings, allowing more granular control per tool.

tools: {
mastra_workspace_read_file: {
enabled: true,
requireApproval: false,
},
mastra_workspace_write_file: {
enabled: true,
requireApproval: true,
requireReadBeforeWrite: true,
},
mastra_workspace_execute_command: {
enabled: true,
requireApproval: true,
},
}

Omit.tools


optional vectorStore?: MastraVector<VectorFilter>

Vector store for semantic search. When provided along with embedder, enables vector and hybrid search.

Omit.vectorStore