/** * `--contract` task creation and target pinning for `send`, split out of `send.ts` * (Issue #4128). */ import type { SendOptions } from '../types'; import type { AutoYesContractPolicy, TaskView } from '../types/api-responses'; import { ApiClient } from '../utils/api-client'; import type { CommandTarget } from './command-target'; import type { RoleAssignmentInput } from '../../types/agent-roles'; import type { RelayEndpointArg } from './relays'; /** * The `autoYes` block of a just-created task in the shape `describeContractPolicy` * reads (Issue #3723), or null when the response carries none. Read defensively: * `contract_json` is replayed verbatim, never re-validated. */ export declare function contractPolicyOf(task: TaskView): AutoYesContractPolicy | null; /** * Create the task row for `--contract` and get the message to send back. * * The contract is parsed server-side: the path is relative to the worktree, * which only the server can resolve, and the completion criterion is expanded * from that worktree's verify.yaml. Every violation the server found is printed * before exiting, so a broken contract is fixed in one pass (Issue #1545). */ export declare function createContractTask(client: ApiClient, worktreeId: string, options: SendOptions, agent: string | undefined, instanceId: string | undefined, replyTo: RelayEndpointArg | undefined): Promise<{ task: TaskView; message: string; contractPolicy: AutoYesContractPolicy | null; }>; /** * The tool and instance a request naming neither is answered for: the worktree's * default, whose primary instance has the tool's own id (#868). */ export declare function effectiveTarget(client: ApiClient, worktreeId: string, agent: string | undefined, instanceId: string | undefined): Promise<{ cliToolId: string | undefined; instanceId: string | undefined; }>; /** * The target of a conditional send that makes several requests about it (Issue #4116), * named in all of them. Left to the server, each resolves the default for itself: a * default moved from A to B between two of them has a read of A, a grant on B, a save on * A and a message to B. So a refusal could then withdraw B's grant on A's evidence. */ export declare function pinCommandTarget(client: ApiClient, worktreeId: string, target: CommandTarget): Promise; /** * `--contract` with a role (Issue #4116): the task check compares the process with * the SETTINGS, so `--role A` to a process running A while the setting says B would be * refused for a setting this very command is replacing. A plain `send --role` saves, * then checks; refused here, this does the same and checks again. Only then, because * the contract is read first: a broken contract saves nothing. * * The save has what `POST /send` has before its own: the roster and the tool read * again, against what this command was resolved to. Anything moved is exit 31 with * nothing saved, up to the PUT itself, which carries the revision read (#4132). A change * after that is seen only in its answer, which is then told. From the save on, anything * that ends this command leaves the setting saved, so it is said right then. A PUT with * no usable answer may have saved too, which {@link roleWrite} says. */ export declare function createContractTaskWithRole(client: ApiClient, worktreeId: string, options: SendOptions, agent: string | undefined, instanceId: string | undefined, role: RoleAssignmentInput | undefined, replyTo: RelayEndpointArg | undefined): ReturnType; //# sourceMappingURL=send-contract.d.ts.map