import { ToolValidationError } from '@wrongstack/core/types'; import { type KanbanBoard, type KanbanCompletionGateEnforcement, type KanbanLifecycleValidationIssue, type KanbanTask } from '@wrongstack/kanban'; import type { KanbanToolOutput } from './kanban-tool-types.js'; /** One-line guidance appended when a freshly created task should be split. */ export declare function atomicityNudge(task: KanbanTask): string; /** * Host-level completion-gate fallback. The kanban package stays env-free; * only hosting surfaces (tools, webui-server) read WRONGSTACK_KANBAN_GATE, * and only when the board carries no explicit completionGate policy. */ export declare function readEnvGateEnforcement(): KanbanCompletionGateEnforcement | undefined; export type KanbanToolErrorCode = 'INVALID_INPUT' | 'NOT_FOUND' | 'REFUSED' | 'CONFLICT' | 'UNAVAILABLE' | 'ABORTED'; export interface KanbanToolErrorOptions { /** Structured lifecycle issues (REFUSED), kept for programmatic callers. */ issues?: readonly KanbanLifecycleValidationIssue[] | undefined; retryable?: boolean | undefined; /** What already committed before the failure, stated in the message. */ committed?: string | undefined; cause?: unknown; } /** Common shape of every error this tool throws on purpose. */ export interface KanbanToolFailure extends Error { readonly kanbanCode: KanbanToolErrorCode; readonly retryable: boolean; readonly issues?: readonly KanbanLifecycleValidationIssue[] | undefined; } export declare class KanbanToolError extends Error implements KanbanToolFailure { readonly kanbanCode: KanbanToolErrorCode; /** Classifier hint (see CLASSIFIER_HINT); not the Kanban code. */ readonly code: string | undefined; readonly retryable: boolean; readonly issues: readonly KanbanLifecycleValidationIssue[] | undefined; readonly committed: string | undefined; /** The bare message, without the code prefix, committed note, or issues tail. */ readonly detail: string; constructor(code: KanbanToolErrorCode, message: string, opts?: KanbanToolErrorOptions); } /** * INVALID_INPUT is a `ToolValidationError` so the executor classifies it as a * validation failure; it carries the same `kanbanCode` contract as the rest. */ export declare class KanbanInputError extends ToolValidationError implements KanbanToolFailure { readonly kanbanCode: 'INVALID_INPUT'; readonly retryable = false; readonly issues: undefined; constructor(message: string, field?: string); } export declare function invalidInput(message: string, field?: string): KanbanInputError; export declare function notFound(message: string, opts?: KanbanToolErrorOptions): KanbanToolError; export declare function refused(message: string, opts?: KanbanToolErrorOptions): KanbanToolError; export declare function conflict(message: string, opts?: KanbanToolErrorOptions): KanbanToolError; export declare function isKanbanToolFailure(err: unknown): err is KanbanToolFailure; /** * Map an error escaping a kanban handler onto the tool's error contract. * Recognised domain/transport failures become a `KanbanToolError`; anything * else (a TypeError, an unexpected invariant) is returned unchanged so it * propagates as the bug it is instead of being dressed up as a refusal. */ export declare function toKanbanToolError(err: unknown, committed?: string): unknown; /** Successful results always carry `ok: true`; failures throw (see above). */ export declare function okBoard(board: KanbanBoard, message?: string): KanbanToolOutput; export declare function okTask(board: KanbanBoard, task: KanbanTask, message: string): KanbanToolOutput; /** * Resolve a task reference (full id or unique prefix) against a loaded board, * with the same semantics as the domain's `findTask`. An ambiguous prefix is * an input error rather than a silent "not found". */ export declare function resolveTaskRef(board: KanbanBoard, taskRef: string): KanbanTask | undefined; //# sourceMappingURL=kanban-tool-results.d.ts.map