diff --git a/package.json b/package.json index 832710f..9568dff 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,9 @@ "build": "next build", "dev": "next dev", "lint": "eslint .", - "start": "next start" + "start": "next start", + "typecheck": "tsc --noEmit -p tsconfig.json", + "test": "vitest run" }, "dependencies": { "@hookform/resolvers": "^3.10.0", @@ -70,11 +72,12 @@ "postcss": "^8.5", "tailwindcss": "^4.1.9", "tw-animate-css": "1.3.3", - "typescript": "^5" + "typescript": "^5", + "vitest": "^3.2.7" }, "pnpm": { "onlyBuiltDependencies": [ "sharp" ] } -} \ No newline at end of file +} diff --git a/packages/schemas/0pt.iceberg_table.schema.json b/packages/schemas/0pt.iceberg_table.schema.json new file mode 100644 index 0000000..2b871a0 --- /dev/null +++ b/packages/schemas/0pt.iceberg_table.schema.json @@ -0,0 +1,20 @@ +{ + "$id": "0pt.iceberg_table.schema.v1", + "description": "NON-AUTHORITATIVE READ CACHE ONLY. ST0RE owns Iceberg table/catalog/snapshot state (docs/ICEBERG_WRITE_BOUNDARY.md, src/clients/st0re-lakehouse-client.ts's St0reIcebergTable). This schema mirrors that shape for tests/p0/enterprise-data-os-expansion.test.ts's contract assertions from an earlier pass; 0pt must never write to it as a second copy of ST0RE's table registry -- see docs/ICEBERG_WRITE_BOUNDARY.md's 'A pre-existing artifact this pass did not touch' section.", + "type": "object", + "required": ["table_id", "table_name", "storage_uri", "namespace", "table_format", "catalog_ref"], + "properties": { + "table_id": { "type": "string" }, + "namespace": { "type": "string" }, + "table_name": { "type": "string" }, + "table_format": { "type": "string", "enum": ["iceberg", "delta", "hudi"] }, + "storage_uri": { "type": "string" }, + "catalog_ref": { "type": "string", "description": "Opaque reference into the external Iceberg catalog -- ST0RE does not resolve it." }, + "dataset_id": { "type": "string" }, + "owner_product": { "type": "string" }, + "current_snapshot_id": { "type": "string" }, + "status": { "type": "string", "enum": ["active", "deprecated", "archived"] }, + "created_at": { "type": "string" }, + "created_by": { "type": "string" } + } +} diff --git a/packages/schemas/0pt.lineage_event.schema.json b/packages/schemas/0pt.lineage_event.schema.json new file mode 100644 index 0000000..8ae6297 --- /dev/null +++ b/packages/schemas/0pt.lineage_event.schema.json @@ -0,0 +1,30 @@ +{ + "$id": "0pt.lineage_event.schema.v1", + "description": "CONTRACT-ONLY -- 0pt's real lineage emissions today go through Aud0Client.ingestLineageEvent (src/clients/aud0-client.ts), whose Aud0LineageEventInput shape is source_type/source_id -> target_type/target_id, not input_assets/output_assets. This wider multi-asset shape exists so tests/p0/enterprise-data-os-expansion.test.ts's contract assertions (from an earlier 'PROMPT 2' pass) have a real file to check; it documents an intended future generalization (multi-input/multi-output lineage), not a built/wired capability.", + "type": "object", + "required": ["input_assets", "output_assets", "producer"], + "properties": { + "lineage_event_id": { "type": "string" }, + "event_type": { "type": "string" }, + "app_id": { "type": "string" }, + "capability_id": { "type": "string" }, + "producer": { "type": "string", "description": "app_id/capability_id that produced this lineage edge." }, + "input_assets": { + "type": "array", + "items": { + "type": "object", + "properties": { "asset_type": { "type": "string" }, "asset_id": { "type": "string" } } + } + }, + "output_assets": { + "type": "array", + "items": { + "type": "object", + "properties": { "asset_type": { "type": "string" }, "asset_id": { "type": "string" } } + } + }, + "st0re_artifacts": { "type": "array", "items": { "type": "string" } }, + "quality_report_id": { "type": "string" }, + "created_at": { "type": "string" } + } +} diff --git a/packages/schemas/0pt.signal.schema.json b/packages/schemas/0pt.signal.schema.json new file mode 100644 index 0000000..1ef1ca8 --- /dev/null +++ b/packages/schemas/0pt.signal.schema.json @@ -0,0 +1,17 @@ +{ + "$id": "0pt.signal.schema.v1", + "description": "CONTRACT-ONLY -- no service in this repo produces or reads 0pt.signal rows yet (as of this pass). This schema exists so tests/p0/enterprise-data-os-expansion.test.ts's contract assertions (from an earlier 'PROMPT 2' pass) have a real file to check; it is documentation of an intended shape for future ICP/signal-intelligence work, not a built capability. Do not treat it as evidence that signal detection is implemented.", + "type": "object", + "required": ["signal_id", "signal_type", "signal_strength", "entity_type"], + "properties": { + "signal_id": { "type": "string" }, + "signal_type": { "type": "string", "description": "e.g. hiring_growth, funding_event, leadership_change." }, + "signal_strength": { "type": "number", "minimum": 0, "maximum": 1 }, + "entity_type": { "type": "string", "enum": ["company", "contact", "vehicle"] }, + "entity_key": { "type": "string" }, + "source_id": { "type": "string" }, + "confidence": { "type": "number", "minimum": 0, "maximum": 1 }, + "detected_at": { "type": "string" }, + "metadata": { "type": "object" } + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6201031..cc39ce4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -189,6 +189,9 @@ importers: typescript: specifier: ^5 version: 5.9.3 + vitest: + specifier: ^3.2.7 + version: 3.2.7(@types/node@22.20.0)(jiti@2.7.0)(lightningcss@1.32.0) packages: @@ -206,6 +209,162 @@ packages: '@emnapi/runtime@1.11.1': resolution: {integrity: sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==} + '@esbuild/aix-ppc64@0.28.1': + resolution: {integrity: sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + + '@esbuild/android-arm64@0.28.1': + resolution: {integrity: sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.28.1': + resolution: {integrity: sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.28.1': + resolution: {integrity: sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.28.1': + resolution: {integrity: sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.28.1': + resolution: {integrity: sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.28.1': + resolution: {integrity: sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.28.1': + resolution: {integrity: sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.28.1': + resolution: {integrity: sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.28.1': + resolution: {integrity: sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.28.1': + resolution: {integrity: sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.28.1': + resolution: {integrity: sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.28.1': + resolution: {integrity: sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.28.1': + resolution: {integrity: sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.28.1': + resolution: {integrity: sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.28.1': + resolution: {integrity: sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.28.1': + resolution: {integrity: sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-arm64@0.28.1': + resolution: {integrity: sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + + '@esbuild/netbsd-x64@0.28.1': + resolution: {integrity: sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-arm64@0.28.1': + resolution: {integrity: sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + + '@esbuild/openbsd-x64@0.28.1': + resolution: {integrity: sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + + '@esbuild/openharmony-arm64@0.28.1': + resolution: {integrity: sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openharmony] + + '@esbuild/sunos-x64@0.28.1': + resolution: {integrity: sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.28.1': + resolution: {integrity: sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.28.1': + resolution: {integrity: sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.28.1': + resolution: {integrity: sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + '@floating-ui/core@1.7.5': resolution: {integrity: sha512-1Ih4WTWyw0+lKyFMcBHGbb5U5FtuHJuujoyyr5zTaWS5EYMeT6Jb2AuDeftsCsEuchO+mM2ij5+q9crhydzLhQ==} @@ -1106,6 +1265,144 @@ packages: '@radix-ui/rect@1.1.0': resolution: {integrity: sha512-A9+lCBZoaMJlVKcRBz2YByCG+Cp2t6nAnMnNba+XiWxnj6r4JUFqfsgwocMBZU9LPtdxC6wB56ySYpc7LQIoJg==} + '@rollup/rollup-android-arm-eabi@4.62.2': + resolution: {integrity: sha512-6o7ZLZK+BeenkZCFNDXqpbjw9bD6nuWonvS/lwQJp7NoVVxm6p3qE7qQ5jGuBjiFsgvqjD8mZAU5oWxTmbOeOg==} + cpu: [arm] + os: [android] + + '@rollup/rollup-android-arm64@4.62.2': + resolution: {integrity: sha512-BaH7BllCACHoH1LguOU56UItGfUWjujlO65kS9LAodViaN4bwIKd7oeW/ZHJ/4ljr/7MIiENnNy3HJ0zXv8Zkw==} + cpu: [arm64] + os: [android] + + '@rollup/rollup-darwin-arm64@4.62.2': + resolution: {integrity: sha512-v39RCCvj4He82I9sFmk+M1VZ0PLM9sfsLVikjfx2hYBNALhrrOR2D3JjQA6AhlaSOgcR+RzrKY7e1+bT6SUO/A==} + cpu: [arm64] + os: [darwin] + + '@rollup/rollup-darwin-x64@4.62.2': + resolution: {integrity: sha512-yl0y2vq3S3lHeuXhEdss6TWfKW8vkujImO12tn4ZkG/4oghr09LvdYm2RElVjokTQiUvDUGXLGsYeLqUMCKpGA==} + cpu: [x64] + os: [darwin] + + '@rollup/rollup-freebsd-arm64@4.62.2': + resolution: {integrity: sha512-tT4pvt4qXD+vEoezupCWi+a1F0vvDiksiHc+PxRlYTOH1I6/X4id9jPxTP+Fg+545euaFT1jJVs4CEdHZAU1vw==} + cpu: [arm64] + os: [freebsd] + + '@rollup/rollup-freebsd-x64@4.62.2': + resolution: {integrity: sha512-6nU5F2wCW+qvCBhTn1pdIU3bzsIoF7EUwsCDRxilWGprQR6yd508YnH9+OKFCwpfS8pjZqDUmnCAr7exax0XCg==} + cpu: [x64] + os: [freebsd] + + '@rollup/rollup-linux-arm-gnueabihf@4.62.2': + resolution: {integrity: sha512-n1GJHPOvpIfhi3TmrCeh6S6URt9BFCt0KQE3qvexyGCTAKpR4Lg+eWvNZEqu7epxwus/8ElT3hacYEucm49SZg==} + cpu: [arm] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-arm-musleabihf@4.62.2': + resolution: {integrity: sha512-JqgflS8wEB+UXV/vS1RpRbifGBeN4D5lz8D8oOFbFZw4vedvdOgCFAjfBmIMdW3yL10XpQQ0Ambepw6MXrhOnA==} + cpu: [arm] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-arm64-gnu@4.62.2': + resolution: {integrity: sha512-wnFJkogWvN4jm/hQRF2UBaeUmk20j5+DmHvoyWii2b8HJDyvz1MF2OU/6ynXt2KR63rbZLWkFpoytpdc/yBuSA==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-arm64-musl@4.62.2': + resolution: {integrity: sha512-HVu2bp0zhvJ8xHEV9+UUs7S90VadmBSY3LcIMvozbPo4AuMGDWlz3ymHLHZPX4hR67TKTt8Qp5PJ5RBg/i+RMQ==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-loong64-gnu@4.62.2': + resolution: {integrity: sha512-mQqqAV8QaoSgr9I2fKDLY2BAVvmKjWoGiu/cSYQonsLvtqwEn1E4QYfnCOcp5zoEqNhsDYin1s6jx/VJmrxlZg==} + cpu: [loong64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-loong64-musl@4.62.2': + resolution: {integrity: sha512-IxKLoxCQ2IWi6bT2akyDUBGsOImDKB+sPp4EsTmwFQ/fMwpCKm8uLSSgP/Kx/QYUgKis6SEZ5/Nlhup0DIA0PQ==} + cpu: [loong64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-ppc64-gnu@4.62.2': + resolution: {integrity: sha512-Mk5ha2RQSgyFfmYYLkBpPnUk8D8FriBxesO1u9O75X0mHgXL1UQcH5Itl2lurWL2tj0RxV9b9tJgipac0hRY9A==} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-ppc64-musl@4.62.2': + resolution: {integrity: sha512-CjvEnqJL/0/TQ3TXX3OPIJ/kmBellrWd4heXUmHeJlTnmwjKpSJzoehLaL6Xk0ZnMHBu9dZuFADNOrtjF4v+2w==} + cpu: [ppc64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-riscv64-gnu@4.62.2': + resolution: {integrity: sha512-1SiZbzwdkaDURsew/tSOrooKiYy7EQGT6m8ufavAi9NEyQb/6VuIxFXAL1fqa4iZe3g4NbNk4P7J32z2tw5Mgg==} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-riscv64-musl@4.62.2': + resolution: {integrity: sha512-nQts12zJ3NQRoE6uYljOH89v7szzLDvG2JD/vsX+vGXU8w/At1GowTZ5/7qeFQ8m7L55rpR8Okugnuo5bgjy2Q==} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@rollup/rollup-linux-s390x-gnu@4.62.2': + resolution: {integrity: sha512-E9/ll019jhPIJgpzfZoIkBGhcz+kKNgVWYRY0zr9srBdPPFVpvOKW8VaJKUbeK+eZXyQF9ltME+Kk6affeaPgg==} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-x64-gnu@4.62.2': + resolution: {integrity: sha512-5BqxR/pshjey51iliyzTD5Xi3EN0aLmQ2lZ3lvefVV9c82BvrLo2/6OT55iifpWBufs6kdwWbuOKS841DrmK9A==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rollup/rollup-linux-x64-musl@4.62.2': + resolution: {integrity: sha512-uNN83XxQrRAh/w0/pmAfibcwyb6YWt4gP+dpnQKPVJshAloQ785ii8CT8ZCIxkGg9opVsvAlGhFitSm6D1Jjpg==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rollup/rollup-openbsd-x64@4.62.2': + resolution: {integrity: sha512-srjEIxSH3LRnJN6THczDHWQplqEMFiAJrTab0msUryh9kwNpkICf3Ea6q6MN/2cZwRFUNx5w+h6Hpi4QuHS6Zg==} + cpu: [x64] + os: [openbsd] + + '@rollup/rollup-openharmony-arm64@4.62.2': + resolution: {integrity: sha512-8hOJnxgbyObnCm5AlRA3A931xX19xq80RjVTKgJOvEKWqJruP/Uf12IbAOaDjjEXYRewwHLfmF0YRIdK3OwKWA==} + cpu: [arm64] + os: [openharmony] + + '@rollup/rollup-win32-arm64-msvc@4.62.2': + resolution: {integrity: sha512-mmF4AY1i0hG/bLWUctUq59gtmgaSIRa3cu/A3JFRp/sCNEme2bgDEiDS22P9FbnJB8NJNF4jPJiSP5RHQpUTDg==} + cpu: [arm64] + os: [win32] + + '@rollup/rollup-win32-ia32-msvc@4.62.2': + resolution: {integrity: sha512-DZgkknc6jhHrk46V25vbAM0zZkyP0nSDkJB8/dRkLTxv470dOmWDqGoEJl/9A0dFfS7yE3REOwNDxpHwSLSt0Q==} + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-gnu@4.62.2': + resolution: {integrity: sha512-T6xr6ucWSFto+VGajA8YH26LdpHRuP4YLHEKAtCWvJDOlnmWcDZVCI2Jmjr+IFHDlt2zRaTAKE4tfjTaWLgJBg==} + cpu: [x64] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.62.2': + resolution: {integrity: sha512-BfzEnDJOt9T8M989/lA37EcJgat01wLRnoi5dQf3QzOH7jzpqTAzdDbVfRljVr5r+jzKqpbHeyOfAaXxAd0PAA==} + cpu: [x64] + os: [win32] + '@swc/helpers@0.5.15': resolution: {integrity: sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==} @@ -1201,6 +1498,9 @@ packages: '@tailwindcss/postcss@4.3.1': resolution: {integrity: sha512-dNJuNbdEJT/SWRuXTYP1WSamelsz3ztkUsdtWQPjrexysrTpaEPM40P/71knXiXLYEojqPOEGitVLLpPMS5T6A==} + '@types/chai@5.2.3': + resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} + '@types/d3-array@3.2.2': resolution: {integrity: sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==} @@ -1228,6 +1528,12 @@ packages: '@types/d3-timer@3.0.2': resolution: {integrity: sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==} + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + + '@types/estree@1.0.9': + resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} + '@types/node@22.20.0': resolution: {integrity: sha512-QWlFW2wf3nTjC13/DqRnBpR4ZO36VJH/JVBkA/vcnmbTBNQIlnObqyqZE1tUR7+Ni23Lda8R1BxMfbXRpCUx5g==} @@ -1250,10 +1556,43 @@ packages: react: optional: true + '@vitest/expect@3.2.7': + resolution: {integrity: sha512-E8eBXaKibuvH2pSZErOjdVb5vF4PbKYcrnluBTYxEk1l/VhhwZg1kZQsdtjq+CsF5CFydf2Rdkz7jDHKSisi3w==} + + '@vitest/mocker@3.2.7': + resolution: {integrity: sha512-Trr0hYO9CM3Wj6ksWHRhK9IZpIY6wTMO5u/MqXurMxT57sWBaOPEtP3Oq60ihZuh5JsiagKfz95OcxdEP6dBrA==} + 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.7': + resolution: {integrity: sha512-KUHlwqVu0sRlhCdyPdQ/wBoTfRahjUky1MubOmYw9fWfIZy1gNoHpuaaQBPAaMaVYdQYHJLurzj8ECCj5OwTqA==} + + '@vitest/runner@3.2.7': + resolution: {integrity: sha512-sB9y4ovltoQP+WaUPwmSxO9WIg9Ig694Di5PalVPsYHklAdE027mehpWF2SQSVq+k6sFgaivbTjTJwZLSHbedA==} + + '@vitest/snapshot@3.2.7': + resolution: {integrity: sha512-7C+MwShwtBSI5Buwoyg3s/iY1eHL9PKAf+O1wVh/TdnjXUtkoL/9YQtre90i4MtNXM6edP1wJ2zOBpfCyhIS7g==} + + '@vitest/spy@3.2.7': + resolution: {integrity: sha512-Q2eQGI6d2L/hBtZ0qNuKcAGid68XK6cv1xsoaIma6PaJhHPoqcEJhYpXZ/5myCMqkNgtP6UKuBhbc0nHKnrkuQ==} + + '@vitest/utils@3.2.7': + resolution: {integrity: sha512-x6BDOd7dyo3PFLY3I9/HJ25X/6OurhGXk2/B9gOZNPF7XDVjeBK4k01lQE5uvDpbuheErh91qYuE1E2OEjK3Rw==} + aria-hidden@1.2.6: resolution: {integrity: sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA==} engines: {node: '>=10'} + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} + autoprefixer@10.5.0: resolution: {integrity: sha512-FMhOoZV4+qR6aTUALKX2rEqGG+oyATvwBt9IIzVR5rMa2HRWPkxf+P+PAJLD1I/H5/II+HuZcBJYEFBpq39ong==} engines: {node: ^10 || ^12 || >=14} @@ -1271,9 +1610,21 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true + cac@6.7.14: + resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} + engines: {node: '>=8'} + caniuse-lite@1.0.30001799: resolution: {integrity: sha512-hG1bReV+OUU+MOqK4t/ZWI0tZOyz3rqS9XuhOUz1cIcbwBKjOyJEJuw9ER5JuNyqxNk8u/JUVbGibBOL1yrjFw==} + chai@5.3.3: + resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} + engines: {node: '>=18'} + + check-error@2.1.3: + resolution: {integrity: sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==} + engines: {node: '>= 16'} + class-variance-authority@0.7.1: resolution: {integrity: sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==} @@ -1343,9 +1694,22 @@ packages: date-fns@4.1.0: resolution: {integrity: sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==} + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + decimal.js-light@2.5.1: resolution: {integrity: sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==} + deep-eql@5.0.2: + resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} + engines: {node: '>=6'} + detect-libc@2.1.2: resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} engines: {node: '>=8'} @@ -1376,20 +1740,49 @@ packages: resolution: {integrity: sha512-aNnGCvbJ/RIyWo1IuhNdVjnNF+EjH9wpzpNHt+ci/m9He9LJvUN8wrCcXjp9cWsGNAuvSpVFTx/vraAFQ8qGjQ==} engines: {node: '>=10.13.0'} + es-module-lexer@1.7.0: + resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} + + esbuild@0.28.1: + resolution: {integrity: sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==} + engines: {node: '>=18'} + hasBin: true + escalade@3.2.0: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} + estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + eventemitter3@4.0.7: resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} + expect-type@1.4.0: + resolution: {integrity: sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==} + engines: {node: '>=12.0.0'} + fast-equals@5.4.0: resolution: {integrity: sha512-jt2DW/aNFNwke7AUd+Z+e6pz39KO5rzdbbFCg2sGafS4mk13MI7Z8O5z9cADNn5lhGODIgLwug6TZO2ctf7kcw==} engines: {node: '>=6.0.0'} + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + fraction.js@5.3.4: resolution: {integrity: sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==} + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + get-nonce@1.0.1: resolution: {integrity: sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==} engines: {node: '>=6'} @@ -1414,6 +1807,9 @@ packages: js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + js-tokens@9.0.1: + resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} + lightningcss-android-arm64@1.32.0: resolution: {integrity: sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==} engines: {node: '>= 12.0.0'} @@ -1495,6 +1891,9 @@ packages: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true + loupe@3.2.1: + resolution: {integrity: sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==} + lucide-react@0.454.0: resolution: {integrity: sha512-hw7zMDwykCLnEzgncEEjHeA6+45aeEzRYuKHuyRSOPkhko+J3ySGjGIzu+mmMfDFG1vazHepMaYFYHbTFAZAAQ==} peerDependencies: @@ -1503,6 +1902,9 @@ packages: magic-string@0.30.21: resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + nanoid@3.3.15: resolution: {integrity: sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -1543,9 +1945,20 @@ packages: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} + 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.5: + resolution: {integrity: sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==} + engines: {node: '>=12'} + postcss-value-parser@4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} @@ -1650,6 +2063,11 @@ packages: react: ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react-dom: ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + rollup@4.62.2: + resolution: {integrity: sha512-RFnrW4lhXA3s3eqHDZvN654g8OTjzRfqpIRJYczCGB6HzphckVAi/Qh4tbPUbRuDi7s1Llv8g/NspLkttY3gTA==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + scheduler@0.27.0: resolution: {integrity: sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==} @@ -1665,6 +2083,9 @@ packages: resolution: {integrity: sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + siginfo@2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + sonner@1.7.4: resolution: {integrity: sha512-DIS8z4PfJRbIyfVFDVnK9rO3eYDtse4Omcm6bt0oEr5/jtLgysmjuBl1frJ9E/EQZrFmKx2A8m/s5s9CRXIzhw==} peerDependencies: @@ -1675,6 +2096,15 @@ packages: 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-literal@3.1.0: + resolution: {integrity: sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==} + stripe@22.2.3: resolution: {integrity: sha512-9lrggvLtjO4Ef5WXH4t50ckHJcJgTD72xFB+KJgZCSszAH9zMV1BqU6PwmWbRLdcdX7LK6PbErBapiGK7pIb+g==} engines: {node: '>=18'} @@ -1715,6 +2145,28 @@ packages: tiny-invariant@1.3.3: resolution: {integrity: sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==} + 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.17: + resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} + 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'} + tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} @@ -1769,6 +2221,84 @@ packages: victory-vendor@36.9.2: resolution: {integrity: sha512-PnpQQMuxlwYdocC8fIJqVXvkeViHYzotI+NJrCuav0ZYFoq912ZHBk3mCeuj+5/VpodOjPe1z0Fk2ihgzlXqjQ==} + 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.6: + resolution: {integrity: sha512-4XP60spRGjSZFf1qYH+dJIkK2znL3zQfl9KkOV9MkkRR/3Dls0dxaBsQPTloEc5BLXWPL9vsOxopxyKoMmDueg==} + 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.7: + resolution: {integrity: sha512-KrxIJ62Fd89gfysR4WotlgZABiz2dqFPgqGzX7s+CwsqLFomRH7777ZcrOD6+WVAh7khPQP41A+BKbpcJFrdEg==} + 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.7 + '@vitest/ui': 3.2.7 + 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 + + why-is-node-running@2.3.0: + resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} + engines: {node: '>=8'} + hasBin: true + zod@3.25.76: resolution: {integrity: sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==} @@ -1785,6 +2315,84 @@ snapshots: tslib: 2.8.1 optional: true + '@esbuild/aix-ppc64@0.28.1': + optional: true + + '@esbuild/android-arm64@0.28.1': + optional: true + + '@esbuild/android-arm@0.28.1': + optional: true + + '@esbuild/android-x64@0.28.1': + optional: true + + '@esbuild/darwin-arm64@0.28.1': + optional: true + + '@esbuild/darwin-x64@0.28.1': + optional: true + + '@esbuild/freebsd-arm64@0.28.1': + optional: true + + '@esbuild/freebsd-x64@0.28.1': + optional: true + + '@esbuild/linux-arm64@0.28.1': + optional: true + + '@esbuild/linux-arm@0.28.1': + optional: true + + '@esbuild/linux-ia32@0.28.1': + optional: true + + '@esbuild/linux-loong64@0.28.1': + optional: true + + '@esbuild/linux-mips64el@0.28.1': + optional: true + + '@esbuild/linux-ppc64@0.28.1': + optional: true + + '@esbuild/linux-riscv64@0.28.1': + optional: true + + '@esbuild/linux-s390x@0.28.1': + optional: true + + '@esbuild/linux-x64@0.28.1': + optional: true + + '@esbuild/netbsd-arm64@0.28.1': + optional: true + + '@esbuild/netbsd-x64@0.28.1': + optional: true + + '@esbuild/openbsd-arm64@0.28.1': + optional: true + + '@esbuild/openbsd-x64@0.28.1': + optional: true + + '@esbuild/openharmony-arm64@0.28.1': + optional: true + + '@esbuild/sunos-x64@0.28.1': + optional: true + + '@esbuild/win32-arm64@0.28.1': + optional: true + + '@esbuild/win32-ia32@0.28.1': + optional: true + + '@esbuild/win32-x64@0.28.1': + optional: true + '@floating-ui/core@1.7.5': dependencies: '@floating-ui/utils': 0.2.11 @@ -2640,6 +3248,81 @@ snapshots: '@radix-ui/rect@1.1.0': {} + '@rollup/rollup-android-arm-eabi@4.62.2': + optional: true + + '@rollup/rollup-android-arm64@4.62.2': + optional: true + + '@rollup/rollup-darwin-arm64@4.62.2': + optional: true + + '@rollup/rollup-darwin-x64@4.62.2': + optional: true + + '@rollup/rollup-freebsd-arm64@4.62.2': + optional: true + + '@rollup/rollup-freebsd-x64@4.62.2': + optional: true + + '@rollup/rollup-linux-arm-gnueabihf@4.62.2': + optional: true + + '@rollup/rollup-linux-arm-musleabihf@4.62.2': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.62.2': + optional: true + + '@rollup/rollup-linux-arm64-musl@4.62.2': + optional: true + + '@rollup/rollup-linux-loong64-gnu@4.62.2': + optional: true + + '@rollup/rollup-linux-loong64-musl@4.62.2': + optional: true + + '@rollup/rollup-linux-ppc64-gnu@4.62.2': + optional: true + + '@rollup/rollup-linux-ppc64-musl@4.62.2': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.62.2': + optional: true + + '@rollup/rollup-linux-riscv64-musl@4.62.2': + optional: true + + '@rollup/rollup-linux-s390x-gnu@4.62.2': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.62.2': + optional: true + + '@rollup/rollup-linux-x64-musl@4.62.2': + optional: true + + '@rollup/rollup-openbsd-x64@4.62.2': + optional: true + + '@rollup/rollup-openharmony-arm64@4.62.2': + optional: true + + '@rollup/rollup-win32-arm64-msvc@4.62.2': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.62.2': + optional: true + + '@rollup/rollup-win32-x64-gnu@4.62.2': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.62.2': + optional: true + '@swc/helpers@0.5.15': dependencies: tslib: 2.8.1 @@ -2713,6 +3396,11 @@ snapshots: postcss: 8.5.15 tailwindcss: 4.3.1 + '@types/chai@5.2.3': + dependencies: + '@types/deep-eql': 4.0.2 + assertion-error: 2.0.1 + '@types/d3-array@3.2.2': {} '@types/d3-color@3.1.3': {} @@ -2737,6 +3425,10 @@ snapshots: '@types/d3-timer@3.0.2': {} + '@types/deep-eql@4.0.2': {} + + '@types/estree@1.0.9': {} + '@types/node@22.20.0': dependencies: undici-types: 6.21.0 @@ -2756,10 +3448,54 @@ snapshots: next: 16.0.10(react-dom@19.2.0(react@19.2.0))(react@19.2.0) react: 19.2.0 + '@vitest/expect@3.2.7': + dependencies: + '@types/chai': 5.2.3 + '@vitest/spy': 3.2.7 + '@vitest/utils': 3.2.7 + chai: 5.3.3 + tinyrainbow: 2.0.0 + + '@vitest/mocker@3.2.7(vite@7.3.6(@types/node@22.20.0)(jiti@2.7.0)(lightningcss@1.32.0))': + dependencies: + '@vitest/spy': 3.2.7 + estree-walker: 3.0.3 + magic-string: 0.30.21 + optionalDependencies: + vite: 7.3.6(@types/node@22.20.0)(jiti@2.7.0)(lightningcss@1.32.0) + + '@vitest/pretty-format@3.2.7': + dependencies: + tinyrainbow: 2.0.0 + + '@vitest/runner@3.2.7': + dependencies: + '@vitest/utils': 3.2.7 + pathe: 2.0.3 + strip-literal: 3.1.0 + + '@vitest/snapshot@3.2.7': + dependencies: + '@vitest/pretty-format': 3.2.7 + magic-string: 0.30.21 + pathe: 2.0.3 + + '@vitest/spy@3.2.7': + dependencies: + tinyspy: 4.0.4 + + '@vitest/utils@3.2.7': + dependencies: + '@vitest/pretty-format': 3.2.7 + loupe: 3.2.1 + tinyrainbow: 2.0.0 + aria-hidden@1.2.6: dependencies: tslib: 2.8.1 + assertion-error@2.0.1: {} + autoprefixer@10.5.0(postcss@8.5.15): dependencies: browserslist: 4.28.4 @@ -2779,8 +3515,20 @@ snapshots: node-releases: 2.0.49 update-browserslist-db: 1.2.3(browserslist@4.28.4) + cac@6.7.14: {} + caniuse-lite@1.0.30001799: {} + 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 + + check-error@2.1.3: {} + class-variance-authority@0.7.1: dependencies: clsx: 2.1.1 @@ -2845,8 +3593,14 @@ snapshots: date-fns@4.1.0: {} + debug@4.4.3: + dependencies: + ms: 2.1.3 + decimal.js-light@2.5.1: {} + deep-eql@5.0.2: {} + detect-libc@2.1.2: {} detect-node-es@1.1.0: {} @@ -2875,14 +3629,58 @@ snapshots: graceful-fs: 4.2.11 tapable: 2.3.3 + es-module-lexer@1.7.0: {} + + esbuild@0.28.1: + optionalDependencies: + '@esbuild/aix-ppc64': 0.28.1 + '@esbuild/android-arm': 0.28.1 + '@esbuild/android-arm64': 0.28.1 + '@esbuild/android-x64': 0.28.1 + '@esbuild/darwin-arm64': 0.28.1 + '@esbuild/darwin-x64': 0.28.1 + '@esbuild/freebsd-arm64': 0.28.1 + '@esbuild/freebsd-x64': 0.28.1 + '@esbuild/linux-arm': 0.28.1 + '@esbuild/linux-arm64': 0.28.1 + '@esbuild/linux-ia32': 0.28.1 + '@esbuild/linux-loong64': 0.28.1 + '@esbuild/linux-mips64el': 0.28.1 + '@esbuild/linux-ppc64': 0.28.1 + '@esbuild/linux-riscv64': 0.28.1 + '@esbuild/linux-s390x': 0.28.1 + '@esbuild/linux-x64': 0.28.1 + '@esbuild/netbsd-arm64': 0.28.1 + '@esbuild/netbsd-x64': 0.28.1 + '@esbuild/openbsd-arm64': 0.28.1 + '@esbuild/openbsd-x64': 0.28.1 + '@esbuild/openharmony-arm64': 0.28.1 + '@esbuild/sunos-x64': 0.28.1 + '@esbuild/win32-arm64': 0.28.1 + '@esbuild/win32-ia32': 0.28.1 + '@esbuild/win32-x64': 0.28.1 + escalade@3.2.0: {} + estree-walker@3.0.3: + dependencies: + '@types/estree': 1.0.9 + eventemitter3@4.0.7: {} + expect-type@1.4.0: {} + fast-equals@5.4.0: {} + fdir@6.5.0(picomatch@4.0.5): + optionalDependencies: + picomatch: 4.0.5 + fraction.js@5.3.4: {} + fsevents@2.3.3: + optional: true + get-nonce@1.0.1: {} graceful-fs@4.2.11: {} @@ -2898,6 +3696,8 @@ snapshots: js-tokens@4.0.0: {} + js-tokens@9.0.1: {} + lightningcss-android-arm64@1.32.0: optional: true @@ -2953,6 +3753,8 @@ snapshots: dependencies: js-tokens: 4.0.0 + loupe@3.2.1: {} + lucide-react@0.454.0(react@19.2.0): dependencies: react: 19.2.0 @@ -2961,6 +3763,8 @@ snapshots: dependencies: '@jridgewell/sourcemap-codec': 1.5.5 + ms@2.1.3: {} + nanoid@3.3.15: {} next-themes@0.4.6(react-dom@19.2.0(react@19.2.0))(react@19.2.0): @@ -2995,8 +3799,14 @@ snapshots: object-assign@4.1.1: {} + pathe@2.0.3: {} + + pathval@2.0.1: {} + picocolors@1.1.1: {} + picomatch@4.0.5: {} + postcss-value-parser@4.2.0: {} postcss@8.4.31: @@ -3107,6 +3917,37 @@ snapshots: tiny-invariant: 1.3.3 victory-vendor: 36.9.2 + rollup@4.62.2: + dependencies: + '@types/estree': 1.0.9 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.62.2 + '@rollup/rollup-android-arm64': 4.62.2 + '@rollup/rollup-darwin-arm64': 4.62.2 + '@rollup/rollup-darwin-x64': 4.62.2 + '@rollup/rollup-freebsd-arm64': 4.62.2 + '@rollup/rollup-freebsd-x64': 4.62.2 + '@rollup/rollup-linux-arm-gnueabihf': 4.62.2 + '@rollup/rollup-linux-arm-musleabihf': 4.62.2 + '@rollup/rollup-linux-arm64-gnu': 4.62.2 + '@rollup/rollup-linux-arm64-musl': 4.62.2 + '@rollup/rollup-linux-loong64-gnu': 4.62.2 + '@rollup/rollup-linux-loong64-musl': 4.62.2 + '@rollup/rollup-linux-ppc64-gnu': 4.62.2 + '@rollup/rollup-linux-ppc64-musl': 4.62.2 + '@rollup/rollup-linux-riscv64-gnu': 4.62.2 + '@rollup/rollup-linux-riscv64-musl': 4.62.2 + '@rollup/rollup-linux-s390x-gnu': 4.62.2 + '@rollup/rollup-linux-x64-gnu': 4.62.2 + '@rollup/rollup-linux-x64-musl': 4.62.2 + '@rollup/rollup-openbsd-x64': 4.62.2 + '@rollup/rollup-openharmony-arm64': 4.62.2 + '@rollup/rollup-win32-arm64-msvc': 4.62.2 + '@rollup/rollup-win32-ia32-msvc': 4.62.2 + '@rollup/rollup-win32-x64-gnu': 4.62.2 + '@rollup/rollup-win32-x64-msvc': 4.62.2 + fsevents: 2.3.3 + scheduler@0.27.0: {} semver@7.8.5: @@ -3146,6 +3987,8 @@ snapshots: '@img/sharp-win32-x64': 0.34.5 optional: true + siginfo@2.0.0: {} + sonner@1.7.4(react-dom@19.2.0(react@19.2.0))(react@19.2.0): dependencies: react: 19.2.0 @@ -3153,6 +3996,14 @@ snapshots: source-map-js@1.2.1: {} + stackback@0.0.2: {} + + std-env@3.10.0: {} + + strip-literal@3.1.0: + dependencies: + js-tokens: 9.0.1 + stripe@22.2.3(@types/node@22.20.0): optionalDependencies: '@types/node': 22.20.0 @@ -3174,6 +4025,21 @@ snapshots: tiny-invariant@1.3.3: {} + tinybench@2.9.0: {} + + tinyexec@0.3.2: {} + + tinyglobby@0.2.17: + dependencies: + fdir: 6.5.0(picomatch@4.0.5) + picomatch: 4.0.5 + + tinypool@1.1.1: {} + + tinyrainbow@2.0.0: {} + + tinyspy@4.0.4: {} + tslib@2.8.1: {} tw-animate-css@1.3.3: {} @@ -3233,4 +4099,85 @@ snapshots: d3-time: 3.1.0 d3-timer: 3.0.1 + vite-node@3.2.4(@types/node@22.20.0)(jiti@2.7.0)(lightningcss@1.32.0): + dependencies: + cac: 6.7.14 + debug: 4.4.3 + es-module-lexer: 1.7.0 + pathe: 2.0.3 + vite: 7.3.6(@types/node@22.20.0)(jiti@2.7.0)(lightningcss@1.32.0) + transitivePeerDependencies: + - '@types/node' + - jiti + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + + vite@7.3.6(@types/node@22.20.0)(jiti@2.7.0)(lightningcss@1.32.0): + dependencies: + esbuild: 0.28.1 + fdir: 6.5.0(picomatch@4.0.5) + picomatch: 4.0.5 + postcss: 8.5.15 + rollup: 4.62.2 + tinyglobby: 0.2.17 + optionalDependencies: + '@types/node': 22.20.0 + fsevents: 2.3.3 + jiti: 2.7.0 + lightningcss: 1.32.0 + + vitest@3.2.7(@types/node@22.20.0)(jiti@2.7.0)(lightningcss@1.32.0): + dependencies: + '@types/chai': 5.2.3 + '@vitest/expect': 3.2.7 + '@vitest/mocker': 3.2.7(vite@7.3.6(@types/node@22.20.0)(jiti@2.7.0)(lightningcss@1.32.0)) + '@vitest/pretty-format': 3.2.7 + '@vitest/runner': 3.2.7 + '@vitest/snapshot': 3.2.7 + '@vitest/spy': 3.2.7 + '@vitest/utils': 3.2.7 + chai: 5.3.3 + debug: 4.4.3 + expect-type: 1.4.0 + magic-string: 0.30.21 + pathe: 2.0.3 + picomatch: 4.0.5 + std-env: 3.10.0 + tinybench: 2.9.0 + tinyexec: 0.3.2 + tinyglobby: 0.2.17 + tinypool: 1.1.1 + tinyrainbow: 2.0.0 + vite: 7.3.6(@types/node@22.20.0)(jiti@2.7.0)(lightningcss@1.32.0) + vite-node: 3.2.4(@types/node@22.20.0)(jiti@2.7.0)(lightningcss@1.32.0) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 22.20.0 + transitivePeerDependencies: + - jiti + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + + why-is-node-running@2.3.0: + dependencies: + siginfo: 2.0.0 + stackback: 0.0.2 + zod@3.25.76: {} diff --git a/src/clients/aud0-client.ts b/src/clients/aud0-client.ts new file mode 100644 index 0000000..22d2f1f --- /dev/null +++ b/src/clients/aud0-client.ts @@ -0,0 +1,97 @@ +// AUD0 audit/evidence client -- 0pt's ONLY path for recording "what +// happened" to the append-only system of record. Every mutating capability +// in this repo emits both a plain event (`ingestEvent`) and, where the +// mutation produced or transformed something, a lineage edge +// (`ingestLineageEvent`) -- see docs/ICEBERG_WRITE_BOUNDARY.md's "Event +// names" table for the full list this client backs. +// +// Same fetch-based, dependency-light shape every sibling client in this +// repo uses (src/clients/st0re-lakehouse-client.ts and this file's own +// siblings cl0ud-client.ts/n0d-client.ts/st0re-client.ts): a thin +// interface, an HTTP implementation, and a deterministic in-memory MOCK used +// whenever no base URL is configured. +// +// HONESTY NOTE: no AUD0_URL was available to probe in this pass. The mock +// below is a true no-op (per docs/ICEBERG_WRITE_BOUNDARY.md: "no-op by +// default, same as every other AUD0 emission already in this repo -- AUD0 +// has no live ingestion endpoint yet") -- it never throws and never blocks a +// caller, matching AUD0's own documented stance that an audit emission is a +// record of what already happened, not a gate the action waits on. A real +// deployment must be pointed at via `aud0BaseUrl`/`AUD0_URL` before events +// emitted through this client are actually durable anywhere. + +export interface Aud0EventInput { + event_id: string; + event_type: string; + tenant_id: string; + project_id: string; + actor_id: string; + app_id: string; + capability_id: string; + resource_type: string; + resource_id: string; + risk_level: string; + payload?: unknown; + created_at: string; + correlation_id: string; +} + +export interface Aud0LineageEventInput { + lineage_event_id: string; + tenant_id: string; + project_id: string; + app_id: string; + capability_id: string; + source_type: string; + source_id: string; + target_type: string; + target_id: string; + lineage_type: string; + metadata?: unknown; + created_at: string; + correlation_id: string; +} + +export interface Aud0Client { + ingestEvent(input: Aud0EventInput): Promise; + ingestLineageEvent(input: Aud0LineageEventInput): Promise; +} + +export function createAud0Client(baseUrl?: string): Aud0Client { + if (!baseUrl) return new MockAud0Client(); + return new HttpAud0Client(baseUrl); +} + +class MockAud0Client implements Aud0Client { + async ingestEvent(input: Aud0EventInput): Promise { + return input; + } + + async ingestLineageEvent(input: Aud0LineageEventInput): Promise { + return input; + } +} + +class HttpAud0Client implements Aud0Client { + constructor(private baseUrl: string) {} + + async ingestEvent(input: Aud0EventInput): Promise { + const res = await fetch(`${this.baseUrl}/v1/aud0/events`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(input), + }); + if (!res.ok) throw new Error(`AUD0 event ingestion error: ${res.status}`); + return res.json(); + } + + async ingestLineageEvent(input: Aud0LineageEventInput): Promise { + const res = await fetch(`${this.baseUrl}/v1/aud0/lineage/events`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(input), + }); + if (!res.ok) throw new Error(`AUD0 lineage event ingestion error: ${res.status}`); + return res.json(); + } +} diff --git a/src/clients/cl0ud-client.ts b/src/clients/cl0ud-client.ts new file mode 100644 index 0000000..1bddb8b --- /dev/null +++ b/src/clients/cl0ud-client.ts @@ -0,0 +1,82 @@ +// CL0UD policy client -- 0pt's ONLY path for the "is this actor/capability/ +// resource allowed right now" check every mutating capability in this repo +// re-runs before it acts (document-extraction-service.ts, iceberg-write-service.ts, +// external-writeback-service.ts). Never bypassed: a `deny` or +// `approval_required` decision always aborts the caller, even when an +// upstream gate (e.g. ACT0's own Approval Engine) already ran -- see +// external-writeback-service.ts's own module doc comment for why that +// specific re-check matters. +// +// Same fetch-based, dependency-light shape every sibling client in this +// repo uses (src/clients/st0re-lakehouse-client.ts, and this file's own +// siblings n0d-client.ts/aud0-client.ts/st0re-client.ts): a thin interface, +// an HTTP implementation, and a deterministic in-memory MOCK used whenever +// no base URL is configured, so this repo's tests (and any caller before +// CL0UD_URL is wired) exercise the real request/response shape and control +// flow without requiring a live CL0UD deployment. +// +// HONESTY NOTE (matches the convention docs/ICEBERG_WRITE_BOUNDARY.md +// documents for st0re-lakehouse-client.ts): no CL0UD_URL was available to +// probe in this pass. The mock below always returns "allow" -- the same +// "graceful degradation when unconfigured" doctrine used throughout this +// repo family, not a security control. A real deployment must be pointed at +// via `cl0udBaseUrl`/`CL0UD_URL` before this client's decision means +// anything in production. + +export type PolicyDecisionValue = "allow" | "deny" | "approval_required"; + +export interface EvaluatePolicyInput { + tenant_id: string; + project_id: string; + actor_id: string; + capability_id: string; + resource_type: string; + resource_id: string; + risk_level: string; + correlation_id: string; +} + +export interface PolicyDecision { + decision_id: string; + decision: PolicyDecisionValue; + reason?: string; +} + +export interface Cl0udClient { + evaluatePolicy(input: EvaluatePolicyInput): Promise; +} + +export function createCl0udClient(baseUrl?: string): Cl0udClient { + if (!baseUrl) return new MockCl0udClient(); + return new HttpCl0udClient(baseUrl); +} + +/** + * Deterministic mock -- always "allow". Every 0pt service that calls + * evaluatePolicy() treats a missing decision as fail-closed (it throws on + * anything other than "allow"), so a mock that instead defaulted to "deny" + * would make every unconfigured-CL0UD test path unusable. "allow" is the + * documented, deliberate choice for local/test/unconfigured use -- + * tests/p0/external-writeback-service.test.ts exercises "deny" and + * "approval_required" explicitly via its own fetch stub against an HTTP + * client instance, not this mock. + */ +class MockCl0udClient implements Cl0udClient { + async evaluatePolicy(_input: EvaluatePolicyInput): Promise { + return { decision_id: `mock_decision_${Date.now()}`, decision: "allow" }; + } +} + +class HttpCl0udClient implements Cl0udClient { + constructor(private baseUrl: string) {} + + async evaluatePolicy(input: EvaluatePolicyInput): Promise { + const res = await fetch(`${this.baseUrl}/v1/cl0ud/policies/evaluate`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(input), + }); + if (!res.ok) throw new Error(`CL0UD policy evaluation error: ${res.status}`); + return res.json(); + } +} diff --git a/src/clients/n0d-client.ts b/src/clients/n0d-client.ts new file mode 100644 index 0000000..64c07aa --- /dev/null +++ b/src/clients/n0d-client.ts @@ -0,0 +1,85 @@ +// N0D compute client -- 0pt's ONLY path for requesting a job on N0D +// (Compute OS). 0pt REQUESTS jobs; it never executes them in-process and +// never owns N0D's scheduling/node/GPU decisions (see +// docs/ICEBERG_WRITE_BOUNDARY.md's "N0D executes" boundary note and +// iceberg-write-service.ts's `requestIcebergWrite({ heavy: true })` for the +// concrete example this client backs). +// +// Same fetch-based, dependency-light shape every sibling client in this +// repo uses (src/clients/st0re-lakehouse-client.ts and this file's own +// siblings cl0ud-client.ts/aud0-client.ts/st0re-client.ts): a thin +// interface, an HTTP implementation, and a deterministic in-memory MOCK used +// whenever no base URL is configured -- see st0re-lakehouse-client.ts's +// module doc comment for the full rationale, which applies here unchanged. +// +// HONESTY NOTE: no N0D_URL was available to probe in this pass. The mock +// below returns a queued job id (`mock_job_*`, matching the prefix this +// repo's own tests already assert on -- tests/p0/iceberg-write-service.test.ts, +// tests/p0/document-capture-mailbox.test.ts) but never actually runs +// anything. A real deployment must be pointed at via `n0dBaseUrl`/`N0D_URL` +// before a "job" requested through this client does real work. + +export interface N0dCreateJobInput { + tenant_id: string; + project_id: string; + job_type: string; + capability_id: string; + requested_by_app_id: string; + requested_by_actor_id: string; + input_artifact_ids?: string[]; + input_dataset_ids?: string[]; + output_artifact_type?: string; + requires_backbone?: boolean; + requires_gpu?: boolean; + required_node_roles?: string[]; + resource_profile?: string; + risk_level: string; + correlation_id: string; +} + +export type N0dJobStatus = "queued" | "running" | "completed" | "failed"; + +export interface N0dJob { + job_id: string; + status: N0dJobStatus; + job_type: string; + tenant_id: string; + project_id: string; + created_at: string; +} + +export interface N0dClient { + createJob(input: N0dCreateJobInput): Promise; +} + +export function createN0dClient(baseUrl?: string): N0dClient { + if (!baseUrl) return new MockN0dClient(); + return new HttpN0dClient(baseUrl); +} + +class MockN0dClient implements N0dClient { + async createJob(input: N0dCreateJobInput): Promise { + return { + job_id: `mock_job_${Date.now()}`, + status: "queued", + job_type: input.job_type, + tenant_id: input.tenant_id, + project_id: input.project_id, + created_at: new Date().toISOString(), + }; + } +} + +class HttpN0dClient implements N0dClient { + constructor(private baseUrl: string) {} + + async createJob(input: N0dCreateJobInput): Promise { + const res = await fetch(`${this.baseUrl}/v1/n0d/jobs`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(input), + }); + if (!res.ok) throw new Error(`N0D job creation error: ${res.status}`); + return res.json(); + } +} diff --git a/src/clients/st0re-client.ts b/src/clients/st0re-client.ts new file mode 100644 index 0000000..dd351ef --- /dev/null +++ b/src/clients/st0re-client.ts @@ -0,0 +1,89 @@ +// ST0RE generic artifact-registry client -- 0pt's path for registering +// artifact METADATA (a pointer to provider/bucket/key + content/PII/ +// retention metadata), used by document-capture-service.ts and +// document-extraction-service.ts to record what they produced. +// +// Distinct from `./st0re-lakehouse-client.ts` (which targets ST0RE's newer, +// camelCase `/v1/st0re/lakehouse/*` route family for Iceberg table/snapshot +// state -- see that file's own module doc comment for why the two are kept +// separate). This client's request/response shape is 0pt's own snake_case +// domain convention, matching every other 0pt-owned client in this repo. +// +// KNOWN GAP (see src/adapters/local-blob-store.ts and +// src/services/document-capture-service.ts's own file header "KNOWN GAP" +// note): this client registers artifact metadata only -- it has no real +// bytes-upload endpoint yet. Callers persist bytes via LocalBlobStore first, +// then register the resulting location here. +// +// Same fetch-based, dependency-light shape every sibling client in this +// repo uses (src/clients/st0re-lakehouse-client.ts and this file's own +// siblings cl0ud-client.ts/n0d-client.ts/aud0-client.ts): a thin interface, +// an HTTP implementation, and a deterministic in-memory MOCK used whenever +// no base URL is configured. +// +// HONESTY NOTE: no ST0RE_URL was available to probe in this pass. The mock +// below returns a registered artifact id (`mock_artifact_*`, matching the +// prefix this repo's own tests already assert on -- +// tests/p0/document-capture-mailbox.test.ts, +// tests/p0/document-extraction-never-fabricates.test.ts) but does not +// persist anything beyond the current process. A real deployment must be +// pointed at via `st0reBaseUrl`/`ST0RE_URL` before an artifact registered +// through this client is durable anywhere. + +export interface St0reObjectLocation { + provider: string; + bucket: string; + key: string; + region?: string; +} + +export interface St0reArtifactInput { + tenant_id: string; + project_id: string; + artifact_type: string; + app_id: string; + produced_by: string; + object_location: St0reObjectLocation; + content_type: string; + size_bytes: number; + checksum_sha256: string; + pii_level?: "none" | "low" | "medium" | "high"; + retention_policy?: string; + data_residency?: string; + risk_level: string; + correlation_id: string; +} + +export interface St0reArtifact extends St0reArtifactInput { + artifact_id: string; + created_at: string; +} + +export interface St0reClient { + createArtifact(input: St0reArtifactInput): Promise; +} + +export function createSt0reClient(baseUrl?: string): St0reClient { + if (!baseUrl) return new MockSt0reClient(); + return new HttpSt0reClient(baseUrl); +} + +class MockSt0reClient implements St0reClient { + async createArtifact(input: St0reArtifactInput): Promise { + return { ...input, artifact_id: `mock_artifact_${Date.now()}`, created_at: new Date().toISOString() }; + } +} + +class HttpSt0reClient implements St0reClient { + constructor(private baseUrl: string) {} + + async createArtifact(input: St0reArtifactInput): Promise { + const res = await fetch(`${this.baseUrl}/v1/st0re/artifacts/register`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(input), + }); + if (!res.ok) throw new Error(`ST0RE artifact registration error: ${res.status}`); + return res.json(); + } +} diff --git a/src/services/dataset-service.ts b/src/services/dataset-service.ts new file mode 100644 index 0000000..a56f3e5 --- /dev/null +++ b/src/services/dataset-service.ts @@ -0,0 +1,114 @@ +/** + * src/services/dataset-service.ts + * ================================== + * Owns the 0pt.dataset registry -- the thing `DatasetIcebergMappingService` + * (src/services/dataset-iceberg-mapping-service.ts) and `IcebergWriteService` + * (src/services/iceberg-write-service.ts) look a `dataset_id` up against + * before pointing an Iceberg table mapping or a write at it. Deliberately + * small and in-memory, same "pure core, thin registry" shape every other + * P0 service in this repo already uses (SourceService, SourceRatePolicyService, + * DatasetIcebergMappingService) -- this is NOT dataset content, schema, or + * quality state; see docs/ICEBERG_WRITE_BOUNDARY.md for that boundary. + * + * In-memory scope: each `new DatasetService()` owns its own registry, same + * pre-existing limitation source-service.ts and every other P0 registry + * service in this repo documents (see docs/P0_QUERY_SOURCE_FLOW.md's "Known + * gaps" section) -- callers that need a shared view across API routes pass + * an existing instance in via the `datasetService` constructor option, + * exactly like IcebergWriteService and DatasetIcebergMappingService already + * do for each other. + */ +import { createAud0Client, type Aud0Client } from "../clients/aud0-client"; +import type { Dataset, DatasetStatus, DatasetType, CreateDatasetInput } from "../types/dataset"; + +interface DatasetRecord { + dataset_id: string; + tenant_id: string; + project_id: string; + name: string; + dataset_type: string; + status: string; + description: string | null; + correlation_id: string | null; + created_at: string; + updated_at: string | null; +} + +export class DatasetService { + private datasets: Map = new Map(); + private aud0: Aud0Client; + + constructor(aud0BaseUrl?: string) { + this.aud0 = createAud0Client(aud0BaseUrl); + } + + async registerDataset(input: CreateDatasetInput): Promise { + if (this.datasets.has(input.dataset_id)) { + throw new Error(`Dataset ${input.dataset_id} already exists`); + } + const now = new Date().toISOString(); + const record: DatasetRecord = { + dataset_id: input.dataset_id, + tenant_id: input.tenant_id, + project_id: input.project_id, + name: input.name, + dataset_type: input.dataset_type, + status: input.status ?? "active", + description: input.description ?? null, + correlation_id: input.correlation_id ?? null, + created_at: now, + updated_at: null, + }; + this.datasets.set(input.dataset_id, record); + + // 0pt.dataset_registered -- same "no mutation without an evented trail" + // doctrine every other P0 registry service in this repo follows + // (SourceService.createSource, SourceRatePolicyService.createSourceRatePolicy). + await this.aud0.ingestEvent({ + event_id: `evt_0pt_dataset_registered_${input.dataset_id}`, + event_type: "0pt.dataset_registered", + tenant_id: input.tenant_id, + project_id: input.project_id, + actor_id: "system", + app_id: "0pt", + capability_id: "0pt.register_dataset", + resource_type: "dataset", + resource_id: input.dataset_id, + risk_level: "L2", + payload: { name: input.name, dataset_type: input.dataset_type }, + created_at: now, + correlation_id: input.correlation_id ?? "", + }); + + return this.toDataset(record); + } + + async getDataset(datasetId: string): Promise { + const record = this.datasets.get(datasetId); + if (!record) throw new Error(`Dataset ${datasetId} not found`); + return this.toDataset(record); + } + + async listDatasets(filter?: { tenant_id?: string; project_id?: string; status?: DatasetStatus }): Promise { + let results = Array.from(this.datasets.values()); + if (filter?.tenant_id) results = results.filter((r) => r.tenant_id === filter.tenant_id); + if (filter?.project_id) results = results.filter((r) => r.project_id === filter.project_id); + if (filter?.status) results = results.filter((r) => r.status === filter.status); + return results.map((r) => this.toDataset(r)); + } + + private toDataset(r: DatasetRecord): Dataset { + return { + dataset_id: r.dataset_id, + tenant_id: r.tenant_id, + project_id: r.project_id, + name: r.name, + dataset_type: r.dataset_type as DatasetType, + status: r.status as DatasetStatus, + description: r.description ?? undefined, + correlation_id: r.correlation_id ?? undefined, + created_at: r.created_at, + updated_at: r.updated_at ?? undefined, + }; + } +} diff --git a/src/services/source-service.ts b/src/services/source-service.ts new file mode 100644 index 0000000..367a725 --- /dev/null +++ b/src/services/source-service.ts @@ -0,0 +1,116 @@ +/** + * src/services/source-service.ts + * ================================= + * Owns the 0pt.source registry -- a per-tenant registration of something + * 0pt can query or crawl against (source_type "database" | "web" | "api" | + * "file", carrying an `adapter_id` for the database case). This is the + * registry `SourceQueryService.querySource()` (src/services/source-query-service.ts) + * and `SourceRatePolicyService` (src/services/source-rate-policy-service.ts) + * both look a `source_id` up against -- see docs/P0_QUERY_SOURCE_FLOW.md. + * + * Deliberately small and in-memory, same "pure core, thin registry" shape + * every other P0 service in this repo already uses. In-memory scope: each + * `new SourceService()` owns its own registry -- the same pre-existing + * limitation docs/P0_QUERY_SOURCE_FLOW.md's "Known gaps" section documents + * (a Source registered via one API route module is not yet visible to + * another route module in the same running process). Callers that need a + * shared view pass an existing instance in via the `sourceService` + * constructor option, exactly like SourceQueryService/SourceRatePolicyService + * already do. + */ +import { createAud0Client, type Aud0Client } from "../clients/aud0-client"; +import type { Source, SourceStatus, SourceType, CreateSourceInput } from "../types/source"; + +interface SourceRecord { + source_id: string; + tenant_id: string; + project_id: string; + source_type: string; + name: string; + adapter_id: string | null; + access: string | null; + status: string; + correlation_id: string | null; + created_at: string; + updated_at: string | null; +} + +export class SourceService { + private sources: Map = new Map(); + private aud0: Aud0Client; + + constructor(aud0BaseUrl?: string) { + this.aud0 = createAud0Client(aud0BaseUrl); + } + + async createSource(input: CreateSourceInput): Promise { + if (this.sources.has(input.source_id)) { + throw new Error(`Source ${input.source_id} already exists`); + } + const now = new Date().toISOString(); + const record: SourceRecord = { + source_id: input.source_id, + tenant_id: input.tenant_id, + project_id: input.project_id, + source_type: input.source_type, + name: input.name, + adapter_id: input.adapter_id ?? null, + access: input.access ?? null, + status: input.status ?? "active", + correlation_id: input.correlation_id ?? null, + created_at: now, + updated_at: null, + }; + this.sources.set(input.source_id, record); + + // 0pt.source_created -- same "no mutation without an evented trail" + // doctrine every other P0 registry service in this repo follows. + await this.aud0.ingestEvent({ + event_id: `evt_0pt_source_created_${input.source_id}`, + event_type: "0pt.source_created", + tenant_id: input.tenant_id, + project_id: input.project_id, + actor_id: "system", + app_id: "0pt", + capability_id: "0pt.create_source", + resource_type: "source", + resource_id: input.source_id, + risk_level: "L2", + payload: { source_type: input.source_type, name: input.name, adapter_id: input.adapter_id }, + created_at: now, + correlation_id: input.correlation_id ?? "", + }); + + return this.toSource(record); + } + + async getSource(sourceId: string): Promise { + const record = this.sources.get(sourceId); + if (!record) throw new Error(`Source ${sourceId} not found`); + return this.toSource(record); + } + + async listSources(filter?: { tenant_id?: string; project_id?: string; status?: SourceStatus }): Promise { + let results = Array.from(this.sources.values()); + if (filter?.tenant_id) results = results.filter((r) => r.tenant_id === filter.tenant_id); + if (filter?.project_id) results = results.filter((r) => r.project_id === filter.project_id); + if (filter?.status) results = results.filter((r) => r.status === filter.status); + return results.map((r) => this.toSource(r)); + } + + private toSource(r: SourceRecord): Source { + return { + source_id: r.source_id, + tenant_id: r.tenant_id, + project_id: r.project_id, + source_type: r.source_type as SourceType, + name: r.name, + adapter_id: r.adapter_id ?? undefined, + access: (r.access as Source["access"]) ?? undefined, + status: r.status as SourceStatus, + correlation_id: r.correlation_id ?? undefined, + created_at: r.created_at, + updated_at: r.updated_at ?? undefined, + }; + } +} diff --git a/src/types/dataset.ts b/src/types/dataset.ts new file mode 100644 index 0000000..f8f3e43 --- /dev/null +++ b/src/types/dataset.ts @@ -0,0 +1,39 @@ +// 0pt.dataset.schema.v1 +// +// A dataset 0pt produces or manages -- the thing `dataset_iceberg_mapping` +// (src/types/dataset-iceberg-mapping.ts) points at, and the thing +// IcebergWriteService (src/services/iceberg-write-service.ts) writes through +// ST0RE's table registry on behalf of. This type intentionally stays small: +// it is a reference/registry entry, not a copy of dataset content, schema, +// or quality state (that boundary is documented in +// docs/ICEBERG_WRITE_BOUNDARY.md -- 0pt owns dataset production, but this +// specific type is only what DatasetIcebergMappingService/IcebergWriteService +// need to confirm a dataset_id is real before pointing a table at it). + +export type DatasetType = "raw" | "structured" | "enriched" | "curated"; + +export type DatasetStatus = "active" | "archived" | "deprecated"; + +export interface Dataset { + dataset_id: string; + tenant_id: string; + project_id: string; + name: string; + dataset_type: DatasetType; + status: DatasetStatus; + description?: string; + correlation_id?: string; + created_at: string; + updated_at?: string; +} + +export interface CreateDatasetInput { + dataset_id: string; + tenant_id: string; + project_id: string; + name: string; + dataset_type: DatasetType; + description?: string; + status?: DatasetStatus; + correlation_id?: string; +} diff --git a/src/types/source.ts b/src/types/source.ts new file mode 100644 index 0000000..0fb1f3b --- /dev/null +++ b/src/types/source.ts @@ -0,0 +1,53 @@ +// 0pt.source.schema.v1 +// +// A registered data Source that a capability (0pt.query_source today; +// 0pt.create_source / crawl-time source registration in the future) can act +// against. This is a DIFFERENT, newer entity than the static provenance +// catalog in docs/03-data-model.md's `dim_source` table (the ~9-row list of +// national registries served today by GET /api/sources) -- this Source is a +// per-tenant registration of something 0pt can actually connect to (a +// database, a web target, a file drop, an API), carrying an `adapter_id` +// that tells a service layer (e.g. SourceQueryService) which concrete +// adapter implementation to use. See docs/P0_QUERY_SOURCE_FLOW.md and +// src/services/source-query-service.ts, the first real consumer. +// +// `access` mirrors dim_source.access (docs/03-data-model.md) so a Source +// registered here can still be reported against the same legal-sourcing +// vocabulary CLAUDE.md ยง1 requires everywhere in this repo. + +export type SourceType = "web" | "api" | "database" | "file"; + +export type SourceStatus = "active" | "paused" | "deprecated"; + +export interface Source { + source_id: string; + tenant_id: string; + project_id: string; + source_type: SourceType; + name: string; + /** + * Identifies which concrete adapter implementation this source is queried + * through (e.g. "fabric_onelake_sql" -- src/adapters/fabric-onelake-adapter.ts). + * Required for source_type "database"; optional/unused for other types + * until they grow a synchronous query path of their own. + */ + adapter_id?: string; + /** Mirrors dim_source.access (docs/03-data-model.md): api | bulk | authorized_web | licensed. */ + access?: "api" | "bulk" | "authorized_web" | "licensed"; + status: SourceStatus; + correlation_id?: string; + created_at: string; + updated_at?: string; +} + +export interface CreateSourceInput { + source_id: string; + tenant_id: string; + project_id: string; + source_type: SourceType; + name: string; + adapter_id?: string; + access?: "api" | "bulk" | "authorized_web" | "licensed"; + status?: SourceStatus; + correlation_id?: string; +} diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 0000000..a56790a --- /dev/null +++ b/vitest.config.ts @@ -0,0 +1,16 @@ +import { defineConfig } from "vitest/config"; +import path from "path"; + +// Mirrors tsconfig.json's "@/*" -> "./*" path alias so tests/p0/*.test.ts's +// "@/src/..." imports resolve the same way they do for `next build`/tsc. +export default defineConfig({ + test: { + include: ["tests/**/*.test.ts"], + environment: "node", + }, + resolve: { + alias: { + "@": path.resolve(__dirname, "."), + }, + }, +});