import { type Static, Type } from "typebox"; import type { LaneRecord } from "../autonomy/lane-tracker.ts"; import { type WorkerAgentBroadcastTargetResult, type WorkerAgentControlPort } from "../delegation/worker-agent-control.ts"; import type { WorkerDelegationRequest } from "../delegation/worker-delegation-request.ts"; import type { WorkerRunOutcome } from "../delegation/worker-runner.ts"; import type { ToolDefinition } from "../extensions/types.ts"; import { type OrchestrationThinkingLevel } from "../orchestration/contracts.ts"; import type { TaskProfileWriterPort } from "../orchestration/task-profile-writer.ts"; import type { WorkerModelPinPolicy } from "../orchestration/worker-model-pins.ts"; import { type DelegateStatusDependencies, type DelegateStatusToolDetails } from "./delegate-status.ts"; import { type DelegateProfileToolDetails } from "./profile-writer.ts"; export declare const DELEGATE_ACTIONS: readonly ["start", "tasks", "list", "transcript", "wait", "wait_many", "interrupt", "resume", "retire", "cancel", "send", "broadcast", "follow_up", "inbox", "inbox_wait", "inbox_ack", "reply", "status", "review", "profile_inspect", "profile_create"]; export type DelegateAction = (typeof DELEGATE_ACTIONS)[number]; declare const delegateSchema: Type.TObject<{ task: Type.TOptional; baseProfileId: Type.TOptional; action: Type.TOptional; profileId: Type.TOptional; model: Type.TOptional>; thinkingLevel: Type.TOptional[]>>; path: Type.TOptional; toolNames: Type.TOptional>; instructions: Type.TOptional; agentId: Type.TOptional; agentIds: Type.TOptional>; dependsOn: Type.TOptional>; requirementId: Type.TOptional; requirementIds: Type.TOptional>; forkTurns: Type.TOptional; mode: Type.TOptional, Type.TLiteral<"all">]>>; message: Type.TOptional; threadId: Type.TOptional; replyToMessageId: Type.TOptional; requestMessageId: Type.TOptional; messageId: Type.TOptional; ackToken: Type.TOptional; expectReply: Type.TOptional; cursor: Type.TOptional; maxMessages: Type.TOptional; timeoutMs: Type.TOptional; laneId: Type.TOptional; }>; export type DelegateToolInput = Static; export interface DelegateRunOutcome { started: boolean; skipReason?: string; record?: LaneRecord; outcome?: WorkerRunOutcome; } export interface DelegateDispatchToolDetails { started: boolean; action?: DelegateAction; agentId?: string; agentIds?: readonly string[]; agentIdsOmitted?: number; skipReason?: string; profileId?: string; modelRef?: string; thinkingLevel?: OrchestrationThinkingLevel; laneId?: string; label?: string; status?: LaneRecord["status"]; reasonCode?: string; accepted?: boolean; costUsd?: number; summary?: string; blockers?: readonly string[]; queued?: boolean; messageId?: string; broadcastResults?: readonly WorkerAgentBroadcastTargetResult[]; broadcastResultsOmitted?: number; timedOut?: boolean; replayed?: boolean; /** * Set when a pin policy is active, the effective role had no pin, and this delegation requested * an explicit model — the owner's model pin was evaded, not merely inapplicable. Diagnostics * only: admission was never blocked on this. Value is the effective role that bypassed the pin. */ modelPinBypass?: string; } type DelegateDispatchDetailProjection = Partial>; export type DelegateToolDetails = (DelegateDispatchToolDetails | DelegateStatusToolDetails | DelegateProfileToolDetails) & DelegateDispatchDetailProjection; export type DelegateCaller = { kind: "session_root"; } | { kind: "worker"; agentId: string; }; export interface DelegateToolDependencies { startWorkerDelegation?: (args: WorkerDelegationRequest) => { started: false; skipReason: string; } | { started: true; record: LaneRecord; modelPinBypass?: string; }; runWorkerDelegation: (args: WorkerDelegationRequest) => Promise; orchestrationProfiles?: readonly { profileId: string; role: string; description: string; }[]; /** Active owner settings only; omitted/absent preserves the existing lean prompt verbatim. */ workerModelPinPolicy?: WorkerModelPinPolicy; workerAgentControl?: WorkerAgentControlPort; /** Root-only bounded lane inspection and durable mutation-review acknowledgement. */ status?: DelegateStatusDependencies; /** Root-only immutable session task-profile inspection and creation. */ profileWriter?: TaskProfileWriterPort; /** Required host-owned caller class. Missing identity never aliases the session root. */ caller: DelegateCaller; /** Host-owned durable turn identity used only by actions that can mutate worker mailboxes. */ resolveMessageReplayScope?: () => { sessionId: string; branchId: string; }; /** * The session's existing warning channel (e.g. WorkerDelegationController.safeWarn), if the * caller has one wired. Used only to surface prompt-guideline bounding diagnostics (a guideline * dropped or truncated to fit the provider prompt budget) — never required for correct operation. */ warn?: (message: string) => void; } export declare function createDelegateToolDefinition(deps: DelegateToolDependencies): ToolDefinition; export {}; //# sourceMappingURL=delegate.d.ts.map