Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

New data tables (#5)

Maximilian Deichmannf96afe7622e8
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 437fa43b4c..7baba00a8b 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -24,5 +24,19 @@
"[astro]": {
"editor.defaultFormatter": "astro-build.astro-vscode"
},
+ "cSpell.words": [
+ "clemra",
+ "clsx",
+ "fontawesome",
+ "fortawesome",
+ "headlessui",
+ "langfuse",
+ "LLMCALL",
+ "lucide",
+ "superjson",
+ "tailwindcss",
+ "tanstack",
+ "TRPC"
+ ],
"typescript.preferences.importModuleSpecifier": "non-relative"
}
diff --git a/package-lock.json b/package-lock.json
index a5c59e2377..2a668f0612 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -22,12 +22,17 @@
"@openapitools/openapi-generator-cli": "^2.6.0",
"@prisma/client": "^4.14.1",
"@radix-ui/react-collapsible": "^1.0.3",
+ "@radix-ui/react-dialog": "^1.0.4",
+ "@radix-ui/react-dropdown-menu": "^2.0.5",
+ "@radix-ui/react-popover": "^1.0.6",
+ "@radix-ui/react-separator": "^1.0.3",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-toggle": "^1.0.3",
"@t3-oss/env-nextjs": "^0.3.1",
"@tailwindcss/forms": "^0.5.3",
"@tanstack/react-query": "^4.29.7",
+ "@tanstack/react-table": "^8.9.1",
"@trpc/client": "^10.28.0",
"@trpc/next": "^10.28.0",
"@trpc/react-query": "^10.28.0",
@@ -37,6 +42,7 @@
"@types/lodash": "^4.14.195",
"class-variance-authority": "^0.6.0",
"clsx": "^1.2.1",
+ "cmdk": "^0.2.0",
"cors": "^2.8.5",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
@@ -495,6 +501,31 @@
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}
},
+ "node_modules/@floating-ui/core": {
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.2.6.tgz",
+ "integrity": "sha512-EvYTiXet5XqweYGClEmpu3BoxmsQ4hkj3QaYA6qEnigCWffTP3vNRwBReTdrwDwo7OoJ3wM8Uoe9Uk4n+d4hfg=="
+ },
+ "node_modules/@floating-ui/dom": {
+ "version": "1.2.9",
+ "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.2.9.tgz",
+ "integrity": "sha512-sosQxsqgxMNkV3C+3UqTS6LxP7isRLwX8WMepp843Rb3/b0Wz8+MdUkxJksByip3C2WwLugLHN1b4ibn//zKwQ==",
+ "dependencies": {
+ "@floating-ui/core": "^1.2.6"
+ }
+ },
+ "node_modules/@floating-ui/react-dom": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.0.tgz",
+ "integrity": "sha512-Ke0oU3SeuABC2C4OFu2mSAwHIP5WUiV98O9YWoHV4Q5aT6E9k06DV0Khi5uYspR8xmmBk08t8ZDcz3TR3ARkEg==",
+ "dependencies": {
+ "@floating-ui/dom": "^1.2.7"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
"node_modules/@fortawesome/fontawesome-common-types": {
"version": "6.4.0",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.4.0.tgz",
@@ -1392,6 +1423,29 @@
"@babel/runtime": "^7.13.10"
}
},
+ "node_modules/@radix-ui/react-arrow": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-arrow/-/react-arrow-1.0.3.tgz",
+ "integrity": "sha512-wSP+pHsB/jQRaL6voubsQ/ZlrGBHHrOjmBnr19hxYgtS0WvAFwZhK2WP/YY5yF9uKECCEEDGxuLxq1NBK51wFA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-primitive": "1.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@radix-ui/react-collapsible": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@radix-ui/react-collapsible/-/react-collapsible-1.0.3.tgz",
@@ -1482,6 +1536,42 @@
}
}
},
+ "node_modules/@radix-ui/react-dialog": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.0.4.tgz",
+ "integrity": "sha512-hJtRy/jPULGQZceSAP2Re6/4NpKo8im6V8P2hUqZsdFiSL8l35kYsw3qbRI6Ay5mQd2+wlLqje770eq+RJ3yZg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-dismissable-layer": "1.0.4",
+ "@radix-ui/react-focus-guards": "1.0.1",
+ "@radix-ui/react-focus-scope": "1.0.3",
+ "@radix-ui/react-id": "1.0.1",
+ "@radix-ui/react-portal": "1.0.3",
+ "@radix-ui/react-presence": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-slot": "1.0.2",
+ "@radix-ui/react-use-controllable-state": "1.0.1",
+ "aria-hidden": "^1.1.1",
+ "react-remove-scroll": "2.5.5"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@radix-ui/react-direction": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.0.1.tgz",
@@ -1499,6 +1589,104 @@
}
}
},
+ "node_modules/@radix-ui/react-dismissable-layer": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.0.4.tgz",
+ "integrity": "sha512-7UpBa/RKMoHJYjie1gkF1DlK8l1fdU/VKDpoS3rCCo8YBJR294GwcEHyxHw72yvphJ7ld0AXEcSLAzY2F/WyCg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-callback-ref": "1.0.1",
+ "@radix-ui/react-use-escape-keydown": "1.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-dropdown-menu": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.0.5.tgz",
+ "integrity": "sha512-xdOrZzOTocqqkCkYo8yRPCib5OkTkqN7lqNCdxwPOdE466DOaNl4N8PkUIlsXthQvW5Wwkd+aEmWpfWlBoDPEw==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-id": "1.0.1",
+ "@radix-ui/react-menu": "2.0.5",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-controllable-state": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-focus-guards": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.0.1.tgz",
+ "integrity": "sha512-Rect2dWbQ8waGzhMavsIbmSVCgYxkXLxxR3ZvCX79JOglzdEy4JXMb98lq4hPxUbLr77nP0UOGf4rcMU+s1pUA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-focus-scope": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.0.3.tgz",
+ "integrity": "sha512-upXdPfqI4islj2CslyfUBNlaJCPybbqRHAi1KER7Isel9Q2AtSJ0zRBZv8mWQiFXD2nyAJ4BhC3yXgZ6kMBSrQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-callback-ref": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@radix-ui/react-id": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.0.1.tgz",
@@ -1517,6 +1705,138 @@
}
}
},
+ "node_modules/@radix-ui/react-menu": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-menu/-/react-menu-2.0.5.tgz",
+ "integrity": "sha512-Gw4f9pwdH+w5w+49k0gLjN0PfRDHvxmAgG16AbyJZ7zhwZ6PBHKtWohvnSwfusfnK3L68dpBREHpVkj8wEM7ZA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-collection": "1.0.3",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-direction": "1.0.1",
+ "@radix-ui/react-dismissable-layer": "1.0.4",
+ "@radix-ui/react-focus-guards": "1.0.1",
+ "@radix-ui/react-focus-scope": "1.0.3",
+ "@radix-ui/react-id": "1.0.1",
+ "@radix-ui/react-popper": "1.1.2",
+ "@radix-ui/react-portal": "1.0.3",
+ "@radix-ui/react-presence": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-roving-focus": "1.0.4",
+ "@radix-ui/react-slot": "1.0.2",
+ "@radix-ui/react-use-callback-ref": "1.0.1",
+ "aria-hidden": "^1.1.1",
+ "react-remove-scroll": "2.5.5"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-popover": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-popover/-/react-popover-1.0.6.tgz",
+ "integrity": "sha512-cZ4defGpkZ0qTRtlIBzJLSzL6ht7ofhhW4i1+pkemjV1IKXm0wgCRnee154qlV6r9Ttunmh2TNZhMfV2bavUyA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-dismissable-layer": "1.0.4",
+ "@radix-ui/react-focus-guards": "1.0.1",
+ "@radix-ui/react-focus-scope": "1.0.3",
+ "@radix-ui/react-id": "1.0.1",
+ "@radix-ui/react-popper": "1.1.2",
+ "@radix-ui/react-portal": "1.0.3",
+ "@radix-ui/react-presence": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-slot": "1.0.2",
+ "@radix-ui/react-use-controllable-state": "1.0.1",
+ "aria-hidden": "^1.1.1",
+ "react-remove-scroll": "2.5.5"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-popper": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.1.2.tgz",
+ "integrity": "sha512-1CnGGfFi/bbqtJZZ0P/NQY20xdG3E0LALJaLUEoKwPLwl6PPPfbeiCqMVQnhoFRAxjJj4RpBRJzDmUgsex2tSg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@floating-ui/react-dom": "^2.0.0",
+ "@radix-ui/react-arrow": "1.0.3",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-callback-ref": "1.0.1",
+ "@radix-ui/react-use-layout-effect": "1.0.1",
+ "@radix-ui/react-use-rect": "1.0.1",
+ "@radix-ui/react-use-size": "1.0.1",
+ "@radix-ui/rect": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-portal": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.0.3.tgz",
+ "integrity": "sha512-xLYZeHrWoPmA5mEKEfZZevoVRK/Q43GfzRXkWV6qawIWWK8t6ifIiLQdd7rmQ4Vk1bmI21XhqF9BN3jWf+phpA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-primitive": "1.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@radix-ui/react-presence": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.0.1.tgz",
@@ -1595,6 +1915,29 @@
}
}
},
+ "node_modules/@radix-ui/react-separator": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-separator/-/react-separator-1.0.3.tgz",
+ "integrity": "sha512-itYmTy/kokS21aiV5+Z56MZB54KrhPgn6eHDKkFeOLR34HMN2s8PaN47qZZAGnvupcjxHaFZnW4pQEh0BvvVuw==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-primitive": "1.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@radix-ui/react-slot": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.0.2.tgz",
@@ -1703,6 +2046,24 @@
}
}
},
+ "node_modules/@radix-ui/react-use-escape-keydown": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.0.3.tgz",
+ "integrity": "sha512-vyL82j40hcFicA+M4Ex7hVkB9vHgSse1ZWomAqV2Je3RleKGO5iM8KMOEtfoSB0PnIelMd2lATjTGMYqN5ylTg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-use-callback-ref": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@radix-ui/react-use-layout-effect": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.0.1.tgz",
@@ -1720,6 +2081,50 @@
}
}
},
+ "node_modules/@radix-ui/react-use-rect": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-rect/-/react-use-rect-1.0.1.tgz",
+ "integrity": "sha512-Cq5DLuSiuYVKNU8orzJMbl15TXilTnJKUCltMVQg53BQOF1/C5toAaGrowkgksdBQ9H+SRL23g0HDmg9tvmxXw==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/rect": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-size": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-size/-/react-use-size-1.0.1.tgz",
+ "integrity": "sha512-ibay+VqrgcaI6veAojjofPATwledXiSmX+C0KrBk/xgpX9rBzPV3OsfwlhQdUOFbh+LKQorLYT+xTXW9V8yd0g==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-use-layout-effect": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/rect": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/rect/-/rect-1.0.1.tgz",
+ "integrity": "sha512-fyrgCaedtvMg9NK3en0pnOYJdtfwxUcNolezkNPUsoX57X8oQk+NkqcvzHXD2uKNij6GXmWU9NDru2IWjrO4BQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ }
+ },
"node_modules/@rushstack/eslint-patch": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.3.0.tgz",
@@ -2167,6 +2572,37 @@
}
}
},
+ "node_modules/@tanstack/react-table": {
+ "version": "8.9.1",
+ "resolved": "https://registry.npmjs.org/@tanstack/react-table/-/react-table-8.9.1.tgz",
+ "integrity": "sha512-yHs2m6lk5J5RNcu2dNtsDGux66wNXZjEgzxos6MRCX8gL+nqxeW3ZglqP6eANN0bGElPnjvqiUHGQvdACOr3Cw==",
+ "dependencies": {
+ "@tanstack/table-core": "8.9.1"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/tannerlinsley"
+ },
+ "peerDependencies": {
+ "react": ">=16",
+ "react-dom": ">=16"
+ }
+ },
+ "node_modules/@tanstack/table-core": {
+ "version": "8.9.1",
+ "resolved": "https://registry.npmjs.org/@tanstack/table-core/-/table-core-8.9.1.tgz",
+ "integrity": "sha512-2+R83n8vMZND0q3W1lSiF7co9nFbeWbjAErFf27xwbeA9E0wtUu5ZDfgj+TZ6JzdAEQAgfxkk/QNFAKiS8E4MA==",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/tannerlinsley"
+ }
+ },
"node_modules/@trpc/client": {
"version": "10.28.0",
"resolved": "https://registry.npmjs.org/@trpc/client/-/client-10.28.0.tgz",
@@ -2820,6 +3256,17 @@
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
},
+ "node_modules/aria-hidden": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/aria-hidden/-/aria-hidden-1.2.3.tgz",
+ "integrity": "sha512-xcLxITLe2HYa1cnYnwCjkOO1PqUHQpozB8x9AR0OgWN2woOBi5kSDVxKfd0b7sb1hw5qFeJhXm9H1nu3xSfLeQ==",
+ "dependencies": {
+ "tslib": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
"node_modules/aria-query": {
"version": "5.1.3",
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.3.tgz",
@@ -3441,6 +3888,257 @@
"node": ">=6"
}
},
+ "node_modules/cmdk": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/cmdk/-/cmdk-0.2.0.tgz",
+ "integrity": "sha512-JQpKvEOb86SnvMZbYaFKYhvzFntWBeSZdyii0rZPhKJj9uwJBxu4DaVYDrRN7r3mPop56oPhRw+JYWTKs66TYw==",
+ "dependencies": {
+ "@radix-ui/react-dialog": "1.0.0",
+ "command-score": "0.1.2"
+ },
+ "peerDependencies": {
+ "react": "^18.0.0",
+ "react-dom": "^18.0.0"
+ }
+ },
+ "node_modules/cmdk/node_modules/@radix-ui/primitive": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.0.0.tgz",
+ "integrity": "sha512-3e7rn8FDMin4CgeL7Z/49smCA3rFYY3Ha2rUQ7HRWFadS5iCRw08ZgVT1LaNTCNqgvrUiyczLflrVrF0SRQtNA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ }
+ },
+ "node_modules/cmdk/node_modules/@radix-ui/react-compose-refs": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.0.0.tgz",
+ "integrity": "sha512-0KaSv6sx787/hK3eF53iOkiSLwAGlFMx5lotrqD2pTjB18KbybKoEIgkNZTKC60YECDQTKGTRcDBILwZVqVKvA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ },
+ "peerDependencies": {
+ "react": "^16.8 || ^17.0 || ^18.0"
+ }
+ },
+ "node_modules/cmdk/node_modules/@radix-ui/react-context": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.0.0.tgz",
+ "integrity": "sha512-1pVM9RfOQ+n/N5PJK33kRSKsr1glNxomxONs5c49MliinBY6Yw2Q995qfBUUo0/Mbg05B/sGA0gkgPI7kmSHBg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ },
+ "peerDependencies": {
+ "react": "^16.8 || ^17.0 || ^18.0"
+ }
+ },
+ "node_modules/cmdk/node_modules/@radix-ui/react-dialog": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.0.0.tgz",
+ "integrity": "sha512-Yn9YU+QlHYLWwV1XfKiqnGVpWYWk6MeBVM6x/bcoyPvxgjQGoeT35482viLPctTMWoMw0PoHgqfSox7Ig+957Q==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.0",
+ "@radix-ui/react-compose-refs": "1.0.0",
+ "@radix-ui/react-context": "1.0.0",
+ "@radix-ui/react-dismissable-layer": "1.0.0",
+ "@radix-ui/react-focus-guards": "1.0.0",
+ "@radix-ui/react-focus-scope": "1.0.0",
+ "@radix-ui/react-id": "1.0.0",
+ "@radix-ui/react-portal": "1.0.0",
+ "@radix-ui/react-presence": "1.0.0",
+ "@radix-ui/react-primitive": "1.0.0",
+ "@radix-ui/react-slot": "1.0.0",
+ "@radix-ui/react-use-controllable-state": "1.0.0",
+ "aria-hidden": "^1.1.1",
+ "react-remove-scroll": "2.5.4"
+ },
+ "peerDependencies": {
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ }
+ },
+ "node_modules/cmdk/node_modules/@radix-ui/react-dismissable-layer": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.0.0.tgz",
+ "integrity": "sha512-n7kDRfx+LB1zLueRDvZ1Pd0bxdJWDUZNQ/GWoxDn2prnuJKRdxsjulejX/ePkOsLi2tTm6P24mDqlMSgQpsT6g==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.0",
+ "@radix-ui/react-compose-refs": "1.0.0",
+ "@radix-ui/react-primitive": "1.0.0",
+ "@radix-ui/react-use-callback-ref": "1.0.0",
+ "@radix-ui/react-use-escape-keydown": "1.0.0"
+ },
+ "peerDependencies": {
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ }
+ },
+ "node_modules/cmdk/node_modules/@radix-ui/react-focus-guards": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.0.0.tgz",
+ "integrity": "sha512-UagjDk4ijOAnGu4WMUPj9ahi7/zJJqNZ9ZAiGPp7waUWJO0O1aWXi/udPphI0IUjvrhBsZJGSN66dR2dsueLWQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ },
+ "peerDependencies": {
+ "react": "^16.8 || ^17.0 || ^18.0"
+ }
+ },
+ "node_modules/cmdk/node_modules/@radix-ui/react-focus-scope": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.0.0.tgz",
+ "integrity": "sha512-C4SWtsULLGf/2L4oGeIHlvWQx7Rf+7cX/vKOAD2dXW0A1b5QXwi3wWeaEgW+wn+SEVrraMUk05vLU9fZZz5HbQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-compose-refs": "1.0.0",
+ "@radix-ui/react-primitive": "1.0.0",
+ "@radix-ui/react-use-callback-ref": "1.0.0"
+ },
+ "peerDependencies": {
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ }
+ },
+ "node_modules/cmdk/node_modules/@radix-ui/react-id": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.0.0.tgz",
+ "integrity": "sha512-Q6iAB/U7Tq3NTolBBQbHTgclPmGWE3OlktGGqrClPozSw4vkQ1DfQAOtzgRPecKsMdJINE05iaoDUG8tRzCBjw==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-use-layout-effect": "1.0.0"
+ },
+ "peerDependencies": {
+ "react": "^16.8 || ^17.0 || ^18.0"
+ }
+ },
+ "node_modules/cmdk/node_modules/@radix-ui/react-portal": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.0.0.tgz",
+ "integrity": "sha512-a8qyFO/Xb99d8wQdu4o7qnigNjTPG123uADNecz0eX4usnQEj7o+cG4ZX4zkqq98NYekT7UoEQIjxBNWIFuqTA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-primitive": "1.0.0"
+ },
+ "peerDependencies": {
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ }
+ },
+ "node_modules/cmdk/node_modules/@radix-ui/react-presence": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.0.0.tgz",
+ "integrity": "sha512-A+6XEvN01NfVWiKu38ybawfHsBjWum42MRPnEuqPsBZ4eV7e/7K321B5VgYMPv3Xx5An6o1/l9ZuDBgmcmWK3w==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-compose-refs": "1.0.0",
+ "@radix-ui/react-use-layout-effect": "1.0.0"
+ },
+ "peerDependencies": {
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ }
+ },
+ "node_modules/cmdk/node_modules/@radix-ui/react-primitive": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-1.0.0.tgz",
+ "integrity": "sha512-EyXe6mnRlHZ8b6f4ilTDrXmkLShICIuOTTj0GX4w1rp+wSxf3+TD05u1UOITC8VsJ2a9nwHvdXtOXEOl0Cw/zQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-slot": "1.0.0"
+ },
+ "peerDependencies": {
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ }
+ },
+ "node_modules/cmdk/node_modules/@radix-ui/react-slot": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.0.0.tgz",
+ "integrity": "sha512-3mrKauI/tWXo1Ll+gN5dHcxDPdm/Df1ufcDLCecn+pnCIVcdWE7CujXo8QaXOWRJyZyQWWbpB8eFwHzWXlv5mQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-compose-refs": "1.0.0"
+ },
+ "peerDependencies": {
+ "react": "^16.8 || ^17.0 || ^18.0"
+ }
+ },
+ "node_modules/cmdk/node_modules/@radix-ui/react-use-callback-ref": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.0.0.tgz",
+ "integrity": "sha512-GZtyzoHz95Rhs6S63D2t/eqvdFCm7I+yHMLVQheKM7nBD8mbZIt+ct1jz4536MDnaOGKIxynJ8eHTkVGVVkoTg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ },
+ "peerDependencies": {
+ "react": "^16.8 || ^17.0 || ^18.0"
+ }
+ },
+ "node_modules/cmdk/node_modules/@radix-ui/react-use-controllable-state": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.0.0.tgz",
+ "integrity": "sha512-FohDoZvk3mEXh9AWAVyRTYR4Sq7/gavuofglmiXB2g1aKyboUD4YtgWxKj8O5n+Uak52gXQ4wKz5IFST4vtJHg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-use-callback-ref": "1.0.0"
+ },
+ "peerDependencies": {
+ "react": "^16.8 || ^17.0 || ^18.0"
+ }
+ },
+ "node_modules/cmdk/node_modules/@radix-ui/react-use-escape-keydown": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.0.0.tgz",
+ "integrity": "sha512-JwfBCUIfhXRxKExgIqGa4CQsiMemo1Xt0W/B4ei3fpzpvPENKpMKQ8mZSB6Acj3ebrAEgi2xiQvcI1PAAodvyg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-use-callback-ref": "1.0.0"
+ },
+ "peerDependencies": {
+ "react": "^16.8 || ^17.0 || ^18.0"
+ }
+ },
+ "node_modules/cmdk/node_modules/@radix-ui/react-use-layout-effect": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.0.0.tgz",
+ "integrity": "sha512-6Tpkq+R6LOlmQb1R5NNETLG0B4YP0wc+klfXafpUCj6JGyaUc8il7/kUZ7m59rGbXGczE9Bs+iz2qloqsZBduQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ },
+ "peerDependencies": {
+ "react": "^16.8 || ^17.0 || ^18.0"
+ }
+ },
+ "node_modules/cmdk/node_modules/react-remove-scroll": {
+ "version": "2.5.4",
+ "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.5.4.tgz",
+ "integrity": "sha512-xGVKJJr0SJGQVirVFAUZ2k1QLyO6m+2fy0l8Qawbp5Jgrv3DeLalrfMNBFSlmz5kriGGzsVBtGVnf4pTKIhhWA==",
+ "dependencies": {
+ "react-remove-scroll-bar": "^2.3.3",
+ "react-style-singleton": "^2.2.1",
+ "tslib": "^2.1.0",
+ "use-callback-ref": "^1.3.0",
+ "use-sidecar": "^1.1.2"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/cmdk/node_modules/tslib": {
+ "version": "2.5.2",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.2.tgz",
+ "integrity": "sha512-5svOrSA2w3iGFDs1HibEVBGbDrAY82bFQ3HZ3ixB+88nsbsWQoKqDRb5UBYAUPEzbBn6dAp5gRNXglySbx1MlA=="
+ },
"node_modules/code-point-at": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
@@ -3486,6 +4184,11 @@
"url": "https://github.com/sponsors/wooorm"
}
},
+ "node_modules/command-score": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/command-score/-/command-score-0.1.2.tgz",
+ "integrity": "sha512-VtDvQpIJBvBatnONUsPzXYFVKQQAhuf3XTNOAsdBxCNO/QCtUUd8LSgjn0GVarBkCad6aJCZfXgrjYbl/KRr7w=="
+ },
"node_modules/commander": {
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",
@@ -4024,6 +4727,11 @@
"node": ">=0.10"
}
},
+ "node_modules/detect-node-es": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz",
+ "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ=="
+ },
"node_modules/didyoumean": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz",
@@ -5220,6 +5928,14 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/get-nonce": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/get-nonce/-/get-nonce-1.0.1.tgz",
+ "integrity": "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/get-stream": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
@@ -8038,6 +8754,56 @@
}
}
},
+ "node_modules/react-remove-scroll": {
+ "version": "2.5.5",
+ "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.5.5.tgz",
+ "integrity": "sha512-ImKhrzJJsyXJfBZ4bzu8Bwpka14c/fQt0k+cyFp/PBhTfyDnU5hjOtM4AG/0AMyy8oKzOTR0lDgJIM7pYXI0kw==",
+ "dependencies": {
+ "react-remove-scroll-bar": "^2.3.3",
+ "react-style-singleton": "^2.2.1",
+ "tslib": "^2.1.0",
+ "use-callback-ref": "^1.3.0",
+ "use-sidecar": "^1.1.2"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-remove-scroll-bar": {
+ "version": "2.3.4",
+ "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.4.tgz",
+ "integrity": "sha512-63C4YQBUt0m6ALadE9XV56hV8BgJWDmmTPY758iIJjfQKt2nYwoUrPk0LXRXcB/yIj82T1/Ixfdpdk68LwIB0A==",
+ "dependencies": {
+ "react-style-singleton": "^2.2.1",
+ "tslib": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-remove-scroll/node_modules/tslib": {
+ "version": "2.5.2",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.2.tgz",
+ "integrity": "sha512-5svOrSA2w3iGFDs1HibEVBGbDrAY82bFQ3HZ3ixB+88nsbsWQoKqDRb5UBYAUPEzbBn6dAp5gRNXglySbx1MlA=="
+ },
"node_modules/react-resize-detector": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/react-resize-detector/-/react-resize-detector-8.1.0.tgz",
@@ -8095,6 +8861,28 @@
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
}
},
+ "node_modules/react-style-singleton": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.1.tgz",
+ "integrity": "sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==",
+ "dependencies": {
+ "get-nonce": "^1.0.0",
+ "invariant": "^2.2.4",
+ "tslib": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
"node_modules/react-syntax-highlighter": {
"version": "15.5.0",
"resolved": "https://registry.npmjs.org/react-syntax-highlighter/-/react-syntax-highlighter-15.5.0.tgz",
@@ -9638,6 +10426,47 @@
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz",
"integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw=="
},
+ "node_modules/use-callback-ref": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.0.tgz",
+ "integrity": "sha512-3FT9PRuRdbB9HfXhEq35u4oZkvpJ5kuYbpqhCfmiZyReuRgpnhDlbr2ZEnnuS0RrJAPn6l23xjFg9kpDM+Ms7w==",
+ "dependencies": {
+ "tslib": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/use-sidecar": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.2.tgz",
+ "integrity": "sha512-epTbsLuzZ7lPClpz2TyryBfztm7m+28DlEv2ZCQ3MDr5ssiwyOwGH/e5F9CkfWjJ1t4clvI58yF822/GUkjjhw==",
+ "dependencies": {
+ "detect-node-es": "^1.1.0",
+ "tslib": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@types/react": "^16.9.0 || ^17.0.0 || ^18.0.0",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
"node_modules/use-sync-external-store": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz",
diff --git a/package.json b/package.json
index 26645c2197..0e76e85bcb 100644
--- a/package.json
+++ b/package.json
@@ -27,12 +27,17 @@
"@openapitools/openapi-generator-cli": "^2.6.0",
"@prisma/client": "^4.14.1",
"@radix-ui/react-collapsible": "^1.0.3",
+ "@radix-ui/react-dialog": "^1.0.4",
+ "@radix-ui/react-dropdown-menu": "^2.0.5",
+ "@radix-ui/react-popover": "^1.0.6",
+ "@radix-ui/react-separator": "^1.0.3",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-toggle": "^1.0.3",
"@t3-oss/env-nextjs": "^0.3.1",
"@tailwindcss/forms": "^0.5.3",
"@tanstack/react-query": "^4.29.7",
+ "@tanstack/react-table": "^8.9.1",
"@trpc/client": "^10.28.0",
"@trpc/next": "^10.28.0",
"@trpc/react-query": "^10.28.0",
@@ -42,6 +47,7 @@
"@types/lodash": "^4.14.195",
"class-variance-authority": "^0.6.0",
"clsx": "^1.2.1",
+ "cmdk": "^0.2.0",
"cors": "^2.8.5",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
diff --git a/src/components/column-header.tsx b/src/components/column-header.tsx
new file mode 100644
index 0000000000..b1e9131a2d
--- /dev/null
+++ b/src/components/column-header.tsx
@@ -0,0 +1,69 @@
+import { type Column } from "@tanstack/react-table";
+import { FilterIcon } from "lucide-react";
+
+import { cn } from "@/src/utils/tailwind";
+import { Button } from "@/src/components/ui/button";
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuTrigger,
+} from "@/src/components/ui/dropdown-menu";
+import { Input } from "./ui/input";
+import { useState } from "react";
+
+interface DataTableColumnHeaderProps<TData, TValue>
+ extends React.HTMLAttributes<HTMLDivElement> {
+ column: Column<TData, TValue>;
+ title: string;
+ onFilter: (value: string) => void;
+}
+
+export function DataTableColumnHeader<TData, TValue>({
+ column,
+ title,
+ className,
+ onFilter,
+}: DataTableColumnHeaderProps<TData, TValue>) {
+ const [filterValue, setFilterValue] = useState("");
+
+ if (!column.getCanFilter()) {
+ return <div className={cn(className)}>{title}</div>;
+ }
+
+ const filterChange = (event: React.ChangeEvent<HTMLInputElement>) => {
+ const value = event.target.value;
+ setFilterValue(value);
+ onFilter(value);
+ };
+
+ return (
+ <div className={cn("flex items-center space-x-2", className)}>
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <Button
+ variant="ghost"
+ size="sm"
+ className="-ml-3 h-8 data-[state=open]:bg-accent"
+ >
+ <span>{title}</span>
+ <FilterIcon className="ml-2 h-4 w-4" />
+ </Button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="start">
+ <DropdownMenuItem>Email equals</DropdownMenuItem>
+ <DropdownMenuItem>
+ <div className="flex items-center py-4">
+ <Input
+ placeholder="Filter name"
+ value={filterValue}
+ className="max-w-sm"
+ onChange={filterChange}
+ />
+ </div>
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </div>
+ );
+}
diff --git a/src/components/data-table-faceted-filter.tsx b/src/components/data-table-faceted-filter.tsx
new file mode 100644
index 0000000000..66abc670dd
--- /dev/null
+++ b/src/components/data-table-faceted-filter.tsx
@@ -0,0 +1,147 @@
+import * as React from "react";
+import { type ColumnDef } from "@tanstack/react-table";
+import { Check, PlusCircle } from "lucide-react";
+
+import { cn } from "@/src/utils/tailwind";
+import { Badge } from "@/src/components/ui/badge";
+import { Button } from "@/src/components/ui/button";
+import {
+ Command,
+ CommandEmpty,
+ CommandGroup,
+ CommandInput,
+ CommandItem,
+ CommandList,
+ CommandSeparator,
+} from "@/src/components/ui/command";
+import {
+ Popover,
+ PopoverContent,
+ PopoverTrigger,
+} from "@/src/components/ui/popover";
+import { Separator } from "@/src/components/ui/separator";
+import { type TraceRowOptions, type TraceFilterInput } from "../pages/traces";
+
+interface DataTableFacetedFilter<TData, TValue> {
+ columnDef: ColumnDef<TData, TValue>;
+ title?: string;
+ queryOptions: TraceFilterInput;
+ options: TraceRowOptions;
+}
+
+export function DataTableFacetedFilter<TData, TValue>({
+ columnDef,
+ title,
+ options,
+}: DataTableFacetedFilter<TData, TValue>) {
+ const selectedValues = columnDef.meta?.filter
+ ? new Set(columnDef.meta?.filter)
+ : new Set<string>();
+
+ return (
+ <Popover>
+ <PopoverTrigger asChild>
+ <Button variant="outline" size="sm" className="h-8 border-dashed">
+ <PlusCircle className="mr-2 h-4 w-4" />
+ {title}
+ {selectedValues?.size > 0 && (
+ <>
+ <Separator orientation="vertical" className="mx-2 h-4" />
+ <Badge
+ variant="secondary"
+ className="rounded-sm px-1 font-normal lg:hidden"
+ >
+ {selectedValues.size}
+ </Badge>
+ <div className="hidden space-x-1 lg:flex">
+ {selectedValues.size > 2 ? (
+ <Badge
+ variant="secondary"
+ className="rounded-sm px-1 font-normal"
+ >
+ {selectedValues.size} selected
+ </Badge>
+ ) : (
+ options.options
+ .filter((option) => selectedValues.has(option.label))
+ .map((option) => (
+ <Badge
+ variant="secondary"
+ key={option.value}
+ className="rounded-sm px-1 font-normal"
+ >
+ {option.label}
+ </Badge>
+ ))
+ )}
+ </div>
+ </>
+ )}
+ </Button>
+ </PopoverTrigger>
+ <PopoverContent className="w-[200px] p-0" align="start">
+ <Command>
+ <CommandInput placeholder={title} />
+ <CommandList>
+ <CommandEmpty>No results found.</CommandEmpty>
+ <CommandGroup>
+ {options.options.map((option) => {
+ const isSelected = selectedValues.has(option.label);
+ return (
+ <CommandItem
+ key={option.label}
+ onSelect={() => {
+ if (isSelected) {
+ selectedValues.delete(option.label);
+ } else {
+ selectedValues.add(option.label);
+ }
+ const filterValues = Array.from(selectedValues);
+
+ columnDef?.meta?.updateFunction(
+ filterValues.length ? filterValues : null
+ );
+ }}
+ >
+ <div
+ className={cn(
+ "mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
+ isSelected
+ ? "bg-primary text-primary-foreground"
+ : "opacity-50 [&_svg]:invisible"
+ )}
+ >
+ <Check className={cn("h-4 w-4")} />
+ </div>
+ {option.icon && (
+ <option.icon className="mr-2 h-4 w-4 text-muted-foreground" />
+ )}
+ <span>{option.label}</span>
+ {option.value && (
+ <span className="ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs">
+ {option.value}
+ </span>
+ )}
+ </CommandItem>
+ );
+ })}
+ </CommandGroup>
+ {selectedValues.size > 0 && (
+ <>
+ <CommandSeparator />
+ <CommandGroup>
+ <CommandItem
+ onSelect={() => columnDef?.meta?.updateFunction(null)}
+ className="justify-center text-center"
+ >
+ Clear filters
+ </CommandItem>
+ </CommandGroup>
+ </>
+ )}
+ </CommandList>
+ </Command>
+ </PopoverContent>
+ </Popover>
+ );
+}
diff --git a/src/components/data-table-toolbar.tsx b/src/components/data-table-toolbar.tsx
new file mode 100644
index 0000000000..108e239f4b
--- /dev/null
+++ b/src/components/data-table-toolbar.tsx
@@ -0,0 +1,60 @@
+import { type ColumnDef } from "@tanstack/react-table";
+import { X } from "lucide-react";
+
+import { Button } from "@/src/components/ui/button";
+import { DataTableFacetedFilter } from "./data-table-faceted-filter";
+import { type TraceFilterInput, type TraceRowOptions } from "../pages/traces";
+
+interface DataTableToolbarProps<TData, TValue> {
+ columnDefs: ColumnDef<TData, TValue>[];
+ options: TraceRowOptions[];
+ queryOptions: TraceFilterInput;
+ updateQueryOptions: (options: TraceFilterInput) => void;
+}
+
+export function DataTableToolbar<TData, TValue>({
+ columnDefs,
+ options,
+ queryOptions,
+ updateQueryOptions,
+}: DataTableToolbarProps<TData, TValue>) {
+ const isFiltered = queryOptions.name !== null;
+
+ return (
+ <div className="flex items-center justify-between">
+ <div className="flex flex-1 items-center space-x-2">
+ {columnDefs.map((column) => {
+ const columnOptions = options.find(
+ (o) =>
+ o.columnId.toLowerCase() === column.meta?.label?.toLowerCase()
+ );
+ return column.enableColumnFilter && columnOptions ? (
+ <DataTableFacetedFilter
+ columnDef={column}
+ title={column.meta?.label}
+ queryOptions={queryOptions}
+ options={columnOptions}
+ />
+ ) : undefined;
+ })}
+ {isFiltered && (
+ <Button
+ variant="ghost"
+ onClick={() =>
+ updateQueryOptions({
+ attribute: {},
+ name: null,
+ id: null,
+ status: null,
+ })
+ }
+ className="h-8 px-2 lg:px-3"
+ >
+ Reset
+ <X className="ml-2 h-4 w-4" />
+ </Button>
+ )}
+ </div>
+ </div>
+ );
+}
diff --git a/src/components/data-table.tsx b/src/components/data-table.tsx
new file mode 100644
index 0000000000..e44d8dab67
--- /dev/null
+++ b/src/components/data-table.tsx
@@ -0,0 +1,122 @@
+"use client";
+
+import {
+ type ColumnDef,
+ flexRender,
+ getCoreRowModel,
+ useReactTable,
+ type ColumnFiltersState,
+ getFilteredRowModel,
+} from "@tanstack/react-table";
+import {
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow,
+} from "@/src/components/ui/table";
+import { useState } from "react";
+import { type TraceRowOptions } from "../pages/traces";
+
+interface DataTableProps<TData, TValue> {
+ columns: ColumnDef<TData, TValue>[];
+ data: AsyncTableData<TData[]>;
+ options: AsyncTableData<TraceRowOptions[]>;
+}
+
+export interface AsyncTableData<T> {
+ isLoading: boolean;
+ isError: boolean;
+ data?: T;
+ error?: string;
+}
+
+export function DataTable<TData, TValue>({
+ columns,
+ data,
+ options,
+}: DataTableProps<TData, TValue>) {
+ const [columnFilters, setColumnFilters] = useState<ColumnFiltersState>([]);
+
+ const table = useReactTable({
+ data: data.data ?? [],
+ columns,
+ onColumnFiltersChange: setColumnFilters,
+ getFilteredRowModel: getFilteredRowModel(),
+ getCoreRowModel: getCoreRowModel(),
+ state: {
+ columnFilters,
+ },
+ manualFiltering: true,
+ });
+
+ return (
+ <>
+ <div className="space-y-4">
+ <div className="rounded-md border">
+ <Table>
+ <TableHeader>
+ {table.getHeaderGroups().map((headerGroup) => (
+ <TableRow key={headerGroup.id}>
+ {headerGroup.headers.map((header) => {
+ return (
+ <TableHead key={header.id}>
+ {header.isPlaceholder
+ ? null
+ : flexRender(
+ header.column.columnDef.header,
+ header.getContext()
+ )}
+ </TableHead>
+ );
+ })}
+ </TableRow>
+ ))}
+ </TableHeader>
+ <TableBody>
+ {options.isLoading ||
+ !options.data ||
+ data.isLoading ||
+ !data.data ? (
+ <TableRow>
+ <TableCell
+ colSpan={columns.length}
+ className="h-24 text-center"
+ >
+ Loading.
+ </TableCell>
+ </TableRow>
+ ) : table.getRowModel().rows?.length ? (
+ table.getRowModel().rows.map((row) => (
+ <TableRow
+ key={row.id}
+ data-state={row.getIsSelected() && "selected"}
+ >
+ {row.getVisibleCells().map((cell) => (
+ <TableCell key={cell.id}>
+ {flexRender(
+ cell.column.columnDef.cell,
+ cell.getContext()
+ )}
+ </TableCell>
+ ))}
+ </TableRow>
+ ))
+ ) : (
+ <TableRow>
+ <TableCell
+ colSpan={columns.length}
+ className="h-24 text-center"
+ >
+ No results.
+ </TableCell>
+ </TableRow>
+ )}
+ </TableBody>
+ </Table>
+ </div>
+ </div>
+ </>
+ );
+}
diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsx
new file mode 100644
index 0000000000..1e221be8dd
--- /dev/null
+++ b/src/components/ui/badge.tsx
@@ -0,0 +1,36 @@
+import * as React from "react";
+import { cva, type VariantProps } from "class-variance-authority";
+
+import { cn } from "@/src/utils/tailwind";
+
+const badgeVariants = cva(
+ "inline-flex items-center border rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
+ {
+ variants: {
+ variant: {
+ default:
+ "bg-primary hover:bg-primary/80 border-transparent text-primary-foreground",
+ secondary:
+ "bg-secondary hover:bg-secondary/80 border-transparent text-secondary-foreground",
+ destructive:
+ "bg-destructive hover:bg-destructive/80 border-transparent text-destructive-foreground",
+ outline: "text-foreground",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+ }
+);
+
+export interface BadgeProps
+ extends React.HTMLAttributes<HTMLDivElement>,
+ VariantProps<typeof badgeVariants> {}
+
+function Badge({ className, variant, ...props }: BadgeProps) {
+ return (
+ <div className={cn(badgeVariants({ variant }), className)} {...props} />
+ );
+}
+
+export { Badge, badgeVariants };
diff --git a/src/components/ui/command.tsx b/src/components/ui/command.tsx
new file mode 100644
index 0000000000..3d67a50df9
--- /dev/null
+++ b/src/components/ui/command.tsx
@@ -0,0 +1,155 @@
+"use client";
+
+import * as React from "react";
+import { type DialogProps } from "@radix-ui/react-dialog";
+import { Command as CommandPrimitive } from "cmdk";
+import { Search } from "lucide-react";
+
+import { cn } from "@/src/utils/tailwind";
+import { Dialog, DialogContent } from "@/src/components/ui/dialog";
+
+const Command = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive>
+>(({ className, ...props }, ref) => (
+ <CommandPrimitive
+ ref={ref}
+ className={cn(
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
+ className
+ )}
+ {...props}
+ />
+));
+Command.displayName = CommandPrimitive.displayName;
+
+type CommandDialogProps = DialogProps;
+
+const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
+ return (
+ <Dialog {...props}>
+ <DialogContent className="overflow-hidden p-0 shadow-2xl">
+ <Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
+ {children}
+ </Command>
+ </DialogContent>
+ </Dialog>
+ );
+};
+
+const CommandInput = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.Input>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
+>(({ className, ...props }, ref) => (
+ <div className="flex items-center border-b px-3" cmdk-input-wrapper="">
+ <Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />
+ <CommandPrimitive.Input
+ ref={ref}
+ className={cn(
+ "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
+ className
+ )}
+ {...props}
+ />
+ </div>
+));
+
+CommandInput.displayName = CommandPrimitive.Input.displayName;
+
+const CommandList = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.List>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
+>(({ className, ...props }, ref) => (
+ <CommandPrimitive.List
+ ref={ref}
+ className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}
+ {...props}
+ />
+));
+
+CommandList.displayName = CommandPrimitive.List.displayName;
+
+const CommandEmpty = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.Empty>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
+>((props, ref) => (
+ <CommandPrimitive.Empty
+ ref={ref}
+ className="py-6 text-center text-sm"
+ {...props}
+ />
+));
+
+CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
+
+const CommandGroup = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.Group>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
+>(({ className, ...props }, ref) => (
+ <CommandPrimitive.Group
+ ref={ref}
+ className={cn(
+ "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
+ className
+ )}
+ {...props}
+ />
+));
+
+CommandGroup.displayName = CommandPrimitive.Group.displayName;
+
+const CommandSeparator = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.Separator>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
+>(({ className, ...props }, ref) => (
+ <CommandPrimitive.Separator
+ ref={ref}
+ className={cn("-mx-1 h-px bg-border", className)}
+ {...props}
+ />
+));
+CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
+
+const CommandItem = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.Item>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
+>(({ className, ...props }, ref) => (
+ <CommandPrimitive.Item
+ ref={ref}
+ className={cn(
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
+ className
+ )}
+ {...props}
+ />
+));
+
+CommandItem.displayName = CommandPrimitive.Item.displayName;
+
+const CommandShortcut = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLSpanElement>) => {
+ return (
+ <span
+ className={cn(
+ "ml-auto text-xs tracking-widest text-muted-foreground",
+ className
+ )}
+ {...props}
+ />
+ );
+};
+CommandShortcut.displayName = "CommandShortcut";
+
+export {
+ Command,
+ CommandDialog,
+ CommandInput,
+ CommandList,
+ CommandEmpty,
+ CommandGroup,
+ CommandItem,
+ CommandShortcut,
+ CommandSeparator,
+};
diff --git a/src/components/ui/dialog.tsx b/src/components/ui/dialog.tsx
new file mode 100644
index 0000000000..31b9e93a95
--- /dev/null
+++ b/src/components/ui/dialog.tsx
@@ -0,0 +1,128 @@
+"use client";
+
+import * as React from "react";
+import * as DialogPrimitive from "@radix-ui/react-dialog";
+import { X } from "lucide-react";
+
+import { cn } from "@/src/utils/tailwind";
+
+const Dialog = DialogPrimitive.Root;
+
+const DialogTrigger = DialogPrimitive.Trigger;
+
+const DialogPortal = ({
+ className,
+ children,
+ ...props
+}: DialogPrimitive.DialogPortalProps) => (
+ <DialogPrimitive.Portal className={cn(className)} {...props}>
+ <div className="fixed inset-0 z-50 flex items-start justify-center sm:items-center">
+ {children}
+ </div>
+ </DialogPrimitive.Portal>
+);
+DialogPortal.displayName = DialogPrimitive.Portal.displayName;
+
+const DialogOverlay = React.forwardRef<
+ React.ElementRef<typeof DialogPrimitive.Overlay>,
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
+>(({ className, ...props }, ref) => (
+ <DialogPrimitive.Overlay
+ ref={ref}
+ className={cn(
+ "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm transition-all duration-100 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in",
+ className
+ )}
+ {...props}
+ />
+));
+DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
+
+const DialogContent = React.forwardRef<
+ React.ElementRef<typeof DialogPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
+>(({ className, children, ...props }, ref) => (
+ <DialogPortal>
+ <DialogOverlay />
+ <DialogPrimitive.Content
+ ref={ref}
+ className={cn(
+ "fixed z-50 grid w-full gap-4 rounded-b-lg border bg-background p-6 shadow-lg animate-in data-[state=open]:fade-in-90 data-[state=open]:slide-in-from-bottom-10 sm:max-w-lg sm:rounded-lg sm:zoom-in-90 data-[state=open]:sm:slide-in-from-bottom-0",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
+ <X className="h-4 w-4" />
+ <span className="sr-only">Close</span>
+ </DialogPrimitive.Close>
+ </DialogPrimitive.Content>
+ </DialogPortal>
+));
+DialogContent.displayName = DialogPrimitive.Content.displayName;
+
+const DialogHeader = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLDivElement>) => (
+ <div
+ className={cn(
+ "flex flex-col space-y-1.5 text-center sm:text-left",
+ className
+ )}
+ {...props}
+ />
+);
+DialogHeader.displayName = "DialogHeader";
+
+const DialogFooter = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLDivElement>) => (
+ <div
+ className={cn(
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
+ className
+ )}
+ {...props}
+ />
+);
+DialogFooter.displayName = "DialogFooter";
+
+const DialogTitle = React.forwardRef<
+ React.ElementRef<typeof DialogPrimitive.Title>,
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
+>(({ className, ...props }, ref) => (
+ <DialogPrimitive.Title
+ ref={ref}
+ className={cn(
+ "text-lg font-semibold leading-none tracking-tight",
+ className
+ )}
+ {...props}
+ />
+));
+DialogTitle.displayName = DialogPrimitive.Title.displayName;
+
+const DialogDescription = React.forwardRef<
+ React.ElementRef<typeof DialogPrimitive.Description>,
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
+>(({ className, ...props }, ref) => (
+ <DialogPrimitive.Description
+ ref={ref}
+ className={cn("text-sm text-muted-foreground", className)}
+ {...props}
+ />
+));
+DialogDescription.displayName = DialogPrimitive.Description.displayName;
+
+export {
+ Dialog,
+ DialogTrigger,
+ DialogContent,
+ DialogHeader,
+ DialogFooter,
+ DialogTitle,
+ DialogDescription,
+};
diff --git a/src/components/ui/dropdown-menu.tsx b/src/components/ui/dropdown-menu.tsx
new file mode 100644
index 0000000000..efbf4075e3
--- /dev/null
+++ b/src/components/ui/dropdown-menu.tsx
@@ -0,0 +1,200 @@
+"use client";
+
+import * as React from "react";
+import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
+import { Check, ChevronRight, Circle } from "lucide-react";
+
+import { cn } from "@/src/utils/tailwind";
+
+const DropdownMenu = DropdownMenuPrimitive.Root;
+
+const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
+
+const DropdownMenuGroup = DropdownMenuPrimitive.Group;
+
+const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
+
+const DropdownMenuSub = DropdownMenuPrimitive.Sub;
+
+const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
+
+const DropdownMenuSubTrigger = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
+ inset?: boolean;
+ }
+>(({ className, inset, children, ...props }, ref) => (
+ <DropdownMenuPrimitive.SubTrigger
+ ref={ref}
+ className={cn(
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
+ inset && "pl-8",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ <ChevronRight className="ml-auto h-4 w-4" />
+ </DropdownMenuPrimitive.SubTrigger>
+));
+DropdownMenuSubTrigger.displayName =
+ DropdownMenuPrimitive.SubTrigger.displayName;
+
+const DropdownMenuSubContent = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
+>(({ className, ...props }, ref) => (
+ <DropdownMenuPrimitive.SubContent
+ ref={ref}
+ className={cn(
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",
+ className
+ )}
+ {...props}
+ />
+));
+DropdownMenuSubContent.displayName =
+ DropdownMenuPrimitive.SubContent.displayName;
+
+const DropdownMenuContent = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
+>(({ className, sideOffset = 4, ...props }, ref) => (
+ <DropdownMenuPrimitive.Portal>
+ <DropdownMenuPrimitive.Content
+ ref={ref}
+ sideOffset={sideOffset}
+ className={cn(
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
+ className
+ )}
+ {...props}
+ />
+ </DropdownMenuPrimitive.Portal>
+));
+DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
+
+const DropdownMenuItem = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.Item>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
+ inset?: boolean;
+ }
+>(({ className, inset, ...props }, ref) => (
+ <DropdownMenuPrimitive.Item
+ ref={ref}
+ className={cn(
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
+ inset && "pl-8",
+ className
+ )}
+ {...props}
+ />
+));
+DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
+
+const DropdownMenuCheckboxItem = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
+>(({ className, children, checked, ...props }, ref) => (
+ <DropdownMenuPrimitive.CheckboxItem
+ ref={ref}
+ className={cn(
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
+ className
+ )}
+ checked={checked}
+ {...props}
+ >
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
+ <DropdownMenuPrimitive.ItemIndicator>
+ <Check className="h-4 w-4" />
+ </DropdownMenuPrimitive.ItemIndicator>
+ </span>
+ {children}
+ </DropdownMenuPrimitive.CheckboxItem>
+));
+DropdownMenuCheckboxItem.displayName =
+ DropdownMenuPrimitive.CheckboxItem.displayName;
+
+const DropdownMenuRadioItem = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
+>(({ className, children, ...props }, ref) => (
+ <DropdownMenuPrimitive.RadioItem
+ ref={ref}
+ className={cn(
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
+ className
+ )}
+ {...props}
+ >
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
+ <DropdownMenuPrimitive.ItemIndicator>
+ <Circle className="h-2 w-2 fill-current" />
+ </DropdownMenuPrimitive.ItemIndicator>
+ </span>
+ {children}
+ </DropdownMenuPrimitive.RadioItem>
+));
+DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
+
+const DropdownMenuLabel = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.Label>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
+ inset?: boolean;
+ }
+>(({ className, inset, ...props }, ref) => (
+ <DropdownMenuPrimitive.Label
+ ref={ref}
+ className={cn(
+ "px-2 py-1.5 text-sm font-semibold",
+ inset && "pl-8",
+ className
+ )}
+ {...props}
+ />
+));
+DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
+
+const DropdownMenuSeparator = React.forwardRef<
+ React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
+>(({ className, ...props }, ref) => (
+ <DropdownMenuPrimitive.Separator
+ ref={ref}
+ className={cn("-mx-1 my-1 h-px bg-muted", className)}
+ {...props}
+ />
+));
+DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
+
+const DropdownMenuShortcut = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLSpanElement>) => {
+ return (
+ <span
+ className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
+ {...props}
+ />
+ );
+};
+DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
+
+export {
+ DropdownMenu,
+ DropdownMenuTrigger,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuCheckboxItem,
+ DropdownMenuRadioItem,
+ DropdownMenuLabel,
+ DropdownMenuSeparator,
+ DropdownMenuShortcut,
+ DropdownMenuGroup,
+ DropdownMenuPortal,
+ DropdownMenuSub,
+ DropdownMenuSubContent,
+ DropdownMenuSubTrigger,
+ DropdownMenuRadioGroup,
+};
diff --git a/src/components/ui/input.tsx b/src/components/ui/input.tsx
new file mode 100644
index 0000000000..b41a93c28c
--- /dev/null
+++ b/src/components/ui/input.tsx
@@ -0,0 +1,24 @@
+import * as React from "react";
+
+import { cn } from "@/src/utils/tailwind";
+
+export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
+
+const Input = React.forwardRef<HTMLInputElement, InputProps>(
+ ({ className, type, ...props }, ref) => {
+ return (
+ <input
+ type={type}
+ className={cn(
+ "flex h-10 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
+ className
+ )}
+ ref={ref}
+ {...props}
+ />
+ );
+ }
+);
+Input.displayName = "Input";
+
+export { Input };
diff --git a/src/components/ui/popover.tsx b/src/components/ui/popover.tsx
new file mode 100644
index 0000000000..15a773eb0f
--- /dev/null
+++ b/src/components/ui/popover.tsx
@@ -0,0 +1,31 @@
+"use client";
+
+import * as React from "react";
+import * as PopoverPrimitive from "@radix-ui/react-popover";
+
+import { cn } from "@/src/utils/tailwind";
+
+const Popover = PopoverPrimitive.Root;
+
+const PopoverTrigger = PopoverPrimitive.Trigger;
+
+const PopoverContent = React.forwardRef<
+ React.ElementRef<typeof PopoverPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
+>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
+ <PopoverPrimitive.Portal>
+ <PopoverPrimitive.Content
+ ref={ref}
+ align={align}
+ sideOffset={sideOffset}
+ className={cn(
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
+ className
+ )}
+ {...props}
+ />
+ </PopoverPrimitive.Portal>
+));
+PopoverContent.displayName = PopoverPrimitive.Content.displayName;
+
+export { Popover, PopoverTrigger, PopoverContent };
diff --git a/src/components/ui/separator.tsx b/src/components/ui/separator.tsx
new file mode 100644
index 0000000000..3021f03267
--- /dev/null
+++ b/src/components/ui/separator.tsx
@@ -0,0 +1,31 @@
+"use client";
+
+import * as React from "react";
+import * as SeparatorPrimitive from "@radix-ui/react-separator";
+
+import { cn } from "@/src/utils/tailwind";
+
+const Separator = React.forwardRef<
+ React.ElementRef<typeof SeparatorPrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
+>(
+ (
+ { className, orientation = "horizontal", decorative = true, ...props },
+ ref
+ ) => (
+ <SeparatorPrimitive.Root
+ ref={ref}
+ decorative={decorative}
+ orientation={orientation}
+ className={cn(
+ "shrink-0 bg-border",
+ orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
+ className
+ )}
+ {...props}
+ />
+ )
+);
+Separator.displayName = SeparatorPrimitive.Root.displayName;
+
+export { Separator };
diff --git a/src/components/ui/table.tsx b/src/components/ui/table.tsx
new file mode 100644
index 0000000000..04ef6e0a59
--- /dev/null
+++ b/src/components/ui/table.tsx
@@ -0,0 +1,113 @@
+import * as React from "react";
+import { cn } from "@/src/utils/tailwind";
+
+const Table = React.forwardRef<
+ HTMLTableElement,
+ React.HTMLAttributes<HTMLTableElement>
+>(({ className, ...props }, ref) => (
+ <div className="w-full overflow-auto">
+ <table
+ ref={ref}
+ className={cn("w-full caption-bottom text-sm", className)}
+ {...props}
+ />
+ </div>
+));
+Table.displayName = "Table";
+
+const TableHeader = React.forwardRef<
+ HTMLTableSectionElement,
+ React.HTMLAttributes<HTMLTableSectionElement>
+>(({ className, ...props }, ref) => (
+ <thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />
+));
+TableHeader.displayName = "TableHeader";
+
+const TableBody = React.forwardRef<
+ HTMLTableSectionElement,
+ React.HTMLAttributes<HTMLTableSectionElement>
+>(({ className, ...props }, ref) => (
+ <tbody
+ ref={ref}
+ className={cn("[&_tr:last-child]:border-0", className)}
+ {...props}
+ />
+));
+TableBody.displayName = "TableBody";
+
+const TableFooter = React.forwardRef<
+ HTMLTableSectionElement,
+ React.HTMLAttributes<HTMLTableSectionElement>
+>(({ className, ...props }, ref) => (
+ <tfoot
+ ref={ref}
+ className={cn("bg-primary font-medium text-primary-foreground", className)}
+ {...props}
+ />
+));
+TableFooter.displayName = "TableFooter";
+
+const TableRow = React.forwardRef<
+ HTMLTableRowElement,
+ React.HTMLAttributes<HTMLTableRowElement>
+>(({ className, ...props }, ref) => (
+ <tr
+ ref={ref}
+ className={cn(
+ "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
+ className
+ )}
+ {...props}
+ />
+));
+TableRow.displayName = "TableRow";
+
+const TableHead = React.forwardRef<
+ HTMLTableCellElement,
+ React.ThHTMLAttributes<HTMLTableCellElement>
+>(({ className, ...props }, ref) => (
+ <th
+ ref={ref}
+ className={cn(
+ "h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
+ className
+ )}
+ {...props}
+ />
+));
+TableHead.displayName = "TableHead";
+
+const TableCell = React.forwardRef<
+ HTMLTableCellElement,
+ React.TdHTMLAttributes<HTMLTableCellElement>
+>(({ className, ...props }, ref) => (
+ <td
+ ref={ref}
+ className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}
+ {...props}
+ />
+));
+TableCell.displayName = "TableCell";
+
+const TableCaption = React.forwardRef<
+ HTMLTableCaptionElement,
+ React.HTMLAttributes<HTMLTableCaptionElement>
+>(({ className, ...props }, ref) => (
+ <caption
+ ref={ref}
+ className={cn("mt-4 text-sm text-muted-foreground", className)}
+ {...props}
+ />
+));
+TableCaption.displayName = "TableCaption";
+
+export {
+ Table,
+ TableHeader,
+ TableBody,
+ TableFooter,
+ TableHead,
+ TableRow,
+ TableCell,
+ TableCaption,
+};
diff --git a/src/pages/playground.tsx b/src/pages/playground.tsx
deleted file mode 100644
index 70684580b8..0000000000
--- a/src/pages/playground.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import Header from "../components/layouts/header";
-
-export default function Playground() {
- return <Header title="Playground" />;
-}
diff --git a/src/pages/traces.tsx b/src/pages/traces.tsx
index 45ee609b9f..f05ac0a51b 100644
--- a/src/pages/traces.tsx
+++ b/src/pages/traces.tsx
@@ -1,428 +1,230 @@
-import Header from "~/components/layouts/header";
-
-import {
- DataGrid,
- type GridRowsProp,
- type GridColDef,
- type GridRowParams,
- type GridFilterItem,
- type GridFilterOperator,
- type GridFilterInputValueProps,
- SUBMIT_FILTER_STROKE_TIME,
- type GridFilterModel,
- GridToolbarContainer,
- GridToolbarExport,
- GridToolbarFilterButton,
-} from "@mui/x-data-grid";
-import { api } from "~/utils/api";
+import React, { useState } from "react";
+import { api } from "../utils/api";
+import { type RouterOutput, type RouterInput } from "../utils/types";
+import { DataTable } from "../components/data-table";
+import { type Trace, type Score } from "@prisma/client";
+import { ArrowUpRight, type LucideIcon } from "lucide-react";
+import { lastCharacters } from "../utils/string";
import { useRouter } from "next/router";
+import { type ColumnDef } from "@tanstack/react-table";
import {
Tabs,
TabsContent,
TabsList,
TabsTrigger,
} from "../components/ui/tabs";
-import { type RouterInput, type RouterOutput } from "../utils/types";
+import Header from "../components/layouts/header";
import { Button } from "../components/ui/button";
import Link from "next/link";
-import { ArrowUpRight } from "lucide-react";
import ObservationDisplay from "../components/observationDisplay";
-import { type TextFieldProps, TextField, Box } from "@mui/material";
-import React from "react";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { faSpinner } from "@fortawesome/free-solid-svg-icons";
-
-interface CustomToolbarProps {
- setFilterButtonEl: React.Dispatch<
- React.SetStateAction<HTMLButtonElement | null>
- >;
-}
+import { DataTableToolbar } from "../components/data-table-toolbar";
-function InputKeyValue(props: GridFilterInputValueProps) {
- const { item, applyValue, focusElementRef = null } = props;
-
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const filterTimeout = React.useRef<any>();
- const [filterValueState, setFilterValueState] = React.useState<
- [string, string]
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
- >(item.value ?? "");
+export type TraceTableRow = {
+ id: string;
+ timestamp: Date;
+ name: string;
+ status: string;
+ statusMessage?: string;
+ attributes?: string;
+ scores: string;
+};
- const [applying, setIsApplying] = React.useState(false);
+export type TraceFilterInput = RouterInput["traces"]["all"];
- React.useEffect(() => {
- return () => {
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
- clearTimeout(filterTimeout.current);
- };
- }, []);
+export type TraceRowOptions = {
+ columnId: string;
+ options: { label: string; value: number; icon?: LucideIcon }[];
+};
- React.useEffect(() => {
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
- const itemValue = item.value ?? [undefined, undefined];
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
- setFilterValueState(itemValue);
- }, [item.value]);
+export default function Traces() {
+ const router = useRouter();
- const updateFilterValue = (key: string, value: string) => {
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
- clearTimeout(filterTimeout.current);
- setFilterValueState([key, value]);
+ const [queryOptions, setQueryOptions] = useState<TraceFilterInput>({
+ attribute: {},
+ name: [],
+ id: [],
+ status: [],
+ });
- setIsApplying(true);
- filterTimeout.current = setTimeout(() => {
- setIsApplying(false);
- applyValue({ ...item, value: [key, value] });
- }, SUBMIT_FILTER_STROKE_TIME);
+ const updateQueryOptions = (options: TraceFilterInput) => {
+ setQueryOptions(options);
};
- const handleUpperFilterChange: TextFieldProps["onChange"] = (event) => {
- const newUpperBound = event.target.value;
- updateFilterValue(filterValueState[0], newUpperBound);
- };
- const handleLowerFilterChange: TextFieldProps["onChange"] = (event) => {
- const newLowerBound = event.target.value;
- updateFilterValue(newLowerBound, filterValueState[1]);
+ // {
+ // refetchInterval: 2000,
+ // }
+
+ const traces = api.traces.all.useQuery(queryOptions);
+
+ const options = api.traces.availableFilterOptions.useQuery(queryOptions);
+
+ const convertToTableRow = (
+ trace: Trace & { scores: Score[] }
+ ): TraceTableRow => {
+ return {
+ id: trace.id,
+ timestamp: trace.timestamp,
+ name: trace.name,
+ status: trace.status,
+ statusMessage: trace.statusMessage ?? undefined,
+ attributes: JSON.stringify(trace.attributes),
+ scores: trace.scores
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-member-access
+ .map((score) => `${score.name}: ${score.value}`)
+ .join("; "),
+ };
};
- return (
- <Box
- sx={{
- display: "inline-flex",
- flexDirection: "row",
- alignItems: "end",
- height: 48,
- pl: "20px",
- }}
- >
- <TextField
- name="lower-bound-input"
- placeholder="Key"
- label="key"
- variant="standard"
- value={String(filterValueState[0])}
- onChange={handleLowerFilterChange}
- type="string"
- inputRef={focusElementRef}
- sx={{ mr: 2 }}
- />
- <TextField
- name="upper-bound-input"
- placeholder="Value"
- label="value"
- variant="standard"
- value={String(filterValueState[1])}
- onChange={handleUpperFilterChange}
- type="string"
- InputProps={
- applying
- ? {
- endAdornment: <FontAwesomeIcon icon={faSpinner} />,
- }
- : {}
- }
- />
- </Box>
- );
-}
-
-interface TraceRowData {
- id: string;
-}
-
-type TraceFilterInput = RouterInput["traces"]["all"];
-
-export default function Traces() {
- const [queryOptions, setQueryOptions] = React.useState<TraceFilterInput>({
- attributes: {},
- });
-
- const traces = api.traces.all.useQuery(queryOptions, {
- refetchInterval: 2000,
- });
- const router = useRouter();
+ const convertToOptions = (
+ options: RouterOutput["traces"]["availableFilterOptions"]
+ ): TraceRowOptions[] => {
+ return options.map((o) => {
+ return {
+ columnId: o.key,
+ options: o.occurrences.map((o) => {
+ return { label: o.key, value: o.count._all };
+ }),
+ };
+ });
+ };
- const quantityOnlyOperators: GridFilterOperator[] = [
+ const columns: ColumnDef<TraceTableRow>[] = [
{
- label: "Key-Value",
- value: "key-value",
- getApplyFilterFn: (filterItem: GridFilterItem) => {
- if (!Array.isArray(filterItem.value) || filterItem.value.length !== 2) {
- return null;
- }
- if (filterItem.value[0] == null || filterItem.value[1] == null) {
- return null;
- }
-
- return ({ value }) => {
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-argument
- const jsonObj = JSON.parse(value);
-
- return (
- value !== null &&
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
- jsonObj[filterItem.value[0]] !== undefined &&
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
- jsonObj[filterItem.value[0]] === filterItem.value[1]
- );
- };
+ accessorKey: "id",
+ cell: ({ row }) => {
+ return (
+ <div>
+ <button
+ key="openTrace"
+ className="rounded bg-indigo-50 px-2 py-1 text-xs font-semibold text-blue-600 shadow-sm hover:bg-indigo-100"
+ onClick={() => {
+ const value = row.getValue("id");
+ typeof value === "string"
+ ? void router.push(`/traces/${value}`)
+ : null;
+ }}
+ >
+ ...{lastCharacters(row.getValue("id"), 7)}
+ </button>
+ </div>
+ );
},
- InputComponent: InputKeyValue,
- },
- ];
-
- const [filterModel, setFilterModel] = React.useState<GridFilterModel>({
- items: [
- {
- id: 1,
- field: "attributes",
- value: ["id", "abcd"],
- operator: "key-value",
+ enableColumnFilter: true,
+ meta: {
+ label: "Id",
+ updateFunction: (newValues: string[] | null) => {
+ updateQueryOptions({ ...queryOptions, id: newValues });
+ },
+ filter: queryOptions.id,
},
- ],
- });
-
- const columns: GridColDef[] = [
- {
- field: "id",
- type: "actions",
- headerName: "ID",
- width: 100,
- getActions: (params: GridRowParams<TraceRowData>) => [
- <button
- key="openTrace"
- className="rounded bg-indigo-50 px-2 py-1 text-xs font-semibold text-indigo-600 shadow-sm hover:bg-indigo-100"
- onClick={() => void router.push(`/traces/${params.row.id}`)}
- >
- ...{lastCharacters(params.row.id, 7)}
- </button>,
- ],
- headerClassName:
- "px-3 py-3.5 text-left text-sm font-semibold text-gray-900 hideRightSeparator",
- sortable: false,
},
{
- field: "timestamp",
- hideable: false,
- type: "dateTime",
- headerName: "Timestamp",
- width: 170,
- headerClassName:
- "px-3 py-3.5 text-left text-sm font-semibold text-gray-900 hideRightSeparator",
- sortable: false,
+ accessorKey: "timestamp",
+ header: "Timestamp",
},
{
- field: "name",
- hideable: false,
- headerName: "Name",
- minWidth: 200,
- headerClassName:
- "px-3 py-3.5 text-left text-sm font-semibold text-gray-900 hideRightSeparator",
- sortable: false,
+ accessorKey: "name",
+ header: "Name",
+ enableColumnFilter: true,
+ meta: {
+ label: "Name",
+ updateFunction: (newValues: string[] | null) => {
+ updateQueryOptions({ ...queryOptions, name: newValues });
+ },
+ filter: queryOptions.name,
+ },
},
{
- field: "status",
- hideable: false,
- headerName: "Status",
- minWidth: 100,
- headerClassName:
- "px-3 py-3.5 text-left text-sm font-semibold text-gray-900 hideRightSeparator",
- sortable: false,
+ accessorKey: "status",
+ header: "Status",
+ enableColumnFilter: true,
+ meta: {
+ label: "Status",
+ updateFunction: (newValues: string[] | null) => {
+ updateQueryOptions({ ...queryOptions, status: newValues });
+ },
+ filter: queryOptions.status,
+ },
},
{
- field: "statusMessage",
- hideable: false,
- headerName: "Status Message",
- width: 200,
- headerClassName:
- "px-3 py-3.5 text-left text-sm font-semibold text-gray-900 hideRightSeparator",
- sortable: false,
+ accessorKey: "statusMessage",
+ header: "Status Message",
},
{
- field: "attributes",
- hideable: false,
- headerName: "Attributes",
- flex: 1,
- filterOperators: quantityOnlyOperators,
- headerClassName:
- "px-3 py-3.5 text-left text-sm font-semibold text-gray-900 hideRightSeparator",
- sortable: false,
+ accessorKey: "attributes",
+ header: "Attributes",
},
{
- field: "scores",
- hideable: false,
- headerName: "Scores",
- flex: 1,
- headerClassName:
- "px-3 py-3.5 text-left text-sm font-semibold text-gray-900 hideRightSeparator",
- sortable: false,
+ accessorKey: "scores",
+ header: "Scores",
},
];
- const onFilterChange = React.useCallback((filterModel: GridFilterModel) => {
- let filterOptions: TraceFilterInput = { attributes: {} };
-
- filterModel.items.forEach((item) => {
- if (item.operator === "key-value") {
- if (!Array.isArray(item.value) || item.value.length !== 2) {
- return null;
- }
- if (item.value[0] == null || item.value[1] == null) {
- return null;
- }
-
- filterOptions = {
- attributes: {
- path: [item.value[0]],
- equals: item.value[1] as string,
- },
- };
+ const tableOptions = options.isLoading
+ ? { isLoading: true, isError: false }
+ : options.isError
+ ? {
+ isLoading: false,
+ isError: true,
+ error: options.error.message,
}
-
- setFilterModel(filterModel);
- });
-
- setQueryOptions(filterOptions);
- }, []);
-
- const [filterButtonEl, setFilterButtonEl] =
- React.useState<HTMLButtonElement | null>(null);
-
- const rows: GridRowsProp = traces.isSuccess
- ? traces.data.map((trace) => ({
- id: trace.id,
- timestamp: trace.timestamp,
- name: trace.name,
- status: trace.status,
- statusMessage: trace.statusMessage,
- attributes: JSON.stringify(trace.attributes),
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
- scores: trace.scores
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-member-access
- .map((score) => `${score.name}: ${score.value}`)
- .join("; "),
- }))
- : [];
+ : {
+ isLoading: false,
+ isError: false,
+ data: convertToOptions(options.data),
+ };
return (
- <>
+ <div className="container mx-auto py-10">
<Header title="Traces" live />
<Tabs defaultValue="table">
<TabsList>
<TabsTrigger value="table">Table</TabsTrigger>
<TabsTrigger value="sidebyside">Side-by-side</TabsTrigger>
</TabsList>
+ {tableOptions.data ? (
+ <div className="mt-2">
+ <DataTableToolbar
+ columnDefs={columns}
+ options={tableOptions.data}
+ queryOptions={queryOptions}
+ updateQueryOptions={updateQueryOptions}
+ />
+ </div>
+ ) : undefined}
<TabsContent value="table">
- <DataGrid
- sx={{
- ".MuiDataGrid-columnHeader:focus": {
- outline: "none",
- },
- "& .MuiDataGrid-cell:focus": {
- outline: "none",
- },
- ".MuiDataGrid-root": {
- ".MuiDataGrid-cell:focus .MuiDataGrid-cell:focus-within .MuiDataGrid-columnHeader:focus .MuiDataGrid-columnHeader:focus-within":
- {
- outline: "none",
- },
- },
- "& .hideRightSeparator > .MuiDataGrid-columnSeparator": {
- display: "none",
- },
- }}
- rows={rows}
+ <DataTable
columns={columns}
- loading={traces.isLoading}
- filterModel={filterModel}
- filterMode="server"
- onFilterModelChange={onFilterChange}
- disableColumnMenu={true}
- disableRowSelectionOnClick={true}
- slots={{
- toolbar: CustomToolbar,
- }}
- slotProps={{
- panel: {
- anchorEl: filterButtonEl,
- },
- toolbar: {
- setFilterButtonEl,
- },
- }}
- getRowClassName={() => `whitespace-nowrap text-sm text-gray-500`}
- autoHeight
+ data={
+ traces.isLoading
+ ? { isLoading: true, isError: false }
+ : traces.isError
+ ? {
+ isLoading: false,
+ isError: true,
+ error: traces.error.message,
+ }
+ : {
+ isLoading: false,
+ isError: false,
+ data: traces.data?.map((t) => convertToTableRow(t)),
+ }
+ }
+ options={tableOptions}
/>
</TabsContent>
<TabsContent value="sidebyside">
- <DataGrid
- sx={{
- ".MuiDataGrid-columnHeader:focus": {
- outline: "none",
- },
- "& .MuiDataGrid-cell:focus": {
- outline: "none",
- },
- ".MuiDataGrid-root": {
- ".MuiDataGrid-cell:focus .MuiDataGrid-cell:focus-within .MuiDataGrid-columnHeader:focus .MuiDataGrid-columnHeader:focus-within":
- {
- outline: "none",
- },
- },
- "& .hideRightSeparator > .MuiDataGrid-columnSeparator": {
- display: "none",
- },
- }}
- rows={[]}
- columns={columns}
- loading={traces.isLoading}
- filterModel={filterModel}
- filterMode="server"
- onFilterModelChange={onFilterChange}
- disableColumnMenu={true}
- disableRowSelectionOnClick={true}
- getRowClassName={() => `whitespace-nowrap text-sm text-gray-500`}
- slots={{
- toolbar: CustomToolbar,
- noRowsOverlay: () => null,
- noResultsOverlay: () => null,
- }}
- slotProps={{
- panel: {
- anchorEl: filterButtonEl,
- },
- toolbar: {
- setFilterButtonEl,
- },
- }}
- hideFooter={true}
- hideFooterPagination={true}
- hideFooterSelectedRowCount={true}
- />
<div className="relative flex max-w-full flex-row gap-2 overflow-x-scroll pb-3">
- {traces.data?.map((trace) => (
- <Single key={trace.id} trace={trace} />
- ))}
+ {traces.data?.map((trace) => {
+ return <Single key={trace.id} trace={trace} />;
+ })}
</div>
</TabsContent>
</Tabs>
- </>
+ </div>
);
}
-function CustomToolbar({ setFilterButtonEl }: CustomToolbarProps) {
- return (
- <GridToolbarContainer>
- <GridToolbarFilterButton ref={setFilterButtonEl} />
- <GridToolbarExport />
- </GridToolbarContainer>
- );
-}
-
-function lastCharacters(str: string, n: number) {
- return str.substring(str.length - n);
-}
-
const Single = (props: { trace: RouterOutput["traces"]["all"][number] }) => {
const { trace } = props;
diff --git a/src/server/api/routers/traces.ts b/src/server/api/routers/traces.ts
index 1bed08e659..2bbe831387 100644
--- a/src/server/api/routers/traces.ts
+++ b/src/server/api/routers/traces.ts
@@ -5,43 +5,145 @@ import { z } from "zod";
import { createTRPCRouter, publicProcedure } from "~/server/api/trpc";
import { prisma } from "~/server/db";
+const FilterOptions = z.object({
+ attribute: z
+ .object({
+ path: z.array(z.string()).optional(),
+ equals: z.string().optional(),
+ string_contains: z.string().optional(),
+ string_starts_with: z.string().optional(),
+ string_ends_with: z.string().optional(),
+ })
+ .nullable(),
+ name: z.array(z.string()).nullable(),
+ id: z.array(z.string()).nullable(),
+ status: z.array(z.string()).nullable(),
+});
+
export const traceRouter = createTRPCRouter({
- all: publicProcedure
- .input(
- z.object({
- attributes: z
- .object({
- path: z.array(z.string()).optional(),
- equals: z.string().optional(),
- string_contains: z.string().optional(),
- string_starts_with: z.string().optional(),
- string_ends_with: z.string().optional(),
- })
- .nullable(),
- })
- )
+ all: publicProcedure.input(FilterOptions).query(async ({ input }) => {
+ const traces = await prisma.trace.findMany({
+ where: {
+ ...(input.attribute?.path
+ ? {
+ attributes: input.attribute,
+ }
+ : undefined),
+ ...(input.name
+ ? {
+ name: {
+ in: input.name,
+ },
+ }
+ : undefined),
+ ...(input.id
+ ? {
+ id: {
+ in: input.id,
+ },
+ }
+ : undefined),
+ ...(input.status
+ ? {
+ status: {
+ in: input.status,
+ },
+ }
+ : undefined),
+ },
+ orderBy: {
+ timestamp: "desc",
+ },
+ include: {
+ scores: true,
+ observations: true,
+ },
+ });
+
+ return traces.map((trace) => ({
+ ...trace,
+ nestedObservation: nestObservations(trace.observations),
+ }));
+ }),
+
+ availableFilterOptions: publicProcedure
+ .input(FilterOptions)
.query(async ({ input }) => {
- const traces = await prisma.trace.findMany({
- ...(input.attributes?.path
+ const filter = {
+ ...(input.attribute?.path
+ ? {
+ attributes: input.attribute,
+ }
+ : undefined),
+ ...(input.name
+ ? {
+ name: {
+ in: input.name,
+ },
+ }
+ : undefined),
+ ...(input.id
+ ? {
+ id: {
+ in: input.id,
+ },
+ }
+ : undefined),
+ ...(input.status
? {
- where: {
- attributes: input.attributes,
+ status: {
+ in: input.status,
},
}
: undefined),
- orderBy: {
- timestamp: "desc",
+ };
+
+ const [ids, names, statuses] = await Promise.all([
+ await prisma.trace.groupBy({
+ where: filter,
+ by: ["id"],
+ _count: {
+ _all: true,
+ },
+ }),
+
+ await prisma.trace.groupBy({
+ where: filter,
+ by: ["name"],
+ _count: {
+ _all: true,
+ },
+ }),
+
+ await prisma.trace.groupBy({
+ where: filter,
+ by: ["status"],
+ _count: {
+ _all: true,
+ },
+ }),
+ ]);
+
+ return [
+ {
+ key: "id",
+ occurrences: ids.map((i) => {
+ return { key: i.id, count: i._count };
+ }),
},
- include: {
- scores: true,
- observations: true,
+ {
+ key: "name",
+ occurrences: names.map((i) => {
+ return { key: i.name, count: i._count };
+ }),
},
- });
-
- return traces.map((trace) => ({
- ...trace,
- nestedObservation: nestObservations(trace.observations),
- }));
+ {
+ key: "status",
+ occurrences: statuses.map((i) => {
+ return { key: i.status, count: i._count };
+ }),
+ },
+ ];
}),
byId: publicProcedure.input(z.string()).query(async ({ input }) => {
diff --git a/src/utils/string.ts b/src/utils/string.ts
new file mode 100644
index 0000000000..f564dedb1e
--- /dev/null
+++ b/src/utils/string.ts
@@ -0,0 +1,3 @@
+export function lastCharacters(str: string, n: number) {
+ return str.substring(str.length - n);
+}
diff --git a/src/utils/tanstack.d.ts b/src/utils/tanstack.d.ts
new file mode 100644
index 0000000000..4fc0ff094d
--- /dev/null
+++ b/src/utils/tanstack.d.ts
@@ -0,0 +1,8 @@
+export declare module "@tanstack/table-core" {
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
+ export interface ColumnMeta<TData extends RowData, TValue> {
+ label?: string;
+ updateFunction: (newValues: string[] | null) => void;
+ filter: string[] | null;
+ }
+}