Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

feat: configure knip dead code detection for all modules (#235)

Gener3e33ae85b6e0
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8545c99da..c8c121e58 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -29,6 +29,28 @@ jobs:
- run: pnpm typecheck
- run: pnpm lint
+ knip:
+ name: Dead Code Detection (knip)
+ # Non-blocking: reports unused code but does not fail the PR.
+ # To switch to blocking mode, remove `continue-on-error: true` below.
+ runs-on: ubuntu-latest
+ timeout-minutes: 10
+ continue-on-error: true
+ strategy:
+ fail-fast: false
+ matrix:
+ module: [app, cli, email-worker, shared, web, ws-do]
+ steps:
+ - uses: actions/checkout@v6
+ - uses: pnpm/action-setup@v6
+ - uses: actions/setup-node@v6
+ with:
+ node-version: 22
+ cache: pnpm
+ - run: pnpm install --frozen-lockfile
+ - name: "knip: ${{ matrix.module }}"
+ run: pnpm --filter "./src/${{ matrix.module }}" run knip
+
test:
name: Tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 69e990a35..813008714 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -45,9 +45,6 @@ importers:
specifier: ^4.94.0
version: 4.94.0(@cloudflare/[email protected])
devDependencies:
- '@alook/cli':
- specifier: workspace:*
- version: link:../cli
'@alook/shared':
specifier: workspace:*
version: link:../shared
@@ -57,12 +54,18 @@ importers:
eslint:
specifier: ^9.39.4
version: 9.39.4([email protected])
+ knip:
+ specifier: ^6.14.2
+ version: 6.14.2
typescript:
specifier: ^6.0.3
version: 6.0.3
typescript-eslint:
specifier: ^8.59.4
+ vitest:
+ specifier: ^4.1.7
src/cli:
dependencies:
@@ -82,15 +85,15 @@ importers:
'@alook/shared':
specifier: workspace:*
version: link:../shared
- '@alook/test-utils':
- specifier: workspace:*
- version: link:../../tests/utils
'@types/bun':
specifier: ^1.3.14
version: 1.3.14
eslint:
specifier: ^10.3.0
version: 10.3.0([email protected])
+ knip:
+ specifier: ^6.14.2
+ version: 6.14.2
typescript:
specifier: ^6.0.3
version: 6.0.3
@@ -122,6 +125,9 @@ importers:
'@types/node':
specifier: ^25.9.1
version: 25.9.1
+ knip:
+ specifier: ^6.14.2
+ version: 6.14.2
typescript:
specifier: ^6.0.3
version: 6.0.3
@@ -150,6 +156,9 @@ importers:
'@types/node':
specifier: ^25.9.1
version: 25.9.1
+ knip:
+ specifier: ^6.14.2
+ version: 6.14.2
playwright-core:
specifier: ^1.60.0
version: 1.60.0
@@ -204,9 +213,6 @@ importers:
'@opennextjs/cloudflare':
specifier: ^1.19.11
- '@tiptap/extension-color':
- specifier: ^3.23.6
- version: 3.23.6(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected])))
'@tiptap/extension-image':
specifier: ^3.23.6
version: 3.23.6(@tiptap/[email protected](@tiptap/[email protected]))
@@ -222,9 +228,6 @@ importers:
'@tiptap/extension-text-align':
specifier: ^3.23.6
version: 3.23.6(@tiptap/[email protected](@tiptap/[email protected]))
- '@tiptap/extension-text-style':
- specifier: ^3.23.6
- version: 3.23.6(@tiptap/[email protected](@tiptap/[email protected]))
'@tiptap/extension-underline':
specifier: ^3.23.6
version: 3.23.6(@tiptap/[email protected](@tiptap/[email protected]))
@@ -255,12 +258,6 @@ importers:
driver.js:
specifier: ^1.4.0
version: 1.4.0
- embla-carousel-autoplay:
- specifier: ^8.6.0
- version: 8.6.0([email protected])
- embla-carousel-react:
- specifier: ^8.6.0
- version: 8.6.0([email protected])
gsap:
specifier: ^3.15.0
version: 3.15.0
@@ -322,9 +319,6 @@ importers:
'@alook/test-utils':
specifier: workspace:*
version: link:../../tests/utils
- '@eslint/eslintrc':
- specifier: ^3
- version: 3.3.5
'@lhci/cli':
specifier: ^0.15.1
version: 0.15.1
@@ -355,6 +349,9 @@ importers:
fake-indexeddb:
specifier: ^6.2.5
version: 6.2.5
+ knip:
+ specifier: ^6.14.2
+ version: 6.14.2
tailwindcss:
specifier: ^4
version: 4.3.0
@@ -383,6 +380,9 @@ importers:
'@types/node':
specifier: ^25.9.1
version: 25.9.1
+ knip:
+ specifier: ^6.14.2
+ version: 6.14.2
typescript:
specifier: ^6.0.3
version: 6.0.3
@@ -2059,9 +2059,242 @@ packages:
resolution: {integrity: sha512-/UhIkaZgPutTFmQ7RnIJGgDXZmtEJ7Dvi86xNTFWcnRxVRNk/aotsqDJYeEvDP+FSMB2SdW+pQzNMcWP0rwuNA==}
engines: {node: '>=14'}
+ '@oxc-parser/[email protected]':
+ resolution: {integrity: sha512-h/xYU8/7ADWzVSf5I+YalLpj33LOy9CI/zgbJNIZ5eunRBG+Czqa3lZsvuPHHf3rOt6z1c5+UzoxjbAzAvhwVw==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm]
+ os: [android]
+
+ '@oxc-parser/[email protected]':
+ resolution: {integrity: sha512-oFWFJrsGv9siFM4HjMqKNB7IuIZD/SMmZdCXl8xyx7lDplGvPKyewpOo272rSWgMXe2Wx7bWI0Yj+gkHv4qbeg==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm64]
+ os: [android]
+
+ '@oxc-parser/[email protected]':
+ resolution: {integrity: sha512-sGUzupdTplK9jQg7eJZ878HfEgQjJNBc6dAYVWJ9W5aU+J8rLfRJhTVsKThiu1pNwm6Y1qKCcbC6WhNWSXR3Ig==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm64]
+ os: [darwin]
+
+ '@oxc-parser/[email protected]':
+ resolution: {integrity: sha512-PsB4cdCISbC00Uy8eiD8bc2AkGWjZqrSrJnkBFuG2ptrrf6mZ2F5gLFSjOAVMMgZPg8B1D7OydJwLWSfyI2Plg==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [x64]
+ os: [darwin]
+
+ '@oxc-parser/[email protected]':
+ resolution: {integrity: sha512-DgABp3l38hS77JbXCV4qk1+n6DPym5u8zzwuweokezm2tX194nDSJDENbDRECxVsiNbprKATLbk+Z5wlHT0OHw==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [x64]
+ os: [freebsd]
+
+ '@oxc-parser/[email protected]':
+ resolution: {integrity: sha512-4Kn3CTEmwFrzhTSC/JuUW16qovmaMdX7jeSKbL8w0pLtLww7To1a2XJi9Z5uD8QWUkfUHhqfV+VD6dVzBnWzoA==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm]
+ os: [linux]
+
+ '@oxc-parser/[email protected]':
+ resolution: {integrity: sha512-D35KZM3F4rRu1uAFKyBlg3Gaf/ybCjyaPR1hfgvk5ex8NtcTmRgc0JgSighEyNg96TPrFhemFba68SZuxaha8w==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm]
+ os: [linux]
+
+ '@oxc-parser/[email protected]':
+ resolution: {integrity: sha512-Q9o7oVlo955KHwS8l1u0bCzIx+JsZUA3XToLXC+MsMhye/9LeBQbt84nh120cl2XLy+TEzvugYDiHShg5yaX6Q==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm64]
+ os: [linux]
+ libc: [glibc]
+
+ '@oxc-parser/[email protected]':
+ resolution: {integrity: sha512-EiJ/gC0ljbcwVpycC8YWw6ggMbtsPX8XMOt0mPx0aqWeMsNR+L9m05Flbvd5T+GlivG+GkSWQL7tM9SRFpM/dw==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm64]
+ os: [linux]
+ libc: [musl]
+
+ '@oxc-parser/[email protected]':
+ resolution: {integrity: sha512-b+h/lsLLurp756dMGizNs5uPaJfyEdWrTcV5t8M609jWm1DEHB1StpRXCkyvwtkJx3m+qL5BNQ0dEKan/4yGFA==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [ppc64]
+ os: [linux]
+ libc: [glibc]
+
+ '@oxc-parser/[email protected]':
+ resolution: {integrity: sha512-O19Cil83XAyjEFfo8WhkMwY58ALqZ7ckjGL+25mjMIuF84urWBeANH0FC8B8BsSSygWU3/1aY3ADdDbp+wlBnw==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [riscv64]
+ os: [linux]
+ libc: [glibc]
+
+ '@oxc-parser/[email protected]':
+ resolution: {integrity: sha512-BgXRVC0+83n3YzCscLQjj6nbyeBIVeZYPTI4fFMAE4WNm2+4RXhWp03IVizL7esIz36kgmT48aebk1iM+cs8sw==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [riscv64]
+ os: [linux]
+ libc: [musl]
+
+ '@oxc-parser/[email protected]':
+ resolution: {integrity: sha512-6tJz0xvnGhsokE7N1WlUSBXibpYmT9xSJFS1Ce41Km/+8gQvdlW8MLhRv8PD0L7ix8vRG0FDDepp3jdOFzdVdw==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [s390x]
+ os: [linux]
+ libc: [glibc]
+
+ '@oxc-parser/[email protected]':
+ resolution: {integrity: sha512-9aCWj83dp3heTQGmGnZGdIWgxjZrr/7VQ0TGFHH5PKByxJKF2Hcr4qvaSUHhhGEa3MSsDjTL1YDP8RAgdL5/Cg==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [x64]
+ os: [linux]
+ libc: [glibc]
+
+ '@oxc-parser/[email protected]':
+ resolution: {integrity: sha512-afXt87aZBqrUVli8TB/I8H1G50RDWcwirjWtXGXYqJ2ZqWEiErH7V72j3LUSDZaivmtu2OLX0KQ/mbhP81mr7A==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [x64]
+ os: [linux]
+ libc: [musl]
+
+ '@oxc-parser/[email protected]':
+ resolution: {integrity: sha512-I0NCrZV/YZuCGWgqwNN/GO/iXlLF2z+Wgc7u+Aa9N4P51oYeIa0XT+zVBUne4csO9GqxskXgI4g8JzzWGRpfOw==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm64]
+ os: [openharmony]
+
+ '@oxc-parser/[email protected]':
+ resolution: {integrity: sha512-sJgQkGaBX0WJvPUDfwciex6IcTk5O5NLQ1bhEb6f3nBruh1GshKMRSMt2bxZlYrgBzjyBbJzsnO+InPG0bg+fA==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [wasm32]
+
+ '@oxc-parser/[email protected]':
+ resolution: {integrity: sha512-bjcma99sQrNh6RY4mPO9yTkfxql6TDFoN3HWdK31RCKXwNhcDgJXW/l8PUtzKNiQ+9vpKJfJtQq+LklBuxSOBA==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm64]
+ os: [win32]
+
+ '@oxc-parser/[email protected]':
+ resolution: {integrity: sha512-hRYbv6HhpSTzT4xTiIkadLI7upLQxuOdLPR/9nL1fTjwhgutBTPXrwaAPb/jTFVx6/8C7Jb5HcUKhmNwloTbFA==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [ia32]
+ os: [win32]
+
+ '@oxc-parser/[email protected]':
+ resolution: {integrity: sha512-RBpA9TsRucJq6HNVNCFF1iKg+QeTkLdZf7hi4xaOGCPvMZWvDHjQgSOEZMUpuW4JNciHbxNhLEYmz5CVygjVGQ==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [x64]
+ os: [win32]
+
'@oxc-project/[email protected]':
resolution: {integrity: sha512-VBFWMTBvHxS11Z5Lvlr3IWgrwhMTXV+Md+EQF0Xf60+wAdsGFTBx7X7K/hP4pi8N7dcm1RvcHwDxZ16Qx8keUg==}
+ '@oxc-project/[email protected]':
+ resolution: {integrity: sha512-ibD2usx9JRu7f5pu2tMKMI4cpA4NgXJQoYRP4pQ7Pxmn1l6k/53qWtQWZayhYy3X4QZkt90Ot+mJEaeXouio6Q==}
+
+ '@oxc-resolver/[email protected]':
+ resolution: {integrity: sha512-IjfWOXRgJFNdORDl+Uf1aibNgZY2guOD3zmOhx1BGVb/MIiqlFTdmjpQNplSN58lhWehnX4UNqC3QwpUo8pjJg==}
+ cpu: [arm]
+ os: [android]
+
+ '@oxc-resolver/[email protected]':
+ resolution: {integrity: sha512-QqslZAuFQG8Q9xm7JuIn8JUbvywhSBMVhuQHtYW+auirZJloS41oxUUaBXk7uUhZJgp44c5zQLeVvmFaDQB+2Q==}
+ cpu: [arm64]
+ os: [android]
+
+ '@oxc-resolver/[email protected]':
+ resolution: {integrity: sha512-MUcavykj2ewlR+kc5arpg4tC2RvzJkUxWtNv74pf7lcNk00GpIpN43vXMj+j6r4eMmfZhlb8hueKoIb8e9kAGQ==}
+ cpu: [arm64]
+ os: [darwin]
+
+ '@oxc-resolver/[email protected]':
+ resolution: {integrity: sha512-BGB16nRUK5Etiv//ihPyzj8Lj1px0mhh4YIfe0FDf045ywknfSm0GEbiRESpr6Q4K82AvnyaRIhhluHByvS4bg==}
+ cpu: [x64]
+ os: [darwin]
+
+ '@oxc-resolver/[email protected]':
+ resolution: {integrity: sha512-JZgtePaqj3qmD5XFHJaSLWzHRxQu0LaPkdoM1KJXYADvAaa83ijXHclV3ej3CueeW0wxfIAbGCZVP45J0CA7uQ==}
+ cpu: [x64]
+ os: [freebsd]
+
+ '@oxc-resolver/[email protected]':
+ resolution: {integrity: sha512-hOQ/p3ry3v3SchUBXicrrnszaI/UmYzM4wtS4RGfwgVUX7a+HbyQSzJ5aOzu+o6XZkFkS3ZXN4PZAzhOb77OSg==}
+ cpu: [arm]
+ os: [linux]
+
+ '@oxc-resolver/[email protected]':
+ resolution: {integrity: sha512-2ArPksaw0AqeuGBfoS715VF+JvJQAhD2niWgjE5hVO+L+nAfikVQopvngCMX9x4BD8itWoQ3dnikrQyl5Ho5Jg==}
+ cpu: [arm]
+ os: [linux]
+
+ '@oxc-resolver/[email protected]':
+ resolution: {integrity: sha512-0bJnmYFp62JdZ4nVMDUZ/C58BCZOCcqgKtnUlp7L9Ojf/czIN+3j72YlLPeWLkzlr6SlYvIQA4SGV/HyO0d+qg==}
+ cpu: [arm64]
+ os: [linux]
+ libc: [glibc]
+
+ '@oxc-resolver/[email protected]':
+ resolution: {integrity: sha512-wKHHzPKZo7Ufhv/Bt6yxT7FOgnIgW4gwXcJUipkShGp68W3wGVqvr1Sr0fY65lN0Oy6y41+g2kIDvkgZaMMUkw==}
+ cpu: [arm64]
+ os: [linux]
+ libc: [musl]
+
+ '@oxc-resolver/[email protected]':
+ resolution: {integrity: sha512-RN8goF7Ie0B79L4i4G6OeBocTgSC56vJbQ65VJje+oXnldVpLnOU7j/AQ/dP94TcCS+Yh6WG8u3Qt4ETteXFNQ==}
+ cpu: [ppc64]
+ os: [linux]
+ libc: [glibc]
+
+ '@oxc-resolver/[email protected]':
+ resolution: {integrity: sha512-5l1yU6/xQEqLZRzxqmMxJfWPslpwCmBsdDGaBvABPehxquCXDC7dd7oraNdKSJUMDXSM7VvVj8H2D2FTjU7oWw==}
+ cpu: [riscv64]
+ os: [linux]
+ libc: [glibc]
+
+ '@oxc-resolver/[email protected]':
+ resolution: {integrity: sha512-xHEvkbgz6UC+A3JOyDQy76LkUaxsNSfIr3/GV8slwZsnuooJiIB34gzJfsyvR4JdCYNUUPsRJc/w/oWkODu+hg==}
+ cpu: [riscv64]
+ os: [linux]
+ libc: [musl]
+
+ '@oxc-resolver/[email protected]':
+ resolution: {integrity: sha512-aWPDUUmSeyHvlW+SoEUd+JIJsQhVhu6a5tBpDRMu058naPAchTgAVGCFy35zjbnFlt0i8hLWziff6HX0D3LU4g==}
+ cpu: [s390x]
+ os: [linux]
+ libc: [glibc]
+
+ '@oxc-resolver/[email protected]':
+ resolution: {integrity: sha512-x2YeSimvhJjKLVD8KSu8f/rqU1potcdEMkApIPJqjZWN7c2Fpt4g2X32WDg1p+XDAmyT7nuQGe0vnhvXeLbH+g==}
+ cpu: [x64]
+ os: [linux]
+ libc: [glibc]
+
+ '@oxc-resolver/[email protected]':
+ resolution: {integrity: sha512-kcRLEIxpZefeYfLChjpgFf3ilBzRDZ+yobMrpRsQlSrxuFGtm3U6PMU7AaEpMqo3NfDGVyJJseAjnRLzMFHjwQ==}
+ cpu: [x64]
+ os: [linux]
+ libc: [musl]
+
+ '@oxc-resolver/[email protected]':
+ resolution: {integrity: sha512-HHcfnApSZGtKhTiHqe8OZruOZe5XuFQH5/E0Yhj3u8fnFvzkM4/k6WjacUf4SvA0SPEAbfbgYmVPuo0VX/fIBQ==}
+ cpu: [arm64]
+ os: [openharmony]
+
+ '@oxc-resolver/[email protected]':
+ resolution: {integrity: sha512-Tn0y1XOFYHNfK1wp1Z5QK8Rcld/bsOwRISQXfqAZ5IBpv8Gz1IvV39fUWNprqNdRizgcvFhOzWwFun2zkJsyBg==}
+ engines: {node: '>=14.0.0'}
+ cpu: [wasm32]
+
+ '@oxc-resolver/[email protected]':
+ resolution: {integrity: sha512-qPi25YNPe4YenS8MgsQU2+bIFHxxpLx1LVna2444cEHqNPhNjvWf9zqj4aWE43H9LpAsTmkkAlA3eL5ElBU3mA==}
+ cpu: [arm64]
+ os: [win32]
+
+ '@oxc-resolver/[email protected]':
+ resolution: {integrity: sha512-Wb14jWEW8huH6It9F6sXd9vrYmIS7pMrgkU6sxpLxkP+9z+wRgs71hUEhRpcn8FOXAFa27FVWfY2tRpbfTzfLw==}
+ cpu: [x64]
+ os: [win32]
+
'@paulirish/[email protected]':
resolution: {integrity: sha512-PUl/vlfo08Oj804VI5nDPeSk9vyslnBlVzDDwFt8SUVxY8+KdGMkra/vrXjEEHe8gb7+RqVTfOIlGw0nyrEelA==}
@@ -2540,11 +2773,6 @@ packages:
peerDependencies:
'@tiptap/core': 3.23.6
- '@tiptap/[email protected]':
- resolution: {integrity: sha512-2WxYc+X+OGFXbq/Ak0VXODEzfK1l5wz33oTWSuhdSw44HAQM7+SSyiDnMCXDQdqi063ANqMmQmlw5WngjQ6wCA==}
- peerDependencies:
- '@tiptap/extension-text-style': 3.23.6
-
'@tiptap/[email protected]':
resolution: {integrity: sha512-XDAIgG9KcKumFM9KJWUEUhXPbFIhhl47bfy5GknareWTRKke85rcoj/oxKKO9ihLZr8JfpbXjqnS4SCm5yhYPw==}
peerDependencies:
@@ -2647,11 +2875,6 @@ packages:
peerDependencies:
'@tiptap/core': 3.23.6
- '@tiptap/[email protected]':
- resolution: {integrity: sha512-Auasgj469wkQ5ip+Zi2gaRzvqxx9qKG58+1mkT8yPE3QAGnOIg/AaKyQ7pTV77UyL3FHvLnU+KsWCad+qcobww==}
- peerDependencies:
- '@tiptap/core': 3.23.6
-
'@tiptap/[email protected]':
resolution: {integrity: sha512-ipoC2TkIAIOTiF5ByiGgvQB1DqDyfP90wrUB3mohBcgvp7lQnwHszCDGv8dNnmcUek8uXV/uoLu2VXeVQlxjPA==}
peerDependencies:
@@ -4235,24 +4458,6 @@ packages:
resolution: {integrity: sha512-Q6Hts7N9FnJc5LeGRINFvLhCI9xZmNtTDe5ZbcVezQz7cU4a8Aua3GH1b8J2XY8Al9PF+OCwYqhgsOOheMdvkA==}
- resolution: {integrity: sha512-OBu5G3nwaSXkZCo1A6LTaFMZ8EpkYbwIaH+bPqdBnDGQ2fh4+NbzjXjs2SktoPNKCtflfVMc75njaDHOYXcrsA==}
- peerDependencies:
- embla-carousel: 8.6.0
-
- resolution: {integrity: sha512-0/PjqU7geVmo6F734pmPqpyHqiM99olvyecY7zdweCw+6tKEXnrE90pBiBbMMU8s5tICemzpQ3hi5EpxzGW+JA==}
- peerDependencies:
- react: ^16.8.0 || ^17.0.1 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc
-
- resolution: {integrity: sha512-fMVUDUEx0/uIEDM0Mz3dHznDhfX+znCCDCeIophYb1QGVM7YThSWX+wz11zlYwWFOr74b4QLGg0hrGPJeG2s4A==}
- peerDependencies:
- embla-carousel: 8.6.0
-
- resolution: {integrity: sha512-SjWyZBHJPbqxHOzckOfo8lHisEaJWmwd23XppYFYVh10bU66/Pn5tkVkbkCMZVdbUE5eTCI2nD8OyIP4Z+uwkA==}
-
resolution: {integrity: sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==}
@@ -4652,6 +4857,9 @@ packages:
resolution: {integrity: sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==}
+ resolution: {integrity: sha512-jKmm9YtsNXN789RS/0mSzOC1NUq9mkVd65vbSSVsKdjGvYXBuE4oWe2QOEoFeRmJg+lPuZxpmrfFclNhoRMneQ==}
+
resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==}
@@ -4725,6 +4933,11 @@ packages:
resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==}
engines: {node: '>= 6'}
+ resolution: {integrity: sha512-9XNj/o4wrRFyhSMJOvsuyMwy8aUfBaZ1VrqHVfohyXf0Sw0e+yfKG+xZaY3arGCOMdwFsqObtzVOc1gU9KiT9w==}
+ engines: {node: '>=18.3.0'}
+ hasBin: true
+
resolution: {integrity: sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==}
engines: {node: '>= 12.20'}
@@ -5399,6 +5612,11 @@ packages:
resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==}
engines: {node: '>=6'}
+ resolution: {integrity: sha512-Vg3JhIINjZew1I7qAFI4UHemW1mc4azP/BxJvsq9eGDfxpGO7oVCuD/bsWkog9TO/ZwwJeAeOMFZ1kd9jnY9+Q==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ hasBin: true
+
resolution: {integrity: sha512-nbD8lB9EB3wNdMhOCdx5Li8DxnLbvKByylRLcJ1h+4SkrowVeECAyZlyiKMThF7xFdRz0jSQ2MoJr+wXux2y0Q==}
engines: {node: '>=20.0.0'}
@@ -6123,6 +6341,13 @@ packages:
resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==}
engines: {node: '>= 0.4'}
+ resolution: {integrity: sha512-X0PJ+NmOok8qP3vK9uaW431ngkdM9UPEK7KG466urtIL2+EYTEgbZK2yqe2MWKJKBjRlFweP/pJPx0x9muMEVw==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+
+ resolution: {integrity: sha512-CblytBiV/a/ZXY34dsVU2NxhIOxMXst8CvDCtyBelVITgd7PLrKzbEbA6oKLdPjvDKDzCiW48qzmzZ+mYaqn+g==}
+
resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==}
engines: {node: '>=6'}
@@ -6759,6 +6984,10 @@ packages:
resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==}
engines: {node: '>= 6.0.0', npm: '>= 3.0.0'}
+ resolution: {integrity: sha512-dWUG8F5sIIARXih1DTaQAX4SsiTXhInKf1buxdY9DIg4ZYPZK5nGM1VRIYmEbDbsHt7USo99xSLFu5Q1IqTmsg==}
+ engines: {node: '>= 18'}
+
resolution: {integrity: sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==}
engines: {node: '>= 14'}
@@ -6912,6 +7141,10 @@ packages:
resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}
engines: {node: '>=8'}
+ resolution: {integrity: sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw==}
+ engines: {node: '>=14.16'}
+
resolution: {integrity: sha512-ums3KNd42PGyx5xaoVTO1mjU1bH3NpY4vsrVlnv9PNGqQj8wd7rJ6nEypLrJ7z5vxK5RP0yMLo6J/Gsm62DI5Q==}
@@ -7168,6 +7401,10 @@ packages:
resolution: {integrity: sha512-yDJTmhydvl5lJzBmy/hyOAA0d+aqCBuwl818haVdYCRrWV84o7YyeVm4QlVHStqNrrJSTb6jKuFAVqAFsr+K3Q==}
+ resolution: {integrity: sha512-FeFPZ/WFT0mbRCuydiZzpPFlrYN8ZUpphQKoq4EeElVIYjYyGzPMxQR/simUwCOJIyVhpFk4RbtyO7RuMpMnHA==}
+ engines: {node: '>=14'}
+
resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==}
engines: {node: '>= 0.4'}
@@ -7389,6 +7626,10 @@ packages:
resolution: {integrity: sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==}
+ resolution: {integrity: sha512-3hu+tD8YzSLGuFYtPRb48vdhKMi0KQV5sn+uWr8+7dMEq/2G/dtLrdDinkLjqq5TIbIBjYJ4Ax/n3YiaW7QM8A==}
+ engines: {node: 20 || >=22}
+
resolution: {integrity: sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==}
@@ -9317,6 +9558,13 @@ snapshots:
'@tybys/wasm-util': 0.10.2
optional: true
+ dependencies:
+ '@emnapi/core': 1.10.0
+ '@emnapi/runtime': 1.10.0
+ '@tybys/wasm-util': 0.10.2
+ optional: true
+
dependencies:
'@emnapi/core': 1.9.2
@@ -9467,8 +9715,135 @@ snapshots:
'@opentelemetry/[email protected]': {}
+ '@oxc-parser/[email protected]':
+ optional: true
+
+ '@oxc-parser/[email protected]':
+ optional: true
+
+ '@oxc-parser/[email protected]':
+ optional: true
+
+ '@oxc-parser/[email protected]':
+ optional: true
+
+ '@oxc-parser/[email protected]':
+ optional: true
+
+ '@oxc-parser/[email protected]':
+ optional: true
+
+ '@oxc-parser/[email protected]':
+ optional: true
+
+ '@oxc-parser/[email protected]':
+ optional: true
+
+ '@oxc-parser/[email protected]':
+ optional: true
+
+ '@oxc-parser/[email protected]':
+ optional: true
+
+ '@oxc-parser/[email protected]':
+ optional: true
+
+ '@oxc-parser/[email protected]':
+ optional: true
+
+ '@oxc-parser/[email protected]':
+ optional: true
+
+ '@oxc-parser/[email protected]':
+ optional: true
+
+ '@oxc-parser/[email protected]':
+ optional: true
+
+ '@oxc-parser/[email protected]':
+ optional: true
+
+ '@oxc-parser/[email protected]':
+ dependencies:
+ '@emnapi/core': 1.10.0
+ '@emnapi/runtime': 1.10.0
+ '@napi-rs/wasm-runtime': 1.1.4(@emnapi/[email protected])(@emnapi/[email protected])
+ optional: true
+
+ '@oxc-parser/[email protected]':
+ optional: true
+
+ '@oxc-parser/[email protected]':
+ optional: true
+
+ '@oxc-parser/[email protected]':
+ optional: true
+
'@oxc-project/[email protected]': {}
+ '@oxc-project/[email protected]': {}
+
+ '@oxc-resolver/[email protected]':
+ optional: true
+
+ '@oxc-resolver/[email protected]':
+ optional: true
+
+ '@oxc-resolver/[email protected]':
+ optional: true
+
+ '@oxc-resolver/[email protected]':
+ optional: true
+
+ '@oxc-resolver/[email protected]':
+ optional: true
+
+ '@oxc-resolver/[email protected]':
+ optional: true
+
+ '@oxc-resolver/[email protected]':
+ optional: true
+
+ '@oxc-resolver/[email protected]':
+ optional: true
+
+ '@oxc-resolver/[email protected]':
+ optional: true
+
+ '@oxc-resolver/[email protected]':
+ optional: true
+
+ '@oxc-resolver/[email protected]':
+ optional: true
+
+ '@oxc-resolver/[email protected]':
+ optional: true
+
+ '@oxc-resolver/[email protected]':
+ optional: true
+
+ '@oxc-resolver/[email protected]':
+ optional: true
+
+ '@oxc-resolver/[email protected]':
+ optional: true
+
+ '@oxc-resolver/[email protected]':
+ optional: true
+
+ '@oxc-resolver/[email protected]':
+ dependencies:
+ '@emnapi/core': 1.10.0
+ '@emnapi/runtime': 1.10.0
+ '@napi-rs/wasm-runtime': 1.1.4(@emnapi/[email protected])(@emnapi/[email protected])
+ optional: true
+
+ '@oxc-resolver/[email protected]':
+ optional: true
+
+ '@oxc-resolver/[email protected]':
+ optional: true
+
'@paulirish/[email protected]':
dependencies:
legacy-javascript: 0.0.1
@@ -9937,10 +10312,6 @@ snapshots:
dependencies:
'@tiptap/core': 3.23.6(@tiptap/[email protected])
- dependencies:
- '@tiptap/extension-text-style': 3.23.6(@tiptap/[email protected](@tiptap/[email protected]))
-
dependencies:
'@tiptap/core': 3.23.6(@tiptap/[email protected])
@@ -10026,10 +10397,6 @@ snapshots:
dependencies:
'@tiptap/core': 3.23.6(@tiptap/[email protected])
- dependencies:
- '@tiptap/core': 3.23.6(@tiptap/[email protected])
-
dependencies:
'@tiptap/core': 3.23.6(@tiptap/[email protected])
@@ -11619,22 +11986,6 @@ snapshots:
- dependencies:
- embla-carousel: 8.6.0
-
- dependencies:
- embla-carousel: 8.6.0
- embla-carousel-reactive-utils: 8.6.0([email protected])
- react: 19.2.6
-
- dependencies:
- embla-carousel: 8.6.0
-
-
@@ -12376,6 +12727,10 @@ snapshots:
dependencies:
reusify: 1.1.0
+ dependencies:
+ walk-up-path: 4.0.0
+
dependencies:
pend: 1.2.0
@@ -12466,6 +12821,10 @@ snapshots:
hasown: 2.0.3
mime-types: 2.1.35
+ dependencies:
+ fd-package-json: 2.0.0
+
dependencies:
node-domexception: 1.0.0
@@ -13188,6 +13547,23 @@ snapshots:
+ dependencies:
+ fdir: 6.5.0([email protected])
+ formatly: 0.3.0
+ get-tsconfig: 4.14.0
+ jiti: 2.7.0
+ minimist: 1.2.8
+ oxc-parser: 0.130.0
+ oxc-resolver: 11.20.0
+ picomatch: 4.0.4
+ smol-toml: 1.6.1
+ strip-json-comments: 5.0.3
+ tinyglobby: 0.2.16
+ unbash: 3.0.0
+ yaml: 2.9.0
+ zod: 4.4.3
+
@@ -14195,6 +14571,53 @@ snapshots:
object-keys: 1.1.1
safe-push-apply: 1.0.0
+ dependencies:
+ '@oxc-project/types': 0.130.0
+ optionalDependencies:
+ '@oxc-parser/binding-android-arm-eabi': 0.130.0
+ '@oxc-parser/binding-android-arm64': 0.130.0
+ '@oxc-parser/binding-darwin-arm64': 0.130.0
+ '@oxc-parser/binding-darwin-x64': 0.130.0
+ '@oxc-parser/binding-freebsd-x64': 0.130.0
+ '@oxc-parser/binding-linux-arm-gnueabihf': 0.130.0
+ '@oxc-parser/binding-linux-arm-musleabihf': 0.130.0
+ '@oxc-parser/binding-linux-arm64-gnu': 0.130.0
+ '@oxc-parser/binding-linux-arm64-musl': 0.130.0
+ '@oxc-parser/binding-linux-ppc64-gnu': 0.130.0
+ '@oxc-parser/binding-linux-riscv64-gnu': 0.130.0
+ '@oxc-parser/binding-linux-riscv64-musl': 0.130.0
+ '@oxc-parser/binding-linux-s390x-gnu': 0.130.0
+ '@oxc-parser/binding-linux-x64-gnu': 0.130.0
+ '@oxc-parser/binding-linux-x64-musl': 0.130.0
+ '@oxc-parser/binding-openharmony-arm64': 0.130.0
+ '@oxc-parser/binding-wasm32-wasi': 0.130.0
+ '@oxc-parser/binding-win32-arm64-msvc': 0.130.0
+ '@oxc-parser/binding-win32-ia32-msvc': 0.130.0
+ '@oxc-parser/binding-win32-x64-msvc': 0.130.0
+
+ optionalDependencies:
+ '@oxc-resolver/binding-android-arm-eabi': 11.20.0
+ '@oxc-resolver/binding-android-arm64': 11.20.0
+ '@oxc-resolver/binding-darwin-arm64': 11.20.0
+ '@oxc-resolver/binding-darwin-x64': 11.20.0
+ '@oxc-resolver/binding-freebsd-x64': 11.20.0
+ '@oxc-resolver/binding-linux-arm-gnueabihf': 11.20.0
+ '@oxc-resolver/binding-linux-arm-musleabihf': 11.20.0
+ '@oxc-resolver/binding-linux-arm64-gnu': 11.20.0
+ '@oxc-resolver/binding-linux-arm64-musl': 11.20.0
+ '@oxc-resolver/binding-linux-ppc64-gnu': 11.20.0
+ '@oxc-resolver/binding-linux-riscv64-gnu': 11.20.0
+ '@oxc-resolver/binding-linux-riscv64-musl': 11.20.0
+ '@oxc-resolver/binding-linux-s390x-gnu': 11.20.0
+ '@oxc-resolver/binding-linux-x64-gnu': 11.20.0
+ '@oxc-resolver/binding-linux-x64-musl': 11.20.0
+ '@oxc-resolver/binding-openharmony-arm64': 11.20.0
+ '@oxc-resolver/binding-wasm32-wasi': 11.20.0
+ '@oxc-resolver/binding-win32-arm64-msvc': 11.20.0
+ '@oxc-resolver/binding-win32-x64-msvc': 11.20.0
+
dependencies:
p-try: 2.2.0
@@ -15081,6 +15504,8 @@ snapshots:
+
dependencies:
agent-base: 7.1.4
@@ -15277,6 +15702,8 @@ snapshots:
+
@@ -15573,6 +16000,8 @@ snapshots:
+
dependencies:
call-bound: 1.0.4
@@ -15772,6 +16201,8 @@ snapshots:
+
diff --git a/src/app/knip.json b/src/app/knip.json
new file mode 100644
index 000000000..3c13893da
--- /dev/null
+++ b/src/app/knip.json
@@ -0,0 +1,20 @@
+{
+ "$schema": "https://unpkg.com/knip@6/schema.json",
+ "entry": [
+ "scripts/**/*.{ts,mjs}"
+ ],
+ "project": ["src/**/*.ts"],
+ "ignoreDependencies": [
+ "citty",
+ "playwright-core",
+ "postal-mime",
+ "wrangler",
+ "bun-types"
+ ],
+ "vitest": {
+ "entry": ["test/**/*.test.ts"]
+ },
+ "eslint": {
+ "entry": ["eslint.config.mjs"]
+ }
+}
diff --git a/src/app/package.json b/src/app/package.json
index dbf0539c4..4b63ee532 100644
--- a/src/app/package.json
+++ b/src/app/package.json
@@ -33,6 +33,7 @@
"build": "bun build src/index.ts --outdir dist --target node --format esm --external commander --external wrangler && node scripts/bundle-cli.mjs",
"prepack": "pnpm run build && node -e \"const{existsSync}=require('fs');if(!existsSync('bundled/web'))throw new Error('bundled/ missing — run pnpm bundle first')\"",
"bundle": "bun run scripts/bundle.ts",
+ "knip": "knip",
"lint": "eslint src/",
"test": "vitest run"
},
@@ -44,11 +45,12 @@
"wrangler": "^4.94.0"
},
"devDependencies": {
- "@alook/cli": "workspace:*",
"@alook/shared": "workspace:*",
"@types/bun": "^1.3.14",
"eslint": "^9.39.4",
+ "knip": "^6.14.2",
"typescript": "^6.0.3",
- "typescript-eslint": "^8.59.4"
+ "typescript-eslint": "^8.59.4",
+ "vitest": "^4.1.7"
}
}
diff --git a/src/app/src/lib/register.ts b/src/app/src/lib/register.ts
index 42f5e1474..07fed105e 100644
--- a/src/app/src/lib/register.ts
+++ b/src/app/src/lib/register.ts
@@ -19,11 +19,6 @@ interface TokenResult {
id: string;
}
-interface RuntimeInfo {
- type: string;
- version: string;
-}
-
function prompt(question: string): Promise<string> {
return new Promise((resolve) => {
const rl = createInterface({ input: process.stdin, output: process.stdout });
@@ -149,40 +144,6 @@ export async function createMachineToken(
return (await res.json()) as TokenResult;
}
-export async function activateToken(
- baseURL: string,
- token: string,
- runtimes: RuntimeInfo[],
-): Promise<{ workspaceId: string; runtimeIds: string[] }> {
- const { hostname } = await import("os");
-
- const res = await fetch(`${baseURL}/api/machine-tokens/activate`, {
- method: "POST",
- headers: { "Content-Type": "application/json", Origin: baseURL },
- body: JSON.stringify({
- token,
- hostname: hostname(),
- runtimes,
- }),
- });
-
- if (!res.ok) {
- const text = await res.text();
- console.error(`Error: failed to activate token (${res.status}): ${text}`);
- process.exit(1);
- }
-
- const data = (await res.json()) as {
- workspace_id: string;
- runtimes: { id: string; provider: string }[];
- };
-
- return {
- workspaceId: data.workspace_id,
- runtimeIds: data.runtimes.map((r) => r.id),
- };
-}
-
export async function waitForServer(baseURL: string, timeoutMs = 90000): Promise<void> {
const deadline = Date.now() + timeoutMs;
let dots = 0;
diff --git a/src/cli/daemon/daemon.ts b/src/cli/daemon/daemon.ts
index 2ffb0ab1d..646707c0c 100644
--- a/src/cli/daemon/daemon.ts
+++ b/src/cli/daemon/daemon.ts
@@ -801,7 +801,7 @@ export function spawnSessionRunner(input: SessionRunnerInput): ChildProcess {
return child;
}
-export function spawnMeetingRunner(input: {
+function spawnMeetingRunner(input: {
meetingId: string;
meetingUrl: string;
participants: string[];
diff --git a/src/cli/daemon/execenv/index.ts b/src/cli/daemon/execenv/index.ts
index 1789cd629..0bf5dce6f 100644
--- a/src/cli/daemon/execenv/index.ts
+++ b/src/cli/daemon/execenv/index.ts
@@ -41,4 +41,3 @@ export function prepare(
return { workDir, timelineDir, env };
}
-export { buildInstructionContent, writeInstructionFileIfChanged, ensureSymlinks, CANONICAL_FILE } from "./context.js";
diff --git a/src/cli/daemon/execenv/timeline.ts b/src/cli/daemon/execenv/timeline.ts
index a6df1702f..e0a79b424 100644
--- a/src/cli/daemon/execenv/timeline.ts
+++ b/src/cli/daemon/execenv/timeline.ts
@@ -284,8 +284,6 @@ export function findRunningEntryByContextKey(
return null;
}
-export { localISOString };
-
// Exported for testing
export {
todayFilename as _todayFilename,
diff --git a/src/cli/daemon/health.ts b/src/cli/daemon/health.ts
index 7064cd22f..f91238043 100644
--- a/src/cli/daemon/health.ts
+++ b/src/cli/daemon/health.ts
@@ -1,32 +1,7 @@
-import { createServer, type Server, type IncomingMessage, type ServerResponse } from "http";
+import { createServer, type IncomingMessage, type ServerResponse } from "http";
const DEFAULT_HEALTH_PORT = Number(process.env.ALOOK_HEALTH_PORT) || 19514;
-export function startHealthServer(port: number = DEFAULT_HEALTH_PORT): Server {
- const startTime = Date.now();
- const runtimeCount = 0;
-
- const server = createServer((req: IncomingMessage, res: ServerResponse) => {
- if (req.url === "/health") {
- const uptime = Math.floor((Date.now() - startTime) / 1000);
- res.writeHead(200, { "Content-Type": "application/json" });
- res.end(
- JSON.stringify({
- status: "ok",
- uptime: `${uptime}s`,
- runtimes: runtimeCount,
- }),
- );
- } else {
- res.writeHead(404);
- res.end();
- }
- });
-
- server.listen(port, "127.0.0.1");
- return server;
-}
-
export function createHealthServer(port: number = DEFAULT_HEALTH_PORT) {
let runtimeCount = 0;
const startTime = Date.now();
diff --git a/src/cli/daemon/skill-scanner.test.ts b/src/cli/daemon/skill-scanner.test.ts
index 0248bae53..0312c64aa 100644
--- a/src/cli/daemon/skill-scanner.test.ts
+++ b/src/cli/daemon/skill-scanner.test.ts
@@ -96,4 +96,31 @@ describe("runScan global skills syncs to all workspaces", () => {
expect(mockClient.syncSkills).not.toHaveBeenCalled();
});
+
+ it("scans codex and opencode runtimes", async () => {
+ const home = join(tempDir, "home-multi");
+ mockState.home = home;
+
+ mkdirSync(join(home, ".agents", "skills"), { recursive: true });
+ mkdirSync(join(home, ".config", "opencode", "commands"), { recursive: true });
+
+ const wsDir = join(workspacesRoot, "ws1", "agent1");
+ mkdirSync(join(wsDir, "workdir"), { recursive: true });
+
+ startSkillScanner(mockClient as unknown as DaemonClient, {
+ workspacesRoot,
+ workspaces: [
+ { workspaceId: "ws1", token: "token-ws1", agentIds: ["agent1"] },
+ ],
+ runtimes: ["codex", "opencode"],
+ daemonId: "test-daemon-multi",
+ }, 999_999);
+
+ await new Promise((r) => setTimeout(r, 100));
+
+ const globalCalls = mockClient.syncSkills.mock.calls.filter(
+ (args) => (args[1] as { scope: string }).scope === "global"
+ );
+ expect(globalCalls.length).toBe(2);
+ });
});
diff --git a/src/cli/daemon/skill-scanner.ts b/src/cli/daemon/skill-scanner.ts
index 7d525ea5b..219b43ec0 100644
--- a/src/cli/daemon/skill-scanner.ts
+++ b/src/cli/daemon/skill-scanner.ts
@@ -8,7 +8,7 @@ import type { DaemonClient } from "./client.js";
const log = createLogger({ module: "skill-scanner" });
-export interface SkillEntry {
+interface SkillEntry {
name: string;
description: string;
}
@@ -115,7 +115,7 @@ function scanFrontmatterSkills(paths: string[]): SkillEntry[] {
return Array.from(skills.values());
}
-export function scanClaudeGlobalSkills(): SkillEntry[] {
+function scanClaudeGlobalSkills(): SkillEntry[] {
const home = homedir();
const allSkills: SkillEntry[] = [];
@@ -139,12 +139,12 @@ export function scanClaudeGlobalSkills(): SkillEntry[] {
return allSkills;
}
-export function scanClaudeAgentSkills(workdir: string): SkillEntry[] {
+function scanClaudeAgentSkills(workdir: string): SkillEntry[] {
const paths = findSkillFiles(join(workdir, ".claude", "skills"), "*/SKILL.md");
return scanFrontmatterSkills(paths);
}
-export function scanCodexGlobalSkills(): SkillEntry[] {
+function scanCodexGlobalSkills(): SkillEntry[] {
const home = homedir();
const allSkills: SkillEntry[] = [];
@@ -171,7 +171,7 @@ export function scanCodexGlobalSkills(): SkillEntry[] {
return allSkills;
}
-export function scanCodexAgentSkills(workdir: string): SkillEntry[] {
+function scanCodexAgentSkills(workdir: string): SkillEntry[] {
const paths = findSkillFiles(join(workdir, ".agents", "skills"), "*/SKILL.md");
return scanFrontmatterSkills(paths);
}
@@ -190,7 +190,7 @@ function scanOpenCodeMdFiles(dir: string): SkillEntry[] {
return skills;
}
-export function scanOpenCodeGlobalSkills(): SkillEntry[] {
+function scanOpenCodeGlobalSkills(): SkillEntry[] {
const home = homedir();
const skills: SkillEntry[] = [];
const names = new Set<string>();
@@ -206,7 +206,7 @@ export function scanOpenCodeGlobalSkills(): SkillEntry[] {
return skills;
}
-export function scanOpenCodeAgentSkills(workdir: string): SkillEntry[] {
+function scanOpenCodeAgentSkills(workdir: string): SkillEntry[] {
const skills: SkillEntry[] = [];
const names = new Set<string>();
diff --git a/src/cli/daemon/types.ts b/src/cli/daemon/types.ts
index 3b7d7f5c8..500beddb5 100644
--- a/src/cli/daemon/types.ts
+++ b/src/cli/daemon/types.ts
@@ -1,4 +1,4 @@
-export interface TaskSender {
+interface TaskSender {
name: string;
email: string;
isOwner: boolean;
@@ -31,14 +31,14 @@ export interface Attachment {
filename: string;
}
-export interface ColleagueData {
+interface ColleagueData {
name: string;
email: string;
description: string;
instruction: string;
}
-export interface TaskAgentData {
+interface TaskAgentData {
id?: string;
name: string;
instructions: string;
@@ -50,26 +50,11 @@ export interface TaskAgentData {
colleagues?: ColleagueData[];
}
-export interface RepoData {
+interface RepoData {
url: string;
description: string;
}
-export interface TaskResult {
- status: "completed" | "failed";
- comment: string;
- branchName?: string;
- sessionId?: string;
-}
-
-export interface RuntimeInfo {
- id: string;
- workspaceId: string;
- name: string;
- provider: string;
- status: string;
-}
-
export interface AgentMessage {
type:
| "text"
diff --git a/src/cli/knip.json b/src/cli/knip.json
new file mode 100644
index 000000000..3c7c7ffd8
--- /dev/null
+++ b/src/cli/knip.json
@@ -0,0 +1,19 @@
+{
+ "$schema": "https://unpkg.com/knip@6/schema.json",
+ "entry": [
+ "daemon/session-runner.ts",
+ "daemon/meeting-runner.ts",
+ "commands/**/*.ts",
+ "scripts/**/*.mjs"
+ ],
+ "project": ["src/**/*.ts", "commands/**/*.ts", "daemon/**/*.ts", "lib/**/*.ts"],
+ "ignoreDependencies": [
+ "citty"
+ ],
+ "vitest": {
+ "entry": ["**/*.test.ts"]
+ },
+ "eslint": {
+ "entry": ["eslint.config.mjs"]
+ }
+}
diff --git a/src/cli/lib/config.ts b/src/cli/lib/config.ts
index 4fd069d53..51b5de50f 100644
--- a/src/cli/lib/config.ts
+++ b/src/cli/lib/config.ts
@@ -21,7 +21,7 @@ interface CLIConfig {
profiles?: Record<string, ProfileConfig>;
}
-export type { CLIConfig, ProfileConfig, WatchedWorkspace };
+export type { CLIConfig, ProfileConfig };
export function configDir(): string {
return process.env.ALOOK_PROJECT_ROOT || join(homedir(), ".alook");
diff --git a/src/cli/package.json b/src/cli/package.json
index 935921031..be9694f37 100644
--- a/src/cli/package.json
+++ b/src/cli/package.json
@@ -40,6 +40,7 @@
"dev": "bun run src/index.ts",
"build": "bun build src/index.ts --outdir dist --target node --format esm --external citty --external commander --external postal-mime --external playwright-core && bun build daemon/session-runner.ts --outdir dist --target node --format esm --external citty --external commander --external postal-mime && bun build daemon/meeting-runner.ts --outdir dist --target node --format esm --external playwright-core && node scripts/prepare-dist.mjs",
"prepack": "pnpm run build",
+ "knip": "knip",
"test": "vitest run",
"test:integration": "vitest run --config ../../tests/integration/cli/vitest.config.ts --passWithNoTests",
"lint": "eslint .",
@@ -53,9 +54,9 @@
},
"devDependencies": {
"@alook/shared": "workspace:*",
- "@alook/test-utils": "workspace:*",
"@types/bun": "^1.3.14",
"eslint": "^10.3.0",
+ "knip": "^6.14.2",
"typescript": "^6.0.3",
"typescript-eslint": "^8.59.4",
"vitest": "^4.1.7"
diff --git a/src/email-worker/knip.json b/src/email-worker/knip.json
new file mode 100644
index 000000000..915fad04a
--- /dev/null
+++ b/src/email-worker/knip.json
@@ -0,0 +1,11 @@
+{
+ "$schema": "https://unpkg.com/knip@6/schema.json",
+ "project": ["src/**/*.ts"],
+ "includeEntryExports": true,
+ "ignoreDependencies": [
+ "cloudflare"
+ ],
+ "vitest": {
+ "entry": ["src/**/*.test.ts"]
+ }
+}
diff --git a/src/email-worker/package.json b/src/email-worker/package.json
index f585d85f5..4e0624a44 100644
--- a/src/email-worker/package.json
+++ b/src/email-worker/package.json
@@ -5,6 +5,7 @@
"scripts": {
"dev": "wrangler dev --persist-to ../web/.wrangler/state",
"deploy": "wrangler deploy",
+ "knip": "knip",
"test": "vitest run",
"typecheck": "tsc --noEmit"
},
@@ -17,6 +18,7 @@
"devDependencies": {
"@cloudflare/workers-types": "^4.20260524.1",
"@types/node": "^25.9.1",
+ "knip": "^6.14.2",
"typescript": "^6.0.3",
"vitest": "^4.1.7",
"wrangler": "^4.94.0"
diff --git a/src/email-worker/src/lib/imap-client.ts b/src/email-worker/src/lib/imap-client.ts
index c17c3000e..53ecfd97f 100644
--- a/src/email-worker/src/lib/imap-client.ts
+++ b/src/email-worker/src/lib/imap-client.ts
@@ -8,7 +8,7 @@ export interface ImapClientOptions {
readTimeoutMs?: number
}
-export class ImapError extends Error {
+class ImapError extends Error {
constructor(message: string) {
super(message)
this.name = "ImapError"
diff --git a/src/shared/knip.json b/src/shared/knip.json
new file mode 100644
index 000000000..5f9a33122
--- /dev/null
+++ b/src/shared/knip.json
@@ -0,0 +1,8 @@
+{
+ "$schema": "https://unpkg.com/knip@6/schema.json",
+ "project": ["src/**/*.ts"],
+ "include": ["files", "dependencies", "devDependencies", "unlisted"],
+ "vitest": {
+ "entry": ["src/**/*.test.ts"]
+ }
+}
diff --git a/src/shared/package.json b/src/shared/package.json
index 925eecf6e..1372c5067 100644
--- a/src/shared/package.json
+++ b/src/shared/package.json
@@ -8,6 +8,7 @@
"./browser": "./src/browser/index.ts"
},
"scripts": {
+ "knip": "knip",
"test": "vitest run",
"typecheck": "tsc --noEmit"
},
@@ -19,6 +20,7 @@
"devDependencies": {
"@cloudflare/workers-types": "^4.20260524.1",
"@types/node": "^25.9.1",
+ "knip": "^6.14.2",
"playwright-core": "^1.60.0",
"typescript": "^6.0.3",
"vitest": "^4.1.7"
diff --git a/src/web/knip.json b/src/web/knip.json
new file mode 100644
index 000000000..a44a50760
--- /dev/null
+++ b/src/web/knip.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://unpkg.com/knip@6/schema.json",
+ "entry": [
+ "src/app/**/page.tsx",
+ "src/app/**/layout.tsx",
+ "src/app/**/route.ts",
+ "src/app/**/error.tsx",
+ "src/app/**/not-found.tsx",
+ "src/app/globals.css",
+ "open-next.config.ts",
+ "scripts/**/*.{ts,mjs}"
+ ],
+ "project": ["src/**/*.{ts,tsx}", "scripts/**/*.{ts,mjs}"],
+ "ignoreDependencies": [
+ "@tailwindcss/node"
+ ],
+ "ignore": [
+ "src/components/ui/**"
+ ],
+ "vitest": {
+ "entry": ["src/**/*.test.{ts,tsx}", "src/test/**/*.{ts,tsx}"]
+ },
+ "eslint": {
+ "entry": ["eslint.config.mjs"]
+ }
+}
diff --git a/src/web/package.json b/src/web/package.json
index b4c464473..dd3292455 100644
--- a/src/web/package.json
+++ b/src/web/package.json
@@ -15,6 +15,7 @@
"test": "vitest run",
"test:watch": "vitest",
"test:e2e": "vitest run --config vitest.e2e.config.ts",
+ "knip": "knip",
"typecheck": "tsc --noEmit",
"seo:check": "lhci autorun --config=lighthouserc.json && node scripts/print-lighthouse-scores.mjs"
},
@@ -33,13 +34,11 @@
"@next/mdx": "^16.2.6",
"@next/third-parties": "^16.2.6",
"@opennextjs/cloudflare": "^1.19.11",
- "@tiptap/extension-color": "^3.23.6",
"@tiptap/extension-image": "^3.23.6",
"@tiptap/extension-link": "^3.23.6",
"@tiptap/extension-mention": "^3.23.6",
"@tiptap/extension-placeholder": "^3.23.6",
"@tiptap/extension-text-align": "^3.23.6",
- "@tiptap/extension-text-style": "^3.23.6",
"@tiptap/extension-underline": "^3.23.6",
"@tiptap/markdown": "^3.23.6",
"@tiptap/react": "^3.23.6",
@@ -50,8 +49,6 @@
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"driver.js": "^1.4.0",
- "embla-carousel-autoplay": "^8.6.0",
- "embla-carousel-react": "^8.6.0",
"gsap": "^3.15.0",
"idb": "^8.0.3",
"input-otp": "^1.4.2",
@@ -74,7 +71,6 @@
},
"devDependencies": {
"@alook/test-utils": "workspace:*",
- "@eslint/eslintrc": "^3",
"@lhci/cli": "^0.15.1",
"@tailwindcss/node": "^4.3.0",
"@tailwindcss/postcss": "^4",
@@ -85,6 +81,7 @@
"eslint-config-next": "16.2.6",
"eslint-plugin-tailwind-canonical-classes": "^1.3.3",
"fake-indexeddb": "^6.2.5",
+ "knip": "^6.14.2",
"tailwindcss": "^4",
"tsx": "^4.22.3",
"typescript": "^6.0.3",
diff --git a/src/web/src/components/agent-chat/menu-toggle-icon.tsx b/src/web/src/components/agent-chat/menu-toggle-icon.tsx
deleted file mode 100644
index e54cc2ce5..000000000
--- a/src/web/src/components/agent-chat/menu-toggle-icon.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import { Menu, X } from "lucide-react";
-import { cn } from "@/lib/utils";
-
-export function MenuToggleIcon({ open }: { open: boolean }) {
- return (
- <span className="relative size-4">
- <Menu
- className={cn(
- "size-4 absolute transition-all duration-200",
- open
- ? "opacity-0 rotate-90 scale-75"
- : "opacity-100 rotate-0 scale-100",
- )}
- />
- <X
- className={cn(
- "size-4 absolute transition-all duration-200",
- open
- ? "opacity-100 rotate-0 scale-100"
- : "opacity-0 -rotate-90 scale-75",
- )}
- />
- </span>
- );
-}
diff --git a/src/web/src/components/agent-form-fields.tsx b/src/web/src/components/agent-form-fields.tsx
index 039a7ba4f..e90a216b8 100644
--- a/src/web/src/components/agent-form-fields.tsx
+++ b/src/web/src/components/agent-form-fields.tsx
@@ -41,7 +41,6 @@ import {
type AgentAccessEntry,
type MemberEntry,
} from "@/lib/api";
-import { useAgentContext } from "@/contexts/agent-context";
import { ApiError } from "@/lib/errors";
import { toast } from "sonner";
import { Switch } from "@/components/ui/switch";
@@ -334,55 +333,6 @@ export function getHandleError(effectiveHandle: string): string {
return "";
}
-// --- Pin Toggle ---
-
-export function PinToggle({ agentId }: { agentId: string }) {
- const { pins, handlePinAgent, handleUnpinAgent } = useAgentContext();
- const isPinned = pins.has(agentId);
- const [toggling, setToggling] = useState(false);
-
- const handleToggle = async () => {
- setToggling(true);
- try {
- if (isPinned) {
- await handleUnpinAgent(agentId);
- } else {
- await handlePinAgent(agentId);
- }
- } finally {
- setToggling(false);
- }
- };
-
- return (
- <div className="space-y-4 rounded-lg border border-border/50 p-4">
- <div className="flex items-center justify-between">
- <div>
- <h3 className="text-sm font-medium">Pin to Sidebar</h3>
- <p className="text-xs text-muted-foreground mt-0.5">
- {isPinned
- ? "This agent is pinned to the top of the sidebar"
- : "Pin this agent to the top of the sidebar"}
- </p>
- </div>
- <div className="flex items-center gap-2">
- <span className="text-xs text-muted-foreground">
- {toggling ? "Saving…" : isPinned ? "Pinned" : "Unpinned"}
- </span>
- <Switch
- checked={isPinned}
- onCheckedChange={handleToggle}
- disabled={toggling}
- />
- </div>
- </div>
- <p className="text-xs text-muted-foreground/70">
- Tip: You can also right-click an agent in the sidebar to pin or unpin
- it.
- </p>
- </div>
- );
-}
// --- Allowed Senders (inline tab content) ---
diff --git a/src/web/src/components/artifact-content-renderer.tsx b/src/web/src/components/artifact-content-renderer.tsx
index 52cce4e1d..06e54ddec 100644
--- a/src/web/src/components/artifact-content-renderer.tsx
+++ b/src/web/src/components/artifact-content-renderer.tsx
@@ -16,7 +16,7 @@ const TEXT_TYPES = new Set([
"application/sql",
]);
-export function isTextType(contentType: string): boolean {
+function isTextType(contentType: string): boolean {
if (contentType.startsWith("text/")) return true;
if (TEXT_TYPES.has(contentType)) return true;
return false;
@@ -26,7 +26,7 @@ export function isHtmlType(contentType: string): boolean {
return contentType.startsWith("text/html");
}
-export function isImageType(contentType: string): boolean {
+function isImageType(contentType: string): boolean {
return contentType.startsWith("image/");
}
diff --git a/src/web/src/components/avatar/index.ts b/src/web/src/components/avatar/index.ts
index 6512b149c..c8c5c772d 100644
--- a/src/web/src/components/avatar/index.ts
+++ b/src/web/src/components/avatar/index.ts
@@ -8,6 +8,5 @@ export {
} from "./avatar-parts";
export { AnimatedAvatar } from "./animated-avatar";
-export { AvatarGenerator } from "./avatar-generator";
export { AvatarPickerDialog } from "./avatar-picker-dialog";
export { AgentAvatar } from "./agent-avatar";
diff --git a/src/web/src/components/calendar/calendar-event-sheet.tsx b/src/web/src/components/calendar/calendar-event-sheet.tsx
index 9596dce85..3f26f581c 100644
--- a/src/web/src/components/calendar/calendar-event-sheet.tsx
+++ b/src/web/src/components/calendar/calendar-event-sheet.tsx
@@ -56,7 +56,7 @@ import {
PRESET_INTERVALS,
} from "./repeat-interval-utils";
-export interface CreateFormValues {
+interface CreateFormValues {
agent_id: string;
title: string;
description?: string;
diff --git a/src/web/src/components/dashboard-navbar.tsx b/src/web/src/components/dashboard-navbar.tsx
deleted file mode 100644
index ac14e9017..000000000
--- a/src/web/src/components/dashboard-navbar.tsx
+++ /dev/null
@@ -1,422 +0,0 @@
-"use client";
-
-import { useEffect, useState, useCallback, useRef } from "react";
-import { Button } from "@/components/ui/button";
-import { Badge } from "@/components/ui/badge";
-import {
- Sheet,
- SheetContent,
- SheetHeader,
- SheetTitle,
- SheetDescription,
- SheetBody,
- SheetTrigger,
-} from "@/components/ui/sheet";
-import {
- listRuntimes,
- createMachineToken,
- deleteMachine,
-} from "@/lib/api";
-import { ConfirmDialog } from "@/components/ui/confirm-dialog";
-import { Tooltip, TooltipTrigger, TooltipContent } from "@/components/ui/tooltip";
-import { Logo } from "@/components/logo";
-import { toast } from "sonner";
-import type { AgentRuntime as Runtime } from "@alook/shared";
-import { signOut } from "@/lib/auth-client";
-import { clearAllCache } from "@/lib/chat-cache";
-import { cliCmd, daemonStartCmd } from "@/lib/utils";
-import { ProviderLogo } from "@/components/provider-logo";
-import { useCopyToClipboard } from "@/hooks/use-copy-to-clipboard";
-
-function OnboardingSteps({
- generatedToken,
- generatingToken,
- onGenerateToken,
-}: {
- generatedToken: string;
- generatingToken: boolean;
- onGenerateToken: () => void;
-}) {
- const hasTriggered = useRef(false);
- const { copy } = useCopyToClipboard();
- useEffect(() => {
- if (!generatedToken && !generatingToken && !hasTriggered.current) {
- hasTriggered.current = true;
- onGenerateToken();
- }
- }, [generatedToken, generatingToken, onGenerateToken]);
-
- return (
- <div className="space-y-6">
- <div>
- <p className="text-sm font-medium tracking-tight">
- Connect a machine
- </p>
- <p className="text-xs text-muted-foreground mt-1">
- Your machine runs AI agents locally using Claude Code, Codex, or
- OpenCode.
- </p>
- </div>
-
- {/* Step 1 — Register CLI */}
- <div className="space-y-2">
- <p className="text-xs font-medium flex items-center gap-2">
- <span className="flex items-center justify-center w-5 h-5 rounded-full bg-foreground text-background text-[10px] font-semibold">
- 1
- </span>
- Register your CLI
- </p>
- <p className="text-[11px] text-muted-foreground pl-7">
- Run this in your terminal to link your machine.
- </p>
- {generatingToken ? (
- <div className="pl-7">
- <div className="rounded-md bg-muted p-2.5 font-mono text-xs text-muted-foreground animate-pulse">
- Generating token...
- </div>
- </div>
- ) : generatedToken ? (
- <div className="pl-7 space-y-2">
- <Tooltip>
- <TooltipTrigger
- render={
- <div
- className="rounded-md bg-muted p-2.5 font-mono text-xs text-muted-foreground cursor-pointer hover:bg-muted/80 transition-colors"
- onClick={() => {
- copy(`${cliCmd()} register --token ${generatedToken}`).then(
- (ok) => { if (ok) toast.success("Copied to clipboard"); }
- );
- }}
- />
- }
- >
- {cliCmd()} register --token{" "}
- <span className="text-foreground/70">
- {generatedToken.slice(0, 12)}...
- </span>
- </TooltipTrigger>
- <TooltipContent>Click to copy</TooltipContent>
- </Tooltip>
- <Button
- size="sm"
- onClick={() => {
- copy(`${cliCmd()} register --token ${generatedToken}`);
- toast.success("Copied to clipboard");
- }}
- className="w-full"
- >
- Copy Command
- </Button>
- </div>
- ) : null}
- </div>
-
- {/* Step 2 — Start daemon */}
- <div
- className={`space-y-2 ${!generatedToken ? "opacity-40 pointer-events-none" : ""}`}
- >
- <p className="text-xs font-medium flex items-center gap-2">
- <span className="flex items-center justify-center w-5 h-5 rounded-full bg-foreground text-background text-[10px] font-semibold">
- 2
- </span>
- Start the daemon
- </p>
- <p className="text-[11px] text-muted-foreground pl-7">
- The daemon connects your local agents to Alook.
- </p>
- <Tooltip>
- <TooltipTrigger
- render={
- <div
- className="ml-7 rounded-md bg-muted p-2.5 font-mono text-xs text-muted-foreground cursor-pointer hover:bg-muted/80 transition-colors"
- onClick={() => {
- copy(daemonStartCmd()).then(
- (ok) => { if (ok) toast.success("Copied to clipboard"); }
- );
- }}
- />
- }
- >
- {daemonStartCmd()}
- </TooltipTrigger>
- <TooltipContent>Click to copy</TooltipContent>
- </Tooltip>
- </div>
- </div>
- );
-}
-
-export function DashboardNavbar() {
- const [runtimes, setRuntimes] = useState<Runtime[]>([]);
- const [runtimeSheetOpen, setRuntimeSheetOpen] = useState(false);
- const [generatedToken, setGeneratedToken] = useState("");
- const [generatingToken, setGeneratingToken] = useState(false);
- const { copy: copyToken, copied: tokenCopied } = useCopyToClipboard();
-
- // Confirm dialog state
- const [confirmOpen, setConfirmOpen] = useState(false);
- const [confirmTitle, setConfirmTitle] = useState("");
- const [confirmDescription, setConfirmDescription] = useState("");
- const [confirmLoading, setConfirmLoading] = useState(false);
- const confirmAction = useRef<(() => Promise<void>) | null>(null);
-
- const openConfirm = (
- title: string,
- description: string,
- action: () => Promise<void>
- ) => {
- setConfirmTitle(title);
- setConfirmDescription(description);
- confirmAction.current = action;
- setConfirmOpen(true);
- };
-
- const handleConfirm = async () => {
- if (!confirmAction.current) return;
- setConfirmLoading(true);
- try {
- await confirmAction.current();
- } finally {
- setConfirmLoading(false);
- setConfirmOpen(false);
- confirmAction.current = null;
- }
- };
-
- // NOTE: This component is currently unused. The workspaceId is hardcoded
- // as a placeholder — if this component is revived it needs a workspace prop.
- const workspaceId = ""
- const loadRuntimes = useCallback(async () => {
- if (!workspaceId) return
- try {
- const r = await listRuntimes(workspaceId);
- setRuntimes(r);
- } catch {
- // silent — runtimes are supplementary
- }
- }, [workspaceId]);
-
- useEffect(() => {
- loadRuntimes();
- }, [loadRuntimes]);
-
- const handleGenerateToken = async () => {
- setGeneratingToken(true);
- try {
- const res = await createMachineToken("cli", workspaceId);
- setGeneratedToken(res.token);
- } catch (err) {
- toast.error(
- err instanceof Error ? err.message : "Failed to generate token"
- );
- } finally {
- setGeneratingToken(false);
- }
- };
-
- const handleCopyToken = async () => {
- await copyToken(generatedToken);
- toast.success("Copied to clipboard");
- };
-
- return (
- <>
- <header className="border-b">
- <div className="mx-auto flex max-w-5xl items-center justify-between px-6 py-3">
- <Logo />
-
- <div className="flex items-center gap-1.5">
- <Sheet
- open={runtimeSheetOpen}
- onOpenChange={(open) => {
- setRuntimeSheetOpen(open);
- if (open) loadRuntimes();
- if (!open) {
- setGeneratedToken("");
- }
- }}
- >
- <SheetTrigger render={<Button variant="outline" size="sm" />}>
- Runtimes
- </SheetTrigger>
- <SheetContent>
- <SheetHeader>
- <SheetTitle>Runtimes</SheetTitle>
- <SheetDescription>
- Your machines and their agent runtimes.
- </SheetDescription>
- </SheetHeader>
- <SheetBody>
- {runtimes.length === 0 ? (
- <OnboardingSteps
- generatedToken={generatedToken}
- generatingToken={generatingToken}
- onGenerateToken={handleGenerateToken}
- />
- ) : (
- <div className="space-y-3">
- {(() => {
- const machines = new Map<
- string,
- { deviceInfo: string; runtimes: Runtime[] }
- >();
- for (const rt of runtimes) {
- const key = rt.daemon_id || rt.id;
- if (!machines.has(key)) {
- machines.set(key, {
- deviceInfo:
- typeof rt.device_info === "string"
- ? rt.device_info
- : "",
- runtimes: [],
- });
- }
- machines.get(key)!.runtimes.push(rt);
- }
-
- return Array.from(machines.entries()).map(
- ([daemonId, machine]) => {
- const displayName =
- machine.deviceInfo || daemonId;
-
- return (
- <div
- key={daemonId}
- className="group rounded-lg border p-3.5 space-y-3"
- >
- <div className="flex items-center justify-between">
- <span className="text-sm font-medium tracking-tight">
- {displayName}
- </span>
- <Button
- variant="ghost"
- size="sm"
- className="text-[11px] text-muted-foreground h-6 px-2 hover:text-destructive opacity-0 group-hover:opacity-100 transition-opacity"
- onClick={() => {
- openConfirm(
- "Remove machine",
- `This will remove "${displayName}" and all its runtimes. Agents using these runtimes will be unlinked.`,
- async () => {
- try {
- await deleteMachine(daemonId, workspaceId);
- const r = await listRuntimes(workspaceId);
- setRuntimes(r);
- } catch (err) {
- toast.error(
- err instanceof Error
- ? err.message
- : "Failed to remove machine"
- );
- }
- }
- );
- }}
- >
- Remove
- </Button>
- </div>
-
- <div className="space-y-2 pl-0.5">
- {machine.runtimes.map((runtime) => (
- <div
- key={runtime.id}
- className="rounded-md border border-dashed p-2.5 space-y-1"
- >
- <div className="flex items-center justify-between">
- <span className="text-xs font-medium flex items-center gap-1.5">
- <ProviderLogo provider={runtime.provider} className="h-3.5 w-3.5" />
- {runtime.provider}
- {runtime.metadata?.version ? (
- <span className="ml-1.5 font-normal text-muted-foreground">
- {String(runtime.metadata.version)}
- </span>
- ) : null}
- </span>
- <Badge
- variant={
- runtime.status === "online"
- ? "default"
- : "outline"
- }
- className="text-[10px] px-1.5 py-0"
- >
- {runtime.status}
- </Badge>
- </div>
- <p className="text-[11px] text-muted-foreground tabular-nums">
- Last seen{" "}
- {runtime.last_seen_at ? new Date(
- runtime.last_seen_at
- ).toLocaleString() : "Never"}
- </p>
- </div>
- ))}
- </div>
- </div>
- );
- }
- );
- })()}
-
- <div className="pt-3 border-t">
- {generatedToken ? (
- <div className="space-y-2">
- <div className="rounded-md bg-muted p-2.5 font-mono text-xs break-all select-all">
- {generatedToken}
- </div>
- <p className="text-[11px] text-muted-foreground">
- Copy this token now — it won&apos;t be shown again.
- </p>
- <Button
- size="sm"
- onClick={handleCopyToken}
- className="w-full"
- >
- {tokenCopied ? "Copied!" : "Copy Token"}
- </Button>
- </div>
- ) : (
- <Button
- size="sm"
- variant="ghost"
- onClick={handleGenerateToken}
- disabled={generatingToken}
- className="w-full text-xs text-muted-foreground"
- >
- {generatingToken
- ? "Generating..."
- : "Connect new machine"}
- </Button>
- )}
- </div>
- </div>
- )}
- </SheetBody>
- </SheetContent>
- </Sheet>
-
- <Button
- variant="ghost"
- size="sm"
- onClick={async () => {
- await clearAllCache();
- await signOut();
- }}
- >
- Sign Out
- </Button>
- </div>
- </div>
- </header>
-
- <ConfirmDialog
- open={confirmOpen}
- onOpenChange={setConfirmOpen}
- title={confirmTitle}
- description={confirmDescription}
- loading={confirmLoading}
- onConfirm={handleConfirm}
- />
- </>
- );
-}
diff --git a/src/web/src/components/home-pet/cloud-code-monster-pet-activity.ts b/src/web/src/components/home-pet/cloud-code-monster-pet-activity.ts
index 143d2ebe2..ad5086fbf 100644
--- a/src/web/src/components/home-pet/cloud-code-monster-pet-activity.ts
+++ b/src/web/src/components/home-pet/cloud-code-monster-pet-activity.ts
@@ -47,7 +47,7 @@ export function clampPetPosition(
};
}
-export function isCloudCodeMonsterActivityId(
+function isCloudCodeMonsterActivityId(
value: string
): value is CloudCodeMonsterActivityId {
return CLOUD_CODE_MONSTER_ACTIVITIES.some(
@@ -203,9 +203,6 @@ export function createCloudCodeMonsterPreviewAwayState(
};
}
-export function simulateCloudCodeMonsterPreviewAway(now = Date.now()) {
- writeStoredActivity(createCloudCodeMonsterPreviewAwayState(now));
-}
export function resolveCloudCodeMonsterPreviewComebackState(
now = Date.now(),
diff --git a/src/web/src/components/home-pet/cloud-code-monster-pet-types.ts b/src/web/src/components/home-pet/cloud-code-monster-pet-types.ts
index b1e972fcc..bf4570f53 100644
--- a/src/web/src/components/home-pet/cloud-code-monster-pet-types.ts
+++ b/src/web/src/components/home-pet/cloud-code-monster-pet-types.ts
@@ -31,7 +31,7 @@ export type CloudCodeMonsterActivity = {
caption: string;
};
-export type CloudCodeMonsterPresetFeature =
+type CloudCodeMonsterPresetFeature =
| "square"
| "horns"
| "ears"
@@ -64,7 +64,7 @@ export type CloudCodeMonsterPresetFeature =
| "drum"
| "sprout";
-export type CloudCodeMonsterPresetShape =
+type CloudCodeMonsterPresetShape =
| "monster"
| "gadget-buddy"
| "electric-mascot"
diff --git a/src/web/src/components/studio-onboarding/ai-tool-step.tsx b/src/web/src/components/studio-onboarding/ai-tool-step.tsx
deleted file mode 100644
index ca4dac00d..000000000
--- a/src/web/src/components/studio-onboarding/ai-tool-step.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-"use client";
-
-import type { AgentRuntime as Runtime } from "@alook/shared";
-import {
- Select,
- SelectTrigger,
- SelectValue,
- SelectContent,
- SelectItem,
-} from "@/components/ui/select";
-import { ProviderLogo } from "@/components/provider-logo";
-import type { TeamMember } from "./team-preview";
-
-export function AiToolStep({
- members,
- runtimes,
- onAssign,
-}: {
- members: TeamMember[];
- runtimes: Runtime[];
- onAssign: (memberIndex: number, runtimeId: string) => void;
-}) {
- if (runtimes.length <= 1) return null;
-
- return (
- <div className="space-y-3">
- <h2 className="text-sm font-medium">Assign execution environments</h2>
- <p className="text-xs text-muted-foreground">
- Choose which AI tool each agent uses.
- </p>
- <div className="space-y-2">
- {members.map((m, i) => (
- <div key={i} className="flex items-center gap-3">
- <span className="text-sm font-medium w-20 truncate">{m.name}</span>
- <div className="flex-1">
- <Select value={m.runtimeId} onValueChange={(val) => { if (val) onAssign(i, val); }}>
- <SelectTrigger className="h-8 text-xs">
- <SelectValue />
- </SelectTrigger>
- <SelectContent>
- {runtimes.map((rt) => (
- <SelectItem key={rt.id} value={rt.id}>
- <div className="flex items-center gap-2">
- <ProviderLogo provider={rt.provider || ""} className="size-3.5" />
- <span>{rt.provider || rt.runtime_mode} on {rt.device_info || "machine"}</span>
- </div>
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- </div>
- </div>
- ))}
- </div>
- </div>
- );
-}
diff --git a/src/web/src/components/studio-onboarding/relation-preview.tsx b/src/web/src/components/studio-onboarding/relation-preview.tsx
deleted file mode 100644
index 4bff3e0d3..000000000
--- a/src/web/src/components/studio-onboarding/relation-preview.tsx
+++ /dev/null
@@ -1,92 +0,0 @@
-"use client";
-
-import type { ScenarioId } from "./scenario-presets";
-import type { TeamMember } from "./team-preview";
-
-type RelationText = { receives: string; reports: string };
-
-const SCENARIO_RELATIONS: Record<string, Record<string, RelationText>> = {
- "software-dev": {
- researcher: {
- receives: "technical research tasks (APIs, libraries, architecture)",
- reports: "findings with code references and confidence levels",
- },
- engineer: {
- receives: "coding tasks with file paths and patterns to follow",
- reports: "verified changes with test results and self-review",
- },
- },
- "content-research": {
- researcher: {
- receives: "topics to investigate, claims to verify, sources to check",
- reports: "verified facts with source list and per-claim confidence",
- },
- assistant: {
- receives: "content to format/publish with platform and deadline",
- reports: "publication status and next steps",
- },
- },
- "sales-outreach": {
- researcher: {
- receives: "prospect research tasks with target criteria and market focus",
- reports: "actionable intelligence with prospect lists and confidence levels",
- },
- assistant: {
- receives: "outreach tasks with prospect details, messaging angle, and timeline",
- reports: "outreach status with responses received and follow-up schedule",
- },
- },
- "customer-support": {
- assistant: {
- receives: "support tickets with customer context and urgency level",
- reports: "resolution status with customer response and follow-up needs",
- },
- },
-};
-
-function getRelation(scenario: ScenarioId | undefined, role: string): RelationText {
- if (scenario && SCENARIO_RELATIONS[scenario]?.[role]) {
- return SCENARIO_RELATIONS[scenario][role];
- }
- return { receives: "delegated tasks with context", reports: "results with status updates" };
-}
-
-export function RelationPreview({ members, scenario }: { members: TeamMember[]; scenario?: ScenarioId }) {
- const leader = members.find((m) => m.role === "leader");
- const specialists = members.filter((m) => m.role !== "leader");
-
- if (!leader || specialists.length === 0) return null;
-
- return (
- <div className="space-y-3">
- <h2 className="text-base font-semibold tracking-tight">How they work together</h2>
- <div className="rounded-lg border border-border p-4 space-y-3">
- <p className="text-xs text-muted-foreground">
- You email <span className="font-medium text-foreground">{leader.name}</span> with tasks.{" "}
- {leader.name} handles them directly or delegates to specialists.
- </p>
- {specialists.map((s, i) => {
- const rel = getRelation(scenario, s.role);
- return (
- <div key={i} className="text-xs text-muted-foreground space-y-0.5">
- <p>
- <span className="font-medium text-foreground">{leader.name}</span>
- {" → "}
- <span className="font-medium text-foreground">{s.name}</span>
- {": "}
- {rel.receives}
- </p>
- <p>
- <span className="font-medium text-foreground">{s.name}</span>
- {" → "}
- <span className="font-medium text-foreground">{leader.name}</span>
- {": "}
- {rel.reports}
- </p>
- </div>
- );
- })}
- </div>
- </div>
- );
-}
diff --git a/src/web/src/components/typewriter-visual.tsx b/src/web/src/components/typewriter-visual.tsx
index ba7c0f230..a922eba8c 100644
--- a/src/web/src/components/typewriter-visual.tsx
+++ b/src/web/src/components/typewriter-visual.tsx
@@ -12,7 +12,7 @@ gsap.registerPlugin(SplitText);
// Key layout: 3 rows of oval keys (front-facing view)
const KEY_ROWS = [9, 7, 9];
-export interface TypewriterEmail {
+interface TypewriterEmail {
from: string;
to: string;
subject: string;
@@ -20,7 +20,7 @@ export interface TypewriterEmail {
}
/** Clean, professional emails — default for the homepage. First email is shown on load, rest are randomly picked. */
-export const EMAILS_DEFAULT: TypewriterEmail[] = [
+const EMAILS_DEFAULT: TypewriterEmail[] = [
{
@@ -77,63 +77,6 @@ export const EMAILS_DEFAULT: TypewriterEmail[] = [
},
];
-/** All-emoji variant — playful, visual, good for sign-in and casual pages. First email is shown on load, rest are randomly picked. */
-export const EMAILS_PLAYFUL: TypewriterEmail[] = [
- {
- from: "🤖@alook.ai",
- to: "🧑‍💻@company.com",
- subject: "🎂 Happy Birthday!",
- body: "🎉 Apr 17! 🧠 of course I remembered 💛 enjoy today, take it slow 🫶 I\u2019ll handle the rest 🥳",
- },
- {
- from: "🧑‍💻@company.com",
- to: "🤖@alook.ai",
- subject: "📝 Organize my meeting notes",
- body: "📂 /docs/notes → 🗂️ sort by project ✅ action items 🔍 flag ⏰ time-sensitive 🫡",
- },
- {
- from: "🤖@alook.ai",
- to: "🧑‍💻@company.com",
- subject: "☀️ Morning briefing — Apr 17",
- body: "🟢 CI ✅ 🔀 2 PRs merged 🔕 no alerts 📅 standup 10am 🎨 design 2pm 🔄 rebased ✨ ready!",
- },
- {
- from: "🤖@alook.ai",
- to: "🧑‍💻@company.com",
- subject: "Re: 👋 Are you there?",
- body: "💛 always here! 🌙 3am → 📬 inbox clear 🐛🐛 triaged 🚀 deploy queued ☕ go grab coffee 🫶",
- },
- {
- from: "🧑‍💻@company.com",
- to: "🤖@alook.ai",
- subject: "🔧 Refactor auth middleware",
- body: "🗂️ src/middleware/auth.ts 🧹 split → small fns ✅ error types 🧪 tests pass 🚫 no API change",
- },
- {
- from: "🤖@alook.ai",
- to: "🧑‍💻@company.com",
- subject: "📊 Weekly recap — Apr 14–17",
- body: "🔀 12 PRs ✅ 🐛 3 closed 📈 86% coverage 📅 calendar focus 💡 caching proposal? 🫡",
- },
- {
- from: "🧑‍💻@company.com",
- to: "🤖@alook.ai",
- subject: "🔍 Research vector DBs",
- body: "🧠 semantic search → pgvector vs Qdrant vs Turbopuffer 🏠 local-first ⚡ latency 🔗 SQLite compat",
- },
- {
- from: "🤖@alook.ai",
- to: "🧑‍💻@company.com",
- subject: "🚨 CI failed on main",
- body: "💥 20min ago 🧪 calendar-month-grid.test.ts 🐛 off-by-one week boundary 🔧 fix ready → push? 🫡",
- },
- {
- from: "🧑‍💻@company.com",
- to: "🤖@alook.ai",
- subject: "🎬 Prep tomorrow's demo",
- body: "📅 2pm demo 🚀 staging up-to-date 🌱 seed test data 📝 walkthrough script ⏱️ under 5min",
- },
-];
const DAYS_IN_MONTH = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
const MONTH_NAMES = Array.from({ length: 12 }, (_, i) =>
diff --git a/src/web/src/components/ui/carousel.tsx b/src/web/src/components/ui/carousel.tsx
deleted file mode 100644
index 9deee76e2..000000000
--- a/src/web/src/components/ui/carousel.tsx
+++ /dev/null
@@ -1,242 +0,0 @@
-"use client"
-
-import * as React from "react"
-import useEmblaCarousel, {
- type UseEmblaCarouselType,
-} from "embla-carousel-react"
-
-import { cn } from "@/lib/utils"
-import { Button } from "@/components/ui/button"
-import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react"
-
-type CarouselApi = UseEmblaCarouselType[1]
-type UseCarouselParameters = Parameters<typeof useEmblaCarousel>
-type CarouselOptions = UseCarouselParameters[0]
-type CarouselPlugin = UseCarouselParameters[1]
-
-type CarouselProps = {
- opts?: CarouselOptions
- plugins?: CarouselPlugin
- orientation?: "horizontal" | "vertical"
- setApi?: (api: CarouselApi) => void
-}
-
-type CarouselContextProps = {
- carouselRef: ReturnType<typeof useEmblaCarousel>[0]
- api: ReturnType<typeof useEmblaCarousel>[1]
- scrollPrev: () => void
- scrollNext: () => void
- canScrollPrev: boolean
- canScrollNext: boolean
-} & CarouselProps
-
-const CarouselContext = React.createContext<CarouselContextProps | null>(null)
-
-function useCarousel() {
- const context = React.useContext(CarouselContext)
-
- if (!context) {
- throw new Error("useCarousel must be used within a <Carousel />")
- }
-
- return context
-}
-
-function Carousel({
- orientation = "horizontal",
- opts,
- setApi,
- plugins,
- className,
- children,
- ...props
-}: React.ComponentProps<"div"> & CarouselProps) {
- const [carouselRef, api] = useEmblaCarousel(
- {
- ...opts,
- axis: orientation === "horizontal" ? "x" : "y",
- },
- plugins
- )
- const [canScrollPrev, setCanScrollPrev] = React.useState(false)
- const [canScrollNext, setCanScrollNext] = React.useState(false)
-
- const onSelect = React.useCallback((api: CarouselApi) => {
- if (!api) return
- setCanScrollPrev(api.canScrollPrev())
- setCanScrollNext(api.canScrollNext())
- }, [])
-
- const scrollPrev = React.useCallback(() => {
- api?.scrollPrev()
- }, [api])
-
- const scrollNext = React.useCallback(() => {
- api?.scrollNext()
- }, [api])
-
- const handleKeyDown = React.useCallback(
- (event: React.KeyboardEvent<HTMLDivElement>) => {
- if (event.key === "ArrowLeft") {
- event.preventDefault()
- scrollPrev()
- } else if (event.key === "ArrowRight") {
- event.preventDefault()
- scrollNext()
- }
- },
- [scrollPrev, scrollNext]
- )
-
- React.useEffect(() => {
- if (!api || !setApi) return
- setApi(api)
- }, [api, setApi])
-
- React.useEffect(() => {
- if (!api) return
- onSelect(api)
- api.on("reInit", onSelect)
- api.on("select", onSelect)
-
- return () => {
- api?.off("select", onSelect)
- }
- }, [api, onSelect])
-
- return (
- <CarouselContext.Provider
- value={{
- carouselRef,
- api: api,
- opts,
- orientation:
- orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
- scrollPrev,
- scrollNext,
- canScrollPrev,
- canScrollNext,
- }}
- >
- <div
- onKeyDownCapture={handleKeyDown}
- className={cn("relative", className)}
- role="region"
- aria-roledescription="carousel"
- data-slot="carousel"
- {...props}
- >
- {children}
- </div>
- </CarouselContext.Provider>
- )
-}
-
-function CarouselContent({ className, ...props }: React.ComponentProps<"div">) {
- const { carouselRef, orientation } = useCarousel()
-
- return (
- <div
- ref={carouselRef}
- className="overflow-hidden"
- data-slot="carousel-content"
- >
- <div
- className={cn(
- "flex",
- orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
- className
- )}
- {...props}
- />
- </div>
- )
-}
-
-function CarouselItem({ className, ...props }: React.ComponentProps<"div">) {
- const { orientation } = useCarousel()
-
- return (
- <div
- role="group"
- aria-roledescription="slide"
- data-slot="carousel-item"
- className={cn(
- "min-w-0 shrink-0 grow-0 basis-full",
- orientation === "horizontal" ? "pl-4" : "pt-4",
- className
- )}
- {...props}
- />
- )
-}
-
-function CarouselPrevious({
- className,
- variant = "outline",
- size = "icon-sm",
- ...props
-}: React.ComponentProps<typeof Button>) {
- const { orientation, scrollPrev, canScrollPrev } = useCarousel()
-
- return (
- <Button
- data-slot="carousel-previous"
- variant={variant}
- size={size}
- className={cn(
- "absolute touch-manipulation rounded-full",
- orientation === "horizontal"
- ? "top-1/2 -left-12 -translate-y-1/2"
- : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
- className
- )}
- disabled={!canScrollPrev}
- onClick={scrollPrev}
- {...props}
- >
- <ChevronLeftIcon />
- <span className="sr-only">Previous slide</span>
- </Button>
- )
-}
-
-function CarouselNext({
- className,
- variant = "outline",
- size = "icon-sm",
- ...props
-}: React.ComponentProps<typeof Button>) {
- const { orientation, scrollNext, canScrollNext } = useCarousel()
-
- return (
- <Button
- data-slot="carousel-next"
- variant={variant}
- size={size}
- className={cn(
- "absolute touch-manipulation rounded-full",
- orientation === "horizontal"
- ? "top-1/2 -right-12 -translate-y-1/2"
- : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
- className
- )}
- disabled={!canScrollNext}
- onClick={scrollNext}
- {...props}
- >
- <ChevronRightIcon />
- <span className="sr-only">Next slide</span>
- </Button>
- )
-}
-
-export {
- type CarouselApi,
- Carousel,
- CarouselContent,
- CarouselItem,
- CarouselPrevious,
- CarouselNext,
- useCarousel,
-}
diff --git a/src/web/src/components/workspace-redirect.tsx b/src/web/src/components/workspace-redirect.tsx
deleted file mode 100644
index e757d4fc7..000000000
--- a/src/web/src/components/workspace-redirect.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-"use client"
-
-import { useEffect } from "react"
-import { useRouter } from "next/navigation"
-
-export function WorkspaceRedirect() {
- const router = useRouter()
-
- useEffect(() => {
- const slug = localStorage.getItem("lastWorkspace")
- router.replace(slug ? `/w/${slug}/home` : "/workspaces?auto")
- }, [router])
-
- return null
-}
diff --git a/src/web/src/lib/api-auth.ts b/src/web/src/lib/api-auth.ts
deleted file mode 100644
index 4b7c0b7c0..000000000
--- a/src/web/src/lib/api-auth.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { getCloudflareContext } from "@opennextjs/cloudflare"
-import { queries } from "@alook/shared"
-import { getDb } from "@/lib/db"
-
-export async function withToken(request: Request) {
- const authHeader = request.headers.get("Authorization")
- if (!authHeader?.startsWith("Bearer ")) {
- return { error: new Response("Unauthorized", { status: 401 }), machineToken: null }
- }
- const raw = authHeader.slice(7)
- if (!raw.startsWith("al_")) {
- return { error: new Response("Invalid token format", { status: 401 }), machineToken: null }
- }
- const { env } = await getCloudflareContext({ async: true })
- const db = getDb((env as Env).DB)
- const mt = await queries.machineToken.getMachineTokenByToken(db, raw)
- if (!mt) {
- return { error: new Response("Token not found", { status: 401 }), machineToken: null }
- }
- queries.machineToken.updateMachineTokenLastUsed(db, mt.id).catch(() => {})
- return { error: null, machineToken: mt }
-}
diff --git a/src/web/src/lib/broadcast.ts b/src/web/src/lib/broadcast.ts
index 014ad98bf..f95acf5cf 100644
--- a/src/web/src/lib/broadcast.ts
+++ b/src/web/src/lib/broadcast.ts
@@ -64,13 +64,6 @@ export function broadcastToUser(userId: string, message: WsMessage): Promise<voi
)
}
-export function broadcastToAgent(agentId: string, message: WsMessage): Promise<void> {
- return sendBroadcast(
- `/broadcast/${agentId}`,
- JSON.stringify(message),
- { agentId, type: message.type },
- )
-}
export function broadcastToDaemon(daemonId: string, message: DaemonPushMessage): Promise<{ sent: number }> {
const promise = doSend(
diff --git a/src/web/src/lib/dual-auth.ts b/src/web/src/lib/dual-auth.ts
deleted file mode 100644
index cf1a2f6e4..000000000
--- a/src/web/src/lib/dual-auth.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { getCloudflareContext } from "@opennextjs/cloudflare"
-import { queries } from "@alook/shared"
-import { getDb } from "@/lib/db"
-import { createAuth } from "@/lib/auth"
-
-export async function requireAuth(request: Request) {
- const { env } = await getCloudflareContext({ async: true })
- const cloudflareEnv = env as Env
-
- const authHeader = request.headers.get("Authorization")
- if (authHeader?.startsWith("Bearer ")) {
- const raw = authHeader.slice(7)
- if (raw.startsWith("al_")) {
- const db = getDb(cloudflareEnv.DB)
- const mt = await queries.machineToken.getMachineTokenByToken(db, raw)
- if (mt) {
- queries.machineToken.updateMachineTokenLastUsed(db, mt.id).catch(() => {})
- return { userId: mt.userId, email: mt.userEmail, workspaceId: mt.workspaceId ?? undefined, error: null }
- }
- }
- }
-
- const auth = createAuth(cloudflareEnv)
- const session = await auth.api.getSession({ headers: request.headers })
- if (session) {
- return { userId: session.user.id, email: session.user.email, workspaceId: undefined, error: null }
- }
-
- return { userId: null, email: null, workspaceId: undefined, error: new Response("Unauthorized", { status: 401 }) }
-}
diff --git a/src/web/src/lib/home-pet-settings.ts b/src/web/src/lib/home-pet-settings.ts
index 9ad6417ff..37d7c57fa 100644
--- a/src/web/src/lib/home-pet-settings.ts
+++ b/src/web/src/lib/home-pet-settings.ts
@@ -2,8 +2,8 @@
import { useEffect, useState } from "react";
-export const HOME_PET_SETTINGS_CHANGED_EVENT = "alook-home-pet-settings-changed";
-export const HOME_PET_ENABLED_STORAGE_KEY = "alook-home-pet-enabled-v1";
+const HOME_PET_SETTINGS_CHANGED_EVENT = "alook-home-pet-settings-changed";
+const HOME_PET_ENABLED_STORAGE_KEY = "alook-home-pet-enabled-v1";
export type HomePetSettings = {
enabled: boolean;
diff --git a/src/web/src/lib/logger.test.ts b/src/web/src/lib/logger.test.ts
index edf773f89..f1e5a5e0d 100644
--- a/src/web/src/lib/logger.test.ts
+++ b/src/web/src/lib/logger.test.ts
@@ -1,5 +1,5 @@
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
-import { Logger } from "./logger";
+import { Logger } from "@alook/shared";
let logSpy: ReturnType<typeof vi.spyOn>;
let errorSpy: ReturnType<typeof vi.spyOn>;
diff --git a/src/web/src/lib/logger.ts b/src/web/src/lib/logger.ts
index 61b145026..8abec6310 100644
--- a/src/web/src/lib/logger.ts
+++ b/src/web/src/lib/logger.ts
@@ -1,7 +1,4 @@
-import { Logger, createLogger } from "@alook/shared"
-
-export type { LogLevel, LoggerOptions } from "@alook/shared"
-export { Logger, createLogger }
+import { createLogger } from "@alook/shared"
export const log = createLogger({
service: "web",
diff --git a/src/web/src/lib/middleware/workspace.ts b/src/web/src/lib/middleware/workspace.ts
index 5abf03c58..f0b849a64 100644
--- a/src/web/src/lib/middleware/workspace.ts
+++ b/src/web/src/lib/middleware/workspace.ts
@@ -5,11 +5,6 @@ import { getDb } from "@/lib/db"
import { cached, cacheKeys } from "@/lib/cache"
import type { AuthContext } from "./auth"
-export interface WorkspaceContext extends AuthContext {
- workspaceId: string
- memberRole: string
-}
-
export async function withWorkspaceMember(
req: NextRequest,
auth: AuthContext & { params?: Record<string, string> }
diff --git a/src/web/src/lib/storage.ts b/src/web/src/lib/storage.ts
deleted file mode 100644
index 572ce8aaa..000000000
--- a/src/web/src/lib/storage.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-export async function saveEmailToR2(
- bucket: R2Bucket,
- emailId: string,
- rawEmail: ReadableStream | ArrayBuffer,
-) {
- const key = `emails/${emailId}/raw`
- await bucket.put(key, rawEmail, {
- httpMetadata: { contentType: "message/rfc822" },
- })
- return key
-}
-
-export async function getEmailPresignedUrl(bucket: R2Bucket, r2Key: string): Promise<string> {
- return r2Key
-}
-
-export async function streamEmailBody(bucket: R2Bucket, r2Key: string) {
- const obj = await bucket.get(r2Key)
- if (!obj) return null
- return obj.body
-}
diff --git a/src/ws-do/knip.json b/src/ws-do/knip.json
new file mode 100644
index 000000000..a55d83df0
--- /dev/null
+++ b/src/ws-do/knip.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "https://unpkg.com/knip@6/schema.json",
+ "project": ["src/**/*.ts"],
+ "ignore": ["src/__mocks__/**"],
+ "includeEntryExports": true,
+ "ignoreDependencies": [
+ "cloudflare"
+ ],
+ "vitest": {
+ "entry": ["src/**/*.test.ts"]
+ }
+}
diff --git a/src/ws-do/package.json b/src/ws-do/package.json
index b233e107d..0089f1b96 100644
--- a/src/ws-do/package.json
+++ b/src/ws-do/package.json
@@ -5,6 +5,7 @@
"scripts": {
"dev": "wrangler dev --persist-to ../web/.wrangler/state",
"deploy": "wrangler deploy",
+ "knip": "knip",
"test": "vitest run --passWithNoTests"
},
"dependencies": {
@@ -13,6 +14,7 @@
"devDependencies": {
"@cloudflare/workers-types": "^4.20260524.1",
"@types/node": "^25.9.1",
+ "knip": "^6.14.2",
"typescript": "^6.0.3",
"vitest": "^4.1.7",
"wrangler": "^4.94.0"