Settings
Harness-wide run policy: the default extension selection, request options, retry, compaction thresholds, tool execution and queue modes. It is read at every use and never stored, so an object with getters follows the user’s preferences without a commit.
Since v0.0.0
CompactionPolicy (interface)
Section titled “CompactionPolicy (interface)”Automatic compaction thresholds; manual compaction ignores enabled.
Signature
export interface CompactionPolicy { readonly enabled: boolean /** Room kept free for the answer: generation blocks to compact above `contextWindow - reserveTokens`. */ readonly reserveTokens: number /** Approximate size of the recent context a summary keeps verbatim. */ readonly keepRecentTokens: number /** Background compaction starts this far below the blocking threshold; `0` disables it. */ readonly backgroundTokens: number}Since v0.0.0
HarnessSettings (interface)
Section titled “HarnessSettings (interface)”What the host passes; every field is optional, and getters are fine.
Signature
export interface HarnessSettings { /** The default extension selection; absent: every installed extension, in install order. */ readonly extensions?: ReadonlyArray<Extension.Any> readonly stream?: StreamOptions readonly retry?: Partial<RetryPolicy> readonly compaction?: Partial<CompactionPolicy> readonly toolExecution?: "parallel" | "sequential" readonly steeringMode?: QueueMode readonly followUpMode?: QueueMode}Since v0.0.0
QueueMode (type alias)
Section titled “QueueMode (type alias)”How many queued items of one mode a boundary places.
Signature
type QueueMode = "all" | "one-at-a-time"Since v0.0.0
Resolved (interface)
Section titled “Resolved (interface)”Every field over its built-in default, object fields merged.
Signature
export interface Resolved { readonly extensions: ReadonlyArray<Extension.Any> | undefined readonly stream: StreamOptions readonly retry: RetryPolicy readonly compaction: CompactionPolicy readonly toolExecution: "parallel" | "sequential" readonly steeringMode: QueueMode readonly followUpMode: QueueMode}Since v0.0.0
RetryPolicy (interface)
Section titled “RetryPolicy (interface)”Durable generation attempt retries.
Signature
export interface RetryPolicy { readonly enabled: boolean readonly maxRetries: number readonly baseDelayMs: number readonly maxDelayMs: number}Since v0.0.0
Settings (class)
Section titled “Settings (class)”Signature
declare class SettingsSince v0.0.0
StreamOptions (interface)
Section titled “StreamOptions (interface)”Signature
export interface StreamOptions { /** Give up on a response that stalls this long. */ readonly timeoutMs?: number}Since v0.0.0
defaultCompaction
Section titled “defaultCompaction”Signature
declare const defaultCompaction: CompactionPolicySince v0.0.0
defaultRetry
Section titled “defaultRetry”Signature
declare const defaultRetry: RetryPolicySince v0.0.0
Settings read from settings at every use.
Signature
declare const layer: (settings?: HarnessSettings) => Layer.Layer<Settings>Since v0.0.0
resolve
Section titled “resolve”Resolve host settings; reads every getter once.
Signature
declare const resolve: (settings: HarnessSettings | undefined) => ResolvedSince v0.0.0