Skip to content

Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.

release: v0.5.0 — frontend monorepo restructure, build hardening, jobs reliability (#132)

Raghav Chamadiyaaadd8f5e0222
diff --git a/.github/workflows/publish-internal.yml b/.github/workflows/publish-internal.yml
new file mode 100644
index 000000000..4b3d6bdc8
--- /dev/null
+++ b/.github/workflows/publish-internal.yml
@@ -0,0 +1,100 @@
+name: Publish internal prereleases
+
+# Publishes @repowise-dev/types and @repowise-dev/ui to GitHub Packages on
+# every push to `next`, tagged as `0.0.0-internal.<short-sha>`. Downstream
+# consumers (e.g. hosted-frontend) pin to a specific SHA.
+#
+# Source package.json files declare the published names directly
+# (`@repowise-dev/types`, `@repowise-dev/ui`) but keep `private: true` and
+# `version: 0.0.1`. This workflow stamps the prerelease version and
+# removes `private` only at publish time. The PyPI publish workflow
+# (`publish.yml`) only fires on `v*` tags and is unaffected.
+#
+# Triggers:
+# - push to `next` (auto)
+# - workflow_dispatch (manual, for re-publishes)
+#
+# Explicitly NOT triggered on push to `main` to avoid surfacing prereleases
+# from main while the package consumption pattern is still being validated.
+
+on:
+ push:
+ branches: [next]
+ workflow_dispatch:
+
+permissions:
+ contents: read
+ packages: write
+
+concurrency:
+ group: publish-internal-${{ github.ref }}
+ cancel-in-progress: false
+
+jobs:
+ publish:
+ name: Publish to GitHub Packages
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: "20"
+ cache: "npm"
+ cache-dependency-path: package-lock.json
+ registry-url: "https://npm.pkg.github.com"
+ scope: "@repowise-dev"
+
+ - name: Install dependencies
+ run: npm ci
+
+ - name: Type-check + test
+ run: |
+ npm run type-check --workspace @repowise-dev/types
+ npm run type-check --workspace @repowise-dev/ui
+ npm run test --workspace @repowise-dev/ui
+
+ - name: Compute prerelease version
+ id: ver
+ run: |
+ SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
+ echo "version=0.0.0-internal.${SHORT_SHA}" >> "$GITHUB_OUTPUT"
+
+ - name: Publish @repowise-dev/types
+ working-directory: packages/types
+ env:
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_GITHUB_PACKAGES }}
+ VERSION: ${{ steps.ver.outputs.version }}
+ run: |
+ npm pkg set version="$VERSION"
+ npm pkg delete private
+ npm publish
+
+ - name: Publish @repowise-dev/ui
+ working-directory: packages/ui
+ env:
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_GITHUB_PACKAGES }}
+ VERSION: ${{ steps.ver.outputs.version }}
+ run: |
+ npm pkg set version="$VERSION"
+ npm pkg set dependencies.@repowise-dev/types="$VERSION"
+ npm pkg delete private
+ npm publish
+
+ - name: Summary
+ run: |
+ {
+ echo "### Published"
+ echo ""
+ echo "- \`@repowise-dev/types@${{ steps.ver.outputs.version }}\`"
+ echo "- \`@repowise-dev/ui@${{ steps.ver.outputs.version }}\`"
+ echo ""
+ echo "Consumer install (hosted-frontend):"
+ echo ""
+ echo '```json'
+ echo '"@repowise-dev/types": "${{ steps.ver.outputs.version }}",'
+ echo '"@repowise-dev/ui": "${{ steps.ver.outputs.version }}"'
+ echo '```'
+ } >> "$GITHUB_STEP_SUMMARY"
diff --git a/README.md b/README.md
index 06ca8d03d..5430c39ea 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@ Four intelligence layers. Seven MCP tools. Multi-repo workspaces. Auto-sync hook
[![MCP](https://img.shields.io/badge/MCP-compatible-F59520?labelColor=0A0A0A)](https://modelcontextprotocol.io)
[![Stars](https://img.shields.io/github/stars/repowise-dev/repowise?color=F59520&labelColor=0A0A0A)](https://github.com/repowise-dev/repowise)
-[**Live Demo →**](https://repowise.dev/examples) · [**Hosted for teams**](https://www.repowise.dev/#contact) · [**Docs**](https://repowise-dev.github.io) · [**Discord**](https://discord.gg/cQVpuDB6rh) · [**Contact**](mailto:[email protected])
+[**Explore real codebases →**](https://www.repowise.dev/explore) · [**Hosted for teams →**](https://www.repowise.dev/#contact) · [**Docs**](https://repowise-dev.github.io) · [**Discord**](https://discord.gg/cQVpuDB6rh) · [**Contact**](mailto:[email protected])
---
@@ -467,17 +467,16 @@ repowise is the intersection: CodeScene-level git intelligence + auto-generated
## Hosted version — for teams
-For teams that want repowise managed, we offer a hosted version. No self-hosting, no infrastructure to maintain — we handle deployment, updates, and webhooks. If your team wants shared codebase intelligence without the operational overhead, reach out.
+[**repowise.dev**](https://www.repowise.dev) is the same engine, fully managed. Now at feature parity with self-hosted: every CLI command, every MCP tool, the full dashboard. Connect your IDE to the hosted MCP endpoint and skip the install entirely.
-Hosted adds what only makes sense in a managed, multi-user environment:
+We use it on our own codebase — see the live snapshot of repowise indexing itself: [**dogfood example →**](https://www.repowise.dev/s/5a6b93fa9a69). More public repos indexed on the [**explore page →**](https://www.repowise.dev/explore).
-- **Shared team context layer** — one CLAUDE.md backed by the full graph and decision layer, auto-injected into every team member's Claude Code session via MCP
-- **Session intelligence harvesting** — architectural decisions extracted from AI coding sessions and proposed to the team knowledge base automatically
-- **Security vulnerability reporting** — repowise scans for known vulnerability patterns, dependency risks, and security anti-patterns across your codebase and surfaces them proactively. Not just `eval` calls — real CVE-aware analysis
-- **Engineering leader dashboard** — bus factor trends, hotspot evolution over time, cross-repo dead code, ownership drift
-- **Managed webhooks** — zero-configuration auto re-index on every commit to any branch
-- **Integrations** — Slack alerts, Jira and Linear decision linking, Confluence and Notion doc sync, GitHub and GitLab webhooks, PagerDuty escalation routing
-- **Cross-repo intelligence at scale** — hotspots, dead code, and ownership across all your repositories with centralized dashboards (beyond what local workspaces provide)
+**What you get on top of self-hosting:**
+- **Zero ops** — managed deploys, managed webhooks, auto re-index on every commit, no infrastructure
+- **Hosted MCP endpoint** — point Claude Code (or any MCP client) at one URL, no local server to run
+- **Security scanning layer** — CVE-aware vulnerability detection, dependency risk surfacing, and security anti-pattern analysis across your repositories
+- **Cross-repo intelligence at scale** — federated hotspots, dead code, and ownership across all your repos in one dashboard
+- **Integrations** *(rolling out)* — Slack alerts, Jira/Linear decision linking, Confluence/Notion doc sync, PagerDuty escalation
[Get in touch →](https://www.repowise.dev/#contact) · [[email protected]](mailto:[email protected])
@@ -634,6 +633,6 @@ For commercial licensing — embedding repowise in a product, white-labeling, or
Built for engineers who got tired of watching their AI agent `cat` the same file for the fourth time.
-[repowise.dev](https://repowise.dev) · [Live Demo →](https://repowise.dev/examples) · [Discord](https://discord.gg/cQVpuDB6rh) · [X](https://x.com/repowisedev) · [[email protected]](mailto:[email protected])
+[repowise.dev](https://repowise.dev) · [Explore →](https://www.repowise.dev/explore) · [Discord](https://discord.gg/cQVpuDB6rh) · [X](https://x.com/repowisedev) · [[email protected]](mailto:[email protected])
</div>
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 6d140e6a5..7c6ebd123 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -9,7 +9,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
---
-## [0.4.0] — Unreleased
+## [0.5.0] — 2026-05-03
+
+### Changed
+- **Build packaging hardened** — `pyproject.toml` now uses `[tool.setuptools.packages.find]` to auto-discover all `repowise.*` subpackages across `packages/{core,cli,server}/src`, replacing the hand-maintained explicit list. Eliminates the missing-subpackage drift class that previously required hotfixes (#97, #110, #115).
+- **Frontend monorepo restructure** — visualization, dashboard, chat, wiki, graph, and workspace components extracted from `packages/web` into shared `@repowise-dev/ui` and `@repowise-dev/types` workspace packages (~50 components). Fully transparent to `pip install repowise` users — the published `repowise-web.tar.gz` standalone bundle is unchanged in shape and behaviour. OSS contributors benefit from clearer module boundaries; both packages resolve via npm workspace symlinks with no extra auth required.
+- **`packages/web` declares its workspace dependencies explicitly** — `@repowise-dev/ui` and `@repowise-dev/types` are now listed in `packages/web/package.json` so isolated installs (`cd packages/web && npm install`) no longer fail with module-not-found.
+
+### Fixed
+- **Jobs reliability pass** — cancel endpoint added; progress hydration covers all phases; stuck-job detection on startup resets stale `pending`/`running` rows; SQLite WAL contention reduced during sync; per-repo DB used in workspace mode (#117).
+- **`repowise update` now persists LLM costs** — costs were being computed but not written to the `llm_costs` table during incremental updates; cost dashboards underreported spend (#108).
+- **Workspace dashboard** — contract summary now renders when contracts exist but no cross-repo links have been detected, instead of showing an empty state (#111).
+
+### Documentation
+- **Computed glossary** — `docs/COMPUTED_GLOSSARY.md` documents every derived metric, score, and signal Repowise computes (PageRank, hotspot score, freshness, confidence tiers, etc.) so the surface vocabulary is discoverable in one place (#127).
+- **README + UI/UX audit fixes** — confirmation dialogs, mobile responsiveness, accessibility, and empty/error/loading states across the dashboard (#117).
+
+### Dependencies
+- `python-dotenv` 1.0.1 → 1.2.2 (#98).
+
+---
+
+## [0.4.1] — 2026-04-30
+
+### Fixed
+- **Wheel packaging** — `pyproject.toml` `[tool.setuptools] packages` list extended to include subpackages omitted in 0.4.0; some installs were missing modules at runtime (#110).
+- **`get_answer` MCP tool** — citation format and confidence gating fixes (#107).
+
+---
+
+## [0.4.0] — 2026-04-26
### Added
diff --git a/package-lock.json b/package-lock.json
index 8f7e5f011..1e4f1cc75 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -8,12 +8,21 @@
"name": "repowise-root",
"version": "0.1.0",
"workspaces": [
+ "packages/types",
+ "packages/ui",
"packages/web"
],
"engines": {
"node": ">=20.0.0"
}
},
+ "node_modules/@adobe/css-tools": {
+ "version": "4.4.4",
+ "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.4.4.tgz",
+ "integrity": "sha512-Elp+iwUx5rN5+Y8xLt5/GRoG20WGoDCQ/1Fb+1LiGtvwbDavuSk0jhD/eZdckHAuzcDzccnkv+rEjyWfRx18gg==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/@alloc/quick-lru": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz",
@@ -40,6 +49,27 @@
"url": "https://github.com/sponsors/antfu"
}
},
+ "node_modules/@asamuzakjp/css-color": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-3.2.0.tgz",
+ "integrity": "sha512-K1A6z8tS3XsmCMM86xoWdn7Fkdn9m6RSVtocUrJYIwZnFVkng/PvkEoWtOWmP+Scc6saYWHWZYbndEEXxl24jw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@csstools/css-calc": "^2.1.3",
+ "@csstools/css-color-parser": "^3.0.9",
+ "@csstools/css-parser-algorithms": "^3.0.4",
+ "@csstools/css-tokenizer": "^3.0.3",
+ "lru-cache": "^10.4.3"
+ }
+ },
+ "node_modules/@asamuzakjp/css-color/node_modules/lru-cache": {
+ "version": "10.4.3",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",
+ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",
+ "dev": true,
+ "license": "ISC"
+ },
"node_modules/@babel/code-frame": {
"version": "7.29.0",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz",
@@ -54,1086 +84,1906 @@
"node": ">=6.9.0"
}
},
- "node_modules/@babel/helper-validator-identifier": {
- "version": "7.28.5",
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz",
- "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==",
+ "node_modules/@babel/compat-data": {
+ "version": "7.29.3",
+ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.3.tgz",
+ "integrity": "sha512-LIVqM46zQWZhj17qA8wb4nW/ixr2y1Nw+r1etiAWgRM6U1IqP+LNhL1yg440jYZR72jCWcWbLWzIosH+uP1fqg==",
+ "dev": true,
"license": "MIT",
"engines": {
"node": ">=6.9.0"
}
},
- "node_modules/@babel/runtime": {
- "version": "7.29.2",
- "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.2.tgz",
- "integrity": "sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==",
+ "node_modules/@babel/core": {
+ "version": "7.29.0",
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz",
+ "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==",
+ "dev": true,
"license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^7.29.0",
+ "@babel/generator": "^7.29.0",
+ "@babel/helper-compilation-targets": "^7.28.6",
+ "@babel/helper-module-transforms": "^7.28.6",
+ "@babel/helpers": "^7.28.6",
+ "@babel/parser": "^7.29.0",
+ "@babel/template": "^7.28.6",
+ "@babel/traverse": "^7.29.0",
+ "@babel/types": "^7.29.0",
+ "@jridgewell/remapping": "^2.3.5",
+ "convert-source-map": "^2.0.0",
+ "debug": "^4.1.0",
+ "gensync": "^1.0.0-beta.2",
+ "json5": "^2.2.3",
+ "semver": "^6.3.1"
+ },
"engines": {
"node": ">=6.9.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/babel"
}
},
- "node_modules/@braintree/sanitize-url": {
- "version": "7.1.2",
- "resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-7.1.2.tgz",
- "integrity": "sha512-jigsZK+sMF/cuiB7sERuo9V7N9jx+dhmHHnQyDSVdpZwVutaBu7WvNYqMDLSgFgfB30n452TP3vjDAvFC973mA==",
- "license": "MIT"
+ "node_modules/@babel/core/node_modules/json5": {
+ "version": "2.2.3",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
+ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "json5": "lib/cli.js"
+ },
+ "engines": {
+ "node": ">=6"
+ }
},
- "node_modules/@chevrotain/cst-dts-gen": {
- "version": "11.1.2",
- "resolved": "https://registry.npmjs.org/@chevrotain/cst-dts-gen/-/cst-dts-gen-11.1.2.tgz",
- "integrity": "sha512-XTsjvDVB5nDZBQB8o0o/0ozNelQtn2KrUVteIHSlPd2VAV2utEb6JzyCJaJ8tGxACR4RiBNWy5uYUHX2eji88Q==",
- "license": "Apache-2.0",
- "dependencies": {
- "@chevrotain/gast": "11.1.2",
- "@chevrotain/types": "11.1.2",
- "lodash-es": "4.17.23"
+ "node_modules/@babel/core/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "dev": true,
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
}
},
- "node_modules/@chevrotain/gast": {
- "version": "11.1.2",
- "resolved": "https://registry.npmjs.org/@chevrotain/gast/-/gast-11.1.2.tgz",
- "integrity": "sha512-Z9zfXR5jNZb1Hlsd/p+4XWeUFugrHirq36bKzPWDSIacV+GPSVXdk+ahVWZTwjhNwofAWg/sZg58fyucKSQx5g==",
- "license": "Apache-2.0",
+ "node_modules/@babel/generator": {
+ "version": "7.29.1",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz",
+ "integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==",
+ "dev": true,
+ "license": "MIT",
"dependencies": {
- "@chevrotain/types": "11.1.2",
- "lodash-es": "4.17.23"
+ "@babel/parser": "^7.29.0",
+ "@babel/types": "^7.29.0",
+ "@jridgewell/gen-mapping": "^0.3.12",
+ "@jridgewell/trace-mapping": "^0.3.28",
+ "jsesc": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=6.9.0"
}
},
- "node_modules/@chevrotain/regexp-to-ast": {
- "version": "11.1.2",
- "resolved": "https://registry.npmjs.org/@chevrotain/regexp-to-ast/-/regexp-to-ast-11.1.2.tgz",
- "integrity": "sha512-nMU3Uj8naWer7xpZTYJdxbAs6RIv/dxYzkYU8GSwgUtcAAlzjcPfX1w+RKRcYG8POlzMeayOQ/znfwxEGo5ulw==",
- "license": "Apache-2.0"
- },
- "node_modules/@chevrotain/types": {
- "version": "11.1.2",
- "resolved": "https://registry.npmjs.org/@chevrotain/types/-/types-11.1.2.tgz",
- "integrity": "sha512-U+HFai5+zmJCkK86QsaJtoITlboZHBqrVketcO2ROv865xfCMSFpELQoz1GkX5GzME8pTa+3kbKrZHQtI0gdbw==",
- "license": "Apache-2.0"
- },
- "node_modules/@chevrotain/utils": {
- "version": "11.1.2",
- "resolved": "https://registry.npmjs.org/@chevrotain/utils/-/utils-11.1.2.tgz",
- "integrity": "sha512-4mudFAQ6H+MqBTfqLmU7G1ZwRzCLfJEooL/fsF6rCX5eePMbGhoy5n4g+G4vlh2muDcsCTJtL+uKbOzWxs5LHA==",
- "license": "Apache-2.0"
- },
- "node_modules/@emnapi/core": {
- "version": "1.9.1",
- "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.1.tgz",
- "integrity": "sha512-mukuNALVsoix/w1BJwFzwXBN/dHeejQtuVzcDsfOEsdpCumXb/E9j8w11h5S54tT1xhifGfbbSm/ICrObRb3KA==",
+ "node_modules/@babel/helper-compilation-targets": {
+ "version": "7.28.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz",
+ "integrity": "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==",
"dev": true,
"license": "MIT",
- "optional": true,
"dependencies": {
- "@emnapi/wasi-threads": "1.2.0",
- "tslib": "^2.4.0"
+ "@babel/compat-data": "^7.28.6",
+ "@babel/helper-validator-option": "^7.27.1",
+ "browserslist": "^4.24.0",
+ "lru-cache": "^5.1.1",
+ "semver": "^6.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
}
},
- "node_modules/@emnapi/runtime": {
- "version": "1.9.1",
- "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.1.tgz",
- "integrity": "sha512-VYi5+ZVLhpgK4hQ0TAjiQiZ6ol0oe4mBx7mVv7IflsiEp0OWoVsp/+f9Vc1hOhE0TtkORVrI1GvzyreqpgWtkA==",
+ "node_modules/@babel/helper-compilation-targets/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "dev": true,
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/@babel/helper-globals": {
+ "version": "7.28.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz",
+ "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==",
+ "dev": true,
"license": "MIT",
- "optional": true,
- "dependencies": {
- "tslib": "^2.4.0"
+ "engines": {
+ "node": ">=6.9.0"
}
},
- "node_modules/@emnapi/wasi-threads": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.0.tgz",
- "integrity": "sha512-N10dEJNSsUx41Z6pZsXU8FjPjpBEplgH24sfkmITrBED1/U2Esum9F3lfLrMjKHHjmi557zQn7kR9R+XWXu5Rg==",
+ "node_modules/@babel/helper-module-imports": {
+ "version": "7.28.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz",
+ "integrity": "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==",
"dev": true,
"license": "MIT",
- "optional": true,
"dependencies": {
- "tslib": "^2.4.0"
+ "@babel/traverse": "^7.28.6",
+ "@babel/types": "^7.28.6"
+ },
+ "engines": {
+ "node": ">=6.9.0"
}
},
- "node_modules/@eslint-community/eslint-utils": {
- "version": "4.9.1",
- "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz",
- "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==",
+ "node_modules/@babel/helper-module-transforms": {
+ "version": "7.28.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz",
+ "integrity": "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==",
"dev": true,
"license": "MIT",
"dependencies": {
- "eslint-visitor-keys": "^3.4.3"
+ "@babel/helper-module-imports": "^7.28.6",
+ "@babel/helper-validator-identifier": "^7.28.5",
+ "@babel/traverse": "^7.28.6"
},
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
+ "node": ">=6.9.0"
},
"peerDependencies": {
- "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
+ "@babel/core": "^7.0.0"
}
},
- "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": {
- "version": "3.4.3",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
- "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
+ "node_modules/@babel/helper-plugin-utils": {
+ "version": "7.28.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz",
+ "integrity": "sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==",
"dev": true,
- "license": "Apache-2.0",
+ "license": "MIT",
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
+ "node": ">=6.9.0"
}
},
- "node_modules/@eslint-community/regexpp": {
- "version": "4.12.2",
- "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz",
- "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==",
+ "node_modules/@babel/helper-string-parser": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz",
+ "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==",
"dev": true,
"license": "MIT",
"engines": {
- "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
+ "node": ">=6.9.0"
}
},
- "node_modules/@eslint/config-array": {
- "version": "0.21.2",
- "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz",
- "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==",
+ "node_modules/@babel/helper-validator-identifier": {
+ "version": "7.28.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz",
+ "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-validator-option": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz",
+ "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==",
"dev": true,
- "license": "Apache-2.0",
- "dependencies": {
- "@eslint/object-schema": "^2.1.7",
- "debug": "^4.3.1",
- "minimatch": "^3.1.5"
- },
+ "license": "MIT",
"engines": {
- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ "node": ">=6.9.0"
}
},
- "node_modules/@eslint/config-helpers": {
- "version": "0.4.2",
- "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz",
- "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==",
+ "node_modules/@babel/helpers": {
+ "version": "7.29.2",
+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.2.tgz",
+ "integrity": "sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw==",
"dev": true,
- "license": "Apache-2.0",
+ "license": "MIT",
"dependencies": {
- "@eslint/core": "^0.17.0"
+ "@babel/template": "^7.28.6",
+ "@babel/types": "^7.29.0"
},
"engines": {
- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ "node": ">=6.9.0"
}
},
- "node_modules/@eslint/core": {
- "version": "0.17.0",
- "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz",
- "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==",
+ "node_modules/@babel/parser": {
+ "version": "7.29.3",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.3.tgz",
+ "integrity": "sha512-b3ctpQwp+PROvU/cttc4OYl4MzfJUWy6FZg+PMXfzmt/+39iHVF0sDfqay8TQM3JA2EUOyKcFZt75jWriQijsA==",
"dev": true,
- "license": "Apache-2.0",
+ "license": "MIT",
"dependencies": {
- "@types/json-schema": "^7.0.15"
+ "@babel/types": "^7.29.0"
+ },
+ "bin": {
+ "parser": "bin/babel-parser.js"
},
"engines": {
- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ "node": ">=6.0.0"
}
},
- "node_modules/@eslint/eslintrc": {
- "version": "3.3.5",
- "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.5.tgz",
- "integrity": "sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg==",
+ "node_modules/@babel/plugin-transform-react-jsx-self": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.27.1.tgz",
+ "integrity": "sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==",
"dev": true,
"license": "MIT",
"dependencies": {
- "ajv": "^6.14.0",
- "debug": "^4.3.2",
- "espree": "^10.0.1",
- "globals": "^14.0.0",
- "ignore": "^5.2.0",
- "import-fresh": "^3.2.1",
- "js-yaml": "^4.1.1",
- "minimatch": "^3.1.5",
- "strip-json-comments": "^3.1.1"
+ "@babel/helper-plugin-utils": "^7.27.1"
},
"engines": {
- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ "node": ">=6.9.0"
},
- "funding": {
- "url": "https://opencollective.com/eslint"
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
}
},
- "node_modules/@eslint/js": {
- "version": "9.39.4",
- "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.4.tgz",
- "integrity": "sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw==",
+ "node_modules/@babel/plugin-transform-react-jsx-source": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.27.1.tgz",
+ "integrity": "sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==",
"dev": true,
"license": "MIT",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.27.1"
+ },
"engines": {
- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ "node": ">=6.9.0"
},
- "funding": {
- "url": "https://eslint.org/donate"
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
}
},
- "node_modules/@eslint/object-schema": {
- "version": "2.1.7",
- "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz",
- "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==",
- "dev": true,
- "license": "Apache-2.0",
+ "node_modules/@babel/runtime": {
+ "version": "7.29.2",
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.2.tgz",
+ "integrity": "sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==",
+ "license": "MIT",
"engines": {
- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ "node": ">=6.9.0"
}
},
- "node_modules/@eslint/plugin-kit": {
- "version": "0.4.1",
- "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz",
- "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==",
+ "node_modules/@babel/template": {
+ "version": "7.28.6",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz",
+ "integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==",
"dev": true,
- "license": "Apache-2.0",
+ "license": "MIT",
"dependencies": {
- "@eslint/core": "^0.17.0",
- "levn": "^0.4.1"
+ "@babel/code-frame": "^7.28.6",
+ "@babel/parser": "^7.28.6",
+ "@babel/types": "^7.28.6"
},
"engines": {
- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ "node": ">=6.9.0"
}
},
- "node_modules/@floating-ui/core": {
- "version": "1.7.5",
- "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.5.tgz",
- "integrity": "sha512-1Ih4WTWyw0+lKyFMcBHGbb5U5FtuHJuujoyyr5zTaWS5EYMeT6Jb2AuDeftsCsEuchO+mM2ij5+q9crhydzLhQ==",
+ "node_modules/@babel/traverse": {
+ "version": "7.29.0",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz",
+ "integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "@floating-ui/utils": "^0.2.11"
+ "@babel/code-frame": "^7.29.0",
+ "@babel/generator": "^7.29.0",
+ "@babel/helper-globals": "^7.28.0",
+ "@babel/parser": "^7.29.0",
+ "@babel/template": "^7.28.6",
+ "@babel/types": "^7.29.0",
+ "debug": "^4.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
}
},
- "node_modules/@floating-ui/dom": {
- "version": "1.7.6",
- "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.6.tgz",
- "integrity": "sha512-9gZSAI5XM36880PPMm//9dfiEngYoC6Am2izES1FF406YFsjvyBMmeJ2g4SAju3xWwtuynNRFL2s9hgxpLI5SQ==",
+ "node_modules/@babel/types": {
+ "version": "7.29.0",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz",
+ "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "@floating-ui/core": "^1.7.5",
- "@floating-ui/utils": "^0.2.11"
+ "@babel/helper-string-parser": "^7.27.1",
+ "@babel/helper-validator-identifier": "^7.28.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
}
},
- "node_modules/@floating-ui/react-dom": {
- "version": "2.1.8",
- "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.8.tgz",
- "integrity": "sha512-cC52bHwM/n/CxS87FH0yWdngEZrjdtLW/qVruo68qg+prK7ZQ4YGdut2GyDVpoGeAYe/h899rVeOVm6Oi40k2A==",
- "license": "MIT",
+ "node_modules/@braintree/sanitize-url": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-7.1.2.tgz",
+ "integrity": "sha512-jigsZK+sMF/cuiB7sERuo9V7N9jx+dhmHHnQyDSVdpZwVutaBu7WvNYqMDLSgFgfB30n452TP3vjDAvFC973mA==",
+ "license": "MIT"
+ },
+ "node_modules/@chevrotain/cst-dts-gen": {
+ "version": "11.1.2",
+ "resolved": "https://registry.npmjs.org/@chevrotain/cst-dts-gen/-/cst-dts-gen-11.1.2.tgz",
+ "integrity": "sha512-XTsjvDVB5nDZBQB8o0o/0ozNelQtn2KrUVteIHSlPd2VAV2utEb6JzyCJaJ8tGxACR4RiBNWy5uYUHX2eji88Q==",
+ "license": "Apache-2.0",
"dependencies": {
- "@floating-ui/dom": "^1.7.6"
- },
- "peerDependencies": {
- "react": ">=16.8.0",
- "react-dom": ">=16.8.0"
+ "@chevrotain/gast": "11.1.2",
+ "@chevrotain/types": "11.1.2",
+ "lodash-es": "4.17.23"
}
},
- "node_modules/@floating-ui/utils": {
- "version": "0.2.11",
- "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.11.tgz",
- "integrity": "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==",
- "license": "MIT"
+ "node_modules/@chevrotain/gast": {
+ "version": "11.1.2",
+ "resolved": "https://registry.npmjs.org/@chevrotain/gast/-/gast-11.1.2.tgz",
+ "integrity": "sha512-Z9zfXR5jNZb1Hlsd/p+4XWeUFugrHirq36bKzPWDSIacV+GPSVXdk+ahVWZTwjhNwofAWg/sZg58fyucKSQx5g==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@chevrotain/types": "11.1.2",
+ "lodash-es": "4.17.23"
+ }
},
- "node_modules/@humanfs/core": {
- "version": "0.19.1",
- "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz",
- "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==",
+ "node_modules/@chevrotain/regexp-to-ast": {
+ "version": "11.1.2",
+ "resolved": "https://registry.npmjs.org/@chevrotain/regexp-to-ast/-/regexp-to-ast-11.1.2.tgz",
+ "integrity": "sha512-nMU3Uj8naWer7xpZTYJdxbAs6RIv/dxYzkYU8GSwgUtcAAlzjcPfX1w+RKRcYG8POlzMeayOQ/znfwxEGo5ulw==",
+ "license": "Apache-2.0"
+ },
+ "node_modules/@chevrotain/types": {
+ "version": "11.1.2",
+ "resolved": "https://registry.npmjs.org/@chevrotain/types/-/types-11.1.2.tgz",
+ "integrity": "sha512-U+HFai5+zmJCkK86QsaJtoITlboZHBqrVketcO2ROv865xfCMSFpELQoz1GkX5GzME8pTa+3kbKrZHQtI0gdbw==",
+ "license": "Apache-2.0"
+ },
+ "node_modules/@chevrotain/utils": {
+ "version": "11.1.2",
+ "resolved": "https://registry.npmjs.org/@chevrotain/utils/-/utils-11.1.2.tgz",
+ "integrity": "sha512-4mudFAQ6H+MqBTfqLmU7G1ZwRzCLfJEooL/fsF6rCX5eePMbGhoy5n4g+G4vlh2muDcsCTJtL+uKbOzWxs5LHA==",
+ "license": "Apache-2.0"
+ },
+ "node_modules/@csstools/color-helpers": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.1.0.tgz",
+ "integrity": "sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA==",
"dev": true,
- "license": "Apache-2.0",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/csstools"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ }
+ ],
+ "license": "MIT-0",
"engines": {
- "node": ">=18.18.0"
+ "node": ">=18"
}
},
- "node_modules/@humanfs/node": {
- "version": "0.16.7",
- "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz",
- "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==",
+ "node_modules/@csstools/css-calc": {
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.4.tgz",
+ "integrity": "sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==",
"dev": true,
- "license": "Apache-2.0",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/csstools"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ }
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "peerDependencies": {
+ "@csstools/css-parser-algorithms": "^3.0.5",
+ "@csstools/css-tokenizer": "^3.0.4"
+ }
+ },
+ "node_modules/@csstools/css-color-parser": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.1.0.tgz",
+ "integrity": "sha512-nbtKwh3a6xNVIp/VRuXV64yTKnb1IjTAEEh3irzS+HkKjAOYLTGNb9pmVNntZ8iVBHcWDA2Dof0QtPgFI1BaTA==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/csstools"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ }
+ ],
+ "license": "MIT",
"dependencies": {
- "@humanfs/core": "^0.19.1",
- "@humanwhocodes/retry": "^0.4.0"
+ "@csstools/color-helpers": "^5.1.0",
+ "@csstools/css-calc": "^2.1.4"
},
"engines": {
- "node": ">=18.18.0"
+ "node": ">=18"
+ },
+ "peerDependencies": {
+ "@csstools/css-parser-algorithms": "^3.0.5",
+ "@csstools/css-tokenizer": "^3.0.4"
}
},
- "node_modules/@humanwhocodes/module-importer": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
- "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",
+ "node_modules/@csstools/css-parser-algorithms": {
+ "version": "3.0.5",
+ "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.5.tgz",
+ "integrity": "sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==",
"dev": true,
- "license": "Apache-2.0",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/csstools"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ }
+ ],
+ "license": "MIT",
"engines": {
- "node": ">=12.22"
+ "node": ">=18"
},
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/nzakas"
+ "peerDependencies": {
+ "@csstools/css-tokenizer": "^3.0.4"
}
},
- "node_modules/@humanwhocodes/retry": {
- "version": "0.4.3",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz",
- "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==",
+ "node_modules/@csstools/css-tokenizer": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.4.tgz",
+ "integrity": "sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==",
"dev": true,
- "license": "Apache-2.0",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/csstools"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ }
+ ],
+ "license": "MIT",
"engines": {
- "node": ">=18.18"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/nzakas"
+ "node": ">=18"
}
},
- "node_modules/@iconify/types": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/@iconify/types/-/types-2.0.0.tgz",
- "integrity": "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==",
- "license": "MIT"
+ "node_modules/@emnapi/core": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.1.tgz",
+ "integrity": "sha512-mukuNALVsoix/w1BJwFzwXBN/dHeejQtuVzcDsfOEsdpCumXb/E9j8w11h5S54tT1xhifGfbbSm/ICrObRb3KA==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "@emnapi/wasi-threads": "1.2.0",
+ "tslib": "^2.4.0"
+ }
},
- "node_modules/@iconify/utils": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/@iconify/utils/-/utils-3.1.0.tgz",
- "integrity": "sha512-Zlzem1ZXhI1iHeeERabLNzBHdOa4VhQbqAcOQaMKuTuyZCpwKbC2R4Dd0Zo3g9EAc+Y4fiarO8HIHRAth7+skw==",
+ "node_modules/@emnapi/runtime": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.1.tgz",
+ "integrity": "sha512-VYi5+ZVLhpgK4hQ0TAjiQiZ6ol0oe4mBx7mVv7IflsiEp0OWoVsp/+f9Vc1hOhE0TtkORVrI1GvzyreqpgWtkA==",
"license": "MIT",
+ "optional": true,
"dependencies": {
- "@antfu/install-pkg": "^1.1.0",
- "@iconify/types": "^2.0.0",
- "mlly": "^1.8.0"
+ "tslib": "^2.4.0"
}
},
- "node_modules/@img/colour": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz",
- "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==",
+ "node_modules/@emnapi/wasi-threads": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.0.tgz",
+ "integrity": "sha512-N10dEJNSsUx41Z6pZsXU8FjPjpBEplgH24sfkmITrBED1/U2Esum9F3lfLrMjKHHjmi557zQn7kR9R+XWXu5Rg==",
+ "dev": true,
"license": "MIT",
"optional": true,
- "engines": {
- "node": ">=18"
+ "dependencies": {
+ "tslib": "^2.4.0"
}
},
- "node_modules/@img/sharp-darwin-arm64": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz",
- "integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==",
+ "node_modules/@esbuild/aix-ppc64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz",
+ "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==",
"cpu": [
- "arm64"
+ "ppc64"
],
- "license": "Apache-2.0",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
- "darwin"
+ "aix"
],
"engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-darwin-arm64": "1.2.4"
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-darwin-x64": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz",
- "integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==",
+ "node_modules/@esbuild/android-arm": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz",
+ "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==",
"cpu": [
- "x64"
+ "arm"
],
- "license": "Apache-2.0",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
- "darwin"
+ "android"
],
"engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-darwin-x64": "1.2.4"
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-libvips-darwin-arm64": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz",
- "integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==",
+ "node_modules/@esbuild/android-arm64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz",
+ "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==",
"cpu": [
"arm64"
],
- "license": "LGPL-3.0-or-later",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
- "darwin"
+ "android"
],
- "funding": {
- "url": "https://opencollective.com/libvips"
+ "engines": {
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-libvips-darwin-x64": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz",
- "integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==",
+ "node_modules/@esbuild/android-x64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz",
+ "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==",
"cpu": [
"x64"
],
- "license": "LGPL-3.0-or-later",
- "optional": true,
- "os": [
- "darwin"
- ],
- "funding": {
- "url": "https://opencollective.com/libvips"
- }
- },
- "node_modules/@img/sharp-libvips-linux-arm": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz",
- "integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==",
- "cpu": [
- "arm"
- ],
- "license": "LGPL-3.0-or-later",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
- "linux"
+ "android"
],
- "funding": {
- "url": "https://opencollective.com/libvips"
+ "engines": {
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-libvips-linux-arm64": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz",
- "integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==",
+ "node_modules/@esbuild/darwin-arm64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz",
+ "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==",
"cpu": [
"arm64"
],
- "license": "LGPL-3.0-or-later",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
- "linux"
+ "darwin"
],
- "funding": {
- "url": "https://opencollective.com/libvips"
+ "engines": {
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-libvips-linux-ppc64": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz",
- "integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==",
+ "node_modules/@esbuild/darwin-x64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz",
+ "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==",
"cpu": [
- "ppc64"
+ "x64"
],
- "license": "LGPL-3.0-or-later",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
- "linux"
+ "darwin"
],
- "funding": {
- "url": "https://opencollective.com/libvips"
+ "engines": {
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-libvips-linux-riscv64": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz",
- "integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==",
+ "node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz",
+ "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==",
"cpu": [
- "riscv64"
+ "arm64"
],
- "license": "LGPL-3.0-or-later",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
- "linux"
+ "freebsd"
],
- "funding": {
- "url": "https://opencollective.com/libvips"
+ "engines": {
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-libvips-linux-s390x": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz",
- "integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==",
+ "node_modules/@esbuild/freebsd-x64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz",
+ "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==",
"cpu": [
- "s390x"
+ "x64"
],
- "license": "LGPL-3.0-or-later",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
- "linux"
+ "freebsd"
],
- "funding": {
- "url": "https://opencollective.com/libvips"
+ "engines": {
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-libvips-linux-x64": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz",
- "integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==",
+ "node_modules/@esbuild/linux-arm": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz",
+ "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==",
"cpu": [
- "x64"
+ "arm"
],
- "license": "LGPL-3.0-or-later",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"linux"
],
- "funding": {
- "url": "https://opencollective.com/libvips"
+ "engines": {
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-libvips-linuxmusl-arm64": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz",
- "integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==",
+ "node_modules/@esbuild/linux-arm64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz",
+ "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==",
"cpu": [
"arm64"
],
- "license": "LGPL-3.0-or-later",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"linux"
],
- "funding": {
- "url": "https://opencollective.com/libvips"
+ "engines": {
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-libvips-linuxmusl-x64": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz",
- "integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==",
+ "node_modules/@esbuild/linux-ia32": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz",
+ "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==",
"cpu": [
- "x64"
+ "ia32"
],
- "license": "LGPL-3.0-or-later",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"linux"
],
- "funding": {
- "url": "https://opencollective.com/libvips"
+ "engines": {
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-linux-arm": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz",
- "integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==",
+ "node_modules/@esbuild/linux-loong64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz",
+ "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==",
"cpu": [
- "arm"
+ "loong64"
],
- "license": "Apache-2.0",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-linux-arm": "1.2.4"
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-linux-arm64": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz",
- "integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==",
+ "node_modules/@esbuild/linux-mips64el": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz",
+ "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==",
"cpu": [
- "arm64"
+ "mips64el"
],
- "license": "Apache-2.0",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-linux-arm64": "1.2.4"
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-linux-ppc64": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz",
- "integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==",
+ "node_modules/@esbuild/linux-ppc64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz",
+ "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==",
"cpu": [
"ppc64"
],
- "license": "Apache-2.0",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-linux-ppc64": "1.2.4"
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-linux-riscv64": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz",
- "integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==",
+ "node_modules/@esbuild/linux-riscv64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz",
+ "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==",
"cpu": [
"riscv64"
],
- "license": "Apache-2.0",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-linux-riscv64": "1.2.4"
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-linux-s390x": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz",
- "integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==",
+ "node_modules/@esbuild/linux-s390x": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz",
+ "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==",
"cpu": [
"s390x"
],
- "license": "Apache-2.0",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-linux-s390x": "1.2.4"
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-linux-x64": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz",
- "integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==",
+ "node_modules/@esbuild/linux-x64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz",
+ "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==",
"cpu": [
"x64"
],
- "license": "Apache-2.0",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-linux-x64": "1.2.4"
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-linuxmusl-arm64": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz",
- "integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==",
+ "node_modules/@esbuild/netbsd-x64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz",
+ "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==",
"cpu": [
- "arm64"
+ "x64"
],
- "license": "Apache-2.0",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
- "linux"
+ "netbsd"
],
"engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-linuxmusl-arm64": "1.2.4"
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-linuxmusl-x64": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz",
- "integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==",
+ "node_modules/@esbuild/openbsd-x64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz",
+ "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==",
"cpu": [
"x64"
],
- "license": "Apache-2.0",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
- "linux"
+ "openbsd"
],
"engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
- },
- "optionalDependencies": {
- "@img/sharp-libvips-linuxmusl-x64": "1.2.4"
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-wasm32": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz",
- "integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==",
+ "node_modules/@esbuild/sunos-x64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz",
+ "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==",
"cpu": [
- "wasm32"
+ "x64"
],
- "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",
+ "dev": true,
+ "license": "MIT",
"optional": true,
- "dependencies": {
- "@emnapi/runtime": "^1.7.0"
- },
+ "os": [
+ "sunos"
+ ],
"engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-win32-arm64": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz",
- "integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==",
+ "node_modules/@esbuild/win32-arm64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz",
+ "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==",
"cpu": [
"arm64"
],
- "license": "Apache-2.0 AND LGPL-3.0-or-later",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-win32-ia32": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz",
- "integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==",
+ "node_modules/@esbuild/win32-ia32": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz",
+ "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==",
"cpu": [
"ia32"
],
- "license": "Apache-2.0 AND LGPL-3.0-or-later",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
+ "node": ">=12"
}
},
- "node_modules/@img/sharp-win32-x64": {
- "version": "0.34.5",
- "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz",
- "integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==",
+ "node_modules/@esbuild/win32-x64": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz",
+ "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==",
"cpu": [
"x64"
],
- "license": "Apache-2.0 AND LGPL-3.0-or-later",
+ "dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/libvips"
+ "node": ">=12"
}
},
- "node_modules/@jridgewell/gen-mapping": {
- "version": "0.3.13",
- "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
- "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
+ "node_modules/@eslint-community/eslint-utils": {
+ "version": "4.9.1",
+ "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz",
+ "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@jridgewell/sourcemap-codec": "^1.5.0",
- "@jridgewell/trace-mapping": "^0.3.24"
+ "eslint-visitor-keys": "^3.4.3"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ },
+ "peerDependencies": {
+ "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
}
},
- "node_modules/@jridgewell/remapping": {
- "version": "2.3.5",
- "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz",
- "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==",
+ "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": {
+ "version": "3.4.3",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
+ "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
"dev": true,
- "license": "MIT",
- "dependencies": {
- "@jridgewell/gen-mapping": "^0.3.5",
- "@jridgewell/trace-mapping": "^0.3.24"
+ "license": "Apache-2.0",
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
}
},
- "node_modules/@jridgewell/resolve-uri": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
- "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
+ "node_modules/@eslint-community/regexpp": {
+ "version": "4.12.2",
+ "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz",
+ "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==",
"dev": true,
"license": "MIT",
"engines": {
- "node": ">=6.0.0"
+ "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
}
},
- "node_modules/@jridgewell/sourcemap-codec": {
- "version": "1.5.5",
- "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
- "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/@jridgewell/trace-mapping": {
- "version": "0.3.31",
- "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",
- "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",
+ "node_modules/@eslint/config-array": {
+ "version": "0.21.2",
+ "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz",
+ "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==",
"dev": true,
- "license": "MIT",
+ "license": "Apache-2.0",
"dependencies": {
- "@jridgewell/resolve-uri": "^3.1.0",
- "@jridgewell/sourcemap-codec": "^1.4.14"
+ "@eslint/object-schema": "^2.1.7",
+ "debug": "^4.3.1",
+ "minimatch": "^3.1.5"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
- "node_modules/@mdx-js/mdx": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.1.1.tgz",
- "integrity": "sha512-f6ZO2ifpwAQIpzGWaBQT2TXxPv6z3RBzQKpVftEWN78Vl/YweF1uwussDx8ECAXVtr3Rs89fKyG9YlzUs9DyGQ==",
- "license": "MIT",
+ "node_modules/@eslint/config-helpers": {
+ "version": "0.4.2",
+ "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz",
+ "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==",
+ "dev": true,
+ "license": "Apache-2.0",
"dependencies": {
- "@types/estree": "^1.0.0",
- "@types/estree-jsx": "^1.0.0",
- "@types/hast": "^3.0.0",
- "@types/mdx": "^2.0.0",
- "acorn": "^8.0.0",
- "collapse-white-space": "^2.0.0",
- "devlop": "^1.0.0",
- "estree-util-is-identifier-name": "^3.0.0",
- "estree-util-scope": "^1.0.0",
- "estree-walker": "^3.0.0",
- "hast-util-to-jsx-runtime": "^2.0.0",
- "markdown-extensions": "^2.0.0",
- "recma-build-jsx": "^1.0.0",
- "recma-jsx": "^1.0.0",
- "recma-stringify": "^1.0.0",
- "rehype-recma": "^1.0.0",
- "remark-mdx": "^3.0.0",
- "remark-parse": "^11.0.0",
- "remark-rehype": "^11.0.0",
- "source-map": "^0.7.0",
- "unified": "^11.0.0",
- "unist-util-position-from-estree": "^2.0.0",
- "unist-util-stringify-position": "^4.0.0",
- "unist-util-visit": "^5.0.0",
- "vfile": "^6.0.0"
+ "@eslint/core": "^0.17.0"
},
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/unified"
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
- "node_modules/@mdx-js/react": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/@mdx-js/react/-/react-3.1.1.tgz",
- "integrity": "sha512-f++rKLQgUVYDAtECQ6fn/is15GkEH9+nZPM3MS0RcxVqoTfawHvDlSCH7JbMhAM6uJ32v3eXLvLmLvjGu7PTQw==",
- "license": "MIT",
+ "node_modules/@eslint/core": {
+ "version": "0.17.0",
+ "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz",
+ "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==",
+ "dev": true,
+ "license": "Apache-2.0",
"dependencies": {
- "@types/mdx": "^2.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/unified"
+ "@types/json-schema": "^7.0.15"
},
- "peerDependencies": {
- "@types/react": ">=16",
- "react": ">=16"
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
- "node_modules/@mermaid-js/parser": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/@mermaid-js/parser/-/parser-1.0.1.tgz",
- "integrity": "sha512-opmV19kN1JsK0T6HhhokHpcVkqKpF+x2pPDKKM2ThHtZAB5F4PROopk0amuVYK5qMrIA4erzpNm8gmPNJgMDxQ==",
+ "node_modules/@eslint/eslintrc": {
+ "version": "3.3.5",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.5.tgz",
+ "integrity": "sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "langium": "^4.0.0"
+ "ajv": "^6.14.0",
+ "debug": "^4.3.2",
+ "espree": "^10.0.1",
+ "globals": "^14.0.0",
+ "ignore": "^5.2.0",
+ "import-fresh": "^3.2.1",
+ "js-yaml": "^4.1.1",
+ "minimatch": "^3.1.5",
+ "strip-json-comments": "^3.1.1"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
}
},
- "node_modules/@napi-rs/wasm-runtime": {
- "version": "0.2.12",
- "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.12.tgz",
- "integrity": "sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==",
+ "node_modules/@eslint/js": {
+ "version": "9.39.4",
+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.4.tgz",
+ "integrity": "sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw==",
"dev": true,
"license": "MIT",
- "optional": true,
- "dependencies": {
- "@emnapi/core": "^1.4.3",
- "@emnapi/runtime": "^1.4.3",
- "@tybys/wasm-util": "^0.10.0"
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://eslint.org/donate"
}
},
- "node_modules/@next/env": {
- "version": "16.2.1",
- "resolved": "https://registry.npmjs.org/@next/env/-/env-16.2.1.tgz",
- "integrity": "sha512-n8P/HCkIWW+gVal2Z8XqXJ6aB3J0tuM29OcHpCsobWlChH/SITBs1DFBk/HajgrwDkqqBXPbuUuzgDvUekREPg==",
- "license": "MIT",
- "peer": true
- },
- "node_modules/@next/eslint-plugin-next": {
- "version": "15.5.14",
- "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-15.5.14.tgz",
- "integrity": "sha512-ogBjgsFrPPz19abP3VwcYSahbkUOMMvJjxCOYWYndw+PydeMuLuB4XrvNkNutFrTjC9St2KFULRdKID8Sd/CMQ==",
+ "node_modules/@eslint/object-schema": {
+ "version": "2.1.7",
+ "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz",
+ "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==",
"dev": true,
- "license": "MIT",
- "dependencies": {
- "fast-glob": "3.3.1"
+ "license": "Apache-2.0",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
- "node_modules/@next/swc-darwin-arm64": {
- "version": "16.2.1",
- "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.2.1.tgz",
- "integrity": "sha512-BwZ8w8YTaSEr2HIuXLMLxIdElNMPvY9fLqb20LX9A9OMGtJilhHLbCL3ggyd0TwjmMcTxi0XXt+ur1vWUoxj2Q==",
+ "node_modules/@eslint/plugin-kit": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz",
+ "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@eslint/core": "^0.17.0",
+ "levn": "^0.4.1"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@floating-ui/core": {
+ "version": "1.7.5",
+ "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.5.tgz",
+ "integrity": "sha512-1Ih4WTWyw0+lKyFMcBHGbb5U5FtuHJuujoyyr5zTaWS5EYMeT6Jb2AuDeftsCsEuchO+mM2ij5+q9crhydzLhQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@floating-ui/utils": "^0.2.11"
+ }
+ },
+ "node_modules/@floating-ui/dom": {
+ "version": "1.7.6",
+ "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.6.tgz",
+ "integrity": "sha512-9gZSAI5XM36880PPMm//9dfiEngYoC6Am2izES1FF406YFsjvyBMmeJ2g4SAju3xWwtuynNRFL2s9hgxpLI5SQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@floating-ui/core": "^1.7.5",
+ "@floating-ui/utils": "^0.2.11"
+ }
+ },
+ "node_modules/@floating-ui/react-dom": {
+ "version": "2.1.8",
+ "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.8.tgz",
+ "integrity": "sha512-cC52bHwM/n/CxS87FH0yWdngEZrjdtLW/qVruo68qg+prK7ZQ4YGdut2GyDVpoGeAYe/h899rVeOVm6Oi40k2A==",
+ "license": "MIT",
+ "dependencies": {
+ "@floating-ui/dom": "^1.7.6"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@floating-ui/utils": {
+ "version": "0.2.11",
+ "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.11.tgz",
+ "integrity": "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==",
+ "license": "MIT"
+ },
+ "node_modules/@humanfs/core": {
+ "version": "0.19.1",
+ "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz",
+ "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=18.18.0"
+ }
+ },
+ "node_modules/@humanfs/node": {
+ "version": "0.16.7",
+ "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz",
+ "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@humanfs/core": "^0.19.1",
+ "@humanwhocodes/retry": "^0.4.0"
+ },
+ "engines": {
+ "node": ">=18.18.0"
+ }
+ },
+ "node_modules/@humanwhocodes/module-importer": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
+ "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=12.22"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/nzakas"
+ }
+ },
+ "node_modules/@humanwhocodes/retry": {
+ "version": "0.4.3",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz",
+ "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=18.18"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/nzakas"
+ }
+ },
+ "node_modules/@iconify/types": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@iconify/types/-/types-2.0.0.tgz",
+ "integrity": "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==",
+ "license": "MIT"
+ },
+ "node_modules/@iconify/utils": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/@iconify/utils/-/utils-3.1.0.tgz",
+ "integrity": "sha512-Zlzem1ZXhI1iHeeERabLNzBHdOa4VhQbqAcOQaMKuTuyZCpwKbC2R4Dd0Zo3g9EAc+Y4fiarO8HIHRAth7+skw==",
+ "license": "MIT",
+ "dependencies": {
+ "@antfu/install-pkg": "^1.1.0",
+ "@iconify/types": "^2.0.0",
+ "mlly": "^1.8.0"
+ }
+ },
+ "node_modules/@img/colour": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz",
+ "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@img/sharp-darwin-arm64": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz",
+ "integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==",
"cpu": [
"arm64"
],
- "license": "MIT",
+ "license": "Apache-2.0",
"optional": true,
"os": [
"darwin"
],
"peer": true,
"engines": {
- "node": ">= 10"
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-darwin-arm64": "1.2.4"
}
},
- "node_modules/@next/swc-darwin-x64": {
- "version": "16.2.1",
- "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.2.1.tgz",
- "integrity": "sha512-/vrcE6iQSJq3uL3VGVHiXeaKbn8Es10DGTGRJnRZlkNQQk3kaNtAJg8Y6xuAlrx/6INKVjkfi5rY0iEXorZ6uA==",
+ "node_modules/@img/sharp-darwin-x64": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz",
+ "integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==",
"cpu": [
"x64"
],
- "license": "MIT",
+ "license": "Apache-2.0",
"optional": true,
"os": [
"darwin"
],
"peer": true,
"engines": {
- "node": ">= 10"
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-darwin-x64": "1.2.4"
}
},
- "node_modules/@next/swc-linux-arm64-gnu": {
- "version": "16.2.1",
- "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.2.1.tgz",
- "integrity": "sha512-uLn+0BK+C31LTVbQ/QU+UaVrV0rRSJQ8RfniQAHPghDdgE+SlroYqcmFnO5iNjNfVWCyKZHYrs3Nl0mUzWxbBw==",
+ "node_modules/@img/sharp-libvips-darwin-arm64": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz",
+ "integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==",
"cpu": [
"arm64"
],
- "license": "MIT",
+ "license": "LGPL-3.0-or-later",
"optional": true,
"os": [
- "linux"
+ "darwin"
],
"peer": true,
- "engines": {
- "node": ">= 10"
+ "funding": {
+ "url": "https://opencollective.com/libvips"
}
},
- "node_modules/@next/swc-linux-arm64-musl": {
- "version": "16.2.1",
- "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.2.1.tgz",
- "integrity": "sha512-ssKq6iMRnHdnycGp9hCuGnXJZ0YPr4/wNwrfE5DbmvEcgl9+yv97/Kq3TPVDfYome1SW5geciLB9aiEqKXQjlQ==",
+ "node_modules/@img/sharp-libvips-darwin-x64": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz",
+ "integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==",
"cpu": [
- "arm64"
+ "x64"
],
- "license": "MIT",
+ "license": "LGPL-3.0-or-later",
"optional": true,
"os": [
- "linux"
+ "darwin"
],
"peer": true,
- "engines": {
- "node": ">= 10"
+ "funding": {
+ "url": "https://opencollective.com/libvips"
}
},
- "node_modules/@next/swc-linux-x64-gnu": {
- "version": "16.2.1",
- "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.2.1.tgz",
- "integrity": "sha512-HQm7SrHRELJ30T1TSmT706IWovFFSRGxfgUkyWJZF/RKBMdbdRWJuFrcpDdE5vy9UXjFOx6L3mRdqH04Mmx0hg==",
+ "node_modules/@img/sharp-libvips-linux-arm": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz",
+ "integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==",
"cpu": [
- "x64"
+ "arm"
],
- "license": "MIT",
+ "license": "LGPL-3.0-or-later",
"optional": true,
"os": [
"linux"
],
"peer": true,
- "engines": {
- "node": ">= 10"
+ "funding": {
+ "url": "https://opencollective.com/libvips"
}
},
- "node_modules/@next/swc-linux-x64-musl": {
- "version": "16.2.1",
- "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.2.1.tgz",
- "integrity": "sha512-aV2iUaC/5HGEpbBkE+4B8aHIudoOy5DYekAKOMSHoIYQ66y/wIVeaRx8MS2ZMdxe/HIXlMho4ubdZs/J8441Tg==",
+ "node_modules/@img/sharp-libvips-linux-arm64": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz",
+ "integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==",
"cpu": [
- "x64"
+ "arm64"
],
- "license": "MIT",
+ "license": "LGPL-3.0-or-later",
"optional": true,
"os": [
"linux"
],
"peer": true,
- "engines": {
- "node": ">= 10"
+ "funding": {
+ "url": "https://opencollective.com/libvips"
}
},
- "node_modules/@next/swc-win32-arm64-msvc": {
- "version": "16.2.1",
- "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.2.1.tgz",
- "integrity": "sha512-IXdNgiDHaSk0ZUJ+xp0OQTdTgnpx1RCfRTalhn3cjOP+IddTMINwA7DXZrwTmGDO8SUr5q2hdP/du4DcrB1GxA==",
+ "node_modules/@img/sharp-libvips-linux-ppc64": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz",
+ "integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==",
"cpu": [
- "arm64"
+ "ppc64"
],
- "license": "MIT",
+ "license": "LGPL-3.0-or-later",
"optional": true,
"os": [
- "win32"
+ "linux"
],
"peer": true,
- "engines": {
- "node": ">= 10"
+ "funding": {
+ "url": "https://opencollective.com/libvips"
}
},
- "node_modules/@next/swc-win32-x64-msvc": {
- "version": "16.2.1",
- "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.2.1.tgz",
- "integrity": "sha512-qvU+3a39Hay+ieIztkGSbF7+mccbbg1Tk25hc4JDylf8IHjYmY/Zm64Qq1602yPyQqvie+vf5T/uPwNxDNIoeg==",
- "cpu": [
+ "node_modules/@img/sharp-libvips-linux-riscv64": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz",
+ "integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==",
+ "cpu": [
+ "riscv64"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "peer": true,
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linux-s390x": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz",
+ "integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==",
+ "cpu": [
+ "s390x"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "peer": true,
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linux-x64": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz",
+ "integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "peer": true,
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linuxmusl-arm64": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz",
+ "integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "peer": true,
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linuxmusl-x64": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz",
+ "integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "peer": true,
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-linux-arm": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz",
+ "integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==",
+ "cpu": [
+ "arm"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "peer": true,
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linux-arm": "1.2.4"
+ }
+ },
+ "node_modules/@img/sharp-linux-arm64": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz",
+ "integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "peer": true,
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linux-arm64": "1.2.4"
+ }
+ },
+ "node_modules/@img/sharp-linux-ppc64": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz",
+ "integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "peer": true,
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linux-ppc64": "1.2.4"
+ }
+ },
+ "node_modules/@img/sharp-linux-riscv64": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz",
+ "integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==",
+ "cpu": [
+ "riscv64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "peer": true,
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linux-riscv64": "1.2.4"
+ }
+ },
+ "node_modules/@img/sharp-linux-s390x": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz",
+ "integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==",
+ "cpu": [
+ "s390x"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "peer": true,
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linux-s390x": "1.2.4"
+ }
+ },
+ "node_modules/@img/sharp-linux-x64": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz",
+ "integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "peer": true,
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linux-x64": "1.2.4"
+ }
+ },
+ "node_modules/@img/sharp-linuxmusl-arm64": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz",
+ "integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "peer": true,
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linuxmusl-arm64": "1.2.4"
+ }
+ },
+ "node_modules/@img/sharp-linuxmusl-x64": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz",
+ "integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "peer": true,
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linuxmusl-x64": "1.2.4"
+ }
+ },
+ "node_modules/@img/sharp-wasm32": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz",
+ "integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==",
+ "cpu": [
+ "wasm32"
+ ],
+ "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",
+ "optional": true,
+ "peer": true,
+ "dependencies": {
+ "@emnapi/runtime": "^1.7.0"
+ },
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-win32-arm64": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz",
+ "integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "Apache-2.0 AND LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "peer": true,
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-win32-ia32": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz",
+ "integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==",
+ "cpu": [
+ "ia32"
+ ],
+ "license": "Apache-2.0 AND LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "peer": true,
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-win32-x64": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz",
+ "integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "Apache-2.0 AND LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "peer": true,
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@jridgewell/gen-mapping": {
+ "version": "0.3.13",
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
+ "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.5.0",
+ "@jridgewell/trace-mapping": "^0.3.24"
+ }
+ },
+ "node_modules/@jridgewell/remapping": {
+ "version": "2.3.5",
+ "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz",
+ "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/gen-mapping": "^0.3.5",
+ "@jridgewell/trace-mapping": "^0.3.24"
+ }
+ },
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.5.5",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
+ "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.31",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",
+ "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.1.0",
+ "@jridgewell/sourcemap-codec": "^1.4.14"
+ }
+ },
+ "node_modules/@mdx-js/mdx": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.1.1.tgz",
+ "integrity": "sha512-f6ZO2ifpwAQIpzGWaBQT2TXxPv6z3RBzQKpVftEWN78Vl/YweF1uwussDx8ECAXVtr3Rs89fKyG9YlzUs9DyGQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "^1.0.0",
+ "@types/estree-jsx": "^1.0.0",
+ "@types/hast": "^3.0.0",
+ "@types/mdx": "^2.0.0",
+ "acorn": "^8.0.0",
+ "collapse-white-space": "^2.0.0",
+ "devlop": "^1.0.0",
+ "estree-util-is-identifier-name": "^3.0.0",
+ "estree-util-scope": "^1.0.0",
+ "estree-walker": "^3.0.0",
+ "hast-util-to-jsx-runtime": "^2.0.0",
+ "markdown-extensions": "^2.0.0",
+ "recma-build-jsx": "^1.0.0",
+ "recma-jsx": "^1.0.0",
+ "recma-stringify": "^1.0.0",
+ "rehype-recma": "^1.0.0",
+ "remark-mdx": "^3.0.0",
+ "remark-parse": "^11.0.0",
+ "remark-rehype": "^11.0.0",
+ "source-map": "^0.7.0",
+ "unified": "^11.0.0",
+ "unist-util-position-from-estree": "^2.0.0",
+ "unist-util-stringify-position": "^4.0.0",
+ "unist-util-visit": "^5.0.0",
+ "vfile": "^6.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/@mdx-js/react": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/@mdx-js/react/-/react-3.1.1.tgz",
+ "integrity": "sha512-f++rKLQgUVYDAtECQ6fn/is15GkEH9+nZPM3MS0RcxVqoTfawHvDlSCH7JbMhAM6uJ32v3eXLvLmLvjGu7PTQw==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/mdx": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ },
+ "peerDependencies": {
+ "@types/react": ">=16",
+ "react": ">=16"
+ }
+ },
+ "node_modules/@mermaid-js/parser": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@mermaid-js/parser/-/parser-1.0.1.tgz",
+ "integrity": "sha512-opmV19kN1JsK0T6HhhokHpcVkqKpF+x2pPDKKM2ThHtZAB5F4PROopk0amuVYK5qMrIA4erzpNm8gmPNJgMDxQ==",
+ "license": "MIT",
+ "dependencies": {
+ "langium": "^4.0.0"
+ }
+ },
+ "node_modules/@napi-rs/wasm-runtime": {
+ "version": "0.2.12",
+ "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.12.tgz",
+ "integrity": "sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "@emnapi/core": "^1.4.3",
+ "@emnapi/runtime": "^1.4.3",
+ "@tybys/wasm-util": "^0.10.0"
+ }
+ },
+ "node_modules/@next/env": {
+ "version": "16.2.1",
+ "resolved": "https://registry.npmjs.org/@next/env/-/env-16.2.1.tgz",
+ "integrity": "sha512-n8P/HCkIWW+gVal2Z8XqXJ6aB3J0tuM29OcHpCsobWlChH/SITBs1DFBk/HajgrwDkqqBXPbuUuzgDvUekREPg==",
+ "license": "MIT",
+ "peer": true
+ },
+ "node_modules/@next/eslint-plugin-next": {
+ "version": "15.5.14",
+ "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-15.5.14.tgz",
+ "integrity": "sha512-ogBjgsFrPPz19abP3VwcYSahbkUOMMvJjxCOYWYndw+PydeMuLuB4XrvNkNutFrTjC9St2KFULRdKID8Sd/CMQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fast-glob": "3.3.1"
+ }
+ },
+ "node_modules/@next/swc-darwin-arm64": {
+ "version": "16.2.1",
+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.2.1.tgz",
+ "integrity": "sha512-BwZ8w8YTaSEr2HIuXLMLxIdElNMPvY9fLqb20LX9A9OMGtJilhHLbCL3ggyd0TwjmMcTxi0XXt+ur1vWUoxj2Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "peer": true,
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-darwin-x64": {
+ "version": "16.2.1",
+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.2.1.tgz",
+ "integrity": "sha512-/vrcE6iQSJq3uL3VGVHiXeaKbn8Es10DGTGRJnRZlkNQQk3kaNtAJg8Y6xuAlrx/6INKVjkfi5rY0iEXorZ6uA==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "peer": true,
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-linux-arm64-gnu": {
+ "version": "16.2.1",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.2.1.tgz",
+ "integrity": "sha512-uLn+0BK+C31LTVbQ/QU+UaVrV0rRSJQ8RfniQAHPghDdgE+SlroYqcmFnO5iNjNfVWCyKZHYrs3Nl0mUzWxbBw==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "peer": true,
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-linux-arm64-musl": {
+ "version": "16.2.1",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.2.1.tgz",
+ "integrity": "sha512-ssKq6iMRnHdnycGp9hCuGnXJZ0YPr4/wNwrfE5DbmvEcgl9+yv97/Kq3TPVDfYome1SW5geciLB9aiEqKXQjlQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "peer": true,
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-linux-x64-gnu": {
+ "version": "16.2.1",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.2.1.tgz",
+ "integrity": "sha512-HQm7SrHRELJ30T1TSmT706IWovFFSRGxfgUkyWJZF/RKBMdbdRWJuFrcpDdE5vy9UXjFOx6L3mRdqH04Mmx0hg==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "peer": true,
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-linux-x64-musl": {
+ "version": "16.2.1",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.2.1.tgz",
+ "integrity": "sha512-aV2iUaC/5HGEpbBkE+4B8aHIudoOy5DYekAKOMSHoIYQ66y/wIVeaRx8MS2ZMdxe/HIXlMho4ubdZs/J8441Tg==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "peer": true,
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-win32-arm64-msvc": {
+ "version": "16.2.1",
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.2.1.tgz",
+ "integrity": "sha512-IXdNgiDHaSk0ZUJ+xp0OQTdTgnpx1RCfRTalhn3cjOP+IddTMINwA7DXZrwTmGDO8SUr5q2hdP/du4DcrB1GxA==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "peer": true,
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-win32-x64-msvc": {
+ "version": "16.2.1",
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.2.1.tgz",
+ "integrity": "sha512-qvU+3a39Hay+ieIztkGSbF7+mccbbg1Tk25hc4JDylf8IHjYmY/Zm64Qq1602yPyQqvie+vf5T/uPwNxDNIoeg==",
+ "cpu": [
"x64"
],
"license": "MIT",
@@ -2314,7 +3164,73 @@
"integrity": "sha512-Qp8WbZOBe+blgpuUT+lw2xheLP8q0oatc9UpmiemEICxGvFLYmHm9QowVZGHtJlGbS6A6yJ3iViad/2cVjnOiA==",
"license": "MIT",
"dependencies": {
- "@radix-ui/react-use-layout-effect": "1.1.1"
+ "@radix-ui/react-use-layout-effect": "1.1.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-escape-keydown": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.1.1.tgz",
+ "integrity": "sha512-Il0+boE7w/XebUHyBjroE+DbByORGR9KKmITzbR7MyQ4akpORYP/ZmbhAr0DG7RmmBqoOnZdy2QlvajJ2QA59g==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/react-use-callback-ref": "1.1.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-layout-effect": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.1.tgz",
+ "integrity": "sha512-RbJRS4UWQFkzHTTwVymMTUv8EqYhOp8dOOviLj2ugtTiXRaRQS7GLGxZTLL1jWhMeoSCf5zmcZkqTl9IiYfXcQ==",
+ "license": "MIT",
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-previous": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-previous/-/react-use-previous-1.1.1.tgz",
+ "integrity": "sha512-2dHfToCj/pzca2Ck724OZ5L0EVrr3eHRNsG/b3xQJLA2hZpVCS99bLAX+hm1IHXDEnzU6by5z/5MIY794/a8NQ==",
+ "license": "MIT",
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-rect": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-rect/-/react-use-rect-1.1.1.tgz",
+ "integrity": "sha512-QTYuDesS0VtuHNNvMh+CjlKJ4LJickCMUAqjlE3+j8w+RlRpwyX3apEQKGFzbZGdo7XNG1tXa+bQqIE7HIXT2w==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/rect": "1.1.1"
},
"peerDependencies": {
"@types/react": "*",
@@ -2326,13 +3242,13 @@
}
}
},
- "node_modules/@radix-ui/react-use-escape-keydown": {
+ "node_modules/@radix-ui/react-use-size": {
"version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.1.1.tgz",
- "integrity": "sha512-Il0+boE7w/XebUHyBjroE+DbByORGR9KKmITzbR7MyQ4akpORYP/ZmbhAr0DG7RmmBqoOnZdy2QlvajJ2QA59g==",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-size/-/react-use-size-1.1.1.tgz",
+ "integrity": "sha512-ewrXRDTAqAXlkl6t/fkXWNAhFX9I+CkKlw6zjEwk86RSPKwZr3xpBRso655aqYafwtnbpHLj6toFzmd6xdVptQ==",
"license": "MIT",
"dependencies": {
- "@radix-ui/react-use-callback-ref": "1.1.1"
+ "@radix-ui/react-use-layout-effect": "1.1.1"
},
"peerDependencies": {
"@types/react": "*",
@@ -2344,100 +3260,435 @@
}
}
},
- "node_modules/@radix-ui/react-use-layout-effect": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.1.tgz",
- "integrity": "sha512-RbJRS4UWQFkzHTTwVymMTUv8EqYhOp8dOOviLj2ugtTiXRaRQS7GLGxZTLL1jWhMeoSCf5zmcZkqTl9IiYfXcQ==",
+ "node_modules/@radix-ui/react-visually-hidden": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.2.3.tgz",
+ "integrity": "sha512-pzJq12tEaaIhqjbzpCuv/OypJY/BPavOofm+dbab+MHLajy277+1lLm6JFcGgF5eskJ6mquGirhXY2GD/8u8Ug==",
"license": "MIT",
+ "dependencies": {
+ "@radix-ui/react-primitive": "2.1.3"
+ },
"peerDependencies": {
"@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
}
}
},
- "node_modules/@radix-ui/react-use-previous": {
+ "node_modules/@radix-ui/rect": {
"version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-previous/-/react-use-previous-1.1.1.tgz",
- "integrity": "sha512-2dHfToCj/pzca2Ck724OZ5L0EVrr3eHRNsG/b3xQJLA2hZpVCS99bLAX+hm1IHXDEnzU6by5z/5MIY794/a8NQ==",
+ "resolved": "https://registry.npmjs.org/@radix-ui/rect/-/rect-1.1.1.tgz",
+ "integrity": "sha512-HPwpGIzkl28mWyZqG52jiqDJ12waP11Pa1lGoiyUkIEuMLBP0oeK/C89esbXrxsky5we7dfd8U58nm0SgAWpVw==",
+ "license": "MIT"
+ },
+ "node_modules/@reduxjs/toolkit": {
+ "version": "2.11.2",
+ "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-2.11.2.tgz",
+ "integrity": "sha512-Kd6kAHTA6/nUpp8mySPqj3en3dm0tdMIgbttnQ1xFMVpufoj+ADi8pXLBsd4xzTRHQa7t/Jv8W5UnCuW4kuWMQ==",
"license": "MIT",
+ "dependencies": {
+ "@standard-schema/spec": "^1.0.0",
+ "@standard-schema/utils": "^0.3.0",
+ "immer": "^11.0.0",
+ "redux": "^5.0.1",
+ "redux-thunk": "^3.1.0",
+ "reselect": "^5.1.0"
+ },
"peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ "react": "^16.9.0 || ^17.0.0 || ^18 || ^19",
+ "react-redux": "^7.2.1 || ^8.1.3 || ^9.0.0"
},
"peerDependenciesMeta": {
- "@types/react": {
+ "react": {
+ "optional": true
+ },
+ "react-redux": {
"optional": true
}
}
},
- "node_modules/@radix-ui/react-use-rect": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-rect/-/react-use-rect-1.1.1.tgz",
- "integrity": "sha512-QTYuDesS0VtuHNNvMh+CjlKJ4LJickCMUAqjlE3+j8w+RlRpwyX3apEQKGFzbZGdo7XNG1tXa+bQqIE7HIXT2w==",
+ "node_modules/@reduxjs/toolkit/node_modules/immer": {
+ "version": "11.1.4",
+ "resolved": "https://registry.npmjs.org/immer/-/immer-11.1.4.tgz",
+ "integrity": "sha512-XREFCPo6ksxVzP4E0ekD5aMdf8WMwmdNaz6vuvxgI40UaEiu6q3p8X52aU6GdyvLY3XXX/8R7JOTXStz/nBbRw==",
+ "license": "MIT",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/immer"
+ }
+ },
+ "node_modules/@repowise-dev/types": {
+ "resolved": "packages/types",
+ "link": true
+ },
+ "node_modules/@repowise-dev/ui": {
+ "resolved": "packages/ui",
+ "link": true
+ },
+ "node_modules/@rolldown/pluginutils": {
+ "version": "1.0.0-beta.27",
+ "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz",
+ "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@rollup/rollup-android-arm-eabi": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.60.2.tgz",
+ "integrity": "sha512-dnlp69efPPg6Uaw2dVqzWRfAWRnYVb1XJ8CyyhIbZeaq4CA5/mLeZ1IEt9QqQxmbdvagjLIm2ZL8BxXv5lH4Yw==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-android-arm64": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.60.2.tgz",
+ "integrity": "sha512-OqZTwDRDchGRHHm/hwLOL7uVPB9aUvI0am/eQuWMNyFHf5PSEQmyEeYYheA0EPPKUO/l0uigCp+iaTjoLjVoHg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-arm64": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.60.2.tgz",
+ "integrity": "sha512-UwRE7CGpvSVEQS8gUMBe1uADWjNnVgP3Iusyda1nSRwNDCsRjnGc7w6El6WLQsXmZTbLZx9cecegumcitNfpmA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-x64": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.60.2.tgz",
+ "integrity": "sha512-gjEtURKLCC5VXm1I+2i1u9OhxFsKAQJKTVB8WvDAHF+oZlq0GTVFOlTlO1q3AlCTE/DF32c16ESvfgqR7343/g==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-arm64": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.60.2.tgz",
+ "integrity": "sha512-Bcl6CYDeAgE70cqZaMojOi/eK63h5Me97ZqAQoh77VPjMysA/4ORQBRGo3rRy45x4MzVlU9uZxs8Uwy7ZaKnBw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-x64": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.60.2.tgz",
+ "integrity": "sha512-LU+TPda3mAE2QB0/Hp5VyeKJivpC6+tlOXd1VMoXV/YFMvk/MNk5iXeBfB4MQGRWyOYVJ01625vjkr0Az98OJQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.60.2.tgz",
+ "integrity": "sha512-2QxQrM+KQ7DAW4o22j+XZ6RKdxjLD7BOWTP0Bv0tmjdyhXSsr2Ul1oJDQqh9Zf5qOwTuTc7Ek83mOFaKnodPjg==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-musleabihf": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.60.2.tgz",
+ "integrity": "sha512-TbziEu2DVsTEOPif2mKWkMeDMLoYjx95oESa9fkQQK7r/Orta0gnkcDpzwufEcAO2BLBsD7mZkXGFqEdMRRwfw==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-gnu": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.60.2.tgz",
+ "integrity": "sha512-bO/rVDiDUuM2YfuCUwZ1t1cP+/yqjqz+Xf2VtkdppefuOFS2OSeAfgafaHNkFn0t02hEyXngZkxtGqXcXwO8Rg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-musl": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.60.2.tgz",
+ "integrity": "sha512-hr26p7e93Rl0Za+JwW7EAnwAvKkehh12BU1Llm9Ykiibg4uIr2rbpxG9WCf56GuvidlTG9KiiQT/TXT1yAWxTA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-loong64-gnu": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.60.2.tgz",
+ "integrity": "sha512-pOjB/uSIyDt+ow3k/RcLvUAOGpysT2phDn7TTUB3n75SlIgZzM6NKAqlErPhoFU+npgY3/n+2HYIQVbF70P9/A==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-loong64-musl": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.60.2.tgz",
+ "integrity": "sha512-2/w+q8jszv9Ww1c+6uJT3OwqhdmGP2/4T17cu8WuwyUuuaCDDJ2ojdyYwZzCxx0GcsZBhzi3HmH+J5pZNXnd+Q==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-ppc64-gnu": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.60.2.tgz",
+ "integrity": "sha512-11+aL5vKheYgczxtPVVRhdptAM2H7fcDR5Gw4/bTcteuZBlH4oP9f5s9zYO9aGZvoGeBpqXI/9TZZihZ609wKw==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-ppc64-musl": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.60.2.tgz",
+ "integrity": "sha512-i16fokAGK46IVZuV8LIIwMdtqhin9hfYkCh8pf8iC3QU3LpwL+1FSFGej+O7l3E/AoknL6Dclh2oTdnRMpTzFQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-gnu": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.60.2.tgz",
+ "integrity": "sha512-49FkKS6RGQoriDSK/6E2GkAsAuU5kETFCh7pG4yD/ylj9rKhTmO3elsnmBvRD4PgJPds5W2PkhC82aVwmUcJ7A==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-musl": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.60.2.tgz",
+ "integrity": "sha512-mjYNkHPfGpUR00DuM1ZZIgs64Hpf4bWcz9Z41+4Q+pgDx73UwWdAYyf6EG/lRFldmdHHzgrYyge5akFUW0D3mQ==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-s390x-gnu": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.60.2.tgz",
+ "integrity": "sha512-ALyvJz965BQk8E9Al/JDKKDLH2kfKFLTGMlgkAbbYtZuJt9LU8DW3ZoDMCtQpXAltZxwBHevXz5u+gf0yA0YoA==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-gnu": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.60.2.tgz",
+ "integrity": "sha512-UQjrkIdWrKI626Du8lCQ6MJp/6V1LAo2bOK9OTu4mSn8GGXIkPXk/Vsp4bLHCd9Z9Iz2OTEaokUE90VweJgIYQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-musl": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.60.2.tgz",
+ "integrity": "sha512-bTsRGj6VlSdn/XD4CGyzMnzaBs9bsRxy79eTqTCBsA8TMIEky7qg48aPkvJvFe1HyzQ5oMZdg7AnVlWQSKLTnw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-openbsd-x64": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.60.2.tgz",
+ "integrity": "sha512-6d4Z3534xitaA1FcMWP7mQPq5zGwBmGbhphh2DwaA1aNIXUu3KTOfwrWpbwI4/Gr0uANo7NTtaykFyO2hPuFLg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-openharmony-arm64": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.60.2.tgz",
+ "integrity": "sha512-NetAg5iO2uN7eB8zE5qrZ3CSil+7IJt4WDFLcC75Ymywq1VZVD6qJ6EvNLjZ3rEm6gB7XW5JdT60c6MN35Z85Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
"license": "MIT",
- "dependencies": {
- "@radix-ui/rect": "1.1.1"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
+ "optional": true,
+ "os": [
+ "openharmony"
+ ]
},
- "node_modules/@radix-ui/react-use-size": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-size/-/react-use-size-1.1.1.tgz",
- "integrity": "sha512-ewrXRDTAqAXlkl6t/fkXWNAhFX9I+CkKlw6zjEwk86RSPKwZr3xpBRso655aqYafwtnbpHLj6toFzmd6xdVptQ==",
+ "node_modules/@rollup/rollup-win32-arm64-msvc": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.60.2.tgz",
+ "integrity": "sha512-NCYhOotpgWZ5kdxCZsv6Iudx0wX8980Q/oW4pNFNihpBKsDbEA1zpkfxJGC0yugsUuyDZ7gL37dbzwhR0VI7pQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
"license": "MIT",
- "dependencies": {
- "@radix-ui/react-use-layout-effect": "1.1.1"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
+ "optional": true,
+ "os": [
+ "win32"
+ ]
},
- "node_modules/@radix-ui/react-visually-hidden": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.2.3.tgz",
- "integrity": "sha512-pzJq12tEaaIhqjbzpCuv/OypJY/BPavOofm+dbab+MHLajy277+1lLm6JFcGgF5eskJ6mquGirhXY2GD/8u8Ug==",
+ "node_modules/@rollup/rollup-win32-ia32-msvc": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.60.2.tgz",
+ "integrity": "sha512-RXsaOqXxfoUBQoOgvmmijVxJnW2IGB0eoMO7F8FAjaj0UTywUO/luSqimWBJn04WNgUkeNhh7fs7pESXajWmkg==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
"license": "MIT",
- "dependencies": {
- "@radix-ui/react-primitive": "2.1.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
+ "optional": true,
+ "os": [
+ "win32"
+ ]
},
- "node_modules/@radix-ui/rect": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@radix-ui/rect/-/rect-1.1.1.tgz",
- "integrity": "sha512-HPwpGIzkl28mWyZqG52jiqDJ12waP11Pa1lGoiyUkIEuMLBP0oeK/C89esbXrxsky5we7dfd8U58nm0SgAWpVw==",
- "license": "MIT"
+ "node_modules/@rollup/rollup-win32-x64-gnu": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.60.2.tgz",
+ "integrity": "sha512-qdAzEULD+/hzObedtmV6iBpdL5TIbKVztGiK7O3/KYSf+HIzU257+MX1EXJcyIiDbMAqmbwaufcYPvyRryeZtA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-msvc": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.60.2.tgz",
+ "integrity": "sha512-Nd/SgG27WoA9e+/TdK74KnHz852TLa94ovOYySo/yMPuTmpckK/jIF2jSwS3g7ELSKXK13/cVdmg1Z/DaCWKxA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
},
"node_modules/@rtsao/scc": {
"version": "1.1.0",
@@ -2528,6 +3779,12 @@
"integrity": "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==",
"license": "MIT"
},
+ "node_modules/@standard-schema/utils": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/@standard-schema/utils/-/utils-0.3.0.tgz",
+ "integrity": "sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==",
+ "license": "MIT"
+ },
"node_modules/@swc/helpers": {
"version": "0.5.15",
"resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz",
@@ -2821,6 +4078,93 @@
"tailwindcss": ">=3.0.0 || insiders || >=4.0.0-alpha.20 || >=4.0.0-beta.1"
}
},
+ "node_modules/@testing-library/dom": {
+ "version": "10.4.1",
+ "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.1.tgz",
+ "integrity": "sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "@babel/code-frame": "^7.10.4",
+ "@babel/runtime": "^7.12.5",
+ "@types/aria-query": "^5.0.1",
+ "aria-query": "5.3.0",
+ "dom-accessibility-api": "^0.5.9",
+ "lz-string": "^1.5.0",
+ "picocolors": "1.1.1",
+ "pretty-format": "^27.0.2"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@testing-library/dom/node_modules/aria-query": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz",
+ "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "peer": true,
+ "dependencies": {
+ "dequal": "^2.0.3"
+ }
+ },
+ "node_modules/@testing-library/jest-dom": {
+ "version": "6.9.1",
+ "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.9.1.tgz",
+ "integrity": "sha512-zIcONa+hVtVSSep9UT3jZ5rizo2BsxgyDYU7WFD5eICBE7no3881HGeb/QkGfsJs6JTkY1aQhT7rIPC7e+0nnA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@adobe/css-tools": "^4.4.0",
+ "aria-query": "^5.0.0",
+ "css.escape": "^1.5.1",
+ "dom-accessibility-api": "^0.6.3",
+ "picocolors": "^1.1.1",
+ "redent": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=14",
+ "npm": ">=6",
+ "yarn": ">=1"
+ }
+ },
+ "node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api": {
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz",
+ "integrity": "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@testing-library/react": {
+ "version": "16.3.2",
+ "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-16.3.2.tgz",
+ "integrity": "sha512-XU5/SytQM+ykqMnAnvB2umaJNIOsLF3PVv//1Ew4CTcpz0/BRyy/af40qqrt7SjKpDdT1saBMc42CUok5gaw+g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/runtime": "^7.12.5"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "peerDependencies": {
+ "@testing-library/dom": "^10.0.0",
+ "@types/react": "^18.0.0 || ^19.0.0",
+ "@types/react-dom": "^18.0.0 || ^19.0.0",
+ "react": "^18.0.0 || ^19.0.0",
+ "react-dom": "^18.0.0 || ^19.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@tybys/wasm-util": {
"version": "0.10.1",
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz",
@@ -2832,6 +4176,59 @@
"tslib": "^2.4.0"
}
},
+ "node_modules/@types/aria-query": {
+ "version": "5.0.4",
+ "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz",
+ "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true
+ },
+ "node_modules/@types/babel__core": {
+ "version": "7.20.5",
+ "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz",
+ "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/parser": "^7.20.7",
+ "@babel/types": "^7.20.7",
+ "@types/babel__generator": "*",
+ "@types/babel__template": "*",
+ "@types/babel__traverse": "*"
+ }
+ },
+ "node_modules/@types/babel__generator": {
+ "version": "7.27.0",
+ "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz",
+ "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "node_modules/@types/babel__template": {
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz",
+ "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/parser": "^7.1.0",
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "node_modules/@types/babel__traverse": {
+ "version": "7.28.0",
+ "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz",
+ "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.28.2"
+ }
+ },
"node_modules/@types/d3": {
"version": "7.4.3",
"resolved": "https://registry.npmjs.org/@types/d3/-/d3-7.4.3.tgz",
@@ -3201,6 +4598,12 @@
"integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==",
"license": "MIT"
},
+ "node_modules/@types/use-sync-external-store": {
+ "version": "0.0.6",
+ "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.6.tgz",
+ "integrity": "sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==",
+ "license": "MIT"
+ },
"node_modules/@typescript-eslint/eslint-plugin": {
"version": "8.57.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.57.1.tgz",
@@ -3739,33 +5142,181 @@
],
"dev": true,
"license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ]
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@unrs/resolver-binding-win32-x64-msvc": {
+ "version": "1.11.1",
+ "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.11.1.tgz",
+ "integrity": "sha512-lrW200hZdbfRtztbygyaq/6jP6AKE8qQN2KvPcJ+x7wiD038YtnYtZ82IMNJ69GJibV7bwL3y9FgK+5w/pYt6g==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@upsetjs/venn.js": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@upsetjs/venn.js/-/venn.js-2.0.0.tgz",
+ "integrity": "sha512-WbBhLrooyePuQ1VZxrJjtLvTc4NVfpOyKx0sKqioq9bX1C1m7Jgykkn8gLrtwumBioXIqam8DLxp88Adbue6Hw==",
+ "license": "MIT",
+ "optionalDependencies": {
+ "d3-selection": "^3.0.0",
+ "d3-transition": "^3.0.1"
+ }
+ },
+ "node_modules/@vitejs/plugin-react": {
+ "version": "4.7.0",
+ "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz",
+ "integrity": "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/core": "^7.28.0",
+ "@babel/plugin-transform-react-jsx-self": "^7.27.1",
+ "@babel/plugin-transform-react-jsx-source": "^7.27.1",
+ "@rolldown/pluginutils": "1.0.0-beta.27",
+ "@types/babel__core": "^7.20.5",
+ "react-refresh": "^0.17.0"
+ },
+ "engines": {
+ "node": "^14.18.0 || >=16.0.0"
+ },
+ "peerDependencies": {
+ "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"
+ }
+ },
+ "node_modules/@vitest/expect": {
+ "version": "2.1.9",
+ "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.9.tgz",
+ "integrity": "sha512-UJCIkTBenHeKT1TTlKMJWy1laZewsRIzYighyYiJKZreqtdxSos/S1t+ktRMQWu2CKqaarrkeszJx1cgC5tGZw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/spy": "2.1.9",
+ "@vitest/utils": "2.1.9",
+ "chai": "^5.1.2",
+ "tinyrainbow": "^1.2.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/mocker": {
+ "version": "2.1.9",
+ "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.9.tgz",
+ "integrity": "sha512-tVL6uJgoUdi6icpxmdrn5YNo3g3Dxv+IHJBr0GXHaEdTcw3F+cPKnsXFhli6nO+f/6SDKPHEK1UN+k+TQv0Ehg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/spy": "2.1.9",
+ "estree-walker": "^3.0.3",
+ "magic-string": "^0.30.12"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ },
+ "peerDependencies": {
+ "msw": "^2.4.9",
+ "vite": "^5.0.0"
+ },
+ "peerDependenciesMeta": {
+ "msw": {
+ "optional": true
+ },
+ "vite": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@vitest/pretty-format": {
+ "version": "2.1.9",
+ "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.9.tgz",
+ "integrity": "sha512-KhRIdGV2U9HOUzxfiHmY8IFHTdqtOhIzCpd8WRdJiE7D/HUcZVD0EgQCVjm+Q9gkUXWgBvMmTtZgIG48wq7sOQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "tinyrainbow": "^1.2.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/runner": {
+ "version": "2.1.9",
+ "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.9.tgz",
+ "integrity": "sha512-ZXSSqTFIrzduD63btIfEyOmNcBmQvgOVsPNPe0jYtESiXkhd8u2erDLnMxmGrDCwHCCHE7hxwRDCT3pt0esT4g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/utils": "2.1.9",
+ "pathe": "^1.1.2"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/@vitest/runner/node_modules/pathe": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz",
+ "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@vitest/snapshot": {
+ "version": "2.1.9",
+ "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.9.tgz",
+ "integrity": "sha512-oBO82rEjsxLNJincVhLhaxxZdEtV0EFHMK5Kmx5sJ6H9L183dHECjiefOAdnqpIgT5eZwT04PoggUnW88vOBNQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/pretty-format": "2.1.9",
+ "magic-string": "^0.30.12",
+ "pathe": "^1.1.2"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
},
- "node_modules/@unrs/resolver-binding-win32-x64-msvc": {
- "version": "1.11.1",
- "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.11.1.tgz",
- "integrity": "sha512-lrW200hZdbfRtztbygyaq/6jP6AKE8qQN2KvPcJ+x7wiD038YtnYtZ82IMNJ69GJibV7bwL3y9FgK+5w/pYt6g==",
- "cpu": [
- "x64"
- ],
+ "node_modules/@vitest/snapshot/node_modules/pathe": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz",
+ "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@vitest/spy": {
+ "version": "2.1.9",
+ "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.9.tgz",
+ "integrity": "sha512-E1B35FwzXXTs9FHNK6bDszs7mtydNi5MIfUWpceJ8Xbfb1gBMscAnwLbEu+B44ed6W3XjL9/ehLPHR1fkf1KLQ==",
"dev": true,
"license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ]
+ "dependencies": {
+ "tinyspy": "^3.0.2"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
},
- "node_modules/@upsetjs/venn.js": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/@upsetjs/venn.js/-/venn.js-2.0.0.tgz",
- "integrity": "sha512-WbBhLrooyePuQ1VZxrJjtLvTc4NVfpOyKx0sKqioq9bX1C1m7Jgykkn8gLrtwumBioXIqam8DLxp88Adbue6Hw==",
+ "node_modules/@vitest/utils": {
+ "version": "2.1.9",
+ "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.9.tgz",
+ "integrity": "sha512-v0psaMSkNJ3A2NMrUEHFRzJtDPFn+/VWZ5WxImB21T9fjucJRmS7xCS3ppEnARb9y11OAzaD+P2Ps+b+BGX5iQ==",
+ "dev": true,
"license": "MIT",
- "optionalDependencies": {
- "d3-selection": "^3.0.0",
- "d3-transition": "^3.0.1"
+ "dependencies": {
+ "@vitest/pretty-format": "2.1.9",
+ "loupe": "^3.1.2",
+ "tinyrainbow": "^1.2.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
}
},
"node_modules/@xyflow/react": {
@@ -3821,6 +5372,16 @@
"acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
}
},
+ "node_modules/agent-base": {
+ "version": "7.1.4",
+ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",
+ "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 14"
+ }
+ },
"node_modules/ajv": {
"version": "6.14.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz",
@@ -3838,6 +5399,17 @@
"url": "https://github.com/sponsors/epoberezkin"
}
},
+ "node_modules/ansi-regex": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
@@ -4043,6 +5615,16 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/assertion-error": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz",
+ "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ }
+ },
"node_modules/ast-types-flow": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz",
@@ -4069,6 +5651,13 @@
"node": ">= 0.4"
}
},
+ "node_modules/asynckit": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
+ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/available-typed-arrays": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz",
@@ -4123,11 +5712,10 @@
"license": "MIT"
},
"node_modules/baseline-browser-mapping": {
- "version": "2.10.11",
- "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.11.tgz",
- "integrity": "sha512-DAKrHphkJyiGuau/cFieRYhcTFeK/lBuD++C7cZ6KZHbMhBrisoi+EvhQ5RZrIfV5qwsW8kgQ07JIC+MDJRAhg==",
+ "version": "2.10.24",
+ "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.24.tgz",
+ "integrity": "sha512-I2NkZOOrj2XuguvWCK6OVh9GavsNjZjK908Rq3mIBK25+GD8vPX5w2WdxVqnQ7xx3SrZJiCiZFu+/Oz50oSYSA==",
"license": "Apache-2.0",
- "peer": true,
"bin": {
"baseline-browser-mapping": "dist/cli.cjs"
},
@@ -4159,6 +5747,50 @@
"node": ">=8"
}
},
+ "node_modules/browserslist": {
+ "version": "4.28.2",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.2.tgz",
+ "integrity": "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/browserslist"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "baseline-browser-mapping": "^2.10.12",
+ "caniuse-lite": "^1.0.30001782",
+ "electron-to-chromium": "^1.5.328",
+ "node-releases": "^2.0.36",
+ "update-browserslist-db": "^1.2.3"
+ },
+ "bin": {
+ "browserslist": "cli.js"
+ },
+ "engines": {
+ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
+ }
+ },
+ "node_modules/cac": {
+ "version": "6.7.14",
+ "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz",
+ "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/call-bind": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz",
@@ -4220,9 +5852,9 @@
}
},
"node_modules/caniuse-lite": {
- "version": "1.0.30001780",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001780.tgz",
- "integrity": "sha512-llngX0E7nQci5BPJDqoZSbuZ5Bcs9F5db7EtgfwBerX9XGtkkiO4NwfDDIRzHTTwcYC8vC7bmeUEPGrKlR/TkQ==",
+ "version": "1.0.30001791",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001791.tgz",
+ "integrity": "sha512-yk0l/YSrOnFZk3UROpDLQD9+kC1l4meK/wed583AXrzoarMGJcbRi2Q4RaUYbKxYAsZ8sWmaSa/DsLmdBeI1vQ==",
"funding": [
{
"type": "opencollective",
@@ -4249,6 +5881,23 @@
"url": "https://github.com/sponsors/wooorm"
}
},
+ "node_modules/chai": {
+ "version": "5.3.3",
+ "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz",
+ "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "assertion-error": "^2.0.1",
+ "check-error": "^2.1.1",
+ "deep-eql": "^5.0.1",
+ "loupe": "^3.1.0",
+ "pathval": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
@@ -4306,6 +5955,16 @@
"url": "https://github.com/sponsors/wooorm"
}
},
+ "node_modules/check-error": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz",
+ "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 16"
+ }
+ },
"node_modules/chevrotain": {
"version": "11.1.2",
"resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-11.1.2.tgz",
@@ -4411,6 +6070,19 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/combined-stream": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
+ "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "delayed-stream": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
"node_modules/comma-separated-tokens": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz",
@@ -4443,6 +6115,13 @@
"integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==",
"license": "MIT"
},
+ "node_modules/convert-source-map": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",
+ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/cose-base": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/cose-base/-/cose-base-1.0.3.tgz",
@@ -4467,6 +6146,13 @@
"node": ">= 8"
}
},
+ "node_modules/css.escape": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz",
+ "integrity": "sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/cssesc": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
@@ -4480,6 +6166,27 @@
"node": ">=4"
}
},
+ "node_modules/cssstyle": {
+ "version": "4.6.0",
+ "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.6.0.tgz",
+ "integrity": "sha512-2z+rWdzbbSZv6/rhtvzvqeZQHrBaqgogqt85sqFNbabZOuFbCVFb8kPeEtZjiKkbrm395irpNKiYeFeLiQnFPg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@asamuzakjp/css-color": "^3.2.0",
+ "rrweb-cssom": "^0.8.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/cssstyle/node_modules/rrweb-cssom": {
+ "version": "0.8.0",
+ "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz",
+ "integrity": "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/csstype": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
@@ -4992,6 +6699,20 @@
"dev": true,
"license": "BSD-2-Clause"
},
+ "node_modules/data-urls": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz",
+ "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "whatwg-mimetype": "^4.0.0",
+ "whatwg-url": "^14.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/data-view-buffer": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz",
@@ -5069,6 +6790,13 @@
}
}
},
+ "node_modules/decimal.js": {
+ "version": "10.6.0",
+ "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz",
+ "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/decimal.js-light": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/decimal.js-light/-/decimal.js-light-2.5.1.tgz",
@@ -5088,6 +6816,16 @@
"url": "https://github.com/sponsors/wooorm"
}
},
+ "node_modules/deep-eql": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz",
+ "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/deep-is": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
@@ -5140,6 +6878,16 @@
"robust-predicates": "^3.0.2"
}
},
+ "node_modules/delayed-stream": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
+ "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
"node_modules/dequal": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
@@ -5191,6 +6939,14 @@
"node": ">=0.10.0"
}
},
+ "node_modules/dom-accessibility-api": {
+ "version": "0.5.16",
+ "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz",
+ "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true
+ },
"node_modules/dom-helpers": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz",
@@ -5225,6 +6981,13 @@
"node": ">= 0.4"
}
},
+ "node_modules/electron-to-chromium": {
+ "version": "1.5.348",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.348.tgz",
+ "integrity": "sha512-QC2X59nRlycQQMc4ZXjSVBX+tSgJfgRtcrYHbIZLgOV2dCvefoQGegLR7lLXKgpPpSuVmJU19LMzGrSa2C7k3Q==",
+ "dev": true,
+ "license": "ISC"
+ },
"node_modules/elkjs": {
"version": "0.11.1",
"resolved": "https://registry.npmjs.org/elkjs/-/elkjs-0.11.1.tgz",
@@ -5258,6 +7021,19 @@
"node": ">=10.13.0"
}
},
+ "node_modules/entities": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz",
+ "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=0.12"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/entities?sponsor=1"
+ }
+ },
"node_modules/es-abstract": {
"version": "1.24.1",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.1.tgz",
@@ -5376,6 +7152,13 @@
"node": ">= 0.4"
}
},
+ "node_modules/es-module-lexer": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz",
+ "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/es-object-atoms": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
@@ -5436,6 +7219,16 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/es-toolkit": {
+ "version": "1.46.1",
+ "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.46.1.tgz",
+ "integrity": "sha512-5eNtXOs3tbfxXOj04tjjseeWkRWaoCjdEI+96DgwzZoe6c9juL49pXlzAFTI72aWC9Y8p7168g6XIKjh7k6pyQ==",
+ "license": "MIT",
+ "workspaces": [
+ "docs",
+ "benchmarks"
+ ]
+ },
"node_modules/esast-util-from-estree": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/esast-util-from-estree/-/esast-util-from-estree-2.0.0.tgz",
@@ -5468,6 +7261,55 @@
"url": "https://opencollective.com/unified"
}
},
+ "node_modules/esbuild": {
+ "version": "0.21.5",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz",
+ "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.21.5",
+ "@esbuild/android-arm": "0.21.5",
+ "@esbuild/android-arm64": "0.21.5",
+ "@esbuild/android-x64": "0.21.5",
+ "@esbuild/darwin-arm64": "0.21.5",
+ "@esbuild/darwin-x64": "0.21.5",
+ "@esbuild/freebsd-arm64": "0.21.5",
+ "@esbuild/freebsd-x64": "0.21.5",
+ "@esbuild/linux-arm": "0.21.5",
+ "@esbuild/linux-arm64": "0.21.5",
+ "@esbuild/linux-ia32": "0.21.5",
+ "@esbuild/linux-loong64": "0.21.5",
+ "@esbuild/linux-mips64el": "0.21.5",
+ "@esbuild/linux-ppc64": "0.21.5",
+ "@esbuild/linux-riscv64": "0.21.5",
+ "@esbuild/linux-s390x": "0.21.5",
+ "@esbuild/linux-x64": "0.21.5",
+ "@esbuild/netbsd-x64": "0.21.5",
+ "@esbuild/openbsd-x64": "0.21.5",
+ "@esbuild/sunos-x64": "0.21.5",
+ "@esbuild/win32-arm64": "0.21.5",
+ "@esbuild/win32-ia32": "0.21.5",
+ "@esbuild/win32-x64": "0.21.5"
+ }
+ },
+ "node_modules/escalade": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
+ "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/escape-string-regexp": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
@@ -6009,6 +7851,16 @@
"integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",
"license": "MIT"
},
+ "node_modules/expect-type": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz",
+ "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
"node_modules/extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
@@ -6183,6 +8035,23 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/form-data": {
+ "version": "4.0.5",
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz",
+ "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.8",
+ "es-set-tostringtag": "^2.1.0",
+ "hasown": "^2.0.2",
+ "mime-types": "^2.1.12"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
"node_modules/framer-motion": {
"version": "11.18.2",
"resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.18.2.tgz",
@@ -6210,6 +8079,21 @@
}
}
},
+ "node_modules/fsevents": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+ }
+ },
"node_modules/function-bind": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
@@ -6279,6 +8163,16 @@
"node": ">= 0.4"
}
},
+ "node_modules/gensync": {
+ "version": "1.0.0-beta.2",
+ "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
+ "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
"node_modules/get-intrinsic": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
@@ -6612,6 +8506,19 @@
"url": "https://opencollective.com/unified"
}
},
+ "node_modules/html-encoding-sniffer": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz",
+ "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "whatwg-encoding": "^3.1.1"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/html-url-attributes": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/html-url-attributes/-/html-url-attributes-3.0.1.tgz",
@@ -6627,9 +8534,37 @@
"resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz",
"integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==",
"license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/wooorm"
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/http-proxy-agent": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz",
+ "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "agent-base": "^7.1.0",
+ "debug": "^4.3.4"
+ },
+ "engines": {
+ "node": ">= 14"
+ }
+ },
+ "node_modules/https-proxy-agent": {
+ "version": "7.0.6",
+ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",
+ "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "agent-base": "^7.1.2",
+ "debug": "4"
+ },
+ "engines": {
+ "node": ">= 14"
}
},
"node_modules/iconv-lite": {
@@ -6654,6 +8589,16 @@
"node": ">= 4"
}
},
+ "node_modules/immer": {
+ "version": "10.2.0",
+ "resolved": "https://registry.npmjs.org/immer/-/immer-10.2.0.tgz",
+ "integrity": "sha512-d/+XTN3zfODyjr89gM3mPq1WNX2B8pYsu7eORitdwyA2sBubnTl3laYlBk4sXY5FUa5qTZGBDPJICVbvqzjlbw==",
+ "license": "MIT",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/immer"
+ }
+ },
"node_modules/import-fresh": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz",
@@ -6681,6 +8626,16 @@
"node": ">=0.8.19"
}
},
+ "node_modules/indent-string": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz",
+ "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/inline-style-parser": {
"version": "0.2.7",
"resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.7.tgz",
@@ -7024,6 +8979,13 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/is-potential-custom-element-name": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz",
+ "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/is-regex": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz",
@@ -7230,6 +9192,60 @@
"js-yaml": "bin/js-yaml.js"
}
},
+ "node_modules/jsdom": {
+ "version": "25.0.1",
+ "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-25.0.1.tgz",
+ "integrity": "sha512-8i7LzZj7BF8uplX+ZyOlIz86V6TAsSs+np6m1kpW9u0JWi4z/1t+FzcK1aek+ybTnAC4KhBL4uXCNT0wcUIeCw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "cssstyle": "^4.1.0",
+ "data-urls": "^5.0.0",
+ "decimal.js": "^10.4.3",
+ "form-data": "^4.0.0",
+ "html-encoding-sniffer": "^4.0.0",
+ "http-proxy-agent": "^7.0.2",
+ "https-proxy-agent": "^7.0.5",
+ "is-potential-custom-element-name": "^1.0.1",
+ "nwsapi": "^2.2.12",
+ "parse5": "^7.1.2",
+ "rrweb-cssom": "^0.7.1",
+ "saxes": "^6.0.0",
+ "symbol-tree": "^3.2.4",
+ "tough-cookie": "^5.0.0",
+ "w3c-xmlserializer": "^5.0.0",
+ "webidl-conversions": "^7.0.0",
+ "whatwg-encoding": "^3.1.1",
+ "whatwg-mimetype": "^4.0.0",
+ "whatwg-url": "^14.0.0",
+ "ws": "^8.18.0",
+ "xml-name-validator": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "peerDependencies": {
+ "canvas": "^2.11.2"
+ },
+ "peerDependenciesMeta": {
+ "canvas": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/jsesc": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
+ "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "jsesc": "bin/jsesc"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/json-buffer": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
@@ -7695,6 +9711,23 @@
"loose-envify": "cli.js"
}
},
+ "node_modules/loupe": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz",
+ "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/lru-cache": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
+ "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "yallist": "^3.0.2"
+ }
+ },
"node_modules/lucide-react": {
"version": "0.460.0",
"resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.460.0.tgz",
@@ -7704,6 +9737,17 @@
"react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc"
}
},
+ "node_modules/lz-string": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz",
+ "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "bin": {
+ "lz-string": "bin/bin.js"
+ }
+ },
"node_modules/magic-string": {
"version": "0.30.21",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz",
@@ -8840,6 +10884,39 @@
"url": "https://github.com/sponsors/jonschlinkert"
}
},
+ "node_modules/mime-db": {
+ "version": "1.52.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mime-types": {
+ "version": "2.1.35",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "mime-db": "1.52.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/min-indent": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz",
+ "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=4"
+ }
+ },
"node_modules/minimatch": {
"version": "3.1.5",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",
@@ -9071,6 +11148,13 @@
"semver": "bin/semver.js"
}
},
+ "node_modules/node-releases": {
+ "version": "2.0.38",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.38.tgz",
+ "integrity": "sha512-3qT/88Y3FbH/Kx4szpQQ4HzUbVrHPKTLVpVocKiLfoYvw9XSGOX2FmD2d6DrXbVYyAQTF2HeF6My8jmzx7/CRw==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/nuqs": {
"version": "2.8.9",
"resolved": "https://registry.npmjs.org/nuqs/-/nuqs-2.8.9.tgz",
@@ -9108,6 +11192,13 @@
}
}
},
+ "node_modules/nwsapi": {
+ "version": "2.2.23",
+ "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.23.tgz",
+ "integrity": "sha512-7wfH4sLbt4M0gCDzGE6vzQBo0bfTKjU7Sfpqy/7gs1qBfYz2vEJH6vXcBKpO3+6Yu1telwd0t9HpyOoLEQQbIQ==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
@@ -9353,6 +11444,19 @@
"integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==",
"license": "MIT"
},
+ "node_modules/parse5": {
+ "version": "7.3.0",
+ "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz",
+ "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "entities": "^6.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/inikulin/parse5?sponsor=1"
+ }
+ },
"node_modules/path-data-parser": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/path-data-parser/-/path-data-parser-0.1.0.tgz",
@@ -9392,6 +11496,16 @@
"integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==",
"license": "MIT"
},
+ "node_modules/pathval": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz",
+ "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 14.16"
+ }
+ },
"node_modules/picocolors": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
@@ -9501,6 +11615,44 @@
"node": ">= 0.8.0"
}
},
+ "node_modules/pretty-format": {
+ "version": "27.5.1",
+ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz",
+ "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "ansi-regex": "^5.0.1",
+ "ansi-styles": "^5.0.0",
+ "react-is": "^17.0.1"
+ },
+ "engines": {
+ "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
+ }
+ },
+ "node_modules/pretty-format/node_modules/ansi-styles": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz",
+ "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/pretty-format/node_modules/react-is": {
+ "version": "17.0.2",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true
+ },
"node_modules/prop-types": {
"version": "15.8.1",
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
@@ -9607,6 +11759,39 @@
"react": ">=18"
}
},
+ "node_modules/react-redux": {
+ "version": "9.2.0",
+ "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.2.0.tgz",
+ "integrity": "sha512-ROY9fvHhwOD9ySfrF0wmvu//bKCQ6AeZZq1nJNtbDC+kk5DuSuNX/n6YWYF/SYy7bSba4D4FSz8DJeKY/S/r+g==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/use-sync-external-store": "^0.0.6",
+ "use-sync-external-store": "^1.4.0"
+ },
+ "peerDependencies": {
+ "@types/react": "^18.2.25 || ^19",
+ "react": "^18.0 || ^19",
+ "redux": "^5.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "redux": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-refresh": {
+ "version": "0.17.0",
+ "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz",
+ "integrity": "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/react-remove-scroll": {
"version": "2.7.2",
"resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.7.2.tgz",
@@ -9812,6 +11997,35 @@
"url": "https://opencollective.com/unified"
}
},
+ "node_modules/redent": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz",
+ "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "indent-string": "^4.0.0",
+ "strip-indent": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/redux": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz",
+ "integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==",
+ "license": "MIT"
+ },
+ "node_modules/redux-thunk": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-3.1.0.tgz",
+ "integrity": "sha512-NW2r5T6ksUKXCabzhL9z+h206HQw/NJkcLm1GPImRQ8IzfXwRGqjVhKJGauHirT0DAuyy6hjdnMZaRoAcy0Klw==",
+ "license": "MIT",
+ "peerDependencies": {
+ "redux": "^5.0.0"
+ }
+ },
"node_modules/reflect.getprototypeof": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz",
@@ -9980,6 +12194,12 @@
"resolved": "packages/web",
"link": true
},
+ "node_modules/reselect": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/reselect/-/reselect-5.1.1.tgz",
+ "integrity": "sha512-K/BG6eIky/SBpzfHZv/dd+9JBFiS4SWV7FIujVyJRux6e45+73RaUHXLmIR1f7WOMaQ0U1km6qwklRQxpJJY0w==",
+ "license": "MIT"
+ },
"node_modules/resolve": {
"version": "1.22.11",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz",
@@ -10038,6 +12258,51 @@
"integrity": "sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==",
"license": "Unlicense"
},
+ "node_modules/rollup": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.60.2.tgz",
+ "integrity": "sha512-J9qZyW++QK/09NyN/zeO0dG/1GdGfyp9lV8ajHnRVLfo/uFsbji5mHnDgn/qYdUHyCkM2N+8VyspgZclfAh0eQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "1.0.8"
+ },
+ "bin": {
+ "rollup": "dist/bin/rollup"
+ },
+ "engines": {
+ "node": ">=18.0.0",
+ "npm": ">=8.0.0"
+ },
+ "optionalDependencies": {
+ "@rollup/rollup-android-arm-eabi": "4.60.2",
+ "@rollup/rollup-android-arm64": "4.60.2",
+ "@rollup/rollup-darwin-arm64": "4.60.2",
+ "@rollup/rollup-darwin-x64": "4.60.2",
+ "@rollup/rollup-freebsd-arm64": "4.60.2",
+ "@rollup/rollup-freebsd-x64": "4.60.2",
+ "@rollup/rollup-linux-arm-gnueabihf": "4.60.2",
+ "@rollup/rollup-linux-arm-musleabihf": "4.60.2",
+ "@rollup/rollup-linux-arm64-gnu": "4.60.2",
+ "@rollup/rollup-linux-arm64-musl": "4.60.2",
+ "@rollup/rollup-linux-loong64-gnu": "4.60.2",
+ "@rollup/rollup-linux-loong64-musl": "4.60.2",
+ "@rollup/rollup-linux-ppc64-gnu": "4.60.2",
+ "@rollup/rollup-linux-ppc64-musl": "4.60.2",
+ "@rollup/rollup-linux-riscv64-gnu": "4.60.2",
+ "@rollup/rollup-linux-riscv64-musl": "4.60.2",
+ "@rollup/rollup-linux-s390x-gnu": "4.60.2",
+ "@rollup/rollup-linux-x64-gnu": "4.60.2",
+ "@rollup/rollup-linux-x64-musl": "4.60.2",
+ "@rollup/rollup-openbsd-x64": "4.60.2",
+ "@rollup/rollup-openharmony-arm64": "4.60.2",
+ "@rollup/rollup-win32-arm64-msvc": "4.60.2",
+ "@rollup/rollup-win32-ia32-msvc": "4.60.2",
+ "@rollup/rollup-win32-x64-gnu": "4.60.2",
+ "@rollup/rollup-win32-x64-msvc": "4.60.2",
+ "fsevents": "~2.3.2"
+ }
+ },
"node_modules/roughjs": {
"version": "4.6.6",
"resolved": "https://registry.npmjs.org/roughjs/-/roughjs-4.6.6.tgz",
@@ -10050,6 +12315,13 @@
"points-on-path": "^0.2.1"
}
},
+ "node_modules/rrweb-cssom": {
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.7.1.tgz",
+ "integrity": "sha512-TrEMa7JGdVm0UThDJSx7ddw5nVm3UJS9o9CCIZ72B1vSyEZoziDqBYP3XIoi/12lKrJR8rE3jeFHMok2F/Mnsg==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/run-parallel": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
@@ -10141,6 +12413,19 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"license": "MIT"
},
+ "node_modules/saxes": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz",
+ "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "xmlchars": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=v12.22.7"
+ }
+ },
"node_modules/scheduler": {
"version": "0.27.0",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz",
@@ -10369,6 +12654,13 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/siginfo": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz",
+ "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==",
+ "dev": true,
+ "license": "ISC"
+ },
"node_modules/sonner": {
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/sonner/-/sonner-2.0.7.tgz",
@@ -10414,6 +12706,20 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/stackback": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",
+ "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/std-env": {
+ "version": "3.10.0",
+ "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz",
+ "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/stop-iteration-iterator": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz",
@@ -10565,6 +12871,19 @@
"node": ">=4"
}
},
+ "node_modules/strip-indent": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz",
+ "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "min-indent": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/strip-json-comments": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
@@ -10664,6 +12983,13 @@
"react": "^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
}
},
+ "node_modules/symbol-tree": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz",
+ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/tailwind-merge": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.6.1.tgz",
@@ -10701,6 +13027,13 @@
"integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==",
"license": "MIT"
},
+ "node_modules/tinybench": {
+ "version": "2.9.0",
+ "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz",
+ "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/tinyexec": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.4.tgz",
@@ -10727,6 +13060,56 @@
"url": "https://github.com/sponsors/SuperchupuDev"
}
},
+ "node_modules/tinypool": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz",
+ "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^18.0.0 || >=20.0.0"
+ }
+ },
+ "node_modules/tinyrainbow": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz",
+ "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/tinyspy": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz",
+ "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/tldts": {
+ "version": "6.1.86",
+ "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.86.tgz",
+ "integrity": "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "tldts-core": "^6.1.86"
+ },
+ "bin": {
+ "tldts": "bin/cli.js"
+ }
+ },
+ "node_modules/tldts-core": {
+ "version": "6.1.86",
+ "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.86.tgz",
+ "integrity": "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
@@ -10740,6 +13123,32 @@
"node": ">=8.0"
}
},
+ "node_modules/tough-cookie": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz",
+ "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "tldts": "^6.1.32"
+ },
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/tr46": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.1.tgz",
+ "integrity": "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "punycode": "^2.3.1"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/trim-lines": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz",
@@ -11088,6 +13497,37 @@
"@unrs/resolver-binding-win32-x64-msvc": "1.11.1"
}
},
+ "node_modules/update-browserslist-db": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz",
+ "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/browserslist"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "escalade": "^3.2.0",
+ "picocolors": "^1.1.1"
+ },
+ "bin": {
+ "update-browserslist-db": "cli.js"
+ },
+ "peerDependencies": {
+ "browserslist": ">= 4.21.0"
+ }
+ },
"node_modules/uri-js": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
@@ -11234,6 +13674,176 @@
"d3-timer": "^3.0.1"
}
},
+ "node_modules/vite": {
+ "version": "5.4.21",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz",
+ "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "esbuild": "^0.21.3",
+ "postcss": "^8.4.43",
+ "rollup": "^4.20.0"
+ },
+ "bin": {
+ "vite": "bin/vite.js"
+ },
+ "engines": {
+ "node": "^18.0.0 || >=20.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/vitejs/vite?sponsor=1"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.3"
+ },
+ "peerDependencies": {
+ "@types/node": "^18.0.0 || >=20.0.0",
+ "less": "*",
+ "lightningcss": "^1.21.0",
+ "sass": "*",
+ "sass-embedded": "*",
+ "stylus": "*",
+ "sugarss": "*",
+ "terser": "^5.4.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ },
+ "less": {
+ "optional": true
+ },
+ "lightningcss": {
+ "optional": true
+ },
+ "sass": {
+ "optional": true
+ },
+ "sass-embedded": {
+ "optional": true
+ },
+ "stylus": {
+ "optional": true
+ },
+ "sugarss": {
+ "optional": true
+ },
+ "terser": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/vite-node": {
+ "version": "2.1.9",
+ "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.9.tgz",
+ "integrity": "sha512-AM9aQ/IPrW/6ENLQg3AGY4K1N2TGZdR5e4gu/MmmR2xR3Ll1+dib+nook92g4TV3PXVyeyxdWwtaCAiUL0hMxA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "cac": "^6.7.14",
+ "debug": "^4.3.7",
+ "es-module-lexer": "^1.5.4",
+ "pathe": "^1.1.2",
+ "vite": "^5.0.0"
+ },
+ "bin": {
+ "vite-node": "vite-node.mjs"
+ },
+ "engines": {
+ "node": "^18.0.0 || >=20.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/vite-node/node_modules/pathe": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz",
+ "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/vitest": {
+ "version": "2.1.9",
+ "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.9.tgz",
+ "integrity": "sha512-MSmPM9REYqDGBI8439mA4mWhV5sKmDlBKWIYbA3lRb2PTHACE0mgKwA8yQ2xq9vxDTuk4iPrECBAEW2aoFXY0Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@vitest/expect": "2.1.9",
+ "@vitest/mocker": "2.1.9",
+ "@vitest/pretty-format": "^2.1.9",
+ "@vitest/runner": "2.1.9",
+ "@vitest/snapshot": "2.1.9",
+ "@vitest/spy": "2.1.9",
+ "@vitest/utils": "2.1.9",
+ "chai": "^5.1.2",
+ "debug": "^4.3.7",
+ "expect-type": "^1.1.0",
+ "magic-string": "^0.30.12",
+ "pathe": "^1.1.2",
+ "std-env": "^3.8.0",
+ "tinybench": "^2.9.0",
+ "tinyexec": "^0.3.1",
+ "tinypool": "^1.0.1",
+ "tinyrainbow": "^1.2.0",
+ "vite": "^5.0.0",
+ "vite-node": "2.1.9",
+ "why-is-node-running": "^2.3.0"
+ },
+ "bin": {
+ "vitest": "vitest.mjs"
+ },
+ "engines": {
+ "node": "^18.0.0 || >=20.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ },
+ "peerDependencies": {
+ "@edge-runtime/vm": "*",
+ "@types/node": "^18.0.0 || >=20.0.0",
+ "@vitest/browser": "2.1.9",
+ "@vitest/ui": "2.1.9",
+ "happy-dom": "*",
+ "jsdom": "*"
+ },
+ "peerDependenciesMeta": {
+ "@edge-runtime/vm": {
+ "optional": true
+ },
+ "@types/node": {
+ "optional": true
+ },
+ "@vitest/browser": {
+ "optional": true
+ },
+ "@vitest/ui": {
+ "optional": true
+ },
+ "happy-dom": {
+ "optional": true
+ },
+ "jsdom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/vitest/node_modules/pathe": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz",
+ "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/vitest/node_modules/tinyexec": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz",
+ "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/vscode-jsonrpc": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz",
@@ -11283,6 +13893,67 @@
"integrity": "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==",
"license": "MIT"
},
+ "node_modules/w3c-xmlserializer": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz",
+ "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "xml-name-validator": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/webidl-conversions": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz",
+ "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/whatwg-encoding": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz",
+ "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==",
+ "deprecated": "Use @exodus/bytes instead for a more spec-conformant and faster implementation",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "iconv-lite": "0.6.3"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/whatwg-mimetype": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz",
+ "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/whatwg-url": {
+ "version": "14.2.0",
+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz",
+ "integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "tr46": "^5.1.0",
+ "webidl-conversions": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
@@ -11388,6 +14059,23 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/why-is-node-running": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz",
+ "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "siginfo": "^2.0.0",
+ "stackback": "0.0.2"
+ },
+ "bin": {
+ "why-is-node-running": "cli.js"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/word-wrap": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
@@ -11398,6 +14086,52 @@
"node": ">=0.10.0"
}
},
+ "node_modules/ws": {
+ "version": "8.20.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.0.tgz",
+ "integrity": "sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/xml-name-validator": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz",
+ "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/xmlchars": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",
+ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/yallist": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
+ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
+ "dev": true,
+ "license": "ISC"
+ },
"node_modules/yaml": {
"version": "2.8.3",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.3.tgz",
@@ -11464,6 +14198,138 @@
"url": "https://github.com/sponsors/wooorm"
}
},
+ "packages/types": {
+ "name": "@repowise-dev/types",
+ "version": "0.0.1",
+ "devDependencies": {
+ "typescript": "^5.6.0",
+ "vitest": "^2.1.0"
+ }
+ },
+ "packages/ui": {
+ "name": "@repowise-dev/ui",
+ "version": "0.0.1",
+ "dependencies": {
+ "@radix-ui/react-dialog": "^1.1.15",
+ "@radix-ui/react-label": "^2.1.8",
+ "@radix-ui/react-progress": "^1.1.8",
+ "@radix-ui/react-scroll-area": "^1.2.10",
+ "@radix-ui/react-select": "^2.2.6",
+ "@radix-ui/react-separator": "^1.1.8",
+ "@radix-ui/react-slider": "^1.3.6",
+ "@radix-ui/react-slot": "^1.2.4",
+ "@radix-ui/react-switch": "^1.2.6",
+ "@radix-ui/react-tabs": "^1.1.13",
+ "@radix-ui/react-tooltip": "^1.2.8",
+ "@repowise-dev/types": "*",
+ "@xyflow/react": "^12.10.2",
+ "class-variance-authority": "^0.7.1",
+ "clsx": "^2.1.1",
+ "d3-force": "^3.0.0",
+ "d3-hierarchy": "^3.1.2",
+ "framer-motion": "^11.11.0",
+ "fuse.js": "^7.0.0",
+ "lucide-react": "^1.7.0",
+ "mermaid": "^11.4.0",
+ "react-markdown": "^10.1.0",
+ "recharts": "^3.8.1",
+ "remark-gfm": "^4.0.1",
+ "tailwind-merge": "^3.5.0"
+ },
+ "devDependencies": {
+ "@testing-library/jest-dom": "^6.5.0",
+ "@testing-library/react": "^16.0.0",
+ "@types/react": "^19.0.0",
+ "@types/react-dom": "^19.0.0",
+ "@vitejs/plugin-react": "^4.3.0",
+ "jsdom": "^25.0.0",
+ "react": "^19.0.0",
+ "react-dom": "^19.0.0",
+ "typescript": "^5.6.0",
+ "vitest": "^2.1.0"
+ },
+ "peerDependencies": {
+ "react": "^19.0.0",
+ "react-dom": "^19.0.0"
+ }
+ },
+ "packages/ui/node_modules/eventemitter3": {
+ "version": "5.0.4",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz",
+ "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==",
+ "license": "MIT"
+ },
+ "packages/ui/node_modules/lucide-react": {
+ "version": "1.14.0",
+ "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-1.14.0.tgz",
+ "integrity": "sha512-+1mdWcfSJVUsaTIjN9zoezmUhfXo5l0vP7ekBMPo3jcS/aIkxHnXqAPsByszMZx/Y8oQBRJxJx5xg+RH3urzxA==",
+ "license": "ISC",
+ "peerDependencies": {
+ "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0"
+ }
+ },
+ "packages/ui/node_modules/recharts": {
+ "version": "3.8.1",
+ "resolved": "https://registry.npmjs.org/recharts/-/recharts-3.8.1.tgz",
+ "integrity": "sha512-mwzmO1s9sFL0TduUpwndxCUNoXsBw3u3E/0+A+cLcrSfQitSG62L32N69GhqUrrT5qKcAE3pCGVINC6pqkBBQg==",
+ "license": "MIT",
+ "workspaces": [
+ "www"
+ ],
+ "dependencies": {
+ "@reduxjs/toolkit": "^1.9.0 || 2.x.x",
+ "clsx": "^2.1.1",
+ "decimal.js-light": "^2.5.1",
+ "es-toolkit": "^1.39.3",
+ "eventemitter3": "^5.0.1",
+ "immer": "^10.1.1",
+ "react-redux": "8.x.x || 9.x.x",
+ "reselect": "5.1.1",
+ "tiny-invariant": "^1.3.3",
+ "use-sync-external-store": "^1.2.2",
+ "victory-vendor": "^37.0.2"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
+ "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
+ "react-is": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
+ }
+ },
+ "packages/ui/node_modules/tailwind-merge": {
+ "version": "3.5.0",
+ "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.5.0.tgz",
+ "integrity": "sha512-I8K9wewnVDkL1NTGoqWmVEIlUcB9gFriAEkXkfCjX5ib8ezGxtR3xD7iZIxrfArjEsH7F1CHD4RFUtxefdqV/A==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/dcastil"
+ }
+ },
+ "packages/ui/node_modules/victory-vendor": {
+ "version": "37.3.6",
+ "resolved": "https://registry.npmjs.org/victory-vendor/-/victory-vendor-37.3.6.tgz",
+ "integrity": "sha512-SbPDPdDBYp+5MJHhBCAyI7wKM3d5ivekigc2Dk2s7pgbZ9wIgIBYGVw4zGHBml/qTFbexrofXW6Gu4noGxrOwQ==",
+ "license": "MIT AND ISC",
+ "dependencies": {
+ "@types/d3-array": "^3.0.3",
+ "@types/d3-ease": "^3.0.0",
+ "@types/d3-interpolate": "^3.0.1",
+ "@types/d3-scale": "^4.0.2",
+ "@types/d3-shape": "^3.1.0",
+ "@types/d3-time": "^3.0.0",
+ "@types/d3-timer": "^3.0.0",
+ "d3-array": "^3.1.6",
+ "d3-ease": "^3.0.1",
+ "d3-interpolate": "^3.0.1",
+ "d3-scale": "^4.0.2",
+ "d3-shape": "^3.1.0",
+ "d3-time": "^3.0.0",
+ "d3-timer": "^3.0.1"
+ }
+ },
"packages/web": {
"name": "repowise-web",
"version": "0.3.0",
@@ -11484,6 +14350,8 @@
"@radix-ui/react-toggle": "^1.1.0",
"@radix-ui/react-toggle-group": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.0",
+ "@repowise-dev/types": "*",
+ "@repowise-dev/ui": "*",
"@xyflow/react": "^12.10.2",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
diff --git a/package.json b/package.json
index 7c2187497..afdad20fa 100644
--- a/package.json
+++ b/package.json
@@ -4,13 +4,16 @@
"private": true,
"description": "Root workspace configuration for repowise monorepo",
"workspaces": [
+ "packages/types",
+ "packages/ui",
"packages/web"
],
"scripts": {
"dev": "cd packages/web && npm run dev",
- "build": "cd packages/web && npm run build",
- "lint": "cd packages/web && npm run lint",
- "type-check": "cd packages/web && npm run type-check"
+ "build": "npm run build --workspaces --if-present",
+ "lint": "npm run lint --workspaces --if-present",
+ "type-check": "npm run type-check --workspaces --if-present",
+ "test": "npm run test --workspaces --if-present"
},
"engines": {
"node": ">=20.0.0"
diff --git a/packages/cli/src/repowise/cli/__init__.py b/packages/cli/src/repowise/cli/__init__.py
index a259cdcce..62c58be27 100644
--- a/packages/cli/src/repowise/cli/__init__.py
+++ b/packages/cli/src/repowise/cli/__init__.py
@@ -6,4 +6,4 @@ git signals, dead code detection, architectural decisions, and
AI-generated documentation.
"""
-__version__ = "0.4.1"
+__version__ = "0.5.0"
diff --git a/packages/core/src/repowise/core/__init__.py b/packages/core/src/repowise/core/__init__.py
index a68d8a1a7..78a20e9d2 100644
--- a/packages/core/src/repowise/core/__init__.py
+++ b/packages/core/src/repowise/core/__init__.py
@@ -6,4 +6,4 @@ generation engine. This is the heart of repowise — all other packages depend o
Namespace package: repowise.core is part of the repowise namespace.
"""
-__version__ = "0.4.1"
+__version__ = "0.5.0"
diff --git a/packages/server/src/repowise/server/__init__.py b/packages/server/src/repowise/server/__init__.py
index 8a4eeb9c7..74c2f3927 100644
--- a/packages/server/src/repowise/server/__init__.py
+++ b/packages/server/src/repowise/server/__init__.py
@@ -7,4 +7,4 @@ Provides:
- Background job scheduler (APScheduler)
"""
-__version__ = "0.4.1"
+__version__ = "0.5.0"
diff --git a/packages/types/__tests__/contracts.test.ts b/packages/types/__tests__/contracts.test.ts
new file mode 100644
index 000000000..6a8420fbb
--- /dev/null
+++ b/packages/types/__tests__/contracts.test.ts
@@ -0,0 +1,178 @@
+/**
+ * Type-level tests for non-trivial contracts in @repowise-dev/types. These run
+ * via `vitest --typecheck` and fail at tsc time if a canonical type drifts
+ * from what consumers depend on.
+ *
+ * Coverage focus:
+ * - ChatArtifact discriminated union: narrowing by `type` must surface
+ * the per-variant `data` shape.
+ * - GraphLink: backwards-compatible additions (edge_type, confidence) are
+ * optional, not required.
+ * - DeadCodeFinding: optional enrichment fields stay optional so canonical
+ * artifacts still satisfy the contract without them.
+ * - DecisionRecord: status + source are union literals, not bare strings.
+ * - Hotspot key shape: canonical Hotspot uses `file_path`, not `path`, so
+ * raw entries with a `path` key must adapt before assignment.
+ */
+
+import { describe, expectTypeOf, it } from "vitest";
+import type {
+ ChatArtifact,
+ KnownChatArtifact,
+ GraphPathArtifact,
+ DeadCodeArtifact,
+ DiagramArtifact,
+ GenericArtifact,
+} from "../src/chat.js";
+import type { GraphLink } from "../src/graph.js";
+import type { DeadCodeFinding } from "../src/dead-code.js";
+import type { DecisionRecord, DecisionStatus } from "../src/decisions.js";
+import type { Hotspot } from "../src/git.js";
+import type {
+ HeritageKind,
+ HeritageRelation,
+ SymbolHeritage,
+} from "../src/symbols.js";
+import type { SecurityFinding, SecuritySeverity } from "../src/security.js";
+
+describe("ChatArtifact discriminated union", () => {
+ it("narrows on .type to the per-variant data shape", () => {
+ // Mirrors backend reality (`backend/app/routers/chat.py:_tool_*`):
+ // - get_dependency_path → { type: "graph", data: { path, distance, explanation } }
+ // - get_dead_code → { type: "dead_code", data: { high_confidence, ... } }
+ // - get_architecture_diagram → { type: "diagram", data: { mermaid_syntax, ... } }
+ const narrow = (a: KnownChatArtifact) => {
+ if (a.type === "graph") {
+ expectTypeOf(a).toEqualTypeOf<GraphPathArtifact>();
+ expectTypeOf(a.data.path).toEqualTypeOf<string[]>();
+ expectTypeOf(a.data.distance).toEqualTypeOf<number>();
+ } else if (a.type === "dead_code") {
+ expectTypeOf(a).toEqualTypeOf<DeadCodeArtifact>();
+ expectTypeOf(a.data.total_findings).toEqualTypeOf<number>();
+ } else if (a.type === "diagram") {
+ expectTypeOf(a).toEqualTypeOf<DiagramArtifact>();
+ expectTypeOf(a.data.mermaid_syntax).toEqualTypeOf<string>();
+ }
+ };
+ expectTypeOf(narrow).toBeFunction();
+ });
+
+ it("falls through to GenericArtifact for unknown tool types", () => {
+ const generic: ChatArtifact = {
+ type: "future_tool_we_havent_typed_yet",
+ data: { whatever: 1 },
+ };
+ expectTypeOf(generic).toMatchTypeOf<GenericArtifact>();
+ });
+});
+
+describe("GraphLink backwards compatibility", () => {
+ it("requires only source/target/imported_names; v0.4.x extras are optional", () => {
+ const minimal: GraphLink = {
+ source: "a.ts",
+ target: "b.ts",
+ imported_names: [],
+ };
+ expectTypeOf(minimal).toEqualTypeOf<GraphLink>();
+ expectTypeOf<GraphLink["edge_type"]>().toEqualTypeOf<string | undefined>();
+ expectTypeOf<GraphLink["confidence"]>().toEqualTypeOf<number | undefined>();
+ });
+});
+
+describe("DeadCodeFinding optional enrichment", () => {
+ it("treats engine-raw fields (evidence, package, etc.) as optional", () => {
+ const minimal: DeadCodeFinding = {
+ id: "f1",
+ kind: "unreachable_file",
+ file_path: "src/foo.ts",
+ symbol_name: null,
+ symbol_kind: null,
+ confidence: 0.9,
+ reason: "no inbound edges",
+ lines: 12,
+ safe_to_delete: true,
+ primary_owner: null,
+ status: "open",
+ note: null,
+ };
+ expectTypeOf(minimal).toEqualTypeOf<DeadCodeFinding>();
+ expectTypeOf<DeadCodeFinding["evidence"]>().toEqualTypeOf<
+ string[] | null | undefined
+ >();
+ });
+});
+
+describe("DecisionRecord literal unions", () => {
+ it("constrains status to the four-literal union", () => {
+ expectTypeOf<DecisionStatus>().toEqualTypeOf<
+ "proposed" | "active" | "deprecated" | "superseded"
+ >();
+ expectTypeOf<DecisionRecord["status"]>().toEqualTypeOf<DecisionStatus>();
+ });
+});
+
+describe("Heritage relation shape", () => {
+ it("constrains kind to the six-literal union", () => {
+ expectTypeOf<HeritageKind>().toEqualTypeOf<
+ | "extends"
+ | "implements"
+ | "trait_impl"
+ | "mixin"
+ | "method_overrides"
+ | "method_implements"
+ >();
+ });
+
+ it("treats child_id/parent_id/confidence as optional (raw vs resolved)", () => {
+ const raw: HeritageRelation = {
+ child_name: "Cat",
+ parent_name: "Animal",
+ kind: "extends",
+ line: 10,
+ };
+ expectTypeOf(raw).toEqualTypeOf<HeritageRelation>();
+ expectTypeOf<HeritageRelation["confidence"]>().toEqualTypeOf<
+ number | undefined
+ >();
+ });
+
+ it("SymbolHeritage exposes both directions", () => {
+ expectTypeOf<SymbolHeritage["parents"]>().toEqualTypeOf<
+ HeritageRelation[]
+ >();
+ expectTypeOf<SymbolHeritage["children"]>().toEqualTypeOf<
+ HeritageRelation[]
+ >();
+ });
+});
+
+describe("SecurityFinding canonical shape", () => {
+ it("severity is the three-literal union widened to string", () => {
+ expectTypeOf<SecuritySeverity>().toEqualTypeOf<
+ "high" | "med" | "low" | string
+ >();
+ });
+
+ it("snippet is nullable; detected_at is an ISO string", () => {
+ const f: SecurityFinding = {
+ id: 1,
+ file_path: "src/auth.py",
+ kind: "hardcoded_secret",
+ severity: "high",
+ snippet: null,
+ detected_at: "2026-05-02T00:00:00Z",
+ };
+ expectTypeOf(f.snippet).toEqualTypeOf<string | null>();
+ expectTypeOf(f.detected_at).toEqualTypeOf<string>();
+ });
+});
+
+describe("Canonical Hotspot key shape", () => {
+ it("uses file_path, not path — raw {path} entries must be adapted", () => {
+ expectTypeOf<Hotspot>().toHaveProperty("file_path").toEqualTypeOf<string>();
+ // Some downstream backends emit `path`. A `{ path: ... }` object should
+ // NOT satisfy Hotspot; this is the contract that forces an adapter call.
+ type RawPathHotspot = { path: string };
+ expectTypeOf<RawPathHotspot>().not.toMatchTypeOf<Hotspot>();
+ });
+});
diff --git a/packages/types/package.json b/packages/types/package.json
new file mode 100644
index 000000000..1b1bde4ae
--- /dev/null
+++ b/packages/types/package.json
@@ -0,0 +1,36 @@
+{
+ "name": "@repowise-dev/types",
+ "version": "0.0.1",
+ "private": true,
+ "description": "Canonical TypeScript data contracts for the Repowise dashboard (packages/web) and downstream consumers of the same engine artifacts.",
+ "type": "module",
+ "main": "./src/index.ts",
+ "types": "./src/index.ts",
+ "exports": {
+ ".": "./src/index.ts",
+ "./graph": "./src/graph.ts",
+ "./git": "./src/git.ts",
+ "./docs": "./src/docs.ts",
+ "./decisions": "./src/decisions.ts",
+ "./dead-code": "./src/dead-code.ts",
+ "./symbols": "./src/symbols.ts",
+ "./chat": "./src/chat.ts",
+ "./workspace": "./src/workspace.ts",
+ "./blast-radius": "./src/blast-radius.ts",
+ "./jobs": "./src/jobs.ts",
+ "./settings": "./src/settings.ts",
+ "./security": "./src/security.ts"
+ },
+ "publishConfig": {
+ "registry": "https://npm.pkg.github.com",
+ "access": "restricted"
+ },
+ "scripts": {
+ "type-check": "tsc --noEmit",
+ "test": "vitest run --typecheck"
+ },
+ "devDependencies": {
+ "typescript": "^5.6.0",
+ "vitest": "^2.1.0"
+ }
+}
diff --git a/packages/types/src/blast-radius.ts b/packages/types/src/blast-radius.ts
new file mode 100644
index 000000000..b2e3d5d8a
--- /dev/null
+++ b/packages/types/src/blast-radius.ts
@@ -0,0 +1,51 @@
+/**
+ * Blast-radius types — mirror the OSS engine's `BlastRadius*` schemas
+ * (`packages/server/src/repowise/server/schemas.py`) and the hosted
+ * backend's `app/models/schemas.py` `BlastRadius*` Pydantic models.
+ *
+ * Both backends produce the same shape; this is the canonical TS contract.
+ */
+
+export interface DirectRiskEntry {
+ path: string;
+ /** 0–1 normalised. UI multiplies by 10 for display. */
+ risk_score: number;
+ /** 0–1 normalised. */
+ temporal_hotspot: number;
+ /** 0–1 centrality fraction. */
+ centrality: number;
+}
+
+export interface TransitiveEntry {
+ path: string;
+ depth: number;
+}
+
+export interface CochangeWarning {
+ changed: string;
+ missing_partner: string;
+ /** Co-change frequency count from git history. */
+ score: number;
+}
+
+export interface ReviewerEntry {
+ email: string;
+ files: number;
+ /** 0–1 fraction. UI multiplies by 100 for display. */
+ ownership_pct: number;
+}
+
+export interface BlastRadiusResponse {
+ direct_risks: DirectRiskEntry[];
+ transitive_affected: TransitiveEntry[];
+ cochange_warnings: CochangeWarning[];
+ recommended_reviewers: ReviewerEntry[];
+ test_gaps: string[];
+ /** 0–10. */
+ overall_risk_score: number;
+}
+
+export interface BlastRadiusRequest {
+ changed_files: string[];
+ max_depth?: number;
+}
diff --git a/packages/types/src/chat.ts b/packages/types/src/chat.ts
new file mode 100644
index 000000000..9c65d1975
--- /dev/null
+++ b/packages/types/src/chat.ts
@@ -0,0 +1,323 @@
+/**
+ * Canonical chat types — conversation, messages, and the discriminated-union
+ * `ChatArtifact` type that lets the chat UI render tool results as
+ * mini-visualizations instead of `<pre>{JSON}</pre>`.
+ *
+ * The variants below mirror the artifact shapes actually emitted by the
+ * hosted-backend chat router (`backend/app/routers/chat.py:_tool_*`). They are
+ * convenience-shaped (denormalised, not strict `DecisionRecord[]` /
+ * `DeadCodeFinding[]` / `GraphExport`) because the backend currently passes
+ * raw tool result dicts through the SSE wrapper.
+ *
+ * KNOWN FOLLOWUP — Phase 2D candidate: normalise backend tool results to use
+ * strict typed contracts (`DecisionRecord[]`, `DeadCodeFinding[]`, etc.) so
+ * renderers stop reaching for ad-hoc fields like `mode` or
+ * `high_confidence`/`medium_confidence`. Out of scope for Phase 2B because it
+ * would touch all eight `_tool_*` functions in `backend/app/routers/chat.py`,
+ * rewrite `tests/unit/server/test_mcp.py`, and risk LLM tool-call quality
+ * regressions if information density shrinks.
+ */
+
+import type { GraphExport } from "./graph.js";
+import type { Hotspot } from "./git.js";
+import type { DeadCodeFinding } from "./dead-code.js";
+import type { DecisionRecord } from "./decisions.js";
+
+// ---------------------------------------------------------------------------
+// Conversations + messages
+// ---------------------------------------------------------------------------
+
+export interface Conversation {
+ id: string;
+ repository_id: string;
+ title: string;
+ message_count: number;
+ created_at: string;
+ updated_at: string;
+}
+
+export interface ChatToolCall {
+ id: string;
+ name: string;
+ arguments?: Record<string, unknown>;
+ result?: Record<string, unknown>;
+}
+
+export interface ChatMessage {
+ id: string;
+ conversation_id: string;
+ role: "user" | "assistant";
+ content: {
+ text?: string;
+ tool_calls?: ChatToolCall[];
+ };
+ created_at: string;
+}
+
+// ---------------------------------------------------------------------------
+// UI-flattened message shape (consumed by chat presentation components)
+// ---------------------------------------------------------------------------
+
+export interface ChatUIToolCall {
+ id: string;
+ name: string;
+ arguments: Record<string, unknown>;
+ result?: Record<string, unknown>;
+ summary?: string;
+ artifact?: { type: string; data: Record<string, unknown> };
+ status: "running" | "done" | "error";
+}
+
+export interface ChatUIMessage {
+ id: string;
+ serverId?: string;
+ role: "user" | "assistant";
+ text: string;
+ toolCalls: ChatUIToolCall[];
+ isStreaming: boolean;
+}
+
+// ---------------------------------------------------------------------------
+// Tool-result artifacts (discriminated union)
+// ---------------------------------------------------------------------------
+
+/**
+ * Common citation surface emitted alongside any artifact when the tool
+ * referenced specific files/symbols. Drives `chat/source-citation.tsx`.
+ */
+export interface ChatCitation {
+ file_path: string;
+ symbol_name?: string;
+ start_line?: number;
+ end_line?: number;
+}
+
+/** `get_overview` — repository fact sheet. */
+export interface OverviewArtifactData {
+ total_files: number;
+ total_symbols: number;
+ languages: Record<string, number>;
+ modules: string[];
+ entry_points: string[];
+ hotspot_count: number;
+ git_summary?: Record<string, unknown> | null;
+ is_monorepo: boolean;
+}
+export interface OverviewArtifact {
+ type: "overview";
+ data: OverviewArtifactData;
+}
+
+/** `get_context` — per-target wiki snippet + git/decision context. */
+export interface ContextArtifactData {
+ targets: Record<
+ string,
+ {
+ docs?: { content_md?: string; title?: string; page_type?: string; page_id?: string } | null;
+ hotspot_info?: Record<string, unknown> | null;
+ decisions?: Array<Record<string, unknown>>;
+ [k: string]: unknown;
+ }
+ >;
+}
+export interface ContextArtifact {
+ type: "context";
+ data: ContextArtifactData;
+}
+
+/** `get_risk` — modification risk report per target. */
+export interface RiskReportArtifactData {
+ targets: Array<{
+ file_path: string;
+ churn_percentile?: number;
+ is_hotspot?: boolean;
+ [k: string]: unknown;
+ }>;
+ global_hotspots: Array<{ path: string; churn_percentile: number }>;
+}
+export interface RiskReportArtifact {
+ type: "risk_report";
+ data: RiskReportArtifactData;
+}
+
+/** `search_codebase` — wiki page hits. */
+export interface SearchResultsArtifactData {
+ query: string;
+ results: Array<{
+ title: string;
+ page_type: string;
+ page_id?: string;
+ target_path?: string;
+ snippet?: string;
+ relevance_score?: number;
+ }>;
+}
+export interface SearchResultsArtifact {
+ type: "search_results";
+ data: SearchResultsArtifactData;
+}
+
+/** `get_dependency_path` — short import-graph path. */
+export interface GraphPathArtifactData {
+ path: string[];
+ distance: number;
+ explanation: string;
+}
+export interface GraphPathArtifact {
+ type: "graph";
+ data: GraphPathArtifactData;
+}
+
+/** `get_why` — decision register search results / health dashboard. */
+export interface DecisionsArtifactData {
+ mode: "health" | "search";
+ query?: string;
+ total_decisions?: number;
+ by_source?: Record<string, number>;
+ decisions?: Array<{ title: string; status?: string }>;
+ results?: Array<{
+ title: string;
+ decision: string;
+ rationale?: string;
+ affected_files?: string[];
+ }>;
+}
+export interface DecisionsArtifact {
+ type: "decisions";
+ data: DecisionsArtifactData;
+}
+
+/** `get_dead_code` — confidence-tiered dead-code findings. */
+export interface DeadCodeArtifactData {
+ total_findings: number;
+ deletable_lines: number;
+ high_confidence: Array<{
+ file_path: string;
+ symbol_name?: string | null;
+ kind: string;
+ confidence: number;
+ reason: string;
+ lines: number;
+ safe_to_delete: boolean;
+ }>;
+ medium_confidence: Array<{
+ file_path: string;
+ symbol_name?: string | null;
+ kind: string;
+ confidence: number;
+ reason: string;
+ }>;
+}
+export interface DeadCodeArtifact {
+ type: "dead_code";
+ data: DeadCodeArtifactData;
+}
+
+/** `get_architecture_diagram` — Mermaid flowchart. */
+export interface DiagramArtifactData {
+ diagram_type: string;
+ mermaid_syntax: string;
+ description?: string;
+}
+export interface DiagramArtifact {
+ type: "diagram";
+ data: DiagramArtifactData;
+}
+
+/**
+ * Fallback for tools that haven't yet been promoted to a typed variant.
+ * The renderer falls back to JSON pretty-print for this case.
+ */
+export interface GenericArtifact {
+ type: string;
+ data: Record<string, unknown>;
+}
+
+/** Future variants — declared for the type system, not yet emitted on the wire. */
+export interface HotspotArtifact {
+ type: "hotspot";
+ data: { hotspots: Hotspot[] };
+}
+export interface AnswerArtifact {
+ type: "answer";
+ data: {
+ answer: string;
+ citations: ChatCitation[];
+ confidence: "high" | "medium" | "low";
+ };
+}
+/** Strict-typed future variants — wire-format alternatives mirroring engine canonicals. */
+export interface StrictGraphArtifact {
+ type: "graph_export";
+ data: GraphExport;
+}
+export interface StrictDeadCodeArtifact {
+ type: "dead_code_strict";
+ data: { findings: DeadCodeFinding[] };
+}
+export interface StrictDecisionsArtifact {
+ type: "decisions_strict";
+ data: { decisions: DecisionRecord[] };
+}
+
+/**
+ * Typed variants only — use this when a consumer needs to narrow on `.type`
+ * and access the per-variant `data` shape. The renderer's `switch` exhaust
+ * check should be against this type.
+ */
+export type KnownChatArtifact =
+ | OverviewArtifact
+ | ContextArtifact
+ | RiskReportArtifact
+ | SearchResultsArtifact
+ | GraphPathArtifact
+ | DecisionsArtifact
+ | DeadCodeArtifact
+ | DiagramArtifact;
+
+/**
+ * Full union accepted on the wire. Consumers should branch on
+ * `isKnownChatArtifact(a)` first, then switch on `a.type` for a typed render
+ * path; the `else` falls through to a JSON pretty-print.
+ */
+export type ChatArtifact = KnownChatArtifact | GenericArtifact;
+
+const KNOWN_ARTIFACT_TYPES: ReadonlyArray<KnownChatArtifact["type"]> = [
+ "overview",
+ "context",
+ "risk_report",
+ "search_results",
+ "graph",
+ "decisions",
+ "dead_code",
+ "diagram",
+];
+
+export function isKnownChatArtifact(
+ a: ChatArtifact,
+): a is KnownChatArtifact {
+ return (KNOWN_ARTIFACT_TYPES as readonly string[]).includes(a.type);
+}
+
+// ---------------------------------------------------------------------------
+// SSE event stream
+// ---------------------------------------------------------------------------
+
+export type ChatSSEEvent =
+ | { type: "text_delta"; text: string }
+ | {
+ type: "tool_start";
+ tool_id: string;
+ tool_name: string;
+ input: Record<string, unknown>;
+ }
+ | {
+ type: "tool_result";
+ tool_id: string;
+ tool_name: string;
+ summary: string;
+ artifact: ChatArtifact;
+ citations?: ChatCitation[];
+ }
+ | { type: "done"; conversation_id: string; message_id: string }
+ | { type: "error"; message: string };
diff --git a/packages/types/src/dead-code.ts b/packages/types/src/dead-code.ts
new file mode 100644
index 000000000..6bd639506
--- /dev/null
+++ b/packages/types/src/dead-code.ts
@@ -0,0 +1,44 @@
+/**
+ * Canonical dead-code finding types.
+ *
+ * Canonical source: engine `DeadCodeFindingResponse` + `DeadCodeSummaryResponse`.
+ * Some downstream pipelines emit extra raw-shape fields (`evidence`, `package`,
+ * `last_commit_at`, `commit_count_90d`, `age_days`) — preserved here as
+ * optional so consumer adapters don't lose information when normalising.
+ */
+
+export type DeadCodeStatus = "open" | "wont_fix" | "deleted" | string;
+
+export interface DeadCodeFinding {
+ id: string;
+ kind: string;
+ file_path: string;
+ symbol_name: string | null;
+ symbol_kind: string | null;
+ confidence: number;
+ reason: string;
+ lines: number;
+ safe_to_delete: boolean;
+ primary_owner: string | null;
+ status: DeadCodeStatus;
+ note: string | null;
+ /** Raw engine artifact fields — present in some downstream pipelines, optional here. */
+ evidence?: string[] | null;
+ package?: string | null;
+ last_commit_at?: string | null;
+ commit_count_90d?: number;
+ age_days?: number | null;
+}
+
+export interface DeadCodePatchInput {
+ status: DeadCodeStatus;
+ note?: string;
+}
+
+export interface DeadCodeSummary {
+ total_findings: number;
+ confidence_summary: Record<string, number>;
+ deletable_lines: number;
+ total_lines: number;
+ by_kind: Record<string, number>;
+}
diff --git a/packages/types/src/decisions.ts b/packages/types/src/decisions.ts
new file mode 100644
index 000000000..62f8c3087
--- /dev/null
+++ b/packages/types/src/decisions.ts
@@ -0,0 +1,75 @@
+/**
+ * Canonical decision-record types.
+ *
+ * Canonical source: engine `DecisionRecordResponse`. Some downstream backends
+ * emit a leaner `DecisionEntry` shape that omits `repository_id` and types
+ * `status`/`source` as bare `string` instead of literal unions — consumer
+ * adapters fill defaults before passing data to components.
+ */
+
+export type DecisionStatus =
+ | "proposed"
+ | "active"
+ | "deprecated"
+ | "superseded";
+
+export type DecisionSource =
+ | "git_archaeology"
+ | "inline_marker"
+ | "readme_mining"
+ | "cli";
+
+export interface DecisionRecord {
+ id: string;
+ repository_id: string;
+ title: string;
+ status: DecisionStatus;
+ context: string;
+ decision: string;
+ rationale: string;
+ alternatives: string[];
+ consequences: string[];
+ affected_files: string[];
+ affected_modules: string[];
+ tags: string[];
+ source: DecisionSource;
+ evidence_commits: string[];
+ evidence_file: string | null;
+ evidence_line: number | null;
+ confidence: number;
+ staleness_score: number;
+ superseded_by: string | null;
+ last_code_change: string | null;
+ created_at: string;
+ updated_at: string;
+}
+
+export interface DecisionCreateInput {
+ title: string;
+ context?: string;
+ decision?: string;
+ rationale?: string;
+ alternatives?: string[];
+ consequences?: string[];
+ affected_files?: string[];
+ affected_modules?: string[];
+ tags?: string[];
+}
+
+export interface DecisionStatusUpdate {
+ status: DecisionStatus | string;
+ superseded_by?: string;
+}
+
+export interface DecisionHealth {
+ summary: {
+ active: number;
+ proposed: number;
+ deprecated: number;
+ superseded: number;
+ stale: number;
+ };
+ stale_decisions: DecisionRecord[];
+ proposed_awaiting_review: DecisionRecord[];
+ ungoverned_hotspots: string[];
+}
diff --git a/packages/types/src/docs.ts b/packages/types/src/docs.ts
new file mode 100644
index 000000000..4658330b6
--- /dev/null
+++ b/packages/types/src/docs.ts
@@ -0,0 +1,63 @@
+/**
+ * Canonical doc/wiki types — wiki pages, freshness, coverage rollups.
+ *
+ * Canonical source: engine `PageResponse` (`packages/server/.../schemas.py`).
+ * Some downstream backends type their `DocsResponse.pages` and
+ * `CoverageResponse.pages` as `Array<Record<string, unknown>>` — consumer
+ * adapters cast through the types below before passing data to components.
+ */
+
+export type FreshnessStatus = "fresh" | "stale" | "outdated" | string;
+
+export interface DocPage {
+ id: string;
+ repository_id: string;
+ page_type: string;
+ title: string;
+ content: string;
+ target_path: string;
+ source_hash: string;
+ model_name: string;
+ provider_name: string;
+ input_tokens: number;
+ output_tokens: number;
+ cached_tokens: number;
+ generation_level: number;
+ version: number;
+ confidence: number;
+ freshness_status: FreshnessStatus;
+ metadata: Record<string, unknown>;
+ human_notes: string | null;
+ created_at: string;
+ updated_at: string;
+}
+
+export interface DocPageVersion {
+ id: string;
+ page_id: string;
+ version: number;
+ page_type: string;
+ title: string;
+ content: string;
+ source_hash: string;
+ model_name: string;
+ provider_name: string;
+ input_tokens: number;
+ output_tokens: number;
+ confidence: number;
+ archived_at: string;
+}
+
+export interface DocPageList {
+ pages: DocPage[];
+ total: number;
+}
+
+export interface CoverageRollup {
+ available: boolean;
+ total_pages: number;
+ fresh: number;
+ stale: number;
+ outdated: number;
+ pages: DocPage[];
+}
diff --git a/packages/types/src/git.ts b/packages/types/src/git.ts
new file mode 100644
index 000000000..13d89d1b1
--- /dev/null
+++ b/packages/types/src/git.ts
@@ -0,0 +1,111 @@
+/**
+ * Canonical git-intelligence types — hotspots, ownership, bus factor, summary.
+ *
+ * Canonical source: engine `PipelineResult.git_metadata` (per-file) and
+ * the rollups produced by `packages/web` UI. Downstream pipelines that emit
+ * a different key (e.g. `path` instead of `file_path`) must rename via an
+ * adapter before passing data to components.
+ */
+
+export interface FileAuthor {
+ name: string;
+ email: string;
+ commit_count: number;
+ pct: number;
+}
+
+export interface SignificantCommit {
+ sha: string;
+ date: string;
+ message: string;
+ author: string;
+}
+
+export interface CoChangePartner {
+ file_path: string;
+ co_change_count: number;
+}
+
+export interface GitMetadata {
+ file_path: string;
+ commit_count_total: number;
+ commit_count_90d: number;
+ commit_count_30d: number;
+ first_commit_at: string | null;
+ last_commit_at: string | null;
+ primary_owner_name: string | null;
+ primary_owner_email: string | null;
+ primary_owner_commit_pct: number | null;
+ recent_owner_name: string | null;
+ recent_owner_commit_pct: number | null;
+ top_authors: FileAuthor[];
+ significant_commits: SignificantCommit[];
+ co_change_partners: CoChangePartner[];
+ is_hotspot: boolean;
+ is_stable: boolean;
+ churn_percentile: number;
+ age_days: number;
+ bus_factor: number;
+ contributor_count: number;
+ lines_added_90d: number;
+ lines_deleted_90d: number;
+ avg_commit_size: number;
+ commit_categories: Record<string, number>;
+ merge_commit_count_90d: number;
+ test_gap?: boolean | null;
+ /** v0.2.0+ — combined recency × churn × ownership score. Order hotspots by this when present. */
+ temporal_hotspot_score?: number | null;
+}
+
+export interface Hotspot {
+ file_path: string;
+ commit_count_90d: number;
+ commit_count_30d: number;
+ churn_percentile: number;
+ temporal_hotspot_score?: number | null;
+ primary_owner: string | null;
+ is_hotspot: boolean;
+ is_stable: boolean;
+ bus_factor: number;
+ contributor_count: number;
+ lines_added_90d: number;
+ lines_deleted_90d: number;
+ avg_commit_size: number;
+ commit_categories: Record<string, number>;
+}
+
+export interface OwnershipEntry {
+ module_path: string;
+ primary_owner: string | null;
+ owner_pct: number | null;
+ file_count: number;
+ is_silo: boolean;
+}
+
+export interface TopOwner {
+ name: string;
+ email?: string;
+ file_count: number;
+ pct: number;
+}
+
+export interface GitSummary {
+ total_files: number;
+ hotspot_count: number;
+ stable_count: number;
+ average_churn_percentile: number;
+ top_owners: TopOwner[];
+}
+
+export interface BusFactorEntry {
+ path: string;
+ bus_factor: number;
+ top_author: string;
+ top_author_pct: number;
+ contributor_count: number;
+}
+
+export interface BusFactor {
+ files: BusFactorEntry[];
+ overall_bus_factor: number;
+}
diff --git a/packages/types/src/graph.ts b/packages/types/src/graph.ts
new file mode 100644
index 000000000..1c60409a5
--- /dev/null
+++ b/packages/types/src/graph.ts
@@ -0,0 +1,254 @@
+/**
+ * Canonical graph types — file/module dependency graph plus graph-intelligence
+ * surfaces (callers/callees, communities, execution flows, metrics).
+ *
+ * Canonical source: engine `PipelineResult.graph` (NetworkX node_link_data
+ * format) and the per-symbol intelligence endpoints in
+ * `packages/server/src/repowise/server/schemas.py`.
+ *
+ * Some downstream backends emit a looser `{ nodes, links, directed?, multigraph? }`
+ * shape; consumer-side adapters are responsible for converting that to
+ * `GraphExport` below before passing data to components.
+ */
+
+// ---------------------------------------------------------------------------
+// Core node + link
+// ---------------------------------------------------------------------------
+
+export interface GraphNode {
+ node_id: string;
+ node_type: string;
+ language: string;
+ symbol_count: number;
+ pagerank: number;
+ betweenness: number;
+ community_id: number;
+ is_test: boolean;
+ is_entry_point: boolean;
+ has_doc: boolean;
+}
+
+export interface GraphLink {
+ source: string;
+ target: string;
+ imported_names: string[];
+ /** Edge kind from v0.4.0 framework-aware extractors (e.g. "spring.bean", "rails.route"). */
+ edge_type?: string;
+ /** Confidence score for resolved symbol-level call edges (v0.4.x). */
+ confidence?: number;
+}
+
+export interface GraphExport {
+ nodes: GraphNode[];
+ links: GraphLink[];
+}
+
+// ---------------------------------------------------------------------------
+// NetworkX-shaped raw payload (what some downstream backends emit)
+// ---------------------------------------------------------------------------
+
+export interface RawGraphNode {
+ id?: string;
+ node_id?: string;
+ label?: string;
+ type?: string;
+ language?: string;
+ loc?: number;
+ is_test?: boolean;
+ is_config?: boolean;
+ is_entry_point?: boolean;
+ community?: number;
+ community_id?: number;
+ pagerank?: number;
+ betweenness?: number;
+ symbol_count?: number;
+ has_doc?: boolean;
+ [extra: string]: unknown;
+}
+
+export interface RawGraphLink {
+ source: string;
+ target: string;
+ kind?: string;
+ weight?: number;
+ confidence?: number;
+ imported_names?: string[];
+ edge_type?: string;
+ [extra: string]: unknown;
+}
+
+export interface RawGraph {
+ nodes: RawGraphNode[];
+ links?: RawGraphLink[];
+ edges?: RawGraphLink[];
+ directed?: boolean;
+ multigraph?: boolean;
+}
+
+export interface RawGraphResponse {
+ graph: RawGraph;
+ pagerank: Record<string, number>;
+ betweenness: Record<string, number>;
+ communities: Record<string, number>;
+}
+
+// ---------------------------------------------------------------------------
+// Module rollup
+// ---------------------------------------------------------------------------
+
+export interface ModuleNode {
+ module_id: string;
+ file_count: number;
+ symbol_count: number;
+ avg_pagerank: number;
+ doc_coverage_pct: number;
+}
+
+export interface ModuleEdge {
+ source: string;
+ target: string;
+ edge_count: number;
+}
+
+export interface ModuleGraph {
+ nodes: ModuleNode[];
+ edges: ModuleEdge[];
+}
+
+// ---------------------------------------------------------------------------
+// Ego (neighborhood) graph
+// ---------------------------------------------------------------------------
+
+export interface EgoGraph {
+ nodes: GraphNode[];
+ links: GraphLink[];
+ center_node_id: string;
+ /** Optional git metadata for the center file. Present when the engine has indexed git history. */
+ center_git_meta?: import("./git.js").GitMetadata | null;
+ inbound_count: number;
+ outbound_count: number;
+}
+
+// ---------------------------------------------------------------------------
+// Path finder
+// ---------------------------------------------------------------------------
+
+export interface GraphPath {
+ path: string[];
+ distance: number;
+ explanation: string;
+ visual_context?: unknown;
+}
+
+/**
+ * Lightweight node-search result used by the path finder autocomplete.
+ * Mirrors `NodeSearchResultResponse` from the engine.
+ */
+export interface NodeSearchResult {
+ node_id: string;
+ language: string;
+ symbol_count: number;
+}
+
+// ---------------------------------------------------------------------------
+// Symbol-level intelligence (v0.4.x)
+// ---------------------------------------------------------------------------
+
+export interface SymbolNodeSummary {
+ symbol_id: string;
+ name: string;
+ kind: string;
+ file: string;
+ start_line?: number | null;
+ signature?: string | null;
+}
+
+export interface CallerCalleeEntry {
+ symbol_id: string;
+ name: string;
+ kind: string;
+ file: string;
+ start_line?: number | null;
+ edge_type: string;
+ confidence: number;
+}
+
+export interface CallersCallees {
+ symbol_id: string;
+ symbol: SymbolNodeSummary;
+ callers: CallerCalleeEntry[];
+ callees: CallerCalleeEntry[];
+ caller_count: number;
+ callee_count: number;
+ truncated: boolean;
+}
+
+// ---------------------------------------------------------------------------
+// Communities (Leiden — v0.4.0)
+// ---------------------------------------------------------------------------
+
+export interface CommunityMember {
+ path: string;
+ pagerank: number;
+ is_entry_point: boolean;
+}
+
+export interface NeighboringCommunity {
+ community_id: number;
+ label: string;
+ cross_edge_count: number;
+}
+
+export interface CommunityDetail {
+ community_id: number;
+ label: string;
+ cohesion: number;
+ member_count: number;
+ members: CommunityMember[];
+ truncated: boolean;
+ neighboring_communities: NeighboringCommunity[];
+}
+
+export interface CommunitySummaryItem {
+ community_id: number;
+ label: string;
+ cohesion: number;
+ member_count: number;
+ top_file: string;
+}
+
+// ---------------------------------------------------------------------------
+// Graph metrics + execution flows
+// ---------------------------------------------------------------------------
+
+export interface GraphMetrics {
+ target: string;
+ node_type: string;
+ pagerank: number;
+ pagerank_percentile: number;
+ betweenness: number;
+ betweenness_percentile: number;
+ community_id: number;
+ community_label: string | null;
+ is_entry_point: boolean;
+ in_degree: number;
+ out_degree: number;
+ entry_point_score?: number | null;
+ kind?: string | null;
+ file?: string | null;
+}
+
+export interface ExecutionFlowEntry {
+ entry_point: string;
+ entry_point_name: string;
+ entry_point_score: number;
+ trace: string[];
+ depth: number;
+ crosses_community: boolean;
+ communities_visited: number[];
+}
+
+export interface ExecutionFlows {
+ total_entry_points: number;
+ flows: ExecutionFlowEntry[];
+}
diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts
new file mode 100644
index 000000000..5145ecf47
--- /dev/null
+++ b/packages/types/src/index.ts
@@ -0,0 +1,21 @@
+/**
+ * @repowise-dev/types — canonical TypeScript data contracts for the Repowise
+ * dashboard (`packages/web`) and any downstream consumer that renders the
+ * same engine artifacts.
+ *
+ * Re-exports per-domain modules. Subpath imports (`@repowise-dev/types/graph`)
+ * are also supported via the `exports` map in package.json.
+ */
+
+export * from "./graph.js";
+export * from "./git.js";
+export * from "./docs.js";
+export * from "./decisions.js";
+export * from "./dead-code.js";
+export * from "./symbols.js";
+export * from "./chat.js";
+export * from "./workspace.js";
+export * from "./blast-radius.js";
+export * from "./jobs.js";
+export * from "./settings.js";
+export * from "./security.js";
diff --git a/packages/types/src/jobs.ts b/packages/types/src/jobs.ts
new file mode 100644
index 000000000..a78ea21a7
--- /dev/null
+++ b/packages/types/src/jobs.ts
@@ -0,0 +1,27 @@
+/**
+ * Indexing / generation job artifact shapes.
+ *
+ * Mirrors the engine's `JobResponse` Pydantic schema. Used by the dashboard
+ * `ActiveJobBanner` and `QuickActions` shells, plus the OSS web `JobLog`
+ * family. Hosted-side hooks resolve and forward into these contracts.
+ */
+
+export type JobStatus = "pending" | "running" | "completed" | "failed" | "paused";
+
+export interface Job {
+ id: string;
+ repository_id: string;
+ status: JobStatus;
+ provider_name: string;
+ model_name: string;
+ total_pages: number;
+ completed_pages: number;
+ failed_pages: number;
+ current_level: number;
+ error_message: string | null;
+ config: Record<string, unknown>;
+ created_at: string;
+ updated_at: string;
+ started_at: string | null;
+ finished_at: string | null;
+}
diff --git a/packages/types/src/security.ts b/packages/types/src/security.ts
new file mode 100644
index 000000000..de4e7554e
--- /dev/null
+++ b/packages/types/src/security.ts
@@ -0,0 +1,23 @@
+/**
+ * Canonical security finding types.
+ *
+ * Mirrors the engine's `security_findings` table (per-snapshot persisted
+ * results from the `security_scan` analyser) and the consumer-side shape
+ * already used by the OSS web `listSecurityFindings` API client.
+ */
+
+export type SecuritySeverity = "high" | "med" | "low" | string;
+
+export interface SecurityFinding {
+ id: number;
+ file_path: string;
+ kind: string;
+ severity: SecuritySeverity;
+ snippet: string | null;
+ detected_at: string;
+}
+
+export interface SecurityFindingList {
+ total: number;
+ findings: SecurityFinding[];
+}
diff --git a/packages/types/src/settings.ts b/packages/types/src/settings.ts
new file mode 100644
index 000000000..31626d353
--- /dev/null
+++ b/packages/types/src/settings.ts
@@ -0,0 +1,13 @@
+/**
+ * Per-repo settings form value contract.
+ *
+ * Hosted ships a read-only variant — the @repowise-dev/ui shell receives an
+ * optional `onSubmit`; if absent, the form renders disabled. OSS web wires
+ * the full save round-trip via its own `updateRepo` API.
+ */
+
+export interface RepoSettingsValue {
+ name: string;
+ default_branch: string;
+ exclude_patterns: string[];
+}
diff --git a/packages/types/src/symbols.ts b/packages/types/src/symbols.ts
new file mode 100644
index 000000000..0448887d4
--- /dev/null
+++ b/packages/types/src/symbols.ts
@@ -0,0 +1,95 @@
+/**
+ * Canonical symbol types.
+ *
+ * Canonical source: engine `SymbolResponse`. Some downstream backends emit a
+ * leaner shape that omits `repository_id` and `symbol_id` — consumer-side
+ * adapters synthesise both before passing data to components.
+ */
+
+export type SymbolKind =
+ | "function"
+ | "method"
+ | "class"
+ | "interface"
+ | "struct"
+ | "enum"
+ | "trait"
+ | "module"
+ | "variable"
+ | "type"
+ | string;
+
+export type SymbolVisibility = "public" | "private" | "protected" | string;
+
+/** Renamed `CodeSymbol` to avoid shadowing the global `Symbol`. */
+export interface CodeSymbol {
+ id: string;
+ repository_id: string;
+ file_path: string;
+ symbol_id: string;
+ name: string;
+ qualified_name: string;
+ kind: SymbolKind;
+ signature: string;
+ start_line: number;
+ end_line: number;
+ docstring: string | null;
+ visibility: SymbolVisibility;
+ is_async: boolean;
+ complexity_estimate: number;
+ language: string;
+ parent_name: string | null;
+}
+
+export interface SymbolList {
+ total: number;
+ symbols: CodeSymbol[];
+}
+
+// ---------------------------------------------------------------------------
+// Heritage (extends / implements / trait_impl / mixin / overrides)
+// ---------------------------------------------------------------------------
+
+/**
+ * Heritage relation kinds. Mirrors the engine's edge_type values for
+ * heritage edges in the symbol graph plus the raw AST-level "mixin" kind.
+ */
+export type HeritageKind =
+ | "extends"
+ | "implements"
+ | "trait_impl"
+ | "mixin"
+ | "method_overrides"
+ | "method_implements";
+
+/**
+ * A single resolved heritage edge.
+ *
+ * `child_id` and `parent_id` are symbol-graph node IDs (e.g.
+ * `src/app.py::MyClass`). `confidence` is present for resolved relations
+ * (0.0–1.0) and absent for raw, unresolved entries lifted directly out of
+ * `parsed_files.json::heritage` (in which case only `child_name`,
+ * `parent_name`, `kind`, and `line` are meaningful).
+ */
+export interface HeritageRelation {
+ child_id?: string;
+ parent_id?: string;
+ child_name: string;
+ parent_name: string;
+ kind: HeritageKind;
+ line: number;
+ confidence?: number;
+}
+
+/**
+ * Heritage view for a single symbol — both directions of the relation.
+ *
+ * `parents` are the relations where this symbol is the child (i.e. what it
+ * extends/implements). `children` are the relations where this symbol is the
+ * parent (i.e. what extends/implements it).
+ */
+export interface SymbolHeritage {
+ symbol_id: string;
+ parents: HeritageRelation[];
+ children: HeritageRelation[];
+}
diff --git a/packages/types/src/workspace.ts b/packages/types/src/workspace.ts
new file mode 100644
index 000000000..f0068e9c5
--- /dev/null
+++ b/packages/types/src/workspace.ts
@@ -0,0 +1,61 @@
+/**
+ * Canonical workspace types — multi-repo views (cross-repo summary, shared
+ * contracts, co-changes) plus a few shared per-repo aggregates that the
+ * workspace UI consumes directly.
+ *
+ * Canonical source: engine `WorkspaceResponse` and the per-domain rollups
+ * (RepoStats, GitSummary). Downstream backends should rename via an adapter
+ * to match these field names before passing to UI components.
+ */
+
+export interface RepoStats {
+ file_count: number;
+ symbol_count: number;
+ entry_point_count: number;
+ doc_coverage_pct: number;
+ freshness_score: number;
+ dead_export_count: number;
+}
+
+export interface WorkspaceCrossRepoSummary {
+ co_change_count: number;
+ package_dep_count: number;
+ top_connections: Array<{ repos: string[]; edge_count: number }>;
+}
+
+export interface WorkspaceContractSummary {
+ total_contracts: number;
+ total_links: number;
+ by_type: Record<string, number>;
+}
+
+export interface WorkspaceContractLinkEntry {
+ contract_id: string;
+ contract_type: string;
+ match_type: string;
+ confidence: number;
+ provider_repo: string;
+ provider_file: string;
+ provider_symbol: string;
+ consumer_repo: string;
+ consumer_file: string;
+ consumer_symbol: string;
+}
+
+export interface WorkspaceCoChangeEntry {
+ source_repo: string;
+ source_file: string;
+ target_repo: string;
+ target_file: string;
+ strength: number;
+ frequency: number;
+ last_date: string;
+}
+
+export interface WorkspacePackageDepEntry {
+ source_repo: string;
+ source_manifest: string;
+ target_repo: string;
+ target_package: string;
+ kind: string;
+}
diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json
new file mode 100644
index 000000000..43bc507f1
--- /dev/null
+++ b/packages/types/tsconfig.json
@@ -0,0 +1,20 @@
+{
+ "compilerOptions": {
+ "target": "ES2022",
+ "module": "ESNext",
+ "moduleResolution": "Bundler",
+ "lib": ["ES2022"],
+ "strict": true,
+ "noUncheckedIndexedAccess": true,
+ "exactOptionalPropertyTypes": true,
+ "noImplicitOverride": true,
+ "isolatedModules": true,
+ "esModuleInterop": true,
+ "skipLibCheck": true,
+ "declaration": true,
+ "declarationMap": true,
+ "noEmit": true,
+ "types": ["vitest/globals"]
+ },
+ "include": ["src/**/*.ts", "__tests__/**/*.ts"]
+}
diff --git a/packages/types/vitest.config.ts b/packages/types/vitest.config.ts
new file mode 100644
index 000000000..ad1820dd9
--- /dev/null
+++ b/packages/types/vitest.config.ts
@@ -0,0 +1,8 @@
+import { defineConfig } from "vitest/config";
+
+export default defineConfig({
+ test: {
+ include: ["__tests__/**/*.test.ts"],
+ typecheck: { enabled: true, include: ["__tests__/**/*.test.ts"] },
+ },
+});
diff --git a/packages/ui/COMPONENT_CONTRACTS.md b/packages/ui/COMPONENT_CONTRACTS.md
new file mode 100644
index 000000000..3479bd0fd
--- /dev/null
+++ b/packages/ui/COMPONENT_CONTRACTS.md
@@ -0,0 +1,1101 @@
+# @repowise-dev/ui — Component Contracts
+
+This document is the public-facing prop contract for components in
+`@repowise-dev/ui`. Each section lists the prop interface, with types
+sourced from `@repowise-dev/types` where the prop carries an engine
+artifact. Components are presentational: they accept canonical data
+via props, manage only UI-local state internally, and emit user
+intent via callbacks. Data fetching, mutation, and routing live in
+the consumer.
+
+The contract is the package's public API. Breaking changes here
+should be deliberate and called out in PR titles.
+
+---
+
+## `ui/*` — Radix-CVA primitives
+
+Standard shadcn-style primitives wrapping Radix UI: `Badge`, `Button`,
+`Card` (+ `CardHeader`/`CardTitle`/`CardDescription`/`CardContent`/
+`CardFooter`), `ConfirmDialog`, `Dialog` (+ all `Dialog*` parts),
+`Input`, `Label`, `Progress`, `ScrollArea`, `Select` (+ `Select*`
+parts), `Separator`, `Sheet` (+ `Sheet*` parts), `Skeleton`, `Slider`,
+`Switch`, `Tabs` (+ `Tabs*` parts), `Tooltip` (+ `Tooltip*` parts).
+
+Props mirror the underlying Radix primitive plus a `className` prop
+merged via `cn` (`tailwind-merge` + `clsx`). `Button` and `Badge`
+expose CVA `variant` and `size` unions documented inline at the
+component definition.
+
+---
+
+## `shared/api-error` — `ApiError`
+
+Renders an inline error card with retry affordance.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `error` | `Error \| null \| undefined` | yes | Surfaced in the card; `null` / `undefined` renders nothing. |
+| `onRetry` | `() => void` | no | When provided, a "Retry" button is rendered. |
+| `className` | `string` | no | Forwarded to the outer container. |
+
+---
+
+## `shared/empty-state` — `EmptyState`
+
+Empty-list placeholder with optional icon and CTA.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `title` | `string` | yes | Heading text. |
+| `description` | `string` | no | Sub-line; shown below the title. |
+| `icon` | `React.ReactNode` | no | Rendered above the title. |
+| `action` | `{ label: string; onClick: () => void }` | no | Renders a primary `Button` when supplied. |
+| `className` | `string` | no | Forwarded to the outer container. |
+
+---
+
+## `shared/stat-card` — `StatCard`
+
+Single-stat display tile.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `label` | `string` | yes | Uppercase label above the value. |
+| `value` | `string \| number` | yes | Rendered tabular-nums. |
+| `description` | `string` | no | Caption under the value. |
+| `trend` | `{ value: string; positive: boolean }` | no | Renders an up/down arrow next to the value. |
+| `icon` | `React.ReactNode` | no | Right-aligned glyph. |
+| `className` | `string` | no | Forwarded to the outer Card. |
+| `href` | `string` | no | Reserved for a follow-up routing prop; currently inert. |
+
+---
+
+## `coverage/coverage-donut` — `CoverageDonut`
+
+Recharts donut visualising fresh/stale/outdated counts with a centred
+percentage label for the fresh slice.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `fresh` | `number` | yes | Count of fresh pages. |
+| `stale` | `number` | yes | Count of stale pages. |
+| `outdated` | `number` | yes | Count of outdated pages. |
+
+Behaviour: zero-value slices are filtered before render; if all three
+are zero the donut renders empty and the centre text shows `0%`.
+
+---
+
+## `decisions/decision-health-widget` — `DecisionHealthWidget`
+
+Three-card summary tile for active / proposed / stale counts.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `health` | `DecisionHealth \| undefined` (`@repowise-dev/types/decisions`) | yes | Renders nothing while undefined; useful for the "loading or absent" state. |
+
+---
+
+## `decisions/decisions-table` — `DecisionsTable`
+
+Filterable table of `DecisionRecord` rows with status + source dropdowns.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `decisions` | `DecisionRecord[] \| undefined` (`@repowise-dev/types/decisions`) | yes | Filtered list as resolved by the caller. |
+| `filters` | `DecisionsTableFilters` | yes | Controlled. Caller mirrors these into fetch keys so filter changes drive a re-fetch. |
+| `onFiltersChange` | `(filters: DecisionsTableFilters) => void` | yes | Fires on every dropdown change. |
+| `repoId` | `string` | yes | Used to build the `/repos/{repoId}/decisions/{id}` link target for each row. |
+| `error` | `unknown` | no | Truthy on a failed fetch; renders an inline retry message. |
+| `isLoading` | `boolean` | no | Suppresses the "no decisions found" empty-state during the first fetch. |
+| `onRetry` | `() => void` | no | Wired to the inline retry button when `error` is truthy. |
+
+Filter unions:
+- `DecisionStatusFilter` = `DecisionStatus \| "all"`
+- `DecisionSourceFilter` = `DecisionSource \| "all"`
+
+---
+
+## `dead-code/summary-bar` — `SummaryBar`
+
+Four-tile summary header for a dead-code report: total findings,
+deletable lines, breakdown by kind, breakdown by confidence band.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `summary` | `DeadCodeSummary` (`@repowise-dev/types/dead-code`) | yes | Caller fetches the rollup. |
+
+---
+
+## `docs/docs-tree` — `DocsTree`
+
+Filterable, collapsible directory tree of `DocPage` entries. Special
+pages (`repo_overview`, `architecture_diagram`) appear at the top
+level; module pages become directories with their page attached;
+file pages nest under their parent directory.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `pages` | `DocPage[]` (`@repowise-dev/types/docs`) | yes | Caller fetches; tree builds the directory hierarchy each render. |
+| `selectedPageId` | `string \| null` | yes | Currently-active page id; the matching node is highlighted. |
+| `onSelectPage` | `(page: DocPage) => void` | yes | Fires on leaf-page or module-page click. |
+| `className` | `string` | no | Forwarded to the outer container. |
+
+Behaviour: built-in search, type filter (`all` / `file_page` /
+`module_page` / `symbol_spotlight` / `repo_overview`), and freshness
+filter (`all` / `fresh` / `stale` / `outdated`). Filter state is
+UI-local — there's no fetch coupling.
+
+---
+
+## `coverage/freshness-table` — `FreshnessTable`
+
+Filterable table of `DocPage` rows with per-row regenerate action.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `pages` | `DocPage[]` (`@repowise-dev/types/docs`) | yes | Caller fetches the list. The table does not mutate. |
+| `onRegenerate` | `(pageId: string) => Promise<void>` | no | Caller wires to a mutation API. The table tracks per-row pending state internally and disables the row's button while in flight. Omit to hide the regenerate column. |
+
+Behaviour:
+
+- Filter tabs (`All`, `Fresh`, `Stale`, `Outdated`) are UI-local state;
+ the canonical `freshness_status` field on `DocPage` is the filter
+ predicate.
+- Confidence column is colour-graded against the same thresholds as
+ `lib/confidence.scoreToStatus`.
+- Empty state (`EmptyState`) appears when the filtered set is empty.
+
+---
+
+## `git/*` — Hotspot, ownership, and contributor visualisations
+
+All twelve components are presentational and accept canonical engine
+artifacts via props (`Hotspot`, `OwnershipEntry` from `@repowise-dev/types/git`,
+or anonymous shapes for partner / owner / category records). None reach
+out to data hooks or mutation APIs — fetching belongs to the caller.
+
+### `git/churn-bar` — `ChurnBar`
+
+Inline horizontal bar shaded green/yellow/red against thresholds at
+50% / 75% percentile.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `percentile` | `number` (0–100, clamped) | yes |
+| `className` | `string` | no |
+
+### `git/co-change-list` — `CoChangeList`
+
+Top-5 co-change partners with relative-magnitude bars.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `partners` | `Array<{ file_path: string; co_change_count: number }>` | yes |
+
+### `git/churn-histogram` — `ChurnHistogram`
+
+Recharts bar chart binning hotspots into 10-percentile buckets.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `hotspots` | `Hotspot[]` (`@repowise-dev/types/git`) | yes |
+
+### `git/commit-category-donut` — `CommitCategoryDonut`
+
+Recharts donut with centred dominant-category label. Returns `null`
+when the total is zero.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `categories` | `Record<string, number>` | yes |
+
+### `git/commit-category-sparkline` — `CommitCategorySparkline`
+
+Single-row stacked bar sized by category counts; each segment wears a
+tooltip. Returns `null` when the total is zero.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `categories` | `Record<string, number>` | yes |
+
+### `git/contributor-bar` — `ContributorBar`
+
+Top-5 horizontal bar of files-by-owner.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `owners` | `Array<{ name; email?; file_count; pct }>` | yes |
+
+### `git/contributor-network` — `ContributorNetwork`
+
+Force-directed (`d3-force`) co-ownership graph. Computes nodes/links
+from `hotspots[].primary_owner` and shared-file overlap; top-20
+contributors only.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `hotspots` | `Hotspot[]` (`@repowise-dev/types/git`) | yes |
+
+### `git/hotspot-table` — `HotspotTable`
+
+Searchable, filterable, sortable table of hotspots. Filter chips:
+`all` / `hot` / `risk` / `accelerating`. Sortable columns:
+`commits` / `churn` / `trend`. UI-local state — no fetch coupling.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `hotspots` | `Hotspot[]` (`@repowise-dev/types/git`) | yes |
+
+### `git/ownership-table` — `OwnershipTable`
+
+Search + silo filter over module ownership rows.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `entries` | `OwnershipEntry[]` (`@repowise-dev/types/git`) | yes |
+
+### `git/ownership-treemap` — `OwnershipTreemap`
+
+Treemap (`d3-hierarchy`) with file-count area, owner-hash colour, and
+silo highlight stroke. Hover tooltips computed against the container's
+bounding rect.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `entries` | `OwnershipEntry[]` (`@repowise-dev/types/git`) | yes |
+
+### `git/risk-distribution-chart` — `RiskDistributionChart`
+
+Top-30 risk-scored vertical bar chart with average reference line.
+Score = `0.4·churn + 0.35·busFactor + 0.25·trend`, all normalised to
+0–100.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `hotspots` | `Hotspot[]` (`@repowise-dev/types/git`) | yes |
+
+### `git/bus-factor-panel` — `BusFactorPanel`
+
+Stacked bar of safe / warning / risk counts plus a top-5 highest-risk
+files list.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `hotspots` | `Hotspot[]` (`@repowise-dev/types/git`) | yes |
+
+---
+
+## `jobs/job-log` — `JobLog`
+
+Auto-scrolling fixed-height log viewer for streaming job progress
+entries.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `entries` | `Array<{ text: string; level?: number }>` | yes | Caller accumulates from SSE / poll. |
+| `maxLines` | `number` | no | Tail length; default `6`. |
+
+## `jobs/generation-progress` — `GenerationProgress`
+
+Status header, progress bar, live cost, summary tiles, and embedded
+`JobLog` for a documentation-generation job. Presentational — the
+caller polls / streams the job and forwards the snapshot via props.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `job` | `GenerationProgressJob \| undefined` | yes | Local subset of the engine `Job` shape (id, status, total/completed_pages, current_level, started_at, error_message, config). |
+| `log` | `Array<{ text: string }>` | yes | Caller accumulates SSE log events. |
+| `elapsed` | `number` | yes | Wall-clock elapsed in ms. Caller owns the interval. |
+| `actualCost` | `number \| null` | yes | Live USD cost; `null` until the first cost-bearing event. |
+| `stuckPending` | `boolean` | yes | Caller decides — typically `pending && !started_at && elapsed > threshold`. |
+| `cancelling` | `boolean` | yes | Disables the Cancel button while in flight. |
+| `onCancel` | `() => void` | yes | Caller wires to the cancel mutation; toasts/error handling live there. |
+
+---
+
+## `symbols/symbol-graph-panel` — `SymbolGraphPanel`
+
+Right-column graph-intelligence panel for a focused symbol: pagerank /
+betweenness percentile bars, in/out degree, community label, optional
+entry-point score, callers/callees, and heritage (extends/implements).
+Presentational.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `metrics` | `GraphMetrics \| undefined` (`@repowise-dev/types/graph`) | yes | |
+| `metricsLoading` | `boolean` | yes | |
+| `callData` | `CallersCallees \| undefined` (`@repowise-dev/types/graph`) | yes | |
+| `callsLoading` | `boolean` | yes | |
+| `heritageData` | `CallersCallees \| undefined` | no | When omitted or empty, the heritage section is hidden. |
+
+## `symbols/symbol-drawer` — `SymbolDrawer`
+
+Modal dialog over a focused symbol: signature, docstring, parent, plus
+an optional right-column slot for the graph-intelligence panel.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `symbol` | `CodeSymbol \| null` (`@repowise-dev/types/symbols`) | yes | `null` closes the dialog. |
+| `onClose` | `() => void` | yes | |
+| `graphPanel` | `ReactNode` | no | Caller passes a data-coupled `<SymbolGraphPanelWrapper>`; omit to hide the column. |
+
+## `symbols/symbol-table` — `SymbolTable`, `SymbolTableProps`, `SortCol`, `SortDir`
+
+Filterable, sortable table of symbols with importance bars and a
+configurable drawer slot. Server-driven filters (`q`, `kind`,
+`language`) are controlled props because they affect fetch keys; sort
+state is UI-local.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `items` | `CodeSymbol[]` | yes | Caller fetches; flattened across pages. |
+| `importanceScores` | `Map<string, number>` | yes | Normalised 0–1, indexed by `symbol.id`. Caller computes from pagerank × log(complexity). |
+| `isLoading` / `isValidating` | `boolean` | yes | First-load skeleton vs. load-more spinner. |
+| `hasMore` | `boolean` | yes | Renders the Load-more button. |
+| `q` / `onQChange` | `string` / `(v) => void` | yes | Search query. Caller debounces before driving the fetch. |
+| `kind` / `onKindChange` | `string` / `(v) => void` | yes | Filter union; `"all"` is the off state. |
+| `language` / `onLanguageChange` | `string` / `(v) => void` | yes | Same as kind. |
+| `onLoadMore` | `() => void` | yes | Wired to the SWR `setSize` increment. |
+| `onSelect` | `(sym: CodeSymbol) => void` | yes | Caller drives the drawer state. |
+| `drawer` | `ReactNode` | no | Caller renders `<SymbolDrawer>` with its own data wiring. |
+
+---
+
+## `wiki/code-block` — `CodeBlock`
+
+Server-rendered fenced code block. The caller passes pre-highlighted
+HTML (e.g. from Shiki) plus the raw code for copy-to-clipboard.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `code` | `string` | yes | Raw text used for the copy action. |
+| `language` | `string` | no | Shown in the header bar. |
+| `html` | `string` | yes | Trusted HTML, set via `dangerouslySetInnerHTML`. |
+
+## `wiki/confidence-badge` — `ConfidenceBadge`
+
+Coloured pill showing freshness status (`fresh` / `stale` / `outdated`).
+Computes status from `score` unless `status` is supplied. When stale
+with `staleSince`, wraps in a tooltip exposing the date and confidence.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `score` | `number` (0–1) | yes |
+| `status` | `string` | no |
+| `showScore` | `boolean` | no |
+| `staleSince` | `string \| null` | no |
+| `className` | `string` | no |
+
+## `wiki/git-history-panel` — `GitHistoryPanel`
+
+Sidebar panel summarising file lifecycle, commit categories, top
+authors with bars, co-change partners, and recent commits.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `git` | `GitMetadata` (`@repowise-dev/types/git`) | yes |
+
+## `wiki/mermaid-diagram` — `MermaidDiagram`
+
+Client-side mermaid renderer with dynamic import to avoid SSR. Uses a
+dark theme matched to the design tokens. Failures render an inline
+error card.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `chart` | `string` | yes |
+
+## `wiki/table-of-contents` — `TableOfContents`
+
+Extracts `#`/`##`/`###` headings from a markdown string and renders an
+anchor list. An `IntersectionObserver` highlights the active heading.
+Returns `null` when fewer than two headings are found.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `content` | `string` | yes |
+
+## `graph/*` — Graph layout, presentation, and chrome
+
+Presentational graph pieces — chrome (toolbar/legend/sidebar/menu),
+ELK layout primitives, `@xyflow/react` node/edge components, and the
+floating `GraphTooltip`. The `GraphContext` provider also lives here
+so node/edge components can be consumed independently of the
+`graph-flow` data-fetching host.
+
+`graph-flow` itself, plus the data-coupled panels (`graph-doc-panel`,
+`graph-community-panel`, `path-finder-panel`), still live in
+`packages/web` because they orchestrate `useGraph*` SWR hooks. They
+will move under a wrapper-pattern refactor in a follow-up.
+
+### `graph/context` — `GraphContext`, `GraphProvider`, `useGraphContext`, `GraphContextValue`
+
+Standalone context module. Node and edge components consume it to
+read selection / hover / highlight state without depending on the
+`graph-flow` host implementation. Hosts wrap their tree in
+`<GraphProvider value={...}>`.
+
+| Export | Type | Notes |
+|--------|------|-------|
+| `GraphContext` | `React.Context<GraphContextValue>` | Default value renders inert. |
+| `GraphProvider` | `React.Provider<GraphContextValue>` | Alias of `GraphContext.Provider`. |
+| `useGraphContext` | `() => GraphContextValue` | Sugar for `useContext(GraphContext)`. |
+| `GraphContextValue` | interface | `highlightedPath`, `highlightedEdges`, `colorMode`, `riskScores`, `hoveredNodeId`, `connectedNodeIds`, `connectedEdgeIds`, `selectedNodeId`, `searchDimmedNodes`. |
+
+### `graph/elk-layout` and `graph/use-elk-layout`
+
+Pure layout primitives. Functions: `layoutFileGraph`,
+`layoutModuleGraph`, `groupNodesAsModules`. Hooks:
+`useFileElkLayout`, `useModuleElkLayout`. Operate on canonical
+`@repowise-dev/types/graph` shapes (`GraphNode`, `GraphLink`,
+`ModuleNode`, `ModuleEdge`) and produce `@xyflow/react` `Node[]` /
+`Edge[]`. No data fetching.
+
+### `graph/nodes/*`, `graph/edges/*`
+
+`FileNode`, `ModuleGroupNode`, `DependencyEdge` — `@xyflow/react`
+node/edge renderers. Consume `GraphContext` for selection / hover /
+path-highlight state. Wear `FileNodeData` / `ModuleNodeData` /
+`DependencyEdgeData` types from `graph/elk-layout`.
+
+### `graph/graph-tooltip` — `GraphTooltip`
+
+Floating tooltip over a focused node, smart-positioned against the
+viewport edges. Renders file or module metadata depending on
+`nodeType`.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `nodeId` | `string` | yes |
+| `nodeType` | `string` (`fileNode` / `moduleGroup`) | yes |
+| `data` | `Record<string, unknown>` (cast to `FileNodeData` or `ModuleNodeData`) | yes |
+| `x`, `y` | `number` | yes |
+| `onClose` / `onViewDocs` | `() => void` | yes |
+| `onExplore` | `() => void` | no — when omitted, the action button is hidden |
+
+### `graph/graph-context-menu` — `GraphContextMenu`
+
+Floating right-click menu rendered at `(x, y)`. Pure UI; the host
+wires the four action callbacks.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `x`, `y` | `number` | yes |
+| `nodeId` | `string` | yes |
+| `isModule` | `boolean` | yes |
+| `onViewDocs` / `onExplore` / `onPathFrom` / `onPathTo` | `() => void` | yes |
+
+### `graph/graph-toolbar` — `GraphToolbar`
+
+Top-right toolbar exposing view mode, color mode, hide-tests toggle,
+fit-view, path-finder toggle, flows toggle, and a search input. Also
+exports the `ColorMode` (`language` / `community` / `risk`) and
+`ViewMode` (`module` / `full` / `architecture` / `dead` / `hotfiles`)
+unions consumed by `GraphLegend` and the host.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `viewMode` / `onViewChange` | `ViewMode` / `(v) => void` | yes |
+| `colorMode` / `onColorModeChange` | `ColorMode` / `(v) => void` | yes |
+| `hideTests` / `onHideTestsChange` | `boolean` / `(v) => void` | yes |
+| `onFitView` | `() => void` | yes |
+| `showPathFinder` / `onTogglePathFinder` | `boolean` / `() => void` | yes |
+| `showFlows` / `onToggleFlows` | `boolean` / `() => void` | yes |
+| `searchQuery` / `onSearchChange` | `string` / `(q) => void` | yes |
+
+### `graph/graph-legend` — `GraphLegend`
+
+Collapsible legend that picks a key per `colorMode`. Imports the
+`ColorMode` and `ViewMode` types from `graph-toolbar`.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `nodeCount` / `edgeCount` | `number` | yes |
+| `colorMode` | `ColorMode` | yes |
+| `viewMode` | `ViewMode` | yes |
+| `communityLabels` | `Map<number, string>` | no |
+
+### `graph/graph-ego-sidebar` — `GraphEgoSidebar`
+
+Right-edge sidebar showing the centre node's neighborhood — inbound
+/ outbound counts, git metadata (owner, last commit, 30d commits),
+and a list of neighbour nodes. Consumes the canonical `EgoGraph`
+type, which now optionally carries `center_git_meta: GitMetadata`.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `graph` | `EgoGraph` (`@repowise-dev/types/graph`) | yes |
+| `onClose` | `() => void` | yes |
+| `onNavigateToNode` | `(nodeId: string) => void` | no |
+
+---
+
+## `workspace/*` — Multi-repo workspace views
+
+Five presentational components that consume the canonical workspace
+shapes from `@repowise-dev/types/workspace`.
+
+### `workspace/contract-type-badge` — `ContractTypeBadge`, `RoleBadge`
+
+Inline pill badges for contract type (`http`, `grpc`, `topic`, …) and
+role (`provider` / `consumer`).
+
+| Component | Prop | Type |
+|-----------|------|------|
+| `ContractTypeBadge` | `type` | `string` |
+| `RoleBadge` | `role` | `string` |
+
+### `workspace/repo-card` — `RepoCard`
+
+Tile linking to `/repos/{id}/overview` with file count, doc-coverage,
+hotspot count, and a primary indicator.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `repoId` | `string` | yes |
+| `alias` | `string` | yes |
+| `name` | `string` | yes |
+| `path` | `string` | yes |
+| `isPrimary` | `boolean` | yes |
+| `stats` | `RepoStats \| null` (`@repowise-dev/types/workspace`) | yes |
+| `gitSummary` | `GitSummary \| null` (`@repowise-dev/types/git`) | yes |
+
+### `workspace/co-change-table` — `CoChangeTable`
+
+Sortable cross-repo co-change table.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `coChanges` | `WorkspaceCoChangeEntry[]` | yes | |
+| `compact` | `boolean` | no | Drops the frequency and last-date columns. |
+
+### `workspace/contract-links-table` — `ContractLinksTable`
+
+Provider/consumer table for matched contract links with confidence
+bars colour-graded against the freshness thresholds.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `links` | `WorkspaceContractLinkEntry[]` | yes |
+
+### `workspace/cross-repo-summary` — `CrossRepoSummary`
+
+Four-tile summary header (`StatCard` × 4) for co-change pairs, package
+deps, contract links, and contract count.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `crossRepo` | `WorkspaceCrossRepoSummary \| null` | yes |
+| `contracts` | `WorkspaceContractSummary \| null` | yes |
+
+---
+
+## `dashboard/*` — Repo overview tiles
+
+Nine presentational tiles that consume canonical engine artifacts.
+The data-coupled trio (`active-job-banner`, `quick-actions`,
+`community-summary-grid`) stays in `packages/web` for now.
+
+### `dashboard/attention-panel` — `AttentionPanel`
+
+Categorised list of items needing developer attention. Re-exports the
+`AttentionItem` type so `packages/web`'s `health-score.ts` can derive
+items without recomputing the shape.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `items` | `AttentionItem[]` | yes |
+| `repoId` | `string` | yes |
+
+### `dashboard/decisions-timeline` — `DecisionsTimeline`
+
+Top-6 most recent decisions with status dots and a "view all" link.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `decisions` | `DecisionRecord[]` (`@repowise-dev/types/decisions`) | yes |
+| `repoId` | `string` | yes |
+
+### `dashboard/dependency-heatmap` — `DependencyHeatmap`
+
+20×20 canvas heatmap of module-to-module edge counts. Modules sorted
+by `avg_pagerank`. Returns `null` when fewer than two modules are
+available.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `moduleGraph` | `ModuleGraph` (`@repowise-dev/types/graph`) | yes |
+
+### `dashboard/execution-flows-panel` — `ExecutionFlowsPanel`
+
+Top-8 execution flows with collapsible call traces. `repoId` is
+accepted for parity with other dashboard tiles but currently unused.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `flows` | `ExecutionFlowEntry[]` (`@repowise-dev/types/graph`) | yes |
+| `repoId` | `string` | yes |
+
+### `dashboard/health-score-ring` — `HealthScoreRing`
+
+Animated `framer-motion` SVG ring showing 0–100 score with text label.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `score` | `number` (0–100) | yes |
+| `size` | `number` | no, default `160` |
+
+### `dashboard/hotspots-mini` — `HotspotsMini`
+
+Top-5 hotspots tile.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `hotspots` | `Hotspot[]` (`@repowise-dev/types/git`) | yes |
+| `repoId` | `string` | yes |
+
+### `dashboard/language-donut` — `LanguageDonut`
+
+Top-6 languages-by-file-count donut with grouped "other" bucket.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `distribution` | `Record<string, number>` | yes |
+
+### `dashboard/module-minimap` — `ModuleMinimap`
+
+Force-directed module graph using `d3-force`. Doc-coverage colours
+the nodes. The simulation runs synchronously for small graphs (≤150
+ticks) and re-renders once the layout converges.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `nodes` | `ModuleNode[]` (`@repowise-dev/types/graph`) | yes |
+| `edges` | `ModuleEdge[]` (`@repowise-dev/types/graph`) | yes |
+| `repoId` | `string` | yes |
+
+### `dashboard/ownership-treemap` — `OwnershipTreemap`
+
+`d3-hierarchy` treemap colouring rectangles by primary owner; silos
+render at lower opacity. Distinct from `git/ownership-treemap` —
+this variant is the dashboard tile (Card-wrapped, fixed height,
+legend below).
+
+| Prop | Type | Required |
+|------|------|----------|
+| `entries` | `OwnershipEntry[]` (`@repowise-dev/types/git`) | yes |
+
+---
+
+## `chat/*` — Conversation rendering primitives
+
+The chat UI types are sourced from `@repowise-dev/types/chat` —
+`ChatUIMessage` and `ChatUIToolCall` are the post-streaming flattened
+shapes consumed by these components. The wire types (`ChatMessage`,
+`ChatToolCall`) live in the same module; consumers are expected to
+keep the SSE merge in their own data layer.
+
+### `chat/chat-markdown` — `ChatMarkdown`
+
+Compact markdown renderer (`react-markdown` + `remark-gfm`) tuned for
+chat density. Code fences are inline `<pre><code>` blocks — no copy
+affordance.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `content` | `string` | yes |
+
+### `chat/tool-call-block` — `ToolCallBlock`
+
+Collapsible card showing a single tool invocation. Friendly labels for
+known tool names; falls back to the raw name. Shows a "View" button
+that fires `onViewArtifact` when an artifact is attached.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `toolCall` | `ChatUIToolCall` (`@repowise-dev/types/chat`) | yes |
+| `onViewArtifact` | `() => void` | no |
+
+### `chat/source-citations` — `SourceCitations`
+
+Renders an inline list of source-page links extracted from
+`tool_calls[]`. Also exports `extractSources(toolCalls, repoId)` for
+callers that need the same shape outside of rendering. Uses plain
+`<a>` (no Next-only `Link`) so the package stays framework-neutral —
+consumers wire prefetching at the parent level if needed.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `toolCalls` | `ChatUIToolCall[]` | yes |
+| `repoId` | `string` | yes |
+
+### `chat/chat-message` — `ChatMessage`
+
+Renders one user or assistant turn: avatar, message bubble for user,
+tool-call cards + markdown + citations for assistant. Streaming
+indicator shows when `message.isStreaming` and there's no text yet.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `message` | `ChatUIMessage` | yes | |
+| `repoId` | `string` | yes | Forwarded to `SourceCitations` for link targets. |
+| `onViewArtifact` | `(artifact: { type; data }) => void` | no | Wired through to `ToolCallBlock` when an artifact is attached. |
+| `assistantAvatarSrc` | `string` | no | Defaults to `/repowise-logo.png`. Override in consumers that don't host that asset. |
+
+### `chat/artifact-panel` — `ArtifactPanel`
+
+Right-edge slide-over panel. Switches on `artifact.type` to pick a
+renderer: markdown for `overview` / `wiki_page`, mermaid (via
+`@repowise-dev/ui/wiki/mermaid-diagram`) for `diagram`, list for
+`search_results`, JSON pretty-print fallback otherwise.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `artifacts` | `Artifact[]` (locally-defined wrapper: `{ type; title; data }`) | yes |
+| `open` | `boolean` | yes |
+| `onClose` | `() => void` | yes |
+
+---
+
+## `wiki/wiki-markdown` — `WikiMarkdown`
+
+Client-side markdown renderer (`react-markdown` + `remark-gfm`) with
+slugged heading anchors, copy-on-hover code blocks, and inline
+`MermaidDiagram` for `\`\`\`mermaid` fences.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `content` | `string` | yes |
+
+---
+
+## `blast-radius/*` — PR impact analysis shells
+
+Pure presentational shells for the blast-radius view. Data fetching,
+input form, and SWR hotspot suggestions stay in the consumer page;
+these components only render `BlastRadiusResponse` (from
+`@repowise-dev/types/blast-radius`).
+
+### `blast-radius/risk-score-card` — `RiskScoreCard`
+
+Coloured 0–10 gauge. Red ≥7, amber ≥4, emerald otherwise.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `score` | `number` (0–10) | yes |
+
+### `blast-radius/table-section` — `TableSection`
+
+Card wrapper with title and "empty" placeholder.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `title` | `string` | yes |
+| `empty` | `boolean` | yes |
+| `emptyLabel` | `string` (defaults to "None") | no |
+| `children` | `ReactNode` | yes |
+
+### `blast-radius/direct-risks-table` — `DirectRisksTable`
+
+Renders `DirectRiskEntry[]`. Multiplies `risk_score` and
+`temporal_hotspot` by 10 for display (backend ships 0–1).
+
+| Prop | Type | Required |
+|------|------|----------|
+| `rows` | `DirectRiskEntry[]` | yes |
+
+### `blast-radius/transitive-table` — `TransitiveTable`
+
+Two-column path + dependency depth.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `rows` | `TransitiveEntry[]` | yes |
+
+### `blast-radius/cochange-table` — `CochangeTable`
+
+Three-column changed file / missing partner / score.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `rows` | `CochangeWarning[]` | yes |
+
+### `blast-radius/reviewers-table` — `ReviewersTable`
+
+Email + files-owned + percent ownership. `ownership_pct` is 0–1.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `rows` | `ReviewerEntry[]` | yes |
+
+### `blast-radius/test-gaps-list` — `TestGapsList`
+
+Bullet list of files lacking adjacent test coverage.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `gaps` | `string[]` | yes |
+
+### `blast-radius/blast-radius-summary` — `BlastRadiusSummary`
+
+Four-stat card sitting beside `RiskScoreCard` (Direct Risks /
+Transitive Files / Co-change Warnings / Test Gaps).
+
+| Prop | Type | Required |
+|------|------|----------|
+| `result` | `BlastRadiusResponse` | yes |
+
+### `blast-radius/blast-radius-results` — `BlastRadiusResults`
+
+Composes the full results stack: gauge + summary + the five tables.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `result` | `BlastRadiusResponse` | yes |
+
+## Phase 2C — dashboard wrappers + settings shells
+
+### `dashboard/active-job-banner` — `ActiveJobBanner`
+
+Slim status strip for the latest indexing/generation job. Wrapper owns
+SWR polling + freshness window; the shell is given a snapshot.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `job` | `Job \| null` | yes |
+| `detailsHref` | `string` | no |
+
+`Job` is canonical (`@repowise-dev/types/jobs`). When `job` is `null`
+or `pending`, the banner renders nothing — the wrapper is responsible
+for filtering out terminal states older than its freshness window.
+
+### `dashboard/quick-actions` — `QuickActions`
+
+Three-button action bar (sync / full-resync / dead-code) with confirm
+dialog and inline cost estimate. Pure presentational — mutations are a
+callback bag.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `onAction` | `(key: QuickActionKey) => Promise<void> \| void` | yes |
+| `actions` | `QuickActionDef[]` | no (defaults to the three baked-in) |
+| `loadingKey` | `QuickActionKey \| null` | no |
+| `lastSyncAt` | `string \| null` | no |
+| `lastResyncAt` | `string \| null` | no |
+| `pageCount` | `number` | no |
+| `modelName` | `string` | no |
+| `activeJobSlot` | `ReactNode` | no — when set, replaces the buttons |
+
+### `dashboard/community-summary-grid` — `CommunitySummaryGrid`
+
+Architecture-community list with expandable detail panel. The wrapper
+owns `useCommunityDetail`; the shell receives resolved details keyed by
+`community_id`.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `communities` | `CommunitySummaryItem[]` | yes |
+| `details` | `Record<number, CommunityDetail \| null>` | no |
+| `loadingDetailId` | `number \| null` | no |
+| `onExpand` | `(communityId: number) => void` | no |
+
+`CommunitySummaryItem` and `CommunityDetail` are canonical types in
+`@repowise-dev/types/graph`.
+
+### `settings/general-form` — `GeneralForm`
+
+Universal repo-settings editor (name, default branch, exclude
+patterns). Read-only when `onSubmit` is omitted — used by hosted, where
+multi-tenant settings persistence is deferred to Phase 5 RBAC.
+
+| Prop | Type | Required |
+|------|------|----------|
+| `value` | `RepoSettingsValue` | yes |
+| `onSubmit` | `(next: RepoSettingsValue) => Promise<void>` | no |
+| `localPath` | `string` | no |
+| `remoteUrl` | `string` | no |
+| `disabledHint` | `string` | no |
+
+`RepoSettingsValue` lives in `@repowise-dev/types/settings`.
+
+### `chat/conversation-history` — `ConversationHistory`
+
+Dropdown listing prior conversations for a repo with select / delete /
+new-conversation affordances. The wrapper owns the SWR fetch
+(`listConversations`) and the delete mutation; the shell only renders
+the popover surface and emits intents.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `conversations` | `Conversation[] \| undefined` | yes | `undefined` while loading. |
+| `isLoading` | `boolean` | no | Renders a "Loading…" placeholder when no list is yet available. |
+| `selectedId` | `string \| null` | no | Highlights the matching row. |
+| `onSelect` | `(id: string) => void` | yes | Fires when a row is clicked. |
+| `onDelete` | `(id: string) => void \| Promise<void>` | yes | Fires when a row's trash icon is clicked. |
+| `onNew` | `() => void` | yes | Fires when "New conversation" is clicked. |
+| `className` | `string` | no | Forwarded to the outer container. |
+
+`Conversation` is canonical (`@repowise-dev/types/chat`).
+
+### `chat/chat-interface` — `ChatInterface`
+
+Top-level chat surface. Renders empty-state suggestion chips when
+`messages` is empty, otherwise a scrollable transcript above a
+textarea composer. Owns the artifact-panel state internally; transport
+(SSE / federated / mock), history dropdown, and model selector are
+wired by the wrapper as opaque slots.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `repoId` | `string` | yes | Forwarded to `ChatMessage` for citation hrefs. |
+| `repoName` | `string` | no | Used in the empty-state heading. |
+| `messages` | `ChatUIMessage[]` | yes | UI-flattened transcript. |
+| `isStreaming` | `boolean` | yes | Toggles Send → Stop in the composer. |
+| `error` | `string \| null` | no | Inline banner above the transcript. |
+| `onSend` | `(text: string) => void \| Promise<void>` | yes | Fires when the user submits. |
+| `onCancel` | `() => void` | yes | Fires when the user clicks Stop; also used as "reset" in the wrapper. |
+| `modelSelectorSlot` | `ReactNode` | no | Rendered in the header bar AND empty-state composer. |
+| `historySlot` | `ReactNode` | no | Rendered in the header bar AND empty-state composer. |
+| `assistantAvatarSrc` | `string` | no | Forwarded to `ChatMessage`. |
+| `buildCitationHref` | `(source: SourceReference) => string` | no | Forwarded to `ChatMessage` → `SourceCitations`. |
+| `emptyStateLogoSrc` | `string` | no | Defaults to `/repowise-logo.png`. |
+| `suggestions` | `string[]` | no | Override default empty-state chip set. |
+
+`ChatUIMessage` is canonical (`@repowise-dev/types/chat`). Downstream
+consumers can wire a different transport (e.g. a multi-repo fan-out
+streaming endpoint) into the same shell by substituting the wrapper —
+that swap validates the data/presentation split.
+
+### `wiki/security-panel` — `SecurityPanel`
+
+Renders a list of security findings (or an empty-state message) for a
+single file. Wrapper owns the `useSWR(["security", repoId, filePath], …)`
+fetch from `listSecurityFindings`.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `findings` | `SecurityFinding[] \| undefined` | yes | Empty / undefined → "No security signals." |
+| `isLoading` | `boolean` | no | While loading the shell renders nothing. |
+
+`SecurityFinding` is canonical (`@repowise-dev/types/security`).
+
+### `wiki/regenerate-button` — `RegenerateButton`
+
+Per-page regenerate affordance: a ghost button + a dialog that hosts a
+job-progress widget. Wrapper owns `regeneratePage`, sonner toasts,
+SWR cache invalidation, and the in-flight job id.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `onRegenerate` | `() => void` | yes | Fires when the user clicks regenerate. |
+| `isLoading` | `boolean` | no | Spinner + disabled while the request is in flight. |
+| `isInProgress` | `boolean` | no | When true, the progress dialog is open. |
+| `onDialogClose` | `() => void` | no | Fires when the dialog requests to close. |
+| `jobSlot` | `ReactNode` | no | Rendered inside the dialog — typically a job-progress widget. |
+
+### `wiki/version-history` — `VersionHistory`
+
+Collapsible per-page version-history panel with an inline LCS-based
+diff view. Wrapper owns the `usePageVersions(pageId)` SWR hook; the
+shell owns expand / select / show-diff UI state and the `computeLineDiff`
+helpers.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `versions` | `DocPageVersion[]` | yes | Archived prior versions, newest-first. |
+| `currentVersion` | `number` | yes | Version number of the currently-rendered page. |
+| `currentContent` | `string` | yes | Content used as the "new" side of the diff view. |
+| `isLoading` | `boolean` | no | While loading or empty the shell renders nothing. |
+
+`DocPageVersion` is canonical (`@repowise-dev/types/docs`).
+
+---
+
+## `graph/graph-doc-panel` — `GraphDocPanel`
+
+Side-panel that renders a wiki page for a graph node. Presentational —
+the consumer fetches the `DocPage` and supplies routing hrefs.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `nodeId` | `string` | yes | Used in the header subtitle when no `page.title` is available. |
+| `page` | `DocPage \| null \| undefined` | yes | Pre-fetched wiki page. |
+| `isLoading` | `boolean` | yes | Drives the spinner state. |
+| `error` | `unknown` | no | Truthy renders the empty state. |
+| `fullPageHref` | `string` | no | When provided, renders the "open full page" external-link icon. |
+| `browseDocsHref` | `string` | no | Fallback link inside the empty state. |
+| `onClose` | `() => void` | yes | Close affordance handler. |
+
+`DocPage` is canonical (`@repowise-dev/types/docs`).
+
+---
+
+## `graph/graph-community-panel` — `GraphCommunityPanel`
+
+Side-panel that lists a Leiden community's members + neighboring
+communities. Presentational — consumer fetches the detail.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `communityId` | `number` | yes | Surfaced in the header fallback when `community` is null. |
+| `community` | `CommunityDetail \| null \| undefined` | yes | Pre-fetched detail; `null` while loading or missing. |
+| `isLoading` | `boolean` | yes | Drives the skeleton state. |
+| `onClose` | `() => void` | yes | Close affordance handler. |
+
+`CommunityDetail` is canonical (`@repowise-dev/types/graph`).
+
+---
+
+## `graph/path-finder-panel` — `PathFinderPanel`
+
+Floating panel for picking two nodes and asking the engine for a path
+between them. Presentational — the consumer injects the search and
+path-find callbacks; the shell owns input + dropdown state and uses
+the `useDebounce` presentational hook for autocomplete.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `searchNodes` | `(query: string, limit: number) => Promise<NodeSearchResult[]>` | yes | Backs the autocomplete dropdown. |
+| `findPath` | `(from: string, to: string) => Promise<GraphPath>` | yes | Resolves the highlighted path. |
+| `onPathFound` | `(pathNodes: string[]) => void` | yes | Handed the resolved node ids. |
+| `onClear` | `() => void` | yes | Called when the user clears prior results. |
+| `onClose` | `() => void` | yes | Close affordance handler. |
+| `initialFrom` | `string` | no | Pre-fill from a parent context-menu. |
+| `initialTo` | `string` | no | Pre-fill from a parent context-menu. |
+
+`NodeSearchResult` and `GraphPath` are canonical (`@repowise-dev/types/graph`).
+
+---
+
+## `graph/graph-flow` — `GraphFlow`
+
+The full graph canvas. Presentational shell over `@xyflow/react` that
+handles view-mode, drill-down, search, hover/selection, context menu,
+execution-flow highlighting, and ELK layout. The consumer supplies
+every dataset (one per view mode) and renders the data-coupled child
+panels (path-finder, community-panel) via slot render props.
+
+| Prop | Type | Required | Notes |
+|------|------|----------|-------|
+| `moduleGraph` | `ModuleGraph \| undefined` | yes | Top-level module rollup; only required for module view at root. |
+| `isLoadingModuleGraph` | `boolean` | yes | Drives the skeleton when in module view. |
+| `fullGraph` | `GraphExport \| undefined` | yes | File-level graph — needed for drill-down and `full` view. |
+| `isLoadingFullGraph` | `boolean` | yes | |
+| `architectureGraph` | `GraphExport \| undefined` | yes | Entry-point / architecture view. |
+| `isLoadingArchitectureGraph` | `boolean` | yes | |
+| `deadCodeGraph` | `GraphExport \| undefined` | yes | Dead-code-only graph. |
+| `isLoadingDeadCodeGraph` | `boolean` | yes | |
+| `hotFilesGraph` | `GraphExport \| undefined` | yes | Hot-files-only graph. |
+| `isLoadingHotFilesGraph` | `boolean` | yes | |
+| `communities` | `CommunitySummaryItem[]` | no | Used for the legend's community labels. |
+| `executionFlows` | `ExecutionFlows` | no | Backs the flows side panel + trace highlighting. |
+| `onViewModeChange` | `(mode: ViewMode) => void` | no | Fires when the user changes view; consumer uses this to toggle data fetches. |
+| `onModulePathChange` | `(path: string[]) => void` | no | Fires on drill-down navigation. |
+| `onNodeClick` | `(nodeId, nodeType) => void \| Promise<void>` | no | File click handler. |
+| `onNodeViewDocs` | `(nodeId: string) => void` | no | "View docs" intent — surface a side panel. |
+| `renderPathFinder` | `(props) => ReactNode` | no | Render slot for the path-finder sub-panel; the shell only owns when to mount it. |
+| `renderCommunityPanel` | `(props) => ReactNode` | no | Render slot for the community detail sub-panel. |
+
+All graph datasets are canonical (`@repowise-dev/types/graph`).
diff --git a/packages/ui/README.md b/packages/ui/README.md
new file mode 100644
index 000000000..a08737c17
--- /dev/null
+++ b/packages/ui/README.md
@@ -0,0 +1,56 @@
+# @repowise-dev/ui
+
+Shared visualization components for the Repowise dashboard
+(`packages/web`) and any downstream consumer that wants to render the
+same engine artifacts.
+
+## Layout
+
+```
+src/
+ graph/ graph-flow, graph-toolbar, ego-sidebar, …
+ git/ hotspot-table, ownership-treemap, …
+ dead-code/
+ decisions/
+ docs/
+ symbols/
+ coverage/
+ wiki/
+ chat/ artifact-panel, model-selector, source-citations
+ dashboard/ health-score-ring, attention-panel, …
+ workspace/ repo-card, contracts-table, …
+ jobs/ generation-progress, job-log
+ shared/ stat-card, empty-state, api-error
+ hooks/ use-elk-layout, use-sse, …
+ ui/ Radix-CVA primitives
+styles/
+ globals.css canonical design tokens (Tailwind v4 @theme)
+```
+
+## Consuming
+
+Components are exposed via subpath exports — import the slice you need
+rather than the barrel:
+
+```ts
+import { HotspotTable } from "@repowise-dev/ui/git";
+import { GraphFlow } from "@repowise-dev/ui/graph";
+```
+
+Consumers must add `transpilePackages: ["@repowise-dev/ui", "@repowise-dev/types"]`
+to their `next.config.ts` (Tailwind v4 + TS source ship as-is, no
+pre-build step).
+
+To inherit the canonical design tokens, import the stylesheet once at
+the root of the app:
+
+```css
+@import "@repowise-dev/ui/styles.css";
+```
+
+## Peer deps
+
+`react`, `react-dom`. Components stay client-pure or pure-presentational —
+they do not call `next/navigation` or `next/link` directly. Where routing
+is needed, accept it via props or context so consumers can wire their
+own router.
diff --git a/packages/ui/__tests__/blast-radius/blast-radius.test.tsx b/packages/ui/__tests__/blast-radius/blast-radius.test.tsx
new file mode 100644
index 000000000..c5813822b
--- /dev/null
+++ b/packages/ui/__tests__/blast-radius/blast-radius.test.tsx
@@ -0,0 +1,134 @@
+import { describe, it, expect } from "vitest";
+import { render, screen } from "@testing-library/react";
+import { RiskScoreCard } from "../../src/blast-radius/risk-score-card";
+import { TableSection } from "../../src/blast-radius/table-section";
+import { DirectRisksTable } from "../../src/blast-radius/direct-risks-table";
+import { TransitiveTable } from "../../src/blast-radius/transitive-table";
+import { CochangeTable } from "../../src/blast-radius/cochange-table";
+import { ReviewersTable } from "../../src/blast-radius/reviewers-table";
+import { TestGapsList } from "../../src/blast-radius/test-gaps-list";
+import { BlastRadiusSummary } from "../../src/blast-radius/blast-radius-summary";
+import { BlastRadiusResults } from "../../src/blast-radius/blast-radius-results";
+import type { BlastRadiusResponse } from "@repowise-dev/types/blast-radius";
+
+const fixture: BlastRadiusResponse = {
+ direct_risks: [
+ { path: "src/auth/login.py", risk_score: 0.82, temporal_hotspot: 0.74, centrality: 0.045 },
+ ],
+ transitive_affected: [{ path: "src/api/handlers.py", depth: 2 }],
+ cochange_warnings: [
+ { changed: "src/auth/login.py", missing_partner: "tests/test_login.py", score: 7 },
+ ],
+ recommended_reviewers: [{ email: "[email protected]", files: 12, ownership_pct: 0.42 }],
+ test_gaps: ["src/auth/login.py"],
+ overall_risk_score: 7.6,
+};
+
+describe("RiskScoreCard", () => {
+ it("labels High Risk for score >= 7", () => {
+ render(<RiskScoreCard score={7.6} />);
+ expect(screen.getByText("High Risk")).toBeTruthy();
+ expect(screen.getByText("7.6")).toBeTruthy();
+ });
+
+ it("labels Low Risk for score < 4", () => {
+ render(<RiskScoreCard score={2.1} />);
+ expect(screen.getByText("Low Risk")).toBeTruthy();
+ });
+});
+
+describe("TableSection", () => {
+ it("renders empty copy when empty=true", () => {
+ render(
+ <TableSection title="Direct Risks" empty>
+ <div>hidden</div>
+ </TableSection>,
+ );
+ expect(screen.getByText("None")).toBeTruthy();
+ expect(screen.queryByText("hidden")).toBeNull();
+ });
+
+ it("renders children when empty=false", () => {
+ render(
+ <TableSection title="Direct Risks" empty={false}>
+ <div>shown</div>
+ </TableSection>,
+ );
+ expect(screen.getByText("shown")).toBeTruthy();
+ });
+});
+
+describe("DirectRisksTable", () => {
+ it("scales risk_score 0–1 → 0–10", () => {
+ render(<DirectRisksTable rows={fixture.direct_risks} />);
+ expect(screen.getByText("8.20")).toBeTruthy();
+ expect(screen.getByText("7.40")).toBeTruthy();
+ });
+});
+
+describe("TransitiveTable", () => {
+ it("renders depth", () => {
+ render(<TransitiveTable rows={fixture.transitive_affected} />);
+ expect(screen.getByText("2")).toBeTruthy();
+ });
+});
+
+describe("CochangeTable", () => {
+ it("renders score", () => {
+ render(<CochangeTable rows={fixture.cochange_warnings} />);
+ expect(screen.getByText("tests/test_login.py")).toBeTruthy();
+ expect(screen.getByText("7")).toBeTruthy();
+ });
+});
+
+describe("ReviewersTable", () => {
+ it("formats ownership_pct as percent", () => {
+ render(<ReviewersTable rows={fixture.recommended_reviewers} />);
+ expect(screen.getByText("42.0%")).toBeTruthy();
+ });
+});
+
+describe("TestGapsList", () => {
+ it("renders each gap", () => {
+ render(<TestGapsList gaps={fixture.test_gaps} />);
+ expect(screen.getByText("src/auth/login.py")).toBeTruthy();
+ });
+});
+
+describe("BlastRadiusSummary", () => {
+ it("renders four counts", () => {
+ render(<BlastRadiusSummary result={fixture} />);
+ expect(screen.getByText("Direct Risks")).toBeTruthy();
+ expect(screen.getByText("Transitive Files")).toBeTruthy();
+ expect(screen.getByText("Co-change Warnings")).toBeTruthy();
+ expect(screen.getByText("Test Gaps")).toBeTruthy();
+ });
+});
+
+describe("BlastRadiusResults", () => {
+ it("composes the full results stack", () => {
+ render(<BlastRadiusResults result={fixture} />);
+ expect(screen.getByText("High Risk")).toBeTruthy();
+ // "Direct Risks" / "Co-change Warnings" / "Test Gaps" appear twice
+ // (summary stat label + TableSection title) — use getAllByText.
+ expect(screen.getAllByText("Direct Risks").length).toBe(2);
+ expect(screen.getByText("Transitive Affected Files")).toBeTruthy();
+ expect(screen.getAllByText("Co-change Warnings").length).toBe(2);
+ expect(screen.getByText("Recommended Reviewers")).toBeTruthy();
+ expect(screen.getAllByText("Test Gaps").length).toBe(2);
+ });
+
+ it("shows 'None' for empty sections", () => {
+ const empty: BlastRadiusResponse = {
+ direct_risks: [],
+ transitive_affected: [],
+ cochange_warnings: [],
+ recommended_reviewers: [],
+ test_gaps: [],
+ overall_risk_score: 1.5,
+ };
+ render(<BlastRadiusResults result={empty} />);
+ expect(screen.getAllByText("None").length).toBe(5);
+ expect(screen.getByText("Low Risk")).toBeTruthy();
+ });
+});
diff --git a/packages/ui/__tests__/chat/artifacts.test.tsx b/packages/ui/__tests__/chat/artifacts.test.tsx
new file mode 100644
index 000000000..95b89728c
--- /dev/null
+++ b/packages/ui/__tests__/chat/artifacts.test.tsx
@@ -0,0 +1,199 @@
+import { describe, it, expect } from "vitest";
+import { render, screen } from "@testing-library/react";
+import {
+ ContextRenderer,
+ DeadCodeRenderer,
+ DecisionsRenderer,
+ DiagramRenderer,
+ GenericJsonRenderer,
+ GraphPathRenderer,
+ OverviewRenderer,
+ RiskReportRenderer,
+ SearchResultsRenderer,
+} from "../../src/chat/artifacts.js";
+
+// Mermaid pulls in DOM measuring APIs jsdom doesn't implement; the renderer is
+// covered by smoke-asserting only the description fallback path.
+describe("chat artifact renderers", () => {
+ it("OverviewRenderer surfaces top-line stats", () => {
+ render(
+ <OverviewRenderer
+ data={{
+ total_files: 42,
+ total_symbols: 1337,
+ languages: { TypeScript: 30, Python: 12 },
+ modules: ["packages/web", "packages/ui"],
+ entry_points: ["packages/web/src/app/page.tsx"],
+ hotspot_count: 5,
+ is_monorepo: true,
+ }}
+ />,
+ );
+ expect(screen.getByText("42")).toBeInTheDocument();
+ expect(screen.getByText("1,337")).toBeInTheDocument();
+ expect(screen.getByText("TypeScript")).toBeInTheDocument();
+ expect(screen.getByText("packages/web")).toBeInTheDocument();
+ });
+
+ it("ContextRenderer shows target paths with markdown when present", () => {
+ render(
+ <ContextRenderer
+ data={{
+ targets: {
+ "packages/ui/src/chat/artifacts.tsx": {
+ docs: { content_md: "# Hello\n\nA short doc." },
+ },
+ },
+ }}
+ />,
+ );
+ expect(
+ screen.getByText("packages/ui/src/chat/artifacts.tsx"),
+ ).toBeInTheDocument();
+ expect(screen.getByText("Hello")).toBeInTheDocument();
+ });
+
+ it("RiskReportRenderer flags hotspots", () => {
+ render(
+ <RiskReportRenderer
+ data={{
+ targets: [
+ { file_path: "src/hot.ts", churn_percentile: 99, is_hotspot: true },
+ ],
+ global_hotspots: [{ path: "src/other.ts", churn_percentile: 88 }],
+ }}
+ />,
+ );
+ expect(screen.getByText("src/hot.ts")).toBeInTheDocument();
+ expect(screen.getByText("hotspot")).toBeInTheDocument();
+ expect(screen.getByText("src/other.ts")).toBeInTheDocument();
+ });
+
+ it("SearchResultsRenderer lists results with snippets", () => {
+ render(
+ <SearchResultsRenderer
+ data={{
+ query: "auth flow",
+ results: [
+ {
+ title: "Authentication Overview",
+ page_type: "module_page",
+ snippet: "JWT-based auth pipeline.",
+ relevance_score: 0.91,
+ },
+ ],
+ }}
+ />,
+ );
+ expect(screen.getByText("auth flow")).toBeInTheDocument();
+ expect(screen.getByText("Authentication Overview")).toBeInTheDocument();
+ expect(screen.getByText("JWT-based auth pipeline.")).toBeInTheDocument();
+ });
+
+ it("SearchResultsRenderer handles empty results", () => {
+ render(<SearchResultsRenderer data={{ query: "nope", results: [] }} />);
+ expect(screen.getByText("No results found.")).toBeInTheDocument();
+ });
+
+ it("GraphPathRenderer renders the explanation and ordered path", () => {
+ render(
+ <GraphPathRenderer
+ data={{
+ path: ["a.ts", "b.ts", "c.ts"],
+ distance: 2,
+ explanation: "Path from a.ts to c.ts via 2 hop(s).",
+ }}
+ />,
+ );
+ expect(
+ screen.getByText("Path from a.ts to c.ts via 2 hop(s)."),
+ ).toBeInTheDocument();
+ expect(screen.getByText("a.ts")).toBeInTheDocument();
+ expect(screen.getByText("b.ts")).toBeInTheDocument();
+ expect(screen.getByText("c.ts")).toBeInTheDocument();
+ });
+
+ it("DecisionsRenderer health mode shows totals + by_source", () => {
+ render(
+ <DecisionsRenderer
+ data={{
+ mode: "health",
+ total_decisions: 17,
+ by_source: { adr: 12, commit: 5 },
+ decisions: [{ title: "Use SSE for chat", status: "accepted" }],
+ }}
+ />,
+ );
+ expect(screen.getByText("17")).toBeInTheDocument();
+ expect(screen.getByText("adr")).toBeInTheDocument();
+ expect(screen.getByText("Use SSE for chat")).toBeInTheDocument();
+ });
+
+ it("DecisionsRenderer search mode renders matches with affected files", () => {
+ render(
+ <DecisionsRenderer
+ data={{
+ mode: "search",
+ query: "cache",
+ results: [
+ {
+ title: "LRU artifact cache",
+ decision: "Use LRU.",
+ rationale: "Bounded memory.",
+ affected_files: ["app/services/artifact_service.py"],
+ },
+ ],
+ }}
+ />,
+ );
+ expect(screen.getByText("LRU artifact cache")).toBeInTheDocument();
+ expect(
+ screen.getByText("app/services/artifact_service.py"),
+ ).toBeInTheDocument();
+ });
+
+ it("DeadCodeRenderer separates high and medium confidence", () => {
+ render(
+ <DeadCodeRenderer
+ data={{
+ total_findings: 3,
+ deletable_lines: 88,
+ high_confidence: [
+ {
+ file_path: "src/legacy.ts",
+ symbol_name: "oldFn",
+ kind: "unused_export",
+ confidence: 0.95,
+ reason: "No callers found.",
+ lines: 30,
+ safe_to_delete: true,
+ },
+ ],
+ medium_confidence: [
+ {
+ file_path: "src/maybe.ts",
+ kind: "unreachable_file",
+ confidence: 0.6,
+ reason: "Possibly imported via dynamic require.",
+ },
+ ],
+ }}
+ />,
+ );
+ expect(screen.getByText("3")).toBeInTheDocument();
+ expect(screen.getByText("88")).toBeInTheDocument();
+ expect(screen.getByText(/src\/legacy\.ts::oldFn/)).toBeInTheDocument();
+ expect(screen.getByText("src/maybe.ts")).toBeInTheDocument();
+ expect(screen.getByText("95%")).toBeInTheDocument();
+ });
+
+ it("DiagramRenderer falls back gracefully when no syntax", () => {
+ render(<DiagramRenderer data={{ diagram_type: "flowchart", mermaid_syntax: "" }} />);
+ expect(screen.getByText("No diagram available.")).toBeInTheDocument();
+ });
+
+ it("GenericJsonRenderer pretty-prints data", () => {
+ render(<GenericJsonRenderer data={{ foo: "bar" }} />);
+ expect(screen.getByText(/"foo": "bar"/)).toBeInTheDocument();
+ });
+});
diff --git a/packages/ui/__tests__/chat/chat-interface.test.tsx b/packages/ui/__tests__/chat/chat-interface.test.tsx
new file mode 100644
index 000000000..87a37de01
--- /dev/null
+++ b/packages/ui/__tests__/chat/chat-interface.test.tsx
@@ -0,0 +1,102 @@
+import { describe, it, expect, vi } from "vitest";
+import { render, screen, fireEvent } from "@testing-library/react";
+import { ChatInterface } from "../../src/chat/chat-interface.js";
+import type { ChatUIMessage } from "@repowise-dev/types/chat";
+
+const ASSISTANT_MSG: ChatUIMessage = {
+ id: "asst-1",
+ role: "assistant",
+ text: "Hello — here is an overview.",
+ toolCalls: [],
+ isStreaming: false,
+};
+
+const USER_MSG: ChatUIMessage = {
+ id: "user-1",
+ role: "user",
+ text: "Give me an overview",
+ toolCalls: [],
+ isStreaming: false,
+};
+
+describe("ChatInterface shell", () => {
+ it("renders empty-state heading + suggestion chips when messages is empty", () => {
+ render(
+ <ChatInterface
+ repoId="r1"
+ repoName="acme"
+ messages={[]}
+ isStreaming={false}
+ onSend={vi.fn()}
+ onCancel={vi.fn()}
+ />,
+ );
+ expect(screen.getByText(/Ask anything about acme/i)).toBeInTheDocument();
+ expect(
+ screen.getByText(/Give me an overview of this codebase/i),
+ ).toBeInTheDocument();
+ });
+
+ it("renders messages and hides empty-state when transcript is non-empty", () => {
+ render(
+ <ChatInterface
+ repoId="r1"
+ messages={[USER_MSG, ASSISTANT_MSG]}
+ isStreaming={false}
+ onSend={vi.fn()}
+ onCancel={vi.fn()}
+ />,
+ );
+ expect(screen.getByText("Give me an overview")).toBeInTheDocument();
+ expect(screen.getByText(/Hello — here is an overview\./)).toBeInTheDocument();
+ expect(screen.queryByText(/Ask anything about/i)).not.toBeInTheDocument();
+ });
+
+ it("invokes onSend with trimmed text when the user submits", () => {
+ const onSend = vi.fn();
+ render(
+ <ChatInterface
+ repoId="r1"
+ messages={[]}
+ isStreaming={false}
+ onSend={onSend}
+ onCancel={vi.fn()}
+ />,
+ );
+ const ta = screen.getByLabelText("Chat message") as HTMLTextAreaElement;
+ fireEvent.change(ta, { target: { value: " hi there " } });
+ fireEvent.click(screen.getByRole("button", { name: /send message/i }));
+ expect(onSend).toHaveBeenCalledWith("hi there");
+ });
+
+ it("renders Stop button and invokes onCancel while streaming", () => {
+ const onCancel = vi.fn();
+ render(
+ <ChatInterface
+ repoId="r1"
+ messages={[USER_MSG, { ...ASSISTANT_MSG, isStreaming: true, text: "" }]}
+ isStreaming={true}
+ onSend={vi.fn()}
+ onCancel={onCancel}
+ />,
+ );
+ fireEvent.click(screen.getByRole("button", { name: /stop generation/i }));
+ expect(onCancel).toHaveBeenCalled();
+ });
+
+ it("renders modelSelectorSlot + historySlot in the active-conversation header", () => {
+ render(
+ <ChatInterface
+ repoId="r1"
+ messages={[USER_MSG, ASSISTANT_MSG]}
+ isStreaming={false}
+ onSend={vi.fn()}
+ onCancel={vi.fn()}
+ modelSelectorSlot={<div data-testid="model-slot">model</div>}
+ historySlot={<div data-testid="history-slot">history</div>}
+ />,
+ );
+ expect(screen.getByTestId("model-slot")).toBeInTheDocument();
+ expect(screen.getByTestId("history-slot")).toBeInTheDocument();
+ });
+});
diff --git a/packages/ui/__tests__/chat/conversation-history.test.tsx b/packages/ui/__tests__/chat/conversation-history.test.tsx
new file mode 100644
index 000000000..3646d2837
--- /dev/null
+++ b/packages/ui/__tests__/chat/conversation-history.test.tsx
@@ -0,0 +1,100 @@
+import { describe, it, expect, vi } from "vitest";
+import { render, screen, fireEvent } from "@testing-library/react";
+import { ConversationHistory } from "../../src/chat/conversation-history.js";
+import type { Conversation } from "@repowise-dev/types/chat";
+
+const CONVERSATIONS: Conversation[] = [
+ {
+ id: "c1",
+ repository_id: "r1",
+ title: "Auth flow review",
+ message_count: 4,
+ created_at: new Date(Date.now() - 60_000).toISOString(),
+ updated_at: new Date(Date.now() - 60_000).toISOString(),
+ },
+ {
+ id: "c2",
+ repository_id: "r1",
+ title: "Dead code triage",
+ message_count: 2,
+ created_at: new Date(Date.now() - 7_200_000).toISOString(),
+ updated_at: new Date(Date.now() - 7_200_000).toISOString(),
+ },
+];
+
+describe("ConversationHistory shell", () => {
+ it("renders the history trigger button", () => {
+ render(
+ <ConversationHistory
+ conversations={CONVERSATIONS}
+ onSelect={vi.fn()}
+ onDelete={vi.fn()}
+ onNew={vi.fn()}
+ />,
+ );
+ expect(
+ screen.getByRole("button", { name: /history/i }),
+ ).toBeInTheDocument();
+ });
+
+ it("opens dropdown and lists conversations on click", () => {
+ render(
+ <ConversationHistory
+ conversations={CONVERSATIONS}
+ onSelect={vi.fn()}
+ onDelete={vi.fn()}
+ onNew={vi.fn()}
+ />,
+ );
+ fireEvent.click(screen.getByRole("button", { name: /history/i }));
+ expect(screen.getByText("Auth flow review")).toBeInTheDocument();
+ expect(screen.getByText("Dead code triage")).toBeInTheDocument();
+ expect(screen.getByText(/New conversation/i)).toBeInTheDocument();
+ });
+
+ it("forwards onSelect when a conversation row is clicked", () => {
+ const onSelect = vi.fn();
+ render(
+ <ConversationHistory
+ conversations={CONVERSATIONS}
+ onSelect={onSelect}
+ onDelete={vi.fn()}
+ onNew={vi.fn()}
+ />,
+ );
+ fireEvent.click(screen.getByRole("button", { name: /history/i }));
+ fireEvent.click(screen.getByText("Auth flow review"));
+ expect(onSelect).toHaveBeenCalledWith("c1");
+ });
+
+ it("forwards onDelete when the row trash icon is clicked", () => {
+ const onDelete = vi.fn();
+ render(
+ <ConversationHistory
+ conversations={CONVERSATIONS}
+ onSelect={vi.fn()}
+ onDelete={onDelete}
+ onNew={vi.fn()}
+ />,
+ );
+ fireEvent.click(screen.getByRole("button", { name: /history/i }));
+ const deleteButtons = screen.getAllByRole("button", {
+ name: /delete conversation/i,
+ });
+ fireEvent.click(deleteButtons[0]!);
+ expect(onDelete).toHaveBeenCalledWith("c1");
+ });
+
+ it("renders the empty placeholder when conversations is an empty list", () => {
+ render(
+ <ConversationHistory
+ conversations={[]}
+ onSelect={vi.fn()}
+ onDelete={vi.fn()}
+ onNew={vi.fn()}
+ />,
+ );
+ fireEvent.click(screen.getByRole("button", { name: /history/i }));
+ expect(screen.getByText(/No conversations yet/i)).toBeInTheDocument();
+ });
+});
diff --git a/packages/ui/__tests__/chat/model-selector.test.tsx b/packages/ui/__tests__/chat/model-selector.test.tsx
new file mode 100644
index 000000000..b3335a741
--- /dev/null
+++ b/packages/ui/__tests__/chat/model-selector.test.tsx
@@ -0,0 +1,67 @@
+import { describe, it, expect, vi } from "vitest";
+import { render, screen, fireEvent } from "@testing-library/react";
+import { ModelSelector } from "../../src/chat/model-selector.js";
+
+const PROVIDERS = [
+ {
+ id: "anthropic",
+ name: "Anthropic",
+ models: ["claude-opus-4-7", "claude-sonnet-4-6"],
+ default_model: "claude-opus-4-7",
+ configured: true,
+ },
+ {
+ id: "openai",
+ name: "OpenAI",
+ models: ["gpt-5"],
+ default_model: "gpt-5",
+ configured: false,
+ },
+];
+
+describe("ModelSelector shell", () => {
+ it("shows the active provider/model in the trigger label", () => {
+ render(
+ <ModelSelector
+ providers={PROVIDERS}
+ activeProvider="anthropic"
+ activeModel="claude-opus-4-7"
+ onActivate={vi.fn()}
+ onSaveKey={vi.fn()}
+ />,
+ );
+ expect(
+ screen.getByText("Anthropic · claude-opus-4-7"),
+ ).toBeInTheDocument();
+ });
+
+ it("calls onActivate with provider + model when a configured model is clicked", async () => {
+ const onActivate = vi.fn();
+ render(
+ <ModelSelector
+ providers={PROVIDERS}
+ activeProvider={null}
+ activeModel={null}
+ onActivate={onActivate}
+ onSaveKey={vi.fn()}
+ />,
+ );
+ fireEvent.click(screen.getByText("Select model"));
+ fireEvent.click(screen.getByText("claude-sonnet-4-6"));
+ expect(onActivate).toHaveBeenCalledWith("anthropic", "claude-sonnet-4-6");
+ });
+
+ it("shows Add-key affordance for unconfigured providers", () => {
+ render(
+ <ModelSelector
+ providers={PROVIDERS}
+ activeProvider="anthropic"
+ activeModel="claude-opus-4-7"
+ onActivate={vi.fn()}
+ onSaveKey={vi.fn()}
+ />,
+ );
+ fireEvent.click(screen.getByText("Anthropic · claude-opus-4-7"));
+ expect(screen.getByText("Add key")).toBeInTheDocument();
+ });
+});
diff --git a/packages/ui/__tests__/chat/source-citation.test.tsx b/packages/ui/__tests__/chat/source-citation.test.tsx
new file mode 100644
index 000000000..d0dd20c63
--- /dev/null
+++ b/packages/ui/__tests__/chat/source-citation.test.tsx
@@ -0,0 +1,45 @@
+import { describe, it, expect } from "vitest";
+import { render, screen } from "@testing-library/react";
+import { SourceCitation } from "../../src/chat/source-citation.js";
+
+describe("SourceCitation", () => {
+ it("renders a file label with line range when provided", () => {
+ render(
+ <SourceCitation
+ citation={{
+ file_path: "packages/ui/src/chat/artifacts.tsx",
+ start_line: 10,
+ end_line: 25,
+ }}
+ index={1}
+ />,
+ );
+ expect(screen.getByText("artifacts.tsx")).toBeInTheDocument();
+ expect(screen.getByText("L10-25")).toBeInTheDocument();
+ expect(screen.getByText("1")).toBeInTheDocument();
+ });
+
+ it("appends symbol name when present", () => {
+ render(
+ <SourceCitation
+ citation={{
+ file_path: "src/foo.py",
+ symbol_name: "do_thing",
+ }}
+ />,
+ );
+ expect(screen.getByText("foo.py::do_thing")).toBeInTheDocument();
+ });
+
+ it("becomes a link when buildHref is supplied", () => {
+ render(
+ <SourceCitation
+ citation={{ file_path: "a/b.ts" }}
+ buildHref={(c) => `/wiki/${encodeURIComponent(c.file_path)}`}
+ />,
+ );
+ const link = screen.getByText("b.ts").closest("a");
+ expect(link).not.toBeNull();
+ expect(link?.getAttribute("href")).toBe("/wiki/a%2Fb.ts");
+ });
+});
diff --git a/packages/ui/__tests__/coverage/freshness-table.test.tsx b/packages/ui/__tests__/coverage/freshness-table.test.tsx
new file mode 100644
index 000000000..b5b462bea
--- /dev/null
+++ b/packages/ui/__tests__/coverage/freshness-table.test.tsx
@@ -0,0 +1,78 @@
+import { describe, it, expect, vi } from "vitest";
+import { render, screen, fireEvent, waitFor } from "@testing-library/react";
+import { FreshnessTable } from "../../src/coverage/freshness-table.js";
+import type { DocPage } from "@repowise-dev/types/docs";
+
+function makePage(overrides: Partial<DocPage> = {}): DocPage {
+ return {
+ id: "p1",
+ repository_id: "r1",
+ page_type: "module",
+ title: "Page 1",
+ content: "...",
+ target_path: "src/foo.ts",
+ source_hash: "h",
+ model_name: "gemini-2.5",
+ provider_name: "google",
+ input_tokens: 0,
+ output_tokens: 0,
+ cached_tokens: 0,
+ generation_level: 1,
+ version: 1,
+ confidence: 0.9,
+ freshness_status: "fresh",
+ metadata: {},
+ human_notes: null,
+ created_at: "2026-01-01T00:00:00Z",
+ updated_at: "2026-01-01T00:00:00Z",
+ ...overrides,
+ };
+}
+
+describe("FreshnessTable", () => {
+ it("renders one row per page", () => {
+ render(
+ <FreshnessTable
+ pages={[
+ makePage({ id: "1", target_path: "a.ts" }),
+ makePage({ id: "2", target_path: "b.ts", freshness_status: "stale" }),
+ ]}
+ />,
+ );
+ expect(screen.getByText("a.ts")).toBeInTheDocument();
+ expect(screen.getByText("b.ts")).toBeInTheDocument();
+ });
+
+ it("filters rows when a status tab is clicked", () => {
+ render(
+ <FreshnessTable
+ pages={[
+ makePage({ id: "1", target_path: "fresh.ts", freshness_status: "fresh" }),
+ makePage({ id: "2", target_path: "stale.ts", freshness_status: "stale" }),
+ ]}
+ />,
+ );
+ fireEvent.click(screen.getByRole("tab", { name: /Stale/ }));
+ expect(screen.queryByText("fresh.ts")).not.toBeInTheDocument();
+ expect(screen.getByText("stale.ts")).toBeInTheDocument();
+ });
+
+ it("invokes onRegenerate with the page id when the button is clicked", async () => {
+ const onRegenerate = vi.fn().mockResolvedValue(undefined);
+ render(
+ <FreshnessTable
+ pages={[makePage({ id: "p1", target_path: "x.ts" })]}
+ onRegenerate={onRegenerate}
+ />,
+ );
+ fireEvent.click(screen.getByRole("button", { name: "Regenerate" }));
+ await waitFor(() => expect(onRegenerate).toHaveBeenCalledWith("p1"));
+ });
+
+ it("hides the regenerate button when no callback is supplied", () => {
+ render(<FreshnessTable pages={[makePage()]} />);
+ expect(
+ screen.queryByRole("button", { name: "Regenerate" }),
+ ).not.toBeInTheDocument();
+ });
+});
diff --git a/packages/ui/__tests__/dashboard/active-job-banner.test.tsx b/packages/ui/__tests__/dashboard/active-job-banner.test.tsx
new file mode 100644
index 000000000..16e41c02b
--- /dev/null
+++ b/packages/ui/__tests__/dashboard/active-job-banner.test.tsx
@@ -0,0 +1,64 @@
+import { describe, it, expect } from "vitest";
+import { render, screen } from "@testing-library/react";
+import { ActiveJobBanner } from "../../src/dashboard/active-job-banner.js";
+import type { Job } from "@repowise-dev/types/jobs";
+
+function makeJob(overrides: Partial<Job> = {}): Job {
+ return {
+ id: "j1",
+ repository_id: "r1",
+ status: "running",
+ provider_name: "openai",
+ model_name: "gpt-5.4-mini",
+ total_pages: 10,
+ completed_pages: 3,
+ failed_pages: 0,
+ current_level: 0,
+ error_message: null,
+ config: { mode: "sync" },
+ created_at: "2026-01-01T00:00:00Z",
+ updated_at: "2026-01-01T00:00:00Z",
+ started_at: "2026-01-01T00:00:00Z",
+ finished_at: null,
+ ...overrides,
+ };
+}
+
+describe("ActiveJobBanner", () => {
+ it("renders nothing when job is null", () => {
+ const { container } = render(<ActiveJobBanner job={null} />);
+ expect(container.firstChild).toBeNull();
+ });
+
+ it("renders running state with progress fraction", () => {
+ render(<ActiveJobBanner job={makeJob()} />);
+ expect(screen.getByText(/Sync · Indexing/)).toBeInTheDocument();
+ expect(screen.getByText("3/10")).toBeInTheDocument();
+ });
+
+ it("renders failed state with error message", () => {
+ render(
+ <ActiveJobBanner
+ job={makeJob({ status: "failed", error_message: "boom" })}
+ />,
+ );
+ expect(screen.getByText("Sync failed")).toBeInTheDocument();
+ expect(screen.getByText("boom")).toBeInTheDocument();
+ });
+
+ it("renders details link only when href is provided", () => {
+ const { rerender } = render(
+ <ActiveJobBanner
+ job={makeJob({ status: "completed", completed_pages: 10, finished_at: "2026-01-01T00:01:00Z" })}
+ />,
+ );
+ expect(screen.queryByText("Details")).not.toBeInTheDocument();
+ rerender(
+ <ActiveJobBanner
+ job={makeJob({ status: "completed", completed_pages: 10, finished_at: "2026-01-01T00:01:00Z" })}
+ detailsHref="/repos/abc/overview"
+ />,
+ );
+ expect(screen.getByText("Details")).toBeInTheDocument();
+ });
+});
diff --git a/packages/ui/__tests__/dashboard/community-summary-grid.test.tsx b/packages/ui/__tests__/dashboard/community-summary-grid.test.tsx
new file mode 100644
index 000000000..966d25afb
--- /dev/null
+++ b/packages/ui/__tests__/dashboard/community-summary-grid.test.tsx
@@ -0,0 +1,55 @@
+import { describe, it, expect, vi } from "vitest";
+import { render, screen, fireEvent } from "@testing-library/react";
+import { CommunitySummaryGrid } from "../../src/dashboard/community-summary-grid.js";
+import type {
+ CommunityDetail,
+ CommunitySummaryItem,
+} from "@repowise-dev/types/graph";
+
+const summaries: CommunitySummaryItem[] = [
+ { community_id: 1, label: "auth", cohesion: 0.84, member_count: 12, top_file: "auth/index.ts" },
+ { community_id: 2, label: "billing", cohesion: 0.62, member_count: 7, top_file: "billing/api.ts" },
+];
+
+const detail: CommunityDetail = {
+ community_id: 1,
+ label: "auth",
+ cohesion: 0.84,
+ member_count: 2,
+ members: [
+ { path: "auth/index.ts", pagerank: 0.0123, is_entry_point: true },
+ { path: "auth/jwt.ts", pagerank: 0.0089, is_entry_point: false },
+ ],
+ truncated: false,
+ neighboring_communities: [
+ { community_id: 2, label: "billing", cross_edge_count: 3 },
+ ],
+};
+
+describe("CommunitySummaryGrid", () => {
+ it("renders one row per summary with cohesion + member count", () => {
+ render(<CommunitySummaryGrid communities={summaries} />);
+ expect(screen.getByText("auth")).toBeInTheDocument();
+ expect(screen.getByText("12 files")).toBeInTheDocument();
+ expect(screen.getByText("billing")).toBeInTheDocument();
+ });
+
+ it("renders nothing when communities is empty", () => {
+ const { container } = render(<CommunitySummaryGrid communities={[]} />);
+ expect(container.firstChild).toBeNull();
+ });
+
+ it("calls onExpand and renders detail when supplied", () => {
+ const onExpand = vi.fn();
+ render(
+ <CommunitySummaryGrid
+ communities={summaries}
+ details={{ 1: detail }}
+ onExpand={onExpand}
+ />,
+ );
+ fireEvent.click(screen.getByText("auth"));
+ expect(onExpand).toHaveBeenCalledWith(1);
+ expect(screen.getByText("Connected Communities")).toBeInTheDocument();
+ });
+});
diff --git a/packages/ui/__tests__/dashboard/quick-actions.test.tsx b/packages/ui/__tests__/dashboard/quick-actions.test.tsx
new file mode 100644
index 000000000..32e93b331
--- /dev/null
+++ b/packages/ui/__tests__/dashboard/quick-actions.test.tsx
@@ -0,0 +1,50 @@
+import { describe, it, expect, vi } from "vitest";
+import { render, screen, fireEvent, waitFor } from "@testing-library/react";
+import { QuickActions } from "../../src/dashboard/quick-actions.js";
+
+describe("QuickActions", () => {
+ it("renders all three default action buttons + last-synced footer", () => {
+ render(
+ <QuickActions
+ onAction={vi.fn()}
+ lastSyncAt="2026-01-01T00:00:00Z"
+ lastResyncAt={null}
+ />,
+ );
+ expect(screen.getByRole("button", { name: /Sync/i })).toBeInTheDocument();
+ expect(screen.getByRole("button", { name: /Full Re-index/i })).toBeInTheDocument();
+ expect(screen.getByRole("button", { name: /Dead Code Scan/i })).toBeInTheDocument();
+ expect(screen.getByText(/Last re-indexed/)).toBeInTheDocument();
+ expect(screen.getByText(/never/i)).toBeInTheDocument();
+ });
+
+ it("opens confirm dialog for needsConfirm actions and forwards key on confirm", async () => {
+ const onAction = vi.fn().mockResolvedValue(undefined);
+ render(<QuickActions onAction={onAction} pageCount={50} modelName="gpt-5.4-mini" />);
+
+ fireEvent.click(screen.getByRole("button", { name: /^Sync$/ }));
+ expect(await screen.findByText("Sync Repository")).toBeInTheDocument();
+ // The confirm button inside the dialog re-uses the same action label.
+ const confirmButtons = screen.getAllByRole("button", { name: /^Sync$/ });
+ fireEvent.click(confirmButtons[confirmButtons.length - 1]!);
+ await waitFor(() => expect(onAction).toHaveBeenCalledWith("sync"));
+ });
+
+ it("renders activeJobSlot in place of the buttons when provided", () => {
+ render(
+ <QuickActions
+ onAction={vi.fn()}
+ activeJobSlot={<div data-testid="job-progress">progress</div>}
+ />,
+ );
+ expect(screen.getByTestId("job-progress")).toBeInTheDocument();
+ expect(screen.queryByRole("button", { name: /^Sync$/ })).not.toBeInTheDocument();
+ });
+
+ it("fires non-confirming actions immediately (dead-code path)", () => {
+ const onAction = vi.fn().mockResolvedValue(undefined);
+ render(<QuickActions onAction={onAction} />);
+ fireEvent.click(screen.getByRole("button", { name: /Dead Code Scan/i }));
+ expect(onAction).toHaveBeenCalledWith("dead-code");
+ });
+});
diff --git a/packages/ui/__tests__/dead-code/summary-bar.test.tsx b/packages/ui/__tests__/dead-code/summary-bar.test.tsx
new file mode 100644
index 000000000..6d355ab85
--- /dev/null
+++ b/packages/ui/__tests__/dead-code/summary-bar.test.tsx
@@ -0,0 +1,29 @@
+import { describe, it, expect } from "vitest";
+import { render, screen } from "@testing-library/react";
+import { SummaryBar } from "../../src/dead-code/summary-bar.js";
+import type { DeadCodeSummary } from "@repowise-dev/types/dead-code";
+
+const SUMMARY: DeadCodeSummary = {
+ total_findings: 142,
+ confidence_summary: { high: 89, medium: 41, low: 12 },
+ deletable_lines: 4321,
+ total_lines: 91234,
+ by_kind: { unreachable_file: 12, unused_export: 88, zombie_package: 42 },
+};
+
+describe("SummaryBar", () => {
+ it("renders the headline counts", () => {
+ render(<SummaryBar summary={SUMMARY} />);
+ expect(screen.getByText("142")).toBeInTheDocument();
+ expect(screen.getByText("4,321")).toBeInTheDocument();
+ });
+
+ it("breaks out by_kind and confidence_summary entries", () => {
+ render(<SummaryBar summary={SUMMARY} />);
+ expect(screen.getByText("unreachable file")).toBeInTheDocument();
+ expect(screen.getByText("unused export")).toBeInTheDocument();
+ expect(screen.getByText("zombie package")).toBeInTheDocument();
+ expect(screen.getByText("high")).toBeInTheDocument();
+ expect(screen.getByText("89")).toBeInTheDocument();
+ });
+});
diff --git a/packages/ui/__tests__/decisions/decision-health-widget.test.tsx b/packages/ui/__tests__/decisions/decision-health-widget.test.tsx
new file mode 100644
index 000000000..ad44a8296
--- /dev/null
+++ b/packages/ui/__tests__/decisions/decision-health-widget.test.tsx
@@ -0,0 +1,28 @@
+import { describe, it, expect } from "vitest";
+import { render, screen } from "@testing-library/react";
+import { DecisionHealthWidget } from "../../src/decisions/decision-health-widget.js";
+import type { DecisionHealth } from "@repowise-dev/types/decisions";
+
+const HEALTH: DecisionHealth = {
+ summary: { active: 12, proposed: 3, deprecated: 1, superseded: 2, stale: 4 },
+ stale_decisions: [],
+ proposed_awaiting_review: [],
+ ungoverned_hotspots: [],
+};
+
+describe("DecisionHealthWidget", () => {
+ it("renders nothing while health is undefined", () => {
+ const { container } = render(<DecisionHealthWidget health={undefined} />);
+ expect(container.firstChild).toBeNull();
+ });
+
+ it("renders three stat cards with the summary counts", () => {
+ render(<DecisionHealthWidget health={HEALTH} />);
+ expect(screen.getByText("Active Decisions")).toBeInTheDocument();
+ expect(screen.getByText("12")).toBeInTheDocument();
+ expect(screen.getByText("Proposed")).toBeInTheDocument();
+ expect(screen.getByText("3")).toBeInTheDocument();
+ expect(screen.getByText("Stale")).toBeInTheDocument();
+ expect(screen.getByText("4")).toBeInTheDocument();
+ });
+});
diff --git a/packages/ui/__tests__/decisions/decisions-table.test.tsx b/packages/ui/__tests__/decisions/decisions-table.test.tsx
new file mode 100644
index 000000000..3fc593a7c
--- /dev/null
+++ b/packages/ui/__tests__/decisions/decisions-table.test.tsx
@@ -0,0 +1,87 @@
+import { describe, it, expect, vi } from "vitest";
+import { render, screen, fireEvent } from "@testing-library/react";
+import { DecisionsTable } from "../../src/decisions/decisions-table.js";
+import type { DecisionRecord } from "@repowise-dev/types/decisions";
+
+function makeDecision(overrides: Partial<DecisionRecord> = {}): DecisionRecord {
+ return {
+ id: "d1",
+ repository_id: "r1",
+ title: "Pick Postgres",
+ status: "active",
+ context: "",
+ decision: "",
+ rationale: "",
+ alternatives: [],
+ consequences: [],
+ affected_files: [],
+ affected_modules: [],
+ tags: ["infra"],
+ source: "git_archaeology",
+ evidence_commits: [],
+ evidence_file: null,
+ evidence_line: null,
+ confidence: 0.9,
+ staleness_score: 0,
+ superseded_by: null,
+ last_code_change: null,
+ created_at: "2026-01-01T00:00:00Z",
+ updated_at: "2026-01-01T00:00:00Z",
+ ...overrides,
+ };
+}
+
+describe("DecisionsTable", () => {
+ const baseProps = {
+ repoId: "r1",
+ filters: { status: "all" as const, source: "all" as const },
+ onFiltersChange: vi.fn(),
+ };
+
+ it("renders one row per decision", () => {
+ render(
+ <DecisionsTable
+ {...baseProps}
+ decisions={[
+ makeDecision({ id: "1", title: "Pick Postgres" }),
+ makeDecision({ id: "2", title: "Adopt SWR" }),
+ ]}
+ />,
+ );
+ expect(screen.getByText("Pick Postgres")).toBeInTheDocument();
+ expect(screen.getByText("Adopt SWR")).toBeInTheDocument();
+ });
+
+ it("invokes onFiltersChange when the status filter changes", () => {
+ const onFiltersChange = vi.fn();
+ render(
+ <DecisionsTable {...baseProps} onFiltersChange={onFiltersChange} decisions={[]} />,
+ );
+ fireEvent.change(screen.getByLabelText("Filter by status"), {
+ target: { value: "active" },
+ });
+ expect(onFiltersChange).toHaveBeenCalledWith({
+ status: "active",
+ source: "all",
+ });
+ });
+
+ it("renders a retry button when an error is supplied with no decisions", () => {
+ const onRetry = vi.fn();
+ render(
+ <DecisionsTable
+ {...baseProps}
+ decisions={[]}
+ error={new Error("boom")}
+ onRetry={onRetry}
+ />,
+ );
+ fireEvent.click(screen.getByRole("button", { name: "Retry" }));
+ expect(onRetry).toHaveBeenCalledOnce();
+ });
+
+ it("renders an empty-state message when there are no decisions and no error", () => {
+ render(<DecisionsTable {...baseProps} decisions={[]} />);
+ expect(screen.getByText("No decisions found")).toBeInTheDocument();
+ });
+});
diff --git a/packages/ui/__tests__/docs/docs-tree.test.tsx b/packages/ui/__tests__/docs/docs-tree.test.tsx
new file mode 100644
index 000000000..cf7cf6f22
--- /dev/null
+++ b/packages/ui/__tests__/docs/docs-tree.test.tsx
@@ -0,0 +1,61 @@
+import { describe, it, expect, vi } from "vitest";
+import { render, screen, fireEvent } from "@testing-library/react";
+import { DocsTree } from "../../src/docs/docs-tree.js";
+import type { DocPage } from "@repowise-dev/types/docs";
+
+function makePage(overrides: Partial<DocPage> = {}): DocPage {
+ return {
+ id: "p1",
+ repository_id: "r1",
+ page_type: "file_page",
+ title: "Page",
+ content: "",
+ target_path: "src/foo.ts",
+ source_hash: "h",
+ model_name: "m",
+ provider_name: "g",
+ input_tokens: 0,
+ output_tokens: 0,
+ cached_tokens: 0,
+ generation_level: 1,
+ version: 1,
+ confidence: 0.9,
+ freshness_status: "fresh",
+ metadata: {},
+ human_notes: null,
+ created_at: "2026-01-01T00:00:00Z",
+ updated_at: "2026-01-01T00:00:00Z",
+ ...overrides,
+ };
+}
+
+describe("DocsTree", () => {
+ it("renders page nodes from the supplied pages array", () => {
+ render(
+ <DocsTree
+ pages={[
+ makePage({ id: "1", target_path: "src/foo.ts", title: "foo.ts" }),
+ makePage({ id: "2", target_path: "src/bar.ts", title: "bar.ts" }),
+ ]}
+ selectedPageId={null}
+ onSelectPage={() => {}}
+ />,
+ );
+ expect(screen.getByText("foo.ts")).toBeInTheDocument();
+ expect(screen.getByText("bar.ts")).toBeInTheDocument();
+ });
+
+ it("invokes onSelectPage when a leaf page is clicked", () => {
+ const onSelectPage = vi.fn();
+ const target = makePage({ id: "x", target_path: "x.ts", title: "x.ts" });
+ render(
+ <DocsTree
+ pages={[target]}
+ selectedPageId={null}
+ onSelectPage={onSelectPage}
+ />,
+ );
+ fireEvent.click(screen.getByText("x.ts"));
+ expect(onSelectPage).toHaveBeenCalledWith(target);
+ });
+});
diff --git a/packages/ui/__tests__/git/churn-bar.test.tsx b/packages/ui/__tests__/git/churn-bar.test.tsx
new file mode 100644
index 000000000..ec9acdc4e
--- /dev/null
+++ b/packages/ui/__tests__/git/churn-bar.test.tsx
@@ -0,0 +1,16 @@
+import { describe, it, expect } from "vitest";
+import { render } from "@testing-library/react";
+import { ChurnBar } from "../../src/git/churn-bar.js";
+
+describe("ChurnBar", () => {
+ it("renders with red fill at high percentile", () => {
+ const { container } = render(<ChurnBar percentile={85} />);
+ expect(container.querySelector(".bg-red-500")).not.toBeNull();
+ });
+
+ it("clamps width to 0–100%", () => {
+ const { container } = render(<ChurnBar percentile={150} />);
+ const inner = container.querySelector(".bg-red-500") as HTMLElement;
+ expect(inner.style.width).toBe("100%");
+ });
+});
diff --git a/packages/ui/__tests__/graph/graph-community-panel.test.tsx b/packages/ui/__tests__/graph/graph-community-panel.test.tsx
new file mode 100644
index 000000000..89df872c5
--- /dev/null
+++ b/packages/ui/__tests__/graph/graph-community-panel.test.tsx
@@ -0,0 +1,49 @@
+import { describe, it, expect, vi } from "vitest";
+import { render, screen } from "@testing-library/react";
+import { GraphCommunityPanel } from "../../src/graph/graph-community-panel.js";
+import type { CommunityDetail } from "@repowise-dev/types/graph";
+
+const sampleCommunity: CommunityDetail = {
+ community_id: 7,
+ label: "auth-cluster",
+ cohesion: 0.82,
+ member_count: 3,
+ members: [
+ { path: "src/auth/login.ts", pagerank: 0.05, is_entry_point: true },
+ { path: "src/auth/session.ts", pagerank: 0.03, is_entry_point: false },
+ { path: "src/auth/utils.ts", pagerank: 0.01, is_entry_point: false },
+ ],
+ truncated: false,
+ neighboring_communities: [
+ { community_id: 4, label: "db-cluster", cross_edge_count: 12 },
+ ],
+};
+
+describe("GraphCommunityPanel", () => {
+ it("renders community label, members, and neighbors", () => {
+ render(
+ <GraphCommunityPanel
+ communityId={7}
+ community={sampleCommunity}
+ isLoading={false}
+ onClose={vi.fn()}
+ />,
+ );
+ expect(screen.getByText("auth-cluster")).toBeTruthy();
+ expect(screen.getByText("Members (3)")).toBeTruthy();
+ expect(screen.getByText("db-cluster")).toBeTruthy();
+ });
+
+ it("falls back to a numeric label when community is null", () => {
+ render(
+ <GraphCommunityPanel
+ communityId={42}
+ community={null}
+ isLoading={false}
+ onClose={vi.fn()}
+ />,
+ );
+ expect(screen.getByText("Community 42")).toBeTruthy();
+ expect(screen.getByText("Community not found")).toBeTruthy();
+ });
+});
diff --git a/packages/ui/__tests__/graph/graph-doc-panel.test.tsx b/packages/ui/__tests__/graph/graph-doc-panel.test.tsx
new file mode 100644
index 000000000..27465e2b4
--- /dev/null
+++ b/packages/ui/__tests__/graph/graph-doc-panel.test.tsx
@@ -0,0 +1,57 @@
+import { describe, it, expect, vi } from "vitest";
+import { render, screen } from "@testing-library/react";
+import { GraphDocPanel } from "../../src/graph/graph-doc-panel.js";
+import type { DocPage } from "@repowise-dev/types/docs";
+
+const samplePage: DocPage = {
+ id: "file_page:src/foo.ts",
+ repository_id: "repo-1",
+ page_type: "file_page",
+ title: "foo.ts",
+ content: "# Foo\n\nDocs body.",
+ target_path: "src/foo.ts",
+ source_hash: "abc",
+ model_name: "claude-haiku-4-5",
+ provider_name: "anthropic",
+ input_tokens: 100,
+ output_tokens: 50,
+ cached_tokens: 0,
+ generation_level: 1,
+ version: 1,
+ confidence: 0.85,
+ freshness_status: "fresh",
+ metadata: {},
+ human_notes: null,
+ created_at: "2026-04-01T00:00:00Z",
+ updated_at: "2026-04-10T00:00:00Z",
+};
+
+describe("GraphDocPanel", () => {
+ it("renders the page title and meta when a page is provided", () => {
+ render(
+ <GraphDocPanel
+ nodeId="src/foo.ts"
+ page={samplePage}
+ isLoading={false}
+ onClose={vi.fn()}
+ />,
+ );
+ expect(screen.getByText("foo.ts")).toBeTruthy();
+ expect(screen.getByText("claude-haiku-4-5")).toBeTruthy();
+ });
+
+ it("renders the empty state when an error is supplied", () => {
+ render(
+ <GraphDocPanel
+ nodeId="src/missing.ts"
+ page={null}
+ isLoading={false}
+ error={new Error("404")}
+ browseDocsHref="/repos/r/docs"
+ onClose={vi.fn()}
+ />,
+ );
+ expect(screen.getByText("No documentation found for this file.")).toBeTruthy();
+ expect(screen.getByText("Browse all docs").getAttribute("href")).toBe("/repos/r/docs");
+ });
+});
diff --git a/packages/ui/__tests__/graph/graph-flow.test.tsx b/packages/ui/__tests__/graph/graph-flow.test.tsx
new file mode 100644
index 000000000..42549b53c
--- /dev/null
+++ b/packages/ui/__tests__/graph/graph-flow.test.tsx
@@ -0,0 +1,44 @@
+import { describe, it, expect, vi } from "vitest";
+import { render, screen } from "@testing-library/react";
+import { GraphFlow } from "../../src/graph/graph-flow.js";
+
+// Mock @xyflow/react — the real implementation needs a measured DOM that
+// jsdom doesn't provide; we just want to assert the shell composes the
+// surrounding chrome correctly.
+vi.mock("@xyflow/react", () => ({
+ ReactFlow: ({ children }: { children?: React.ReactNode }) => (
+ <div data-testid="react-flow-mock">{children}</div>
+ ),
+ ReactFlowProvider: ({ children }: { children?: React.ReactNode }) => <>{children}</>,
+ MiniMap: () => null,
+ Controls: () => null,
+ Background: () => null,
+ BackgroundVariant: { Dots: "dots" },
+ useReactFlow: () => ({ getNode: () => undefined, fitView: vi.fn() }),
+}));
+
+// elk-layout / use-elk-layout do real DOM work; stub them out.
+vi.mock("../../src/graph/use-elk-layout.js", () => ({
+ useModuleElkLayout: () => ({ nodes: [], edges: [], isLayouting: false }),
+ useFileElkLayout: () => ({ nodes: [], edges: [], isLayouting: false }),
+}));
+
+describe("GraphFlow shell", () => {
+ it("renders the empty state when no nodes are layouted", () => {
+ render(
+ <GraphFlow
+ moduleGraph={undefined}
+ isLoadingModuleGraph={false}
+ fullGraph={undefined}
+ isLoadingFullGraph={false}
+ architectureGraph={undefined}
+ isLoadingArchitectureGraph={false}
+ deadCodeGraph={undefined}
+ isLoadingDeadCodeGraph={false}
+ hotFilesGraph={undefined}
+ isLoadingHotFilesGraph={false}
+ />,
+ );
+ expect(screen.getByText("No graph data")).toBeTruthy();
+ });
+});
diff --git a/packages/ui/__tests__/graph/graph-tooltip.test.tsx b/packages/ui/__tests__/graph/graph-tooltip.test.tsx
new file mode 100644
index 000000000..e05e5d3f3
--- /dev/null
+++ b/packages/ui/__tests__/graph/graph-tooltip.test.tsx
@@ -0,0 +1,55 @@
+import { describe, it, expect, vi } from "vitest";
+import { render, screen } from "@testing-library/react";
+import { GraphTooltip } from "../../src/graph/graph-tooltip.js";
+
+describe("GraphTooltip", () => {
+ it("renders file metadata for a file node", () => {
+ render(
+ <GraphTooltip
+ nodeId="src/foo/bar.ts"
+ nodeType="fileNode"
+ data={{
+ label: "bar.ts",
+ fullPath: "src/foo/bar.ts",
+ language: "typescript",
+ symbolCount: 3,
+ pagerank: 0.005,
+ betweenness: 0.002,
+ communityId: 1,
+ isTest: false,
+ isEntryPoint: false,
+ hasDoc: false,
+ }}
+ x={100}
+ y={100}
+ onClose={vi.fn()}
+ onViewDocs={vi.fn()}
+ />,
+ );
+ expect(screen.getByText("bar.ts")).toBeTruthy();
+ expect(screen.getByText("typescript")).toBeTruthy();
+ });
+
+ it("renders module metadata for a moduleGroup node", () => {
+ render(
+ <GraphTooltip
+ nodeId="src/foo"
+ nodeType="moduleGroup"
+ data={{
+ label: "foo",
+ fullPath: "src/foo",
+ fileCount: 5,
+ symbolCount: 12,
+ avgPagerank: 0.001,
+ docCoveragePct: 0.6,
+ }}
+ x={50}
+ y={50}
+ onClose={vi.fn()}
+ onViewDocs={vi.fn()}
+ />,
+ );
+ expect(screen.getByText("Doc coverage")).toBeTruthy();
+ expect(screen.getByText("60%")).toBeTruthy();
+ });
+});
diff --git a/packages/ui/__tests__/graph/path-finder-panel.test.tsx b/packages/ui/__tests__/graph/path-finder-panel.test.tsx
new file mode 100644
index 000000000..72a3e41d5
--- /dev/null
+++ b/packages/ui/__tests__/graph/path-finder-panel.test.tsx
@@ -0,0 +1,36 @@
+import { describe, it, expect, vi } from "vitest";
+import { render, screen } from "@testing-library/react";
+import { PathFinderPanel } from "../../src/graph/path-finder-panel.js";
+
+describe("PathFinderPanel", () => {
+ it("renders title and disabled find button when inputs are empty", () => {
+ render(
+ <PathFinderPanel
+ searchNodes={vi.fn().mockResolvedValue([])}
+ findPath={vi.fn().mockResolvedValue({ path: [], distance: 0, explanation: "" })}
+ onPathFound={vi.fn()}
+ onClear={vi.fn()}
+ onClose={vi.fn()}
+ />,
+ );
+ expect(screen.getAllByText("Find Path").length).toBeGreaterThan(0);
+ const findBtn = screen.getByRole("button", { name: /Find Path/i });
+ expect((findBtn as HTMLButtonElement).disabled).toBe(true);
+ });
+
+ it("pre-fills inputs from initialFrom / initialTo", () => {
+ render(
+ <PathFinderPanel
+ searchNodes={vi.fn().mockResolvedValue([])}
+ findPath={vi.fn().mockResolvedValue({ path: [], distance: 0, explanation: "" })}
+ onPathFound={vi.fn()}
+ onClear={vi.fn()}
+ onClose={vi.fn()}
+ initialFrom="src/a.ts"
+ initialTo="src/b.ts"
+ />,
+ );
+ expect((screen.getByPlaceholderText("From file...") as HTMLInputElement).value).toBe("src/a.ts");
+ expect((screen.getByPlaceholderText("To file...") as HTMLInputElement).value).toBe("src/b.ts");
+ });
+});
diff --git a/packages/ui/__tests__/jobs/generation-progress.test.tsx b/packages/ui/__tests__/jobs/generation-progress.test.tsx
new file mode 100644
index 000000000..cf8126207
--- /dev/null
+++ b/packages/ui/__tests__/jobs/generation-progress.test.tsx
@@ -0,0 +1,45 @@
+import { describe, it, expect, vi } from "vitest";
+import { render, screen } from "@testing-library/react";
+import { GenerationProgress } from "../../src/jobs/generation-progress.js";
+
+describe("GenerationProgress", () => {
+ it("renders the queued state for pending jobs", () => {
+ render(
+ <GenerationProgress
+ job={{
+ id: "j1",
+ status: "pending",
+ total_pages: 0,
+ completed_pages: 0,
+ }}
+ log={[]}
+ elapsed={1000}
+ actualCost={null}
+ stuckPending={false}
+ cancelling={false}
+ onCancel={vi.fn()}
+ />,
+ );
+ expect(screen.getByText(/Queued/)).toBeTruthy();
+ });
+
+ it("shows the stuck-pending banner when set", () => {
+ render(
+ <GenerationProgress
+ job={{
+ id: "j1",
+ status: "pending",
+ total_pages: 0,
+ completed_pages: 0,
+ }}
+ log={[]}
+ elapsed={45_000}
+ actualCost={null}
+ stuckPending={true}
+ cancelling={false}
+ onCancel={vi.fn()}
+ />,
+ );
+ expect(screen.getByText(/Job hasn't started/)).toBeTruthy();
+ });
+});
diff --git a/packages/ui/__tests__/settings/general-form.test.tsx b/packages/ui/__tests__/settings/general-form.test.tsx
new file mode 100644
index 000000000..cce45ee6a
--- /dev/null
+++ b/packages/ui/__tests__/settings/general-form.test.tsx
@@ -0,0 +1,45 @@
+import { describe, it, expect, vi } from "vitest";
+import { render, screen, fireEvent, waitFor } from "@testing-library/react";
+import { GeneralForm } from "../../src/settings/general-form.js";
+import type { RepoSettingsValue } from "@repowise-dev/types/settings";
+
+const baseValue: RepoSettingsValue = {
+ name: "demo",
+ default_branch: "main",
+ exclude_patterns: ["node_modules/"],
+};
+
+describe("GeneralForm", () => {
+ it("loads value into inputs", () => {
+ render(<GeneralForm value={baseValue} onSubmit={vi.fn()} localPath="/srv/demo" />);
+ expect(screen.getByLabelText("Repository name")).toHaveValue("demo");
+ expect(screen.getByLabelText("Default branch")).toHaveValue("main");
+ expect(screen.getByText("/srv/demo")).toBeInTheDocument();
+ expect(screen.getByText("node_modules/")).toBeInTheDocument();
+ });
+
+ it("disables save until a field changes; calls onSubmit on save", async () => {
+ const onSubmit = vi.fn().mockResolvedValue(undefined);
+ render(<GeneralForm value={baseValue} onSubmit={onSubmit} />);
+ const save = screen.getByRole("button", { name: /Save changes/i });
+ expect(save).toBeDisabled();
+
+ fireEvent.change(screen.getByLabelText("Repository name"), {
+ target: { value: "renamed" },
+ });
+ expect(save).toBeEnabled();
+ fireEvent.click(save);
+ await waitFor(() => expect(onSubmit).toHaveBeenCalledTimes(1));
+ expect(onSubmit.mock.calls[0]![0]).toMatchObject({ name: "renamed" });
+ });
+
+ it("renders read-only when onSubmit is omitted (hosted)", () => {
+ render(<GeneralForm value={baseValue} disabledHint="Editing not yet available." />);
+ expect(screen.getByLabelText("Repository name")).toBeDisabled();
+ expect(screen.getByLabelText("Default branch")).toBeDisabled();
+ expect(screen.getByRole("button", { name: /Save changes/i })).toBeDisabled();
+ expect(screen.getByText("Editing not yet available.")).toBeInTheDocument();
+ // Add-pattern input is suppressed in read-only mode.
+ expect(screen.queryByLabelText("New excluded pattern")).not.toBeInTheDocument();
+ });
+});
diff --git a/packages/ui/__tests__/setup.ts b/packages/ui/__tests__/setup.ts
new file mode 100644
index 000000000..f149f27ae
--- /dev/null
+++ b/packages/ui/__tests__/setup.ts
@@ -0,0 +1 @@
+import "@testing-library/jest-dom/vitest";
diff --git a/packages/ui/__tests__/shared/stat-card.test.tsx b/packages/ui/__tests__/shared/stat-card.test.tsx
new file mode 100644
index 000000000..c721586f1
--- /dev/null
+++ b/packages/ui/__tests__/shared/stat-card.test.tsx
@@ -0,0 +1,27 @@
+import { describe, it, expect } from "vitest";
+import { render, screen } from "@testing-library/react";
+import { StatCard } from "../../src/shared/stat-card.js";
+
+describe("StatCard", () => {
+ it("renders the label and value", () => {
+ render(<StatCard label="Hotspots" value="42" />);
+ expect(screen.getByText("Hotspots")).toBeInTheDocument();
+ expect(screen.getByText("42")).toBeInTheDocument();
+ });
+
+ it("renders an optional description when provided", () => {
+ render(<StatCard label="Coverage" value="87%" description="last 30 days" />);
+ expect(screen.getByText("last 30 days")).toBeInTheDocument();
+ });
+
+ it("renders a positive trend with an up arrow", () => {
+ render(
+ <StatCard
+ label="Hotspots"
+ value={42}
+ trend={{ value: "+5", positive: true }}
+ />,
+ );
+ expect(screen.getByText(/↑ \+5/)).toBeInTheDocument();
+ });
+});
diff --git a/packages/ui/__tests__/smoke.test.tsx b/packages/ui/__tests__/smoke.test.tsx
new file mode 100644
index 000000000..17af4589b
--- /dev/null
+++ b/packages/ui/__tests__/smoke.test.tsx
@@ -0,0 +1,16 @@
+import { describe, it, expect } from "vitest";
+import { render, screen } from "@testing-library/react";
+
+describe("@repowise-dev/ui test infrastructure", () => {
+ it("mounts a React tree under jsdom and resolves jest-dom matchers", () => {
+ function Hello({ name }: { name: string }) {
+ return <p data-testid="greeting">Hello, {name}</p>;
+ }
+
+ render(<Hello name="repowise" />);
+
+ const node = screen.getByTestId("greeting");
+ expect(node).toBeInTheDocument();
+ expect(node).toHaveTextContent("Hello, repowise");
+ });
+});
diff --git a/packages/ui/__tests__/symbols/symbol-table.test.tsx b/packages/ui/__tests__/symbols/symbol-table.test.tsx
new file mode 100644
index 000000000..286f2e87f
--- /dev/null
+++ b/packages/ui/__tests__/symbols/symbol-table.test.tsx
@@ -0,0 +1,70 @@
+import { describe, it, expect, vi } from "vitest";
+import { render, screen } from "@testing-library/react";
+import { SymbolTable } from "../../src/symbols/symbol-table.js";
+import type { CodeSymbol } from "@repowise-dev/types/symbols";
+
+const sym = (overrides: Partial<CodeSymbol> = {}): CodeSymbol => ({
+ id: "s1",
+ repository_id: "r",
+ file_path: "src/foo.ts",
+ symbol_id: "src/foo.ts::bar",
+ name: "bar",
+ qualified_name: "foo.bar",
+ kind: "function",
+ signature: "function bar()",
+ start_line: 10,
+ end_line: 15,
+ docstring: null,
+ visibility: "public",
+ is_async: false,
+ complexity_estimate: 3,
+ language: "typescript",
+ parent_name: null,
+ ...overrides,
+});
+
+describe("SymbolTable", () => {
+ it("renders the empty state when no items", () => {
+ render(
+ <SymbolTable
+ items={[]}
+ importanceScores={new Map()}
+ isLoading={false}
+ isValidating={false}
+ hasMore={false}
+ q=""
+ onQChange={vi.fn()}
+ kind="all"
+ onKindChange={vi.fn()}
+ language="all"
+ onLanguageChange={vi.fn()}
+ onLoadMore={vi.fn()}
+ onSelect={vi.fn()}
+ />,
+ );
+ expect(screen.getByText("No symbols found")).toBeTruthy();
+ });
+
+ it("renders rows for loaded symbols", () => {
+ render(
+ <SymbolTable
+ items={[sym(), sym({ id: "s2", name: "baz", file_path: "src/baz.ts" })]}
+ importanceScores={new Map([["s1", 0.9], ["s2", 0.3]])}
+ isLoading={false}
+ isValidating={false}
+ hasMore={false}
+ q=""
+ onQChange={vi.fn()}
+ kind="all"
+ onKindChange={vi.fn()}
+ language="all"
+ onLanguageChange={vi.fn()}
+ onLoadMore={vi.fn()}
+ onSelect={vi.fn()}
+ />,
+ );
+ expect(screen.getByText("bar")).toBeTruthy();
+ expect(screen.getByText("baz")).toBeTruthy();
+ expect(screen.getByText("2 symbols")).toBeTruthy();
+ });
+});
diff --git a/packages/ui/__tests__/ui/button.test.tsx b/packages/ui/__tests__/ui/button.test.tsx
new file mode 100644
index 000000000..5d4fe475e
--- /dev/null
+++ b/packages/ui/__tests__/ui/button.test.tsx
@@ -0,0 +1,29 @@
+import { describe, it, expect } from "vitest";
+import { render, screen } from "@testing-library/react";
+import { Button } from "../../src/ui/button.js";
+
+describe("Button", () => {
+ it("renders children with the default variant", () => {
+ render(<Button>Click me</Button>);
+ const btn = screen.getByRole("button", { name: "Click me" });
+ expect(btn).toBeInTheDocument();
+ expect(btn.className).toMatch(/inline-flex/);
+ });
+
+ it("applies the destructive variant class when requested", () => {
+ render(<Button variant="destructive">Delete</Button>);
+ const btn = screen.getByRole("button", { name: "Delete" });
+ expect(btn.className).toMatch(/bg-\[var\(--color-error\)\]/);
+ });
+
+ it("forwards arbitrary HTML attributes to the underlying button", () => {
+ render(
+ <Button data-testid="action" type="submit" disabled>
+ Save
+ </Button>,
+ );
+ const btn = screen.getByTestId("action");
+ expect(btn).toHaveAttribute("type", "submit");
+ expect(btn).toBeDisabled();
+ });
+});
diff --git a/packages/ui/__tests__/wiki/regenerate-button.test.tsx b/packages/ui/__tests__/wiki/regenerate-button.test.tsx
new file mode 100644
index 000000000..512b33767
--- /dev/null
+++ b/packages/ui/__tests__/wiki/regenerate-button.test.tsx
@@ -0,0 +1,29 @@
+import { describe, it, expect, vi } from "vitest";
+import { render, screen, fireEvent } from "@testing-library/react";
+import { RegenerateButton } from "../../src/wiki/regenerate-button.js";
+
+describe("RegenerateButton", () => {
+ it("renders the regenerate button and fires onRegenerate on click", () => {
+ const onRegenerate = vi.fn();
+ render(<RegenerateButton onRegenerate={onRegenerate} />);
+ fireEvent.click(screen.getByRole("button", { name: /regenerate/i }));
+ expect(onRegenerate).toHaveBeenCalledTimes(1);
+ });
+
+ it("disables the button while loading", () => {
+ render(<RegenerateButton onRegenerate={vi.fn()} isLoading />);
+ expect(screen.getByRole("button", { name: /regenerate/i })).toBeDisabled();
+ });
+
+ it("renders the jobSlot inside the dialog when in progress", () => {
+ render(
+ <RegenerateButton
+ onRegenerate={vi.fn()}
+ isInProgress
+ jobSlot={<div data-testid="job-progress">progress</div>}
+ />,
+ );
+ expect(screen.getByTestId("job-progress")).toBeInTheDocument();
+ expect(screen.getByText(/regenerating page/i)).toBeInTheDocument();
+ });
+});
diff --git a/packages/ui/__tests__/wiki/security-panel.test.tsx b/packages/ui/__tests__/wiki/security-panel.test.tsx
new file mode 100644
index 000000000..feb0770af
--- /dev/null
+++ b/packages/ui/__tests__/wiki/security-panel.test.tsx
@@ -0,0 +1,31 @@
+import { describe, it, expect } from "vitest";
+import { render, screen } from "@testing-library/react";
+import type { SecurityFinding } from "@repowise-dev/types";
+import { SecurityPanel } from "../../src/wiki/security-panel.js";
+
+const finding: SecurityFinding = {
+ id: 1,
+ file_path: "src/auth.py",
+ kind: "hardcoded_secret",
+ severity: "high",
+ snippet: "API_KEY = \"sk-1234\"",
+ detected_at: "2026-01-01T00:00:00Z",
+};
+
+describe("SecurityPanel", () => {
+ it("renders empty state when no findings", () => {
+ render(<SecurityPanel findings={[]} />);
+ expect(screen.getByText(/no security signals/i)).toBeInTheDocument();
+ });
+
+ it("renders nothing while loading", () => {
+ const { container } = render(<SecurityPanel findings={undefined} isLoading />);
+ expect(container).toBeEmptyDOMElement();
+ });
+
+ it("renders a finding with severity badge and kind", () => {
+ render(<SecurityPanel findings={[finding]} />);
+ expect(screen.getByText("High")).toBeInTheDocument();
+ expect(screen.getByText("hardcoded_secret")).toBeInTheDocument();
+ });
+});
diff --git a/packages/ui/__tests__/wiki/version-history.test.tsx b/packages/ui/__tests__/wiki/version-history.test.tsx
new file mode 100644
index 000000000..99ebd79bb
--- /dev/null
+++ b/packages/ui/__tests__/wiki/version-history.test.tsx
@@ -0,0 +1,55 @@
+import { describe, it, expect } from "vitest";
+import { render, screen, fireEvent } from "@testing-library/react";
+import type { DocPageVersion } from "@repowise-dev/types";
+import { VersionHistory } from "../../src/wiki/version-history.js";
+
+const version: DocPageVersion = {
+ id: "v1",
+ page_id: "p1",
+ version: 1,
+ page_type: "module",
+ title: "Module",
+ content: "old content",
+ source_hash: "abc",
+ model_name: "gpt-5.4-mini",
+ provider_name: "openai",
+ input_tokens: 100,
+ output_tokens: 50,
+ confidence: 0.9,
+ archived_at: "2026-01-01T00:00:00Z",
+};
+
+describe("VersionHistory", () => {
+ it("renders nothing when there are no prior versions", () => {
+ const { container } = render(
+ <VersionHistory versions={[]} currentVersion={2} currentContent="new content" />,
+ );
+ expect(container).toBeEmptyDOMElement();
+ });
+
+ it("renders the collapsed header with a versions count badge", () => {
+ render(
+ <VersionHistory
+ versions={[version]}
+ currentVersion={2}
+ currentContent="new content"
+ />,
+ );
+ expect(screen.getByText(/version history/i)).toBeInTheDocument();
+ expect(screen.getByText(/1 versions/i)).toBeInTheDocument();
+ });
+
+ it("expands to show the current and prior version rows", () => {
+ render(
+ <VersionHistory
+ versions={[version]}
+ currentVersion={2}
+ currentContent="new content"
+ />,
+ );
+ fireEvent.click(screen.getByRole("button", { name: /version history/i }));
+ expect(screen.getByText("v2")).toBeInTheDocument();
+ expect(screen.getByText("v1")).toBeInTheDocument();
+ expect(screen.getByText(/current/i)).toBeInTheDocument();
+ });
+});
diff --git a/packages/ui/package.json b/packages/ui/package.json
new file mode 100644
index 000000000..0349cbcd2
--- /dev/null
+++ b/packages/ui/package.json
@@ -0,0 +1,110 @@
+{
+ "name": "@repowise-dev/ui",
+ "version": "0.0.1",
+ "private": true,
+ "description": "Shared visualization components for the Repowise dashboard (packages/web) and downstream consumers. Domains: graph, git, dead-code, decisions, docs, symbols, coverage, wiki, chat, dashboard, workspace, jobs, blast-radius, plus shared primitives and hooks.",
+ "type": "module",
+ "main": "./src/index.ts",
+ "types": "./src/index.ts",
+ "sideEffects": [
+ "./styles/globals.css",
+ "**/*.css"
+ ],
+ "exports": {
+ ".": "./src/index.ts",
+ "./styles.css": "./styles/globals.css",
+ "./graph": "./src/graph/index.ts",
+ "./graph/context": "./src/graph/context.ts",
+ "./graph/elk-layout": "./src/graph/elk-layout.ts",
+ "./graph/use-elk-layout": "./src/graph/use-elk-layout.ts",
+ "./graph/nodes/*": "./src/graph/nodes/*.tsx",
+ "./graph/edges/*": "./src/graph/edges/*.tsx",
+ "./graph/*": "./src/graph/*.tsx",
+ "./git": "./src/git/index.ts",
+ "./git/*": "./src/git/*.tsx",
+ "./dead-code": "./src/dead-code/index.ts",
+ "./dead-code/*": "./src/dead-code/*.tsx",
+ "./decisions": "./src/decisions/index.ts",
+ "./decisions/*": "./src/decisions/*.tsx",
+ "./docs": "./src/docs/index.ts",
+ "./docs/*": "./src/docs/*.tsx",
+ "./symbols": "./src/symbols/index.ts",
+ "./symbols/*": "./src/symbols/*.tsx",
+ "./coverage": "./src/coverage/index.ts",
+ "./coverage/*": "./src/coverage/*.tsx",
+ "./wiki": "./src/wiki/index.ts",
+ "./wiki/wiki-mdx-preprocess": "./src/wiki/wiki-mdx-preprocess.ts",
+ "./wiki/*": "./src/wiki/*.tsx",
+ "./chat": "./src/chat/index.ts",
+ "./chat/*": "./src/chat/*.tsx",
+ "./dashboard": "./src/dashboard/index.ts",
+ "./dashboard/*": "./src/dashboard/*.tsx",
+ "./workspace": "./src/workspace/index.ts",
+ "./workspace/*": "./src/workspace/*.tsx",
+ "./jobs": "./src/jobs/index.ts",
+ "./jobs/*": "./src/jobs/*.tsx",
+ "./blast-radius": "./src/blast-radius/index.ts",
+ "./blast-radius/*": "./src/blast-radius/*.tsx",
+ "./settings": "./src/settings/index.ts",
+ "./settings/*": "./src/settings/*.tsx",
+ "./shared": "./src/shared/index.ts",
+ "./shared/*": "./src/shared/*.tsx",
+ "./hooks": "./src/hooks/index.ts",
+ "./ui": "./src/ui/index.ts",
+ "./ui/*": "./src/ui/*.tsx",
+ "./lib/cn": "./src/lib/cn.ts",
+ "./lib/confidence": "./src/lib/confidence.ts",
+ "./lib/format": "./src/lib/format.ts"
+ },
+ "publishConfig": {
+ "registry": "https://npm.pkg.github.com",
+ "access": "restricted"
+ },
+ "scripts": {
+ "type-check": "tsc --noEmit",
+ "test": "vitest run"
+ },
+ "dependencies": {
+ "@radix-ui/react-dialog": "^1.1.15",
+ "@radix-ui/react-label": "^2.1.8",
+ "@radix-ui/react-progress": "^1.1.8",
+ "@radix-ui/react-scroll-area": "^1.2.10",
+ "@radix-ui/react-select": "^2.2.6",
+ "@radix-ui/react-separator": "^1.1.8",
+ "@radix-ui/react-slider": "^1.3.6",
+ "@radix-ui/react-slot": "^1.2.4",
+ "@radix-ui/react-switch": "^1.2.6",
+ "@radix-ui/react-tabs": "^1.1.13",
+ "@radix-ui/react-tooltip": "^1.2.8",
+ "@repowise-dev/types": "*",
+ "@xyflow/react": "^12.10.2",
+ "class-variance-authority": "^0.7.1",
+ "fuse.js": "^7.0.0",
+ "clsx": "^2.1.1",
+ "d3-force": "^3.0.0",
+ "d3-hierarchy": "^3.1.2",
+ "framer-motion": "^11.11.0",
+ "lucide-react": "^1.7.0",
+ "mermaid": "^11.4.0",
+ "react-markdown": "^10.1.0",
+ "recharts": "^3.8.1",
+ "remark-gfm": "^4.0.1",
+ "tailwind-merge": "^3.5.0"
+ },
+ "peerDependencies": {
+ "react": "^19.0.0",
+ "react-dom": "^19.0.0"
+ },
+ "devDependencies": {
+ "@testing-library/jest-dom": "^6.5.0",
+ "@testing-library/react": "^16.0.0",
+ "@types/react": "^19.0.0",
+ "@types/react-dom": "^19.0.0",
+ "@vitejs/plugin-react": "^4.3.0",
+ "jsdom": "^25.0.0",
+ "react": "^19.0.0",
+ "react-dom": "^19.0.0",
+ "typescript": "^5.6.0",
+ "vitest": "^2.1.0"
+ }
+}
diff --git a/packages/ui/src/blast-radius/blast-radius-results.tsx b/packages/ui/src/blast-radius/blast-radius-results.tsx
new file mode 100644
index 000000000..7ebce6328
--- /dev/null
+++ b/packages/ui/src/blast-radius/blast-radius-results.tsx
@@ -0,0 +1,54 @@
+import type { BlastRadiusResponse } from "@repowise-dev/types/blast-radius";
+import { RiskScoreCard } from "./risk-score-card";
+import { BlastRadiusSummary } from "./blast-radius-summary";
+import { TableSection } from "./table-section";
+import { DirectRisksTable } from "./direct-risks-table";
+import { TransitiveTable } from "./transitive-table";
+import { CochangeTable } from "./cochange-table";
+import { ReviewersTable } from "./reviewers-table";
+import { TestGapsList } from "./test-gaps-list";
+
+interface BlastRadiusResultsProps {
+ result: BlastRadiusResponse;
+}
+
+/** Composes the full results stack — score gauge, summary, all five tables. */
+export function BlastRadiusResults({ result }: BlastRadiusResultsProps) {
+ return (
+ <div className="space-y-4">
+ <div className="grid grid-cols-1 gap-4 sm:grid-cols-4">
+ <RiskScoreCard score={result.overall_risk_score} />
+ <BlastRadiusSummary result={result} />
+ </div>
+
+ <TableSection title="Direct Risks" empty={result.direct_risks.length === 0}>
+ <DirectRisksTable rows={result.direct_risks} />
+ </TableSection>
+
+ <TableSection
+ title="Transitive Affected Files"
+ empty={result.transitive_affected.length === 0}
+ >
+ <TransitiveTable rows={result.transitive_affected} />
+ </TableSection>
+
+ <TableSection
+ title="Co-change Warnings"
+ empty={result.cochange_warnings.length === 0}
+ >
+ <CochangeTable rows={result.cochange_warnings} />
+ </TableSection>
+
+ <TableSection
+ title="Recommended Reviewers"
+ empty={result.recommended_reviewers.length === 0}
+ >
+ <ReviewersTable rows={result.recommended_reviewers} />
+ </TableSection>
+
+ <TableSection title="Test Gaps" empty={result.test_gaps.length === 0}>
+ <TestGapsList gaps={result.test_gaps} />
+ </TableSection>
+ </div>
+ );
+}
diff --git a/packages/ui/src/blast-radius/blast-radius-summary.tsx b/packages/ui/src/blast-radius/blast-radius-summary.tsx
new file mode 100644
index 000000000..060c60090
--- /dev/null
+++ b/packages/ui/src/blast-radius/blast-radius-summary.tsx
@@ -0,0 +1,33 @@
+import type { BlastRadiusResponse } from "@repowise-dev/types/blast-radius";
+import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
+
+interface BlastRadiusSummaryProps {
+ result: BlastRadiusResponse;
+}
+
+/** Four-stat summary card sitting beside the RiskScoreCard. */
+export function BlastRadiusSummary({ result }: BlastRadiusSummaryProps) {
+ const stats = [
+ { label: "Direct Risks", value: result.direct_risks.length },
+ { label: "Transitive Files", value: result.transitive_affected.length },
+ { label: "Co-change Warnings", value: result.cochange_warnings.length },
+ { label: "Test Gaps", value: result.test_gaps.length },
+ ];
+ return (
+ <Card className="sm:col-span-3">
+ <CardHeader className="pb-3">
+ <CardTitle className="text-sm">Summary</CardTitle>
+ </CardHeader>
+ <CardContent className="pt-0 grid grid-cols-2 sm:grid-cols-4 gap-4">
+ {stats.map(({ label, value }) => (
+ <div key={label} className="space-y-1">
+ <p className="text-2xl font-bold text-[var(--color-text-primary)] tabular-nums">
+ {value}
+ </p>
+ <p className="text-xs text-[var(--color-text-tertiary)]">{label}</p>
+ </div>
+ ))}
+ </CardContent>
+ </Card>
+ );
+}
diff --git a/packages/ui/src/blast-radius/cells.tsx b/packages/ui/src/blast-radius/cells.tsx
new file mode 100644
index 000000000..0283685ce
--- /dev/null
+++ b/packages/ui/src/blast-radius/cells.tsx
@@ -0,0 +1,29 @@
+import type { ReactNode } from "react";
+import { cn } from "../lib/cn";
+
+export function Th({ children }: { children: ReactNode }) {
+ return (
+ <th className="text-left text-xs font-medium text-[var(--color-text-tertiary)] py-1.5 pr-4 whitespace-nowrap">
+ {children}
+ </th>
+ );
+}
+
+export function Td({
+ children,
+ className,
+}: {
+ children: ReactNode;
+ className?: string;
+}) {
+ return (
+ <td
+ className={cn(
+ "text-xs text-[var(--color-text-secondary)] py-1.5 pr-4 align-top",
+ className,
+ )}
+ >
+ {children}
+ </td>
+ );
+}
diff --git a/packages/ui/src/blast-radius/cochange-table.tsx b/packages/ui/src/blast-radius/cochange-table.tsx
new file mode 100644
index 000000000..87bbd9615
--- /dev/null
+++ b/packages/ui/src/blast-radius/cochange-table.tsx
@@ -0,0 +1,43 @@
+import type { CochangeWarning } from "@repowise-dev/types/blast-radius";
+import { Th, Td } from "./cells";
+
+interface CochangeTableProps {
+ rows: CochangeWarning[];
+}
+
+export function CochangeTable({ rows }: CochangeTableProps) {
+ return (
+ <div className="overflow-x-auto">
+ <table className="w-full">
+ <caption className="sr-only">Co-change warnings</caption>
+ <thead>
+ <tr>
+ <Th>Changed File</Th>
+ <Th>Missing Partner</Th>
+ <Th>Co-change Count</Th>
+ </tr>
+ </thead>
+ <tbody>
+ {rows.map((r, i) => (
+ <tr
+ key={`${r.changed}|${r.missing_partner}|${i}`}
+ className="border-t border-[var(--color-border-default)]"
+ >
+ <Td>
+ <span className="font-mono break-all" title={r.changed}>
+ {r.changed}
+ </span>
+ </Td>
+ <Td>
+ <span className="font-mono break-all" title={r.missing_partner}>
+ {r.missing_partner}
+ </span>
+ </Td>
+ <Td className="text-right tabular-nums">{r.score}</Td>
+ </tr>
+ ))}
+ </tbody>
+ </table>
+ </div>
+ );
+}
diff --git a/packages/ui/src/blast-radius/direct-risks-table.tsx b/packages/ui/src/blast-radius/direct-risks-table.tsx
new file mode 100644
index 000000000..1bf1816cb
--- /dev/null
+++ b/packages/ui/src/blast-radius/direct-risks-table.tsx
@@ -0,0 +1,41 @@
+import type { DirectRiskEntry } from "@repowise-dev/types/blast-radius";
+import { Th, Td } from "./cells";
+
+interface DirectRisksTableProps {
+ rows: DirectRiskEntry[];
+}
+
+export function DirectRisksTable({ rows }: DirectRisksTableProps) {
+ // Backend risk_score / temporal_hotspot are 0–1; render 0–10 to match the gauge.
+ const fmt10 = (v: number) => (v * 10).toFixed(2);
+ const fmtPct = (v: number) => `${(v * 100).toFixed(2)}%`;
+ return (
+ <div className="overflow-x-auto">
+ <table className="w-full">
+ <caption className="sr-only">Direct risks for the changed files</caption>
+ <thead>
+ <tr>
+ <Th>File</Th>
+ <Th>Risk Score</Th>
+ <Th>Temporal Hotspot</Th>
+ <Th>Centrality</Th>
+ </tr>
+ </thead>
+ <tbody>
+ {rows.map((r) => (
+ <tr key={r.path} className="border-t border-[var(--color-border-default)]">
+ <Td>
+ <span className="font-mono break-all" title={r.path}>
+ {r.path}
+ </span>
+ </Td>
+ <Td className="text-right tabular-nums">{fmt10(r.risk_score)}</Td>
+ <Td className="text-right tabular-nums">{fmt10(r.temporal_hotspot)}</Td>
+ <Td className="text-right tabular-nums">{fmtPct(r.centrality)}</Td>
+ </tr>
+ ))}
+ </tbody>
+ </table>
+ </div>
+ );
+}
diff --git a/packages/ui/src/blast-radius/index.ts b/packages/ui/src/blast-radius/index.ts
new file mode 100644
index 000000000..70404df98
--- /dev/null
+++ b/packages/ui/src/blast-radius/index.ts
@@ -0,0 +1,9 @@
+export * from "./risk-score-card";
+export * from "./table-section";
+export * from "./direct-risks-table";
+export * from "./transitive-table";
+export * from "./cochange-table";
+export * from "./reviewers-table";
+export * from "./test-gaps-list";
+export * from "./blast-radius-summary";
+export * from "./blast-radius-results";
diff --git a/packages/ui/src/blast-radius/reviewers-table.tsx b/packages/ui/src/blast-radius/reviewers-table.tsx
new file mode 100644
index 000000000..c5fdaa84e
--- /dev/null
+++ b/packages/ui/src/blast-radius/reviewers-table.tsx
@@ -0,0 +1,34 @@
+import type { ReviewerEntry } from "@repowise-dev/types/blast-radius";
+import { Th, Td } from "./cells";
+
+interface ReviewersTableProps {
+ rows: ReviewerEntry[];
+}
+
+export function ReviewersTable({ rows }: ReviewersTableProps) {
+ return (
+ <div className="overflow-x-auto">
+ <table className="w-full">
+ <caption className="sr-only">Recommended reviewers</caption>
+ <thead>
+ <tr>
+ <Th>Email</Th>
+ <Th>Files Owned</Th>
+ <Th>Avg Ownership %</Th>
+ </tr>
+ </thead>
+ <tbody>
+ {rows.map((r) => (
+ <tr key={r.email} className="border-t border-[var(--color-border-default)]">
+ <Td>{r.email}</Td>
+ <Td className="text-right tabular-nums">{r.files}</Td>
+ <Td className="text-right tabular-nums">
+ {(r.ownership_pct * 100).toFixed(1)}%
+ </Td>
+ </tr>
+ ))}
+ </tbody>
+ </table>
+ </div>
+ );
+}
diff --git a/packages/ui/src/blast-radius/risk-score-card.tsx b/packages/ui/src/blast-radius/risk-score-card.tsx
new file mode 100644
index 000000000..761b04c27
--- /dev/null
+++ b/packages/ui/src/blast-radius/risk-score-card.tsx
@@ -0,0 +1,31 @@
+import { Card, CardContent } from "../ui/card";
+import { cn } from "../lib/cn";
+
+interface RiskScoreCardProps {
+ /** 0–10. */
+ score: number;
+}
+
+export function RiskScoreCard({ score }: RiskScoreCardProps) {
+ const color =
+ score >= 7
+ ? "text-red-500 border-red-500/30 bg-red-500/5"
+ : score >= 4
+ ? "text-amber-500 border-amber-500/30 bg-amber-500/5"
+ : "text-emerald-500 border-emerald-500/30 bg-emerald-500/5";
+ const label = score >= 7 ? "High Risk" : score >= 4 ? "Medium Risk" : "Low Risk";
+
+ return (
+ <Card className={cn("border", color)}>
+ <CardContent className="flex flex-col items-center justify-center py-8 gap-2">
+ <span className={cn("text-6xl font-bold tabular-nums", color.split(" ")[0])}>
+ {score.toFixed(1)}
+ </span>
+ <span className={cn("text-sm font-medium", color.split(" ")[0])}>{label}</span>
+ <span className="text-xs text-[var(--color-text-tertiary)]">
+ Overall Risk Score (0–10)
+ </span>
+ </CardContent>
+ </Card>
+ );
+}
diff --git a/packages/ui/src/blast-radius/table-section.tsx b/packages/ui/src/blast-radius/table-section.tsx
new file mode 100644
index 000000000..0dad9d970
--- /dev/null
+++ b/packages/ui/src/blast-radius/table-section.tsx
@@ -0,0 +1,32 @@
+import type { ReactNode } from "react";
+import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
+
+interface TableSectionProps {
+ title: string;
+ empty: boolean;
+ children: ReactNode;
+ /** Optional empty-state copy. Defaults to "None". */
+ emptyLabel?: string;
+}
+
+export function TableSection({
+ title,
+ empty,
+ children,
+ emptyLabel = "None",
+}: TableSectionProps) {
+ return (
+ <Card>
+ <CardHeader className="pb-3">
+ <CardTitle className="text-sm">{title}</CardTitle>
+ </CardHeader>
+ <CardContent className="pt-0">
+ {empty ? (
+ <p className="text-xs text-[var(--color-text-tertiary)] py-2">{emptyLabel}</p>
+ ) : (
+ children
+ )}
+ </CardContent>
+ </Card>
+ );
+}
diff --git a/packages/ui/src/blast-radius/test-gaps-list.tsx b/packages/ui/src/blast-radius/test-gaps-list.tsx
new file mode 100644
index 000000000..6887b4f16
--- /dev/null
+++ b/packages/ui/src/blast-radius/test-gaps-list.tsx
@@ -0,0 +1,18 @@
+interface TestGapsListProps {
+ gaps: string[];
+}
+
+export function TestGapsList({ gaps }: TestGapsListProps) {
+ return (
+ <ul className="space-y-1">
+ {gaps.map((g) => (
+ <li
+ key={g}
+ className="text-xs font-mono text-[var(--color-text-secondary)] break-all"
+ >
+ {g}
+ </li>
+ ))}
+ </ul>
+ );
+}
diff --git a/packages/ui/src/blast-radius/transitive-table.tsx b/packages/ui/src/blast-radius/transitive-table.tsx
new file mode 100644
index 000000000..f3eb1629c
--- /dev/null
+++ b/packages/ui/src/blast-radius/transitive-table.tsx
@@ -0,0 +1,34 @@
+import type { TransitiveEntry } from "@repowise-dev/types/blast-radius";
+import { Th, Td } from "./cells";
+
+interface TransitiveTableProps {
+ rows: TransitiveEntry[];
+}
+
+export function TransitiveTable({ rows }: TransitiveTableProps) {
+ return (
+ <div className="overflow-x-auto">
+ <table className="w-full">
+ <caption className="sr-only">Transitively affected files</caption>
+ <thead>
+ <tr>
+ <Th>File</Th>
+ <Th>Depth</Th>
+ </tr>
+ </thead>
+ <tbody>
+ {rows.map((r) => (
+ <tr key={r.path} className="border-t border-[var(--color-border-default)]">
+ <Td>
+ <span className="font-mono break-all" title={r.path}>
+ {r.path}
+ </span>
+ </Td>
+ <Td className="text-right tabular-nums">{r.depth}</Td>
+ </tr>
+ ))}
+ </tbody>
+ </table>
+ </div>
+ );
+}
diff --git a/packages/ui/src/chat/artifact-panel.tsx b/packages/ui/src/chat/artifact-panel.tsx
new file mode 100644
index 000000000..3435f6516
--- /dev/null
+++ b/packages/ui/src/chat/artifact-panel.tsx
@@ -0,0 +1,145 @@
+"use client";
+
+import { useState } from "react";
+import { X } from "lucide-react";
+import { cn } from "../lib/cn";
+import { ChatMarkdown } from "./chat-markdown";
+import {
+ ContextRenderer,
+ DeadCodeRenderer,
+ DecisionsRenderer,
+ DiagramRenderer,
+ GenericJsonRenderer,
+ GraphPathRenderer,
+ OverviewRenderer,
+ RiskReportRenderer,
+ SearchResultsRenderer,
+} from "./artifacts";
+import type {
+ ChatArtifact,
+ ContextArtifactData,
+ DeadCodeArtifactData,
+ DecisionsArtifactData,
+ DiagramArtifactData,
+ GraphPathArtifactData,
+ OverviewArtifactData,
+ RiskReportArtifactData,
+ SearchResultsArtifactData,
+} from "@repowise-dev/types/chat";
+
+export interface Artifact {
+ type: string;
+ title: string;
+ data: Record<string, unknown>;
+}
+
+interface ArtifactPanelProps {
+ artifacts: Artifact[];
+ open: boolean;
+ onClose: () => void;
+}
+
+export function ArtifactPanel({ artifacts, open, onClose }: ArtifactPanelProps) {
+ const [activeIdx, setActiveIdx] = useState(0);
+
+ if (!open || artifacts.length === 0) return null;
+
+ const active = artifacts[Math.min(activeIdx, artifacts.length - 1)];
+ if (!active) return null;
+
+ return (
+ <>
+ <div className="fixed inset-0 z-[var(--z-modal)] bg-black/50 lg:hidden" onClick={onClose} />
+
+ <div
+ className={cn(
+ "fixed right-0 top-0 z-[var(--z-modal)] h-full bg-[var(--color-bg-surface)] border-l border-[var(--color-border-default)] flex flex-col",
+ "w-full sm:w-[480px] lg:w-[420px]",
+ "transition-transform duration-300",
+ open ? "translate-x-0" : "translate-x-full",
+ )}
+ >
+ <div className="flex items-center justify-between px-4 py-3 border-b border-[var(--color-border-default)] shrink-0">
+ <span className="text-xs font-medium text-[var(--color-text-primary)]">
+ Artifacts
+ </span>
+ <button
+ onClick={onClose}
+ className="p-1 rounded hover:bg-[var(--color-bg-elevated)] text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)] transition-colors"
+ >
+ <X className="h-4 w-4" />
+ </button>
+ </div>
+
+ {artifacts.length > 1 && (
+ <div className="flex gap-0 border-b border-[var(--color-border-default)] shrink-0 overflow-x-auto px-2">
+ {artifacts.map((art, idx) => (
+ <button
+ key={idx}
+ onClick={() => setActiveIdx(idx)}
+ className={cn(
+ "px-3 py-2 text-xs whitespace-nowrap border-b-2 transition-colors",
+ idx === activeIdx
+ ? "border-[var(--color-accent-primary)] text-[var(--color-accent-primary)]"
+ : "border-transparent text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)]",
+ )}
+ >
+ {art.title || art.type}
+ </button>
+ ))}
+ </div>
+ )}
+
+ <div className="flex-1 overflow-y-auto p-4">
+ <ArtifactRenderer artifact={active} />
+ </div>
+ </div>
+ </>
+ );
+}
+
+/**
+ * Dispatcher: switches on the artifact `.type` discriminant. Every
+ * `KnownChatArtifact` variant has a dedicated renderer; the `default`
+ * branch handles `wiki_page` (legacy markdown-shaped overview pages from
+ * older indexer outputs) and falls through to `GenericJsonRenderer` for
+ * unknown shapes.
+ */
+function ArtifactRenderer({ artifact }: { artifact: Artifact | ChatArtifact }) {
+ const { type, data } = artifact;
+
+ switch (type) {
+ case "overview":
+ return <OverviewRenderer data={data as unknown as OverviewArtifactData} />;
+ case "context":
+ return <ContextRenderer data={data as unknown as ContextArtifactData} />;
+ case "risk_report":
+ return <RiskReportRenderer data={data as unknown as RiskReportArtifactData} />;
+ case "search_results":
+ return <SearchResultsRenderer data={data as unknown as SearchResultsArtifactData} />;
+ case "graph":
+ return <GraphPathRenderer data={data as unknown as GraphPathArtifactData} />;
+ case "decisions":
+ return <DecisionsRenderer data={data as unknown as DecisionsArtifactData} />;
+ case "dead_code":
+ return <DeadCodeRenderer data={data as unknown as DeadCodeArtifactData} />;
+ case "diagram":
+ return <DiagramRenderer data={data as unknown as DiagramArtifactData} />;
+
+ case "wiki_page": {
+ // Legacy markdown-shaped artifact, pre-dating the typed union.
+ const content =
+ ((data as Record<string, unknown>).content_md as string) ??
+ ((data as Record<string, unknown>).content as string) ??
+ "";
+ return content ? (
+ <ChatMarkdown content={content} />
+ ) : (
+ <GenericJsonRenderer data={data as Record<string, unknown>} />
+ );
+ }
+
+ default:
+ return <GenericJsonRenderer data={data as Record<string, unknown>} />;
+ }
+}
diff --git a/packages/ui/src/chat/artifacts.tsx b/packages/ui/src/chat/artifacts.tsx
new file mode 100644
index 000000000..38f39401c
--- /dev/null
+++ b/packages/ui/src/chat/artifacts.tsx
@@ -0,0 +1,538 @@
+"use client";
+
+/**
+ * Per-type chat artifact renderers. Dispatched by `ArtifactPanel` based on
+ * `artifact.type`. Variant shapes are declared in
+ * `@repowise-dev/types/chat`. Each renderer is intentionally small and
+ * presentation-only — heavier visualisations (full graph canvases, tables,
+ * etc.) belong in their own subpackages and are linked to from here.
+ */
+
+import {
+ Activity,
+ AlertTriangle,
+ ArrowRight,
+ Box,
+ CheckCircle2,
+ FileCode,
+ GitBranch,
+ Layers,
+ Search,
+ ShieldAlert,
+ Sparkles,
+} from "lucide-react";
+import type {
+ ContextArtifactData,
+ DeadCodeArtifactData,
+ DecisionsArtifactData,
+ DiagramArtifactData,
+ GraphPathArtifactData,
+ OverviewArtifactData,
+ RiskReportArtifactData,
+ SearchResultsArtifactData,
+} from "@repowise-dev/types/chat";
+import { ChatMarkdown } from "./chat-markdown";
+import { MermaidDiagram } from "../wiki/mermaid-diagram";
+
+// ---------------------------------------------------------------------------
+// Shared atoms
+// ---------------------------------------------------------------------------
+
+function StatRow({ label, value }: { label: string; value: React.ReactNode }) {
+ return (
+ <div className="flex items-baseline justify-between gap-3 text-xs">
+ <span className="text-[var(--color-text-tertiary)]">{label}</span>
+ <span className="font-mono tabular-nums text-[var(--color-text-secondary)]">
+ {value}
+ </span>
+ </div>
+ );
+}
+
+function SectionTitle({
+ icon: Icon,
+ children,
+}: {
+ icon: React.ComponentType<{ className?: string }>;
+ children: React.ReactNode;
+}) {
+ return (
+ <div className="flex items-center gap-1.5 text-[10px] font-medium uppercase tracking-wider text-[var(--color-text-tertiary)] mb-2">
+ <Icon className="h-3 w-3" />
+ <span>{children}</span>
+ </div>
+ );
+}
+
+function FilePathChip({ path }: { path: string }) {
+ return (
+ <span className="inline-flex items-center gap-1 rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] px-1.5 py-0.5 text-[10px] font-mono text-[var(--color-text-secondary)]">
+ <FileCode className="h-2.5 w-2.5 opacity-60" />
+ <span className="truncate max-w-[200px]" title={path}>
+ {path}
+ </span>
+ </span>
+ );
+}
+
+// ---------------------------------------------------------------------------
+// Overview
+// ---------------------------------------------------------------------------
+
+export function OverviewRenderer({ data }: { data: OverviewArtifactData }) {
+ const langs = Object.entries(data.languages ?? {})
+ .sort((a, b) => (b[1] as number) - (a[1] as number))
+ .slice(0, 6);
+ return (
+ <div className="space-y-4">
+ <div className="grid grid-cols-2 gap-2">
+ <StatRow label="Files" value={data.total_files.toLocaleString()} />
+ <StatRow label="Symbols" value={data.total_symbols.toLocaleString()} />
+ <StatRow label="Hotspots" value={data.hotspot_count.toLocaleString()} />
+ <StatRow label="Monorepo" value={data.is_monorepo ? "yes" : "no"} />
+ </div>
+
+ {langs.length > 0 && (
+ <div>
+ <SectionTitle icon={Layers}>Languages</SectionTitle>
+ <div className="space-y-1">
+ {langs.map(([lang, count]) => (
+ <StatRow
+ key={lang}
+ label={lang}
+ value={(count as number).toLocaleString()}
+ />
+ ))}
+ </div>
+ </div>
+ )}
+
+ {data.modules.length > 0 && (
+ <div>
+ <SectionTitle icon={Box}>Modules</SectionTitle>
+ <div className="flex flex-wrap gap-1">
+ {data.modules.slice(0, 12).map((m) => (
+ <span
+ key={m}
+ className="rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] px-1.5 py-0.5 text-[10px] font-mono text-[var(--color-text-secondary)]"
+ >
+ {m}
+ </span>
+ ))}
+ </div>
+ </div>
+ )}
+
+ {data.entry_points.length > 0 && (
+ <div>
+ <SectionTitle icon={ArrowRight}>Entry points</SectionTitle>
+ <div className="space-y-1">
+ {data.entry_points.slice(0, 5).map((ep) => (
+ <FilePathChip key={ep} path={ep} />
+ ))}
+ </div>
+ </div>
+ )}
+ </div>
+ );
+}
+
+// ---------------------------------------------------------------------------
+// Context
+// ---------------------------------------------------------------------------
+
+export function ContextRenderer({ data }: { data: ContextArtifactData }) {
+ const targets = Object.entries(data.targets ?? {});
+ if (targets.length === 0) {
+ return (
+ <p className="text-xs text-[var(--color-text-tertiary)]">No context loaded.</p>
+ );
+ }
+ return (
+ <div className="space-y-5">
+ {targets.map(([target, info]) => {
+ const md = info.docs?.content_md ?? "";
+ return (
+ <div key={target}>
+ <h3 className="text-xs font-mono text-[var(--color-accent-primary)] mb-2 break-all">
+ {target}
+ </h3>
+ {md ? (
+ <ChatMarkdown content={md} />
+ ) : (
+ <p className="text-xs text-[var(--color-text-tertiary)]">
+ No documentation available.
+ </p>
+ )}
+ </div>
+ );
+ })}
+ </div>
+ );
+}
+
+// ---------------------------------------------------------------------------
+// Risk report
+// ---------------------------------------------------------------------------
+
+export function RiskReportRenderer({ data }: { data: RiskReportArtifactData }) {
+ return (
+ <div className="space-y-4">
+ <div>
+ <SectionTitle icon={ShieldAlert}>Targets</SectionTitle>
+ <div className="space-y-1.5">
+ {data.targets.map((t, i) => (
+ <div
+ key={`${t.file_path}:${i}`}
+ className="rounded-lg border border-[var(--color-border-default)] p-2.5"
+ >
+ <div className="flex items-center justify-between gap-2">
+ <span className="font-mono text-xs text-[var(--color-text-primary)] truncate">
+ {t.file_path}
+ </span>
+ {t.is_hotspot && (
+ <span className="inline-flex items-center gap-1 rounded bg-amber-500/10 px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-wider text-amber-400">
+ <AlertTriangle className="h-2.5 w-2.5" /> hotspot
+ </span>
+ )}
+ </div>
+ {typeof t.churn_percentile === "number" && (
+ <div className="text-[10px] text-[var(--color-text-tertiary)] mt-0.5 tabular-nums">
+ Churn {Math.round(t.churn_percentile)}th pct
+ </div>
+ )}
+ </div>
+ ))}
+ </div>
+ </div>
+
+ {data.global_hotspots.length > 0 && (
+ <div>
+ <SectionTitle icon={Activity}>Top global hotspots</SectionTitle>
+ <div className="space-y-1">
+ {data.global_hotspots.slice(0, 5).map((h, i) => (
+ <div
+ key={`${h.path}:${i}`}
+ className="flex items-center justify-between gap-2 text-xs"
+ >
+ <span className="font-mono text-[var(--color-text-secondary)] truncate">
+ {h.path}
+ </span>
+ <span className="text-[10px] tabular-nums text-[var(--color-text-tertiary)]">
+ {Math.round(h.churn_percentile)}th
+ </span>
+ </div>
+ ))}
+ </div>
+ </div>
+ )}
+ </div>
+ );
+}
+
+// ---------------------------------------------------------------------------
+// Search results
+// ---------------------------------------------------------------------------
+
+export function SearchResultsRenderer({
+ data,
+}: {
+ data: SearchResultsArtifactData;
+}) {
+ if (!data.results || data.results.length === 0) {
+ return (
+ <div className="space-y-2">
+ <SectionTitle icon={Search}>Query</SectionTitle>
+ <p className="text-xs text-[var(--color-text-secondary)] font-mono">
+ {data.query}
+ </p>
+ <p className="text-xs text-[var(--color-text-tertiary)]">
+ No results found.
+ </p>
+ </div>
+ );
+ }
+ return (
+ <div className="space-y-2">
+ <SectionTitle icon={Search}>{data.query}</SectionTitle>
+ {data.results.map((r, i) => (
+ <div
+ key={`${r.page_id ?? r.title}:${i}`}
+ className="rounded-lg border border-[var(--color-border-default)] p-3"
+ >
+ <div className="text-xs font-medium text-[var(--color-text-primary)]">
+ {r.title}
+ </div>
+ <div className="text-[10px] text-[var(--color-text-tertiary)] mt-0.5">
+ {r.page_type}
+ {typeof r.relevance_score === "number" && (
+ <> · score {(r.relevance_score as number).toFixed(2)}</>
+ )}
+ </div>
+ {r.snippet && (
+ <p className="text-xs text-[var(--color-text-secondary)] mt-1 line-clamp-3">
+ {r.snippet}
+ </p>
+ )}
+ </div>
+ ))}
+ </div>
+ );
+}
+
+// ---------------------------------------------------------------------------
+// Graph (dependency path)
+// ---------------------------------------------------------------------------
+
+export function GraphPathRenderer({ data }: { data: GraphPathArtifactData }) {
+ return (
+ <div className="space-y-3">
+ <p className="text-xs text-[var(--color-text-secondary)]">
+ {data.explanation}
+ </p>
+ {data.path.length > 0 ? (
+ <div>
+ <SectionTitle icon={GitBranch}>Path</SectionTitle>
+ <ol className="space-y-1">
+ {data.path.map((node, i) => (
+ <li
+ key={`${node}:${i}`}
+ className="flex items-center gap-2 text-xs"
+ >
+ <span className="flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-[var(--color-bg-elevated)] border border-[var(--color-border-default)] text-[9px] font-mono tabular-nums text-[var(--color-text-tertiary)]">
+ {i + 1}
+ </span>
+ <span className="font-mono text-[var(--color-text-secondary)] truncate">
+ {node}
+ </span>
+ {i < data.path.length - 1 && (
+ <ArrowRight className="h-3 w-3 text-[var(--color-text-tertiary)] ml-auto shrink-0" />
+ )}
+ </li>
+ ))}
+ </ol>
+ </div>
+ ) : (
+ <p className="text-xs text-[var(--color-text-tertiary)]">
+ No path found.
+ </p>
+ )}
+ </div>
+ );
+}
+
+// ---------------------------------------------------------------------------
+// Decisions
+// ---------------------------------------------------------------------------
+
+export function DecisionsRenderer({ data }: { data: DecisionsArtifactData }) {
+ if (data.mode === "health") {
+ return (
+ <div className="space-y-4">
+ <StatRow
+ label="Decisions"
+ value={(data.total_decisions ?? 0).toLocaleString()}
+ />
+ {data.by_source && Object.keys(data.by_source).length > 0 && (
+ <div>
+ <SectionTitle icon={Layers}>By source</SectionTitle>
+ <div className="space-y-1">
+ {Object.entries(data.by_source).map(([source, count]) => (
+ <StatRow
+ key={source}
+ label={source}
+ value={(count as number).toLocaleString()}
+ />
+ ))}
+ </div>
+ </div>
+ )}
+ {data.decisions && data.decisions.length > 0 && (
+ <div>
+ <SectionTitle icon={Sparkles}>Recent</SectionTitle>
+ <ul className="space-y-1">
+ {data.decisions.map((d, i) => (
+ <li key={i} className="text-xs text-[var(--color-text-secondary)]">
+ <span className="truncate">{d.title}</span>
+ {d.status && (
+ <span className="ml-1.5 text-[10px] text-[var(--color-text-tertiary)]">
+ ({d.status})
+ </span>
+ )}
+ </li>
+ ))}
+ </ul>
+ </div>
+ )}
+ </div>
+ );
+ }
+
+ // search mode
+ if (!data.results || data.results.length === 0) {
+ return (
+ <p className="text-xs text-[var(--color-text-tertiary)]">
+ No matching decisions for {data.query ? `"${data.query}"` : "this query"}.
+ </p>
+ );
+ }
+ return (
+ <div className="space-y-3">
+ {data.query && (
+ <p className="text-xs text-[var(--color-text-tertiary)]">
+ Matches for{" "}
+ <span className="font-mono text-[var(--color-text-secondary)]">
+ "{data.query}"
+ </span>
+ </p>
+ )}
+ {data.results.map((r, i) => (
+ <div
+ key={`${r.title}:${i}`}
+ className="rounded-lg border border-[var(--color-border-default)] p-3 space-y-1.5"
+ >
+ <h3 className="text-xs font-medium text-[var(--color-text-primary)]">
+ {r.title}
+ </h3>
+ <p className="text-xs text-[var(--color-text-secondary)] leading-relaxed">
+ {r.decision}
+ </p>
+ {r.rationale && (
+ <p className="text-[11px] text-[var(--color-text-tertiary)] leading-relaxed">
+ {r.rationale}
+ </p>
+ )}
+ {r.affected_files && r.affected_files.length > 0 && (
+ <div className="flex flex-wrap gap-1 pt-1">
+ {r.affected_files.slice(0, 6).map((f) => (
+ <FilePathChip key={f} path={f} />
+ ))}
+ </div>
+ )}
+ </div>
+ ))}
+ </div>
+ );
+}
+
+// ---------------------------------------------------------------------------
+// Dead code
+// ---------------------------------------------------------------------------
+
+export function DeadCodeRenderer({ data }: { data: DeadCodeArtifactData }) {
+ return (
+ <div className="space-y-4">
+ <div className="grid grid-cols-2 gap-2">
+ <StatRow
+ label="Findings"
+ value={data.total_findings.toLocaleString()}
+ />
+ <StatRow
+ label="Deletable lines"
+ value={data.deletable_lines.toLocaleString()}
+ />
+ </div>
+
+ {data.high_confidence.length > 0 && (
+ <div>
+ <SectionTitle icon={CheckCircle2}>High confidence</SectionTitle>
+ <div className="space-y-1.5">
+ {data.high_confidence.map((f, i) => (
+ <DeadCodeRow key={`${f.file_path}:${i}`} finding={f} showLines />
+ ))}
+ </div>
+ </div>
+ )}
+
+ {data.medium_confidence.length > 0 && (
+ <div>
+ <SectionTitle icon={AlertTriangle}>Medium confidence</SectionTitle>
+ <div className="space-y-1.5">
+ {data.medium_confidence.map((f, i) => (
+ <DeadCodeRow key={`${f.file_path}:${i}`} finding={f} />
+ ))}
+ </div>
+ </div>
+ )}
+ </div>
+ );
+}
+
+function DeadCodeRow({
+ finding,
+ showLines = false,
+}: {
+ finding: {
+ file_path: string;
+ symbol_name?: string | null;
+ kind: string;
+ confidence: number;
+ reason: string;
+ lines?: number;
+ safe_to_delete?: boolean;
+ };
+ showLines?: boolean;
+}) {
+ return (
+ <div className="rounded-md border border-[var(--color-border-default)] p-2 text-xs">
+ <div className="flex items-center justify-between gap-2">
+ <span className="font-mono text-[var(--color-text-primary)] truncate">
+ {finding.symbol_name ? `${finding.file_path}::${finding.symbol_name}` : finding.file_path}
+ </span>
+ <span className="text-[10px] tabular-nums text-[var(--color-text-tertiary)] shrink-0">
+ {(finding.confidence * 100).toFixed(0)}%
+ </span>
+ </div>
+ <div className="text-[10px] text-[var(--color-text-tertiary)] mt-0.5">
+ {finding.kind}
+ {showLines && typeof finding.lines === "number" && (
+ <> · {finding.lines} lines</>
+ )}
+ {finding.safe_to_delete && <> · safe to delete</>}
+ </div>
+ <p className="text-[11px] text-[var(--color-text-secondary)] mt-1 line-clamp-2">
+ {finding.reason}
+ </p>
+ </div>
+ );
+}
+
+// ---------------------------------------------------------------------------
+// Diagram (Mermaid)
+// ---------------------------------------------------------------------------
+
+export function DiagramRenderer({ data }: { data: DiagramArtifactData }) {
+ if (!data.mermaid_syntax) {
+ return (
+ <p className="text-xs text-[var(--color-text-tertiary)]">
+ No diagram available.
+ </p>
+ );
+ }
+ return (
+ <div className="space-y-3">
+ {data.description && (
+ <p className="text-xs text-[var(--color-text-tertiary)]">
+ {data.description}
+ </p>
+ )}
+ <MermaidDiagram chart={data.mermaid_syntax} />
+ </div>
+ );
+}
+
+// ---------------------------------------------------------------------------
+// Generic JSON fallback
+// ---------------------------------------------------------------------------
+
+export function GenericJsonRenderer({
+ data,
+}: {
+ data: Record<string, unknown>;
+}) {
+ return (
+ <pre className="text-[10px] font-mono text-[var(--color-text-secondary)] overflow-auto max-h-[70vh] whitespace-pre-wrap break-words">
+ {JSON.stringify(data, null, 2)}
+ </pre>
+ );
+}
diff --git a/packages/ui/src/chat/chat-interface.tsx b/packages/ui/src/chat/chat-interface.tsx
new file mode 100644
index 000000000..762874223
--- /dev/null
+++ b/packages/ui/src/chat/chat-interface.tsx
@@ -0,0 +1,306 @@
+"use client";
+
+/**
+ * Presentational shell for the main chat interface. The wrapper owns:
+ *
+ * - the SSE transport (`useChat` in hosted-web, the federated transport in
+ * the hosted-frontend example app),
+ * - the model + conversation-history dropdowns (passed in as opaque slot
+ * `ReactNode`s so each consumer can wire its own data hooks),
+ * - artifact panel state (artifacts list + open boolean).
+ *
+ * The shell is stateless apart from the textarea input value and renders
+ * messages, the empty-state suggestion chips, the input area, and slots.
+ */
+
+import {
+ useCallback,
+ useEffect,
+ useRef,
+ useState,
+ type ReactNode,
+} from "react";
+import { Send, StopCircle, PanelRight } from "lucide-react";
+import { Button } from "../ui/button";
+import { ScrollArea } from "../ui/scroll-area";
+import { cn } from "../lib/cn";
+import { ChatMessage } from "./chat-message";
+import { ArtifactPanel, type Artifact } from "./artifact-panel";
+import type { ChatUIMessage } from "@repowise-dev/types/chat";
+import type { SourceReference } from "./source-citations";
+
+const DEFAULT_SUGGESTIONS = [
+ "Give me an overview of this codebase",
+ "What are the highest-risk files to modify?",
+ "Show me the architecture diagram",
+ "What dead code can be safely removed?",
+ "What architectural decisions have been made?",
+ "Search for authentication-related code",
+];
+
+export interface ChatInterfaceProps {
+ /** Identifier forwarded to `ChatMessage` for source-citation hrefs. */
+ repoId: string;
+ /** Optional repo display name shown in the empty state heading. */
+ repoName?: string;
+
+ /** Conversation transcript (UI-flattened). */
+ messages: ChatUIMessage[];
+ /** True while a response is streaming; flips Send → Stop. */
+ isStreaming: boolean;
+ /** Optional inline error banner (cleared by the wrapper when appropriate). */
+ error?: string | null;
+
+ /** Submit a new user message. */
+ onSend: (text: string) => void | Promise<void>;
+ /** Cancel the in-flight stream. Also used as "reset" by callers. */
+ onCancel: () => void;
+
+ /**
+ * Slot rendered in the right side of the active-conversation header bar AND
+ * in the empty-state composer footer. Typically a `<ModelSelector />`
+ * wrapper that owns its providers SWR.
+ */
+ modelSelectorSlot?: ReactNode;
+ /**
+ * Slot rendered in the left side of the active-conversation header bar AND
+ * in the empty-state composer footer. Typically a `<ConversationHistory />`
+ * wrapper that owns its SWR + delete mutation.
+ */
+ historySlot?: ReactNode;
+
+ /** Avatar src forwarded to `ChatMessage`. */
+ assistantAvatarSrc?: string;
+ /** Forwarded to `SourceCitations` for href customisation. */
+ buildCitationHref?: (source: SourceReference) => string;
+ /** Logo shown above the empty-state heading. */
+ emptyStateLogoSrc?: string;
+ /** Override default suggestion chips. */
+ suggestions?: string[];
+}
+
+export function ChatInterface({
+ repoId,
+ repoName,
+ messages,
+ isStreaming,
+ error,
+ onSend,
+ onCancel,
+ modelSelectorSlot,
+ historySlot,
+ assistantAvatarSrc,
+ buildCitationHref,
+ emptyStateLogoSrc = "/repowise-logo.png",
+ suggestions = DEFAULT_SUGGESTIONS,
+}: ChatInterfaceProps) {
+ const [input, setInput] = useState("");
+ const [artifactPanelOpen, setArtifactPanelOpen] = useState(false);
+ const [artifacts, setArtifacts] = useState<Artifact[]>([]);
+ const bottomRef = useRef<HTMLDivElement>(null);
+ const textareaRef = useRef<HTMLTextAreaElement>(null);
+
+ const isEmpty = messages.length === 0;
+
+ useEffect(() => {
+ bottomRef.current?.scrollIntoView?.({ behavior: "smooth" });
+ }, [messages]);
+
+ useEffect(() => {
+ const ta = textareaRef.current;
+ if (ta) {
+ ta.style.height = "auto";
+ ta.style.height = `${Math.min(ta.scrollHeight, 144)}px`;
+ }
+ }, [input]);
+
+ const handleViewArtifact = useCallback(
+ (artifact: { type: string; data: Record<string, unknown> }) => {
+ const title = (artifact.data.title as string) ?? artifact.type;
+ const newArt: Artifact = { type: artifact.type, title, data: artifact.data };
+ setArtifacts((prev) => {
+ const existing = prev.findIndex(
+ (a) => a.type === newArt.type && a.title === newArt.title,
+ );
+ if (existing >= 0) return prev;
+ return [...prev, newArt];
+ });
+ setArtifactPanelOpen(true);
+ },
+ [],
+ );
+
+ async function handleSubmit() {
+ const text = input.trim();
+ if (!text || isStreaming) return;
+ setInput("");
+ if (textareaRef.current) {
+ textareaRef.current.style.height = "auto";
+ }
+ await onSend(text);
+ }
+
+ function handleSuggestion(text: string) {
+ setInput(text);
+ textareaRef.current?.focus();
+ }
+
+ const totalArtifactCount = messages.reduce(
+ (count, m) => count + m.toolCalls.filter((tc) => tc.artifact).length,
+ 0,
+ );
+
+ return (
+ <div className="flex h-full flex-col min-h-0">
+ {/* Header bar (active conversation) */}
+ {!isEmpty && (
+ <div className="flex items-center justify-between px-4 py-2.5 border-b border-[var(--color-border-default)] shrink-0 bg-[var(--color-bg-surface)]/95 backdrop-blur-sm">
+ <div className="flex items-center gap-2">{historySlot}</div>
+ <div className="flex items-center gap-2">
+ {totalArtifactCount > 0 && (
+ <Button
+ variant="ghost"
+ size="sm"
+ className="h-8 text-xs gap-1.5"
+ onClick={() => setArtifactPanelOpen(true)}
+ >
+ <PanelRight className="h-4 w-4" />
+ {totalArtifactCount}
+ </Button>
+ )}
+ {modelSelectorSlot}
+ </div>
+ </div>
+ )}
+
+ {/* Message list or empty state */}
+ <div className="flex-1 min-h-0 relative">
+ {isEmpty ? (
+ <div className="flex flex-col items-center justify-center h-full gap-10 px-4">
+ <div className="text-center space-y-3">
+ <div className="flex items-center justify-center mb-6">
+ {/* eslint-disable-next-line @next/next/no-img-element */}
+ <img
+ src={emptyStateLogoSrc}
+ alt="repowise"
+ width={48}
+ height={48}
+ className="drop-shadow-[0_0_12px_rgba(245,149,32,0.35)]"
+ />
+ </div>
+ <h2 className="text-xl font-semibold text-[var(--color-text-primary)]">
+ Ask anything about {repoName ?? "this codebase"}
+ </h2>
+ <p className="text-sm text-[var(--color-text-secondary)] max-w-md leading-relaxed">
+ Explore architecture, assess risk, search code, trace
+ dependencies, and understand decisions.
+ </p>
+ </div>
+
+ <div className="grid grid-cols-1 sm:grid-cols-2 gap-2.5 max-w-xl w-full">
+ {suggestions.map((s) => (
+ <button
+ key={s}
+ className="text-left text-sm text-[var(--color-text-secondary)] rounded-xl border border-[var(--color-border-default)] px-4 py-3 hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] hover:border-[var(--color-border-hover)] transition-colors"
+ onClick={() => handleSuggestion(s)}
+ >
+ {s}
+ </button>
+ ))}
+ </div>
+
+ <div className="flex items-center gap-3">
+ {modelSelectorSlot && (
+ <span className="text-xs text-[var(--color-text-tertiary)]">
+ Using:
+ </span>
+ )}
+ {modelSelectorSlot}
+ {historySlot}
+ </div>
+ </div>
+ ) : (
+ <ScrollArea className="h-full">
+ <div className="px-4 py-6 space-y-5 max-w-3xl mx-auto">
+ {messages.map((m) => (
+ <ChatMessage
+ key={m.id}
+ message={m}
+ repoId={repoId}
+ onViewArtifact={handleViewArtifact}
+ {...(assistantAvatarSrc ? { assistantAvatarSrc } : {})}
+ {...(buildCitationHref ? { buildCitationHref } : {})}
+ />
+ ))}
+ {error && (
+ <div className="rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2.5 text-sm text-red-400">
+ {error}
+ </div>
+ )}
+ <div ref={bottomRef} />
+ </div>
+ </ScrollArea>
+ )}
+ </div>
+
+ {/* Input area */}
+ <div
+ className={cn(
+ "shrink-0 px-4 py-4",
+ !isEmpty && "border-t border-[var(--color-border-default)]",
+ )}
+ >
+ <div className="max-w-3xl mx-auto">
+ <div
+ className={cn(
+ "flex items-end gap-2 rounded-2xl border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] px-4 py-3",
+ isEmpty && "shadow-lg shadow-black/20",
+ )}
+ >
+ <textarea
+ ref={textareaRef}
+ value={input}
+ onChange={(e) => setInput(e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === "Enter" && !e.shiftKey) {
+ e.preventDefault();
+ void handleSubmit();
+ }
+ }}
+ placeholder="Ask anything about this codebase..."
+ aria-label="Chat message"
+ rows={1}
+ className="flex-1 resize-none bg-transparent text-sm text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] outline-none leading-6 max-h-36 overflow-y-auto"
+ style={{ scrollbarWidth: "none" }}
+ />
+ <Button
+ size="icon"
+ className="h-8 w-8 shrink-0 rounded-xl"
+ onClick={isStreaming ? onCancel : () => void handleSubmit()}
+ disabled={!input.trim() && !isStreaming}
+ aria-label={isStreaming ? "Stop generation" : "Send message"}
+ title={isStreaming ? "Stop generation" : "Send message"}
+ >
+ {isStreaming ? (
+ <StopCircle className="h-4 w-4" />
+ ) : (
+ <Send className="h-4 w-4" />
+ )}
+ </Button>
+ </div>
+ {isEmpty && (
+ <p className="text-center text-[11px] text-[var(--color-text-tertiary)] mt-2.5">
+ Shift+Enter for newline · Enter to send
+ </p>
+ )}
+ </div>
+ </div>
+
+ <ArtifactPanel
+ artifacts={artifacts}
+ open={artifactPanelOpen}
+ onClose={() => setArtifactPanelOpen(false)}
+ />
+ </div>
+ );
+}
diff --git a/packages/web/src/components/chat/chat-markdown.tsx b/packages/ui/src/chat/chat-markdown.tsx
similarity index 100%
rename from packages/web/src/components/chat/chat-markdown.tsx
rename to packages/ui/src/chat/chat-markdown.tsx
diff --git a/packages/web/src/components/chat/chat-message.tsx b/packages/ui/src/chat/chat-message.tsx
similarity index 63%
rename from packages/web/src/components/chat/chat-message.tsx
rename to packages/ui/src/chat/chat-message.tsx
index 40454ff78..040535fe3 100644
--- a/packages/web/src/components/chat/chat-message.tsx
+++ b/packages/ui/src/chat/chat-message.tsx
@@ -1,25 +1,33 @@
"use client";
-import Image from "next/image";
import { User } from "lucide-react";
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
import { ToolCallBlock } from "./tool-call-block";
import { ChatMarkdown } from "./chat-markdown";
-import { SourceCitations } from "./source-citations";
-import type { ChatMessage as ChatMessageType } from "@/lib/hooks/use-chat";
+import { SourceCitations, type SourceReference } from "./source-citations";
+import type { ChatUIMessage } from "@repowise-dev/types/chat";
interface ChatMessageProps {
- message: ChatMessageType;
+ message: ChatUIMessage;
repoId: string;
onViewArtifact?: (artifact: { type: string; data: Record<string, unknown> }) => void;
+ /** Optional avatar src for the assistant. Defaults to `/repowise-logo.png`. */
+ assistantAvatarSrc?: string;
+ /** Forwarded to `SourceCitations` so consumers can customise the link path. */
+ buildCitationHref?: (source: SourceReference) => string;
}
-export function ChatMessage({ message, repoId, onViewArtifact }: ChatMessageProps) {
+export function ChatMessage({
+ message,
+ repoId,
+ onViewArtifact,
+ assistantAvatarSrc = "/repowise-logo.png",
+ buildCitationHref,
+}: ChatMessageProps) {
const isUser = message.role === "user";
return (
<div className={cn("flex gap-3.5", isUser && "flex-row-reverse")}>
- {/* Avatar */}
<div
className={cn(
"flex shrink-0 items-center justify-center rounded-full mt-0.5",
@@ -31,8 +39,9 @@ export function ChatMessage({ message, repoId, onViewArtifact }: ChatMessageProp
{isUser ? (
<User className="h-4 w-4 text-white" />
) : (
- <Image
- src="/repowise-logo.png"
+ /* eslint-disable-next-line @next/next/no-img-element */
+ <img
+ src={assistantAvatarSrc}
alt="repowise"
width={22}
height={22}
@@ -41,53 +50,53 @@ export function ChatMessage({ message, repoId, onViewArtifact }: ChatMessageProp
)}
</div>
- {/* Content */}
<div
className={cn(
"flex-1 min-w-0",
isUser && "flex flex-col items-end",
)}
>
- {/* User message */}
{isUser && (
<div className="rounded-2xl rounded-tr-sm bg-[var(--color-accent-primary)] px-4 py-2.5 text-sm text-white max-w-[85%]">
{message.text}
</div>
)}
- {/* Assistant message */}
{!isUser && (
<div className="max-w-full space-y-1.5">
- {/* Tool calls */}
{message.toolCalls.length > 0 && (
<div className="space-y-1">
- {message.toolCalls.map((tc) => (
- <ToolCallBlock
- key={tc.id}
- toolCall={tc}
- onViewArtifact={
- tc.artifact && onViewArtifact
- ? () => onViewArtifact(tc.artifact!)
- : undefined
- }
- />
- ))}
+ {message.toolCalls.map((tc) => {
+ const artifact = tc.artifact;
+ const handler =
+ artifact && onViewArtifact
+ ? () => onViewArtifact(artifact)
+ : undefined;
+ return (
+ <ToolCallBlock
+ key={tc.id}
+ toolCall={tc}
+ {...(handler ? { onViewArtifact: handler } : {})}
+ />
+ );
+ })}
</div>
)}
- {/* Text content */}
{message.text && (
<div className="prose-chat">
<ChatMarkdown content={message.text} />
</div>
)}
- {/* Source citations */}
{!message.isStreaming && message.toolCalls.length > 0 && (
- <SourceCitations toolCalls={message.toolCalls} repoId={repoId} />
+ <SourceCitations
+ toolCalls={message.toolCalls}
+ repoId={repoId}
+ {...(buildCitationHref ? { buildHref: buildCitationHref } : {})}
+ />
)}
- {/* Streaming cursor */}
{message.isStreaming &&
!message.text &&
message.toolCalls.length === 0 && (
diff --git a/packages/ui/src/chat/conversation-history.tsx b/packages/ui/src/chat/conversation-history.tsx
new file mode 100644
index 000000000..0b64cc32d
--- /dev/null
+++ b/packages/ui/src/chat/conversation-history.tsx
@@ -0,0 +1,132 @@
+"use client";
+
+/**
+ * Presentational shell for the chat conversation-history dropdown. The data
+ * fetch (SWR list) and delete mutation live in the consumer wrapper; this
+ * shell only renders the trigger, popover surface, list rows, and emits
+ * select / delete / new intents via callbacks.
+ */
+
+import { useState } from "react";
+import { History, Plus, Trash2 } from "lucide-react";
+import { cn } from "../lib/cn";
+import type { Conversation } from "@repowise-dev/types/chat";
+
+export interface ConversationHistoryProps {
+ conversations: Conversation[] | undefined;
+ isLoading?: boolean;
+ /** id of the currently active conversation. */
+ selectedId?: string | null;
+ onSelect: (id: string) => void;
+ onDelete: (id: string) => void | Promise<void>;
+ onNew: () => void;
+ className?: string;
+}
+
+function formatRelativeTime(dateStr: string): string {
+ const diff = Date.now() - new Date(dateStr).getTime();
+ const mins = Math.floor(diff / 60000);
+ if (mins < 1) return "just now";
+ if (mins < 60) return `${mins}m ago`;
+ const hours = Math.floor(mins / 60);
+ if (hours < 24) return `${hours}h ago`;
+ const days = Math.floor(hours / 24);
+ if (days < 7) return `${days}d ago`;
+ return new Date(dateStr).toLocaleDateString();
+}
+
+export function ConversationHistory({
+ conversations,
+ isLoading = false,
+ selectedId = null,
+ onSelect,
+ onDelete,
+ onNew,
+ className,
+}: ConversationHistoryProps) {
+ const [open, setOpen] = useState(false);
+
+ return (
+ <div className={cn("relative", className)}>
+ <button
+ onClick={() => setOpen(!open)}
+ className={cn(
+ "flex items-center gap-1 rounded-md px-2 py-1 text-xs",
+ "text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)]",
+ "hover:bg-[var(--color-bg-elevated)] transition-colors",
+ )}
+ >
+ <History className="h-3.5 w-3.5" />
+ History
+ </button>
+
+ {open && (
+ <>
+ <div
+ className="fixed inset-0 z-[var(--z-dropdown)]"
+ onClick={() => setOpen(false)}
+ />
+ <div className="absolute left-0 top-full mt-1 z-[calc(var(--z-dropdown)+1)] w-72 rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-overlay)] shadow-lg overflow-hidden">
+ <button
+ onClick={() => {
+ onNew();
+ setOpen(false);
+ }}
+ className="flex w-full items-center gap-2 px-3 py-2 text-xs text-[var(--color-accent-primary)] hover:bg-[var(--color-bg-elevated)] transition-colors border-b border-[var(--color-border-default)]"
+ >
+ <Plus className="h-3.5 w-3.5" />
+ New conversation
+ </button>
+
+ <div className="max-h-64 overflow-y-auto">
+ {isLoading && !conversations && (
+ <div className="px-3 py-4 text-xs text-[var(--color-text-tertiary)] text-center">
+ Loading...
+ </div>
+ )}
+ {conversations?.length === 0 && (
+ <div className="px-3 py-4 text-xs text-[var(--color-text-tertiary)] text-center">
+ No conversations yet
+ </div>
+ )}
+ {conversations?.map((conv) => (
+ <div
+ key={conv.id}
+ className={cn(
+ "flex items-center gap-2 px-3 py-2 hover:bg-[var(--color-bg-elevated)] transition-colors group cursor-pointer",
+ conv.id === selectedId &&
+ "bg-[var(--color-accent-muted)]",
+ )}
+ onClick={() => {
+ onSelect(conv.id);
+ setOpen(false);
+ }}
+ >
+ <div className="flex-1 min-w-0">
+ <div className="text-xs text-[var(--color-text-primary)] truncate">
+ {conv.title}
+ </div>
+ <div className="text-[10px] text-[var(--color-text-tertiary)]">
+ {formatRelativeTime(conv.updated_at)} ·{" "}
+ {conv.message_count} msgs
+ </div>
+ </div>
+ <button
+ onClick={(e) => {
+ e.stopPropagation();
+ void onDelete(conv.id);
+ }}
+ className="opacity-0 group-hover:opacity-100 p-1 text-[var(--color-text-tertiary)] hover:text-red-400 transition-all"
+ aria-label="Delete conversation"
+ >
+ <Trash2 className="h-3 w-3" />
+ </button>
+ </div>
+ ))}
+ </div>
+ </div>
+ </>
+ )}
+ </div>
+ );
+}
diff --git a/packages/ui/src/chat/index.ts b/packages/ui/src/chat/index.ts
new file mode 100644
index 000000000..7d30018e3
--- /dev/null
+++ b/packages/ui/src/chat/index.ts
@@ -0,0 +1,10 @@
+export * from "./artifact-panel.js";
+export * from "./artifacts.js";
+export * from "./chat-interface.js";
+export * from "./chat-markdown.js";
+export * from "./chat-message.js";
+export * from "./conversation-history.js";
+export * from "./model-selector.js";
+export * from "./source-citation.js";
+export * from "./source-citations.js";
+export * from "./tool-call-block.js";
diff --git a/packages/ui/src/chat/model-selector.tsx b/packages/ui/src/chat/model-selector.tsx
new file mode 100644
index 000000000..764807f3b
--- /dev/null
+++ b/packages/ui/src/chat/model-selector.tsx
@@ -0,0 +1,213 @@
+"use client";
+
+/**
+ * Presentational shell for the chat model selector. The interactive surface
+ * (popover, "add API key" form, model list, active highlight) lives here;
+ * the data hook (e.g. SWR fetch of `/providers`) lives in the consumer app
+ * via a thin wrapper that maps its hook output onto these props.
+ */
+
+import { useState } from "react";
+import { ChevronDown, Check, Key, X } from "lucide-react";
+import { cn } from "../lib/cn";
+
+export interface ModelSelectorProvider {
+ id: string;
+ name: string;
+ models: string[];
+ default_model: string;
+ configured: boolean;
+}
+
+export interface ModelSelectorProps {
+ providers: ModelSelectorProvider[];
+ activeProvider: string | null;
+ activeModel: string | null;
+ isLoading?: boolean;
+ onActivate: (providerId: string, model: string) => void | Promise<void>;
+ onSaveKey: (providerId: string, key: string) => void | Promise<void>;
+ /** Optional label override when no provider is active. */
+ emptyLabel?: string;
+ className?: string;
+}
+
+export function ModelSelector({
+ providers,
+ activeProvider,
+ activeModel,
+ isLoading = false,
+ onActivate,
+ onSaveKey,
+ emptyLabel = "Select model",
+ className,
+}: ModelSelectorProps) {
+ const [open, setOpen] = useState(false);
+ const [addingKeyFor, setAddingKeyFor] = useState<string | null>(null);
+ const [keyInput, setKeyInput] = useState("");
+ const [saving, setSaving] = useState(false);
+
+ const activeP = providers.find((p) => p.id === activeProvider);
+ const label = activeP
+ ? `${activeP.name} · ${activeModel ?? activeP.default_model}`
+ : emptyLabel;
+
+ async function handleSelect(providerId: string, model: string) {
+ await onActivate(providerId, model);
+ setOpen(false);
+ }
+
+ async function handleSaveKey(providerId: string) {
+ if (!keyInput.trim()) return;
+ setSaving(true);
+ try {
+ await onSaveKey(providerId, keyInput.trim());
+ setAddingKeyFor(null);
+ setKeyInput("");
+ } catch {
+ // Errors surface via the consumer's hook.
+ } finally {
+ setSaving(false);
+ }
+ }
+
+ return (
+ <div className={cn("relative", className)}>
+ <button
+ onClick={() => setOpen(!open)}
+ className={cn(
+ "flex items-center gap-1.5 rounded-md px-2 py-1 text-xs",
+ "text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)]",
+ "hover:bg-[var(--color-bg-elevated)] transition-colors",
+ "border border-[var(--color-border-default)]",
+ )}
+ >
+ <span className="truncate max-w-[200px]">
+ {isLoading ? "..." : label}
+ </span>
+ <ChevronDown className="h-3 w-3 shrink-0" />
+ </button>
+
+ {open && (
+ <>
+ <div
+ className="fixed inset-0 z-[var(--z-dropdown)]"
+ onClick={() => {
+ setOpen(false);
+ setAddingKeyFor(null);
+ }}
+ />
+
+ <div className="absolute right-0 top-full mt-1 z-[calc(var(--z-dropdown)+1)] w-72 rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-overlay)] shadow-lg overflow-hidden">
+ <div className="p-2 space-y-1 max-h-80 overflow-y-auto">
+ {providers.map((provider) => {
+ const isConfigured = provider.configured;
+ return (
+ <div key={provider.id}>
+ <div className="flex items-center justify-between px-2 py-1">
+ <span
+ className={cn(
+ "text-xs font-medium",
+ isConfigured
+ ? "text-[var(--color-text-primary)]"
+ : "text-[var(--color-text-tertiary)]",
+ )}
+ >
+ {provider.name}
+ </span>
+ {!isConfigured && (
+ <button
+ onClick={(e) => {
+ e.stopPropagation();
+ setAddingKeyFor(
+ addingKeyFor === provider.id
+ ? null
+ : provider.id,
+ );
+ setKeyInput("");
+ }}
+ className="text-[10px] text-[var(--color-accent-primary)] hover:underline flex items-center gap-0.5"
+ >
+ <Key className="h-3 w-3" />
+ Add key
+ </button>
+ )}
+ </div>
+
+ {addingKeyFor === provider.id && (
+ <div className="px-2 pb-1.5 flex gap-1">
+ <input
+ type="password"
+ value={keyInput}
+ onChange={(e) => setKeyInput(e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === "Enter")
+ handleSaveKey(provider.id);
+ }}
+ placeholder="API key..."
+ className="flex-1 rounded border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-2 py-1 text-xs text-[var(--color-text-primary)] outline-none focus:ring-1 focus:ring-[var(--color-accent-primary)]"
+ autoFocus
+ />
+ <button
+ onClick={() => handleSaveKey(provider.id)}
+ disabled={saving || !keyInput.trim()}
+ className="rounded bg-[var(--color-accent-primary)] px-2 py-1 text-xs text-white disabled:opacity-50"
+ >
+ {saving ? "..." : "Save"}
+ </button>
+ <button
+ onClick={() => {
+ setAddingKeyFor(null);
+ setKeyInput("");
+ }}
+ className="p-1 text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)]"
+ >
+ <X className="h-3 w-3" />
+ </button>
+ </div>
+ )}
+
+ {isConfigured &&
+ provider.models.map((model) => {
+ const isActive =
+ activeProvider === provider.id &&
+ activeModel === model;
+ return (
+ <button
+ key={model}
+ onClick={() => handleSelect(provider.id, model)}
+ className={cn(
+ "flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors",
+ isActive
+ ? "bg-[var(--color-accent-muted)] text-[var(--color-accent-primary)]"
+ : "text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)]",
+ )}
+ >
+ <span className="flex-1 text-left font-mono truncate">
+ {model}
+ </span>
+ {isActive && (
+ <Check className="h-3 w-3 shrink-0" />
+ )}
+ </button>
+ );
+ })}
+
+ {!isConfigured &&
+ provider.models.map((model) => (
+ <div
+ key={model}
+ className="px-3 py-1.5 text-xs font-mono text-[var(--color-text-tertiary)] opacity-50"
+ >
+ {model}
+ </div>
+ ))}
+ </div>
+ );
+ })}
+ </div>
+ </div>
+ </>
+ )}
+ </div>
+ );
+}
diff --git a/packages/ui/src/chat/source-citation.tsx b/packages/ui/src/chat/source-citation.tsx
new file mode 100644
index 000000000..faef5b290
--- /dev/null
+++ b/packages/ui/src/chat/source-citation.tsx
@@ -0,0 +1,75 @@
+"use client";
+
+import { FileCode } from "lucide-react";
+import type { ChatCitation } from "@repowise-dev/types/chat";
+
+/**
+ * Singular citation chip for the typed `ChatCitation` shape (file path +
+ * optional symbol + optional line range). Distinct from `SourceCitations`,
+ * which derives chips from raw tool result blobs — this one renders an
+ * already-typed citation reference.
+ *
+ * The component is framework-neutral: pass `buildHref` to control routing.
+ * If omitted, the chip renders as plain text with no link wrapping.
+ */
+export interface SourceCitationProps {
+ citation: ChatCitation;
+ buildHref?: (citation: ChatCitation) => string;
+ /** Optional 1-based numeric badge prefix. */
+ index?: number;
+ className?: string;
+}
+
+export function SourceCitation({
+ citation,
+ buildHref,
+ index,
+ className,
+}: SourceCitationProps) {
+ const href = buildHref ? buildHref(citation) : null;
+ const label = formatCitationLabel(citation);
+
+ const inner = (
+ <>
+ {typeof index === "number" && (
+ <span className="flex items-center justify-center h-3.5 w-3.5 rounded-sm bg-[var(--color-bg-overlay)] text-[9px] font-bold text-[var(--color-text-tertiary)] shrink-0">
+ {index}
+ </span>
+ )}
+ <FileCode className="h-3 w-3 shrink-0 opacity-60" />
+ <span className="truncate max-w-[220px] font-mono">{label}</span>
+ {citation.start_line != null && (
+ <span className="text-[9px] tabular-nums text-[var(--color-text-tertiary)] shrink-0">
+ L{citation.start_line}
+ {citation.end_line != null && citation.end_line !== citation.start_line
+ ? `-${citation.end_line}`
+ : ""}
+ </span>
+ )}
+ </>
+ );
+
+ const baseCls =
+ "group inline-flex items-center gap-1.5 rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] px-2 py-1 text-[10px] text-[var(--color-text-secondary)]";
+ const interactiveCls =
+ "hover:border-[var(--color-accent-primary)] hover:text-[var(--color-accent-primary)] hover:bg-[var(--color-accent-muted)] transition-all";
+
+ if (href) {
+ return (
+ <a
+ href={href}
+ className={[baseCls, interactiveCls, className ?? ""].join(" ")}
+ >
+ {inner}
+ </a>
+ );
+ }
+ return (
+ <span className={[baseCls, className ?? ""].join(" ")}>{inner}</span>
+ );
+}
+
+function formatCitationLabel(c: ChatCitation): string {
+ const filename = c.file_path.split("/").pop() ?? c.file_path;
+ return c.symbol_name ? `${filename}::${c.symbol_name}` : filename;
+}
diff --git a/packages/web/src/components/chat/source-citations.tsx b/packages/ui/src/chat/source-citations.tsx
similarity index 79%
rename from packages/web/src/components/chat/source-citations.tsx
rename to packages/ui/src/chat/source-citations.tsx
index 0ebf65c21..049ec3a1d 100644
--- a/packages/web/src/components/chat/source-citations.tsx
+++ b/packages/ui/src/chat/source-citations.tsx
@@ -1,7 +1,6 @@
"use client";
import { useMemo } from "react";
-import Link from "next/link";
import {
FileText,
FolderOpen,
@@ -10,12 +9,7 @@ import {
LayoutGrid,
ArrowUpRight,
} from "lucide-react";
-import { cn } from "@/lib/utils/cn";
-import type { ChatToolCall } from "@/lib/hooks/use-chat";
-
-// ---------------------------------------------------------------------------
-// Types
-// ---------------------------------------------------------------------------
+import type { ChatUIToolCall } from "@repowise-dev/types/chat";
export interface SourceReference {
id: string;
@@ -27,13 +21,9 @@ export interface SourceReference {
toolName: string;
}
-// ---------------------------------------------------------------------------
-// Extract sources from tool call results
-// ---------------------------------------------------------------------------
-
export function extractSources(
- toolCalls: ChatToolCall[],
- repoId: string,
+ toolCalls: ChatUIToolCall[],
+ _repoId: string,
): SourceReference[] {
const seen = new Set<string>();
const sources: SourceReference[] = [];
@@ -41,9 +31,8 @@ export function extractSources(
for (const tc of toolCalls) {
if (tc.status !== "done" || !tc.result) continue;
- const result = tc.result as Record<string, unknown>;
+ const result = tc.result;
- // search_codebase → results array
if (tc.name === "search_codebase") {
const results = (result.results as Array<Record<string, unknown>>) ?? [];
for (const r of results) {
@@ -62,7 +51,6 @@ export function extractSources(
}
}
- // get_context → targets dict with docs
if (tc.name === "get_context") {
const targets = result.targets as Record<string, Record<string, unknown>> | undefined;
if (targets) {
@@ -84,7 +72,6 @@ export function extractSources(
}
}
- // get_overview → single overview page
if (tc.name === "get_overview") {
const title = result.title as string;
if (title) {
@@ -103,7 +90,6 @@ export function extractSources(
}
}
- // get_why → decisions with page references
if (tc.name === "get_why") {
const decisions = (result.decisions as Array<Record<string, unknown>>)
?? (result.matching_decisions as Array<Record<string, unknown>>)
@@ -126,7 +112,6 @@ export function extractSources(
}
}
- // get_architecture_diagram — link to the diagram page
if (tc.name === "get_architecture_diagram") {
const pageId = "architecture_diagram:";
if (!seen.has(pageId)) {
@@ -146,10 +131,6 @@ export function extractSources(
return sources;
}
-// ---------------------------------------------------------------------------
-// Icon helper
-// ---------------------------------------------------------------------------
-
const TYPE_ICON: Record<string, React.ComponentType<{ className?: string }>> = {
repo_overview: Globe,
architecture_diagram: LayoutGrid,
@@ -159,19 +140,29 @@ const TYPE_ICON: Record<string, React.ComponentType<{ className?: string }>> = {
function SourceIcon({ pageType, className }: { pageType: string; className?: string }) {
const Icon = TYPE_ICON[pageType] ?? FileText;
- return <Icon className={className} />;
+ return <Icon {...(className ? { className } : {})} />;
}
-// ---------------------------------------------------------------------------
-// Component
-// ---------------------------------------------------------------------------
-
interface SourceCitationsProps {
- toolCalls: ChatToolCall[];
+ toolCalls: ChatUIToolCall[];
repoId: string;
+ /**
+ * Builds the navigation URL for a citation. Defaults to OSS web's
+ * `/repos/{repoId}/wiki/{pageId}` shape; hosted-frontend supplies its own
+ * (e.g. `/s/{shortId}/wiki/{pageId}`) so this component stays
+ * framework-neutral.
+ */
+ buildHref?: (source: SourceReference) => string;
}
-export function SourceCitations({ toolCalls, repoId }: SourceCitationsProps) {
+const defaultBuildHref = (s: SourceReference, repoId: string) =>
+ `/repos/${repoId}/wiki/${encodeURIComponent(s.pageId)}`;
+
+export function SourceCitations({
+ toolCalls,
+ repoId,
+ buildHref,
+}: SourceCitationsProps) {
const sources = useMemo(
() => extractSources(toolCalls, repoId),
[toolCalls, repoId],
@@ -186,9 +177,9 @@ export function SourceCitations({ toolCalls, repoId }: SourceCitationsProps) {
</p>
<div className="flex flex-wrap gap-1.5">
{sources.map((source, idx) => (
- <Link
+ <a
key={source.id}
- href={`/repos/${repoId}/wiki/${encodeURIComponent(source.pageId)}`}
+ href={buildHref ? buildHref(source) : defaultBuildHref(source, repoId)}
className="group inline-flex items-center gap-1.5 rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] px-2 py-1 text-[10px] text-[var(--color-text-secondary)] hover:border-[var(--color-accent-primary)] hover:text-[var(--color-accent-primary)] hover:bg-[var(--color-accent-muted)] transition-all"
>
<span className="flex items-center justify-center h-3.5 w-3.5 rounded-sm bg-[var(--color-bg-overlay)] text-[9px] font-bold text-[var(--color-text-tertiary)] group-hover:bg-[var(--color-accent-primary)] group-hover:text-white shrink-0 transition-colors">
@@ -202,7 +193,7 @@ export function SourceCitations({ toolCalls, repoId }: SourceCitationsProps) {
</span>
)}
<ArrowUpRight className="h-2.5 w-2.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0" />
- </Link>
+ </a>
))}
</div>
</div>
diff --git a/packages/web/src/components/chat/tool-call-block.tsx b/packages/ui/src/chat/tool-call-block.tsx
similarity index 95%
rename from packages/web/src/components/chat/tool-call-block.tsx
rename to packages/ui/src/chat/tool-call-block.tsx
index 181ddbe00..07c512ea3 100644
--- a/packages/web/src/components/chat/tool-call-block.tsx
+++ b/packages/ui/src/chat/tool-call-block.tsx
@@ -2,8 +2,7 @@
import { useState } from "react";
import { ChevronDown, ChevronRight, Loader2, CheckCircle2, ExternalLink } from "lucide-react";
-import { cn } from "@/lib/utils/cn";
-import type { ChatToolCall } from "@/lib/hooks/use-chat";
+import type { ChatUIToolCall } from "@repowise-dev/types/chat";
const TOOL_LABELS: Record<string, string> = {
get_overview: "Getting codebase overview",
@@ -17,7 +16,7 @@ const TOOL_LABELS: Record<string, string> = {
};
interface ToolCallBlockProps {
- toolCall: ChatToolCall;
+ toolCall: ChatUIToolCall;
onViewArtifact?: () => void;
}
@@ -42,7 +41,7 @@ export function ToolCallBlock({ toolCall, onViewArtifact }: ToolCallBlockProps)
</span>
{toolCall.summary && !isRunning && (
<span className="text-[var(--color-text-tertiary)] truncate ml-1">
- — {toolCall.summary}
+ — {toolCall.summary}
</span>
)}
<span className="ml-auto flex items-center gap-1">
diff --git a/packages/web/src/components/coverage/coverage-donut.tsx b/packages/ui/src/coverage/coverage-donut.tsx
similarity index 80%
rename from packages/web/src/components/coverage/coverage-donut.tsx
rename to packages/ui/src/coverage/coverage-donut.tsx
index 5a1dd8445..c773fa6a3 100644
--- a/packages/web/src/components/coverage/coverage-donut.tsx
+++ b/packages/ui/src/coverage/coverage-donut.tsx
@@ -8,8 +8,12 @@ interface CoverageDonutProps {
outdated: number;
}
-const COLORS = ["#22c55e", "#eab308", "#ef4444"];
-const LABELS = ["Fresh", "Stale", "Outdated"];
+const COLORS: Record<string, string> = {
+ Fresh: "#22c55e",
+ Stale: "#eab308",
+ Outdated: "#ef4444",
+};
+const FALLBACK_COLOR = "#22c55e";
export function CoverageDonut({ fresh, stale, outdated }: CoverageDonutProps) {
const total = fresh + stale + outdated;
@@ -39,7 +43,7 @@ export function CoverageDonut({ fresh, stale, outdated }: CoverageDonutProps) {
{data.map((entry) => (
<Cell
key={entry.name}
- fill={COLORS[LABELS.indexOf(entry.name)]}
+ fill={COLORS[entry.name] ?? FALLBACK_COLOR}
strokeWidth={0}
/>
))}
@@ -52,9 +56,12 @@ export function CoverageDonut({ fresh, stale, outdated }: CoverageDonutProps) {
fontSize: "12px",
color: "var(--color-text-primary)",
}}
- formatter={(value: number) => [
- `${value} pages (${total > 0 ? Math.round((value / total) * 100) : 0}%)`,
- ]}
+ formatter={(value) => {
+ const n = typeof value === "number" ? value : 0;
+ return [
+ `${n} pages (${total > 0 ? Math.round((n / total) * 100) : 0}%)`,
+ ];
+ }}
/>
</PieChart>
</ResponsiveContainer>
diff --git a/packages/web/src/components/coverage/freshness-table.tsx b/packages/ui/src/coverage/freshness-table.tsx
similarity index 76%
rename from packages/web/src/components/coverage/freshness-table.tsx
rename to packages/ui/src/coverage/freshness-table.tsx
index 62efc5de9..771400456 100644
--- a/packages/web/src/components/coverage/freshness-table.tsx
+++ b/packages/ui/src/coverage/freshness-table.tsx
@@ -1,32 +1,47 @@
"use client";
import { useState } from "react";
-import { Button } from "@/components/ui/button";
-import { Badge } from "@/components/ui/badge";
-import { EmptyState } from "@/components/shared/empty-state";
-import { regeneratePage } from "@/lib/api/pages";
-import { statusBadgeClasses, statusLabel } from "@/lib/utils/confidence";
-import { truncatePath, formatConfidence, formatRelativeTime } from "@/lib/utils/format";
-import { cn } from "@/lib/utils/cn";
-import type { PageResponse } from "@/lib/api/types";
-import type { FreshnessStatus } from "@/lib/utils/confidence";
+import { Button } from "../ui/button";
+import { EmptyState } from "../shared/empty-state";
+import { cn } from "../lib/cn";
+import {
+ statusBadgeClasses,
+ statusLabel,
+ type FreshnessStatus,
+} from "../lib/confidence";
+import {
+ formatConfidence,
+ formatRelativeTime,
+} from "../lib/format";
+import type { DocPage } from "@repowise-dev/types/docs";
-type Filter = "all" | FreshnessStatus;
+type Filter = "all" | "fresh" | "stale" | "outdated";
-interface FreshnessTableProps {
- pages: PageResponse[];
+export interface FreshnessTableProps {
+ /** Pages to render. Caller is responsible for fetching. */
+ pages: DocPage[];
+ /**
+ * Invoked when the user clicks "Regenerate" on a row. Caller wires this
+ * to whichever API client is appropriate; the table only manages the
+ * per-row pending UI state. Omit to hide the regenerate button.
+ */
+ onRegenerate?: (pageId: string) => Promise<void>;
}
-export function FreshnessTable({ pages }: FreshnessTableProps) {
+export function FreshnessTable({ pages, onRegenerate }: FreshnessTableProps) {
const [filter, setFilter] = useState<Filter>("all");
const [regenerating, setRegenerating] = useState<Set<string>>(new Set());
- const filtered = filter === "all" ? pages : pages.filter((p) => p.freshness_status === filter);
+ const filtered =
+ filter === "all"
+ ? pages
+ : pages.filter((p) => p.freshness_status === filter);
const handleRegenerate = async (pageId: string) => {
+ if (!onRegenerate) return;
setRegenerating((prev) => new Set(prev).add(pageId));
try {
- await regeneratePage(pageId);
+ await onRegenerate(pageId);
} finally {
setRegenerating((prev) => {
const next = new Set(prev);
@@ -38,10 +53,12 @@ export function FreshnessTable({ pages }: FreshnessTableProps) {
return (
<div className="space-y-4">
- {/* Filter tabs */}
<div role="tablist" aria-label="Freshness filter" className="flex items-center gap-1">
{(["all", "fresh", "stale", "outdated"] as Filter[]).map((f) => {
- const count = f === "all" ? pages.length : pages.filter((p) => p.freshness_status === f).length;
+ const count =
+ f === "all"
+ ? pages.length
+ : pages.filter((p) => p.freshness_status === f).length;
return (
<button
key={f}
@@ -135,15 +152,17 @@ export function FreshnessTable({ pages }: FreshnessTableProps) {
{formatRelativeTime(page.updated_at)}
</td>
<td className="px-4 py-2.5">
- <Button
- size="sm"
- variant="ghost"
- disabled={regenerating.has(page.id)}
- onClick={() => handleRegenerate(page.id)}
- className="h-6 px-2 text-xs"
- >
- {regenerating.has(page.id) ? "…" : "Regenerate"}
- </Button>
+ {onRegenerate && (
+ <Button
+ size="sm"
+ variant="ghost"
+ disabled={regenerating.has(page.id)}
+ onClick={() => handleRegenerate(page.id)}
+ className="h-6 px-2 text-xs"
+ >
+ {regenerating.has(page.id) ? "…" : "Regenerate"}
+ </Button>
+ )}
</td>
</tr>
);
diff --git a/packages/ui/src/coverage/index.ts b/packages/ui/src/coverage/index.ts
new file mode 100644
index 000000000..aeafe718c
--- /dev/null
+++ b/packages/ui/src/coverage/index.ts
@@ -0,0 +1,2 @@
+export * from "./coverage-donut.js";
+export * from "./freshness-table.js";
diff --git a/packages/web/src/components/dashboard/active-job-banner.tsx b/packages/ui/src/dashboard/active-job-banner.tsx
similarity index 57%
rename from packages/web/src/components/dashboard/active-job-banner.tsx
rename to packages/ui/src/dashboard/active-job-banner.tsx
index 474d064a4..48edcbdf8 100644
--- a/packages/web/src/components/dashboard/active-job-banner.tsx
+++ b/packages/ui/src/dashboard/active-job-banner.tsx
@@ -1,86 +1,73 @@
"use client";
-import useSWR from "swr";
-import Link from "next/link";
import { Loader2, CheckCircle, XCircle, ExternalLink } from "lucide-react";
-import { Progress } from "@/components/ui/progress";
-import { listJobs } from "@/lib/api/jobs";
-import { formatNumber, formatRelativeTime } from "@/lib/utils/format";
-import type { JobResponse } from "@/lib/api/types";
+import { Progress } from "../ui/progress";
+import { formatNumber, formatRelativeTime } from "../lib/format";
+import type { Job } from "@repowise-dev/types/jobs";
-interface ActiveJobBannerProps {
- repoId: string;
+export interface ActiveJobBannerProps {
+ /**
+ * Latest job for the repo, or `null` if there is none. Wrappers are
+ * responsible for polling cadence + freshness window — the shell only
+ * decides what to render based on the snapshot it is given.
+ */
+ job: Job | null;
+ /**
+ * Optional href for the "Details" link rendered alongside completed jobs.
+ * Hosted passes `/s/{shortId}/overview`, OSS web `/repos/{repoId}/overview`.
+ * If omitted, the link is suppressed.
+ */
+ detailsHref?: string;
}
-export function ActiveJobBanner({ repoId }: ActiveJobBannerProps) {
- const { data: jobs } = useSWR<JobResponse[]>(
- `/api/jobs?repo_id=${repoId}&limit=1`,
- () => listJobs({ repo_id: repoId, limit: 1 }),
- { refreshInterval: (data) => {
- const j = data?.[0];
- if (j?.status === "running") return 5000; // poll faster when running
- return 30000; // slow poll otherwise
- }},
- );
+const PHASE_LABELS: Record<number, string> = {
+ 0: "Indexing",
+ 1: "Analysing",
+ 2: "Generating docs",
+};
- const job = jobs?.[0];
+export function ActiveJobBanner({ job, detailsHref }: ActiveJobBannerProps) {
if (!job) return null;
+ if (job.status === "pending") return null;
const isRunning = job.status === "running";
const isDone = job.status === "completed";
const isFailed = job.status === "failed";
- // Don't show pending jobs (they may never start) or old terminal states
- if (job.status === "pending") return null;
- if (!isRunning) {
- const finishedAt = job.finished_at ? new Date(job.finished_at).getTime() : 0;
- const age = Date.now() - finishedAt;
- if (age > 60_000) return null;
- }
-
- const progress = job.total_pages > 0
- ? Math.min(100, Math.round((job.completed_pages / job.total_pages) * 100))
- : 0;
+ const progress =
+ job.total_pages > 0
+ ? Math.min(100, Math.round((job.completed_pages / job.total_pages) * 100))
+ : 0;
const mode = (job.config?.mode as string) ?? "sync";
const label = mode === "full_resync" ? "Full Re-index" : "Sync";
-
- const PHASE_LABELS: Record<number, string> = {
- 0: "Indexing",
- 1: "Analysing",
- 2: "Generating docs",
- };
const phaseLabel = PHASE_LABELS[job.current_level ?? 0] ?? "Processing";
return (
<div className="px-4 py-2 border-b border-[var(--color-border-default)] bg-[var(--color-bg-inset)]">
<div className="flex items-center gap-3">
- {/* Status icon */}
{isRunning && <Loader2 className="h-3.5 w-3.5 animate-spin text-[var(--color-accent-primary)] shrink-0" />}
{isDone && <CheckCircle className="h-3.5 w-3.5 text-[var(--color-success)] shrink-0" />}
{isFailed && <XCircle className="h-3.5 w-3.5 text-[var(--color-error)] shrink-0" />}
- {/* Label */}
<span className="text-xs text-[var(--color-text-secondary)]">
{isRunning && `${label} · ${phaseLabel}…`}
{isDone && `${label} complete`}
{isFailed && `${label} failed`}
</span>
- {/* Progress bar (running only) */}
{isRunning && (
<div className="flex-1 max-w-[200px]">
<Progress value={progress} className="h-1.5" />
</div>
)}
- {/* Stats */}
<span className="text-[10px] text-[var(--color-text-tertiary)] tabular-nums">
{isRunning && job.total_pages > 0 && `${formatNumber(job.completed_pages)}/${formatNumber(job.total_pages)}`}
{isDone && (
<>
{formatNumber(job.completed_pages)} pages
- {job.config?.total_input_tokens && (
+ {job.config?.total_input_tokens != null && (
<> · {formatNumber(job.config.total_input_tokens as number)} tokens</>
)}
{job.finished_at && <> · {formatRelativeTime(job.finished_at)}</>}
@@ -89,14 +76,13 @@ export function ActiveJobBanner({ repoId }: ActiveJobBannerProps) {
{isFailed && (job.error_message ?? "Unknown error")}
</span>
- {/* Link to overview for details */}
- {isDone && job.completed_pages > 0 && (
- <Link
- href={`/repos/${repoId}/overview`}
+ {isDone && job.completed_pages > 0 && detailsHref && (
+ <a
+ href={detailsHref}
className="text-[10px] text-[var(--color-accent-primary)] hover:underline flex items-center gap-0.5 shrink-0"
>
Details <ExternalLink className="h-2.5 w-2.5" />
- </Link>
+ </a>
)}
</div>
</div>
diff --git a/packages/web/src/components/dashboard/attention-panel.tsx b/packages/ui/src/dashboard/attention-panel.tsx
similarity index 89%
rename from packages/web/src/components/dashboard/attention-panel.tsx
rename to packages/ui/src/dashboard/attention-panel.tsx
index 8151693e9..570f359ec 100644
--- a/packages/web/src/components/dashboard/attention-panel.tsx
+++ b/packages/ui/src/dashboard/attention-panel.tsx
@@ -5,11 +5,24 @@ import {
FileWarning,
Lightbulb,
} from "lucide-react";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
-import { Badge } from "@/components/ui/badge";
+import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
+import { Badge } from "../ui/badge";
-import type { AttentionItem } from "@/lib/utils/health-score";
-export type { AttentionItem };
+export type AttentionItemType =
+ | "stale_decision"
+ | "knowledge_silo"
+ | "ungoverned_hotspot"
+ | "dead_code"
+ | "proposed_decision";
+
+export interface AttentionItem {
+ id: string;
+ type: AttentionItemType;
+ title: string;
+ description: string;
+ severity: "high" | "medium" | "low";
+ href?: string;
+}
const ICON_MAP = {
stale_decision: AlertTriangle,
@@ -38,6 +51,22 @@ interface AttentionPanelProps {
repoId: string;
}
+function getDefaultHref(item: AttentionItem, repoId: string): string {
+ switch (item.type) {
+ case "stale_decision":
+ case "proposed_decision":
+ return `/repos/${repoId}/decisions`;
+ case "knowledge_silo":
+ return `/repos/${repoId}/ownership`;
+ case "ungoverned_hotspot":
+ return `/repos/${repoId}/hotspots`;
+ case "dead_code":
+ return `/repos/${repoId}/dead-code`;
+ default:
+ return `/repos/${repoId}`;
+ }
+}
+
export function AttentionPanel({ items, repoId }: AttentionPanelProps) {
if (items.length === 0) {
return (
@@ -104,20 +133,3 @@ export function AttentionPanel({ items, repoId }: AttentionPanelProps) {
</Card>
);
}
-
-function getDefaultHref(item: AttentionItem, repoId: string): string {
- switch (item.type) {
- case "stale_decision":
- case "proposed_decision":
- return `/repos/${repoId}/decisions`;
- case "knowledge_silo":
- return `/repos/${repoId}/ownership`;
- case "ungoverned_hotspot":
- return `/repos/${repoId}/hotspots`;
- case "dead_code":
- return `/repos/${repoId}/dead-code`;
- default:
- return `/repos/${repoId}`;
- }
-}
-
diff --git a/packages/ui/src/dashboard/community-summary-grid.tsx b/packages/ui/src/dashboard/community-summary-grid.tsx
new file mode 100644
index 000000000..53256af5c
--- /dev/null
+++ b/packages/ui/src/dashboard/community-summary-grid.tsx
@@ -0,0 +1,201 @@
+"use client";
+
+import { useState } from "react";
+import { Network, ChevronRight, ChevronDown, ArrowRight, X } from "lucide-react";
+import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
+import { Badge } from "../ui/badge";
+import { ScrollArea } from "../ui/scroll-area";
+import { Skeleton } from "../ui/skeleton";
+import { truncatePath } from "../lib/format";
+import { cn } from "../lib/cn";
+import type {
+ CommunityDetail,
+ CommunitySummaryItem,
+} from "@repowise-dev/types/graph";
+
+const COMMUNITY_COLORS = [
+ "bg-indigo-400", "bg-pink-400", "bg-emerald-400", "bg-amber-400",
+ "bg-blue-400", "bg-purple-400", "bg-rose-400", "bg-teal-400",
+ "bg-orange-400", "bg-cyan-400",
+];
+
+interface DetailPanelProps {
+ detail: CommunityDetail | null;
+ isLoading: boolean;
+ onClose: () => void;
+}
+
+function DetailPanel({ detail, isLoading, onClose }: DetailPanelProps) {
+ if (isLoading) {
+ return (
+ <div className="p-4 space-y-2">
+ <Skeleton className="h-4 w-32" />
+ <Skeleton className="h-3 w-full" />
+ <Skeleton className="h-3 w-3/4" />
+ </div>
+ );
+ }
+ if (!detail) return null;
+
+ return (
+ <div className="border-t border-[var(--color-border-default)] bg-[var(--color-bg-elevated)]/50">
+ <div className="flex items-center justify-between px-4 py-2 border-b border-[var(--color-border-default)]">
+ <span className="text-xs font-medium text-[var(--color-text-primary)]">
+ {detail.label} &middot; {detail.member_count} files &middot; cohesion{" "}
+ {(detail.cohesion * 100).toFixed(0)}%
+ </span>
+ <button
+ onClick={onClose}
+ className="text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)]"
+ >
+ <X className="h-3.5 w-3.5" />
+ </button>
+ </div>
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-4 p-4">
+ <div>
+ <p className="text-[10px] font-medium text-[var(--color-text-tertiary)] uppercase tracking-wider mb-2">
+ Members ({detail.member_count})
+ </p>
+ <ScrollArea className="max-h-[200px]">
+ <div className="space-y-1">
+ {detail.members.slice(0, 20).map((m) => (
+ <div key={m.path} className="flex items-center justify-between gap-2 py-0.5">
+ <span
+ className="text-[11px] font-mono text-[var(--color-text-secondary)] truncate"
+ title={m.path}
+ >
+ {truncatePath(m.path)}
+ </span>
+ <div className="flex items-center gap-1 shrink-0">
+ {m.is_entry_point && (
+ <Badge variant="accent" className="text-[8px] h-3.5">
+ EP
+ </Badge>
+ )}
+ <span className="text-[9px] font-mono text-[var(--color-text-tertiary)] tabular-nums">
+ {m.pagerank.toFixed(4)}
+ </span>
+ </div>
+ </div>
+ ))}
+ {detail.member_count > 20 && (
+ <p className="text-[10px] text-[var(--color-text-tertiary)]">
+ +{detail.member_count - 20} more
+ </p>
+ )}
+ </div>
+ </ScrollArea>
+ </div>
+
+ {detail.neighboring_communities.length > 0 && (
+ <div>
+ <p className="text-[10px] font-medium text-[var(--color-text-tertiary)] uppercase tracking-wider mb-2">
+ Connected Communities
+ </p>
+ <div className="space-y-1.5">
+ {detail.neighboring_communities.map((n) => (
+ <div key={n.community_id} className="flex items-center justify-between gap-2">
+ <div className="flex items-center gap-1.5 min-w-0">
+ <ArrowRight className="h-2.5 w-2.5 shrink-0 text-[var(--color-text-tertiary)]" />
+ <span className="text-[11px] text-[var(--color-text-secondary)] truncate">
+ {n.label}
+ </span>
+ </div>
+ <Badge variant="outline" className="text-[9px] h-4 shrink-0">
+ {n.cross_edge_count} edges
+ </Badge>
+ </div>
+ ))}
+ </div>
+ </div>
+ )}
+ </div>
+ </div>
+ );
+}
+
+export interface CommunitySummaryGridProps {
+ communities: CommunitySummaryItem[];
+ /** Already-resolved details keyed by community_id. The wrapper fetches in
+ * parallel (or lazily) and forwards. Missing entries render skeletons. */
+ details?: Record<number, CommunityDetail | null>;
+ /** Truthy while a detail fetch is in flight for the given community_id. */
+ loadingDetailId?: number | null;
+ /** Called when a row is expanded; the wrapper kicks off the detail fetch. */
+ onExpand?: (communityId: number) => void;
+}
+
+export function CommunitySummaryGrid({
+ communities,
+ details = {},
+ loadingDetailId = null,
+ onExpand,
+}: CommunitySummaryGridProps) {
+ const [expandedId, setExpandedId] = useState<number | null>(null);
+ if (communities.length === 0) return null;
+
+ return (
+ <Card>
+ <CardHeader className="pb-2">
+ <CardTitle className="text-sm font-medium flex items-center gap-2">
+ <Network className="h-4 w-4" />
+ Architecture Communities ({communities.length})
+ </CardTitle>
+ </CardHeader>
+ <CardContent className="p-0">
+ <div className="divide-y divide-[var(--color-border-default)]">
+ {communities.slice(0, 12).map((c, i) => {
+ const isExpanded = expandedId === c.community_id;
+ return (
+ <div key={c.community_id}>
+ <button
+ onClick={() => {
+ const next = isExpanded ? null : c.community_id;
+ setExpandedId(next);
+ if (next != null) onExpand?.(next);
+ }}
+ className={cn(
+ "flex items-center gap-3 w-full px-4 py-2.5 text-left hover:bg-[var(--color-bg-elevated)] transition-colors",
+ isExpanded && "bg-[var(--color-bg-elevated)]",
+ )}
+ >
+ <span
+ className={cn(
+ "w-2.5 h-2.5 rounded-full shrink-0",
+ COMMUNITY_COLORS[i % COMMUNITY_COLORS.length],
+ )}
+ />
+ <span className="text-xs font-medium text-[var(--color-text-primary)] truncate min-w-0 flex-1">
+ {c.label}
+ </span>
+ <span className="text-[10px] text-[var(--color-text-tertiary)] tabular-nums shrink-0">
+ {c.member_count} files
+ </span>
+ <div className="w-12 h-1.5 rounded-full bg-[var(--color-bg-elevated)] overflow-hidden shrink-0">
+ <div
+ className="h-full rounded-full bg-[var(--color-accent)]"
+ style={{ width: `${Math.round(c.cohesion * 100)}%` }}
+ />
+ </div>
+ {isExpanded ? (
+ <ChevronDown className="h-3 w-3 shrink-0 text-[var(--color-text-tertiary)]" />
+ ) : (
+ <ChevronRight className="h-3 w-3 shrink-0 text-[var(--color-text-tertiary)]" />
+ )}
+ </button>
+
+ {isExpanded && (
+ <DetailPanel
+ detail={details[c.community_id] ?? null}
+ isLoading={loadingDetailId === c.community_id && !details[c.community_id]}
+ onClose={() => setExpandedId(null)}
+ />
+ )}
+ </div>
+ );
+ })}
+ </div>
+ </CardContent>
+ </Card>
+ );
+}
diff --git a/packages/web/src/components/dashboard/decisions-timeline.tsx b/packages/ui/src/dashboard/decisions-timeline.tsx
similarity index 85%
rename from packages/web/src/components/dashboard/decisions-timeline.tsx
rename to packages/ui/src/dashboard/decisions-timeline.tsx
index a1d4a7f81..20e804c62 100644
--- a/packages/web/src/components/dashboard/decisions-timeline.tsx
+++ b/packages/ui/src/dashboard/decisions-timeline.tsx
@@ -1,12 +1,11 @@
-import Link from "next/link";
import { Landmark } from "lucide-react";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
-import { Badge } from "@/components/ui/badge";
-import type { DecisionRecordResponse } from "@/lib/api/types";
-import { formatRelativeTime } from "@/lib/utils/format";
+import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
+import { Badge } from "../ui/badge";
+import { formatRelativeTime } from "../lib/format";
+import type { DecisionRecord } from "@repowise-dev/types/decisions";
interface DecisionsTimelineProps {
- decisions: DecisionRecordResponse[];
+ decisions: DecisionRecord[];
repoId: string;
}
@@ -51,29 +50,27 @@ export function DecisionsTimeline({ decisions, repoId }: DecisionsTimelineProps)
<Landmark className="h-4 w-4 text-[var(--color-text-secondary)]" />
Recent Decisions
</span>
- <Link
+ <a
href={`/repos/${repoId}/decisions`}
className="text-[10px] text-[var(--color-accent-primary)] hover:underline font-normal"
>
View all
- </Link>
+ </a>
</CardTitle>
</CardHeader>
<CardContent className="pt-0">
<div className="relative">
- {/* Timeline line */}
<div className="absolute left-[5px] top-1 bottom-1 w-px bg-[var(--color-border-default)]" />
<div className="space-y-3">
{recent.map((d) => (
- <Link
+ <a
key={d.id}
href={`/repos/${repoId}/decisions/${d.id}`}
className="flex items-start gap-3 pl-0 group relative"
>
- {/* Dot */}
<span
- className={`h-[11px] w-[11px] rounded-full shrink-0 mt-0.5 ring-2 ring-[var(--color-bg-surface)] relative z-10 ${STATUS_COLORS[d.status] ?? STATUS_COLORS.active}`}
+ className={`h-[11px] w-[11px] rounded-full shrink-0 mt-0.5 ring-2 ring-[var(--color-bg-surface)] relative z-10 ${STATUS_COLORS[d.status] ?? STATUS_COLORS["active"]}`}
/>
<div className="min-w-0 flex-1">
<div className="flex items-center gap-2">
@@ -89,10 +86,10 @@ export function DecisionsTimeline({ decisions, repoId }: DecisionsTimelineProps)
</div>
<span className="text-[10px] text-[var(--color-text-tertiary)]">
{formatRelativeTime(d.created_at)}
- {d.source && ` · ${d.source.replace("_", " ")}`}
+ {d.source && ` · ${d.source.replace("_", " ")}`}
</span>
</div>
- </Link>
+ </a>
))}
</div>
</div>
diff --git a/packages/web/src/components/dashboard/dependency-heatmap.tsx b/packages/ui/src/dashboard/dependency-heatmap.tsx
similarity index 84%
rename from packages/web/src/components/dashboard/dependency-heatmap.tsx
rename to packages/ui/src/dashboard/dependency-heatmap.tsx
index ae94793d5..7d1718bb7 100644
--- a/packages/web/src/components/dashboard/dependency-heatmap.tsx
+++ b/packages/ui/src/dashboard/dependency-heatmap.tsx
@@ -1,10 +1,10 @@
"use client";
import { useMemo, useRef, useEffect } from "react";
-import type { ModuleGraphResponse } from "@/lib/api/types";
+import type { ModuleGraph } from "@repowise-dev/types/graph";
interface DependencyHeatmapProps {
- moduleGraph: ModuleGraphResponse;
+ moduleGraph: ModuleGraph;
}
function heatColor(count: number, max: number): string {
@@ -20,6 +20,7 @@ export function DependencyHeatmap({ moduleGraph }: DependencyHeatmapProps) {
const { modules, matrix, maxCount } = useMemo(() => {
const mods = moduleGraph.nodes
+ .slice()
.sort((a, b) => b.avg_pagerank - a.avg_pagerank)
.slice(0, 20)
.map((m) => m.module_id);
@@ -28,7 +29,7 @@ export function DependencyHeatmap({ moduleGraph }: DependencyHeatmapProps) {
mods.forEach((m, i) => modIdx.set(m, i));
const mat: number[][] = Array.from({ length: mods.length }, () =>
- new Array(mods.length).fill(0)
+ new Array<number>(mods.length).fill(0),
);
let max = 0;
@@ -36,8 +37,10 @@ export function DependencyHeatmap({ moduleGraph }: DependencyHeatmapProps) {
const si = modIdx.get(e.source);
const ti = modIdx.get(e.target);
if (si !== undefined && ti !== undefined) {
- mat[si][ti] += e.edge_count;
- if (mat[si][ti] > max) max = mat[si][ti];
+ const row = mat[si];
+ if (!row) continue;
+ row[ti] = (row[ti] ?? 0) + e.edge_count;
+ if ((row[ti] ?? 0) > max) max = row[ti] ?? 0;
}
}
@@ -64,16 +67,16 @@ export function DependencyHeatmap({ moduleGraph }: DependencyHeatmapProps) {
if (!ctx) return;
ctx.scale(2, 2);
- // Clear
ctx.clearRect(0, 0, totalWidth, totalHeight);
- // Draw labels (top)
ctx.save();
ctx.font = "9px var(--font-geist-mono, monospace)";
ctx.fillStyle = "var(--color-text-tertiary)";
ctx.textAlign = "right";
for (let i = 0; i < size; i++) {
- const label = modules[i].split("/").pop() ?? modules[i];
+ const mod = modules[i];
+ if (!mod) continue;
+ const label = mod.split("/").pop() ?? mod;
const x = labelWidth + i * (cellSize + padding) + cellSize / 2;
ctx.save();
ctx.translate(x, labelWidth - 4);
@@ -82,20 +85,22 @@ export function DependencyHeatmap({ moduleGraph }: DependencyHeatmapProps) {
ctx.restore();
}
- // Draw labels (left)
ctx.textAlign = "right";
ctx.textBaseline = "middle";
for (let i = 0; i < size; i++) {
- const label = modules[i].split("/").pop() ?? modules[i];
+ const mod = modules[i];
+ if (!mod) continue;
+ const label = mod.split("/").pop() ?? mod;
const y = labelWidth + i * (cellSize + padding) + cellSize / 2;
ctx.fillText(label.slice(0, 12), labelWidth - 6, y);
}
ctx.restore();
- // Draw cells
for (let r = 0; r < size; r++) {
+ const row = matrix[r];
+ if (!row) continue;
for (let c = 0; c < size; c++) {
- const count = matrix[r][c];
+ const count = row[c] ?? 0;
const x = labelWidth + c * (cellSize + padding);
const y = labelWidth + r * (cellSize + padding);
diff --git a/packages/web/src/components/dashboard/execution-flows-panel.tsx b/packages/ui/src/dashboard/execution-flows-panel.tsx
similarity index 91%
rename from packages/web/src/components/dashboard/execution-flows-panel.tsx
rename to packages/ui/src/dashboard/execution-flows-panel.tsx
index 4a96d29cf..efcfdc1bf 100644
--- a/packages/web/src/components/dashboard/execution-flows-panel.tsx
+++ b/packages/ui/src/dashboard/execution-flows-panel.tsx
@@ -2,10 +2,10 @@
import { useState } from "react";
import { ChevronRight, ChevronDown } from "lucide-react";
-import { Badge } from "@/components/ui/badge";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
-import { cn } from "@/lib/utils/cn";
-import type { ExecutionFlowEntry } from "@/lib/api/types";
+import { Badge } from "../ui/badge";
+import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
+import { cn } from "../lib/cn";
+import type { ExecutionFlowEntry } from "@repowise-dev/types/graph";
interface ExecutionFlowsPanelProps {
flows: ExecutionFlowEntry[];
@@ -84,7 +84,7 @@ function FlowRow({ flow }: { flow: ExecutionFlowEntry }) {
);
}
-export function ExecutionFlowsPanel({ flows, repoId }: ExecutionFlowsPanelProps) {
+export function ExecutionFlowsPanel({ flows, repoId: _repoId }: ExecutionFlowsPanelProps) {
if (flows.length === 0) return null;
return (
diff --git a/packages/web/src/components/dashboard/health-score-ring.tsx b/packages/ui/src/dashboard/health-score-ring.tsx
similarity index 94%
rename from packages/web/src/components/dashboard/health-score-ring.tsx
rename to packages/ui/src/dashboard/health-score-ring.tsx
index b78530615..9fa3b4a97 100644
--- a/packages/web/src/components/dashboard/health-score-ring.tsx
+++ b/packages/ui/src/dashboard/health-score-ring.tsx
@@ -4,7 +4,7 @@ import { useEffect, useState } from "react";
import { motion } from "framer-motion";
interface HealthScoreRingProps {
- score: number; // 0-100
+ score: number;
size?: number;
}
@@ -35,7 +35,6 @@ export function HealthScoreRing({ score, size = 160 }: HealthScoreRingProps) {
return (
<div className="relative flex items-center justify-center" style={{ width: size, height: size }}>
<svg width={size} height={size} className="-rotate-90">
- {/* Background track */}
<circle
cx={size / 2}
cy={size / 2}
@@ -44,7 +43,6 @@ export function HealthScoreRing({ score, size = 160 }: HealthScoreRingProps) {
stroke="var(--color-border-default)"
strokeWidth={strokeWidth}
/>
- {/* Animated progress arc */}
<motion.circle
cx={size / 2}
cy={size / 2}
@@ -59,7 +57,6 @@ export function HealthScoreRing({ score, size = 160 }: HealthScoreRingProps) {
transition={{ duration: 1.2, ease: "easeOut" }}
/>
</svg>
- {/* Center text */}
<div className="absolute inset-0 flex flex-col items-center justify-center">
<motion.span
className="text-3xl font-bold tabular-nums"
@@ -77,4 +74,3 @@ export function HealthScoreRing({ score, size = 160 }: HealthScoreRingProps) {
</div>
);
}
-
diff --git a/packages/web/src/components/dashboard/hotspots-mini.tsx b/packages/ui/src/dashboard/hotspots-mini.tsx
similarity index 87%
rename from packages/web/src/components/dashboard/hotspots-mini.tsx
rename to packages/ui/src/dashboard/hotspots-mini.tsx
index e41b4d26c..64a135957 100644
--- a/packages/web/src/components/dashboard/hotspots-mini.tsx
+++ b/packages/ui/src/dashboard/hotspots-mini.tsx
@@ -1,14 +1,19 @@
-import Link from "next/link";
import { Flame } from "lucide-react";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
-import type { HotspotResponse } from "@/lib/api/types";
-import { truncatePath } from "@/lib/utils/format";
+import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
+import { truncatePath } from "../lib/format";
+import type { Hotspot } from "@repowise-dev/types/git";
interface HotspotsMiniProps {
- hotspots: HotspotResponse[];
+ hotspots: Hotspot[];
repoId: string;
}
+function getChurnColor(percentile: number): string {
+ if (percentile >= 95) return "var(--color-error)";
+ if (percentile >= 80) return "var(--color-warning)";
+ return "var(--color-accent-primary)";
+}
+
export function HotspotsMini({ hotspots, repoId }: HotspotsMiniProps) {
const top = hotspots.slice(0, 5);
@@ -36,19 +41,18 @@ export function HotspotsMini({ hotspots, repoId }: HotspotsMiniProps) {
<Flame className="h-4 w-4 text-red-500" />
Top Hotspots
</span>
- <Link
+ <a
href={`/repos/${repoId}/hotspots`}
className="text-[10px] text-[var(--color-accent-primary)] hover:underline font-normal"
>
View all
- </Link>
+ </a>
</CardTitle>
</CardHeader>
<CardContent className="pt-0">
<div className="space-y-2">
{top.map((h) => (
<div key={h.file_path} className="flex items-center gap-3">
- {/* Churn bar */}
<div className="w-16 shrink-0">
<div className="h-1.5 rounded-full bg-[var(--color-bg-elevated)] overflow-hidden">
<div
@@ -60,13 +64,11 @@ export function HotspotsMini({ hotspots, repoId }: HotspotsMiniProps) {
/>
</div>
</div>
- {/* File info */}
<div className="min-w-0 flex-1">
<p className="text-[11px] font-mono text-[var(--color-text-primary)] truncate">
{truncatePath(h.file_path, 40)}
</p>
</div>
- {/* Stats */}
<div className="flex items-center gap-2 shrink-0 text-[10px] text-[var(--color-text-tertiary)] tabular-nums">
<span>{h.commit_count_90d}c/90d</span>
<span className="text-[var(--color-text-secondary)]">
@@ -80,9 +82,3 @@ export function HotspotsMini({ hotspots, repoId }: HotspotsMiniProps) {
</Card>
);
}
-
-function getChurnColor(percentile: number): string {
- if (percentile >= 95) return "var(--color-error)";
- if (percentile >= 80) return "var(--color-warning)";
- return "var(--color-accent-primary)";
-}
diff --git a/packages/ui/src/dashboard/index.ts b/packages/ui/src/dashboard/index.ts
new file mode 100644
index 000000000..770a84554
--- /dev/null
+++ b/packages/ui/src/dashboard/index.ts
@@ -0,0 +1,12 @@
+export * from "./attention-panel.js";
+export * from "./decisions-timeline.js";
+export * from "./dependency-heatmap.js";
+export * from "./execution-flows-panel.js";
+export * from "./health-score-ring.js";
+export * from "./hotspots-mini.js";
+export * from "./language-donut.js";
+export * from "./module-minimap.js";
+export * from "./ownership-treemap.js";
+export * from "./active-job-banner.js";
+export * from "./quick-actions.js";
+export * from "./community-summary-grid.js";
diff --git a/packages/web/src/components/dashboard/language-donut.tsx b/packages/ui/src/dashboard/language-donut.tsx
similarity index 92%
rename from packages/web/src/components/dashboard/language-donut.tsx
rename to packages/ui/src/dashboard/language-donut.tsx
index b77cddc17..327f4c867 100644
--- a/packages/web/src/components/dashboard/language-donut.tsx
+++ b/packages/ui/src/dashboard/language-donut.tsx
@@ -1,7 +1,7 @@
"use client";
import { PieChart, Pie, Cell, ResponsiveContainer, Tooltip } from "recharts";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
+import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
import { Code } from "lucide-react";
const LANG_COLORS: Record<string, string> = {
@@ -33,7 +33,6 @@ export function LanguageDonut({ distribution }: LanguageDonutProps) {
const total = entries.reduce((s, e) => s + e.value, 0);
if (total === 0) return null;
- // Show top 6, group rest as "other"
const shown = entries.slice(0, 6);
const otherValue = entries.slice(6).reduce((s, e) => s + e.value, 0);
if (otherValue > 0) shown.push({ name: "other", value: otherValue });
@@ -73,7 +72,10 @@ export function LanguageDonut({ distribution }: LanguageDonutProps) {
fontSize: 11,
color: "var(--color-text-primary)",
}}
- formatter={(value: number) => [`${value} files (${Math.round((value / total) * 100)}%)`, ""]}
+ formatter={(value) => {
+ const n = typeof value === "number" ? value : 0;
+ return [`${n} files (${Math.round((n / total) * 100)}%)`, ""];
+ }}
/>
</PieChart>
</ResponsiveContainer>
@@ -101,4 +103,3 @@ export function LanguageDonut({ distribution }: LanguageDonutProps) {
</Card>
);
}
-
diff --git a/packages/web/src/components/dashboard/module-minimap.tsx b/packages/ui/src/dashboard/module-minimap.tsx
similarity index 81%
rename from packages/web/src/components/dashboard/module-minimap.tsx
rename to packages/ui/src/dashboard/module-minimap.tsx
index 73996026b..e1fc3e395 100644
--- a/packages/web/src/components/dashboard/module-minimap.tsx
+++ b/packages/ui/src/dashboard/module-minimap.tsx
@@ -2,15 +2,14 @@
import { useRef, useEffect, useState, useCallback } from "react";
import * as d3Force from "d3-force";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
-import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
+import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
+import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../ui/tooltip";
import { Network } from "lucide-react";
-import Link from "next/link";
-import type { ModuleNodeResponse, ModuleEdgeResponse } from "@/lib/api/types";
+import type { ModuleNode, ModuleEdge } from "@repowise-dev/types/graph";
interface ModuleMinimapProps {
- nodes: ModuleNodeResponse[];
- edges: ModuleEdgeResponse[];
+ nodes: ModuleNode[];
+ edges: ModuleEdge[];
repoId: string;
}
@@ -38,7 +37,9 @@ export function ModuleMinimap({ nodes, edges, repoId }: ModuleMinimapProps) {
useEffect(() => {
if (!containerRef.current) return;
const observer = new ResizeObserver((es) => {
- const { width, height } = es[0].contentRect;
+ const first = es[0];
+ if (!first) return;
+ const { width, height } = first.contentRect;
setDimensions({ width, height: Math.max(height, 200) });
});
observer.observe(containerRef.current);
@@ -65,7 +66,7 @@ export function ModuleMinimap({ nodes, edges, repoId }: ModuleMinimapProps) {
.forceSimulation(sNodes)
.force(
"link",
- d3Force.forceLink<SimNode, SimLink>(sLinks as never[]).id((d: SimNode) => d.id).distance(60)
+ d3Force.forceLink<SimNode, SimLink>(sLinks as never[]).id((d: SimNode) => d.id).distance(60),
)
.force("charge", d3Force.forceManyBody().strength(-120))
.force("center", d3Force.forceCenter(dimensions.width / 2, dimensions.height / 2))
@@ -73,35 +74,33 @@ export function ModuleMinimap({ nodes, edges, repoId }: ModuleMinimapProps) {
.alpha(0.8)
.alphaDecay(0.05);
+ const resolveLink = (l: SimLink) => {
+ const source = sNodes.find(
+ (n) => n.id === (typeof l.source === "string" ? l.source : (l.source as SimNode).id),
+ );
+ const target = sNodes.find(
+ (n) => n.id === (typeof l.target === "string" ? l.target : (l.target as SimNode).id),
+ );
+ if (!source || !target) return null;
+ return { source, target, edgeCount: l.edgeCount };
+ };
+
sim.on("end", () => {
setSimNodes([...sNodes]);
- setSimLinks(
- sLinks.map((l) => ({
- source: sNodes.find((n) => n.id === (typeof l.source === "string" ? l.source : (l.source as SimNode).id))!,
- target: sNodes.find((n) => n.id === (typeof l.target === "string" ? l.target : (l.target as SimNode).id))!,
- edgeCount: l.edgeCount,
- }))
- );
+ setSimLinks(sLinks.map(resolveLink).filter((x): x is { source: SimNode; target: SimNode; edgeCount: number } => x !== null));
});
- // Run simulation synchronously for small graphs
sim.tick(150);
sim.stop();
setSimNodes([...sNodes]);
- setSimLinks(
- sLinks.map((l) => ({
- source: sNodes.find((n) => n.id === (typeof l.source === "string" ? l.source : (l.source as SimNode).id))!,
- target: sNodes.find((n) => n.id === (typeof l.target === "string" ? l.target : (l.target as SimNode).id))!,
- edgeCount: l.edgeCount,
- }))
- );
+ setSimLinks(sLinks.map(resolveLink).filter((x): x is { source: SimNode; target: SimNode; edgeCount: number } => x !== null));
return () => { sim.stop(); };
}, [nodes, edges, dimensions]);
const getNodeRadius = useCallback(
(n: SimNode) => Math.max(4, Math.min(16, Math.sqrt(n.fileCount) * 3)),
- []
+ [],
);
if (nodes.length === 0) return null;
@@ -116,12 +115,12 @@ export function ModuleMinimap({ nodes, edges, repoId }: ModuleMinimapProps) {
<Network className="h-4 w-4 text-[var(--color-text-secondary)]" />
Architecture
</span>
- <Link
+ <a
href={`/repos/${repoId}/graph`}
className="text-[10px] text-[var(--color-accent-primary)] hover:underline font-normal"
>
Full graph
- </Link>
+ </a>
</CardTitle>
</CardHeader>
<CardContent className="pt-0">
@@ -129,7 +128,6 @@ export function ModuleMinimap({ nodes, edges, repoId }: ModuleMinimapProps) {
{width > 0 && simNodes.length > 0 && (
<TooltipProvider delayDuration={100}>
<svg width={width} height={height}>
- {/* Edges */}
{simLinks.map((link, i) => (
<line
key={i}
@@ -149,7 +147,6 @@ export function ModuleMinimap({ nodes, edges, repoId }: ModuleMinimapProps) {
className="transition-opacity"
/>
))}
- {/* Nodes */}
{simNodes.map((node) => {
const r = getNodeRadius(node);
const isHovered = hoveredNode === node.id;
@@ -176,7 +173,7 @@ export function ModuleMinimap({ nodes, edges, repoId }: ModuleMinimapProps) {
<TooltipContent side="top" className="text-xs">
<p className="font-medium font-mono">{node.id}</p>
<p className="text-[var(--color-text-tertiary)]">
- {node.fileCount} files · {node.symbolCount} symbols · {Math.round(node.docCoverage)}% docs
+ {node.fileCount} files · {node.symbolCount} symbols · {Math.round(node.docCoverage)}% docs
</p>
</TooltipContent>
</Tooltip>
diff --git a/packages/web/src/components/dashboard/ownership-treemap.tsx b/packages/ui/src/dashboard/ownership-treemap.tsx
similarity index 91%
rename from packages/web/src/components/dashboard/ownership-treemap.tsx
rename to packages/ui/src/dashboard/ownership-treemap.tsx
index f134bf4e5..9a1b14928 100644
--- a/packages/web/src/components/dashboard/ownership-treemap.tsx
+++ b/packages/ui/src/dashboard/ownership-treemap.tsx
@@ -2,17 +2,17 @@
import { useRef, useEffect, useState } from "react";
import * as d3 from "d3-hierarchy";
-import type { OwnershipEntry } from "@/lib/api/types";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
-import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
+import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
+import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../ui/tooltip";
import { Users } from "lucide-react";
+import type { OwnershipEntry } from "@repowise-dev/types/git";
-// Owner color palette — muted, high contrast on dark
const OWNER_COLORS = [
"#3b82f6", "#8b5cf6", "#06b6d4", "#f59520", "#22c55e",
"#ec4899", "#eab308", "#ef4444", "#14b8a6", "#a855f7",
"#6366f1", "#f97316",
];
+const OWNER_FALLBACK = "#6b7280";
interface OwnershipTreemapProps {
entries: OwnershipEntry[];
@@ -34,7 +34,9 @@ export function OwnershipTreemap({ entries }: OwnershipTreemapProps) {
useEffect(() => {
if (!containerRef.current) return;
const observer = new ResizeObserver((es) => {
- const { width, height } = es[0].contentRect;
+ const first = es[0];
+ if (!first) return;
+ const { width, height } = first.contentRect;
setDimensions({ width, height: Math.max(height, 200) });
});
observer.observe(containerRef.current);
@@ -43,12 +45,10 @@ export function OwnershipTreemap({ entries }: OwnershipTreemapProps) {
if (entries.length === 0) return null;
- // Build unique owner → color map
const owners = [...new Set(entries.map((e) => e.primary_owner).filter(Boolean))] as string[];
const ownerColorMap = new Map<string, string>();
- owners.forEach((o, i) => ownerColorMap.set(o, OWNER_COLORS[i % OWNER_COLORS.length]));
+ owners.forEach((o, i) => ownerColorMap.set(o, OWNER_COLORS[i % OWNER_COLORS.length] ?? OWNER_FALLBACK));
- // Build hierarchy
const root = d3
.hierarchy<{ children: TreemapNode[] } | TreemapNode>({
children: entries.map((e) => ({
@@ -129,7 +129,7 @@ export function OwnershipTreemap({ entries }: OwnershipTreemapProps) {
className="text-[10px] fill-white pointer-events-none"
opacity={0.9}
>
- {d.name.length > w / 6 ? d.name.slice(0, Math.floor(w / 6)) + "…" : d.name}
+ {d.name.length > w / 6 ? d.name.slice(0, Math.floor(w / 6)) + "…" : d.name}
</text>
)}
<TooltipContent side="top" className="text-xs">
@@ -138,7 +138,7 @@ export function OwnershipTreemap({ entries }: OwnershipTreemapProps) {
Owner: {d.owner ?? "none"} ({d.ownerPct ? Math.round(d.ownerPct * 100) : 0}%)
</p>
<p className="text-[var(--color-text-tertiary)]">
- {d.value} files{d.isSilo ? " • Knowledge silo" : ""}
+ {d.value} files{d.isSilo ? " • Knowledge silo" : ""}
</p>
</TooltipContent>
</Tooltip>
@@ -147,7 +147,6 @@ export function OwnershipTreemap({ entries }: OwnershipTreemapProps) {
</svg>
</TooltipProvider>
</div>
- {/* Legend */}
<div className="flex flex-wrap gap-x-3 gap-y-1 mt-2">
{owners.slice(0, 6).map((owner) => (
<div key={owner} className="flex items-center gap-1.5 text-[10px] text-[var(--color-text-secondary)]">
diff --git a/packages/ui/src/dashboard/quick-actions.tsx b/packages/ui/src/dashboard/quick-actions.tsx
new file mode 100644
index 000000000..c1046d09f
--- /dev/null
+++ b/packages/ui/src/dashboard/quick-actions.tsx
@@ -0,0 +1,295 @@
+"use client";
+
+import { useMemo, useState, type ReactNode, type ComponentType } from "react";
+import { RefreshCw, Trash2, AlertTriangle, Zap } from "lucide-react";
+import { Button } from "../ui/button";
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ DialogDescription,
+ DialogFooter,
+} from "../ui/dialog";
+import { formatNumber, formatCost, formatRelativeTime } from "../lib/format";
+
+// Weighted average per-page token heuristics from cost_estimator.py _TOKEN_HEURISTICS
+const AVG_INPUT_TOKENS_PER_PAGE = 3500;
+const AVG_OUTPUT_TOKENS_PER_PAGE = 2200;
+
+const COST_TABLE_EXACT: Record<string, [number, number]> = {
+ "gpt-5.4": [0.0025, 0.015],
+ "gpt-5.4-mini": [0.00075, 0.0045],
+ "gpt-5.4-nano": [0.0002, 0.00125],
+ "gemini-3.1-pro-preview": [0.002, 0.012],
+ "gemini-3-flash-preview": [0.0005, 0.003],
+ "gemini-3.1-flash-lite-preview": [0.00025, 0.0015],
+ "claude-opus-4-6": [0.005, 0.025],
+ "claude-sonnet-4-6": [0.003, 0.015],
+ "claude-haiku-4-5": [0.001, 0.005],
+};
+
+const COST_TABLE_PREFIX: [string, [number, number]][] = [
+ ["gpt-5.4-nano", [0.0002, 0.00125]],
+ ["gpt-5.4-mini", [0.00075, 0.0045]],
+ ["gpt-5.4", [0.0025, 0.015]],
+ ["claude-opus", [0.005, 0.025]],
+ ["claude-sonnet", [0.003, 0.015]],
+ ["claude-haiku", [0.001, 0.005]],
+ ["claude", [0.003, 0.015]],
+ ["gemini", [0.00025, 0.0015]],
+ ["llama", [0, 0]],
+ ["mock", [0, 0]],
+];
+
+function lookupCost(modelName: string): [number, number] {
+ const lower = modelName.toLowerCase();
+ if (lower in COST_TABLE_EXACT) return COST_TABLE_EXACT[lower]!;
+ let bestLen = 0;
+ let bestRates: [number, number] = [0, 0];
+ for (const [prefix, rates] of COST_TABLE_PREFIX) {
+ if (lower.startsWith(prefix) && prefix.length > bestLen) {
+ bestLen = prefix.length;
+ bestRates = rates;
+ }
+ }
+ return bestRates;
+}
+
+function estimateCost(pageCount: number, modelName: string) {
+ const inputTokens = pageCount * AVG_INPUT_TOKENS_PER_PAGE;
+ const outputTokens = pageCount * AVG_OUTPUT_TOKENS_PER_PAGE;
+ const [inputRate, outputRate] = lookupCost(modelName);
+ const cost = (inputTokens / 1000) * inputRate + (outputTokens / 1000) * outputRate;
+ return { inputTokens, outputTokens, cost };
+}
+
+export type QuickActionKey = "sync" | "resync" | "dead-code";
+
+export interface QuickActionDef {
+ key: QuickActionKey;
+ label: string;
+ description: string;
+ icon: ComponentType<{ className?: string }>;
+ destructive: boolean;
+ needsConfirm: boolean;
+ confirmTitle: string;
+ confirmDescription: string;
+}
+
+export const DEFAULT_QUICK_ACTIONS: QuickActionDef[] = [
+ {
+ key: "sync",
+ label: "Sync",
+ description: "Update everything — only affected pages regenerated",
+ icon: Zap,
+ destructive: false,
+ needsConfirm: true,
+ confirmTitle: "Sync Repository",
+ confirmDescription:
+ "Re-indexes the dependency graph, git metadata, dead code, and decisions. Only wiki pages affected by recent changes are regenerated (minimal LLM cost).",
+ },
+ {
+ key: "resync",
+ label: "Full Re-index",
+ description: "Regenerate all docs from scratch",
+ icon: RefreshCw,
+ destructive: true,
+ needsConfirm: true,
+ confirmTitle: "Full Re-index",
+ confirmDescription:
+ "This regenerates every page from scratch. All existing pages will be overwritten.",
+ },
+ {
+ key: "dead-code",
+ label: "Dead Code Scan",
+ description: "Analyze for unused exports and files",
+ icon: Trash2,
+ destructive: false,
+ needsConfirm: false,
+ confirmTitle: "",
+ confirmDescription: "",
+ },
+];
+
+export interface QuickActionsProps {
+ /** Action set to render. Defaults to {sync, resync, dead-code}. */
+ actions?: QuickActionDef[];
+ /** Bag of mutation callbacks; the shell calls the matching key. */
+ onAction: (key: QuickActionKey) => Promise<void> | void;
+ /** Disabled / loading flag for a specific action. Optional — if omitted the
+ * shell tracks its own optimistic loading state. */
+ loadingKey?: QuickActionKey | null;
+ /** ISO datetimes for the timestamp footer. */
+ lastSyncAt?: string | null;
+ lastResyncAt?: string | null;
+ /** Inputs for the cost-estimate panel inside the confirm dialog. */
+ pageCount?: number;
+ modelName?: string;
+ /** When provided, replaces the buttons with the given node — typically a
+ * rendered job-progress widget. Wrapper decides what to pass. */
+ activeJobSlot?: ReactNode;
+}
+
+export function QuickActions({
+ actions = DEFAULT_QUICK_ACTIONS,
+ onAction,
+ loadingKey,
+ lastSyncAt,
+ lastResyncAt,
+ pageCount = 0,
+ modelName = "",
+ activeJobSlot,
+}: QuickActionsProps) {
+ const [internalLoading, setInternalLoading] = useState<QuickActionKey | null>(null);
+ const [pendingAction, setPendingAction] = useState<QuickActionDef | null>(null);
+ const loading = loadingKey !== undefined ? loadingKey : internalLoading;
+
+ const estimate = useMemo(() => {
+ if (!pendingAction || pendingAction.key === "dead-code" || pageCount <= 0) return null;
+ const pages =
+ pendingAction.key === "sync" ? Math.max(1, Math.ceil(pageCount * 0.1)) : pageCount;
+ return estimateCost(pages, modelName);
+ }, [pendingAction, pageCount, modelName]);
+
+ async function execute(action: QuickActionDef) {
+ if (loadingKey === undefined) setInternalLoading(action.key);
+ setPendingAction(null);
+ try {
+ await onAction(action.key);
+ } finally {
+ if (loadingKey === undefined) setInternalLoading(null);
+ }
+ }
+
+ function handleClick(action: QuickActionDef) {
+ if (action.needsConfirm) {
+ setPendingAction(action);
+ } else {
+ void execute(action);
+ }
+ }
+
+ if (activeJobSlot) {
+ return <div className="mb-2">{activeJobSlot}</div>;
+ }
+
+ return (
+ <>
+ <div className="space-y-1.5">
+ <div className="flex flex-wrap gap-2">
+ {actions.map((action) => {
+ const Icon = action.icon;
+ const isLoading = loading === action.key;
+ return (
+ <Button
+ key={action.key}
+ variant="outline"
+ size="sm"
+ className="h-8 gap-1.5 text-xs"
+ disabled={loading !== null}
+ onClick={() => handleClick(action)}
+ >
+ <Icon className={`h-3.5 w-3.5 ${isLoading ? "animate-spin" : ""}`} />
+ {action.label}
+ </Button>
+ );
+ })}
+ </div>
+ <div className="flex flex-wrap gap-x-4 gap-y-0.5">
+ <span className="text-[11px] text-[var(--color-text-tertiary)]">
+ Last synced{" "}
+ <span className="text-[var(--color-text-secondary)]">
+ {lastSyncAt ? formatRelativeTime(lastSyncAt) : "never"}
+ </span>
+ </span>
+ <span className="text-[11px] text-[var(--color-text-tertiary)]">
+ Last re-indexed{" "}
+ <span className="text-[var(--color-text-secondary)]">
+ {lastResyncAt ? formatRelativeTime(lastResyncAt) : "never"}
+ </span>
+ </span>
+ </div>
+ </div>
+
+ <Dialog
+ open={pendingAction !== null}
+ onOpenChange={(open) => !open && setPendingAction(null)}
+ >
+ {pendingAction && (
+ <DialogContent className="sm:max-w-sm">
+ <DialogHeader>
+ <DialogTitle className="flex items-center gap-2">
+ {pendingAction.destructive && (
+ <AlertTriangle className="h-4 w-4 text-[var(--color-warning)]" />
+ )}
+ {pendingAction.confirmTitle}
+ </DialogTitle>
+ <DialogDescription>{pendingAction.confirmDescription}</DialogDescription>
+ </DialogHeader>
+
+ {estimate && estimate.cost > 0 && (
+ <div className="rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-inset)] p-3 space-y-2">
+ <p className="text-xs font-medium text-[var(--color-text-secondary)] uppercase tracking-wider">
+ Estimated Cost
+ </p>
+ <div className="grid grid-cols-3 gap-2 text-center">
+ <div>
+ <p className="text-sm font-semibold text-[var(--color-text-primary)] tabular-nums">
+ {formatNumber(
+ pendingAction.key === "sync"
+ ? Math.max(1, Math.ceil(pageCount * 0.1))
+ : pageCount,
+ )}
+ </p>
+ <p className="text-[10px] text-[var(--color-text-tertiary)]">pages</p>
+ </div>
+ <div>
+ <p className="text-sm font-semibold text-[var(--color-text-primary)] tabular-nums">
+ {formatNumber(estimate.inputTokens + estimate.outputTokens)}
+ </p>
+ <p className="text-[10px] text-[var(--color-text-tertiary)]">tokens</p>
+ </div>
+ <div>
+ <p className="text-sm font-semibold text-[var(--color-accent-primary)] tabular-nums">
+ ~{formatCost(estimate.cost)}
+ </p>
+ <p className="text-[10px] text-[var(--color-text-tertiary)]">
+ {modelName || "est."}
+ </p>
+ </div>
+ </div>
+ {estimate.cost < 0.01 && (
+ <p className="text-[10px] text-[var(--color-text-tertiary)] text-center">
+ Free or near-free with this model
+ </p>
+ )}
+ </div>
+ )}
+
+ {estimate && estimate.cost === 0 && (
+ <div className="rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-inset)] p-3">
+ <p className="text-xs text-[var(--color-success)] text-center">
+ No API cost — running locally via Ollama
+ </p>
+ </div>
+ )}
+
+ <DialogFooter>
+ <Button variant="ghost" size="sm" onClick={() => setPendingAction(null)}>
+ Cancel
+ </Button>
+ <Button
+ variant={pendingAction.destructive ? "destructive" : "default"}
+ size="sm"
+ onClick={() => execute(pendingAction)}
+ >
+ {pendingAction.label}
+ </Button>
+ </DialogFooter>
+ </DialogContent>
+ )}
+ </Dialog>
+ </>
+ );
+}
diff --git a/packages/ui/src/dead-code/index.ts b/packages/ui/src/dead-code/index.ts
new file mode 100644
index 000000000..77fe19b0d
--- /dev/null
+++ b/packages/ui/src/dead-code/index.ts
@@ -0,0 +1 @@
+export * from "./summary-bar.js";
diff --git a/packages/web/src/components/dead-code/summary-bar.tsx b/packages/ui/src/dead-code/summary-bar.tsx
similarity index 91%
rename from packages/web/src/components/dead-code/summary-bar.tsx
rename to packages/ui/src/dead-code/summary-bar.tsx
index 9eded243d..7d2d8ee10 100644
--- a/packages/web/src/components/dead-code/summary-bar.tsx
+++ b/packages/ui/src/dead-code/summary-bar.tsx
@@ -1,8 +1,9 @@
-import { formatNumber } from "@/lib/utils/format";
-import type { DeadCodeSummaryResponse } from "@/lib/api/types";
+import { formatNumber } from "../lib/format";
+import type { DeadCodeSummary } from "@repowise-dev/types/dead-code";
-interface SummaryBarProps {
- summary: DeadCodeSummaryResponse;
+export interface SummaryBarProps {
+ /** Summary rollup; caller fetches. */
+ summary: DeadCodeSummary;
}
export function SummaryBar({ summary }: SummaryBarProps) {
diff --git a/packages/ui/src/decisions/decision-health-widget.tsx b/packages/ui/src/decisions/decision-health-widget.tsx
new file mode 100644
index 000000000..6650ad5c2
--- /dev/null
+++ b/packages/ui/src/decisions/decision-health-widget.tsx
@@ -0,0 +1,23 @@
+"use client";
+
+import { StatCard } from "../shared/stat-card";
+import type { DecisionHealth } from "@repowise-dev/types/decisions";
+
+export interface DecisionHealthWidgetProps {
+ /** Resolved health summary; widget renders nothing while undefined. */
+ health: DecisionHealth | undefined;
+}
+
+export function DecisionHealthWidget({ health }: DecisionHealthWidgetProps) {
+ if (!health) return null;
+
+ const { summary } = health;
+
+ return (
+ <div className="grid grid-cols-3 gap-3">
+ <StatCard label="Active Decisions" value={summary.active} />
+ <StatCard label="Proposed" value={summary.proposed} />
+ <StatCard label="Stale" value={summary.stale} />
+ </div>
+ );
+}
diff --git a/packages/web/src/components/decisions/decisions-table.tsx b/packages/ui/src/decisions/decisions-table.tsx
similarity index 75%
rename from packages/web/src/components/decisions/decisions-table.tsx
rename to packages/ui/src/decisions/decisions-table.tsx
index c874ba154..986110057 100644
--- a/packages/web/src/components/decisions/decisions-table.tsx
+++ b/packages/ui/src/decisions/decisions-table.tsx
@@ -2,10 +2,12 @@
import * as React from "react";
import Link from "next/link";
-import useSWR from "swr";
-import { Badge } from "@/components/ui/badge";
-import { listDecisions } from "@/lib/api/decisions";
-import type { DecisionRecordResponse } from "@/lib/api/types";
+import { Badge } from "../ui/badge";
+import type {
+ DecisionRecord,
+ DecisionStatus,
+ DecisionSource,
+} from "@repowise-dev/types/decisions";
const STATUS_VARIANT: Record<string, "default" | "fresh" | "stale" | "outdated" | "outline" | "accent"> = {
active: "fresh",
@@ -21,34 +23,49 @@ const SOURCE_LABEL: Record<string, string> = {
cli: "Manual",
};
-interface DecisionsTableProps {
- repoId: string;
- initialData?: DecisionRecordResponse[];
-}
+export type DecisionStatusFilter = DecisionStatus | "all";
+export type DecisionSourceFilter = DecisionSource | "all";
-export function DecisionsTable({ repoId, initialData }: DecisionsTableProps) {
- const [statusFilter, setStatusFilter] = React.useState<string>("all");
- const [sourceFilter, setSourceFilter] = React.useState<string>("all");
+export interface DecisionsTableFilters {
+ status: DecisionStatusFilter;
+ source: DecisionSourceFilter;
+}
- const { data: decisions, error, mutate, isLoading } = useSWR(
- [`/api/repos/${repoId}/decisions`, statusFilter, sourceFilter],
- () =>
- listDecisions(repoId, {
- status: statusFilter !== "all" ? statusFilter : undefined,
- source: sourceFilter !== "all" ? sourceFilter : undefined,
- include_proposed: true,
- limit: 100,
- }),
- { fallbackData: initialData },
- );
+export interface DecisionsTableProps {
+ /** Resolved decision list. Caller fetches; the table renders. */
+ decisions: DecisionRecord[] | undefined;
+ /** Current filter values; the caller controls and reflects them in fetch keys. */
+ filters: DecisionsTableFilters;
+ /** Invoked when the user changes a filter. */
+ onFiltersChange: (filters: DecisionsTableFilters) => void;
+ /** Used to build the "View" link target for each row. */
+ repoId: string;
+ /** Truthy when the most recent fetch errored; an inline retry is rendered. */
+ error?: unknown;
+ /** Truthy while a fetch is in flight; suppresses the empty-state message. */
+ isLoading?: boolean;
+ /** Invoked when the user clicks "Retry" after an error. */
+ onRetry?: () => void;
+}
+export function DecisionsTable({
+ decisions,
+ filters,
+ onFiltersChange,
+ repoId,
+ error,
+ isLoading,
+ onRetry,
+}: DecisionsTableProps) {
return (
<div className="space-y-4">
{/* Filters */}
<div className="flex flex-wrap gap-3">
<select
- value={statusFilter}
- onChange={(e) => setStatusFilter(e.target.value)}
+ value={filters.status}
+ onChange={(e) =>
+ onFiltersChange({ ...filters, status: e.target.value as DecisionStatusFilter })
+ }
aria-label="Filter by status"
className="w-full sm:w-auto rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-3 py-1.5 text-sm text-[var(--color-text-primary)]"
>
@@ -59,8 +76,10 @@ export function DecisionsTable({ repoId, initialData }: DecisionsTableProps) {
<option value="superseded">Superseded</option>
</select>
<select
- value={sourceFilter}
- onChange={(e) => setSourceFilter(e.target.value)}
+ value={filters.source}
+ onChange={(e) =>
+ onFiltersChange({ ...filters, source: e.target.value as DecisionSourceFilter })
+ }
aria-label="Filter by source"
className="w-full sm:w-auto rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-3 py-1.5 text-sm text-[var(--color-text-primary)]"
>
@@ -138,25 +157,27 @@ export function DecisionsTable({ repoId, initialData }: DecisionsTableProps) {
) : d.staleness_score > 0 ? (
<span className="text-[var(--color-text-tertiary)]">{Math.round(d.staleness_score * 100)}%</span>
) : (
- <span className="text-[var(--color-text-tertiary)]">—</span>
+ <span className="text-[var(--color-text-tertiary)]">—</span>
)}
</td>
</tr>
))}
- {!decisions?.length && error && !isLoading && (
+ {!decisions?.length && Boolean(error) && !isLoading && (
<tr>
<td colSpan={6} className="px-4 py-8 text-center text-[var(--color-outdated)]">
Couldn&apos;t load decisions.{" "}
- <button
- onClick={() => mutate()}
- className="underline text-[var(--color-accent-primary)] hover:text-[var(--color-text-primary)]"
- >
- Retry
- </button>
+ {onRetry && (
+ <button
+ onClick={onRetry}
+ className="underline text-[var(--color-accent-primary)] hover:text-[var(--color-text-primary)]"
+ >
+ Retry
+ </button>
+ )}
</td>
</tr>
)}
- {!decisions?.length && !error && (
+ {!decisions?.length && !error && !isLoading && (
<tr>
<td colSpan={6} className="px-4 py-8 text-center text-[var(--color-text-tertiary)]">
No decisions found
diff --git a/packages/ui/src/decisions/index.ts b/packages/ui/src/decisions/index.ts
new file mode 100644
index 000000000..7e2a231b7
--- /dev/null
+++ b/packages/ui/src/decisions/index.ts
@@ -0,0 +1,2 @@
+export * from "./decision-health-widget.js";
+export * from "./decisions-table.js";
diff --git a/packages/web/src/components/docs/docs-tree.tsx b/packages/ui/src/docs/docs-tree.tsx
similarity index 95%
rename from packages/web/src/components/docs/docs-tree.tsx
rename to packages/ui/src/docs/docs-tree.tsx
index e643530be..c3979be4d 100644
--- a/packages/web/src/components/docs/docs-tree.tsx
+++ b/packages/ui/src/docs/docs-tree.tsx
@@ -13,10 +13,9 @@ import {
Search,
Filter,
} from "lucide-react";
-import { cn } from "@/lib/utils/cn";
-import { statusBadgeClasses } from "@/lib/utils/confidence";
-import type { PageResponse } from "@/lib/api/types";
-import type { FreshnessStatus } from "@/lib/utils/confidence";
+import { cn } from "../lib/cn";
+import { statusBadgeClasses, type FreshnessStatus } from "../lib/confidence";
+import type { DocPage } from "@repowise-dev/types/docs";
// ---------------------------------------------------------------------------
// Types
@@ -26,14 +25,14 @@ interface TreeNode {
name: string;
path: string;
isDir: boolean;
- page?: PageResponse;
+ page?: DocPage;
children: TreeNode[];
}
interface DocsTreeProps {
- pages: PageResponse[];
+ pages: DocPage[];
selectedPageId: string | null;
- onSelectPage: (page: PageResponse) => void;
+ onSelectPage: (page: DocPage) => void;
className?: string;
}
@@ -50,19 +49,19 @@ const PAGE_TYPE_ICON: Record<string, React.ComponentType<{ className?: string }>
function PageIcon({ pageType, className }: { pageType: string; className?: string }) {
const Icon = PAGE_TYPE_ICON[pageType] ?? FileText;
- return <Icon className={className} />;
+ return <Icon {...(className ? { className } : {})} />;
}
// ---------------------------------------------------------------------------
// Build tree from flat page list
// ---------------------------------------------------------------------------
-function buildTree(pages: PageResponse[]): TreeNode[] {
+function buildTree(pages: DocPage[]): TreeNode[] {
const root: TreeNode[] = [];
// Separate special pages (overview, architecture) from path-based pages
- const specialPages: PageResponse[] = [];
- const pathPages: PageResponse[] = [];
+ const specialPages: DocPage[] = [];
+ const pathPages: DocPage[] = [];
for (const page of pages) {
if (page.page_type === "repo_overview" || page.page_type === "architecture_diagram") {
@@ -90,7 +89,7 @@ function buildTree(pages: PageResponse[]): TreeNode[] {
if (dirMap.has(dirPath)) return dirMap.get(dirPath)!;
const parts = dirPath.split("/");
- const name = parts[parts.length - 1];
+ const name = parts[parts.length - 1] ?? dirPath;
const node: TreeNode = {
name,
path: dirPath,
@@ -127,7 +126,7 @@ function buildTree(pages: PageResponse[]): TreeNode[] {
} else {
// File pages go into their parent directory
const parts = targetPath.split("/");
- const fileName = parts[parts.length - 1];
+ const fileName = parts[parts.length - 1] ?? targetPath;
const fileNode: TreeNode = {
name: fileName,
@@ -178,7 +177,7 @@ type TypeFilter = "all" | "file_page" | "module_page" | "symbol_spotlight" | "re
type FreshnessFilter = "all" | "fresh" | "stale" | "outdated";
function matchesFilters(
- page: PageResponse | undefined,
+ page: DocPage | undefined,
search: string,
typeFilter: TypeFilter,
freshnessFilter: FreshnessFilter,
@@ -238,7 +237,7 @@ function TreeItem({
selectedPageId: string | null;
expandedDirs: Set<string>;
toggleDir: (path: string) => void;
- onSelectPage: (page: PageResponse) => void;
+ onSelectPage: (page: DocPage) => void;
}) {
const isExpanded = expandedDirs.has(node.path);
const isSelected = node.page && node.page.id === selectedPageId;
@@ -349,7 +348,7 @@ export function DocsTree({ pages, selectedPageId, onSelectPage, className }: Doc
const dirs = new Set<string>();
for (const page of pages) {
const parts = page.target_path.split("/");
- if (parts.length > 1) dirs.add(parts[0]);
+ if (parts.length > 1 && parts[0]) dirs.add(parts[0]);
}
return dirs;
});
@@ -446,7 +445,7 @@ export function DocsTree({ pages, selectedPageId, onSelectPage, className }: Doc
{/* Stats line */}
<div className="flex items-center justify-between text-[10px] text-[var(--color-text-tertiary)]">
<span>{totalPages} pages</span>
- <span>{freshCount} fresh · {totalPages - freshCount} need attention</span>
+ <span>{freshCount} fresh · {totalPages - freshCount} need attention</span>
</div>
</div>
diff --git a/packages/ui/src/docs/index.ts b/packages/ui/src/docs/index.ts
new file mode 100644
index 000000000..2629c199c
--- /dev/null
+++ b/packages/ui/src/docs/index.ts
@@ -0,0 +1 @@
+export * from "./docs-tree.js";
diff --git a/packages/web/src/components/git/bus-factor-panel.tsx b/packages/ui/src/git/bus-factor-panel.tsx
similarity index 87%
rename from packages/web/src/components/git/bus-factor-panel.tsx
rename to packages/ui/src/git/bus-factor-panel.tsx
index e2a2de21d..8e95cdede 100644
--- a/packages/web/src/components/git/bus-factor-panel.tsx
+++ b/packages/ui/src/git/bus-factor-panel.tsx
@@ -7,11 +7,11 @@ import {
Tooltip,
ResponsiveContainer,
} from "recharts";
-import { truncatePath } from "@/lib/utils/format";
-import type { HotspotResponse } from "@/lib/api/types";
+import { truncatePath } from "../lib/format";
+import type { Hotspot } from "@repowise-dev/types/git";
interface BusFactorPanelProps {
- hotspots: HotspotResponse[];
+ hotspots: Hotspot[];
}
export function BusFactorPanel({ hotspots }: BusFactorPanelProps) {
@@ -29,7 +29,6 @@ export function BusFactorPanel({ hotspots }: BusFactorPanelProps) {
return (
<div className="space-y-4">
- {/* Stacked bar */}
<div>
<div className="flex items-center justify-between text-xs text-[var(--color-text-tertiary)] mb-2">
<span>Bus Factor Distribution</span>
@@ -47,9 +46,10 @@ export function BusFactorPanel({ hotspots }: BusFactorPanelProps) {
fontSize: "12px",
color: "var(--color-text-primary)",
}}
- formatter={(value: number, name: string) => {
- const label = name === "high" ? "Safe (≥3)" : name === "medium" ? "Warning (2)" : "Risk (≤1)";
- return [`${value} files`, label];
+ formatter={(value, name) => {
+ const n = typeof value === "number" ? value : 0;
+ const label = name === "high" ? "Safe (≥3)" : name === "medium" ? "Warning (2)" : "Risk (≤1)";
+ return [`${n} files`, label];
}}
/>
<Bar dataKey="high" stackId="a" fill="#22c55e" radius={[4, 0, 0, 4]} />
@@ -59,18 +59,17 @@ export function BusFactorPanel({ hotspots }: BusFactorPanelProps) {
</ResponsiveContainer>
<div className="flex items-center gap-4 mt-2 text-[10px] text-[var(--color-text-tertiary)]">
<span className="flex items-center gap-1">
- <span className="inline-block h-2 w-2 rounded-sm bg-green-500" /> Safe (≥3): {high}
+ <span className="inline-block h-2 w-2 rounded-sm bg-green-500" /> Safe (≥3): {high}
</span>
<span className="flex items-center gap-1">
<span className="inline-block h-2 w-2 rounded-sm bg-yellow-500" /> Warning (2): {medium}
</span>
<span className="flex items-center gap-1">
- <span className="inline-block h-2 w-2 rounded-sm bg-red-500" /> Risk (≤1): {low}
+ <span className="inline-block h-2 w-2 rounded-sm bg-red-500" /> Risk (≤1): {low}
</span>
</div>
</div>
- {/* At-risk files list */}
{riskFiles.length > 0 && (
<div>
<p className="text-xs font-medium text-[var(--color-text-tertiary)] uppercase tracking-wider mb-2">
diff --git a/packages/web/src/components/git/churn-bar.tsx b/packages/ui/src/git/churn-bar.tsx
similarity index 88%
rename from packages/web/src/components/git/churn-bar.tsx
rename to packages/ui/src/git/churn-bar.tsx
index cd2fc5250..66ee9168a 100644
--- a/packages/web/src/components/git/churn-bar.tsx
+++ b/packages/ui/src/git/churn-bar.tsx
@@ -1,7 +1,7 @@
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
interface ChurnBarProps {
- percentile: number; // 0-100
+ percentile: number;
className?: string;
}
diff --git a/packages/web/src/components/git/churn-histogram.tsx b/packages/ui/src/git/churn-histogram.tsx
similarity index 76%
rename from packages/web/src/components/git/churn-histogram.tsx
rename to packages/ui/src/git/churn-histogram.tsx
index 5f68b9859..4bb38460f 100644
--- a/packages/web/src/components/git/churn-histogram.tsx
+++ b/packages/ui/src/git/churn-histogram.tsx
@@ -9,10 +9,10 @@ import {
ResponsiveContainer,
Cell,
} from "recharts";
-import type { HotspotResponse } from "@/lib/api/types";
+import type { Hotspot } from "@repowise-dev/types/git";
interface ChurnHistogramProps {
- hotspots: HotspotResponse[];
+ hotspots: Hotspot[];
}
const BUCKET_COLORS = [
@@ -20,16 +20,17 @@ const BUCKET_COLORS = [
"#eab308", "#eab308", "#f59520",
"#ef4444", "#ef4444",
];
+const BUCKET_FALLBACK = "#8b5cf6";
export function ChurnHistogram({ hotspots }: ChurnHistogramProps) {
- const buckets = Array(10).fill(0) as number[];
+ const buckets = Array<number>(10).fill(0);
for (const h of hotspots) {
const idx = Math.min(9, Math.floor(h.churn_percentile / 10));
- buckets[idx]++;
+ buckets[idx] = (buckets[idx] ?? 0) + 1;
}
const data = buckets.map((count, i) => ({
- range: `${i * 10}–${(i + 1) * 10}`,
+ range: `${i * 10}–${(i + 1) * 10}`,
count,
}));
@@ -57,12 +58,12 @@ export function ChurnHistogram({ hotspots }: ChurnHistogramProps) {
fontSize: "12px",
color: "var(--color-text-primary)",
}}
- formatter={(value: number) => [`${value} files`, "Count"]}
- labelFormatter={(label: string) => `Churn ${label}%`}
+ formatter={(value) => [`${typeof value === "number" ? value : 0} files`, "Count"]}
+ labelFormatter={(label) => `Churn ${String(label)}%`}
/>
<Bar dataKey="count" radius={[4, 4, 0, 0]}>
{data.map((_, i) => (
- <Cell key={i} fill={BUCKET_COLORS[i]} />
+ <Cell key={i} fill={BUCKET_COLORS[i] ?? BUCKET_FALLBACK} />
))}
</Bar>
</BarChart>
diff --git a/packages/web/src/components/git/co-change-list.tsx b/packages/ui/src/git/co-change-list.tsx
similarity index 96%
rename from packages/web/src/components/git/co-change-list.tsx
rename to packages/ui/src/git/co-change-list.tsx
index 8a62d42f3..9a0402492 100644
--- a/packages/web/src/components/git/co-change-list.tsx
+++ b/packages/ui/src/git/co-change-list.tsx
@@ -1,4 +1,4 @@
-import { truncatePath } from "@/lib/utils/format";
+import { truncatePath } from "../lib/format";
interface CoChangeListProps {
partners: Array<{ file_path: string; co_change_count: number }>;
diff --git a/packages/web/src/components/git/commit-category-donut.tsx b/packages/ui/src/git/commit-category-donut.tsx
similarity index 89%
rename from packages/web/src/components/git/commit-category-donut.tsx
rename to packages/ui/src/git/commit-category-donut.tsx
index d73f93942..2469fc15d 100644
--- a/packages/web/src/components/git/commit-category-donut.tsx
+++ b/packages/ui/src/git/commit-category-donut.tsx
@@ -58,10 +58,13 @@ export function CommitCategoryDonut({ categories }: CommitCategoryDonutProps) {
fontSize: "12px",
color: "var(--color-text-primary)",
}}
- formatter={(value: number, name: string) => [
- `${value} commits (${Math.round((value / total) * 100)}%)`,
- name,
- ]}
+ formatter={(value, name) => {
+ const n = typeof value === "number" ? value : 0;
+ return [
+ `${n} commits (${Math.round((n / total) * 100)}%)`,
+ name,
+ ];
+ }}
/>
</PieChart>
</ResponsiveContainer>
diff --git a/packages/web/src/components/git/commit-category-sparkline.tsx b/packages/ui/src/git/commit-category-sparkline.tsx
similarity index 96%
rename from packages/web/src/components/git/commit-category-sparkline.tsx
rename to packages/ui/src/git/commit-category-sparkline.tsx
index 33cdf6e9b..f7b6efccf 100644
--- a/packages/web/src/components/git/commit-category-sparkline.tsx
+++ b/packages/ui/src/git/commit-category-sparkline.tsx
@@ -2,7 +2,7 @@ import {
Tooltip,
TooltipTrigger,
TooltipContent,
-} from "@/components/ui/tooltip";
+} from "../ui/tooltip";
interface CommitCategorySparklineProps {
categories: Record<string, number>;
@@ -27,6 +27,7 @@ export function CommitCategorySparkline({ categories }: CommitCategorySparklineP
const count = categories[key] || 0;
if (count === 0) return null;
const config = CATEGORY_CONFIG[key];
+ if (!config) return null;
return (
<Tooltip key={key}>
<TooltipTrigger asChild>
diff --git a/packages/web/src/components/git/contributor-bar.tsx b/packages/ui/src/git/contributor-bar.tsx
similarity index 94%
rename from packages/web/src/components/git/contributor-bar.tsx
rename to packages/ui/src/git/contributor-bar.tsx
index 55d528543..e6c099f15 100644
--- a/packages/web/src/components/git/contributor-bar.tsx
+++ b/packages/ui/src/git/contributor-bar.tsx
@@ -46,7 +46,7 @@ export function ContributorBar({ owners }: ContributorBarProps) {
fontSize: "12px",
color: "var(--color-text-primary)",
}}
- formatter={(value: number) => [value, "files"]}
+ formatter={(value) => [typeof value === "number" ? value : 0, "files"]}
/>
<Bar dataKey="files" fill="var(--color-accent-primary)" radius={[0, 4, 4, 0]} />
</BarChart>
diff --git a/packages/web/src/components/git/contributor-network.tsx b/packages/ui/src/git/contributor-network.tsx
similarity index 88%
rename from packages/web/src/components/git/contributor-network.tsx
rename to packages/ui/src/git/contributor-network.tsx
index 5ec47cc5d..f92710a2f 100644
--- a/packages/web/src/components/git/contributor-network.tsx
+++ b/packages/ui/src/git/contributor-network.tsx
@@ -2,10 +2,10 @@
import { useRef, useEffect, useMemo } from "react";
import * as d3 from "d3-force";
-import type { HotspotResponse } from "@/lib/api/types";
+import type { Hotspot } from "@repowise-dev/types/git";
interface ContributorNetworkProps {
- hotspots: HotspotResponse[];
+ hotspots: Hotspot[];
}
interface ContributorNode extends d3.SimulationNodeDatum {
@@ -22,12 +22,12 @@ const PALETTE = [
"#6366f1", "#ec4899", "#10b981", "#f59e0b", "#3b82f6", "#a855f7",
"#14b8a6", "#f97316", "#84cc16", "#06b6d4", "#e11d48", "#8b5cf6",
];
+const PALETTE_FALLBACK = "#6366f1";
export function ContributorNetwork({ hotspots }: ContributorNetworkProps) {
const svgRef = useRef<SVGSVGElement>(null);
const { nodes, links } = useMemo(() => {
- // Build contributor -> files map
const ownerFiles = new Map<string, Set<string>>();
for (const h of hotspots) {
const owner = h.primary_owner;
@@ -36,7 +36,6 @@ export function ContributorNetwork({ hotspots }: ContributorNetworkProps) {
ownerFiles.get(owner)!.add(h.file_path);
}
- // Build nodes
const nodeArr: ContributorNode[] = Array.from(ownerFiles.entries())
.map(([id, files]) => ({
id,
@@ -48,17 +47,20 @@ export function ContributorNetwork({ hotspots }: ContributorNetworkProps) {
const nodeIds = new Set(nodeArr.map((n) => n.id));
- // Build links (shared file co-ownership)
const linkArr: ContributorLink[] = [];
const nodeList = Array.from(nodeIds);
for (let i = 0; i < nodeList.length; i++) {
for (let j = i + 1; j < nodeList.length; j++) {
- const a = ownerFiles.get(nodeList[i])!;
- const b = ownerFiles.get(nodeList[j])!;
+ const idA = nodeList[i];
+ const idB = nodeList[j];
+ if (!idA || !idB) continue;
+ const a = ownerFiles.get(idA);
+ const b = ownerFiles.get(idB);
+ if (!a || !b) continue;
let shared = 0;
for (const f of a) if (b.has(f)) shared++;
if (shared > 0) {
- linkArr.push({ source: nodeList[i], target: nodeList[j], sharedFiles: shared });
+ linkArr.push({ source: idA, target: idB, sharedFiles: shared });
}
}
}
@@ -73,16 +75,13 @@ export function ContributorNetwork({ hotspots }: ContributorNetworkProps) {
const width = svg.clientWidth || 400;
const height = svg.clientHeight || 300;
- // Clear
while (svg.firstChild) svg.removeChild(svg.firstChild);
const ns = "http://www.w3.org/2000/svg";
- // Create a group for zoom
const g = document.createElementNS(ns, "g");
svg.appendChild(g);
- // Reset node positions
for (const n of nodes) {
n.x = width / 2 + (Math.random() - 0.5) * 100;
n.y = height / 2 + (Math.random() - 0.5) * 100;
@@ -95,7 +94,6 @@ export function ContributorNetwork({ hotspots }: ContributorNetworkProps) {
.force("center", d3.forceCenter(width / 2, height / 2))
.force("collide", d3.forceCollide<ContributorNode>().radius((d) => d.radius + 4));
- // Draw links
const linkElements: SVGLineElement[] = links.map((l) => {
const line = document.createElementNS(ns, "line");
line.setAttribute("stroke", "rgba(255,255,255,0.1)");
@@ -104,16 +102,16 @@ export function ContributorNetwork({ hotspots }: ContributorNetworkProps) {
return line;
});
- // Draw nodes
const nodeGroups: SVGGElement[] = nodes.map((n, i) => {
const group = document.createElementNS(ns, "g");
group.style.cursor = "pointer";
+ const fill = PALETTE[i % PALETTE.length] ?? PALETTE_FALLBACK;
const circle = document.createElementNS(ns, "circle");
circle.setAttribute("r", String(n.radius));
- circle.setAttribute("fill", PALETTE[i % PALETTE.length]);
+ circle.setAttribute("fill", fill);
circle.setAttribute("fill-opacity", "0.8");
- circle.setAttribute("stroke", PALETTE[i % PALETTE.length]);
+ circle.setAttribute("stroke", fill);
circle.setAttribute("stroke-opacity", "0.3");
circle.setAttribute("stroke-width", "3");
group.appendChild(circle);
@@ -123,7 +121,7 @@ export function ContributorNetwork({ hotspots }: ContributorNetworkProps) {
text.setAttribute("dy", String(n.radius + 12));
text.setAttribute("fill", "var(--color-text-secondary)");
text.setAttribute("font-size", "9");
- text.textContent = n.id.length > 15 ? n.id.slice(0, 15) + "…" : n.id;
+ text.textContent = n.id.length > 15 ? n.id.slice(0, 15) + "…" : n.id;
group.appendChild(text);
const title = document.createElementNS(ns, "title");
@@ -137,6 +135,7 @@ export function ContributorNetwork({ hotspots }: ContributorNetworkProps) {
simulation.on("tick", () => {
linkElements.forEach((line, i) => {
const l = links[i];
+ if (!l) return;
const s = l.source as ContributorNode;
const t = l.target as ContributorNode;
line.setAttribute("x1", String(s.x ?? 0));
@@ -147,6 +146,7 @@ export function ContributorNetwork({ hotspots }: ContributorNetworkProps) {
nodeGroups.forEach((group, i) => {
const n = nodes[i];
+ if (!n) return;
group.setAttribute("transform", `translate(${n.x ?? 0}, ${n.y ?? 0})`);
});
});
diff --git a/packages/web/src/components/git/hotspot-table.tsx b/packages/ui/src/git/hotspot-table.tsx
similarity index 95%
rename from packages/web/src/components/git/hotspot-table.tsx
rename to packages/ui/src/git/hotspot-table.tsx
index 6949bba34..a339b21cd 100644
--- a/packages/web/src/components/git/hotspot-table.tsx
+++ b/packages/ui/src/git/hotspot-table.tsx
@@ -2,16 +2,16 @@
import { useState, useMemo } from "react";
import { TrendingUp, TrendingDown, Search, Flame, ArrowUpDown, ArrowUp, ArrowDown } from "lucide-react";
-import { Badge } from "@/components/ui/badge";
-import { Input } from "@/components/ui/input";
-import { EmptyState } from "@/components/shared/empty-state";
+import { Badge } from "../ui/badge";
+import { Input } from "../ui/input";
+import { EmptyState } from "../shared/empty-state";
import { ChurnBar } from "./churn-bar";
-import { formatLOC } from "@/lib/utils/format";
-import { cn } from "@/lib/utils/cn";
-import type { HotspotResponse } from "@/lib/api/types";
+import { formatLOC } from "../lib/format";
+import { cn } from "../lib/cn";
+import type { Hotspot } from "@repowise-dev/types/git";
interface HotspotTableProps {
- hotspots: HotspotResponse[];
+ hotspots: Hotspot[];
}
type Filter = "all" | "hot" | "risk" | "accelerating";
@@ -69,7 +69,6 @@ export function HotspotTable({ hotspots }: HotspotTableProps) {
break;
}
- // Client-side sort
const sign = sortDir === "desc" ? -1 : 1;
items = [...items].sort((a, b) => {
if (sortKey === "trend") {
@@ -89,7 +88,7 @@ export function HotspotTable({ hotspots }: HotspotTableProps) {
return (
<EmptyState
title="No hotspots found"
- description="All files look stable — great work!"
+ description="All files look stable — great work!"
/>
);
}
@@ -103,12 +102,11 @@ export function HotspotTable({ hotspots }: HotspotTableProps) {
return (
<div className="space-y-3">
- {/* Search + filters */}
<div className="flex flex-wrap items-center gap-2">
<div className="relative">
<Search className="absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-[var(--color-text-tertiary)]" />
<Input
- placeholder="Search files or owners…"
+ placeholder="Search files or owners…"
value={search}
onChange={(e) => setSearch(e.target.value)}
className="pl-8 h-8 w-full sm:w-56 text-xs"
@@ -133,7 +131,6 @@ export function HotspotTable({ hotspots }: HotspotTableProps) {
</div>
</div>
- {/* Table */}
{filtered.length === 0 ? (
<EmptyState title="No matches" description="Try adjusting your search or filters." />
) : (
@@ -176,7 +173,7 @@ export function HotspotTable({ hotspots }: HotspotTableProps) {
Bus Factor
</th>
<th className="px-3 py-2.5 text-left text-xs font-medium text-[var(--color-text-tertiary)] uppercase tracking-wider w-24 hidden lg:table-cell">
- Lines ±90d
+ Lines ±90d
</th>
<th className="px-3 py-2.5 text-left text-xs font-medium text-[var(--color-text-tertiary)] uppercase tracking-wider hidden md:table-cell">
Owner
@@ -229,7 +226,7 @@ export function HotspotTable({ hotspots }: HotspotTableProps) {
</span>
</>
) : (
- <span className="text-[var(--color-text-tertiary)]">—</span>
+ <span className="text-[var(--color-text-tertiary)]">—</span>
)}
</span>
</td>
@@ -252,7 +249,7 @@ export function HotspotTable({ hotspots }: HotspotTableProps) {
<span className="text-red-400">-{formatLOC(h.lines_deleted_90d)}</span>
</td>
<td className="px-3 py-2.5 text-xs text-[var(--color-text-secondary)] hidden md:table-cell">
- {h.primary_owner ?? "—"}
+ {h.primary_owner ?? "—"}
</td>
<td className="px-3 py-2.5 flex items-center gap-1">
{h.is_hotspot && <Badge variant="outdated">Hot</Badge>}
diff --git a/packages/ui/src/git/index.ts b/packages/ui/src/git/index.ts
new file mode 100644
index 000000000..1d42e514c
--- /dev/null
+++ b/packages/ui/src/git/index.ts
@@ -0,0 +1,12 @@
+export * from "./bus-factor-panel.js";
+export * from "./churn-bar.js";
+export * from "./churn-histogram.js";
+export * from "./co-change-list.js";
+export * from "./commit-category-donut.js";
+export * from "./commit-category-sparkline.js";
+export * from "./contributor-bar.js";
+export * from "./contributor-network.js";
+export * from "./hotspot-table.js";
+export * from "./ownership-table.js";
+export * from "./ownership-treemap.js";
+export * from "./risk-distribution-chart.js";
diff --git a/packages/web/src/components/git/ownership-table.tsx b/packages/ui/src/git/ownership-table.tsx
similarity index 93%
rename from packages/web/src/components/git/ownership-table.tsx
rename to packages/ui/src/git/ownership-table.tsx
index f292df120..db47a9687 100644
--- a/packages/web/src/components/git/ownership-table.tsx
+++ b/packages/ui/src/git/ownership-table.tsx
@@ -2,12 +2,12 @@
import { useState, useMemo } from "react";
import { Search } from "lucide-react";
-import { Badge } from "@/components/ui/badge";
-import { Input } from "@/components/ui/input";
-import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
-import { EmptyState } from "@/components/shared/empty-state";
-import { cn } from "@/lib/utils/cn";
-import type { OwnershipEntry } from "@/lib/api/types";
+import { Badge } from "../ui/badge";
+import { Input } from "../ui/input";
+import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip";
+import { EmptyState } from "../shared/empty-state";
+import { cn } from "../lib/cn";
+import type { OwnershipEntry } from "@repowise-dev/types/git";
interface OwnershipTableProps {
entries: OwnershipEntry[];
@@ -51,12 +51,11 @@ export function OwnershipTable({ entries }: OwnershipTableProps) {
return (
<div className="space-y-3">
- {/* Search + filters */}
<div className="flex flex-wrap items-center gap-2">
<div className="relative">
<Search className="absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-[var(--color-text-tertiary)]" />
<Input
- placeholder="Search modules or owners…"
+ placeholder="Search modules or owners…"
value={search}
onChange={(e) => setSearch(e.target.value)}
className="pl-8 h-8 w-full sm:w-56 text-xs"
@@ -125,7 +124,7 @@ export function OwnershipTable({ entries }: OwnershipTableProps) {
</td>
<td className="px-4 py-2.5 text-xs text-[var(--color-text-secondary)] max-w-[200px]">
<span className="block truncate" title={entry.primary_owner ?? undefined}>
- {entry.primary_owner ?? "—"}
+ {entry.primary_owner ?? "—"}
</span>
</td>
<td className="px-4 py-2.5">
@@ -142,7 +141,7 @@ export function OwnershipTable({ entries }: OwnershipTableProps) {
</span>
</div>
) : (
- <span className="text-[var(--color-text-tertiary)]">—</span>
+ <span className="text-[var(--color-text-tertiary)]">—</span>
)}
</td>
<td className="px-4 py-2.5 text-xs text-[var(--color-text-tertiary)] tabular-nums">
diff --git a/packages/web/src/components/git/ownership-treemap.tsx b/packages/ui/src/git/ownership-treemap.tsx
similarity index 92%
rename from packages/web/src/components/git/ownership-treemap.tsx
rename to packages/ui/src/git/ownership-treemap.tsx
index 92fa795f5..f61945209 100644
--- a/packages/web/src/components/git/ownership-treemap.tsx
+++ b/packages/ui/src/git/ownership-treemap.tsx
@@ -2,7 +2,7 @@
import { useRef, useEffect, useState, useCallback } from "react";
import { hierarchy, treemap, treemapSquarify, type HierarchyRectangularNode } from "d3-hierarchy";
-import type { OwnershipEntry } from "@/lib/api/types";
+import type { OwnershipEntry } from "@repowise-dev/types/git";
interface OwnershipTreemapProps {
entries: OwnershipEntry[];
@@ -12,14 +12,15 @@ const OWNER_COLORS = [
"#5b9cf6", "#a855f7", "#22c55e", "#eab308",
"#ec4899", "#6366f1", "#14b8a6", "#f59520",
];
+const OWNER_FALLBACK = "#4b5563";
function ownerColor(name: string | null): string {
- if (!name) return "#4b5563";
+ if (!name) return OWNER_FALLBACK;
let hash = 0;
for (let i = 0; i < name.length; i++) {
hash = name.charCodeAt(i) + ((hash << 5) - hash);
}
- return OWNER_COLORS[Math.abs(hash) % OWNER_COLORS.length];
+ return OWNER_COLORS[Math.abs(hash) % OWNER_COLORS.length] ?? OWNER_FALLBACK;
}
interface TooltipData {
@@ -40,8 +41,10 @@ export function OwnershipTreemap({ entries }: OwnershipTreemapProps) {
useEffect(() => {
const el = containerRef.current;
if (!el) return;
- const ro = new ResizeObserver((entries) => {
- const { width } = entries[0].contentRect;
+ const ro = new ResizeObserver((observed) => {
+ const first = observed[0];
+ if (!first) return;
+ const { width } = first.contentRect;
if (width > 0) setDims({ width, height: Math.max(240, Math.min(400, width * 0.5)) });
});
ro.observe(el);
@@ -146,7 +149,7 @@ export function OwnershipTreemap({ entries }: OwnershipTreemapProps) {
fontFamily="var(--font-geist-mono)"
pointerEvents="none"
>
- {d.name.length > w / 7 ? d.name.slice(0, Math.floor(w / 7)) + "…" : d.name}
+ {d.name.length > w / 7 ? d.name.slice(0, Math.floor(w / 7)) + "…" : d.name}
</text>
<text
x={x0 + 6}
@@ -164,7 +167,6 @@ export function OwnershipTreemap({ entries }: OwnershipTreemapProps) {
})}
</svg>
- {/* Tooltip */}
{tooltip && (
<div
className="absolute z-20 pointer-events-none rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-overlay)] px-3 py-2 text-xs shadow-lg"
@@ -175,7 +177,7 @@ export function OwnershipTreemap({ entries }: OwnershipTreemapProps) {
>
<p className="font-mono font-medium text-[var(--color-text-primary)]">{tooltip.name}</p>
<p className="text-[var(--color-text-secondary)] mt-0.5">
- Owner: {tooltip.owner ?? "—"}
+ Owner: {tooltip.owner ?? "—"}
{tooltip.pct != null && ` (${Math.round(tooltip.pct * 100)}%)`}
</p>
<p className="text-[var(--color-text-secondary)]">{tooltip.fileCount} files</p>
diff --git a/packages/web/src/components/git/risk-distribution-chart.tsx b/packages/ui/src/git/risk-distribution-chart.tsx
similarity index 91%
rename from packages/web/src/components/git/risk-distribution-chart.tsx
rename to packages/ui/src/git/risk-distribution-chart.tsx
index 94f4f1317..e0b30da07 100644
--- a/packages/web/src/components/git/risk-distribution-chart.tsx
+++ b/packages/ui/src/git/risk-distribution-chart.tsx
@@ -11,13 +11,13 @@ import {
Cell,
ReferenceLine,
} from "recharts";
-import type { HotspotResponse } from "@/lib/api/types";
+import type { Hotspot } from "@repowise-dev/types/git";
interface RiskDistributionChartProps {
- hotspots: HotspotResponse[];
+ hotspots: Hotspot[];
}
-function computeRiskScore(h: HotspotResponse): number {
+function computeRiskScore(h: Hotspot): number {
const churn = h.churn_percentile / 100;
const busFactor = h.bus_factor <= 1 ? 1 : h.bus_factor === 2 ? 0.5 : 0;
const trend = Math.min(1, (h.temporal_hotspot_score ?? 0) / 10);
@@ -81,8 +81,8 @@ export function RiskDistributionChart({ hotspots }: RiskDistributionChartProps)
fontSize: 11,
color: "var(--color-text-primary)",
}}
- formatter={(value: number) => [`${value}`, "Risk Score"]}
- labelFormatter={(label: string) => label}
+ formatter={(value) => [`${typeof value === "number" ? value : 0}`, "Risk Score"]}
+ labelFormatter={(label) => String(label)}
/>
<ReferenceLine
x={avgRisk}
diff --git a/packages/ui/src/graph/context.ts b/packages/ui/src/graph/context.ts
new file mode 100644
index 000000000..8c07b4f71
--- /dev/null
+++ b/packages/ui/src/graph/context.ts
@@ -0,0 +1,36 @@
+"use client";
+
+import { createContext, useContext } from "react";
+import type { ColorMode } from "./graph-toolbar";
+
+export interface GraphContextValue {
+ highlightedPath: Set<string>;
+ highlightedEdges: Set<string>;
+ colorMode: ColorMode;
+ riskScores: Map<string, number>;
+ hoveredNodeId: string | null;
+ connectedNodeIds: Set<string>;
+ connectedEdgeIds: Set<string>;
+ selectedNodeId: string | null;
+ searchDimmedNodes: Set<string> | null;
+}
+
+const defaultValue: GraphContextValue = {
+ highlightedPath: new Set(),
+ highlightedEdges: new Set(),
+ colorMode: "language",
+ riskScores: new Map(),
+ hoveredNodeId: null,
+ connectedNodeIds: new Set(),
+ connectedEdgeIds: new Set(),
+ selectedNodeId: null,
+ searchDimmedNodes: null,
+};
+
+export const GraphContext = createContext<GraphContextValue>(defaultValue);
+
+export const GraphProvider = GraphContext.Provider;
+
+export function useGraphContext(): GraphContextValue {
+ return useContext(GraphContext);
+}
diff --git a/packages/web/src/components/graph/edges/dependency-edge.tsx b/packages/ui/src/graph/edges/dependency-edge.tsx
similarity index 98%
rename from packages/web/src/components/graph/edges/dependency-edge.tsx
rename to packages/ui/src/graph/edges/dependency-edge.tsx
index 653309152..ecfb585be 100644
--- a/packages/web/src/components/graph/edges/dependency-edge.tsx
+++ b/packages/ui/src/graph/edges/dependency-edge.tsx
@@ -5,7 +5,7 @@ import {
getBezierPath,
type EdgeProps,
} from "@xyflow/react";
-import { GraphContext } from "../graph-flow";
+import { GraphContext } from "../context";
import type { DependencyEdgeData } from "../elk-layout";
function DependencyEdgeInner({
diff --git a/packages/web/src/components/graph/elk-layout.ts b/packages/ui/src/graph/elk-layout.ts
similarity index 96%
rename from packages/web/src/components/graph/elk-layout.ts
rename to packages/ui/src/graph/elk-layout.ts
index 0077ee0ea..89e6cc6f7 100644
--- a/packages/web/src/components/graph/elk-layout.ts
+++ b/packages/ui/src/graph/elk-layout.ts
@@ -9,11 +9,11 @@ import ELK from "elkjs/lib/elk.bundled.js";
import type { ElkNode, ElkExtendedEdge } from "elkjs";
import type { Node, Edge } from "@xyflow/react";
import type {
- GraphNodeResponse,
- GraphEdgeResponse,
- ModuleNodeResponse,
- ModuleEdgeResponse,
-} from "@/lib/api/types";
+ GraphNode as GraphNodeResponse,
+ GraphLink as GraphEdgeResponse,
+ ModuleNode as ModuleNodeResponse,
+ ModuleEdge as ModuleEdgeResponse,
+} from "@repowise-dev/types/graph";
// ---- Constants ----
@@ -168,9 +168,10 @@ export function groupNodesAsModules(
// A "file entry" is when the module_id equals a single node's full path
// (i.e., it's a direct file at this level, not a subdirectory)
- const isSingleFile = fileCount === 1 && groupedNodes[0].node_id === moduleId;
- if (isSingleFile) {
- fileEntries.set(moduleId, groupedNodes[0]);
+ const firstNode = groupedNodes[0];
+ const isSingleFile = fileCount === 1 && firstNode?.node_id === moduleId;
+ if (isSingleFile && firstNode) {
+ fileEntries.set(moduleId, firstNode);
}
moduleNodes.push({
@@ -197,7 +198,7 @@ export function groupNodesAsModules(
const moduleEdges: ModuleEdgeResponse[] = Array.from(edgeCounts.entries()).map(
([key, count]) => {
- const [source, target] = key.split("→");
+ const [source = "", target = ""] = key.split("→");
return { source, target, edge_count: count };
},
);
@@ -253,7 +254,7 @@ export async function layoutFileGraph(
const dirElkNodes = new Map<string, ElkNode>();
for (const dir of dirs) {
const parts = dir.split("/");
- const label = parts[parts.length - 1];
+ const label = parts[parts.length - 1] ?? dir;
const elkNode: ElkNode = {
id: `dir:${dir}`,
labels: [{ text: label }],
@@ -480,7 +481,7 @@ export async function layoutModuleGraph(
}
const rfEdges: Edge[] = Array.from(edgeMap.entries()).map(([key, count]) => {
- const [source, target] = key.split("→");
+ const [source = "", target = ""] = key.split("→");
return {
id: key,
source,
diff --git a/packages/ui/src/graph/graph-community-panel.tsx b/packages/ui/src/graph/graph-community-panel.tsx
new file mode 100644
index 000000000..09ca652c9
--- /dev/null
+++ b/packages/ui/src/graph/graph-community-panel.tsx
@@ -0,0 +1,137 @@
+"use client";
+
+import { X, ArrowRight } from "lucide-react";
+import { Badge } from "../ui/badge";
+import { ScrollArea } from "../ui/scroll-area";
+import { Skeleton } from "../ui/skeleton";
+import { truncatePath } from "../lib/format";
+import type { CommunityDetail } from "@repowise-dev/types/graph";
+
+export interface GraphCommunityPanelProps {
+ /** Community id surfaced in the empty/loading title fallback. */
+ communityId: number;
+ /** Pre-fetched community detail; `null`/`undefined` while loading. */
+ community: CommunityDetail | null | undefined;
+ /** Loading flag from the consumer's data hook. */
+ isLoading: boolean;
+ onClose: () => void;
+}
+
+export function GraphCommunityPanel({
+ communityId,
+ community,
+ isLoading,
+ onClose,
+}: GraphCommunityPanelProps) {
+ return (
+ <div className="absolute right-0 top-0 bottom-0 w-full sm:w-[360px] border-l border-[var(--color-border-default)] bg-[var(--color-bg-surface)] z-10 flex flex-col shadow-lg shadow-black/20">
+ {/* Header */}
+ <div className="flex items-center justify-between px-4 py-3 border-b border-[var(--color-border-default)]">
+ <div className="min-w-0">
+ <p className="text-sm font-medium text-[var(--color-text-primary)] truncate">
+ {community?.label ?? `Community ${communityId}`}
+ </p>
+ {community && (
+ <p className="text-[10px] text-[var(--color-text-tertiary)]">
+ {community.member_count} files &middot; cohesion {(community.cohesion * 100).toFixed(0)}%
+ </p>
+ )}
+ </div>
+ <button
+ onClick={onClose}
+ className="p-1 rounded hover:bg-[var(--color-bg-elevated)] transition-colors"
+ >
+ <X className="h-4 w-4 text-[var(--color-text-tertiary)]" />
+ </button>
+ </div>
+
+ {/* Content */}
+ {isLoading ? (
+ <div className="p-4 space-y-2">
+ <Skeleton className="h-4 w-full" />
+ <Skeleton className="h-4 w-3/4" />
+ <Skeleton className="h-4 w-full" />
+ <Skeleton className="h-4 w-2/3" />
+ </div>
+ ) : community ? (
+ <ScrollArea className="flex-1">
+ <div className="p-4 space-y-4">
+ {/* Members */}
+ <div>
+ <p className="text-[11px] font-medium text-[var(--color-text-tertiary)] uppercase tracking-wider mb-2">
+ Members ({community.member_count})
+ </p>
+ <div className="space-y-1">
+ {community.members.map((m) => {
+ const maxPr = community.members[0]?.pagerank || 1;
+ const barWidth = maxPr > 0 ? Math.round((m.pagerank / maxPr) * 100) : 0;
+
+ return (
+ <div
+ key={m.path}
+ className="flex items-center gap-2 py-1 px-1.5 rounded hover:bg-[var(--color-bg-elevated)] transition-colors"
+ >
+ <div className="min-w-0 flex-1">
+ <p className="text-[11px] font-mono text-[var(--color-text-primary)] truncate" title={m.path}>
+ {truncatePath(m.path)}
+ </p>
+ </div>
+ {/* PageRank bar */}
+ <div className="w-16 h-1.5 rounded-full bg-[var(--color-bg-elevated)] overflow-hidden shrink-0">
+ <div
+ className="h-full rounded-full bg-[var(--color-accent)]"
+ style={{ width: `${barWidth}%` }}
+ />
+ </div>
+ {m.is_entry_point && (
+ <Badge variant="accent" className="text-[8px] h-3.5 shrink-0">
+ EP
+ </Badge>
+ )}
+ </div>
+ );
+ })}
+ {community.truncated && (
+ <p className="text-[10px] text-[var(--color-text-tertiary)] px-1.5 pt-1">
+ +{community.member_count - community.members.length} more files
+ </p>
+ )}
+ </div>
+ </div>
+
+ {/* Neighboring Communities */}
+ {community.neighboring_communities.length > 0 && (
+ <div>
+ <p className="text-[11px] font-medium text-[var(--color-text-tertiary)] uppercase tracking-wider mb-2">
+ Neighboring Communities
+ </p>
+ <div className="space-y-1">
+ {community.neighboring_communities.map((n) => (
+ <div
+ key={n.community_id}
+ className="flex items-center justify-between gap-2 py-1 px-1.5 rounded hover:bg-[var(--color-bg-elevated)] transition-colors"
+ >
+ <div className="flex items-center gap-1.5 min-w-0">
+ <ArrowRight className="h-3 w-3 shrink-0 text-[var(--color-text-tertiary)]" />
+ <span className="text-[11px] text-[var(--color-text-primary)] truncate">
+ {n.label}
+ </span>
+ </div>
+ <Badge variant="outline" className="text-[9px] shrink-0 h-4">
+ {n.cross_edge_count} edges
+ </Badge>
+ </div>
+ ))}
+ </div>
+ </div>
+ )}
+ </div>
+ </ScrollArea>
+ ) : (
+ <div className="p-4">
+ <p className="text-xs text-[var(--color-text-tertiary)]">Community not found</p>
+ </div>
+ )}
+ </div>
+ );
+}
diff --git a/packages/web/src/components/graph/graph-context-menu.tsx b/packages/ui/src/graph/graph-context-menu.tsx
similarity index 98%
rename from packages/web/src/components/graph/graph-context-menu.tsx
rename to packages/ui/src/graph/graph-context-menu.tsx
index 6e5721888..5c637f2a9 100644
--- a/packages/web/src/components/graph/graph-context-menu.tsx
+++ b/packages/ui/src/graph/graph-context-menu.tsx
@@ -30,7 +30,6 @@ export function GraphContextMenu({
className="fixed z-50 min-w-[200px] rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-overlay)] shadow-xl shadow-black/40 backdrop-blur-md py-1 text-xs"
style={{ left: x, top: y }}
>
- {/* Node name header */}
<div className="px-3 py-1.5 text-[10px] text-[var(--color-text-tertiary)] font-mono truncate border-b border-[var(--color-border-default)] mb-1">
{shortName}
</div>
diff --git a/packages/ui/src/graph/graph-doc-panel.tsx b/packages/ui/src/graph/graph-doc-panel.tsx
new file mode 100644
index 000000000..49208d078
--- /dev/null
+++ b/packages/ui/src/graph/graph-doc-panel.tsx
@@ -0,0 +1,139 @@
+"use client";
+
+import { useEffect, useRef } from "react";
+import {
+ X,
+ FileText,
+ ExternalLink,
+ Clock,
+ Cpu,
+ Loader2,
+ AlertCircle,
+} from "lucide-react";
+import { Button } from "../ui/button";
+import { Badge } from "../ui/badge";
+import { ChatMarkdown } from "../chat/chat-markdown";
+import { ConfidenceBadge } from "../wiki/confidence-badge";
+import { formatRelativeTime } from "../lib/format";
+import type { DocPage } from "@repowise-dev/types/docs";
+
+export interface GraphDocPanelProps {
+ /** Node id whose docs are being shown. Used in the header subtitle. */
+ nodeId: string;
+ /** Pre-fetched doc page; `null`/`undefined` while loading or when missing. */
+ page: DocPage | null | undefined;
+ /** Loading flag from the consumer's data hook. */
+ isLoading: boolean;
+ /** Truthy when no doc page exists for this node. */
+ error?: unknown;
+ /** Href for the "open full page" external-link icon. Provided by consumer. */
+ fullPageHref?: string;
+ /** Href for the "browse all docs" fallback link inside the empty state. */
+ browseDocsHref?: string;
+ onClose: () => void;
+}
+
+export function GraphDocPanel({
+ nodeId,
+ page,
+ isLoading,
+ error,
+ fullPageHref,
+ browseDocsHref,
+ onClose,
+}: GraphDocPanelProps) {
+ const scrollRef = useRef<HTMLDivElement>(null);
+
+ useEffect(() => {
+ scrollRef.current?.scrollTo?.(0, 0);
+ }, [nodeId]);
+
+ return (
+ <div className="absolute top-0 right-0 z-20 h-full w-[min(400px,calc(100vw-1.5rem))] flex flex-col bg-[var(--color-bg-surface)] border-l border-[var(--color-border-default)] shadow-2xl shadow-black/30">
+ {/* Header */}
+ <div className="flex items-center gap-2 px-4 py-3 border-b border-[var(--color-border-default)] shrink-0">
+ <FileText className="h-4 w-4 text-[var(--color-accent-primary)] shrink-0" />
+ <div className="flex-1 min-w-0">
+ <p className="text-xs font-medium text-[var(--color-text-primary)] truncate">
+ {page?.title ?? nodeId.split("/").pop()}
+ </p>
+ <p className="text-[10px] text-[var(--color-text-tertiary)] font-mono truncate">
+ {nodeId}
+ </p>
+ </div>
+ <div className="flex items-center gap-1.5 shrink-0">
+ {page && fullPageHref && (
+ <a
+ href={fullPageHref}
+ className="text-[var(--color-text-tertiary)] hover:text-[var(--color-accent-primary)] transition-colors p-1"
+ title="Open full page"
+ >
+ <ExternalLink className="h-3.5 w-3.5" />
+ </a>
+ )}
+ <Button
+ size="sm"
+ variant="ghost"
+ onClick={onClose}
+ className="h-6 w-6 p-0"
+ >
+ <X className="h-3.5 w-3.5" />
+ </Button>
+ </div>
+ </div>
+
+ {/* Meta bar */}
+ {page && (
+ <div className="flex items-center gap-2 px-4 py-2 border-b border-[var(--color-border-default)] shrink-0 flex-wrap">
+ <ConfidenceBadge
+ score={page.confidence}
+ status={page.freshness_status}
+ showScore
+ />
+ <Badge variant="outline" className="font-mono text-[10px]">
+ <Cpu className="h-2.5 w-2.5 mr-0.5" />
+ {page.model_name}
+ </Badge>
+ <span className="text-[10px] text-[var(--color-text-tertiary)] flex items-center gap-1 ml-auto">
+ <Clock className="h-2.5 w-2.5" />
+ {formatRelativeTime(page.updated_at)}
+ </span>
+ </div>
+ )}
+
+ {/* Content */}
+ <div ref={scrollRef} className="flex-1 overflow-y-auto">
+ {isLoading && (
+ <div className="flex items-center justify-center h-32">
+ <Loader2 className="h-5 w-5 animate-spin text-[var(--color-accent-primary)]" />
+ </div>
+ )}
+
+ {Boolean(error) && !isLoading && (
+ <div className="flex flex-col items-center justify-center h-32 gap-2 px-6 text-center">
+ <AlertCircle className="h-5 w-5 text-[var(--color-text-tertiary)]" />
+ <p className="text-xs text-[var(--color-text-tertiary)]">
+ No documentation found for this file.
+ </p>
+ {browseDocsHref && (
+ <a
+ href={browseDocsHref}
+ className="text-xs text-[var(--color-accent-primary)] hover:underline"
+ >
+ Browse all docs
+ </a>
+ )}
+ </div>
+ )}
+
+ {page && !isLoading && (
+ <div className="px-4 py-4">
+ <article className="prose-chat text-xs">
+ <ChatMarkdown content={page.content} />
+ </article>
+ </div>
+ )}
+ </div>
+ </div>
+ );
+}
diff --git a/packages/web/src/components/graph/graph-ego-sidebar.tsx b/packages/ui/src/graph/graph-ego-sidebar.tsx
similarity index 71%
rename from packages/web/src/components/graph/graph-ego-sidebar.tsx
rename to packages/ui/src/graph/graph-ego-sidebar.tsx
index 7ad3eb246..9d8a3ec4b 100644
--- a/packages/web/src/components/graph/graph-ego-sidebar.tsx
+++ b/packages/ui/src/graph/graph-ego-sidebar.tsx
@@ -1,12 +1,12 @@
"use client";
import { X, GitCommit, User, Clock, ArrowDownToLine, ArrowUpFromLine, FileText } from "lucide-react";
-import { Button } from "@/components/ui/button";
-import { formatRelativeTime } from "@/lib/utils/format";
-import type { EgoGraphResponse } from "@/lib/api/types";
+import { Button } from "../ui/button";
+import { formatRelativeTime } from "../lib/format";
+import type { EgoGraph } from "@repowise-dev/types/graph";
interface GraphEgoSidebarProps {
- graph: EgoGraphResponse;
+ graph: EgoGraph;
onClose: () => void;
onNavigateToNode?: (nodeId: string) => void;
}
@@ -17,7 +17,6 @@ export function GraphEgoSidebar({ graph, onClose, onNavigateToNode }: GraphEgoSi
return (
<div className="absolute top-3 right-3 z-20 w-[min(18rem,calc(100vw-1.5rem))] rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-overlay)]/95 backdrop-blur-sm shadow-xl text-xs">
- {/* Header */}
<div className="flex items-start justify-between p-3 border-b border-[var(--color-border-default)]">
<div className="flex-1 min-w-0">
<div className="flex items-center gap-1.5 mb-0.5">
@@ -35,7 +34,6 @@ export function GraphEgoSidebar({ graph, onClose, onNavigateToNode }: GraphEgoSi
</Button>
</div>
- {/* Stats */}
<div className="p-3 space-y-2">
<div className="grid grid-cols-2 gap-2">
<div className="rounded-md bg-[var(--color-bg-elevated)] p-2">
@@ -67,46 +65,42 @@ export function GraphEgoSidebar({ graph, onClose, onNavigateToNode }: GraphEgoSi
</div>
)}
- {/* Git metadata */}
{meta && (
- <>
- <div className="border-t border-[var(--color-border-default)] pt-2 space-y-1.5">
- {meta.primary_owner_name && (
- <div className="flex items-center justify-between text-[var(--color-text-secondary)]">
- <div className="flex items-center gap-1.5">
- <User className="h-3 w-3" />
- <span>Owner</span>
- </div>
- <span className="font-medium text-[var(--color-text-primary)] truncate max-w-[120px]">
- {meta.primary_owner_name}
- </span>
- </div>
- )}
- {meta.last_commit_at != null && (
- <div className="flex items-center justify-between text-[var(--color-text-secondary)]">
- <div className="flex items-center gap-1.5">
- <Clock className="h-3 w-3" />
- <span>Last commit</span>
- </div>
- <span className="font-medium text-[var(--color-text-primary)]">
- {formatRelativeTime(meta.last_commit_at)}
- </span>
+ <div className="border-t border-[var(--color-border-default)] pt-2 space-y-1.5">
+ {meta.primary_owner_name && (
+ <div className="flex items-center justify-between text-[var(--color-text-secondary)]">
+ <div className="flex items-center gap-1.5">
+ <User className="h-3 w-3" />
+ <span>Owner</span>
</div>
- )}
+ <span className="font-medium text-[var(--color-text-primary)] truncate max-w-[120px]">
+ {meta.primary_owner_name}
+ </span>
+ </div>
+ )}
+ {meta.last_commit_at != null && (
<div className="flex items-center justify-between text-[var(--color-text-secondary)]">
<div className="flex items-center gap-1.5">
- <GitCommit className="h-3 w-3" />
- <span>Commits (30d)</span>
+ <Clock className="h-3 w-3" />
+ <span>Last commit</span>
</div>
- <span className="font-medium text-[var(--color-text-primary)] tabular-nums">
- {meta.commit_count_30d}
+ <span className="font-medium text-[var(--color-text-primary)]">
+ {formatRelativeTime(meta.last_commit_at)}
</span>
</div>
+ )}
+ <div className="flex items-center justify-between text-[var(--color-text-secondary)]">
+ <div className="flex items-center gap-1.5">
+ <GitCommit className="h-3 w-3" />
+ <span>Commits (30d)</span>
+ </div>
+ <span className="font-medium text-[var(--color-text-primary)] tabular-nums">
+ {meta.commit_count_30d}
+ </span>
</div>
- </>
+ </div>
)}
- {/* Neighborhood nodes */}
{graph.nodes.length > 1 && (
<div className="border-t border-[var(--color-border-default)] pt-2">
<p className="text-[var(--color-text-tertiary)] mb-1.5">
diff --git a/packages/ui/src/graph/graph-flow.tsx b/packages/ui/src/graph/graph-flow.tsx
new file mode 100644
index 000000000..99a3bdc9b
--- /dev/null
+++ b/packages/ui/src/graph/graph-flow.tsx
@@ -0,0 +1,818 @@
+"use client";
+
+import {
+ useCallback,
+ useMemo,
+ useState,
+ useEffect,
+ useRef,
+ type ReactNode,
+} from "react";
+import {
+ ReactFlow,
+ MiniMap,
+ Controls,
+ Background,
+ BackgroundVariant,
+ ReactFlowProvider,
+ useReactFlow,
+ type NodeMouseHandler,
+ type Node,
+} from "@xyflow/react";
+import "@xyflow/react/dist/style.css";
+import { Loader2, ChevronRight, Home } from "lucide-react";
+import Fuse from "fuse.js";
+import { Skeleton } from "../ui/skeleton";
+import { EmptyState } from "../shared/empty-state";
+import { ModuleGroupNode } from "./nodes/module-group-node";
+import { FileNode } from "./nodes/file-node";
+import { DependencyEdge } from "./edges/dependency-edge";
+import { GraphProvider, type GraphContextValue } from "./context";
+import { GraphTooltip } from "./graph-tooltip";
+import { groupNodesAsModules, type FileNodeData } from "./elk-layout";
+import { useModuleElkLayout, useFileElkLayout } from "./use-elk-layout";
+import { GraphToolbar, type ColorMode, type ViewMode } from "./graph-toolbar";
+import { GraphLegend } from "./graph-legend";
+import { GraphContextMenu } from "./graph-context-menu";
+import { languageColor } from "../lib/confidence";
+import type {
+ GraphExport,
+ ModuleGraph,
+ ExecutionFlows,
+ CommunitySummaryItem,
+} from "@repowise-dev/types/graph";
+
+// ---- Node/Edge types ----
+
+const nodeTypes = {
+ moduleGroup: ModuleGroupNode,
+ fileNode: FileNode,
+};
+
+const edgeTypes = {
+ dependency: DependencyEdge,
+};
+
+// ---- Props ----
+
+export interface GraphFlowProps {
+ /** Top-level module rollup; only fetched/needed for the module view at root. */
+ moduleGraph: ModuleGraph | undefined;
+ isLoadingModuleGraph: boolean;
+
+ /** Full file-level graph; needed for drill-down and the "full" view. */
+ fullGraph: GraphExport | undefined;
+ isLoadingFullGraph: boolean;
+
+ /** Architecture view graph. */
+ architectureGraph: GraphExport | undefined;
+ isLoadingArchitectureGraph: boolean;
+
+ /** Dead-code view graph. */
+ deadCodeGraph: GraphExport | undefined;
+ isLoadingDeadCodeGraph: boolean;
+
+ /** Hot-files view graph. */
+ hotFilesGraph: GraphExport | undefined;
+ isLoadingHotFilesGraph: boolean;
+
+ /** Community list — used for legend labels and detail panel lookup. */
+ communities?: CommunitySummaryItem[];
+
+ /** Execution-flows data — used for the side panel and trace highlighting. */
+ executionFlows?: ExecutionFlows;
+
+ /**
+ * Called when a view-mode change requires the consumer to (re)load
+ * datasets that aren't already supplied. The shell does NOT fetch — the
+ * wrapper observes this and triggers SWR / mutate as needed.
+ */
+ onViewModeChange?: (mode: ViewMode) => void;
+ /** Same idea for drill-down. The shell exposes the current module path. */
+ onModulePathChange?: (path: string[]) => void;
+
+ /** Node-level interactions surfaced to the consumer. */
+ onNodeClick?: (nodeId: string, nodeType: string) => void | Promise<void>;
+ onNodeViewDocs?: (nodeId: string) => void;
+
+ /**
+ * Render the path-finder sub-panel. The shell only decides when to mount
+ * it and provides path-finder context (initial from/to, callbacks).
+ */
+ renderPathFinder?: (props: {
+ initialFrom: string;
+ initialTo: string;
+ onPathFound: (pathNodes: string[]) => void;
+ onClear: () => void;
+ onClose: () => void;
+ }) => ReactNode;
+
+ /**
+ * Render the community detail panel. The shell only owns the
+ * `communityId` selection state.
+ */
+ renderCommunityPanel?: (props: {
+ communityId: number;
+ onClose: () => void;
+ }) => ReactNode;
+}
+
+// ---- Inner component (needs ReactFlowProvider) ----
+
+function GraphFlowInner(props: GraphFlowProps) {
+ const {
+ moduleGraph,
+ isLoadingModuleGraph,
+ fullGraph,
+ isLoadingFullGraph,
+ architectureGraph,
+ isLoadingArchitectureGraph,
+ deadCodeGraph,
+ isLoadingDeadCodeGraph,
+ hotFilesGraph,
+ isLoadingHotFilesGraph,
+ communities,
+ executionFlows,
+ onViewModeChange,
+ onModulePathChange,
+ onNodeClick,
+ onNodeViewDocs,
+ renderPathFinder,
+ renderCommunityPanel,
+ } = props;
+
+ const reactFlow = useReactFlow();
+
+ // State — read initial colorMode from URL if present
+ const [viewMode, setViewMode] = useState<ViewMode>("module");
+ const [colorMode, setColorMode] = useState<ColorMode>(() => {
+ if (typeof window !== "undefined") {
+ const params = new URLSearchParams(window.location.search);
+ const cm = params.get("colorMode");
+ if (cm === "community" || cm === "language" || cm === "risk") return cm;
+ }
+ return "language";
+ });
+ const [hideTests, setHideTests] = useState(false);
+ const [highlightedPath, setHighlightedPath] = useState<Set<string>>(new Set());
+ const [highlightedEdges, setHighlightedEdges] = useState<Set<string>>(new Set());
+ const [showPathFinder, setShowPathFinder] = useState(false);
+
+ // Drill-down: stack of module prefixes. e.g. ["packages", "packages/web"]
+ const [modulePath, setModulePath] = useState<string[]>([]);
+ const currentPrefix = modulePath.length > 0 ? (modulePath[modulePath.length - 1] ?? "") : "";
+ const isDrilledDown = modulePath.length > 0;
+
+ // Notify consumer of module-path changes (so it can fetch full graph etc.)
+ useEffect(() => {
+ onModulePathChange?.(modulePath);
+ }, [modulePath, onModulePathChange]);
+
+ // Context menu
+ const [ctxMenu, setCtxMenu] = useState<{
+ x: number; y: number; nodeId: string; nodeType: string;
+ } | null>(null);
+
+ // Path finder pre-fill
+ const [pathFrom, setPathFrom] = useState("");
+ const [pathTo, setPathTo] = useState("");
+
+ // Hover & selection tracking
+ const [hoveredNodeId, setHoveredNodeId] = useState<string | null>(null);
+ const [selectedNodeId, setSelectedNodeId] = useState<string | null>(null);
+ const [selectedNodeScreen, setSelectedNodeScreen] = useState<{ x: number; y: number } | null>(null);
+
+ // Graph search
+ const [searchQuery, setSearchQuery] = useState("");
+ const [searchDimmedNodes, setSearchDimmedNodes] = useState<Set<string> | null>(null);
+
+ // Execution flow highlighting
+ const [activeFlowIdx, setActiveFlowIdx] = useState<number | null>(null);
+ const [showFlows, setShowFlows] = useState(false);
+
+ // Community panel selection
+ const [communityPanelId, setCommunityPanelId] = useState<number | null>(null);
+
+ // ---- Data selection (consumer supplies the data; shell picks the right slice) ----
+ const isModuleView = viewMode === "module";
+
+ const communityLabels = useMemo(() => {
+ if (!communities) return undefined;
+ const m = new Map<number, string>();
+ for (const c of communities) m.set(c.community_id, c.label);
+ return m;
+ }, [communities]);
+
+ // ---- Derived data ----
+
+ // When drilled down, re-group nodes as sub-modules at the current prefix
+ const drillDownData = useMemo(() => {
+ if (!isDrilledDown || !fullGraph) return null;
+ return groupNodesAsModules(fullGraph.nodes, fullGraph.links, currentPrefix);
+ }, [isDrilledDown, fullGraph, currentPrefix]);
+
+ // File-level graph data — only for non-module views
+ const fileGraphData = useMemo(() => {
+ switch (viewMode) {
+ case "full":
+ return fullGraph ? { nodes: fullGraph.nodes, links: fullGraph.links } : undefined;
+ case "architecture":
+ return architectureGraph
+ ? { nodes: architectureGraph.nodes, links: architectureGraph.links }
+ : undefined;
+ case "dead":
+ return deadCodeGraph
+ ? { nodes: deadCodeGraph.nodes, links: deadCodeGraph.links }
+ : undefined;
+ case "hotfiles":
+ return hotFilesGraph
+ ? { nodes: hotFilesGraph.nodes, links: hotFilesGraph.links }
+ : undefined;
+ default:
+ return undefined;
+ }
+ }, [viewMode, fullGraph, architectureGraph, deadCodeGraph, hotFilesGraph]);
+
+ // ---- Layout selection ----
+ const moduleLayoutInput = useMemo(() => {
+ if (!isModuleView) return { nodes: undefined, edges: undefined, fileEntries: undefined };
+ if (!isDrilledDown) {
+ return { nodes: moduleGraph?.nodes, edges: moduleGraph?.edges, fileEntries: undefined };
+ }
+ return {
+ nodes: drillDownData?.moduleNodes,
+ edges: drillDownData?.moduleEdges,
+ fileEntries: drillDownData?.fileEntries,
+ };
+ }, [isModuleView, isDrilledDown, moduleGraph, drillDownData]);
+
+ const {
+ nodes: moduleNodes,
+ edges: moduleEdges,
+ isLayouting: moduleLayouting,
+ } = useModuleElkLayout(moduleLayoutInput.nodes, moduleLayoutInput.edges, moduleLayoutInput.fileEntries);
+
+ const {
+ nodes: fileNodes,
+ edges: fileEdges,
+ isLayouting: fileLayouting,
+ } = useFileElkLayout(
+ !isModuleView ? fileGraphData?.nodes : undefined,
+ !isModuleView ? fileGraphData?.links : undefined,
+ );
+
+ const currentNodes = isModuleView ? moduleNodes : fileNodes;
+ const currentEdges = isModuleView ? moduleEdges : fileEdges;
+
+ // Filter hidden tests
+ const filteredNodes = useMemo(() => {
+ if (!hideTests) return currentNodes;
+ return currentNodes.filter((n) => {
+ if (n.type === "fileNode") {
+ return !(n.data as { isTest?: boolean }).isTest;
+ }
+ return true;
+ });
+ }, [currentNodes, hideTests]);
+
+ const isLoading =
+ (isModuleView && !isDrilledDown) ? isLoadingModuleGraph :
+ isDrilledDown ? isLoadingFullGraph :
+ viewMode === "full" ? isLoadingFullGraph :
+ viewMode === "architecture" ? isLoadingArchitectureGraph :
+ viewMode === "dead" ? isLoadingDeadCodeGraph :
+ viewMode === "hotfiles" ? isLoadingHotFilesGraph : false;
+ const isLayouting = isModuleView ? moduleLayouting : fileLayouting;
+
+ // Compute connected nodes/edges for hover highlighting
+ const { connectedNodeIds, connectedEdgeIds } = useMemo(() => {
+ if (!hoveredNodeId) return { connectedNodeIds: new Set<string>(), connectedEdgeIds: new Set<string>() };
+ const nodeIds = new Set<string>([hoveredNodeId]);
+ const edgeIds = new Set<string>();
+ for (const edge of currentEdges) {
+ if (edge.source === hoveredNodeId || edge.target === hoveredNodeId) {
+ edgeIds.add(edge.id);
+ nodeIds.add(edge.source);
+ nodeIds.add(edge.target);
+ }
+ }
+ return { connectedNodeIds: nodeIds, connectedEdgeIds: edgeIds };
+ }, [hoveredNodeId, currentEdges]);
+
+ // Fuse search index over visible nodes
+ const fuseIndex = useMemo(() => {
+ const items = filteredNodes.map((n) => ({ id: n.id, label: (n.data as { label?: string }).label ?? n.id }));
+ return new Fuse(items, { keys: ["id", "label"], threshold: 0.4 });
+ }, [filteredNodes]);
+
+ // Search: compute dimmed set when query is active
+ useEffect(() => {
+ if (!searchQuery || searchQuery.length < 2) {
+ setSearchDimmedNodes(null);
+ return;
+ }
+ const results = fuseIndex.search(searchQuery);
+ const matchIds = new Set(results.map((r) => r.item.id));
+ const dimmed = new Set<string>();
+ for (const n of filteredNodes) {
+ if (!matchIds.has(n.id)) dimmed.add(n.id);
+ }
+ setSearchDimmedNodes(dimmed);
+
+ if (results.length > 0 && results.length <= 20) {
+ const matchedRfNodes = results
+ .map((r) => reactFlow.getNode(r.item.id))
+ .filter(Boolean) as Node[];
+ if (matchedRfNodes.length > 0) {
+ reactFlow.fitView({ nodes: matchedRfNodes, padding: 0.4, duration: 500 });
+ }
+ }
+ }, [searchQuery, fuseIndex, filteredNodes, reactFlow]);
+
+ // Execution flow highlighting
+ useEffect(() => {
+ if (activeFlowIdx === null || !executionFlows) {
+ if (activeFlowIdx === null && showFlows) {
+ setHighlightedPath(new Set());
+ setHighlightedEdges(new Set());
+ }
+ return;
+ }
+ const flow = executionFlows.flows[activeFlowIdx];
+ if (!flow) return;
+ const pathSet = new Set(flow.trace);
+ const edgeKeys = new Set<string>();
+ for (let i = 0; i < flow.trace.length - 1; i++) {
+ edgeKeys.add(`${flow.trace[i]}→${flow.trace[i + 1]}`);
+ edgeKeys.add(`${flow.trace[i + 1]}→${flow.trace[i]}`);
+ }
+ setHighlightedPath(pathSet);
+ setHighlightedEdges(edgeKeys);
+
+ if (viewMode === "module") {
+ setViewMode("full");
+ setModulePath([]);
+ onViewModeChange?.("full");
+ }
+
+ setTimeout(() => {
+ const traceNodes = flow.trace
+ .map((id) => reactFlow.getNode(id))
+ .filter(Boolean) as Node[];
+ if (traceNodes.length > 0) {
+ reactFlow.fitView({ nodes: traceNodes, padding: 0.3, duration: 600 });
+ }
+ }, 800);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [activeFlowIdx, executionFlows]);
+
+ // Context value
+ const ctxValue = useMemo<GraphContextValue>(
+ () => ({
+ highlightedPath,
+ highlightedEdges,
+ colorMode,
+ riskScores: new Map(),
+ hoveredNodeId,
+ connectedNodeIds,
+ connectedEdgeIds,
+ selectedNodeId,
+ searchDimmedNodes,
+ }),
+ [highlightedPath, highlightedEdges, colorMode, hoveredNodeId, connectedNodeIds, connectedEdgeIds, selectedNodeId, searchDimmedNodes],
+ );
+
+ // ---- Handlers ----
+
+ const handleNodeClick: NodeMouseHandler = useCallback(
+ (event, node) => {
+ if (node.type === "moduleGroup" && isModuleView) {
+ setModulePath((prev) => [...prev, node.id]);
+ setSelectedNodeId(null);
+ return;
+ }
+ if (colorMode === "community" && node.type === "fileNode") {
+ const nodeData = node.data as FileNodeData;
+ if (nodeData?.communityId !== undefined) {
+ setCommunityPanelId(nodeData.communityId);
+ }
+ }
+
+ const mEvent = event as unknown as React.MouseEvent;
+ if (selectedNodeId === node.id) {
+ setSelectedNodeId(null);
+ setSelectedNodeScreen(null);
+ } else {
+ setSelectedNodeId(node.id);
+ setSelectedNodeScreen({ x: mEvent.clientX, y: mEvent.clientY });
+ }
+ },
+ [isModuleView, selectedNodeId, colorMode],
+ );
+
+ const handleNodeMouseEnter: NodeMouseHandler = useCallback(
+ (_event, node) => { setHoveredNodeId(node.id); },
+ [],
+ );
+
+ const handleNodeMouseLeave: NodeMouseHandler = useCallback(
+ () => { setHoveredNodeId(null); },
+ [],
+ );
+
+ const handleNodeDoubleClick: NodeMouseHandler = useCallback(
+ (_event, node) => {
+ if (node.type !== "moduleGroup") {
+ onNodeViewDocs?.(node.id);
+ }
+ },
+ [onNodeViewDocs],
+ );
+
+ const handleNodeContextMenu: NodeMouseHandler = useCallback(
+ (event, node) => {
+ event.preventDefault();
+ setCtxMenu({
+ x: (event as unknown as React.MouseEvent).clientX,
+ y: (event as unknown as React.MouseEvent).clientY,
+ nodeId: node.id,
+ nodeType: node.type ?? "fileNode",
+ });
+ },
+ [],
+ );
+
+ useEffect(() => {
+ if (!ctxMenu) return;
+ const close = () => setCtxMenu(null);
+ const onKey = (e: KeyboardEvent) => {
+ if (e.key === "Escape") close();
+ };
+ window.addEventListener("click", close);
+ window.addEventListener("keydown", onKey);
+ return () => {
+ window.removeEventListener("click", close);
+ window.removeEventListener("keydown", onKey);
+ };
+ }, [ctxMenu]);
+
+ const handlePathFound = useCallback(
+ (pathNodes: string[]) => {
+ setHighlightedPath(new Set(pathNodes));
+ const edgeKeys = new Set<string>();
+ for (let i = 0; i < pathNodes.length - 1; i++) {
+ edgeKeys.add(`${pathNodes[i]}→${pathNodes[i + 1]}`);
+ edgeKeys.add(`${pathNodes[i + 1]}→${pathNodes[i]}`);
+ }
+ setHighlightedEdges(edgeKeys);
+ if (viewMode === "module") {
+ setViewMode("full");
+ setModulePath([]);
+ onViewModeChange?.("full");
+ }
+ setTimeout(() => {
+ const pathRfNodes = pathNodes
+ .map((id) => reactFlow.getNode(id))
+ .filter(Boolean) as Node[];
+ if (pathRfNodes.length > 0) {
+ reactFlow.fitView({ nodes: pathRfNodes, padding: 0.3, duration: 600 });
+ }
+ }, 800);
+ },
+ [viewMode, reactFlow, onViewModeChange],
+ );
+
+ const handlePathClear = useCallback(() => {
+ setHighlightedPath(new Set());
+ setHighlightedEdges(new Set());
+ }, []);
+
+ const handleFitView = useCallback(() => {
+ reactFlow.fitView({ padding: 0.15, duration: 400 });
+ }, [reactFlow]);
+
+ const handleViewChange = useCallback((v: ViewMode) => {
+ setViewMode(v);
+ setModulePath([]);
+ setHighlightedPath(new Set());
+ setHighlightedEdges(new Set());
+ setSelectedNodeId(null);
+ setSelectedNodeScreen(null);
+ onViewModeChange?.(v);
+ }, [onViewModeChange]);
+
+ // Breadcrumb
+ const handleBreadcrumbClick = useCallback((index: number) => {
+ if (index < 0) {
+ setModulePath([]);
+ } else {
+ setModulePath((prev) => prev.slice(0, index + 1));
+ }
+ }, []);
+
+ // Context menu actions
+ const handleCtxViewDocs = useCallback(() => {
+ if (ctxMenu) onNodeViewDocs?.(ctxMenu.nodeId);
+ setCtxMenu(null);
+ }, [ctxMenu, onNodeViewDocs]);
+
+ const handleCtxExplore = useCallback(() => {
+ if (ctxMenu) {
+ if (ctxMenu.nodeType === "moduleGroup" && isModuleView) {
+ setModulePath((prev) => [...prev, ctxMenu.nodeId]);
+ } else {
+ onNodeClick?.(ctxMenu.nodeId, ctxMenu.nodeType);
+ }
+ }
+ setCtxMenu(null);
+ }, [ctxMenu, isModuleView, onNodeClick]);
+
+ const handleCtxPathFrom = useCallback(() => {
+ if (ctxMenu) { setPathFrom(ctxMenu.nodeId); setShowPathFinder(true); }
+ setCtxMenu(null);
+ }, [ctxMenu]);
+
+ const handleCtxPathTo = useCallback(() => {
+ if (ctxMenu) { setPathTo(ctxMenu.nodeId); setShowPathFinder(true); }
+ setCtxMenu(null);
+ }, [ctxMenu]);
+
+ // After layout completes, zoom to entry-point nodes for a readable first view
+ const hasFocusedRef = useRef(false);
+
+ useEffect(() => {
+ if (isLayouting || filteredNodes.length === 0 || hasFocusedRef.current) return;
+ hasFocusedRef.current = true;
+
+ const timer = setTimeout(() => {
+ switch (viewMode) {
+ case "dead":
+ case "hotfiles":
+ case "architecture": {
+ reactFlow.fitView({ padding: 0.3, duration: 600, maxZoom: 1.5 });
+ return;
+ }
+ case "module": {
+ reactFlow.fitView({ padding: 0.2, duration: 600, maxZoom: 1 });
+ return;
+ }
+ default:
+ break;
+ }
+ reactFlow.fitView({ padding: 0.15, duration: 600, maxZoom: 0.6 });
+ }, 100);
+
+ return () => clearTimeout(timer);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [isLayouting, filteredNodes, reactFlow]);
+
+ // Reset focus flag when view mode changes
+ useEffect(() => {
+ hasFocusedRef.current = false;
+ }, [viewMode]);
+
+ const minimapNodeColor = useCallback(
+ (node: Node) => {
+ if (node.type === "moduleGroup") {
+ const pct = (node.data as { docCoveragePct?: number }).docCoveragePct;
+ if (pct != null) return pct >= 0.7 ? "#22c55e" : pct >= 0.3 ? "#f59520" : "#ef4444";
+ return "#3b82f6";
+ }
+ const lang = (node.data as { language?: string }).language;
+ return lang ? languageColor(lang) : "#8b5cf6";
+ },
+ [],
+ );
+
+ if (isLoading) return <Skeleton className="h-full w-full rounded-lg" />;
+
+ return (
+ <GraphProvider value={ctxValue}>
+ <div className="relative w-full h-full" style={{ touchAction: "none" }} aria-label="Dependency graph">
+ {isLayouting && (
+ <div className="absolute inset-0 z-50 flex items-center justify-center bg-[var(--color-bg-root)]/60 backdrop-blur-sm rounded-lg">
+ <div className="flex items-center gap-3 text-sm text-[var(--color-text-secondary)]">
+ <Loader2 className="w-5 h-5 animate-spin text-[var(--color-accent-graph)]" />
+ Computing layout...
+ </div>
+ </div>
+ )}
+
+ {filteredNodes.length === 0 && !isLayouting ? (
+ <div className="flex items-center justify-center h-full">
+ <EmptyState
+ title="No graph data"
+ description="Check that the backend is running and this repo has been indexed."
+ />
+ </div>
+ ) : (
+ <ReactFlow
+ nodes={filteredNodes}
+ edges={currentEdges}
+ nodeTypes={nodeTypes}
+ edgeTypes={edgeTypes}
+ onNodeClick={handleNodeClick}
+ onNodeDoubleClick={handleNodeDoubleClick}
+ onNodeContextMenu={handleNodeContextMenu}
+ onNodeMouseEnter={handleNodeMouseEnter}
+ onNodeMouseLeave={handleNodeMouseLeave}
+ onPaneClick={() => { setSelectedNodeId(null); setSelectedNodeScreen(null); }}
+ fitView
+ fitViewOptions={{ padding: 0.3, maxZoom: 1.2 }}
+ minZoom={0.05}
+ maxZoom={4}
+ proOptions={{ hideAttribution: true }}
+ className="!bg-transparent"
+ nodesDraggable={false}
+ defaultEdgeOptions={{ type: "dependency" }}
+ >
+ <Background variant={BackgroundVariant.Dots} gap={16} size={0.5} color="rgba(255,255,255,0.03)" />
+ <Controls
+ showInteractive={false}
+ className="!border-[var(--color-border-default)] !bg-[var(--color-bg-elevated)] !shadow-lg !shadow-black/20 [&>button]:!border-[var(--color-border-default)] [&>button]:!bg-[var(--color-bg-elevated)] [&>button]:!text-[var(--color-text-secondary)] [&>button:hover]:!bg-[var(--color-bg-overlay)] [&>button:hover]:!text-[var(--color-text-primary)]"
+ />
+ <MiniMap
+ nodeColor={minimapNodeColor}
+ maskColor="rgba(0, 0, 0, 0.6)"
+ className="!bg-[var(--color-bg-surface)] !border-[var(--color-border-default)] !shadow-lg !shadow-black/20 !rounded-lg !hidden sm:!block"
+ pannable
+ zoomable
+ />
+ </ReactFlow>
+ )}
+
+ {/* Breadcrumb — shown when drilled into a module */}
+ {isModuleView && isDrilledDown && (
+ <div className="absolute top-3 left-3 z-10">
+ <div className="flex items-center gap-1 rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)]/90 backdrop-blur-sm px-2.5 py-1.5 shadow-lg shadow-black/20">
+ <button
+ onClick={() => handleBreadcrumbClick(-1)}
+ className="flex items-center gap-1 text-[11px] text-[var(--color-text-tertiary)] hover:text-[var(--color-accent-graph)] transition-colors"
+ >
+ <Home className="w-3 h-3" />
+ <span>Root</span>
+ </button>
+ {modulePath.map((fullPrefix, i) => {
+ const prevPrefix = i > 0 ? modulePath[i - 1] + "/" : "";
+ const label = fullPrefix.slice(prevPrefix.length);
+ const isLast = i === modulePath.length - 1;
+ return (
+ <span key={i} className="flex items-center gap-1">
+ <ChevronRight className="w-3 h-3 text-[var(--color-text-tertiary)]" />
+ <button
+ onClick={() => !isLast && handleBreadcrumbClick(i)}
+ className={`text-[11px] font-mono transition-colors ${
+ isLast
+ ? "text-[var(--color-text-primary)] font-medium cursor-default"
+ : "text-[var(--color-text-tertiary)] hover:text-[var(--color-accent-graph)]"
+ }`}
+ >
+ {label}
+ </button>
+ </span>
+ );
+ })}
+ </div>
+ </div>
+ )}
+
+ {/* Toolbar */}
+ <div className="absolute top-3 right-3 z-10">
+ <GraphToolbar
+ viewMode={viewMode}
+ onViewChange={handleViewChange}
+ colorMode={colorMode}
+ onColorModeChange={setColorMode}
+ hideTests={hideTests}
+ onHideTestsChange={setHideTests}
+ onFitView={handleFitView}
+ showPathFinder={showPathFinder}
+ onTogglePathFinder={() => setShowPathFinder((s) => !s)}
+ showFlows={showFlows}
+ onToggleFlows={() => { setShowFlows((s) => !s); setActiveFlowIdx(null); }}
+ searchQuery={searchQuery}
+ onSearchChange={setSearchQuery}
+ />
+ </div>
+
+ {/* Path Finder — rendered via consumer slot (data-coupled) */}
+ {showPathFinder && renderPathFinder && (
+ <div className="absolute top-14 right-3 z-10">
+ {renderPathFinder({
+ initialFrom: pathFrom,
+ initialTo: pathTo,
+ onPathFound: handlePathFound,
+ onClear: handlePathClear,
+ onClose: () => setShowPathFinder(false),
+ })}
+ </div>
+ )}
+
+ {/* Execution Flows Panel */}
+ {showFlows && executionFlows && executionFlows.flows.length > 0 && (
+ <div className="absolute top-14 right-3 z-10 w-[min(16rem,calc(100vw-1.5rem))]">
+ <div className="rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)]/95 backdrop-blur-sm shadow-lg shadow-black/20 p-3">
+ <div className="flex items-center justify-between mb-2">
+ <span className="text-[11px] font-medium text-[var(--color-text-primary)]">
+ Execution Flows
+ </span>
+ <span className="text-[10px] text-[var(--color-text-tertiary)]">
+ {executionFlows.flows.length} entry points
+ </span>
+ </div>
+ <div className="space-y-1 max-h-60 overflow-y-auto">
+ {executionFlows.flows.map((flow, idx) => (
+ <button
+ key={flow.entry_point}
+ onClick={() => setActiveFlowIdx(activeFlowIdx === idx ? null : idx)}
+ className={`w-full text-left px-2 py-1.5 rounded-md text-[11px] transition-colors ${
+ activeFlowIdx === idx
+ ? "bg-[var(--color-accent-primary)]/15 text-[var(--color-accent-primary)]"
+ : "text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-overlay)] hover:text-[var(--color-text-primary)]"
+ }`}
+ >
+ <div className="font-mono truncate">{flow.entry_point_name}</div>
+ <div className="flex items-center gap-2 mt-0.5 text-[10px] text-[var(--color-text-tertiary)]">
+ <span>depth {flow.depth}</span>
+ <span>{flow.trace.length} nodes</span>
+ {flow.crosses_community && (
+ <span className="text-yellow-500">cross-community</span>
+ )}
+ </div>
+ </button>
+ ))}
+ </div>
+ </div>
+ </div>
+ )}
+
+ {/* Legend */}
+ <div className="absolute bottom-3 left-3 z-10">
+ <GraphLegend
+ nodeCount={filteredNodes.length}
+ edgeCount={currentEdges.length}
+ colorMode={colorMode}
+ viewMode={viewMode}
+ {...(communityLabels ? { communityLabels } : {})}
+ />
+ </div>
+
+ {/* Context menu */}
+ {ctxMenu && (
+ <GraphContextMenu
+ x={ctxMenu.x}
+ y={ctxMenu.y}
+ nodeId={ctxMenu.nodeId}
+ isModule={ctxMenu.nodeType === "moduleGroup"}
+ onViewDocs={handleCtxViewDocs}
+ onExplore={handleCtxExplore}
+ onPathFrom={handleCtxPathFrom}
+ onPathTo={handleCtxPathTo}
+ />
+ )}
+
+ {/* Community detail panel — rendered via consumer slot */}
+ {communityPanelId !== null && renderCommunityPanel &&
+ renderCommunityPanel({
+ communityId: communityPanelId,
+ onClose: () => setCommunityPanelId(null),
+ })}
+
+ {/* Node detail tooltip */}
+ {selectedNodeId && selectedNodeScreen && (() => {
+ const rfNode = filteredNodes.find((n) => n.id === selectedNodeId);
+ if (!rfNode) return null;
+ const onExplore = rfNode.type === "moduleGroup" && isModuleView
+ ? () => {
+ setModulePath((prev) => [...prev, selectedNodeId]);
+ setSelectedNodeId(null);
+ setSelectedNodeScreen(null);
+ }
+ : undefined;
+ return (
+ <GraphTooltip
+ nodeId={selectedNodeId}
+ nodeType={rfNode.type ?? "fileNode"}
+ data={rfNode.data as Record<string, unknown>}
+ x={selectedNodeScreen.x}
+ y={selectedNodeScreen.y}
+ onClose={() => { setSelectedNodeId(null); setSelectedNodeScreen(null); }}
+ onViewDocs={() => { onNodeViewDocs?.(selectedNodeId); setSelectedNodeId(null); setSelectedNodeScreen(null); }}
+ {...(onExplore ? { onExplore } : {})}
+ />
+ );
+ })()}
+ </div>
+ </GraphProvider>
+ );
+}
+
+// ---- Public component ----
+
+export function GraphFlow(props: GraphFlowProps) {
+ return (
+ <ReactFlowProvider>
+ <GraphFlowInner {...props} />
+ </ReactFlowProvider>
+ );
+}
diff --git a/packages/web/src/components/graph/graph-legend.tsx b/packages/ui/src/graph/graph-legend.tsx
similarity index 96%
rename from packages/web/src/components/graph/graph-legend.tsx
rename to packages/ui/src/graph/graph-legend.tsx
index 30d1f843c..e8d06be62 100644
--- a/packages/web/src/components/graph/graph-legend.tsx
+++ b/packages/ui/src/graph/graph-legend.tsx
@@ -2,7 +2,7 @@
import { useState } from "react";
import { ChevronDown, ChevronUp } from "lucide-react";
-import { LANGUAGE_COLORS } from "@/lib/utils/confidence";
+import { LANGUAGE_COLORS } from "../lib/confidence";
import type { ColorMode, ViewMode } from "./graph-toolbar";
const COMMUNITY_SAMPLE = [
@@ -43,7 +43,6 @@ export function GraphLegend({
return (
<div className="rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-overlay)]/80 backdrop-blur-sm text-xs shadow-lg shadow-black/20 min-w-[120px] max-w-[150px]">
- {/* Header — always visible, clickable to expand */}
<button
onClick={() => setExpanded((s) => !s)}
className="flex items-center justify-between w-full px-2.5 py-2 text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] transition-colors"
@@ -58,7 +57,6 @@ export function GraphLegend({
)}
</button>
- {/* Expandable color legend */}
{expanded && (
<div className="px-2.5 pb-2.5 space-y-1.5 border-t border-[var(--color-border-default)] pt-2">
<p className="text-[9px] text-[var(--color-text-tertiary)] uppercase tracking-wider font-medium">
@@ -116,7 +114,6 @@ export function GraphLegend({
</>
)}
- {/* View-specific info */}
{viewMode !== "module" && viewMode !== "full" && (
<p className="text-[9px] text-[var(--color-text-tertiary)] pt-1 border-t border-[var(--color-border-default)]">
{viewMode === "dead" && "Showing unreachable files"}
diff --git a/packages/web/src/components/graph/graph-toolbar.tsx b/packages/ui/src/graph/graph-toolbar.tsx
similarity index 96%
rename from packages/web/src/components/graph/graph-toolbar.tsx
rename to packages/ui/src/graph/graph-toolbar.tsx
index f03888cfe..fbe8bcff9 100644
--- a/packages/web/src/components/graph/graph-toolbar.tsx
+++ b/packages/ui/src/graph/graph-toolbar.tsx
@@ -16,8 +16,7 @@ import {
Search,
X,
} from "lucide-react";
-import { Button } from "@/components/ui/button";
-import { Input } from "@/components/ui/input";
+import { Button } from "../ui/button";
export type ColorMode = "language" | "community" | "risk";
export type ViewMode = "module" | "full" | "architecture" | "dead" | "hotfiles";
@@ -69,7 +68,6 @@ export function GraphToolbar({
}: GraphToolbarProps) {
return (
<div className="flex flex-col gap-1.5 items-end">
- {/* View modes */}
<div className="flex gap-0.5 rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)]/90 backdrop-blur-sm p-1 shadow-lg shadow-black/20">
{VIEW_MODES.map((m) => {
const Icon = m.icon;
@@ -94,9 +92,7 @@ export function GraphToolbar({
})}
</div>
- {/* Color mode + actions row */}
<div className="flex gap-1.5 items-center">
- {/* Color modes */}
<div className="flex gap-0.5 rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)]/90 backdrop-blur-sm p-1 shadow-lg shadow-black/20">
{COLOR_MODES.map((m) => {
const Icon = m.icon;
@@ -120,7 +116,6 @@ export function GraphToolbar({
})}
</div>
- {/* Action buttons */}
<div className="flex gap-0.5 rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)]/90 backdrop-blur-sm p-1 shadow-lg shadow-black/20">
<Button
size="sm"
@@ -168,7 +163,6 @@ export function GraphToolbar({
</div>
</div>
- {/* Search */}
<div className="relative">
<div className="flex items-center gap-1 rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)]/90 backdrop-blur-sm px-2 py-1 shadow-lg shadow-black/20">
<Search className="w-3 h-3 text-[var(--color-text-tertiary)] shrink-0" />
diff --git a/packages/web/src/components/graph/graph-tooltip.tsx b/packages/ui/src/graph/graph-tooltip.tsx
similarity index 98%
rename from packages/web/src/components/graph/graph-tooltip.tsx
rename to packages/ui/src/graph/graph-tooltip.tsx
index a444b270b..6a879b37e 100644
--- a/packages/web/src/components/graph/graph-tooltip.tsx
+++ b/packages/ui/src/graph/graph-tooltip.tsx
@@ -2,8 +2,8 @@
import { useEffect, useRef } from "react";
import { FileText, Folder, ArrowRight, X, Zap, FlaskConical, BookOpen } from "lucide-react";
-import { formatNumber } from "@/lib/utils/format";
-import { languageColor } from "@/lib/utils/confidence";
+import { formatNumber } from "../lib/format";
+import { languageColor } from "../lib/confidence";
import type { FileNodeData, ModuleNodeData } from "./elk-layout";
interface GraphTooltipProps {
diff --git a/packages/ui/src/graph/index.ts b/packages/ui/src/graph/index.ts
new file mode 100644
index 000000000..08752a634
--- /dev/null
+++ b/packages/ui/src/graph/index.ts
@@ -0,0 +1,15 @@
+export * from "./graph-context-menu.js";
+export * from "./graph-ego-sidebar.js";
+export * from "./graph-legend.js";
+export * from "./graph-toolbar.js";
+export * from "./graph-tooltip.js";
+export * from "./graph-doc-panel.js";
+export * from "./graph-community-panel.js";
+export * from "./path-finder-panel.js";
+export * from "./graph-flow.js";
+export * from "./context.js";
+export * from "./elk-layout.js";
+export * from "./use-elk-layout.js";
+export { FileNode } from "./nodes/file-node.js";
+export { ModuleGroupNode } from "./nodes/module-group-node.js";
+export { DependencyEdge } from "./edges/dependency-edge.js";
diff --git a/packages/web/src/components/graph/nodes/file-node.tsx b/packages/ui/src/graph/nodes/file-node.tsx
similarity index 96%
rename from packages/web/src/components/graph/nodes/file-node.tsx
rename to packages/ui/src/graph/nodes/file-node.tsx
index 59a29130f..d545d3f76 100644
--- a/packages/web/src/components/graph/nodes/file-node.tsx
+++ b/packages/ui/src/graph/nodes/file-node.tsx
@@ -3,8 +3,8 @@
import { memo, useContext } from "react";
import { Handle, Position, type NodeProps } from "@xyflow/react";
import { FileText } from "lucide-react";
-import { GraphContext } from "../graph-flow";
-import { languageColor } from "@/lib/utils/confidence";
+import { GraphContext } from "../context";
+import { languageColor } from "../../lib/confidence";
import type { FileNodeData } from "../elk-layout";
const COMMUNITY_COLORS = [
@@ -43,7 +43,7 @@ function FileNodeInner({ id, data }: NodeProps) {
break;
}
case "community":
- accentColor = COMMUNITY_COLORS[d.communityId % COMMUNITY_COLORS.length];
+ accentColor = COMMUNITY_COLORS[d.communityId % COMMUNITY_COLORS.length] ?? "#6366f1";
break;
case "language":
default:
diff --git a/packages/web/src/components/graph/nodes/module-group-node.tsx b/packages/ui/src/graph/nodes/module-group-node.tsx
similarity index 98%
rename from packages/web/src/components/graph/nodes/module-group-node.tsx
rename to packages/ui/src/graph/nodes/module-group-node.tsx
index a4c41663f..ae1de9ae0 100644
--- a/packages/web/src/components/graph/nodes/module-group-node.tsx
+++ b/packages/ui/src/graph/nodes/module-group-node.tsx
@@ -3,7 +3,7 @@
import { memo, useContext } from "react";
import { Handle, Position, type NodeProps } from "@xyflow/react";
import { Folder } from "lucide-react";
-import { GraphContext } from "../graph-flow";
+import { GraphContext } from "../context";
import type { ModuleNodeData } from "../elk-layout";
const COMMUNITY_COLORS = [
@@ -30,7 +30,7 @@ function ModuleGroupNodeInner({ id, data }: NodeProps) {
case "community": {
let hash = 0;
for (let i = 0; i < id.length; i++) hash = (hash * 31 + id.charCodeAt(i)) | 0;
- accentColor = COMMUNITY_COLORS[Math.abs(hash) % COMMUNITY_COLORS.length];
+ accentColor = COMMUNITY_COLORS[Math.abs(hash) % COMMUNITY_COLORS.length] ?? "#6366f1";
break;
}
case "language":
diff --git a/packages/ui/src/graph/path-finder-panel.tsx b/packages/ui/src/graph/path-finder-panel.tsx
new file mode 100644
index 000000000..fd0c4fb7a
--- /dev/null
+++ b/packages/ui/src/graph/path-finder-panel.tsx
@@ -0,0 +1,280 @@
+"use client";
+
+import { useState, useEffect, useRef, useCallback } from "react";
+import { Route, Loader2, X, ArrowRight, Search, ChevronDown } from "lucide-react";
+import { Button } from "../ui/button";
+import { useDebounce } from "../hooks/use-debounce";
+import type { GraphPath, NodeSearchResult } from "@repowise-dev/types/graph";
+
+export interface PathFinderPanelProps {
+ /** Inject the autocomplete searcher. Returns the top-N nodes for a query. */
+ searchNodes: (query: string, limit: number) => Promise<NodeSearchResult[]>;
+ /** Inject the path finder. Returns the engine's `GraphPath` payload. */
+ findPath: (from: string, to: string) => Promise<GraphPath>;
+ /** Called with the resolved path's node ids when a path is found. */
+ onPathFound: (pathNodes: string[]) => void;
+ /** Clear any prior highlighted path in the parent graph canvas. */
+ onClear: () => void;
+ /** Close the panel. */
+ onClose: () => void;
+ /** Pre-fill values driven by the parent's context-menu. */
+ initialFrom?: string;
+ initialTo?: string;
+}
+
+interface NodeAutocompleteProps {
+ searchNodes: PathFinderPanelProps["searchNodes"];
+ value: string;
+ onChange: (v: string) => void;
+ placeholder: string;
+ onSubmit?: () => void;
+}
+
+function NodeAutocomplete({
+ searchNodes,
+ value,
+ onChange,
+ placeholder,
+ onSubmit,
+}: NodeAutocompleteProps) {
+ const [results, setResults] = useState<NodeSearchResult[]>([]);
+ const [topNodes, setTopNodes] = useState<NodeSearchResult[]>([]);
+ const [showDropdown, setShowDropdown] = useState(false);
+ const debounced = useDebounce(value, 250);
+ const topLoaded = useRef(false);
+
+ // Load top nodes by pagerank once for the dropdown
+ useEffect(() => {
+ if (topLoaded.current) return;
+ topLoaded.current = true;
+ searchNodes("", 20)
+ .then(setTopNodes)
+ .catch(() => {});
+ }, [searchNodes]);
+
+ // Search as user types
+ useEffect(() => {
+ if (!debounced.trim() || debounced.length < 2) {
+ setResults([]);
+ return;
+ }
+ searchNodes(debounced, 12)
+ .then((r) => {
+ setResults(r);
+ setShowDropdown(r.length > 0);
+ })
+ .catch(() => setResults([]));
+ }, [debounced, searchNodes]);
+
+ const displayResults = results.length > 0 ? results : topNodes;
+
+ const handleSelect = useCallback(
+ (nodeId: string) => {
+ onChange(nodeId);
+ setShowDropdown(false);
+ },
+ [onChange],
+ );
+
+ return (
+ <div className="relative">
+ <Search className="absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-[var(--color-text-tertiary)]" />
+ <input
+ type="text"
+ value={value}
+ onChange={(e) => onChange(e.target.value)}
+ onFocus={() => setShowDropdown(true)}
+ onBlur={() => setTimeout(() => setShowDropdown(false), 150)}
+ onKeyDown={(e) => {
+ if (e.key === "Enter") {
+ setShowDropdown(false);
+ onSubmit?.();
+ }
+ }}
+ placeholder={placeholder}
+ className="w-full h-8 pl-8 pr-8 rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-inset)] text-xs font-mono text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:border-[var(--color-accent-graph)] focus:ring-1 focus:ring-[var(--color-accent-graph)]/30 transition-all"
+ />
+ <ChevronDown className="absolute right-2.5 top-1/2 -translate-y-1/2 w-3 h-3 text-[var(--color-text-tertiary)]" />
+ {showDropdown && displayResults.length > 0 && (
+ <div className="absolute top-full left-0 mt-1 w-full max-h-52 overflow-auto z-50 rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-overlay)] shadow-xl shadow-black/30 py-1">
+ {results.length === 0 && topNodes.length > 0 && (
+ <div className="px-3 py-1 text-[9px] text-[var(--color-text-tertiary)] uppercase tracking-wider">
+ Top files by importance
+ </div>
+ )}
+ {displayResults.map((r) => (
+ <button
+ key={r.node_id}
+ className="w-full px-3 py-1.5 text-left text-xs hover:bg-[var(--color-bg-elevated)] transition-colors flex items-center gap-2"
+ onMouseDown={() => handleSelect(r.node_id)}
+ >
+ <span className="font-mono text-[var(--color-text-primary)] truncate flex-1">
+ {r.node_id}
+ </span>
+ <span className="text-[10px] text-[var(--color-text-tertiary)] capitalize shrink-0 tabular-nums">
+ {r.language}
+ </span>
+ </button>
+ ))}
+ </div>
+ )}
+ </div>
+ );
+}
+
+export function PathFinderPanel({
+ searchNodes,
+ findPath,
+ onPathFound,
+ onClear,
+ onClose,
+ initialFrom = "",
+ initialTo = "",
+}: PathFinderPanelProps) {
+ const [from, setFrom] = useState(initialFrom);
+ const [to, setTo] = useState(initialTo);
+ const [loading, setLoading] = useState(false);
+ const [result, setResult] = useState<GraphPath | null>(null);
+ const [error, setError] = useState<string | null>(null);
+
+ // Sync initial values when they change from context menu
+ useEffect(() => {
+ if (initialFrom) setFrom(initialFrom);
+ }, [initialFrom]);
+ useEffect(() => {
+ if (initialTo) setTo(initialTo);
+ }, [initialTo]);
+
+ const handleFind = useCallback(async () => {
+ if (!from.trim() || !to.trim()) return;
+ setLoading(true);
+ setError(null);
+ setResult(null);
+ onClear();
+ try {
+ const res = await findPath(from.trim(), to.trim());
+ setResult(res);
+ if (res.path && res.path.length > 0) {
+ onPathFound(res.path);
+ } else {
+ setError("No path found between these nodes.");
+ }
+ } catch {
+ setError("No path found between these nodes.");
+ } finally {
+ setLoading(false);
+ }
+ }, [from, to, findPath, onPathFound, onClear]);
+
+ const handleClear = useCallback(() => {
+ setFrom("");
+ setTo("");
+ setResult(null);
+ setError(null);
+ onClear();
+ }, [onClear]);
+
+ return (
+ <div className="rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-overlay)]/90 backdrop-blur-md shadow-xl shadow-black/30 p-3 w-[min(280px,calc(100vw-1.5rem))] space-y-2">
+ {/* Header */}
+ <div className="flex items-center gap-2">
+ <Route className="w-3.5 h-3.5 text-[var(--color-accent-graph)]" />
+ <span className="text-xs font-semibold text-[var(--color-text-primary)]">
+ Find Path
+ </span>
+ <div className="ml-auto flex items-center gap-1">
+ {(result || error) && (
+ <Button
+ size="sm"
+ variant="ghost"
+ onClick={handleClear}
+ className="h-5 w-5 p-0"
+ aria-label="Clear results"
+ title="Clear results"
+ >
+ <X className="h-3 w-3" />
+ </Button>
+ )}
+ <Button
+ size="sm"
+ variant="ghost"
+ onClick={onClose}
+ className="h-5 w-5 p-0 text-[var(--color-text-tertiary)]"
+ aria-label="Close"
+ title="Close"
+ >
+ <X className="h-3 w-3" />
+ </Button>
+ </div>
+ </div>
+
+ {/* Inputs stacked */}
+ <div className="space-y-1.5">
+ <NodeAutocomplete
+ searchNodes={searchNodes}
+ value={from}
+ onChange={setFrom}
+ placeholder="From file..."
+ onSubmit={handleFind}
+ />
+ <NodeAutocomplete
+ searchNodes={searchNodes}
+ value={to}
+ onChange={setTo}
+ placeholder="To file..."
+ onSubmit={handleFind}
+ />
+ </div>
+
+ {/* Find button */}
+ <Button
+ size="sm"
+ onClick={handleFind}
+ disabled={!from.trim() || !to.trim() || loading}
+ className="w-full h-7 text-xs font-medium gap-1.5"
+ style={{
+ background: "var(--color-accent-graph)",
+ color: "#000",
+ }}
+ >
+ {loading ? (
+ <Loader2 className="h-3.5 w-3.5 animate-spin" />
+ ) : (
+ <Route className="h-3.5 w-3.5" />
+ )}
+ Find Path
+ </Button>
+
+ {/* Result */}
+ {result && result.path && result.path.length > 0 && (
+ <div className="rounded-lg bg-[var(--color-bg-inset)] border border-[var(--color-border-default)] p-2 space-y-1">
+ <p className="text-[10px] font-medium text-[var(--color-accent-graph)] uppercase tracking-wider">
+ {result.distance} {result.distance === 1 ? "hop" : "hops"}
+ </p>
+ <div className="space-y-0.5 max-h-28 overflow-auto">
+ {result.path.map((nodeName, i) => {
+ const shortName = nodeName.split("/").pop() ?? nodeName;
+ return (
+ <div key={i} className="flex items-center gap-1">
+ {i > 0 && (
+ <ArrowRight className="w-2.5 h-2.5 text-[var(--color-accent-graph)] shrink-0" />
+ )}
+ <span
+ className="text-[10px] font-mono text-[var(--color-text-secondary)] truncate"
+ title={nodeName}
+ >
+ {shortName}
+ </span>
+ </div>
+ );
+ })}
+ </div>
+ </div>
+ )}
+
+ {error && (
+ <p className="text-[10px] text-[var(--color-risk-high)]">{error}</p>
+ )}
+ </div>
+ );
+}
diff --git a/packages/web/src/components/graph/use-elk-layout.ts b/packages/ui/src/graph/use-elk-layout.ts
similarity index 95%
rename from packages/web/src/components/graph/use-elk-layout.ts
rename to packages/ui/src/graph/use-elk-layout.ts
index 16f604819..f325af983 100644
--- a/packages/web/src/components/graph/use-elk-layout.ts
+++ b/packages/ui/src/graph/use-elk-layout.ts
@@ -3,11 +3,11 @@
import { useState, useEffect, useRef } from "react";
import type { Node, Edge } from "@xyflow/react";
import type {
- GraphNodeResponse,
- GraphEdgeResponse,
- ModuleNodeResponse,
- ModuleEdgeResponse,
-} from "@/lib/api/types";
+ GraphNode as GraphNodeResponse,
+ GraphLink as GraphEdgeResponse,
+ ModuleNode as ModuleNodeResponse,
+ ModuleEdge as ModuleEdgeResponse,
+} from "@repowise-dev/types/graph";
import { layoutFileGraph, layoutModuleGraph } from "./elk-layout";
interface ElkLayoutResult {
diff --git a/packages/ui/src/hooks/index.ts b/packages/ui/src/hooks/index.ts
new file mode 100644
index 000000000..61f14e59b
--- /dev/null
+++ b/packages/ui/src/hooks/index.ts
@@ -0,0 +1 @@
+export * from "./use-debounce.js";
diff --git a/packages/ui/src/hooks/use-debounce.ts b/packages/ui/src/hooks/use-debounce.ts
new file mode 100644
index 000000000..773fdf56a
--- /dev/null
+++ b/packages/ui/src/hooks/use-debounce.ts
@@ -0,0 +1,17 @@
+"use client";
+
+import { useEffect, useState } from "react";
+
+/**
+ * Debounce a rapidly-changing value. Presentational hook — safe to use
+ * inside `@repowise-dev/ui` shells (no data fetching, no framework
+ * coupling).
+ */
+export function useDebounce<T>(value: T, delay: number): T {
+ const [debounced, setDebounced] = useState(value);
+ useEffect(() => {
+ const timer = setTimeout(() => setDebounced(value), delay);
+ return () => clearTimeout(timer);
+ }, [value, delay]);
+ return debounced;
+}
diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts
new file mode 100644
index 000000000..b884c68d4
--- /dev/null
+++ b/packages/ui/src/index.ts
@@ -0,0 +1,10 @@
+/**
+ * @repowise-dev/ui — shared visualization components.
+ *
+ * Consumers should import via subpath (`@repowise-dev/ui/graph`,
+ * `@repowise-dev/ui/chat`, etc.) rather than the barrel below — the barrel
+ * exists so the package resolves cleanly in IDEs and tooling that probes
+ * the root entry point.
+ */
+
+export {};
diff --git a/packages/web/src/components/jobs/generation-progress.tsx b/packages/ui/src/jobs/generation-progress.tsx
similarity index 57%
rename from packages/web/src/components/jobs/generation-progress.tsx
rename to packages/ui/src/jobs/generation-progress.tsx
index 91f51aeb1..f87bd6a96 100644
--- a/packages/web/src/components/jobs/generation-progress.tsx
+++ b/packages/ui/src/jobs/generation-progress.tsx
@@ -1,76 +1,47 @@
"use client";
-import { useEffect, useRef, useState } from "react";
-import { toast } from "sonner";
import { CheckCircle, XCircle, Loader2, AlertTriangle, X } from "lucide-react";
-import { useJob } from "@/lib/hooks/use-job";
-import { Progress } from "@/components/ui/progress";
-import { Badge } from "@/components/ui/badge";
-import { Button } from "@/components/ui/button";
+import { Progress } from "../ui/progress";
+import { Badge } from "../ui/badge";
+import { Button } from "../ui/button";
import { JobLog } from "./job-log";
-import { formatTokens, formatNumber } from "@/lib/utils/format";
-import { cancelJob } from "@/lib/api/jobs";
-import type { JobProgressEvent } from "@/lib/api/types";
-
-interface Props {
- jobId: string;
- repoName?: string;
- /** Called when the job reaches a terminal state */
- onDone?: () => void;
+import { formatTokens, formatNumber } from "../lib/format";
+
+/** Subset of the Job shape this presentational shell renders. */
+export interface GenerationProgressJob {
+ id: string;
+ status: "pending" | "running" | "completed" | "failed" | string;
+ total_pages: number;
+ completed_pages: number;
+ failed_pages?: number;
+ current_level?: number | null;
+ started_at?: string | null;
+ error_message?: string | null;
+ config?: Record<string, unknown> | null;
}
-// Anything past this without transitioning out of "pending" is almost
-// certainly stuck — the background task crashed before recording running.
-const PENDING_STUCK_THRESHOLD_MS = 30_000;
-
-export function GenerationProgress({ jobId, repoName, onDone }: Props) {
- const { job, sse } = useJob(jobId);
- const [log, setLog] = useState<Array<{ text: string }>>([]);
- const [elapsed, setElapsed] = useState(0);
- const [actualCost, setActualCost] = useState<number | null>(null);
- const [cancelling, setCancelling] = useState(false);
- const startRef = useRef(Date.now());
- const notifiedRef = useRef(false);
-
- // Elapsed timer
- useEffect(() => {
- const id = setInterval(() => setElapsed(Date.now() - startRef.current), 1000);
- return () => clearInterval(id);
- }, []);
-
- // Accumulate log entries and track running cost from SSE progress events
- useEffect(() => {
- if (!sse.data) return;
- const ev = sse.data as JobProgressEvent;
- if (ev.current_page) {
- setLog((prev) => [
- ...prev,
- { text: `[L${ev.current_level ?? "?"}] ${ev.current_page}` },
- ]);
- }
- if (ev.actual_cost_usd != null) {
- setActualCost(ev.actual_cost_usd);
- }
- }, [sse.data]);
-
- // Toast on terminal state
- useEffect(() => {
- if (notifiedRef.current) return;
- if (job?.status === "completed") {
- notifiedRef.current = true;
- toast.success(`Documentation updated${repoName ? ` — ${repoName}` : ""}`, {
- description: `${formatNumber(job.completed_pages)} pages generated`,
- });
- onDone?.();
- } else if (job?.status === "failed") {
- notifiedRef.current = true;
- toast.error("Generation failed", {
- description: job.error_message ?? "Unknown error",
- });
- onDone?.();
- }
- }, [job?.status, job?.completed_pages, job?.error_message, repoName, onDone]);
+export interface GenerationProgressProps {
+ job: GenerationProgressJob | undefined;
+ log: Array<{ text: string }>;
+ /** Wall-clock elapsed time in ms. The wrapper owns the interval timer. */
+ elapsed: number;
+ /** Live cost in USD (null until first SSE progress event with cost). */
+ actualCost: number | null;
+ /** True when the job has been pending past the stuck-threshold and never started. */
+ stuckPending: boolean;
+ cancelling: boolean;
+ onCancel: () => void;
+}
+export function GenerationProgress({
+ job,
+ log,
+ elapsed,
+ actualCost,
+ stuckPending,
+ cancelling,
+ onCancel,
+}: GenerationProgressProps) {
const progress = job
? job.total_pages > 0
? Math.round((job.completed_pages / job.total_pages) * 100)
@@ -84,32 +55,8 @@ export function GenerationProgress({ jobId, repoName, onDone }: Props) {
const isDone = job?.status === "completed";
const isFailed = job?.status === "failed";
- // Detect a stuck pending job: we've been observing it for >30s and the
- // server still reports `pending` without `started_at` ever flipping.
- const stuckPending =
- isPending &&
- job?.started_at == null &&
- elapsed > PENDING_STUCK_THRESHOLD_MS;
-
- async function handleCancel() {
- if (!job) return;
- setCancelling(true);
- try {
- await cancelJob(job.id);
- toast.success("Job cancelled");
- onDone?.();
- } catch (e) {
- toast.error("Couldn't cancel job", {
- description: e instanceof Error ? e.message : "Unknown error",
- });
- } finally {
- setCancelling(false);
- }
- }
-
return (
<div className="space-y-3">
- {/* Header */}
<div className="flex items-center gap-2">
{isInflight && <Loader2 className="h-4 w-4 animate-spin text-[var(--color-accent-primary)] shrink-0" />}
{isDone && <CheckCircle className="h-4 w-4 text-[var(--color-fresh)] shrink-0" />}
@@ -130,7 +77,7 @@ export function GenerationProgress({ jobId, repoName, onDone }: Props) {
<Button
size="sm"
variant="ghost"
- onClick={handleCancel}
+ onClick={onCancel}
disabled={cancelling}
className="h-7 px-2 text-xs"
aria-label="Cancel job"
@@ -154,11 +101,10 @@ export function GenerationProgress({ jobId, repoName, onDone }: Props) {
</div>
)}
- {/* Progress bar */}
<div className="space-y-1">
<Progress
value={progress}
- indicatorClassName={isFailed ? "bg-[var(--color-outdated)]" : undefined}
+ {...(isFailed ? { indicatorClassName: "bg-[var(--color-outdated)]" } : {})}
/>
<div className="flex justify-between text-xs text-[var(--color-text-tertiary)]">
<span>
@@ -174,7 +120,6 @@ export function GenerationProgress({ jobId, repoName, onDone }: Props) {
</div>
</div>
- {/* Live cost */}
{actualCost != null && (
<div className="flex items-center gap-1.5 text-xs text-[var(--color-text-tertiary)]">
<span>Cost: ${actualCost.toFixed(4)}</span>
@@ -187,18 +132,17 @@ export function GenerationProgress({ jobId, repoName, onDone }: Props) {
</div>
)}
- {/* Summary on done */}
- {isDone && (
+ {isDone && job && (
<div className="grid grid-cols-3 gap-2">
<div className="rounded border border-[var(--color-border-default)] p-2 text-center">
<p className="text-lg font-semibold text-[var(--color-text-primary)]">
- {formatNumber(job!.completed_pages)}
+ {formatNumber(job.completed_pages)}
</p>
<p className="text-xs text-[var(--color-text-tertiary)]">pages</p>
</div>
<div className="rounded border border-[var(--color-border-default)] p-2 text-center">
<p className="text-lg font-semibold text-[var(--color-text-primary)]">
- {formatTokens((job!.config?.total_input_tokens as number) ?? 0)}
+ {formatTokens((job.config?.total_input_tokens as number) ?? 0)}
</p>
<p className="text-xs text-[var(--color-text-tertiary)]">tokens in</p>
</div>
@@ -211,12 +155,10 @@ export function GenerationProgress({ jobId, repoName, onDone }: Props) {
</div>
)}
- {/* Error */}
{isFailed && job?.error_message && (
<p className="text-sm text-[var(--color-outdated)]">{job.error_message}</p>
)}
- {/* Live log */}
{log.length > 0 && <JobLog entries={log} />}
</div>
);
diff --git a/packages/ui/src/jobs/index.ts b/packages/ui/src/jobs/index.ts
new file mode 100644
index 000000000..d18737ca0
--- /dev/null
+++ b/packages/ui/src/jobs/index.ts
@@ -0,0 +1,2 @@
+export * from "./job-log.js";
+export * from "./generation-progress.js";
diff --git a/packages/web/src/components/jobs/job-log.tsx b/packages/ui/src/jobs/job-log.tsx
similarity index 86%
rename from packages/web/src/components/jobs/job-log.tsx
rename to packages/ui/src/jobs/job-log.tsx
index 0fc101ef9..f2e458fec 100644
--- a/packages/web/src/components/jobs/job-log.tsx
+++ b/packages/ui/src/jobs/job-log.tsx
@@ -1,19 +1,19 @@
"use client";
import { useEffect, useRef } from "react";
-import { ScrollArea } from "@/components/ui/scroll-area";
+import { ScrollArea } from "../ui/scroll-area";
interface LogEntry {
text: string;
level?: number;
}
-interface Props {
+interface JobLogProps {
entries: LogEntry[];
maxLines?: number;
}
-export function JobLog({ entries, maxLines = 6 }: Props) {
+export function JobLog({ entries, maxLines = 6 }: JobLogProps) {
const bottomRef = useRef<HTMLDivElement>(null);
useEffect(() => {
diff --git a/packages/ui/src/lib/cn.ts b/packages/ui/src/lib/cn.ts
new file mode 100644
index 000000000..365058ceb
--- /dev/null
+++ b/packages/ui/src/lib/cn.ts
@@ -0,0 +1,6 @@
+import { type ClassValue, clsx } from "clsx";
+import { twMerge } from "tailwind-merge";
+
+export function cn(...inputs: ClassValue[]) {
+ return twMerge(clsx(inputs));
+}
diff --git a/packages/web/src/lib/utils/confidence.ts b/packages/ui/src/lib/confidence.ts
similarity index 99%
rename from packages/web/src/lib/utils/confidence.ts
rename to packages/ui/src/lib/confidence.ts
index ab312d23a..4dddd7a97 100644
--- a/packages/web/src/lib/utils/confidence.ts
+++ b/packages/ui/src/lib/confidence.ts
@@ -78,7 +78,7 @@ export const LANGUAGE_COLORS: Record<string, string> = {
};
export function languageColor(lang: string): string {
- return LANGUAGE_COLORS[lang.toLowerCase()] ?? LANGUAGE_COLORS.other;
+ return LANGUAGE_COLORS[lang.toLowerCase()] ?? LANGUAGE_COLORS.other ?? "#8B5CF6";
}
/** Color hex for a graph edge type */
diff --git a/packages/web/src/lib/utils/format.ts b/packages/ui/src/lib/format.ts
similarity index 98%
rename from packages/web/src/lib/utils/format.ts
rename to packages/ui/src/lib/format.ts
index 3fa82cbe3..965e1572e 100644
--- a/packages/web/src/lib/utils/format.ts
+++ b/packages/ui/src/lib/format.ts
@@ -87,7 +87,7 @@ export function truncatePath(path: string, maxChars = 60): string {
if (candidate.length <= maxChars) return candidate;
}
// Just filename
- const filename = parts[parts.length - 1];
+ const filename = parts[parts.length - 1] ?? path;
return filename.length <= maxChars ? `…/${filename}` : `…${filename.slice(-(maxChars - 1))}`;
}
diff --git a/packages/ui/src/settings/general-form.tsx b/packages/ui/src/settings/general-form.tsx
new file mode 100644
index 000000000..478646d59
--- /dev/null
+++ b/packages/ui/src/settings/general-form.tsx
@@ -0,0 +1,251 @@
+"use client";
+
+import { useState } from "react";
+import { Info, Save, X } from "lucide-react";
+import { Badge } from "../ui/badge";
+import { Button } from "../ui/button";
+import { Input } from "../ui/input";
+import { Label } from "../ui/label";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from "../ui/tooltip";
+import type { RepoSettingsValue } from "@repowise-dev/types/settings";
+
+const SUGGESTIONS = [
+ "vendor/",
+ "dist/",
+ "build/",
+ "node_modules/",
+ "*.generated.*",
+ "**/fixtures/**",
+];
+
+function arraysEqual(a: string[], b: string[]) {
+ return a.length === b.length && a.every((v, i) => v === b[i]);
+}
+
+export interface GeneralFormProps {
+ /** Initial form value. Also used as the "saved" baseline for dirty-check. */
+ value: RepoSettingsValue;
+ /**
+ * Optional save handler. When omitted, the form renders read-only — useful
+ * for hosted, where multi-tenant settings persistence is deferred to the
+ * Phase 5 RBAC data-model rewrite.
+ */
+ onSubmit?: (next: RepoSettingsValue) => Promise<void>;
+ /** Read-only fields shown alongside the editable form. */
+ localPath?: string;
+ remoteUrl?: string;
+ /**
+ * Copy displayed underneath the disabled save button when `onSubmit` is
+ * absent. Defaults to a generic "managed elsewhere" line.
+ */
+ disabledHint?: string;
+}
+
+export function GeneralForm({
+ value,
+ onSubmit,
+ localPath,
+ remoteUrl,
+ disabledHint = "Editing repository settings is not yet available on this surface.",
+}: GeneralFormProps) {
+ const [name, setName] = useState(value.name);
+ const [branch, setBranch] = useState(value.default_branch);
+ const [patterns, setPatterns] = useState<string[]>(value.exclude_patterns);
+ const [newPattern, setNewPattern] = useState("");
+ const [saving, setSaving] = useState(false);
+
+ const readOnly = onSubmit === undefined;
+ const hasChanges =
+ name !== value.name ||
+ branch !== value.default_branch ||
+ !arraysEqual(patterns, value.exclude_patterns);
+
+ function addPattern(pattern: string) {
+ const trimmed = pattern.trim();
+ if (!trimmed || patterns.includes(trimmed)) return;
+ setPatterns([...patterns, trimmed]);
+ setNewPattern("");
+ }
+
+ function removePattern(pattern: string) {
+ setPatterns(patterns.filter((p) => p !== pattern));
+ }
+
+ async function handleSave() {
+ if (!onSubmit || !hasChanges) return;
+ setSaving(true);
+ try {
+ await onSubmit({
+ name,
+ default_branch: branch,
+ exclude_patterns: patterns,
+ });
+ } finally {
+ setSaving(false);
+ }
+ }
+
+ return (
+ <div className="space-y-5">
+ <div className="space-y-1.5">
+ <Label htmlFor="repo-name">Repository name</Label>
+ <Input
+ id="repo-name"
+ value={name}
+ onChange={(e) => setName(e.target.value)}
+ placeholder="my-project"
+ className="max-w-sm"
+ disabled={readOnly}
+ />
+ </div>
+
+ <div className="space-y-1.5">
+ <Label htmlFor="repo-branch">Default branch</Label>
+ <Input
+ id="repo-branch"
+ value={branch}
+ onChange={(e) => setBranch(e.target.value)}
+ placeholder="main"
+ className="max-w-sm"
+ disabled={readOnly}
+ />
+ </div>
+
+ {localPath && (
+ <div className="space-y-1.5">
+ <Label>Local path</Label>
+ <p className="text-sm font-mono text-[var(--color-text-secondary)] break-all">
+ {localPath}
+ </p>
+ <p className="text-xs text-[var(--color-text-tertiary)]">
+ Path cannot be changed after repository is registered.
+ </p>
+ </div>
+ )}
+
+ {remoteUrl && (
+ <div className="space-y-1.5">
+ <Label>Remote URL</Label>
+ <p className="text-sm font-mono text-[var(--color-text-secondary)] break-all">
+ {remoteUrl}
+ </p>
+ </div>
+ )}
+
+ <div className="space-y-3 border-t border-[var(--color-border-default)] pt-5">
+ <div className="flex items-center gap-2">
+ <span className="text-sm font-medium">Excluded Paths</span>
+ {patterns.length > 0 && (
+ <Badge variant="accent" className="text-xs">
+ {patterns.length} active
+ </Badge>
+ )}
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Info className="h-3.5 w-3.5 text-[var(--color-text-tertiary)] cursor-help" />
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>Supports full .gitignore syntax. Paths are relative to the repo root.</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ </div>
+ <p className="text-xs text-[var(--color-text-secondary)]">
+ Gitignore-style patterns. Excluded folders are skipped during indexing and generation.
+ </p>
+
+ {patterns.length === 0 ? (
+ <p className="text-xs text-[var(--color-text-tertiary)] italic">
+ No custom patterns — .gitignore and .repowiseIgnore are always respected.
+ </p>
+ ) : (
+ <div className="flex flex-wrap gap-1.5">
+ {patterns.map((p) => (
+ <span
+ key={p}
+ className="inline-flex items-center gap-1 rounded-full bg-[var(--color-bg-inset)] px-2.5 py-0.5 text-xs font-mono text-[var(--color-text-primary)] border border-[var(--color-border-default)]"
+ >
+ {p}
+ {!readOnly && (
+ <button
+ type="button"
+ onClick={() => removePattern(p)}
+ className="text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)] transition-colors"
+ aria-label={`Remove ${p}`}
+ >
+ <X className="h-3 w-3" />
+ </button>
+ )}
+ </span>
+ ))}
+ </div>
+ )}
+
+ {!readOnly && (
+ <>
+ <div className="flex gap-2 max-w-sm">
+ <Input
+ id="exclude-pattern"
+ aria-label="New excluded pattern"
+ value={newPattern}
+ onChange={(e) => setNewPattern(e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === "Enter") {
+ e.preventDefault();
+ addPattern(newPattern);
+ }
+ }}
+ placeholder="e.g. vendor/, src/generated/**, *.min.js"
+ className="font-mono text-xs"
+ />
+ <Button
+ type="button"
+ variant="outline"
+ size="sm"
+ onClick={() => addPattern(newPattern)}
+ disabled={!newPattern.trim()}
+ >
+ Add
+ </Button>
+ </div>
+
+ <div className="flex flex-wrap gap-1.5">
+ {SUGGESTIONS.map((suggestion) => (
+ <button
+ key={suggestion}
+ type="button"
+ onClick={() => addPattern(suggestion)}
+ disabled={patterns.includes(suggestion)}
+ className="text-xs rounded-full border border-[var(--color-border-default)] px-2.5 py-0.5 font-mono text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] hover:bg-[var(--color-bg-inset)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed"
+ >
+ + {suggestion}
+ </button>
+ ))}
+ </div>
+ </>
+ )}
+ </div>
+
+ <div className="space-y-1.5">
+ <Button
+ onClick={handleSave}
+ disabled={readOnly || !hasChanges || saving}
+ size="sm"
+ className="gap-2"
+ >
+ <Save className="h-3.5 w-3.5" />
+ {saving ? "Saving…" : "Save changes"}
+ </Button>
+ {readOnly && (
+ <p className="text-xs text-[var(--color-text-tertiary)]">{disabledHint}</p>
+ )}
+ </div>
+ </div>
+ );
+}
diff --git a/packages/ui/src/settings/index.ts b/packages/ui/src/settings/index.ts
new file mode 100644
index 000000000..848534039
--- /dev/null
+++ b/packages/ui/src/settings/index.ts
@@ -0,0 +1 @@
+export * from "./general-form.js";
diff --git a/packages/web/src/components/shared/api-error.tsx b/packages/ui/src/shared/api-error.tsx
similarity index 94%
rename from packages/web/src/components/shared/api-error.tsx
rename to packages/ui/src/shared/api-error.tsx
index 9c922fde5..29f9bb1f3 100644
--- a/packages/web/src/components/shared/api-error.tsx
+++ b/packages/ui/src/shared/api-error.tsx
@@ -1,5 +1,5 @@
import { AlertTriangle, RefreshCw } from "lucide-react";
-import { Button } from "@/components/ui/button";
+import { Button } from "@repowise-dev/ui/ui/button";
interface ApiErrorProps {
title?: string;
diff --git a/packages/web/src/components/shared/empty-state.tsx b/packages/ui/src/shared/empty-state.tsx
similarity index 92%
rename from packages/web/src/components/shared/empty-state.tsx
rename to packages/ui/src/shared/empty-state.tsx
index 7e48565b5..e7e86d67b 100644
--- a/packages/web/src/components/shared/empty-state.tsx
+++ b/packages/ui/src/shared/empty-state.tsx
@@ -1,6 +1,6 @@
import * as React from "react";
-import { cn } from "@/lib/utils/cn";
-import { Button } from "@/components/ui/button";
+import { cn } from "../lib/cn";
+import { Button } from "@repowise-dev/ui/ui/button";
interface EmptyStateProps {
icon?: React.ReactNode;
diff --git a/packages/ui/src/shared/index.ts b/packages/ui/src/shared/index.ts
new file mode 100644
index 000000000..77c17aff0
--- /dev/null
+++ b/packages/ui/src/shared/index.ts
@@ -0,0 +1,3 @@
+export * from "./api-error.js";
+export * from "./empty-state.js";
+export * from "./stat-card.js";
diff --git a/packages/web/src/components/shared/stat-card.tsx b/packages/ui/src/shared/stat-card.tsx
similarity index 94%
rename from packages/web/src/components/shared/stat-card.tsx
rename to packages/ui/src/shared/stat-card.tsx
index fbe90f499..417e95a68 100644
--- a/packages/web/src/components/shared/stat-card.tsx
+++ b/packages/ui/src/shared/stat-card.tsx
@@ -1,6 +1,6 @@
import * as React from "react";
-import { cn } from "@/lib/utils/cn";
-import { Card, CardContent } from "@/components/ui/card";
+import { cn } from "../lib/cn";
+import { Card, CardContent } from "@repowise-dev/ui/ui/card";
interface StatCardProps {
label: string;
diff --git a/packages/ui/src/symbols/index.ts b/packages/ui/src/symbols/index.ts
new file mode 100644
index 000000000..571ff663a
--- /dev/null
+++ b/packages/ui/src/symbols/index.ts
@@ -0,0 +1,3 @@
+export * from "./symbol-table.js";
+export * from "./symbol-drawer.js";
+export * from "./symbol-graph-panel.js";
diff --git a/packages/web/src/components/symbols/symbol-drawer.tsx b/packages/ui/src/symbols/symbol-drawer.tsx
similarity index 78%
rename from packages/web/src/components/symbols/symbol-drawer.tsx
rename to packages/ui/src/symbols/symbol-drawer.tsx
index 5145b502a..428f2264d 100644
--- a/packages/web/src/components/symbols/symbol-drawer.tsx
+++ b/packages/ui/src/symbols/symbol-drawer.tsx
@@ -1,25 +1,29 @@
"use client";
+import type { ReactNode } from "react";
import {
Dialog,
DialogContent,
DialogHeader,
DialogTitle,
DialogDescription,
-} from "@/components/ui/dialog";
-import { Badge } from "@/components/ui/badge";
-import { ScrollArea } from "@/components/ui/scroll-area";
-import { Separator } from "@/components/ui/separator";
-import { SymbolGraphPanel } from "./symbol-graph-panel";
-import type { SymbolResponse } from "@/lib/api/types";
+} from "../ui/dialog";
+import { Badge } from "../ui/badge";
+import { ScrollArea } from "../ui/scroll-area";
+import { Separator } from "../ui/separator";
+import type { CodeSymbol } from "@repowise-dev/types/symbols";
interface SymbolDrawerProps {
- symbol: SymbolResponse | null;
- repoId: string;
+ symbol: CodeSymbol | null;
onClose: () => void;
+ /**
+ * Right-column graph intelligence slot. Wrappers pass a data-coupled
+ * `<SymbolGraphPanelWrapper>` here; pass `null` to hide the column.
+ */
+ graphPanel?: ReactNode;
}
-export function SymbolDrawer({ symbol, repoId, onClose }: SymbolDrawerProps) {
+export function SymbolDrawer({ symbol, onClose, graphPanel }: SymbolDrawerProps) {
return (
<Dialog open={symbol !== null} onOpenChange={(open) => !open && onClose()}>
<DialogContent className="max-w-[90vw] w-[900px] max-h-[85vh] overflow-hidden p-0">
@@ -48,7 +52,6 @@ export function SymbolDrawer({ symbol, repoId, onClose }: SymbolDrawerProps) {
<Separator />
<div className="flex min-h-0 flex-1 overflow-hidden" style={{ maxHeight: "calc(85vh - 120px)" }}>
- {/* Left column — existing content */}
<ScrollArea className="flex-1 min-w-0">
<div className="px-6 py-4 space-y-3">
<div className="rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)]">
@@ -76,10 +79,11 @@ export function SymbolDrawer({ symbol, repoId, onClose }: SymbolDrawerProps) {
</div>
</ScrollArea>
- {/* Right column — graph intelligence */}
- <div className="hidden md:flex flex-col border-l border-[var(--color-border-default)] bg-[var(--color-bg-surface)] w-[280px] shrink-0 overflow-hidden">
- <SymbolGraphPanel repoId={repoId} symbol={symbol} />
- </div>
+ {graphPanel && (
+ <div className="hidden md:flex flex-col border-l border-[var(--color-border-default)] bg-[var(--color-bg-surface)] w-[280px] shrink-0 overflow-hidden">
+ {graphPanel}
+ </div>
+ )}
</div>
</>
)}
diff --git a/packages/web/src/components/symbols/symbol-graph-panel.tsx b/packages/ui/src/symbols/symbol-graph-panel.tsx
similarity index 85%
rename from packages/web/src/components/symbols/symbol-graph-panel.tsx
rename to packages/ui/src/symbols/symbol-graph-panel.tsx
index dbe383ee7..18a020e7a 100644
--- a/packages/web/src/components/symbols/symbol-graph-panel.tsx
+++ b/packages/ui/src/symbols/symbol-graph-panel.tsx
@@ -1,17 +1,23 @@
"use client";
-import { Badge } from "@/components/ui/badge";
-import { Skeleton } from "@/components/ui/skeleton";
-import { ScrollArea } from "@/components/ui/scroll-area";
-import { Separator } from "@/components/ui/separator";
-import { useGraphMetrics, useCallersCallees } from "@/lib/hooks/use-graph";
-import { truncatePath } from "@/lib/utils/format";
-import { cn } from "@/lib/utils/cn";
-import type { SymbolResponse, CallerCalleeEntry } from "@/lib/api/types";
+import { Badge } from "../ui/badge";
+import { Skeleton } from "../ui/skeleton";
+import { ScrollArea } from "../ui/scroll-area";
+import { Separator } from "../ui/separator";
+import { truncatePath } from "../lib/format";
+import { cn } from "../lib/cn";
+import type {
+ CallerCalleeEntry,
+ CallersCallees,
+ GraphMetrics,
+} from "@repowise-dev/types/graph";
interface SymbolGraphPanelProps {
- repoId: string;
- symbol: SymbolResponse;
+ metrics: GraphMetrics | undefined;
+ metricsLoading: boolean;
+ callData: CallersCallees | undefined;
+ callsLoading: boolean;
+ heritageData?: CallersCallees | undefined;
}
function PercentileBadge({ value, label }: { value: number; label: string }) {
@@ -61,7 +67,6 @@ function CallerCalleeList({
key={item.symbol_id}
className="flex items-start gap-1.5 py-1 px-1.5 rounded hover:bg-[var(--color-bg-elevated)] transition-colors"
>
- {/* Confidence dot */}
<span
className={cn(
"mt-1.5 w-1.5 h-1.5 rounded-full shrink-0",
@@ -97,22 +102,19 @@ function CallerCalleeList({
);
}
-export function SymbolGraphPanel({ repoId, symbol }: SymbolGraphPanelProps) {
- const nodeId = `${symbol.file_path}::${symbol.name}`;
-
- const { metrics, isLoading: metricsLoading } = useGraphMetrics(repoId, nodeId);
- const { data: callData, isLoading: callsLoading } = useCallersCallees(repoId, nodeId);
- const { data: heritageData } = useCallersCallees(repoId, nodeId, {
- edge_types: "extends,implements",
- });
-
+export function SymbolGraphPanel({
+ metrics,
+ metricsLoading,
+ callData,
+ callsLoading,
+ heritageData,
+}: SymbolGraphPanelProps) {
const hasHeritage =
heritageData && (heritageData.caller_count > 0 || heritageData.callee_count > 0);
return (
<ScrollArea className="h-full">
<div className="space-y-4 p-1">
- {/* Graph Metrics */}
<div>
<p className="text-[11px] font-medium text-[var(--color-text-tertiary)] uppercase tracking-wider mb-2">
Graph Metrics
@@ -127,14 +129,12 @@ export function SymbolGraphPanel({ repoId, symbol }: SymbolGraphPanelProps) {
<div className="space-y-1.5">
<PercentileBadge value={metrics.pagerank_percentile} label="PageRank" />
<PercentileBadge value={metrics.betweenness_percentile} label="Betweenness" />
-
<div className="flex items-center justify-between gap-2">
<span className="text-[11px] text-[var(--color-text-tertiary)]">Degree</span>
<span className="text-[11px] font-mono text-[var(--color-text-secondary)]">
{metrics.in_degree} in &middot; {metrics.out_degree} out
</span>
</div>
-
{metrics.community_label && (
<div className="flex items-center justify-between gap-2">
<span className="text-[11px] text-[var(--color-text-tertiary)]">Community</span>
@@ -143,7 +143,6 @@ export function SymbolGraphPanel({ repoId, symbol }: SymbolGraphPanelProps) {
</Badge>
</div>
)}
-
{metrics.entry_point_score != null && metrics.entry_point_score > 0 && (
<div className="flex items-center justify-between gap-2">
<span className="text-[11px] text-[var(--color-text-tertiary)]">Entry Point</span>
@@ -170,7 +169,6 @@ export function SymbolGraphPanel({ repoId, symbol }: SymbolGraphPanelProps) {
<Separator />
- {/* Callers & Callees */}
<div>
{callsLoading ? (
<div className="space-y-2">
@@ -186,18 +184,17 @@ export function SymbolGraphPanel({ repoId, symbol }: SymbolGraphPanelProps) {
) : null}
</div>
- {/* Heritage */}
- {hasHeritage && (
+ {hasHeritage && heritageData && (
<>
<Separator />
<div>
<p className="text-[11px] font-medium text-[var(--color-text-tertiary)] uppercase tracking-wider mb-1.5">
Heritage
</p>
- {heritageData!.callers.length > 0 && (
+ {heritageData.callers.length > 0 && (
<div className="mb-2">
<p className="text-[10px] text-[var(--color-text-tertiary)] mb-1">Extended/Implemented by:</p>
- {heritageData!.callers.map((c) => (
+ {heritageData.callers.map((c) => (
<p key={c.symbol_id} className="text-[11px] font-mono text-[var(--color-text-primary)] truncate pl-2">
{c.name}
<span className="text-[var(--color-text-tertiary)] ml-1">({c.edge_type})</span>
@@ -205,10 +202,10 @@ export function SymbolGraphPanel({ repoId, symbol }: SymbolGraphPanelProps) {
))}
</div>
)}
- {heritageData!.callees.length > 0 && (
+ {heritageData.callees.length > 0 && (
<div>
<p className="text-[10px] text-[var(--color-text-tertiary)] mb-1">Extends/Implements:</p>
- {heritageData!.callees.map((c) => (
+ {heritageData.callees.map((c) => (
<p key={c.symbol_id} className="text-[11px] font-mono text-[var(--color-text-primary)] truncate pl-2">
{c.name}
<span className="text-[var(--color-text-tertiary)] ml-1">({c.edge_type})</span>
diff --git a/packages/web/src/components/symbols/symbol-table.tsx b/packages/ui/src/symbols/symbol-table.tsx
similarity index 70%
rename from packages/web/src/components/symbols/symbol-table.tsx
rename to packages/ui/src/symbols/symbol-table.tsx
index f0469a680..a1349249e 100644
--- a/packages/web/src/components/symbols/symbol-table.tsx
+++ b/packages/ui/src/symbols/symbol-table.tsx
@@ -1,33 +1,42 @@
"use client";
-import { useState, useCallback, useMemo } from "react";
-import useSWR from "swr";
-import useSWRInfinite from "swr/infinite";
+import { useState, useCallback, useMemo, type ReactNode } from "react";
import { ChevronUp, ChevronDown, ChevronsUpDown, TrendingUp } from "lucide-react";
-import { Input } from "@/components/ui/input";
-import { Button } from "@/components/ui/button";
-import { Badge } from "@/components/ui/badge";
-import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
-import { Skeleton } from "@/components/ui/skeleton";
-import { EmptyState } from "@/components/shared/empty-state";
-import { SymbolDrawer } from "./symbol-drawer";
-import { listSymbols } from "@/lib/api/symbols";
-import { getGraph } from "@/lib/api/graph";
-import { useDebounce } from "@/lib/hooks/use-debounce";
-import { truncatePath } from "@/lib/utils/format";
-import { cn } from "@/lib/utils/cn";
-import type { SymbolResponse, GraphExportResponse } from "@/lib/api/types";
+import { Input } from "../ui/input";
+import { Button } from "../ui/button";
+import { Badge } from "../ui/badge";
+import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select";
+import { Skeleton } from "../ui/skeleton";
+import { EmptyState } from "../shared/empty-state";
+import { truncatePath } from "../lib/format";
+import { cn } from "../lib/cn";
+import type { CodeSymbol } from "@repowise-dev/types/symbols";
-type SortCol = "importance" | "name" | "kind" | "language" | "complexity_estimate" | "start_line";
-type SortDir = "asc" | "desc";
-
-const LIMIT = 50;
+export type SortCol = "importance" | "name" | "kind" | "language" | "complexity_estimate" | "start_line";
+export type SortDir = "asc" | "desc";
const KINDS = ["function", "class", "method", "interface", "variable", "module"];
const LANGUAGES = ["python", "typescript", "javascript", "go", "rust", "java", "cpp", "c"];
-interface SymbolTableProps {
- repoId: string;
+export interface SymbolTableProps {
+ /** Loaded symbols (already paginated and filtered server-side). */
+ items: CodeSymbol[];
+ /** Map of symbol.id → normalized importance score (0–1). */
+ importanceScores: Map<string, number>;
+ isLoading: boolean;
+ isValidating: boolean;
+ hasMore: boolean;
+ /** Server-driven filters — these affect the fetch key, so they live in the wrapper. */
+ q: string;
+ onQChange: (v: string) => void;
+ kind: string;
+ onKindChange: (v: string) => void;
+ language: string;
+ onLanguageChange: (v: string) => void;
+ onLoadMore: () => void;
+ onSelect: (sym: CodeSymbol) => void;
+ /** Drawer slot for the selected row. Wrapper passes a `<SymbolDrawer>` mounted with its own data. */
+ drawer?: ReactNode;
}
function SortIcon({ col, sortCol, sortDir }: { col: SortCol; sortCol: SortCol; sortDir: SortDir }) {
@@ -52,63 +61,24 @@ function ImportanceBar({ score }: { score: number }) {
);
}
-export function SymbolTable({ repoId }: SymbolTableProps) {
- const [q, setQ] = useState("");
- const debouncedQ = useDebounce(q, 300);
- const [kind, setKind] = useState("all");
- const [language, setLanguage] = useState("all");
+export function SymbolTable({
+ items,
+ importanceScores,
+ isLoading,
+ isValidating,
+ hasMore,
+ q,
+ onQChange,
+ kind,
+ onKindChange,
+ language,
+ onLanguageChange,
+ onLoadMore,
+ onSelect,
+ drawer,
+}: SymbolTableProps) {
const [sortCol, setSortCol] = useState<SortCol>("importance");
const [sortDir, setSortDir] = useState<SortDir>("desc");
- const [selected, setSelected] = useState<SymbolResponse | null>(null);
-
- // Fetch graph data for pagerank-based importance scoring
- const { data: graphData } = useSWR<GraphExportResponse>(
- `graph:${repoId}`,
- () => getGraph(repoId),
- { revalidateOnFocus: false, revalidateOnReconnect: false },
- );
-
- const pagerankMap = useMemo(() => {
- if (!graphData) return new Map<string, number>();
- const m = new Map<string, number>();
- for (const n of graphData.nodes) m.set(n.node_id, n.pagerank);
- return m;
- }, [graphData]);
-
- const { data, size, setSize, isLoading, isValidating } = useSWRInfinite<SymbolResponse[]>(
- (pageIndex, previousPageData) => {
- if (previousPageData && previousPageData.length < LIMIT) return null;
- return `symbols:${repoId}:${debouncedQ}:${kind}:${language}:${pageIndex}`;
- },
- (key) => {
- const pageIndex = parseInt(key.split(":").pop()!, 10);
- return listSymbols({
- repo_id: repoId,
- q: debouncedQ || undefined,
- kind: kind !== "all" ? kind : undefined,
- language: language !== "all" ? language : undefined,
- limit: LIMIT,
- offset: pageIndex * LIMIT,
- });
- },
- { revalidateOnFocus: false, revalidateFirstPage: false },
- );
-
- const items = useMemo(() => (data ? data.flat() : []), [data]);
-
- // Compute importance score per symbol: file pagerank * (1 + log(complexity))
- const importanceScores = useMemo(() => {
- const scores = new Map<string, number>();
- for (const sym of items) {
- const fileRank = pagerankMap.get(sym.file_path) ?? 0;
- const complexity = Math.max(1, sym.complexity_estimate);
- scores.set(sym.id, fileRank * (1 + Math.log(complexity)));
- }
- // Normalize to 0-1 range
- const max = Math.max(...scores.values(), 0.0001);
- for (const [k, v] of scores) scores.set(k, v / max);
- return scores;
- }, [items, pagerankMap]);
const handleSort = useCallback(
(col: SortCol) => {
@@ -129,16 +99,13 @@ export function SymbolTable({ repoId }: SymbolTableProps) {
const ib = importanceScores.get(b.id) ?? 0;
return sortDir === "asc" ? ia - ib : ib - ia;
}
- const va = a[sortCol] ?? "";
- const vb = b[sortCol] ?? "";
+ const va = (a as unknown as Record<string, unknown>)[sortCol] ?? "";
+ const vb = (b as unknown as Record<string, unknown>)[sortCol] ?? "";
const cmp = String(va).localeCompare(String(vb), undefined, { numeric: true });
return sortDir === "asc" ? cmp : -cmp;
});
}, [items, sortCol, sortDir, importanceScores]);
- const lastPage = data ? data[data.length - 1] : undefined;
- const hasMore = lastPage?.length === LIMIT;
-
const columns: Array<{ col: SortCol; label: string; hideOnMobile?: boolean }> = [
{ col: "importance", label: "Importance" },
{ col: "name", label: "Name" },
@@ -150,15 +117,14 @@ export function SymbolTable({ repoId }: SymbolTableProps) {
return (
<div className="space-y-4">
- {/* Filters */}
<div className="flex flex-wrap gap-2">
<Input
placeholder="Search symbols…"
value={q}
- onChange={(e) => setQ(e.target.value)}
+ onChange={(e) => onQChange(e.target.value)}
className="max-w-xs"
/>
- <Select value={kind} onValueChange={setKind}>
+ <Select value={kind} onValueChange={onKindChange}>
<SelectTrigger className="w-36">
<SelectValue placeholder="Kind" />
</SelectTrigger>
@@ -171,7 +137,7 @@ export function SymbolTable({ repoId }: SymbolTableProps) {
))}
</SelectContent>
</Select>
- <Select value={language} onValueChange={setLanguage}>
+ <Select value={language} onValueChange={onLanguageChange}>
<SelectTrigger className="w-36">
<SelectValue placeholder="Language" />
</SelectTrigger>
@@ -191,7 +157,6 @@ export function SymbolTable({ repoId }: SymbolTableProps) {
)}
</div>
- {/* Table */}
{isLoading && items.length === 0 ? (
<div className="space-y-2">
{Array.from({ length: 8 }).map((_, i) => (
@@ -240,11 +205,11 @@ export function SymbolTable({ repoId }: SymbolTableProps) {
tabIndex={0}
role="button"
aria-label={`View ${sym.qualified_name || sym.name}`}
- onClick={() => setSelected(sym)}
+ onClick={() => onSelect(sym)}
onKeyDown={(e) => {
if (e.key === "Enter" || e.key === " ") {
e.preventDefault();
- setSelected(sym);
+ onSelect(sym);
}
}}
>
@@ -292,7 +257,7 @@ export function SymbolTable({ repoId }: SymbolTableProps) {
<Button
variant="outline"
size="sm"
- onClick={() => setSize(size + 1)}
+ onClick={onLoadMore}
disabled={isValidating}
>
{isValidating ? "Loading…" : "Load more"}
@@ -302,7 +267,7 @@ export function SymbolTable({ repoId }: SymbolTableProps) {
</>
)}
- <SymbolDrawer symbol={selected} repoId={repoId} onClose={() => setSelected(null)} />
+ {drawer}
</div>
);
}
diff --git a/packages/web/src/components/ui/badge.tsx b/packages/ui/src/ui/badge.tsx
similarity index 97%
rename from packages/web/src/components/ui/badge.tsx
rename to packages/ui/src/ui/badge.tsx
index 0fdabc681..d8e7218cc 100644
--- a/packages/web/src/components/ui/badge.tsx
+++ b/packages/ui/src/ui/badge.tsx
@@ -1,6 +1,6 @@
import * as React from "react";
import { cva, type VariantProps } from "class-variance-authority";
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
const badgeVariants = cva(
"inline-flex items-center gap-1 rounded border px-2 py-0.5 text-xs font-medium transition-colors",
diff --git a/packages/web/src/components/ui/button.tsx b/packages/ui/src/ui/button.tsx
similarity index 98%
rename from packages/web/src/components/ui/button.tsx
rename to packages/ui/src/ui/button.tsx
index 619343f47..a2279b17c 100644
--- a/packages/web/src/components/ui/button.tsx
+++ b/packages/ui/src/ui/button.tsx
@@ -1,7 +1,7 @@
import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { cva, type VariantProps } from "class-variance-authority";
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
const buttonVariants = cva(
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent-primary)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-root)] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
diff --git a/packages/web/src/components/ui/card.tsx b/packages/ui/src/ui/card.tsx
similarity index 98%
rename from packages/web/src/components/ui/card.tsx
rename to packages/ui/src/ui/card.tsx
index 0dbacd04d..d7fb066d3 100644
--- a/packages/web/src/components/ui/card.tsx
+++ b/packages/ui/src/ui/card.tsx
@@ -1,5 +1,5 @@
import * as React from "react";
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
({ className, ...props }, ref) => (
diff --git a/packages/web/src/components/ui/confirm-dialog.tsx b/packages/ui/src/ui/confirm-dialog.tsx
similarity index 95%
rename from packages/web/src/components/ui/confirm-dialog.tsx
rename to packages/ui/src/ui/confirm-dialog.tsx
index 197d3ebec..bc2bd3de1 100644
--- a/packages/web/src/components/ui/confirm-dialog.tsx
+++ b/packages/ui/src/ui/confirm-dialog.tsx
@@ -8,8 +8,8 @@ import {
DialogFooter,
DialogHeader,
DialogTitle,
-} from "@/components/ui/dialog";
-import { Button } from "@/components/ui/button";
+} from "./dialog";
+import { Button } from "./button";
interface ConfirmDialogProps {
open: boolean;
diff --git a/packages/web/src/components/ui/dialog.tsx b/packages/ui/src/ui/dialog.tsx
similarity index 99%
rename from packages/web/src/components/ui/dialog.tsx
rename to packages/ui/src/ui/dialog.tsx
index e7dd270e7..58f6a8e2d 100644
--- a/packages/web/src/components/ui/dialog.tsx
+++ b/packages/ui/src/ui/dialog.tsx
@@ -3,7 +3,7 @@
import * as React from "react";
import * as DialogPrimitive from "@radix-ui/react-dialog";
import { X } from "lucide-react";
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
const Dialog = DialogPrimitive.Root;
const DialogTrigger = DialogPrimitive.Trigger;
diff --git a/packages/ui/src/ui/index.ts b/packages/ui/src/ui/index.ts
new file mode 100644
index 000000000..822fb6959
--- /dev/null
+++ b/packages/ui/src/ui/index.ts
@@ -0,0 +1,17 @@
+export * from "./badge.js";
+export * from "./button.js";
+export * from "./card.js";
+export * from "./confirm-dialog.js";
+export * from "./dialog.js";
+export * from "./input.js";
+export * from "./label.js";
+export * from "./progress.js";
+export * from "./scroll-area.js";
+export * from "./select.js";
+export * from "./separator.js";
+export * from "./sheet.js";
+export * from "./skeleton.js";
+export * from "./slider.js";
+export * from "./switch.js";
+export * from "./tabs.js";
+export * from "./tooltip.js";
diff --git a/packages/web/src/components/ui/input.tsx b/packages/ui/src/ui/input.tsx
similarity index 95%
rename from packages/web/src/components/ui/input.tsx
rename to packages/ui/src/ui/input.tsx
index 266554842..d9c523b68 100644
--- a/packages/web/src/components/ui/input.tsx
+++ b/packages/ui/src/ui/input.tsx
@@ -1,5 +1,5 @@
import * as React from "react";
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
({ className, type, ...props }, ref) => {
diff --git a/packages/web/src/components/ui/label.tsx b/packages/ui/src/ui/label.tsx
similarity index 92%
rename from packages/web/src/components/ui/label.tsx
rename to packages/ui/src/ui/label.tsx
index 3adc1aaf4..453bba088 100644
--- a/packages/web/src/components/ui/label.tsx
+++ b/packages/ui/src/ui/label.tsx
@@ -1,7 +1,7 @@
"use client";
import * as LabelPrimitive from "@radix-ui/react-label";
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
export function Label({
className,
diff --git a/packages/web/src/components/ui/progress.tsx b/packages/ui/src/ui/progress.tsx
similarity index 95%
rename from packages/web/src/components/ui/progress.tsx
rename to packages/ui/src/ui/progress.tsx
index 849243de5..f7be6ea22 100644
--- a/packages/web/src/components/ui/progress.tsx
+++ b/packages/ui/src/ui/progress.tsx
@@ -1,7 +1,7 @@
"use client";
import * as ProgressPrimitive from "@radix-ui/react-progress";
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
export function Progress({
value,
diff --git a/packages/web/src/components/ui/scroll-area.tsx b/packages/ui/src/ui/scroll-area.tsx
similarity index 97%
rename from packages/web/src/components/ui/scroll-area.tsx
rename to packages/ui/src/ui/scroll-area.tsx
index b4dca02c5..ffb6026e9 100644
--- a/packages/web/src/components/ui/scroll-area.tsx
+++ b/packages/ui/src/ui/scroll-area.tsx
@@ -2,7 +2,7 @@
import * as React from "react";
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
const ScrollArea = React.forwardRef<
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
diff --git a/packages/web/src/components/ui/select.tsx b/packages/ui/src/ui/select.tsx
similarity index 99%
rename from packages/web/src/components/ui/select.tsx
rename to packages/ui/src/ui/select.tsx
index 315fe6a86..2543e3fbe 100644
--- a/packages/web/src/components/ui/select.tsx
+++ b/packages/ui/src/ui/select.tsx
@@ -3,7 +3,7 @@
import * as React from "react";
import * as SelectPrimitive from "@radix-ui/react-select";
import { Check, ChevronDown, ChevronUp } from "lucide-react";
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
const Select = SelectPrimitive.Root;
const SelectGroup = SelectPrimitive.Group;
diff --git a/packages/web/src/components/ui/separator.tsx b/packages/ui/src/ui/separator.tsx
similarity index 95%
rename from packages/web/src/components/ui/separator.tsx
rename to packages/ui/src/ui/separator.tsx
index b0c674a9f..be1ffac71 100644
--- a/packages/web/src/components/ui/separator.tsx
+++ b/packages/ui/src/ui/separator.tsx
@@ -2,7 +2,7 @@
import * as React from "react";
import * as SeparatorPrimitive from "@radix-ui/react-separator";
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
const Separator = React.forwardRef<
React.ElementRef<typeof SeparatorPrimitive.Root>,
diff --git a/packages/web/src/components/ui/sheet.tsx b/packages/ui/src/ui/sheet.tsx
similarity index 98%
rename from packages/web/src/components/ui/sheet.tsx
rename to packages/ui/src/ui/sheet.tsx
index 009bd6eec..b51c77542 100644
--- a/packages/web/src/components/ui/sheet.tsx
+++ b/packages/ui/src/ui/sheet.tsx
@@ -3,7 +3,7 @@
import * as React from "react";
import * as DialogPrimitive from "@radix-ui/react-dialog";
import { X } from "lucide-react";
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
const Sheet = DialogPrimitive.Root;
const SheetTrigger = DialogPrimitive.Trigger;
diff --git a/packages/web/src/components/ui/skeleton.tsx b/packages/ui/src/ui/skeleton.tsx
similarity index 88%
rename from packages/web/src/components/ui/skeleton.tsx
rename to packages/ui/src/ui/skeleton.tsx
index d78fc8d9f..379cebcbc 100644
--- a/packages/web/src/components/ui/skeleton.tsx
+++ b/packages/ui/src/ui/skeleton.tsx
@@ -1,4 +1,4 @@
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
function Skeleton({
className,
diff --git a/packages/web/src/components/ui/slider.tsx b/packages/ui/src/ui/slider.tsx
similarity index 96%
rename from packages/web/src/components/ui/slider.tsx
rename to packages/ui/src/ui/slider.tsx
index 3470c5e25..012fb54e1 100644
--- a/packages/web/src/components/ui/slider.tsx
+++ b/packages/ui/src/ui/slider.tsx
@@ -1,7 +1,7 @@
"use client";
import * as SliderPrimitive from "@radix-ui/react-slider";
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
export function Slider({
className,
diff --git a/packages/web/src/components/ui/switch.tsx b/packages/ui/src/ui/switch.tsx
similarity index 96%
rename from packages/web/src/components/ui/switch.tsx
rename to packages/ui/src/ui/switch.tsx
index c850a29ba..a7bcff5b9 100644
--- a/packages/web/src/components/ui/switch.tsx
+++ b/packages/ui/src/ui/switch.tsx
@@ -1,7 +1,7 @@
"use client";
import * as SwitchPrimitive from "@radix-ui/react-switch";
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
export function Switch({
className,
diff --git a/packages/web/src/components/ui/tabs.tsx b/packages/ui/src/ui/tabs.tsx
similarity index 98%
rename from packages/web/src/components/ui/tabs.tsx
rename to packages/ui/src/ui/tabs.tsx
index d237de2e6..fa813f06c 100644
--- a/packages/web/src/components/ui/tabs.tsx
+++ b/packages/ui/src/ui/tabs.tsx
@@ -2,7 +2,7 @@
import * as React from "react";
import * as TabsPrimitive from "@radix-ui/react-tabs";
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
const Tabs = TabsPrimitive.Root;
diff --git a/packages/web/src/components/ui/tooltip.tsx b/packages/ui/src/ui/tooltip.tsx
similarity index 97%
rename from packages/web/src/components/ui/tooltip.tsx
rename to packages/ui/src/ui/tooltip.tsx
index 8db30eb0a..ffb8ccddf 100644
--- a/packages/web/src/components/ui/tooltip.tsx
+++ b/packages/ui/src/ui/tooltip.tsx
@@ -2,7 +2,7 @@
import * as React from "react";
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
const TooltipProvider = TooltipPrimitive.Provider;
const Tooltip = TooltipPrimitive.Root;
diff --git a/packages/web/src/components/wiki/code-block.tsx b/packages/ui/src/wiki/code-block.tsx
similarity index 90%
rename from packages/web/src/components/wiki/code-block.tsx
rename to packages/ui/src/wiki/code-block.tsx
index c32f2e50e..04e75899a 100644
--- a/packages/web/src/components/wiki/code-block.tsx
+++ b/packages/ui/src/wiki/code-block.tsx
@@ -2,16 +2,16 @@
import { useState } from "react";
import { Copy, Check } from "lucide-react";
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
-interface Props {
+interface CodeBlockProps {
code: string;
language?: string;
/** Pre-rendered HTML from Shiki — passed through as dangerouslySetInnerHTML */
html: string;
}
-export function CodeBlock({ code, language, html }: Props) {
+export function CodeBlock({ code, language, html }: CodeBlockProps) {
const [copied, setCopied] = useState(false);
async function copy() {
@@ -22,7 +22,6 @@ export function CodeBlock({ code, language, html }: Props) {
return (
<div className="group relative my-4 rounded-lg border border-[var(--color-border-default)] overflow-hidden">
- {/* Header bar */}
<div className="flex items-center justify-between px-4 py-1.5 bg-[var(--color-bg-elevated)] border-b border-[var(--color-border-default)]">
{language && (
<span className="text-xs font-mono text-[var(--color-text-tertiary)]">
@@ -52,7 +51,6 @@ export function CodeBlock({ code, language, html }: Props) {
</button>
</div>
- {/* Shiki-rendered HTML */}
<div
className="overflow-x-auto text-sm [&>pre]:p-4 [&>pre]:m-0 [&>pre]:bg-transparent!"
dangerouslySetInnerHTML={{ __html: html }}
diff --git a/packages/web/src/components/wiki/confidence-badge.tsx b/packages/ui/src/wiki/confidence-badge.tsx
similarity index 88%
rename from packages/web/src/components/wiki/confidence-badge.tsx
rename to packages/ui/src/wiki/confidence-badge.tsx
index 54aefb3ef..45488bd06 100644
--- a/packages/web/src/components/wiki/confidence-badge.tsx
+++ b/packages/ui/src/wiki/confidence-badge.tsx
@@ -1,15 +1,15 @@
"use client";
import * as React from "react";
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
import {
scoreToStatus,
statusBadgeClasses,
statusLabel,
type FreshnessStatus,
-} from "@/lib/utils/confidence";
-import { formatConfidence } from "@/lib/utils/format";
-import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
+} from "../lib/confidence";
+import { formatConfidence } from "../lib/format";
+import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip";
interface ConfidenceBadgeProps {
score: number;
diff --git a/packages/web/src/components/wiki/git-history-panel.tsx b/packages/ui/src/wiki/git-history-panel.tsx
similarity index 91%
rename from packages/web/src/components/wiki/git-history-panel.tsx
rename to packages/ui/src/wiki/git-history-panel.tsx
index 2065a6f46..c22b95d9e 100644
--- a/packages/web/src/components/wiki/git-history-panel.tsx
+++ b/packages/ui/src/wiki/git-history-panel.tsx
@@ -1,23 +1,25 @@
import { GitCommit, User } from "lucide-react";
-import { Badge } from "@/components/ui/badge";
-import { CommitCategorySparkline } from "@/components/git/commit-category-sparkline";
-import { CoChangeList } from "@/components/git/co-change-list";
-import { formatRelativeTime, formatDate, formatAgeDays } from "@/lib/utils/format";
-import type { GitMetadataResponse } from "@/lib/api/types";
+import { Badge } from "../ui/badge";
+import { CommitCategorySparkline } from "../git/commit-category-sparkline";
+import { CoChangeList } from "../git/co-change-list";
+import { formatRelativeTime, formatDate, formatAgeDays } from "../lib/format";
+import type { GitMetadata } from "@repowise-dev/types/git";
interface GitHistoryPanelProps {
- git: GitMetadataResponse;
+ git: GitMetadata;
}
const AUTHOR_COLORS = [
"bg-blue-500", "bg-purple-500", "bg-green-500", "bg-yellow-500",
"bg-pink-500", "bg-indigo-500", "bg-teal-500", "bg-orange-500",
];
+const AUTHOR_COLOR_FALLBACK = "bg-gray-500";
const AUTHOR_BAR_COLORS = [
"#3b82f6", "#a855f7", "#22c55e", "#eab308",
"#ec4899", "#6366f1", "#14b8a6", "#f97316",
];
+const AUTHOR_BAR_FALLBACK = "#6b7280";
function authorColorIndex(name: string): number {
let hash = 0;
@@ -33,7 +35,7 @@ function AuthorAvatar({ name }: { name: string }) {
.map((p) => p[0]?.toUpperCase() ?? "")
.join("");
- const color = AUTHOR_COLORS[authorColorIndex(name)];
+ const color = AUTHOR_COLORS[authorColorIndex(name)] ?? AUTHOR_COLOR_FALLBACK;
return (
<div
@@ -46,7 +48,7 @@ function AuthorAvatar({ name }: { name: string }) {
);
}
-function getVelocityLabel(git: GitMetadataResponse): { label: string; color: string } {
+function getVelocityLabel(git: GitMetadata): { label: string; color: string } {
if (git.commit_count_90d === 0) return { label: "Inactive", color: "text-[var(--color-text-tertiary)]" };
const rate30 = git.commit_count_30d / 30;
const rate90 = git.commit_count_90d / 90;
@@ -61,7 +63,6 @@ export function GitHistoryPanel({ git }: GitHistoryPanelProps) {
return (
<div className="space-y-4">
- {/* File lifecycle */}
<div>
<p className="text-xs font-medium text-[var(--color-text-tertiary)] uppercase tracking-wider mb-2">
File Status
@@ -115,7 +116,6 @@ export function GitHistoryPanel({ git }: GitHistoryPanelProps) {
</div>
</div>
- {/* Commit categories sparkline */}
{git.commit_categories && Object.keys(git.commit_categories).length > 0 && (
<div>
<p className="text-xs font-medium text-[var(--color-text-tertiary)] uppercase tracking-wider mb-2">
@@ -125,7 +125,6 @@ export function GitHistoryPanel({ git }: GitHistoryPanelProps) {
</div>
)}
- {/* Top authors with bars */}
{git.top_authors && git.top_authors.length > 0 && (
<div>
<p className="text-xs font-medium text-[var(--color-text-tertiary)] uppercase tracking-wider mb-2">
@@ -148,7 +147,8 @@ export function GitHistoryPanel({ git }: GitHistoryPanelProps) {
className="h-1 rounded-full transition-all"
style={{
width: `${Math.min(100, author.pct * 100)}%`,
- backgroundColor: AUTHOR_BAR_COLORS[authorColorIndex(author.name)],
+ backgroundColor:
+ AUTHOR_BAR_COLORS[authorColorIndex(author.name)] ?? AUTHOR_BAR_FALLBACK,
}}
/>
</div>
@@ -158,7 +158,6 @@ export function GitHistoryPanel({ git }: GitHistoryPanelProps) {
</div>
)}
- {/* Co-change partners */}
{git.co_change_partners && git.co_change_partners.length > 0 && (
<div>
<p className="text-xs font-medium text-[var(--color-text-tertiary)] uppercase tracking-wider mb-2">
@@ -168,7 +167,6 @@ export function GitHistoryPanel({ git }: GitHistoryPanelProps) {
</div>
)}
- {/* Recent commits */}
{commits.length > 0 && (
<div>
<p className="text-xs font-medium text-[var(--color-text-tertiary)] uppercase tracking-wider mb-2">
diff --git a/packages/ui/src/wiki/index.ts b/packages/ui/src/wiki/index.ts
new file mode 100644
index 000000000..da2c62b26
--- /dev/null
+++ b/packages/ui/src/wiki/index.ts
@@ -0,0 +1,11 @@
+export * from "./code-block.js";
+export * from "./confidence-badge.js";
+export * from "./git-history-panel.js";
+export * from "./mermaid-diagram.js";
+export * from "./regenerate-button.js";
+export * from "./security-panel.js";
+export * from "./table-of-contents.js";
+export * from "./version-history.js";
+export * from "./wiki-markdown.js";
+export * from "./wiki-mdx-components.js";
+export * from "./wiki-mdx-preprocess.js";
diff --git a/packages/web/src/components/wiki/mermaid-diagram.tsx b/packages/ui/src/wiki/mermaid-diagram.tsx
similarity index 87%
rename from packages/web/src/components/wiki/mermaid-diagram.tsx
rename to packages/ui/src/wiki/mermaid-diagram.tsx
index 9abecca21..0947d2c4a 100644
--- a/packages/web/src/components/wiki/mermaid-diagram.tsx
+++ b/packages/ui/src/wiki/mermaid-diagram.tsx
@@ -2,11 +2,11 @@
import { useEffect, useRef, useState } from "react";
-interface Props {
+interface MermaidDiagramProps {
chart: string;
}
-export function MermaidDiagram({ chart }: Props) {
+export function MermaidDiagram({ chart }: MermaidDiagramProps) {
const ref = useRef<HTMLDivElement>(null);
const [error, setError] = useState<string | null>(null);
@@ -14,7 +14,6 @@ export function MermaidDiagram({ chart }: Props) {
if (!ref.current) return;
const el = ref.current;
- // Dynamic import avoids SSR issues with mermaid
import("mermaid").then(({ default: mermaid }) => {
mermaid.initialize({
startOnLoad: false,
@@ -32,8 +31,6 @@ export function MermaidDiagram({ chart }: Props) {
.render(id, chart)
.then(({ svg }) => {
el.innerHTML = svg;
- // Make the rendered SVG fluid so it reflows on narrow viewports
- // instead of forcing horizontal scroll.
const svgEl = el.querySelector("svg");
if (svgEl) {
svgEl.removeAttribute("width");
diff --git a/packages/ui/src/wiki/regenerate-button.tsx b/packages/ui/src/wiki/regenerate-button.tsx
new file mode 100644
index 000000000..9e19c886a
--- /dev/null
+++ b/packages/ui/src/wiki/regenerate-button.tsx
@@ -0,0 +1,66 @@
+"use client";
+
+import type { ReactNode } from "react";
+import { RefreshCw } from "lucide-react";
+import { Button } from "../ui/button";
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+} from "../ui/dialog";
+
+export interface RegenerateButtonProps {
+ /** Fired when the user clicks the regenerate button. Wrapper owns the
+ * mutation + toast + cache-invalidation lifecycle. */
+ onRegenerate: () => void;
+ /** When true, the button shows a spinning icon and is disabled (request
+ * in-flight prior to a job id being assigned). */
+ isLoading?: boolean;
+ /** When true, the progress dialog is open. The wrapper sets this to
+ * `true` once it receives a job id back from the regenerate mutation. */
+ isInProgress?: boolean;
+ /** Called when the dialog requests to close (user dismiss or job done). */
+ onDialogClose?: () => void;
+ /** Rendered inside the in-progress dialog — typically a job-progress
+ * widget owned by the wrapper. */
+ jobSlot?: ReactNode;
+}
+
+export function RegenerateButton({
+ onRegenerate,
+ isLoading = false,
+ isInProgress = false,
+ onDialogClose,
+ jobSlot,
+}: RegenerateButtonProps) {
+ return (
+ <>
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={onRegenerate}
+ disabled={isLoading || isInProgress}
+ className="h-7 gap-1.5 text-xs"
+ aria-label="Regenerate this page"
+ >
+ <RefreshCw className={`h-3.5 w-3.5 ${isLoading ? "animate-spin" : ""}`} />
+ <span className="hidden sm:inline">Regenerate</span>
+ </Button>
+
+ <Dialog
+ open={isInProgress}
+ onOpenChange={(v) => {
+ if (!v) onDialogClose?.();
+ }}
+ >
+ <DialogContent className="sm:max-w-md">
+ <DialogHeader>
+ <DialogTitle>Regenerating Page</DialogTitle>
+ </DialogHeader>
+ {jobSlot}
+ </DialogContent>
+ </Dialog>
+ </>
+ );
+}
diff --git a/packages/ui/src/wiki/security-panel.tsx b/packages/ui/src/wiki/security-panel.tsx
new file mode 100644
index 000000000..7f67123e5
--- /dev/null
+++ b/packages/ui/src/wiki/security-panel.tsx
@@ -0,0 +1,60 @@
+"use client";
+
+import type { SecurityFinding, SecuritySeverity } from "@repowise-dev/types";
+import { Badge } from "../ui/badge";
+
+export interface SecurityPanelProps {
+ /** Findings for the file. Empty / undefined renders an empty-state message. */
+ findings: SecurityFinding[] | undefined;
+ /** While loading the shell renders nothing. */
+ isLoading?: boolean;
+}
+
+function severityVariant(severity: SecuritySeverity): "outdated" | "stale" | "default" {
+ if (severity === "high") return "outdated";
+ if (severity === "med") return "stale";
+ return "default";
+}
+
+function severityLabel(severity: SecuritySeverity): string {
+ if (severity === "high") return "High";
+ if (severity === "med") return "Med";
+ return "Low";
+}
+
+export function SecurityPanel({ findings, isLoading }: SecurityPanelProps) {
+ if (isLoading) return null;
+ if (!findings || findings.length === 0) {
+ return (
+ <p className="text-xs text-[var(--color-text-tertiary)]">No security signals.</p>
+ );
+ }
+
+ return (
+ <div className="space-y-2">
+ {findings.map((f) => (
+ <div
+ key={f.id}
+ className="rounded border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] p-2 space-y-1"
+ >
+ <div className="flex items-center gap-1.5 flex-wrap">
+ <Badge
+ variant={severityVariant(f.severity)}
+ className="text-[10px] px-1 py-0 leading-4"
+ >
+ {severityLabel(f.severity)}
+ </Badge>
+ <span className="text-xs font-medium text-[var(--color-text-secondary)] truncate">
+ {f.kind}
+ </span>
+ </div>
+ {f.snippet && (
+ <pre className="text-[10px] font-mono text-[var(--color-text-tertiary)] whitespace-pre-wrap break-all line-clamp-3 leading-relaxed">
+ {f.snippet.length > 120 ? f.snippet.slice(0, 120) + "…" : f.snippet}
+ </pre>
+ )}
+ </div>
+ ))}
+ </div>
+ );
+}
diff --git a/packages/web/src/components/wiki/table-of-contents.tsx b/packages/ui/src/wiki/table-of-contents.tsx
similarity index 96%
rename from packages/web/src/components/wiki/table-of-contents.tsx
rename to packages/ui/src/wiki/table-of-contents.tsx
index 2a7ee7215..091cd0ab6 100644
--- a/packages/web/src/components/wiki/table-of-contents.tsx
+++ b/packages/ui/src/wiki/table-of-contents.tsx
@@ -1,7 +1,7 @@
"use client";
import { useEffect, useState } from "react";
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
interface Heading {
id: string;
@@ -14,7 +14,7 @@ function extractHeadings(content: string): Heading[] {
const headings: Heading[] = [];
for (const line of lines) {
const match = line.match(/^(#{1,3})\s+(.+)$/);
- if (match) {
+ if (match && match[1] && match[2]) {
const text = match[2].trim();
const id = text
.toLowerCase()
diff --git a/packages/ui/src/wiki/version-history.tsx b/packages/ui/src/wiki/version-history.tsx
new file mode 100644
index 000000000..40ab197b3
--- /dev/null
+++ b/packages/ui/src/wiki/version-history.tsx
@@ -0,0 +1,230 @@
+"use client";
+
+import { useState } from "react";
+import { ChevronDown, ChevronRight, Clock, Diff, ArrowLeft } from "lucide-react";
+import type { DocPageVersion } from "@repowise-dev/types";
+import { cn } from "../lib/cn";
+import { formatRelativeTime } from "../lib/format";
+import { Badge } from "../ui/badge";
+
+export interface VersionHistoryProps {
+ /** Archived prior versions, newest-first as returned by the engine. */
+ versions: DocPageVersion[];
+ /** Version number of the currently-rendered page. */
+ currentVersion: number;
+ /** Markdown content of the currently-rendered page (used as the
+ * "new" side of the diff view). */
+ currentContent: string;
+ /** While loading the shell renders nothing. */
+ isLoading?: boolean;
+}
+
+export function VersionHistory({
+ versions,
+ currentVersion,
+ currentContent,
+ isLoading,
+}: VersionHistoryProps) {
+ const [expanded, setExpanded] = useState(false);
+ const [selectedVersion, setSelectedVersion] = useState<DocPageVersion | null>(null);
+ const [showDiff, setShowDiff] = useState(false);
+
+ if (isLoading || versions.length === 0) return null;
+
+ if (selectedVersion) {
+ return (
+ <div className="border border-[var(--color-border-default)] rounded-lg overflow-hidden">
+ {/* Header */}
+ <div className="flex items-center justify-between px-4 py-2 bg-[var(--color-bg-elevated)] border-b border-[var(--color-border-default)]">
+ <button
+ onClick={() => {
+ setSelectedVersion(null);
+ setShowDiff(false);
+ }}
+ className="flex items-center gap-1.5 text-xs text-[var(--color-accent-primary)] hover:underline"
+ >
+ <ArrowLeft className="h-3 w-3" />
+ Back to versions
+ </button>
+ <div className="flex items-center gap-2">
+ <span className="text-xs text-[var(--color-text-tertiary)]">
+ v{selectedVersion.version}
+ </span>
+ <button
+ onClick={() => setShowDiff((d) => !d)}
+ className={cn(
+ "flex items-center gap-1 text-xs px-2 py-0.5 rounded border transition-colors",
+ showDiff
+ ? "bg-[var(--color-accent-primary)]/10 border-[var(--color-accent-primary)]/30 text-[var(--color-accent-primary)]"
+ : "border-[var(--color-border-default)] text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)]",
+ )}
+ >
+ <Diff className="h-3 w-3" />
+ {showDiff ? "Showing diff" : "Show diff"}
+ </button>
+ </div>
+ </div>
+
+ {/* Content */}
+ <div className="max-h-[500px] overflow-auto p-4">
+ {showDiff ? (
+ <DiffView oldContent={selectedVersion.content} newContent={currentContent} />
+ ) : (
+ <pre className="text-xs font-mono text-[var(--color-text-secondary)] whitespace-pre-wrap leading-relaxed">
+ {selectedVersion.content}
+ </pre>
+ )}
+ </div>
+ </div>
+ );
+ }
+
+ return (
+ <div className="border border-[var(--color-border-default)] rounded-lg overflow-hidden">
+ <button
+ onClick={() => setExpanded((e) => !e)}
+ className="flex items-center justify-between w-full px-4 py-2 bg-[var(--color-bg-elevated)] hover:bg-[var(--color-bg-elevated)]/80 transition-colors"
+ >
+ <div className="flex items-center gap-1.5">
+ <Clock className="h-3.5 w-3.5 text-[var(--color-text-tertiary)]" />
+ <span className="text-xs font-medium text-[var(--color-text-secondary)]">
+ Version History
+ </span>
+ <Badge variant="outline" className="text-[10px] ml-1">
+ {versions.length} versions
+ </Badge>
+ </div>
+ {expanded ? (
+ <ChevronDown className="h-3.5 w-3.5 text-[var(--color-text-tertiary)]" />
+ ) : (
+ <ChevronRight className="h-3.5 w-3.5 text-[var(--color-text-tertiary)]" />
+ )}
+ </button>
+
+ {expanded && (
+ <div className="divide-y divide-[var(--color-border-default)]">
+ {/* Current version */}
+ <div className="flex items-center justify-between px-4 py-2 bg-[var(--color-accent-primary)]/5">
+ <div className="flex items-center gap-2">
+ <span className="text-xs font-mono text-[var(--color-accent-primary)]">
+ v{currentVersion}
+ </span>
+ <Badge variant="accent" className="text-[10px]">
+ current
+ </Badge>
+ </div>
+ </div>
+
+ {/* Previous versions */}
+ {versions.map((v) => (
+ <button
+ key={v.id}
+ onClick={() => setSelectedVersion(v)}
+ className="flex items-center justify-between w-full px-4 py-2 hover:bg-[var(--color-bg-elevated)] transition-colors text-left"
+ >
+ <div className="flex items-center gap-2 min-w-0">
+ <span className="text-xs font-mono text-[var(--color-text-secondary)]">
+ v{v.version}
+ </span>
+ <span className="text-[10px] text-[var(--color-text-tertiary)] font-mono truncate">
+ {v.model_name}
+ </span>
+ </div>
+ <span className="text-[10px] text-[var(--color-text-tertiary)] shrink-0 ml-2">
+ {formatRelativeTime(v.archived_at)}
+ </span>
+ </button>
+ ))}
+ </div>
+ )}
+ </div>
+ );
+}
+
+function DiffView({ oldContent, newContent }: { oldContent: string; newContent: string }) {
+ const oldLines = oldContent.split("\n");
+ const newLines = newContent.split("\n");
+
+ // Simple line-by-line diff (LCS-based)
+ const diff = computeLineDiff(oldLines, newLines);
+
+ return (
+ <div className="text-xs font-mono space-y-0">
+ {diff.map((line, i) => (
+ <div
+ key={i}
+ className={cn(
+ "px-2 py-0.5 whitespace-pre-wrap break-all",
+ line.type === "added" && "bg-green-500/10 text-green-400",
+ line.type === "removed" && "bg-red-500/10 text-red-400",
+ line.type === "unchanged" && "text-[var(--color-text-tertiary)]",
+ )}
+ >
+ <span className="inline-block w-4 text-right mr-2 select-none opacity-50">
+ {line.type === "added" ? "+" : line.type === "removed" ? "-" : " "}
+ </span>
+ {line.text}
+ </div>
+ ))}
+ </div>
+ );
+}
+
+interface DiffLine {
+ type: "added" | "removed" | "unchanged";
+ text: string;
+}
+
+function computeLineDiff(oldLines: string[], newLines: string[]): DiffLine[] {
+ // Build LCS table
+ const m = oldLines.length;
+ const n = newLines.length;
+
+ // For very large files, fall back to a simpler approach
+ if (m * n > 500_000) {
+ return simpleDiff(oldLines, newLines);
+ }
+
+ const dp: number[][] = Array.from({ length: m + 1 }, () => Array(n + 1).fill(0));
+
+ for (let i = 1; i <= m; i++) {
+ for (let j = 1; j <= n; j++) {
+ if (oldLines[i - 1] === newLines[j - 1]) {
+ dp[i]![j] = dp[i - 1]![j - 1]! + 1;
+ } else {
+ dp[i]![j] = Math.max(dp[i - 1]![j]!, dp[i]![j - 1]!);
+ }
+ }
+ }
+
+ // Backtrack to produce diff
+ const result: DiffLine[] = [];
+ let i = m;
+ let j = n;
+ while (i > 0 || j > 0) {
+ if (i > 0 && j > 0 && oldLines[i - 1] === newLines[j - 1]) {
+ result.unshift({ type: "unchanged", text: oldLines[i - 1]! });
+ i--;
+ j--;
+ } else if (j > 0 && (i === 0 || dp[i]![j - 1]! >= dp[i - 1]![j]!)) {
+ result.unshift({ type: "added", text: newLines[j - 1]! });
+ j--;
+ } else {
+ result.unshift({ type: "removed", text: oldLines[i - 1]! });
+ i--;
+ }
+ }
+
+ return result;
+}
+
+function simpleDiff(oldLines: string[], newLines: string[]): DiffLine[] {
+ const result: DiffLine[] = [];
+ for (const line of oldLines) {
+ result.push({ type: "removed", text: line });
+ }
+ for (const line of newLines) {
+ result.push({ type: "added", text: line });
+ }
+ return result;
+}
diff --git a/packages/web/src/components/wiki/wiki-markdown.tsx b/packages/ui/src/wiki/wiki-markdown.tsx
similarity index 95%
rename from packages/web/src/components/wiki/wiki-markdown.tsx
rename to packages/ui/src/wiki/wiki-markdown.tsx
index c82be4a78..1bef7acdb 100644
--- a/packages/web/src/components/wiki/wiki-markdown.tsx
+++ b/packages/ui/src/wiki/wiki-markdown.tsx
@@ -6,15 +6,7 @@ import type { Components } from "react-markdown";
import { MermaidDiagram } from "./mermaid-diagram";
import { useState } from "react";
import { Copy, Check } from "lucide-react";
-import { cn } from "@/lib/utils/cn";
-
-/**
- * Client-side wiki markdown renderer with Mermaid diagram support and
- * heading anchor IDs (for ToC scroll-to-heading).
- *
- * This replaces ChatMarkdown in the docs explorer so that Mermaid diagrams
- * render inline and ToC links work correctly.
- */
+import { cn } from "../lib/cn";
function slugify(text: string): string {
return text
diff --git a/packages/ui/src/wiki/wiki-mdx-components.tsx b/packages/ui/src/wiki/wiki-mdx-components.tsx
new file mode 100644
index 000000000..57039fc41
--- /dev/null
+++ b/packages/ui/src/wiki/wiki-mdx-components.tsx
@@ -0,0 +1,120 @@
+import type { ReactNode } from "react";
+
+function slugify(text: string): string {
+ return text
+ .toLowerCase()
+ .replace(/[^\w\s-]/g, "")
+ .replace(/\s+/g, "-");
+}
+
+function extractText(node: unknown): string {
+ if (typeof node === "string") return node;
+ if (Array.isArray(node)) return node.map(extractText).join("");
+ if (node && typeof node === "object" && "props" in node) {
+ const props = (node as { props?: { children?: unknown } }).props;
+ return extractText(props?.children);
+ }
+ return "";
+}
+
+export const wikiMdxComponents = {
+ h1: (props: React.HTMLAttributes<HTMLHeadingElement>) => {
+ const id = slugify(extractText(props.children));
+ return (
+ <h2
+ id={id}
+ className="mt-8 mb-4 text-xl font-semibold text-[var(--color-text-primary)] first:mt-0 scroll-mt-16"
+ {...props}
+ />
+ );
+ },
+ h2: (props: React.HTMLAttributes<HTMLHeadingElement>) => {
+ const id = slugify(extractText(props.children));
+ return (
+ <h2
+ id={id}
+ className="mt-6 mb-3 text-lg font-semibold text-[var(--color-text-primary)] scroll-mt-16"
+ {...props}
+ />
+ );
+ },
+ h3: (props: React.HTMLAttributes<HTMLHeadingElement>) => {
+ const id = slugify(extractText(props.children));
+ return (
+ <h3
+ id={id}
+ className="mt-5 mb-2 text-base font-semibold text-[var(--color-text-primary)] scroll-mt-16"
+ {...props}
+ />
+ );
+ },
+ p: (props: React.HTMLAttributes<HTMLParagraphElement>) => (
+ <p className="mb-4 text-sm leading-7 text-[var(--color-text-secondary)]" {...props} />
+ ),
+ ul: (props: React.HTMLAttributes<HTMLUListElement>) => (
+ <ul className="mb-4 ml-4 space-y-1 list-disc text-sm text-[var(--color-text-secondary)]" {...props} />
+ ),
+ ol: (props: React.HTMLAttributes<HTMLOListElement>) => (
+ <ol className="mb-4 ml-4 space-y-1 list-decimal text-sm text-[var(--color-text-secondary)]" {...props} />
+ ),
+ li: (props: React.HTMLAttributes<HTMLLIElement>) => (
+ <li className="leading-6" {...props} />
+ ),
+ blockquote: (props: React.HTMLAttributes<HTMLQuoteElement>) => (
+ <blockquote
+ className="my-4 border-l-2 border-[var(--color-accent-primary)] pl-4 text-sm italic text-[var(--color-text-tertiary)]"
+ {...props}
+ />
+ ),
+ table: (props: React.HTMLAttributes<HTMLTableElement>) => (
+ <div className="my-4 overflow-x-auto rounded border border-[var(--color-border-default)]">
+ <table className="w-full text-sm" {...props} />
+ </div>
+ ),
+ thead: (props: React.HTMLAttributes<HTMLTableSectionElement>) => (
+ <thead className="bg-[var(--color-bg-elevated)]" {...props} />
+ ),
+ th: (props: React.HTMLAttributes<HTMLTableCellElement>) => (
+ <th
+ className="px-4 py-2 text-left text-xs font-medium text-[var(--color-text-tertiary)] uppercase tracking-wider"
+ {...props}
+ />
+ ),
+ td: (props: React.HTMLAttributes<HTMLTableCellElement>) => (
+ <td
+ className="px-4 py-2 text-sm text-[var(--color-text-secondary)] border-t border-[var(--color-border-default)]"
+ {...props}
+ />
+ ),
+ hr: () => <hr className="my-6 border-[var(--color-border-default)]" />,
+ a: (props: React.AnchorHTMLAttributes<HTMLAnchorElement>) => (
+ <a
+ className="text-[var(--color-accent-primary)] underline underline-offset-2 hover:opacity-80 transition-opacity"
+ {...props}
+ />
+ ),
+ strong: (props: React.HTMLAttributes<HTMLElement>) => (
+ <strong className="font-semibold text-[var(--color-text-primary)]" {...props} />
+ ),
+ code: (props: React.HTMLAttributes<HTMLElement>) => (
+ <code
+ className="rounded bg-[var(--color-bg-elevated)] px-1.5 py-0.5 text-xs font-mono text-[var(--color-accent-primary)]"
+ {...props}
+ />
+ ),
+};
+
+export interface ShikiBlockProps {
+ html: string;
+ code: string;
+ lang: string;
+}
+
+export interface MermaidBlockProps {
+ chart: string;
+}
+
+export type WikiMdxOverrides = {
+ ShikiBlock: (p: ShikiBlockProps) => ReactNode;
+ MermaidBlock: (p: MermaidBlockProps) => ReactNode;
+};
diff --git a/packages/ui/src/wiki/wiki-mdx-preprocess.ts b/packages/ui/src/wiki/wiki-mdx-preprocess.ts
new file mode 100644
index 000000000..d8d7cfad1
--- /dev/null
+++ b/packages/ui/src/wiki/wiki-mdx-preprocess.ts
@@ -0,0 +1,59 @@
+// Framework-neutral preprocessor that swaps fenced code blocks for JSX
+// component calls (`<ShikiBlock />` and `<MermaidBlock />`). The Shiki call
+// is async and provided by the caller so the package never imports `shiki`
+// directly — apps decide whether to run it server-side or client-side.
+
+export interface PreprocessedSource {
+ source: string;
+}
+
+export type ShikiHighlighter = (
+ code: string,
+ lang: string,
+) => Promise<string>;
+
+export async function preprocessWikiCodeBlocks(
+ content: string,
+ highlight: ShikiHighlighter,
+): Promise<PreprocessedSource> {
+ const fenceRe = /```(\w*)\n([\s\S]*?)```/g;
+ const replacements: Array<{ placeholder: string; jsx: string }> = [];
+
+ let match: RegExpExecArray | null;
+ let idx = 0;
+ while ((match = fenceRe.exec(content)) !== null) {
+ const lang = match[1] || "text";
+ const code = match[2] ?? "";
+
+ if (lang === "mermaid") {
+ const chart = JSON.stringify(code);
+ replacements.push({
+ placeholder: `\`\`\`${lang}\n${code}\`\`\``,
+ jsx: `<MermaidBlock chart={${chart}} />`,
+ });
+ idx++;
+ continue;
+ }
+
+ let html = "";
+ try {
+ html = await highlight(code, lang);
+ } catch {
+ html = `<pre><code>${code.replace(/</g, "&lt;")}</code></pre>`;
+ }
+
+ const htmlProp = JSON.stringify(html);
+ const codeProp = JSON.stringify(code);
+ replacements.push({
+ placeholder: `\`\`\`${lang}\n${code}\`\`\``,
+ jsx: `<ShikiBlock html={${htmlProp}} code={${codeProp}} lang="${lang}" />`,
+ });
+ idx++;
+ }
+
+ let source = content;
+ for (const { placeholder, jsx } of replacements) {
+ source = source.replace(placeholder, jsx);
+ }
+ return { source };
+}
diff --git a/packages/web/src/components/workspace/co-change-table.tsx b/packages/ui/src/workspace/co-change-table.tsx
similarity index 96%
rename from packages/web/src/components/workspace/co-change-table.tsx
rename to packages/ui/src/workspace/co-change-table.tsx
index 7df38ebb1..6fbdf49ad 100644
--- a/packages/web/src/components/workspace/co-change-table.tsx
+++ b/packages/ui/src/workspace/co-change-table.tsx
@@ -1,7 +1,7 @@
"use client";
-import type { WorkspaceCoChangeEntry } from "@/lib/api/types";
-import { Badge } from "@/components/ui/badge";
+import { Badge } from "../ui/badge";
+import type { WorkspaceCoChangeEntry } from "@repowise-dev/types/workspace";
interface CoChangeTableProps {
coChanges: WorkspaceCoChangeEntry[];
@@ -68,7 +68,7 @@ export function CoChangeTable({ coChanges, compact }: CoChangeTableProps) {
)}
{!compact && (
<td className="py-2 text-xs text-[var(--color-text-tertiary)]" title={cc.last_date ? new Date(cc.last_date).toLocaleString() : undefined}>
- {cc.last_date ? new Date(cc.last_date).toLocaleDateString() : "—"}
+ {cc.last_date ? new Date(cc.last_date).toLocaleDateString() : "—"}
</td>
)}
</tr>
diff --git a/packages/web/src/components/workspace/contract-links-table.tsx b/packages/ui/src/workspace/contract-links-table.tsx
similarity index 97%
rename from packages/web/src/components/workspace/contract-links-table.tsx
rename to packages/ui/src/workspace/contract-links-table.tsx
index 50a0684dd..7dc5c3b6a 100644
--- a/packages/web/src/components/workspace/contract-links-table.tsx
+++ b/packages/ui/src/workspace/contract-links-table.tsx
@@ -1,7 +1,7 @@
"use client";
-import type { WorkspaceContractLinkEntry } from "@/lib/api/types";
import { ContractTypeBadge } from "./contract-type-badge";
+import type { WorkspaceContractLinkEntry } from "@repowise-dev/types/workspace";
interface ContractLinksTableProps {
links: WorkspaceContractLinkEntry[];
diff --git a/packages/web/src/components/workspace/contract-type-badge.tsx b/packages/ui/src/workspace/contract-type-badge.tsx
similarity index 96%
rename from packages/web/src/components/workspace/contract-type-badge.tsx
rename to packages/ui/src/workspace/contract-type-badge.tsx
index 3f185baf6..aafbac701 100644
--- a/packages/web/src/components/workspace/contract-type-badge.tsx
+++ b/packages/ui/src/workspace/contract-type-badge.tsx
@@ -1,6 +1,6 @@
"use client";
-import { cn } from "@/lib/utils/cn";
+import { cn } from "../lib/cn";
const TYPE_STYLES: Record<string, { bg: string; text: string; label: string }> = {
http: { bg: "bg-blue-500/10", text: "text-blue-400", label: "HTTP" },
diff --git a/packages/web/src/components/workspace/cross-repo-summary.tsx b/packages/ui/src/workspace/cross-repo-summary.tsx
similarity index 72%
rename from packages/web/src/components/workspace/cross-repo-summary.tsx
rename to packages/ui/src/workspace/cross-repo-summary.tsx
index 6437166e7..f525f6c15 100644
--- a/packages/web/src/components/workspace/cross-repo-summary.tsx
+++ b/packages/ui/src/workspace/cross-repo-summary.tsx
@@ -1,8 +1,11 @@
"use client";
import { Link2, GitMerge, Package } from "lucide-react";
-import type { WorkspaceCrossRepoSummary, WorkspaceContractSummary } from "@/lib/api/types";
-import { StatCard } from "@/components/shared/stat-card";
+import { StatCard } from "../shared/stat-card";
+import type {
+ WorkspaceCrossRepoSummary,
+ WorkspaceContractSummary,
+} from "@repowise-dev/types/workspace";
interface CrossRepoSummaryProps {
crossRepo: WorkspaceCrossRepoSummary | null;
@@ -10,6 +13,12 @@ interface CrossRepoSummaryProps {
}
export function CrossRepoSummary({ crossRepo, contracts }: CrossRepoSummaryProps) {
+ const byTypeDescription = contracts?.by_type
+ ? Object.entries(contracts.by_type)
+ .map(([k, v]) => `${v} ${k}`)
+ .join(", ")
+ : undefined;
+
return (
<div className="grid grid-cols-2 gap-3 lg:grid-cols-4">
<StatCard
@@ -30,13 +39,7 @@ export function CrossRepoSummary({ crossRepo, contracts }: CrossRepoSummaryProps
<StatCard
label="Contracts Detected"
value={contracts?.total_contracts ?? 0}
- description={
- contracts?.by_type
- ? Object.entries(contracts.by_type)
- .map(([k, v]) => `${v} ${k}`)
- .join(", ")
- : undefined
- }
+ {...(byTypeDescription ? { description: byTypeDescription } : {})}
icon={<Link2 className="h-4 w-4 text-orange-400" />}
/>
</div>
diff --git a/packages/ui/src/workspace/index.ts b/packages/ui/src/workspace/index.ts
new file mode 100644
index 000000000..e9703c10c
--- /dev/null
+++ b/packages/ui/src/workspace/index.ts
@@ -0,0 +1,7 @@
+export * from "./co-change-table.js";
+export * from "./contract-links-table.js";
+export * from "./contract-type-badge.js";
+export * from "./cross-repo-summary.js";
+export * from "./package-deps-table.js";
+export * from "./repo-card.js";
+export * from "./repo-card-compact.js";
diff --git a/packages/ui/src/workspace/package-deps-table.tsx b/packages/ui/src/workspace/package-deps-table.tsx
new file mode 100644
index 000000000..018bb35be
--- /dev/null
+++ b/packages/ui/src/workspace/package-deps-table.tsx
@@ -0,0 +1,53 @@
+import { Badge } from "../ui/badge";
+import type { WorkspacePackageDepEntry } from "@repowise-dev/types/workspace";
+
+interface PackageDepsTableProps {
+ deps: WorkspacePackageDepEntry[];
+}
+
+export function PackageDepsTable({ deps }: PackageDepsTableProps) {
+ if (deps.length === 0) {
+ return (
+ <p className="text-sm text-[var(--color-text-tertiary)] py-4 text-center">
+ No cross-repo package dependencies detected.
+ </p>
+ );
+ }
+
+ return (
+ <div className="overflow-x-auto">
+ <table className="w-full text-sm">
+ <thead>
+ <tr className="border-b border-[var(--color-border-default)] text-left text-xs text-[var(--color-text-tertiary)]">
+ <th className="pb-2 pr-4 font-medium">Source</th>
+ <th className="pb-2 pr-4 font-medium">Target</th>
+ <th className="pb-2 pr-4 font-medium">Manifest</th>
+ <th className="pb-2 font-medium">Kind</th>
+ </tr>
+ </thead>
+ <tbody className="divide-y divide-[var(--color-border-default)]">
+ {deps.map((d, i) => (
+ <tr
+ key={`${d.source_repo}|${d.target_repo}|${d.source_manifest}|${i}`}
+ className="hover:bg-[var(--color-bg-elevated)] transition-colors"
+ >
+ <td className="py-2 pr-4">
+ <Badge variant="default" className="text-[11px]">{d.source_repo}</Badge>
+ </td>
+ <td className="py-2 pr-4">
+ <Badge variant="default" className="text-[11px]">{d.target_repo}</Badge>
+ </td>
+ <td
+ className="py-2 pr-4 font-mono text-xs text-[var(--color-text-secondary)] truncate max-w-[280px]"
+ title={d.source_manifest}
+ >
+ {d.source_manifest}
+ </td>
+ <td className="py-2 text-xs text-[var(--color-text-secondary)]">{d.kind}</td>
+ </tr>
+ ))}
+ </tbody>
+ </table>
+ </div>
+ );
+}
diff --git a/packages/ui/src/workspace/repo-card-compact.tsx b/packages/ui/src/workspace/repo-card-compact.tsx
new file mode 100644
index 000000000..41953e52d
--- /dev/null
+++ b/packages/ui/src/workspace/repo-card-compact.tsx
@@ -0,0 +1,80 @@
+import { ChevronRight, Trash2 } from "lucide-react";
+import { Card, CardContent } from "../ui/card";
+import { Badge } from "../ui/badge";
+
+// Slim variant of RepoCard for callers that don't have RepoStats / GitSummary
+// per member yet (e.g. multi-repo workspace overviews where member detail
+// would require an N+1 fan-out). Renders display name, alias, status badge,
+// optional file count + visibility line, and an optional remove button.
+export interface RepoCardCompactProps {
+ displayName: string;
+ aliasLabel?: string | null;
+ status: string;
+ fileCount?: number | null;
+ isPublic?: boolean | null;
+ href?: string | null;
+ onRemove?: () => void;
+ removing?: boolean;
+}
+
+export function RepoCardCompact({
+ displayName,
+ aliasLabel,
+ status,
+ fileCount,
+ isPublic,
+ href,
+ onRemove,
+ removing,
+}: RepoCardCompactProps) {
+ const inner = (
+ <Card className="group transition-colors hover:border-[var(--color-accent-primary)]/30">
+ <CardContent className="p-4">
+ <div className="flex items-start justify-between gap-3">
+ <div className="min-w-0 flex-1">
+ <div className="flex items-center gap-2 flex-wrap">
+ <h3 className="text-sm font-semibold text-[var(--color-text-primary)] truncate">
+ {displayName}
+ </h3>
+ {aliasLabel && (
+ <span className="text-xs text-[var(--color-text-tertiary)] truncate">
+ {aliasLabel}
+ </span>
+ )}
+ <Badge variant="default" className="text-[10px]">{status}</Badge>
+ </div>
+ {(fileCount != null || isPublic != null) && (
+ <p className="mt-1 text-xs text-[var(--color-text-tertiary)] truncate">
+ {fileCount != null ? `${fileCount.toLocaleString()} files` : "—"}
+ {isPublic != null ? ` · ${isPublic ? "Public" : "Private"}` : ""}
+ </p>
+ )}
+ </div>
+ <div className="flex items-center gap-1 shrink-0">
+ {onRemove && (
+ <button
+ aria-label="Remove from workspace"
+ type="button"
+ onClick={(e) => {
+ e.preventDefault();
+ e.stopPropagation();
+ onRemove();
+ }}
+ disabled={removing}
+ className="p-1.5 rounded-md text-[var(--color-text-tertiary)] hover:text-red-400 hover:bg-red-500/10 transition disabled:opacity-50"
+ >
+ <Trash2 className="h-3.5 w-3.5" />
+ </button>
+ )}
+ {href && (
+ <ChevronRight className="h-4 w-4 text-[var(--color-text-tertiary)] group-hover:text-[var(--color-accent-primary)]" />
+ )}
+ </div>
+ </div>
+ </CardContent>
+ </Card>
+ );
+
+ if (href) return <a href={href}>{inner}</a>;
+ return inner;
+}
diff --git a/packages/web/src/components/workspace/repo-card.tsx b/packages/ui/src/workspace/repo-card.tsx
similarity index 81%
rename from packages/web/src/components/workspace/repo-card.tsx
rename to packages/ui/src/workspace/repo-card.tsx
index 8b1328b75..9c2bc0f5b 100644
--- a/packages/web/src/components/workspace/repo-card.tsx
+++ b/packages/ui/src/workspace/repo-card.tsx
@@ -1,8 +1,8 @@
-import Link from "next/link";
import { FileText, Flame, BarChart3, ChevronRight } from "lucide-react";
-import type { RepoStatsResponse, GitSummaryResponse } from "@/lib/api/types";
-import { Card, CardContent } from "@/components/ui/card";
-import { Badge } from "@/components/ui/badge";
+import { Card, CardContent } from "../ui/card";
+import { Badge } from "../ui/badge";
+import type { RepoStats } from "@repowise-dev/types/workspace";
+import type { GitSummary } from "@repowise-dev/types/git";
interface RepoCardProps {
repoId: string;
@@ -10,8 +10,8 @@ interface RepoCardProps {
name: string;
path: string;
isPrimary: boolean;
- stats: RepoStatsResponse | null;
- gitSummary: GitSummaryResponse | null;
+ stats: RepoStats | null;
+ gitSummary: GitSummary | null;
}
export function RepoCard({
@@ -38,7 +38,7 @@ export function RepoCard({
</Badge>
)}
</div>
- <p className="text-xs text-[var(--color-text-tertiary)] font-mono mt-0.5 truncate" title={`${alias} · ${path}`}>
+ <p className="text-xs text-[var(--color-text-tertiary)] font-mono mt-0.5 truncate" title={`${alias} · ${path}`}>
{alias} &middot; {path}
</p>
</div>
@@ -51,19 +51,19 @@ export function RepoCard({
<div className="flex items-center gap-1.5">
<FileText className="h-3.5 w-3.5 text-[var(--color-text-tertiary)]" />
<span className="text-xs text-[var(--color-text-secondary)]">
- {stats?.file_count ?? "—"} files
+ {stats?.file_count ?? "—"} files
</span>
</div>
<div className="flex items-center gap-1.5">
<BarChart3 className="h-3.5 w-3.5 text-[var(--color-text-tertiary)]" />
<span className="text-xs text-[var(--color-text-secondary)]">
- {stats ? `${Math.round(stats.doc_coverage_pct)}% docs` : "—"}
+ {stats ? `${Math.round(stats.doc_coverage_pct)}% docs` : "—"}
</span>
</div>
<div className="flex items-center gap-1.5">
<Flame className="h-3.5 w-3.5 text-[var(--color-text-tertiary)]" />
<span className="text-xs text-[var(--color-text-secondary)]">
- {gitSummary?.hotspot_count ?? "—"} hotspots
+ {gitSummary?.hotspot_count ?? "—"} hotspots
</span>
</div>
</div>
@@ -74,8 +74,8 @@ export function RepoCard({
if (!repoId) return card;
return (
- <Link href={`/repos/${repoId}/overview`}>
+ <a href={`/repos/${repoId}/overview`}>
{card}
- </Link>
+ </a>
);
}
diff --git a/packages/ui/styles/globals.css b/packages/ui/styles/globals.css
new file mode 100644
index 000000000..da949778f
--- /dev/null
+++ b/packages/ui/styles/globals.css
@@ -0,0 +1,326 @@
+@import "tailwindcss";
+@plugin "@tailwindcss/typography";
+
+/*
+ * @repowise-dev/ui — canonical design tokens.
+ *
+ * Imported by every consumer that wants the standard Repowise look.
+ * Tailwind v4 `@theme` block defines CSS custom properties; base styles,
+ * scrollbar, focus, prose overrides, and React Flow theming follow.
+ *
+ * The `@source` directive below tells Tailwind v4 to scan component
+ * source under `packages/ui/src/**` for utility classes — required so
+ * consumers that import this file pick up classes used by shared
+ * components without each consumer re-declaring the source path.
+ *
+ * Consumers can override individual tokens (accent, surface) by
+ * declaring a `@theme` block of their own after importing this file.
+ */
+
+@source "../src/**/*.{ts,tsx}";
+
+@theme {
+ /* ------------------------------------------------------------------ */
+ /* Core Surfaces */
+ /* ------------------------------------------------------------------ */
+ --color-bg-root: #0d0d0d;
+ --color-bg-surface: #141414;
+ --color-bg-elevated: #1c1c1c;
+ --color-bg-overlay: #202020;
+ --color-bg-inset: #0a0a0a;
+
+ /* ------------------------------------------------------------------ */
+ /* Borders */
+ /* ------------------------------------------------------------------ */
+ --color-border-default: rgba(255, 255, 255, 0.06);
+ --color-border-hover: rgba(255, 255, 255, 0.12);
+ --color-border-active: rgba(255, 255, 255, 0.20);
+
+ /* ------------------------------------------------------------------ */
+ /* Text */
+ /* ------------------------------------------------------------------ */
+ --color-text-primary: #ececec;
+ --color-text-secondary: #999999;
+ --color-text-tertiary: #5c5c5c;
+ --color-text-inverse: #0d0d0d;
+
+ /* ------------------------------------------------------------------ */
+ /* Accent — repowise Orange */
+ /* ------------------------------------------------------------------ */
+ --color-accent-primary: #f59520;
+ --color-accent-hover: #f7a94d;
+ --color-accent-muted: rgba(245, 149, 32, 0.15);
+
+ /* ------------------------------------------------------------------ */
+ /* Confidence System */
+ /* ------------------------------------------------------------------ */
+ --color-confidence-fresh: #22c55e;
+ --color-confidence-stale: #eab308;
+ --color-confidence-outdated: #ef4444;
+
+ /* ------------------------------------------------------------------ */
+ /* Semantic */
+ /* ------------------------------------------------------------------ */
+ --color-success: #22c55e;
+ --color-warning: #eab308;
+ --color-error: #ef4444;
+ --color-info: #f59520;
+
+ /* Aliases — short names used in component class strings. */
+ /* Keep these in sync with the canonical confidence/accent tokens. */
+ --color-fresh: var(--color-confidence-fresh);
+ --color-stale: var(--color-confidence-stale);
+ --color-outdated: var(--color-confidence-outdated);
+ --color-accent: var(--color-accent-primary);
+ --color-accent-blue: var(--color-accent-primary);
+ --color-border-accent: var(--color-accent-primary);
+
+ /* ------------------------------------------------------------------ */
+ /* Graph — React Flow */
+ /* ------------------------------------------------------------------ */
+ --color-accent-graph: #f59520;
+ --color-risk-low: #22c55e;
+ --color-risk-medium: #f59520;
+ --color-risk-high: #ef4444;
+ --color-node-documented: #22c55e;
+ --color-node-undocumented: #64748b;
+
+ /* ------------------------------------------------------------------ */
+ /* Language Colors (graph nodes) */
+ /* ------------------------------------------------------------------ */
+ --color-lang-python: #3776ab;
+ --color-lang-typescript: #3178c6;
+ --color-lang-go: #00add8;
+ --color-lang-rust: #dea584;
+ --color-lang-java: #ed8b00;
+ --color-lang-cpp: #00599c;
+ --color-lang-config: #6b7280;
+ --color-lang-other: #8b5cf6;
+
+ /* ------------------------------------------------------------------ */
+ /* Edge Colors (graph edges) */
+ /* ------------------------------------------------------------------ */
+ --color-edge-imports: #f59520;
+ --color-edge-calls: #22c55e;
+ --color-edge-inherits: #a855f7;
+ --color-edge-implements: #ec4899;
+ --color-edge-co-change: #8b5cf6;
+
+ /* ------------------------------------------------------------------ */
+ /* Typography */
+ /* ------------------------------------------------------------------ */
+ --font-sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
+ --font-mono: "Geist Mono", "JetBrains Mono", "Fira Code", monospace;
+
+ --text-xs: 0.8125rem;
+ --text-sm: 0.875rem;
+ --text-base: 0.9375rem;
+ --text-lg: 1.0625rem;
+ --text-xl: 1.375rem;
+ --text-2xl: 1.75rem;
+ --text-3xl: 2.25rem;
+
+ --leading-tight: 1.3;
+ --leading-normal: 1.5;
+ --leading-relaxed: 1.75;
+
+ /* ------------------------------------------------------------------ */
+ /* Spacing (4px base grid) */
+ /* ------------------------------------------------------------------ */
+ --spacing-1: 0.25rem;
+ --spacing-2: 0.5rem;
+ --spacing-3: 0.75rem;
+ --spacing-4: 1rem;
+ --spacing-5: 1.25rem;
+ --spacing-6: 1.5rem;
+ --spacing-8: 2rem;
+ --spacing-10: 2.5rem;
+ --spacing-12: 3rem;
+ --spacing-16: 4rem;
+
+ /* ------------------------------------------------------------------ */
+ /* Radii */
+ /* ------------------------------------------------------------------ */
+ --radius-sm: 6px;
+ --radius-md: 8px;
+ --radius-lg: 10px;
+ --radius-xl: 14px;
+
+ /* ------------------------------------------------------------------ */
+ /* Z-Index Scale */
+ /* ------------------------------------------------------------------ */
+ --z-base: 0;
+ --z-elevated: 10;
+ --z-dropdown: 20;
+ --z-sidebar: 30;
+ --z-modal: 40;
+ --z-command: 50;
+ --z-toast: 60;
+
+ /* ------------------------------------------------------------------ */
+ /* Layout */
+ /* ------------------------------------------------------------------ */
+ --sidebar-width: 260px;
+ --context-panel-width: 280px;
+ --content-max-width: 768px;
+
+ /* ------------------------------------------------------------------ */
+ /* Animation */
+ /* ------------------------------------------------------------------ */
+ --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
+ --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
+ --ease-inout: cubic-bezier(0.87, 0, 0.13, 1);
+ --duration-fast: 150ms;
+ --duration-normal: 250ms;
+ --duration-slow: 400ms;
+}
+
+/* -------------------------------------------------------------------- */
+/* Base Styles */
+/* -------------------------------------------------------------------- */
+
+html {
+ color-scheme: dark;
+}
+
+body {
+ background-color: var(--color-bg-root);
+ color: var(--color-text-primary);
+ font-family: var(--font-sans);
+ font-size: var(--text-base);
+ line-height: var(--leading-normal);
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+/* -------------------------------------------------------------------- */
+/* Scrollbar */
+/* -------------------------------------------------------------------- */
+
+::-webkit-scrollbar {
+ width: 6px;
+ height: 6px;
+}
+
+::-webkit-scrollbar-track {
+ background: transparent;
+}
+
+::-webkit-scrollbar-thumb {
+ background: rgba(255, 255, 255, 0.1);
+ border-radius: 3px;
+}
+
+::-webkit-scrollbar-thumb:hover {
+ background: rgba(255, 255, 255, 0.2);
+}
+
+/* -------------------------------------------------------------------- */
+/* Focus Ring */
+/* -------------------------------------------------------------------- */
+
+:focus-visible {
+ outline: 2px solid var(--color-accent-primary);
+ outline-offset: 2px;
+}
+
+/* -------------------------------------------------------------------- */
+/* Selection */
+/* -------------------------------------------------------------------- */
+
+::selection {
+ background-color: var(--color-accent-muted);
+ color: var(--color-text-primary);
+}
+
+/* -------------------------------------------------------------------- */
+/* Reduced Motion */
+/* -------------------------------------------------------------------- */
+
+@media (prefers-reduced-motion: reduce) {
+ *,
+ *::before,
+ *::after {
+ animation-duration: 0.01ms !important;
+ animation-iteration-count: 1 !important;
+ transition-duration: 0.01ms !important;
+ scroll-behavior: auto !important;
+ }
+}
+
+/* -------------------------------------------------------------------- */
+/* Typography: prose overrides for wiki content */
+/* -------------------------------------------------------------------- */
+
+.prose {
+ --tw-prose-body: var(--color-text-secondary);
+ --tw-prose-headings: var(--color-text-primary);
+ --tw-prose-links: var(--color-accent-primary);
+ --tw-prose-code: var(--color-text-primary);
+ --tw-prose-pre-bg: var(--color-bg-inset);
+ --tw-prose-pre-code: var(--color-text-primary);
+ --tw-prose-bold: var(--color-text-primary);
+ --tw-prose-counters: var(--color-text-tertiary);
+ --tw-prose-bullets: var(--color-text-tertiary);
+ --tw-prose-hr: var(--color-border-default);
+ --tw-prose-quotes: var(--color-text-secondary);
+ --tw-prose-quote-borders: var(--color-border-default);
+ --tw-prose-th-borders: var(--color-border-default);
+ --tw-prose-td-borders: var(--color-border-default);
+}
+
+.prose code {
+ font-family: var(--font-mono);
+ font-size: 0.85em;
+}
+
+.prose pre {
+ border: 1px solid var(--color-border-default);
+ border-radius: var(--radius-lg);
+}
+
+.prose a {
+ text-decoration: none;
+ border-bottom: 1px solid transparent;
+ transition: border-color var(--duration-fast) var(--ease-out);
+}
+
+.prose a:hover {
+ border-bottom-color: var(--color-accent-primary);
+}
+
+/* -------------------------------------------------------------------- */
+/* Tabular numbers for data tables */
+/* -------------------------------------------------------------------- */
+
+.tabular-nums {
+ font-variant-numeric: tabular-nums;
+}
+
+/* -------------------------------------------------------------------- */
+/* React Flow Dark Theme */
+/* -------------------------------------------------------------------- */
+
+.react-flow {
+ --xy-background-color: transparent;
+ --xy-minimap-background-color: var(--color-bg-surface);
+ --xy-minimap-mask-background: rgba(0, 0, 0, 0.6);
+ --xy-minimap-mask-stroke: none;
+ --xy-controls-button-background-color: var(--color-bg-elevated);
+ --xy-controls-button-background-color-hover: var(--color-bg-overlay);
+ --xy-controls-button-border-color: var(--color-border-default);
+ --xy-controls-button-color: var(--color-text-secondary);
+ --xy-controls-button-color-hover: var(--color-text-primary);
+ --xy-edge-stroke: rgba(245, 149, 32, 0.3);
+ --xy-edge-stroke-selected: var(--color-accent-graph);
+ --xy-node-border-radius: var(--radius-lg);
+}
+
+@keyframes graph-path-pulse {
+ 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 149, 32, 0.4); }
+ 50% { box-shadow: 0 0 12px 4px rgba(245, 149, 32, 0.2); }
+}
+
+@keyframes graph-marching-ants {
+ to { stroke-dashoffset: -20; }
+}
diff --git a/packages/ui/tsconfig.json b/packages/ui/tsconfig.json
new file mode 100644
index 000000000..f0062e5d8
--- /dev/null
+++ b/packages/ui/tsconfig.json
@@ -0,0 +1,24 @@
+{
+ "compilerOptions": {
+ "target": "ES2022",
+ "module": "ESNext",
+ "moduleResolution": "Bundler",
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
+ "jsx": "react-jsx",
+ "strict": true,
+ "noUncheckedIndexedAccess": true,
+ "exactOptionalPropertyTypes": true,
+ "noImplicitOverride": true,
+ "isolatedModules": true,
+ "esModuleInterop": true,
+ "skipLibCheck": true,
+ "declaration": true,
+ "declarationMap": true,
+ "noEmit": true,
+ "paths": {
+ "@repowise-dev/types": ["../types/src/index.ts"],
+ "@repowise-dev/types/*": ["../types/src/*"]
+ }
+ },
+ "include": ["src/**/*.ts", "src/**/*.tsx", "__tests__/**/*.ts", "__tests__/**/*.tsx"]
+}
diff --git a/packages/ui/vitest.config.ts b/packages/ui/vitest.config.ts
new file mode 100644
index 000000000..8c9b205d4
--- /dev/null
+++ b/packages/ui/vitest.config.ts
@@ -0,0 +1,26 @@
+import { defineConfig } from "vitest/config";
+import react from "@vitejs/plugin-react";
+import path from "node:path";
+
+export default defineConfig({
+ plugins: [react()],
+ test: {
+ environment: "jsdom",
+ globals: true,
+ setupFiles: ["./__tests__/setup.ts"],
+ include: ["__tests__/**/*.{test,spec}.{ts,tsx}", "src/**/*.{test,spec}.{ts,tsx}"],
+ exclude: ["node_modules", "dist"],
+ },
+ resolve: {
+ alias: {
+ "@repowise-dev/types": path.resolve(__dirname, "../types/src/index.ts"),
+ "@repowise-dev/types/graph": path.resolve(__dirname, "../types/src/graph.ts"),
+ "@repowise-dev/types/git": path.resolve(__dirname, "../types/src/git.ts"),
+ "@repowise-dev/types/docs": path.resolve(__dirname, "../types/src/docs.ts"),
+ "@repowise-dev/types/decisions": path.resolve(__dirname, "../types/src/decisions.ts"),
+ "@repowise-dev/types/dead-code": path.resolve(__dirname, "../types/src/dead-code.ts"),
+ "@repowise-dev/types/symbols": path.resolve(__dirname, "../types/src/symbols.ts"),
+ "@repowise-dev/types/chat": path.resolve(__dirname, "../types/src/chat.ts"),
+ },
+ },
+});
diff --git a/packages/web/next.config.ts b/packages/web/next.config.ts
index 9e20241aa..e40d3305c 100644
--- a/packages/web/next.config.ts
+++ b/packages/web/next.config.ts
@@ -2,6 +2,7 @@ import type { NextConfig } from "next";
const nextConfig: NextConfig = {
output: "standalone",
+ transpilePackages: ["@repowise-dev/ui", "@repowise-dev/types"],
experimental: {
optimizePackageImports: ["lucide-react", "recharts", "d3"],
},
diff --git a/packages/web/package.json b/packages/web/package.json
index 55f6149a7..d32ae53fb 100644
--- a/packages/web/package.json
+++ b/packages/web/package.json
@@ -11,6 +11,8 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
+ "@repowise-dev/types": "*",
+ "@repowise-dev/ui": "*",
"@radix-ui/react-accordion": "^1.2.0",
"@radix-ui/react-dialog": "^1.1.0",
"@radix-ui/react-dropdown-menu": "^2.1.0",
diff --git a/packages/web/src/app/error.tsx b/packages/web/src/app/error.tsx
index 7b292148c..db26f9315 100644
--- a/packages/web/src/app/error.tsx
+++ b/packages/web/src/app/error.tsx
@@ -2,7 +2,7 @@
import { useEffect } from "react";
import { AlertTriangle, RefreshCw } from "lucide-react";
-import { Button } from "@/components/ui/button";
+import { Button } from "@repowise-dev/ui/ui/button";
export default function GlobalError({
error,
diff --git a/packages/web/src/app/layout.tsx b/packages/web/src/app/layout.tsx
index 73ce2b35e..57ee1f0ed 100644
--- a/packages/web/src/app/layout.tsx
+++ b/packages/web/src/app/layout.tsx
@@ -3,7 +3,7 @@ import { GeistSans } from "geist/font/sans";
import { GeistMono } from "geist/font/mono";
import { NuqsAdapter } from "nuqs/adapters/next/app";
import { Toaster } from "sonner";
-import { TooltipProvider } from "@/components/ui/tooltip";
+import { TooltipProvider } from "@repowise-dev/ui/ui/tooltip";
import { Sidebar } from "@/components/layout/sidebar";
import { MobileNav } from "@/components/layout/mobile-nav";
import { CommandPalette } from "@/components/search/command-palette";
@@ -15,7 +15,7 @@ import "@/styles/globals.css";
export const metadata: Metadata = {
title: {
default: "repowise",
- template: "%s — repowise",
+ template: "%s — repowise",
},
description: "Open-source codebase documentation engine",
};
@@ -37,7 +37,7 @@ export default async function RootLayout({
if (reposResult.status === "fulfilled") repos = reposResult.value;
if (wsResult.status === "fulfilled") workspace = wsResult.value;
} catch {
- // API not available — show empty sidebar
+ // API not available — show empty sidebar
}
return (
diff --git a/packages/web/src/app/loading.tsx b/packages/web/src/app/loading.tsx
index 49762a2bc..4376d01c9 100644
--- a/packages/web/src/app/loading.tsx
+++ b/packages/web/src/app/loading.tsx
@@ -1,4 +1,4 @@
-import { Skeleton } from "@/components/ui/skeleton";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
export default function DashboardLoading() {
return (
diff --git a/packages/web/src/app/page.tsx b/packages/web/src/app/page.tsx
index b4942729a..f8071191f 100644
--- a/packages/web/src/app/page.tsx
+++ b/packages/web/src/app/page.tsx
@@ -15,13 +15,13 @@ import { listJobs } from "@/lib/api/jobs";
import { getGitSummary } from "@/lib/api/git";
import { getWorkspace } from "@/lib/api/workspace";
import type { RepoStatsResponse, GitSummaryResponse } from "@/lib/api/types";
-import { StatCard } from "@/components/shared/stat-card";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
-import { Badge } from "@/components/ui/badge";
-import { ConfidenceBadge } from "@/components/wiki/confidence-badge";
-import { EmptyState } from "@/components/shared/empty-state";
-import { formatRelativeTime, formatNumber } from "@/lib/utils/format";
-import { scoreToStatus } from "@/lib/utils/confidence";
+import { StatCard } from "@repowise-dev/ui/shared/stat-card";
+import { Card, CardContent, CardHeader, CardTitle } from "@repowise-dev/ui/ui/card";
+import { Badge } from "@repowise-dev/ui/ui/badge";
+import { ConfidenceBadge } from "@repowise-dev/ui/wiki/confidence-badge";
+import { EmptyState } from "@repowise-dev/ui/shared/empty-state";
+import { formatRelativeTime, formatNumber } from "@repowise-dev/ui/lib/format";
+import { scoreToStatus } from "@repowise-dev/ui/lib/confidence";
export const metadata: Metadata = { title: "Dashboard" };
@@ -38,12 +38,12 @@ export default async function DashboardPage() {
const jobList = jobs.status === "fulfilled" ? jobs.value : [];
const workspace = ws.status === "fulfilled" ? ws.value : null;
- // Workspace mode → workspace dashboard
+ // Workspace mode → workspace dashboard
if (workspace?.is_workspace) {
redirect("/workspace");
}
- // Single repo → go straight to its overview
+ // Single repo → go straight to its overview
if (repoList.length === 1) {
redirect(`/repos/${repoList[0].id}/overview`);
}
@@ -97,7 +97,7 @@ export default async function DashboardPage() {
<StatCard
label="Fresh Pages"
value={formatNumber(freshPages)}
- description="Confidence ≥ 80%"
+ description="Confidence ≥ 80%"
icon={<CheckCircle2 className="h-4 w-4 text-green-500" />}
/>
<StatCard
@@ -108,7 +108,7 @@ export default async function DashboardPage() {
/>
<StatCard
label="Dead Code"
- value={deadCode > 0 ? formatNumber(deadCode) : "—"}
+ value={deadCode > 0 ? formatNumber(deadCode) : "—"}
description={deadCode > 0 ? "Unused exports" : "Analyze to detect"}
icon={<Skull className="h-4 w-4 text-[var(--color-text-tertiary)]" />}
/>
@@ -230,7 +230,7 @@ export default async function DashboardPage() {
</Badge>
</div>
<p className="text-xs text-[var(--color-text-tertiary)] mt-0.5">
- {job.model_name} · {formatRelativeTime(job.updated_at)}
+ {job.model_name} · {formatRelativeTime(job.updated_at)}
</p>
</div>
</Link>
diff --git a/packages/web/src/app/repos/[id]/blast-radius/page.tsx b/packages/web/src/app/repos/[id]/blast-radius/page.tsx
index c0747daff..fcd294a23 100644
--- a/packages/web/src/app/repos/[id]/blast-radius/page.tsx
+++ b/packages/web/src/app/repos/[id]/blast-radius/page.tsx
@@ -4,235 +4,14 @@ import { useState } from "react";
import useSWR from "swr";
import { useParams } from "next/navigation";
import { Radar, Plus, Flame } from "lucide-react";
-import { Button } from "@/components/ui/button";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
-import { Skeleton } from "@/components/ui/skeleton";
-import { cn } from "@/lib/utils/cn";
-import {
- analyzeBlastRadius,
- type BlastRadiusResponse,
- type DirectRiskEntry,
- type TransitiveEntry,
- type CochangeWarning,
- type ReviewerEntry,
-} from "@/lib/api/blast-radius";
+import { Button } from "@repowise-dev/ui/ui/button";
+import { Card, CardHeader, CardTitle, CardContent } from "@repowise-dev/ui/ui/card";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
+import { BlastRadiusResults } from "@repowise-dev/ui/blast-radius";
+import type { BlastRadiusResponse } from "@repowise-dev/types/blast-radius";
+import { analyzeBlastRadius } from "@/lib/api/blast-radius";
import { getHotspots } from "@/lib/api/git";
-// ---------------------------------------------------------------------------
-// Risk score gauge card
-// ---------------------------------------------------------------------------
-
-function RiskScoreCard({ score }: { score: number }) {
- const color =
- score >= 7
- ? "text-red-500 border-red-500/30 bg-red-500/5"
- : score >= 4
- ? "text-amber-500 border-amber-500/30 bg-amber-500/5"
- : "text-emerald-500 border-emerald-500/30 bg-emerald-500/5";
- const label = score >= 7 ? "High Risk" : score >= 4 ? "Medium Risk" : "Low Risk";
-
- return (
- <Card className={cn("border", color)}>
- <CardContent className="flex flex-col items-center justify-center py-8 gap-2">
- <span className={cn("text-6xl font-bold tabular-nums", color.split(" ")[0])}>
- {score.toFixed(1)}
- </span>
- <span className={cn("text-sm font-medium", color.split(" ")[0])}>{label}</span>
- <span className="text-xs text-[var(--color-text-tertiary)]">Overall Risk Score (0–10)</span>
- </CardContent>
- </Card>
- );
-}
-
-// ---------------------------------------------------------------------------
-// Simple table helpers
-// ---------------------------------------------------------------------------
-
-function TableSection({
- title,
- children,
- empty,
-}: {
- title: string;
- children: React.ReactNode;
- empty: boolean;
-}) {
- return (
- <Card>
- <CardHeader className="pb-3">
- <CardTitle className="text-sm">{title}</CardTitle>
- </CardHeader>
- <CardContent className="pt-0">
- {empty ? (
- <p className="text-xs text-[var(--color-text-tertiary)] py-2">None</p>
- ) : (
- children
- )}
- </CardContent>
- </Card>
- );
-}
-
-function Th({ children }: { children: React.ReactNode }) {
- return (
- <th className="text-left text-xs font-medium text-[var(--color-text-tertiary)] py-1.5 pr-4 whitespace-nowrap">
- {children}
- </th>
- );
-}
-
-function Td({ children, className }: { children: React.ReactNode; className?: string }) {
- return (
- <td
- className={cn(
- "text-xs text-[var(--color-text-secondary)] py-1.5 pr-4 align-top",
- className,
- )}
- >
- {children}
- </td>
- );
-}
-
-// ---------------------------------------------------------------------------
-// Result tables
-// ---------------------------------------------------------------------------
-
-function DirectRisksTable({ rows }: { rows: DirectRiskEntry[] }) {
- // Risk scores from the API are 0–1; render as 0–10 to match the gauge.
- const fmt10 = (v: number) => (v * 10).toFixed(2);
- // Centrality is small; render as percentage with 2 decimals.
- const fmtPct = (v: number) => `${(v * 100).toFixed(2)}%`;
- return (
- <div className="overflow-x-auto">
- <table className="w-full">
- <caption className="sr-only">Direct risks for the changed files</caption>
- <thead>
- <tr>
- <Th>File</Th>
- <Th>Risk Score</Th>
- <Th>Temporal Hotspot</Th>
- <Th>Centrality</Th>
- </tr>
- </thead>
- <tbody>
- {rows.map((r) => (
- <tr key={r.path} className="border-t border-[var(--color-border-default)]">
- <Td>
- <span className="font-mono break-all" title={r.path}>{r.path}</span>
- </Td>
- <Td className="text-right tabular-nums">{fmt10(r.risk_score)}</Td>
- <Td className="text-right tabular-nums">{fmt10(r.temporal_hotspot)}</Td>
- <Td className="text-right tabular-nums">{fmtPct(r.centrality)}</Td>
- </tr>
- ))}
- </tbody>
- </table>
- </div>
- );
-}
-
-function TransitiveTable({ rows }: { rows: TransitiveEntry[] }) {
- return (
- <div className="overflow-x-auto">
- <table className="w-full">
- <caption className="sr-only">Transitively affected files</caption>
- <thead>
- <tr>
- <Th>File</Th>
- <Th>Depth</Th>
- </tr>
- </thead>
- <tbody>
- {rows.map((r) => (
- <tr key={r.path} className="border-t border-[var(--color-border-default)]">
- <Td>
- <span className="font-mono break-all" title={r.path}>{r.path}</span>
- </Td>
- <Td className="text-right tabular-nums">{r.depth}</Td>
- </tr>
- ))}
- </tbody>
- </table>
- </div>
- );
-}
-
-function CochangeTable({ rows }: { rows: CochangeWarning[] }) {
- return (
- <div className="overflow-x-auto">
- <table className="w-full">
- <caption className="sr-only">Co-change warnings</caption>
- <thead>
- <tr>
- <Th>Changed File</Th>
- <Th>Missing Partner</Th>
- <Th>Co-change Count</Th>
- </tr>
- </thead>
- <tbody>
- {rows.map((r, i) => (
- <tr
- key={`${r.changed}|${r.missing_partner}|${i}`}
- className="border-t border-[var(--color-border-default)]"
- >
- <Td>
- <span className="font-mono break-all" title={r.changed}>{r.changed}</span>
- </Td>
- <Td>
- <span className="font-mono break-all" title={r.missing_partner}>{r.missing_partner}</span>
- </Td>
- <Td className="text-right tabular-nums">{r.score}</Td>
- </tr>
- ))}
- </tbody>
- </table>
- </div>
- );
-}
-
-function ReviewersTable({ rows }: { rows: ReviewerEntry[] }) {
- return (
- <div className="overflow-x-auto">
- <table className="w-full">
- <caption className="sr-only">Recommended reviewers</caption>
- <thead>
- <tr>
- <Th>Email</Th>
- <Th>Files Owned</Th>
- <Th>Avg Ownership %</Th>
- </tr>
- </thead>
- <tbody>
- {rows.map((r) => (
- <tr key={r.email} className="border-t border-[var(--color-border-default)]">
- <Td>{r.email}</Td>
- <Td className="text-right tabular-nums">{r.files}</Td>
- <Td className="text-right tabular-nums">{(r.ownership_pct * 100).toFixed(1)}%</Td>
- </tr>
- ))}
- </tbody>
- </table>
- </div>
- );
-}
-
-function TestGapsList({ gaps }: { gaps: string[] }) {
- return (
- <ul className="space-y-1">
- {gaps.map((g) => (
- <li key={g} className="text-xs font-mono text-[var(--color-text-secondary)] break-all">
- {g}
- </li>
- ))}
- </ul>
- );
-}
-
-// ---------------------------------------------------------------------------
-// Page
-// ---------------------------------------------------------------------------
-
export default function BlastRadiusPage() {
const params = useParams<{ id: string }>();
const repoId = params.id;
@@ -387,70 +166,11 @@ export default function BlastRadiusPage() {
</Button>
)}
</div>
- {error && (
- <p className="text-xs text-red-500">{error}</p>
- )}
+ {error && <p className="text-xs text-red-500">{error}</p>}
</CardContent>
</Card>
- {/* Results */}
- {result && (
- <div className="space-y-4">
- {/* Risk gauge + stats row */}
- <div className="grid grid-cols-1 gap-4 sm:grid-cols-4">
- <RiskScoreCard score={result.overall_risk_score} />
- <Card className="sm:col-span-3">
- <CardHeader className="pb-3">
- <CardTitle className="text-sm">Summary</CardTitle>
- </CardHeader>
- <CardContent className="pt-0 grid grid-cols-2 sm:grid-cols-4 gap-4">
- {[
- { label: "Direct Risks", value: result.direct_risks.length },
- { label: "Transitive Files", value: result.transitive_affected.length },
- { label: "Co-change Warnings", value: result.cochange_warnings.length },
- { label: "Test Gaps", value: result.test_gaps.length },
- ].map(({ label, value }) => (
- <div key={label} className="space-y-1">
- <p className="text-2xl font-bold text-[var(--color-text-primary)] tabular-nums">
- {value}
- </p>
- <p className="text-xs text-[var(--color-text-tertiary)]">{label}</p>
- </div>
- ))}
- </CardContent>
- </Card>
- </div>
-
- <TableSection title="Direct Risks" empty={result.direct_risks.length === 0}>
- <DirectRisksTable rows={result.direct_risks} />
- </TableSection>
-
- <TableSection
- title="Transitive Affected Files"
- empty={result.transitive_affected.length === 0}
- >
- <TransitiveTable rows={result.transitive_affected} />
- </TableSection>
-
- <TableSection
- title="Co-change Warnings"
- empty={result.cochange_warnings.length === 0}
- >
- <CochangeTable rows={result.cochange_warnings} />
- </TableSection>
-
- <TableSection
- title="Recommended Reviewers"
- empty={result.recommended_reviewers.length === 0}
- >
- <ReviewersTable rows={result.recommended_reviewers} />
- </TableSection>
-
- <TableSection title="Test Gaps" empty={result.test_gaps.length === 0}>
- <TestGapsList gaps={result.test_gaps} />
- </TableSection>
- </div>
- )}
+ {result && <BlastRadiusResults result={result} />}
</div>
);
}
diff --git a/packages/web/src/app/repos/[id]/costs/page.tsx b/packages/web/src/app/repos/[id]/costs/page.tsx
index 9e3739f24..53673c22c 100644
--- a/packages/web/src/app/repos/[id]/costs/page.tsx
+++ b/packages/web/src/app/repos/[id]/costs/page.tsx
@@ -12,12 +12,12 @@ import {
Tooltip,
ResponsiveContainer,
} from "recharts";
-import { StatCard } from "@/components/shared/stat-card";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
-import { Skeleton } from "@/components/ui/skeleton";
+import { StatCard } from "@repowise-dev/ui/shared/stat-card";
+import { Card, CardContent, CardHeader, CardTitle } from "@repowise-dev/ui/ui/card";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
import { listCosts, getCostSummary } from "@/lib/api/costs";
import type { CostGroup, CostSummary } from "@/lib/api/costs";
-import { formatCost, formatNumber, formatTokens } from "@/lib/utils/format";
+import { formatCost, formatNumber, formatTokens } from "@repowise-dev/ui/lib/format";
type GroupBy = "day" | "model" | "operation";
@@ -108,7 +108,7 @@ export default function CostsPage() {
))}
</div>
- {/* Chart — only when grouping by day */}
+ {/* Chart — only when grouping by day */}
{by === "day" && (
<Card>
<CardHeader className="pb-2">
@@ -131,7 +131,7 @@ export default function CostsPage() {
interval="preserveStartEnd"
minTickGap={24}
tickFormatter={(v: string) => {
- // ISO date "YYYY-MM-DD" → "M/D"
+ // ISO date "YYYY-MM-DD" → "M/D"
const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(v);
return m ? `${Number(m[2])}/${Number(m[3])}` : v;
}}
diff --git a/packages/web/src/app/repos/[id]/coverage/loading.tsx b/packages/web/src/app/repos/[id]/coverage/loading.tsx
index 0c30880e3..ca45f6c5e 100644
--- a/packages/web/src/app/repos/[id]/coverage/loading.tsx
+++ b/packages/web/src/app/repos/[id]/coverage/loading.tsx
@@ -1,4 +1,4 @@
-import { Skeleton } from "@/components/ui/skeleton";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
export default function CoverageLoading() {
return (
diff --git a/packages/web/src/app/repos/[id]/coverage/page.tsx b/packages/web/src/app/repos/[id]/coverage/page.tsx
index d47c1c432..7422e3d84 100644
--- a/packages/web/src/app/repos/[id]/coverage/page.tsx
+++ b/packages/web/src/app/repos/[id]/coverage/page.tsx
@@ -1,10 +1,10 @@
import type { Metadata } from "next";
import { FileCheck } from "lucide-react";
-import { CoverageDonut } from "@/components/coverage/coverage-donut";
-import { FreshnessTable } from "@/components/coverage/freshness-table";
-import { StatCard } from "@/components/shared/stat-card";
+import { CoverageDonut } from "@repowise-dev/ui/coverage/coverage-donut";
+import { FreshnessTableWithRegenerate } from "@/components/coverage/freshness-table-wrapper";
+import { StatCard } from "@repowise-dev/ui/shared/stat-card";
import { listPages } from "@/lib/api/pages";
-import { formatNumber } from "@/lib/utils/format";
+import { formatNumber } from "@repowise-dev/ui/lib/format";
export const metadata: Metadata = { title: "Coverage" };
@@ -94,7 +94,7 @@ export default async function CoveragePage({
</div>
)}
- <FreshnessTable pages={pages} />
+ <FreshnessTableWithRegenerate pages={pages} />
</div>
);
}
diff --git a/packages/web/src/app/repos/[id]/dead-code/loading.tsx b/packages/web/src/app/repos/[id]/dead-code/loading.tsx
index e399932d6..fef87a65f 100644
--- a/packages/web/src/app/repos/[id]/dead-code/loading.tsx
+++ b/packages/web/src/app/repos/[id]/dead-code/loading.tsx
@@ -1,4 +1,4 @@
-import { Skeleton } from "@/components/ui/skeleton";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
export default function DeadCodeLoading() {
return (
diff --git a/packages/web/src/app/repos/[id]/dead-code/page.tsx b/packages/web/src/app/repos/[id]/dead-code/page.tsx
index e4b4716b2..c936b3914 100644
--- a/packages/web/src/app/repos/[id]/dead-code/page.tsx
+++ b/packages/web/src/app/repos/[id]/dead-code/page.tsx
@@ -5,10 +5,10 @@ import useSWR from "swr";
import { useParams } from "next/navigation";
import { Trash2 } from "lucide-react";
import { toast } from "sonner";
-import { Button } from "@/components/ui/button";
-import { SummaryBar } from "@/components/dead-code/summary-bar";
+import { Button } from "@repowise-dev/ui/ui/button";
+import { SummaryBar } from "@repowise-dev/ui/dead-code/summary-bar";
import { FindingsTable } from "@/components/dead-code/findings-table";
-import { Skeleton } from "@/components/ui/skeleton";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
import { getDeadCodeSummary, analyzeDeadCode } from "@/lib/api/dead-code";
import type { DeadCodeSummaryResponse } from "@/lib/api/types";
@@ -27,7 +27,7 @@ export default function DeadCodePage() {
setAnalyzing(true);
try {
await analyzeDeadCode(id);
- toast.success("Analysis started — results will appear shortly.");
+ toast.success("Analysis started — results will appear shortly.");
} catch (err) {
toast.error(
err instanceof Error ? `Couldn't start analysis: ${err.message}` : "Couldn't start analysis",
@@ -56,7 +56,7 @@ export default function DeadCodePage() {
onClick={handleAnalyze}
disabled={analyzing}
>
- {analyzing ? "Starting…" : "Analyze"}
+ {analyzing ? "Starting…" : "Analyze"}
</Button>
</div>
</div>
diff --git a/packages/web/src/app/repos/[id]/decisions/page.tsx b/packages/web/src/app/repos/[id]/decisions/page.tsx
index 5c2887a37..6a0aba3e2 100644
--- a/packages/web/src/app/repos/[id]/decisions/page.tsx
+++ b/packages/web/src/app/repos/[id]/decisions/page.tsx
@@ -1,7 +1,7 @@
import { notFound } from "next/navigation";
import { listDecisions } from "@/lib/api/decisions";
import { ApiClientError } from "@/lib/api/client";
-import { DecisionsTable } from "@/components/decisions/decisions-table";
+import { DecisionsTableWrapper } from "@/components/decisions/decisions-table-wrapper";
export const revalidate = 30;
@@ -33,7 +33,7 @@ export default async function DecisionsPage({ params }: Props) {
Why the codebase is built the way it is — constraints, tradeoffs, and rejected alternatives.
</p>
</div>
- <DecisionsTable repoId={repoId} initialData={decisions} />
+ <DecisionsTableWrapper repoId={repoId} initialData={decisions} />
</div>
);
}
diff --git a/packages/web/src/app/repos/[id]/docs/page.tsx b/packages/web/src/app/repos/[id]/docs/page.tsx
index b075bc0cc..ba5cccf87 100644
--- a/packages/web/src/app/repos/[id]/docs/page.tsx
+++ b/packages/web/src/app/repos/[id]/docs/page.tsx
@@ -2,7 +2,7 @@
import { use, useState } from "react";
import { Download, FolderArchive, Loader2 } from "lucide-react";
-import { Button } from "@/components/ui/button";
+import { Button } from "@repowise-dev/ui/ui/button";
import { DocsExplorer } from "@/components/docs/docs-explorer";
import { listAllPages } from "@/lib/api/pages";
import { downloadTextFile } from "@/lib/utils/download";
diff --git a/packages/web/src/app/repos/[id]/error.tsx b/packages/web/src/app/repos/[id]/error.tsx
index 28ec2be58..5e623310f 100644
--- a/packages/web/src/app/repos/[id]/error.tsx
+++ b/packages/web/src/app/repos/[id]/error.tsx
@@ -3,7 +3,7 @@
import { useEffect } from "react";
import Link from "next/link";
import { AlertTriangle, RefreshCw, ArrowLeft } from "lucide-react";
-import { Button } from "@/components/ui/button";
+import { Button } from "@repowise-dev/ui/ui/button";
export default function RepoError({
error,
diff --git a/packages/web/src/app/repos/[id]/graph/loading.tsx b/packages/web/src/app/repos/[id]/graph/loading.tsx
index e0ffd4dc0..be28d9404 100644
--- a/packages/web/src/app/repos/[id]/graph/loading.tsx
+++ b/packages/web/src/app/repos/[id]/graph/loading.tsx
@@ -1,4 +1,4 @@
-import { Skeleton } from "@/components/ui/skeleton";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
export default function GraphLoading() {
return (
diff --git a/packages/web/src/app/repos/[id]/hotspots/loading.tsx b/packages/web/src/app/repos/[id]/hotspots/loading.tsx
index 4d15ce5e9..865471bd7 100644
--- a/packages/web/src/app/repos/[id]/hotspots/loading.tsx
+++ b/packages/web/src/app/repos/[id]/hotspots/loading.tsx
@@ -1,4 +1,4 @@
-import { Skeleton } from "@/components/ui/skeleton";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
export default function HotspotsLoading() {
return (
diff --git a/packages/web/src/app/repos/[id]/hotspots/page.tsx b/packages/web/src/app/repos/[id]/hotspots/page.tsx
index 738634212..546f43170 100644
--- a/packages/web/src/app/repos/[id]/hotspots/page.tsx
+++ b/packages/web/src/app/repos/[id]/hotspots/page.tsx
@@ -1,14 +1,14 @@
import type { Metadata } from "next";
import { Flame, Shield } from "lucide-react";
-import { StatCard } from "@/components/shared/stat-card";
-import { HotspotTable } from "@/components/git/hotspot-table";
-import { ContributorBar } from "@/components/git/contributor-bar";
-import { ChurnHistogram } from "@/components/git/churn-histogram";
-import { CommitCategoryDonut } from "@/components/git/commit-category-donut";
-import { RiskDistributionChart } from "@/components/git/risk-distribution-chart";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
+import { StatCard } from "@repowise-dev/ui/shared/stat-card";
+import { HotspotTable } from "@repowise-dev/ui/git/hotspot-table";
+import { ContributorBar } from "@repowise-dev/ui/git/contributor-bar";
+import { ChurnHistogram } from "@repowise-dev/ui/git/churn-histogram";
+import { CommitCategoryDonut } from "@repowise-dev/ui/git/commit-category-donut";
+import { RiskDistributionChart } from "@repowise-dev/ui/git/risk-distribution-chart";
+import { Card, CardContent, CardHeader, CardTitle } from "@repowise-dev/ui/ui/card";
import { getHotspots, getGitSummary } from "@/lib/api/git";
-import { formatNumber } from "@/lib/utils/format";
+import { formatNumber } from "@repowise-dev/ui/lib/format";
export const metadata: Metadata = { title: "Hotspots" };
@@ -51,13 +51,13 @@ export default async function HotspotsPage({
Hotspots
</h1>
<p className="text-sm text-[var(--color-text-secondary)]">
- High-churn files — where the most risky code lives.
+ High-churn files — where the most risky code lives.
</p>
</div>
{loadError && hotspots.length === 0 && (
<div className="rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] p-4 text-sm text-[var(--color-text-secondary)]">
- Couldn&apos;t load hotspots. The data may not be ready yet — try running a sync first.
+ Couldn&apos;t load hotspots. The data may not be ready yet — try running a sync first.
</div>
)}
@@ -87,7 +87,7 @@ export default async function HotspotsPage({
<StatCard
label="Bus Factor Risk"
value={formatNumber(busFactorRiskCount)}
- description="files with factor ≤ 1"
+ description="files with factor ≤ 1"
icon={<Shield className="h-4 w-4 text-red-400" />}
/>
</div>
diff --git a/packages/web/src/app/repos/[id]/layout.tsx b/packages/web/src/app/repos/[id]/layout.tsx
index e158b882b..8cd73800a 100644
--- a/packages/web/src/app/repos/[id]/layout.tsx
+++ b/packages/web/src/app/repos/[id]/layout.tsx
@@ -1,6 +1,6 @@
import { redirect } from "next/navigation";
import { getRepo } from "@/lib/api/repos";
-import { ActiveJobBanner } from "@/components/dashboard/active-job-banner";
+import { ActiveJobBannerWrapper as ActiveJobBanner } from "@/components/dashboard/active-job-banner-wrapper";
import { PageTransition } from "@/components/layout/page-transition";
interface RepoLayoutProps {
diff --git a/packages/web/src/app/repos/[id]/loading.tsx b/packages/web/src/app/repos/[id]/loading.tsx
index 59147d870..2606f8a7e 100644
--- a/packages/web/src/app/repos/[id]/loading.tsx
+++ b/packages/web/src/app/repos/[id]/loading.tsx
@@ -1,4 +1,4 @@
-import { Skeleton } from "@/components/ui/skeleton";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
export default function RepoLoading() {
return (
diff --git a/packages/web/src/app/repos/[id]/overview/loading.tsx b/packages/web/src/app/repos/[id]/overview/loading.tsx
index a280cd429..5048addf3 100644
--- a/packages/web/src/app/repos/[id]/overview/loading.tsx
+++ b/packages/web/src/app/repos/[id]/overview/loading.tsx
@@ -1,5 +1,5 @@
-import { Skeleton } from "@/components/ui/skeleton";
-import { Card, CardContent } from "@/components/ui/card";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
+import { Card, CardContent } from "@repowise-dev/ui/ui/card";
export default function OverviewLoading() {
return (
diff --git a/packages/web/src/app/repos/[id]/overview/page.tsx b/packages/web/src/app/repos/[id]/overview/page.tsx
index c0ad97938..96ca5a5b8 100644
--- a/packages/web/src/app/repos/[id]/overview/page.tsx
+++ b/packages/web/src/app/repos/[id]/overview/page.tsx
@@ -9,27 +9,27 @@ import { getGraph, getModuleGraph, getCommunities, getExecutionFlows } from "@/l
import { getProviders } from "@/lib/api/providers";
import { listJobs } from "@/lib/api/jobs";
import { getKnowledgeMap } from "@/lib/api/knowledge-map";
-import { Badge } from "@/components/ui/badge";
-import { StatCard } from "@/components/shared/stat-card";
-import { HealthScoreRing } from "@/components/dashboard/health-score-ring";
-import { AttentionPanel } from "@/components/dashboard/attention-panel";
-import { QuickActions } from "@/components/dashboard/quick-actions";
-import { OwnershipTreemap } from "@/components/dashboard/ownership-treemap";
-import { LanguageDonut } from "@/components/dashboard/language-donut";
+import { Badge } from "@repowise-dev/ui/ui/badge";
+import { StatCard } from "@repowise-dev/ui/shared/stat-card";
+import { HealthScoreRing } from "@repowise-dev/ui/dashboard/health-score-ring";
+import { AttentionPanel } from "@repowise-dev/ui/dashboard/attention-panel";
+import { QuickActionsWrapper as QuickActions } from "@/components/dashboard/quick-actions-wrapper";
+import { OwnershipTreemap } from "@repowise-dev/ui/dashboard/ownership-treemap";
+import { LanguageDonut } from "@repowise-dev/ui/dashboard/language-donut";
import { computeHealthScore, buildAttentionItems, aggregateLanguages } from "@/lib/utils/health-score";
-import { HotspotsMini } from "@/components/dashboard/hotspots-mini";
-import { DecisionsTimeline } from "@/components/dashboard/decisions-timeline";
-import { ModuleMinimap } from "@/components/dashboard/module-minimap";
-import { CommunitySummaryGrid } from "@/components/dashboard/community-summary-grid";
-import { ExecutionFlowsPanel } from "@/components/dashboard/execution-flows-panel";
-import { DependencyHeatmap } from "@/components/dashboard/dependency-heatmap";
-import { BusFactorPanel } from "@/components/git/bus-factor-panel";
-import { ChurnHistogram } from "@/components/git/churn-histogram";
-import { CommitCategoryDonut } from "@/components/git/commit-category-donut";
-import { CommitCategorySparkline } from "@/components/git/commit-category-sparkline";
-import { OwnershipTreemap as OwnershipTreemapGit } from "@/components/git/ownership-treemap";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
-import { formatNumber } from "@/lib/utils/format";
+import { HotspotsMini } from "@repowise-dev/ui/dashboard/hotspots-mini";
+import { DecisionsTimeline } from "@repowise-dev/ui/dashboard/decisions-timeline";
+import { ModuleMinimap } from "@repowise-dev/ui/dashboard/module-minimap";
+import { CommunitySummaryGridWrapper as CommunitySummaryGrid } from "@/components/dashboard/community-summary-grid-wrapper";
+import { ExecutionFlowsPanel } from "@repowise-dev/ui/dashboard/execution-flows-panel";
+import { DependencyHeatmap } from "@repowise-dev/ui/dashboard/dependency-heatmap";
+import { BusFactorPanel } from "@repowise-dev/ui/git/bus-factor-panel";
+import { ChurnHistogram } from "@repowise-dev/ui/git/churn-histogram";
+import { CommitCategoryDonut } from "@repowise-dev/ui/git/commit-category-donut";
+import { CommitCategorySparkline } from "@repowise-dev/ui/git/commit-category-sparkline";
+import { OwnershipTreemap as OwnershipTreemapGit } from "@repowise-dev/ui/git/ownership-treemap";
+import { Card, CardContent, CardHeader, CardTitle } from "@repowise-dev/ui/ui/card";
+import { formatNumber } from "@repowise-dev/ui/lib/format";
import type {
RepoStatsResponse,
GitSummaryResponse,
@@ -50,7 +50,7 @@ interface Props {
params: Promise<{ id: string }>;
}
-// Each fetch wrapped to return null on failure — the dashboard degrades gracefully
+// Each fetch wrapped to return null on failure — the dashboard degrades gracefully
async function safeFetch<T>(fn: () => Promise<T>): Promise<T | null> {
try {
return await fn();
@@ -65,7 +65,7 @@ export default async function OverviewPage({ params }: Props) {
const repo = await safeFetch(() => getRepo(id));
if (!repo) notFound();
- // Fetch all data in parallel — each independently failable
+ // Fetch all data in parallel — each independently failable
const [stats, gitSummary, hotspots, ownership, deadCodeSummary, deadCodeSafe, decisions, decisionHealth, graph, moduleGraph, providers, completedJobs, knowledgeMap, communities, executionFlows] =
await Promise.all([
safeFetch(() => getRepoStats(id)),
@@ -116,7 +116,7 @@ export default async function OverviewPage({ params }: Props) {
return (
<div className="p-4 sm:p-6 space-y-6 max-w-[1600px]">
- {/* ── Hero: Health Score + Repo Info + Quick Actions ── */}
+ {/* ── Hero: Health Score + Repo Info + Quick Actions ── */}
<div className="flex flex-col sm:flex-row items-start gap-6">
<HealthScoreRing score={healthScore} />
@@ -155,27 +155,27 @@ export default async function OverviewPage({ params }: Props) {
<div className="grid grid-cols-2 gap-2 sm:grid-cols-5">
<StatCard
label="Files"
- value={stats ? formatNumber(stats.file_count) : "—"}
+ value={stats ? formatNumber(stats.file_count) : "—"}
className="!p-0 [&>div]:!p-3"
/>
<StatCard
label="Symbols"
- value={stats ? formatNumber(stats.symbol_count) : "—"}
+ value={stats ? formatNumber(stats.symbol_count) : "—"}
className="!p-0 [&>div]:!p-3"
/>
<StatCard
label="Entry Points"
- value={stats ? formatNumber(stats.entry_point_count) : "—"}
+ value={stats ? formatNumber(stats.entry_point_count) : "—"}
className="!p-0 [&>div]:!p-3"
/>
<StatCard
label="Doc Coverage"
- value={stats ? `${Math.round(stats.doc_coverage_pct)}%` : "—"}
+ value={stats ? `${Math.round(stats.doc_coverage_pct)}%` : "—"}
className="!p-0 [&>div]:!p-3"
/>
<StatCard
label="Dead Exports"
- value={stats ? formatNumber(stats.dead_export_count) : "—"}
+ value={stats ? formatNumber(stats.dead_export_count) : "—"}
description={
deadCodeSummary
? `${formatNumber(deadCodeSummary.deletable_lines)} deletable lines`
@@ -187,9 +187,9 @@ export default async function OverviewPage({ params }: Props) {
</div>
</div>
- {/* ── Main Grid ── */}
+ {/* ── Main Grid ── */}
<div className="grid grid-cols-1 gap-4 lg:grid-cols-3">
- {/* Left column — Attention + Hotspots */}
+ {/* Left column — Attention + Hotspots */}
<div className="space-y-4 lg:col-span-2">
<AttentionPanel items={attentionItems} repoId={id} />
<div className="grid grid-cols-1 gap-4 md:grid-cols-2">
@@ -207,7 +207,7 @@ export default async function OverviewPage({ params }: Props) {
</div>
</div>
- {/* Right column — Visualizations */}
+ {/* Right column — Visualizations */}
<div className="space-y-4">
<LanguageDonut distribution={langDistribution} />
{ownership && ownership.length > 0 && (
@@ -216,7 +216,7 @@ export default async function OverviewPage({ params }: Props) {
</div>
</div>
- {/* ── Git Insights ── */}
+ {/* ── Git Insights ── */}
{hotspots && hotspots.length > 0 && (() => {
const aggregatedCategories: Record<string, number> = {};
for (const h of hotspots) {
@@ -299,7 +299,7 @@ export default async function OverviewPage({ params }: Props) {
);
})()}
- {/* ── Module Architecture Map + Dependency Heatmap ── */}
+ {/* ── Module Architecture Map + Dependency Heatmap ── */}
{moduleGraph && moduleGraph.nodes.length > 0 && (
<div className="space-y-4">
<ModuleMinimap
@@ -312,7 +312,7 @@ export default async function OverviewPage({ params }: Props) {
<CardHeader className="pb-2">
<CardTitle className="text-sm font-medium">Dependency Heatmap</CardTitle>
<p className="text-xs text-[var(--color-text-tertiary)]">
- Module-to-module dependency density — brighter cells indicate more connections
+ Module-to-module dependency density — brighter cells indicate more connections
</p>
</CardHeader>
<CardContent>
@@ -323,7 +323,7 @@ export default async function OverviewPage({ params }: Props) {
</div>
)}
- {/* ── Graph Intelligence: Communities & Execution Flows ── */}
+ {/* ── Graph Intelligence: Communities & Execution Flows ── */}
{((communities && communities.length > 0) || (executionFlows && executionFlows.flows.length > 0)) && (
<div className="space-y-4">
<h2 className="text-sm font-medium text-[var(--color-text-secondary)] uppercase tracking-wider">
@@ -340,7 +340,7 @@ export default async function OverviewPage({ params }: Props) {
</div>
)}
- {/* ── Knowledge Map ── */}
+ {/* ── Knowledge Map ── */}
{knowledgeMap && (
<div className="space-y-4">
<h2 className="text-sm font-medium text-[var(--color-text-secondary)] uppercase tracking-wider">
@@ -390,7 +390,7 @@ export default async function OverviewPage({ params }: Props) {
</CardHeader>
<CardContent>
{knowledgeMap.knowledge_silos.length === 0 ? (
- <p className="text-xs text-[var(--color-text-tertiary)]">No silos detected — good bus factor!</p>
+ <p className="text-xs text-[var(--color-text-tertiary)]">No silos detected — good bus factor!</p>
) : (
<div className="space-y-1">
<p className="text-xs text-[var(--color-text-secondary)] mb-2">
@@ -435,7 +435,7 @@ export default async function OverviewPage({ params }: Props) {
{target.path}
</p>
<p className="text-[10px] text-[var(--color-text-tertiary)]">
- pagerank {target.pagerank.toFixed(4)} · {formatNumber(target.doc_words)} doc words
+ pagerank {target.pagerank.toFixed(4)} · {formatNumber(target.doc_words)} doc words
</p>
</li>
))}
diff --git a/packages/web/src/app/repos/[id]/ownership/loading.tsx b/packages/web/src/app/repos/[id]/ownership/loading.tsx
index 0186b1b73..34bc46100 100644
--- a/packages/web/src/app/repos/[id]/ownership/loading.tsx
+++ b/packages/web/src/app/repos/[id]/ownership/loading.tsx
@@ -1,4 +1,4 @@
-import { Skeleton } from "@/components/ui/skeleton";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
export default function OwnershipLoading() {
return (
diff --git a/packages/web/src/app/repos/[id]/ownership/page.tsx b/packages/web/src/app/repos/[id]/ownership/page.tsx
index 4258a09d3..c6803cd97 100644
--- a/packages/web/src/app/repos/[id]/ownership/page.tsx
+++ b/packages/web/src/app/repos/[id]/ownership/page.tsx
@@ -4,16 +4,16 @@ import { useState } from "react";
import useSWR from "swr";
import { useParams } from "next/navigation";
import { Users, Shield } from "lucide-react";
-import { StatCard } from "@/components/shared/stat-card";
-import { OwnershipTable } from "@/components/git/ownership-table";
-import { ContributorBar } from "@/components/git/contributor-bar";
-import { OwnershipTreemap } from "@/components/git/ownership-treemap";
-import { BusFactorPanel } from "@/components/git/bus-factor-panel";
-import { ContributorNetwork } from "@/components/git/contributor-network";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
-import { Skeleton } from "@/components/ui/skeleton";
+import { StatCard } from "@repowise-dev/ui/shared/stat-card";
+import { OwnershipTable } from "@repowise-dev/ui/git/ownership-table";
+import { ContributorBar } from "@repowise-dev/ui/git/contributor-bar";
+import { OwnershipTreemap } from "@repowise-dev/ui/git/ownership-treemap";
+import { BusFactorPanel } from "@repowise-dev/ui/git/bus-factor-panel";
+import { ContributorNetwork } from "@repowise-dev/ui/git/contributor-network";
+import { Card, CardContent, CardHeader, CardTitle } from "@repowise-dev/ui/ui/card";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
import { getOwnership, getGitSummary, getHotspots } from "@/lib/api/git";
-import { formatNumber } from "@/lib/utils/format";
+import { formatNumber } from "@repowise-dev/ui/lib/format";
import { cn } from "@/lib/utils/cn";
import type { OwnershipEntry, GitSummaryResponse, HotspotResponse } from "@/lib/api/types";
@@ -53,7 +53,7 @@ export default function OwnershipPage() {
Code Ownership
</h1>
<p className="text-sm text-[var(--color-text-secondary)]">
- Who owns what — silo detection and bus factor risk.
+ Who owns what — silo detection and bus factor risk.
</p>
</div>
@@ -79,7 +79,7 @@ export default function OwnershipPage() {
<StatCard
label="Bus Factor Risk"
value={formatNumber(busFactorRiskCount)}
- description="files with factor ≤ 1"
+ description="files with factor ≤ 1"
icon={<Shield className="h-4 w-4 text-red-400" />}
/>
</div>
@@ -157,7 +157,7 @@ export default function OwnershipPage() {
<CardHeader className="pb-2">
<CardTitle className="text-sm">Contributor Network</CardTitle>
<p className="text-xs text-[var(--color-text-tertiary)]">
- Contributors linked by shared file ownership — larger nodes own more files
+ Contributors linked by shared file ownership — larger nodes own more files
</p>
</CardHeader>
<CardContent className="pt-0">
diff --git a/packages/web/src/app/repos/[id]/page.tsx b/packages/web/src/app/repos/[id]/page.tsx
index bcf118d52..648f98c95 100644
--- a/packages/web/src/app/repos/[id]/page.tsx
+++ b/packages/web/src/app/repos/[id]/page.tsx
@@ -2,7 +2,7 @@ import type { Metadata } from "next";
import { notFound } from "next/navigation";
import { Hash } from "lucide-react";
import { getRepo } from "@/lib/api/repos";
-import { Badge } from "@/components/ui/badge";
+import { Badge } from "@repowise-dev/ui/ui/badge";
import { ChatInterface } from "@/components/chat/chat-interface";
interface Props {
@@ -13,7 +13,7 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { id } = await params;
try {
const repo = await getRepo(id);
- return { title: `${repo.name} — Chat` };
+ return { title: `${repo.name} — Chat` };
} catch {
return { title: "Repository" };
}
diff --git a/packages/web/src/app/repos/[id]/search/loading.tsx b/packages/web/src/app/repos/[id]/search/loading.tsx
index 1e5981bde..17bfcc712 100644
--- a/packages/web/src/app/repos/[id]/search/loading.tsx
+++ b/packages/web/src/app/repos/[id]/search/loading.tsx
@@ -1,4 +1,4 @@
-import { Skeleton } from "@/components/ui/skeleton";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
export default function SearchLoading() {
return (
diff --git a/packages/web/src/app/repos/[id]/search/page.tsx b/packages/web/src/app/repos/[id]/search/page.tsx
index 431af4c77..c4a5b8224 100644
--- a/packages/web/src/app/repos/[id]/search/page.tsx
+++ b/packages/web/src/app/repos/[id]/search/page.tsx
@@ -5,8 +5,8 @@ import { useParams } from "next/navigation";
import { Search } from "lucide-react";
import { SearchBar } from "@/components/search/search-bar";
import { SearchResultCard } from "@/components/search/search-result-card";
-import { EmptyState } from "@/components/shared/empty-state";
-import { Skeleton } from "@/components/ui/skeleton";
+import { EmptyState } from "@repowise-dev/ui/shared/empty-state";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
import { useSearch } from "@/lib/hooks/use-search";
type SearchType = "fulltext" | "semantic";
diff --git a/packages/web/src/app/repos/[id]/settings/page.tsx b/packages/web/src/app/repos/[id]/settings/page.tsx
index 334eb2ad2..e11c73907 100644
--- a/packages/web/src/app/repos/[id]/settings/page.tsx
+++ b/packages/web/src/app/repos/[id]/settings/page.tsx
@@ -3,10 +3,10 @@ import { notFound } from "next/navigation";
import { Settings } from "lucide-react";
import { getRepo } from "@/lib/api/repos";
import { getCoordinatorHealth } from "@/lib/api/health";
-import { RepoSettingsForm } from "@/components/repos/repo-settings-form";
+import { RepoSettingsFormWrapper as RepoSettingsForm } from "@/components/repos/repo-settings-form-wrapper";
import { CoordinatorHealthPanel } from "@/components/repos/coordinator-health-panel";
-import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card";
-import { Separator } from "@/components/ui/separator";
+import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@repowise-dev/ui/ui/card";
+import { Separator } from "@repowise-dev/ui/ui/separator";
import { OperationsPanel } from "@/components/repos/operations-panel";
interface Props {
@@ -17,7 +17,7 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { id } = await params;
try {
const repo = await getRepo(id);
- return { title: `${repo.name} — Settings` };
+ return { title: `${repo.name} — Settings` };
} catch {
return { title: "Settings" };
}
diff --git a/packages/web/src/app/repos/[id]/symbols/loading.tsx b/packages/web/src/app/repos/[id]/symbols/loading.tsx
index 181057cc7..17e24ac98 100644
--- a/packages/web/src/app/repos/[id]/symbols/loading.tsx
+++ b/packages/web/src/app/repos/[id]/symbols/loading.tsx
@@ -1,4 +1,4 @@
-import { Skeleton } from "@/components/ui/skeleton";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
export default function SymbolsLoading() {
return (
diff --git a/packages/web/src/app/repos/[id]/symbols/page.tsx b/packages/web/src/app/repos/[id]/symbols/page.tsx
index 41420d994..23cb74c4c 100644
--- a/packages/web/src/app/repos/[id]/symbols/page.tsx
+++ b/packages/web/src/app/repos/[id]/symbols/page.tsx
@@ -1,6 +1,6 @@
import type { Metadata } from "next";
import { Code2 } from "lucide-react";
-import { SymbolTable } from "@/components/symbols/symbol-table";
+import { SymbolTableWrapper as SymbolTable } from "@/components/symbols/symbol-table-wrapper";
export const metadata: Metadata = { title: "Symbols" };
diff --git a/packages/web/src/app/repos/[id]/wiki/[...slug]/loading.tsx b/packages/web/src/app/repos/[id]/wiki/[...slug]/loading.tsx
index e43069b49..4b520f47d 100644
--- a/packages/web/src/app/repos/[id]/wiki/[...slug]/loading.tsx
+++ b/packages/web/src/app/repos/[id]/wiki/[...slug]/loading.tsx
@@ -1,4 +1,4 @@
-import { Skeleton } from "@/components/ui/skeleton";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
export default function WikiPageLoading() {
return (
diff --git a/packages/web/src/app/repos/[id]/wiki/[...slug]/page.tsx b/packages/web/src/app/repos/[id]/wiki/[...slug]/page.tsx
index 55bc6b8b8..77e16903d 100644
--- a/packages/web/src/app/repos/[id]/wiki/[...slug]/page.tsx
+++ b/packages/web/src/app/repos/[id]/wiki/[...slug]/page.tsx
@@ -6,16 +6,16 @@ import { getRepo } from "@/lib/api/repos";
import { getPageById, getPageVersions } from "@/lib/api/pages";
import { getGitMetadata } from "@/lib/api/git";
import { getGraphMetrics } from "@/lib/api/graph";
-import { ConfidenceBadge } from "@/components/wiki/confidence-badge";
+import { ConfidenceBadge } from "@repowise-dev/ui/wiki/confidence-badge";
import { WikiRenderer } from "@/components/wiki/wiki-renderer";
-import { TableOfContents } from "@/components/wiki/table-of-contents";
-import { RegenerateButton } from "@/components/wiki/regenerate-button";
-import { GitHistoryPanel } from "@/components/wiki/git-history-panel";
-import { SecurityPanel } from "@/components/wiki/security-panel";
-import { Badge } from "@/components/ui/badge";
-import { Separator } from "@/components/ui/separator";
-import { formatRelativeTime, formatTokens } from "@/lib/utils/format";
-import { CoChangeList } from "@/components/git/co-change-list";
+import { TableOfContents } from "@repowise-dev/ui/wiki/table-of-contents";
+import { RegenerateButtonWrapper } from "@/components/wiki/regenerate-button";
+import { GitHistoryPanel } from "@repowise-dev/ui/wiki/git-history-panel";
+import { SecurityPanelWrapper } from "@/components/wiki/security-panel";
+import { Badge } from "@repowise-dev/ui/ui/badge";
+import { Separator } from "@repowise-dev/ui/ui/separator";
+import { formatRelativeTime, formatTokens } from "@repowise-dev/ui/lib/format";
+import { CoChangeList } from "@repowise-dev/ui/git/co-change-list";
import { Hash, Cpu, StickyNote, Network } from "lucide-react";
import type { GraphMetricsResponse } from "@/lib/api/types";
@@ -102,7 +102,7 @@ export default async function WikiPageRoute({ params }: Props) {
)}
{/* Regenerate */}
- <RegenerateButton pageId={page.id} repoId={id} />
+ <RegenerateButtonWrapper pageId={page.id} repoId={id} />
</div>
{/* Page content */}
@@ -151,7 +151,7 @@ export default async function WikiPageRoute({ params }: Props) {
<span>Generated {formatRelativeTime(page.updated_at)}</span>
<Separator orientation="vertical" className="h-4 hidden sm:block" />
<span className="font-mono">
- {formatTokens(page.input_tokens)} in · {formatTokens(page.output_tokens)} out
+ {formatTokens(page.input_tokens)} in · {formatTokens(page.output_tokens)} out
</span>
{versionList.length > 0 && (
<>
@@ -247,7 +247,7 @@ export default async function WikiPageRoute({ params }: Props) {
<p className="text-xs font-medium text-[var(--color-text-tertiary)] uppercase tracking-wider mb-2">
Security Signals
</p>
- <SecurityPanel repoId={id} filePath={page.target_path} />
+ <SecurityPanelWrapper repoId={id} filePath={page.target_path} />
</div>
)}
diff --git a/packages/web/src/app/workspace/co-changes/page.tsx b/packages/web/src/app/workspace/co-changes/page.tsx
index 008f229a8..c040043d5 100644
--- a/packages/web/src/app/workspace/co-changes/page.tsx
+++ b/packages/web/src/app/workspace/co-changes/page.tsx
@@ -3,10 +3,10 @@
import { useState } from "react";
import { GitMerge, Filter } from "lucide-react";
import { useWorkspaceCoChanges, useWorkspace } from "@/lib/hooks/use-workspace";
-import { CoChangeTable } from "@/components/workspace/co-change-table";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
-import { StatCard } from "@/components/shared/stat-card";
-import { Skeleton } from "@/components/ui/skeleton";
+import { CoChangeTable } from "@repowise-dev/ui/workspace/co-change-table";
+import { Card, CardContent, CardHeader, CardTitle } from "@repowise-dev/ui/ui/card";
+import { StatCard } from "@repowise-dev/ui/shared/stat-card";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
export default function CoChangesPage() {
const { workspace } = useWorkspace();
@@ -33,7 +33,7 @@ export default function CoChangesPage() {
</h1>
</div>
<p className="text-sm text-[var(--color-text-secondary)]">
- Files across repositories that frequently change together — implicit coupling detected from git history.
+ Files across repositories that frequently change together — implicit coupling detected from git history.
</p>
</div>
@@ -41,7 +41,7 @@ export default function CoChangesPage() {
<div className="grid grid-cols-2 gap-3 lg:grid-cols-3">
<StatCard
label="Total Co-Change Pairs"
- value={data?.total ?? "—"}
+ value={data?.total ?? "—"}
icon={<GitMerge className="h-4 w-4 text-[var(--color-accent-primary)]" />}
/>
<StatCard
@@ -50,10 +50,10 @@ export default function CoChangesPage() {
data?.co_changes
? new Set(
data.co_changes.map((cc) =>
- [cc.source_repo, cc.target_repo].sort().join("↔"),
+ [cc.source_repo, cc.target_repo].sort().join("↔"),
),
).size
- : "—"
+ : "—"
}
icon={<GitMerge className="h-4 w-4 text-purple-400" />}
/>
@@ -66,7 +66,7 @@ export default function CoChangesPage() {
data.co_changes.length) *
100,
)}%`
- : "—"
+ : "—"
}
icon={<GitMerge className="h-4 w-4 text-orange-400" />}
/>
diff --git a/packages/web/src/app/workspace/contracts/page.tsx b/packages/web/src/app/workspace/contracts/page.tsx
index 7ef75dc2a..e146c9aa4 100644
--- a/packages/web/src/app/workspace/contracts/page.tsx
+++ b/packages/web/src/app/workspace/contracts/page.tsx
@@ -4,11 +4,11 @@ import { useState } from "react";
import { Link2, Filter } from "lucide-react";
import { useWorkspaceContracts } from "@/lib/hooks/use-workspace";
import { useWorkspace } from "@/lib/hooks/use-workspace";
-import { ContractLinksTable } from "@/components/workspace/contract-links-table";
-import { ContractTypeBadge, RoleBadge } from "@/components/workspace/contract-type-badge";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
-import { StatCard } from "@/components/shared/stat-card";
-import { Skeleton } from "@/components/ui/skeleton";
+import { ContractLinksTable } from "@repowise-dev/ui/workspace/contract-links-table";
+import { ContractTypeBadge, RoleBadge } from "@repowise-dev/ui/workspace/contract-type-badge";
+import { Card, CardContent, CardHeader, CardTitle } from "@repowise-dev/ui/ui/card";
+import { StatCard } from "@repowise-dev/ui/shared/stat-card";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
const TYPE_OPTIONS = [
{ value: "", label: "All Types" },
@@ -67,17 +67,17 @@ export default function ContractsPage() {
<div className="grid grid-cols-2 gap-3 lg:grid-cols-4">
<StatCard
label="Total Contracts"
- value={data?.total_contracts ?? "—"}
+ value={data?.total_contracts ?? "—"}
icon={<Link2 className="h-4 w-4" />}
/>
<StatCard
label="Matched Links"
- value={data?.total_links ?? "—"}
+ value={data?.total_links ?? "—"}
icon={<Link2 className="h-4 w-4 text-green-400" />}
/>
<StatCard
label="Unmatched"
- value={isLoading ? "—" : unmatchedCount}
+ value={isLoading ? "—" : unmatchedCount}
description="No matching provider or consumer"
icon={<Link2 className="h-4 w-4 text-yellow-400" />}
/>
@@ -86,7 +86,7 @@ export default function ContractsPage() {
value={
data?.by_type
? Object.values(data.by_type).reduce((a, b) => a + b, 0)
- : "—"
+ : "—"
}
description={
data?.by_type
diff --git a/packages/web/src/app/workspace/page.tsx b/packages/web/src/app/workspace/page.tsx
index c4abeb7fc..6987c7134 100644
--- a/packages/web/src/app/workspace/page.tsx
+++ b/packages/web/src/app/workspace/page.tsx
@@ -11,13 +11,13 @@ import {
ArrowRight,
} from "lucide-react";
import { getWorkspace, getWorkspaceCoChanges } from "@/lib/api/workspace";
-import { StatCard } from "@/components/shared/stat-card";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
-import { RepoCard } from "@/components/workspace/repo-card";
-import { CrossRepoSummary } from "@/components/workspace/cross-repo-summary";
-import { CoChangeTable } from "@/components/workspace/co-change-table";
-import { ContractTypeBadge } from "@/components/workspace/contract-type-badge";
-import { formatNumber } from "@/lib/utils/format";
+import { StatCard } from "@repowise-dev/ui/shared/stat-card";
+import { Card, CardContent, CardHeader, CardTitle } from "@repowise-dev/ui/ui/card";
+import { RepoCard } from "@repowise-dev/ui/workspace/repo-card";
+import { CrossRepoSummary } from "@repowise-dev/ui/workspace/cross-repo-summary";
+import { CoChangeTable } from "@repowise-dev/ui/workspace/co-change-table";
+import { ContractTypeBadge } from "@repowise-dev/ui/workspace/contract-type-badge";
+import { formatNumber } from "@repowise-dev/ui/lib/format";
export const metadata: Metadata = { title: "Workspace" };
diff --git a/packages/web/src/components/chat/artifact-panel.tsx b/packages/web/src/components/chat/artifact-panel.tsx
deleted file mode 100644
index 773b1539e..000000000
--- a/packages/web/src/components/chat/artifact-panel.tsx
+++ /dev/null
@@ -1,222 +0,0 @@
-"use client";
-
-import { useState } from "react";
-import { X } from "lucide-react";
-import { cn } from "@/lib/utils/cn";
-import { ChatMarkdown } from "./chat-markdown";
-
-export interface Artifact {
- type: string;
- title: string;
- data: Record<string, unknown>;
-}
-
-interface ArtifactPanelProps {
- artifacts: Artifact[];
- open: boolean;
- onClose: () => void;
-}
-
-export function ArtifactPanel({ artifacts, open, onClose }: ArtifactPanelProps) {
- const [activeIdx, setActiveIdx] = useState(0);
-
- if (!open || artifacts.length === 0) return null;
-
- const active = artifacts[Math.min(activeIdx, artifacts.length - 1)];
-
- return (
- <>
- {/* Mobile: full-screen overlay */}
- <div className="fixed inset-0 z-[var(--z-modal)] bg-black/50 lg:hidden" onClick={onClose} />
-
- <div
- className={cn(
- "fixed right-0 top-0 z-[var(--z-modal)] h-full bg-[var(--color-bg-surface)] border-l border-[var(--color-border-default)] flex flex-col",
- "w-full sm:w-[480px] lg:w-[420px]",
- "transition-transform duration-300",
- open ? "translate-x-0" : "translate-x-full",
- )}
- >
- {/* Header */}
- <div className="flex items-center justify-between px-4 py-3 border-b border-[var(--color-border-default)] shrink-0">
- <span className="text-xs font-medium text-[var(--color-text-primary)]">
- Artifacts
- </span>
- <button
- onClick={onClose}
- className="p-1 rounded hover:bg-[var(--color-bg-elevated)] text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)] transition-colors"
- >
- <X className="h-4 w-4" />
- </button>
- </div>
-
- {/* Tabs */}
- {artifacts.length > 1 && (
- <div className="flex gap-0 border-b border-[var(--color-border-default)] shrink-0 overflow-x-auto px-2">
- {artifacts.map((art, idx) => (
- <button
- key={idx}
- onClick={() => setActiveIdx(idx)}
- className={cn(
- "px-3 py-2 text-xs whitespace-nowrap border-b-2 transition-colors",
- idx === activeIdx
- ? "border-[var(--color-accent-primary)] text-[var(--color-accent-primary)]"
- : "border-transparent text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)]",
- )}
- >
- {art.title || art.type}
- </button>
- ))}
- </div>
- )}
-
- {/* Content */}
- <div className="flex-1 overflow-y-auto p-4">
- <ArtifactRenderer artifact={active} />
- </div>
- </div>
- </>
- );
-}
-
-function ArtifactRenderer({ artifact }: { artifact: Artifact }) {
- const { type, data } = artifact;
-
- switch (type) {
- case "overview":
- case "wiki_page": {
- const content =
- (data as Record<string, unknown>).content_md as string ??
- (data as Record<string, unknown>).content as string ??
- "";
- // For get_context with targets
- const targets = data.targets as Record<string, Record<string, unknown>> | undefined;
- if (targets) {
- return (
- <div className="space-y-4">
- {Object.entries(targets).map(([target, info]) => {
- const docs = (info as Record<string, unknown>).docs as Record<string, unknown> | undefined;
- const md = docs?.content_md as string ?? "";
- return (
- <div key={target}>
- <h3 className="text-xs font-mono text-[var(--color-accent-primary)] mb-2">
- {target}
- </h3>
- {md ? <ChatMarkdown content={md} /> : (
- <pre className="text-xs font-mono text-[var(--color-text-secondary)] overflow-auto max-h-96">
- {JSON.stringify(info, null, 2)}
- </pre>
- )}
- </div>
- );
- })}
- </div>
- );
- }
- return content ? <ChatMarkdown content={content} /> : <RawJson data={data} />;
- }
-
- case "diagram": {
- const mermaid = (data.mermaid_syntax as string) ?? "";
- if (mermaid) {
- return <MermaidBlock chart={mermaid} />;
- }
- return <RawJson data={data} />;
- }
-
- case "search_results": {
- const results = (data.results as Array<Record<string, unknown>>) ?? [];
- return (
- <div className="space-y-2">
- {results.map((r, i) => (
- <div
- key={i}
- className="rounded-lg border border-[var(--color-border-default)] p-3"
- >
- <div className="text-xs font-medium text-[var(--color-text-primary)]">
- {r.title as string}
- </div>
- <div className="text-[10px] text-[var(--color-text-tertiary)] mt-0.5">
- {r.page_type as string} · score: {((r.relevance_score as number) ?? 0).toFixed(2)}
- </div>
- {r.snippet ? (
- <p className="text-xs text-[var(--color-text-secondary)] mt-1 line-clamp-3">
- {r.snippet as string}
- </p>
- ) : null}
- </div>
- ))}
- {results.length === 0 && (
- <p className="text-xs text-[var(--color-text-tertiary)]">
- No results found.
- </p>
- )}
- </div>
- );
- }
-
- case "risk_report":
- case "decisions":
- case "dead_code":
- case "graph":
- default:
- return <RawJson data={data} />;
- }
-}
-
-function RawJson({ data }: { data: Record<string, unknown> }) {
- return (
- <pre className="text-[10px] font-mono text-[var(--color-text-secondary)] overflow-auto max-h-[70vh] whitespace-pre-wrap break-words">
- {JSON.stringify(data, null, 2)}
- </pre>
- );
-}
-
-function MermaidBlock({ chart }: { chart: string }) {
- // Use dynamic import via useEffect for Mermaid (same pattern as wiki)
- const [svg, setSvg] = useState<string | null>(null);
- const [error, setError] = useState<string | null>(null);
-
- // Lazy load mermaid
- import("mermaid").then((mermaid) => {
- const mermaidInstance = mermaid.default;
- mermaidInstance.initialize({
- startOnLoad: false,
- theme: "dark",
- themeVariables: {
- background: "var(--color-bg-surface)",
- primaryColor: "#5B9CF6",
- primaryTextColor: "#e2e8f0",
- lineColor: "#334155",
- },
- });
- const id = `mermaid-artifact-${Math.random().toString(36).slice(2)}`;
- mermaidInstance
- .render(id, chart)
- .then(({ svg: renderedSvg }) => setSvg(renderedSvg))
- .catch((err: Error) => setError(err.message));
- });
-
- if (error) {
- return (
- <div className="rounded border border-red-500/30 bg-red-500/10 p-3 text-xs text-red-400">
- Diagram error: {error}
- </div>
- );
- }
-
- if (svg) {
- return (
- <div
- className="flex justify-center overflow-x-auto rounded border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] p-4"
- dangerouslySetInnerHTML={{ __html: svg }}
- />
- );
- }
-
- return (
- <div className="flex justify-center p-4">
- <div className="h-4 w-4 animate-spin rounded-full border-2 border-[var(--color-accent-primary)] border-t-transparent" />
- </div>
- );
-}
diff --git a/packages/web/src/components/chat/chat-interface.tsx b/packages/web/src/components/chat/chat-interface.tsx
index e6e9f48b6..54421b50f 100644
--- a/packages/web/src/components/chat/chat-interface.tsx
+++ b/packages/web/src/components/chat/chat-interface.tsx
@@ -1,31 +1,15 @@
"use client";
-import { useRef, useEffect, useState, useCallback } from "react";
-import Image from "next/image";
-import { Send, StopCircle, PanelRight, MessageSquare } from "lucide-react";
-import { Button } from "@/components/ui/button";
-import { ScrollArea } from "@/components/ui/scroll-area";
+import { ChatInterface as ChatInterfaceShell } from "@repowise-dev/ui/chat/chat-interface";
import { useChat } from "@/lib/hooks/use-chat";
-import { ChatMessage } from "./chat-message";
import { ModelSelector } from "./model-selector";
import { ConversationHistory } from "./conversation-history";
-import { ArtifactPanel, type Artifact } from "./artifact-panel";
-import { cn } from "@/lib/utils/cn";
interface ChatInterfaceProps {
repoId: string;
repoName?: string;
}
-const DEFAULT_SUGGESTIONS = [
- "Give me an overview of this codebase",
- "What are the highest-risk files to modify?",
- "Show me the architecture diagram",
- "What dead code can be safely removed?",
- "What architectural decisions have been made?",
- "Search for authentication-related code",
-];
-
export function ChatInterface({ repoId, repoName }: ChatInterfaceProps) {
const {
messages,
@@ -37,228 +21,24 @@ export function ChatInterface({ repoId, repoName }: ChatInterfaceProps) {
reset,
} = useChat(repoId);
- const [input, setInput] = useState("");
- const [artifactPanelOpen, setArtifactPanelOpen] = useState(false);
- const [artifacts, setArtifacts] = useState<Artifact[]>([]);
- const bottomRef = useRef<HTMLDivElement>(null);
- const textareaRef = useRef<HTMLTextAreaElement>(null);
-
- const isEmpty = messages.length === 0;
-
- // Auto-scroll to bottom
- useEffect(() => {
- bottomRef.current?.scrollIntoView({ behavior: "smooth" });
- }, [messages]);
-
- // Auto-resize textarea
- useEffect(() => {
- const ta = textareaRef.current;
- if (ta) {
- ta.style.height = "auto";
- ta.style.height = `${Math.min(ta.scrollHeight, 144)}px`;
- }
- }, [input]);
-
- const handleViewArtifact = useCallback(
- (artifact: { type: string; data: Record<string, unknown> }) => {
- const title = (artifact.data.title as string) ?? artifact.type;
- const newArt: Artifact = { type: artifact.type, title, data: artifact.data };
-
- setArtifacts((prev) => {
- const existing = prev.findIndex(
- (a) => a.type === newArt.type && a.title === newArt.title,
- );
- if (existing >= 0) return prev;
- return [...prev, newArt];
- });
- setArtifactPanelOpen(true);
- },
- [],
- );
-
- async function handleSubmit() {
- const text = input.trim();
- if (!text || isStreaming) return;
- setInput("");
- if (textareaRef.current) {
- textareaRef.current.style.height = "auto";
- }
- await sendMessage(text);
- }
-
- function handleSuggestion(text: string) {
- setInput(text);
- textareaRef.current?.focus();
- }
-
- // Count artifacts from all messages
- const totalArtifactCount = messages.reduce(
- (count, m) =>
- count + m.toolCalls.filter((tc) => tc.artifact).length,
- 0,
- );
-
return (
- <div className="flex h-full flex-col min-h-0">
- {/* Header bar (when active conversation) */}
- {!isEmpty && (
- <div className="flex items-center justify-between px-4 py-2.5 border-b border-[var(--color-border-default)] shrink-0 bg-[var(--color-bg-surface)]/95 backdrop-blur-sm">
- <div className="flex items-center gap-2">
- <ConversationHistory
- repoId={repoId}
- activeConversationId={conversationId}
- onSelect={loadConversation}
- onNew={reset}
- />
- </div>
- <div className="flex items-center gap-2">
- {totalArtifactCount > 0 && (
- <Button
- variant="ghost"
- size="sm"
- className="h-8 text-xs gap-1.5"
- onClick={() => setArtifactPanelOpen(true)}
- >
- <PanelRight className="h-4 w-4" />
- {totalArtifactCount}
- </Button>
- )}
- <ModelSelector />
- </div>
- </div>
- )}
-
- {/* Message list or empty state */}
- <div className="flex-1 min-h-0 relative">
- {isEmpty ? (
- <div className="flex flex-col items-center justify-center h-full gap-10 px-4">
- <div className="text-center space-y-3">
- <div className="flex items-center justify-center mb-6">
- <Image
- src="/repowise-logo.png"
- alt="repowise"
- width={48}
- height={48}
- className="drop-shadow-[0_0_12px_rgba(245,149,32,0.35)]"
- />
- </div>
- <h2 className="text-xl font-semibold text-[var(--color-text-primary)]">
- Ask anything about {repoName ?? "this codebase"}
- </h2>
- <p className="text-sm text-[var(--color-text-secondary)] max-w-md leading-relaxed">
- Explore architecture, assess risk, search code, trace
- dependencies, and understand decisions.
- </p>
- </div>
-
- {/* Suggestion chips */}
- <div className="grid grid-cols-1 sm:grid-cols-2 gap-2.5 max-w-xl w-full">
- {DEFAULT_SUGGESTIONS.map((s) => (
- <button
- key={s}
- className="text-left text-sm text-[var(--color-text-secondary)] rounded-xl border border-[var(--color-border-default)] px-4 py-3 hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)] hover:border-[var(--color-border-hover)] transition-colors"
- onClick={() => handleSuggestion(s)}
- >
- {s}
- </button>
- ))}
- </div>
-
- {/* Model selector for empty state */}
- <div className="flex items-center gap-3">
- <span className="text-xs text-[var(--color-text-tertiary)]">
- Using:
- </span>
- <ModelSelector />
- <ConversationHistory
- repoId={repoId}
- activeConversationId={null}
- onSelect={loadConversation}
- onNew={reset}
- />
- </div>
- </div>
- ) : (
- <ScrollArea className="h-full">
- <div className="px-4 py-6 space-y-5 max-w-3xl mx-auto">
- {messages.map((m) => (
- <ChatMessage
- key={m.id}
- message={m}
- repoId={repoId}
- onViewArtifact={handleViewArtifact}
- />
- ))}
- {error && (
- <div className="rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2.5 text-sm text-red-400">
- {error}
- </div>
- )}
- <div ref={bottomRef} />
- </div>
- </ScrollArea>
- )}
- </div>
-
- {/* Input area */}
- <div
- className={cn(
- "shrink-0 px-4 py-4",
- !isEmpty && "border-t border-[var(--color-border-default)]",
- )}
- >
- <div className="max-w-3xl mx-auto">
- <div
- className={cn(
- "flex items-end gap-2 rounded-2xl border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] px-4 py-3",
- isEmpty && "shadow-lg shadow-black/20",
- )}
- >
- <textarea
- ref={textareaRef}
- value={input}
- onChange={(e) => setInput(e.target.value)}
- onKeyDown={(e) => {
- if (e.key === "Enter" && !e.shiftKey) {
- e.preventDefault();
- handleSubmit();
- }
- }}
- placeholder="Ask anything about this codebase..."
- aria-label="Chat message"
- rows={1}
- className="flex-1 resize-none bg-transparent text-sm text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] outline-none leading-6 max-h-36 overflow-y-auto"
- style={{ scrollbarWidth: "none" }}
- />
- <Button
- size="icon"
- className="h-8 w-8 shrink-0 rounded-xl"
- onClick={isStreaming ? reset : handleSubmit}
- disabled={!input.trim() && !isStreaming}
- aria-label={isStreaming ? "Stop generation" : "Send message"}
- title={isStreaming ? "Stop generation" : "Send message"}
- >
- {isStreaming ? (
- <StopCircle className="h-4 w-4" />
- ) : (
- <Send className="h-4 w-4" />
- )}
- </Button>
- </div>
- {isEmpty && (
- <p className="text-center text-[11px] text-[var(--color-text-tertiary)] mt-2.5">
- Shift+Enter for newline · Enter to send
- </p>
- )}
- </div>
- </div>
-
- {/* Artifact panel */}
- <ArtifactPanel
- artifacts={artifacts}
- open={artifactPanelOpen}
- onClose={() => setArtifactPanelOpen(false)}
- />
- </div>
+ <ChatInterfaceShell
+ repoId={repoId}
+ {...(repoName !== undefined ? { repoName } : {})}
+ messages={messages}
+ isStreaming={isStreaming}
+ error={error}
+ onSend={(text) => sendMessage(text)}
+ onCancel={reset}
+ modelSelectorSlot={<ModelSelector />}
+ historySlot={
+ <ConversationHistory
+ repoId={repoId}
+ activeConversationId={conversationId}
+ onSelect={loadConversation}
+ onNew={reset}
+ />
+ }
+ />
);
}
diff --git a/packages/web/src/components/chat/conversation-history.tsx b/packages/web/src/components/chat/conversation-history.tsx
index 12944595d..397c64d7d 100644
--- a/packages/web/src/components/chat/conversation-history.tsx
+++ b/packages/web/src/components/chat/conversation-history.tsx
@@ -1,43 +1,28 @@
"use client";
-import { useState } from "react";
import useSWR from "swr";
-import { History, Plus, Trash2 } from "lucide-react";
-import { cn } from "@/lib/utils/cn";
+import { ConversationHistory as ConversationHistoryShell } from "@repowise-dev/ui/chat/conversation-history";
import { listConversations, deleteConversation } from "@/lib/api/chat";
import type { ConversationResponse } from "@/lib/api/types";
-interface ConversationHistoryProps {
+interface Props {
repoId: string;
activeConversationId: string | null;
onSelect: (id: string) => void;
onNew: () => void;
}
-function formatRelativeTime(dateStr: string): string {
- const diff = Date.now() - new Date(dateStr).getTime();
- const mins = Math.floor(diff / 60000);
- if (mins < 1) return "just now";
- if (mins < 60) return `${mins}m ago`;
- const hours = Math.floor(mins / 60);
- if (hours < 24) return `${hours}h ago`;
- const days = Math.floor(hours / 24);
- if (days < 7) return `${days}d ago`;
- return new Date(dateStr).toLocaleDateString();
-}
-
-export function ConversationHistory({
+export function ConversationHistoryWrapper({
repoId,
activeConversationId,
onSelect,
onNew,
-}: ConversationHistoryProps) {
- const [open, setOpen] = useState(false);
- const { data: conversations, mutate } = useSWR<ConversationResponse[]>(
- open ? `chat-convs:${repoId}` : null,
- () => listConversations(repoId),
- { revalidateOnFocus: false },
- );
+}: Props) {
+ const { data: conversations, isLoading, mutate } = useSWR<
+ ConversationResponse[]
+ >(`chat-convs:${repoId}`, () => listConversations(repoId), {
+ revalidateOnFocus: false,
+ });
async function handleDelete(convId: string) {
await deleteConversation(repoId, convId);
@@ -45,87 +30,16 @@ export function ConversationHistory({
}
return (
- <div className="relative">
- <button
- onClick={() => setOpen(!open)}
- className={cn(
- "flex items-center gap-1 rounded-md px-2 py-1 text-xs",
- "text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)]",
- "hover:bg-[var(--color-bg-elevated)] transition-colors",
- )}
- >
- <History className="h-3.5 w-3.5" />
- History
- </button>
-
- {open && (
- <>
- <div
- className="fixed inset-0 z-[var(--z-dropdown)]"
- onClick={() => setOpen(false)}
- />
- <div className="absolute left-0 top-full mt-1 z-[calc(var(--z-dropdown)+1)] w-72 rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-overlay)] shadow-lg overflow-hidden">
- {/* New conversation */}
- <button
- onClick={() => {
- onNew();
- setOpen(false);
- }}
- className="flex w-full items-center gap-2 px-3 py-2 text-xs text-[var(--color-accent-primary)] hover:bg-[var(--color-bg-elevated)] transition-colors border-b border-[var(--color-border-default)]"
- >
- <Plus className="h-3.5 w-3.5" />
- New conversation
- </button>
-
- {/* Conversation list */}
- <div className="max-h-64 overflow-y-auto">
- {!conversations && (
- <div className="px-3 py-4 text-xs text-[var(--color-text-tertiary)] text-center">
- Loading...
- </div>
- )}
- {conversations?.length === 0 && (
- <div className="px-3 py-4 text-xs text-[var(--color-text-tertiary)] text-center">
- No conversations yet
- </div>
- )}
- {conversations?.map((conv) => (
- <div
- key={conv.id}
- className={cn(
- "flex items-center gap-2 px-3 py-2 hover:bg-[var(--color-bg-elevated)] transition-colors group cursor-pointer",
- conv.id === activeConversationId &&
- "bg-[var(--color-accent-muted)]",
- )}
- onClick={() => {
- onSelect(conv.id);
- setOpen(false);
- }}
- >
- <div className="flex-1 min-w-0">
- <div className="text-xs text-[var(--color-text-primary)] truncate">
- {conv.title}
- </div>
- <div className="text-[10px] text-[var(--color-text-tertiary)]">
- {formatRelativeTime(conv.updated_at)} ·{" "}
- {conv.message_count} msgs
- </div>
- </div>
- <button
- onClick={(e) => {
- e.stopPropagation();
- handleDelete(conv.id);
- }}
- className="opacity-0 group-hover:opacity-100 p-1 text-[var(--color-text-tertiary)] hover:text-red-400 transition-all"
- >
- <Trash2 className="h-3 w-3" />
- </button>
- </div>
- ))}
- </div>
- </div>
- </>
- )}
- </div>
+ <ConversationHistoryShell
+ conversations={conversations}
+ isLoading={isLoading}
+ selectedId={activeConversationId}
+ onSelect={onSelect}
+ onDelete={handleDelete}
+ onNew={onNew}
+ />
);
}
+
+// Backwards-compatible name for existing import sites.
+export { ConversationHistoryWrapper as ConversationHistory };
diff --git a/packages/web/src/components/chat/model-selector.tsx b/packages/web/src/components/chat/model-selector.tsx
index 4001b313b..e38b1f5a6 100644
--- a/packages/web/src/components/chat/model-selector.tsx
+++ b/packages/web/src/components/chat/model-selector.tsx
@@ -1,9 +1,7 @@
"use client";
-import { useState } from "react";
-import { ChevronDown, Check, Key, X } from "lucide-react";
+import { ModelSelector as ModelSelectorShell } from "@repowise-dev/ui/chat/model-selector";
import { useProviders } from "@/lib/hooks/use-providers";
-import { cn } from "@/lib/utils/cn";
export function ModelSelector() {
const {
@@ -15,179 +13,14 @@ export function ModelSelector() {
saveKey,
} = useProviders();
- const [open, setOpen] = useState(false);
- const [addingKeyFor, setAddingKeyFor] = useState<string | null>(null);
- const [keyInput, setKeyInput] = useState("");
- const [saving, setSaving] = useState(false);
-
- const activeP = providers.find((p) => p.id === activeProvider);
- const label = activeP
- ? `${activeP.name} · ${activeModel ?? activeP.default_model}`
- : "Select model";
-
- async function handleSelect(providerId: string, model: string) {
- await activate(providerId, model);
- setOpen(false);
- }
-
- async function handleSaveKey(providerId: string) {
- if (!keyInput.trim()) return;
- setSaving(true);
- try {
- await saveKey(providerId, keyInput.trim());
- setAddingKeyFor(null);
- setKeyInput("");
- } catch {
- // error handled by SWR
- } finally {
- setSaving(false);
- }
- }
-
return (
- <div className="relative">
- <button
- onClick={() => setOpen(!open)}
- className={cn(
- "flex items-center gap-1.5 rounded-md px-2 py-1 text-xs",
- "text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)]",
- "hover:bg-[var(--color-bg-elevated)] transition-colors",
- "border border-[var(--color-border-default)]",
- )}
- >
- <span className="truncate max-w-[200px]">{isLoading ? "..." : label}</span>
- <ChevronDown className="h-3 w-3 shrink-0" />
- </button>
-
- {open && (
- <>
- {/* Backdrop */}
- <div
- className="fixed inset-0 z-[var(--z-dropdown)]"
- onClick={() => {
- setOpen(false);
- setAddingKeyFor(null);
- }}
- />
-
- {/* Popover */}
- <div className="absolute right-0 top-full mt-1 z-[calc(var(--z-dropdown)+1)] w-72 rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-overlay)] shadow-lg overflow-hidden">
- <div className="p-2 space-y-1 max-h-80 overflow-y-auto">
- {providers.map((provider) => {
- const isConfigured = provider.configured;
- return (
- <div key={provider.id}>
- {/* Provider header */}
- <div className="flex items-center justify-between px-2 py-1">
- <span
- className={cn(
- "text-xs font-medium",
- isConfigured
- ? "text-[var(--color-text-primary)]"
- : "text-[var(--color-text-tertiary)]",
- )}
- >
- {provider.name}
- </span>
- {!isConfigured && (
- <button
- onClick={(e) => {
- e.stopPropagation();
- setAddingKeyFor(
- addingKeyFor === provider.id
- ? null
- : provider.id,
- );
- setKeyInput("");
- }}
- className="text-[10px] text-[var(--color-accent-primary)] hover:underline flex items-center gap-0.5"
- >
- <Key className="h-3 w-3" />
- Add key
- </button>
- )}
- </div>
-
- {/* Add key form */}
- {addingKeyFor === provider.id && (
- <div className="px-2 pb-1.5 flex gap-1">
- <input
- type="password"
- value={keyInput}
- onChange={(e) => setKeyInput(e.target.value)}
- onKeyDown={(e) => {
- if (e.key === "Enter")
- handleSaveKey(provider.id);
- }}
- placeholder="API key..."
- className="flex-1 rounded border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-2 py-1 text-xs text-[var(--color-text-primary)] outline-none focus:ring-1 focus:ring-[var(--color-accent-primary)]"
- autoFocus
- />
- <button
- onClick={() => handleSaveKey(provider.id)}
- disabled={saving || !keyInput.trim()}
- className="rounded bg-[var(--color-accent-primary)] px-2 py-1 text-xs text-white disabled:opacity-50"
- >
- {saving ? "..." : "Save"}
- </button>
- <button
- onClick={() => {
- setAddingKeyFor(null);
- setKeyInput("");
- }}
- className="p-1 text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)]"
- >
- <X className="h-3 w-3" />
- </button>
- </div>
- )}
-
- {/* Models */}
- {isConfigured &&
- provider.models.map((model) => {
- const isActive =
- activeProvider === provider.id &&
- activeModel === model;
- return (
- <button
- key={model}
- onClick={() =>
- handleSelect(provider.id, model)
- }
- className={cn(
- "flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors",
- isActive
- ? "bg-[var(--color-accent-muted)] text-[var(--color-accent-primary)]"
- : "text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)]",
- )}
- >
- <span className="flex-1 text-left font-mono truncate">
- {model}
- </span>
- {isActive && (
- <Check className="h-3 w-3 shrink-0" />
- )}
- </button>
- );
- })}
-
- {/* Unconfigured models (greyed) */}
- {!isConfigured &&
- provider.models.map((model) => (
- <div
- key={model}
- className="px-3 py-1.5 text-xs font-mono text-[var(--color-text-tertiary)] opacity-50"
- >
- {model}
- </div>
- ))}
- </div>
- );
- })}
- </div>
- </div>
- </>
- )}
- </div>
+ <ModelSelectorShell
+ providers={providers}
+ activeProvider={activeProvider}
+ activeModel={activeModel}
+ isLoading={isLoading}
+ onActivate={(id, model) => activate(id, model)}
+ onSaveKey={saveKey}
+ />
);
}
diff --git a/packages/web/src/components/coverage/freshness-table-wrapper.tsx b/packages/web/src/components/coverage/freshness-table-wrapper.tsx
new file mode 100644
index 000000000..44c2280bc
--- /dev/null
+++ b/packages/web/src/components/coverage/freshness-table-wrapper.tsx
@@ -0,0 +1,16 @@
+"use client";
+
+import {
+ FreshnessTable,
+ type FreshnessTableProps,
+} from "@repowise-dev/ui/coverage/freshness-table";
+import { regeneratePage } from "@/lib/api/pages";
+
+export function FreshnessTableWithRegenerate({
+ pages,
+}: Pick<FreshnessTableProps, "pages">) {
+ const handleRegenerate = async (pageId: string) => {
+ await regeneratePage(pageId);
+ };
+ return <FreshnessTable pages={pages} onRegenerate={handleRegenerate} />;
+}
diff --git a/packages/web/src/components/dashboard/active-job-banner-wrapper.tsx b/packages/web/src/components/dashboard/active-job-banner-wrapper.tsx
new file mode 100644
index 000000000..afa8b02f9
--- /dev/null
+++ b/packages/web/src/components/dashboard/active-job-banner-wrapper.tsx
@@ -0,0 +1,39 @@
+"use client";
+
+import useSWR from "swr";
+import { ActiveJobBanner as ActiveJobBannerShell } from "@repowise-dev/ui/dashboard/active-job-banner";
+import { listJobs } from "@/lib/api/jobs";
+import type { Job } from "@repowise-dev/types/jobs";
+
+interface Props {
+ repoId: string;
+}
+
+export function ActiveJobBannerWrapper({ repoId }: Props) {
+ const { data: jobs } = useSWR<Job[]>(
+ `/api/jobs?repo_id=${repoId}&limit=1`,
+ () => listJobs({ repo_id: repoId, limit: 1 }),
+ {
+ refreshInterval: (data) => {
+ const j = data?.[0];
+ if (j?.status === "running") return 5000;
+ return 30000;
+ },
+ },
+ );
+
+ const job = jobs?.[0] ?? null;
+ if (!job) return null;
+
+ // Drop completed/failed banners after a 60s freshness window — matches the
+ // pre-extraction inline behaviour.
+ if (job.status !== "running" && job.status !== "completed" && job.status !== "failed") {
+ return null;
+ }
+ if (job.status !== "running") {
+ const finishedAt = job.finished_at ? new Date(job.finished_at).getTime() : 0;
+ if (Date.now() - finishedAt > 60_000) return null;
+ }
+
+ return <ActiveJobBannerShell job={job} detailsHref={`/repos/${repoId}/overview`} />;
+}
diff --git a/packages/web/src/components/dashboard/community-summary-grid-wrapper.tsx b/packages/web/src/components/dashboard/community-summary-grid-wrapper.tsx
new file mode 100644
index 000000000..e751051a9
--- /dev/null
+++ b/packages/web/src/components/dashboard/community-summary-grid-wrapper.tsx
@@ -0,0 +1,35 @@
+"use client";
+
+import { useState } from "react";
+import { CommunitySummaryGrid as CommunitySummaryGridShell } from "@repowise-dev/ui/dashboard/community-summary-grid";
+import { useCommunityDetail } from "@/lib/hooks/use-graph";
+import type { CommunityDetail, CommunitySummaryItem } from "@repowise-dev/types/graph";
+
+interface Props {
+ communities: CommunitySummaryItem[];
+ repoId: string;
+}
+
+/**
+ * Lifts `useCommunityDetail` into the wrapper. The original component
+ * spawned the hook inside an inner `CommunityDetail` subcomponent which
+ * was rendered (and unmounted) per-row; pulling the active id up here
+ * keeps a single SWR subscription per click and lets the shell stay
+ * presentational.
+ */
+export function CommunitySummaryGridWrapper({ communities, repoId }: Props) {
+ const [activeId, setActiveId] = useState<number | null>(null);
+ const { community, isLoading } = useCommunityDetail(repoId, activeId);
+
+ const details: Record<number, CommunityDetail | null> =
+ activeId != null && community ? { [activeId]: community } : {};
+
+ return (
+ <CommunitySummaryGridShell
+ communities={communities}
+ details={details}
+ loadingDetailId={isLoading ? activeId : null}
+ onExpand={(id) => setActiveId(id)}
+ />
+ );
+}
diff --git a/packages/web/src/components/dashboard/community-summary-grid.tsx b/packages/web/src/components/dashboard/community-summary-grid.tsx
deleted file mode 100644
index 6dabefb80..000000000
--- a/packages/web/src/components/dashboard/community-summary-grid.tsx
+++ /dev/null
@@ -1,172 +0,0 @@
-"use client";
-
-import { useState } from "react";
-import { Network, ChevronRight, ChevronDown, ArrowRight, X } from "lucide-react";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
-import { Badge } from "@/components/ui/badge";
-import { ScrollArea } from "@/components/ui/scroll-area";
-import { Skeleton } from "@/components/ui/skeleton";
-import { truncatePath } from "@/lib/utils/format";
-import { useCommunityDetail } from "@/lib/hooks/use-graph";
-import { cn } from "@/lib/utils/cn";
-import type { CommunitySummaryItem } from "@/lib/api/types";
-
-const COMMUNITY_COLORS = [
- "bg-indigo-400", "bg-pink-400", "bg-emerald-400", "bg-amber-400",
- "bg-blue-400", "bg-purple-400", "bg-rose-400", "bg-teal-400",
- "bg-orange-400", "bg-cyan-400",
-];
-
-function CommunityDetail({ repoId, communityId, onClose }: { repoId: string; communityId: number; onClose: () => void }) {
- const { community, isLoading } = useCommunityDetail(repoId, communityId);
-
- if (isLoading) {
- return (
- <div className="p-4 space-y-2">
- <Skeleton className="h-4 w-32" />
- <Skeleton className="h-3 w-full" />
- <Skeleton className="h-3 w-3/4" />
- </div>
- );
- }
-
- if (!community) return null;
-
- return (
- <div className="border-t border-[var(--color-border-default)] bg-[var(--color-bg-elevated)]/50">
- <div className="flex items-center justify-between px-4 py-2 border-b border-[var(--color-border-default)]">
- <span className="text-xs font-medium text-[var(--color-text-primary)]">
- {community.label} &middot; {community.member_count} files &middot; cohesion {(community.cohesion * 100).toFixed(0)}%
- </span>
- <button onClick={onClose} className="text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)]">
- <X className="h-3.5 w-3.5" />
- </button>
- </div>
- <div className="grid grid-cols-1 md:grid-cols-2 gap-4 p-4">
- {/* Members */}
- <div>
- <p className="text-[10px] font-medium text-[var(--color-text-tertiary)] uppercase tracking-wider mb-2">
- Members ({community.member_count})
- </p>
- <ScrollArea className="max-h-[200px]">
- <div className="space-y-1">
- {community.members.slice(0, 20).map((m) => (
- <div key={m.path} className="flex items-center justify-between gap-2 py-0.5">
- <span className="text-[11px] font-mono text-[var(--color-text-secondary)] truncate" title={m.path}>
- {truncatePath(m.path)}
- </span>
- <div className="flex items-center gap-1 shrink-0">
- {m.is_entry_point && (
- <Badge variant="accent" className="text-[8px] h-3.5">EP</Badge>
- )}
- <span className="text-[9px] font-mono text-[var(--color-text-tertiary)] tabular-nums">
- {m.pagerank.toFixed(4)}
- </span>
- </div>
- </div>
- ))}
- {community.member_count > 20 && (
- <p className="text-[10px] text-[var(--color-text-tertiary)]">+{community.member_count - 20} more</p>
- )}
- </div>
- </ScrollArea>
- </div>
-
- {/* Neighbors */}
- {community.neighboring_communities.length > 0 && (
- <div>
- <p className="text-[10px] font-medium text-[var(--color-text-tertiary)] uppercase tracking-wider mb-2">
- Connected Communities
- </p>
- <div className="space-y-1.5">
- {community.neighboring_communities.map((n) => (
- <div key={n.community_id} className="flex items-center justify-between gap-2">
- <div className="flex items-center gap-1.5 min-w-0">
- <ArrowRight className="h-2.5 w-2.5 shrink-0 text-[var(--color-text-tertiary)]" />
- <span className="text-[11px] text-[var(--color-text-secondary)] truncate">{n.label}</span>
- </div>
- <Badge variant="outline" className="text-[9px] h-4 shrink-0">{n.cross_edge_count} edges</Badge>
- </div>
- ))}
- </div>
- </div>
- )}
- </div>
- </div>
- );
-}
-
-interface CommunitySummaryGridProps {
- communities: CommunitySummaryItem[];
- repoId: string;
-}
-
-export function CommunitySummaryGrid({ communities, repoId }: CommunitySummaryGridProps) {
- const [expandedId, setExpandedId] = useState<number | null>(null);
-
- if (communities.length === 0) return null;
-
- return (
- <Card>
- <CardHeader className="pb-2">
- <CardTitle className="text-sm font-medium flex items-center gap-2">
- <Network className="h-4 w-4" />
- Architecture Communities ({communities.length})
- </CardTitle>
- </CardHeader>
- <CardContent className="p-0">
- {/* Community list */}
- <div className="divide-y divide-[var(--color-border-default)]">
- {communities.slice(0, 12).map((c, i) => (
- <div key={c.community_id}>
- <button
- onClick={() => setExpandedId(expandedId === c.community_id ? null : c.community_id)}
- className={cn(
- "flex items-center gap-3 w-full px-4 py-2.5 text-left hover:bg-[var(--color-bg-elevated)] transition-colors",
- expandedId === c.community_id && "bg-[var(--color-bg-elevated)]",
- )}
- >
- {/* Color dot */}
- <span className={cn("w-2.5 h-2.5 rounded-full shrink-0", COMMUNITY_COLORS[i % COMMUNITY_COLORS.length])} />
-
- {/* Label */}
- <span className="text-xs font-medium text-[var(--color-text-primary)] truncate min-w-0 flex-1">
- {c.label}
- </span>
-
- {/* File count */}
- <span className="text-[10px] text-[var(--color-text-tertiary)] tabular-nums shrink-0">
- {c.member_count} files
- </span>
-
- {/* Cohesion mini bar */}
- <div className="w-12 h-1.5 rounded-full bg-[var(--color-bg-elevated)] overflow-hidden shrink-0">
- <div
- className="h-full rounded-full bg-[var(--color-accent)]"
- style={{ width: `${Math.round(c.cohesion * 100)}%` }}
- />
- </div>
-
- {/* Expand arrow */}
- {expandedId === c.community_id ? (
- <ChevronDown className="h-3 w-3 shrink-0 text-[var(--color-text-tertiary)]" />
- ) : (
- <ChevronRight className="h-3 w-3 shrink-0 text-[var(--color-text-tertiary)]" />
- )}
- </button>
-
- {/* Detail panel */}
- {expandedId === c.community_id && (
- <CommunityDetail
- repoId={repoId}
- communityId={c.community_id}
- onClose={() => setExpandedId(null)}
- />
- )}
- </div>
- ))}
- </div>
- </CardContent>
- </Card>
- );
-}
diff --git a/packages/web/src/components/dashboard/quick-actions-wrapper.tsx b/packages/web/src/components/dashboard/quick-actions-wrapper.tsx
new file mode 100644
index 000000000..543c847d3
--- /dev/null
+++ b/packages/web/src/components/dashboard/quick-actions-wrapper.tsx
@@ -0,0 +1,110 @@
+"use client";
+
+import { useEffect, useState } from "react";
+import { toast } from "sonner";
+import {
+ QuickActions as QuickActionsShell,
+ type QuickActionKey,
+} from "@repowise-dev/ui/dashboard/quick-actions";
+import { syncRepo, fullResyncRepo } from "@/lib/api/repos";
+import { listJobs } from "@/lib/api/jobs";
+import { analyzeDeadCode } from "@/lib/api/dead-code";
+import { GenerationProgressWrapper } from "@/components/jobs/generation-progress-wrapper";
+
+interface Props {
+ repoId: string;
+ repoName?: string;
+ pageCount?: number;
+ modelName?: string;
+ lastSyncAt?: string | null;
+ lastResyncAt?: string | null;
+}
+
+export function QuickActionsWrapper({
+ repoId,
+ repoName,
+ pageCount = 0,
+ modelName = "",
+ lastSyncAt,
+ lastResyncAt,
+}: Props) {
+ const [activeJobId, setActiveJobId] = useState<string | null>(null);
+
+ // Hydrate from any in-flight job so refreshes don't lose progress visibility.
+ useEffect(() => {
+ let cancelled = false;
+ (async () => {
+ try {
+ const [running, pending] = await Promise.all([
+ listJobs({ repo_id: repoId, status: "running", limit: 1 }),
+ listJobs({ repo_id: repoId, status: "pending", limit: 1 }),
+ ]);
+ if (cancelled) return;
+ const inflight = running[0] ?? pending[0];
+ if (inflight) setActiveJobId(inflight.id);
+ } catch {
+ // best-effort
+ }
+ })();
+ return () => {
+ cancelled = true;
+ };
+ }, [repoId]);
+
+ async function handleAction(key: QuickActionKey) {
+ try {
+ if (key === "sync") {
+ const job = await syncRepo(repoId);
+ setActiveJobId(job.id);
+ toast.info(`Sync started${repoName ? ` — ${repoName}` : ""}`);
+ } else if (key === "resync") {
+ const job = await fullResyncRepo(repoId);
+ setActiveJobId(job.id);
+ toast.info(`Full resync started${repoName ? ` — ${repoName}` : ""}`);
+ } else if (key === "dead-code") {
+ await analyzeDeadCode(repoId);
+ toast.info("Dead code analysis started");
+ }
+ } catch (e) {
+ const msg = e instanceof Error ? e.message : "Unknown error";
+ if (/already in progress/i.test(msg)) {
+ try {
+ const [running, pending] = await Promise.all([
+ listJobs({ repo_id: repoId, status: "running", limit: 1 }),
+ listJobs({ repo_id: repoId, status: "pending", limit: 1 }),
+ ]);
+ const inflight = running[0] ?? pending[0];
+ if (inflight) {
+ setActiveJobId(inflight.id);
+ toast.info(
+ "Showing progress for the in-flight job. Cancel it from the panel to start a new one.",
+ );
+ return;
+ }
+ } catch {
+ // fall through
+ }
+ }
+ toast.error(`${key} failed`, { description: msg });
+ }
+ }
+
+ const activeSlot = activeJobId ? (
+ <GenerationProgressWrapper
+ jobId={activeJobId}
+ repoName={repoName}
+ onDone={() => setActiveJobId(null)}
+ />
+ ) : null;
+
+ return (
+ <QuickActionsShell
+ onAction={handleAction}
+ lastSyncAt={lastSyncAt}
+ lastResyncAt={lastResyncAt}
+ pageCount={pageCount}
+ modelName={modelName}
+ activeJobSlot={activeSlot}
+ />
+ );
+}
diff --git a/packages/web/src/components/dashboard/quick-actions.tsx b/packages/web/src/components/dashboard/quick-actions.tsx
deleted file mode 100644
index 6c060927d..000000000
--- a/packages/web/src/components/dashboard/quick-actions.tsx
+++ /dev/null
@@ -1,347 +0,0 @@
-"use client";
-
-import { useEffect, useState } from "react";
-import { toast } from "sonner";
-import { RefreshCw, Trash2, AlertTriangle, Zap } from "lucide-react";
-import { Button } from "@/components/ui/button";
-import {
- Dialog,
- DialogContent,
- DialogHeader,
- DialogTitle,
- DialogDescription,
- DialogFooter,
-} from "@/components/ui/dialog";
-import { syncRepo, fullResyncRepo } from "@/lib/api/repos";
-import { listJobs } from "@/lib/api/jobs";
-import { analyzeDeadCode } from "@/lib/api/dead-code";
-import { GenerationProgress } from "@/components/jobs/generation-progress";
-import { formatNumber, formatCost, formatRelativeTime } from "@/lib/utils/format";
-
-// Weighted average per-page token heuristics from cost_estimator.py _TOKEN_HEURISTICS
-const AVG_INPUT_TOKENS_PER_PAGE = 3500;
-const AVG_OUTPUT_TOKENS_PER_PAGE = 2200;
-
-// Pricing per 1K tokens (input, output) — mirrors cost_estimator.py _COST_TABLE exactly
-const COST_TABLE_EXACT: Record<string, [number, number]> = {
- "gpt-5.4": [0.0025, 0.015],
- "gpt-5.4-mini": [0.00075, 0.0045],
- "gpt-5.4-nano": [0.0002, 0.00125],
- "gemini-3.1-pro-preview": [0.002, 0.012],
- "gemini-3-flash-preview": [0.0005, 0.003],
- "gemini-3.1-flash-lite-preview": [0.00025, 0.0015],
- "claude-opus-4-6": [0.005, 0.025],
- "claude-sonnet-4-6": [0.003, 0.015],
- "claude-haiku-4-5": [0.001, 0.005],
-};
-
-// Prefix fallbacks — longest match wins (same as cost_estimator.py)
-const COST_TABLE_PREFIX: [string, [number, number]][] = [
- ["gpt-5.4-nano", [0.0002, 0.00125]],
- ["gpt-5.4-mini", [0.00075, 0.0045]],
- ["gpt-5.4", [0.0025, 0.015]],
- ["claude-opus", [0.005, 0.025]],
- ["claude-sonnet", [0.003, 0.015]],
- ["claude-haiku", [0.001, 0.005]],
- ["claude", [0.003, 0.015]],
- ["gemini", [0.00025, 0.0015]],
- ["llama", [0, 0]],
- ["mock", [0, 0]],
-];
-
-function lookupCost(modelName: string): [number, number] {
- const lower = modelName.toLowerCase();
- if (lower in COST_TABLE_EXACT) return COST_TABLE_EXACT[lower];
- let bestLen = 0;
- let bestRates: [number, number] = [0, 0];
- for (const [prefix, rates] of COST_TABLE_PREFIX) {
- if (lower.startsWith(prefix) && prefix.length > bestLen) {
- bestLen = prefix.length;
- bestRates = rates;
- }
- }
- return bestRates;
-}
-
-function estimateCost(pageCount: number, modelName: string): { inputTokens: number; outputTokens: number; cost: number } {
- const inputTokens = pageCount * AVG_INPUT_TOKENS_PER_PAGE;
- const outputTokens = pageCount * AVG_OUTPUT_TOKENS_PER_PAGE;
- const [inputRate, outputRate] = lookupCost(modelName);
- // cost_estimator.py: (total_input / 1000) * input_rate + (total_output / 1000) * output_rate
- const cost = (inputTokens / 1000) * inputRate + (outputTokens / 1000) * outputRate;
- return { inputTokens, outputTokens, cost };
-}
-
-type ActionKey = "sync" | "resync" | "dead-code";
-
-interface ActionDef {
- key: ActionKey;
- label: string;
- description: string;
- icon: typeof RefreshCw;
- destructive: boolean;
- needsConfirm: boolean;
- confirmTitle: string;
- confirmDescription: string;
-}
-
-const ACTIONS: ActionDef[] = [
- {
- key: "sync",
- label: "Sync",
- description: "Update everything — only affected pages regenerated",
- icon: Zap,
- destructive: false,
- needsConfirm: true,
- confirmTitle: "Sync Repository",
- confirmDescription: "Re-indexes the dependency graph, git metadata, dead code, and decisions. Only wiki pages affected by recent changes are regenerated (minimal LLM cost).",
- },
- {
- key: "resync",
- label: "Full Re-index",
- description: "Regenerate all docs from scratch",
- icon: RefreshCw,
- destructive: true,
- needsConfirm: true,
- confirmTitle: "Full Re-index",
- confirmDescription: "This regenerates every page from scratch. All existing pages will be overwritten.",
- },
- {
- key: "dead-code",
- label: "Dead Code Scan",
- description: "Analyze for unused exports and files",
- icon: Trash2,
- destructive: false,
- needsConfirm: false,
- confirmTitle: "",
- confirmDescription: "",
- },
-];
-
-interface QuickActionsProps {
- repoId: string;
- repoName?: string;
- pageCount?: number;
- modelName?: string;
- lastSyncAt?: string | null;
- lastResyncAt?: string | null;
-}
-
-export function QuickActions({ repoId, repoName, pageCount = 0, modelName = "", lastSyncAt, lastResyncAt }: QuickActionsProps) {
- const [loading, setLoading] = useState<ActionKey | null>(null);
- const [pendingAction, setPendingAction] = useState<ActionDef | null>(null);
- const [activeJobId, setActiveJobId] = useState<string | null>(null);
-
- // On mount, hydrate from any in-flight job so a page refresh shows live
- // progress instead of pretending nothing is happening. Without this, a
- // job stuck in 'pending' is invisible from the UI even though the
- // sync-blocked guard is still firing on the server.
- useEffect(() => {
- let cancelled = false;
- (async () => {
- try {
- const [running, pending] = await Promise.all([
- listJobs({ repo_id: repoId, status: "running", limit: 1 }),
- listJobs({ repo_id: repoId, status: "pending", limit: 1 }),
- ]);
- if (cancelled) return;
- const inflight = running[0] ?? pending[0];
- if (inflight) setActiveJobId(inflight.id);
- } catch {
- // best-effort hydration — don't block the UI
- }
- })();
- return () => {
- cancelled = true;
- };
- }, [repoId]);
-
- // Sync regenerates ~10-15% of pages (only affected by changes).
- // Full resync regenerates all pages.
- const estimate = pageCount > 0 && pendingAction?.key !== "dead-code"
- ? estimateCost(
- pendingAction?.key === "sync" ? Math.max(1, Math.ceil(pageCount * 0.1)) : pageCount,
- modelName
- )
- : null;
-
- async function executeAction(action: ActionDef) {
- setLoading(action.key);
- setPendingAction(null);
- try {
- if (action.key === "sync") {
- const job = await syncRepo(repoId);
- setActiveJobId(job.id);
- toast.info(`Sync started${repoName ? ` — ${repoName}` : ""}`);
- } else if (action.key === "resync") {
- const job = await fullResyncRepo(repoId);
- setActiveJobId(job.id);
- toast.info(`Full resync started${repoName ? ` — ${repoName}` : ""}`);
- } else if (action.key === "dead-code") {
- await analyzeDeadCode(repoId);
- toast.info("Dead code analysis started");
- }
- } catch (e) {
- const msg = e instanceof Error ? e.message : "Unknown error";
- // If the server already has an in-flight job, surface that one's
- // progress instead of just showing an opaque 409.
- if (/already in progress/i.test(msg)) {
- try {
- const [running, pending] = await Promise.all([
- listJobs({ repo_id: repoId, status: "running", limit: 1 }),
- listJobs({ repo_id: repoId, status: "pending", limit: 1 }),
- ]);
- const inflight = running[0] ?? pending[0];
- if (inflight) {
- setActiveJobId(inflight.id);
- toast.info("Showing progress for the in-flight job. Cancel it from the panel to start a new one.");
- return;
- }
- } catch {
- // fall through to error toast
- }
- }
- toast.error(`${action.label} failed`, { description: msg });
- } finally {
- setLoading(null);
- }
- }
-
- function handleClick(action: ActionDef) {
- if (action.needsConfirm) {
- setPendingAction(action);
- } else {
- executeAction(action);
- }
- }
-
- return (
- <>
- {/* Active job progress */}
- {activeJobId && (
- <div className="mb-2">
- <GenerationProgress
- jobId={activeJobId}
- repoName={repoName}
- onDone={() => setActiveJobId(null)}
- />
- </div>
- )}
-
- {/* Action buttons + timestamps */}
- {!activeJobId && (
- <div className="space-y-1.5">
- <div className="flex flex-wrap gap-2">
- {ACTIONS.map((action) => {
- const Icon = action.icon;
- const isLoading = loading === action.key;
- return (
- <Button
- key={action.key}
- variant="outline"
- size="sm"
- className="h-8 gap-1.5 text-xs"
- disabled={loading !== null}
- onClick={() => handleClick(action)}
- >
- <Icon className={`h-3.5 w-3.5 ${isLoading ? "animate-spin" : ""}`} />
- {action.label}
- </Button>
- );
- })}
- </div>
- <div className="flex flex-wrap gap-x-4 gap-y-0.5">
- <span className="text-[11px] text-[var(--color-text-tertiary)]">
- Last synced{" "}
- <span className="text-[var(--color-text-secondary)]">
- {lastSyncAt ? formatRelativeTime(lastSyncAt) : "never"}
- </span>
- </span>
- <span className="text-[11px] text-[var(--color-text-tertiary)]">
- Last re-indexed{" "}
- <span className="text-[var(--color-text-secondary)]">
- {lastResyncAt ? formatRelativeTime(lastResyncAt) : "never"}
- </span>
- </span>
- </div>
- </div>
- )}
-
- {/* Confirmation dialog */}
- <Dialog open={pendingAction !== null} onOpenChange={(open) => !open && setPendingAction(null)}>
- {pendingAction && (
- <DialogContent className="sm:max-w-sm">
- <DialogHeader>
- <DialogTitle className="flex items-center gap-2">
- {pendingAction.destructive && (
- <AlertTriangle className="h-4 w-4 text-[var(--color-warning)]" />
- )}
- {pendingAction.confirmTitle}
- </DialogTitle>
- <DialogDescription>
- {pendingAction.confirmDescription}
- </DialogDescription>
- </DialogHeader>
-
- {/* Cost estimate */}
- {estimate && estimate.cost > 0 && (
- <div className="rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-inset)] p-3 space-y-2">
- <p className="text-xs font-medium text-[var(--color-text-secondary)] uppercase tracking-wider">
- Estimated Cost
- </p>
- <div className="grid grid-cols-3 gap-2 text-center">
- <div>
- <p className="text-sm font-semibold text-[var(--color-text-primary)] tabular-nums">
- {formatNumber(pendingAction.key === "sync" ? Math.max(1, Math.ceil(pageCount * 0.1)) : pageCount)}
- </p>
- <p className="text-[10px] text-[var(--color-text-tertiary)]">pages</p>
- </div>
- <div>
- <p className="text-sm font-semibold text-[var(--color-text-primary)] tabular-nums">
- {formatNumber(estimate.inputTokens + estimate.outputTokens)}
- </p>
- <p className="text-[10px] text-[var(--color-text-tertiary)]">tokens</p>
- </div>
- <div>
- <p className="text-sm font-semibold text-[var(--color-accent-primary)] tabular-nums">
- ~{formatCost(estimate.cost)}
- </p>
- <p className="text-[10px] text-[var(--color-text-tertiary)]">
- {modelName || "est."}
- </p>
- </div>
- </div>
- {estimate.cost < 0.01 && (
- <p className="text-[10px] text-[var(--color-text-tertiary)] text-center">
- Free or near-free with this model
- </p>
- )}
- </div>
- )}
-
- {estimate && estimate.cost === 0 && (
- <div className="rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-inset)] p-3">
- <p className="text-xs text-[var(--color-success)] text-center">
- No API cost — running locally via Ollama
- </p>
- </div>
- )}
-
- <DialogFooter>
- <Button variant="ghost" size="sm" onClick={() => setPendingAction(null)}>
- Cancel
- </Button>
- <Button
- variant={pendingAction.destructive ? "destructive" : "default"}
- size="sm"
- onClick={() => executeAction(pendingAction)}
- >
- {pendingAction.label}
- </Button>
- </DialogFooter>
- </DialogContent>
- )}
- </Dialog>
- </>
- );
-}
diff --git a/packages/web/src/components/dead-code/finding-row.tsx b/packages/web/src/components/dead-code/finding-row.tsx
index b66d61985..204b29039 100644
--- a/packages/web/src/components/dead-code/finding-row.tsx
+++ b/packages/web/src/components/dead-code/finding-row.tsx
@@ -2,10 +2,10 @@
import { useState } from "react";
import { toast } from "sonner";
-import { Button } from "@/components/ui/button";
-import { Badge } from "@/components/ui/badge";
-import { ConfirmDialog } from "@/components/ui/confirm-dialog";
-import { formatConfidence } from "@/lib/utils/format";
+import { Button } from "@repowise-dev/ui/ui/button";
+import { Badge } from "@repowise-dev/ui/ui/badge";
+import { ConfirmDialog } from "@repowise-dev/ui/ui/confirm-dialog";
+import { formatConfidence } from "@repowise-dev/ui/lib/format";
import { patchDeadCodeFinding } from "@/lib/api/dead-code";
import { cn } from "@/lib/utils/cn";
import type { DeadCodeFindingResponse } from "@/lib/api/types";
@@ -123,7 +123,7 @@ export function FindingRow({ finding, selected, onToggle, onUpdate }: FindingRow
</span>
</td>
<td className="px-4 py-2.5 text-xs text-[var(--color-text-secondary)] hidden md:table-cell">
- {finding.primary_owner ?? "—"}
+ {finding.primary_owner ?? "—"}
</td>
<td className="px-4 py-2.5 text-xs text-[var(--color-text-tertiary)] tabular-nums hidden md:table-cell">
{finding.lines}
diff --git a/packages/web/src/components/dead-code/findings-table.tsx b/packages/web/src/components/dead-code/findings-table.tsx
index 1132e30c5..4161608d2 100644
--- a/packages/web/src/components/dead-code/findings-table.tsx
+++ b/packages/web/src/components/dead-code/findings-table.tsx
@@ -3,11 +3,11 @@
import { useState, useEffect } from "react";
import useSWR from "swr";
import { toast } from "sonner";
-import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs";
-import { Button } from "@/components/ui/button";
-import { Skeleton } from "@/components/ui/skeleton";
-import { ConfirmDialog } from "@/components/ui/confirm-dialog";
-import { EmptyState } from "@/components/shared/empty-state";
+import { Tabs, TabsList, TabsTrigger, TabsContent } from "@repowise-dev/ui/ui/tabs";
+import { Button } from "@repowise-dev/ui/ui/button";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
+import { ConfirmDialog } from "@repowise-dev/ui/ui/confirm-dialog";
+import { EmptyState } from "@repowise-dev/ui/shared/empty-state";
import { FindingRow } from "./finding-row";
import { listDeadCode, patchDeadCodeFinding } from "@/lib/api/dead-code";
import type { DeadCodeFindingResponse } from "@/lib/api/types";
@@ -149,7 +149,7 @@ export function FindingsTable({ repoId }: FindingsTableProps) {
onClick={() => setBulkConfirmOpen(true)}
className="text-green-500 border-green-500/30 hover:bg-green-500/10"
>
- {bulkPending ? "Resolving…" : `Resolve ${selected.size} selected`}
+ {bulkPending ? "Resolving…" : `Resolve ${selected.size} selected`}
</Button>
)}
</div>
diff --git a/packages/web/src/components/decisions/decision-detail.tsx b/packages/web/src/components/decisions/decision-detail.tsx
index 90ded5380..320a5dcc2 100644
--- a/packages/web/src/components/decisions/decision-detail.tsx
+++ b/packages/web/src/components/decisions/decision-detail.tsx
@@ -6,8 +6,8 @@ import remarkGfm from "remark-gfm";
import { toast } from "sonner";
import Link from "next/link";
import { ChevronLeft } from "lucide-react";
-import { Badge } from "@/components/ui/badge";
-import { ConfirmDialog } from "@/components/ui/confirm-dialog";
+import { Badge } from "@repowise-dev/ui/ui/badge";
+import { ConfirmDialog } from "@repowise-dev/ui/ui/confirm-dialog";
import { patchDecision } from "@/lib/api/decisions";
import type { DecisionRecordResponse } from "@/lib/api/types";
@@ -119,7 +119,7 @@ export function DecisionDetail({ decision, repoId }: DecisionDetailProps) {
{/* Stale warning */}
{decision.staleness_score > 0.5 && (
<div className="rounded-md border border-amber-400/30 bg-amber-50 px-4 py-3 text-sm text-amber-800 dark:bg-amber-900/20 dark:text-amber-200">
- This decision may be stale — affected files have changed significantly since it was recorded.
+ This decision may be stale — affected files have changed significantly since it was recorded.
</div>
)}
diff --git a/packages/web/src/components/decisions/decision-health-widget-wrapper.tsx b/packages/web/src/components/decisions/decision-health-widget-wrapper.tsx
new file mode 100644
index 000000000..15fc470a1
--- /dev/null
+++ b/packages/web/src/components/decisions/decision-health-widget-wrapper.tsx
@@ -0,0 +1,20 @@
+"use client";
+
+import useSWR from "swr";
+import { DecisionHealthWidget } from "@repowise-dev/ui/decisions/decision-health-widget";
+import { getDecisionHealth } from "@/lib/api/decisions";
+
+interface DecisionHealthWidgetWrapperProps {
+ repoId: string;
+}
+
+export function DecisionHealthWidgetWrapper({
+ repoId,
+}: DecisionHealthWidgetWrapperProps) {
+ const { data: health } = useSWR(
+ `/api/repos/${repoId}/decisions/health`,
+ () => getDecisionHealth(repoId),
+ );
+
+ return <DecisionHealthWidget health={health} />;
+}
diff --git a/packages/web/src/components/decisions/decision-health-widget.tsx b/packages/web/src/components/decisions/decision-health-widget.tsx
deleted file mode 100644
index bc633c617..000000000
--- a/packages/web/src/components/decisions/decision-health-widget.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-"use client";
-
-import useSWR from "swr";
-import { getDecisionHealth } from "@/lib/api/decisions";
-import { StatCard } from "@/components/shared/stat-card";
-
-interface DecisionHealthWidgetProps {
- repoId: string;
-}
-
-export function DecisionHealthWidget({ repoId }: DecisionHealthWidgetProps) {
- const { data: health } = useSWR(
- `/api/repos/${repoId}/decisions/health`,
- () => getDecisionHealth(repoId),
- );
-
- if (!health) return null;
-
- const { summary } = health;
-
- return (
- <div className="grid grid-cols-3 gap-3">
- <StatCard
- label="Active Decisions"
- value={summary.active}
- />
- <StatCard
- label="Proposed"
- value={summary.proposed}
- />
- <StatCard
- label="Stale"
- value={summary.stale}
- />
- </div>
- );
-}
diff --git a/packages/web/src/components/decisions/decisions-table-wrapper.tsx b/packages/web/src/components/decisions/decisions-table-wrapper.tsx
new file mode 100644
index 000000000..d9c0fcf97
--- /dev/null
+++ b/packages/web/src/components/decisions/decisions-table-wrapper.tsx
@@ -0,0 +1,49 @@
+"use client";
+
+import * as React from "react";
+import useSWR from "swr";
+import {
+ DecisionsTable,
+ type DecisionsTableFilters,
+} from "@repowise-dev/ui/decisions/decisions-table";
+import { listDecisions } from "@/lib/api/decisions";
+import type { DecisionRecord } from "@repowise-dev/types/decisions";
+
+interface DecisionsTableWrapperProps {
+ repoId: string;
+ initialData?: DecisionRecord[];
+}
+
+export function DecisionsTableWrapper({
+ repoId,
+ initialData,
+}: DecisionsTableWrapperProps) {
+ const [filters, setFilters] = React.useState<DecisionsTableFilters>({
+ status: "all",
+ source: "all",
+ });
+
+ const { data, error, mutate, isLoading } = useSWR(
+ [`/api/repos/${repoId}/decisions`, filters.status, filters.source],
+ () =>
+ listDecisions(repoId, {
+ status: filters.status !== "all" ? filters.status : undefined,
+ source: filters.source !== "all" ? filters.source : undefined,
+ include_proposed: true,
+ limit: 100,
+ }),
+ { fallbackData: initialData },
+ );
+
+ return (
+ <DecisionsTable
+ decisions={data}
+ filters={filters}
+ onFiltersChange={setFilters}
+ repoId={repoId}
+ error={error}
+ isLoading={isLoading}
+ onRetry={() => mutate()}
+ />
+ );
+}
diff --git a/packages/web/src/components/docs/docs-explorer.tsx b/packages/web/src/components/docs/docs-explorer.tsx
index 318c301fa..f2ecaa3a3 100644
--- a/packages/web/src/components/docs/docs-explorer.tsx
+++ b/packages/web/src/components/docs/docs-explorer.tsx
@@ -5,9 +5,9 @@ import { useSearchParams, useRouter } from "next/navigation";
import { BookOpen, PanelLeftClose, PanelLeft } from "lucide-react";
import { cn } from "@/lib/utils/cn";
import { usePages } from "@/lib/hooks/use-pages";
-import { DocsTree } from "./docs-tree";
+import { DocsTree } from "@repowise-dev/ui/docs/docs-tree";
import { DocsViewer } from "./docs-viewer";
-import { Skeleton } from "@/components/ui/skeleton";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
import type { PageResponse } from "@/lib/api/types";
interface DocsExplorerProps {
diff --git a/packages/web/src/components/docs/docs-viewer.tsx b/packages/web/src/components/docs/docs-viewer.tsx
index d9d54d965..426681592 100644
--- a/packages/web/src/components/docs/docs-viewer.tsx
+++ b/packages/web/src/components/docs/docs-viewer.tsx
@@ -20,14 +20,14 @@ import {
GitBranch,
} from "lucide-react";
import { cn } from "@/lib/utils/cn";
-import { WikiMarkdown } from "@/components/wiki/wiki-markdown";
-import { VersionHistory } from "@/components/wiki/version-history";
-import { ConfidenceBadge } from "@/components/wiki/confidence-badge";
-import { Button } from "@/components/ui/button";
-import { Badge } from "@/components/ui/badge";
-import { ScrollArea } from "@/components/ui/scroll-area";
-import { Skeleton } from "@/components/ui/skeleton";
-import { formatRelativeTime, formatTokens } from "@/lib/utils/format";
+import { WikiMarkdown } from "@repowise-dev/ui/wiki/wiki-markdown";
+import { VersionHistoryWrapper } from "@/components/wiki/version-history";
+import { ConfidenceBadge } from "@repowise-dev/ui/wiki/confidence-badge";
+import { Button } from "@repowise-dev/ui/ui/button";
+import { Badge } from "@repowise-dev/ui/ui/badge";
+import { ScrollArea } from "@repowise-dev/ui/ui/scroll-area";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
+import { formatRelativeTime, formatTokens } from "@repowise-dev/ui/lib/format";
import { downloadTextFile } from "@/lib/utils/download";
import { useGraphMetrics, useCallersCallees } from "@/lib/hooks/use-graph";
import type { PageResponse } from "@/lib/api/types";
@@ -290,7 +290,7 @@ export function DocsViewer({ page, repoId, isLoading }: DocsViewerProps) {
</span>
<span>v{page.version}</span>
<span className="font-mono">
- {formatTokens(page.input_tokens)} in · {formatTokens(page.output_tokens)} out
+ {formatTokens(page.input_tokens)} in · {formatTokens(page.output_tokens)} out
</span>
</div>
@@ -316,7 +316,7 @@ export function DocsViewer({ page, repoId, isLoading }: DocsViewerProps) {
{/* Version history */}
<div className="mt-8">
- <VersionHistory
+ <VersionHistoryWrapper
pageId={page.id}
currentVersion={page.version}
currentContent={page.content}
@@ -342,7 +342,7 @@ export function DocsViewer({ page, repoId, isLoading }: DocsViewerProps) {
</div>
</div>
- {/* Right sidebar — Graph Intelligence */}
+ {/* Right sidebar — Graph Intelligence */}
{hasTargetPath && sidebarOpen && (
<div className="hidden lg:flex flex-col border-l border-[var(--color-border-default)] bg-[var(--color-bg-surface)] shrink-0 w-[240px] overflow-auto">
<DocsSidebar repoId={repoId} targetPath={page.target_path} />
diff --git a/packages/web/src/components/graph/graph-community-panel.tsx b/packages/web/src/components/graph/graph-community-panel.tsx
index 260e74b7b..5a2318cf4 100644
--- a/packages/web/src/components/graph/graph-community-panel.tsx
+++ b/packages/web/src/components/graph/graph-community-panel.tsx
@@ -1,13 +1,10 @@
"use client";
-import { X, ArrowRight } from "lucide-react";
-import { Badge } from "@/components/ui/badge";
-import { ScrollArea } from "@/components/ui/scroll-area";
-import { Skeleton } from "@/components/ui/skeleton";
+import { GraphCommunityPanel as GraphCommunityPanelShell } from "@repowise-dev/ui/graph/graph-community-panel";
import { useCommunityDetail } from "@/lib/hooks/use-graph";
-import { truncatePath } from "@/lib/utils/format";
+import type { CommunityDetail } from "@repowise-dev/types/graph";
-interface GraphCommunityPanelProps {
+interface GraphCommunityPanelWrapperProps {
repoId: string;
communityId: number;
onClose: () => void;
@@ -17,118 +14,15 @@ export function GraphCommunityPanel({
repoId,
communityId,
onClose,
-}: GraphCommunityPanelProps) {
+}: GraphCommunityPanelWrapperProps) {
const { community, isLoading } = useCommunityDetail(repoId, communityId);
return (
- <div className="absolute right-0 top-0 bottom-0 w-full sm:w-[360px] border-l border-[var(--color-border-default)] bg-[var(--color-bg-surface)] z-10 flex flex-col shadow-lg shadow-black/20">
- {/* Header */}
- <div className="flex items-center justify-between px-4 py-3 border-b border-[var(--color-border-default)]">
- <div className="min-w-0">
- <p className="text-sm font-medium text-[var(--color-text-primary)] truncate">
- {community?.label ?? `Community ${communityId}`}
- </p>
- {community && (
- <p className="text-[10px] text-[var(--color-text-tertiary)]">
- {community.member_count} files &middot; cohesion {(community.cohesion * 100).toFixed(0)}%
- </p>
- )}
- </div>
- <button
- onClick={onClose}
- className="p-1 rounded hover:bg-[var(--color-bg-elevated)] transition-colors"
- >
- <X className="h-4 w-4 text-[var(--color-text-tertiary)]" />
- </button>
- </div>
-
- {/* Content */}
- {isLoading ? (
- <div className="p-4 space-y-2">
- <Skeleton className="h-4 w-full" />
- <Skeleton className="h-4 w-3/4" />
- <Skeleton className="h-4 w-full" />
- <Skeleton className="h-4 w-2/3" />
- </div>
- ) : community ? (
- <ScrollArea className="flex-1">
- <div className="p-4 space-y-4">
- {/* Members */}
- <div>
- <p className="text-[11px] font-medium text-[var(--color-text-tertiary)] uppercase tracking-wider mb-2">
- Members ({community.member_count})
- </p>
- <div className="space-y-1">
- {community.members.map((m) => {
- const maxPr = community.members[0]?.pagerank || 1;
- const barWidth = maxPr > 0 ? Math.round((m.pagerank / maxPr) * 100) : 0;
-
- return (
- <div
- key={m.path}
- className="flex items-center gap-2 py-1 px-1.5 rounded hover:bg-[var(--color-bg-elevated)] transition-colors"
- >
- <div className="min-w-0 flex-1">
- <p className="text-[11px] font-mono text-[var(--color-text-primary)] truncate" title={m.path}>
- {truncatePath(m.path)}
- </p>
- </div>
- {/* PageRank bar */}
- <div className="w-16 h-1.5 rounded-full bg-[var(--color-bg-elevated)] overflow-hidden shrink-0">
- <div
- className="h-full rounded-full bg-[var(--color-accent)]"
- style={{ width: `${barWidth}%` }}
- />
- </div>
- {m.is_entry_point && (
- <Badge variant="accent" className="text-[8px] h-3.5 shrink-0">
- EP
- </Badge>
- )}
- </div>
- );
- })}
- {community.truncated && (
- <p className="text-[10px] text-[var(--color-text-tertiary)] px-1.5 pt-1">
- +{community.member_count - community.members.length} more files
- </p>
- )}
- </div>
- </div>
-
- {/* Neighboring Communities */}
- {community.neighboring_communities.length > 0 && (
- <div>
- <p className="text-[11px] font-medium text-[var(--color-text-tertiary)] uppercase tracking-wider mb-2">
- Neighboring Communities
- </p>
- <div className="space-y-1">
- {community.neighboring_communities.map((n) => (
- <div
- key={n.community_id}
- className="flex items-center justify-between gap-2 py-1 px-1.5 rounded hover:bg-[var(--color-bg-elevated)] transition-colors"
- >
- <div className="flex items-center gap-1.5 min-w-0">
- <ArrowRight className="h-3 w-3 shrink-0 text-[var(--color-text-tertiary)]" />
- <span className="text-[11px] text-[var(--color-text-primary)] truncate">
- {n.label}
- </span>
- </div>
- <Badge variant="outline" className="text-[9px] shrink-0 h-4">
- {n.cross_edge_count} edges
- </Badge>
- </div>
- ))}
- </div>
- </div>
- )}
- </div>
- </ScrollArea>
- ) : (
- <div className="p-4">
- <p className="text-xs text-[var(--color-text-tertiary)]">Community not found</p>
- </div>
- )}
- </div>
+ <GraphCommunityPanelShell
+ communityId={communityId}
+ community={community as CommunityDetail | null | undefined}
+ isLoading={isLoading}
+ onClose={onClose}
+ />
);
}
diff --git a/packages/web/src/components/graph/graph-doc-panel.tsx b/packages/web/src/components/graph/graph-doc-panel.tsx
index c4153d162..961357c03 100644
--- a/packages/web/src/components/graph/graph-doc-panel.tsx
+++ b/packages/web/src/components/graph/graph-doc-panel.tsx
@@ -1,123 +1,30 @@
"use client";
-import { useEffect, useRef } from "react";
-import Link from "next/link";
-import {
- X,
- FileText,
- ExternalLink,
- Clock,
- Cpu,
- Loader2,
- AlertCircle,
-} from "lucide-react";
-import { cn } from "@/lib/utils/cn";
-import { Button } from "@/components/ui/button";
-import { Badge } from "@/components/ui/badge";
-import { ChatMarkdown } from "@/components/chat/chat-markdown";
-import { ConfidenceBadge } from "@/components/wiki/confidence-badge";
+import { GraphDocPanel as GraphDocPanelShell } from "@repowise-dev/ui/graph/graph-doc-panel";
import { usePage } from "@/lib/hooks/use-page";
-import { formatRelativeTime } from "@/lib/utils/format";
+import type { DocPage } from "@repowise-dev/types/docs";
-interface GraphDocPanelProps {
+interface GraphDocPanelWrapperProps {
repoId: string;
nodeId: string;
onClose: () => void;
}
-export function GraphDocPanel({ repoId, nodeId, onClose }: GraphDocPanelProps) {
+export function GraphDocPanel({ repoId, nodeId, onClose }: GraphDocPanelWrapperProps) {
const pageId = `file_page:${nodeId}`;
const { page, isLoading, error } = usePage(pageId);
- const scrollRef = useRef<HTMLDivElement>(null);
-
- useEffect(() => {
- scrollRef.current?.scrollTo(0, 0);
- }, [nodeId]);
return (
- <div className="absolute top-0 right-0 z-20 h-full w-[min(400px,calc(100vw-1.5rem))] flex flex-col bg-[var(--color-bg-surface)] border-l border-[var(--color-border-default)] shadow-2xl shadow-black/30">
- {/* Header */}
- <div className="flex items-center gap-2 px-4 py-3 border-b border-[var(--color-border-default)] shrink-0">
- <FileText className="h-4 w-4 text-[var(--color-accent-primary)] shrink-0" />
- <div className="flex-1 min-w-0">
- <p className="text-xs font-medium text-[var(--color-text-primary)] truncate">
- {page?.title ?? nodeId.split("/").pop()}
- </p>
- <p className="text-[10px] text-[var(--color-text-tertiary)] font-mono truncate">
- {nodeId}
- </p>
- </div>
- <div className="flex items-center gap-1.5 shrink-0">
- {page && (
- <Link
- href={`/repos/${repoId}/wiki/${encodeURIComponent(page.id)}`}
- className="text-[var(--color-text-tertiary)] hover:text-[var(--color-accent-primary)] transition-colors p-1"
- title="Open full page"
- >
- <ExternalLink className="h-3.5 w-3.5" />
- </Link>
- )}
- <Button
- size="sm"
- variant="ghost"
- onClick={onClose}
- className="h-6 w-6 p-0"
- >
- <X className="h-3.5 w-3.5" />
- </Button>
- </div>
- </div>
-
- {/* Meta bar */}
- {page && (
- <div className="flex items-center gap-2 px-4 py-2 border-b border-[var(--color-border-default)] shrink-0 flex-wrap">
- <ConfidenceBadge
- score={page.confidence}
- status={page.freshness_status}
- showScore
- />
- <Badge variant="outline" className="font-mono text-[10px]">
- <Cpu className="h-2.5 w-2.5 mr-0.5" />
- {page.model_name}
- </Badge>
- <span className="text-[10px] text-[var(--color-text-tertiary)] flex items-center gap-1 ml-auto">
- <Clock className="h-2.5 w-2.5" />
- {formatRelativeTime(page.updated_at)}
- </span>
- </div>
- )}
-
- {/* Content */}
- <div ref={scrollRef} className="flex-1 overflow-y-auto">
- {isLoading && (
- <div className="flex items-center justify-center h-32">
- <Loader2 className="h-5 w-5 animate-spin text-[var(--color-accent-primary)]" />
- </div>
- )}
-
- {error && !isLoading && (
- <div className="flex flex-col items-center justify-center h-32 gap-2 px-6 text-center">
- <AlertCircle className="h-5 w-5 text-[var(--color-text-tertiary)]" />
- <p className="text-xs text-[var(--color-text-tertiary)]">
- No documentation found for this file.
- </p>
- <Link
- href={`/repos/${repoId}/docs`}
- className="text-xs text-[var(--color-accent-primary)] hover:underline"
- >
- Browse all docs
- </Link>
- </div>
- )}
-
- {page && !isLoading && (
- <div className="px-4 py-4">
- <article className="prose-chat text-xs">
- <ChatMarkdown content={page.content} />
- </article>
- </div>
- )}
- </div>
- </div>
+ <GraphDocPanelShell
+ nodeId={nodeId}
+ page={page as DocPage | null | undefined}
+ isLoading={isLoading}
+ error={error}
+ fullPageHref={
+ page ? `/repos/${repoId}/wiki/${encodeURIComponent(page.id)}` : undefined
+ }
+ browseDocsHref={`/repos/${repoId}/docs`}
+ onClose={onClose}
+ />
);
}
diff --git a/packages/web/src/components/graph/graph-flow.tsx b/packages/web/src/components/graph/graph-flow.tsx
index 45512d305..35f348130 100644
--- a/packages/web/src/components/graph/graph-flow.tsx
+++ b/packages/web/src/components/graph/graph-flow.tsx
@@ -1,30 +1,10 @@
"use client";
+import { useState } from "react";
import {
- createContext,
- useCallback,
- useMemo,
- useState,
- useEffect,
- useRef,
-} from "react";
-import {
- ReactFlow,
- MiniMap,
- Controls,
- Background,
- BackgroundVariant,
- ReactFlowProvider,
- useReactFlow,
- type NodeMouseHandler,
- type Node,
-} from "@xyflow/react";
-import "@xyflow/react/dist/style.css";
-import { Loader2, ChevronRight, Home, Search } from "lucide-react";
-import Fuse from "fuse.js";
-import { Skeleton } from "@/components/ui/skeleton";
-import { Input } from "@/components/ui/input";
-import { EmptyState } from "@/components/shared/empty-state";
+ GraphFlow as GraphFlowShell,
+ type GraphFlowProps as GraphFlowShellProps,
+} from "@repowise-dev/ui/graph/graph-flow";
import {
useModuleGraph,
useGraph,
@@ -34,127 +14,37 @@ import {
useCommunities,
useExecutionFlows,
} from "@/lib/hooks/use-graph";
-import { ModuleGroupNode } from "./nodes/module-group-node";
-import { FileNode } from "./nodes/file-node";
-import { DependencyEdge } from "./edges/dependency-edge";
-import { groupNodesAsModules, type FileNodeData } from "./elk-layout";
-import { useModuleElkLayout, useFileElkLayout } from "./use-elk-layout";
import { PathFinderPanel } from "./path-finder-panel";
-import { GraphToolbar, type ColorMode, type ViewMode } from "./graph-toolbar";
-import { GraphLegend } from "./graph-legend";
import { GraphCommunityPanel } from "./graph-community-panel";
-import { GraphContextMenu } from "./graph-context-menu";
-import { GraphTooltip } from "./graph-tooltip";
-import { languageColor } from "@/lib/utils/confidence";
-
-// ---- Context ----
-
-export interface GraphContextValue {
- highlightedPath: Set<string>;
- highlightedEdges: Set<string>;
- colorMode: ColorMode;
- riskScores: Map<string, number>;
- hoveredNodeId: string | null;
- connectedNodeIds: Set<string>;
- connectedEdgeIds: Set<string>;
- selectedNodeId: string | null;
- searchDimmedNodes: Set<string> | null;
-}
-
-export const GraphContext = createContext<GraphContextValue>({
- highlightedPath: new Set(),
- highlightedEdges: new Set(),
- colorMode: "language",
- riskScores: new Map(),
- hoveredNodeId: null,
- connectedNodeIds: new Set(),
- connectedEdgeIds: new Set(),
- selectedNodeId: null,
- searchDimmedNodes: null,
-});
-
-// ---- Node/Edge types ----
+import type {
+ GraphExport,
+ ModuleGraph,
+ ExecutionFlows,
+ CommunitySummaryItem,
+} from "@repowise-dev/types/graph";
-const nodeTypes = {
- moduleGroup: ModuleGroupNode,
- fileNode: FileNode,
-};
-
-const edgeTypes = {
- dependency: DependencyEdge,
-};
-
-// ---- Inner component (needs ReactFlowProvider) ----
-
-interface GraphFlowInnerProps {
+export interface GraphFlowProps {
repoId: string;
- onNodeClick?: (nodeId: string, nodeType: string) => void | Promise<void>;
- onNodeViewDocs?: (nodeId: string) => void;
+ onNodeClick?: GraphFlowShellProps["onNodeClick"];
+ onNodeViewDocs?: GraphFlowShellProps["onNodeViewDocs"];
}
-function GraphFlowInner({
- repoId,
- onNodeClick,
- onNodeViewDocs,
-}: GraphFlowInnerProps) {
- const reactFlow = useReactFlow();
-
- // State — read initial colorMode from URL if present
- const [viewMode, setViewMode] = useState<ViewMode>("module");
- const [colorMode, setColorMode] = useState<ColorMode>(() => {
- if (typeof window !== "undefined") {
- const params = new URLSearchParams(window.location.search);
- const cm = params.get("colorMode");
- if (cm === "community" || cm === "language" || cm === "risk") return cm;
- }
- return "language";
- });
- const [hideTests, setHideTests] = useState(false);
- const [highlightedPath, setHighlightedPath] = useState<Set<string>>(new Set());
- const [highlightedEdges, setHighlightedEdges] = useState<Set<string>>(new Set());
- const [showPathFinder, setShowPathFinder] = useState(false);
-
- // Drill-down: stack of module prefixes. e.g. ["packages", "packages/web"]
+export function GraphFlow({ repoId, onNodeClick, onNodeViewDocs }: GraphFlowProps) {
+ // Track view-mode + drill-down so we can suppress fetches we don't need.
+ const [viewMode, setViewMode] = useState<
+ "module" | "full" | "architecture" | "dead" | "hotfiles"
+ >("module");
const [modulePath, setModulePath] = useState<string[]>([]);
- const currentPrefix = modulePath.length > 0 ? modulePath[modulePath.length - 1] : "";
const isDrilledDown = modulePath.length > 0;
-
- // Context menu
- const [ctxMenu, setCtxMenu] = useState<{
- x: number; y: number; nodeId: string; nodeType: string;
- } | null>(null);
-
- // Path finder pre-fill
- const [pathFrom, setPathFrom] = useState("");
- const [pathTo, setPathTo] = useState("");
-
- // Hover & selection tracking
- const [hoveredNodeId, setHoveredNodeId] = useState<string | null>(null);
- const [selectedNodeId, setSelectedNodeId] = useState<string | null>(null);
- const [selectedNodeScreen, setSelectedNodeScreen] = useState<{ x: number; y: number } | null>(null);
-
- // Graph search
- const [searchQuery, setSearchQuery] = useState("");
- const [searchDimmedNodes, setSearchDimmedNodes] = useState<Set<string> | null>(null);
-
- // Execution flow highlighting
- const [activeFlowIdx, setActiveFlowIdx] = useState<number | null>(null);
- const [showFlows, setShowFlows] = useState(false);
-
- // ---- Data fetching ----
const isModuleView = viewMode === "module";
- // Top-level module graph (only when at root of module view)
const { graph: moduleGraph, isLoading: moduleLoading } = useModuleGraph(
isModuleView && !isDrilledDown ? repoId : null,
);
-
- // Full graph — needed for drill-down and other views
const needsFullGraph = isDrilledDown || viewMode === "full";
const { graph: fullGraph, isLoading: fullLoading } = useGraph(
needsFullGraph ? repoId : null,
);
-
const { graph: archGraph, isLoading: archLoading } = useArchitectureGraph(
viewMode === "architecture" ? repoId : null,
);
@@ -164,641 +54,47 @@ function GraphFlowInner({
const { graph: hotGraph, isLoading: hotLoading } = useHotFilesGraph(
viewMode === "hotfiles" ? repoId : null,
);
-
- // Community data for legend labels and detail panel
const { communities } = useCommunities(repoId);
- const communityLabels = useMemo(() => {
- if (!communities) return undefined;
- const m = new Map<number, string>();
- for (const c of communities) m.set(c.community_id, c.label);
- return m;
- }, [communities]);
- const [communityPanelId, setCommunityPanelId] = useState<number | null>(null);
-
- // Execution flows data
- const { flows: executionFlowsData } = useExecutionFlows(repoId, { top_n: 10, max_depth: 6 });
-
- // ---- Derived data ----
-
- // When drilled down, re-group nodes as sub-modules at the current prefix
- const drillDownData = useMemo(() => {
- if (!isDrilledDown || !fullGraph) return null;
- return groupNodesAsModules(fullGraph.nodes, fullGraph.links, currentPrefix);
- }, [isDrilledDown, fullGraph, currentPrefix]);
-
- // File-level graph data — only for non-module views
- const fileGraphData = useMemo(() => {
- switch (viewMode) {
- case "full":
- return fullGraph ? { nodes: fullGraph.nodes, links: fullGraph.links } : undefined;
- case "architecture":
- return archGraph ? { nodes: archGraph.nodes, links: archGraph.links } : undefined;
- case "dead":
- return deadGraph ? { nodes: deadGraph.nodes, links: deadGraph.links } : undefined;
- case "hotfiles":
- return hotGraph ? { nodes: hotGraph.nodes, links: hotGraph.links } : undefined;
- default:
- return undefined;
- }
- }, [viewMode, fullGraph, archGraph, deadGraph, hotGraph]);
-
- // ---- Layout selection ----
- // Module view (including drill-down) always uses module layout
- // Other views use file layout
-
- const moduleLayoutInput = useMemo(() => {
- if (!isModuleView) return { nodes: undefined, edges: undefined, fileEntries: undefined };
- if (!isDrilledDown) {
- return { nodes: moduleGraph?.nodes, edges: moduleGraph?.edges, fileEntries: undefined };
- }
- return {
- nodes: drillDownData?.moduleNodes,
- edges: drillDownData?.moduleEdges,
- fileEntries: drillDownData?.fileEntries,
- };
- }, [isModuleView, isDrilledDown, moduleGraph, drillDownData]);
-
- const {
- nodes: moduleNodes,
- edges: moduleEdges,
- isLayouting: moduleLayouting,
- } = useModuleElkLayout(moduleLayoutInput.nodes, moduleLayoutInput.edges, moduleLayoutInput.fileEntries);
-
- const {
- nodes: fileNodes,
- edges: fileEdges,
- isLayouting: fileLayouting,
- } = useFileElkLayout(
- !isModuleView ? fileGraphData?.nodes : undefined,
- !isModuleView ? fileGraphData?.links : undefined,
- );
-
- const currentNodes = isModuleView ? moduleNodes : fileNodes;
- const currentEdges = isModuleView ? moduleEdges : fileEdges;
-
- // Filter hidden tests
- const filteredNodes = useMemo(() => {
- if (!hideTests) return currentNodes;
- return currentNodes.filter((n) => {
- if (n.type === "fileNode") {
- return !(n.data as { isTest?: boolean }).isTest;
- }
- return true;
- });
- }, [currentNodes, hideTests]);
-
- const isLoading =
- (isModuleView && !isDrilledDown) ? moduleLoading :
- isDrilledDown ? fullLoading :
- viewMode === "full" ? fullLoading :
- viewMode === "architecture" ? archLoading :
- viewMode === "dead" ? deadLoading :
- viewMode === "hotfiles" ? hotLoading : false;
- const isLayouting = isModuleView ? moduleLayouting : fileLayouting;
-
- // Compute connected nodes/edges for hover highlighting
- const { connectedNodeIds, connectedEdgeIds } = useMemo(() => {
- if (!hoveredNodeId) return { connectedNodeIds: new Set<string>(), connectedEdgeIds: new Set<string>() };
- const nodeIds = new Set<string>([hoveredNodeId]);
- const edgeIds = new Set<string>();
- for (const edge of currentEdges) {
- if (edge.source === hoveredNodeId || edge.target === hoveredNodeId) {
- edgeIds.add(edge.id);
- nodeIds.add(edge.source);
- nodeIds.add(edge.target);
- }
- }
- return { connectedNodeIds: nodeIds, connectedEdgeIds: edgeIds };
- }, [hoveredNodeId, currentEdges]);
-
- // Fuse search index over visible nodes
- const fuseIndex = useMemo(() => {
- const items = filteredNodes.map((n) => ({ id: n.id, label: (n.data as { label?: string }).label ?? n.id }));
- return new Fuse(items, { keys: ["id", "label"], threshold: 0.4 });
- }, [filteredNodes]);
-
- // Search: compute dimmed set when query is active
- useEffect(() => {
- if (!searchQuery || searchQuery.length < 2) {
- setSearchDimmedNodes(null);
- return;
- }
- const results = fuseIndex.search(searchQuery);
- const matchIds = new Set(results.map((r) => r.item.id));
- const dimmed = new Set<string>();
- for (const n of filteredNodes) {
- if (!matchIds.has(n.id)) dimmed.add(n.id);
- }
- setSearchDimmedNodes(dimmed);
-
- // Zoom to matched nodes
- if (results.length > 0 && results.length <= 20) {
- const matchedRfNodes = results
- .map((r) => reactFlow.getNode(r.item.id))
- .filter(Boolean) as Node[];
- if (matchedRfNodes.length > 0) {
- reactFlow.fitView({ nodes: matchedRfNodes, padding: 0.4, duration: 500 });
- }
- }
- }, [searchQuery, fuseIndex, filteredNodes, reactFlow]);
-
- // Execution flow highlighting
- useEffect(() => {
- if (activeFlowIdx === null || !executionFlowsData) {
- // Don't clear if a manual path is highlighted
- if (activeFlowIdx === null && showFlows) {
- setHighlightedPath(new Set());
- setHighlightedEdges(new Set());
- }
- return;
- }
- const flow = executionFlowsData.flows[activeFlowIdx];
- if (!flow) return;
- const pathSet = new Set(flow.trace);
- const edgeKeys = new Set<string>();
- for (let i = 0; i < flow.trace.length - 1; i++) {
- edgeKeys.add(`${flow.trace[i]}→${flow.trace[i + 1]}`);
- edgeKeys.add(`${flow.trace[i + 1]}→${flow.trace[i]}`);
- }
- setHighlightedPath(pathSet);
- setHighlightedEdges(edgeKeys);
-
- // Switch to full view if in module view to show the trace
- if (viewMode === "module") {
- setViewMode("full");
- setModulePath([]);
- }
-
- setTimeout(() => {
- const traceNodes = flow.trace
- .map((id) => reactFlow.getNode(id))
- .filter(Boolean) as Node[];
- if (traceNodes.length > 0) {
- reactFlow.fitView({ nodes: traceNodes, padding: 0.3, duration: 600 });
- }
- }, 800);
- }, [activeFlowIdx, executionFlowsData]);
-
- // Context value
- const ctxValue = useMemo<GraphContextValue>(
- () => ({
- highlightedPath,
- highlightedEdges,
- colorMode,
- riskScores: new Map(),
- hoveredNodeId,
- connectedNodeIds,
- connectedEdgeIds,
- selectedNodeId,
- searchDimmedNodes,
- }),
- [highlightedPath, highlightedEdges, colorMode, hoveredNodeId, connectedNodeIds, connectedEdgeIds, selectedNodeId, searchDimmedNodes],
- );
-
- // ---- Handlers ----
-
- const handleNodeClick: NodeMouseHandler = useCallback(
- (event, node) => {
- if (node.type === "moduleGroup" && isModuleView) {
- // Drill into this module — the node ID is the full module path
- setModulePath((prev) => [...prev, node.id]);
- setSelectedNodeId(null);
- return;
- }
- // In community mode, open community detail panel
- if (colorMode === "community" && node.type === "fileNode") {
- const nodeData = node.data as FileNodeData;
- if (nodeData?.communityId !== undefined) {
- setCommunityPanelId(nodeData.communityId);
- }
- }
-
- // Toggle selection — show tooltip on click
- const mEvent = event as unknown as React.MouseEvent;
- if (selectedNodeId === node.id) {
- setSelectedNodeId(null);
- setSelectedNodeScreen(null);
- } else {
- setSelectedNodeId(node.id);
- setSelectedNodeScreen({ x: mEvent.clientX, y: mEvent.clientY });
- }
- },
- [isModuleView, selectedNodeId, colorMode],
- );
-
- const handleNodeMouseEnter: NodeMouseHandler = useCallback(
- (_event, node) => { setHoveredNodeId(node.id); },
- [],
- );
-
- const handleNodeMouseLeave: NodeMouseHandler = useCallback(
- () => { setHoveredNodeId(null); },
- [],
- );
-
- const handleNodeDoubleClick: NodeMouseHandler = useCallback(
- (_event, node) => {
- if (node.type !== "moduleGroup") {
- onNodeViewDocs?.(node.id);
- }
- },
- [onNodeViewDocs],
- );
-
- const handleNodeContextMenu: NodeMouseHandler = useCallback(
- (event, node) => {
- event.preventDefault();
- setCtxMenu({
- x: (event as unknown as React.MouseEvent).clientX,
- y: (event as unknown as React.MouseEvent).clientY,
- nodeId: node.id,
- nodeType: node.type ?? "fileNode",
- });
- },
- [],
- );
-
- useEffect(() => {
- if (!ctxMenu) return;
- const close = () => setCtxMenu(null);
- const onKey = (e: KeyboardEvent) => {
- if (e.key === "Escape") close();
- };
- window.addEventListener("click", close);
- window.addEventListener("keydown", onKey);
- return () => {
- window.removeEventListener("click", close);
- window.removeEventListener("keydown", onKey);
- };
- }, [ctxMenu]);
-
- const handlePathFound = useCallback(
- (pathNodes: string[]) => {
- setHighlightedPath(new Set(pathNodes));
- const edgeKeys = new Set<string>();
- for (let i = 0; i < pathNodes.length - 1; i++) {
- edgeKeys.add(`${pathNodes[i]}→${pathNodes[i + 1]}`);
- edgeKeys.add(`${pathNodes[i + 1]}→${pathNodes[i]}`);
- }
- setHighlightedEdges(edgeKeys);
- if (viewMode === "module") {
- setViewMode("full");
- setModulePath([]);
- }
- setTimeout(() => {
- const pathRfNodes = pathNodes
- .map((id) => reactFlow.getNode(id))
- .filter(Boolean) as Node[];
- if (pathRfNodes.length > 0) {
- reactFlow.fitView({ nodes: pathRfNodes, padding: 0.3, duration: 600 });
- }
- }, 800);
- },
- [viewMode, reactFlow],
- );
-
- const handlePathClear = useCallback(() => {
- setHighlightedPath(new Set());
- setHighlightedEdges(new Set());
- }, []);
-
- const handleFitView = useCallback(() => {
- reactFlow.fitView({ padding: 0.15, duration: 400 });
- }, [reactFlow]);
-
- const handleViewChange = useCallback((v: ViewMode) => {
- setViewMode(v);
- setModulePath([]);
- setHighlightedPath(new Set());
- setHighlightedEdges(new Set());
- setSelectedNodeId(null);
- setSelectedNodeScreen(null);
- }, []);
-
- // Breadcrumb
- const handleBreadcrumbClick = useCallback((index: number) => {
- if (index < 0) {
- setModulePath([]);
- } else {
- setModulePath((prev) => prev.slice(0, index + 1));
- }
- }, []);
-
- // Context menu actions
- const handleCtxViewDocs = useCallback(() => {
- if (ctxMenu) onNodeViewDocs?.(ctxMenu.nodeId);
- setCtxMenu(null);
- }, [ctxMenu, onNodeViewDocs]);
-
- const handleCtxExplore = useCallback(() => {
- if (ctxMenu) {
- if (ctxMenu.nodeType === "moduleGroup" && isModuleView) {
- setModulePath((prev) => [...prev, ctxMenu.nodeId]);
- } else {
- onNodeClick?.(ctxMenu.nodeId, ctxMenu.nodeType);
- }
- }
- setCtxMenu(null);
- }, [ctxMenu, isModuleView, onNodeClick]);
-
- const handleCtxPathFrom = useCallback(() => {
- if (ctxMenu) { setPathFrom(ctxMenu.nodeId); setShowPathFinder(true); }
- setCtxMenu(null);
- }, [ctxMenu]);
-
- const handleCtxPathTo = useCallback(() => {
- if (ctxMenu) { setPathTo(ctxMenu.nodeId); setShowPathFinder(true); }
- setCtxMenu(null);
- }, [ctxMenu]);
-
- // After layout completes, zoom to entry-point nodes for a readable first view
- const hasFocusedRef = useRef(false);
-
- useEffect(() => {
- // Only auto-focus once per view mode, after layout is done and nodes exist
- if (isLayouting || filteredNodes.length === 0 || hasFocusedRef.current) return;
- hasFocusedRef.current = true;
-
- const timer = setTimeout(() => {
- // Per-view zoom strategy
- switch (viewMode) {
- case "dead":
- case "hotfiles":
- case "architecture": {
- // Small, focused graphs — fit all nodes, zoom in to read them
- reactFlow.fitView({ padding: 0.3, duration: 600, maxZoom: 1.5 });
- return;
- }
- case "module": {
- // Module view — fit all, comfortable zoom
- reactFlow.fitView({ padding: 0.2, duration: 600, maxZoom: 1 });
- return;
- }
- default:
- break;
- }
-
- // Full graph: zoom to show all nodes but cap zoom so they're readable
- reactFlow.fitView({ padding: 0.15, duration: 600, maxZoom: 0.6 });
- }, 100);
-
- return () => clearTimeout(timer);
- }, [isLayouting, filteredNodes, reactFlow]);
-
- // Reset focus flag when view mode changes
- useEffect(() => {
- hasFocusedRef.current = false;
- }, [viewMode]);
-
- const minimapNodeColor = useCallback(
- (node: Node) => {
- if (node.type === "moduleGroup") {
- const pct = (node.data as { docCoveragePct?: number }).docCoveragePct;
- if (pct != null) return pct >= 0.7 ? "#22c55e" : pct >= 0.3 ? "#f59520" : "#ef4444";
- return "#3b82f6";
- }
- const lang = (node.data as { language?: string }).language;
- return lang ? languageColor(lang) : "#8b5cf6";
- },
- [],
- );
-
- if (isLoading) return <Skeleton className="h-full w-full rounded-lg" />;
-
- return (
- <GraphContext.Provider value={ctxValue}>
- <div className="relative w-full h-full" style={{ touchAction: "none" }} aria-label="Dependency graph">
- {isLayouting && (
- <div className="absolute inset-0 z-50 flex items-center justify-center bg-[var(--color-bg-root)]/60 backdrop-blur-sm rounded-lg">
- <div className="flex items-center gap-3 text-sm text-[var(--color-text-secondary)]">
- <Loader2 className="w-5 h-5 animate-spin text-[var(--color-accent-graph)]" />
- Computing layout...
- </div>
- </div>
- )}
-
- {filteredNodes.length === 0 && !isLayouting ? (
- <div className="flex items-center justify-center h-full">
- <EmptyState
- title="No graph data"
- description="Check that the backend is running and this repo has been indexed."
- />
- </div>
- ) : (
- <ReactFlow
- nodes={filteredNodes}
- edges={currentEdges}
- nodeTypes={nodeTypes}
- edgeTypes={edgeTypes}
- onNodeClick={handleNodeClick}
- onNodeDoubleClick={handleNodeDoubleClick}
- onNodeContextMenu={handleNodeContextMenu}
- onNodeMouseEnter={handleNodeMouseEnter}
- onNodeMouseLeave={handleNodeMouseLeave}
- onPaneClick={() => { setSelectedNodeId(null); setSelectedNodeScreen(null); }}
- fitView
- fitViewOptions={{ padding: 0.3, maxZoom: 1.2 }}
- minZoom={0.05}
- maxZoom={4}
- proOptions={{ hideAttribution: true }}
- className="!bg-transparent"
- nodesDraggable={false}
- defaultEdgeOptions={{ type: "dependency" }}
- >
- <Background variant={BackgroundVariant.Dots} gap={16} size={0.5} color="rgba(255,255,255,0.03)" />
- <Controls
- showInteractive={false}
- className="!border-[var(--color-border-default)] !bg-[var(--color-bg-elevated)] !shadow-lg !shadow-black/20 [&>button]:!border-[var(--color-border-default)] [&>button]:!bg-[var(--color-bg-elevated)] [&>button]:!text-[var(--color-text-secondary)] [&>button:hover]:!bg-[var(--color-bg-overlay)] [&>button:hover]:!text-[var(--color-text-primary)]"
- />
- <MiniMap
- nodeColor={minimapNodeColor}
- maskColor="rgba(0, 0, 0, 0.6)"
- className="!bg-[var(--color-bg-surface)] !border-[var(--color-border-default)] !shadow-lg !shadow-black/20 !rounded-lg !hidden sm:!block"
- pannable
- zoomable
- />
- </ReactFlow>
- )}
-
- {/* Breadcrumb — shown when drilled into a module */}
- {isModuleView && isDrilledDown && (
- <div className="absolute top-3 left-3 z-10">
- <div className="flex items-center gap-1 rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)]/90 backdrop-blur-sm px-2.5 py-1.5 shadow-lg shadow-black/20">
- <button
- onClick={() => handleBreadcrumbClick(-1)}
- className="flex items-center gap-1 text-[11px] text-[var(--color-text-tertiary)] hover:text-[var(--color-accent-graph)] transition-colors"
- >
- <Home className="w-3 h-3" />
- <span>Root</span>
- </button>
- {modulePath.map((fullPrefix, i) => {
- // Show only the segment added at this level
- const prevPrefix = i > 0 ? modulePath[i - 1] + "/" : "";
- const label = fullPrefix.slice(prevPrefix.length);
- const isLast = i === modulePath.length - 1;
- return (
- <span key={i} className="flex items-center gap-1">
- <ChevronRight className="w-3 h-3 text-[var(--color-text-tertiary)]" />
- <button
- onClick={() => !isLast && handleBreadcrumbClick(i)}
- className={`text-[11px] font-mono transition-colors ${
- isLast
- ? "text-[var(--color-text-primary)] font-medium cursor-default"
- : "text-[var(--color-text-tertiary)] hover:text-[var(--color-accent-graph)]"
- }`}
- >
- {label}
- </button>
- </span>
- );
- })}
- </div>
- </div>
- )}
-
- {/* Toolbar */}
- <div className="absolute top-3 right-3 z-10">
- <GraphToolbar
- viewMode={viewMode}
- onViewChange={handleViewChange}
- colorMode={colorMode}
- onColorModeChange={setColorMode}
- hideTests={hideTests}
- onHideTestsChange={setHideTests}
- onFitView={handleFitView}
- showPathFinder={showPathFinder}
- onTogglePathFinder={() => setShowPathFinder((s) => !s)}
- showFlows={showFlows}
- onToggleFlows={() => { setShowFlows((s) => !s); setActiveFlowIdx(null); }}
- searchQuery={searchQuery}
- onSearchChange={setSearchQuery}
- />
- </div>
-
- {/* Path Finder */}
- {showPathFinder && (
- <div className="absolute top-14 right-3 z-10">
- <PathFinderPanel
- repoId={repoId}
- onPathFound={handlePathFound}
- onClear={handlePathClear}
- onClose={() => setShowPathFinder(false)}
- initialFrom={pathFrom}
- initialTo={pathTo}
- />
- </div>
- )}
-
- {/* Execution Flows Panel */}
- {showFlows && executionFlowsData && executionFlowsData.flows.length > 0 && (
- <div className="absolute top-14 right-3 z-10 w-[min(16rem,calc(100vw-1.5rem))]">
- <div className="rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)]/95 backdrop-blur-sm shadow-lg shadow-black/20 p-3">
- <div className="flex items-center justify-between mb-2">
- <span className="text-[11px] font-medium text-[var(--color-text-primary)]">
- Execution Flows
- </span>
- <span className="text-[10px] text-[var(--color-text-tertiary)]">
- {executionFlowsData.flows.length} entry points
- </span>
- </div>
- <div className="space-y-1 max-h-60 overflow-y-auto">
- {executionFlowsData.flows.map((flow, idx) => (
- <button
- key={flow.entry_point}
- onClick={() => setActiveFlowIdx(activeFlowIdx === idx ? null : idx)}
- className={`w-full text-left px-2 py-1.5 rounded-md text-[11px] transition-colors ${
- activeFlowIdx === idx
- ? "bg-[var(--color-accent-primary)]/15 text-[var(--color-accent-primary)]"
- : "text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-overlay)] hover:text-[var(--color-text-primary)]"
- }`}
- >
- <div className="font-mono truncate">{flow.entry_point_name}</div>
- <div className="flex items-center gap-2 mt-0.5 text-[10px] text-[var(--color-text-tertiary)]">
- <span>depth {flow.depth}</span>
- <span>{flow.trace.length} nodes</span>
- {flow.crosses_community && (
- <span className="text-yellow-500">cross-community</span>
- )}
- </div>
- </button>
- ))}
- </div>
- </div>
- </div>
- )}
-
- {/* Legend */}
- <div className="absolute bottom-3 left-3 z-10">
- <GraphLegend
- nodeCount={filteredNodes.length}
- edgeCount={currentEdges.length}
- colorMode={colorMode}
- viewMode={viewMode}
- communityLabels={communityLabels}
- />
- </div>
-
- {/* Context menu */}
- {ctxMenu && (
- <GraphContextMenu
- x={ctxMenu.x}
- y={ctxMenu.y}
- nodeId={ctxMenu.nodeId}
- isModule={ctxMenu.nodeType === "moduleGroup"}
- onViewDocs={handleCtxViewDocs}
- onExplore={handleCtxExplore}
- onPathFrom={handleCtxPathFrom}
- onPathTo={handleCtxPathTo}
- />
- )}
-
- {/* Community detail panel */}
- {communityPanelId !== null && (
- <GraphCommunityPanel
- repoId={repoId}
- communityId={communityPanelId}
- onClose={() => setCommunityPanelId(null)}
- />
- )}
-
- {/* Node detail tooltip */}
- {selectedNodeId && selectedNodeScreen && (() => {
- const rfNode = filteredNodes.find((n) => n.id === selectedNodeId);
- if (!rfNode) return null;
- return (
- <GraphTooltip
- nodeId={selectedNodeId}
- nodeType={rfNode.type ?? "fileNode"}
- data={rfNode.data as Record<string, unknown>}
- x={selectedNodeScreen.x}
- y={selectedNodeScreen.y}
- onClose={() => { setSelectedNodeId(null); setSelectedNodeScreen(null); }}
- onViewDocs={() => { onNodeViewDocs?.(selectedNodeId); setSelectedNodeId(null); setSelectedNodeScreen(null); }}
- onExplore={rfNode.type === "moduleGroup" && isModuleView ? () => {
- setModulePath((prev) => [...prev, selectedNodeId]);
- setSelectedNodeId(null);
- setSelectedNodeScreen(null);
- } : undefined}
- />
- );
- })()}
- </div>
- </GraphContext.Provider>
- );
-}
-
-// ---- Public component ----
-
-export interface GraphFlowProps {
- repoId: string;
- onNodeClick?: (nodeId: string, nodeType: string) => void | Promise<void>;
- onNodeViewDocs?: (nodeId: string) => void;
-}
+ const { flows: executionFlowsData } = useExecutionFlows(repoId, {
+ top_n: 10,
+ max_depth: 6,
+ });
-export function GraphFlow(props: GraphFlowProps) {
return (
- <ReactFlowProvider>
- <GraphFlowInner {...props} />
- </ReactFlowProvider>
+ <GraphFlowShell
+ moduleGraph={moduleGraph as ModuleGraph | undefined}
+ isLoadingModuleGraph={moduleLoading}
+ fullGraph={fullGraph as GraphExport | undefined}
+ isLoadingFullGraph={fullLoading}
+ architectureGraph={archGraph as GraphExport | undefined}
+ isLoadingArchitectureGraph={archLoading}
+ deadCodeGraph={deadGraph as GraphExport | undefined}
+ isLoadingDeadCodeGraph={deadLoading}
+ hotFilesGraph={hotGraph as GraphExport | undefined}
+ isLoadingHotFilesGraph={hotLoading}
+ communities={communities as CommunitySummaryItem[] | undefined}
+ executionFlows={executionFlowsData as ExecutionFlows | undefined}
+ onViewModeChange={setViewMode}
+ onModulePathChange={setModulePath}
+ onNodeClick={onNodeClick}
+ onNodeViewDocs={onNodeViewDocs}
+ renderPathFinder={(props) => (
+ <PathFinderPanel
+ repoId={repoId}
+ initialFrom={props.initialFrom}
+ initialTo={props.initialTo}
+ onPathFound={props.onPathFound}
+ onClear={props.onClear}
+ onClose={props.onClose}
+ />
+ )}
+ renderCommunityPanel={(props) => (
+ <GraphCommunityPanel
+ repoId={repoId}
+ communityId={props.communityId}
+ onClose={props.onClose}
+ />
+ )}
+ />
);
}
diff --git a/packages/web/src/components/graph/path-finder-panel.tsx b/packages/web/src/components/graph/path-finder-panel.tsx
index 9cb88ec0a..825823816 100644
--- a/packages/web/src/components/graph/path-finder-panel.tsx
+++ b/packages/web/src/components/graph/path-finder-panel.tsx
@@ -1,13 +1,9 @@
"use client";
-import { useState, useEffect, useRef, useCallback } from "react";
-import { Route, Loader2, X, ArrowRight, Search, ChevronDown } from "lucide-react";
-import { Button } from "@/components/ui/button";
+import { PathFinderPanel as PathFinderPanelShell } from "@repowise-dev/ui/graph/path-finder-panel";
import { getGraphPath, searchNodes } from "@/lib/api/graph";
-import { useDebounce } from "@/lib/hooks/use-debounce";
-import type { GraphPathResponse, NodeSearchResult } from "@/lib/api/types";
-interface PathFinderPanelProps {
+interface PathFinderPanelWrapperProps {
repoId: string;
onPathFound: (pathNodes: string[]) => void;
onClear: () => void;
@@ -16,104 +12,6 @@ interface PathFinderPanelProps {
initialTo?: string;
}
-function NodeAutocomplete({
- repoId,
- value,
- onChange,
- placeholder,
- onSubmit,
-}: {
- repoId: string;
- value: string;
- onChange: (v: string) => void;
- placeholder: string;
- onSubmit?: () => void;
-}) {
- const [results, setResults] = useState<NodeSearchResult[]>([]);
- const [topNodes, setTopNodes] = useState<NodeSearchResult[]>([]);
- const [showDropdown, setShowDropdown] = useState(false);
- const debounced = useDebounce(value, 250);
- const topLoaded = useRef(false);
-
- // Load top nodes by pagerank once for the dropdown
- useEffect(() => {
- if (topLoaded.current) return;
- topLoaded.current = true;
- searchNodes(repoId, "", 20)
- .then(setTopNodes)
- .catch(() => {});
- }, [repoId]);
-
- // Search as user types
- useEffect(() => {
- if (!debounced.trim() || debounced.length < 2) {
- setResults([]);
- return;
- }
- searchNodes(repoId, debounced, 12)
- .then((r) => {
- setResults(r);
- setShowDropdown(r.length > 0);
- })
- .catch(() => setResults([]));
- }, [debounced, repoId]);
-
- const displayResults = results.length > 0 ? results : topNodes;
-
- const handleSelect = useCallback(
- (nodeId: string) => {
- onChange(nodeId);
- setShowDropdown(false);
- },
- [onChange],
- );
-
- return (
- <div className="relative">
- <Search className="absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-[var(--color-text-tertiary)]" />
- <input
- type="text"
- value={value}
- onChange={(e) => onChange(e.target.value)}
- onFocus={() => setShowDropdown(true)}
- onBlur={() => setTimeout(() => setShowDropdown(false), 150)}
- onKeyDown={(e) => {
- if (e.key === "Enter") {
- setShowDropdown(false);
- onSubmit?.();
- }
- }}
- placeholder={placeholder}
- className="w-full h-8 pl-8 pr-8 rounded-md border border-[var(--color-border-default)] bg-[var(--color-bg-inset)] text-xs font-mono text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:border-[var(--color-accent-graph)] focus:ring-1 focus:ring-[var(--color-accent-graph)]/30 transition-all"
- />
- <ChevronDown className="absolute right-2.5 top-1/2 -translate-y-1/2 w-3 h-3 text-[var(--color-text-tertiary)]" />
- {showDropdown && displayResults.length > 0 && (
- <div className="absolute top-full left-0 mt-1 w-full max-h-52 overflow-auto z-50 rounded-lg border border-[var(--color-border-default)] bg-[var(--color-bg-overlay)] shadow-xl shadow-black/30 py-1">
- {results.length === 0 && topNodes.length > 0 && (
- <div className="px-3 py-1 text-[9px] text-[var(--color-text-tertiary)] uppercase tracking-wider">
- Top files by importance
- </div>
- )}
- {displayResults.map((r) => (
- <button
- key={r.node_id}
- className="w-full px-3 py-1.5 text-left text-xs hover:bg-[var(--color-bg-elevated)] transition-colors flex items-center gap-2"
- onMouseDown={() => handleSelect(r.node_id)}
- >
- <span className="font-mono text-[var(--color-text-primary)] truncate flex-1">
- {r.node_id}
- </span>
- <span className="text-[10px] text-[var(--color-text-tertiary)] capitalize shrink-0 tabular-nums">
- {r.language}
- </span>
- </button>
- ))}
- </div>
- )}
- </div>
- );
-}
-
export function PathFinderPanel({
repoId,
onPathFound,
@@ -121,151 +19,16 @@ export function PathFinderPanel({
onClose,
initialFrom = "",
initialTo = "",
-}: PathFinderPanelProps) {
- const [from, setFrom] = useState(initialFrom);
- const [to, setTo] = useState(initialTo);
- const [loading, setLoading] = useState(false);
- const [result, setResult] = useState<GraphPathResponse | null>(null);
- const [error, setError] = useState<string | null>(null);
-
- // Sync initial values when they change from context menu
- useEffect(() => {
- if (initialFrom) setFrom(initialFrom);
- }, [initialFrom]);
- useEffect(() => {
- if (initialTo) setTo(initialTo);
- }, [initialTo]);
-
- const handleFind = useCallback(async () => {
- if (!from.trim() || !to.trim()) return;
- setLoading(true);
- setError(null);
- setResult(null);
- onClear();
- try {
- const res = await getGraphPath(repoId, from.trim(), to.trim());
- setResult(res);
- if (res.path && res.path.length > 0) {
- onPathFound(res.path);
- } else {
- setError("No path found between these nodes.");
- }
- } catch {
- setError("No path found between these nodes.");
- } finally {
- setLoading(false);
- }
- }, [from, to, repoId, onPathFound, onClear]);
-
- const handleClear = useCallback(() => {
- setFrom("");
- setTo("");
- setResult(null);
- setError(null);
- onClear();
- }, [onClear]);
-
+}: PathFinderPanelWrapperProps) {
return (
- <div className="rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-overlay)]/90 backdrop-blur-md shadow-xl shadow-black/30 p-3 w-[min(280px,calc(100vw-1.5rem))] space-y-2">
- {/* Header */}
- <div className="flex items-center gap-2">
- <Route className="w-3.5 h-3.5 text-[var(--color-accent-graph)]" />
- <span className="text-xs font-semibold text-[var(--color-text-primary)]">
- Find Path
- </span>
- <div className="ml-auto flex items-center gap-1">
- {(result || error) && (
- <Button
- size="sm"
- variant="ghost"
- onClick={handleClear}
- className="h-5 w-5 p-0"
- aria-label="Clear results"
- title="Clear results"
- >
- <X className="h-3 w-3" />
- </Button>
- )}
- <Button
- size="sm"
- variant="ghost"
- onClick={onClose}
- className="h-5 w-5 p-0 text-[var(--color-text-tertiary)]"
- aria-label="Close"
- title="Close"
- >
- <X className="h-3 w-3" />
- </Button>
- </div>
- </div>
-
- {/* Inputs stacked */}
- <div className="space-y-1.5">
- <NodeAutocomplete
- repoId={repoId}
- value={from}
- onChange={setFrom}
- placeholder="From file..."
- onSubmit={handleFind}
- />
- <NodeAutocomplete
- repoId={repoId}
- value={to}
- onChange={setTo}
- placeholder="To file..."
- onSubmit={handleFind}
- />
- </div>
-
- {/* Find button */}
- <Button
- size="sm"
- onClick={handleFind}
- disabled={!from.trim() || !to.trim() || loading}
- className="w-full h-7 text-xs font-medium gap-1.5"
- style={{
- background: "var(--color-accent-graph)",
- color: "#000",
- }}
- >
- {loading ? (
- <Loader2 className="h-3.5 w-3.5 animate-spin" />
- ) : (
- <Route className="h-3.5 w-3.5" />
- )}
- Find Path
- </Button>
-
- {/* Result */}
- {result && result.path && result.path.length > 0 && (
- <div className="rounded-lg bg-[var(--color-bg-inset)] border border-[var(--color-border-default)] p-2 space-y-1">
- <p className="text-[10px] font-medium text-[var(--color-accent-graph)] uppercase tracking-wider">
- {result.distance} {result.distance === 1 ? "hop" : "hops"}
- </p>
- <div className="space-y-0.5 max-h-28 overflow-auto">
- {result.path.map((nodeName, i) => {
- const shortName = nodeName.split("/").pop() ?? nodeName;
- return (
- <div key={i} className="flex items-center gap-1">
- {i > 0 && (
- <ArrowRight className="w-2.5 h-2.5 text-[var(--color-accent-graph)] shrink-0" />
- )}
- <span
- className="text-[10px] font-mono text-[var(--color-text-secondary)] truncate"
- title={nodeName}
- >
- {shortName}
- </span>
- </div>
- );
- })}
- </div>
- </div>
- )}
-
- {error && (
- <p className="text-[10px] text-[var(--color-risk-high)]">{error}</p>
- )}
- </div>
+ <PathFinderPanelShell
+ searchNodes={(query, limit) => searchNodes(repoId, query, limit)}
+ findPath={(from, to) => getGraphPath(repoId, from, to)}
+ onPathFound={onPathFound}
+ onClear={onClear}
+ onClose={onClose}
+ initialFrom={initialFrom}
+ initialTo={initialTo}
+ />
);
}
diff --git a/packages/web/src/components/jobs/generation-progress-wrapper.tsx b/packages/web/src/components/jobs/generation-progress-wrapper.tsx
new file mode 100644
index 000000000..ea6dfcb01
--- /dev/null
+++ b/packages/web/src/components/jobs/generation-progress-wrapper.tsx
@@ -0,0 +1,97 @@
+"use client";
+
+import { useEffect, useRef, useState } from "react";
+import { toast } from "sonner";
+import { GenerationProgress } from "@repowise-dev/ui/jobs/generation-progress";
+import { useJob } from "@/lib/hooks/use-job";
+import { cancelJob } from "@/lib/api/jobs";
+import { formatNumber } from "@repowise-dev/ui/lib/format";
+import type { JobProgressEvent } from "@/lib/api/types";
+
+interface Props {
+ jobId: string;
+ repoName?: string;
+ onDone?: () => void;
+}
+
+const PENDING_STUCK_THRESHOLD_MS = 30_000;
+
+export function GenerationProgressWrapper({ jobId, repoName, onDone }: Props) {
+ const { job, sse } = useJob(jobId);
+ const [log, setLog] = useState<Array<{ text: string }>>([]);
+ const [elapsed, setElapsed] = useState(0);
+ const [actualCost, setActualCost] = useState<number | null>(null);
+ const [cancelling, setCancelling] = useState(false);
+ const startRef = useRef(Date.now());
+ const notifiedRef = useRef(false);
+
+ useEffect(() => {
+ const id = setInterval(() => setElapsed(Date.now() - startRef.current), 1000);
+ return () => clearInterval(id);
+ }, []);
+
+ useEffect(() => {
+ if (!sse.data) return;
+ const ev = sse.data as JobProgressEvent;
+ if (ev.current_page) {
+ setLog((prev) => [
+ ...prev,
+ { text: `[L${ev.current_level ?? "?"}] ${ev.current_page}` },
+ ]);
+ }
+ if (ev.actual_cost_usd != null) {
+ setActualCost(ev.actual_cost_usd);
+ }
+ }, [sse.data]);
+
+ useEffect(() => {
+ if (notifiedRef.current) return;
+ if (job?.status === "completed") {
+ notifiedRef.current = true;
+ toast.success(`Documentation updated${repoName ? ` — ${repoName}` : ""}`, {
+ description: `${formatNumber(job.completed_pages)} pages generated`,
+ });
+ onDone?.();
+ } else if (job?.status === "failed") {
+ notifiedRef.current = true;
+ toast.error("Generation failed", {
+ description: job.error_message ?? "Unknown error",
+ });
+ onDone?.();
+ }
+ }, [job?.status, job?.completed_pages, job?.error_message, repoName, onDone]);
+
+ const isPending = job?.status === "pending";
+ const stuckPending =
+ isPending &&
+ job?.started_at == null &&
+ elapsed > PENDING_STUCK_THRESHOLD_MS;
+
+ async function handleCancel() {
+ if (!job) return;
+ setCancelling(true);
+ try {
+ await cancelJob(job.id);
+ toast.success("Job cancelled");
+ onDone?.();
+ } catch (e) {
+ toast.error("Couldn't cancel job", {
+ description: e instanceof Error ? e.message : "Unknown error",
+ });
+ } finally {
+ setCancelling(false);
+ }
+ }
+
+ return (
+ <GenerationProgress
+ job={job ?? undefined}
+ log={log}
+ elapsed={elapsed}
+ actualCost={actualCost}
+ stuckPending={stuckPending}
+ cancelling={cancelling}
+ onCancel={handleCancel}
+ />
+ );
+}
diff --git a/packages/web/src/components/layout/mobile-nav.tsx b/packages/web/src/components/layout/mobile-nav.tsx
index 179404953..ef4bc2a19 100644
--- a/packages/web/src/components/layout/mobile-nav.tsx
+++ b/packages/web/src/components/layout/mobile-nav.tsx
@@ -28,10 +28,10 @@ import {
Link2,
GitMerge,
} from "lucide-react";
-import { Button } from "@/components/ui/button";
-import { Sheet, SheetContent, SheetHeader, SheetTitle } from "@/components/ui/sheet";
-import { ScrollArea } from "@/components/ui/scroll-area";
-import { Separator } from "@/components/ui/separator";
+import { Button } from "@repowise-dev/ui/ui/button";
+import { Sheet, SheetContent, SheetHeader, SheetTitle } from "@repowise-dev/ui/ui/sheet";
+import { ScrollArea } from "@repowise-dev/ui/ui/scroll-area";
+import { Separator } from "@repowise-dev/ui/ui/separator";
import { AddRepoDialog } from "@/components/repos/add-repo-dialog";
import { cn } from "@/lib/utils/cn";
import type { RepoResponse, WorkspaceResponse } from "@/lib/api/types";
diff --git a/packages/web/src/components/layout/sidebar.tsx b/packages/web/src/components/layout/sidebar.tsx
index 744c5ce86..fbbdb8b12 100644
--- a/packages/web/src/components/layout/sidebar.tsx
+++ b/packages/web/src/components/layout/sidebar.tsx
@@ -29,9 +29,9 @@ import {
GitMerge,
} from "lucide-react";
import { cn } from "@/lib/utils/cn";
-import { ScrollArea } from "@/components/ui/scroll-area";
-import { Separator } from "@/components/ui/separator";
-import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
+import { ScrollArea } from "@repowise-dev/ui/ui/scroll-area";
+import { Separator } from "@repowise-dev/ui/ui/separator";
+import { Tooltip, TooltipContent, TooltipTrigger } from "@repowise-dev/ui/ui/tooltip";
import { AddRepoDialog } from "@/components/repos/add-repo-dialog";
import type { RepoResponse, WorkspaceResponse } from "@/lib/api/types";
@@ -158,7 +158,7 @@ export function Sidebar({ repos = [], activeRepoId, workspace }: SidebarProps) {
))}
</nav>
- {/* Workspace nav — only shown in workspace mode */}
+ {/* Workspace nav — only shown in workspace mode */}
{isWorkspace && (
<>
{!isIconOnly && (
diff --git a/packages/web/src/components/repos/add-repo-dialog.tsx b/packages/web/src/components/repos/add-repo-dialog.tsx
index 3b3695531..31c74cc1a 100644
--- a/packages/web/src/components/repos/add-repo-dialog.tsx
+++ b/packages/web/src/components/repos/add-repo-dialog.tsx
@@ -4,16 +4,16 @@ import { useState } from "react";
import { Plus } from "lucide-react";
import { useSWRConfig } from "swr";
import { createRepo } from "@/lib/api/repos";
-import { Button } from "@/components/ui/button";
+import { Button } from "@repowise-dev/ui/ui/button";
import {
Dialog,
DialogContent,
DialogHeader,
DialogTitle,
DialogFooter,
-} from "@/components/ui/dialog";
-import { Label } from "@/components/ui/label";
-import { Input } from "@/components/ui/input";
+} from "@repowise-dev/ui/ui/dialog";
+import { Label } from "@repowise-dev/ui/ui/label";
+import { Input } from "@repowise-dev/ui/ui/input";
interface Props {
/** Render as a sidebar button (icon + label) vs standalone button */
@@ -145,7 +145,7 @@ export function AddRepoDialog({ variant = "default" }: Props) {
Cancel
</Button>
<Button type="submit" disabled={submitting || !name.trim() || !localPath.trim()}>
- {submitting ? "Adding…" : "Add Repository"}
+ {submitting ? "Adding…" : "Add Repository"}
</Button>
</DialogFooter>
</form>
diff --git a/packages/web/src/components/repos/coordinator-health-panel.tsx b/packages/web/src/components/repos/coordinator-health-panel.tsx
index 9732f9164..efb7842e1 100644
--- a/packages/web/src/components/repos/coordinator-health-panel.tsx
+++ b/packages/web/src/components/repos/coordinator-health-panel.tsx
@@ -2,7 +2,7 @@
import { useState } from "react";
import { RefreshCw } from "lucide-react";
-import { Button } from "@/components/ui/button";
+import { Button } from "@repowise-dev/ui/ui/button";
import { getCoordinatorHealth, type CoordinatorHealth } from "@/lib/api/health";
interface Props {
@@ -43,8 +43,8 @@ export function CoordinatorHealthPanel({ repoId, initial }: Props) {
}
}
- const fmt = (v: number | null) => (v === null ? "—" : String(v));
- const fmtPct = (v: number | null) => (v === null ? "—" : `${v.toFixed(1)}%`);
+ const fmt = (v: number | null) => (v === null ? "—" : String(v));
+ const fmtPct = (v: number | null) => (v === null ? "—" : `${v.toFixed(1)}%`);
return (
<div className="space-y-3">
@@ -65,7 +65,7 @@ export function CoordinatorHealthPanel({ repoId, initial }: Props) {
</>
) : (
<p className="text-xs text-[var(--color-text-secondary)]">
- {error ?? "No data — click Refresh to load."}
+ {error ?? "No data — click Refresh to load."}
</p>
)}
{error && (
@@ -79,7 +79,7 @@ export function CoordinatorHealthPanel({ repoId, initial }: Props) {
disabled={loading}
>
<RefreshCw className={`h-3.5 w-3.5 mr-1.5 ${loading ? "animate-spin" : ""}`} />
- {loading ? "Checking…" : "Refresh"}
+ {loading ? "Checking…" : "Refresh"}
</Button>
</div>
);
diff --git a/packages/web/src/components/repos/operations-panel.tsx b/packages/web/src/components/repos/operations-panel.tsx
index c4cd47cd5..a1536771d 100644
--- a/packages/web/src/components/repos/operations-panel.tsx
+++ b/packages/web/src/components/repos/operations-panel.tsx
@@ -4,17 +4,17 @@ import { useState } from "react";
import { toast } from "sonner";
import { RefreshCw, Zap, ChevronDown, ChevronUp, AlertTriangle, Download } from "lucide-react";
import { syncRepo, fullResyncRepo } from "@/lib/api/repos";
-import { Button } from "@/components/ui/button";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
+import { Button } from "@repowise-dev/ui/ui/button";
+import { Card, CardContent, CardHeader, CardTitle } from "@repowise-dev/ui/ui/card";
import {
Dialog,
DialogContent,
DialogHeader,
DialogTitle,
DialogFooter,
-} from "@/components/ui/dialog";
+} from "@repowise-dev/ui/ui/dialog";
import { RunConfigForm, type RunConfig } from "./run-config-form";
-import { GenerationProgress } from "@/components/jobs/generation-progress";
+import { GenerationProgressWrapper as GenerationProgress } from "@/components/jobs/generation-progress-wrapper";
interface Props {
repoId: string;
@@ -41,7 +41,7 @@ export function OperationsPanel({ repoId, repoName }: Props) {
try {
const job = await syncRepo(repoId);
setActiveJobId(job.id);
- toast.info(`Sync started — ${repoName}`);
+ toast.info(`Sync started — ${repoName}`);
} catch (e) {
toast.error("Sync failed", {
description: e instanceof Error ? e.message : "Unknown error",
@@ -57,7 +57,7 @@ export function OperationsPanel({ repoId, repoName }: Props) {
try {
const job = await fullResyncRepo(repoId);
setActiveJobId(job.id);
- toast.info(`Full resync started — ${repoName}`);
+ toast.info(`Full resync started — ${repoName}`);
} catch (e) {
toast.error("Resync failed", {
description: e instanceof Error ? e.message : "Unknown error",
@@ -115,7 +115,7 @@ export function OperationsPanel({ repoId, repoName }: Props) {
className="flex-1"
>
<Zap className="h-3.5 w-3.5 mr-1.5" />
- {loading === "sync" ? "Starting…" : "Sync"}
+ {loading === "sync" ? "Starting…" : "Sync"}
</Button>
<Button
variant="outline"
@@ -125,7 +125,7 @@ export function OperationsPanel({ repoId, repoName }: Props) {
className="flex-1"
>
<RefreshCw className="h-3.5 w-3.5 mr-1.5" />
- {loading === "resync" ? "Starting…" : "Full Resync"}
+ {loading === "resync" ? "Starting…" : "Full Resync"}
</Button>
<Button
variant="ghost"
diff --git a/packages/web/src/components/repos/repo-settings-form-wrapper.tsx b/packages/web/src/components/repos/repo-settings-form-wrapper.tsx
new file mode 100644
index 000000000..1489c5791
--- /dev/null
+++ b/packages/web/src/components/repos/repo-settings-form-wrapper.tsx
@@ -0,0 +1,43 @@
+"use client";
+
+import { toast } from "sonner";
+import { GeneralForm } from "@repowise-dev/ui/settings/general-form";
+import { updateRepo } from "@/lib/api/repos";
+import type { RepoResponse } from "@/lib/api/types";
+import type { RepoSettingsValue } from "@repowise-dev/types/settings";
+
+interface Props {
+ repo: RepoResponse;
+}
+
+export function RepoSettingsFormWrapper({ repo }: Props) {
+ const value: RepoSettingsValue = {
+ name: repo.name,
+ default_branch: repo.default_branch,
+ exclude_patterns:
+ (repo.settings?.exclude_patterns as string[] | undefined) ?? [],
+ };
+
+ async function handleSubmit(next: RepoSettingsValue) {
+ try {
+ await updateRepo(repo.id, {
+ name: next.name,
+ default_branch: next.default_branch,
+ settings: { ...repo.settings, exclude_patterns: next.exclude_patterns },
+ });
+ toast.success("Repository settings saved");
+ } catch (err) {
+ toast.error(err instanceof Error ? err.message : "Failed to save settings");
+ throw err;
+ }
+ }
+
+ return (
+ <GeneralForm
+ value={value}
+ onSubmit={handleSubmit}
+ localPath={repo.local_path}
+ remoteUrl={repo.url ?? undefined}
+ />
+ );
+}
diff --git a/packages/web/src/components/repos/repo-settings-form.tsx b/packages/web/src/components/repos/repo-settings-form.tsx
deleted file mode 100644
index c3f085bd7..000000000
--- a/packages/web/src/components/repos/repo-settings-form.tsx
+++ /dev/null
@@ -1,221 +0,0 @@
-"use client";
-
-import { useState } from "react";
-import { toast } from "sonner";
-import { Info, Save, X } from "lucide-react";
-import { Badge } from "@/components/ui/badge";
-import { Button } from "@/components/ui/button";
-import { Input } from "@/components/ui/input";
-import { Label } from "@/components/ui/label";
-import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
-import { updateRepo } from "@/lib/api/repos";
-import type { RepoResponse } from "@/lib/api/types";
-
-const SUGGESTIONS = [
- "vendor/",
- "dist/",
- "build/",
- "node_modules/",
- "*.generated.*",
- "**/fixtures/**",
-];
-
-function arraysEqual(a: string[], b: string[]): boolean {
- return a.length === b.length && a.every((v, i) => v === b[i]);
-}
-
-interface RepoSettingsFormProps {
- repo: RepoResponse;
-}
-
-export function RepoSettingsForm({ repo }: RepoSettingsFormProps) {
- const [name, setName] = useState(repo.name);
- const [branch, setBranch] = useState(repo.default_branch);
- const [patterns, setPatterns] = useState<string[]>(
- (repo.settings?.exclude_patterns as string[] | undefined) ?? []
- );
- const [newPattern, setNewPattern] = useState("");
- const [saving, setSaving] = useState(false);
-
- const savedPatterns = (repo.settings?.exclude_patterns as string[] | undefined) ?? [];
- const hasChanges =
- name !== repo.name ||
- branch !== repo.default_branch ||
- !arraysEqual(patterns, savedPatterns);
-
- function addPattern(pattern: string) {
- const trimmed = pattern.trim();
- if (!trimmed || patterns.includes(trimmed)) return;
- setPatterns([...patterns, trimmed]);
- setNewPattern("");
- }
-
- function removePattern(pattern: string) {
- setPatterns(patterns.filter((p) => p !== pattern));
- }
-
- async function handleSave() {
- if (!hasChanges) return;
- setSaving(true);
- try {
- await updateRepo(repo.id, {
- name,
- default_branch: branch,
- settings: { ...repo.settings, exclude_patterns: patterns },
- });
- toast.success("Repository settings saved");
- } catch (err) {
- toast.error(err instanceof Error ? err.message : "Failed to save settings");
- } finally {
- setSaving(false);
- }
- }
-
- return (
- <div className="space-y-5">
- <div className="space-y-1.5">
- <Label htmlFor="repo-name">Repository name</Label>
- <Input
- id="repo-name"
- value={name}
- onChange={(e) => setName(e.target.value)}
- placeholder="my-project"
- className="max-w-sm"
- />
- </div>
-
- <div className="space-y-1.5">
- <Label htmlFor="repo-branch">Default branch</Label>
- <Input
- id="repo-branch"
- value={branch}
- onChange={(e) => setBranch(e.target.value)}
- placeholder="main"
- className="max-w-sm"
- />
- </div>
-
- <div className="space-y-1.5">
- <Label>Local path</Label>
- <p className="text-sm font-mono text-[var(--color-text-secondary)] break-all">
- {repo.local_path}
- </p>
- <p className="text-xs text-[var(--color-text-tertiary)]">
- Path cannot be changed after repository is registered.
- </p>
- </div>
-
- {repo.url && (
- <div className="space-y-1.5">
- <Label>Remote URL</Label>
- <p className="text-sm font-mono text-[var(--color-text-secondary)] break-all">
- {repo.url}
- </p>
- </div>
- )}
-
- {/* Excluded Paths */}
- <div className="space-y-3 border-t border-[var(--color-border-default)] pt-5">
- <div className="flex items-center gap-2">
- <span className="text-sm font-medium">Excluded Paths</span>
- {patterns.length > 0 && (
- <Badge variant="accent" className="text-xs">
- {patterns.length} active
- </Badge>
- )}
- <TooltipProvider>
- <Tooltip>
- <TooltipTrigger asChild>
- <Info className="h-3.5 w-3.5 text-[var(--color-text-tertiary)] cursor-help" />
- </TooltipTrigger>
- <TooltipContent>
- <p>Supports full .gitignore syntax. Paths are relative to the repo root.</p>
- </TooltipContent>
- </Tooltip>
- </TooltipProvider>
- </div>
- <p className="text-xs text-[var(--color-text-secondary)]">
- Gitignore-style patterns. Excluded folders are skipped during indexing and generation.
- </p>
-
- {/* Chips */}
- {patterns.length === 0 ? (
- <p className="text-xs text-[var(--color-text-tertiary)] italic">
- No custom patterns — .gitignore and .repowiseIgnore are always respected.
- </p>
- ) : (
- <div className="flex flex-wrap gap-1.5">
- {patterns.map((p) => (
- <span
- key={p}
- className="inline-flex items-center gap-1 rounded-full bg-[var(--color-bg-inset)] px-2.5 py-0.5 text-xs font-mono text-[var(--color-text-primary)] border border-[var(--color-border-default)]"
- >
- {p}
- <button
- type="button"
- onClick={() => removePattern(p)}
- className="text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)] transition-colors"
- aria-label={`Remove ${p}`}
- >
- <X className="h-3 w-3" />
- </button>
- </span>
- ))}
- </div>
- )}
-
- {/* Add input */}
- <div className="flex gap-2 max-w-sm">
- <Input
- id="exclude-pattern"
- aria-label="New excluded pattern"
- value={newPattern}
- onChange={(e) => setNewPattern(e.target.value)}
- onKeyDown={(e) => {
- if (e.key === "Enter") {
- e.preventDefault();
- addPattern(newPattern);
- }
- }}
- placeholder="e.g. vendor/, src/generated/**, *.min.js"
- className="font-mono text-xs"
- />
- <Button
- type="button"
- variant="outline"
- size="sm"
- onClick={() => addPattern(newPattern)}
- disabled={!newPattern.trim()}
- >
- Add
- </Button>
- </div>
-
- {/* Quick-add suggestions */}
- <div className="flex flex-wrap gap-1.5">
- {SUGGESTIONS.map((suggestion) => (
- <button
- key={suggestion}
- type="button"
- onClick={() => addPattern(suggestion)}
- disabled={patterns.includes(suggestion)}
- className="text-xs rounded-full border border-[var(--color-border-default)] px-2.5 py-0.5 font-mono text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] hover:bg-[var(--color-bg-inset)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed"
- >
- + {suggestion}
- </button>
- ))}
- </div>
- </div>
-
- <Button
- onClick={handleSave}
- disabled={!hasChanges || saving}
- size="sm"
- className="gap-2"
- >
- <Save className="h-3.5 w-3.5" />
- {saving ? "Saving…" : "Save changes"}
- </Button>
- </div>
- );
-}
diff --git a/packages/web/src/components/repos/run-config-form.tsx b/packages/web/src/components/repos/run-config-form.tsx
index ea1d1aac5..168eaf0f7 100644
--- a/packages/web/src/components/repos/run-config-form.tsx
+++ b/packages/web/src/components/repos/run-config-form.tsx
@@ -2,17 +2,17 @@
import { useEffect } from "react";
import { config } from "@/lib/config";
-import { Label } from "@/components/ui/label";
-import { Input } from "@/components/ui/input";
-import { Switch } from "@/components/ui/switch";
-import { Slider } from "@/components/ui/slider";
+import { Label } from "@repowise-dev/ui/ui/label";
+import { Input } from "@repowise-dev/ui/ui/input";
+import { Switch } from "@repowise-dev/ui/ui/switch";
+import { Slider } from "@repowise-dev/ui/ui/slider";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
-} from "@/components/ui/select";
+} from "@repowise-dev/ui/ui/select";
export interface RunConfig {
provider: string;
diff --git a/packages/web/src/components/search/command-palette.tsx b/packages/web/src/components/search/command-palette.tsx
index 95d3c16cc..5b292f973 100644
--- a/packages/web/src/components/search/command-palette.tsx
+++ b/packages/web/src/components/search/command-palette.tsx
@@ -5,7 +5,7 @@ import { useRouter } from "next/navigation";
import { Command } from "cmdk";
import { Search, LayoutDashboard, Settings, BookOpen, Layers, Link2, GitMerge } from "lucide-react";
import { useSearch } from "@/lib/hooks/use-search";
-import { truncatePath } from "@/lib/utils/format";
+import { truncatePath } from "@repowise-dev/ui/lib/format";
import type { RepoResponse, WorkspaceResponse } from "@/lib/api/types";
interface CommandPaletteProps {
@@ -63,7 +63,7 @@ export function CommandPalette({ repos, workspace }: CommandPaletteProps) {
<Command.Input
value={query}
onValueChange={setQuery}
- placeholder="Search pages, navigate repos…"
+ placeholder="Search pages, navigate repos…"
className="flex-1 bg-transparent text-sm text-[var(--color-text-primary)] outline-none placeholder:text-[var(--color-text-tertiary)]"
/>
<kbd className="hidden sm:inline-flex items-center rounded border border-[var(--color-border-default)] px-1.5 py-0.5 text-xs text-[var(--color-text-tertiary)] font-mono">
@@ -73,7 +73,7 @@ export function CommandPalette({ repos, workspace }: CommandPaletteProps) {
<Command.List className="max-h-[60dvh] overflow-y-auto py-2">
<Command.Empty className="px-4 py-8 text-center text-sm text-[var(--color-text-tertiary)]">
- {isLoading ? "Searching…" : "No results found."}
+ {isLoading ? "Searching…" : "No results found."}
</Command.Empty>
{/* Quick navigation */}
@@ -172,8 +172,8 @@ export function CommandPalette({ repos, workspace }: CommandPaletteProps) {
</Command.List>
<div className="border-t border-[var(--color-border-default)] px-4 py-2 flex items-center gap-4 text-xs text-[var(--color-text-tertiary)]">
- <span>↑↓ navigate</span>
- <span>↵ select</span>
+ <span>↑↓ navigate</span>
+ <span>↵ select</span>
<span>esc close</span>
</div>
</div>
diff --git a/packages/web/src/components/search/search-bar.tsx b/packages/web/src/components/search/search-bar.tsx
index e10309be6..352b183fa 100644
--- a/packages/web/src/components/search/search-bar.tsx
+++ b/packages/web/src/components/search/search-bar.tsx
@@ -1,7 +1,7 @@
"use client";
import { Search } from "lucide-react";
-import { Input } from "@/components/ui/input";
+import { Input } from "@repowise-dev/ui/ui/input";
import { cn } from "@/lib/utils/cn";
type SearchType = "fulltext" | "semantic";
@@ -28,7 +28,7 @@ export function SearchBar({
<Input
value={query}
onChange={(e) => onQueryChange(e.target.value)}
- placeholder="Search wiki pages…"
+ placeholder="Search wiki pages…"
className="pl-9"
autoFocus
/>
diff --git a/packages/web/src/components/search/search-result-card.tsx b/packages/web/src/components/search/search-result-card.tsx
index 97dcba5a0..28caa7fd6 100644
--- a/packages/web/src/components/search/search-result-card.tsx
+++ b/packages/web/src/components/search/search-result-card.tsx
@@ -1,6 +1,6 @@
import Link from "next/link";
-import { Badge } from "@/components/ui/badge";
-import { truncatePath } from "@/lib/utils/format";
+import { Badge } from "@repowise-dev/ui/ui/badge";
+import { truncatePath } from "@repowise-dev/ui/lib/format";
import { cn } from "@/lib/utils/cn";
import type { SearchResultResponse } from "@/lib/api/types";
diff --git a/packages/web/src/components/settings/connection-section.tsx b/packages/web/src/components/settings/connection-section.tsx
index 3b563e211..fd6cf986b 100644
--- a/packages/web/src/components/settings/connection-section.tsx
+++ b/packages/web/src/components/settings/connection-section.tsx
@@ -5,10 +5,10 @@ import { CheckCircle, XCircle, Loader2 } from "lucide-react";
import { toast } from "sonner";
import { config } from "@/lib/config";
import { getHealth } from "@/lib/api/health";
-import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card";
-import { Label } from "@/components/ui/label";
-import { Input } from "@/components/ui/input";
-import { Button } from "@/components/ui/button";
+import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@repowise-dev/ui/ui/card";
+import { Label } from "@repowise-dev/ui/ui/label";
+import { Input } from "@repowise-dev/ui/ui/input";
+import { Button } from "@repowise-dev/ui/ui/button";
import type { HealthResponse } from "@/lib/api/types";
export function ConnectionSection() {
@@ -87,7 +87,7 @@ export function ConnectionSection() {
<Input
id="api-key"
type="password"
- placeholder="Optional — only required if REPOWISE_API_KEY is set on the server"
+ placeholder="Optional — only required if REPOWISE_API_KEY is set on the server"
value={apiKey}
onChange={(e) => setApiKey(e.target.value)}
onBlur={save}
@@ -112,7 +112,7 @@ export function ConnectionSection() {
{health && (
<span className="flex items-center gap-1.5 text-sm text-[var(--color-fresh)]">
<CheckCircle className="h-4 w-4" />
- Connected · v{health.version} · DB {health.db}
+ Connected · v{health.version} · DB {health.db}
</span>
)}
{error && (
diff --git a/packages/web/src/components/settings/mcp-section.tsx b/packages/web/src/components/settings/mcp-section.tsx
index 79ac36cd4..0471441c1 100644
--- a/packages/web/src/components/settings/mcp-section.tsx
+++ b/packages/web/src/components/settings/mcp-section.tsx
@@ -2,8 +2,8 @@
import { useState } from "react";
import { Copy, Check } from "lucide-react";
-import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card";
-import { Button } from "@/components/ui/button";
+import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@repowise-dev/ui/ui/card";
+import { Button } from "@repowise-dev/ui/ui/button";
const MCP_CONFIG = JSON.stringify(
{
diff --git a/packages/web/src/components/settings/provider-section.tsx b/packages/web/src/components/settings/provider-section.tsx
index 338deb624..c935d74b0 100644
--- a/packages/web/src/components/settings/provider-section.tsx
+++ b/packages/web/src/components/settings/provider-section.tsx
@@ -2,17 +2,17 @@
import { useState, useEffect } from "react";
import { config } from "@/lib/config";
-import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card";
-import { Label } from "@/components/ui/label";
-import { Input } from "@/components/ui/input";
-import { Badge } from "@/components/ui/badge";
+import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@repowise-dev/ui/ui/card";
+import { Label } from "@repowise-dev/ui/ui/label";
+import { Input } from "@repowise-dev/ui/ui/input";
+import { Badge } from "@repowise-dev/ui/ui/badge";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
-} from "@/components/ui/select";
+} from "@repowise-dev/ui/ui/select";
const PROVIDERS = ["gemini", "openai", "anthropic", "ollama", "litellm", "mock"] as const;
const EMBEDDERS = ["mock", "gemini", "openai"] as const;
@@ -176,12 +176,12 @@ export function ProviderSection() {
{embedderVars.map((v) => (
<code key={v} className="font-mono">{v}</code>
))}{" "}
- — set <code className="font-mono">REPOWISE_EMBEDDER={embedder}</code> on the server.
+ — set <code className="font-mono">REPOWISE_EMBEDDER={embedder}</code> on the server.
</p>
)}
{embedder === "mock" && (
<p className="text-xs text-[var(--color-text-tertiary)]">
- Using mock embedder — semantic search disabled. Set{" "}
+ Using mock embedder — semantic search disabled. Set{" "}
<code className="font-mono">REPOWISE_EMBEDDER=gemini</code> or{" "}
<code className="font-mono">REPOWISE_EMBEDDER=openai</code> for real RAG.
</p>
@@ -210,14 +210,14 @@ export function ProviderSection() {
disabled={testStatus === "testing"}
className="text-sm px-3 py-1.5 rounded-md border border-[var(--color-border)] hover:bg-[var(--color-bg-secondary)] disabled:opacity-50 transition-colors"
>
- {testStatus === "testing" ? "Testing…" : "Test connection"}
+ {testStatus === "testing" ? "Testing…" : "Test connection"}
</button>
{testStatus === "ok" && (
- <span className="text-sm text-green-600 dark:text-green-400">✓ Server healthy</span>
+ <span className="text-sm text-green-600 dark:text-green-400">✓ Server healthy</span>
)}
{testStatus === "error" && (
<span className="text-sm text-red-600 dark:text-red-400">
- ✗ {testError || "Connection failed"}
+ ✗ {testError || "Connection failed"}
</span>
)}
</div>
diff --git a/packages/web/src/components/settings/webhook-section.tsx b/packages/web/src/components/settings/webhook-section.tsx
index 6db14cc48..8de1e3a43 100644
--- a/packages/web/src/components/settings/webhook-section.tsx
+++ b/packages/web/src/components/settings/webhook-section.tsx
@@ -2,8 +2,8 @@
import { useState } from "react";
import { Copy, Check } from "lucide-react";
-import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card";
-import { Button } from "@/components/ui/button";
+import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@repowise-dev/ui/ui/card";
+import { Button } from "@repowise-dev/ui/ui/button";
function CopyField({ label, value }: { label: string; value: string }) {
const [copied, setCopied] = useState(false);
diff --git a/packages/web/src/components/symbols/symbol-drawer-wrapper.tsx b/packages/web/src/components/symbols/symbol-drawer-wrapper.tsx
new file mode 100644
index 000000000..c20ab9be8
--- /dev/null
+++ b/packages/web/src/components/symbols/symbol-drawer-wrapper.tsx
@@ -0,0 +1,21 @@
+"use client";
+
+import { SymbolDrawer } from "@repowise-dev/ui/symbols/symbol-drawer";
+import { SymbolGraphPanelWrapper } from "./symbol-graph-panel-wrapper";
+import type { SymbolResponse } from "@/lib/api/types";
+
+interface Props {
+ symbol: SymbolResponse | null;
+ repoId: string;
+ onClose: () => void;
+}
+
+export function SymbolDrawerWrapper({ symbol, repoId, onClose }: Props) {
+ return (
+ <SymbolDrawer
+ symbol={symbol}
+ onClose={onClose}
+ graphPanel={symbol ? <SymbolGraphPanelWrapper repoId={repoId} symbol={symbol} /> : null}
+ />
+ );
+}
diff --git a/packages/web/src/components/symbols/symbol-graph-panel-wrapper.tsx b/packages/web/src/components/symbols/symbol-graph-panel-wrapper.tsx
new file mode 100644
index 000000000..903a81629
--- /dev/null
+++ b/packages/web/src/components/symbols/symbol-graph-panel-wrapper.tsx
@@ -0,0 +1,29 @@
+"use client";
+
+import { SymbolGraphPanel } from "@repowise-dev/ui/symbols/symbol-graph-panel";
+import { useGraphMetrics, useCallersCallees } from "@/lib/hooks/use-graph";
+import type { SymbolResponse } from "@/lib/api/types";
+
+interface Props {
+ repoId: string;
+ symbol: SymbolResponse;
+}
+
+export function SymbolGraphPanelWrapper({ repoId, symbol }: Props) {
+ const nodeId = `${symbol.file_path}::${symbol.name}`;
+ const { metrics, isLoading: metricsLoading } = useGraphMetrics(repoId, nodeId);
+ const { data: callData, isLoading: callsLoading } = useCallersCallees(repoId, nodeId);
+ const { data: heritageData } = useCallersCallees(repoId, nodeId, {
+ edge_types: "extends,implements",
+ });
+
+ return (
+ <SymbolGraphPanel
+ metrics={metrics}
+ metricsLoading={metricsLoading}
+ callData={callData}
+ callsLoading={callsLoading}
+ heritageData={heritageData}
+ />
+ );
+}
diff --git a/packages/web/src/components/symbols/symbol-table-wrapper.tsx b/packages/web/src/components/symbols/symbol-table-wrapper.tsx
new file mode 100644
index 000000000..56ed4ecba
--- /dev/null
+++ b/packages/web/src/components/symbols/symbol-table-wrapper.tsx
@@ -0,0 +1,99 @@
+"use client";
+
+import { useState, useMemo } from "react";
+import useSWR from "swr";
+import useSWRInfinite from "swr/infinite";
+import { SymbolTable } from "@repowise-dev/ui/symbols/symbol-table";
+import { SymbolDrawerWrapper } from "./symbol-drawer-wrapper";
+import { listSymbols } from "@/lib/api/symbols";
+import { getGraph } from "@/lib/api/graph";
+import { useDebounce } from "@/lib/hooks/use-debounce";
+import type { SymbolResponse, GraphExportResponse } from "@/lib/api/types";
+
+const LIMIT = 50;
+
+interface Props {
+ repoId: string;
+}
+
+export function SymbolTableWrapper({ repoId }: Props) {
+ const [q, setQ] = useState("");
+ const debouncedQ = useDebounce(q, 300);
+ const [kind, setKind] = useState("all");
+ const [language, setLanguage] = useState("all");
+ const [selected, setSelected] = useState<SymbolResponse | null>(null);
+
+ const { data: graphData } = useSWR<GraphExportResponse>(
+ `graph:${repoId}`,
+ () => getGraph(repoId),
+ { revalidateOnFocus: false, revalidateOnReconnect: false },
+ );
+
+ const pagerankMap = useMemo(() => {
+ if (!graphData) return new Map<string, number>();
+ const m = new Map<string, number>();
+ for (const n of graphData.nodes) m.set(n.node_id, n.pagerank);
+ return m;
+ }, [graphData]);
+
+ const { data, size, setSize, isLoading, isValidating } = useSWRInfinite<SymbolResponse[]>(
+ (pageIndex, previousPageData) => {
+ if (previousPageData && previousPageData.length < LIMIT) return null;
+ return `symbols:${repoId}:${debouncedQ}:${kind}:${language}:${pageIndex}`;
+ },
+ (key) => {
+ const pageIndex = parseInt(key.split(":").pop()!, 10);
+ return listSymbols({
+ repo_id: repoId,
+ q: debouncedQ || undefined,
+ kind: kind !== "all" ? kind : undefined,
+ language: language !== "all" ? language : undefined,
+ limit: LIMIT,
+ offset: pageIndex * LIMIT,
+ });
+ },
+ { revalidateOnFocus: false, revalidateFirstPage: false },
+ );
+
+ const items = useMemo(() => (data ? data.flat() : []), [data]);
+
+ const importanceScores = useMemo(() => {
+ const scores = new Map<string, number>();
+ for (const sym of items) {
+ const fileRank = pagerankMap.get(sym.file_path) ?? 0;
+ const complexity = Math.max(1, sym.complexity_estimate);
+ scores.set(sym.id, fileRank * (1 + Math.log(complexity)));
+ }
+ const max = Math.max(...scores.values(), 0.0001);
+ for (const [k, v] of scores) scores.set(k, v / max);
+ return scores;
+ }, [items, pagerankMap]);
+
+ const lastPage = data ? data[data.length - 1] : undefined;
+ const hasMore = lastPage?.length === LIMIT;
+
+ return (
+ <SymbolTable
+ items={items}
+ importanceScores={importanceScores}
+ isLoading={isLoading}
+ isValidating={isValidating}
+ hasMore={hasMore}
+ q={q}
+ onQChange={setQ}
+ kind={kind}
+ onKindChange={setKind}
+ language={language}
+ onLanguageChange={setLanguage}
+ onLoadMore={() => setSize(size + 1)}
+ onSelect={setSelected}
+ drawer={
+ <SymbolDrawerWrapper
+ symbol={selected}
+ repoId={repoId}
+ onClose={() => setSelected(null)}
+ />
+ }
+ />
+ );
+}
diff --git a/packages/web/src/components/wiki/regenerate-button.tsx b/packages/web/src/components/wiki/regenerate-button.tsx
index 450113cf4..7642b1a16 100644
--- a/packages/web/src/components/wiki/regenerate-button.tsx
+++ b/packages/web/src/components/wiki/regenerate-button.tsx
@@ -2,24 +2,18 @@
import { useState } from "react";
import { toast } from "sonner";
-import { RefreshCw } from "lucide-react";
import { useSWRConfig } from "swr";
+import { RegenerateButton as RegenerateButtonShell } from "@repowise-dev/ui/wiki/regenerate-button";
import { regeneratePage } from "@/lib/api/pages";
-import { Button } from "@/components/ui/button";
-import {
- Dialog,
- DialogContent,
- DialogHeader,
- DialogTitle,
-} from "@/components/ui/dialog";
-import { GenerationProgress } from "@/components/jobs/generation-progress";
+import { GenerationProgressWrapper as GenerationProgress } from "@/components/jobs/generation-progress-wrapper";
interface Props {
pageId: string;
+ // repoId retained for parent compat; not currently consumed in the wrapper.
repoId: string;
}
-export function RegenerateButton({ pageId, repoId }: Props) {
+export function RegenerateButtonWrapper({ pageId }: Props) {
const { mutate } = useSWRConfig();
const [loading, setLoading] = useState(false);
const [jobId, setJobId] = useState<string | null>(null);
@@ -41,34 +35,17 @@ export function RegenerateButton({ pageId, repoId }: Props) {
function handleDone() {
// Revalidate the page data so confidence badge and content refresh
- mutate(`/api/pages/lookup?page_id=${pageId}`);
+ void mutate(`/api/pages/lookup?page_id=${pageId}`);
setJobId(null);
}
return (
- <>
- <Button
- variant="ghost"
- size="sm"
- onClick={handleRegenerate}
- disabled={loading || !!jobId}
- className="h-7 gap-1.5 text-xs"
- aria-label="Regenerate this page"
- >
- <RefreshCw className={`h-3.5 w-3.5 ${loading ? "animate-spin" : ""}`} />
- <span className="hidden sm:inline">Regenerate</span>
- </Button>
-
- <Dialog open={!!jobId} onOpenChange={(v) => { if (!v) setJobId(null); }}>
- <DialogContent className="sm:max-w-md">
- <DialogHeader>
- <DialogTitle>Regenerating Page</DialogTitle>
- </DialogHeader>
- {jobId && (
- <GenerationProgress jobId={jobId} onDone={handleDone} />
- )}
- </DialogContent>
- </Dialog>
- </>
+ <RegenerateButtonShell
+ onRegenerate={handleRegenerate}
+ isLoading={loading}
+ isInProgress={!!jobId}
+ onDialogClose={() => setJobId(null)}
+ jobSlot={jobId ? <GenerationProgress jobId={jobId} onDone={handleDone} /> : null}
+ />
);
}
diff --git a/packages/web/src/components/wiki/security-panel.tsx b/packages/web/src/components/wiki/security-panel.tsx
index 84f3f8955..3521aa0d1 100644
--- a/packages/web/src/components/wiki/security-panel.tsx
+++ b/packages/web/src/components/wiki/security-panel.tsx
@@ -1,63 +1,21 @@
"use client";
import useSWR from "swr";
-import { Badge } from "@/components/ui/badge";
+import type { SecurityFinding } from "@repowise-dev/types";
+import { SecurityPanel as SecurityPanelShell } from "@repowise-dev/ui/wiki/security-panel";
import { listSecurityFindings } from "@/lib/api/security";
-import type { SecurityFinding } from "@/lib/api/security";
-interface SecurityPanelProps {
+interface Props {
repoId: string;
filePath: string;
}
-function severityVariant(severity: string): "outdated" | "stale" | "default" {
- if (severity === "high") return "outdated";
- if (severity === "med") return "stale";
- return "default";
-}
-
-function severityLabel(severity: string): string {
- if (severity === "high") return "High";
- if (severity === "med") return "Med";
- return "Low";
-}
-
-export function SecurityPanel({ repoId, filePath }: SecurityPanelProps) {
+export function SecurityPanelWrapper({ repoId, filePath }: Props) {
const { data: findings, isLoading } = useSWR<SecurityFinding[]>(
["security", repoId, filePath],
() => listSecurityFindings(repoId, { file_path: filePath, limit: 20 }),
{ revalidateOnFocus: false },
);
- if (isLoading) return null;
- if (!findings || findings.length === 0) {
- return (
- <p className="text-xs text-[var(--color-text-tertiary)]">No security signals.</p>
- );
- }
-
- return (
- <div className="space-y-2">
- {findings.map((f) => (
- <div
- key={f.id}
- className="rounded border border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] p-2 space-y-1"
- >
- <div className="flex items-center gap-1.5 flex-wrap">
- <Badge variant={severityVariant(f.severity)} className="text-[10px] px-1 py-0 leading-4">
- {severityLabel(f.severity)}
- </Badge>
- <span className="text-xs font-medium text-[var(--color-text-secondary)] truncate">
- {f.kind}
- </span>
- </div>
- {f.snippet && (
- <pre className="text-[10px] font-mono text-[var(--color-text-tertiary)] whitespace-pre-wrap break-all line-clamp-3 leading-relaxed">
- {f.snippet.length > 120 ? f.snippet.slice(0, 120) + "…" : f.snippet}
- </pre>
- )}
- </div>
- ))}
- </div>
- );
+ return <SecurityPanelShell findings={findings} isLoading={isLoading} />;
}
diff --git a/packages/web/src/components/wiki/version-history.tsx b/packages/web/src/components/wiki/version-history.tsx
index 3895c95a3..8880f076a 100644
--- a/packages/web/src/components/wiki/version-history.tsx
+++ b/packages/web/src/components/wiki/version-history.tsx
@@ -1,218 +1,24 @@
"use client";
-import { useState } from "react";
-import { ChevronDown, ChevronRight, Clock, Diff, ArrowLeft } from "lucide-react";
-import { cn } from "@/lib/utils/cn";
+import type { DocPageVersion } from "@repowise-dev/types";
+import { VersionHistory as VersionHistoryShell } from "@repowise-dev/ui/wiki/version-history";
import { usePageVersions } from "@/lib/hooks/use-page";
-import { Badge } from "@/components/ui/badge";
-import { formatRelativeTime } from "@/lib/utils/format";
-import type { PageVersionResponse } from "@/lib/api/types";
-interface VersionHistoryProps {
+interface Props {
pageId: string;
currentVersion: number;
currentContent: string;
}
-export function VersionHistory({ pageId, currentVersion, currentContent }: VersionHistoryProps) {
+export function VersionHistoryWrapper({ pageId, currentVersion, currentContent }: Props) {
const { versions, isLoading } = usePageVersions(pageId);
- const [expanded, setExpanded] = useState(false);
- const [selectedVersion, setSelectedVersion] = useState<PageVersionResponse | null>(null);
- const [showDiff, setShowDiff] = useState(false);
-
- if (isLoading || versions.length === 0) return null;
-
- if (selectedVersion) {
- return (
- <div className="border border-[var(--color-border-default)] rounded-lg overflow-hidden">
- {/* Header */}
- <div className="flex items-center justify-between px-4 py-2 bg-[var(--color-bg-elevated)] border-b border-[var(--color-border-default)]">
- <button
- onClick={() => { setSelectedVersion(null); setShowDiff(false); }}
- className="flex items-center gap-1.5 text-xs text-[var(--color-accent-primary)] hover:underline"
- >
- <ArrowLeft className="h-3 w-3" />
- Back to versions
- </button>
- <div className="flex items-center gap-2">
- <span className="text-xs text-[var(--color-text-tertiary)]">
- v{selectedVersion.version}
- </span>
- <button
- onClick={() => setShowDiff((d) => !d)}
- className={cn(
- "flex items-center gap-1 text-xs px-2 py-0.5 rounded border transition-colors",
- showDiff
- ? "bg-[var(--color-accent-primary)]/10 border-[var(--color-accent-primary)]/30 text-[var(--color-accent-primary)]"
- : "border-[var(--color-border-default)] text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)]",
- )}
- >
- <Diff className="h-3 w-3" />
- {showDiff ? "Showing diff" : "Show diff"}
- </button>
- </div>
- </div>
-
- {/* Content */}
- <div className="max-h-[500px] overflow-auto p-4">
- {showDiff ? (
- <DiffView oldContent={selectedVersion.content} newContent={currentContent} />
- ) : (
- <pre className="text-xs font-mono text-[var(--color-text-secondary)] whitespace-pre-wrap leading-relaxed">
- {selectedVersion.content}
- </pre>
- )}
- </div>
- </div>
- );
- }
-
- return (
- <div className="border border-[var(--color-border-default)] rounded-lg overflow-hidden">
- <button
- onClick={() => setExpanded((e) => !e)}
- className="flex items-center justify-between w-full px-4 py-2 bg-[var(--color-bg-elevated)] hover:bg-[var(--color-bg-elevated)]/80 transition-colors"
- >
- <div className="flex items-center gap-1.5">
- <Clock className="h-3.5 w-3.5 text-[var(--color-text-tertiary)]" />
- <span className="text-xs font-medium text-[var(--color-text-secondary)]">
- Version History
- </span>
- <Badge variant="outline" className="text-[10px] ml-1">
- {versions.length} versions
- </Badge>
- </div>
- {expanded ? (
- <ChevronDown className="h-3.5 w-3.5 text-[var(--color-text-tertiary)]" />
- ) : (
- <ChevronRight className="h-3.5 w-3.5 text-[var(--color-text-tertiary)]" />
- )}
- </button>
-
- {expanded && (
- <div className="divide-y divide-[var(--color-border-default)]">
- {/* Current version */}
- <div className="flex items-center justify-between px-4 py-2 bg-[var(--color-accent-primary)]/5">
- <div className="flex items-center gap-2">
- <span className="text-xs font-mono text-[var(--color-accent-primary)]">
- v{currentVersion}
- </span>
- <Badge variant="accent" className="text-[10px]">current</Badge>
- </div>
- </div>
-
- {/* Previous versions */}
- {versions.map((v) => (
- <button
- key={v.id}
- onClick={() => setSelectedVersion(v)}
- className="flex items-center justify-between w-full px-4 py-2 hover:bg-[var(--color-bg-elevated)] transition-colors text-left"
- >
- <div className="flex items-center gap-2 min-w-0">
- <span className="text-xs font-mono text-[var(--color-text-secondary)]">
- v{v.version}
- </span>
- <span className="text-[10px] text-[var(--color-text-tertiary)] font-mono truncate">
- {v.model_name}
- </span>
- </div>
- <span className="text-[10px] text-[var(--color-text-tertiary)] shrink-0 ml-2">
- {formatRelativeTime(v.archived_at)}
- </span>
- </button>
- ))}
- </div>
- )}
- </div>
- );
-}
-
-function DiffView({ oldContent, newContent }: { oldContent: string; newContent: string }) {
- const oldLines = oldContent.split("\n");
- const newLines = newContent.split("\n");
-
- // Simple line-by-line diff (LCS-based)
- const diff = computeLineDiff(oldLines, newLines);
return (
- <div className="text-xs font-mono space-y-0">
- {diff.map((line, i) => (
- <div
- key={i}
- className={cn(
- "px-2 py-0.5 whitespace-pre-wrap break-all",
- line.type === "added" && "bg-green-500/10 text-green-400",
- line.type === "removed" && "bg-red-500/10 text-red-400",
- line.type === "unchanged" && "text-[var(--color-text-tertiary)]",
- )}
- >
- <span className="inline-block w-4 text-right mr-2 select-none opacity-50">
- {line.type === "added" ? "+" : line.type === "removed" ? "-" : " "}
- </span>
- {line.text}
- </div>
- ))}
- </div>
+ <VersionHistoryShell
+ versions={versions as DocPageVersion[]}
+ currentVersion={currentVersion}
+ currentContent={currentContent}
+ isLoading={isLoading}
+ />
);
}
-
-interface DiffLine {
- type: "added" | "removed" | "unchanged";
- text: string;
-}
-
-function computeLineDiff(oldLines: string[], newLines: string[]): DiffLine[] {
- // Build LCS table
- const m = oldLines.length;
- const n = newLines.length;
-
- // For very large files, fall back to a simpler approach
- if (m * n > 500_000) {
- return simpleDiff(oldLines, newLines);
- }
-
- const dp: number[][] = Array.from({ length: m + 1 }, () =>
- Array(n + 1).fill(0),
- );
-
- for (let i = 1; i <= m; i++) {
- for (let j = 1; j <= n; j++) {
- if (oldLines[i - 1] === newLines[j - 1]) {
- dp[i][j] = dp[i - 1][j - 1] + 1;
- } else {
- dp[i][j] = Math.max(dp[i - 1][j], dp[i][j - 1]);
- }
- }
- }
-
- // Backtrack to produce diff
- const result: DiffLine[] = [];
- let i = m;
- let j = n;
- while (i > 0 || j > 0) {
- if (i > 0 && j > 0 && oldLines[i - 1] === newLines[j - 1]) {
- result.unshift({ type: "unchanged", text: oldLines[i - 1] });
- i--;
- j--;
- } else if (j > 0 && (i === 0 || dp[i][j - 1] >= dp[i - 1][j])) {
- result.unshift({ type: "added", text: newLines[j - 1] });
- j--;
- } else {
- result.unshift({ type: "removed", text: oldLines[i - 1] });
- i--;
- }
- }
-
- return result;
-}
-
-function simpleDiff(oldLines: string[], newLines: string[]): DiffLine[] {
- const result: DiffLine[] = [];
- for (const line of oldLines) {
- result.push({ type: "removed", text: line });
- }
- for (const line of newLines) {
- result.push({ type: "added", text: line });
- }
- return result;
-}
diff --git a/packages/web/src/components/wiki/wiki-renderer.tsx b/packages/web/src/components/wiki/wiki-renderer.tsx
index 7ab3f9426..2d580b152 100644
--- a/packages/web/src/components/wiki/wiki-renderer.tsx
+++ b/packages/web/src/components/wiki/wiki-renderer.tsx
@@ -1,126 +1,30 @@
import { MDXRemote } from "next-mdx-remote/rsc";
import { codeToHtml } from "shiki";
-import { CodeBlock } from "./code-block";
-import { MermaidDiagram } from "./mermaid-diagram";
-
-// ---------------------------------------------------------------------------
-// Custom MDX components
-// ---------------------------------------------------------------------------
-
-function slugify(text: string): string {
- return text
- .toLowerCase()
- .replace(/[^\w\s-]/g, "")
- .replace(/\s+/g, "-");
-}
-
-function extractText(node: unknown): string {
- if (typeof node === "string") return node;
- if (Array.isArray(node)) return node.map(extractText).join("");
- if (node && typeof node === "object" && "props" in node) {
- const props = (node as { props?: { children?: unknown } }).props;
- return extractText(props?.children);
- }
- return "";
-}
-
-const mdxComponents = {
- // Code blocks — pass Shiki-highlighted HTML via a server action wrapper
- // The actual Shiki call happens in the pre/code override below.
- h1: (props: React.HTMLAttributes<HTMLHeadingElement>) => {
- // Downgrade article-body H1 to H2 to keep the page header as the sole H1.
- const id = slugify(extractText(props.children));
- return <h2 id={id} className="mt-8 mb-4 text-xl font-semibold text-[var(--color-text-primary)] first:mt-0 scroll-mt-16" {...props} />;
- },
- h2: (props: React.HTMLAttributes<HTMLHeadingElement>) => {
- const id = slugify(extractText(props.children));
- return <h2 id={id} className="mt-6 mb-3 text-lg font-semibold text-[var(--color-text-primary)] scroll-mt-16" {...props} />;
- },
- h3: (props: React.HTMLAttributes<HTMLHeadingElement>) => {
- const id = slugify(extractText(props.children));
- return <h3 id={id} className="mt-5 mb-2 text-base font-semibold text-[var(--color-text-primary)] scroll-mt-16" {...props} />;
- },
- p: (props: React.HTMLAttributes<HTMLParagraphElement>) => (
- <p className="mb-4 text-sm leading-7 text-[var(--color-text-secondary)]" {...props} />
- ),
- ul: (props: React.HTMLAttributes<HTMLUListElement>) => (
- <ul className="mb-4 ml-4 space-y-1 list-disc text-sm text-[var(--color-text-secondary)]" {...props} />
- ),
- ol: (props: React.HTMLAttributes<HTMLOListElement>) => (
- <ol className="mb-4 ml-4 space-y-1 list-decimal text-sm text-[var(--color-text-secondary)]" {...props} />
- ),
- li: (props: React.HTMLAttributes<HTMLLIElement>) => (
- <li className="leading-6" {...props} />
- ),
- blockquote: (props: React.HTMLAttributes<HTMLQuoteElement>) => (
- <blockquote
- className="my-4 border-l-2 border-[var(--color-accent-primary)] pl-4 text-sm italic text-[var(--color-text-tertiary)]"
- {...props}
- />
- ),
- table: (props: React.HTMLAttributes<HTMLTableElement>) => (
- <div className="my-4 overflow-x-auto rounded border border-[var(--color-border-default)]">
- <table className="w-full text-sm" {...props} />
- </div>
- ),
- thead: (props: React.HTMLAttributes<HTMLTableSectionElement>) => (
- <thead className="bg-[var(--color-bg-elevated)]" {...props} />
- ),
- th: (props: React.HTMLAttributes<HTMLTableCellElement>) => (
- <th
- className="px-4 py-2 text-left text-xs font-medium text-[var(--color-text-tertiary)] uppercase tracking-wider"
- {...props}
- />
- ),
- td: (props: React.HTMLAttributes<HTMLTableCellElement>) => (
- <td
- className="px-4 py-2 text-sm text-[var(--color-text-secondary)] border-t border-[var(--color-border-default)]"
- {...props}
- />
- ),
- hr: () => <hr className="my-6 border-[var(--color-border-default)]" />,
- a: (props: React.AnchorHTMLAttributes<HTMLAnchorElement>) => (
- <a
- className="text-[var(--color-accent-primary)] underline underline-offset-2 hover:opacity-80 transition-opacity"
- {...props}
- />
- ),
- strong: (props: React.HTMLAttributes<HTMLElement>) => (
- <strong className="font-semibold text-[var(--color-text-primary)]" {...props} />
- ),
- code: (props: React.HTMLAttributes<HTMLElement>) => (
- <code
- className="rounded bg-[var(--color-bg-elevated)] px-1.5 py-0.5 text-xs font-mono text-[var(--color-accent-primary)]"
- {...props}
- />
- ),
-};
-
-// ---------------------------------------------------------------------------
-// WikiRenderer — server component
-// ---------------------------------------------------------------------------
+import { CodeBlock } from "@repowise-dev/ui/wiki/code-block";
+import { MermaidDiagram } from "@repowise-dev/ui/wiki/mermaid-diagram";
+import { wikiMdxComponents } from "@repowise-dev/ui/wiki/wiki-mdx-components";
+import { preprocessWikiCodeBlocks } from "@repowise-dev/ui/wiki/wiki-mdx-preprocess";
interface Props {
content: string;
}
export async function WikiRenderer({ content }: Props) {
- // Pre-process fenced code blocks so we can pass Shiki-rendered HTML.
- // We replace ```lang\ncode\n``` with a <ShikiBlock> JSX component call
- // that embeds pre-rendered HTML as a prop. This avoids any client-side
- // Shiki import.
- const preprocessed = await preprocessCodeBlocks(content);
+ const preprocessed = await preprocessWikiCodeBlocks(content, async (code, lang) =>
+ codeToHtml(code, {
+ lang: lang as Parameters<typeof codeToHtml>[1]["lang"],
+ theme: "vesper",
+ }),
+ );
return (
<MDXRemote
source={preprocessed.source}
components={{
- ...mdxComponents,
- // ShikiBlock is injected by the preprocessor
+ ...wikiMdxComponents,
ShikiBlock: ({ html, code, lang }: { html: string; code: string; lang: string }) => (
<CodeBlock html={html} code={code} language={lang} />
),
- // MermaidBlock renders Mermaid diagrams client-side
MermaidBlock: ({ chart }: { chart: string }) => (
<MermaidDiagram chart={chart} />
),
@@ -135,61 +39,3 @@ export async function WikiRenderer({ content }: Props) {
/>
);
}
-
-// ---------------------------------------------------------------------------
-// Server-side preprocessor: replace fenced code blocks with JSX components
-// ---------------------------------------------------------------------------
-
-interface Preprocessed {
- source: string;
-}
-
-async function preprocessCodeBlocks(content: string): Promise<Preprocessed> {
- // Match fenced code blocks: ```lang\ncode\n```
- const fenceRe = /```(\w*)\n([\s\S]*?)```/g;
- const replacements: Array<{ placeholder: string; jsx: string }> = [];
-
- let match;
- let idx = 0;
- while ((match = fenceRe.exec(content)) !== null) {
- const lang = match[1] || "text";
- const code = match[2];
-
- let html = "";
- try {
- if (lang === "mermaid") {
- // Mermaid diagrams rendered client-side
- const chart = JSON.stringify(code);
- const placeholder = `PLACEHOLDER_${idx++}`;
- replacements.push({
- placeholder: `\`\`\`${lang}\n${code}\`\`\``,
- jsx: `<MermaidBlock chart={${chart}} />`,
- });
- continue;
- }
-
- html = await codeToHtml(code, {
- lang: lang as Parameters<typeof codeToHtml>[1]["lang"],
- theme: "vesper",
- });
- } catch {
- // Unknown language — fall back to plain pre
- html = `<pre><code>${code.replace(/</g, "&lt;")}</code></pre>`;
- }
-
- const htmlProp = JSON.stringify(html);
- const codeProp = JSON.stringify(code);
- replacements.push({
- placeholder: `\`\`\`${lang}\n${code}\`\`\``,
- jsx: `<ShikiBlock html={${htmlProp}} code={${codeProp}} lang="${lang}" />`,
- });
- idx++;
- }
-
- let source = content;
- for (const { placeholder, jsx } of replacements) {
- source = source.replace(placeholder, jsx);
- }
-
- return { source };
-}
diff --git a/packages/web/src/lib/api/blast-radius.ts b/packages/web/src/lib/api/blast-radius.ts
index fb328e602..32b383b4c 100644
--- a/packages/web/src/lib/api/blast-radius.ts
+++ b/packages/web/src/lib/api/blast-radius.ts
@@ -1,50 +1,17 @@
import { apiPost } from "./client";
-
-// ---------------------------------------------------------------------------
-// Types (mirror packages/server/src/repowise/server/schemas.py BlastRadius*)
-// ---------------------------------------------------------------------------
-
-export interface DirectRiskEntry {
- path: string;
- risk_score: number;
- temporal_hotspot: number;
- centrality: number;
-}
-
-export interface TransitiveEntry {
- path: string;
- depth: number;
-}
-
-export interface CochangeWarning {
- changed: string;
- missing_partner: string;
- score: number;
-}
-
-export interface ReviewerEntry {
- email: string;
- files: number;
- ownership_pct: number;
-}
-
-export interface BlastRadiusResponse {
- direct_risks: DirectRiskEntry[];
- transitive_affected: TransitiveEntry[];
- cochange_warnings: CochangeWarning[];
- recommended_reviewers: ReviewerEntry[];
- test_gaps: string[];
- overall_risk_score: number;
-}
-
-export interface BlastRadiusRequest {
- changed_files: string[];
- max_depth?: number;
-}
-
-// ---------------------------------------------------------------------------
-// API call
-// ---------------------------------------------------------------------------
+import type {
+ BlastRadiusRequest,
+ BlastRadiusResponse,
+} from "@repowise-dev/types/blast-radius";
+
+export type {
+ DirectRiskEntry,
+ TransitiveEntry,
+ CochangeWarning,
+ ReviewerEntry,
+ BlastRadiusResponse,
+ BlastRadiusRequest,
+} from "@repowise-dev/types/blast-radius";
export async function analyzeBlastRadius(
repoId: string,
diff --git a/packages/web/src/lib/hooks/use-chat.ts b/packages/web/src/lib/hooks/use-chat.ts
index c8c58660e..21cad5330 100644
--- a/packages/web/src/lib/hooks/use-chat.ts
+++ b/packages/web/src/lib/hooks/use-chat.ts
@@ -3,29 +3,12 @@
import { useCallback, useRef, useState } from "react";
import { postChatMessage, getConversation } from "@/lib/api/chat";
import type { ChatSSEEvent } from "@/lib/api/types";
+import type {
+ ChatUIToolCall as ChatToolCall,
+ ChatUIMessage as ChatMessage,
+} from "@repowise-dev/types/chat";
-// ---------------------------------------------------------------------------
-// Types
-// ---------------------------------------------------------------------------
-
-export interface ChatToolCall {
- id: string;
- name: string;
- arguments: Record<string, unknown>;
- result?: Record<string, unknown>;
- summary?: string;
- artifact?: { type: string; data: Record<string, unknown> };
- status: "running" | "done" | "error";
-}
-
-export interface ChatMessage {
- id: string;
- serverId?: string;
- role: "user" | "assistant";
- text: string;
- toolCalls: ChatToolCall[];
- isStreaming: boolean;
-}
+export type { ChatToolCall, ChatMessage };
export interface UseChatState {
messages: ChatMessage[];
diff --git a/packages/web/src/lib/utils/health-score.ts b/packages/web/src/lib/utils/health-score.ts
index e81b93aa8..00881d902 100644
--- a/packages/web/src/lib/utils/health-score.ts
+++ b/packages/web/src/lib/utils/health-score.ts
@@ -63,14 +63,8 @@ export function aggregateLanguages(
return counts;
}
-export interface AttentionItem {
- id: string;
- type: "stale_decision" | "knowledge_silo" | "ungoverned_hotspot" | "dead_code" | "proposed_decision";
- title: string;
- description: string;
- severity: "high" | "medium" | "low";
- href?: string;
-}
+export type { AttentionItem } from "@repowise-dev/ui/dashboard/attention-panel";
+import type { AttentionItem } from "@repowise-dev/ui/dashboard/attention-panel";
/** Build attention items from existing API responses */
export function buildAttentionItems(params: {
diff --git a/packages/web/src/styles/globals.css b/packages/web/src/styles/globals.css
index fd9ebb587..d44eb3c9c 100644
--- a/packages/web/src/styles/globals.css
+++ b/packages/web/src/styles/globals.css
@@ -1,314 +1,8 @@
-@import "tailwindcss";
-@plugin "@tailwindcss/typography";
-
/*
- * repowise Design System
- * "Linear's exactness + Stripe's docs quality"
- * Dark mode primary. No light mode in v1.
+ * packages/web — global stylesheet.
+ *
+ * Tokens, base styles, prose and React Flow theming live in
+ * `@repowise-dev/ui/styles.css`. App-specific overrides go below the import.
*/
-@theme {
- /* ------------------------------------------------------------------ */
- /* Core Surfaces */
- /* ------------------------------------------------------------------ */
- --color-bg-root: #0d0d0d;
- --color-bg-surface: #141414;
- --color-bg-elevated: #1c1c1c;
- --color-bg-overlay: #202020;
- --color-bg-inset: #0a0a0a;
-
- /* ------------------------------------------------------------------ */
- /* Borders */
- /* ------------------------------------------------------------------ */
- --color-border-default: rgba(255, 255, 255, 0.06);
- --color-border-hover: rgba(255, 255, 255, 0.12);
- --color-border-active: rgba(255, 255, 255, 0.20);
-
- /* ------------------------------------------------------------------ */
- /* Text */
- /* ------------------------------------------------------------------ */
- --color-text-primary: #ececec;
- --color-text-secondary: #999999;
- --color-text-tertiary: #5c5c5c;
- --color-text-inverse: #0d0d0d;
-
- /* ------------------------------------------------------------------ */
- /* Accent — repowise Orange */
- /* ------------------------------------------------------------------ */
- --color-accent-primary: #f59520;
- --color-accent-hover: #f7a94d;
- --color-accent-muted: rgba(245, 149, 32, 0.15);
-
- /* ------------------------------------------------------------------ */
- /* Confidence System */
- /* ------------------------------------------------------------------ */
- --color-confidence-fresh: #22c55e;
- --color-confidence-stale: #eab308;
- --color-confidence-outdated: #ef4444;
-
- /* ------------------------------------------------------------------ */
- /* Semantic */
- /* ------------------------------------------------------------------ */
- --color-success: #22c55e;
- --color-warning: #eab308;
- --color-error: #ef4444;
- --color-info: #f59520;
-
- /* Aliases — short names used in component class strings. */
- /* Keep these in sync with the canonical confidence/accent tokens. */
- --color-fresh: var(--color-confidence-fresh);
- --color-stale: var(--color-confidence-stale);
- --color-outdated: var(--color-confidence-outdated);
- --color-accent: var(--color-accent-primary);
- --color-accent-blue: var(--color-accent-primary);
- --color-border-accent: var(--color-accent-primary);
-
- /* ------------------------------------------------------------------ */
- /* Graph — React Flow */
- /* ------------------------------------------------------------------ */
- --color-accent-graph: #f59520;
- --color-risk-low: #22c55e;
- --color-risk-medium: #f59520;
- --color-risk-high: #ef4444;
- --color-node-documented: #22c55e;
- --color-node-undocumented: #64748b;
-
- /* ------------------------------------------------------------------ */
- /* Language Colors (graph nodes) */
- /* ------------------------------------------------------------------ */
- --color-lang-python: #3776ab;
- --color-lang-typescript: #3178c6;
- --color-lang-go: #00add8;
- --color-lang-rust: #dea584;
- --color-lang-java: #ed8b00;
- --color-lang-cpp: #00599c;
- --color-lang-config: #6b7280;
- --color-lang-other: #8b5cf6;
-
- /* ------------------------------------------------------------------ */
- /* Edge Colors (graph edges) */
- /* ------------------------------------------------------------------ */
- --color-edge-imports: #f59520;
- --color-edge-calls: #22c55e;
- --color-edge-inherits: #a855f7;
- --color-edge-implements: #ec4899;
- --color-edge-co-change: #8b5cf6;
-
- /* ------------------------------------------------------------------ */
- /* Typography */
- /* ------------------------------------------------------------------ */
- --font-sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
- --font-mono: "Geist Mono", "JetBrains Mono", "Fira Code", monospace;
-
- --text-xs: 0.8125rem;
- --text-sm: 0.875rem;
- --text-base: 0.9375rem;
- --text-lg: 1.0625rem;
- --text-xl: 1.375rem;
- --text-2xl: 1.75rem;
- --text-3xl: 2.25rem;
-
- --leading-tight: 1.3;
- --leading-normal: 1.5;
- --leading-relaxed: 1.75;
-
- /* ------------------------------------------------------------------ */
- /* Spacing (4px base grid) */
- /* ------------------------------------------------------------------ */
- --spacing-1: 0.25rem;
- --spacing-2: 0.5rem;
- --spacing-3: 0.75rem;
- --spacing-4: 1rem;
- --spacing-5: 1.25rem;
- --spacing-6: 1.5rem;
- --spacing-8: 2rem;
- --spacing-10: 2.5rem;
- --spacing-12: 3rem;
- --spacing-16: 4rem;
-
- /* ------------------------------------------------------------------ */
- /* Radii */
- /* ------------------------------------------------------------------ */
- --radius-sm: 6px;
- --radius-md: 8px;
- --radius-lg: 10px;
- --radius-xl: 14px;
-
- /* ------------------------------------------------------------------ */
- /* Z-Index Scale */
- /* ------------------------------------------------------------------ */
- --z-base: 0;
- --z-elevated: 10;
- --z-dropdown: 20;
- --z-sidebar: 30;
- --z-modal: 40;
- --z-command: 50;
- --z-toast: 60;
-
- /* ------------------------------------------------------------------ */
- /* Layout */
- /* ------------------------------------------------------------------ */
- --sidebar-width: 260px;
- --context-panel-width: 280px;
- --content-max-width: 768px;
-
- /* ------------------------------------------------------------------ */
- /* Animation */
- /* ------------------------------------------------------------------ */
- --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
- --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
- --ease-inout: cubic-bezier(0.87, 0, 0.13, 1);
- --duration-fast: 150ms;
- --duration-normal: 250ms;
- --duration-slow: 400ms;
-}
-
-/* -------------------------------------------------------------------- */
-/* Base Styles */
-/* -------------------------------------------------------------------- */
-
-html {
- color-scheme: dark;
-}
-
-body {
- background-color: var(--color-bg-root);
- color: var(--color-text-primary);
- font-family: var(--font-sans);
- font-size: var(--text-base);
- line-height: var(--leading-normal);
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-
-/* -------------------------------------------------------------------- */
-/* Scrollbar */
-/* -------------------------------------------------------------------- */
-
-::-webkit-scrollbar {
- width: 6px;
- height: 6px;
-}
-
-::-webkit-scrollbar-track {
- background: transparent;
-}
-
-::-webkit-scrollbar-thumb {
- background: rgba(255, 255, 255, 0.1);
- border-radius: 3px;
-}
-
-::-webkit-scrollbar-thumb:hover {
- background: rgba(255, 255, 255, 0.2);
-}
-
-/* -------------------------------------------------------------------- */
-/* Focus Ring */
-/* -------------------------------------------------------------------- */
-
-:focus-visible {
- outline: 2px solid var(--color-accent-primary);
- outline-offset: 2px;
-}
-
-/* -------------------------------------------------------------------- */
-/* Selection */
-/* -------------------------------------------------------------------- */
-
-::selection {
- background-color: var(--color-accent-muted);
- color: var(--color-text-primary);
-}
-
-/* -------------------------------------------------------------------- */
-/* Reduced Motion */
-/* -------------------------------------------------------------------- */
-
-@media (prefers-reduced-motion: reduce) {
- *,
- *::before,
- *::after {
- animation-duration: 0.01ms !important;
- animation-iteration-count: 1 !important;
- transition-duration: 0.01ms !important;
- scroll-behavior: auto !important;
- }
-}
-
-/* -------------------------------------------------------------------- */
-/* Typography: prose overrides for wiki content */
-/* -------------------------------------------------------------------- */
-
-.prose {
- --tw-prose-body: var(--color-text-secondary);
- --tw-prose-headings: var(--color-text-primary);
- --tw-prose-links: var(--color-accent-primary);
- --tw-prose-code: var(--color-text-primary);
- --tw-prose-pre-bg: var(--color-bg-inset);
- --tw-prose-pre-code: var(--color-text-primary);
- --tw-prose-bold: var(--color-text-primary);
- --tw-prose-counters: var(--color-text-tertiary);
- --tw-prose-bullets: var(--color-text-tertiary);
- --tw-prose-hr: var(--color-border-default);
- --tw-prose-quotes: var(--color-text-secondary);
- --tw-prose-quote-borders: var(--color-border-default);
- --tw-prose-th-borders: var(--color-border-default);
- --tw-prose-td-borders: var(--color-border-default);
-}
-
-.prose code {
- font-family: var(--font-mono);
- font-size: 0.85em;
-}
-
-.prose pre {
- border: 1px solid var(--color-border-default);
- border-radius: var(--radius-lg);
-}
-
-.prose a {
- text-decoration: none;
- border-bottom: 1px solid transparent;
- transition: border-color var(--duration-fast) var(--ease-out);
-}
-
-.prose a:hover {
- border-bottom-color: var(--color-accent-primary);
-}
-
-/* -------------------------------------------------------------------- */
-/* Tabular numbers for data tables */
-/* -------------------------------------------------------------------- */
-
-.tabular-nums {
- font-variant-numeric: tabular-nums;
-}
-
-/* -------------------------------------------------------------------- */
-/* React Flow Dark Theme */
-/* -------------------------------------------------------------------- */
-
-.react-flow {
- --xy-background-color: transparent;
- --xy-minimap-background-color: var(--color-bg-surface);
- --xy-minimap-mask-background: rgba(0, 0, 0, 0.6);
- --xy-minimap-mask-stroke: none;
- --xy-controls-button-background-color: var(--color-bg-elevated);
- --xy-controls-button-background-color-hover: var(--color-bg-overlay);
- --xy-controls-button-border-color: var(--color-border-default);
- --xy-controls-button-color: var(--color-text-secondary);
- --xy-controls-button-color-hover: var(--color-text-primary);
- --xy-edge-stroke: rgba(245, 149, 32, 0.3);
- --xy-edge-stroke-selected: var(--color-accent-graph);
- --xy-node-border-radius: var(--radius-lg);
-}
-
-@keyframes graph-path-pulse {
- 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 149, 32, 0.4); }
- 50% { box-shadow: 0 0 12px 4px rgba(245, 149, 32, 0.2); }
-}
-
-@keyframes graph-marching-ants {
- to { stroke-dashoffset: -20; }
-}
+@import "@repowise-dev/ui/styles.css";
diff --git a/pyproject.toml b/pyproject.toml
index e4922e793..88e8ea7e5 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "repowise"
-version = "0.4.1"
+version = "0.5.0"
description = "Codebase intelligence for developers and AI — generates and maintains a structured wiki for any codebase"
readme = "README.md"
requires-python = ">=3.11"
diff --git a/uv.lock b/uv.lock
index b0830508f..cc6eade18 100644
--- a/uv.lock
+++ b/uv.lock
@@ -3010,7 +3010,7 @@ wheels = [
[[package]]
name = "repowise"
-version = "0.4.0"
+version = "0.4.1"
source = { editable = "." }
dependencies = [
{ name = "aiosqlite" },