@wildo-ai/platform-config-lib 1.1.13 → 1.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/esm/bootstrap/application-scheduled-jobs.contracts.d.ts +187 -0
  2. package/dist/esm/bootstrap/application-scheduled-jobs.contracts.d.ts.map +1 -0
  3. package/dist/esm/bootstrap/application-scheduled-jobs.contracts.js +250 -0
  4. package/dist/esm/bootstrap/application-scheduled-jobs.contracts.js.map +1 -0
  5. package/dist/esm/bootstrap/minion-database-queue-confinement.contracts.d.ts +41 -0
  6. package/dist/esm/bootstrap/minion-database-queue-confinement.contracts.d.ts.map +1 -0
  7. package/dist/esm/bootstrap/minion-database-queue-confinement.contracts.js +53 -0
  8. package/dist/esm/bootstrap/minion-database-queue-confinement.contracts.js.map +1 -0
  9. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +12 -0
  10. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  11. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +12 -0
  12. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  13. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts +64 -0
  14. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts.map +1 -1
  15. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js +49 -0
  16. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js.map +1 -1
  17. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts +23 -2
  18. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
  19. package/dist/esm/bootstrap/runtime-backing-service-access.js +23 -4
  20. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
  21. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts +14 -0
  22. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
  23. package/dist/esm/bootstrap/runtime-topology.contracts.js +24 -0
  24. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  25. package/dist/esm/index.d.ts +2 -0
  26. package/dist/esm/index.d.ts.map +1 -1
  27. package/dist/esm/index.js +2 -0
  28. package/dist/esm/index.js.map +1 -1
  29. package/dist/esm/key-management/approval-seal-verifier.d.ts +72 -2
  30. package/dist/esm/key-management/approval-seal-verifier.d.ts.map +1 -1
  31. package/dist/esm/key-management/approval-seal-verifier.js +102 -0
  32. package/dist/esm/key-management/approval-seal-verifier.js.map +1 -1
  33. package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts +1 -1
  34. package/dist/esm/pnpm-settings/application-pnpm-settings.js +1 -1
  35. package/dist/esm/pnpm-settings/application-pnpm-settings.js.map +1 -1
  36. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  37. package/dist/esm/project-config/define-infra-env-config.js +12 -1
  38. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  39. package/dist/esm/project-config/hosted-infra-env-config.js +8 -1
  40. package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
  41. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  42. package/dist/esm/project-config/provider-companion-discovery.js +1 -0
  43. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  44. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +23 -0
  45. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  46. package/dist/esm/project-config/provider-runtime-artifacts.js +68 -5
  47. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  48. package/dist/esm/project-config/shared/csp-defaults.d.ts +7 -3
  49. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
  50. package/dist/esm/project-config/shared/csp-defaults.js +10 -4
  51. package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
  52. package/dist/esm/project-config/shared/environment.schemas.d.ts +52 -6
  53. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  54. package/dist/esm/project-config/shared/environment.schemas.js +80 -6
  55. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  56. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +8 -0
  57. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  58. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  59. package/dist/tsconfig.build.tsbuildinfo +1 -1
  60. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"approval-seal-verifier.js","sourceRoot":"","sources":["../../../src/key-management/approval-seal-verifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,6BAA6B,EAAE,+BAA+B,EAAE,eAAe,EAA8C,iBAAiB,EAAE,eAAe,EAAE,sBAAsB,EAAwB,MAAM,uBAAuB,CAAC;AACtP,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,EAAsB,MAAM,aAAa,CAAC;AACpG,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAC5F,OAAO,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxJ,OAAO,EAAE,+BAA+B,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,8BAA8B,EAC9B,4BAA4B,GAG7B,MAAM,2BAA2B,CAAC;AAEnC,qCAAqC;AACrC,MAAM,iBAAiB,GAAG,eAAe,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;AAE3E,4FAA4F;AAC5F,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,CAAU,CAAC;AAyEjE,wDAAwD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M,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC;SACxK,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,KAAK,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,qFAAqF,EAAE,CAAC;SACxL,QAAQ,EAAE;CACd,CAAC,CAAC","sourcesContent":["/**\n * # Verifying an approval seal, offline (#2903)\n *\n * Everything a verifier needs travels with the seal: the compact JWS, the stored records of the keys that may have signed\n * it (their public half, scope and issuer, as an export carries them), and, when the person's content is to be shown,\n * the disclosures. Nothing here calls the application or the platform, so a seal verifies after the application is gone.\n *\n * ## What is checked, and on whose authority\n *\n * - The header: ES256 is pinned per key from the key RECORD, never read from the header (RFC 8725 §3.1); `jku`, `x5u`,\n * `jwk` and `x5c` are never followed (RFC 8725 §3.10, RFC 7515 §10.7); a `crit` naming anything is refused, since no\n * extension is understood (RFC 7515 §4.1.11); `typ` must be the approval seal's.\n * - The signature, under the key the `kid` names among those given.\n * - The issuer: the payload's `iss` must be the key record's, and the expected issuer when one is given.\n * - The claims: the version-1 shape, strict.\n * - The key's scope, from its stored record and never from a JWKS member: an organization-scoped key verifies only a seal\n * whose tenant is that organization.\n * - The disclosures: each must digest to the commitment its claim names; a commitment with no disclosure is reported as\n * erased (the person's content was removed, the seal stands).\n * - A FILE deliverable (#2904), when the seal attests one: the file's bytes, hashed and salted with the salt its row\n * kept, must give the commitment the disclosed presentation binds it by. One changed byte fails the seal; bytes not\n * given are reported as such (a missing file), never as a match.\n * - A MANIFESTED COPY (#2907), when the seal's deliverable has one: the copy is rebuilt from its own prefix, the JWS, the\n * inputs it carries (its words, its pinned font, its verification address) and the disclosed approver's printed name,\n * and must equal the bytes given, and the host's record of its hash when the bundle states one; its prefix must then open the seal's commitment\n * to the approved file, which ties the copy to the original without the original being supplied. One changed byte in\n * the approval page fails the seal. A copy the approver's erasure deleted is reported CONTENT_ERASED, never missing.\n * - The CURRENCY of the approval over its record (#2914), when the record as it is now is given: the values of the fields\n * the approval covers, as the disclosed presentation carries them, compared with the record. A record changed since is\n * NOT a failure: the seal still proves what was approved; it is reported NO_LONGER_CURRENT. Without the presentation\n * disclosed there is nothing to compare, and it is reported as having no sealed field set, never as current.\n * - A COMPROMISED key: the signature may still verify, but the seal is not PROVABLE unless corroborated by evidence the\n * key's holder could not have forged: the decision's payload digest recorded outside the application before the\n * compromise instant (an exported audit event, an immutable sink).\n * - The OPERATOR'S PIN SET, when one is given (#2932): the key must be pinned, by the RFC 7638 thumbprint of the public\n * half the verifier was handed (so a key record that names a pinned `kid` over another key is refused), and the pin's\n * state, scope and compromise instant are used instead of the record's. The record (from a bundle, from the host)\n * only supplies the public half and the issuer; the operator's pin decides whether that half is theirs and what became\n * of it. Without a pin set the records are trusted as given, as before.\n * - The OPERATOR'S KEPT SIGNING-LOG EXPORTS, when given (#2932): a seal under a key compromised after an export that lists\n * it is corroborated by that export, which the host could not have signed after the compromise without the operator's\n * copy disagreeing. Each export is verified here, with the operator's pin set for the export key.\n *\n * spec-cite: RFC 8725 §3.1 (algorithm verification), §3.10 (do not trust received URLs); RFC 7515 §4.1.11 (`crit`),\n * §10.7 (key selection from header parameters). Cited by section; the behaviour is this file's decision.\n */\nimport { createHash } from 'node:crypto';\nimport { z } from 'zod';\nimport { approvalSealSubjectCurrencyOf, humanDecisionBoundDeliverableOf, singleJwsTypeOf, type ApprovalSealSubjectCurrencyAssessment, CryptoKey_Purpose, CryptoKey_Scope, CryptoKey_VersionState, type CryptoKeyPinSet } from '@wildo-ai/saas-models';\nimport { ES256_JWS_ALGORITHM, isP256PublicJwk, verifyEs256, type P256PublicJwk } from './es256-jws';\nimport { decisionPayloadDigestOf, sealClaimsDigestOf } from './signature-request.contracts';\nimport { VerificationKeyRecordSchema, compareSigningLogExports, pinnedVerificationKeyOf, verifySigningLogExport } from './signing-log-export.contracts';\nimport { checkApprovalSealManifestedCopy } from './approval-seal-manifested-copy';\nimport {\n ApprovalSealClaimsV1Schema,\n ApprovalSealDisclosureClaim,\n approvalSealDisclosureDigestOf,\n approvalSealFileCommitmentOf,\n type ApprovalSealClaimsV1,\n type ApprovalSealDisclosureValue,\n} from './approval-seal.contracts';\n\n/** The approval seal's JWS `typ`. */\nconst APPROVAL_SEAL_TYP = singleJwsTypeOf(CryptoKey_Purpose.APPROVAL_SEAL);\n\n/** The payload members the custodian sets; the rest is the decision's committed payload. */\nconst CUSTODIAN_SET_CLAIMS = ['iss', 'iat', 'lateSeal'] as const;\n\n/** One key that may have signed a seal: its STORED record (scope, issuer, state), as an export carries it. */\nexport interface ApprovalSealVerificationKey {\n readonly kid: string;\n readonly publicJwk: P256PublicJwk;\n /** The algorithm the key record pins. ES256 for every approval-seal key today. */\n readonly alg: typeof ES256_JWS_ALGORITHM;\n readonly scope: CryptoKey_Scope;\n /** The application's id for an APPLICATION key, the organization's for an ORGANIZATION key. */\n readonly scopeId: string;\n readonly iss: string;\n readonly state: CryptoKey_VersionState;\n /** ISO 8601, for a COMPROMISED key: the earliest instant its private half may have been exposed. */\n readonly compromiseInstant?: string;\n}\n\n/** Evidence recorded OUTSIDE the application that the decision's payload existed before a key's compromise. */\nexport interface ApprovalSealCorroboration {\n readonly decisionPayloadDigest: string;\n /** ISO 8601: when the evidence was recorded where the key's holder could not rewrite it. */\n readonly recordedAt: string;\n}\n\nexport interface ApprovalSealVerificationInput {\n readonly jws: string;\n readonly keys: readonly ApprovalSealVerificationKey[];\n /** The issuer the seal must carry, when the verifier knows which application it expects. */\n readonly expectedIssuer?: string;\n readonly disclosures?: readonly ApprovalSealDisclosureValue[];\n /**\n * The committed claims whose content the host no longer holds because an ERASURE removed it (#2924): the approver's\n * own erasure, or a later erasure of the requester or of a person the presentation named (#3001). The host's\n * statement, read as a reason and never as proof: a claim it names and does not give reads ERASED, one it neither\n * names nor gives reads WITHHELD, and either way the seal stands.\n */\n readonly erasedClaims?: readonly ApprovalSealDisclosureClaim[];\n readonly corroboration?: ApprovalSealCorroboration;\n /**\n * The file deliverable the seal attests (#2904): its id and the salt the seal's row kept (a bundle carries both), and\n * the file's BYTES, which the verifier is given by whoever holds the file (`wildo seal verify --deliverable`). Without\n * the bytes the file is reported NOT_GIVEN.\n */\n readonly deliverableFile?: { readonly fileId: string; readonly salt: string; readonly bytes?: Uint8Array };\n /**\n * The manifested copy of that deliverable (#2907): its id as the host names it, or the host's statement that the\n * approver's erasure deleted it (`contentErased`, read as a reason, never as proof), and the copy's BYTES from whoever\n * holds the file (`wildo seal verify --manifested-copy`). Checking it needs the approver disclosed (the copy prints\n * their name) and, to tie it to the approved file, the presentation and `deliverableFile`'s salt. `contentSha256` is\n * the host's record of the copy's hash: it binds what the rebuild takes from the copy itself (its words, its\n * verification address), so a copy reworded since does not verify.\n */\n readonly manifestedCopy?: { readonly fileId?: string; readonly contentSha256?: string; readonly contentErased?: boolean; readonly bytes?: Uint8Array };\n /**\n * The record the approval is about, as it is NOW (#2914): its fields as an export of the record states them, or null\n * for a record that is gone. Compared with the sealed field set the disclosed presentation carries\n * (`wildo seal verify --subject-record`).\n */\n readonly subjectRecord?: Readonly<Record<string, unknown>> | null;\n /** The operator's pin set for approval seals (#2932), from a channel the host does not control. */\n readonly pins?: CryptoKeyPinSet;\n /**\n * The signing-log exports the operator kept (#2932), with the records of the keys that signed them and the operator's\n * pin set for SIGNING_LOG_EXPORT. An export that does not verify, or was signed after its own key's compromise, is\n * ignored: it corroborates nothing.\n */\n readonly signingLogExports?: {\n readonly exports: readonly string[];\n readonly keys: readonly ApprovalSealVerificationKey[];\n readonly pins?: CryptoKeyPinSet;\n };\n}\n\n/** What corroborated a seal under a compromised key. */\nexport enum ApprovalSealCorroborationSource {\n /** The decision's payload digest, recorded outside the application before the compromise. */\n RECORDED_EVIDENCE = 'recorded_evidence',\n /** A signing-log export the operator kept, signed before the compromise, lists the seal. */\n SIGNING_LOG_EXPORT = 'signing_log_export',\n}\n\n/** Why a seal does not verify. */\nexport enum ApprovalSealVerificationFailure {\n /** Not a compact JWS with a JSON header and payload. */\n MALFORMED = 'malformed',\n /** The header's `alg` is not the one the key record pins. */\n ALGORITHM_NOT_PINNED = 'algorithm_not_pinned',\n /** The header names a critical extension, and none is understood. */\n CRITICAL_EXTENSION = 'critical_extension',\n /** The header's `typ` is not the approval seal's. */\n TYPE_MISMATCH = 'type_mismatch',\n /** No given key has the header's `kid`. */\n UNKNOWN_KEY = 'unknown_key',\n SIGNATURE_INVALID = 'signature_invalid',\n /** The payload's issuer is not the key record's, or not the expected one. */\n ISSUER_MISMATCH = 'issuer_mismatch',\n /** The payload is not the version-1 claims shape. */\n CLAIMS_INVALID = 'claims_invalid',\n /** The key's stored scope does not cover the seal's tenant (or is not a scope a seal is signed under). */\n TENANT_OUTSIDE_KEY_SCOPE = 'tenant_outside_key_scope',\n /** A disclosure does not digest to the commitment its claim names. */\n DISCLOSURE_MISMATCH = 'disclosure_mismatch',\n /** A pin set was given and does not pin the key, or the key handed over is not the one its pinned `kid` names. */\n UNPINNED = 'unpinned',\n /** A file deliverable's bytes were given and are not the ones the seal binds (#2904). */\n DELIVERABLE_FILE_MISMATCH = 'deliverable_file_mismatch',\n /**\n * A manifested copy was given and is not this seal's (#2907): its approval page, its attached JWS or its page tree is\n * not what the seal rebuilds, or what precedes them is not the file the seal binds.\n */\n MANIFESTED_COPY_MISMATCH = 'manifested_copy_mismatch',\n}\n\n/** What the seal says about the file deliverable it attests (#2904). */\nexport enum ApprovalSealDeliverableFileStanding {\n /** The bytes given hash, with the row's salt, to the commitment the presentation binds: the file approved. */\n MATCHES = 'matches',\n /** The bytes given are not the file approved: one changed byte is enough. The seal does not verify. */\n CHANGED = 'changed',\n /** The seal binds the file and its bytes were not given: the file is missing, or was not supplied. */\n NOT_GIVEN = 'not_given',\n /**\n * Nothing to compare with: the presentation that holds the commitment is not disclosed (erased with a person it\n * named, or withheld), or it binds no such file.\n */\n NOT_COMMITTED = 'not_committed',\n /**\n * A manifested copy (#2907) only: the host states the approver's erasure deleted it. The copy printed the approver's\n * name in clear and a file cannot be scrubbed, so it went; the seal and the original still prove the approval, and the\n * copy can be rebuilt from both should the name ever lawfully be needed again.\n */\n CONTENT_ERASED = 'content_erased',\n}\n\n/**\n * What the seal says about one committed disclosure: a person's (approver, requester), what they were shown, what they\n * answered. In none of the three is the seal failed: the signature covers the commitments, never the content (#2924).\n */\nexport enum ApprovalSealDisclosureStanding {\n /** Given, and it digests to the commitment. */\n DISCLOSED = 'disclosed',\n /**\n * Committed to, not given, and the bundle states an erasure removed it (`erasedClaims`): UNDISCLOSED (erased). For the\n * presentation this is PRESENTATION_ERASED: an erasure rewrote the stored presentation, and the seal still proves that\n * a presentation with this digest was shown.\n */\n ERASED = 'erased',\n /** Committed to, and not given, with no erasure stated: withheld, or a bundle that does not carry it. */\n WITHHELD = 'withheld',\n}\n\nexport interface ApprovalSealVerification {\n /** The signature verifies, under a key whose record covers the seal, over well-formed claims and matching disclosures. */\n readonly valid: boolean;\n readonly failures: readonly ApprovalSealVerificationFailure[];\n /**\n * The seal proves what it says: valid, and its key not compromised, or corroborated before the compromise. A valid seal\n * under a compromised key, uncorroborated, is reported valid and NOT provable.\n */\n readonly provable: boolean;\n /** For a seal under a compromised key, what corroborated it; absent when nothing did (or nothing needed to). */\n readonly corroboratedBy?: ApprovalSealCorroborationSource;\n readonly kid?: string;\n readonly keyState?: CryptoKey_VersionState;\n readonly claims?: ApprovalSealClaimsV1;\n readonly iss?: string;\n /** The signing instant, epoch seconds. */\n readonly iat?: number;\n readonly lateSeal?: boolean;\n /** Seconds between the decision and its signature: what the database held at signing is what is sealed. */\n readonly signingWindowSeconds?: number;\n /** The digest of the decision's committed payload, to compare with the RESOLVED row of an exported trail. */\n readonly decisionPayloadDigest?: string;\n readonly approver?: { readonly standing: ApprovalSealDisclosureStanding; readonly value?: Readonly<Record<string, unknown>> };\n readonly requester?: { readonly standing: ApprovalSealDisclosureStanding; readonly value?: Readonly<Record<string, unknown>> };\n /** What the person was shown (#2903 S6), when the seal binds it: DISCLOSED, ERASED (PRESENTATION_ERASED) or WITHHELD. */\n readonly presentation?: { readonly standing: ApprovalSealDisclosureStanding; readonly value?: Readonly<Record<string, unknown>> };\n /** What the person answered, when the seal binds it. */\n readonly statement?: { readonly standing: ApprovalSealDisclosureStanding; readonly value?: Readonly<Record<string, unknown>> };\n /** The file deliverable the seal attests, checked against its bytes (#2904), when one was named. */\n readonly deliverableFile?: { readonly fileId: string; readonly argument?: string; readonly standing: ApprovalSealDeliverableFileStanding };\n /**\n * The manifested copy (#2907), when one was named: MATCHES (the original the seal binds, followed by exactly this seal's\n * approval page naming the disclosed approver), CHANGED, NOT_GIVEN, NOT_COMMITTED (the approver or the commitment is\n * not disclosed, so there is nothing to rebuild or tie it to) or CONTENT_ERASED. `approverName` is the name it prints.\n */\n readonly manifestedCopy?: {\n readonly fileId?: string;\n readonly standing: ApprovalSealDeliverableFileStanding;\n readonly approverName?: string;\n /** What the copy states it was made with, when it rebuilt: its words' language, its verification address. */\n readonly locale?: string;\n readonly verificationUrl?: string;\n };\n /**\n * Whether the approval is still current over its record (#2914), when the record was given: CURRENT,\n * NO_LONGER_CURRENT (never a failure), SUBJECT_GONE, or NO_SEALED_FIELD_SET when the presentation is not disclosed or\n * covers no record field.\n */\n readonly subjectRecordCurrency?: ApprovalSealSubjectCurrencyAssessment;\n}\n\nfunction decodeJson(part: string | undefined): Record<string, unknown> | null {\n if (!part) return null;\n try {\n const value: unknown = JSON.parse(Buffer.from(part, 'base64url').toString('utf8'));\n return value !== null && typeof value === 'object' && !Array.isArray(value) ? (value as Record<string, unknown>) : null;\n } catch {\n return null;\n }\n}\n\nfunction disclosureStanding(\n claimName: ApprovalSealDisclosureClaim,\n commitment: string | undefined,\n disclosures: readonly ApprovalSealDisclosureValue[],\n erasedClaims: readonly ApprovalSealDisclosureClaim[],\n failures: ApprovalSealVerificationFailure[],\n): ApprovalSealVerification['approver'] {\n if (!commitment) return undefined;\n const given = disclosures.filter((disclosure) => disclosure.claimName === claimName);\n if (given.length === 0) {\n return { standing: erasedClaims.includes(claimName) ? ApprovalSealDisclosureStanding.ERASED : ApprovalSealDisclosureStanding.WITHHELD };\n }\n const matching = given.find((disclosure) => approvalSealDisclosureDigestOf(disclosure) === commitment);\n if (!matching) {\n // A disclosure that does not open its commitment is not the content: the seal fails, and nothing was disclosed.\n failures.push(ApprovalSealVerificationFailure.DISCLOSURE_MISMATCH);\n return { standing: ApprovalSealDisclosureStanding.WITHHELD };\n }\n return { standing: ApprovalSealDisclosureStanding.DISCLOSED, value: matching.value };\n}\n\n/**\n * The file deliverable against the commitment the disclosed presentation binds it by (#2904). A mismatch is a failure:\n * the seal does not attest those bytes.\n */\nfunction deliverableFileStandingOf(\n given: ApprovalSealVerificationInput['deliverableFile'],\n presentation: ApprovalSealVerification['presentation'],\n failures: ApprovalSealVerificationFailure[],\n): ApprovalSealVerification['deliverableFile'] {\n if (!given) return undefined;\n const bound = presentation?.standing === ApprovalSealDisclosureStanding.DISCLOSED ? humanDecisionBoundDeliverableOf(presentation.value, given.fileId) : undefined;\n if (!bound) return { fileId: given.fileId, standing: ApprovalSealDeliverableFileStanding.NOT_COMMITTED };\n if (!given.bytes) return { fileId: given.fileId, argument: bound.argument, standing: ApprovalSealDeliverableFileStanding.NOT_GIVEN };\n const contentSha256 = createHash('sha256').update(given.bytes).digest('hex');\n if (approvalSealFileCommitmentOf(given.salt, contentSha256) === bound.commitment) {\n return { fileId: given.fileId, argument: bound.argument, standing: ApprovalSealDeliverableFileStanding.MATCHES };\n }\n failures.push(ApprovalSealVerificationFailure.DELIVERABLE_FILE_MISMATCH);\n return { fileId: given.fileId, argument: bound.argument, standing: ApprovalSealDeliverableFileStanding.CHANGED };\n}\n\n/**\n * The manifested copy against the seal (#2907): rebuilt and compared, then its prefix opened against the commitment the\n * disclosed presentation binds the deliverable by. A mismatch at either step is a failure.\n */\nfunction manifestedCopyStandingOf(\n input: ApprovalSealVerificationInput,\n approver: ApprovalSealVerification['approver'],\n presentation: ApprovalSealVerification['presentation'],\n failures: ApprovalSealVerificationFailure[],\n): ApprovalSealVerification['manifestedCopy'] {\n const given = input.manifestedCopy;\n if (!given) return undefined;\n const named = given.fileId ? { fileId: given.fileId } : {};\n if (!given.bytes) {\n return { ...named, standing: given.contentErased ? ApprovalSealDeliverableFileStanding.CONTENT_ERASED : ApprovalSealDeliverableFileStanding.NOT_GIVEN };\n }\n if (approver?.standing !== ApprovalSealDisclosureStanding.DISCLOSED || !approver.value) return { ...named, standing: ApprovalSealDeliverableFileStanding.NOT_COMMITTED };\n const approverName = typeof approver.value.name === 'string' ? approver.value.name : undefined;\n const printed = approverName !== undefined ? { approverName } : {};\n const statedHash = given.contentSha256 === undefined || createHash('sha256').update(given.bytes).digest('hex') === given.contentSha256;\n const check = checkApprovalSealManifestedCopy(given.bytes, { jws: input.jws, ...printed });\n if (!check.matches || !statedHash) {\n failures.push(ApprovalSealVerificationFailure.MANIFESTED_COPY_MISMATCH);\n return { ...named, standing: ApprovalSealDeliverableFileStanding.CHANGED };\n }\n const deliverable = input.deliverableFile;\n const bound = deliverable && presentation?.standing === ApprovalSealDisclosureStanding.DISCLOSED\n ? humanDecisionBoundDeliverableOf(presentation.value, deliverable.fileId)\n : undefined;\n const stated = { locale: check.statement.locale, ...(check.statement.verificationUrl ? { verificationUrl: check.statement.verificationUrl } : {}) };\n if (!deliverable || !bound) return { ...named, standing: ApprovalSealDeliverableFileStanding.NOT_COMMITTED, ...printed, ...stated };\n if (approvalSealFileCommitmentOf(deliverable.salt, createHash('sha256').update(check.original).digest('hex')) !== bound.commitment) {\n failures.push(ApprovalSealVerificationFailure.MANIFESTED_COPY_MISMATCH);\n return { ...named, standing: ApprovalSealDeliverableFileStanding.CHANGED };\n }\n return { ...named, standing: ApprovalSealDeliverableFileStanding.MATCHES, ...printed, ...stated };\n}\n\n/**\n * What corroborates a seal under a compromised key, if anything: evidence of its payload recorded before the compromise,\n * or a kept export signed before the compromise that lists this exact seal (its issuer, its key, its signed claims).\n */\nfunction corroborationOf(\n input: ApprovalSealVerificationInput,\n key: ApprovalSealVerificationKey,\n payload: Readonly<Record<string, unknown>>,\n decisionPayloadDigest: string,\n): ApprovalSealCorroborationSource | undefined {\n if (key.compromiseInstant === undefined) return undefined;\n const compromisedFrom = Date.parse(key.compromiseInstant);\n if (input.corroboration && input.corroboration.decisionPayloadDigest === decisionPayloadDigest && Date.parse(input.corroboration.recordedAt) < compromisedFrom) {\n return ApprovalSealCorroborationSource.RECORDED_EVIDENCE;\n }\n const logged = input.signingLogExports;\n if (!logged) return undefined;\n const claimsDigest = sealClaimsDigestOf(payload);\n const evidence = logged.exports.flatMap((jws) => {\n const exported = verifySigningLogExport({ jws, keys: logged.keys, ...(logged.pins ? { pins: logged.pins } : {}), expectedIssuer: key.iss });\n return exported.provable && exported.claims ? [exported.claims] : [];\n });\n // The exports must agree with each other first (#2932 review M3): an export is dated by the instant it states for\n // itself, so a host holding the export key could sign one dated before the compromise; it disagrees with the operator's\n // kept exports (a different hash at some sequence, or a head behind an earlier one), and then none of them corroborates.\n if (!compareSigningLogExports(evidence).consistent) return undefined;\n for (const claims of evidence) {\n if (claims.iat * 1000 >= compromisedFrom) continue;\n const lists = claims.entries.some((entry) =>\n entry.purpose === CryptoKey_Purpose.APPROVAL_SEAL && entry.kid === key.kid && entry.iss === key.iss && entry.claimsDigest === claimsDigest);\n if (lists) return ApprovalSealCorroborationSource.SIGNING_LOG_EXPORT;\n }\n return undefined;\n}\n\n/** See the file's header. Pure and offline. */\nexport function verifyApprovalSeal(input: ApprovalSealVerificationInput): ApprovalSealVerification {\n const failures: ApprovalSealVerificationFailure[] = [];\n const fail = (failure: ApprovalSealVerificationFailure, extra: Partial<ApprovalSealVerification> = {}): ApprovalSealVerification =>\n ({ valid: false, provable: false, failures: [...failures, failure], ...extra });\n\n const parts = input.jws.split('.');\n const header = parts.length === 3 ? decodeJson(parts[0]) : null;\n const payload = parts.length === 3 ? decodeJson(parts[1]) : null;\n if (!header || !payload || !parts[2]) return fail(ApprovalSealVerificationFailure.MALFORMED);\n\n const kid = typeof header.kid === 'string' ? header.kid : undefined;\n // The key is chosen by `kid` among the keys the verifier was GIVEN; `jku`/`x5u`/`jwk`/`x5c` are never read.\n const record = kid ? input.keys.find((candidate) => candidate.kid === kid) : undefined;\n if (!record || !isP256PublicJwk(record.publicJwk)) return fail(ApprovalSealVerificationFailure.UNKNOWN_KEY, kid ? { kid } : {});\n // The operator's pin, when given: the key handed over must be the one the pinned thumbprint names, and the pin (not\n // the record) says what became of it.\n const key = pinnedVerificationKeyOf(record, input.pins);\n if (!key) return fail(ApprovalSealVerificationFailure.UNPINNED, { kid });\n if (header.alg !== key.alg || key.alg !== ES256_JWS_ALGORITHM) return fail(ApprovalSealVerificationFailure.ALGORITHM_NOT_PINNED, { kid });\n if (header.crit !== undefined) return fail(ApprovalSealVerificationFailure.CRITICAL_EXTENSION, { kid });\n if (header.typ !== APPROVAL_SEAL_TYP) return fail(ApprovalSealVerificationFailure.TYPE_MISMATCH, { kid });\n if (!verifyEs256(`${parts[0]}.${parts[1]}`, Buffer.from(parts[2], 'base64url'), key.publicJwk)) {\n return fail(ApprovalSealVerificationFailure.SIGNATURE_INVALID, { kid, keyState: key.state });\n }\n\n const iss = typeof payload.iss === 'string' ? payload.iss : undefined;\n const iat = typeof payload.iat === 'number' ? payload.iat : undefined;\n const lateSeal = payload.lateSeal === true;\n if (!iss || iss !== key.iss || (input.expectedIssuer !== undefined && iss !== input.expectedIssuer)) failures.push(ApprovalSealVerificationFailure.ISSUER_MISMATCH);\n\n const committed = Object.fromEntries(Object.entries(payload).filter(([name]) => !(CUSTODIAN_SET_CLAIMS as readonly string[]).includes(name)));\n const parsed = ApprovalSealClaimsV1Schema.safeParse(committed);\n if (!parsed.success) return fail(ApprovalSealVerificationFailure.CLAIMS_INVALID, { kid, keyState: key.state, ...(iss ? { iss } : {}) });\n const claims = parsed.data;\n\n // The key's scope from its RECORD: an organization key covers only that organization's decisions.\n const scopeCovers = key.scope === CryptoKey_Scope.APPLICATION || (key.scope === CryptoKey_Scope.ORGANIZATION && claims.tenant === key.scopeId);\n if (!scopeCovers) failures.push(ApprovalSealVerificationFailure.TENANT_OUTSIDE_KEY_SCOPE);\n\n const disclosures = input.disclosures ?? [];\n const erased = input.erasedClaims ?? [];\n const approver = disclosureStanding(ApprovalSealDisclosureClaim.APPROVER, claims.approver, disclosures, erased, failures);\n const requester = disclosureStanding(ApprovalSealDisclosureClaim.REQUESTER, claims.requester?.disclosure, disclosures, erased, failures);\n const presentation = disclosureStanding(ApprovalSealDisclosureClaim.PRESENTATION, claims.presentation?.digest, disclosures, erased, failures);\n const statement = disclosureStanding(ApprovalSealDisclosureClaim.STATEMENT, claims.statementDigest, disclosures, erased, failures);\n const deliverableFile = deliverableFileStandingOf(input.deliverableFile, presentation, failures);\n const manifestedCopy = manifestedCopyStandingOf(input, approver, presentation, failures);\n // #2914: never a failure; the presentation counts only when it opened its commitment.\n const subjectRecordCurrency = input.subjectRecord !== undefined\n ? approvalSealSubjectCurrencyOf(presentation?.standing === ApprovalSealDisclosureStanding.DISCLOSED ? presentation.value : undefined, input.subjectRecord)\n : undefined;\n\n const decisionPayloadDigest = decisionPayloadDigestOf(committed);\n const valid = failures.length === 0;\n const compromised = key.state === CryptoKey_VersionState.COMPROMISED;\n const corroboratedBy = compromised ? corroborationOf(input, key, payload, decisionPayloadDigest) : undefined;\n const corroborated = !compromised || corroboratedBy !== undefined;\n return {\n valid,\n failures,\n provable: valid && corroborated,\n ...(corroboratedBy ? { corroboratedBy } : {}),\n kid,\n keyState: key.state,\n claims,\n iss,\n ...(iat !== undefined ? { iat, signingWindowSeconds: Math.max(0, iat - claims.decidedAt) } : {}),\n lateSeal,\n decisionPayloadDigest,\n ...(approver ? { approver } : {}),\n ...(requester ? { requester } : {}),\n ...(presentation ? { presentation } : {}),\n ...(statement ? { statement } : {}),\n ...(deliverableFile ? { deliverableFile } : {}),\n ...(manifestedCopy ? { manifestedCopy } : {}),\n ...(subjectRecordCurrency ? { subjectRecordCurrency } : {}),\n };\n}\n\n/** A verification key as an export or a CLI file states it (dates as ISO strings): the one shape of a key record. */\nexport const ApprovalSealVerificationKeySchema = VerificationKeyRecordSchema;\n\n/**\n * Evidence recorded outside the application that a decision's payload existed before a key's compromise, as the file an\n * operator keeps it in (`wildo seal verify --corroboration <file>`).\n */\nexport const ApprovalSealCorroborationSchema = z.object({ decisionPayloadDigest: z.string().min(1), recordedAt: z.string().min(1) });\n\n/**\n * What `wildo seal verify` reads: one seal and everything it needs to verify, offline. A bundle is what the HOST exports,\n * so it carries no pin set, no signing-log exports and no corroboration: each is evidence against the host, and reaches\n * the verifier only from the operator's own files (`ApprovalSealVerificationInput.pins` / `signingLogExports` /\n * `corroboration`). The schema is not strict, so a bundle naming any of them has it stripped on parse rather than\n * believed (#2932 review H1, R1).\n */\nexport const ApprovalSealVerificationBundleSchema = z.object({\n jws: z.string().min(1),\n keys: z.array(ApprovalSealVerificationKeySchema).min(1),\n expectedIssuer: z.string().min(1).optional(),\n disclosures: z.array(z.object({ claimName: z.enum(ApprovalSealDisclosureClaim), salt: z.string().min(1), value: z.record(z.string(), z.unknown()) })).optional(),\n /** The committed claims an erasure removed from the host's row (#2924): see `ApprovalSealVerificationInput.erasedClaims`. */\n erasedClaims: z.array(z.enum(ApprovalSealDisclosureClaim)).optional(),\n /**\n * The file deliverable the seal attests (#2904): its id and the salt its row kept. Never the bytes, which the verifier\n * is given from the file itself (`--deliverable`), and never the clear hash.\n */\n deliverableFile: z.object({ fileId: z.string().min(1), salt: z.string().min(1) }).optional(),\n /**\n * The deliverable's manifested copy (#2907): its file id, or `contentErased` when the approver's erasure deleted it.\n * Never its bytes, which the verifier is given from the file itself (`--manifested-copy`).\n */\n manifestedCopy: z.object({ fileId: z.string().min(1).optional(), contentSha256: z.string().regex(/^[0-9a-f]{64}$/).optional(), contentErased: z.literal(true).optional() })\n .refine((copy) => (copy.fileId === undefined) !== (copy.contentErased === undefined), { message: 'A manifested copy is named by its file id, or stated erased: exactly one of the two' })\n .optional(),\n});\nexport type ApprovalSealVerificationBundle = z.infer<typeof ApprovalSealVerificationBundleSchema>;\n"]}
