/**
 * Per-tool contract for `task` — embedded subagent dispatch. Unlike other
 * host tools, this one runs in-process via `run-subagent.ts` rather than
 * crossing the host/worker boundary.
 */
import type { Api, Model } from '../../../ai/types.js';
import type { ChildAgentEventEmitter } from '../../../contracts/agent-api.js';
import { type HostToolRequest, type ToolContract, type ToolLlmOptionsBase } from '../../../contracts/host-tool.js';
import type { StreamFn, ToolDefinition } from '../../../core/core-types.js';
import type { AgentExecuteCodeMode } from '../../index.js';
import type { ShortcutXLPromptPlatform } from '../../prompt/build.js';
import { ExecuteCodeSurface } from '../execute-code/index.js';
export declare const TASK_KIND: "task";
export type TaskKind = typeof TASK_KIND;
export declare const TASK_QUERY_FILE_KIND: "taskQueryFile";
export type TaskQueryFileKind = typeof TASK_QUERY_FILE_KIND;
export interface TaskParams {
    readonly subagent_type: string;
    readonly name: string;
    readonly query: string;
    readonly model?: TaskSelectableModelId;
}
export interface TaskDetails {
    readonly subagent_type: string;
    readonly model?: string;
    readonly thinking_level?: string;
    readonly error?: boolean;
}
export interface TaskQueryFileParams {
    readonly query: string;
}
export interface TaskQueryFileDetails {
    readonly error?: boolean;
    readonly query_file?: string;
    readonly resolved?: boolean;
    /** Resolved query text. Required when `resolved === true`; undefined otherwise. */
    readonly resolved_query?: string;
    /** Renderer artifact prose; populated on the failure path. */
    readonly user_message?: string;
}
export type TaskQueryFileRequest = HostToolRequest & {
    readonly kind: TaskQueryFileKind;
    readonly params: TaskQueryFileParams;
};
export declare const TASK_SELECTABLE_MODEL_IDS: readonly ["claude-opus-4-8", "gpt-5.5-2026-04-23"];
export type TaskSelectableModelId = (typeof TASK_SELECTABLE_MODEL_IDS)[number];
/**
 * Options for `task.createLlmTool` — extends the base with subagent-only
 * dependencies (model resolution, streamer, optional event sink).
 */
export interface TaskLlmOptions extends ToolLlmOptionsBase {
    /** Runtime streamer — same function the main agent uses. */
    readonly streamFn: StreamFn;
    /** Resolve a subagent's model id string to a concrete `Model<Api>`. */
    readonly resolveModel: (modelId: string) => Model<Api> | undefined;
    readonly getCurrentModel?: () => Model<Api> | undefined;
    /**
     * Resolve an API key for a provider. Auth-requiring providers reject the
     * subagent's stream with 401 if this is missing.
     */
    readonly getApiKey?: (provider: string) => Promise<string | undefined> | string | undefined;
    /** Active per-turn speed inherited by child agents when the parent run set one. */
    readonly getSpeed?: () => 'fast' | 'standard' | undefined;
    readonly preferCurrentModelForSubagents?: boolean;
    /** AgentController mode propagated to the subagent's tool list. */
    readonly agentMode: AgentExecuteCodeMode;
    /** Platform surface propagated to the subagent's tools. */
    readonly executeCodeSurface: ExecuteCodeSurface;
    /**
     * Optional sink for raw child-agent events. `toolCallId` keys the parent
     * call; `subagentType` / `subagentName` are stamped here so the runner
     * stays naming-agnostic. When omitted, subagents run without streaming.
     */
    readonly emitChildAgentEvent?: ChildAgentEventEmitter;
    /**
     * Prompt platform handle. Subagent system-prompt builders use it to
     * render an API reference for the right host (web vs plugin). Required
     * if the catalog contains any subagent whose `systemPrompt` is a
     * function — the builder receives this as `ctx.platform`.
     */
    readonly promptPlatform?: ShortcutXLPromptPlatform;
    /** Session-scoped tool names unavailable to this runtime. */
    readonly disabledToolNames?: readonly string[];
    /**
     * Builds the child tool list for a subagent. The top-level host-tool builder
     * supplies this so the task contract does not import the global registry and
     * create a module cycle.
     */
    readonly buildChildTools: (options: TaskChildToolBuildOptions) => ToolDefinition[];
    /** Subagent types this task tool may launch. Omit to allow the full catalog. */
    readonly allowedSubagents?: readonly string[];
}
export interface TaskChildToolBuildOptions {
    readonly sessionPolicy: ToolLlmOptionsBase['sessionPolicy'];
    readonly spreadsheetReadOnly: boolean;
    readonly toolNames: readonly string[];
    readonly allowedSubagents?: readonly string[];
}
/** Build the `task` tool description by enumerating every registered subagent. */
export declare function buildTaskToolDescription(allowedSubagents?: readonly string[], disabledToolNames?: readonly string[]): string;
export declare const TASK_SUBAGENT_TYPE_DESCRIPTION = "Which subagent to spawn. Must be one of the documented subagent_type values.";
export declare const TASK_NAME_DESCRIPTION = "A short (3-6 word) human-readable name for this subagent run. Shown in the UI; does not affect behavior.";
export declare const TASK_QUERY_DESCRIPTION = "The full prompt the subagent will run against. Be explicit \u2014 the subagent does not see your conversation. A single sandbox .txt file path may be passed to load the prompt from that file.";
export declare const TASK_MODEL_DESCRIPTION: string;
/** If a query string is a bare `.txt` path, return it; otherwise undefined. */
export declare function resolveTaskQueryFilePath(query: string): string | undefined;
export declare const taskContract: ToolContract<TaskParams, TaskDetails, TaskLlmOptions>;
export declare const taskQueryFileContract: ToolContract<TaskQueryFileParams, TaskQueryFileDetails>;
//# sourceMappingURL=contract.d.ts.map