Skip to content
2 min read · 338 words

Interface: SkillSource

Defined in: src/batteries/skills/contracts.ts:62

Runtime-neutral source seam for discovery, metadata, body bytes, and bundled files.

Properties

PropertyModifierTypeDescriptionDefined in
idreadonlystringStable provenance label; the manager rejects duplicate source ids at configuration time.src/batteries/skills/contracts.ts:64

Methods

descriptor()

ts
descriptor(ref: SkillRef, o?: {
  signal?: AbortSignal;
}): Promise<unknown>;

Defined in: src/batteries/skills/contracts.ts:68

Resolves the live descriptor and tools only when a manager operation loads the skill.

Parameters

ParameterType
refSkillRef
o?{ signal?: AbortSignal; }
o.signal?AbortSignal

Returns

Promise<unknown>


discover()

ts
discover(o?: {
  signal?: AbortSignal;
}): AsyncIterable<DiscoveredSkill>;

Defined in: src/batteries/skills/contracts.ts:66

Asynchronously yields discovery metadata; protocol conformance is checked by the suite, not the duck-guard.

Parameters

ParameterType
o?{ signal?: AbortSignal; }
o.signal?AbortSignal

Returns

AsyncIterable<DiscoveredSkill>


list()?

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

Defined in: src/batteries/skills/contracts.ts:84

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[]>


read()

ts
read(
   ref: SkillRef,
   path?: string,
   o?: {
  signal?: AbortSignal;
}): Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>;

Defined in: src/batteries/skills/contracts.ts:73

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
o?{ signal?: AbortSignal; }
o.signal?AbortSignal

Returns

Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>


stat()

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

Defined in: src/batteries/skills/contracts.ts:79

Returns source size and version for a body or bundled file without returning its bytes.

Parameters

ParameterType
refSkillRef
path?string

Returns

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