import { Schema } from "effect"; import type { Tool } from "effect/unstable/ai"; import type { Agent, ToolSchedulingPolicy } from "../agent/agent.js"; import { BudgetLimits } from "./run-budget.js"; import { AgentPin, CapabilityPin, ModelPin } from "./pin.js"; import { NamedCapability, PinnedContent, type NamedCapabilityEncoded } from "./capability.js"; import { ProgramBudget, type ProgramAgentCapability } from "./program-manifest.js"; export { NamedCapability, PinnedContent, type NamedCapabilityEncoded }; /** @experimental One child profile name this Agent may select from its executable registry. */ export interface ChildSelection { readonly selection: string; } export interface PortablePolicy { readonly _tag: "Forever" | "Recurs" | "UntilToolCall" | "Both"; readonly count?: number; readonly name?: string; readonly first?: PortablePolicy; readonly second?: PortablePolicy; } /** @experimental Exact identity of either a portable policy or an opaque policy capability. */ export type PolicyIdentity = { readonly _tag: "Portable"; readonly policy: PortablePolicy; } | { readonly _tag: "Pinned"; readonly pin: CapabilityPin; }; /** @experimental Exact identity and token limits of one reconstructable compaction capability. */ export interface CompactionIdentity { readonly service: CapabilityPin; readonly summaryModel: ModelPin; readonly contextWindow: number; readonly reserveTokens: number; readonly keepRecentTokens: number; readonly strategyIdentity: string; readonly summaryPromptIdentity: string; } /** @experimental Maximum Program authority an Agent may narrow for one dynamic child. */ export interface ProgramAuthority { readonly sandbox: CapabilityPin; readonly input: CapabilityPin; readonly output: CapabilityPin; readonly maxSourceBytes: number; readonly tools: ReadonlyArray; readonly agents: ReadonlyArray; readonly steps: ReadonlyArray; readonly budget: ProgramBudget; } /** @experimental Closed, reconstructable identity contract for one Agent. */ export interface AgentManifest { readonly version: "2"; readonly name: string; readonly instructions?: string; readonly supplemental?: string; readonly model: ModelPin; readonly tools: ReadonlyArray; readonly skills: ReadonlyArray; readonly services: ReadonlyArray; readonly policy: PolicyIdentity; readonly toolScheduling: ToolSchedulingPolicy; readonly compaction?: CompactionIdentity; readonly programAuthority?: ProgramAuthority; readonly budget: BudgetLimits; readonly children: ReadonlyArray; } export type PolicyIdentityEncoded = { readonly _tag: "Portable"; readonly policy: PortablePolicy; } | { readonly _tag: "Pinned"; readonly pin: string; }; export interface CompactionIdentityEncoded extends Omit { readonly service: string; readonly summaryModel: string; } export interface AgentManifestEncoded extends Omit { readonly model: string; readonly tools: ReadonlyArray; readonly skills: ReadonlyArray; readonly services: ReadonlyArray; readonly policy: PolicyIdentityEncoded; readonly compaction?: CompactionIdentityEncoded; readonly programAuthority?: { readonly sandbox: string; readonly input: string; readonly output: string; readonly maxSourceBytes: number; readonly tools: ReadonlyArray; readonly agents: ReadonlyArray<{ readonly selection: string; readonly agent: string; readonly input: string; }>; readonly steps: ReadonlyArray; readonly budget: typeof ProgramBudget.Encoded; }; readonly children: ReadonlyArray; } /** @experimental One child profile name this Agent may select from its executable registry. */ export declare const ChildSelection: Schema.Codec; /** @experimental Closed portable turn-policy constructor data. */ export declare const PortablePolicy: Schema.Codec; /** @experimental Exact identity of either a portable policy or an opaque policy capability. */ export declare const PolicyIdentity: Schema.Codec; /** @experimental Exact identity and token limits of one reconstructable compaction capability. */ export declare const CompactionIdentity: Schema.Codec; /** @experimental Maximum Program authority an Agent may narrow for one dynamic child. */ export declare const ProgramAuthority: Schema.Struct<{ readonly sandbox: Schema.brand; readonly input: Schema.brand; readonly output: Schema.brand; readonly maxSourceBytes: Schema.Int; readonly tools: Schema.$Array; readonly content: Schema.optionalKey>; }>>; readonly agents: Schema.$Array; readonly input: Schema.brand; }>>; readonly steps: Schema.$Array; readonly content: Schema.optionalKey>; }>>; readonly budget: Schema.Struct<{ readonly agentRuns: Schema.Int; readonly concurrency: Schema.Int; readonly toolCalls: Schema.Int; readonly tokens: Schema.Int; readonly wallClockMillis: Schema.Int; readonly logBytes: Schema.Int; readonly outputBytes: Schema.Int; }>; }>; /** @experimental Closed, reconstructable identity contract for one Agent. */ export declare const AgentManifest: Schema.Codec; /** @experimental An Agent manifest paired with its constructor-owned digest. */ export interface PinnedAgent { readonly pin: AgentPin; readonly manifest: AgentManifest; } /** @experimental Construct and pin a canonical closed Agent manifest. */ export declare const make: (input: Omit & { readonly version?: "2"; }) => PinnedAgent; /** @experimental Build an exact manifest for a live Agent using explicitly supplied opaque dependencies. */ export declare const fromLiveAgent: { , R, PolicyServices, AuthorizationServices>(identity: { readonly model: ModelPin; readonly tools: ReadonlyArray; readonly skills: ReadonlyArray; readonly services: ReadonlyArray; readonly policy: PolicyIdentity; readonly compaction?: CompactionIdentity; readonly programAuthority?: ProgramAuthority; readonly budget: BudgetLimits; readonly children: ReadonlyArray; }): (agent: Agent) => PinnedAgent; , R, PolicyServices, AuthorizationServices>(agent: Agent, identity: { readonly model: ModelPin; readonly tools: ReadonlyArray; readonly skills: ReadonlyArray; readonly services: ReadonlyArray; readonly policy: PolicyIdentity; readonly compaction?: CompactionIdentity; readonly programAuthority?: ProgramAuthority; readonly budget: BudgetLimits; readonly children: ReadonlyArray; }): PinnedAgent; };