Skip to content
2 min read · 337 words

Class: InMemorySkillSource

Defined in: src/batteries/skills/in_memory/index.ts:29

A mutable, deterministic SkillSource backed by SKILL.md strings.

Implements

Constructors

Constructor

ts
new InMemorySkillSource(id: string, entries: readonly {
  descriptor: SkillDescriptor;
  files?: Readonly<Record<string, string | Uint8Array<ArrayBufferLike>>>;
  id: string;
  manifest: string;
  version: string;
}[]): InMemorySkillSource;

Defined in: src/batteries/skills/in_memory/index.ts:34

Parameters

ParameterType
idstring
entriesreadonly { descriptor: SkillDescriptor; files?: Readonly<Record<string, string | Uint8Array<ArrayBufferLike>>>; id: string; manifest: string; version: string; }[]

Returns

InMemorySkillSource

Properties

PropertyModifierTypeDescriptionDefined in
idreadonlystringSource provenance stamped onto every discovered reference.src/batteries/skills/in_memory/index.ts:31

Methods

descriptor()

ts
descriptor(ref: SkillRef): Promise<SkillDescriptor>;

Defined in: src/batteries/skills/in_memory/index.ts:76

Returns the live descriptor for a discovered id.

Parameters

ParameterType
refSkillRef

Returns

Promise<SkillDescriptor>

Implementation of

SkillSource.descriptor


discover()

ts
discover(): AsyncIterable<DiscoveredSkill>;

Defined in: src/batteries/skills/in_memory/index.ts:71

Yields the precomputed routing metadata without loading descriptors.

Returns

AsyncIterable<DiscoveredSkill>

Implementation of

SkillSource.discover


list()

ts
list(ref: SkillRef): Promise<readonly string[]>;

Defined in: src/batteries/skills/in_memory/index.ts:100

Enumerate bundled files for materialization. MUST include every path named by a SkillScriptSpec, and MUST NOT include the body.

Parameters

ParameterType
refSkillRef

Returns

Promise<readonly string[]>

Implementation of

SkillSource.list


read()

ts
read(ref: SkillRef, path?: string): Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>;

Defined in: src/batteries/skills/in_memory/index.ts:82

Read a file from the skill. An omitted path means the skill BODY — the SKILL.md equivalent — whatever the source calls it internally. Every channel needs the body.

Parameters

ParameterType
refSkillRef
path?string

Returns

Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>

Implementation of

SkillSource.read


stat()

ts
stat(ref: SkillRef, path?: string): Promise<{
  size: number;
  version: string;
}>;

Defined in: src/batteries/skills/in_memory/index.ts:92

Reports byte size and current entry version for the body or a bundled file.

Parameters

ParameterType
refSkillRef
path?string

Returns

Promise<{ size: number; version: string; }>

Implementation of

SkillSource.stat