createVirtualWorkspace(Persistent, actor-local text workspace over the existing private harness SQL port. It intentionally exposes no filesystem, process, module-loading, or dynamic-extension capability. Parametersports,limits?):ToolVirtualWorkspace
Returns
ToolVirtualWorkspace
createVirtualWorkspaceTools()
createVirtualWorkspaceTools(Explicit server-side tools backed only by a VirtualWorkspace. Skill documents remain returned data; this factory never evaluates their content. Parametersworkspace):Readonly<{activate_skill:Tool<{name:string; },ActivatedWorkspaceSkill>;edit_file:Tool<{expectedRevision?:number|undefined;newText:string;oldText:string;path:string; },WorkspaceToolEntry>;find_files:Tool<{needle:string; },Readonly<{matches: readonlyWorkspaceEntry[];origin:"workspace";truncated?:true; }>>;grep_files:Tool<{needle:string; },Readonly<{matches: readonly {line:number;path:string;text:string; }[];origin:"workspace";truncated?:true; }>>;list_files:Tool<Record<string,never>,Readonly<{entries: readonlyWorkspaceEntry[];origin:"workspace";truncated?:true; }>>;read_file:Tool<{path:string; },Readonly<{bytes:number;content:string;origin:"workspace";path:string;revision:number;truncated?:true; } | {found:false;origin:"workspace";path:string; }>>;write_file:Tool<{content:string;expectedRevision?:number|undefined;path:string; },WorkspaceToolEntry>; }>
Returns
Readonly<{ activate_skill: Tool<{ name: string; }, ActivatedWorkspaceSkill>; edit_file: Tool<{ expectedRevision?: number | undefined; newText: string; oldText: string; path: string; }, WorkspaceToolEntry>; find_files: Tool<{ needle: string; }, Readonly<{ matches: readonly WorkspaceEntry[]; origin: "workspace"; truncated?: true; }>>; grep_files: Tool<{ needle: string; }, Readonly<{ matches: readonly { line: number; path: string; text: string; }[]; origin: "workspace"; truncated?: true; }>>; list_files: Tool<Record<string, never>, Readonly<{ entries: readonly WorkspaceEntry[]; origin: "workspace"; truncated?: true; }>>; read_file: Tool<{ path: string; }, Readonly<{ bytes: number; content: string; origin: "workspace"; path: string; revision: number; truncated?: true; } | { found: false; origin: "workspace"; path: string; }>>; write_file: Tool<{ content: string; expectedRevision?: number | undefined; path: string; }, WorkspaceToolEntry>; }>
The results of the file tools carry
origin: "workspace", and the result of activate_skill carries origin: "activated-skill". A path is relative, such as notes/order.md, and at most 128 bytes.
read()
read(Parameterspath):Promise<WorkspaceRead|undefined>
Returns
Promise<WorkspaceRead | undefined>
write()
write(Parameterspath,content,options?):Promise<WorkspaceEntry>
Returns
Promise<WorkspaceEntry>
edit()
edit(Parameterspath,oldText,newText,options?):Promise<WorkspaceEntry>
Returns
Promise<WorkspaceEntry>
list()
list():ReturnsPromise<Readonly<{entries: readonlyWorkspaceEntry[];truncated?:true; }>>
Promise<Readonly<{ entries: readonly WorkspaceEntry[]; truncated?: true; }>>
find()
find(Parametersneedle):Promise<Readonly<{matches: readonlyWorkspaceEntry[];truncated?:true; }>>
Returns
Promise<Readonly<{ matches: readonly WorkspaceEntry[]; truncated?: true; }>>
grep()
grep(Parametersneedle):Promise<Readonly<{matches: readonly {line:number;path:string;text:string; }[];truncated?:true; }>>
Returns
Promise<Readonly<{ matches: readonly { line: number; path: string; text: string; }[]; truncated?: true; }>>
journal()
journal(Parametersoptions?):Promise<readonlyWorkspaceJournalEntry[]>
Returns
Promise<readonly WorkspaceJournalEntry[]>
discoverSkills()
discoverSkills():ReturnsPromise<WorkspaceSkillCatalog>
Promise<WorkspaceSkillCatalog>
A skill is the document at skills/<name>/SKILL.md, written like any other file. Nothing in a skill is executed.
activateSkill()
activateSkill(Parametersname):Promise<ActivatedWorkspaceSkill>
Returns
Promise<ActivatedWorkspaceSkill>
assemblePrompt()
assemblePrompt(Parametersbase,skills):Promise<Readonly<{sources: readonlyPromptSource[];text:string; }>>
Returns
Promise<Readonly<{ sources: readonly PromptSource[]; text: string; }>>
VirtualWorkspaceLimits
Properties maxFileBytes?maxOutputBytes?readonlyoptionalmaxFileBytes?:number
maxResults?readonlyoptionalmaxOutputBytes?:number
maxWorkspaceBytes?readonlyoptionalmaxResults?:number
readonlyoptionalmaxWorkspaceBytes?:number
WorkspaceEntry
Properties bytespathreadonlybytes:number
revisionreadonlypath:string
readonlyrevision:number
WorkspaceRead
Properties bytescontentreadonlybytes:number
pathreadonlycontent:string
revisionreadonlypath:string
truncated?readonlyrevision:number
readonlyoptionaltruncated?:true
WorkspaceWriteOptions
Properties expectedRevision?readonlyoptionalexpectedRevision?:number
WorkspaceJournalEntry
Properties bytesoperationreadonlybytes:number
pathreadonlyoperation:"write"|"edit"
revisionreadonlypath:string
sequencereadonlyrevision:number
readonlysequence:number
WorkspaceSkill
Properties nameoriginreadonlyname:string
pathreadonlyorigin:"workspace"
readonlypath:string
WorkspaceSkillCatalog
Properties skillstruncated?readonlyskills: readonlyWorkspaceSkill[]
readonlyoptionaltruncated?:true
ActivatedWorkspaceSkill
Properties contentnamereadonlycontent:string
originreadonlyname:string
pathreadonlyorigin:"activated-skill"
readonlypath:string
PromptSource
PromptSource =Readonly<{origin:"application"; }> |Readonly<{name:string;origin:"activated-skill";path:string; }>
WorkspaceToolEntry
Properties bytesoriginreadonlybytes:number
pathreadonlyorigin:"workspace"
revisionreadonlypath:string
readonlyrevision:number
ToolVirtualWorkspace
A concrete workspace that can atomically preflight tool mutation results. Properties [TOOL_WORKSPACE_CAPABILITY]Methods activateSkill()readonly[TOOL_WORKSPACE_CAPABILITY]:true
activateSkill(Parametersname):Promise<ActivatedWorkspaceSkill>
Returns
Promise<ActivatedWorkspaceSkill>
assemblePrompt()
assemblePrompt(Parametersbase,skills):Promise<Readonly<{sources: readonlyPromptSource[];text:string; }>>
Returns
Promise<Readonly<{ sources: readonly PromptSource[]; text: string; }>>
discoverSkills()
discoverSkills():ReturnsPromise<WorkspaceSkillCatalog>
Promise<WorkspaceSkillCatalog>
edit()
edit(Parameterspath,oldText,newText,options?):Promise<WorkspaceEntry>
Returns
Promise<WorkspaceEntry>
find()
find(Parametersneedle):Promise<Readonly<{matches: readonlyWorkspaceEntry[];truncated?:true; }>>
Returns
Promise<Readonly<{ matches: readonly WorkspaceEntry[]; truncated?: true; }>>
grep()
grep(Parametersneedle):Promise<Readonly<{matches: readonly {line:number;path:string;text:string; }[];truncated?:true; }>>
Returns
Promise<Readonly<{ matches: readonly { line: number; path: string; text: string; }[]; truncated?: true; }>>
journal()
journal(Parametersoptions?):Promise<readonlyWorkspaceJournalEntry[]>
Returns
Promise<readonly WorkspaceJournalEntry[]>
list()
list():ReturnsPromise<Readonly<{entries: readonlyWorkspaceEntry[];truncated?:true; }>>
Promise<Readonly<{ entries: readonly WorkspaceEntry[]; truncated?: true; }>>
read()
read(Parameterspath):Promise<WorkspaceRead|undefined>
Returns
Promise<WorkspaceRead | undefined>
write()
write(Parameterspath,content,options?):Promise<WorkspaceEntry>
Returns
Promise<WorkspaceEntry>