Skip to content
1 min read · 251 words

Interface: SkillWorkspace ​

Defined in: src/batteries/skills/types.ts:67

Skill-scoped materialization service used by tier-3 scripts.

Properties ​

PropertyModifierTypeDescriptionDefined in
fileSystemreadonlySandboxFileSystemFilesystem view used by the sandbox policy and script runner.src/batteries/skills/types.ts:87
rootreadonlystringWorkspace base used to resolve materializations; individual returned roots remain authoritative.src/batteries/skills/types.ts:89

Methods ​

dispose() ​

ts
dispose(root: string): Promise<void>;

Defined in: src/batteries/skills/types.ts:85

Remove one materialization, identified by its returned root rather than by SkillRef. A prepare-then-swap refresh can have two live materializations of the same skill at once, and a workspace using randomized paths cannot distinguish them from the ref and could delete the wrong one.

Parameters ​

ParameterType
rootstring

Returns ​

Promise<void>


materialize() ​

ts
materialize(
   skill: SkillRef,
   files: AsyncIterable<{
  bytes: ReadableStream<Uint8Array<ArrayBufferLike>>;
  path: string;
}>,
   o?: {
  signal?: AbortSignal;
}): Promise<string>;

Defined in: src/batteries/skills/types.ts:74

Write files and return the authoritative absolute materialized root. Callers must use the returned root rather than reconstructing ${root}/${id}: ids are external data, two sources may offer the same id, and an implementation may add a version or random path segment (and MUST do so on id collision).

Parameters ​

ParameterType
skillSkillRef
filesAsyncIterable<{ bytes: ReadableStream<Uint8Array<ArrayBufferLike>>; path: string; }>
o?{ signal?: AbortSignal; }
o.signal?AbortSignal

Returns ​

Promise<string>