From f2435471afa1c6f9abe0b272642a2cac88f3c643 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Fri, 6 Mar 2026 08:11:55 -0600 Subject: [PATCH 1/8] feat(MQ-001): initialize pnpm workspace with strict TS lint and vitest --- .gitignore | 7 + eslint.config.mjs | 32 + package.json | 18 + packages/queue/package.json | 16 + packages/queue/src/index.ts | 1 + packages/queue/tests/smoke.test.ts | 9 + packages/queue/tsconfig.build.json | 10 + packages/queue/tsconfig.json | 8 + packages/queue/vitest.config.ts | 8 + pnpm-lock.yaml | 1854 ++++++++++++++++++++++++++++ pnpm-workspace.yaml | 2 + tsconfig.base.json | 19 + 12 files changed, 1984 insertions(+) create mode 100644 .gitignore create mode 100644 eslint.config.mjs create mode 100644 package.json create mode 100644 packages/queue/package.json create mode 100644 packages/queue/src/index.ts create mode 100644 packages/queue/tests/smoke.test.ts create mode 100644 packages/queue/tsconfig.build.json create mode 100644 packages/queue/tsconfig.json create mode 100644 packages/queue/vitest.config.ts create mode 100644 pnpm-lock.yaml create mode 100644 pnpm-workspace.yaml create mode 100644 tsconfig.base.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4e8b778 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +node_modules +.pnpm-store +coverage +*.log +.env +.env.* +packages/*/dist diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..9582696 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,32 @@ +import tseslintPlugin from '@typescript-eslint/eslint-plugin'; +import tseslintParser from '@typescript-eslint/parser'; + +export default [ + { + ignores: ['**/dist/**', '**/node_modules/**', '**/coverage/**'], + }, + { + files: ['**/*.ts'], + languageOptions: { + parser: tseslintParser, + parserOptions: { + projectService: true, + tsconfigRootDir: import.meta.dirname, + }, + }, + plugins: { + '@typescript-eslint': tseslintPlugin, + }, + rules: { + ...tseslintPlugin.configs['recommended-type-checked'].rules, + ...tseslintPlugin.configs['stylistic-type-checked'].rules, + '@typescript-eslint/consistent-type-imports': [ + 'error', + { + prefer: 'type-imports', + }, + ], + '@typescript-eslint/no-floating-promises': 'error', + }, + }, +]; diff --git a/package.json b/package.json new file mode 100644 index 0000000..e77572d --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "name": "mosaic-queue-workspace", + "private": true, + "packageManager": "pnpm@10.6.2", + "scripts": { + "lint": "pnpm -r --if-present lint", + "build": "pnpm -r --if-present build", + "test": "pnpm -r --if-present test" + }, + "devDependencies": { + "@types/node": "^22.13.10", + "@typescript-eslint/eslint-plugin": "^8.27.0", + "@typescript-eslint/parser": "^8.27.0", + "eslint": "^9.22.0", + "typescript": "^5.8.2", + "vitest": "^3.0.8" + } +} diff --git a/packages/queue/package.json b/packages/queue/package.json new file mode 100644 index 0000000..1790fc7 --- /dev/null +++ b/packages/queue/package.json @@ -0,0 +1,16 @@ +{ + "name": "@mosaic/queue", + "version": "0.0.1", + "description": "Valkey-backed task queue exposed via CLI and MCP", + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "dist" + ], + "scripts": { + "lint": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" \"vitest.config.ts\"", + "build": "tsc -p tsconfig.build.json", + "test": "vitest run" + } +} diff --git a/packages/queue/src/index.ts b/packages/queue/src/index.ts new file mode 100644 index 0000000..382b256 --- /dev/null +++ b/packages/queue/src/index.ts @@ -0,0 +1 @@ +export const packageVersion = '0.0.1'; diff --git a/packages/queue/tests/smoke.test.ts b/packages/queue/tests/smoke.test.ts new file mode 100644 index 0000000..23b00d0 --- /dev/null +++ b/packages/queue/tests/smoke.test.ts @@ -0,0 +1,9 @@ +import { describe, expect, it } from 'vitest'; + +import { packageVersion } from '../src/index.js'; + +describe('package bootstrap', () => { + it('exposes package version constant', () => { + expect(packageVersion).toBe('0.0.1'); + }); +}); diff --git a/packages/queue/tsconfig.build.json b/packages/queue/tsconfig.build.json new file mode 100644 index 0000000..9cbb17c --- /dev/null +++ b/packages/queue/tsconfig.build.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "rootDir": "src", + "outDir": "dist" + }, + "include": ["src/**/*.ts"], + "exclude": ["tests/**/*"] +} diff --git a/packages/queue/tsconfig.json b/packages/queue/tsconfig.json new file mode 100644 index 0000000..1c3e279 --- /dev/null +++ b/packages/queue/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "noEmit": true, + "rootDir": "." + }, + "include": ["src/**/*.ts", "tests/**/*.ts", "vitest.config.ts"] +} diff --git a/packages/queue/vitest.config.ts b/packages/queue/vitest.config.ts new file mode 100644 index 0000000..8363e16 --- /dev/null +++ b/packages/queue/vitest.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + environment: 'node', + include: ['tests/**/*.test.ts'], + }, +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..103c155 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,1854 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@types/node': + specifier: ^22.13.10 + version: 22.19.15 + '@typescript-eslint/eslint-plugin': + specifier: ^8.27.0 + version: 8.56.1(@typescript-eslint/parser@8.56.1(eslint@9.39.3)(typescript@5.9.3))(eslint@9.39.3)(typescript@5.9.3) + '@typescript-eslint/parser': + specifier: ^8.27.0 + version: 8.56.1(eslint@9.39.3)(typescript@5.9.3) + eslint: + specifier: ^9.22.0 + version: 9.39.3 + typescript: + specifier: ^5.8.2 + version: 5.9.3 + vitest: + specifier: ^3.0.8 + version: 3.2.4(@types/node@22.19.15) + + packages/queue: {} + +packages: + + '@esbuild/aix-ppc64@0.27.3': + resolution: {integrity: sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + + '@esbuild/android-arm64@0.27.3': + resolution: {integrity: sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.27.3': + resolution: {integrity: sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.27.3': + resolution: {integrity: sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.27.3': + resolution: {integrity: sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.27.3': + resolution: {integrity: sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.27.3': + resolution: {integrity: sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.27.3': + resolution: {integrity: sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.27.3': + resolution: {integrity: sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.27.3': + resolution: {integrity: sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.27.3': + resolution: {integrity: sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.27.3': + resolution: {integrity: sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.27.3': + resolution: {integrity: sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.27.3': + resolution: {integrity: sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.27.3': + resolution: {integrity: sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.27.3': + resolution: {integrity: sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.27.3': + resolution: {integrity: sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-arm64@0.27.3': + resolution: {integrity: sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + + '@esbuild/netbsd-x64@0.27.3': + resolution: {integrity: sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-arm64@0.27.3': + resolution: {integrity: sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + + '@esbuild/openbsd-x64@0.27.3': + resolution: {integrity: sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + + '@esbuild/openharmony-arm64@0.27.3': + resolution: {integrity: sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openharmony] + + '@esbuild/sunos-x64@0.27.3': + resolution: {integrity: sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.27.3': + resolution: {integrity: sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.27.3': + resolution: {integrity: sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.27.3': + resolution: {integrity: sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + + '@eslint-community/eslint-utils@4.9.1': + resolution: {integrity: sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + + '@eslint-community/regexpp@4.12.2': + resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + + '@eslint/config-array@0.21.1': + resolution: {integrity: sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/config-helpers@0.4.2': + resolution: {integrity: sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/core@0.17.0': + resolution: {integrity: sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/eslintrc@3.3.4': + resolution: {integrity: sha512-4h4MVF8pmBsncB60r0wSJiIeUKTSD4m7FmTFThG8RHlsg9ajqckLm9OraguFGZE4vVdpiI1Q4+hFnisopmG6gQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/js@9.39.3': + resolution: {integrity: sha512-1B1VkCq6FuUNlQvlBYb+1jDu/gV297TIs/OeiaSR9l1H27SVW55ONE1e1Vp16NqP683+xEGzxYtv4XCiDPaQiw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/object-schema@2.1.7': + resolution: {integrity: sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/plugin-kit@0.4.1': + resolution: {integrity: sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@humanfs/core@0.19.1': + resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} + engines: {node: '>=18.18.0'} + + '@humanfs/node@0.16.7': + resolution: {integrity: sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==} + engines: {node: '>=18.18.0'} + + '@humanwhocodes/module-importer@1.0.1': + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + + '@humanwhocodes/retry@0.4.3': + resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} + engines: {node: '>=18.18'} + + '@jridgewell/sourcemap-codec@1.5.5': + resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} + + '@rollup/rollup-android-arm-eabi@4.59.0': + resolution: {integrity: sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg==} + cpu: [arm] + os: [android] + + '@rollup/rollup-android-arm64@4.59.0': + resolution: {integrity: sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q==} + cpu: [arm64] + os: [android] + + '@rollup/rollup-darwin-arm64@4.59.0': + resolution: {integrity: sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg==} + cpu: [arm64] + os: [darwin] + + '@rollup/rollup-darwin-x64@4.59.0': + resolution: {integrity: sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w==} + cpu: [x64] + os: [darwin] + + '@rollup/rollup-freebsd-arm64@4.59.0': + resolution: {integrity: sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA==} + cpu: [arm64] + os: [freebsd] + + '@rollup/rollup-freebsd-x64@4.59.0': + resolution: {integrity: sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg==} + cpu: [x64] + os: [freebsd] + + '@rollup/rollup-linux-arm-gnueabihf@4.59.0': + resolution: {integrity: sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm-musleabihf@4.59.0': + resolution: {integrity: sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm64-gnu@4.59.0': + resolution: {integrity: sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-arm64-musl@4.59.0': + resolution: {integrity: sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-loong64-gnu@4.59.0': + resolution: {integrity: sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg==} + cpu: [loong64] + os: [linux] + + '@rollup/rollup-linux-loong64-musl@4.59.0': + resolution: {integrity: sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q==} + cpu: [loong64] + os: [linux] + + '@rollup/rollup-linux-ppc64-gnu@4.59.0': + resolution: {integrity: sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA==} + cpu: [ppc64] + os: [linux] + + '@rollup/rollup-linux-ppc64-musl@4.59.0': + resolution: {integrity: sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA==} + cpu: [ppc64] + os: [linux] + + '@rollup/rollup-linux-riscv64-gnu@4.59.0': + resolution: {integrity: sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg==} + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-riscv64-musl@4.59.0': + resolution: {integrity: sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg==} + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-s390x-gnu@4.59.0': + resolution: {integrity: sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w==} + cpu: [s390x] + os: [linux] + + '@rollup/rollup-linux-x64-gnu@4.59.0': + resolution: {integrity: sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-linux-x64-musl@4.59.0': + resolution: {integrity: sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-openbsd-x64@4.59.0': + resolution: {integrity: sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ==} + cpu: [x64] + os: [openbsd] + + '@rollup/rollup-openharmony-arm64@4.59.0': + resolution: {integrity: sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA==} + cpu: [arm64] + os: [openharmony] + + '@rollup/rollup-win32-arm64-msvc@4.59.0': + resolution: {integrity: sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A==} + cpu: [arm64] + os: [win32] + + '@rollup/rollup-win32-ia32-msvc@4.59.0': + resolution: {integrity: sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA==} + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-gnu@4.59.0': + resolution: {integrity: sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA==} + cpu: [x64] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.59.0': + resolution: {integrity: sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA==} + cpu: [x64] + os: [win32] + + '@types/chai@5.2.3': + resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} + + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + + '@types/estree@1.0.8': + resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} + + '@types/json-schema@7.0.15': + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + + '@types/node@22.19.15': + resolution: {integrity: sha512-F0R/h2+dsy5wJAUe3tAU6oqa2qbWY5TpNfL/RGmo1y38hiyO1w3x2jPtt76wmuaJI4DQnOBu21cNXQ2STIUUWg==} + + '@typescript-eslint/eslint-plugin@8.56.1': + resolution: {integrity: sha512-Jz9ZztpB37dNC+HU2HI28Bs9QXpzCz+y/twHOwhyrIRdbuVDxSytJNDl6z/aAKlaRIwC7y8wJdkBv7FxYGgi0A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + '@typescript-eslint/parser': ^8.56.1 + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.0.0' + + '@typescript-eslint/parser@8.56.1': + resolution: {integrity: sha512-klQbnPAAiGYFyI02+znpBRLyjL4/BrBd0nyWkdC0s/6xFLkXYQ8OoRrSkqacS1ddVxf/LDyODIKbQ5TgKAf/Fg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.0.0' + + '@typescript-eslint/project-service@8.56.1': + resolution: {integrity: sha512-TAdqQTzHNNvlVFfR+hu2PDJrURiwKsUvxFn1M0h95BB8ah5jejas08jUWG4dBA68jDMI988IvtfdAI53JzEHOQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.0.0' + + '@typescript-eslint/scope-manager@8.56.1': + resolution: {integrity: sha512-YAi4VDKcIZp0O4tz/haYKhmIDZFEUPOreKbfdAN3SzUDMcPhJ8QI99xQXqX+HoUVq8cs85eRKnD+rne2UAnj2w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/tsconfig-utils@8.56.1': + resolution: {integrity: sha512-qOtCYzKEeyr3aR9f28mPJqBty7+DBqsdd63eO0yyDwc6vgThj2UjWfJIcsFeSucYydqcuudMOprZ+x1SpF3ZuQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.0.0' + + '@typescript-eslint/type-utils@8.56.1': + resolution: {integrity: sha512-yB/7dxi7MgTtGhZdaHCemf7PuwrHMenHjmzgUW1aJpO+bBU43OycnM3Wn+DdvDO/8zzA9HlhaJ0AUGuvri4oGg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.0.0' + + '@typescript-eslint/types@8.56.1': + resolution: {integrity: sha512-dbMkdIUkIkchgGDIv7KLUpa0Mda4IYjo4IAMJUZ+3xNoUXxMsk9YtKpTHSChRS85o+H9ftm51gsK1dZReY9CVw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/typescript-estree@8.56.1': + resolution: {integrity: sha512-qzUL1qgalIvKWAf9C1HpvBjif+Vm6rcT5wZd4VoMb9+Km3iS3Cv9DY6dMRMDtPnwRAFyAi7YXJpTIEXLvdfPxg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.0.0' + + '@typescript-eslint/utils@8.56.1': + resolution: {integrity: sha512-HPAVNIME3tABJ61siYlHzSWCGtOoeP2RTIaHXFMPqjrQKCGB9OgUVdiNgH7TJS2JNIQ5qQ4RsAUDuGaGme/KOA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 + typescript: '>=4.8.4 <6.0.0' + + '@typescript-eslint/visitor-keys@8.56.1': + resolution: {integrity: sha512-KiROIzYdEV85YygXw6BI/Dx4fnBlFQu6Mq4QE4MOH9fFnhohw6wX/OAvDY2/C+ut0I3RSPKenvZJIVYqJNkhEw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@vitest/expect@3.2.4': + resolution: {integrity: sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==} + + '@vitest/mocker@3.2.4': + resolution: {integrity: sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==} + peerDependencies: + msw: ^2.4.9 + vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + + '@vitest/pretty-format@3.2.4': + resolution: {integrity: sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==} + + '@vitest/runner@3.2.4': + resolution: {integrity: sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==} + + '@vitest/snapshot@3.2.4': + resolution: {integrity: sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==} + + '@vitest/spy@3.2.4': + resolution: {integrity: sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==} + + '@vitest/utils@3.2.4': + resolution: {integrity: sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==} + + acorn-jsx@5.3.2: + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + + acorn@8.16.0: + resolution: {integrity: sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==} + engines: {node: '>=0.4.0'} + hasBin: true + + ajv@6.14.0: + resolution: {integrity: sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==} + + ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + + argparse@2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} + + balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + + balanced-match@4.0.4: + resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} + engines: {node: 18 || 20 || >=22} + + brace-expansion@1.1.12: + resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==} + + brace-expansion@5.0.4: + resolution: {integrity: sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==} + engines: {node: 18 || 20 || >=22} + + cac@6.7.14: + resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} + engines: {node: '>=8'} + + callsites@3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + + chai@5.3.3: + resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} + engines: {node: '>=18'} + + chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + + check-error@2.1.3: + resolution: {integrity: sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==} + engines: {node: '>= 16'} + + color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + + color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + + concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} + engines: {node: '>= 8'} + + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + deep-eql@5.0.2: + resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} + engines: {node: '>=6'} + + deep-is@0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + + es-module-lexer@1.7.0: + resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} + + esbuild@0.27.3: + resolution: {integrity: sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==} + engines: {node: '>=18'} + hasBin: true + + escape-string-regexp@4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + + eslint-scope@8.4.0: + resolution: {integrity: sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + eslint-visitor-keys@4.2.1: + resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + eslint-visitor-keys@5.0.1: + resolution: {integrity: sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + + eslint@9.39.3: + resolution: {integrity: sha512-VmQ+sifHUbI/IcSopBCF/HO3YiHQx/AVd3UVyYL6weuwW+HvON9VYn5l6Zl1WZzPWXPNZrSQpxwkkZ/VuvJZzg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + hasBin: true + peerDependencies: + jiti: '*' + peerDependenciesMeta: + jiti: + optional: true + + espree@10.4.0: + resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + esquery@1.7.0: + resolution: {integrity: sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==} + engines: {node: '>=0.10'} + + esrecurse@4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + + estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + + estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + + esutils@2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + + expect-type@1.3.0: + resolution: {integrity: sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==} + engines: {node: '>=12.0.0'} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-json-stable-stringify@2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + + fast-levenshtein@2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + + file-entry-cache@8.0.0: + resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} + engines: {node: '>=16.0.0'} + + find-up@5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + + flat-cache@4.0.1: + resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} + engines: {node: '>=16'} + + flatted@3.3.4: + resolution: {integrity: sha512-3+mMldrTAPdta5kjX2G2J7iX4zxtnwpdA8Tr2ZSjkyPSanvbZAcy6flmtnXbEybHrDcU9641lxrMfFuUxVz9vA==} + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + glob-parent@6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + + globals@14.0.0: + resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} + engines: {node: '>=18'} + + has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + + ignore@5.3.2: + resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} + engines: {node: '>= 4'} + + ignore@7.0.5: + resolution: {integrity: sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==} + engines: {node: '>= 4'} + + import-fresh@3.3.1: + resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} + engines: {node: '>=6'} + + imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + + is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + + is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + + isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + + js-tokens@9.0.1: + resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} + + js-yaml@4.1.1: + resolution: {integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==} + hasBin: true + + json-buffer@3.0.1: + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + + json-schema-traverse@0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + + json-stable-stringify-without-jsonify@1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + + keyv@4.5.4: + resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + + levn@0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} + + locate-path@6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + + lodash.merge@4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + + loupe@3.2.1: + resolution: {integrity: sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==} + + magic-string@0.30.21: + resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + + minimatch@10.2.4: + resolution: {integrity: sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==} + engines: {node: 18 || 20 || >=22} + + minimatch@3.1.5: + resolution: {integrity: sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==} + + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + + nanoid@3.3.11: + resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + + optionator@0.9.4: + resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} + engines: {node: '>= 0.8.0'} + + p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + + p-locate@5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + + parent-module@1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} + + path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + + path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + + pathe@2.0.3: + resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + + pathval@2.0.1: + resolution: {integrity: sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==} + engines: {node: '>= 14.16'} + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@4.0.3: + resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} + engines: {node: '>=12'} + + postcss@8.5.8: + resolution: {integrity: sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==} + engines: {node: ^10 || ^12 || >=14} + + prelude-ls@1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + + punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + + resolve-from@4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + + rollup@4.59.0: + resolution: {integrity: sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + + semver@7.7.4: + resolution: {integrity: sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==} + engines: {node: '>=10'} + hasBin: true + + shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + + shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + + siginfo@2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + + stackback@0.0.2: + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + + std-env@3.10.0: + resolution: {integrity: sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==} + + strip-json-comments@3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + + strip-literal@3.1.0: + resolution: {integrity: sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==} + + supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + + tinybench@2.9.0: + resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} + + tinyexec@0.3.2: + resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} + + tinyglobby@0.2.15: + resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} + engines: {node: '>=12.0.0'} + + tinypool@1.1.1: + resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==} + engines: {node: ^18.0.0 || >=20.0.0} + + tinyrainbow@2.0.0: + resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} + engines: {node: '>=14.0.0'} + + tinyspy@4.0.4: + resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==} + engines: {node: '>=14.0.0'} + + ts-api-utils@2.4.0: + resolution: {integrity: sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA==} + engines: {node: '>=18.12'} + peerDependencies: + typescript: '>=4.8.4' + + type-check@0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + engines: {node: '>=14.17'} + hasBin: true + + undici-types@6.21.0: + resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} + + uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + + vite-node@3.2.4: + resolution: {integrity: sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + + vite@7.3.1: + resolution: {integrity: sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + jiti: '>=1.21.0' + less: ^4.0.0 + lightningcss: ^1.21.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + jiti: + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + vitest@3.2.4: + resolution: {integrity: sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@types/debug': ^4.1.12 + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + '@vitest/browser': 3.2.4 + '@vitest/ui': 3.2.4 + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@types/debug': + optional: true + '@types/node': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + + which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + + why-is-node-running@2.3.0: + resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} + engines: {node: '>=8'} + hasBin: true + + word-wrap@1.2.5: + resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} + engines: {node: '>=0.10.0'} + + yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + +snapshots: + + '@esbuild/aix-ppc64@0.27.3': + optional: true + + '@esbuild/android-arm64@0.27.3': + optional: true + + '@esbuild/android-arm@0.27.3': + optional: true + + '@esbuild/android-x64@0.27.3': + optional: true + + '@esbuild/darwin-arm64@0.27.3': + optional: true + + '@esbuild/darwin-x64@0.27.3': + optional: true + + '@esbuild/freebsd-arm64@0.27.3': + optional: true + + '@esbuild/freebsd-x64@0.27.3': + optional: true + + '@esbuild/linux-arm64@0.27.3': + optional: true + + '@esbuild/linux-arm@0.27.3': + optional: true + + '@esbuild/linux-ia32@0.27.3': + optional: true + + '@esbuild/linux-loong64@0.27.3': + optional: true + + '@esbuild/linux-mips64el@0.27.3': + optional: true + + '@esbuild/linux-ppc64@0.27.3': + optional: true + + '@esbuild/linux-riscv64@0.27.3': + optional: true + + '@esbuild/linux-s390x@0.27.3': + optional: true + + '@esbuild/linux-x64@0.27.3': + optional: true + + '@esbuild/netbsd-arm64@0.27.3': + optional: true + + '@esbuild/netbsd-x64@0.27.3': + optional: true + + '@esbuild/openbsd-arm64@0.27.3': + optional: true + + '@esbuild/openbsd-x64@0.27.3': + optional: true + + '@esbuild/openharmony-arm64@0.27.3': + optional: true + + '@esbuild/sunos-x64@0.27.3': + optional: true + + '@esbuild/win32-arm64@0.27.3': + optional: true + + '@esbuild/win32-ia32@0.27.3': + optional: true + + '@esbuild/win32-x64@0.27.3': + optional: true + + '@eslint-community/eslint-utils@4.9.1(eslint@9.39.3)': + dependencies: + eslint: 9.39.3 + eslint-visitor-keys: 3.4.3 + + '@eslint-community/regexpp@4.12.2': {} + + '@eslint/config-array@0.21.1': + dependencies: + '@eslint/object-schema': 2.1.7 + debug: 4.4.3 + minimatch: 3.1.5 + transitivePeerDependencies: + - supports-color + + '@eslint/config-helpers@0.4.2': + dependencies: + '@eslint/core': 0.17.0 + + '@eslint/core@0.17.0': + dependencies: + '@types/json-schema': 7.0.15 + + '@eslint/eslintrc@3.3.4': + dependencies: + ajv: 6.14.0 + debug: 4.4.3 + espree: 10.4.0 + globals: 14.0.0 + ignore: 5.3.2 + import-fresh: 3.3.1 + js-yaml: 4.1.1 + minimatch: 3.1.5 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + + '@eslint/js@9.39.3': {} + + '@eslint/object-schema@2.1.7': {} + + '@eslint/plugin-kit@0.4.1': + dependencies: + '@eslint/core': 0.17.0 + levn: 0.4.1 + + '@humanfs/core@0.19.1': {} + + '@humanfs/node@0.16.7': + dependencies: + '@humanfs/core': 0.19.1 + '@humanwhocodes/retry': 0.4.3 + + '@humanwhocodes/module-importer@1.0.1': {} + + '@humanwhocodes/retry@0.4.3': {} + + '@jridgewell/sourcemap-codec@1.5.5': {} + + '@rollup/rollup-android-arm-eabi@4.59.0': + optional: true + + '@rollup/rollup-android-arm64@4.59.0': + optional: true + + '@rollup/rollup-darwin-arm64@4.59.0': + optional: true + + '@rollup/rollup-darwin-x64@4.59.0': + optional: true + + '@rollup/rollup-freebsd-arm64@4.59.0': + optional: true + + '@rollup/rollup-freebsd-x64@4.59.0': + optional: true + + '@rollup/rollup-linux-arm-gnueabihf@4.59.0': + optional: true + + '@rollup/rollup-linux-arm-musleabihf@4.59.0': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.59.0': + optional: true + + '@rollup/rollup-linux-arm64-musl@4.59.0': + optional: true + + '@rollup/rollup-linux-loong64-gnu@4.59.0': + optional: true + + '@rollup/rollup-linux-loong64-musl@4.59.0': + optional: true + + '@rollup/rollup-linux-ppc64-gnu@4.59.0': + optional: true + + '@rollup/rollup-linux-ppc64-musl@4.59.0': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.59.0': + optional: true + + '@rollup/rollup-linux-riscv64-musl@4.59.0': + optional: true + + '@rollup/rollup-linux-s390x-gnu@4.59.0': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.59.0': + optional: true + + '@rollup/rollup-linux-x64-musl@4.59.0': + optional: true + + '@rollup/rollup-openbsd-x64@4.59.0': + optional: true + + '@rollup/rollup-openharmony-arm64@4.59.0': + optional: true + + '@rollup/rollup-win32-arm64-msvc@4.59.0': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.59.0': + optional: true + + '@rollup/rollup-win32-x64-gnu@4.59.0': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.59.0': + optional: true + + '@types/chai@5.2.3': + dependencies: + '@types/deep-eql': 4.0.2 + assertion-error: 2.0.1 + + '@types/deep-eql@4.0.2': {} + + '@types/estree@1.0.8': {} + + '@types/json-schema@7.0.15': {} + + '@types/node@22.19.15': + dependencies: + undici-types: 6.21.0 + + '@typescript-eslint/eslint-plugin@8.56.1(@typescript-eslint/parser@8.56.1(eslint@9.39.3)(typescript@5.9.3))(eslint@9.39.3)(typescript@5.9.3)': + dependencies: + '@eslint-community/regexpp': 4.12.2 + '@typescript-eslint/parser': 8.56.1(eslint@9.39.3)(typescript@5.9.3) + '@typescript-eslint/scope-manager': 8.56.1 + '@typescript-eslint/type-utils': 8.56.1(eslint@9.39.3)(typescript@5.9.3) + '@typescript-eslint/utils': 8.56.1(eslint@9.39.3)(typescript@5.9.3) + '@typescript-eslint/visitor-keys': 8.56.1 + eslint: 9.39.3 + ignore: 7.0.5 + natural-compare: 1.4.0 + ts-api-utils: 2.4.0(typescript@5.9.3) + typescript: 5.9.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/parser@8.56.1(eslint@9.39.3)(typescript@5.9.3)': + dependencies: + '@typescript-eslint/scope-manager': 8.56.1 + '@typescript-eslint/types': 8.56.1 + '@typescript-eslint/typescript-estree': 8.56.1(typescript@5.9.3) + '@typescript-eslint/visitor-keys': 8.56.1 + debug: 4.4.3 + eslint: 9.39.3 + typescript: 5.9.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/project-service@8.56.1(typescript@5.9.3)': + dependencies: + '@typescript-eslint/tsconfig-utils': 8.56.1(typescript@5.9.3) + '@typescript-eslint/types': 8.56.1 + debug: 4.4.3 + typescript: 5.9.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/scope-manager@8.56.1': + dependencies: + '@typescript-eslint/types': 8.56.1 + '@typescript-eslint/visitor-keys': 8.56.1 + + '@typescript-eslint/tsconfig-utils@8.56.1(typescript@5.9.3)': + dependencies: + typescript: 5.9.3 + + '@typescript-eslint/type-utils@8.56.1(eslint@9.39.3)(typescript@5.9.3)': + dependencies: + '@typescript-eslint/types': 8.56.1 + '@typescript-eslint/typescript-estree': 8.56.1(typescript@5.9.3) + '@typescript-eslint/utils': 8.56.1(eslint@9.39.3)(typescript@5.9.3) + debug: 4.4.3 + eslint: 9.39.3 + ts-api-utils: 2.4.0(typescript@5.9.3) + typescript: 5.9.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/types@8.56.1': {} + + '@typescript-eslint/typescript-estree@8.56.1(typescript@5.9.3)': + dependencies: + '@typescript-eslint/project-service': 8.56.1(typescript@5.9.3) + '@typescript-eslint/tsconfig-utils': 8.56.1(typescript@5.9.3) + '@typescript-eslint/types': 8.56.1 + '@typescript-eslint/visitor-keys': 8.56.1 + debug: 4.4.3 + minimatch: 10.2.4 + semver: 7.7.4 + tinyglobby: 0.2.15 + ts-api-utils: 2.4.0(typescript@5.9.3) + typescript: 5.9.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/utils@8.56.1(eslint@9.39.3)(typescript@5.9.3)': + dependencies: + '@eslint-community/eslint-utils': 4.9.1(eslint@9.39.3) + '@typescript-eslint/scope-manager': 8.56.1 + '@typescript-eslint/types': 8.56.1 + '@typescript-eslint/typescript-estree': 8.56.1(typescript@5.9.3) + eslint: 9.39.3 + typescript: 5.9.3 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/visitor-keys@8.56.1': + dependencies: + '@typescript-eslint/types': 8.56.1 + eslint-visitor-keys: 5.0.1 + + '@vitest/expect@3.2.4': + dependencies: + '@types/chai': 5.2.3 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 + chai: 5.3.3 + tinyrainbow: 2.0.0 + + '@vitest/mocker@3.2.4(vite@7.3.1(@types/node@22.19.15))': + dependencies: + '@vitest/spy': 3.2.4 + estree-walker: 3.0.3 + magic-string: 0.30.21 + optionalDependencies: + vite: 7.3.1(@types/node@22.19.15) + + '@vitest/pretty-format@3.2.4': + dependencies: + tinyrainbow: 2.0.0 + + '@vitest/runner@3.2.4': + dependencies: + '@vitest/utils': 3.2.4 + pathe: 2.0.3 + strip-literal: 3.1.0 + + '@vitest/snapshot@3.2.4': + dependencies: + '@vitest/pretty-format': 3.2.4 + magic-string: 0.30.21 + pathe: 2.0.3 + + '@vitest/spy@3.2.4': + dependencies: + tinyspy: 4.0.4 + + '@vitest/utils@3.2.4': + dependencies: + '@vitest/pretty-format': 3.2.4 + loupe: 3.2.1 + tinyrainbow: 2.0.0 + + acorn-jsx@5.3.2(acorn@8.16.0): + dependencies: + acorn: 8.16.0 + + acorn@8.16.0: {} + + ajv@6.14.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + + ansi-styles@4.3.0: + dependencies: + color-convert: 2.0.1 + + argparse@2.0.1: {} + + assertion-error@2.0.1: {} + + balanced-match@1.0.2: {} + + balanced-match@4.0.4: {} + + brace-expansion@1.1.12: + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + + brace-expansion@5.0.4: + dependencies: + balanced-match: 4.0.4 + + cac@6.7.14: {} + + callsites@3.1.0: {} + + chai@5.3.3: + dependencies: + assertion-error: 2.0.1 + check-error: 2.1.3 + deep-eql: 5.0.2 + loupe: 3.2.1 + pathval: 2.0.1 + + chalk@4.1.2: + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + + check-error@2.1.3: {} + + color-convert@2.0.1: + dependencies: + color-name: 1.1.4 + + color-name@1.1.4: {} + + concat-map@0.0.1: {} + + cross-spawn@7.0.6: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + + debug@4.4.3: + dependencies: + ms: 2.1.3 + + deep-eql@5.0.2: {} + + deep-is@0.1.4: {} + + es-module-lexer@1.7.0: {} + + esbuild@0.27.3: + optionalDependencies: + '@esbuild/aix-ppc64': 0.27.3 + '@esbuild/android-arm': 0.27.3 + '@esbuild/android-arm64': 0.27.3 + '@esbuild/android-x64': 0.27.3 + '@esbuild/darwin-arm64': 0.27.3 + '@esbuild/darwin-x64': 0.27.3 + '@esbuild/freebsd-arm64': 0.27.3 + '@esbuild/freebsd-x64': 0.27.3 + '@esbuild/linux-arm': 0.27.3 + '@esbuild/linux-arm64': 0.27.3 + '@esbuild/linux-ia32': 0.27.3 + '@esbuild/linux-loong64': 0.27.3 + '@esbuild/linux-mips64el': 0.27.3 + '@esbuild/linux-ppc64': 0.27.3 + '@esbuild/linux-riscv64': 0.27.3 + '@esbuild/linux-s390x': 0.27.3 + '@esbuild/linux-x64': 0.27.3 + '@esbuild/netbsd-arm64': 0.27.3 + '@esbuild/netbsd-x64': 0.27.3 + '@esbuild/openbsd-arm64': 0.27.3 + '@esbuild/openbsd-x64': 0.27.3 + '@esbuild/openharmony-arm64': 0.27.3 + '@esbuild/sunos-x64': 0.27.3 + '@esbuild/win32-arm64': 0.27.3 + '@esbuild/win32-ia32': 0.27.3 + '@esbuild/win32-x64': 0.27.3 + + escape-string-regexp@4.0.0: {} + + eslint-scope@8.4.0: + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + + eslint-visitor-keys@3.4.3: {} + + eslint-visitor-keys@4.2.1: {} + + eslint-visitor-keys@5.0.1: {} + + eslint@9.39.3: + dependencies: + '@eslint-community/eslint-utils': 4.9.1(eslint@9.39.3) + '@eslint-community/regexpp': 4.12.2 + '@eslint/config-array': 0.21.1 + '@eslint/config-helpers': 0.4.2 + '@eslint/core': 0.17.0 + '@eslint/eslintrc': 3.3.4 + '@eslint/js': 9.39.3 + '@eslint/plugin-kit': 0.4.1 + '@humanfs/node': 0.16.7 + '@humanwhocodes/module-importer': 1.0.1 + '@humanwhocodes/retry': 0.4.3 + '@types/estree': 1.0.8 + ajv: 6.14.0 + chalk: 4.1.2 + cross-spawn: 7.0.6 + debug: 4.4.3 + escape-string-regexp: 4.0.0 + eslint-scope: 8.4.0 + eslint-visitor-keys: 4.2.1 + espree: 10.4.0 + esquery: 1.7.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 8.0.0 + find-up: 5.0.0 + glob-parent: 6.0.2 + ignore: 5.3.2 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + json-stable-stringify-without-jsonify: 1.0.1 + lodash.merge: 4.6.2 + minimatch: 3.1.5 + natural-compare: 1.4.0 + optionator: 0.9.4 + transitivePeerDependencies: + - supports-color + + espree@10.4.0: + dependencies: + acorn: 8.16.0 + acorn-jsx: 5.3.2(acorn@8.16.0) + eslint-visitor-keys: 4.2.1 + + esquery@1.7.0: + dependencies: + estraverse: 5.3.0 + + esrecurse@4.3.0: + dependencies: + estraverse: 5.3.0 + + estraverse@5.3.0: {} + + estree-walker@3.0.3: + dependencies: + '@types/estree': 1.0.8 + + esutils@2.0.3: {} + + expect-type@1.3.0: {} + + fast-deep-equal@3.1.3: {} + + fast-json-stable-stringify@2.1.0: {} + + fast-levenshtein@2.0.6: {} + + fdir@6.5.0(picomatch@4.0.3): + optionalDependencies: + picomatch: 4.0.3 + + file-entry-cache@8.0.0: + dependencies: + flat-cache: 4.0.1 + + find-up@5.0.0: + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + + flat-cache@4.0.1: + dependencies: + flatted: 3.3.4 + keyv: 4.5.4 + + flatted@3.3.4: {} + + fsevents@2.3.3: + optional: true + + glob-parent@6.0.2: + dependencies: + is-glob: 4.0.3 + + globals@14.0.0: {} + + has-flag@4.0.0: {} + + ignore@5.3.2: {} + + ignore@7.0.5: {} + + import-fresh@3.3.1: + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + + imurmurhash@0.1.4: {} + + is-extglob@2.1.1: {} + + is-glob@4.0.3: + dependencies: + is-extglob: 2.1.1 + + isexe@2.0.0: {} + + js-tokens@9.0.1: {} + + js-yaml@4.1.1: + dependencies: + argparse: 2.0.1 + + json-buffer@3.0.1: {} + + json-schema-traverse@0.4.1: {} + + json-stable-stringify-without-jsonify@1.0.1: {} + + keyv@4.5.4: + dependencies: + json-buffer: 3.0.1 + + levn@0.4.1: + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + + locate-path@6.0.0: + dependencies: + p-locate: 5.0.0 + + lodash.merge@4.6.2: {} + + loupe@3.2.1: {} + + magic-string@0.30.21: + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + + minimatch@10.2.4: + dependencies: + brace-expansion: 5.0.4 + + minimatch@3.1.5: + dependencies: + brace-expansion: 1.1.12 + + ms@2.1.3: {} + + nanoid@3.3.11: {} + + natural-compare@1.4.0: {} + + optionator@0.9.4: + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + word-wrap: 1.2.5 + + p-limit@3.1.0: + dependencies: + yocto-queue: 0.1.0 + + p-locate@5.0.0: + dependencies: + p-limit: 3.1.0 + + parent-module@1.0.1: + dependencies: + callsites: 3.1.0 + + path-exists@4.0.0: {} + + path-key@3.1.1: {} + + pathe@2.0.3: {} + + pathval@2.0.1: {} + + picocolors@1.1.1: {} + + picomatch@4.0.3: {} + + postcss@8.5.8: + dependencies: + nanoid: 3.3.11 + picocolors: 1.1.1 + source-map-js: 1.2.1 + + prelude-ls@1.2.1: {} + + punycode@2.3.1: {} + + resolve-from@4.0.0: {} + + rollup@4.59.0: + dependencies: + '@types/estree': 1.0.8 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.59.0 + '@rollup/rollup-android-arm64': 4.59.0 + '@rollup/rollup-darwin-arm64': 4.59.0 + '@rollup/rollup-darwin-x64': 4.59.0 + '@rollup/rollup-freebsd-arm64': 4.59.0 + '@rollup/rollup-freebsd-x64': 4.59.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.59.0 + '@rollup/rollup-linux-arm-musleabihf': 4.59.0 + '@rollup/rollup-linux-arm64-gnu': 4.59.0 + '@rollup/rollup-linux-arm64-musl': 4.59.0 + '@rollup/rollup-linux-loong64-gnu': 4.59.0 + '@rollup/rollup-linux-loong64-musl': 4.59.0 + '@rollup/rollup-linux-ppc64-gnu': 4.59.0 + '@rollup/rollup-linux-ppc64-musl': 4.59.0 + '@rollup/rollup-linux-riscv64-gnu': 4.59.0 + '@rollup/rollup-linux-riscv64-musl': 4.59.0 + '@rollup/rollup-linux-s390x-gnu': 4.59.0 + '@rollup/rollup-linux-x64-gnu': 4.59.0 + '@rollup/rollup-linux-x64-musl': 4.59.0 + '@rollup/rollup-openbsd-x64': 4.59.0 + '@rollup/rollup-openharmony-arm64': 4.59.0 + '@rollup/rollup-win32-arm64-msvc': 4.59.0 + '@rollup/rollup-win32-ia32-msvc': 4.59.0 + '@rollup/rollup-win32-x64-gnu': 4.59.0 + '@rollup/rollup-win32-x64-msvc': 4.59.0 + fsevents: 2.3.3 + + semver@7.7.4: {} + + shebang-command@2.0.0: + dependencies: + shebang-regex: 3.0.0 + + shebang-regex@3.0.0: {} + + siginfo@2.0.0: {} + + source-map-js@1.2.1: {} + + stackback@0.0.2: {} + + std-env@3.10.0: {} + + strip-json-comments@3.1.1: {} + + strip-literal@3.1.0: + dependencies: + js-tokens: 9.0.1 + + supports-color@7.2.0: + dependencies: + has-flag: 4.0.0 + + tinybench@2.9.0: {} + + tinyexec@0.3.2: {} + + tinyglobby@0.2.15: + dependencies: + fdir: 6.5.0(picomatch@4.0.3) + picomatch: 4.0.3 + + tinypool@1.1.1: {} + + tinyrainbow@2.0.0: {} + + tinyspy@4.0.4: {} + + ts-api-utils@2.4.0(typescript@5.9.3): + dependencies: + typescript: 5.9.3 + + type-check@0.4.0: + dependencies: + prelude-ls: 1.2.1 + + typescript@5.9.3: {} + + undici-types@6.21.0: {} + + uri-js@4.4.1: + dependencies: + punycode: 2.3.1 + + vite-node@3.2.4(@types/node@22.19.15): + dependencies: + cac: 6.7.14 + debug: 4.4.3 + es-module-lexer: 1.7.0 + pathe: 2.0.3 + vite: 7.3.1(@types/node@22.19.15) + transitivePeerDependencies: + - '@types/node' + - jiti + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + + vite@7.3.1(@types/node@22.19.15): + dependencies: + esbuild: 0.27.3 + fdir: 6.5.0(picomatch@4.0.3) + picomatch: 4.0.3 + postcss: 8.5.8 + rollup: 4.59.0 + tinyglobby: 0.2.15 + optionalDependencies: + '@types/node': 22.19.15 + fsevents: 2.3.3 + + vitest@3.2.4(@types/node@22.19.15): + dependencies: + '@types/chai': 5.2.3 + '@vitest/expect': 3.2.4 + '@vitest/mocker': 3.2.4(vite@7.3.1(@types/node@22.19.15)) + '@vitest/pretty-format': 3.2.4 + '@vitest/runner': 3.2.4 + '@vitest/snapshot': 3.2.4 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 + chai: 5.3.3 + debug: 4.4.3 + expect-type: 1.3.0 + magic-string: 0.30.21 + pathe: 2.0.3 + picomatch: 4.0.3 + std-env: 3.10.0 + tinybench: 2.9.0 + tinyexec: 0.3.2 + tinyglobby: 0.2.15 + tinypool: 1.1.1 + tinyrainbow: 2.0.0 + vite: 7.3.1(@types/node@22.19.15) + vite-node: 3.2.4(@types/node@22.19.15) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 22.19.15 + transitivePeerDependencies: + - jiti + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + + which@2.0.2: + dependencies: + isexe: 2.0.0 + + why-is-node-running@2.3.0: + dependencies: + siginfo: 2.0.0 + stackback: 0.0.2 + + word-wrap@1.2.5: {} + + yocto-queue@0.1.0: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..924b55f --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - packages/* diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 0000000..7912991 --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "strict": true, + "noImplicitOverride": true, + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": true, + "useUnknownInCatchVariables": true, + "forceConsistentCasingInFileNames": true, + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "declaration": true, + "sourceMap": true, + "types": ["node"] + } +} -- 2.49.1 From 79b9617045cbe202804da5748276cdad12100aba Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Fri, 6 Mar 2026 09:16:33 -0600 Subject: [PATCH 2/8] feat(queue): add redis connection module with health check (MQ-002) --- packages/queue/package.json | 3 + packages/queue/src/index.ts | 13 +++ packages/queue/src/redis-connection.ts | 95 +++++++++++++++++++ packages/queue/tests/redis-connection.test.ts | 76 +++++++++++++++ pnpm-lock.yaml | 70 +++++++++++++- 5 files changed, 256 insertions(+), 1 deletion(-) create mode 100644 packages/queue/src/redis-connection.ts create mode 100644 packages/queue/tests/redis-connection.test.ts diff --git a/packages/queue/package.json b/packages/queue/package.json index 1790fc7..5aa258b 100644 --- a/packages/queue/package.json +++ b/packages/queue/package.json @@ -12,5 +12,8 @@ "lint": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" \"vitest.config.ts\"", "build": "tsc -p tsconfig.build.json", "test": "vitest run" + }, + "dependencies": { + "ioredis": "^5.10.0" } } diff --git a/packages/queue/src/index.ts b/packages/queue/src/index.ts index 382b256..74a9354 100644 --- a/packages/queue/src/index.ts +++ b/packages/queue/src/index.ts @@ -1 +1,14 @@ export const packageVersion = '0.0.1'; + +export { + assertRedisHealthy, + createRedisClient, + resolveRedisUrl, + runRedisHealthCheck, +} from './redis-connection.js'; +export type { + CreateRedisClientOptions, + RedisClientConstructor, + RedisHealthCheck, + RedisPingClient, +} from './redis-connection.js'; diff --git a/packages/queue/src/redis-connection.ts b/packages/queue/src/redis-connection.ts new file mode 100644 index 0000000..b7612b6 --- /dev/null +++ b/packages/queue/src/redis-connection.ts @@ -0,0 +1,95 @@ +import Redis, { type RedisOptions } from 'ioredis'; + +const ERR_MISSING_REDIS_URL = + 'Missing required Valkey/Redis connection URL. Set VALKEY_URL or REDIS_URL.'; + +export interface RedisHealthCheck { + readonly checkedAt: number; + readonly latencyMs: number; + readonly ok: boolean; + readonly response?: string; + readonly error?: string; +} + +export interface RedisPingClient { + ping(): Promise; +} + +export type RedisClientConstructor = new ( + url: string, + options?: RedisOptions, +) => TClient; + +export interface CreateRedisClientOptions { + readonly env?: NodeJS.ProcessEnv; + readonly redisConstructor?: RedisClientConstructor; + readonly redisOptions?: RedisOptions; +} + +export function resolveRedisUrl(env: NodeJS.ProcessEnv = process.env): string { + const resolvedUrl = env.VALKEY_URL ?? env.REDIS_URL; + + if (typeof resolvedUrl !== 'string' || resolvedUrl.trim().length === 0) { + throw new Error(ERR_MISSING_REDIS_URL); + } + + return resolvedUrl; +} + +export function createRedisClient( + options: CreateRedisClientOptions = {}, +): TClient { + const redisUrl = resolveRedisUrl(options.env); + + const RedisCtor = + options.redisConstructor ?? + (Redis as unknown as RedisClientConstructor); + + return new RedisCtor(redisUrl, { + maxRetriesPerRequest: null, + ...options.redisOptions, + }); +} + +export async function runRedisHealthCheck( + client: RedisPingClient, +): Promise { + const startedAt = process.hrtime.bigint(); + + try { + const response = await client.ping(); + const elapsedMs = Number((process.hrtime.bigint() - startedAt) / 1_000_000n); + + return { + checkedAt: Date.now(), + latencyMs: elapsedMs, + ok: true, + response, + }; + } catch (error) { + const elapsedMs = Number((process.hrtime.bigint() - startedAt) / 1_000_000n); + const message = + error instanceof Error ? error.message : 'Unknown redis health check error'; + + return { + checkedAt: Date.now(), + latencyMs: elapsedMs, + ok: false, + error: message, + }; + } +} + +export async function assertRedisHealthy( + client: RedisPingClient, +): Promise { + const health = await runRedisHealthCheck(client); + + if (!health.ok) { + throw new Error( + `Redis health check failed after ${health.latencyMs}ms: ${health.error ?? 'unknown error'}`, + ); + } + + return health; +} diff --git a/packages/queue/tests/redis-connection.test.ts b/packages/queue/tests/redis-connection.test.ts new file mode 100644 index 0000000..3a4b072 --- /dev/null +++ b/packages/queue/tests/redis-connection.test.ts @@ -0,0 +1,76 @@ +import { describe, expect, it } from 'vitest'; + +import { + createRedisClient, + resolveRedisUrl, + runRedisHealthCheck, +} from '../src/redis-connection.js'; + +describe('resolveRedisUrl', () => { + it('prefers VALKEY_URL when both env vars are present', () => { + const url = resolveRedisUrl({ + VALKEY_URL: 'redis://valkey.local:6379', + REDIS_URL: 'redis://redis.local:6379', + }); + + expect(url).toBe('redis://valkey.local:6379'); + }); + + it('falls back to REDIS_URL when VALKEY_URL is missing', () => { + const url = resolveRedisUrl({ + REDIS_URL: 'redis://redis.local:6379', + }); + + expect(url).toBe('redis://redis.local:6379'); + }); + + it('throws loudly when no redis environment variable exists', () => { + expect(() => resolveRedisUrl({})).toThrowError( + /Missing required Valkey\/Redis connection URL/i, + ); + }); +}); + +describe('createRedisClient', () => { + it('uses env URL for client creation with no hardcoded defaults', () => { + class FakeRedis { + public readonly url: string; + + public constructor(url: string) { + this.url = url; + } + } + + const client = createRedisClient({ + env: { + VALKEY_URL: 'redis://queue.local:6379', + }, + redisConstructor: FakeRedis, + }); + + expect(client.url).toBe('redis://queue.local:6379'); + }); +}); + +describe('runRedisHealthCheck', () => { + it('returns healthy status when ping succeeds', async () => { + const health = await runRedisHealthCheck({ + ping: () => Promise.resolve('PONG'), + }); + + expect(health.ok).toBe(true); + expect(health.response).toBe('PONG'); + expect(health.latencyMs).toBeTypeOf('number'); + expect(health.latencyMs).toBeGreaterThanOrEqual(0); + }); + + it('returns unhealthy status when ping fails', async () => { + const health = await runRedisHealthCheck({ + ping: () => Promise.reject(new Error('connection refused')), + }); + + expect(health.ok).toBe(false); + expect(health.error).toMatch(/connection refused/i); + expect(health.latencyMs).toBeTypeOf('number'); + }); +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 103c155..acb4068 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,7 +27,11 @@ importers: specifier: ^3.0.8 version: 3.2.4(@types/node@22.19.15) - packages/queue: {} + packages/queue: + dependencies: + ioredis: + specifier: ^5.10.0 + version: 5.10.0 packages: @@ -241,6 +245,9 @@ packages: resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} engines: {node: '>=18.18'} + '@ioredis/commands@1.5.1': + resolution: {integrity: sha512-JH8ZL/ywcJyR9MmJ5BNqZllXNZQqQbnVZOqpPQqE1vHiFgAw4NHbvE0FOduNU8IX9babitBT46571OnPTT0Zcw==} + '@jridgewell/sourcemap-codec@1.5.5': resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} @@ -530,6 +537,10 @@ packages: resolution: {integrity: sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==} engines: {node: '>= 16'} + cluster-key-slot@1.1.2: + resolution: {integrity: sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==} + engines: {node: '>=0.10.0'} + color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} @@ -560,6 +571,10 @@ packages: deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + denque@2.1.0: + resolution: {integrity: sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==} + engines: {node: '>=0.10'} + es-module-lexer@1.7.0: resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} @@ -691,6 +706,10 @@ packages: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} + ioredis@5.10.0: + resolution: {integrity: sha512-HVBe9OFuqs+Z6n64q09PQvP1/R4Bm+30PAyyD4wIEqssh3v9L21QjCVk4kRLucMBcDokJTcLjsGeVRlq/nH6DA==} + engines: {node: '>=12.22.0'} + is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -729,6 +748,12 @@ packages: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} + lodash.defaults@4.2.0: + resolution: {integrity: sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==} + + lodash.isarguments@3.1.0: + resolution: {integrity: sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==} + lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} @@ -806,6 +831,14 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} + redis-errors@1.2.0: + resolution: {integrity: sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==} + engines: {node: '>=4'} + + redis-parser@3.0.0: + resolution: {integrity: sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==} + engines: {node: '>=4'} + resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -838,6 +871,9 @@ packages: stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + standard-as-callback@2.1.0: + resolution: {integrity: sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==} + std-env@3.10.0: resolution: {integrity: sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==} @@ -1123,6 +1159,8 @@ snapshots: '@humanwhocodes/retry@0.4.3': {} + '@ioredis/commands@1.5.1': {} + '@jridgewell/sourcemap-codec@1.5.5': {} '@rollup/rollup-android-arm-eabi@4.59.0': @@ -1401,6 +1439,8 @@ snapshots: check-error@2.1.3: {} + cluster-key-slot@1.1.2: {} + color-convert@2.0.1: dependencies: color-name: 1.1.4 @@ -1423,6 +1463,8 @@ snapshots: deep-is@0.1.4: {} + denque@2.1.0: {} + es-module-lexer@1.7.0: {} esbuild@0.27.3: @@ -1578,6 +1620,20 @@ snapshots: imurmurhash@0.1.4: {} + ioredis@5.10.0: + dependencies: + '@ioredis/commands': 1.5.1 + cluster-key-slot: 1.1.2 + debug: 4.4.3 + denque: 2.1.0 + lodash.defaults: 4.2.0 + lodash.isarguments: 3.1.0 + redis-errors: 1.2.0 + redis-parser: 3.0.0 + standard-as-callback: 2.1.0 + transitivePeerDependencies: + - supports-color + is-extglob@2.1.1: {} is-glob@4.0.3: @@ -1611,6 +1667,10 @@ snapshots: dependencies: p-locate: 5.0.0 + lodash.defaults@4.2.0: {} + + lodash.isarguments@3.1.0: {} + lodash.merge@4.6.2: {} loupe@3.2.1: {} @@ -1676,6 +1736,12 @@ snapshots: punycode@2.3.1: {} + redis-errors@1.2.0: {} + + redis-parser@3.0.0: + dependencies: + redis-errors: 1.2.0 + resolve-from@4.0.0: {} rollup@4.59.0: @@ -1723,6 +1789,8 @@ snapshots: stackback@0.0.2: {} + standard-as-callback@2.1.0: {} + std-env@3.10.0: {} strip-json-comments@3.1.1: {} -- 2.49.1 From a235aebf20d893dfc0087ce504fc02c9c49fcf98 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Fri, 6 Mar 2026 09:19:53 -0600 Subject: [PATCH 3/8] feat(queue): add redis task CRUD repository (MQ-003) --- packages/queue/src/index.ts | 21 ++ packages/queue/src/task-repository.ts | 271 +++++++++++++++++++ packages/queue/src/task.ts | 76 ++++++ packages/queue/tests/task-repository.test.ts | 171 ++++++++++++ 4 files changed, 539 insertions(+) create mode 100644 packages/queue/src/task-repository.ts create mode 100644 packages/queue/src/task.ts create mode 100644 packages/queue/tests/task-repository.test.ts diff --git a/packages/queue/src/index.ts b/packages/queue/src/index.ts index 74a9354..9998ac0 100644 --- a/packages/queue/src/index.ts +++ b/packages/queue/src/index.ts @@ -12,3 +12,24 @@ export type { RedisHealthCheck, RedisPingClient, } from './redis-connection.js'; +export { + RedisTaskRepository, + TaskAlreadyExistsError, + TaskNotFoundError, + TaskSerializationError, +} from './task-repository.js'; +export type { RedisTaskClient, RedisTaskRepositoryOptions } from './task-repository.js'; +export { + TASK_LANES, + TASK_PRIORITIES, + TASK_STATUSES, +} from './task.js'; +export type { + CreateTaskInput, + Task, + TaskLane, + TaskListFilters, + TaskPriority, + TaskStatus, + TaskUpdateInput, +} from './task.js'; diff --git a/packages/queue/src/task-repository.ts b/packages/queue/src/task-repository.ts new file mode 100644 index 0000000..b31f8b8 --- /dev/null +++ b/packages/queue/src/task-repository.ts @@ -0,0 +1,271 @@ +import { + TASK_LANES, + TASK_PRIORITIES, + TASK_STATUSES, + type CreateTaskInput, + type Task, + type TaskLane, + type TaskListFilters, + type TaskPriority, + type TaskStatus, + type TaskUpdateInput, +} from './task.js'; + +const STATUS_SET = new Set(TASK_STATUSES); +const PRIORITY_SET = new Set(TASK_PRIORITIES); +const LANE_SET = new Set(TASK_LANES); + +const DEFAULT_KEY_PREFIX = 'mosaic:queue'; + +interface RepositoryKeys { + readonly taskIds: string; + task(taskId: string): string; +} + +export interface RedisTaskClient { + get(key: string): Promise; + set(key: string, value: string, mode?: 'NX' | 'XX'): Promise<'OK' | null>; + smembers(key: string): Promise; + sadd(key: string, member: string): Promise; +} + +export interface RedisTaskRepositoryOptions { + readonly client: RedisTaskClient; + readonly keyPrefix?: string; + readonly now?: () => number; +} + +export class TaskAlreadyExistsError extends Error { + public constructor(taskId: string) { + super(`Task ${taskId} already exists.`); + this.name = 'TaskAlreadyExistsError'; + } +} + +export class TaskNotFoundError extends Error { + public constructor(taskId: string) { + super(`Task ${taskId} was not found.`); + this.name = 'TaskNotFoundError'; + } +} + +export class TaskSerializationError extends Error { + public constructor(taskId: string, message: string) { + super(`Unable to deserialize task ${taskId}: ${message}`); + this.name = 'TaskSerializationError'; + } +} + +export class RedisTaskRepository { + private readonly client: RedisTaskClient; + private readonly keys: RepositoryKeys; + private readonly now: () => number; + + public constructor(options: RedisTaskRepositoryOptions) { + this.client = options.client; + this.keys = buildRepositoryKeys(options.keyPrefix ?? DEFAULT_KEY_PREFIX); + this.now = options.now ?? Date.now; + } + + public async create(input: CreateTaskInput): Promise { + const timestamp = this.now(); + + const task: Task = { + id: input.taskId, + project: input.project, + mission: input.mission, + taskId: input.taskId, + title: input.title, + description: input.description, + status: 'pending', + priority: input.priority ?? 'medium', + dependencies: [...(input.dependencies ?? [])], + lane: input.lane ?? 'any', + retryCount: 0, + metadata: input.metadata, + createdAt: timestamp, + updatedAt: timestamp, + }; + + const saveResult = await this.client.set( + this.keys.task(task.taskId), + JSON.stringify(task), + 'NX', + ); + + if (saveResult !== 'OK') { + throw new TaskAlreadyExistsError(task.taskId); + } + + await this.client.sadd(this.keys.taskIds, task.taskId); + + return task; + } + + public async get(taskId: string): Promise { + const raw = await this.client.get(this.keys.task(taskId)); + + if (raw === null) { + return null; + } + + return deserializeTask(taskId, raw); + } + + public async list(filters: TaskListFilters = {}): Promise { + const taskIds = await this.client.smembers(this.keys.taskIds); + const records = await Promise.all(taskIds.map(async (taskId) => this.get(taskId))); + const tasks = records.filter((task): task is Task => task !== null); + + return tasks + .filter((task) => + matchesFilters(task, { + project: filters.project, + mission: filters.mission, + status: filters.status, + }), + ) + .sort((left, right) => left.createdAt - right.createdAt); + } + + public async update(taskId: string, patch: TaskUpdateInput): Promise { + const existing = await this.get(taskId); + + if (existing === null) { + throw new TaskNotFoundError(taskId); + } + + const updated: Task = { + ...existing, + ...patch, + dependencies: + patch.dependencies === undefined ? existing.dependencies : [...patch.dependencies], + updatedAt: this.now(), + }; + + const saveResult = await this.client.set( + this.keys.task(taskId), + JSON.stringify(updated), + 'XX', + ); + + if (saveResult !== 'OK') { + throw new TaskNotFoundError(taskId); + } + + await this.client.sadd(this.keys.taskIds, taskId); + + return updated; + } +} + +function matchesFilters(task: Task, filters: TaskListFilters): boolean { + if (filters.project !== undefined && task.project !== filters.project) { + return false; + } + + if (filters.mission !== undefined && task.mission !== filters.mission) { + return false; + } + + if (filters.status !== undefined && task.status !== filters.status) { + return false; + } + + return true; +} + +function deserializeTask(taskId: string, raw: string): Task { + let parsed: unknown; + + try { + parsed = JSON.parse(raw); + } catch (error) { + throw new TaskSerializationError( + taskId, + error instanceof Error ? error.message : 'invalid JSON', + ); + } + + if (!isRecord(parsed)) { + throw new TaskSerializationError(taskId, 'task payload is not an object'); + } + + const requiredStringKeys = ['id', 'project', 'mission', 'taskId', 'title'] as const; + const requiredNumberKeys = ['retryCount', 'createdAt', 'updatedAt'] as const; + + for (const key of requiredStringKeys) { + if (typeof parsed[key] !== 'string') { + throw new TaskSerializationError(taskId, `missing string field "${key}"`); + } + } + + for (const key of requiredNumberKeys) { + if (typeof parsed[key] !== 'number') { + throw new TaskSerializationError(taskId, `missing numeric field "${key}"`); + } + } + + if (!STATUS_SET.has(parsed.status as TaskStatus)) { + throw new TaskSerializationError(taskId, 'invalid status value'); + } + + if (!PRIORITY_SET.has(parsed.priority as TaskPriority)) { + throw new TaskSerializationError(taskId, 'invalid priority value'); + } + + if (!LANE_SET.has(parsed.lane as TaskLane)) { + throw new TaskSerializationError(taskId, 'invalid lane value'); + } + + if (!Array.isArray(parsed.dependencies)) { + throw new TaskSerializationError(taskId, 'dependencies must be an array'); + } + + if (!parsed.dependencies.every((dependency): dependency is string => typeof dependency === 'string')) { + throw new TaskSerializationError(taskId, 'dependencies must contain only strings'); + } + + return { + id: parsed.id, + project: parsed.project, + mission: parsed.mission, + taskId: parsed.taskId, + title: parsed.title, + status: parsed.status, + priority: parsed.priority, + dependencies: parsed.dependencies, + lane: parsed.lane, + retryCount: parsed.retryCount, + createdAt: parsed.createdAt, + updatedAt: parsed.updatedAt, + ...(typeof parsed.description === 'string' + ? { description: parsed.description } + : {}), + ...(typeof parsed.claimedBy === 'string' ? { claimedBy: parsed.claimedBy } : {}), + ...(typeof parsed.claimedAt === 'number' ? { claimedAt: parsed.claimedAt } : {}), + ...(typeof parsed.claimTTL === 'number' ? { claimTTL: parsed.claimTTL } : {}), + ...(typeof parsed.completedAt === 'number' + ? { completedAt: parsed.completedAt } + : {}), + ...(typeof parsed.failedAt === 'number' ? { failedAt: parsed.failedAt } : {}), + ...(typeof parsed.failureReason === 'string' + ? { failureReason: parsed.failureReason } + : {}), + ...(typeof parsed.completionSummary === 'string' + ? { completionSummary: parsed.completionSummary } + : {}), + ...(isRecord(parsed.metadata) ? { metadata: parsed.metadata } : {}), + }; +} + +function buildRepositoryKeys(keyPrefix: string): RepositoryKeys { + return { + taskIds: `${keyPrefix}:task-ids`, + task: (taskId: string) => `${keyPrefix}:task:${taskId}`, + }; +} + +function isRecord(value: unknown): value is Record { + return typeof value === 'object' && value !== null && !Array.isArray(value); +} diff --git a/packages/queue/src/task.ts b/packages/queue/src/task.ts new file mode 100644 index 0000000..df7f6f7 --- /dev/null +++ b/packages/queue/src/task.ts @@ -0,0 +1,76 @@ +export const TASK_STATUSES = [ + 'pending', + 'claimed', + 'in-progress', + 'completed', + 'failed', + 'blocked', +] as const; + +export const TASK_PRIORITIES = ['critical', 'high', 'medium', 'low'] as const; + +export const TASK_LANES = ['planning', 'coding', 'any'] as const; + +export type TaskStatus = (typeof TASK_STATUSES)[number]; +export type TaskPriority = (typeof TASK_PRIORITIES)[number]; +export type TaskLane = (typeof TASK_LANES)[number]; + +export interface Task { + readonly id: string; + readonly project: string; + readonly mission: string; + readonly taskId: string; + readonly title: string; + readonly description?: string; + readonly status: TaskStatus; + readonly priority: TaskPriority; + readonly dependencies: readonly string[]; + readonly lane: TaskLane; + readonly claimedBy?: string; + readonly claimedAt?: number; + readonly claimTTL?: number; + readonly completedAt?: number; + readonly failedAt?: number; + readonly failureReason?: string; + readonly completionSummary?: string; + readonly retryCount: number; + readonly metadata?: Record; + readonly createdAt: number; + readonly updatedAt: number; +} + +export interface CreateTaskInput { + readonly project: string; + readonly mission: string; + readonly taskId: string; + readonly title: string; + readonly description?: string; + readonly priority?: TaskPriority; + readonly dependencies?: readonly string[]; + readonly lane?: TaskLane; + readonly metadata?: Record; +} + +export interface TaskListFilters { + readonly project?: string; + readonly mission?: string; + readonly status?: TaskStatus; +} + +export interface TaskUpdateInput { + readonly title?: string; + readonly description?: string; + readonly status?: TaskStatus; + readonly priority?: TaskPriority; + readonly dependencies?: readonly string[]; + readonly lane?: TaskLane; + readonly claimedBy?: string; + readonly claimedAt?: number; + readonly claimTTL?: number; + readonly completedAt?: number; + readonly failedAt?: number; + readonly failureReason?: string; + readonly completionSummary?: string; + readonly retryCount?: number; + readonly metadata?: Record; +} diff --git a/packages/queue/tests/task-repository.test.ts b/packages/queue/tests/task-repository.test.ts new file mode 100644 index 0000000..180b7df --- /dev/null +++ b/packages/queue/tests/task-repository.test.ts @@ -0,0 +1,171 @@ +import { describe, expect, it } from 'vitest'; + +import { + RedisTaskRepository, + TaskAlreadyExistsError, + type RedisTaskClient, +} from '../src/task-repository.js'; + +class InMemoryRedisClient implements RedisTaskClient { + private readonly kv = new Map(); + private readonly sets = new Map>(); + + public get(key: string): Promise { + return Promise.resolve(this.kv.get(key) ?? null); + } + + public set( + key: string, + value: string, + mode?: 'NX' | 'XX', + ): Promise<'OK' | null> { + const exists = this.kv.has(key); + + if (mode === 'NX' && exists) { + return Promise.resolve(null); + } + + if (mode === 'XX' && !exists) { + return Promise.resolve(null); + } + + this.kv.set(key, value); + return Promise.resolve('OK'); + } + + public smembers(key: string): Promise { + return Promise.resolve([...(this.sets.get(key) ?? new Set())]); + } + + public sadd(key: string, member: string): Promise { + const values = this.sets.get(key) ?? new Set(); + const beforeSize = values.size; + + values.add(member); + this.sets.set(key, values); + + return Promise.resolve(values.size === beforeSize ? 0 : 1); + } +} + +describe('RedisTaskRepository CRUD', () => { + it('creates and fetches a task with defaults', async () => { + const repository = new RedisTaskRepository({ + client: new InMemoryRedisClient(), + now: () => 1_700_000_000_000, + }); + + const created = await repository.create({ + project: 'queue', + mission: 'phase1', + taskId: 'MQ-003', + title: 'Implement task CRUD', + }); + + const fetched = await repository.get('MQ-003'); + + expect(created.id).toBe('MQ-003'); + expect(created.status).toBe('pending'); + expect(created.priority).toBe('medium'); + expect(created.lane).toBe('any'); + expect(created.dependencies).toEqual([]); + expect(created.createdAt).toBe(1_700_000_000_000); + expect(fetched).toEqual(created); + }); + + it('throws when creating a duplicate task id', async () => { + const repository = new RedisTaskRepository({ + client: new InMemoryRedisClient(), + }); + + await repository.create({ + project: 'queue', + mission: 'phase1', + taskId: 'MQ-003', + title: 'First task', + }); + + await expect( + repository.create({ + project: 'queue', + mission: 'phase1', + taskId: 'MQ-003', + title: 'Duplicate', + }), + ).rejects.toBeInstanceOf(TaskAlreadyExistsError); + }); + + it('lists tasks and filters by project, mission, and status', async () => { + const repository = new RedisTaskRepository({ + client: new InMemoryRedisClient(), + }); + + await repository.create({ + project: 'queue', + mission: 'phase1', + taskId: 'MQ-003A', + title: 'Pending task', + }); + + await repository.create({ + project: 'queue', + mission: 'phase2', + taskId: 'MQ-003B', + title: 'Claimed task', + }); + + await repository.update('MQ-003B', { + status: 'claimed', + }); + + const byProject = await repository.list({ + project: 'queue', + }); + const byMission = await repository.list({ + mission: 'phase2', + }); + const byStatus = await repository.list({ + status: 'claimed', + }); + + expect(byProject).toHaveLength(2); + expect(byMission.map((task) => task.taskId)).toEqual(['MQ-003B']); + expect(byStatus.map((task) => task.taskId)).toEqual(['MQ-003B']); + }); + + it('updates mutable fields and preserves immutable fields', async () => { + const repository = new RedisTaskRepository({ + client: new InMemoryRedisClient(), + now: () => 1_700_000_000_001, + }); + + await repository.create({ + project: 'queue', + mission: 'phase1', + taskId: 'MQ-003', + title: 'Original title', + description: 'Original description', + }); + + const updated = await repository.update('MQ-003', { + title: 'Updated title', + description: 'Updated description', + priority: 'high', + lane: 'coding', + dependencies: ['MQ-002'], + metadata: { + source: 'unit-test', + }, + }); + + expect(updated.title).toBe('Updated title'); + expect(updated.description).toBe('Updated description'); + expect(updated.priority).toBe('high'); + expect(updated.lane).toBe('coding'); + expect(updated.dependencies).toEqual(['MQ-002']); + expect(updated.metadata).toEqual({ source: 'unit-test' }); + expect(updated.project).toBe('queue'); + expect(updated.taskId).toBe('MQ-003'); + expect(updated.updatedAt).toBe(1_700_000_000_001); + }); +}); -- 2.49.1 From 5049d0497701d907b120ba826efb9978452e03b1 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Fri, 6 Mar 2026 09:24:08 -0600 Subject: [PATCH 4/8] feat(queue): add atomic task state transitions (MQ-004) --- packages/queue/src/index.ts | 14 +- packages/queue/src/task-repository.ts | 272 +++++++++++++++ packages/queue/tests/task-atomic.test.ts | 330 +++++++++++++++++++ packages/queue/tests/task-repository.test.ts | 27 ++ 4 files changed, 642 insertions(+), 1 deletion(-) create mode 100644 packages/queue/tests/task-atomic.test.ts diff --git a/packages/queue/src/index.ts b/packages/queue/src/index.ts index 9998ac0..1a005ff 100644 --- a/packages/queue/src/index.ts +++ b/packages/queue/src/index.ts @@ -15,10 +15,22 @@ export type { export { RedisTaskRepository, TaskAlreadyExistsError, + TaskAtomicConflictError, TaskNotFoundError, + TaskOwnershipError, TaskSerializationError, + TaskTransitionError, +} from './task-repository.js'; +export type { + ClaimTaskInput, + CompleteTaskInput, + FailTaskInput, + HeartbeatTaskInput, + RedisTaskClient, + RedisTaskRepositoryOptions, + RedisTaskTransaction, + ReleaseTaskInput, } from './task-repository.js'; -export type { RedisTaskClient, RedisTaskRepositoryOptions } from './task-repository.js'; export { TASK_LANES, TASK_PRIORITIES, diff --git a/packages/queue/src/task-repository.ts b/packages/queue/src/task-repository.ts index b31f8b8..30d504a 100644 --- a/packages/queue/src/task-repository.ts +++ b/packages/queue/src/task-repository.ts @@ -16,6 +16,7 @@ const PRIORITY_SET = new Set(TASK_PRIORITIES); const LANE_SET = new Set(TASK_LANES); const DEFAULT_KEY_PREFIX = 'mosaic:queue'; +const MAX_ATOMIC_RETRIES = 8; interface RepositoryKeys { readonly taskIds: string; @@ -27,6 +28,15 @@ export interface RedisTaskClient { set(key: string, value: string, mode?: 'NX' | 'XX'): Promise<'OK' | null>; smembers(key: string): Promise; sadd(key: string, member: string): Promise; + watch(...keys: string[]): Promise<'OK'>; + unwatch(): Promise<'OK'>; + multi(): RedisTaskTransaction; +} + +export interface RedisTaskTransaction { + set(key: string, value: string, mode?: 'NX' | 'XX'): RedisTaskTransaction; + sadd(key: string, member: string): RedisTaskTransaction; + exec(): Promise; } export interface RedisTaskRepositoryOptions { @@ -35,6 +45,30 @@ export interface RedisTaskRepositoryOptions { readonly now?: () => number; } +export interface ClaimTaskInput { + readonly agentId: string; + readonly ttlSeconds: number; +} + +export interface ReleaseTaskInput { + readonly agentId?: string; +} + +export interface HeartbeatTaskInput { + readonly agentId?: string; + readonly ttlSeconds?: number; +} + +export interface CompleteTaskInput { + readonly agentId?: string; + readonly summary?: string; +} + +export interface FailTaskInput { + readonly agentId?: string; + readonly reason: string; +} + export class TaskAlreadyExistsError extends Error { public constructor(taskId: string) { super(`Task ${taskId} already exists.`); @@ -56,6 +90,29 @@ export class TaskSerializationError extends Error { } } +export class TaskTransitionError extends Error { + public constructor(taskId: string, status: TaskStatus, action: string) { + super(`Task ${taskId} cannot transition from ${status} via ${action}.`); + this.name = 'TaskTransitionError'; + } +} + +export class TaskOwnershipError extends Error { + public constructor(taskId: string, expectedAgentId: string, actualAgentId: string) { + super( + `Task ${taskId} is owned by ${actualAgentId}, not ${expectedAgentId}.`, + ); + this.name = 'TaskOwnershipError'; + } +} + +export class TaskAtomicConflictError extends Error { + public constructor(taskId: string) { + super(`Task ${taskId} could not be updated atomically after multiple retries.`); + this.name = 'TaskAtomicConflictError'; + } +} + export class RedisTaskRepository { private readonly client: RedisTaskClient; private readonly keys: RepositoryKeys; @@ -157,6 +214,158 @@ export class RedisTaskRepository { return updated; } + + public async claim(taskId: string, input: ClaimTaskInput): Promise { + if (input.ttlSeconds <= 0) { + throw new Error(`Task ${taskId} claim ttl must be greater than 0 seconds.`); + } + + return this.mutateTaskAtomically(taskId, (existing, now) => { + if (!canClaimTask(existing, now)) { + throw new TaskTransitionError(taskId, existing.status, 'claim'); + } + + const base = withoutCompletionAndFailureFields(withoutClaimFields(existing)); + + return { + ...base, + status: 'claimed', + claimedBy: input.agentId, + claimedAt: now, + claimTTL: input.ttlSeconds, + updatedAt: now, + }; + }); + } + + public async release(taskId: string, input: ReleaseTaskInput = {}): Promise { + return this.mutateTaskAtomically(taskId, (existing, now) => { + if (!isClaimedLikeStatus(existing.status)) { + throw new TaskTransitionError(taskId, existing.status, 'release'); + } + + assertTaskOwnership(taskId, existing, input.agentId); + + const base = withoutClaimFields(existing); + + return { + ...base, + status: 'pending', + updatedAt: now, + }; + }); + } + + public async heartbeat( + taskId: string, + input: HeartbeatTaskInput = {}, + ): Promise { + return this.mutateTaskAtomically(taskId, (existing, now) => { + if (!isClaimedLikeStatus(existing.status)) { + throw new TaskTransitionError(taskId, existing.status, 'heartbeat'); + } + + if (isClaimExpired(existing, now)) { + throw new TaskTransitionError(taskId, existing.status, 'heartbeat'); + } + + assertTaskOwnership(taskId, existing, input.agentId); + + const ttl = input.ttlSeconds ?? existing.claimTTL; + + if (ttl === undefined || ttl <= 0) { + throw new TaskTransitionError(taskId, existing.status, 'heartbeat'); + } + + return { + ...existing, + claimedAt: now, + claimTTL: ttl, + updatedAt: now, + }; + }); + } + + public async complete( + taskId: string, + input: CompleteTaskInput = {}, + ): Promise { + return this.mutateTaskAtomically(taskId, (existing, now) => { + if (!isClaimedLikeStatus(existing.status)) { + throw new TaskTransitionError(taskId, existing.status, 'complete'); + } + + assertTaskOwnership(taskId, existing, input.agentId); + + const base = withoutCompletionAndFailureFields(withoutClaimFields(existing)); + + return { + ...base, + status: 'completed', + completedAt: now, + ...(input.summary === undefined ? {} : { completionSummary: input.summary }), + updatedAt: now, + }; + }); + } + + public async fail(taskId: string, input: FailTaskInput): Promise { + return this.mutateTaskAtomically(taskId, (existing, now) => { + if (!isClaimedLikeStatus(existing.status)) { + throw new TaskTransitionError(taskId, existing.status, 'fail'); + } + + assertTaskOwnership(taskId, existing, input.agentId); + + const base = withoutCompletionAndFailureFields(withoutClaimFields(existing)); + + return { + ...base, + status: 'failed', + failedAt: now, + failureReason: input.reason, + retryCount: existing.retryCount + 1, + updatedAt: now, + }; + }); + } + + private async mutateTaskAtomically( + taskId: string, + mutation: (existing: Task, now: number) => Task, + ): Promise { + const taskKey = this.keys.task(taskId); + + for (let attempt = 0; attempt < MAX_ATOMIC_RETRIES; attempt += 1) { + await this.client.watch(taskKey); + + try { + const raw = await this.client.get(taskKey); + + if (raw === null) { + throw new TaskNotFoundError(taskId); + } + + const existing = deserializeTask(taskId, raw); + const updated = mutation(existing, this.now()); + + const transaction = this.client.multi(); + transaction.set(taskKey, JSON.stringify(updated), 'XX'); + transaction.sadd(this.keys.taskIds, taskId); + const execResult = await transaction.exec(); + + if (execResult === null) { + continue; + } + + return updated; + } finally { + await this.client.unwatch(); + } + } + + throw new TaskAtomicConflictError(taskId); + } } function matchesFilters(task: Task, filters: TaskListFilters): boolean { @@ -175,6 +384,69 @@ function matchesFilters(task: Task, filters: TaskListFilters): boolean { return true; } +function canClaimTask(task: Task, now: number): boolean { + if (task.status === 'pending') { + return true; + } + + if (!isClaimedLikeStatus(task.status)) { + return false; + } + + return isClaimExpired(task, now); +} + +function isClaimedLikeStatus(status: TaskStatus): boolean { + return status === 'claimed' || status === 'in-progress'; +} + +function isClaimExpired(task: Task, now: number): boolean { + if (task.claimedAt === undefined || task.claimTTL === undefined) { + return false; + } + + return task.claimedAt + task.claimTTL * 1000 <= now; +} + +function assertTaskOwnership( + taskId: string, + task: Task, + expectedAgentId: string | undefined, +): void { + if (expectedAgentId === undefined || task.claimedBy === undefined) { + return; + } + + if (task.claimedBy !== expectedAgentId) { + throw new TaskOwnershipError(taskId, expectedAgentId, task.claimedBy); + } +} + +type TaskWithoutClaimFields = Omit; +type TaskWithoutCompletionAndFailureFields = Omit< + Task, + 'completedAt' | 'failedAt' | 'failureReason' | 'completionSummary' +>; + +function withoutClaimFields(task: Task): TaskWithoutClaimFields { + const draft: Partial = { ...task }; + delete draft.claimedBy; + delete draft.claimedAt; + delete draft.claimTTL; + return draft as TaskWithoutClaimFields; +} + +function withoutCompletionAndFailureFields( + task: TaskWithoutClaimFields, +): TaskWithoutCompletionAndFailureFields { + const draft: Partial = { ...task }; + delete draft.completedAt; + delete draft.failedAt; + delete draft.failureReason; + delete draft.completionSummary; + return draft as TaskWithoutCompletionAndFailureFields; +} + function deserializeTask(taskId: string, raw: string): Task { let parsed: unknown; diff --git a/packages/queue/tests/task-atomic.test.ts b/packages/queue/tests/task-atomic.test.ts new file mode 100644 index 0000000..f931f27 --- /dev/null +++ b/packages/queue/tests/task-atomic.test.ts @@ -0,0 +1,330 @@ +import { describe, expect, it } from 'vitest'; + +import { + RedisTaskRepository, + TaskTransitionError, + type RedisTaskClient, + type RedisTaskTransaction, +} from '../src/task-repository.js'; + +type QueuedOperation = + | { + readonly type: 'set'; + readonly key: string; + readonly value: string; + readonly mode?: 'NX' | 'XX'; + } + | { + readonly type: 'sadd'; + readonly key: string; + readonly member: string; + }; + +class InMemoryRedisBackend { + public readonly kv = new Map(); + public readonly sets = new Map>(); + public readonly revisions = new Map(); + + public getRevision(key: string): number { + return this.revisions.get(key) ?? 0; + } + + public bumpRevision(key: string): void { + this.revisions.set(key, this.getRevision(key) + 1); + } +} + +class InMemoryRedisTransaction implements RedisTaskTransaction { + private readonly operations: QueuedOperation[] = []; + + public constructor( + private readonly backend: InMemoryRedisBackend, + private readonly watchedRevisions: ReadonlyMap, + ) {} + + public set(key: string, value: string, mode?: 'NX' | 'XX'): RedisTaskTransaction { + this.operations.push({ + type: 'set', + key, + value, + mode, + }); + return this; + } + + public sadd(key: string, member: string): RedisTaskTransaction { + this.operations.push({ + type: 'sadd', + key, + member, + }); + return this; + } + + public exec(): Promise { + for (const [key, revision] of this.watchedRevisions.entries()) { + if (this.backend.getRevision(key) !== revision) { + return Promise.resolve(null); + } + } + + const results: (readonly [Error | null, unknown])[] = []; + + for (const operation of this.operations) { + if (operation.type === 'set') { + const exists = this.backend.kv.has(operation.key); + if (operation.mode === 'NX' && exists) { + results.push([null, null]); + continue; + } + + if (operation.mode === 'XX' && !exists) { + results.push([null, null]); + continue; + } + + this.backend.kv.set(operation.key, operation.value); + this.backend.bumpRevision(operation.key); + results.push([null, 'OK']); + continue; + } + + const set = this.backend.sets.get(operation.key) ?? new Set(); + const before = set.size; + + set.add(operation.member); + this.backend.sets.set(operation.key, set); + this.backend.bumpRevision(operation.key); + results.push([null, set.size === before ? 0 : 1]); + } + + return Promise.resolve(results); + } +} + +class InMemoryAtomicRedisClient implements RedisTaskClient { + private watchedRevisions = new Map(); + + public constructor(private readonly backend: InMemoryRedisBackend) {} + + public get(key: string): Promise { + return Promise.resolve(this.backend.kv.get(key) ?? null); + } + + public set( + key: string, + value: string, + mode?: 'NX' | 'XX', + ): Promise<'OK' | null> { + const exists = this.backend.kv.has(key); + + if (mode === 'NX' && exists) { + return Promise.resolve(null); + } + + if (mode === 'XX' && !exists) { + return Promise.resolve(null); + } + + this.backend.kv.set(key, value); + this.backend.bumpRevision(key); + + return Promise.resolve('OK'); + } + + public smembers(key: string): Promise { + return Promise.resolve([...(this.backend.sets.get(key) ?? new Set())]); + } + + public sadd(key: string, member: string): Promise { + const values = this.backend.sets.get(key) ?? new Set(); + const before = values.size; + + values.add(member); + this.backend.sets.set(key, values); + this.backend.bumpRevision(key); + + return Promise.resolve(values.size === before ? 0 : 1); + } + + public watch(...keys: string[]): Promise<'OK'> { + this.watchedRevisions = new Map( + keys.map((key) => [key, this.backend.getRevision(key)]), + ); + return Promise.resolve('OK'); + } + + public unwatch(): Promise<'OK'> { + this.watchedRevisions.clear(); + return Promise.resolve('OK'); + } + + public multi(): RedisTaskTransaction { + const watchedSnapshot = new Map(this.watchedRevisions); + this.watchedRevisions.clear(); + return new InMemoryRedisTransaction(this.backend, watchedSnapshot); + } +} + +function createRepositoryPair(now: () => number): [RedisTaskRepository, RedisTaskRepository] { + const backend = new InMemoryRedisBackend(); + + return [ + new RedisTaskRepository({ + client: new InMemoryAtomicRedisClient(backend), + now, + }), + new RedisTaskRepository({ + client: new InMemoryAtomicRedisClient(backend), + now, + }), + ]; +} + +describe('RedisTaskRepository atomic transitions', () => { + it('claims a pending task once and blocks concurrent double-claim', async () => { + let timestamp = 1_700_000_000_000; + const now = (): number => timestamp; + const [repositoryA, repositoryB] = createRepositoryPair(now); + + await repositoryA.create({ + project: 'queue', + mission: 'phase1', + taskId: 'MQ-004', + title: 'Atomic claim', + }); + + const [claimA, claimB] = await Promise.allSettled([ + repositoryA.claim('MQ-004', { agentId: 'agent-a', ttlSeconds: 60 }), + repositoryB.claim('MQ-004', { agentId: 'agent-b', ttlSeconds: 60 }), + ]); + + const fulfilled = [claimA, claimB].filter((result) => result.status === 'fulfilled'); + const rejected = [claimA, claimB].filter((result) => result.status === 'rejected'); + + expect(fulfilled).toHaveLength(1); + expect(rejected).toHaveLength(1); + }); + + it('allows claim takeover after TTL expiry', async () => { + let timestamp = 1_700_000_000_000; + const now = (): number => timestamp; + const [repositoryA, repositoryB] = createRepositoryPair(now); + + await repositoryA.create({ + project: 'queue', + mission: 'phase1', + taskId: 'MQ-004-EXP', + title: 'TTL expiry', + }); + + await repositoryA.claim('MQ-004-EXP', { + agentId: 'agent-a', + ttlSeconds: 1, + }); + + timestamp += 2_000; + + const takeover = await repositoryB.claim('MQ-004-EXP', { + agentId: 'agent-b', + ttlSeconds: 60, + }); + + expect(takeover.claimedBy).toBe('agent-b'); + }); + + it('releases a claimed task back to pending', async () => { + const [repository] = createRepositoryPair(() => 1_700_000_000_000); + + await repository.create({ + project: 'queue', + mission: 'phase1', + taskId: 'MQ-004-REL', + title: 'Release test', + }); + + await repository.claim('MQ-004-REL', { + agentId: 'agent-a', + ttlSeconds: 60, + }); + + const released = await repository.release('MQ-004-REL', { + agentId: 'agent-a', + }); + + expect(released.status).toBe('pending'); + expect(released.claimedBy).toBeUndefined(); + expect(released.claimedAt).toBeUndefined(); + }); + + it('heartbeats, completes, and fails with valid transitions', async () => { + let timestamp = 1_700_000_000_000; + const now = (): number => timestamp; + const [repository] = createRepositoryPair(now); + + await repository.create({ + project: 'queue', + mission: 'phase1', + taskId: 'MQ-004-HCF', + title: 'Transition test', + }); + + await repository.claim('MQ-004-HCF', { + agentId: 'agent-a', + ttlSeconds: 60, + }); + + timestamp += 1_000; + const heartbeat = await repository.heartbeat('MQ-004-HCF', { + agentId: 'agent-a', + ttlSeconds: 120, + }); + expect(heartbeat.claimTTL).toBe(120); + expect(heartbeat.claimedAt).toBe(1_700_000_001_000); + + const completed = await repository.complete('MQ-004-HCF', { + agentId: 'agent-a', + summary: 'done', + }); + expect(completed.status).toBe('completed'); + expect(completed.completionSummary).toBe('done'); + + await repository.create({ + project: 'queue', + mission: 'phase1', + taskId: 'MQ-004-FAIL', + title: 'Failure test', + }); + + await repository.claim('MQ-004-FAIL', { + agentId: 'agent-a', + ttlSeconds: 60, + }); + + const failed = await repository.fail('MQ-004-FAIL', { + agentId: 'agent-a', + reason: 'boom', + }); + + expect(failed.status).toBe('failed'); + expect(failed.failureReason).toBe('boom'); + expect(failed.retryCount).toBe(1); + }); + + it('rejects invalid transitions', async () => { + const [repository] = createRepositoryPair(() => 1_700_000_000_000); + + await repository.create({ + project: 'queue', + mission: 'phase1', + taskId: 'MQ-004-INV', + title: 'Invalid transitions', + }); + + await expect( + repository.complete('MQ-004-INV', { + agentId: 'agent-a', + }), + ).rejects.toBeInstanceOf(TaskTransitionError); + }); +}); diff --git a/packages/queue/tests/task-repository.test.ts b/packages/queue/tests/task-repository.test.ts index 180b7df..226d546 100644 --- a/packages/queue/tests/task-repository.test.ts +++ b/packages/queue/tests/task-repository.test.ts @@ -4,8 +4,23 @@ import { RedisTaskRepository, TaskAlreadyExistsError, type RedisTaskClient, + type RedisTaskTransaction, } from '../src/task-repository.js'; +class NoopRedisTransaction implements RedisTaskTransaction { + public set(): RedisTaskTransaction { + return this; + } + + public sadd(): RedisTaskTransaction { + return this; + } + + public exec(): Promise { + return Promise.resolve([]); + } +} + class InMemoryRedisClient implements RedisTaskClient { private readonly kv = new Map(); private readonly sets = new Map>(); @@ -46,6 +61,18 @@ class InMemoryRedisClient implements RedisTaskClient { return Promise.resolve(values.size === beforeSize ? 0 : 1); } + + public watch(): Promise<'OK'> { + return Promise.resolve('OK'); + } + + public unwatch(): Promise<'OK'> { + return Promise.resolve('OK'); + } + + public multi(): RedisTaskTransaction { + return new NoopRedisTransaction(); + } } describe('RedisTaskRepository CRUD', () => { -- 2.49.1 From 9b2db93afcb4f3ab66e030e1d4887c7f66ca1b78 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Fri, 6 Mar 2026 09:29:41 -0600 Subject: [PATCH 5/8] feat(queue): add commander CLI for core queue ops (MQ-005) --- packages/queue/package.json | 1 + packages/queue/src/cli.ts | 345 +++++++++++++++++++++++++++++++ packages/queue/src/index.ts | 6 + packages/queue/tests/cli.test.ts | 218 +++++++++++++++++++ pnpm-lock.yaml | 9 + 5 files changed, 579 insertions(+) create mode 100644 packages/queue/src/cli.ts create mode 100644 packages/queue/tests/cli.test.ts diff --git a/packages/queue/package.json b/packages/queue/package.json index 5aa258b..8942e0e 100644 --- a/packages/queue/package.json +++ b/packages/queue/package.json @@ -14,6 +14,7 @@ "test": "vitest run" }, "dependencies": { + "commander": "^14.0.3", "ioredis": "^5.10.0" } } diff --git a/packages/queue/src/cli.ts b/packages/queue/src/cli.ts new file mode 100644 index 0000000..a42bf25 --- /dev/null +++ b/packages/queue/src/cli.ts @@ -0,0 +1,345 @@ +import { + Command, + CommanderError, + InvalidArgumentError, + Option, +} from 'commander'; + +import { assertRedisHealthy, createRedisClient } from './redis-connection.js'; +import { + RedisTaskRepository, + type ClaimTaskInput, + type CompleteTaskInput, + type RedisTaskClient, +} from './task-repository.js'; +import { + TASK_LANES, + TASK_PRIORITIES, + TASK_STATUSES, + type CreateTaskInput, + type TaskLane, + type TaskListFilters, + type TaskPriority, + type TaskStatus, +} from './task.js'; + +export type QueueRepository = Pick< + RedisTaskRepository, + 'create' | 'list' | 'get' | 'claim' | 'release' | 'complete' +>; + +export interface QueueRepositorySession { + readonly repository: QueueRepository; + readonly close: () => Promise; +} + +export interface QueueCliDependencies { + readonly openSession: () => Promise; + readonly stdout: (line: string) => void; + readonly stderr: (line: string) => void; +} + +interface CreateCommandOptions { + readonly title: string; + readonly description?: string; + readonly priority?: TaskPriority; + readonly lane?: TaskLane; + readonly dependency?: string[]; +} + +interface ListCommandOptions { + readonly project?: string; + readonly mission?: string; + readonly status?: TaskStatus; +} + +interface ClaimCommandOptions { + readonly agent: string; + readonly ttl: number; +} + +interface ReleaseCommandOptions { + readonly agent?: string; +} + +interface CompleteCommandOptions { + readonly agent?: string; + readonly summary?: string; +} + +interface ClosableRedisTaskClient extends RedisTaskClient { + quit(): Promise; +} + +const DEFAULT_DEPENDENCIES: QueueCliDependencies = { + openSession: openRedisSession, + stdout: (line: string) => { + console.log(line); + }, + stderr: (line: string) => { + console.error(line); + }, +}; + +const PRIORITY_SET = new Set(TASK_PRIORITIES); +const LANE_SET = new Set(TASK_LANES); +const STATUS_SET = new Set(TASK_STATUSES); + +export function buildQueueCli( + dependencyOverrides: Partial = {}, +): Command { + const dependencies = resolveDependencies(dependencyOverrides); + const program = new Command(); + program + .name('mosaic') + .description('mosaic queue command line interface') + .exitOverride(); + + program.configureOutput({ + writeOut: (output: string) => dependencies.stdout(output.trimEnd()), + writeErr: (output: string) => dependencies.stderr(output.trimEnd()), + }); + + const queue = program.command('queue').description('Manage queue tasks'); + + queue + .command('create ') + .description('Create a queue task') + .requiredOption('--title ', 'Task title') + .option('--description <description>', 'Task description') + .addOption( + new Option('--priority <priority>', 'Task priority') + .choices(TASK_PRIORITIES) + .argParser(parsePriority), + ) + .addOption( + new Option('--lane <lane>', 'Task lane').choices(TASK_LANES).argParser(parseLane), + ) + .option('--dependency <taskIds...>', 'Task dependencies') + .action( + async ( + project: string, + mission: string, + taskId: string, + options: CreateCommandOptions, + ) => { + await withSession(dependencies, async (repository) => { + const payload: CreateTaskInput = { + project, + mission, + taskId, + title: options.title, + description: options.description, + priority: options.priority, + dependencies: options.dependency, + lane: options.lane, + }; + const task = await repository.create(payload); + dependencies.stdout(JSON.stringify(task, null, 2)); + }); + }, + ); + + queue + .command('list') + .description('List queue tasks') + .option('--project <project>', 'Filter by project') + .option('--mission <mission>', 'Filter by mission') + .addOption( + new Option('--status <status>', 'Filter by status') + .choices(TASK_STATUSES) + .argParser(parseStatus), + ) + .action(async (options: ListCommandOptions) => { + await withSession(dependencies, async (repository) => { + const filters: TaskListFilters = { + project: options.project, + mission: options.mission, + status: options.status, + }; + const tasks = await repository.list(filters); + dependencies.stdout(JSON.stringify(tasks, null, 2)); + }); + }); + + queue + .command('show <taskId>') + .description('Show a single queue task') + .action(async (taskId: string) => { + await withSession(dependencies, async (repository) => { + const task = await repository.get(taskId); + + if (task === null) { + throw new Error(`Task ${taskId} was not found.`); + } + + dependencies.stdout(JSON.stringify(task, null, 2)); + }); + }); + + queue + .command('claim <taskId>') + .description('Claim a pending task') + .requiredOption('--agent <agentId>', 'Agent identifier') + .requiredOption('--ttl <seconds>', 'Claim TTL in seconds', parsePositiveInteger) + .action(async (taskId: string, options: ClaimCommandOptions) => { + await withSession(dependencies, async (repository) => { + const claimInput: ClaimTaskInput = { + agentId: options.agent, + ttlSeconds: options.ttl, + }; + const task = await repository.claim(taskId, claimInput); + dependencies.stdout(JSON.stringify(task, null, 2)); + }); + }); + + queue + .command('release <taskId>') + .description('Release a claimed task back to pending') + .option('--agent <agentId>', 'Expected owner agent id') + .action(async (taskId: string, options: ReleaseCommandOptions) => { + await withSession(dependencies, async (repository) => { + const task = await repository.release(taskId, { + agentId: options.agent, + }); + dependencies.stdout(JSON.stringify(task, null, 2)); + }); + }); + + queue + .command('complete <taskId>') + .description('Complete a claimed task') + .option('--agent <agentId>', 'Expected owner agent id') + .option('--summary <summary>', 'Optional completion summary') + .action(async (taskId: string, options: CompleteCommandOptions) => { + await withSession(dependencies, async (repository) => { + const completeInput: CompleteTaskInput = { + agentId: options.agent, + summary: options.summary, + }; + const task = await repository.complete(taskId, completeInput); + dependencies.stdout(JSON.stringify(task, null, 2)); + }); + }); + + return program; +} + +export async function runQueueCli( + argv: string[] = process.argv, + dependencyOverrides: Partial<QueueCliDependencies> = {}, +): Promise<number> { + const dependencies = resolveDependencies(dependencyOverrides); + const program = buildQueueCli(dependencies); + + try { + await program.parseAsync(argv, { + from: 'node', + }); + return 0; + } catch (error) { + if (error instanceof CommanderError) { + if (error.code === 'commander.helpDisplayed') { + return 0; + } + + if (error.code.startsWith('commander.')) { + return error.exitCode; + } + } + + dependencies.stderr(formatError(error)); + return 1; + } +} + +async function openRedisSession(): Promise<QueueRepositorySession> { + const redisClient = createRedisClient<ClosableRedisTaskClient>(); + + try { + await assertRedisHealthy(redisClient); + + return { + repository: new RedisTaskRepository({ + client: redisClient, + }), + close: async () => { + await redisClient.quit(); + }, + }; + } catch (error) { + await redisClient.quit(); + throw error; + } +} + +async function withSession( + dependencies: QueueCliDependencies, + action: (repository: QueueRepository) => Promise<void>, +): Promise<void> { + const session = await dependencies.openSession(); + + try { + await action(session.repository); + } finally { + await session.close(); + } +} + +function resolveDependencies( + overrides: Partial<QueueCliDependencies>, +): QueueCliDependencies { + const openSession = overrides.openSession ?? DEFAULT_DEPENDENCIES.openSession; + const stdout = overrides.stdout ?? DEFAULT_DEPENDENCIES.stdout; + const stderr = overrides.stderr ?? DEFAULT_DEPENDENCIES.stderr; + + return { + openSession: () => openSession(), + stdout: (line: string) => stdout(line), + stderr: (line: string) => stderr(line), + }; +} + +function parsePositiveInteger(value: string): number { + const parsed = Number.parseInt(value, 10); + + if (!Number.isInteger(parsed) || parsed <= 0) { + throw new InvalidArgumentError(`Expected a positive integer, received "${value}"`); + } + + return parsed; +} + +function parsePriority(value: string): TaskPriority { + if (!PRIORITY_SET.has(value as TaskPriority)) { + throw new InvalidArgumentError( + `Expected one of ${TASK_PRIORITIES.join(', ')}, received "${value}"`, + ); + } + + return value as TaskPriority; +} + +function parseLane(value: string): TaskLane { + if (!LANE_SET.has(value as TaskLane)) { + throw new InvalidArgumentError( + `Expected one of ${TASK_LANES.join(', ')}, received "${value}"`, + ); + } + + return value as TaskLane; +} + +function parseStatus(value: string): TaskStatus { + if (!STATUS_SET.has(value as TaskStatus)) { + throw new InvalidArgumentError( + `Expected one of ${TASK_STATUSES.join(', ')}, received "${value}"`, + ); + } + + return value as TaskStatus; +} + +function formatError(error: unknown): string { + return error instanceof Error ? error.message : String(error); +} diff --git a/packages/queue/src/index.ts b/packages/queue/src/index.ts index 1a005ff..f991cac 100644 --- a/packages/queue/src/index.ts +++ b/packages/queue/src/index.ts @@ -45,3 +45,9 @@ export type { TaskStatus, TaskUpdateInput, } from './task.js'; +export { buildQueueCli, runQueueCli } from './cli.js'; +export type { + QueueCliDependencies, + QueueRepository, + QueueRepositorySession, +} from './cli.js'; diff --git a/packages/queue/tests/cli.test.ts b/packages/queue/tests/cli.test.ts new file mode 100644 index 0000000..7101eac --- /dev/null +++ b/packages/queue/tests/cli.test.ts @@ -0,0 +1,218 @@ +import { describe, expect, it, vi } from 'vitest'; + +import { runQueueCli, type QueueCliDependencies, type QueueRepository } from '../src/cli.js'; + +function createRepositoryMock(): QueueRepository { + return { + create: vi.fn(() => + Promise.resolve({ + id: 'MQ-005', + project: 'queue', + mission: 'phase1', + taskId: 'MQ-005', + title: 'Build CLI', + status: 'pending', + priority: 'medium', + dependencies: [], + lane: 'any', + retryCount: 0, + createdAt: 1, + updatedAt: 1, + }), + ), + list: vi.fn(() => Promise.resolve([])), + get: vi.fn(() => Promise.resolve(null)), + claim: vi.fn(() => + Promise.resolve({ + id: 'MQ-005', + project: 'queue', + mission: 'phase1', + taskId: 'MQ-005', + title: 'Build CLI', + status: 'claimed', + priority: 'medium', + dependencies: [], + lane: 'any', + claimedBy: 'agent-a', + claimedAt: 2, + claimTTL: 60, + retryCount: 0, + createdAt: 1, + updatedAt: 2, + }), + ), + release: vi.fn(() => + Promise.resolve({ + id: 'MQ-005', + project: 'queue', + mission: 'phase1', + taskId: 'MQ-005', + title: 'Build CLI', + status: 'pending', + priority: 'medium', + dependencies: [], + lane: 'any', + retryCount: 0, + createdAt: 1, + updatedAt: 3, + }), + ), + complete: vi.fn(() => + Promise.resolve({ + id: 'MQ-005', + project: 'queue', + mission: 'phase1', + taskId: 'MQ-005', + title: 'Build CLI', + status: 'completed', + priority: 'medium', + dependencies: [], + lane: 'any', + completionSummary: 'done', + retryCount: 0, + createdAt: 1, + updatedAt: 4, + completedAt: 4, + }), + ), + }; +} + +function createDependencies( + repository: QueueRepository, +): QueueCliDependencies & { outputs: string[]; errors: string[] } { + const outputs: string[] = []; + const errors: string[] = []; + const close = vi.fn(() => Promise.resolve(undefined)); + + return { + openSession: () => + Promise.resolve({ + repository, + close, + }), + stdout: (line) => { + outputs.push(line); + }, + stderr: (line) => { + errors.push(line); + }, + outputs, + errors, + }; +} + +describe('runQueueCli', () => { + it('creates a task from command options', async () => { + const repository = createRepositoryMock(); + const dependencies = createDependencies(repository); + + const exitCode = await runQueueCli( + [ + 'node', + 'mosaic', + 'queue', + 'create', + 'queue', + 'phase1', + 'MQ-005', + '--title', + 'Build CLI', + '--priority', + 'high', + '--lane', + 'coding', + '--dependency', + 'MQ-002', + 'MQ-003', + ], + dependencies, + ); + + expect(exitCode).toBe(0); + expect(repository.create).toHaveBeenCalledWith({ + project: 'queue', + mission: 'phase1', + taskId: 'MQ-005', + title: 'Build CLI', + description: undefined, + priority: 'high', + dependencies: ['MQ-002', 'MQ-003'], + lane: 'coding', + }); + }); + + it('lists tasks with filters', async () => { + const repository = createRepositoryMock(); + const dependencies = createDependencies(repository); + + const exitCode = await runQueueCli( + [ + 'node', + 'mosaic', + 'queue', + 'list', + '--project', + 'queue', + '--mission', + 'phase1', + '--status', + 'pending', + ], + dependencies, + ); + + expect(exitCode).toBe(0); + expect(repository.list).toHaveBeenCalledWith({ + project: 'queue', + mission: 'phase1', + status: 'pending', + }); + }); + + it('claims and completes tasks with typed options', async () => { + const repository = createRepositoryMock(); + const dependencies = createDependencies(repository); + + const claimExitCode = await runQueueCli( + [ + 'node', + 'mosaic', + 'queue', + 'claim', + 'MQ-005', + '--agent', + 'agent-a', + '--ttl', + '60', + ], + dependencies, + ); + + const completeExitCode = await runQueueCli( + [ + 'node', + 'mosaic', + 'queue', + 'complete', + 'MQ-005', + '--agent', + 'agent-a', + '--summary', + 'done', + ], + dependencies, + ); + + expect(claimExitCode).toBe(0); + expect(completeExitCode).toBe(0); + expect(repository.claim).toHaveBeenCalledWith('MQ-005', { + agentId: 'agent-a', + ttlSeconds: 60, + }); + expect(repository.complete).toHaveBeenCalledWith('MQ-005', { + agentId: 'agent-a', + summary: 'done', + }); + }); +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index acb4068..7030b18 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,6 +29,9 @@ importers: packages/queue: dependencies: + commander: + specifier: ^14.0.3 + version: 14.0.3 ioredis: specifier: ^5.10.0 version: 5.10.0 @@ -548,6 +551,10 @@ packages: color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + commander@14.0.3: + resolution: {integrity: sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==} + engines: {node: '>=20'} + concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} @@ -1447,6 +1454,8 @@ snapshots: color-name@1.1.4: {} + commander@14.0.3: {} + concat-map@0.0.1: {} cross-spawn@7.0.6: -- 2.49.1 From 869f9b49dfd3919ac5a3de62816d689855c3038c Mon Sep 17 00:00:00 2001 From: Jason Woltje <jason@diversecanvas.com> Date: Fri, 6 Mar 2026 09:36:18 -0600 Subject: [PATCH 6/8] feat(queue): add MCP server tools for queue operations (MQ-006) --- packages/queue/package.json | 4 +- packages/queue/src/index.ts | 20 + packages/queue/src/mcp-server.ts | 308 +++++++++++ packages/queue/src/mcp-tool-schemas.ts | 44 ++ packages/queue/tests/mcp-server.test.ts | 50 ++ pnpm-lock.yaml | 696 ++++++++++++++++++++++++ 6 files changed, 1121 insertions(+), 1 deletion(-) create mode 100644 packages/queue/src/mcp-server.ts create mode 100644 packages/queue/src/mcp-tool-schemas.ts create mode 100644 packages/queue/tests/mcp-server.test.ts diff --git a/packages/queue/package.json b/packages/queue/package.json index 8942e0e..3fa4860 100644 --- a/packages/queue/package.json +++ b/packages/queue/package.json @@ -14,7 +14,9 @@ "test": "vitest run" }, "dependencies": { + "@modelcontextprotocol/sdk": "^1.27.1", "commander": "^14.0.3", - "ioredis": "^5.10.0" + "ioredis": "^5.10.0", + "zod": "^4.3.6" } } diff --git a/packages/queue/src/index.ts b/packages/queue/src/index.ts index f991cac..ded39f7 100644 --- a/packages/queue/src/index.ts +++ b/packages/queue/src/index.ts @@ -51,3 +51,23 @@ export type { QueueRepository, QueueRepositorySession, } from './cli.js'; +export { + QUEUE_MCP_TOOL_DEFINITIONS, + buildQueueMcpServer, + startQueueMcpServer, +} from './mcp-server.js'; +export type { + QueueMcpDependencies, + QueueMcpRepository, + QueueMcpSession, +} from './mcp-server.js'; +export { + queueClaimToolInputSchema, + queueCompleteToolInputSchema, + queueFailToolInputSchema, + queueGetToolInputSchema, + queueHeartbeatToolInputSchema, + queueListToolInputSchema, + queueReleaseToolInputSchema, + queueStatusToolInputSchema, +} from './mcp-tool-schemas.js'; diff --git a/packages/queue/src/mcp-server.ts b/packages/queue/src/mcp-server.ts new file mode 100644 index 0000000..d02a774 --- /dev/null +++ b/packages/queue/src/mcp-server.ts @@ -0,0 +1,308 @@ +import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; +import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; +import type { CallToolResult, Implementation } from '@modelcontextprotocol/sdk/types.js'; +import type { z } from 'zod'; + +import { + assertRedisHealthy, + createRedisClient, + runRedisHealthCheck, + type RedisHealthCheck, +} from './redis-connection.js'; +import { + queueClaimToolInputSchema, + queueCompleteToolInputSchema, + queueFailToolInputSchema, + queueGetToolInputSchema, + queueHeartbeatToolInputSchema, + queueListToolInputSchema, + queueReleaseToolInputSchema, + queueStatusToolInputSchema, +} from './mcp-tool-schemas.js'; +import { + RedisTaskRepository, + type RedisTaskClient, +} from './task-repository.js'; +import { TASK_STATUSES, type Task, type TaskStatus } from './task.js'; + +export type QueueMcpRepository = Pick< + RedisTaskRepository, + 'list' | 'get' | 'claim' | 'heartbeat' | 'release' | 'complete' | 'fail' +>; + +export interface QueueMcpSession { + readonly repository: QueueMcpRepository; + readonly checkHealth: () => Promise<RedisHealthCheck>; + readonly close: () => Promise<void>; +} + +export interface QueueMcpDependencies { + readonly openSession: () => Promise<QueueMcpSession>; + readonly serverInfo: Implementation; +} + +type ToolSchema = z.ZodObject<Record<string, z.ZodTypeAny>>; + +interface QueueMcpToolDefinition<TArgs extends z.ZodTypeAny> { + readonly name: string; + readonly description: string; + readonly inputSchema: TArgs; + readonly execute: ( + session: QueueMcpSession, + input: z.output<TArgs>, + ) => Promise<unknown>; +} + +interface ClosableRedisTaskClient extends RedisTaskClient { + quit(): Promise<string>; +} + +const DEFAULT_SERVER_INFO: Implementation = { + name: 'mosaic-queue', + version: '0.0.1', +}; + +const DEFAULT_DEPENDENCIES: QueueMcpDependencies = { + openSession: openRedisMcpSession, + serverInfo: DEFAULT_SERVER_INFO, +}; + +export const QUEUE_MCP_TOOL_DEFINITIONS = [ + { + name: 'queue_list', + description: 'List queue tasks with optional project/mission/status filters', + inputSchema: queueListToolInputSchema, + execute: async (session, input) => { + const tasks = await session.repository.list(input); + return { + tasks, + }; + }, + }, + { + name: 'queue_get', + description: 'Get a single queue task by taskId', + inputSchema: queueGetToolInputSchema, + execute: async (session, input) => { + const task = await session.repository.get(input.taskId); + return { + task, + }; + }, + }, + { + name: 'queue_claim', + description: 'Atomically claim a task for an agent', + inputSchema: queueClaimToolInputSchema, + execute: async (session, input) => { + const task = await session.repository.claim(input.taskId, { + agentId: input.agentId, + ttlSeconds: input.ttlSeconds, + }); + + return { + task, + }; + }, + }, + { + name: 'queue_heartbeat', + description: 'Refresh claim ownership TTL for a task', + inputSchema: queueHeartbeatToolInputSchema, + execute: async (session, input) => { + const task = await session.repository.heartbeat(input.taskId, { + agentId: input.agentId, + ttlSeconds: input.ttlSeconds, + }); + + return { + task, + }; + }, + }, + { + name: 'queue_release', + description: 'Release a claimed task back to pending', + inputSchema: queueReleaseToolInputSchema, + execute: async (session, input) => { + const task = await session.repository.release(input.taskId, { + agentId: input.agentId, + }); + + return { + task, + }; + }, + }, + { + name: 'queue_complete', + description: 'Mark a claimed task as completed', + inputSchema: queueCompleteToolInputSchema, + execute: async (session, input) => { + const task = await session.repository.complete(input.taskId, { + agentId: input.agentId, + summary: input.summary, + }); + + return { + task, + }; + }, + }, + { + name: 'queue_fail', + description: 'Mark a claimed task as failed with a reason', + inputSchema: queueFailToolInputSchema, + execute: async (session, input) => { + const task = await session.repository.fail(input.taskId, { + agentId: input.agentId, + reason: input.reason, + }); + + return { + task, + }; + }, + }, + { + name: 'queue_status', + description: 'Return queue health and task status counters', + inputSchema: queueStatusToolInputSchema, + execute: async (session) => { + const tasks = await session.repository.list({}); + const health = await session.checkHealth(); + const counts = countStatuses(tasks); + + return { + health, + counts, + total: tasks.length, + }; + }, + }, +] as const satisfies readonly QueueMcpToolDefinition<ToolSchema>[]; + +export function buildQueueMcpServer( + dependencyOverrides: Partial<QueueMcpDependencies> = {}, +): McpServer { + const dependencies = resolveDependencies(dependencyOverrides); + const server = new McpServer(dependencies.serverInfo); + + for (const definition of QUEUE_MCP_TOOL_DEFINITIONS) { + server.registerTool( + definition.name, + { + description: definition.description, + inputSchema: definition.inputSchema, + }, + async (args) => { + return withSession(dependencies, async (session) => { + try { + const parsedArgs = definition.inputSchema.parse(args); + const response = await definition.execute(session, parsedArgs); + return toToolResult(response); + } catch (error) { + return toToolErrorResult(error); + } + }); + }, + ); + } + + return server; +} + +export async function startQueueMcpServer( + dependencyOverrides: Partial<QueueMcpDependencies> = {}, +): Promise<McpServer> { + const server = buildQueueMcpServer(dependencyOverrides); + const transport = new StdioServerTransport(); + await server.connect(transport); + return server; +} + +function resolveDependencies( + overrides: Partial<QueueMcpDependencies>, +): QueueMcpDependencies { + const openSession = overrides.openSession ?? DEFAULT_DEPENDENCIES.openSession; + const serverInfo = overrides.serverInfo ?? DEFAULT_DEPENDENCIES.serverInfo; + + return { + openSession: () => openSession(), + serverInfo, + }; +} + +async function withSession( + dependencies: QueueMcpDependencies, + handler: (session: QueueMcpSession) => Promise<CallToolResult>, +): Promise<CallToolResult> { + const session = await dependencies.openSession(); + + try { + return await handler(session); + } finally { + await session.close(); + } +} + +async function openRedisMcpSession(): Promise<QueueMcpSession> { + const redisClient = createRedisClient<ClosableRedisTaskClient>(); + + try { + await assertRedisHealthy(redisClient); + + return { + repository: new RedisTaskRepository({ + client: redisClient, + }), + checkHealth: async () => runRedisHealthCheck(redisClient), + close: async () => { + await redisClient.quit(); + }, + }; + } catch (error) { + await redisClient.quit(); + throw error; + } +} + +function toToolResult(payload: unknown): CallToolResult { + return { + content: [ + { + type: 'text', + text: JSON.stringify(payload, null, 2), + }, + ], + }; +} + +function toToolErrorResult(error: unknown): CallToolResult { + return { + isError: true, + content: [ + { + type: 'text', + text: formatError(error), + }, + ], + }; +} + +function formatError(error: unknown): string { + return error instanceof Error ? error.message : String(error); +} + +function countStatuses(tasks: readonly Task[]): Record<TaskStatus, number> { + const counts = Object.fromEntries(TASK_STATUSES.map((status) => [status, 0])) as Record< + TaskStatus, + number + >; + + for (const task of tasks) { + counts[task.status] += 1; + } + + return counts; +} diff --git a/packages/queue/src/mcp-tool-schemas.ts b/packages/queue/src/mcp-tool-schemas.ts new file mode 100644 index 0000000..bd0c4f9 --- /dev/null +++ b/packages/queue/src/mcp-tool-schemas.ts @@ -0,0 +1,44 @@ +import { z } from 'zod'; + +import { TASK_STATUSES } from './task.js'; + +export const queueListToolInputSchema = z.object({ + project: z.string().min(1).optional(), + mission: z.string().min(1).optional(), + status: z.enum(TASK_STATUSES).optional(), +}); + +export const queueGetToolInputSchema = z.object({ + taskId: z.string().min(1), +}); + +export const queueClaimToolInputSchema = z.object({ + taskId: z.string().min(1), + agentId: z.string().min(1), + ttlSeconds: z.number().int().positive(), +}); + +export const queueHeartbeatToolInputSchema = z.object({ + taskId: z.string().min(1), + agentId: z.string().min(1).optional(), + ttlSeconds: z.number().int().positive().optional(), +}); + +export const queueReleaseToolInputSchema = z.object({ + taskId: z.string().min(1), + agentId: z.string().min(1).optional(), +}); + +export const queueCompleteToolInputSchema = z.object({ + taskId: z.string().min(1), + agentId: z.string().min(1).optional(), + summary: z.string().min(1).optional(), +}); + +export const queueFailToolInputSchema = z.object({ + taskId: z.string().min(1), + agentId: z.string().min(1).optional(), + reason: z.string().min(1), +}); + +export const queueStatusToolInputSchema = z.object({}); diff --git a/packages/queue/tests/mcp-server.test.ts b/packages/queue/tests/mcp-server.test.ts new file mode 100644 index 0000000..4d92867 --- /dev/null +++ b/packages/queue/tests/mcp-server.test.ts @@ -0,0 +1,50 @@ +import { describe, expect, it } from 'vitest'; + +import { + QUEUE_MCP_TOOL_DEFINITIONS, + buildQueueMcpServer, +} from '../src/mcp-server.js'; + +describe('queue MCP server', () => { + it('declares all required phase-1 tools', () => { + const toolNames = QUEUE_MCP_TOOL_DEFINITIONS.map((tool) => tool.name).sort(); + + expect(toolNames).toEqual([ + 'queue_claim', + 'queue_complete', + 'queue_fail', + 'queue_get', + 'queue_heartbeat', + 'queue_list', + 'queue_release', + 'queue_status', + ]); + }); + + it('builds an MCP server instance', () => { + const server = buildQueueMcpServer({ + openSession: () => + Promise.resolve({ + repository: { + list: () => Promise.resolve([]), + get: () => Promise.resolve(null), + claim: () => Promise.reject(new Error('not implemented')), + heartbeat: () => Promise.reject(new Error('not implemented')), + release: () => Promise.reject(new Error('not implemented')), + complete: () => Promise.reject(new Error('not implemented')), + fail: () => Promise.reject(new Error('not implemented')), + }, + checkHealth: () => + Promise.resolve({ + checkedAt: 1, + latencyMs: 0, + ok: true, + response: 'PONG', + }), + close: () => Promise.resolve(), + }), + }); + + expect(server).toBeDefined(); + }); +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7030b18..ca4b854 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,12 +29,18 @@ importers: packages/queue: dependencies: + '@modelcontextprotocol/sdk': + specifier: ^1.27.1 + version: 1.27.1(zod@4.3.6) commander: specifier: ^14.0.3 version: 14.0.3 ioredis: specifier: ^5.10.0 version: 5.10.0 + zod: + specifier: ^4.3.6 + version: 4.3.6 packages: @@ -232,6 +238,12 @@ packages: resolution: {integrity: sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@hono/node-server@1.19.11': + resolution: {integrity: sha512-dr8/3zEaB+p0D2n/IUrlPF1HZm586qgJNXK1a9fhg/PzdtkK7Ksd5l312tJX2yBuALqDYBlG20QEbayqPyxn+g==} + engines: {node: '>=18.14.1'} + peerDependencies: + hono: ^4 + '@humanfs/core@0.19.1': resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} engines: {node: '>=18.18.0'} @@ -254,6 +266,16 @@ packages: '@jridgewell/sourcemap-codec@1.5.5': resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} + '@modelcontextprotocol/sdk@1.27.1': + resolution: {integrity: sha512-sr6GbP+4edBwFndLbM60gf07z0FQ79gaExpnsjMGePXqFcSSb7t6iscpjk9DhFhwd+mTEQrzNafGP8/iGGFYaA==} + engines: {node: '>=18'} + peerDependencies: + '@cfworker/json-schema': ^4.1.1 + zod: ^3.25 || ^4.0 + peerDependenciesMeta: + '@cfworker/json-schema': + optional: true + '@rollup/rollup-android-arm-eabi@4.59.0': resolution: {integrity: sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg==} cpu: [arm] @@ -482,6 +504,10 @@ packages: '@vitest/utils@3.2.4': resolution: {integrity: sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==} + accepts@2.0.0: + resolution: {integrity: sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==} + engines: {node: '>= 0.6'} + acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -492,9 +518,20 @@ packages: engines: {node: '>=0.4.0'} hasBin: true + ajv-formats@3.0.1: + resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + ajv@6.14.0: resolution: {integrity: sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==} + ajv@8.18.0: + resolution: {integrity: sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==} + ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} @@ -513,6 +550,10 @@ packages: resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} engines: {node: 18 || 20 || >=22} + body-parser@2.2.2: + resolution: {integrity: sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==} + engines: {node: '>=18'} + brace-expansion@1.1.12: resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==} @@ -520,10 +561,22 @@ packages: resolution: {integrity: sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==} engines: {node: 18 || 20 || >=22} + bytes@3.1.2: + resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} + engines: {node: '>= 0.8'} + cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} + call-bind-apply-helpers@1.0.2: + resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} + engines: {node: '>= 0.4'} + + call-bound@1.0.4: + resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} + engines: {node: '>= 0.4'} + callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -558,6 +611,26 @@ packages: concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + content-disposition@1.0.1: + resolution: {integrity: sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==} + engines: {node: '>=18'} + + content-type@1.0.5: + resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} + engines: {node: '>= 0.6'} + + cookie-signature@1.2.2: + resolution: {integrity: sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==} + engines: {node: '>=6.6.0'} + + cookie@0.7.2: + resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==} + engines: {node: '>= 0.6'} + + cors@2.8.6: + resolution: {integrity: sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==} + engines: {node: '>= 0.10'} + cross-spawn@7.0.6: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} @@ -582,14 +655,44 @@ packages: resolution: {integrity: sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==} engines: {node: '>=0.10'} + depd@2.0.0: + resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} + engines: {node: '>= 0.8'} + + dunder-proto@1.0.1: + resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} + engines: {node: '>= 0.4'} + + ee-first@1.1.1: + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + + encodeurl@2.0.0: + resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==} + engines: {node: '>= 0.8'} + + es-define-property@1.0.1: + resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} + engines: {node: '>= 0.4'} + + es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + es-module-lexer@1.7.0: resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} + es-object-atoms@1.1.1: + resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} + engines: {node: '>= 0.4'} + esbuild@0.27.3: resolution: {integrity: sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==} engines: {node: '>=18'} hasBin: true + escape-html@1.0.3: + resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} @@ -643,10 +746,32 @@ packages: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} + etag@1.8.1: + resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} + engines: {node: '>= 0.6'} + + eventsource-parser@3.0.6: + resolution: {integrity: sha512-Vo1ab+QXPzZ4tCa8SwIHJFaSzy4R6SHf7BY79rFBDf0idraZWAkYrDjDj8uWaSm3S2TK+hJ7/t1CEmZ7jXw+pg==} + engines: {node: '>=18.0.0'} + + eventsource@3.0.7: + resolution: {integrity: sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==} + engines: {node: '>=18.0.0'} + expect-type@1.3.0: resolution: {integrity: sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==} engines: {node: '>=12.0.0'} + express-rate-limit@8.3.0: + resolution: {integrity: sha512-KJzBawY6fB9FiZGdE/0aftepZ91YlaGIrV8vgblRM3J8X+dHx/aiowJWwkx6LIGyuqGiANsjSwwrbb8mifOJ4Q==} + engines: {node: '>= 16'} + peerDependencies: + express: '>= 4.11' + + express@5.2.1: + resolution: {integrity: sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==} + engines: {node: '>= 18'} + fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -656,6 +781,9 @@ packages: fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + fast-uri@3.1.0: + resolution: {integrity: sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==} + fdir@6.5.0: resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} engines: {node: '>=12.0.0'} @@ -669,6 +797,10 @@ packages: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} + finalhandler@2.1.1: + resolution: {integrity: sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==} + engines: {node: '>= 18.0.0'} + find-up@5.0.0: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} @@ -680,11 +812,30 @@ packages: flatted@3.3.4: resolution: {integrity: sha512-3+mMldrTAPdta5kjX2G2J7iX4zxtnwpdA8Tr2ZSjkyPSanvbZAcy6flmtnXbEybHrDcU9641lxrMfFuUxVz9vA==} + forwarded@0.2.0: + resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} + engines: {node: '>= 0.6'} + + fresh@2.0.0: + resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==} + engines: {node: '>= 0.8'} + fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + + get-intrinsic@1.3.0: + resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} + engines: {node: '>= 0.4'} + + get-proto@1.0.1: + resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} + engines: {node: '>= 0.4'} + glob-parent@6.0.2: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} @@ -693,10 +844,34 @@ packages: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} + gopd@1.2.0: + resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} + engines: {node: '>= 0.4'} + has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} + has-symbols@1.1.0: + resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} + engines: {node: '>= 0.4'} + + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + + hono@4.12.5: + resolution: {integrity: sha512-3qq+FUBtlTHhtYxbxheZgY8NIFnkkC/MR8u5TTsr7YZ3wixryQ3cCwn3iZbg8p8B88iDBBAYSfZDS75t8MN7Vg==} + engines: {node: '>=16.9.0'} + + http-errors@2.0.1: + resolution: {integrity: sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==} + engines: {node: '>= 0.8'} + + iconv-lite@0.7.2: + resolution: {integrity: sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==} + engines: {node: '>=0.10.0'} + ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} @@ -713,10 +888,21 @@ packages: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} + inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + ioredis@5.10.0: resolution: {integrity: sha512-HVBe9OFuqs+Z6n64q09PQvP1/R4Bm+30PAyyD4wIEqssh3v9L21QjCVk4kRLucMBcDokJTcLjsGeVRlq/nH6DA==} engines: {node: '>=12.22.0'} + ip-address@10.1.0: + resolution: {integrity: sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==} + engines: {node: '>= 12'} + + ipaddr.js@1.9.1: + resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} + engines: {node: '>= 0.10'} + is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -725,9 +911,15 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + is-promise@4.0.0: + resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} + isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + jose@6.2.0: + resolution: {integrity: sha512-xsfE1TcSCbUdo6U07tR0mvhg0flGxU8tPLbF03mirl2ukGQENhUg4ubGYQnhVH0b5stLlPM+WOqDkEl1R1y5sQ==} + js-tokens@9.0.1: resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} @@ -741,6 +933,12 @@ packages: json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + json-schema-typed@8.0.2: + resolution: {integrity: sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==} + json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} @@ -770,6 +968,26 @@ packages: magic-string@0.30.21: resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + math-intrinsics@1.1.0: + resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} + engines: {node: '>= 0.4'} + + media-typer@1.1.0: + resolution: {integrity: sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==} + engines: {node: '>= 0.8'} + + merge-descriptors@2.0.0: + resolution: {integrity: sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==} + engines: {node: '>=18'} + + mime-db@1.54.0: + resolution: {integrity: sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==} + engines: {node: '>= 0.6'} + + mime-types@3.0.2: + resolution: {integrity: sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==} + engines: {node: '>=18'} + minimatch@10.2.4: resolution: {integrity: sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==} engines: {node: 18 || 20 || >=22} @@ -788,6 +1006,25 @@ packages: natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + negotiator@1.0.0: + resolution: {integrity: sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==} + engines: {node: '>= 0.6'} + + object-assign@4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + + object-inspect@1.13.4: + resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==} + engines: {node: '>= 0.4'} + + on-finished@2.4.1: + resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} + engines: {node: '>= 0.8'} + + once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + optionator@0.9.4: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} @@ -804,6 +1041,10 @@ packages: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} + parseurl@1.3.3: + resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} + engines: {node: '>= 0.8'} + path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -812,6 +1053,9 @@ packages: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} + path-to-regexp@8.3.0: + resolution: {integrity: sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==} + pathe@2.0.3: resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} @@ -826,6 +1070,10 @@ packages: resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} engines: {node: '>=12'} + pkce-challenge@5.0.1: + resolution: {integrity: sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==} + engines: {node: '>=16.20.0'} + postcss@8.5.8: resolution: {integrity: sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==} engines: {node: ^10 || ^12 || >=14} @@ -834,10 +1082,26 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} + proxy-addr@2.0.7: + resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} + engines: {node: '>= 0.10'} + punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} + qs@6.15.0: + resolution: {integrity: sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==} + engines: {node: '>=0.6'} + + range-parser@1.2.1: + resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} + engines: {node: '>= 0.6'} + + raw-body@3.0.2: + resolution: {integrity: sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==} + engines: {node: '>= 0.10'} + redis-errors@1.2.0: resolution: {integrity: sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==} engines: {node: '>=4'} @@ -846,6 +1110,10 @@ packages: resolution: {integrity: sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==} engines: {node: '>=4'} + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -855,11 +1123,29 @@ packages: engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true + router@2.2.0: + resolution: {integrity: sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==} + engines: {node: '>= 18'} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + semver@7.7.4: resolution: {integrity: sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==} engines: {node: '>=10'} hasBin: true + send@1.2.1: + resolution: {integrity: sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==} + engines: {node: '>= 18'} + + serve-static@2.2.1: + resolution: {integrity: sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==} + engines: {node: '>= 18'} + + setprototypeof@1.2.0: + resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} @@ -868,6 +1154,22 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} + side-channel-list@1.0.0: + resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==} + engines: {node: '>= 0.4'} + + side-channel-map@1.0.1: + resolution: {integrity: sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==} + engines: {node: '>= 0.4'} + + side-channel-weakmap@1.0.2: + resolution: {integrity: sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==} + engines: {node: '>= 0.4'} + + side-channel@1.1.0: + resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==} + engines: {node: '>= 0.4'} + siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} @@ -881,6 +1183,10 @@ packages: standard-as-callback@2.1.0: resolution: {integrity: sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==} + statuses@2.0.2: + resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==} + engines: {node: '>= 0.8'} + std-env@3.10.0: resolution: {integrity: sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==} @@ -917,6 +1223,10 @@ packages: resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==} engines: {node: '>=14.0.0'} + toidentifier@1.0.1: + resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} + engines: {node: '>=0.6'} + ts-api-utils@2.4.0: resolution: {integrity: sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA==} engines: {node: '>=18.12'} @@ -927,6 +1237,10 @@ packages: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} + type-is@2.0.1: + resolution: {integrity: sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==} + engines: {node: '>= 0.6'} + typescript@5.9.3: resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} engines: {node: '>=14.17'} @@ -935,9 +1249,17 @@ packages: undici-types@6.21.0: resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} + unpipe@1.0.0: + resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} + engines: {node: '>= 0.8'} + uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + vary@1.1.2: + resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} + engines: {node: '>= 0.8'} + vite-node@3.2.4: resolution: {integrity: sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} @@ -1025,10 +1347,21 @@ packages: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} + wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + zod-to-json-schema@3.25.1: + resolution: {integrity: sha512-pM/SU9d3YAggzi6MtR4h7ruuQlqKtad8e9S0fmxcMi+ueAK5Korys/aWcV9LIIHTVbj01NdzxcnXSN+O74ZIVA==} + peerDependencies: + zod: ^3.25 || ^4 + + zod@4.3.6: + resolution: {integrity: sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==} + snapshots: '@esbuild/aix-ppc64@0.27.3': @@ -1155,6 +1488,10 @@ snapshots: '@eslint/core': 0.17.0 levn: 0.4.1 + '@hono/node-server@1.19.11(hono@4.12.5)': + dependencies: + hono: 4.12.5 + '@humanfs/core@0.19.1': {} '@humanfs/node@0.16.7': @@ -1170,6 +1507,28 @@ snapshots: '@jridgewell/sourcemap-codec@1.5.5': {} + '@modelcontextprotocol/sdk@1.27.1(zod@4.3.6)': + dependencies: + '@hono/node-server': 1.19.11(hono@4.12.5) + ajv: 8.18.0 + ajv-formats: 3.0.1(ajv@8.18.0) + content-type: 1.0.5 + cors: 2.8.6 + cross-spawn: 7.0.6 + eventsource: 3.0.7 + eventsource-parser: 3.0.6 + express: 5.2.1 + express-rate-limit: 8.3.0(express@5.2.1) + hono: 4.12.5 + jose: 6.2.0 + json-schema-typed: 8.0.2 + pkce-challenge: 5.0.1 + raw-body: 3.0.2 + zod: 4.3.6 + zod-to-json-schema: 3.25.1(zod@4.3.6) + transitivePeerDependencies: + - supports-color + '@rollup/rollup-android-arm-eabi@4.59.0': optional: true @@ -1393,12 +1752,21 @@ snapshots: loupe: 3.2.1 tinyrainbow: 2.0.0 + accepts@2.0.0: + dependencies: + mime-types: 3.0.2 + negotiator: 1.0.0 + acorn-jsx@5.3.2(acorn@8.16.0): dependencies: acorn: 8.16.0 acorn@8.16.0: {} + ajv-formats@3.0.1(ajv@8.18.0): + optionalDependencies: + ajv: 8.18.0 + ajv@6.14.0: dependencies: fast-deep-equal: 3.1.3 @@ -1406,6 +1774,13 @@ snapshots: json-schema-traverse: 0.4.1 uri-js: 4.4.1 + ajv@8.18.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.0 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + ansi-styles@4.3.0: dependencies: color-convert: 2.0.1 @@ -1418,6 +1793,20 @@ snapshots: balanced-match@4.0.4: {} + body-parser@2.2.2: + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 4.4.3 + http-errors: 2.0.1 + iconv-lite: 0.7.2 + on-finished: 2.4.1 + qs: 6.15.0 + raw-body: 3.0.2 + type-is: 2.0.1 + transitivePeerDependencies: + - supports-color + brace-expansion@1.1.12: dependencies: balanced-match: 1.0.2 @@ -1427,8 +1816,20 @@ snapshots: dependencies: balanced-match: 4.0.4 + bytes@3.1.2: {} + cac@6.7.14: {} + call-bind-apply-helpers@1.0.2: + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + + call-bound@1.0.4: + dependencies: + call-bind-apply-helpers: 1.0.2 + get-intrinsic: 1.3.0 + callsites@3.1.0: {} chai@5.3.3: @@ -1458,6 +1859,19 @@ snapshots: concat-map@0.0.1: {} + content-disposition@1.0.1: {} + + content-type@1.0.5: {} + + cookie-signature@1.2.2: {} + + cookie@0.7.2: {} + + cors@2.8.6: + dependencies: + object-assign: 4.1.1 + vary: 1.1.2 + cross-spawn@7.0.6: dependencies: path-key: 3.1.1 @@ -1474,8 +1888,28 @@ snapshots: denque@2.1.0: {} + depd@2.0.0: {} + + dunder-proto@1.0.1: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-errors: 1.3.0 + gopd: 1.2.0 + + ee-first@1.1.1: {} + + encodeurl@2.0.0: {} + + es-define-property@1.0.1: {} + + es-errors@1.3.0: {} + es-module-lexer@1.7.0: {} + es-object-atoms@1.1.1: + dependencies: + es-errors: 1.3.0 + esbuild@0.27.3: optionalDependencies: '@esbuild/aix-ppc64': 0.27.3 @@ -1505,6 +1939,8 @@ snapshots: '@esbuild/win32-ia32': 0.27.3 '@esbuild/win32-x64': 0.27.3 + escape-html@1.0.3: {} + escape-string-regexp@4.0.0: {} eslint-scope@8.4.0: @@ -1579,14 +2015,62 @@ snapshots: esutils@2.0.3: {} + etag@1.8.1: {} + + eventsource-parser@3.0.6: {} + + eventsource@3.0.7: + dependencies: + eventsource-parser: 3.0.6 + expect-type@1.3.0: {} + express-rate-limit@8.3.0(express@5.2.1): + dependencies: + express: 5.2.1 + ip-address: 10.1.0 + + express@5.2.1: + dependencies: + accepts: 2.0.0 + body-parser: 2.2.2 + content-disposition: 1.0.1 + content-type: 1.0.5 + cookie: 0.7.2 + cookie-signature: 1.2.2 + debug: 4.4.3 + depd: 2.0.0 + encodeurl: 2.0.0 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 2.1.1 + fresh: 2.0.0 + http-errors: 2.0.1 + merge-descriptors: 2.0.0 + mime-types: 3.0.2 + on-finished: 2.4.1 + once: 1.4.0 + parseurl: 1.3.3 + proxy-addr: 2.0.7 + qs: 6.15.0 + range-parser: 1.2.1 + router: 2.2.0 + send: 1.2.1 + serve-static: 2.2.1 + statuses: 2.0.2 + type-is: 2.0.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + fast-deep-equal@3.1.3: {} fast-json-stable-stringify@2.1.0: {} fast-levenshtein@2.0.6: {} + fast-uri@3.1.0: {} + fdir@6.5.0(picomatch@4.0.3): optionalDependencies: picomatch: 4.0.3 @@ -1595,6 +2079,17 @@ snapshots: dependencies: flat-cache: 4.0.1 + finalhandler@2.1.1: + dependencies: + debug: 4.4.3 + encodeurl: 2.0.0 + escape-html: 1.0.3 + on-finished: 2.4.1 + parseurl: 1.3.3 + statuses: 2.0.2 + transitivePeerDependencies: + - supports-color + find-up@5.0.0: dependencies: locate-path: 6.0.0 @@ -1607,17 +2102,63 @@ snapshots: flatted@3.3.4: {} + forwarded@0.2.0: {} + + fresh@2.0.0: {} + fsevents@2.3.3: optional: true + function-bind@1.1.2: {} + + get-intrinsic@1.3.0: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-define-property: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + function-bind: 1.1.2 + get-proto: 1.0.1 + gopd: 1.2.0 + has-symbols: 1.1.0 + hasown: 2.0.2 + math-intrinsics: 1.1.0 + + get-proto@1.0.1: + dependencies: + dunder-proto: 1.0.1 + es-object-atoms: 1.1.1 + glob-parent@6.0.2: dependencies: is-glob: 4.0.3 globals@14.0.0: {} + gopd@1.2.0: {} + has-flag@4.0.0: {} + has-symbols@1.1.0: {} + + hasown@2.0.2: + dependencies: + function-bind: 1.1.2 + + hono@4.12.5: {} + + http-errors@2.0.1: + dependencies: + depd: 2.0.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 2.0.2 + toidentifier: 1.0.1 + + iconv-lite@0.7.2: + dependencies: + safer-buffer: 2.1.2 + ignore@5.3.2: {} ignore@7.0.5: {} @@ -1629,6 +2170,8 @@ snapshots: imurmurhash@0.1.4: {} + inherits@2.0.4: {} + ioredis@5.10.0: dependencies: '@ioredis/commands': 1.5.1 @@ -1643,14 +2186,22 @@ snapshots: transitivePeerDependencies: - supports-color + ip-address@10.1.0: {} + + ipaddr.js@1.9.1: {} + is-extglob@2.1.1: {} is-glob@4.0.3: dependencies: is-extglob: 2.1.1 + is-promise@4.0.0: {} + isexe@2.0.0: {} + jose@6.2.0: {} + js-tokens@9.0.1: {} js-yaml@4.1.1: @@ -1661,6 +2212,10 @@ snapshots: json-schema-traverse@0.4.1: {} + json-schema-traverse@1.0.0: {} + + json-schema-typed@8.0.2: {} + json-stable-stringify-without-jsonify@1.0.1: {} keyv@4.5.4: @@ -1688,6 +2243,18 @@ snapshots: dependencies: '@jridgewell/sourcemap-codec': 1.5.5 + math-intrinsics@1.1.0: {} + + media-typer@1.1.0: {} + + merge-descriptors@2.0.0: {} + + mime-db@1.54.0: {} + + mime-types@3.0.2: + dependencies: + mime-db: 1.54.0 + minimatch@10.2.4: dependencies: brace-expansion: 5.0.4 @@ -1702,6 +2269,20 @@ snapshots: natural-compare@1.4.0: {} + negotiator@1.0.0: {} + + object-assign@4.1.1: {} + + object-inspect@1.13.4: {} + + on-finished@2.4.1: + dependencies: + ee-first: 1.1.1 + + once@1.4.0: + dependencies: + wrappy: 1.0.2 + optionator@0.9.4: dependencies: deep-is: 0.1.4 @@ -1723,10 +2304,14 @@ snapshots: dependencies: callsites: 3.1.0 + parseurl@1.3.3: {} + path-exists@4.0.0: {} path-key@3.1.1: {} + path-to-regexp@8.3.0: {} + pathe@2.0.3: {} pathval@2.0.1: {} @@ -1735,6 +2320,8 @@ snapshots: picomatch@4.0.3: {} + pkce-challenge@5.0.1: {} + postcss@8.5.8: dependencies: nanoid: 3.3.11 @@ -1743,14 +2330,34 @@ snapshots: prelude-ls@1.2.1: {} + proxy-addr@2.0.7: + dependencies: + forwarded: 0.2.0 + ipaddr.js: 1.9.1 + punycode@2.3.1: {} + qs@6.15.0: + dependencies: + side-channel: 1.1.0 + + range-parser@1.2.1: {} + + raw-body@3.0.2: + dependencies: + bytes: 3.1.2 + http-errors: 2.0.1 + iconv-lite: 0.7.2 + unpipe: 1.0.0 + redis-errors@1.2.0: {} redis-parser@3.0.0: dependencies: redis-errors: 1.2.0 + require-from-string@2.0.2: {} + resolve-from@4.0.0: {} rollup@4.59.0: @@ -1784,14 +2391,81 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.59.0 fsevents: 2.3.3 + router@2.2.0: + dependencies: + debug: 4.4.3 + depd: 2.0.0 + is-promise: 4.0.0 + parseurl: 1.3.3 + path-to-regexp: 8.3.0 + transitivePeerDependencies: + - supports-color + + safer-buffer@2.1.2: {} + semver@7.7.4: {} + send@1.2.1: + dependencies: + debug: 4.4.3 + encodeurl: 2.0.0 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 2.0.0 + http-errors: 2.0.1 + mime-types: 3.0.2 + ms: 2.1.3 + on-finished: 2.4.1 + range-parser: 1.2.1 + statuses: 2.0.2 + transitivePeerDependencies: + - supports-color + + serve-static@2.2.1: + dependencies: + encodeurl: 2.0.0 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 1.2.1 + transitivePeerDependencies: + - supports-color + + setprototypeof@1.2.0: {} + shebang-command@2.0.0: dependencies: shebang-regex: 3.0.0 shebang-regex@3.0.0: {} + side-channel-list@1.0.0: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.4 + + side-channel-map@1.0.1: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + object-inspect: 1.13.4 + + side-channel-weakmap@1.0.2: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + object-inspect: 1.13.4 + side-channel-map: 1.0.1 + + side-channel@1.1.0: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.4 + side-channel-list: 1.0.0 + side-channel-map: 1.0.1 + side-channel-weakmap: 1.0.2 + siginfo@2.0.0: {} source-map-js@1.2.1: {} @@ -1800,6 +2474,8 @@ snapshots: standard-as-callback@2.1.0: {} + statuses@2.0.2: {} + std-env@3.10.0: {} strip-json-comments@3.1.1: {} @@ -1827,6 +2503,8 @@ snapshots: tinyspy@4.0.4: {} + toidentifier@1.0.1: {} + ts-api-utils@2.4.0(typescript@5.9.3): dependencies: typescript: 5.9.3 @@ -1835,14 +2513,24 @@ snapshots: dependencies: prelude-ls: 1.2.1 + type-is@2.0.1: + dependencies: + content-type: 1.0.5 + media-typer: 1.1.0 + mime-types: 3.0.2 + typescript@5.9.3: {} undici-types@6.21.0: {} + unpipe@1.0.0: {} + uri-js@4.4.1: dependencies: punycode: 2.3.1 + vary@1.1.2: {} + vite-node@3.2.4(@types/node@22.19.15): dependencies: cac: 6.7.14 @@ -1928,4 +2616,12 @@ snapshots: word-wrap@1.2.5: {} + wrappy@1.0.2: {} + yocto-queue@0.1.0: {} + + zod-to-json-schema@3.25.1(zod@4.3.6): + dependencies: + zod: 4.3.6 + + zod@4.3.6: {} -- 2.49.1 From 119fbdf80123649bdddc3a32fcd2cdb13a1303d2 Mon Sep 17 00:00:00 2001 From: Jason Woltje <jason@diversecanvas.com> Date: Fri, 6 Mar 2026 09:37:21 -0600 Subject: [PATCH 7/8] test(queue): cover atomic ownership and MCP tool schemas (MQ-007) --- packages/queue/tests/mcp-tool-schemas.test.ts | 90 +++++++++++++++++++ packages/queue/tests/task-atomic.test.ts | 29 ++++++ 2 files changed, 119 insertions(+) create mode 100644 packages/queue/tests/mcp-tool-schemas.test.ts diff --git a/packages/queue/tests/mcp-tool-schemas.test.ts b/packages/queue/tests/mcp-tool-schemas.test.ts new file mode 100644 index 0000000..0593cf9 --- /dev/null +++ b/packages/queue/tests/mcp-tool-schemas.test.ts @@ -0,0 +1,90 @@ +import { describe, expect, it } from 'vitest'; + +import { + queueClaimToolInputSchema, + queueCompleteToolInputSchema, + queueFailToolInputSchema, + queueGetToolInputSchema, + queueHeartbeatToolInputSchema, + queueListToolInputSchema, + queueReleaseToolInputSchema, + queueStatusToolInputSchema, +} from '../src/mcp-tool-schemas.js'; + +describe('MCP tool schemas', () => { + it('validates queue_list filters', () => { + const parsed = queueListToolInputSchema.parse({ + project: 'queue', + mission: 'phase1', + status: 'pending', + }); + + expect(parsed).toEqual({ + project: 'queue', + mission: 'phase1', + status: 'pending', + }); + }); + + it('requires a taskId for queue_get', () => { + expect(() => queueGetToolInputSchema.parse({})).toThrowError(); + }); + + it('requires positive ttlSeconds for queue_claim', () => { + expect(() => + queueClaimToolInputSchema.parse({ + taskId: 'MQ-007', + agentId: 'agent-a', + ttlSeconds: 0, + }), + ).toThrowError(); + }); + + it('accepts optional fields for queue_heartbeat and queue_release', () => { + const heartbeat = queueHeartbeatToolInputSchema.parse({ + taskId: 'MQ-007', + ttlSeconds: 30, + }); + + const release = queueReleaseToolInputSchema.parse({ + taskId: 'MQ-007', + }); + + expect(heartbeat).toEqual({ + taskId: 'MQ-007', + ttlSeconds: 30, + }); + expect(release).toEqual({ + taskId: 'MQ-007', + }); + }); + + it('validates queue_complete and queue_fail payloads', () => { + const complete = queueCompleteToolInputSchema.parse({ + taskId: 'MQ-007', + agentId: 'agent-a', + summary: 'done', + }); + + const fail = queueFailToolInputSchema.parse({ + taskId: 'MQ-007', + reason: 'boom', + }); + + expect(complete).toEqual({ + taskId: 'MQ-007', + agentId: 'agent-a', + summary: 'done', + }); + expect(fail).toEqual({ + taskId: 'MQ-007', + reason: 'boom', + }); + }); + + it('accepts an empty payload for queue_status', () => { + const parsed = queueStatusToolInputSchema.parse({}); + + expect(parsed).toEqual({}); + }); +}); diff --git a/packages/queue/tests/task-atomic.test.ts b/packages/queue/tests/task-atomic.test.ts index f931f27..b2a7d1a 100644 --- a/packages/queue/tests/task-atomic.test.ts +++ b/packages/queue/tests/task-atomic.test.ts @@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest'; import { RedisTaskRepository, + TaskOwnershipError, TaskTransitionError, type RedisTaskClient, type RedisTaskTransaction, @@ -327,4 +328,32 @@ describe('RedisTaskRepository atomic transitions', () => { }), ).rejects.toBeInstanceOf(TaskTransitionError); }); + + it('enforces claim ownership for release and complete', async () => { + const [repository] = createRepositoryPair(() => 1_700_000_000_000); + + await repository.create({ + project: 'queue', + mission: 'phase1', + taskId: 'MQ-004-OWN', + title: 'Ownership checks', + }); + + await repository.claim('MQ-004-OWN', { + agentId: 'agent-a', + ttlSeconds: 60, + }); + + await expect( + repository.release('MQ-004-OWN', { + agentId: 'agent-b', + }), + ).rejects.toBeInstanceOf(TaskOwnershipError); + + await expect( + repository.complete('MQ-004-OWN', { + agentId: 'agent-b', + }), + ).rejects.toBeInstanceOf(TaskOwnershipError); + }); }); -- 2.49.1 From 67fcb2e60c79b667c432d1603d3fd7822a51876b Mon Sep 17 00:00:00 2001 From: Jason Woltje <jason@diversecanvas.com> Date: Fri, 6 Mar 2026 09:38:54 -0600 Subject: [PATCH 8/8] docs(queue): add README, bin entrypoints, and publish prep (MQ-008) --- README.md | 82 +++++++++++++++++++++- docs/TASKS.md | 16 ++--- packages/queue/package.json | 20 +++++- packages/queue/src/bin/mosaic-queue-mcp.ts | 11 +++ packages/queue/src/bin/mosaic.ts | 6 ++ 5 files changed, 125 insertions(+), 10 deletions(-) create mode 100644 packages/queue/src/bin/mosaic-queue-mcp.ts create mode 100644 packages/queue/src/bin/mosaic.ts diff --git a/README.md b/README.md index 2f4bd5e..ac6587e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,82 @@ -# queue +# mosaic-queue +Valkey/Redis-backed task queue with: + +- Atomic task lifecycle operations (`claim`, `release`, `heartbeat`, `complete`, `fail`) +- CLI commands for queue management +- MCP server tools for agent integrations + +## Requirements + +- Node.js `>=20` +- pnpm `10.x` +- Valkey/Redis URL in one of: + - `VALKEY_URL` + - `REDIS_URL` + +No default Redis URL is hardcoded. Startup fails loudly when neither env var exists. + +## Install + +```bash +pnpm install +pnpm build +``` + +## CLI Usage + +The package ships a `mosaic` binary. + +```bash +mosaic queue create <project> <mission> <taskId> --title "..." [--priority high] [--lane coding] +mosaic queue list [--project X] [--mission Y] [--status pending] +mosaic queue show <taskId> +mosaic queue claim <taskId> --agent <agentId> --ttl 3600 +mosaic queue release <taskId> [--agent <agentId>] +mosaic queue complete <taskId> [--agent <agentId>] [--summary "..."] +``` + +Example: + +```bash +export VALKEY_URL="redis://localhost:6379" +mosaic queue create queue phase1 MQ-001 --title "Implement core queue" +mosaic queue claim MQ-001 --agent codex --ttl 3600 +``` + +## MCP Server + +The package also ships a `mosaic-queue-mcp` binary exposing: + +- `queue_list` +- `queue_get` +- `queue_claim` +- `queue_heartbeat` +- `queue_release` +- `queue_complete` +- `queue_fail` +- `queue_status` + +Run over stdio: + +```bash +export VALKEY_URL="redis://localhost:6379" +mosaic-queue-mcp +``` + +## Development + +```bash +pnpm lint +pnpm test +pnpm build +``` + +## Publish Prep + +`packages/queue/package.json` includes: + +- `bin` entries for `mosaic` and `mosaic-queue-mcp` +- `exports` + `types` for ESM package consumption +- `prepublishOnly` quality gate (`lint`, `test`, `build`) +- `publishConfig.access = public` diff --git a/docs/TASKS.md b/docs/TASKS.md index 9368f80..a4dfc3f 100644 --- a/docs/TASKS.md +++ b/docs/TASKS.md @@ -2,11 +2,11 @@ | id | status | description | issue | repo | branch | depends_on | blocks | agent | started_at | completed_at | estimate | used | notes | |---|---|---|---|---|---|---|---|---|---|---|---|---|---| -| MQ-001 | not-started | Init: pnpm monorepo, TypeScript strict, ESLint, vitest | TASKS:P1 | queue | feat/core-queue | | MQ-002 | | | | 8K | | | -| MQ-002 | not-started | Valkey/Redis connection module with health check | TASKS:P1 | queue | feat/core-queue | MQ-001 | MQ-003 | | | | 5K | | | -| MQ-003 | not-started | Task CRUD: create, get, list, update (ioredis + JSON serialization) | TASKS:P1 | queue | feat/core-queue | MQ-002 | MQ-004 | | | | 12K | | | -| MQ-004 | not-started | Atomic claim/release/heartbeat/complete/fail operations | TASKS:P1 | queue | feat/core-queue | MQ-003 | MQ-005 | | | | 15K | | | -| MQ-005 | not-started | CLI: commander wiring for create/list/show/claim/release/complete | TASKS:P1 | queue | feat/core-queue | MQ-004 | MQ-006 | | | | 10K | | | -| MQ-006 | not-started | MCP server: queue_list/get/claim/heartbeat/release/complete/fail/status tools | TASKS:P1 | queue | feat/core-queue | MQ-005 | MQ-007 | | | | 15K | | | -| MQ-007 | not-started | Unit tests for claim atomicity + state transitions + MCP tool schemas | TASKS:P1 | queue | feat/core-queue | MQ-006 | MQ-008 | | | | 15K | | | -| MQ-008 | not-started | README, package.json bin entry, npm publish prep | TASKS:P1 | queue | feat/core-queue | MQ-007 | | | | | 5K | | | +| MQ-001 | done | Init: pnpm monorepo, TypeScript strict, ESLint, vitest | TASKS:P1 | queue | feat/core-queue | | MQ-002 | | | | 8K | | | +| MQ-002 | done | Valkey/Redis connection module with health check | TASKS:P1 | queue | feat/core-queue | MQ-001 | MQ-003 | | | | 5K | | | +| MQ-003 | done | Task CRUD: create, get, list, update (ioredis + JSON serialization) | TASKS:P1 | queue | feat/core-queue | MQ-002 | MQ-004 | | | | 12K | | | +| MQ-004 | done | Atomic claim/release/heartbeat/complete/fail operations | TASKS:P1 | queue | feat/core-queue | MQ-003 | MQ-005 | | | | 15K | | | +| MQ-005 | done | CLI: commander wiring for create/list/show/claim/release/complete | TASKS:P1 | queue | feat/core-queue | MQ-004 | MQ-006 | | | | 10K | | | +| MQ-006 | done | MCP server: queue_list/get/claim/heartbeat/release/complete/fail/status tools | TASKS:P1 | queue | feat/core-queue | MQ-005 | MQ-007 | | | | 15K | | | +| MQ-007 | done | Unit tests for claim atomicity + state transitions + MCP tool schemas | TASKS:P1 | queue | feat/core-queue | MQ-006 | MQ-008 | | | | 15K | | | +| MQ-008 | done | README, package.json bin entry, npm publish prep | TASKS:P1 | queue | feat/core-queue | MQ-007 | | | | | 5K | | | diff --git a/packages/queue/package.json b/packages/queue/package.json index 3fa4860..3b32005 100644 --- a/packages/queue/package.json +++ b/packages/queue/package.json @@ -2,16 +2,34 @@ "name": "@mosaic/queue", "version": "0.0.1", "description": "Valkey-backed task queue exposed via CLI and MCP", + "license": "MIT", "type": "module", "main": "dist/index.js", "types": "dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js" + } + }, + "bin": { + "mosaic": "dist/bin/mosaic.js", + "mosaic-queue-mcp": "dist/bin/mosaic-queue-mcp.js" + }, "files": [ "dist" ], "scripts": { "lint": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" \"vitest.config.ts\"", "build": "tsc -p tsconfig.build.json", - "test": "vitest run" + "test": "vitest run", + "prepublishOnly": "pnpm lint && pnpm test && pnpm build" + }, + "engines": { + "node": ">=20.0.0" + }, + "publishConfig": { + "access": "public" }, "dependencies": { "@modelcontextprotocol/sdk": "^1.27.1", diff --git a/packages/queue/src/bin/mosaic-queue-mcp.ts b/packages/queue/src/bin/mosaic-queue-mcp.ts new file mode 100644 index 0000000..f7514ec --- /dev/null +++ b/packages/queue/src/bin/mosaic-queue-mcp.ts @@ -0,0 +1,11 @@ +#!/usr/bin/env node + +import { startQueueMcpServer } from '../mcp-server.js'; + +try { + await startQueueMcpServer(); +} catch (error) { + const message = error instanceof Error ? error.message : String(error); + console.error(message); + process.exitCode = 1; +} diff --git a/packages/queue/src/bin/mosaic.ts b/packages/queue/src/bin/mosaic.ts new file mode 100644 index 0000000..ca849cf --- /dev/null +++ b/packages/queue/src/bin/mosaic.ts @@ -0,0 +1,6 @@ +#!/usr/bin/env node + +import { runQueueCli } from '../cli.js'; + +const exitCode = await runQueueCli(process.argv); +process.exitCode = exitCode; -- 2.49.1