/** * Canonical hashes for the declarations a session reads (change: add-ledger-contract-hashes). * * The session ledger tracks code symbols by a normalized content hash, so a reformat is not a * change and a real edit is. An agent that was served `POST /v1/checkout` from `openapi.yaml`, or * an infrastructure resource, deserves the same: a note that names the ELEMENT a teammate changed, * not the file it lives in — and no note at all when the file was merely re-indented. * * Two element kinds, each hashed from what its reader actually parses: * * - **An OpenAPI/Swagger operation** is hashed over its parsed model with the sorted keys the * reader already produces (method, path, `operationId`, deprecation, parameters, request body, * success response — each carrying the reader's own Merkle hash of the schema it references). * The declaration LINE is deliberately not in the hash: an operation added above does not change * the one below it. * - **An infrastructure resource** is hashed over the normalized text of its declared span, which * is where its property values live — the normalized IaC model keeps a resource's address, type, * module, declaration header and references, not every property. A resource whose span the * extractor did not close falls back to that parsed model, which is a weaker hash: a changed * property value inside it is not seen. Both cases are whitespace-insensitive. * * Deterministic and offline: the same readers the index uses, no second grammar, no LLM. */ /** One declaration's hash, in the shape the ledger's hasher returns. */ export interface DeclarationHash { name: string; hash: string; kind: 'contract' | 'iac'; } /** * The IaC language a file is, for hashing: the extension-detected one, then the content-based * YAML/JSON disambiguation the analyze walk uses. `null` when the file is not infrastructure. * (A Helm chart member, which needs the whole file set to resolve, is not classified here: its * `Chart.yaml` is, and a template is hashed as a whole file.) */ export declare function resolveIacLanguage(file: string, content: string): string | null; /** * One entry per operation a specification declares, keyed `::` — the same id * the graph projection gives the operation node. `undefined` when the file is not a readable * specification, so the caller can fall back to its whole-file hash rather than report nothing. */ export declare function hashContractOperations(file: string, content: string): Map | undefined; /** * One entry per infrastructure resource a file declares, keyed `::
` — the same id * the IaC projection gives the resource node. `undefined` when the file declares none. */ export declare function hashIacResources(file: string, content: string, language: string): Promise | undefined>; //# sourceMappingURL=declaration-hashes.d.ts.map