/** * Workflow operations bound to your factory's durable step wrappers, imported from * `#jigs/routines`. Routines compose recorded steps and waits; they have no recorded result of * their own. * * @module factory/routines * @packageDocumentation */ import type { LinearAgentConversationOptions, LinearDelegationInputs, LinearMentionInputs, SlackQuestion } from "@jigs-ai/jigs"; /** * Run an agent with tools and validate its answer against your output schema. * * @group Agents and models */ export declare const runAgent: (config: import("@jigs-ai/jigs").RunAgentOptions) => Promise>; /** * One agent across several turns: resumes the session it holds, or starts fresh when it cannot. * * @group Agents and models * * @remarks * Each turn supplies an incremental `resume` prompt and a complete `fresh` prompt. * A prompt may be a function, evaluated only when selected. A missing session or * changed harness descriptor starts fresh. The helper is rebuilt on replay; * recorded `AgentSessionRef` data restores the session reference. * * @inlineType AgentSessionOptions */ export declare const agentSession: (options: import("@jigs-ai/jigs/routines").AgentSessionOptions) => import("@jigs-ai/jigs/routines").AgentSession; /** * Ask an agent harness without tools or a worktree. * * @group Agents and models */ export declare const askAgent: (config: import("@jigs-ai/jigs").AskAgentOptions) => Promise>; /** * Ask a model without tools and validate its answer against your output schema. * * @group Agents and models */ export declare const askModel: (config: import("@jigs-ai/jigs").AskModelOptions) => Promise>; /** * Ask a decision model named questions and receive calibrated typed answers. * * @group Agents and models */ export declare const askJev: (config: import("@jigs-ai/jigs").AskJevOptions) => Promise>; /** * Ask in the ticket's Linear agent session and wait for a reply there. * * @group Linear and human input * * @remarks * Posts the question in the session the claim holds, then waits until someone * answers in it. Messages sent there since the run last read it answer at once. * The question mentions the operator (or the ticket's creator) and the assignee; * list more emails in the halt's `mention`. * * @inlineType HaltForHumanFn */ export declare const haltForHuman: import("../dist/index-DJ6CHaMc.js").U; /** * Post a note in the ticket's Linear agent session that asks for nothing and waits for nothing. * Set `run: "ended"` on the run's last note, success or not, to end the session. Set * `run: "waiting"` before a long wait on people, so the session shows awaiting input and never * goes stale. * * @group Linear and human input */ export declare const noteOnTicket: (claim: import("@jigs-ai/jigs").TicketClaim, note: import("@jigs-ai/jigs").TicketNote) => Promise; /** * Resolve a Linear ticket in the named Linear installation, claim it, and read its requirements, * before any protected work. The run opens a Linear agent session on the ticket, or takes the * `session` that started it, and talks to people only there. * * @group Linear and human input */ export declare const acquireTicket: (ticket: { installationName: string; reference: string; session?: string; }) => Promise<{ claim: import("@jigs-ai/jigs").TicketClaim; snapshot: import("@jigs-ai/jigs").TicketSnapshot; }>; export declare const /** * Read branch state, failing unless there is a new commit and no uncommitted work. * * @remarks * Counts commits since the worktree base, or `options.since` when supplied. * Returns the head SHA, commit count and clean state; fails with a repair hint * if the agent left no new commit or uncommitted changes. * * @group Git changes * @inlineType CommittedWorkOptions * @inlineType BranchState */ committedWork: (worktree: import("@jigs-ai/jigs").Worktree, options?: import("@jigs-ai/jigs/routines").CommittedWorkOptions) => Promise; /** * Read current pull request facts, then yield changed snapshots until it closes. * * @group Pull requests * * @remarks * Reads once immediately, then rereads on each GitHub event from the hub and on `jigs poke`. * Duplicate wakes and reordered collections with unchanged facts do not yield again. * Snapshots include comments regardless of author or jigs markers; the workflow * owns decisions, action limits and merging. A closed snapshot is yielded once. * Leaving the loop releases the watch. Only one run may watch a pull request; * a second owner receives `ClaimConflictError`. */ export declare const watchPullRequest: (pr: import("@jigs-ai/jigs").PullRequestRef, options?: import("@jigs-ai/jigs").PullRequestReadOptions) => AsyncGenerator; /** * Post a note about a commit, once per head and reason. * * @group Pull requests * * @remarks * Reads current comments and skips a note already marked with this scope, head and reason. * Use `ci` for a CI update, `merge` for a merge refusal, or `merge-retry` for a temporary * refusal. The reason does not change readiness or schedule more work. Posting failures * are logged and return without throwing; the workflow decides whether to try again. */ export declare const postPullRequestNote: (options: Omit) => Promise; /** * Build and review a delivery's change until the reviewer raises no blocking finding. * Ends `approved` with the reviewed commit, or `stopped` when the rounds run out or there is * nothing to review. * * @group Pull request delivery */ export declare const buildAndReview: (delivery: import("@jigs-ai/jigs").BuildDelivery, options: import("@jigs-ai/jigs").BuildAndReviewOptions) => Promise; /** * Have the writer, or the builder, write the pull request's title and body from the diff. * An optional `check` returns problems; the writer is sent back once with them. * * @group Pull request delivery */ export declare const describePullRequest: (delivery: import("@jigs-ai/jigs").DescribeDelivery, options?: import("@jigs-ai/jigs").DescribeOptions) => Promise; /** * Push exactly the given commit and open its pull request with the given title and body. * * @group Pull request delivery */ export declare const publishPullRequest: (delivery: import("@jigs-ai/jigs").PublishDelivery, options: import("@jigs-ai/jigs").PublishOptions) => Promise; /** * Follow a delivery's pull request until it merges or closes, waking the builder for feedback. * Ends `merged` or `closed`. * * @group Pull request delivery * * @remarks * `wake` decides what wakes the builder; pass `builderWakeFacts` for the default rules. A pull * request that needs a person, a blocked merge included, reaches the workflow through * `onNeedsHuman` with facts; the workflow words and sends any note. When `mergeWhen` agrees, an * approved, green, clean pull request merges once local work is published. */ export declare const followPullRequestToOutcome: (delivery: import("@jigs-ai/jigs").FollowDelivery, pr: import("@jigs-ai/jigs").PullRequestRef, options: import("@jigs-ai/jigs").FollowOptions) => Promise; /** * Wait for a human reply in a Slack thread after `lastRead`. Ends `replied` with every such * reply, never empty and oldest first, `timed-out` after `until`, or `gone` if deleted. * * @remarks * Binds the library's `waitForSlackReply` routine to this factory's `fetchSlackMessage` * step; its documentation covers deadlines, wakes, deletion and conflicts. * * @group Slack messages */ export declare const waitForSlackReply: (question: SlackQuestion) => Promise; /** * Hold a conversation with Claude in the Linear agent session that started this run, until no * one replies for `idleFor` (four hours by default), someone presses stop, or a turn fails. * * @remarks * Binds the library's `linearAgentConversation` routine to this factory's steps; its * documentation covers turns, stops and what Linear shows. * * @group Linear agent sessions */ export declare const linearAgentConversation: (session: LinearDelegationInputs | LinearMentionInputs, options: LinearAgentConversationOptions) => Promise; export type { AgentSession, AgentSessionTurn } from "@jigs-ai/jigs/routines";