From 0888fc1d06efa5d0525c7b2227c37ba9ff8d00b1 Mon Sep 17 00:00:00 2001 From: Prompt Stack Date: Tue, 1 Sep 2026 20:28:32 -0400 Subject: [PATCH] release: prepare npm CLI 1.10.26 --- .debt-scan.json | 1 + .github/workflows/publish-npm.yml | 118 ++ dist/index.cjs | 1374 +++++++++++------ .../2026-09-01-cli-npm-release-1.10.26.md | 231 +++ package.json | 9 +- packages/core/package.json | 2 +- packages/db/package.json | 2 +- packages/manifest/package.json | 4 +- pnpm-lock.yaml | 61 +- scripts/validate-publish-runtime.mjs | 29 + .../unit/quality-workflow-contract.test.js | 53 + 11 files changed, 1378 insertions(+), 506 deletions(-) create mode 100644 .github/workflows/publish-npm.yml create mode 100644 docs/swe-compliance/2026-09-01-cli-npm-release-1.10.26.md create mode 100644 scripts/validate-publish-runtime.mjs diff --git a/.debt-scan.json b/.debt-scan.json index 7023276..9ae6791 100644 --- a/.debt-scan.json +++ b/.debt-scan.json @@ -112,6 +112,7 @@ "scripts/agent-debt-runner.mjs", "scripts/generate-manifest.js", "scripts/generate-daemon-openapi.js", + "scripts/validate-publish-runtime.mjs", "scripts/run-tests.js" ], "checks": [ diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml new file mode 100644 index 0000000..bdd2dfd --- /dev/null +++ b/.github/workflows/publish-npm.yml @@ -0,0 +1,118 @@ +name: Publish npm + +on: + workflow_dispatch: + inputs: + version: + description: Exact package version to publish from main + required: true + type: string + +permissions: + contents: read + id-token: write + +concurrency: + group: publish-npm + cancel-in-progress: false + +jobs: + publish: + name: publish + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - name: Check out accepted source + uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0 + with: + fetch-depth: 0 + + - name: Set up Node.js + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 + with: + node-version: '24' + registry-url: 'https://registry.npmjs.org' + package-manager-cache: false + + - name: Enable Corepack + run: corepack enable + + - name: Verify trusted-publishing runtime + run: | + NPM_VERSION="$(npm --version)" + node scripts/validate-publish-runtime.mjs "$NPM_VERSION" + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Verify requested version is releasable + env: + EXPECTED_VERSION: ${{ inputs.version }} + run: | + ACTUAL_VERSION="$(node -p "require('./package.json').version")" + if [ "$ACTUAL_VERSION" != "$EXPECTED_VERSION" ]; then + echo "Requested version $EXPECTED_VERSION does not match package version $ACTUAL_VERSION" >&2 + exit 1 + fi + npm view @learnrudi/cli versions --json > "$RUNNER_TEMP/npm-versions.json" + node --input-type=module -e ' + import fs from "node:fs"; + const expected = process.env.EXPECTED_VERSION; + const versions = JSON.parse(fs.readFileSync(process.env.RUNNER_TEMP + "/npm-versions.json", "utf8")); + if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(expected)) { + throw new Error(`Invalid release version: ${expected}`); + } + if (versions.includes(expected)) { + throw new Error(`@learnrudi/cli@${expected} already exists`); + } + ' + + - name: Test + run: pnpm test + + - name: Build + run: pnpm build + + - name: Verify generated distribution + run: git diff --exit-code -- dist src/packages-manifest.json + + - name: Scan changed JavaScript and TypeScript debt + run: node scripts/agent-debt-runner.mjs --changed-since HEAD^ --no-log + + - name: Audit production dependencies + run: pnpm audit --prod --audit-level=moderate + + - name: Pack verified artifact + id: pack + env: + EXPECTED_VERSION: ${{ inputs.version }} + run: | + npm pack --json --pack-destination "$RUNNER_TEMP" > "$RUNNER_TEMP/npm-pack.json" + PACKAGE_TARBALL="$(node --input-type=module -e ' + import fs from "node:fs"; + const expectedFiles = [ + "LICENSE", + "README.md", + "dist/index.cjs", + "dist/packages-manifest.json", + "dist/router-mcp.js", + "package.json", + ]; + const [packed] = JSON.parse(fs.readFileSync(process.env.RUNNER_TEMP + "/npm-pack.json", "utf8")); + const actualFiles = packed.files.map(({ path }) => path).sort(); + if (packed.version !== process.env.EXPECTED_VERSION) { + throw new Error(`Packed version ${packed.version} does not match ${process.env.EXPECTED_VERSION}`); + } + if (JSON.stringify(actualFiles) !== JSON.stringify(expectedFiles)) { + throw new Error(`Unexpected package files: ${actualFiles.join(", ")}`); + } + process.stdout.write(packed.filename); + ')" + echo "filename=$PACKAGE_TARBALL" >> "$GITHUB_OUTPUT" + + - name: Publish through npm trusted publishing + env: + PACKAGE_TARBALL: ${{ steps.pack.outputs.filename }} + run: npm publish "$RUNNER_TEMP/$PACKAGE_TARBALL" --access public --ignore-scripts diff --git a/dist/index.cjs b/dist/index.cjs index d9b22c7..ed1ef8a 100755 --- a/dist/index.cjs +++ b/dist/index.cjs @@ -2272,9 +2272,9 @@ var init_src3 = __esm({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/identity.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/identity.js var require_identity = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/identity.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/identity.js"(exports2) { "use strict"; var ALIAS = /* @__PURE__ */ Symbol.for("yaml.alias"); var DOC = /* @__PURE__ */ Symbol.for("yaml.document"); @@ -2329,9 +2329,9 @@ var require_identity = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/visit.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/visit.js var require_visit = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/visit.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/visit.js"(exports2) { "use strict"; var identity = require_identity(); var BREAK = /* @__PURE__ */ Symbol("break visit"); @@ -2487,9 +2487,9 @@ var require_visit = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/directives.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/directives.js var require_directives = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/directives.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/directives.js"(exports2) { "use strict"; var identity = require_identity(); var visit = require_visit(); @@ -2658,9 +2658,9 @@ var require_directives = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/anchors.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/anchors.js var require_anchors = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/anchors.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/anchors.js"(exports2) { "use strict"; var identity = require_identity(); var visit = require_visit(); @@ -2728,9 +2728,9 @@ var require_anchors = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/applyReviver.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/applyReviver.js var require_applyReviver = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/applyReviver.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/applyReviver.js"(exports2) { "use strict"; function applyReviver(reviver, obj, key, val) { if (val && typeof val === "object") { @@ -2778,9 +2778,9 @@ var require_applyReviver = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/toJS.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/toJS.js var require_toJS = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/toJS.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/toJS.js"(exports2) { "use strict"; var identity = require_identity(); function toJS(value, arg, ctx) { @@ -2808,9 +2808,9 @@ var require_toJS = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Node.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Node.js var require_Node = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Node.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Node.js"(exports2) { "use strict"; var applyReviver = require_applyReviver(); var identity = require_identity(); @@ -2849,9 +2849,9 @@ var require_Node = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Alias.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Alias.js var require_Alias = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Alias.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Alias.js"(exports2) { "use strict"; var anchors = require_anchors(); var visit = require_visit(); @@ -2873,6 +2873,8 @@ var require_Alias = __commonJS({ * instance of the `source` anchor before this node. */ resolve(doc, ctx) { + if (ctx?.maxAliasCount === 0) + throw new ReferenceError("Alias resolution is disabled"); let nodes; if (ctx?.aliasResolveCache) { nodes = ctx.aliasResolveCache; @@ -2963,9 +2965,9 @@ var require_Alias = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Scalar.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Scalar.js var require_Scalar = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Scalar.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Scalar.js"(exports2) { "use strict"; var identity = require_identity(); var Node = require_Node(); @@ -2993,9 +2995,9 @@ var require_Scalar = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/createNode.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/createNode.js var require_createNode = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/createNode.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/createNode.js"(exports2) { "use strict"; var Alias = require_Alias(); var identity = require_identity(); @@ -3068,9 +3070,9 @@ var require_createNode = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Collection.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Collection.js var require_Collection = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Collection.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Collection.js"(exports2) { "use strict"; var createNode = require_createNode(); var identity = require_identity(); @@ -3211,9 +3213,9 @@ var require_Collection = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyComment.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyComment.js var require_stringifyComment = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyComment.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyComment.js"(exports2) { "use strict"; var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#"); function indentComment(comment, indent) { @@ -3228,9 +3230,9 @@ var require_stringifyComment = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/foldFlowLines.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/foldFlowLines.js var require_foldFlowLines = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/foldFlowLines.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/foldFlowLines.js"(exports2) { "use strict"; var FOLD_FLOW = "flow"; var FOLD_BLOCK = "block"; @@ -3364,9 +3366,9 @@ ${indent}${text.slice(fold + 1, end2)}`; } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyString.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyString.js var require_stringifyString = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyString.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyString.js"(exports2) { "use strict"; var Scalar = require_Scalar(); var foldFlowLines = require_foldFlowLines(); @@ -3647,9 +3649,9 @@ ${indent}`); } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringify.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringify.js var require_stringify = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringify.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringify.js"(exports2) { "use strict"; var anchors = require_anchors(); var identity = require_identity(); @@ -3672,6 +3674,7 @@ var require_stringify = __commonJS({ nullStr: "null", simpleKeys: false, singleQuote: null, + trailingComma: false, trueStr: "true", verifyAliasOrder: true }, doc.schema.toStringOptions, options); @@ -3770,9 +3773,9 @@ ${ctx.indent}${str}`; } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyPair.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyPair.js var require_stringifyPair = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyPair.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyPair.js"(exports2) { "use strict"; var identity = require_identity(); var Scalar = require_Scalar(); @@ -3903,9 +3906,9 @@ ${ctx.indent}`; } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/log.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/log.js var require_log = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/log.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/log.js"(exports2) { "use strict"; var node_process = require("process"); function debug(logLevel, ...messages) { @@ -3925,9 +3928,9 @@ var require_log = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/merge.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/merge.js var require_merge = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/merge.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/merge.js"(exports2) { "use strict"; var identity = require_identity(); var Scalar = require_Scalar(); @@ -3944,18 +3947,18 @@ var require_merge = __commonJS({ }; var isMergeKey = (ctx, key) => (merge.identify(key) || identity.isScalar(key) && (!key.type || key.type === Scalar.Scalar.PLAIN) && merge.identify(key.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge.tag && tag.default); function addMergeToJSMap(ctx, map, value) { - value = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value; - if (identity.isSeq(value)) - for (const it of value.items) + const source = resolveAliasValue(ctx, value); + if (identity.isSeq(source)) + for (const it of source.items) mergeValue(ctx, map, it); - else if (Array.isArray(value)) - for (const it of value) + else if (Array.isArray(source)) + for (const it of source) mergeValue(ctx, map, it); else - mergeValue(ctx, map, value); + mergeValue(ctx, map, source); } function mergeValue(ctx, map, value) { - const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value; + const source = resolveAliasValue(ctx, value); if (!identity.isMap(source)) throw new Error("Merge sources must be maps or map aliases"); const srcMap = source.toJSON(null, ctx, Map); @@ -3976,15 +3979,18 @@ var require_merge = __commonJS({ } return map; } + function resolveAliasValue(ctx, value) { + return ctx && identity.isAlias(value) ? value.resolve(ctx.doc, ctx) : value; + } exports2.addMergeToJSMap = addMergeToJSMap; exports2.isMergeKey = isMergeKey; exports2.merge = merge; } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/addPairToJSMap.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/addPairToJSMap.js var require_addPairToJSMap = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/addPairToJSMap.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/addPairToJSMap.js"(exports2) { "use strict"; var log = require_log(); var merge = require_merge(); @@ -4046,9 +4052,9 @@ var require_addPairToJSMap = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Pair.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Pair.js var require_Pair = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Pair.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Pair.js"(exports2) { "use strict"; var createNode = require_createNode(); var stringifyPair = require_stringifyPair(); @@ -4086,9 +4092,9 @@ var require_Pair = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyCollection.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyCollection.js var require_stringifyCollection = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyCollection.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyCollection.js"(exports2) { "use strict"; var identity = require_identity(); var stringify = require_stringify(); @@ -4189,12 +4195,19 @@ ${indent}${line}` : "\n"; if (comment) reqNewline = true; let str = stringify.stringify(item, itemCtx, () => comment = null); - if (i < items.length - 1) + reqNewline || (reqNewline = lines.length > linesAtValue || str.includes("\n")); + if (i < items.length - 1) { str += ","; + } else if (ctx.options.trailingComma) { + if (ctx.options.lineWidth > 0) { + reqNewline || (reqNewline = lines.reduce((sum, line) => sum + line.length + 2, 2) + (str.length + 2) > ctx.options.lineWidth); + } + if (reqNewline) { + str += ","; + } + } if (comment) str += stringifyComment.lineComment(str, itemIndent, commentString(comment)); - if (!reqNewline && (lines.length > linesAtValue || str.includes("\n"))) - reqNewline = true; lines.push(str); linesAtValue = lines.length; } @@ -4230,9 +4243,9 @@ ${indent}${end}`; } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLMap.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/YAMLMap.js var require_YAMLMap = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLMap.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/YAMLMap.js"(exports2) { "use strict"; var stringifyCollection = require_stringifyCollection(); var addPairToJSMap = require_addPairToJSMap(); @@ -4374,9 +4387,9 @@ var require_YAMLMap = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/map.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/common/map.js var require_map = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/map.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/common/map.js"(exports2) { "use strict"; var identity = require_identity(); var YAMLMap = require_YAMLMap(); @@ -4396,9 +4409,9 @@ var require_map = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLSeq.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/YAMLSeq.js var require_YAMLSeq = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLSeq.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/YAMLSeq.js"(exports2) { "use strict"; var createNode = require_createNode(); var stringifyCollection = require_stringifyCollection(); @@ -4512,9 +4525,9 @@ var require_YAMLSeq = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/seq.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/common/seq.js var require_seq = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/seq.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/common/seq.js"(exports2) { "use strict"; var identity = require_identity(); var YAMLSeq = require_YAMLSeq(); @@ -4534,9 +4547,9 @@ var require_seq = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/string.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/common/string.js var require_string = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/string.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/common/string.js"(exports2) { "use strict"; var stringifyString = require_stringifyString(); var string = { @@ -4553,9 +4566,9 @@ var require_string = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/null.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/common/null.js var require_null = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/null.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/common/null.js"(exports2) { "use strict"; var Scalar = require_Scalar(); var nullTag = { @@ -4571,9 +4584,9 @@ var require_null = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/bool.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/core/bool.js var require_bool = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/bool.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/core/bool.js"(exports2) { "use strict"; var Scalar = require_Scalar(); var boolTag = { @@ -4595,9 +4608,9 @@ var require_bool = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyNumber.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyNumber.js var require_stringifyNumber = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyNumber.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyNumber.js"(exports2) { "use strict"; function stringifyNumber({ format, minFractionDigits, tag, value }) { if (typeof value === "bigint") @@ -4606,7 +4619,7 @@ var require_stringifyNumber = __commonJS({ if (!isFinite(num)) return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf"; let n = Object.is(value, -0) ? "-0" : JSON.stringify(value); - if (!format && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^\d/.test(n)) { + if (!format && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^-?\d/.test(n) && !n.includes("e")) { let i = n.indexOf("."); if (i < 0) { i = n.length; @@ -4622,9 +4635,9 @@ var require_stringifyNumber = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/float.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/core/float.js var require_float = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/float.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/core/float.js"(exports2) { "use strict"; var Scalar = require_Scalar(); var stringifyNumber = require_stringifyNumber(); @@ -4668,9 +4681,9 @@ var require_float = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/int.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/core/int.js var require_int = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/int.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/core/int.js"(exports2) { "use strict"; var stringifyNumber = require_stringifyNumber(); var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value); @@ -4713,9 +4726,9 @@ var require_int = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/schema.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/core/schema.js var require_schema = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/schema.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/core/schema.js"(exports2) { "use strict"; var map = require_map(); var _null = require_null(); @@ -4741,9 +4754,9 @@ var require_schema = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/json/schema.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/json/schema.js var require_schema2 = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/json/schema.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/json/schema.js"(exports2) { "use strict"; var Scalar = require_Scalar(); var map = require_map(); @@ -4808,9 +4821,9 @@ var require_schema2 = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/binary.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/binary.js var require_binary = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/binary.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/binary.js"(exports2) { "use strict"; var node_buffer = require("buffer"); var Scalar = require_Scalar(); @@ -4874,9 +4887,9 @@ var require_binary = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/pairs.js var require_pairs = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/pairs.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/pairs.js"(exports2) { "use strict"; var identity = require_identity(); var Pair = require_Pair(); @@ -4952,9 +4965,9 @@ ${cn.comment}` : item.comment; } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/omap.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/omap.js var require_omap = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/omap.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/omap.js"(exports2) { "use strict"; var identity = require_identity(); var toJS = require_toJS(); @@ -5030,9 +5043,9 @@ var require_omap = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/bool.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/bool.js var require_bool2 = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/bool.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/bool.js"(exports2) { "use strict"; var Scalar = require_Scalar(); function boolStringify({ value, source }, ctx) { @@ -5062,9 +5075,9 @@ var require_bool2 = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/float.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/float.js var require_float2 = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/float.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/float.js"(exports2) { "use strict"; var Scalar = require_Scalar(); var stringifyNumber = require_stringifyNumber(); @@ -5111,9 +5124,9 @@ var require_float2 = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/int.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/int.js var require_int2 = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/int.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/int.js"(exports2) { "use strict"; var stringifyNumber = require_stringifyNumber(); var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value); @@ -5190,9 +5203,9 @@ var require_int2 = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/set.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/set.js var require_set = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/set.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/set.js"(exports2) { "use strict"; var identity = require_identity(); var Pair = require_Pair(); @@ -5279,9 +5292,9 @@ var require_set = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js var require_timestamp = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js"(exports2) { "use strict"; var stringifyNumber = require_stringifyNumber(); function parseSexagesimal(str, asBigInt) { @@ -5367,9 +5380,9 @@ var require_timestamp = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/schema.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/schema.js var require_schema3 = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/schema.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/schema.js"(exports2) { "use strict"; var map = require_map(); var _null = require_null(); @@ -5411,9 +5424,9 @@ var require_schema3 = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/tags.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/tags.js var require_tags = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/tags.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/tags.js"(exports2) { "use strict"; var map = require_map(); var _null = require_null(); @@ -5505,9 +5518,9 @@ var require_tags = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/Schema.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/Schema.js var require_Schema = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/Schema.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/Schema.js"(exports2) { "use strict"; var identity = require_identity(); var map = require_map(); @@ -5537,9 +5550,9 @@ var require_Schema = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyDocument.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyDocument.js var require_stringifyDocument = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyDocument.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyDocument.js"(exports2) { "use strict"; var identity = require_identity(); var stringify = require_stringify(); @@ -5617,9 +5630,9 @@ var require_stringifyDocument = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/Document.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/Document.js var require_Document = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/Document.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/Document.js"(exports2) { "use strict"; var Alias = require_Alias(); var Collection = require_Collection(); @@ -5926,9 +5939,9 @@ var require_Document = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/errors.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/errors.js var require_errors = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/errors.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/errors.js"(exports2) { "use strict"; var YAMLError = class extends Error { constructor(name, pos, code, message) { @@ -5991,9 +6004,9 @@ ${pointer} } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-props.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-props.js var require_resolve_props = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-props.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-props.js"(exports2) { "use strict"; function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) { let spaceBefore = false; @@ -6125,9 +6138,9 @@ var require_resolve_props = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-contains-newline.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/util-contains-newline.js var require_util_contains_newline = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-contains-newline.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/util-contains-newline.js"(exports2) { "use strict"; function containsNewline(key) { if (!key) @@ -6167,9 +6180,9 @@ var require_util_contains_newline = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-flow-indent-check.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/util-flow-indent-check.js var require_util_flow_indent_check = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-flow-indent-check.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/util-flow-indent-check.js"(exports2) { "use strict"; var utilContainsNewline = require_util_contains_newline(); function flowIndentCheck(indent, fc, onError) { @@ -6185,9 +6198,9 @@ var require_util_flow_indent_check = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-map-includes.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/util-map-includes.js var require_util_map_includes = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-map-includes.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/util-map-includes.js"(exports2) { "use strict"; var identity = require_identity(); function mapIncludes(ctx, items, search) { @@ -6201,9 +6214,9 @@ var require_util_map_includes = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-map.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-map.js var require_resolve_block_map = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-map.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-map.js"(exports2) { "use strict"; var Pair = require_Pair(); var YAMLMap = require_YAMLMap(); @@ -6309,9 +6322,9 @@ var require_resolve_block_map = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-seq.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-seq.js var require_resolve_block_seq = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-seq.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-seq.js"(exports2) { "use strict"; var YAMLSeq = require_YAMLSeq(); var resolveProps = require_resolve_props(); @@ -6360,9 +6373,9 @@ var require_resolve_block_seq = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-end.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-end.js var require_resolve_end = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-end.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-end.js"(exports2) { "use strict"; function resolveEnd(end, offset, reqSpace, onError) { let comment = ""; @@ -6403,9 +6416,9 @@ var require_resolve_end = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-collection.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-flow-collection.js var require_resolve_flow_collection = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-collection.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-flow-collection.js"(exports2) { "use strict"; var identity = require_identity(); var Pair = require_Pair(); @@ -6597,9 +6610,9 @@ var require_resolve_flow_collection = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-collection.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/compose-collection.js var require_compose_collection = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-collection.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/compose-collection.js"(exports2) { "use strict"; var identity = require_identity(); var Scalar = require_Scalar(); @@ -6662,9 +6675,9 @@ var require_compose_collection = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-scalar.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-scalar.js var require_resolve_block_scalar = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-scalar.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-scalar.js"(exports2) { "use strict"; var Scalar = require_Scalar(); function resolveBlockScalar(ctx, scalar, onError) { @@ -6845,9 +6858,9 @@ var require_resolve_block_scalar = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-scalar.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-flow-scalar.js var require_resolve_flow_scalar = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-scalar.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-flow-scalar.js"(exports2) { "use strict"; var Scalar = require_Scalar(); var resolveEnd = require_resolve_end(); @@ -6978,7 +6991,7 @@ var require_resolve_flow_scalar = __commonJS({ while (next === " " || next === " ") next = source[++i + 1]; } else if (next === "x" || next === "u" || next === "U") { - const length = { x: 2, u: 4, U: 8 }[next]; + const length = next === "x" ? 2 : next === "u" ? 4 : 8; res += parseCharCode(source, i + 1, length, onError); i += length; } else { @@ -7053,20 +7066,21 @@ var require_resolve_flow_scalar = __commonJS({ const cc = source.substr(offset, length); const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc); const code = ok ? parseInt(cc, 16) : NaN; - if (isNaN(code)) { + try { + return String.fromCodePoint(code); + } catch { const raw = source.substr(offset - 2, length + 2); onError(offset - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw}`); return raw; } - return String.fromCodePoint(code); } exports2.resolveFlowScalar = resolveFlowScalar; } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-scalar.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/compose-scalar.js var require_compose_scalar = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-scalar.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/compose-scalar.js"(exports2) { "use strict"; var identity = require_identity(); var Scalar = require_Scalar(); @@ -7145,9 +7159,9 @@ var require_compose_scalar = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-empty-scalar-position.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/util-empty-scalar-position.js var require_util_empty_scalar_position = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-empty-scalar-position.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/util-empty-scalar-position.js"(exports2) { "use strict"; function emptyScalarPosition(offset, before, pos) { if (before) { @@ -7175,9 +7189,9 @@ var require_util_empty_scalar_position = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-node.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/compose-node.js var require_compose_node = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-node.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/compose-node.js"(exports2) { "use strict"; var Alias = require_Alias(); var identity = require_identity(); @@ -7208,17 +7222,22 @@ var require_compose_node = __commonJS({ case "block-map": case "block-seq": case "flow-collection": - node = composeCollection.composeCollection(CN, ctx, token, props, onError); - if (anchor) - node.anchor = anchor.source.substring(1); + try { + node = composeCollection.composeCollection(CN, ctx, token, props, onError); + if (anchor) + node.anchor = anchor.source.substring(1); + } catch (error) { + const message = error instanceof Error ? error.message : String(error); + onError(token, "RESOURCE_EXHAUSTION", message); + } break; default: { const message = token.type === "error" ? token.message : `Unsupported token (type: ${token.type})`; onError(token, "UNEXPECTED_TOKEN", message); - node = composeEmptyNode(ctx, token.offset, void 0, null, props, onError); isSrcToken = false; } } + node ?? (node = composeEmptyNode(ctx, token.offset, void 0, null, props, onError)); if (anchor && node.anchor === "") onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string"); if (atKey && ctx.options.stringKeys && (!identity.isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) { @@ -7276,9 +7295,9 @@ var require_compose_node = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-doc.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/compose-doc.js var require_compose_doc = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-doc.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/compose-doc.js"(exports2) { "use strict"; var Document = require_Document(); var composeNode = require_compose_node(); @@ -7319,9 +7338,9 @@ var require_compose_doc = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/composer.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/composer.js var require_composer = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/composer.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/composer.js"(exports2) { "use strict"; var node_process = require("process"); var directives = require_directives(); @@ -7403,8 +7422,10 @@ ${cb}` : comment; } } if (afterDoc) { - Array.prototype.push.apply(doc.errors, this.errors); - Array.prototype.push.apply(doc.warnings, this.warnings); + for (let i = 0; i < this.errors.length; ++i) + doc.errors.push(this.errors[i]); + for (let i = 0; i < this.warnings.length; ++i) + doc.warnings.push(this.warnings[i]); } else { doc.errors = this.errors; doc.warnings = this.warnings; @@ -7525,9 +7546,9 @@ ${end.comment}` : end.comment; } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-scalar.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst-scalar.js var require_cst_scalar = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-scalar.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst-scalar.js"(exports2) { "use strict"; var resolveBlockScalar = require_resolve_block_scalar(); var resolveFlowScalar = require_resolve_flow_scalar(); @@ -7710,9 +7731,9 @@ var require_cst_scalar = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-stringify.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst-stringify.js var require_cst_stringify = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-stringify.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst-stringify.js"(exports2) { "use strict"; var stringify = (cst) => "type" in cst ? stringifyToken(cst) : stringifyItem(cst); function stringifyToken(token) { @@ -7771,9 +7792,9 @@ var require_cst_stringify = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-visit.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst-visit.js var require_cst_visit = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-visit.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst-visit.js"(exports2) { "use strict"; var BREAK = /* @__PURE__ */ Symbol("break visit"); var SKIP = /* @__PURE__ */ Symbol("skip children"); @@ -7833,9 +7854,9 @@ var require_cst_visit = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst.js var require_cst = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst.js"(exports2) { "use strict"; var cstScalar = require_cst_scalar(); var cstStringify = require_cst_stringify(); @@ -7935,9 +7956,9 @@ var require_cst = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/lexer.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/lexer.js var require_lexer = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/lexer.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/lexer.js"(exports2) { "use strict"; var cst = require_cst(); function isEmpty(ch) { @@ -8137,7 +8158,7 @@ var require_lexer = __commonJS({ const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)); this.indentNext = this.indentValue + 1; this.indentValue += n; - return yield* this.parseBlockStart(); + return "block-start"; } return "doc"; } @@ -8436,28 +8457,38 @@ var require_lexer = __commonJS({ return 0; } *pushIndicators() { - switch (this.charAt(0)) { - case "!": - return (yield* this.pushTag()) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators()); - case "&": - return (yield* this.pushUntil(isNotAnchorChar)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators()); - case "-": - // this is an error - case "?": - // this is an error outside flow collections - case ":": { - const inFlow = this.flowLevel > 0; - const ch1 = this.charAt(1); - if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) { - if (!inFlow) - this.indentNext = this.indentValue + 1; - else if (this.flowKey) - this.flowKey = false; - return (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators()); + let n = 0; + loop: while (true) { + switch (this.charAt(0)) { + case "!": + n += yield* this.pushTag(); + n += yield* this.pushSpaces(true); + continue loop; + case "&": + n += yield* this.pushUntil(isNotAnchorChar); + n += yield* this.pushSpaces(true); + continue loop; + case "-": + // this is an error + case "?": + // this is an error outside flow collections + case ":": { + const inFlow = this.flowLevel > 0; + const ch1 = this.charAt(1); + if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) { + if (!inFlow) + this.indentNext = this.indentValue + 1; + else if (this.flowKey) + this.flowKey = false; + n += yield* this.pushCount(1); + n += yield* this.pushSpaces(true); + continue loop; + } } } + break loop; } - return 0; + return n; } *pushTag() { if (this.charAt(1) === "<") { @@ -8514,9 +8545,9 @@ var require_lexer = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/line-counter.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/line-counter.js var require_line_counter = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/line-counter.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/line-counter.js"(exports2) { "use strict"; var LineCounter = class { constructor() { @@ -8545,9 +8576,9 @@ var require_line_counter = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/parser.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/parser.js var require_parser = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/parser.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/parser.js"(exports2) { "use strict"; var node_process = require("process"); var cst = require_cst(); @@ -8616,6 +8647,13 @@ var require_parser = __commonJS({ } return prev.splice(i, prev.length); } + function arrayPushArray(target, source) { + if (source.length < 1e5) + Array.prototype.push.apply(target, source); + else + for (let i = 0; i < source.length; ++i) + target.push(source[i]); + } function fixFlowSeqItems(fc) { if (fc.start.type === "flow-seq-start") { for (const it of fc.items) { @@ -8625,11 +8663,11 @@ var require_parser = __commonJS({ delete it.key; if (isFlowToken(it.value)) { if (it.value.end) - Array.prototype.push.apply(it.value.end, it.sep); + arrayPushArray(it.value.end, it.sep); else it.value.end = it.sep; } else - Array.prototype.push.apply(it.start, it.sep); + arrayPushArray(it.start, it.sep); delete it.sep; } } @@ -8984,7 +9022,7 @@ var require_parser = __commonJS({ const prev = map.items[map.items.length - 2]; const end = prev?.value?.end; if (Array.isArray(end)) { - Array.prototype.push.apply(end, it.start); + arrayPushArray(end, it.start); end.push(this.sourceToken); map.items.pop(); return; @@ -9172,7 +9210,7 @@ var require_parser = __commonJS({ const prev = seq.items[seq.items.length - 2]; const end = prev?.value?.end; if (Array.isArray(end)) { - Array.prototype.push.apply(end, it.start); + arrayPushArray(end, it.start); end.push(this.sourceToken); seq.items.pop(); return; @@ -9412,9 +9450,9 @@ var require_parser = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/public-api.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/public-api.js var require_public_api = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/public-api.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/public-api.js"(exports2) { "use strict"; var composer = require_composer(); var Document = require_Document(); @@ -9509,9 +9547,9 @@ var require_public_api = __commonJS({ } }); -// node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/index.js +// node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/index.js var require_dist = __commonJS({ - "node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/index.js"(exports2) { + "node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/index.js"(exports2) { "use strict"; var composer = require_composer(); var Document = require_Document(); @@ -13714,9 +13752,9 @@ var init_src5 = __esm({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/code.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js var require_code = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/code.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.regexpCode = exports2.getEsmExportName = exports2.getProperty = exports2.safeStringify = exports2.stringify = exports2.strConcat = exports2.addCodeArg = exports2.str = exports2._ = exports2.nil = exports2._Code = exports2.Name = exports2.IDENTIFIER = exports2._CodeOrName = void 0; @@ -13868,9 +13906,9 @@ var require_code = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/scope.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/scope.js var require_scope = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/scope.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/scope.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.ValueScope = exports2.ValueScopeName = exports2.Scope = exports2.varKinds = exports2.UsedValueState = void 0; @@ -14013,9 +14051,9 @@ var require_scope = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/index.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js var require_codegen = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/index.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.or = exports2.and = exports2.not = exports2.CodeGen = exports2.operators = exports2.varKinds = exports2.ValueScopeName = exports2.ValueScope = exports2.Scope = exports2.Name = exports2.regexpCode = exports2.stringify = exports2.getProperty = exports2.nil = exports2.strConcat = exports2.str = exports2._ = void 0; @@ -14733,9 +14771,9 @@ var require_codegen = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/util.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/util.js var require_util = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/util.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/util.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.checkStrictMode = exports2.getErrorPath = exports2.Type = exports2.useFunc = exports2.setEvaluated = exports2.evaluatedPropsToName = exports2.mergeEvaluated = exports2.eachItem = exports2.unescapeJsonPointer = exports2.escapeJsonPointer = exports2.escapeFragment = exports2.unescapeFragment = exports2.schemaRefOrVal = exports2.schemaHasRulesButRef = exports2.schemaHasRules = exports2.checkUnknownRules = exports2.alwaysValidSchema = exports2.toHash = void 0; @@ -14900,9 +14938,9 @@ var require_util = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/names.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/names.js var require_names = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/names.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/names.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -14939,9 +14977,9 @@ var require_names = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/errors.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/errors.js var require_errors2 = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/errors.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/errors.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.extendErrors = exports2.resetErrorsCount = exports2.reportExtraError = exports2.reportError = exports2.keyword$DataError = exports2.keywordError = void 0; @@ -15061,9 +15099,9 @@ var require_errors2 = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/boolSchema.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/boolSchema.js var require_boolSchema = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/boolSchema.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/boolSchema.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.boolOrEmptySchema = exports2.topBoolOrEmptySchema = void 0; @@ -15112,9 +15150,9 @@ var require_boolSchema = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/rules.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/rules.js var require_rules = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/rules.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/rules.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getRules = exports2.isJSONType = void 0; @@ -15143,9 +15181,9 @@ var require_rules = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/applicability.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/applicability.js var require_applicability = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/applicability.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/applicability.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.shouldUseRule = exports2.shouldUseGroup = exports2.schemaHasRulesForType = void 0; @@ -15166,9 +15204,9 @@ var require_applicability = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/dataType.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/dataType.js var require_dataType = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/dataType.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/dataType.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.reportTypeError = exports2.checkDataTypes = exports2.checkDataType = exports2.coerceAndCheckDataType = exports2.getJSONTypes = exports2.getSchemaTypes = exports2.DataType = void 0; @@ -15350,9 +15388,9 @@ var require_dataType = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/defaults.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/defaults.js var require_defaults = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/defaults.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/defaults.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.assignDefaults = void 0; @@ -15387,9 +15425,9 @@ var require_defaults = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/code.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/code.js var require_code2 = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/code.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/code.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.validateUnion = exports2.validateArray = exports2.usePattern = exports2.callValidateCode = exports2.schemaProperties = exports2.allSchemaProperties = exports2.noPropertyInData = exports2.propertyInData = exports2.isOwnProperty = exports2.hasPropFunc = exports2.reportMissingProp = exports2.checkMissingProp = exports2.checkReportMissingProp = void 0; @@ -15520,9 +15558,9 @@ var require_code2 = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/keyword.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/keyword.js var require_keyword = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/keyword.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/keyword.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.validateKeywordUsage = exports2.validSchemaType = exports2.funcKeywordCode = exports2.macroKeywordCode = void 0; @@ -15638,9 +15676,9 @@ var require_keyword = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/subschema.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/subschema.js var require_subschema = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/subschema.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/subschema.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.extendSubschemaMode = exports2.extendSubschemaData = exports2.getSubschema = void 0; @@ -15844,9 +15882,9 @@ var require_json_schema_traverse = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/resolve.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/resolve.js var require_resolve = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/resolve.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/resolve.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getSchemaRefs = exports2.resolveUrl = exports2.normalizeId = exports2._getFullPath = exports2.getFullPath = exports2.inlineRef = void 0; @@ -16000,9 +16038,9 @@ var require_resolve = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/index.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/index.js var require_validate = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/index.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getData = exports2.KeywordCxt = exports2.validateFunctionCode = void 0; @@ -16508,9 +16546,9 @@ var require_validate = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/validation_error.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/validation_error.js var require_validation_error = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/validation_error.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/validation_error.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var ValidationError = class extends Error { @@ -16524,9 +16562,9 @@ var require_validation_error = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/ref_error.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/ref_error.js var require_ref_error = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/ref_error.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/ref_error.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var resolve_1 = require_resolve(); @@ -16541,9 +16579,9 @@ var require_ref_error = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/index.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/index.js var require_compile = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/index.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.resolveSchema = exports2.getCompilingSchema = exports2.resolveRef = exports2.compileSchema = exports2.SchemaEnv = void 0; @@ -16765,9 +16803,9 @@ var require_compile = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/refs/data.json +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/data.json var require_data = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/refs/data.json"(exports2, module2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/data.json"(exports2, module2) { module2.exports = { $id: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", description: "Meta-schema for $data reference (JSON AnySchema extension proposal)", @@ -16784,12 +16822,33 @@ var require_data = __commonJS({ } }); -// node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js +// node_modules/.pnpm/fast-uri@3.1.6/node_modules/fast-uri/lib/utils.js var require_utils = __commonJS({ - "node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js"(exports2, module2) { + "node_modules/.pnpm/fast-uri@3.1.6/node_modules/fast-uri/lib/utils.js"(exports2, module2) { "use strict"; var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu); var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u); + var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu); + var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu); + var isPathCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u); + var isQueryFragmentCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u); + var isUserinfoCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u); + var BYTE_HEX = new Array(256); + { + const HEX_DIGITS = "0123456789ABCDEF"; + for (let i = 0; i < 256; i++) { + BYTE_HEX[i] = "%" + HEX_DIGITS[i >> 4] + HEX_DIGITS[i & 15]; + } + } + function percentEncodeNonAscii(cp2) { + if (cp2 < 2048) { + return BYTE_HEX[192 | cp2 >> 6] + BYTE_HEX[128 | cp2 & 63]; + } + if (cp2 < 65536) { + return BYTE_HEX[224 | cp2 >> 12] + BYTE_HEX[128 | cp2 >> 6 & 63] + BYTE_HEX[128 | cp2 & 63]; + } + return BYTE_HEX[240 | cp2 >> 18] + BYTE_HEX[128 | cp2 >> 12 & 63] + BYTE_HEX[128 | cp2 >> 6 & 63] + BYTE_HEX[128 | cp2 & 63]; + } function stringArrayToHexStripped(input) { let acc = ""; let code = 0; @@ -16814,91 +16873,105 @@ var require_utils = __commonJS({ } return acc; } + var isHextet = RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/); + var isIPvFuture = RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/); + var isZoneCharacter = RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/); var nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u); - function consumeIsZone(buffer) { - buffer.length = 0; - return true; - } - function consumeHextets(buffer, address, output) { - if (buffer.length) { - const hex = stringArrayToHexStripped(buffer); - if (hex !== "") { - address.push(hex); - } else { - output.error = true; - return false; + function isZoneIdentifier(zone) { + if (zone.length === 0) return false; + for (let i = 0; i < zone.length; i++) { + if (isZoneCharacter(zone[i])) continue; + if (zone[i] === "%" && i + 2 < zone.length && isHexPair(zone.slice(i + 1, i + 3))) { + i += 2; + continue; } - buffer.length = 0; + return false; } return true; } - function getIPV6(input) { - let tokenCount = 0; - const output = { error: false, address: "", zone: "" }; - const address = []; - const buffer = []; - let endipv6Encountered = false; - let endIpv6 = false; - let consume = consumeHextets; - for (let i = 0; i < input.length; i++) { - const cursor = input[i]; - if (cursor === "[" || cursor === "]") { - continue; - } - if (cursor === ":") { - if (endipv6Encountered === true) { - endIpv6 = true; + function compressIPv6ZeroRun(hextets) { + let bestStart = -1; + let bestLength = 0; + let runStart = -1; + let runLength = 0; + for (let i = 0; i < hextets.length; i++) { + if (hextets[i] === "0") { + if (runStart === -1) runStart = i; + runLength++; + if (runLength > bestLength) { + bestLength = runLength; + bestStart = runStart; } - if (!consume(buffer, address, output)) { - break; - } - if (++tokenCount > 7) { - output.error = true; - break; - } - if (i > 0 && input[i - 1] === ":") { - endipv6Encountered = true; - } - address.push(":"); - continue; - } else if (cursor === "%") { - if (!consume(buffer, address, output)) { - break; - } - consume = consumeIsZone; } else { - buffer.push(cursor); + runStart = -1; + runLength = 0; + } + } + if (bestLength < 2) return hextets.join(":"); + const head = hextets.slice(0, bestStart).join(":"); + const tail = hextets.slice(bestStart + bestLength).join(":"); + return head + "::" + tail; + } + function normalizeIPv6Address(input) { + const compression = input.indexOf("::"); + if (compression !== -1 && input.indexOf("::", compression + 1) !== -1) return void 0; + const left = compression === -1 ? input.split(":") : input.slice(0, compression).split(":"); + const right = compression === -1 ? [] : input.slice(compression + 2).split(":"); + if (compression !== -1) { + if (left.length === 1 && left[0] === "") left.length = 0; + if (right.length === 1 && right[0] === "") right.length = 0; + } + const parts = left.concat(right); + let hextetCount = 0; + for (let i = 0; i < parts.length; i++) { + const part = parts[i]; + if (part === "") return void 0; + if (part.indexOf(".") !== -1) { + if (i !== parts.length - 1 || compression !== -1 && right.length === 0 || !isIPv4(part)) return void 0; + hextetCount += 2; continue; } + if (!isHextet(part)) return void 0; + parts[i] = parseInt(part, 16).toString(16); + hextetCount++; } - if (buffer.length) { - if (consume === consumeIsZone) { - output.zone = buffer.join(""); - } else if (endIpv6) { - address.push(buffer.join("")); - } else { - address.push(stringArrayToHexStripped(buffer)); - } + if (compression === -1) { + if (hextetCount !== 8) return void 0; + return compressIPv6ZeroRun(parts); } - output.address = address.join(""); - return output; + if (hextetCount >= 8) return void 0; + const expanded = parts.slice(0, left.length); + for (let i = hextetCount; i < 8; i++) expanded.push("0"); + for (let i = left.length; i < parts.length; i++) expanded.push(parts[i]); + return compressIPv6ZeroRun(expanded); } function normalizeIPv6(host) { - if (findToken(host, ":") < 2) { - return { host, isIPV6: false }; - } - const ipv6 = getIPV6(host); - if (!ipv6.error) { - let newHost = ipv6.address; - let escapedHost = ipv6.address; - if (ipv6.zone) { - newHost += "%" + ipv6.zone; - escapedHost += "%25" + ipv6.zone; - } - return { host: newHost, isIPV6: true, escapedHost }; - } else { - return { host, isIPV6: false }; - } + const bracketed = host[0] === "[" && host[host.length - 1] === "]"; + const hasBracket = host[0] === "[" || host[host.length - 1] === "]"; + if (hasBracket && !bracketed) return { host, isIPV6: false, error: true }; + let input = bracketed ? host.slice(1, -1) : host; + if (bracketed && isIPvFuture(input)) { + input = input.toLowerCase(); + return { host: `[${input}]`, escapedHost: input, isIPV6: false, isIPVFuture: true }; + } + if (findToken(input, ":") < 2) { + return { host, isIPV6: false, error: bracketed }; + } + let zoneIdentifier = ""; + const zoneSeparator = input.indexOf("%"); + if (zoneSeparator !== -1) { + const separatorLength = input.slice(zoneSeparator, zoneSeparator + 3).toLowerCase() === "%25" ? 3 : 1; + zoneIdentifier = input.slice(zoneSeparator + separatorLength); + if (!isZoneIdentifier(zoneIdentifier)) return { host, isIPV6: false, error: true }; + input = input.slice(0, zoneSeparator); + } + const address = normalizeIPv6Address(input); + if (address === void 0) return { host, isIPV6: false, error: true }; + return { + host: address + (zoneIdentifier ? "%" + zoneIdentifier : ""), + escapedHost: address + (zoneIdentifier ? "%25" + zoneIdentifier : ""), + isIPV6: true + }; } function findToken(str, token) { let ind = 0; @@ -16982,42 +17055,239 @@ var require_utils = __commonJS({ } return output.join(""); } - function normalizeComponentEncoding(component, esc) { - const func = esc !== true ? escape : unescape; - if (component.scheme !== void 0) { - component.scheme = func(component.scheme); + var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" }; + var HOST_DELIM_RE = /[@/?#:]/g; + var HOST_DELIM_NO_COLON_RE = /[@/?#]/g; + function reescapeHostDelimiters(host, isIP) { + const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE; + re.lastIndex = 0; + return host.replace(re, (ch) => HOST_DELIMS[ch]); + } + function normalizePercentEncoding(input, decodeUnreserved = false) { + if (input.indexOf("%") === -1) { + return input; } - if (component.userinfo !== void 0) { - component.userinfo = func(component.userinfo); + let output = ""; + for (let i = 0; i < input.length; i++) { + if (input[i] === "%" && i + 2 < input.length) { + const hex = input.slice(i + 1, i + 3); + if (isHexPair(hex)) { + const normalizedHex = hex.toUpperCase(); + const decoded = String.fromCharCode(parseInt(normalizedHex, 16)); + if (decodeUnreserved && isUnreserved(decoded)) { + output += decoded; + } else { + output += "%" + normalizedHex; + } + i += 2; + continue; + } + } + output += input[i]; } - if (component.host !== void 0) { - component.host = func(component.host); + return output; + } + function normalizePathEncoding(input) { + let output = ""; + for (let i = 0; i < input.length; i++) { + const ch = input[i]; + if (ch === "%" && i + 2 < input.length) { + const hex = input.slice(i + 1, i + 3); + if (isHexPair(hex)) { + const normalizedHex = hex.toUpperCase(); + const decoded = String.fromCharCode(parseInt(normalizedHex, 16)); + if (decoded !== "." && isUnreserved(decoded)) { + output += decoded; + } else { + output += "%" + normalizedHex; + } + i += 2; + continue; + } + } + if (isPathCharacter(ch)) { + output += ch; + } else { + const code = input.charCodeAt(i); + if (code < 128) { + output += isEscapeSafe(code) ? ch : BYTE_HEX[code]; + } else if (code < 55296 || code > 57343) { + output += percentEncodeNonAscii(code); + } else if (code <= 56319 && i + 1 < input.length) { + const low = input.charCodeAt(i + 1); + if (low >= 56320 && low <= 57343) { + output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320)); + i++; + } else { + output += percentEncodeNonAscii(65533); + } + } else { + output += percentEncodeNonAscii(65533); + } + } } - if (component.path !== void 0) { - component.path = func(component.path); + return output; + } + function serializePathEncoding(input, pathNoScheme = false) { + let output = ""; + let firstSegment = pathNoScheme && input[0] !== "/"; + for (let i = 0; i < input.length; i++) { + const ch = input[i]; + if (ch === "%" && i + 2 < input.length) { + const hex = input.slice(i + 1, i + 3); + if (isHexPair(hex)) { + output += "%" + hex.toUpperCase(); + i += 2; + continue; + } + } + if (ch === "/") { + firstSegment = false; + } + if (isPathCharacter(ch) && (ch !== ":" || !firstSegment)) { + output += ch; + } else { + const code = input.charCodeAt(i); + if (code < 128) { + output += BYTE_HEX[code]; + } else if (code < 55296 || code > 57343) { + output += percentEncodeNonAscii(code); + } else if (code <= 56319 && i + 1 < input.length) { + const low = input.charCodeAt(i + 1); + if (low >= 56320 && low <= 57343) { + output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320)); + i++; + } else { + output += percentEncodeNonAscii(65533); + } + } else { + output += percentEncodeNonAscii(65533); + } + } } - if (component.query !== void 0) { - component.query = func(component.query); + return output; + } + function encodeComponent(input, isAllowed) { + let output = ""; + for (let i = 0; i < input.length; i++) { + const ch = input[i]; + if (ch === "%" && i + 2 < input.length) { + const hex = input.slice(i + 1, i + 3); + if (isHexPair(hex)) { + output += "%" + hex.toUpperCase(); + i += 2; + continue; + } + } + if (isAllowed(ch)) { + output += ch; + } else { + const code = input.charCodeAt(i); + if (code < 128) { + output += BYTE_HEX[code]; + } else if (code < 55296 || code > 57343) { + output += percentEncodeNonAscii(code); + } else if (code <= 56319 && i + 1 < input.length) { + const low = input.charCodeAt(i + 1); + if (low >= 56320 && low <= 57343) { + output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320)); + i++; + } else { + output += percentEncodeNonAscii(65533); + } + } else { + output += percentEncodeNonAscii(65533); + } + } } - if (component.fragment !== void 0) { - component.fragment = func(component.fragment); + return output; + } + function encodeUserinfo(input) { + return encodeComponent(input, isUserinfoCharacter); + } + function encodeQuery(input) { + return encodeComponent(input, isQueryFragmentCharacter); + } + function encodeFragment(input) { + return encodeComponent(input, isQueryFragmentCharacter); + } + function isEscapeSafe(cp2) { + return cp2 >= 48 && cp2 <= 57 || cp2 >= 65 && cp2 <= 90 || cp2 >= 97 && cp2 <= 122 || cp2 === 42 || cp2 === 43 || cp2 === 45 || cp2 === 46 || cp2 === 47 || cp2 === 64 || cp2 === 95; + } + function normalizeQueryFragmentEncoding(input) { + let output = ""; + for (let i = 0; i < input.length; i++) { + const ch = input[i]; + if (ch === "%" && i + 2 < input.length) { + const hex = input.slice(i + 1, i + 3); + if (isHexPair(hex)) { + const normalizedHex = hex.toUpperCase(); + const decoded = String.fromCharCode(parseInt(normalizedHex, 16)); + if (isUnreserved(decoded)) { + output += decoded; + } else { + output += "%" + normalizedHex; + } + i += 2; + continue; + } + } + if (isQueryFragmentCharacter(ch)) { + output += ch; + } else { + const code = input.charCodeAt(i); + if (code < 128) { + output += isEscapeSafe(code) ? ch : BYTE_HEX[code]; + } else if (code < 55296 || code > 57343) { + output += percentEncodeNonAscii(code); + } else if (code <= 56319 && i + 1 < input.length) { + const low = input.charCodeAt(i + 1); + if (low >= 56320 && low <= 57343) { + output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320)); + i++; + } else { + output += percentEncodeNonAscii(65533); + } + } else { + output += percentEncodeNonAscii(65533); + } + } } - return component; + return output; + } + function escapePreservingEscapes(input) { + let output = ""; + for (let i = 0; i < input.length; i++) { + if (input[i] === "%" && i + 2 < input.length) { + const hex = input.slice(i + 1, i + 3); + if (isHexPair(hex)) { + output += "%" + hex.toUpperCase(); + i += 2; + continue; + } + } + output += escape(input[i]); + } + return output; } function recomposeAuthority(component) { const uriTokens = []; if (component.userinfo !== void 0) { - uriTokens.push(component.userinfo); + uriTokens.push(encodeUserinfo(component.userinfo)); uriTokens.push("@"); } if (component.host !== void 0) { - let host = unescape(component.host); + let host = component.host; if (!isIPv4(host)) { - const ipV6res = normalizeIPv6(host); - if (ipV6res.isIPV6 === true) { + let ipV6res = normalizeIPv6(host); + if (ipV6res.isIPV6 !== true && ipV6res.isIPVFuture !== true) { + host = normalizePercentEncoding(host, true); + ipV6res = normalizeIPv6(host); + } + if (ipV6res.isIPV6 === true || ipV6res.isIPVFuture === true) { host = `[${ipV6res.escapedHost}]`; } else { - host = component.host; + host = reescapeHostDelimiters(host, false); } } uriTokens.push(host); @@ -17031,7 +17301,15 @@ var require_utils = __commonJS({ module2.exports = { nonSimpleDomain, recomposeAuthority, - normalizeComponentEncoding, + reescapeHostDelimiters, + normalizePercentEncoding, + normalizePathEncoding, + serializePathEncoding, + normalizeQueryFragmentEncoding, + encodeUserinfo, + encodeQuery, + encodeFragment, + escapePreservingEscapes, removeDotSegments, isIPv4, isUUID, @@ -17041,12 +17319,12 @@ var require_utils = __commonJS({ } }); -// node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js +// node_modules/.pnpm/fast-uri@3.1.6/node_modules/fast-uri/lib/schemes.js var require_schemes = __commonJS({ - "node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js"(exports2, module2) { + "node_modules/.pnpm/fast-uri@3.1.6/node_modules/fast-uri/lib/schemes.js"(exports2, module2) { "use strict"; var { isUUID } = require_utils(); - var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu; + var URN_REG = /^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu; var supportedSchemeNames = ( /** @type {const} */ [ @@ -17107,9 +17385,10 @@ var require_schemes = __commonJS({ wsComponent.secure = void 0; } if (wsComponent.resourceName) { - const [path55, query] = wsComponent.resourceName.split("?"); + const queryIndex = wsComponent.resourceName.indexOf("?"); + const path55 = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex); wsComponent.path = path55 && path55 !== "/" ? path55 : void 0; - wsComponent.query = query; + wsComponent.query = queryIndex === -1 ? void 0 : wsComponent.resourceName.slice(queryIndex + 1); wsComponent.resourceName = void 0; } wsComponent.fragment = void 0; @@ -17121,7 +17400,7 @@ var require_schemes = __commonJS({ return urnComponent; } const matches = urnComponent.path.match(URN_REG); - if (matches) { + if (matches && matches[0] === urnComponent.path) { const scheme = options.scheme || urnComponent.scheme || "urn"; urnComponent.nid = matches[1].toLowerCase(); urnComponent.nss = matches[2]; @@ -17251,16 +17530,25 @@ var require_schemes = __commonJS({ } }); -// node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js +// node_modules/.pnpm/fast-uri@3.1.6/node_modules/fast-uri/index.js var require_fast_uri = __commonJS({ - "node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js"(exports2, module2) { + "node_modules/.pnpm/fast-uri@3.1.6/node_modules/fast-uri/index.js"(exports2, module2) { "use strict"; - var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils(); + var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils(); var { SCHEMES, getSchemeHandler } = require_schemes(); + var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u; + var MALFORMED_SCHEME_ERROR = "URI scheme is malformed."; + function decodeValidScheme(scheme) { + const decodedScheme = unescape(String(scheme)); + if (!VALID_SCHEME.test(decodedScheme)) { + throw new TypeError(MALFORMED_SCHEME_ERROR); + } + return decodedScheme; + } function normalize2(uri, options) { if (typeof uri === "string") { uri = /** @type {T} */ - serialize(parse(uri, options), options); + normalizeString(uri, options); } else if (typeof uri === "object") { uri = /** @type {T} */ parse(serialize(uri, options), options); @@ -17269,7 +17557,34 @@ var require_fast_uri = __commonJS({ } function resolve4(baseURI, relativeURI, options) { const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" }; - const resolved = resolveComponent(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true); + const { + parsed: baseParsed, + malformedAuthorityOrPort: baseMalformed, + malformedPercentEncoding: baseMalformedPercentEncoding, + malformedSchemeSpecific: baseMalformedSchemeSpecific, + malformedHost: baseMalformedHost, + malformedScheme: baseMalformedScheme + } = parseWithStatus(baseURI, schemelessOptions); + const { + parsed: relativeParsed, + malformedAuthorityOrPort: relativeMalformed, + malformedPercentEncoding: relativeMalformedPercentEncoding, + malformedSchemeSpecific: relativeMalformedSchemeSpecific, + malformedHost: relativeMalformedHost, + malformedScheme: relativeMalformedScheme + } = parseWithStatus(relativeURI, schemelessOptions); + if (baseMalformed || relativeMalformed || baseMalformedPercentEncoding || relativeMalformedPercentEncoding || baseMalformedSchemeSpecific || relativeMalformedSchemeSpecific || baseMalformedHost || relativeMalformedHost || baseMalformedScheme || relativeMalformedScheme) { + throw new Error(baseParsed.error || relativeParsed.error || "URI is malformed."); + } + const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true); + const resolvedSchemeHandler = getSchemeHandler(options && options.scheme || resolved.scheme); + const resolvedHost = resolved.host; + const resolvedHostIsIP = resolvedHost !== void 0 && resolvedHost !== "" && (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6); + canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP); + const encodedASCIIHost = resolvedHost && resolvedHost.indexOf("%") !== -1 && !/\P{ASCII}/u.test(resolvedHost); + if (resolved.error && !encodedASCIIHost) { + throw new Error(resolved.error); + } schemelessOptions.skipEscape = true; return serialize(resolved, schemelessOptions); } @@ -17327,19 +17642,9 @@ var require_fast_uri = __commonJS({ return target; } function equal(uriA, uriB, options) { - if (typeof uriA === "string") { - uriA = unescape(uriA); - uriA = serialize(normalizeComponentEncoding(parse(uriA, options), true), { ...options, skipEscape: true }); - } else if (typeof uriA === "object") { - uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true }); - } - if (typeof uriB === "string") { - uriB = unescape(uriB); - uriB = serialize(normalizeComponentEncoding(parse(uriB, options), true), { ...options, skipEscape: true }); - } else if (typeof uriB === "object") { - uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true }); - } - return uriA.toLowerCase() === uriB.toLowerCase(); + const normalizedA = normalizeComparableURI(uriA, options); + const normalizedB = normalizeComparableURI(uriB, options); + return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA === normalizedB; } function serialize(cmpts, opts) { const component = { @@ -17360,19 +17665,22 @@ var require_fast_uri = __commonJS({ }; const options = Object.assign({}, opts); const uriTokens = []; + if (component.scheme) { + component.scheme = decodeValidScheme(component.scheme); + } const schemeHandler = getSchemeHandler(options.scheme || component.scheme); if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options); + const hasAuthority = component.userinfo !== void 0 || component.host !== void 0 || component.port !== void 0; + const pathNoScheme = !options.skipEscape && component.scheme === void 0 && !hasAuthority; if (component.path !== void 0) { if (!options.skipEscape) { - component.path = escape(component.path); - if (component.scheme !== void 0) { - component.path = component.path.split("%3A").join(":"); - } + component.path = serializePathEncoding(component.path, pathNoScheme); } else { - component.path = unescape(component.path); + component.path = normalizePercentEncoding(component.path); } } if (options.reference !== "suffix" && component.scheme) { + component.scheme = decodeValidScheme(component.scheme); uriTokens.push(component.scheme, ":"); } const authority = recomposeAuthority(component); @@ -17390,21 +17698,61 @@ var require_fast_uri = __commonJS({ if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { s = removeDotSegments(s); } + if (pathNoScheme) { + s = serializePathEncoding(s, true); + } if (authority === void 0 && s[0] === "/" && s[1] === "/") { s = "/%2F" + s.slice(2); } uriTokens.push(s); } if (component.query !== void 0) { - uriTokens.push("?", component.query); + uriTokens.push("?", encodeQuery(component.query)); } if (component.fragment !== void 0) { - uriTokens.push("#", component.fragment); + uriTokens.push("#", encodeFragment(component.fragment)); } return uriTokens.join(""); } var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u; - function parse(uri, opts) { + var AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/; + var AUTHORITY_INTRODUCER_REGION = /^(?:[^#/:?]+:)?([/\\\t\n\r]*)/; + function getParseError(parsed, matches) { + if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") { + return 'URI path must start with "/" when authority is present.'; + } + if (typeof parsed.port === "number" && (parsed.port < 0 || parsed.port > 65535)) { + return "URI port is malformed."; + } + return void 0; + } + function hasMalformedPercentEncoding(component) { + if (component === void 0) return false; + let percent = component.indexOf("%"); + while (percent !== -1) { + if (percent + 2 >= component.length || !/^[\da-f]{2}$/iu.test(component.slice(percent + 1, percent + 3))) { + return true; + } + percent = component.indexOf("%", percent + 3); + } + return false; + } + function hasMalformedComponentPercentEncoding(matches) { + const host = matches[4]; + return hasMalformedPercentEncoding(matches[3]) || host !== void 0 && !(host[0] === "[" && host[host.length - 1] === "]") && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]); + } + function canonicalizeHost(parsed, options, schemeHandler, isIP) { + if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && parsed.host[0] !== "[" && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) { + try { + parsed.host = new URL("http://" + parsed.host).hostname; + } catch (e) { + parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e; + return true; + } + } + return false; + } + function parseWithStatus(uri, opts) { const options = Object.assign({}, opts); const parsed = { scheme: void 0, @@ -17415,6 +17763,12 @@ var require_fast_uri = __commonJS({ query: void 0, fragment: void 0 }; + let malformedAuthorityOrPort = false; + let malformedPercentEncoding = false; + let malformedSchemeSpecific = false; + let malformedHost = false; + let malformedIPLiteral = false; + let malformedScheme = false; let isIP = false; if (options.reference === "suffix") { if (options.scheme) { @@ -17423,6 +17777,25 @@ var require_fast_uri = __commonJS({ uri = "//" + uri; } } + const authorityMatch = uri.match(AUTHORITY_PREFIX); + if (authorityMatch !== null && authorityMatch[1].indexOf("\\") !== -1) { + parsed.error = "URI authority must not contain a literal backslash."; + malformedAuthorityOrPort = true; + } + const introducerMatch = uri.match(AUTHORITY_INTRODUCER_REGION); + if (introducerMatch !== null) { + const region = introducerMatch[1]; + const normalizedRegion = region.replace(/[\t\n\r]/g, ""); + if (normalizedRegion.length >= 2) { + if (normalizedRegion.slice(0, 2) !== "//") { + parsed.error = parsed.error || "URI authority must not contain a literal backslash."; + malformedAuthorityOrPort = true; + } else if (region.length !== normalizedRegion.length) { + parsed.error = parsed.error || "URI authority introducer must not contain whitespace."; + malformedAuthorityOrPort = true; + } + } + } const matches = uri.match(URI_PARSE); if (matches) { parsed.scheme = matches[1]; @@ -17432,15 +17805,39 @@ var require_fast_uri = __commonJS({ parsed.path = matches[6] || ""; parsed.query = matches[7]; parsed.fragment = matches[8]; + if (parsed.scheme !== void 0) { + const decodedScheme = unescape(parsed.scheme); + if (VALID_SCHEME.test(decodedScheme)) { + parsed.scheme = decodedScheme.toLowerCase(); + } else { + parsed.error = parsed.error || MALFORMED_SCHEME_ERROR; + malformedScheme = true; + } + } + malformedPercentEncoding = hasMalformedComponentPercentEncoding(matches); + if (malformedPercentEncoding) { + parsed.error = parsed.error || "URI contains malformed percent-encoding."; + } if (isNaN(parsed.port)) { parsed.port = matches[5]; } + const parseError = getParseError(parsed, matches); + if (parseError !== void 0) { + parsed.error = parsed.error || parseError; + malformedAuthorityOrPort = true; + } if (parsed.host) { const ipv4result = isIPv4(parsed.host); if (ipv4result === false) { + const bracketedIPLiteral = parsed.host[0] === "[" && parsed.host[parsed.host.length - 1] === "]"; const ipv6result = normalizeIPv6(parsed.host); - parsed.host = ipv6result.host.toLowerCase(); - isIP = ipv6result.isIPV6; + isIP = ipv6result.isIPV6 || ipv6result.isIPVFuture === true; + malformedIPLiteral = bracketedIPLiteral && ipv6result.error === true; + parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase(); + if (malformedIPLiteral) { + parsed.error = parsed.error || "URI host is malformed."; + malformedAuthorityOrPort = true; + } } else { isIP = true; } @@ -17458,38 +17855,64 @@ var require_fast_uri = __commonJS({ parsed.error = parsed.error || "URI is not a " + options.reference + " reference."; } const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme); - if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { - if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) { - try { - parsed.host = URL.domainToASCII(parsed.host.toLowerCase()); - } catch (e) { - parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e; - } - } - } + malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP); if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) { if (uri.indexOf("%") !== -1) { - if (parsed.scheme !== void 0) { - parsed.scheme = unescape(parsed.scheme); - } - if (parsed.host !== void 0) { - parsed.host = unescape(parsed.host); + if (parsed.host !== void 0 && !malformedIPLiteral) { + const host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true); + parsed.host = reescapeHostDelimiters(host, isIP); } } if (parsed.path) { - parsed.path = escape(unescape(parsed.path)); + parsed.path = normalizePathEncoding(parsed.path); + } + if (parsed.query) { + parsed.query = normalizeQueryFragmentEncoding(parsed.query); } if (parsed.fragment) { - parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment)); + parsed.fragment = normalizeQueryFragmentEncoding(parsed.fragment); } } if (schemeHandler && schemeHandler.parse) { schemeHandler.parse(parsed, options); + if (schemeHandler === SCHEMES.urn && parsed.nid === void 0) { + malformedSchemeSpecific = true; + } } } else { parsed.error = parsed.error || "URI can not be parsed."; } - return parsed; + return { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme }; + } + function parse(uri, opts) { + return parseWithStatus(uri, opts).parsed; + } + function normalizeString(uri, opts) { + return normalizeStringWithStatus(uri, opts).normalized; + } + function normalizeStringWithStatus(uri, opts) { + const { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = parseWithStatus(uri, opts); + return { + normalized: malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? uri : serialize(parsed, opts), + malformedAuthorityOrPort, + malformedPercentEncoding, + malformedSchemeSpecific, + malformedHost, + malformedScheme + }; + } + function normalizeComparableURI(uri, opts) { + if (typeof uri !== "string" && typeof uri !== "object") { + return void 0; + } + let value; + try { + value = typeof uri === "string" ? uri : serialize(uri, opts); + } catch { + return void 0; + } + const { normalized, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = normalizeStringWithStatus(value, opts); + return malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? void 0 : normalized; } var fastUri = { SCHEMES, @@ -17506,9 +17929,9 @@ var require_fast_uri = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/uri.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/uri.js var require_uri = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/uri.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/uri.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var uri = require_fast_uri(); @@ -17517,9 +17940,9 @@ var require_uri = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/core.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/core.js var require_core = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/core.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/core.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.CodeGen = exports2.Name = exports2.nil = exports2.stringify = exports2.str = exports2._ = exports2.KeywordCxt = void 0; @@ -17629,7 +18052,7 @@ var require_core = __commonJS({ constructor(opts = {}) { this.schemas = {}; this.refs = {}; - this.formats = {}; + this.formats = /* @__PURE__ */ Object.create(null); this._compilations = /* @__PURE__ */ new Set(); this._loading = {}; this._cache = /* @__PURE__ */ new Map(); @@ -18128,9 +18551,9 @@ var require_core = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/id.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js var require_id = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/id.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var def = { @@ -18143,9 +18566,9 @@ var require_id = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/ref.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js var require_ref = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/ref.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.callRef = exports2.getValidate = void 0; @@ -18265,9 +18688,9 @@ var require_ref = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/index.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js var require_core2 = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/index.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var id_1 = require_id(); @@ -18286,9 +18709,9 @@ var require_core2 = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js var require_limitNumber = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitNumber.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -18318,9 +18741,9 @@ var require_limitNumber = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js var require_multipleOf = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/multipleOf.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -18346,9 +18769,9 @@ var require_multipleOf = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/ucs2length.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/ucs2length.js var require_ucs2length = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/ucs2length.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/ucs2length.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); function ucs2length(str) { @@ -18372,9 +18795,9 @@ var require_ucs2length = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitLength.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js var require_limitLength = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitLength.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -18404,12 +18827,13 @@ var require_limitLength = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/pattern.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js var require_pattern = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/pattern.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var code_1 = require_code2(); + var util_1 = require_util(); var codegen_1 = require_codegen(); var error = { message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`, @@ -18422,19 +18846,27 @@ var require_pattern = __commonJS({ $data: true, error, code(cxt) { - const { data, $data, schema, schemaCode, it } = cxt; + const { gen, data, $data, schema, schemaCode, it } = cxt; const u = it.opts.unicodeRegExp ? "u" : ""; - const regExp = $data ? (0, codegen_1._)`(new RegExp(${schemaCode}, ${u}))` : (0, code_1.usePattern)(cxt, schema); - cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`); + if ($data) { + const { regExp } = it.opts.code; + const regExpCode = regExp.code === "new RegExp" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen, regExp); + const valid = gen.let("valid"); + gen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false)); + cxt.fail$data((0, codegen_1._)`!${valid}`); + } else { + const regExp = (0, code_1.usePattern)(cxt, schema); + cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`); + } } }; exports2.default = def; } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js var require_limitProperties = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitProperties.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -18461,9 +18893,9 @@ var require_limitProperties = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/required.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js var require_required = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/required.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var code_1 = require_code2(); @@ -18543,9 +18975,9 @@ var require_required = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitItems.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js var require_limitItems = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitItems.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -18572,9 +19004,9 @@ var require_limitItems = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/equal.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js var require_equal = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/equal.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var equal = require_fast_deep_equal(); @@ -18583,9 +19015,9 @@ var require_equal = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js var require_uniqueItems = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var dataType_1 = require_dataType(); @@ -18650,9 +19082,9 @@ var require_uniqueItems = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/const.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js var require_const = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/const.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -18679,9 +19111,9 @@ var require_const = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/enum.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js var require_enum = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/enum.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -18728,9 +19160,9 @@ var require_enum = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/index.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js var require_validation = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/index.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var limitNumber_1 = require_limitNumber(); @@ -18766,9 +19198,9 @@ var require_validation = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js var require_additionalItems = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.validateAdditionalItems = void 0; @@ -18819,9 +19251,9 @@ var require_additionalItems = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/items.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js var require_items = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/items.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.validateTuple = void 0; @@ -18876,9 +19308,9 @@ var require_items = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js var require_prefixItems = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var items_1 = require_items(); @@ -18893,9 +19325,9 @@ var require_prefixItems = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/items2020.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js var require_items2020 = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/items2020.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -18928,9 +19360,9 @@ var require_items2020 = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/contains.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js var require_contains = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/contains.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -19022,9 +19454,9 @@ var require_contains = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js var require_dependencies = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/dependencies.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.validateSchemaDeps = exports2.validatePropertyDeps = exports2.error = void 0; @@ -19116,9 +19548,9 @@ var require_dependencies = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js var require_propertyNames = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -19159,9 +19591,9 @@ var require_propertyNames = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js var require_additionalProperties = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var code_1 = require_code2(); @@ -19265,9 +19697,9 @@ var require_additionalProperties = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/properties.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js var require_properties = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/properties.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var validate_1 = require_validate(); @@ -19323,9 +19755,9 @@ var require_properties = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js var require_patternProperties = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var code_1 = require_code2(); @@ -19397,9 +19829,9 @@ var require_patternProperties = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/not.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/not.js var require_not = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/not.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/not.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var util_1 = require_util(); @@ -19428,9 +19860,9 @@ var require_not = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js var require_anyOf = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/anyOf.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var code_1 = require_code2(); @@ -19445,9 +19877,9 @@ var require_anyOf = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js var require_oneOf = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/oneOf.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -19503,9 +19935,9 @@ var require_oneOf = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/allOf.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js var require_allOf = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/allOf.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var util_1 = require_util(); @@ -19530,9 +19962,9 @@ var require_allOf = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/if.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js var require_if = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/if.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -19599,9 +20031,9 @@ var require_if = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js var require_thenElse = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/thenElse.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var util_1 = require_util(); @@ -19617,9 +20049,9 @@ var require_thenElse = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/index.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js var require_applicator = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/index.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var additionalItems_1 = require_additionalItems(); @@ -19665,9 +20097,9 @@ var require_applicator = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/format/format.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js var require_format = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/format/format.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -19755,9 +20187,9 @@ var require_format = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/format/index.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js var require_format2 = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/format/index.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var format_1 = require_format(); @@ -19766,9 +20198,9 @@ var require_format2 = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/metadata.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js var require_metadata = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/metadata.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.contentVocabulary = exports2.metadataVocabulary = void 0; @@ -19789,9 +20221,9 @@ var require_metadata = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/draft7.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft7.js var require_draft7 = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/draft7.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft7.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var core_1 = require_core2(); @@ -19811,9 +20243,9 @@ var require_draft7 = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/discriminator/types.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js var require_types = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/discriminator/types.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DiscrError = void 0; @@ -19825,9 +20257,9 @@ var require_types = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/discriminator/index.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js var require_discriminator = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/discriminator/index.js"(exports2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var codegen_1 = require_codegen(); @@ -19930,9 +20362,9 @@ var require_discriminator = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/refs/json-schema-draft-07.json +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-draft-07.json var require_json_schema_draft_07 = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/refs/json-schema-draft-07.json"(exports2, module2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-draft-07.json"(exports2, module2) { module2.exports = { $schema: "http://json-schema.org/draft-07/schema#", $id: "http://json-schema.org/draft-07/schema#", @@ -20087,9 +20519,9 @@ var require_json_schema_draft_07 = __commonJS({ } }); -// node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/ajv.js +// node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/ajv.js var require_ajv = __commonJS({ - "node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/ajv.js"(exports2, module2) { + "node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/ajv.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.MissingRefError = exports2.ValidationError = exports2.CodeGen = exports2.Name = exports2.nil = exports2.stringify = exports2.str = exports2._ = exports2.KeywordCxt = exports2.Ajv = void 0; @@ -20157,9 +20589,9 @@ var require_ajv = __commonJS({ } }); -// node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.17.1/node_modules/ajv-formats/dist/formats.js +// node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/formats.js var require_formats = __commonJS({ - "node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.17.1/node_modules/ajv-formats/dist/formats.js"(exports2) { + "node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/formats.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.formatNames = exports2.fastFormats = exports2.fullFormats = void 0; @@ -20360,9 +20792,9 @@ var require_formats = __commonJS({ } }); -// node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.17.1/node_modules/ajv-formats/dist/limit.js +// node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/limit.js var require_limit = __commonJS({ - "node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.17.1/node_modules/ajv-formats/dist/limit.js"(exports2) { + "node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/limit.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.formatLimitDefinition = void 0; @@ -20432,9 +20864,9 @@ var require_limit = __commonJS({ } }); -// node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.17.1/node_modules/ajv-formats/dist/index.js +// node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/index.js var require_dist2 = __commonJS({ - "node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.17.1/node_modules/ajv-formats/dist/index.js"(exports2, module2) { + "node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/index.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var formats_1 = require_formats(); @@ -40607,7 +41039,7 @@ async function cmdLeverage(args, flags) { } // src/index.js -var VERSION = true ? "1.10.25" : process.env.npm_package_version || "0.0.0"; +var VERSION = true ? "1.10.26" : process.env.npm_package_version || "0.0.0"; var RETIRED_COMMANDS = /* @__PURE__ */ new Map([ ["apply", "Provider transcripts remain authoritative; organization-plan execution was removed."], ["database", "Use Studio only if you still need the isolated compatibility database."], diff --git a/docs/swe-compliance/2026-09-01-cli-npm-release-1.10.26.md b/docs/swe-compliance/2026-09-01-cli-npm-release-1.10.26.md new file mode 100644 index 0000000..b0fa64a --- /dev/null +++ b/docs/swe-compliance/2026-09-01-cli-npm-release-1.10.26.md @@ -0,0 +1,231 @@ +# CLI npm Release 1.10.26 Compliance Checklist + +## Phase 0: Baseline And Manual Lookup + +- Status: complete. +- Scope: promote current `origin/main` as a traceable npm release after the + published `latest` tag stalled at `1.10.12` while source and the verified + workstation install advanced to `1.10.25`. +- Files inspected before editing: `AGENTS.md`, `package.json`, + `.github/workflows/quality.yml`, `README.md`, the tracked `dist/index.cjs`, + existing release/compliance records, installed package metadata, and npm + registry metadata. +- Relevant SWE manual sections: Engineering Operating Manual Index, + Infrastructure and Deployment Standard H1/H4/H5, Agent Co-Pilot Operating + Standard, Engineering Quick Reference, and Horizontal Engineering and + Codebase Stewardship Standard. +- Current-state commands: `rudi --version` reported `1.10.25`; + `npm view @learnrudi/cli version dist-tags --json` reported npm `latest` as + `1.10.12`; `git show origin/main:package.json` reported `1.10.25`; SHA-256 + comparison proved the installed `dist/index.cjs` exactly matched + `origin/main` before this release branch. +- Horizontal-pattern scan: package publishing is not duplicated in repository + automation; `.github/workflows/quality.yml` verifies packages but does not + publish them. The approved expansion adds the repository's single owned npm + publication mechanism rather than duplicating an existing path. +- Risks and invariants: npm versions are immutable; the published artifact must + correspond to one reviewed Git commit; `latest` must not move until all + package gates pass; no secrets may enter logs or artifacts; the installed + CLI must continue to resolve through the supported npm/Homebrew prefix. +- Initial risk tier and rationale: high, because npm publication and the new + OIDC release workflow are externally visible software-supply-chain changes. +- Exit criteria: clean release worktree at current `origin/main`, exact stale + registry state reproduced, release boundary and rollback documented. + +## Phase 1: Scope Lock + +- Status: complete, including the user-approved security/provenance expansion + on 2026-09-01. +- In scope: bump `@learnrudi/cli` from `1.10.25` to `1.10.26`; remediate the + production/bundled dependency advisories discovered during release review; + add one GitHub Actions OIDC trusted-publishing workflow with automatic npm + provenance; rebuild the tracked distribution; run repository-prescribed + quality gates; independently review the final diff and proof; publish through + a protected-branch pull request; publish the accepted `main` commit to npm; + verify `latest` and provenance; and reconcile the paired admin Mac if it is + safely reachable and clean enough. +- Non-goals: product features, Registry package updates, stack updates, daemon + changes, unrelated dependency modernization, or token-based npm automation. +- Expected files touched: `package.json`, `packages/core/package.json`, + `packages/db/package.json`, `packages/manifest/package.json`, + `pnpm-lock.yaml`, `dist/index.cjs`, `.debt-scan.json`, + `scripts/validate-publish-runtime.mjs`, + `src/__tests__/unit/quality-workflow-contract.test.js`, + `.github/workflows/publish-npm.yml`, and this checklist. +- External inputs and trust boundaries: npm registry metadata, npm auth state, + GitHub auth/PR state, remote CI results, and admin-Mac repository/runtime + state are untrusted until explicitly checked. +- Failure behavior to define: stop before publication on dirty or unexpected + diffs, failed tests/build/debt/package checks, npm version collision, missing + authentication, PR/CI rejection, or peer conflict. After npm publication, + never overwrite the immutable version; correct a bad `latest` tag, deprecate + the bad version, and issue a new patch release. +- Authorized external actions: the user approved the expanded dependency, + workflow, commit, push, PR, merge, npm configuration/publication, and + machine-update sequence on 2026-09-01. Direct pushes to protected `main` + remain prohibited; use a feature branch and PR. +- Commit strategy and authorization: one atomic release commit containing the + version, matching tracked bundle, and evidence checklist; push the release + branch and open a PR after local gates; merge only after required review and + CI; publish npm only from the accepted merged commit. +- Horizontal-obligation disposition: resolve in this change. Standardize npm + publication on `.github/workflows/publish-npm.yml`; no second release + implementation exists, and local token-based publication is not retained as + a shadow path. +- Review and approval gates: local full verification, fresh-context independent + Standards/Spec/Proof review, GitHub PR checks, protected-branch acceptance, + npm preflight, exact tarball inspection, and post-publish smoke verification. +- Exit criteria: only the named files are changed and all authority, rollback, + and promotion boundaries are explicit. + +## Phase 2: Red Tests + +- Status: complete. +- Observable behavior to prove: the packaged CLI reports `1.10.26`; the locked + production graph contains no known moderate-or-higher advisories; the release + workflow verifies the exact version, repeats the complete gate set, and + publishes only from `main` through OIDC without an npm token. +- Test file edited: + `src/__tests__/unit/quality-workflow-contract.test.js`. +- Red command 1: `pnpm audit --prod --audit-level=low --json` found five high + and three moderate advisories in `ajv@8.17.1`, `fast-uri@3.1.0`, + `yaml@2.8.2`, and `uuid@11.1.0`. +- Red command 2: `pnpm test -- + src/__tests__/unit/quality-workflow-contract.test.js` passed 3/5 and failed + because `.github/workflows/publish-npm.yml` did not exist and the dependency + floors were still vulnerable. A follow-up red assertion proved the + `fast-uri@3.1.6` override was absent while the stale lock resolution remained. +- Expected failure: missing workflow contract and vulnerable dependency floors + or lock resolutions must block release. +- Exit criteria: met; both red failures were behavioral and deterministic. + +## Phase 3: Implementation + +- Status: complete. The CLI version is `1.10.26`; secure minimum floors are + declared for Ajv, YAML, and UUID; `fast-uri@3.1.6` is enforced with a root + pnpm override because an ordinary Ajv update retained the vulnerable lock + entry; and the OIDC workflow is present and contract-tested. `pnpm build` + regenerated `dist/index.cjs` from these accepted sources. +- Implementation rules: make only release, dependency-remediation, and + provenance changes; use the repository build command; do not hand-edit + generated bundle contents; do not add or expose an npm token. +- Files allowed to change: the Phase 1 expected-file list only. +- Validation and error-handling requirements: reject any unexpected generated + diff or package contents; do not publish if `1.10.26` already exists. +- Observability requirements: preserve command results, artifact contents, + checksums, commit identity, PR/CI state, npm registry response, and smoke + versions in this checklist. +- Exit criteria: met. Source version and generated bundle agree on `1.10.26`; + resolved versions are `ajv@8.20.0`, `fast-uri@3.1.6`, `yaml@2.9.0`, and + `uuid@11.1.1`; workflow YAML parses successfully; no unrelated change exists. + +## Phase 4: Green Tests And Refactor + +- Status: complete for the expanded diff. +- Green command: `pnpm test -- + src/__tests__/unit/quality-workflow-contract.test.js` passed 6/6; `pnpm audit + --prod --audit-level=moderate` reported no known vulnerabilities. +- Refactor constraints: none; no refactor is authorized or required. +- Regression checks: compare generated output scope, run `git diff --check`, + and confirm the built CLI reports `1.10.26`. +- Commit checkpoint: create the single verified release commit only after Phase + 5 local gates pass. +- Results: `node dist/index.cjs --version` reported `rudi v1.10.26`; a 5,000 + level YAML nesting payload now fails as bounded `YAMLParseError`, not + `RangeError`; the generated bundle is reproducible across repeated builds. +- Exit criteria: met. Release metadata, dependency graph, workflow contract, + and bundle are consistent and focused checks pass unchanged. + +## Phase 5: Full Verification + +- Status: complete locally; local gates are green and focused independent + confirmation passed before the commit boundary. +- Targeted tests: built CLI `--version`, version-related unit tests, and package + allowlist/content inspection. +- Full suite: `pnpm test` passed 777/777 tests across 43 suites after the + expanded change. +- Build/typecheck/lint: `pnpm build`, reproducibility check against the tracked + bundle, `git diff --check`, and `npm pack --dry-run --json`. +- JS/TS debt scan: repository-prescribed debt runner and the installed + `stack:swe-engineering` debt scan against task-owned changes. +- Live smoke checks: install the exact packed artifact into an isolated + temporary prefix with lifecycle scripts disabled, run its CLI version/help, + then after publication install `@learnrudi/cli@1.10.26` and verify version and + basic read-only health commands. +- Independent review: fresh-context `rudi-code-review` verdicts for Standards, + Spec, and Proof, with all blocking findings resolved before promotion. +- Risk-tier approval: user authorization is recorded; protected-branch review + and CI plus npm trusted-publisher configuration are still required. +- Results: `pnpm build` passed twice and the before/after SHA-256 manifests for + all three generated files were identical; `git diff --check` passed; both + `node scripts/agent-debt-runner.mjs --changed-since origin/main --no-log` and + `stack:swe-engineering` `swe_debt_scan` reported zero findings. The latter + explicitly scanned the new runtime validator, workflow-contract test, and + bundle; adding the validator to the `pr-review` entrypoints resolved its only + initial orphan warning. +- Package proof: the secure candidate at + `/Users/hoff/.rudi/outputs/cli-releases/1.10.26-candidate-2/learnrudi-cli-1.10.26.tgz` + has SHA-256 + `d9162f44b6657df4e2fd47019bfd8da9a441585dc5adb5764e98c827d04d0159` + and exactly six allowlisted files (`LICENSE`, `README.md`, `dist/index.cjs`, + `dist/packages-manifest.json`, `dist/router-mcp.js`, `package.json`). Its + isolated `npm install --ignore-scripts` reports `rudi v1.10.26`, renders help, + and audits with zero vulnerabilities. The earlier + `/Users/hoff/.rudi/outputs/cli-releases/1.10.26/` candidate is obsolete and + must never be published. +- Vulnerability proof: `pnpm audit --prod --audit-level=moderate` reports no + known vulnerabilities across 101 production dependencies. +- Publication-path proof: the workflow packs one exact tarball into + `$RUNNER_TEMP`, verifies its six-file inventory and version, and publishes + that exact file with `npm publish ... --ignore-scripts`, preventing + `prepublishOnly` from rebuilding after verification. A local dry-run of this + exact path succeeded and left the verified `dist/index.cjs` hash unchanged. +- Independent review: the initial release-only review returned Standards + `revise`, Spec `pass`, Proof `revise`, Overall `revise`. Its provenance, + vulnerability, and evidence findings have been addressed in the expanded + implementation. A second fresh-context review found three promotion blockers: + npm `11.5.0` was incorrectly accepted, publication could rebuild after the + last verification, and the `main`-only guard lacked contract coverage. The + validator now rejects `11.5.0` and accepts `11.5.1`, publication uses the + verified tarball with lifecycle scripts disabled, and the guard is covered; + focused confirmation returned Standards `pass`, Spec `pass`, Proof `pass`, + Overall `pass`, with no remaining P0-P3 findings. +- Exit criteria: met locally. Post-PR CI remains the promotion gate. + +## Phase 6: Docs, Contracts, And Closure + +- Status: pending accepted commit, PR/CI, trusted-publisher configuration, + publication, peer reconciliation, and closeout. +- Docs or API contracts to update: this compliance/evidence record only; user + docs do not change because the install command and CLI behavior are unchanged. +- Final files touched before the release commit: `.debt-scan.json`, + `.github/workflows/publish-npm.yml`, `dist/index.cjs`, `package.json`, + `packages/core/package.json`, `packages/db/package.json`, + `packages/manifest/package.json`, `pnpm-lock.yaml`, + `scripts/validate-publish-runtime.mjs`, + `src/__tests__/unit/quality-workflow-contract.test.js`, and this checklist. +- Commands run and results: local version/build, focused tests, full tests, + reproducibility, diff checks, two debt scans, package dry-run/pack, isolated + package smoke, registry availability/auth preflight, and dependency audit are + recorded above. Commit, PR, CI, registry, and peer-update commands remain + pending. +- Evidence artifacts: pre-commit tarball inventory/checksum recorded above; + accepted commit, PR, CI, npm metadata/provenance, workstation/admin-Mac + versions, and worktree closeout receipt remain pending. +- Independent-review result: the two `revise` review rounds are recorded above; + focused confirmation closed every finding and returned Overall `pass`. +- Commit ledger and publication status: pending. +- Horizontal obligations opened, closed, or accepted: provenance-preserving + npm release automation is resolved in this change by one owned workflow; + closing proof is successful OIDC publication from accepted `main` with npm + provenance visible and no token configured in the repository. +- Final verdict: pending. +- Accepted debt: none approved. The existing transitive `prebuild-install` + deprecation warning is non-blocking but must remain visible. +- Proof gaps: accepted commit, PR/CI, npm trusted-publisher configuration, + registry attestation/signature, + post-publish smoke, admin-Mac reconciliation, and worktree closeout. +- Definition of Done: exact accepted Git commit is published as + `@learnrudi/cli@1.10.26`, npm `latest` resolves to it, local and paired-peer + smoke checks pass or a peer-specific blocker is recorded, and the release + worktree has a durable closeout receipt. diff --git a/package.json b/package.json index e915606..ce246d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@learnrudi/cli", - "version": "1.10.25", + "version": "1.10.26", "packageManager": "pnpm@10.22.0", "description": "RUDI CLI - Install and manage local MCP stacks, runtimes, daemon lifecycle, and agent router integrations", "type": "module", @@ -23,7 +23,7 @@ "test": "node scripts/run-tests.js" }, "dependencies": { - "ajv": "^8.17.1", + "ajv": "^8.18.0", "better-sqlite3": "^12.5.0" }, "devDependencies": { @@ -38,6 +38,11 @@ "esbuild": "^0.27.2", "typescript": "^5.9.3" }, + "pnpm": { + "overrides": { + "fast-uri": "3.1.6" + } + }, "engines": { "node": ">=18.0.0" }, diff --git a/packages/core/package.json b/packages/core/package.json index 5bfe96f..4098a4e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -26,7 +26,7 @@ "@learnrudi/env": "workspace:*", "@learnrudi/manifest": "workspace:*", "@learnrudi/registry-client": "workspace:*", - "yaml": "^2.3.4" + "yaml": "^2.8.3" }, "engines": { "node": ">=18.0.0" diff --git a/packages/db/package.json b/packages/db/package.json index ed8b0c8..d98ac4f 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -26,7 +26,7 @@ "@learnrudi/env": "^1.0.0", "better-sqlite3": "^12.5.0", "isomorphic-git": "^1.36.0", - "uuid": "^11.1.0" + "uuid": "^11.1.1" }, "devDependencies": {}, "engines": { diff --git a/packages/manifest/package.json b/packages/manifest/package.json index 3e82996..73514be 100644 --- a/packages/manifest/package.json +++ b/packages/manifest/package.json @@ -14,9 +14,9 @@ "test": "node ../../scripts/run-tests.js src/__tests__/" }, "dependencies": { - "ajv": "^8.12.0", + "ajv": "^8.18.0", "ajv-formats": "^3.0.1", - "yaml": "^2.3.4" + "yaml": "^2.8.3" }, "engines": { "node": ">=18.0.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8c1f522..9b3644f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,13 +4,16 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +overrides: + fast-uri: 3.1.6 + importers: .: dependencies: ajv: - specifier: ^8.17.1 - version: 8.17.1 + specifier: ^8.18.0 + version: 8.20.0 better-sqlite3: specifier: ^12.5.0 version: 12.5.0 @@ -58,8 +61,8 @@ importers: specifier: workspace:* version: link:../registry-client yaml: - specifier: ^2.3.4 - version: 2.8.2 + specifier: ^2.8.3 + version: 2.9.0 packages/db: dependencies: @@ -73,22 +76,22 @@ importers: specifier: ^1.36.0 version: 1.36.1 uuid: - specifier: ^11.1.0 - version: 11.1.0 + specifier: ^11.1.1 + version: 11.1.1 packages/env: {} packages/manifest: dependencies: ajv: - specifier: ^8.12.0 - version: 8.17.1 + specifier: ^8.18.0 + version: 8.20.0 ajv-formats: specifier: ^3.0.1 - version: 3.0.1(ajv@8.17.1) + version: 3.0.1(ajv@8.20.0) yaml: - specifier: ^2.3.4 - version: 2.8.2 + specifier: ^2.8.3 + version: 2.9.0 packages/mcp: {} @@ -296,8 +299,8 @@ packages: ajv: optional: true - ajv@8.17.1: - resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} + ajv@8.20.0: + resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} async-lock@1.4.1: resolution: {integrity: sha512-Az2ZTpuytrtqENulXwO3GGv1Bztugx6TT37NIo7imr/Qo0gsYiGtSdBa2B6fsXhTpVZDNfu1Qn3pk531e3q+nQ==} @@ -406,8 +409,8 @@ packages: fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - fast-uri@3.1.0: - resolution: {integrity: sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==} + fast-uri@3.1.6: + resolution: {integrity: sha512-7Ical1vFEMr0onbVzEDIreM22I4khW+fzyQPwvAFWBp1iwdshSZRsL4jjRvPG9JP1uiqMHRto+YU6R2/CzDz5Q==} file-uri-to-path@1.0.0: resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} @@ -607,8 +610,8 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - uuid@11.1.0: - resolution: {integrity: sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==} + uuid@11.1.1: + resolution: {integrity: sha512-vIYxrBCC/N/K+Js3qSN88go7kIfNPssr/hHCesKCQNAjmgvYS2oqr69kIufEG+O4+PfezOH4EbIeHCfFov8ZgQ==} hasBin: true which-typed-array@1.1.19: @@ -618,8 +621,8 @@ packages: wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - yaml@2.8.2: - resolution: {integrity: sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==} + yaml@2.9.0: + resolution: {integrity: sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==} engines: {node: '>= 14.6'} hasBin: true @@ -707,22 +710,22 @@ snapshots: '@learnrudi/manifest@1.0.0': dependencies: - ajv: 8.17.1 - ajv-formats: 3.0.1(ajv@8.17.1) - yaml: 2.8.2 + ajv: 8.20.0 + ajv-formats: 3.0.1(ajv@8.20.0) + yaml: 2.9.0 abort-controller@3.0.0: dependencies: event-target-shim: 5.0.1 - ajv-formats@3.0.1(ajv@8.17.1): + ajv-formats@3.0.1(ajv@8.20.0): optionalDependencies: - ajv: 8.17.1 + ajv: 8.20.0 - ajv@8.17.1: + ajv@8.20.0: dependencies: fast-deep-equal: 3.1.3 - fast-uri: 3.1.0 + fast-uri: 3.1.6 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 @@ -853,7 +856,7 @@ snapshots: fast-deep-equal@3.1.3: {} - fast-uri@3.1.0: {} + fast-uri@3.1.6: {} file-uri-to-path@1.0.0: {} @@ -1074,7 +1077,7 @@ snapshots: util-deprecate@1.0.2: {} - uuid@11.1.0: {} + uuid@11.1.1: {} which-typed-array@1.1.19: dependencies: @@ -1088,4 +1091,4 @@ snapshots: wrappy@1.0.2: {} - yaml@2.8.2: {} + yaml@2.9.0: {} diff --git a/scripts/validate-publish-runtime.mjs b/scripts/validate-publish-runtime.mjs new file mode 100644 index 0000000..05fe18e --- /dev/null +++ b/scripts/validate-publish-runtime.mjs @@ -0,0 +1,29 @@ +#!/usr/bin/env node + +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const MINIMUM_TRUSTED_PUBLISHING_NPM = [11, 5, 1]; + +export function supportsTrustedPublishingNpm(version) { + const match = /^(\d+)\.(\d+)\.(\d+)(?:[-+][0-9A-Za-z.-]+)?$/.exec(version); + if (!match) return false; + + const actual = match.slice(1, 4).map(Number); + for (let index = 0; index < MINIMUM_TRUSTED_PUBLISHING_NPM.length; index += 1) { + if (actual[index] > MINIMUM_TRUSTED_PUBLISHING_NPM[index]) return true; + if (actual[index] < MINIMUM_TRUSTED_PUBLISHING_NPM[index]) return false; + } + return true; +} + +export function assertTrustedPublishingNpm(version) { + if (!supportsTrustedPublishingNpm(version)) { + throw new Error(`npm ${version || ''} does not support trusted publishing; require >=11.5.1`); + } +} + +const invokedPath = process.argv[1] ? path.resolve(process.argv[1]) : ''; +if (invokedPath === fileURLToPath(import.meta.url)) { + assertTrustedPublishingNpm(process.argv[2] || ''); +} diff --git a/src/__tests__/unit/quality-workflow-contract.test.js b/src/__tests__/unit/quality-workflow-contract.test.js index 842ce2e..a9744f0 100644 --- a/src/__tests__/unit/quality-workflow-contract.test.js +++ b/src/__tests__/unit/quality-workflow-contract.test.js @@ -3,6 +3,7 @@ import fs from 'node:fs'; import path from 'node:path'; import test from 'node:test'; import { fileURLToPath } from 'node:url'; +import { supportsTrustedPublishingNpm } from '../../../scripts/validate-publish-runtime.mjs'; const TEST_DIR = path.dirname(fileURLToPath(import.meta.url)); const REPO_ROOT = path.resolve(TEST_DIR, '../../..'); @@ -29,6 +30,58 @@ test('GitHub quality workflow blocks unverified changes', () => { assert.match(workflow, /npm pack --dry-run/); }); +test('npm release workflow verifies the exact version and publishes through OIDC', () => { + const workflow = read('.github/workflows/publish-npm.yml'); + + assert.match(workflow, /^name: Publish npm$/m); + assert.match(workflow, /^\s{2}workflow_dispatch:$/m); + assert.match(workflow, /^\s{2}contents: read$/m); + assert.match(workflow, /^\s{2}id-token: write$/m); + assert.match(workflow, /^\s{4}name: publish$/m); + assert.match(workflow, /if: github\.ref == 'refs\/heads\/main'/); + assert.match(workflow, /actions\/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09/); + assert.match(workflow, /actions\/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38/); + assert.match(workflow, /node-version: ['"]24['"]/); + assert.match(workflow, /registry-url: ['"]https:\/\/registry\.npmjs\.org['"]/); + assert.match(workflow, /package-manager-cache: false/); + assert.match(workflow, /node scripts\/validate-publish-runtime\.mjs/); + assert.match(workflow, /pnpm install --frozen-lockfile/); + assert.match(workflow, /EXPECTED_VERSION/); + assert.match(workflow, /npm view @learnrudi\/cli versions --json/); + assert.match(workflow, /pnpm test/); + assert.match(workflow, /pnpm build/); + assert.match(workflow, /git diff --exit-code -- dist src\/packages-manifest\.json/); + assert.match(workflow, /node scripts\/agent-debt-runner\.mjs --changed-since/); + assert.match(workflow, /pnpm audit --prod --audit-level=moderate/); + assert.match(workflow, /npm pack --json --pack-destination/); + assert.match(workflow, /expectedFiles/); + assert.match(workflow, /npm publish "\$RUNNER_TEMP\/\$PACKAGE_TARBALL" --access public --ignore-scripts/); + assert.doesNotMatch(workflow, /NODE_AUTH_TOKEN|NPM_TOKEN/); +}); + +test('trusted-publishing npm gate enforces the complete minimum version', () => { + assert.equal(supportsTrustedPublishingNpm('11.4.99'), false); + assert.equal(supportsTrustedPublishingNpm('11.5.0'), false); + assert.equal(supportsTrustedPublishingNpm('11.5.1'), true); + assert.equal(supportsTrustedPublishingNpm('11.6.0'), true); + assert.equal(supportsTrustedPublishingNpm('12.0.0'), true); + assert.equal(supportsTrustedPublishingNpm('invalid'), false); +}); + +test('publishable workspace packages declare remediated dependency floors', () => { + const cliPackage = JSON.parse(read('package.json')); + const corePackage = JSON.parse(read('packages/core/package.json')); + const dbPackage = JSON.parse(read('packages/db/package.json')); + const manifestPackage = JSON.parse(read('packages/manifest/package.json')); + + assert.equal(cliPackage.dependencies.ajv, '^8.18.0'); + assert.equal(cliPackage.pnpm.overrides['fast-uri'], '3.1.6'); + assert.equal(corePackage.dependencies.yaml, '^2.8.3'); + assert.equal(dbPackage.dependencies.uuid, '^11.1.1'); + assert.equal(manifestPackage.dependencies.ajv, '^8.18.0'); + assert.equal(manifestPackage.dependencies.yaml, '^2.8.3'); +}); + test('debt scan is portable outside the developer workstation', () => { const runner = read('scripts/agent-debt-runner.mjs'); const scannerPath = path.join(REPO_ROOT, 'scripts/agent-debt-scan.cjs');