/** * Durable steps your workflows import from `#jigs/steps`. * Each wrapper carries its own "use step" directive and stable factory identity. * * @module factory/steps * @packageDocumentation */ import type { AgentRequest, AskJevOptions, Halt, JevQuestions, JevResult, MergeOptions, ModelRequest, PullRequestReadOptions, PullRequestRef, PullRequestWorktree, ReleasePolicy, RunResource, TicketNote, Worktree } from "@jigs-ai/jigs"; import type { LinearAgentActivityContent, LinearAgentTurnRequest } from "@jigs-ai/jigs/steps/linear"; import * as linearOperations from "@jigs-ai/jigs/steps/linear"; import * as pullRequestsOperations from "@jigs-ai/jigs/steps/pull-requests"; import type { PullRequestWorktreeRequest, WorktreeRequest } from "@jigs-ai/jigs/steps/workspaces"; /** * Prepare a worktree for this run, reusing it when the run resumes. * * @group Workspaces and resources */ export declare function provisionWorktree(request: WorktreeRequest): Promise; /** * Check out a pull request's head commit in a worktree for this run, with no branch to push. * * @group Workspaces and resources */ export declare function provisionPullRequestWorktree(request: PullRequestWorktreeRequest): Promise; /** * List every binding in the factory's configuration on GitHub, with the repository it points at. * * @group Workspaces and resources */ export declare function listBindings(): Promise<(import("@jigs-ai/jigs").RepositoryRef & { name: string; })[]>; /** * Release this run's resources now and return the report. The service already does this when * the run ends; call it to release early, to read the report, or to pass this run's policy. * * @group Workspaces and resources */ export declare function release(policy?: ReleasePolicy): Promise; /** * Execute an agent in a working directory. Use runAgent() to pass an output schema and parse its answer. * * @group Agent execution */ export declare function executeAgent(request: AgentRequest): Promise<{ jitFailure: ({ id: string; label: string; unanswered?: true; } & { ok: false; reason: string; repair: string; })[]; } | { resumeFailed: string; } | import("@jigs-ai/jigs").AgentResult>; /** * Execute a model request without tools. Use askModel() to pass an output schema and parse its answer. * * @group Agent execution */ export declare function executeModel(request: ModelRequest): Promise; /** * Execute typed decision questions against one shared state. * * @group Agent execution */ export declare function executeJev(request: AskJevOptions): Promise>; /** * Ask in the ticket's Linear agent session for human input. Use haltForHuman() to also wait for a * reply. * * @group Linear and human input */ export declare function postTicketHumanInputRequest(request: { installationName: string; issueId: string; sessionId: string; halt: Halt; }): Promise; /** * Post a note in the ticket's Linear agent session that asks for nothing and waits for nothing. * * @group Linear and human input */ export declare function postTicketNote(request: { installationName: string; issueId: string; sessionId: string; note: TicketNote; }): Promise; /** * Read a pull request's reviews, comments, CI results, approval, and merge state. * * @group Pull requests */ export declare function fetchPullRequestState(pullRequest: PullRequestRef, options?: PullRequestReadOptions): Promise; /** * Read the ticket's current details, comments, and related issues from Linear. * * @group Linear and human input */ export declare function fetchTicketSnapshot(ticket: { installationName: string; issueId: string; }): Promise; /** * Move a ticket to a named state when this workflow's policy says to. * * @group Linear and human input */ export declare function setTicketStatus(request: { installationName: string; issueId: string; stateName: string; }): Promise; /** * Resolve a Linear ticket identifier or issue ID before claiming it. * * @group Linear and human input */ export declare function resolveLinearIssue(request: { installationName: string; reference: string; }): Promise; /** * Open a Linear agent session on an issue as the factory's app, linked to this run. * * @group Linear agent sessions */ export declare function openLinearAgentSession(request: { installationName: string; issueId: string; }): Promise<{ sessionId: string; }>; /** * Post a thought, action, elicitation, response or error into a Linear agent session as the * factory's app. * * @group Linear agent sessions */ export declare function postLinearAgentActivity(request: { installationName: string; sessionId: string; content: LinearAgentActivityContent; ephemeral?: boolean; once?: string; }): Promise<{ id: string; createdAt: string; }>; /** * Replace the links a Linear agent session shows, after the run's dashboard. * * @group Linear agent sessions */ export declare function setLinearAgentSessionUrls(request: { installationName: string; sessionId: string; urls: Array<{ label: string; url: string; }>; }): Promise; /** * Run one turn of a conversation in a Linear agent session, posting its status and answers there. * Use linearAgentConversation() to hold the whole conversation. * * @group Linear agent sessions */ export declare function executeLinearAgentTurn(request: LinearAgentTurnRequest): Promise; /** * Read every message people sent into a Linear agent session, oldest first. * * @group Linear agent sessions */ export declare function listLinearAgentSessionPrompts(session: { installationName: string; sessionId: string; }): Promise; /** * Read a snapshot of the PagerDuty incident. * * @group PagerDuty incidents */ export declare function fetchIncidentSnapshot(incident: { installationName: string; incidentId: string; }): Promise; /** * Add a plain-text note to the PagerDuty incident, ending in a line that names this run. * * @group PagerDuty incidents */ export declare function postIncidentNote(note: { installationName: string; incidentId: string; content: string; }): Promise<{ noteId: string; }>; export declare namespace postIncidentNote { var maxRetries: number; } /** * Read a Slack message and its thread replies, with each author's name and email. * * @group Slack messages */ export declare function fetchSlackMessage(message: { installationName: string; channel: string; ts: string; }): Promise; /** * Post plain mrkdwn text to a Slack channel, or reply in the thread under `threadTs`. * * @group Slack messages */ export declare function postSlackMessage(message: { installationName: string; channel: string; text: string; threadTs?: string; }): Promise; export declare namespace postSlackMessage { var maxRetries: number; } /** * Prepare this run's scratch directory, preserving it when the run resumes. * * @group Workspaces and resources */ export declare function createRunDirectory(): Promise; /** * Record a resource on this run independently of the workflow's return value. * * @group Workspaces and resources * * @remarks * Register anything a person may need to find in `jigs status`. Kind and identity * together name the record; registering again updates its URL. Create external * resources in a separate step when creation is not safe to repeat, then register * them here so registration retries cannot repeat creation. The record is observation * only: jigs never deletes what it names. The kinds jigs records and releases itself * (`worktree`, `branch`, `run-directory`, `codex-home`, `pi-home`, `claude-plugins`) are reserved. */ export declare function registerResource(resource: RunResource): Promise; /** * Remove this run's scratch directory after its work is complete. * * @group Workspaces and resources */ export declare function removeRunDirectory(): Promise; /** * Check commits since the base, the branch's current commit, and uncommitted changes. * * @group Git changes * @inlineType BranchState */ export declare function readBranchState(worktree: Worktree, baseSha?: string): Promise; /** * Push the worktree's branch to its remote, including any newly committed changes. * * @group Git changes */ export declare function pushBranch(worktree: Worktree): Promise<{ headSha: string; }>; /** * Recheck approval and push only the reviewed commit, including on retries. * * @group Git changes */ export declare function pushApprovedChange(worktree: Worktree, approvedCommit: string): Promise<{ headSha: string; }>; /** * Read committed changes, defaulting to the worktree's base commit. Large diffs are truncated. * * @group Git changes */ export declare function readWorktreeDiff(worktree: Worktree, baseSha?: string): Promise; /** * Read committed file changes and subjects up to HEAD, defaulting to the worktree's base. * * @group Git changes */ export declare function readChange(worktree: Worktree, base?: string): Promise; /** * Read capped patches for literal named paths between the summary's commits. * * @group Git changes */ export declare function readPatch(worktree: Worktree, base: string, head: string, paths: string[]): Promise; /** * Create a pull request for a branch that has already been pushed. * * @group Pull requests */ export declare function createPullRequest(request: { worktree: Worktree; title: string; body: string; draft?: boolean; }): Promise; /** * Reply to an existing code-review thread on a pull request. * * @group Pull requests */ export declare function replyToPullRequestReviewThread(pullRequest: PullRequestRef, rootCommentId: number, body: string): Promise<{ id: number; }>; export declare namespace replyToPullRequestReviewThread { var maxRetries: number; } /** * Add a comment to the pull request's main conversation. * * @group Pull requests */ export declare function commentOnPullRequest(pullRequest: PullRequestRef, body: string): Promise<{ id: number; }>; export declare namespace commentOnPullRequest { var maxRetries: number; } /** * Post a review on a pull request. * * @group Pull requests */ export declare function reviewPullRequest(pullRequest: PullRequestRef, review: { event: "comment" | "approve" | "request-changes"; body: string; comments?: Array<{ path: string; line: number; body: string; }>; }): Promise<{ id: number; }>; export declare namespace reviewPullRequest { var maxRetries: number; } /** * Mark a draft pull request ready for review and return its current state. * * @group Pull requests */ export declare function markPullRequestReady(pullRequest: PullRequestRef): Promise; /** * Merge the pull request with the first method its repository allows of squash, merge commit * and rebase, pinned to the approved head. * * @group Pull requests */ export declare function mergePullRequest(pullRequest: PullRequestRef, expectedHeadSha: string, options?: MergeOptions): Promise;