1
+ {"version":3,"file":"approval-seal-verifier.js","sourceRoot":"","sources":["../../../src/key-management/approval-seal-verifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,6BAA6B,EAAE,+BAA+B,EAAE,eAAe,EAA8C,iBAAiB,EAAE,eAAe,EAAE,sBAAsB,EAAwB,MAAM,uBAAuB,CAAC;AACtP,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,EAAsB,MAAM,aAAa,CAAC;AACpG,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAC5F,OAAO,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxJ,OAAO,EAAE,+BAA+B,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,8BAA8B,EAC9B,4BAA4B,GAG7B,MAAM,2BAA2B,CAAC;AAEnC,qCAAqC;AACrC,MAAM,iBAAiB,GAAG,eAAe,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;AAE3E,4FAA4F;AAC5F,MAAM,o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2903)\n *\n * Everything a verifier needs travels with the seal: the compact JWS, the stored records of the keys that may have signed\n * it (their public half, scope and issuer, as an export carries them), and, when the person's content is to be shown,\n * the disclosures. Nothing here calls the application or the platform, so a seal verifies after the application is gone.\n *\n * ## What is checked, and on whose authority\n *\n * - The header: ES256 is pinned per key from the key RECORD, never read from the header (RFC 8725 §3.1); `jku`, `x5u`,\n * `jwk` and `x5c` are never followed (RFC 8725 §3.10, RFC 7515 §10.7); a `crit` naming anything is refused, since no\n * extension is understood (RFC 7515 §4.1.11); `typ` must be the approval seal's.\n * - The signature, under the key the `kid` names among those given.\n * - The issuer: the payload's `iss` must be the key record's, and the expected issuer when one is given.\n * - The claims: the version-1 shape, strict.\n * - The key's scope, from its stored record and never from a JWKS member: an organization-scoped key verifies only a seal\n * whose tenant is that organization.\n * - The disclosures: each must digest to the commitment its claim names; a commitment with no disclosure is reported as\n * erased (the person's content was removed, the seal stands).\n * - A FILE deliverable (#2904), when the seal attests one: the file's bytes, hashed and salted with the salt its row\n * kept, must give the commitment the disclosed presentation binds it by. One changed byte fails the seal; bytes not\n * given are reported as such (a missing file), never as a match.\n * - A MANIFESTED COPY (#2907), when the seal's deliverable has one: the copy is rebuilt from its own prefix, the JWS, the\n * inputs it carries (its words, its pinned font, its verification address) and the disclosed approver's printed name,\n * and must equal the bytes given, and the host's record of its hash when the bundle states one; its prefix must then open the seal's commitment\n * to the approved file, which ties the copy to the original without the original being supplied. One changed byte in\n * the approval page fails the seal. A copy the approver's erasure deleted is reported CONTENT_ERASED, never missing.\n * - The CURRENCY of the approval over its record (#2914), when the record as it is now is given: the values of the fields\n * the approval covers, as the disclosed presentation carries them, compared with the record. A record changed since is\n * NOT a failure: the seal still proves what was approved; it is reported NO_LONGER_CURRENT. Without the presentation\n * disclosed there is nothing to compare, and it is reported as having no sealed field set, never as current.\n * - A COMPROMISED key: the signature may still verify, but the seal is not PROVABLE unless corroborated by evidence the\n * key's holder could not have forged: the decision's payload digest recorded outside the application before the\n * compromise instant (an exported audit event, an immutable sink).\n * - The OPERATOR'S PIN SET, when one is given (#2932): the key must be pinned, by the RFC 7638 thumbprint of the public\n * half the verifier was handed (so a key record that names a pinned `kid` over another key is refused), and the pin's\n * state, scope and compromise instant are used instead of the record's. The record (from a bundle, from the host)\n * only supplies the public half and the issuer; the operator's pin decides whether that half is theirs and what became\n * of it. Without a pin set the records are trusted as given, as before.\n * - The OPERATOR'S KEPT SIGNING-LOG EXPORTS, when given (#2932): a seal under a key compromised after an export that lists\n * it is corroborated by that export, which the host could not have signed after the compromise without the operator's\n * copy disagreeing. Each export is verified here, with the operator's pin set for the export key.\n *\n * spec-cite: RFC 8725 §3.1 (algorithm verification), §3.10 (do not trust received URLs); RFC 7515 §4.1.11 (`crit`),\n * §10.7 (key selection from header parameters). Cited by section; the behaviour is this file's decision.\n */\nimport { createHash } from 'node:crypto';\nimport { z } from 'zod';\nimport { approvalSealSubjectCurrencyOf, humanDecisionBoundDeliverableOf, singleJwsTypeOf, type ApprovalSealSubjectCurrencyAssessment, CryptoKey_Purpose, CryptoKey_Scope, CryptoKey_VersionState, type CryptoKeyPinSet } from '@wildo-ai/saas-models';\nimport { ES256_JWS_ALGORITHM, isP256PublicJwk, verifyEs256, type P256PublicJwk } from './es256-jws';\nimport { decisionPayloadDigestOf, sealClaimsDigestOf } from './signature-request.contracts';\nimport { VerificationKeyRecordSchema, compareSigningLogExports, pinnedVerificationKeyOf, verifySigningLogExport } from './signing-log-export.contracts';\nimport { checkApprovalSealManifestedCopy } from './approval-seal-manifested-copy';\nimport {\n ApprovalSealClaimsV1Schema,\n ApprovalSealDisclosureClaim,\n approvalSealDisclosureDigestOf,\n approvalSealFileCommitmentOf,\n type ApprovalSealClaimsV1,\n type ApprovalSealDisclosureValue,\n} from './approval-seal.contracts';\n\n/** The approval seal's JWS `typ`. */\nconst APPROVAL_SEAL_TYP = singleJwsTypeOf(CryptoKey_Purpose.APPROVAL_SEAL);\n\n/** The payload members the custodian sets; the rest is the decision's committed payload. */\nconst CUSTODIAN_SET_CLAIMS = ['iss', 'iat', 'lateSeal'] as const;\n\n/** One key that may have signed a seal: its STORED record (scope, issuer, state), as an export carries it. */\nexport interface ApprovalSealVerificationKey {\n readonly kid: string;\n readonly publicJwk: P256PublicJwk;\n /** The algorithm the key record pins. ES256 for every approval-seal key today. */\n readonly alg: typeof ES256_JWS_ALGORITHM;\n readonly scope: CryptoKey_Scope;\n /** The application's id for an APPLICATION key, the organization's for an ORGANIZATION key. */\n readonly scopeId: string;\n readonly iss: string;\n readonly state: CryptoKey_VersionState;\n /** ISO 8601, for a COMPROMISED key: the earliest instant its private half may have been exposed. */\n readonly compromiseInstant?: string;\n}\n\n/** Evidence recorded OUTSIDE the application that the decision's payload existed before a key's compromise. */\nexport interface ApprovalSealCorroboration {\n readonly decisionPayloadDigest: string;\n /** ISO 8601: when the evidence was recorded where the key's holder could not rewrite it. */\n readonly recordedAt: string;\n}\n\nexport interface ApprovalSealVerificationInput {\n readonly jws: string;\n readonly keys: readonly ApprovalSealVerificationKey[];\n /** The issuer the seal must carry, when the verifier knows which application it expects. */\n readonly expectedIssuer?: string;\n readonly disclosures?: readonly ApprovalSealDisclosureValue[];\n /**\n * The committed claims whose content the host no longer holds because an ERASURE removed it (#2924): the approver's\n * own erasure, or a later erasure of the requester or of a person the presentation named (#3001). The host's\n * statement, read as a reason and never as proof: a claim it names and does not give reads ERASED, one it neither\n * names nor gives reads WITHHELD, and either way the seal stands.\n */\n readonly erasedClaims?: readonly ApprovalSealDisclosureClaim[];\n readonly corroboration?: ApprovalSealCorroboration;\n /**\n * The file deliverable the seal attests (#2904): its id and the salt the seal's row kept (a bundle carries both), and\n * the file's BYTES, which the verifier is given by whoever holds the file (`wildo seal verify --deliverable`). Without\n * the bytes the file is reported NOT_GIVEN.\n */\n readonly deliverableFile?: { readonly fileId: string; readonly salt: string; readonly bytes?: Uint8Array };\n /**\n * The manifested copy of that deliverable (#2907): its id as the host names it, or the host's statement that the\n * approver's erasure deleted it (`contentErased`, read as a reason, never as proof), and the copy's BYTES from whoever\n * holds the file (`wildo seal verify --manifested-copy`). Checking it needs the approver disclosed (the copy prints\n * their name) and, to tie it to the approved file, the presentation and `deliverableFile`'s salt. `contentSha256` is\n * the host's record of the copy's hash: it binds what the rebuild takes from the copy itself (its words, its\n * verification address), so a copy reworded since does not verify.\n */\n readonly manifestedCopy?: { readonly fileId?: string; readonly contentSha256?: string; readonly contentErased?: boolean; readonly bytes?: Uint8Array };\n /**\n * The copies an electronic-signature vendor returned of that deliverable (#2293, #2907): each derived from the approved\n * original as a `VENDOR_SIGNED_COPY`. The host names each one (`fileId`), states which file its row says it was derived\n * from (`derivedFromFileId`) and the hash its row recorded (`contentSha256`), all read as statements, never as proof;\n * whoever holds the file gives its BYTES (`wildo seal verify --vendor-signed-copy`). See {@link ApprovalSealVendorSignedCopyInput}.\n */\n readonly vendorSignedCopies?: readonly ApprovalSealVendorSignedCopyInput[];\n /**\n * The record the approval is about, as it is NOW (#2914): its fields as an export of the record states them, or null\n * for a record that is gone. Compared with the sealed field set the disclosed presentation carries\n * (`wildo seal verify --subject-record`).\n */\n readonly subjectRecord?: Readonly<Record<string, unknown>> | null;\n /** The operator's pin set for approval seals (#2932), from a channel the host does not control. */\n readonly pins?: CryptoKeyPinSet;\n /**\n * The signing-log exports the operator kept (#2932), with the records of the keys that signed them and the operator's\n * pin set for SIGNING_LOG_EXPORT. An export that does not verify, or was signed after its own key's compromise, is\n * ignored: it corroborates nothing.\n */\n readonly signingLogExports?: {\n readonly exports: readonly string[];\n readonly keys: readonly ApprovalSealVerificationKey[];\n readonly pins?: CryptoKeyPinSet;\n };\n}\n\n/**\n * One vendor-signed copy of the approved deliverable, as the verifier is given it (#2907's document chain).\n *\n * The chain is: the frozen original the seal binds → its manifested copy (this seal's approval page appended), and the\n * same original → each vendor-signed copy (the vendor's signature appended as an incremental update, which the request's\n * PAdES validation required: its signed revision starts with exactly the bytes sent). So a vendor-signed copy is tied to\n * the approval by its FIRST REVISION: a prefix of the copy, ending at a `%%EOF` marker, must open the seal's commitment to\n * the original (`approvalSealFileCommitmentOf(salt, sha256(prefix))`). That needs the disclosed presentation and the\n * deliverable's salt, exactly like the deliverable itself.\n *\n * What this does NOT check: the vendor's signature over the copy. That was validated at receipt by the engine (chain to the\n * vendor's pinned anchors, revocation data, byte range), and its evidence is the request's `validationEvidence` file. The\n * offline verifier answers the question the seal can answer: does this copy start with the approved file. Whether what\n * follows is the vendor's validated signature is the HOST's record, which is why a copy the host recorded (named, with\n * the hash its row kept, and these bytes) is reported apart from one the host does not record (`recordedByHost`).\n */\nexport interface ApprovalSealVendorSignedCopyInput {\n /** The copy's file id, as the host names it. */\n readonly fileId?: string;\n /** The file the host's row says this copy was derived from. When it is not the deliverable the seal binds, it is refused. */\n readonly derivedFromFileId?: string;\n /** The copy's SHA-256 as its file row recorded it: given bytes that do not hash to it are refused. */\n readonly contentSha256?: string;\n readonly bytes?: Uint8Array;\n}\n\n/** What corroborated a seal under a compromised key. */\nexport enum ApprovalSealCorroborationSource {\n /** The decision's payload digest, recorded outside the application before the compromise. */\n RECORDED_EVIDENCE = 'recorded_evidence',\n /** A signing-log export the operator kept, signed before the compromise, lists the seal. */\n SIGNING_LOG_EXPORT = 'signing_log_export',\n}\n\n/** Why a seal does not verify. */\nexport enum ApprovalSealVerificationFailure {\n /** Not a compact JWS with a JSON header and payload. */\n MALFORMED = 'malformed',\n /** The header's `alg` is not the one the key record pins. */\n ALGORITHM_NOT_PINNED = 'algorithm_not_pinned',\n /** The header names a critical extension, and none is understood. */\n CRITICAL_EXTENSION = 'critical_extension',\n /** The header's `typ` is not the approval seal's. */\n TYPE_MISMATCH = 'type_mismatch',\n /** No given key has the header's `kid`. */\n UNKNOWN_KEY = 'unknown_key',\n SIGNATURE_INVALID = 'signature_invalid',\n /** The payload's issuer is not the key record's, or not the expected one. */\n ISSUER_MISMATCH = 'issuer_mismatch',\n /** The payload is not the version-1 claims shape. */\n CLAIMS_INVALID = 'claims_invalid',\n /** The key's stored scope does not cover the seal's tenant (or is not a scope a seal is signed under). */\n TENANT_OUTSIDE_KEY_SCOPE = 'tenant_outside_key_scope',\n /** A disclosure does not digest to the commitment its claim names. */\n DISCLOSURE_MISMATCH = 'disclosure_mismatch',\n /** A pin set was given and does not pin the key, or the key handed over is not the one its pinned `kid` names. */\n UNPINNED = 'unpinned',\n /** A file deliverable's bytes were given and are not the ones the seal binds (#2904). */\n DELIVERABLE_FILE_MISMATCH = 'deliverable_file_mismatch',\n /**\n * A manifested copy was given and is not this seal's (#2907): its approval page, its attached JWS or its page tree is\n * not what the seal rebuilds, or what precedes them is not the file the seal binds.\n */\n MANIFESTED_COPY_MISMATCH = 'manifested_copy_mismatch',\n /**\n * A vendor-signed copy was given or named and is not derived from the file this seal binds (#2907): no prefix of it\n * ending at a `%%EOF` is the approved file, its bytes are not the ones its row recorded, or the host states it was\n * derived from another file.\n */\n VENDOR_SIGNED_COPY_MISMATCH = 'vendor_signed_copy_mismatch',\n}\n\n/** What the seal says about the file deliverable it attests (#2904). */\nexport enum ApprovalSealDeliverableFileStanding {\n /** The bytes given hash, with the row's salt, to the commitment the presentation binds: the file approved. */\n MATCHES = 'matches',\n /** The bytes given are not the file approved: one changed byte is enough. The seal does not verify. */\n CHANGED = 'changed',\n /** The seal binds the file and its bytes were not given: the file is missing, or was not supplied. */\n NOT_GIVEN = 'not_given',\n /**\n * Nothing to compare with: the presentation that holds the commitment is not disclosed (erased with a person it\n * named, or withheld), or it binds no such file.\n */\n NOT_COMMITTED = 'not_committed',\n /**\n * A manifested copy (#2907) only: the host states the approver's erasure deleted it. The copy printed the approver's\n * name in clear and a file cannot be scrubbed, so it went; the seal and the original still prove the approval, and the\n * copy can be rebuilt from both should the name ever lawfully be needed again.\n */\n CONTENT_ERASED = 'content_erased',\n /**\n * A vendor-signed copy (#2907) only: the host's own row says it was derived from another file than the one this seal\n * binds. The copy belongs to another original, whatever its bytes; the seal does not verify with it.\n */\n DERIVED_FROM_ANOTHER_FILE = 'derived_from_another_file',\n}\n\n/**\n * What the seal says about one committed disclosure: a person's (approver, requester), what they were shown, what they\n * answered. In none of the three is the seal failed: the signature covers the commitments, never the content (#2924).\n */\nexport enum ApprovalSealDisclosureStanding {\n /** Given, and it digests to the commitment. */\n DISCLOSED = 'disclosed',\n /**\n * Committed to, not given, and the bundle states an erasure removed it (`erasedClaims`): UNDISCLOSED (erased). For the\n * presentation this is PRESENTATION_ERASED: an erasure rewrote the stored presentation, and the seal still proves that\n * a presentation with this digest was shown.\n */\n ERASED = 'erased',\n /** Committed to, and not given, with no erasure stated: withheld, or a bundle that does not carry it. */\n WITHHELD = 'withheld',\n}\n\nexport interface ApprovalSealVerification {\n /** The signature verifies, under a key whose record covers the seal, over well-formed claims and matching disclosures. */\n readonly valid: boolean;\n readonly failures: readonly ApprovalSealVerificationFailure[];\n /**\n * The seal proves what it says: valid, and its key not compromised, or corroborated before the compromise. A valid seal\n * under a compromised key, uncorroborated, is reported valid and NOT provable.\n */\n readonly provable: boolean;\n /** For a seal under a compromised key, what corroborated it; absent when nothing did (or nothing needed to). */\n readonly corroboratedBy?: ApprovalSealCorroborationSource;\n readonly kid?: string;\n readonly keyState?: CryptoKey_VersionState;\n readonly claims?: ApprovalSealClaimsV1;\n readonly iss?: string;\n /** The signing instant, epoch seconds. */\n readonly iat?: number;\n readonly lateSeal?: boolean;\n /** Seconds between the decision and its signature: what the database held at signing is what is sealed. */\n readonly signingWindowSeconds?: number;\n /** The digest of the decision's committed payload, to compare with the RESOLVED row of an exported trail. */\n readonly decisionPayloadDigest?: string;\n readonly approver?: { readonly standing: ApprovalSealDisclosureStanding; readonly value?: Readonly<Record<string, unknown>> };\n readonly requester?: { readonly standing: ApprovalSealDisclosureStanding; readonly value?: Readonly<Record<string, unknown>> };\n /** What the person was shown (#2903 S6), when the seal binds it: DISCLOSED, ERASED (PRESENTATION_ERASED) or WITHHELD. */\n readonly presentation?: { readonly standing: ApprovalSealDisclosureStanding; readonly value?: Readonly<Record<string, unknown>> };\n /** What the person answered, when the seal binds it. */\n readonly statement?: { readonly standing: ApprovalSealDisclosureStanding; readonly value?: Readonly<Record<string, unknown>> };\n /** The file deliverable the seal attests, checked against its bytes (#2904), when one was named. */\n readonly deliverableFile?: { readonly fileId: string; readonly argument?: string; readonly standing: ApprovalSealDeliverableFileStanding };\n /**\n * The manifested copy (#2907), when one was named: MATCHES (the original the seal binds, followed by exactly this seal's\n * approval page naming the disclosed approver), CHANGED, NOT_GIVEN, NOT_COMMITTED (the approver or the commitment is\n * not disclosed, so there is nothing to rebuild or tie it to) or CONTENT_ERASED. `approverName` is the name it prints.\n */\n readonly manifestedCopy?: {\n readonly fileId?: string;\n readonly standing: ApprovalSealDeliverableFileStanding;\n readonly approverName?: string;\n /** What the copy states it was made with, when it rebuilt: its words' language, its verification address. */\n readonly locale?: string;\n readonly verificationUrl?: string;\n };\n /**\n * Each vendor-signed copy named or given (#2907), in the order given: MATCHES (its first revision is the file the seal\n * binds, `derivesFromFileId` naming it, `originalLength` where it ends), CHANGED, DERIVED_FROM_ANOTHER_FILE, NOT_GIVEN\n * or NOT_COMMITTED (the presentation or the deliverable's salt is not disclosed, so there is nothing to tie it to).\n */\n readonly vendorSignedCopies?: ReadonlyArray<{\n readonly fileId?: string;\n readonly standing: ApprovalSealDeliverableFileStanding;\n /** The approved original this copy derives from: the deliverable the seal binds, when the copy MATCHES it. */\n readonly derivesFromFileId?: string;\n /** The original's length in bytes: what follows it is what the vendor appended. */\n readonly originalLength?: number;\n /** What the host stated the copy derives from, when that is another file. */\n readonly statedDerivedFromFileId?: string;\n /**\n * On MATCHES: whether the host RECORDS this exact copy (it named the copy and the bytes are the ones its file row\n * hashed), so the copy is the signed document a request validated at receipt. False for a copy the host names\n * without a recorded hash, or does not name: its first revision is the approved file, and nothing here says what\n * follows it is a vendor's signature.\n */\n readonly recordedByHost?: boolean;\n }>;\n /**\n * Whether the approval is still current over its record (#2914), when the record was given: CURRENT,\n * NO_LONGER_CURRENT (never a failure), SUBJECT_GONE, or NO_SEALED_FIELD_SET when the presentation is not disclosed or\n * covers no record field.\n */\n readonly subjectRecordCurrency?: ApprovalSealSubjectCurrencyAssessment;\n}\n\nfunction decodeJson(part: string | undefined): Record<string, unknown> | null {\n if (!part) return null;\n try {\n const value: unknown = JSON.parse(Buffer.from(part, 'base64url').toString('utf8'));\n return value !== null && typeof value === 'object' && !Array.isArray(value) ? (value as Record<string, unknown>) : null;\n } catch {\n return null;\n }\n}\n\nfunction disclosureStanding(\n claimName: ApprovalSealDisclosureClaim,\n commitment: string | undefined,\n disclosures: readonly ApprovalSealDisclosureValue[],\n erasedClaims: readonly ApprovalSealDisclosureClaim[],\n failures: ApprovalSealVerificationFailure[],\n): ApprovalSealVerification['approver'] {\n if (!commitment) return undefined;\n const given = disclosures.filter((disclosure) => disclosure.claimName === claimName);\n if (given.length === 0) {\n return { standing: erasedClaims.includes(claimName) ? ApprovalSealDisclosureStanding.ERASED : ApprovalSealDisclosureStanding.WITHHELD };\n }\n const matching = given.find((disclosure) => approvalSealDisclosureDigestOf(disclosure) === commitment);\n if (!matching) {\n // A disclosure that does not open its commitment is not the content: the seal fails, and nothing was disclosed.\n failures.push(ApprovalSealVerificationFailure.DISCLOSURE_MISMATCH);\n return { standing: ApprovalSealDisclosureStanding.WITHHELD };\n }\n return { standing: ApprovalSealDisclosureStanding.DISCLOSED, value: matching.value };\n}\n\n/**\n * The file deliverable against the commitment the disclosed presentation binds it by (#2904). A mismatch is a failure:\n * the seal does not attest those bytes.\n */\nfunction deliverableFileStandingOf(\n given: ApprovalSealVerificationInput['deliverableFile'],\n presentation: ApprovalSealVerification['presentation'],\n failures: ApprovalSealVerificationFailure[],\n): ApprovalSealVerification['deliverableFile'] {\n if (!given) return undefined;\n const bound = presentation?.standing === ApprovalSealDisclosureStanding.DISCLOSED ? humanDecisionBoundDeliverableOf(presentation.value, given.fileId) : undefined;\n if (!bound) return { fileId: given.fileId, standing: ApprovalSealDeliverableFileStanding.NOT_COMMITTED };\n if (!given.bytes) return { fileId: given.fileId, argument: bound.argument, standing: ApprovalSealDeliverableFileStanding.NOT_GIVEN };\n const contentSha256 = createHash('sha256').update(given.bytes).digest('hex');\n if (approvalSealFileCommitmentOf(given.salt, contentSha256) === bound.commitment) {\n return { fileId: given.fileId, argument: bound.argument, standing: ApprovalSealDeliverableFileStanding.MATCHES };\n }\n failures.push(ApprovalSealVerificationFailure.DELIVERABLE_FILE_MISMATCH);\n return { fileId: given.fileId, argument: bound.argument, standing: ApprovalSealDeliverableFileStanding.CHANGED };\n}\n\n/**\n * The manifested copy against the seal (#2907): rebuilt and compared, then its prefix opened against the commitment the\n * disclosed presentation binds the deliverable by. A mismatch at either step is a failure.\n */\nfunction manifestedCopyStandingOf(\n input: ApprovalSealVerificationInput,\n approver: ApprovalSealVerification['approver'],\n presentation: ApprovalSealVerification['presentation'],\n failures: ApprovalSealVerificationFailure[],\n): ApprovalSealVerification['manifestedCopy'] {\n const given = input.manifestedCopy;\n if (!given) return undefined;\n const named = given.fileId ? { fileId: given.fileId } : {};\n if (!given.bytes) {\n return { ...named, standing: given.contentErased ? ApprovalSealDeliverableFileStanding.CONTENT_ERASED : ApprovalSealDeliverableFileStanding.NOT_GIVEN };\n }\n if (approver?.standing !== ApprovalSealDisclosureStanding.DISCLOSED || !approver.value) return { ...named, standing: ApprovalSealDeliverableFileStanding.NOT_COMMITTED };\n const approverName = typeof approver.value.name === 'string' ? approver.value.name : undefined;\n const printed = approverName !== undefined ? { approverName } : {};\n const statedHash = given.contentSha256 === undefined || createHash('sha256').update(given.bytes).digest('hex') === given.contentSha256;\n const check = checkApprovalSealManifestedCopy(given.bytes, { jws: input.jws, ...printed });\n if (!check.matches || !statedHash) {\n failures.push(ApprovalSealVerificationFailure.MANIFESTED_COPY_MISMATCH);\n return { ...named, standing: ApprovalSealDeliverableFileStanding.CHANGED };\n }\n const deliverable = input.deliverableFile;\n const bound = deliverable && presentation?.standing === ApprovalSealDisclosureStanding.DISCLOSED\n ? humanDecisionBoundDeliverableOf(presentation.value, deliverable.fileId)\n : undefined;\n const stated = { locale: check.statement.locale, ...(check.statement.verificationUrl ? { verificationUrl: check.statement.verificationUrl } : {}) };\n if (!deliverable || !bound) return { ...named, standing: ApprovalSealDeliverableFileStanding.NOT_COMMITTED, ...printed, ...stated };\n if (approvalSealFileCommitmentOf(deliverable.salt, createHash('sha256').update(check.original).digest('hex')) !== bound.commitment) {\n failures.push(ApprovalSealVerificationFailure.MANIFESTED_COPY_MISMATCH);\n return { ...named, standing: ApprovalSealDeliverableFileStanding.CHANGED };\n }\n return { ...named, standing: ApprovalSealDeliverableFileStanding.MATCHES, ...printed, ...stated };\n}\n\n/**\n * The lengths at which a PDF's revisions end: just past each `%%EOF` marker, and past its end-of-line when one follows\n * (a file may end either way), ascending. An incremental update appends after one of them, so the original a later\n * revision was appended to is one of these prefixes. Read as Latin-1, so a byte offset in the text is a byte offset in\n * the file.\n */\nfunction pdfRevisionEndsOf(bytes: Uint8Array): number[] {\n const text = Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength).toString('latin1');\n const ends: number[] = [];\n for (let index = text.indexOf('%%EOF'); index >= 0; index = text.indexOf('%%EOF', index + 1)) {\n const end = index + 5;\n ends.push(end);\n if (text[end] === '\\r' && text[end + 1] === '\\n') ends.push(end + 2);\n else if (text[end] === '\\n' || text[end] === '\\r') ends.push(end + 1);\n }\n return ends;\n}\n\n/**\n * The first revision end at which the prefix's SHA-256 satisfies `opens`, or undefined. Hashed INCREMENTALLY, one\n * running digest extended from one candidate end to the next and copied to read it, so a file carrying many `%%EOF`\n * markers costs one pass over its bytes rather than one per marker.\n */\nfunction firstPrefixOpening(bytes: Uint8Array, opens: (prefixSha256: string) => boolean): number | undefined {\n const running = createHash('sha256');\n let hashedTo = 0;\n for (const end of pdfRevisionEndsOf(bytes)) {\n running.update(bytes.subarray(hashedTo, end));\n hashedTo = end;\n if (opens(running.copy().digest('hex'))) return end;\n }\n return undefined;\n}\n\n/**\n * Each vendor-signed copy against the seal (#2907's document chain): its first revision opened against the commitment the\n * disclosed presentation binds the deliverable by. See {@link ApprovalSealVendorSignedCopyInput}. A copy the host states\n * was derived from another file, one whose bytes are not its recorded hash, or one with no prefix that is the approved\n * file, is a failure.\n */\nfunction vendorSignedCopyStandingsOf(\n input: ApprovalSealVerificationInput,\n presentation: ApprovalSealVerification['presentation'],\n failures: ApprovalSealVerificationFailure[],\n): ApprovalSealVerification['vendorSignedCopies'] {\n const copies = input.vendorSignedCopies;\n if (!copies || copies.length === 0) return undefined;\n const deliverable = input.deliverableFile;\n const bound = deliverable && presentation?.standing === ApprovalSealDisclosureStanding.DISCLOSED\n ? humanDecisionBoundDeliverableOf(presentation.value, deliverable.fileId)\n : undefined;\n let mismatched = false;\n const standings = copies.map((copy) => {\n const named = copy.fileId ? { fileId: copy.fileId } : {};\n // The host's own row names another original: the copy is not this approval's, whatever its bytes (refused before they\n // are read, so a copy built to open the commitment cannot pass under another file's lineage either).\n if (deliverable && copy.derivedFromFileId !== undefined && copy.derivedFromFileId !== deliverable.fileId) {\n mismatched = true;\n return { ...named, standing: ApprovalSealDeliverableFileStanding.DERIVED_FROM_ANOTHER_FILE, statedDerivedFromFileId: copy.derivedFromFileId };\n }\n if (!copy.bytes) return { ...named, standing: ApprovalSealDeliverableFileStanding.NOT_GIVEN };\n if (copy.contentSha256 !== undefined && createHash('sha256').update(copy.bytes).digest('hex') !== copy.contentSha256) {\n mismatched = true;\n return { ...named, standing: ApprovalSealDeliverableFileStanding.CHANGED };\n }\n if (!deliverable || !bound) return { ...named, standing: ApprovalSealDeliverableFileStanding.NOT_COMMITTED };\n const originalLength = firstPrefixOpening(copy.bytes, (prefixSha256) => approvalSealFileCommitmentOf(deliverable.salt, prefixSha256) === bound.commitment);\n if (originalLength === undefined) {\n mismatched = true;\n return { ...named, standing: ApprovalSealDeliverableFileStanding.CHANGED };\n }\n // `contentSha256` was compared with these bytes above, so a named copy carrying one is the copy the host recorded.\n const recordedByHost = copy.fileId !== undefined && copy.contentSha256 !== undefined;\n return { ...named, standing: ApprovalSealDeliverableFileStanding.MATCHES, derivesFromFileId: deliverable.fileId, originalLength, recordedByHost };\n });\n if (mismatched) failures.push(ApprovalSealVerificationFailure.VENDOR_SIGNED_COPY_MISMATCH);\n return standings;\n}\n\n/**\n * What corroborates a seal under a compromised key, if anything: evidence of its payload recorded before the compromise,\n * or a kept export signed before the compromise that lists this exact seal (its issuer, its key, its signed claims).\n */\nfunction corroborationOf(\n input: ApprovalSealVerificationInput,\n key: ApprovalSealVerificationKey,\n payload: Readonly<Record<string, unknown>>,\n decisionPayloadDigest: string,\n): ApprovalSealCorroborationSource | undefined {\n if (key.compromiseInstant === undefined) return undefined;\n const compromisedFrom = Date.parse(key.compromiseInstant);\n if (input.corroboration && input.corroboration.decisionPayloadDigest === decisionPayloadDigest && Date.parse(input.corroboration.recordedAt) < compromisedFrom) {\n return ApprovalSealCorroborationSource.RECORDED_EVIDENCE;\n }\n const logged = input.signingLogExports;\n if (!logged) return undefined;\n const claimsDigest = sealClaimsDigestOf(payload);\n const evidence = logged.exports.flatMap((jws) => {\n const exported = verifySigningLogExport({ jws, keys: logged.keys, ...(logged.pins ? { pins: logged.pins } : {}), expectedIssuer: key.iss });\n return exported.provable && exported.claims ? [exported.claims] : [];\n });\n // The exports must agree with each other first (#2932 review M3): an export is dated by the instant it states for\n // itself, so a host holding the export key could sign one dated before the compromise; it disagrees with the operator's\n // kept exports (a different hash at some sequence, or a head behind an earlier one), and then none of them corroborates.\n if (!compareSigningLogExports(evidence).consistent) return undefined;\n for (const claims of evidence) {\n if (claims.iat * 1000 >= compromisedFrom) continue;\n const lists = claims.entries.some((entry) =>\n entry.purpose === CryptoKey_Purpose.APPROVAL_SEAL && entry.kid === key.kid && entry.iss === key.iss && entry.claimsDigest === claimsDigest);\n if (lists) return ApprovalSealCorroborationSource.SIGNING_LOG_EXPORT;\n }\n return undefined;\n}\n\n/** See the file's header. Pure and offline. */\nexport function verifyApprovalSeal(input: ApprovalSealVerificationInput): ApprovalSealVerification {\n const failures: ApprovalSealVerificationFailure[] = [];\n const fail = (failure: ApprovalSealVerificationFailure, extra: Partial<ApprovalSealVerification> = {}): ApprovalSealVerification =>\n ({ valid: false, provable: false, failures: [...failures, failure], ...extra });\n\n const parts = input.jws.split('.');\n const header = parts.length === 3 ? decodeJson(parts[0]) : null;\n const payload = parts.length === 3 ? decodeJson(parts[1]) : null;\n if (!header || !payload || !parts[2]) return fail(ApprovalSealVerificationFailure.MALFORMED);\n\n const kid = typeof header.kid === 'string' ? header.kid : undefined;\n // The key is chosen by `kid` among the keys the verifier was GIVEN; `jku`/`x5u`/`jwk`/`x5c` are never read.\n const record = kid ? input.keys.find((candidate) => candidate.kid === kid) : undefined;\n if (!record || !isP256PublicJwk(record.publicJwk)) return fail(ApprovalSealVerificationFailure.UNKNOWN_KEY, kid ? { kid } : {});\n // The operator's pin, when given: the key handed over must be the one the pinned thumbprint names, and the pin (not\n // the record) says what became of it.\n const key = pinnedVerificationKeyOf(record, input.pins);\n if (!key) return fail(ApprovalSealVerificationFailure.UNPINNED, { kid });\n if (header.alg !== key.alg || key.alg !== ES256_JWS_ALGORITHM) return fail(ApprovalSealVerificationFailure.ALGORITHM_NOT_PINNED, { kid });\n if (header.crit !== undefined) return fail(ApprovalSealVerificationFailure.CRITICAL_EXTENSION, { kid });\n if (header.typ !== APPROVAL_SEAL_TYP) return fail(ApprovalSealVerificationFailure.TYPE_MISMATCH, { kid });\n if (!verifyEs256(`${parts[0]}.${parts[1]}`, Buffer.from(parts[2], 'base64url'), key.publicJwk)) {\n return fail(ApprovalSealVerificationFailure.SIGNATURE_INVALID, { kid, keyState: key.state });\n }\n\n const iss = typeof payload.iss === 'string' ? payload.iss : undefined;\n const iat = typeof payload.iat === 'number' ? payload.iat : undefined;\n const lateSeal = payload.lateSeal === true;\n if (!iss || iss !== key.iss || (input.expectedIssuer !== undefined && iss !== input.expectedIssuer)) failures.push(ApprovalSealVerificationFailure.ISSUER_MISMATCH);\n\n const committed = Object.fromEntries(Object.entries(payload).filter(([name]) => !(CUSTODIAN_SET_CLAIMS as readonly string[]).includes(name)));\n const parsed = ApprovalSealClaimsV1Schema.safeParse(committed);\n if (!parsed.success) return fail(ApprovalSealVerificationFailure.CLAIMS_INVALID, { kid, keyState: key.state, ...(iss ? { iss } : {}) });\n const claims = parsed.data;\n\n // The key's scope from its RECORD: an organization key covers only that organization's decisions.\n const scopeCovers = key.scope === CryptoKey_Scope.APPLICATION || (key.scope === CryptoKey_Scope.ORGANIZATION && claims.tenant === key.scopeId);\n if (!scopeCovers) failures.push(ApprovalSealVerificationFailure.TENANT_OUTSIDE_KEY_SCOPE);\n\n const disclosures = input.disclosures ?? [];\n const erased = input.erasedClaims ?? [];\n const approver = disclosureStanding(ApprovalSealDisclosureClaim.APPROVER, claims.approver, disclosures, erased, failures);\n const requester = disclosureStanding(ApprovalSealDisclosureClaim.REQUESTER, claims.requester?.disclosure, disclosures, erased, failures);\n const presentation = disclosureStanding(ApprovalSealDisclosureClaim.PRESENTATION, claims.presentation?.digest, disclosures, erased, failures);\n const statement = disclosureStanding(ApprovalSealDisclosureClaim.STATEMENT, claims.statementDigest, disclosures, erased, failures);\n const deliverableFile = deliverableFileStandingOf(input.deliverableFile, presentation, failures);\n const manifestedCopy = manifestedCopyStandingOf(input, approver, presentation, failures);\n const vendorSignedCopies = vendorSignedCopyStandingsOf(input, presentation, failures);\n // #2914: never a failure; the presentation counts only when it opened its commitment.\n const subjectRecordCurrency = input.subjectRecord !== undefined\n ? approvalSealSubjectCurrencyOf(presentation?.standing === ApprovalSealDisclosureStanding.DISCLOSED ? presentation.value : undefined, input.subjectRecord)\n : undefined;\n\n const decisionPayloadDigest = decisionPayloadDigestOf(committed);\n const valid = failures.length === 0;\n const compromised = key.state === CryptoKey_VersionState.COMPROMISED;\n const corroboratedBy = compromised ? corroborationOf(input, key, payload, decisionPayloadDigest) : undefined;\n const corroborated = !compromised || corroboratedBy !== undefined;\n return {\n valid,\n failures,\n provable: valid && corroborated,\n ...(corroboratedBy ? { corroboratedBy } : {}),\n kid,\n keyState: key.state,\n claims,\n iss,\n ...(iat !== undefined ? { iat, signingWindowSeconds: Math.max(0, iat - claims.decidedAt) } : {}),\n lateSeal,\n decisionPayloadDigest,\n ...(approver ? { approver } : {}),\n ...(requester ? { requester } : {}),\n ...(presentation ? { presentation } : {}),\n ...(statement ? { statement } : {}),\n ...(deliverableFile ? { deliverableFile } : {}),\n ...(manifestedCopy ? { manifestedCopy } : {}),\n ...(vendorSignedCopies ? { vendorSignedCopies } : {}),\n ...(subjectRecordCurrency ? { subjectRecordCurrency } : {}),\n };\n}\n\n/** A verification key as an export or a CLI file states it (dates as ISO strings): the one shape of a key record. */\nexport const ApprovalSealVerificationKeySchema = VerificationKeyRecordSchema;\n\n/**\n * Evidence recorded outside the application that a decision's payload existed before a key's compromise, as the file an\n * operator keeps it in (`wildo seal verify --corroboration <file>`).\n */\nexport const ApprovalSealCorroborationSchema = z.object({ decisionPayloadDigest: z.string().min(1), recordedAt: z.string().min(1) });\n\n/**\n * What `wildo seal verify` reads: one seal and everything it needs to verify, offline. A bundle is what the HOST exports,\n * so it carries no pin set, no signing-log exports and no corroboration: each is evidence against the host, and reaches\n * the verifier only from the operator's own files (`ApprovalSealVerificationInput.pins` / `signingLogExports` /\n * `corroboration`). The schema is not strict, so a bundle naming any of them has it stripped on parse rather than\n * believed (#2932 review H1, R1).\n */\nexport const ApprovalSealVerificationBundleSchema = z.object({\n jws: z.string().min(1),\n keys: z.array(ApprovalSealVerificationKeySchema).min(1),\n expectedIssuer: z.string().min(1).optional(),\n disclosures: z.array(z.object({ claimName: z.enum(ApprovalSealDisclosureClaim), salt: z.string().min(1), value: z.record(z.string(), z.unknown()) })).optional(),\n /** The committed claims an erasure removed from the host's row (#2924): see `ApprovalSealVerificationInput.erasedClaims`. */\n erasedClaims: z.array(z.enum(ApprovalSealDisclosureClaim)).optional(),\n /**\n * The file deliverable the seal attests (#2904): its id and the salt its row kept. Never the bytes, which the verifier\n * is given from the file itself (`--deliverable`), and never the clear hash.\n */\n deliverableFile: z.object({ fileId: z.string().min(1), salt: z.string().min(1) }).optional(),\n /**\n * The deliverable's manifested copy (#2907): its file id, or `contentErased` when the approver's erasure deleted it.\n * Never its bytes, which the verifier is given from the file itself (`--manifested-copy`).\n */\n manifestedCopy: z.object({ fileId: z.string().min(1).optional(), contentSha256: z.string().regex(/^[0-9a-f]{64}$/).optional(), contentErased: z.literal(true).optional() })\n .refine((copy) => (copy.fileId === undefined) !== (copy.contentErased === undefined), { message: 'A manifested copy is named by its file id, or stated erased: exactly one of the two' })\n .optional(),\n /**\n * The document chain's other branch (#2907): the copies an electronic-signature vendor returned of the deliverable, each\n * with the file its row says it was derived from and the hash its row recorded. Never their bytes, which the verifier is\n * given from the files themselves (`--vendor-signed-copy`).\n */\n vendorSignedCopies: z.array(z.object({\n fileId: z.string().min(1),\n derivedFromFileId: z.string().min(1).optional(),\n contentSha256: z.string().regex(/^[0-9a-f]{64}$/).optional(),\n })).optional(),\n});\nexport type ApprovalSealVerificationBundle = z.infer<typeof ApprovalSealVerificationBundleSchema>;\n"]}
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * ## Where the settings live, measured rather than assumed (2026-11-09, scratch workspaces with local tarballs)
7
7
  *
