import type { JamDeps } from "../deps.js"; import type { CreateIssueInput, CreateIssueWritePlan, WritePlanReceipt } from "../domain/write.js"; export type PlanCreateIssueRequest = { input: Record; }; /** * Work out whether an issue can be created here, and describe the one JAM * would create. * * Reads only - the create metadata endpoints answer questions about a * project's configuration and change nothing. The order is the point: * * 1. Validate the request against JAM's own contract. Anything refusable * without asking Jira is refused before a round trip is spent on it. * 2. Ask Jira which issue types this account can create here, and resolve the * requested one against that list. An id is never derived from a name. * 3. Ask Jira what that issue type's create screen requires, and refuse now if * it requires something JAM cannot express. A create JAM knows Jira will * reject is not sent. * 4. Resolve every constrained value against Jira's own allowed list. * * What comes out is a plan that records not just the intended issue but the * premises it rests on, so apply can check they still hold. * * The target project is never a parameter. It is the project this workspace is * bound to, which is what the user consented to when they set JAM up; taking * it from the caller would make the binding advisory. */ export declare function planCreateIssue(deps: JamDeps, request: PlanCreateIssueRequest): Promise<{ plan: CreateIssueWritePlan; receipt: WritePlanReceipt; }>; /** The project this workspace is bound to, or a refusal that says so. */ export declare function configuredProject(deps: JamDeps): string; /** * Check the request against the create contract, and normalize it. * * Pure: no Jira, no state. `key` is not accepted here at all - there is no * issue to name - and neither is `project`, which comes from the binding. * Anything outside CREATABLE_FIELDS is rejected rather than ignored: silently * dropping a field an agent asked for would create an issue that is not the * one it described. */ export declare function validateCreateInput(raw: Record): CreateIssueInput; /** Whitelisted values to the shapes Jira's create API expects. */ /** * Exported because apply derives these again and compares - see * `assertCreateMutationMatchesInput` in apply-create-issue.ts. Planning and * applying must produce the same fields from the same input, so they call one * function rather than two that are supposed to agree. */ export declare function toJiraCreateFields(projectKey: string, issueTypeId: string, input: CreateIssueInput, resolved: { priority?: string; components?: string[]; }): Record;