/** * Multi-agent cast: roles and per-role tool-access policy. * * Phase-2 sibling of the C# reference (`dotnet/core/src/Cast.cs`) and the Rust * engine. A *cast* is the set of named roles a lead can dispatch to; each role has * a {@link RoleKind} (Lead / Sidekick / Shadow) and a {@link Clearance} that gates * which tools it may call. * * {@link Clearance} semantics (mirrors the reference engines): * - a **deny always wins** — a denied tool is never permitted; * - a deny entry of `'*'` denies **everything** — that is how Rust spells deny-all; * - the allow side is matched **literally**: `allow('*')` permits only a tool named `*`; * - a **non-empty allow-list is a whitelist** — only listed tools are permitted; * - **empty allow + empty deny means "all tools"**. * * Clearance is wired into the agent loop: if `AgentOptions.clearance` forbids a * tool the model asked for, that tool is *not* executed — a clear "not permitted" * result is returned to the model instead, mirroring how the engine surfaces other * tool errors. */ /** A role's place in a multi-agent cast. Mirrors the reference engines' `RoleKind`. */ export declare enum RoleKind { /** The orchestrator that delegates to sidekicks. */ Lead = "lead", /** A focused specialist a lead can dispatch a sub-task to. */ Sidekick = "sidekick", /** A passive observer (e.g. for logging/critique); not directly dispatchable. */ Shadow = "shadow" } /** * Tool-access policy for a role. A deny always wins; a non-empty `allowTools` is a * whitelist; empty allow + empty deny means "all tools". `denyEverything` blocks * every tool regardless of the lists. */ export declare class Clearance { readonly allowTools: ReadonlySet; readonly denyTools: ReadonlySet; readonly denyEverything: boolean; constructor(options?: { allowTools?: Iterable; denyTools?: Iterable; denyEverything?: boolean; }); static allowAll(): Clearance; static denyAll(): Clearance; static allow(...tools: string[]): Clearance; static deny(...tools: string[]): Clearance; /** * Whether this clearance denies every tool — either via the `denyEverything` * flag or via a `'*'` entry in `denyTools`. Rust has no `denyEverything` * flag: its `Clearance::deny_all()` *is* `denyTools: ['*']`, so a role * definition shared with or migrated from Rust expresses deny-all that way. */ isDenyAll(): boolean; /** Whether `tool` is permitted under this clearance. */ isAllowed(tool: string): boolean; } /** * A named role in the cast — its kind, instructions, tool clearance, and budget. * Mirrors the reference engines' `OperatorRole`. */ export interface OperatorRole { name: string; kind: RoleKind; instructions?: string; /** Tool-access policy (defaults to allow-all when constructed via {@link makeRole}). */ permissions?: Clearance; maxIterations?: number; /** Hidden from listings (still dispatchable by name). */ hidden?: boolean; } /** Build an {@link OperatorRole} with the reference-engine defaults applied. */ export declare function makeRole(name: string, kind: RoleKind, overrides?: { instructions?: string; permissions?: Clearance; maxIterations?: number; hidden?: boolean; }): Required; /** The registered set of roles a lead can dispatch to. Mirrors the reference engines' `Cast`. */ export declare class Cast { private readonly roles; register(role: OperatorRole): this; get(name: string): OperatorRole | undefined; list(): OperatorRole[]; listVisible(): OperatorRole[]; sidekicks(): OperatorRole[]; get count(): number; get isEmpty(): boolean; } //# sourceMappingURL=cast.d.ts.map