import { type RequestType } from './artifact-prerequisites.js'; /** * Where a request artifact's effective type came from. * * `default` means the body carried no usable `- type:` line, so * `DEFAULT_REQUEST_TYPE` was substituted. Nothing else in the repository tells * that apart from a deliberate `- type: feature`, and the substitution has a * price: measured 2026-10-13 through `getPrerequisitesFor`, the `feature` row at * `rd:qa-handoff` demands 9 artifacts, `bugfix` 10, `docs` and `chore` none. The * locked PRD handoff for this slice states 10 for `feature`; 9 is what the * function returns. * * `peaks request init` writes a type line only when `--type` was passed, so the * absence of the line survives creation instead of being stamped over with the * default at the moment the distinction is first knowable. */ export type RequestTypeSource = 'declared' | 'default'; export type ArtifactMetadata = { state: string; requestType: RequestType; requestTypeSource: RequestTypeSource; createdAt?: string; sessionId?: string; }; /** * Read the fields of a request artifact body. Moved verbatim out of * `request-artifact-service.ts` when the type's provenance was added; the only * behaviour change is `requestTypeSource`, which records whether a usable * `- type:` line was actually present. * * THIS READER IS THE CANONICAL `- type:` RULE. `.husky/pipeline/request-type-line.mjs` * reimplements it because that module must load under bare `node` and cannot import * `src/**`, and `tests/unit/hooks/pipeline-verify-type-derivation.test.ts` drives * both readers over one corpus so they cannot drift. The rule: each line is * trimmed, the bullet is a hyphen, the value is everything after `type:` and must * be a request type (`isRequestType`), and the LAST usable line wins — an unusable * later line does not erase an earlier usable one, and no usable line leaves the * default with source `default`. */ export declare function extractMetadata(markdown: string): ArtifactMetadata;