8
- * | setting | pnpm 10.6.4 (the pin) | pnpm 11.20.0 |
8
+ * | setting | pnpm 10.6.4 (the pin at the time; 10.34.9 since #3014 behaves the same here) | pnpm 11.20.0 |
9
9
  * |---|---|---|
10
10
  * | `overrides` in `pnpm-workspace.yaml` | read | read |
11
11
  * | `overrides` in `package.json` → `pnpm` | read, and it REPLACES the YAML block whole (a `package.json` block holding one unrelated key switched off every YAML override) | ignored, with a warning naming the key |
@@ -7,7 +7,7 @@ import { join } from 'node:path';
7
7
  *
8
8
  * ## Where the settings live, measured rather than assumed (2026-11-09, scratch workspaces with local tarballs)
9
9
  *
10
- * | setting | pnpm 10.6.4 (the pin) | pnpm 11.20.0 |
10
+ * | setting | pnpm 10.6.4 (the pin at the time; 10.34.9 since #3014 behaves the same here) | pnpm 11.20.0 |
11
11
  * |---|---|---|
12
12
  * | `overrides` in `pnpm-workspace.yaml` | read | read |
13
13
  * | `overrides` in `package.json` → `pnpm` | read, and it REPLACES the YAML block whole (a `package.json` block holding one unrelated key switched off every YAML override) | ignored, with a warning naming the key |
@@ -1 +1 @@
1
- {"version":3,"file":"application-pnpm-settings.js","sourceRoot":"","sources":["../../../src/pnpm-settings/application-pnpm-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,+DAA+D;AAC/D,MAAM,CAAN,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,6GAA6G;IAC7G,mDAA6B,CAAA;IAC7B,0FAA0F;IAC1F,4DAAsC,CAAA;AACxC,CAAC,EALW,kBAAkB,KAAlB,kBAAkB,QAK7B;AAED,8GAA8G;AAC9G,MAAM,CAAN,IAAY,gBASX;AATD,WAAY,gBAAgB;IAC1B,+GAA+G;IAC/G,2CAAuB,CAAA;IACvB,mHAAmH;IACnH,qEAAiD,CAAA;IACjD,yIAAyI;IACzI,uEAAmD,CAAA;IACnD,kHAAkH;IAClH,gEAA4C,CAAA;AAC9C,CAAC,EATW,gBAAgB,KAAhB,gBAAgB,QAS3B;AAED,gGAAgG;AAChG,MAAM,CAAC,MAAM,mBAAmB,GAAgC;IAC9D,gBAAgB,CAAC,SAAS;IAC1B,gBAAgB,CAAC,uBAAuB;IACxC,gBAAgB,CAAC,wBAAwB;IACzC,gBAAgB,CAAC,oBAAoB;CACtC,CAAC;AAmCF,uHAAuH;AACvH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAChD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAA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,EAAE,CAAC;IAC9I,MAAM,MAAM,GAAG,4BAA4B,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IACrE,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;AAC5G,CAAC","sourcesContent":["import { existsSync, readFileSync, writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\n\n/**\n * The ONE place that decides where an application's pnpm settings live, how they are read and how they are written\n * (#2808). Its twin for the repository's dependency-free scripts is `scripts/pnpm-workspace-settings.mjs`: the same\n * grammar, the same precedence and the same rendering, held byte-for-byte equal by `application-pnpm-settings.parity.test.ts`.\n *\n * ## Where the settings live, measured rather than assumed (2026-11-09, scratch workspaces with local tarballs)\n *\n * | setting | pnpm 10.6.4 (the pin) | pnpm 11.20.0 |\n * |---|---|---|\n * | `overrides` in `pnpm-workspace.yaml` | read | read |\n * | `overrides` in `package.json` → `pnpm` | read, and it REPLACES the YAML block whole (a `package.json` block holding one unrelated key switched off every YAML override) | ignored, with a warning naming the key |\n * | `onlyBuiltDependencies` in `pnpm-workspace.yaml` | read | ignored silently: pnpm 11 REMOVED the setting (`allowBuilds` replaces it) |\n * | `onlyBuiltDependencies` in `package.json` | read, and it replaces the YAML list | ignored, with a warning |\n * | `neverBuiltDependencies`, either file | read; beside an `onlyBuiltDependencies` list in EITHER file, `ERR_PNPM_CONFIG_CONFLICT_BUILT_DEPENDENCIES` | ignored (removed) |\n * | `allowBuilds` in `pnpm-workspace.yaml` | not read (the 10.6.4 binary does not know the key) | read |\n * | `patchedDependencies`, `packageExtensions` in `pnpm-workspace.yaml` | read | read |\n * | the same in `package.json` → `pnpm` | read (a `package.json` `patchedDependencies` is applied in place of the YAML one) | ignored, with a warning |\n *\n * So `pnpm-workspace.yaml` is the one file both versions read, and it is where every writer puts the settings it owns.\n * The two build lists are carried there for the pnpm 10 pin; pnpm 11 needs them restated as `allowBuilds`, which is the\n * pnpm-major bump's own work and is refused by `pnpm check:app-deps` until it is done.\n *\n * ## The precedence a reader must honour\n *\n * pnpm 10.6.4 takes each setting from `package.json` → `pnpm` when that key is present there, and from the workspace\n * file otherwise. {@link readApplicationPnpmSettings} returns exactly that view, with each key's source, so a reader\n * sees what the installed pnpm sees whichever file an older application still keeps its settings in.\n *\n * ## What a write does\n *\n * {@link writeApplicationPnpmSettings} writes each given key into the workspace file and REMOVES the same key from\n * `package.json` → `pnpm` (dropping the field when it empties). Leaving the old copy would be worse than not writing:\n * under pnpm 10 it would keep replacing the new one. Keys a call does not name stay where they are, so a writer that\n * owns one setting never moves another.\n *\n * ## Why the workspace file is parsed by hand\n *\n * This package and the scripts beside the repository must read the file with no YAML dependency (the scripts run with\n * nothing installed; see `scripts/pnpm-workspace-members.mjs`). The grammar of the blocks owned here is small:\n * a map of scalar to scalar, or a list of scalars, plus comments. Anything else inside an owned block (a nested map, a\n * flow collection, a multi-line scalar) is REFUSED with its line number rather than guessed at, and every block this\n * module does not own is kept byte for byte.\n */\n\n/** The application root files that can carry pnpm settings. */\nexport enum PnpmSettingsSource {\n /** `package.json` → `pnpm`: read by pnpm 10, ignored by pnpm 11 (#2808). Never written by Wildo any more. */\n PACKAGE_JSON = 'package.json',\n /** `pnpm-workspace.yaml`: read by pnpm 10 and pnpm 11. Every Wildo writer writes here. */\n WORKSPACE_FILE = 'pnpm-workspace.yaml',\n}\n\n/** The pnpm settings Wildo reads and writes in an application, each a top-level key of the workspace file. */\nexport enum PnpmOwnedSetting {\n /** Version pins: the framework's propagated pins, its `file:` links, provider vendor pins, security floors. */\n OVERRIDES = 'overrides',\n /** The dependencies whose install scripts pnpm 10 runs. A provider module's vendor packages enter here (#2801). */\n ONLY_BUILT_DEPENDENCIES = 'onlyBuiltDependencies',\n /** The dependencies whose install scripts pnpm 10 never runs. Wildo never writes it; it only reads it, since pnpm refuses both lists. */\n NEVER_BUILT_DEPENDENCIES = 'neverBuiltDependencies',\n /** `<name>@<exact version>` → the root-relative patch file pnpm applies after installing that package (#3522). */\n PATCHED_DEPENDENCIES = 'patchedDependencies',\n}\n\n/** The owned settings in the order a workspace file renders them when it has to append them. */\nexport const PNPM_OWNED_SETTINGS: readonly PnpmOwnedSetting[] = [\n PnpmOwnedSetting.OVERRIDES,\n PnpmOwnedSetting.ONLY_BUILT_DEPENDENCIES,\n PnpmOwnedSetting.NEVER_BUILT_DEPENDENCIES,\n PnpmOwnedSetting.PATCHED_DEPENDENCIES,\n];\n\n/** One application's effective pnpm settings, as pnpm 10.6.4 resolves them. */\nexport interface ApplicationPnpmSettings {\n /** `overrides`, or `undefined` when neither file declares the setting. */\n overrides?: Record<string, string>;\n onlyBuiltDependencies?: string[];\n neverBuiltDependencies?: string[];\n patchedDependencies?: Record<string, string>;\n /** Where each declared setting was read from. A setting absent here is declared nowhere. */\n sources: Partial<Record<PnpmOwnedSetting, PnpmSettingsSource>>;\n /**\n * Every key of `package.json` → `pnpm`, owned or not. Non-empty means the application still keeps settings where pnpm 11\n * does not read them: an owned key is moved by the next write of it (or by {@link migrateApplicationPnpmSettings}); an\n * unowned one (`packageExtensions`, `patchedDependencies`, …) is the application's to move.\n */\n packageJsonKeys: string[];\n}\n\n/** A change to an application's settings: a value replaces the setting, `null` removes it, an absent key is left alone. */\nexport interface ApplicationPnpmSettingsUpdate {\n overrides?: Record<string, string> | null;\n onlyBuiltDependencies?: readonly string[] | null;\n neverBuiltDependencies?: readonly string[] | null;\n patchedDependencies?: Record<string, string> | null;\n}\n\n/** What {@link writeApplicationPnpmSettings} changed, so a caller can report it or stay quiet. */\nexport interface ApplicationPnpmSettingsWriteResult {\n /** True when either file's bytes changed. */\n changed: boolean;\n /** The owned keys removed from `package.json` → `pnpm` by this write. */\n movedFromPackageJson: PnpmOwnedSetting[];\n}\n\n/** Thrown for a workspace file or manifest this module cannot read faithfully. The message names the file and line. */\nexport class PnpmSettingsFormatError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'PnpmSettingsFormatError';\n }\n}\n\nconst OWNED_KEYS: ReadonlySet<string> = new Set<string>(PNPM_OWNED_SETTINGS);\nconst MAP_SETTINGS: ReadonlySet<string> = new Set<string>([PnpmOwnedSetting.OVERRIDES, PnpmOwnedSetting.PATCHED_DEPENDENCIES]);\n\n/** One entry of an owned block, with the comment lines written directly above it, which travel with it. */\ninterface OwnedEntry {\n key: string;\n value: string;\n leadingComments: string[];\n}\n\n/** One parsed owned block. `trailingComments` are indented comments after the last entry. */\ninterface OwnedBlock {\n setting: PnpmOwnedSetting;\n entries: OwnedEntry[];\n trailingComments: string[];\n /** The block's own lines as read, rendered back unchanged unless a write replaces the block. */\n raw?: string[];\n}\n\n/** A workspace file split into top-level segments. An owned block is parsed; everything else is kept verbatim. */\ntype WorkspaceSegment = { kind: 'verbatim'; lines: string[] } | { kind: 'owned'; block: OwnedBlock };\n\n// A top-level key, plain or quoted (`\"onlyBuiltDependencies\": [...]` is valid YAML and pnpm reads it).\nconst TOP_LEVEL_KEY = /^(?:\"([A-Za-z_][\\w-]*)\"|'([A-Za-z_][\\w-]*)'|([A-Za-z_][\\w-]*))\\s*:(.*)$/;\n\nfunction stripTrailingComment(text: string): string {\n // Only a ` #` outside quotes starts a comment; the scalar parser below handles quoted text first.\n const index = text.search(/\\s#/);\n return (index === -1 ? text : text.slice(0, index)).trim();\n}\n\n/** Parse one scalar at the start of `text`; returns the value and the rest of the text after it. */\nfunction parseScalar(text: string, where: string): { value: string; rest: string } {\n if (text.startsWith(\"'\")) {\n let value = '';\n let i = 1;\n for (;;) {\n if (i >= text.length) throw new PnpmSettingsFormatError(`${where}: unterminated single-quoted scalar.`);\n if (text[i] === \"'\") {\n if (text[i + 1] === \"'\") {\n value += \"'\";\n i += 2;\n continue;\n }\n return { value, rest: text.slice(i + 1) };\n }\n value += text[i];\n i += 1;\n }\n }\n if (text.startsWith('\"')) {\n let value = '';\n let i = 1;\n for (;;) {\n if (i >= text.length) throw new PnpmSettingsFormatError(`${where}: unterminated double-quoted scalar.`);\n const char = text[i];\n if (char === '\\\\') {\n const next = text[i + 1];\n if (next !== '\"' && next !== '\\\\') throw new PnpmSettingsFormatError(`${where}: escape \\\\${next ?? ''} is not supported; use single quotes.`);\n value += next;\n i += 2;\n continue;\n }\n if (char === '\"') return { value, rest: text.slice(i + 1) };\n value += char;\n i += 1;\n }\n }\n return { value: '', rest: text };\n}\n\n/** Parse a whole scalar that must make up `text` (a list item, or a map value), refusing what this grammar does not hold. */\nfunction parseWholeScalar(text: string, where: string): string {\n const trimmed = text.trim();\n if (trimmed.startsWith(\"'\") || trimmed.startsWith('\"')) {\n const { value, rest } = parseScalar(trimmed, where);\n if (stripTrailingComment(rest) !== '') throw new PnpmSettingsFormatError(`${where}: unexpected text after a quoted scalar.`);\n return value;\n }\n const plain = stripTrailingComment(trimmed);\n if (plain === '' || /^[[{|>&*!%@`]/.test(plain) || plain.includes(': ')) {\n throw new PnpmSettingsFormatError(`${where}: '${plain}' is not a scalar this reader supports; quote it with single quotes.`);\n }\n return plain;\n}\n\n/** The items of a flow list's inside, split at commas outside quotes; nested collections are refused. */\nfunction splitFlowItems(inside: string, where: string): string[] {\n const items: string[] = [];\n let current = '';\n let quote: string | null = null;\n for (const char of inside) {\n if (quote !== null) {\n current += char;\n if (char === quote) quote = null;\n } else if (char === \"'\" || char === '\"') {\n quote = char;\n current += char;\n } else if (char === ',') {\n items.push(current);\n current = '';\n } else if (char === '[' || char === '{') {\n throw new PnpmSettingsFormatError(`${where}: a nested collection is not supported in a flow list.`);\n } else {\n current += char;\n }\n }\n if (current.trim() !== '' || items.length > 0) items.push(current);\n return items.map((item) => item.trim());\n}\n\nfunction parseOwnedBlock(setting: PnpmOwnedSetting, headerRest: string, body: string[], firstLine: number, file: string): OwnedBlock {\n const block: OwnedBlock = { setting, entries: [], trailingComments: [] };\n const header = stripTrailingComment(headerRest);\n if (header === '{}' || (header.startsWith('[') && header.endsWith(']') && !MAP_SETTINGS.has(setting))) {\n if (body.some((line) => line.trim() !== '' && !line.trim().startsWith('#'))) {\n throw new PnpmSettingsFormatError(`${file}:${firstLine}: '${setting}: ${header}' is followed by entries.`);\n }\n // A flow list (`[esbuild, 'sharp']`): its items, split at the commas outside quotes.\n for (const item of splitFlowItems(header.slice(1, -1), `${file}:${firstLine}`)) {\n block.entries.push({ key: parseWholeScalar(item, `${file}:${firstLine}`), value: '', leadingComments: [] });\n }\n return block;\n }\n if (header !== '') throw new PnpmSettingsFormatError(`${file}:${firstLine}: '${setting}' must be a block (one entry per line), not '${header}'.`);\n const isMap = MAP_SETTINGS.has(setting);\n let pending: string[] = [];\n body.forEach((line, offset) => {\n const where = `${file}:${firstLine + 1 + offset}`;\n const trimmed = line.trim();\n if (trimmed === '') return;\n if (trimmed.startsWith('#')) {\n pending.push(line);\n return;\n }\n if (isMap) {\n const { value: quotedKey, rest } = parseScalar(trimmed, where);\n let key: string;\n let afterKey: string;\n if (trimmed.startsWith(\"'\") || trimmed.startsWith('\"')) {\n key = quotedKey;\n afterKey = rest;\n } else {\n const colon = trimmed.indexOf(': ');\n if (colon === -1) throw new PnpmSettingsFormatError(`${where}: '${trimmed}' is not a 'name: value' entry.`);\n key = trimmed.slice(0, colon).trim();\n afterKey = trimmed.slice(colon);\n }\n const match = /^\\s*:\\s(.*)$/.exec(afterKey);\n if (!match) throw new PnpmSettingsFormatError(`${where}: '${trimmed}' is not a 'name: value' entry.`);\n block.entries.push({ key, value: parseWholeScalar(match[1] ?? '', where), leadingComments: pending });\n } else {\n if (!trimmed.startsWith('- ')) throw new PnpmSettingsFormatError(`${where}: '${trimmed}' is not a '- name' list item.`);\n block.entries.push({ key: parseWholeScalar(trimmed.slice(2), where), value: '', leadingComments: pending });\n }\n pending = [];\n });\n block.trailingComments = pending;\n return block;\n}\n\n/** Split a workspace file into segments. Lines between top-level keys that start at column 0 open a verbatim segment. */\nfunction parseWorkspaceFile(text: string, file: string): WorkspaceSegment[] {\n const lines = text.split('\\n');\n if (lines.length > 0 && lines[lines.length - 1] === '') lines.pop();\n const segments: WorkspaceSegment[] = [];\n const seen = new Set<string>();\n let i = 0;\n const pushVerbatim = (line: string): void => {\n const last = segments[segments.length - 1];\n if (last?.kind === 'verbatim') last.lines.push(line);\n else segments.push({ kind: 'verbatim', lines: [line] });\n };\n while (i < lines.length) {\n const line = lines[i] ?? '';\n const match = TOP_LEVEL_KEY.exec(line);\n const key = match ? (match[1] ?? match[2] ?? match[3] ?? '') : '';\n if (match && OWNED_KEYS.has(key)) {\n const setting = key as PnpmOwnedSetting;\n if (seen.has(setting)) throw new PnpmSettingsFormatError(`${file}:${i + 1}: '${setting}' is declared twice.`);\n seen.add(setting);\n const body: string[] = [];\n let j = i + 1;\n // A block runs over blank and indented lines; the first non-blank line at column 0 ends it.\n while (j < lines.length && ((lines[j] ?? '').trim() === '' || /^\\s/.test(lines[j] ?? ''))) {\n body.push(lines[j] ?? '');\n j += 1;\n }\n // Blank lines closing the block belong to the file's layout, not to the block.\n let trailingBlank = 0;\n while (body.length > 0 && (body[body.length - 1] ?? '').trim() === '') {\n body.pop();\n trailingBlank += 1;\n }\n segments.push({ kind: 'owned', block: { ...parseOwnedBlock(setting, match[4] ?? '', body, i + 1, file), raw: [line, ...body] } });\n for (let k = 0; k < trailingBlank; k += 1) pushVerbatim('');\n i = j;\n continue;\n }\n pushVerbatim(line);\n i += 1;\n }\n return segments;\n}\n\n/** Quote a scalar the one way this module writes them: single quotes, a quote doubled. */\nfunction quote(value: string): string {\n return `'${value.replace(/'/g, \"''\")}'`;\n}\n\nfunction renderOwnedBlock(block: OwnedBlock): string[] {\n if (block.raw !== undefined) return block.raw;\n if (block.entries.length === 0 && block.trailingComments.length === 0) {\n return [`${block.setting}: ${MAP_SETTINGS.has(block.setting) ? '{}' : '[]'}`];\n }\n const lines = [`${block.setting}:`];\n for (const entry of block.entries) {\n lines.push(...entry.leadingComments);\n lines.push(MAP_SETTINGS.has(block.setting) ? ` ${quote(entry.key)}: ${quote(entry.value)}` : ` - ${quote(entry.key)}`);\n }\n lines.push(...block.trailingComments);\n return lines;\n}\n\nfunction renderWorkspaceFile(segments: readonly WorkspaceSegment[]): string {\n const lines: string[] = [];\n for (const segment of segments) {\n if (segment.kind === 'verbatim') lines.push(...segment.lines);\n else lines.push(...renderOwnedBlock(segment.block));\n }\n return lines.length === 0 ? '' : `${lines.join('\\n')}\\n`;\n}\n\n/** Code-unit order, the order every Wildo writer of these settings has always used. */\nfunction compareKeys(a: string, b: string): number {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\n/** Whether a block already holds `next`: the same pairs, or the same names, whatever their order. A no-op write writes nothing. */\nfunction sameContents(current: Record<string, string> | string[], next: Record<string, string> | readonly string[]): boolean {\n const pairs = (value: Record<string, string> | readonly string[]): string[] =>\n (Array.isArray(value) ? [...new Set(value as readonly string[])] : Object.entries(value as Record<string, string>).map(([k, v]) => `${k}\\u0000${v}`)).sort();\n return JSON.stringify(pairs(current)) === JSON.stringify(pairs(next));\n}\n\n/** Rebuild a block from new contents, keeping each surviving entry's comments. */\nfunction rebuildBlock(setting: PnpmOwnedSetting, previous: OwnedBlock | undefined, next: Record<string, string> | readonly string[]): OwnedBlock {\n const commentsByKey = new Map((previous?.entries ?? []).map((entry) => [entry.key, entry.leadingComments] as const));\n const pairs: Array<[string, string]> = Array.isArray(next)\n ? [...new Set(next as readonly string[])].map((name) => [name, ''] as [string, string])\n : Object.entries(next as Record<string, string>);\n pairs.sort(([a], [b]) => compareKeys(a, b));\n return {\n setting,\n entries: pairs.map(([key, value]) => ({ key, value, leadingComments: commentsByKey.get(key) ?? [] })),\n trailingComments: previous?.trailingComments ?? [],\n };\n}\n\nfunction blockValue(block: OwnedBlock): Record<string, string> | string[] {\n return MAP_SETTINGS.has(block.setting)\n ? Object.fromEntries(block.entries.map((entry) => [entry.key, entry.value]))\n : block.entries.map((entry) => entry.key);\n}\n\nfunction readManifest(applicationRoot: string): Record<string, unknown> | undefined {\n const path = join(applicationRoot, PnpmSettingsSource.PACKAGE_JSON);\n if (!existsSync(path)) return undefined;\n const parsed: unknown = JSON.parse(readFileSync(path, 'utf8'));\n if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {\n throw new PnpmSettingsFormatError(`${path}: not a JSON object.`);\n }\n return parsed as Record<string, unknown>;\n}\n\nfunction manifestPnpmField(manifest: Record<string, unknown> | undefined, path: string): Record<string, unknown> | undefined {\n const field = manifest?.pnpm;\n if (field === undefined) return undefined;\n if (field === null || typeof field !== 'object' || Array.isArray(field)) {\n throw new PnpmSettingsFormatError(`${path}: the 'pnpm' field is not an object.`);\n }\n return field as Record<string, unknown>;\n}\n\nfunction manifestSetting(field: Record<string, unknown>, setting: PnpmOwnedSetting, path: string): Record<string, string> | string[] {\n const value = field[setting];\n if (MAP_SETTINGS.has(setting)) {\n if (value === null || typeof value !== 'object' || Array.isArray(value)) throw new PnpmSettingsFormatError(`${path}: pnpm.${setting} is not an object.`);\n return Object.fromEntries(Object.entries(value as Record<string, unknown>).map(([key, entry]) => [key, String(entry)]));\n }\n if (!Array.isArray(value)) throw new PnpmSettingsFormatError(`${path}: pnpm.${setting} is not a list.`);\n return value.map(String);\n}\n\n/**\n * The application's effective pnpm settings, as pnpm 10.6.4 reads them: each owned setting from `package.json` → `pnpm`\n * when that key is present there, else from `pnpm-workspace.yaml`. Throws {@link PnpmSettingsFormatError} for a file it\n * cannot read faithfully, never a partial answer.\n */\nexport function readApplicationPnpmSettings(applicationRoot: string): ApplicationPnpmSettings {\n const manifestPath = join(applicationRoot, PnpmSettingsSource.PACKAGE_JSON);\n const workspacePath = join(applicationRoot, PnpmSettingsSource.WORKSPACE_FILE);\n return resolveApplicationPnpmSettingsText({\n manifestText: existsSync(manifestPath) ? readFileSync(manifestPath, 'utf8') : null,\n manifestPath,\n workspaceText: existsSync(workspacePath) ? readFileSync(workspacePath, 'utf8') : null,\n workspacePath,\n });\n}\n\n/**\n * {@link readApplicationPnpmSettings} over the two files' TEXT (`null` for an absent file), for a caller previewing\n * contents it has not written yet (the provider-link reconciliation inside a composition plan).\n */\nexport function resolveApplicationPnpmSettingsText(input: {\n manifestText: string | null;\n manifestPath: string;\n workspaceText: string | null;\n workspacePath: string;\n}): ApplicationPnpmSettings {\n let manifest: Record<string, unknown> | undefined;\n if (input.manifestText !== null) {\n const parsed: unknown = JSON.parse(input.manifestText);\n if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) throw new PnpmSettingsFormatError(`${input.manifestPath}: not a JSON object.`);\n manifest = parsed as Record<string, unknown>;\n }\n const field = manifestPnpmField(manifest, input.manifestPath);\n const workspace = new Map<PnpmOwnedSetting, OwnedBlock>();\n for (const segment of input.workspaceText === null ? [] : parseWorkspaceFile(input.workspaceText, input.workspacePath)) {\n if (segment.kind === 'owned') workspace.set(segment.block.setting, segment.block);\n }\n const settings: ApplicationPnpmSettings = { sources: {}, packageJsonKeys: Object.keys(field ?? {}) };\n const assign = (setting: PnpmOwnedSetting, value: Record<string, string> | string[]): void => {\n if (setting === PnpmOwnedSetting.OVERRIDES) settings.overrides = value as Record<string, string>;\n else if (setting === PnpmOwnedSetting.ONLY_BUILT_DEPENDENCIES) settings.onlyBuiltDependencies = value as string[];\n else if (setting === PnpmOwnedSetting.PATCHED_DEPENDENCIES) settings.patchedDependencies = value as Record<string, string>;\n else settings.neverBuiltDependencies = value as string[];\n };\n for (const setting of PNPM_OWNED_SETTINGS) {\n if (field !== undefined && Object.hasOwn(field, setting)) {\n assign(setting, manifestSetting(field, setting, input.manifestPath));\n settings.sources[setting] = PnpmSettingsSource.PACKAGE_JSON;\n } else if (workspace.has(setting)) {\n assign(setting, blockValue(workspace.get(setting) as OwnedBlock));\n settings.sources[setting] = PnpmSettingsSource.WORKSPACE_FILE;\n }\n }\n return settings;\n}\n\n/**\n * `package.json` text with the given owned settings removed from its `pnpm` field (the field dropped when it empties),\n * formatted as every Wildo writer formats a manifest. Returns `text` itself when none of them is there.\n */\nexport function removePackageJsonPnpmSettingsText(text: string, path: string, settings: readonly PnpmOwnedSetting[]): string {\n const parsed: unknown = JSON.parse(text);\n if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) throw new PnpmSettingsFormatError(`${path}: not a JSON object.`);\n const manifest = parsed as Record<string, unknown>;\n const field = manifestPnpmField(manifest, path);\n if (field === undefined || !settings.some((setting) => Object.hasOwn(field, setting))) return text;\n for (const setting of settings) delete field[setting];\n if (Object.keys(field).length === 0) delete manifest.pnpm;\n return `${JSON.stringify(manifest, null, 2)}\\n`;\n}\n\n/**\n * Place a block the file did not have. Directly ABOVE the `packages:` block (and the column-0 comments written over it)\n * when there is one, because every scenario and provider install adds a workspace member by appending a line at the\n * END of the file: an owned block after `packages:` would receive those member lines as entries. At the end otherwise.\n */\nfunction insertNewBlock(segments: WorkspaceSegment[], block: OwnedBlock): void {\n for (let index = 0; index < segments.length; index += 1) {\n const segment = segments[index];\n if (segment?.kind !== 'verbatim') continue;\n const packagesLine = segment.lines.findIndex((line) => /^packages\\s*:/.test(line));\n if (packagesLine === -1) continue;\n let at = packagesLine;\n while (at > 0 && /^#/.test(segment.lines[at - 1] ?? '')) at -= 1;\n const before = segment.lines.slice(0, at);\n const after = segment.lines.slice(at);\n const inserted: WorkspaceSegment[] = [];\n if (before.length > 0) inserted.push({ kind: 'verbatim', lines: (before[before.length - 1] ?? '') === '' ? before : [...before, ''] });\n else if (segments[index - 1]?.kind === 'owned') inserted.push({ kind: 'verbatim', lines: [''] });\n inserted.push({ kind: 'owned', block }, { kind: 'verbatim', lines: ['', ...after] });\n segments.splice(index, 1, ...inserted);\n return;\n }\n const last = segments[segments.length - 1];\n if (last?.kind === 'verbatim' && (last.lines[last.lines.length - 1] ?? '') !== '') last.lines.push('');\n else if (last?.kind === 'owned') segments.push({ kind: 'verbatim', lines: [''] });\n segments.push({ kind: 'owned', block });\n}\n\n/**\n * The owned settings a workspace file's TEXT declares, for a caller that holds the bytes rather than the file (the\n * composition planner, which edits files in memory before writing any). Same grammar, same refusals, as the file\n * readers above.\n */\nexport function readPnpmWorkspaceSettingsText(text: string, file: string): Partial<Record<PnpmOwnedSetting, Record<string, string> | string[]>> {\n const declared: Partial<Record<PnpmOwnedSetting, Record<string, string> | string[]>> = {};\n for (const segment of parseWorkspaceFile(text, file)) {\n if (segment.kind === 'owned') declared[segment.block.setting] = blockValue(segment.block);\n }\n return declared;\n}\n\n/**\n * A workspace file's text with the given settings replaced (`null` removes one). Untouched blocks, comments and every\n * block this module does not own keep their bytes; a setting whose contents do not change keeps its bytes too, so a\n * no-op update returns `text` itself.\n */\nexport function updatePnpmWorkspaceSettingsText(text: string, file: string, update: ApplicationPnpmSettingsUpdate): string {\n const segments = parseWorkspaceFile(text, file);\n for (const setting of PNPM_OWNED_SETTINGS) {\n if (!Object.hasOwn(update, setting)) continue;\n const next = update[setting as keyof ApplicationPnpmSettingsUpdate];\n const index = segments.findIndex((segment) => segment.kind === 'owned' && segment.block.setting === setting);\n const previous = index === -1 ? undefined : (segments[index] as { kind: 'owned'; block: OwnedBlock }).block;\n if (next === null || next === undefined) {\n if (index !== -1) {\n segments.splice(index, 1);\n // The blank line that separated the block goes with it, so removing a block a write inserted gives the file back.\n const before = segments[index - 1];\n const after = segments[index];\n if (after?.kind === 'verbatim' && after.lines[0] === '' && (before === undefined || (before.kind === 'verbatim' && before.lines[before.lines.length - 1] === ''))) {\n after.lines.shift();\n }\n }\n } else if (previous === undefined || !sameContents(blockValue(previous), next as Record<string, string> | readonly string[])) {\n const block = rebuildBlock(setting, previous, next as Record<string, string> | readonly string[]);\n if (index !== -1) segments[index] = { kind: 'owned', block };\n else insertNewBlock(segments, block);\n }\n }\n const rendered = renderWorkspaceFile(segments);\n return rendered === renderWorkspaceFile(parseWorkspaceFile(text, file)) ? text : rendered;\n}\n\n/**\n * Write the given settings into the application's `pnpm-workspace.yaml` and remove the same keys from `package.json` →\n * `pnpm` (see the module comment for why both). A setting the update does not name is left exactly where it is. Writes\n * a file only when its bytes change; formats the manifest as every Wildo writer does (two-space JSON, final newline).\n */\nexport function writeApplicationPnpmSettings(applicationRoot: string, update: ApplicationPnpmSettingsUpdate): ApplicationPnpmSettingsWriteResult {\n const workspacePath = join(applicationRoot, PnpmSettingsSource.WORKSPACE_FILE);\n const manifestPath = join(applicationRoot, PnpmSettingsSource.PACKAGE_JSON);\n const originalWorkspace = existsSync(workspacePath) ? readFileSync(workspacePath, 'utf8') : '';\n const manifest = readManifest(applicationRoot);\n const field = manifestPnpmField(manifest, manifestPath);\n const movedFromPackageJson: PnpmOwnedSetting[] = [];\n for (const setting of PNPM_OWNED_SETTINGS) {\n if (Object.hasOwn(update, setting) && field !== undefined && Object.hasOwn(field, setting)) {\n delete field[setting];\n movedFromPackageJson.push(setting);\n }\n }\n let changed = false;\n const after = updatePnpmWorkspaceSettingsText(originalWorkspace, workspacePath, update);\n if (after !== originalWorkspace) {\n writeFileSync(workspacePath, after, 'utf8');\n changed = true;\n }\n if (manifest !== undefined && movedFromPackageJson.length > 0) {\n if (field !== undefined && Object.keys(field).length === 0) delete manifest.pnpm;\n writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 2)}\\n`, 'utf8');\n changed = true;\n }\n return { changed, movedFromPackageJson };\n}\n\n/**\n * Move every owned setting `package.json` → `pnpm` still carries into `pnpm-workspace.yaml`, unchanged in value: the\n * effective settings are the same before and after, under pnpm 10, and pnpm 11 starts reading them. Returns the keys\n * of `package.json` → `pnpm` it could not move (settings Wildo does not own), which the caller reports.\n */\nexport function migrateApplicationPnpmSettings(applicationRoot: string): { result: ApplicationPnpmSettingsWriteResult; unownedPackageJsonKeys: string[] } {\n const settings = readApplicationPnpmSettings(applicationRoot);\n const update: ApplicationPnpmSettingsUpdate = {};\n if (settings.sources.overrides === PnpmSettingsSource.PACKAGE_JSON) update.overrides = settings.overrides ?? {};\n if (settings.sources.onlyBuiltDependencies === PnpmSettingsSource.PACKAGE_JSON) update.onlyBuiltDependencies = settings.onlyBuiltDependencies ?? [];\n if (settings.sources.neverBuiltDependencies === PnpmSettingsSource.PACKAGE_JSON) update.neverBuiltDependencies = settings.neverBuiltDependencies ?? [];\n if (settings.sources.patchedDependencies === PnpmSettingsSource.PACKAGE_JSON) update.patchedDependencies = settings.patchedDependencies ?? {};\n const result = writeApplicationPnpmSettings(applicationRoot, update);\n return { result, unownedPackageJsonKeys: settings.packageJsonKeys.filter((key) => !OWNED_KEYS.has(key)) };\n}\n"]}
1
+ {"version":3,"file":"application-pnpm-settings.js","sourceRoot":"","sources":["../../../src/pnpm-settings/application-pnpm-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,+DAA+D;AAC/D,MAAM,CAAN,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,6GAA6G;IAC7G,mDAA6B,CAAA;IAC7B,0FAA0F;IAC1F,4DAAsC,CAAA;AACxC,CAAC,EALW,kBAAkB,KAAlB,kBAAkB,QAK7B;AAED,8GAA8G;AAC9G,MAAM,CAAN,IAAY,gBASX;AATD,WAAY,gBAAgB;IAC1B,+GAA+G;IAC/G,2CAAuB,CAAA;IACvB,mHAAmH;IACnH,qEAAiD,CAAA;IACjD,yIAAyI;IACzI,uEAAmD,CAAA;IACnD,kHAAkH;IAClH,gEAA4C,CAAA;AAC9C,CAAC,EATW,gBAAgB,KAAhB,gBAAgB,QAS3B;AAED,gGAAgG;AAChG,MAAM,CAAC,MAAM,mBAAmB,GAAgC;IAC9D,gBAAgB,CAAC,SAAS;IAC1B,gBAAgB,CAAC,uBAAuB;IACxC,gBAAgB,CAAC,wBAAwB;IACzC,gBAAgB,CAAC,oBAAoB;CACtC,CAAC;AAmCF,uHAAuH;AACvH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAChD,YAAY,OAAe;QACzB,K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,CAAC,mBAAmB,IAAI,EAAE,CAAC;IAC9I,MAAM,MAAM,GAAG,4BAA4B,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IACrE,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;AAC5G,CAAC","sourcesContent":["import { existsSync, readFileSync, writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\n\n/**\n * The ONE place that decides where an application's pnpm settings live, how they are read and how they are written\n * (#2808). Its twin for the repository's dependency-free scripts is `scripts/pnpm-workspace-settings.mjs`: the same\n * grammar, the same precedence and the same rendering, held byte-for-byte equal by `application-pnpm-settings.parity.test.ts`.\n *\n * ## Where the settings live, measured rather than assumed (2026-11-09, scratch workspaces with local tarballs)\n *\n * | setting | pnpm 10.6.4 (the pin at the time; 10.34.9 since #3014 behaves the same here) | pnpm 11.20.0 |\n * |---|---|---|\n * | `overrides` in `pnpm-workspace.yaml` | read | read |\n * | `overrides` in `package.json` → `pnpm` | read, and it REPLACES the YAML block whole (a `package.json` block holding one unrelated key switched off every YAML override) | ignored, with a warning naming the key |\n * | `onlyBuiltDependencies` in `pnpm-workspace.yaml` | read | ignored silently: pnpm 11 REMOVED the setting (`allowBuilds` replaces it) |\n * | `onlyBuiltDependencies` in `package.json` | read, and it replaces the YAML list | ignored, with a warning |\n * | `neverBuiltDependencies`, either file | read; beside an `onlyBuiltDependencies` list in EITHER file, `ERR_PNPM_CONFIG_CONFLICT_BUILT_DEPENDENCIES` | ignored (removed) |\n * | `allowBuilds` in `pnpm-workspace.yaml` | not read (the 10.6.4 binary does not know the key) | read |\n * | `patchedDependencies`, `packageExtensions` in `pnpm-workspace.yaml` | read | read |\n * | the same in `package.json` → `pnpm` | read (a `package.json` `patchedDependencies` is applied in place of the YAML one) | ignored, with a warning |\n *\n * So `pnpm-workspace.yaml` is the one file both versions read, and it is where every writer puts the settings it owns.\n * The two build lists are carried there for the pnpm 10 pin; pnpm 11 needs them restated as `allowBuilds`, which is the\n * pnpm-major bump's own work and is refused by `pnpm check:app-deps` until it is done.\n *\n * ## The precedence a reader must honour\n *\n * pnpm 10.6.4 takes each setting from `package.json` → `pnpm` when that key is present there, and from the workspace\n * file otherwise. {@link readApplicationPnpmSettings} returns exactly that view, with each key's source, so a reader\n * sees what the installed pnpm sees whichever file an older application still keeps its settings in.\n *\n * ## What a write does\n *\n * {@link writeApplicationPnpmSettings} writes each given key into the workspace file and REMOVES the same key from\n * `package.json` → `pnpm` (dropping the field when it empties). Leaving the old copy would be worse than not writing:\n * under pnpm 10 it would keep replacing the new one. Keys a call does not name stay where they are, so a writer that\n * owns one setting never moves another.\n *\n * ## Why the workspace file is parsed by hand\n *\n * This package and the scripts beside the repository must read the file with no YAML dependency (the scripts run with\n * nothing installed; see `scripts/pnpm-workspace-members.mjs`). The grammar of the blocks owned here is small:\n * a map of scalar to scalar, or a list of scalars, plus comments. Anything else inside an owned block (a nested map, a\n * flow collection, a multi-line scalar) is REFUSED with its line number rather than guessed at, and every block this\n * module does not own is kept byte for byte.\n */\n\n/** The application root files that can carry pnpm settings. */\nexport enum PnpmSettingsSource {\n /** `package.json` → `pnpm`: read by pnpm 10, ignored by pnpm 11 (#2808). Never written by Wildo any more. */\n PACKAGE_JSON = 'package.json',\n /** `pnpm-workspace.yaml`: read by pnpm 10 and pnpm 11. Every Wildo writer writes here. */\n WORKSPACE_FILE = 'pnpm-workspace.yaml',\n}\n\n/** The pnpm settings Wildo reads and writes in an application, each a top-level key of the workspace file. */\nexport enum PnpmOwnedSetting {\n /** Version pins: the framework's propagated pins, its `file:` links, provider vendor pins, security floors. */\n OVERRIDES = 'overrides',\n /** The dependencies whose install scripts pnpm 10 runs. A provider module's vendor packages enter here (#2801). */\n ONLY_BUILT_DEPENDENCIES = 'onlyBuiltDependencies',\n /** The dependencies whose install scripts pnpm 10 never runs. Wildo never writes it; it only reads it, since pnpm refuses both lists. */\n NEVER_BUILT_DEPENDENCIES = 'neverBuiltDependencies',\n /** `<name>@<exact version>` → the root-relative patch file pnpm applies after installing that package (#3522). */\n PATCHED_DEPENDENCIES = 'patchedDependencies',\n}\n\n/** The owned settings in the order a workspace file renders them when it has to append them. */\nexport const PNPM_OWNED_SETTINGS: readonly PnpmOwnedSetting[] = [\n PnpmOwnedSetting.OVERRIDES,\n PnpmOwnedSetting.ONLY_BUILT_DEPENDENCIES,\n PnpmOwnedSetting.NEVER_BUILT_DEPENDENCIES,\n PnpmOwnedSetting.PATCHED_DEPENDENCIES,\n];\n\n/** One application's effective pnpm settings, as pnpm 10.6.4 resolves them. */\nexport interface ApplicationPnpmSettings {\n /** `overrides`, or `undefined` when neither file declares the setting. */\n overrides?: Record<string, string>;\n onlyBuiltDependencies?: string[];\n neverBuiltDependencies?: string[];\n patchedDependencies?: Record<string, string>;\n /** Where each declared setting was read from. A setting absent here is declared nowhere. */\n sources: Partial<Record<PnpmOwnedSetting, PnpmSettingsSource>>;\n /**\n * Every key of `package.json` → `pnpm`, owned or not. Non-empty means the application still keeps settings where pnpm 11\n * does not read them: an owned key is moved by the next write of it (or by {@link migrateApplicationPnpmSettings}); an\n * unowned one (`packageExtensions`, `patchedDependencies`, …) is the application's to move.\n */\n packageJsonKeys: string[];\n}\n\n/** A change to an application's settings: a value replaces the setting, `null` removes it, an absent key is left alone. */\nexport interface ApplicationPnpmSettingsUpdate {\n overrides?: Record<string, string> | null;\n onlyBuiltDependencies?: readonly string[] | null;\n neverBuiltDependencies?: readonly string[] | null;\n patchedDependencies?: Record<string, string> | null;\n}\n\n/** What {@link writeApplicationPnpmSettings} changed, so a caller can report it or stay quiet. */\nexport interface ApplicationPnpmSettingsWriteResult {\n /** True when either file's bytes changed. */\n changed: boolean;\n /** The owned keys removed from `package.json` → `pnpm` by this write. */\n movedFromPackageJson: PnpmOwnedSetting[];\n}\n\n/** Thrown for a workspace file or manifest this module cannot read faithfully. The message names the file and line. */\nexport class PnpmSettingsFormatError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'PnpmSettingsFormatError';\n }\n}\n\nconst OWNED_KEYS: ReadonlySet<string> = new Set<string>(PNPM_OWNED_SETTINGS);\nconst MAP_SETTINGS: ReadonlySet<string> = new Set<string>([PnpmOwnedSetting.OVERRIDES, PnpmOwnedSetting.PATCHED_DEPENDENCIES]);\n\n/** One entry of an owned block, with the comment lines written directly above it, which travel with it. */\ninterface OwnedEntry {\n key: string;\n value: string;\n leadingComments: string[];\n}\n\n/** One parsed owned block. `trailingComments` are indented comments after the last entry. */\ninterface OwnedBlock {\n setting: PnpmOwnedSetting;\n entries: OwnedEntry[];\n trailingComments: string[];\n /** The block's own lines as read, rendered back unchanged unless a write replaces the block. */\n raw?: string[];\n}\n\n/** A workspace file split into top-level segments. An owned block is parsed; everything else is kept verbatim. */\ntype WorkspaceSegment = { kind: 'verbatim'; lines: string[] } | { kind: 'owned'; block: OwnedBlock };\n\n// A top-level key, plain or quoted (`\"onlyBuiltDependencies\": [...]` is valid YAML and pnpm reads it).\nconst TOP_LEVEL_KEY = /^(?:\"([A-Za-z_][\\w-]*)\"|'([A-Za-z_][\\w-]*)'|([A-Za-z_][\\w-]*))\\s*:(.*)$/;\n\nfunction stripTrailingComment(text: string): string {\n // Only a ` #` outside quotes starts a comment; the scalar parser below handles quoted text first.\n const index = text.search(/\\s#/);\n return (index === -1 ? text : text.slice(0, index)).trim();\n}\n\n/** Parse one scalar at the start of `text`; returns the value and the rest of the text after it. */\nfunction parseScalar(text: string, where: string): { value: string; rest: string } {\n if (text.startsWith(\"'\")) {\n let value = '';\n let i = 1;\n for (;;) {\n if (i >= text.length) throw new PnpmSettingsFormatError(`${where}: unterminated single-quoted scalar.`);\n if (text[i] === \"'\") {\n if (text[i + 1] === \"'\") {\n value += \"'\";\n i += 2;\n continue;\n }\n return { value, rest: text.slice(i + 1) };\n }\n value += text[i];\n i += 1;\n }\n }\n if (text.startsWith('\"')) {\n let value = '';\n let i = 1;\n for (;;) {\n if (i >= text.length) throw new PnpmSettingsFormatError(`${where}: unterminated double-quoted scalar.`);\n const char = text[i];\n if (char === '\\\\') {\n const next = text[i + 1];\n if (next !== '\"' && next !== '\\\\') throw new PnpmSettingsFormatError(`${where}: escape \\\\${next ?? ''} is not supported; use single quotes.`);\n value += next;\n i += 2;\n continue;\n }\n if (char === '\"') return { value, rest: text.slice(i + 1) };\n value += char;\n i += 1;\n }\n }\n return { value: '', rest: text };\n}\n\n/** Parse a whole scalar that must make up `text` (a list item, or a map value), refusing what this grammar does not hold. */\nfunction parseWholeScalar(text: string, where: string): string {\n const trimmed = text.trim();\n if (trimmed.startsWith(\"'\") || trimmed.startsWith('\"')) {\n const { value, rest } = parseScalar(trimmed, where);\n if (stripTrailingComment(rest) !== '') throw new PnpmSettingsFormatError(`${where}: unexpected text after a quoted scalar.`);\n return value;\n }\n const plain = stripTrailingComment(trimmed);\n if (plain === '' || /^[[{|>&*!%@`]/.test(plain) || plain.includes(': ')) {\n throw new PnpmSettingsFormatError(`${where}: '${plain}' is not a scalar this reader supports; quote it with single quotes.`);\n }\n return plain;\n}\n\n/** The items of a flow list's inside, split at commas outside quotes; nested collections are refused. */\nfunction splitFlowItems(inside: string, where: string): string[] {\n const items: string[] = [];\n let current = '';\n let quote: string | null = null;\n for (const char of inside) {\n if (quote !== null) {\n current += char;\n if (char === quote) quote = null;\n } else if (char === \"'\" || char === '\"') {\n quote = char;\n current += char;\n } else if (char === ',') {\n items.push(current);\n current = '';\n } else if (char === '[' || char === '{') {\n throw new PnpmSettingsFormatError(`${where}: a nested collection is not supported in a flow list.`);\n } else {\n current += char;\n }\n }\n if (current.trim() !== '' || items.length > 0) items.push(current);\n return items.map((item) => item.trim());\n}\n\nfunction parseOwnedBlock(setting: PnpmOwnedSetting, headerRest: string, body: string[], firstLine: number, file: string): OwnedBlock {\n const block: OwnedBlock = { setting, entries: [], trailingComments: [] };\n const header = stripTrailingComment(headerRest);\n if (header === '{}' || (header.startsWith('[') && header.endsWith(']') && !MAP_SETTINGS.has(setting))) {\n if (body.some((line) => line.trim() !== '' && !line.trim().startsWith('#'))) {\n throw new PnpmSettingsFormatError(`${file}:${firstLine}: '${setting}: ${header}' is followed by entries.`);\n }\n // A flow list (`[esbuild, 'sharp']`): its items, split at the commas outside quotes.\n for (const item of splitFlowItems(header.slice(1, -1), `${file}:${firstLine}`)) {\n block.entries.push({ key: parseWholeScalar(item, `${file}:${firstLine}`), value: '', leadingComments: [] });\n }\n return block;\n }\n if (header !== '') throw new PnpmSettingsFormatError(`${file}:${firstLine}: '${setting}' must be a block (one entry per line), not '${header}'.`);\n const isMap = MAP_SETTINGS.has(setting);\n let pending: string[] = [];\n body.forEach((line, offset) => {\n const where = `${file}:${firstLine + 1 + offset}`;\n const trimmed = line.trim();\n if (trimmed === '') return;\n if (trimmed.startsWith('#')) {\n pending.push(line);\n return;\n }\n if (isMap) {\n const { value: quotedKey, rest } = parseScalar(trimmed, where);\n let key: string;\n let afterKey: string;\n if (trimmed.startsWith(\"'\") || trimmed.startsWith('\"')) {\n key = quotedKey;\n afterKey = rest;\n } else {\n const colon = trimmed.indexOf(': ');\n if (colon === -1) throw new PnpmSettingsFormatError(`${where}: '${trimmed}' is not a 'name: value' entry.`);\n key = trimmed.slice(0, colon).trim();\n afterKey = trimmed.slice(colon);\n }\n const match = /^\\s*:\\s(.*)$/.exec(afterKey);\n if (!match) throw new PnpmSettingsFormatError(`${where}: '${trimmed}' is not a 'name: value' entry.`);\n block.entries.push({ key, value: parseWholeScalar(match[1] ?? '', where), leadingComments: pending });\n } else {\n if (!trimmed.startsWith('- ')) throw new PnpmSettingsFormatError(`${where}: '${trimmed}' is not a '- name' list item.`);\n block.entries.push({ key: parseWholeScalar(trimmed.slice(2), where), value: '', leadingComments: pending });\n }\n pending = [];\n });\n block.trailingComments = pending;\n return block;\n}\n\n/** Split a workspace file into segments. Lines between top-level keys that start at column 0 open a verbatim segment. */\nfunction parseWorkspaceFile(text: string, file: string): WorkspaceSegment[] {\n const lines = text.split('\\n');\n if (lines.length > 0 && lines[lines.length - 1] === '') lines.pop();\n const segments: WorkspaceSegment[] = [];\n const seen = new Set<string>();\n let i = 0;\n const pushVerbatim = (line: string): void => {\n const last = segments[segments.length - 1];\n if (last?.kind === 'verbatim') last.lines.push(line);\n else segments.push({ kind: 'verbatim', lines: [line] });\n };\n while (i < lines.length) {\n const line = lines[i] ?? '';\n const match = TOP_LEVEL_KEY.exec(line);\n const key = match ? (match[1] ?? match[2] ?? match[3] ?? '') : '';\n if (match && OWNED_KEYS.has(key)) {\n const setting = key as PnpmOwnedSetting;\n if (seen.has(setting)) throw new PnpmSettingsFormatError(`${file}:${i + 1}: '${setting}' is declared twice.`);\n seen.add(setting);\n const body: string[] = [];\n let j = i + 1;\n // A block runs over blank and indented lines; the first non-blank line at column 0 ends it.\n while (j < lines.length && ((lines[j] ?? '').trim() === '' || /^\\s/.test(lines[j] ?? ''))) {\n body.push(lines[j] ?? '');\n j += 1;\n }\n // Blank lines closing the block belong to the file's layout, not to the block.\n let trailingBlank = 0;\n while (body.length > 0 && (body[body.length - 1] ?? '').trim() === '') {\n body.pop();\n trailingBlank += 1;\n }\n segments.push({ kind: 'owned', block: { ...parseOwnedBlock(setting, match[4] ?? '', body, i + 1, file), raw: [line, ...body] } });\n for (let k = 0; k < trailingBlank; k += 1) pushVerbatim('');\n i = j;\n continue;\n }\n pushVerbatim(line);\n i += 1;\n }\n return segments;\n}\n\n/** Quote a scalar the one way this module writes them: single quotes, a quote doubled. */\nfunction quote(value: string): string {\n return `'${value.replace(/'/g, \"''\")}'`;\n}\n\nfunction renderOwnedBlock(block: OwnedBlock): string[] {\n if (block.raw !== undefined) return block.raw;\n if (block.entries.length === 0 && block.trailingComments.length === 0) {\n return [`${block.setting}: ${MAP_SETTINGS.has(block.setting) ? '{}' : '[]'}`];\n }\n const lines = [`${block.setting}:`];\n for (const entry of block.entries) {\n lines.push(...entry.leadingComments);\n lines.push(MAP_SETTINGS.has(block.setting) ? ` ${quote(entry.key)}: ${quote(entry.value)}` : ` - ${quote(entry.key)}`);\n }\n lines.push(...block.trailingComments);\n return lines;\n}\n\nfunction renderWorkspaceFile(segments: readonly WorkspaceSegment[]): string {\n const lines: string[] = [];\n for (const segment of segments) {\n if (segment.kind === 'verbatim') lines.push(...segment.lines);\n else lines.push(...renderOwnedBlock(segment.block));\n }\n return lines.length === 0 ? '' : `${lines.join('\\n')}\\n`;\n}\n\n/** Code-unit order, the order every Wildo writer of these settings has always used. */\nfunction compareKeys(a: string, b: string): number {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\n/** Whether a block already holds `next`: the same pairs, or the same names, whatever their order. A no-op write writes nothing. */\nfunction sameContents(current: Record<string, string> | string[], next: Record<string, string> | readonly string[]): boolean {\n const pairs = (value: Record<string, string> | readonly string[]): string[] =>\n (Array.isArray(value) ? [...new Set(value as readonly string[])] : Object.entries(value as Record<string, string>).map(([k, v]) => `${k}\\u0000${v}`)).sort();\n return JSON.stringify(pairs(current)) === JSON.stringify(pairs(next));\n}\n\n/** Rebuild a block from new contents, keeping each surviving entry's comments. */\nfunction rebuildBlock(setting: PnpmOwnedSetting, previous: OwnedBlock | undefined, next: Record<string, string> | readonly string[]): OwnedBlock {\n const commentsByKey = new Map((previous?.entries ?? []).map((entry) => [entry.key, entry.leadingComments] as const));\n const pairs: Array<[string, string]> = Array.isArray(next)\n ? [...new Set(next as readonly string[])].map((name) => [name, ''] as [string, string])\n : Object.entries(next as Record<string, string>);\n pairs.sort(([a], [b]) => compareKeys(a, b));\n return {\n setting,\n entries: pairs.map(([key, value]) => ({ key, value, leadingComments: commentsByKey.get(key) ?? [] })),\n trailingComments: previous?.trailingComments ?? [],\n };\n}\n\nfunction blockValue(block: OwnedBlock): Record<string, string> | string[] {\n return MAP_SETTINGS.has(block.setting)\n ? Object.fromEntries(block.entries.map((entry) => [entry.key, entry.value]))\n : block.entries.map((entry) => entry.key);\n}\n\nfunction readManifest(applicationRoot: string): Record<string, unknown> | undefined {\n const path = join(applicationRoot, PnpmSettingsSource.PACKAGE_JSON);\n if (!existsSync(path)) return undefined;\n const parsed: unknown = JSON.parse(readFileSync(path, 'utf8'));\n if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {\n throw new PnpmSettingsFormatError(`${path}: not a JSON object.`);\n }\n return parsed as Record<string, unknown>;\n}\n\nfunction manifestPnpmField(manifest: Record<string, unknown> | undefined, path: string): Record<string, unknown> | undefined {\n const field = manifest?.pnpm;\n if (field === undefined) return undefined;\n if (field === null || typeof field !== 'object' || Array.isArray(field)) {\n throw new PnpmSettingsFormatError(`${path}: the 'pnpm' field is not an object.`);\n }\n return field as Record<string, unknown>;\n}\n\nfunction manifestSetting(field: Record<string, unknown>, setting: PnpmOwnedSetting, path: string): Record<string, string> | string[] {\n const value = field[setting];\n if (MAP_SETTINGS.has(setting)) {\n if (value === null || typeof value !== 'object' || Array.isArray(value)) throw new PnpmSettingsFormatError(`${path}: pnpm.${setting} is not an object.`);\n return Object.fromEntries(Object.entries(value as Record<string, unknown>).map(([key, entry]) => [key, String(entry)]));\n }\n if (!Array.isArray(value)) throw new PnpmSettingsFormatError(`${path}: pnpm.${setting} is not a list.`);\n return value.map(String);\n}\n\n/**\n * The application's effective pnpm settings, as pnpm 10.6.4 reads them: each owned setting from `package.json` → `pnpm`\n * when that key is present there, else from `pnpm-workspace.yaml`. Throws {@link PnpmSettingsFormatError} for a file it\n * cannot read faithfully, never a partial answer.\n */\nexport function readApplicationPnpmSettings(applicationRoot: string): ApplicationPnpmSettings {\n const manifestPath = join(applicationRoot, PnpmSettingsSource.PACKAGE_JSON);\n const workspacePath = join(applicationRoot, PnpmSettingsSource.WORKSPACE_FILE);\n return resolveApplicationPnpmSettingsText({\n manifestText: existsSync(manifestPath) ? readFileSync(manifestPath, 'utf8') : null,\n manifestPath,\n workspaceText: existsSync(workspacePath) ? readFileSync(workspacePath, 'utf8') : null,\n workspacePath,\n });\n}\n\n/**\n * {@link readApplicationPnpmSettings} over the two files' TEXT (`null` for an absent file), for a caller previewing\n * contents it has not written yet (the provider-link reconciliation inside a composition plan).\n */\nexport function resolveApplicationPnpmSettingsText(input: {\n manifestText: string | null;\n manifestPath: string;\n workspaceText: string | null;\n workspacePath: string;\n}): ApplicationPnpmSettings {\n let manifest: Record<string, unknown> | undefined;\n if (input.manifestText !== null) {\n const parsed: unknown = JSON.parse(input.manifestText);\n if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) throw new PnpmSettingsFormatError(`${input.manifestPath}: not a JSON object.`);\n manifest = parsed as Record<string, unknown>;\n }\n const field = manifestPnpmField(manifest, input.manifestPath);\n const workspace = new Map<PnpmOwnedSetting, OwnedBlock>();\n for (const segment of input.workspaceText === null ? [] : parseWorkspaceFile(input.workspaceText, input.workspacePath)) {\n if (segment.kind === 'owned') workspace.set(segment.block.setting, segment.block);\n }\n const settings: ApplicationPnpmSettings = { sources: {}, packageJsonKeys: Object.keys(field ?? {}) };\n const assign = (setting: PnpmOwnedSetting, value: Record<string, string> | string[]): void => {\n if (setting === PnpmOwnedSetting.OVERRIDES) settings.overrides = value as Record<string, string>;\n else if (setting === PnpmOwnedSetting.ONLY_BUILT_DEPENDENCIES) settings.onlyBuiltDependencies = value as string[];\n else if (setting === PnpmOwnedSetting.PATCHED_DEPENDENCIES) settings.patchedDependencies = value as Record<string, string>;\n else settings.neverBuiltDependencies = value as string[];\n };\n for (const setting of PNPM_OWNED_SETTINGS) {\n if (field !== undefined && Object.hasOwn(field, setting)) {\n assign(setting, manifestSetting(field, setting, input.manifestPath));\n settings.sources[setting] = PnpmSettingsSource.PACKAGE_JSON;\n } else if (workspace.has(setting)) {\n assign(setting, blockValue(workspace.get(setting) as OwnedBlock));\n settings.sources[setting] = PnpmSettingsSource.WORKSPACE_FILE;\n }\n }\n return settings;\n}\n\n/**\n * `package.json` text with the given owned settings removed from its `pnpm` field (the field dropped when it empties),\n * formatted as every Wildo writer formats a manifest. Returns `text` itself when none of them is there.\n */\nexport function removePackageJsonPnpmSettingsText(text: string, path: string, settings: readonly PnpmOwnedSetting[]): string {\n const parsed: unknown = JSON.parse(text);\n if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) throw new PnpmSettingsFormatError(`${path}: not a JSON object.`);\n const manifest = parsed as Record<string, unknown>;\n const field = manifestPnpmField(manifest, path);\n if (field === undefined || !settings.some((setting) => Object.hasOwn(field, setting))) return text;\n for (const setting of settings) delete field[setting];\n if (Object.keys(field).length === 0) delete manifest.pnpm;\n return `${JSON.stringify(manifest, null, 2)}\\n`;\n}\n\n/**\n * Place a block the file did not have. Directly ABOVE the `packages:` block (and the column-0 comments written over it)\n * when there is one, because every scenario and provider install adds a workspace member by appending a line at the\n * END of the file: an owned block after `packages:` would receive those member lines as entries. At the end otherwise.\n */\nfunction insertNewBlock(segments: WorkspaceSegment[], block: OwnedBlock): void {\n for (let index = 0; index < segments.length; index += 1) {\n const segment = segments[index];\n if (segment?.kind !== 'verbatim') continue;\n const packagesLine = segment.lines.findIndex((line) => /^packages\\s*:/.test(line));\n if (packagesLine === -1) continue;\n let at = packagesLine;\n while (at > 0 && /^#/.test(segment.lines[at - 1] ?? '')) at -= 1;\n const before = segment.lines.slice(0, at);\n const after = segment.lines.slice(at);\n const inserted: WorkspaceSegment[] = [];\n if (before.length > 0) inserted.push({ kind: 'verbatim', lines: (before[before.length - 1] ?? '') === '' ? before : [...before, ''] });\n else if (segments[index - 1]?.kind === 'owned') inserted.push({ kind: 'verbatim', lines: [''] });\n inserted.push({ kind: 'owned', block }, { kind: 'verbatim', lines: ['', ...after] });\n segments.splice(index, 1, ...inserted);\n return;\n }\n const last = segments[segments.length - 1];\n if (last?.kind === 'verbatim' && (last.lines[last.lines.length - 1] ?? '') !== '') last.lines.push('');\n else if (last?.kind === 'owned') segments.push({ kind: 'verbatim', lines: [''] });\n segments.push({ kind: 'owned', block });\n}\n\n/**\n * The owned settings a workspace file's TEXT declares, for a caller that holds the bytes rather than the file (the\n * composition planner, which edits files in memory before writing any). Same grammar, same refusals, as the file\n * readers above.\n */\nexport function readPnpmWorkspaceSettingsText(text: string, file: string): Partial<Record<PnpmOwnedSetting, Record<string, string> | string[]>> {\n const declared: Partial<Record<PnpmOwnedSetting, Record<string, string> | string[]>> = {};\n for (const segment of parseWorkspaceFile(text, file)) {\n if (segment.kind === 'owned') declared[segment.block.setting] = blockValue(segment.block);\n }\n return declared;\n}\n\n/**\n * A workspace file's text with the given settings replaced (`null` removes one). Untouched blocks, comments and every\n * block this module does not own keep their bytes; a setting whose contents do not change keeps its bytes too, so a\n * no-op update returns `text` itself.\n */\nexport function updatePnpmWorkspaceSettingsText(text: string, file: string, update: ApplicationPnpmSettingsUpdate): string {\n const segments = parseWorkspaceFile(text, file);\n for (const setting of PNPM_OWNED_SETTINGS) {\n if (!Object.hasOwn(update, setting)) continue;\n const next = update[setting as keyof ApplicationPnpmSettingsUpdate];\n const index = segments.findIndex((segment) => segment.kind === 'owned' && segment.block.setting === setting);\n const previous = index === -1 ? undefined : (segments[index] as { kind: 'owned'; block: OwnedBlock }).block;\n if (next === null || next === undefined) {\n if (index !== -1) {\n segments.splice(index, 1);\n // The blank line that separated the block goes with it, so removing a block a write inserted gives the file back.\n const before = segments[index - 1];\n const after = segments[index];\n if (after?.kind === 'verbatim' && after.lines[0] === '' && (before === undefined || (before.kind === 'verbatim' && before.lines[before.lines.length - 1] === ''))) {\n after.lines.shift();\n }\n }\n } else if (previous === undefined || !sameContents(blockValue(previous), next as Record<string, string> | readonly string[])) {\n const block = rebuildBlock(setting, previous, next as Record<string, string> | readonly string[]);\n if (index !== -1) segments[index] = { kind: 'owned', block };\n else insertNewBlock(segments, block);\n }\n }\n const rendered = renderWorkspaceFile(segments);\n return rendered === renderWorkspaceFile(parseWorkspaceFile(text, file)) ? text : rendered;\n}\n\n/**\n * Write the given settings into the application's `pnpm-workspace.yaml` and remove the same keys from `package.json` →\n * `pnpm` (see the module comment for why both). A setting the update does not name is left exactly where it is. Writes\n * a file only when its bytes change; formats the manifest as every Wildo writer does (two-space JSON, final newline).\n */\nexport function writeApplicationPnpmSettings(applicationRoot: string, update: ApplicationPnpmSettingsUpdate): ApplicationPnpmSettingsWriteResult {\n const workspacePath = join(applicationRoot, PnpmSettingsSource.WORKSPACE_FILE);\n const manifestPath = join(applicationRoot, PnpmSettingsSource.PACKAGE_JSON);\n const originalWorkspace = existsSync(workspacePath) ? readFileSync(workspacePath, 'utf8') : '';\n const manifest = readManifest(applicationRoot);\n const field = manifestPnpmField(manifest, manifestPath);\n const movedFromPackageJson: PnpmOwnedSetting[] = [];\n for (const setting of PNPM_OWNED_SETTINGS) {\n if (Object.hasOwn(update, setting) && field !== undefined && Object.hasOwn(field, setting)) {\n delete field[setting];\n movedFromPackageJson.push(setting);\n }\n }\n let changed = false;\n const after = updatePnpmWorkspaceSettingsText(originalWorkspace, workspacePath, update);\n if (after !== originalWorkspace) {\n writeFileSync(workspacePath, after, 'utf8');\n changed = true;\n }\n if (manifest !== undefined && movedFromPackageJson.length > 0) {\n if (field !== undefined && Object.keys(field).length === 0) delete manifest.pnpm;\n writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 2)}\\n`, 'utf8');\n changed = true;\n }\n return { changed, movedFromPackageJson };\n}\n\n/**\n * Move every owned setting `package.json` → `pnpm` still carries into `pnpm-workspace.yaml`, unchanged in value: the\n * effective settings are the same before and after, under pnpm 10, and pnpm 11 starts reading them. Returns the keys\n * of `package.json` → `pnpm` it could not move (settings Wildo does not own), which the caller reports.\n */\nexport function migrateApplicationPnpmSettings(applicationRoot: string): { result: ApplicationPnpmSettingsWriteResult; unownedPackageJsonKeys: string[] } {\n const settings = readApplicationPnpmSettings(applicationRoot);\n const update: ApplicationPnpmSettingsUpdate = {};\n if (settings.sources.overrides === PnpmSettingsSource.PACKAGE_JSON) update.overrides = settings.overrides ?? {};\n if (settings.sources.onlyBuiltDependencies === PnpmSettingsSource.PACKAGE_JSON) update.onlyBuiltDependencies = settings.onlyBuiltDependencies ?? [];\n if (settings.sources.neverBuiltDependencies === PnpmSettingsSource.PACKAGE_JSON) update.neverBuiltDependencies = settings.neverBuiltDependencies ?? [];\n if (settings.sources.patchedDependencies === PnpmSettingsSource.PACKAGE_JSON) update.patchedDependencies = settings.patchedDependencies ?? {};\n const result = writeApplicationPnpmSettings(applicationRoot, update);\n return { result, unownedPackageJsonKeys: settings.packageJsonKeys.filter((key) => !OWNED_KEYS.has(key)) };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"define-infra-env-config.d.ts","sourceRoot":"","sources":["../../../src/project-config/define-infra-env-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC9H,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAsB,oBAAoB,EAAkC,MAAM,mCAAmC,CAAC;AAS7H,OAAO,EACL,cAAc,EAGd,sBAAsB,EAItB,iBAAiB,EACjB,qBAAqB,EAGrB,yBAAyB,EAWzB,qBAAqB,EAEtB,MAAM,8BAA8B,CAAC;AA6DtC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,2BAA2B;;;;kBAItC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEjF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,oCAAoC;;kBAI/C,CAAC;AAEH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAEnG;;;;;;;GAOG;AACH,QAAA,MAAM,4BAA4B;;;;;IAShC;;;;;;;;;;;OAWG;;IAEH;;;;;;;;;;;;;;;;;OAiBG;;IAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;;;;;;IAcH,6IAA6I;IAC7I;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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