Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:

jobs:
build:
name: Type-check + build
name: Lint + type-check + build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand Down Expand Up @@ -66,6 +66,13 @@ jobs:
- name: Install dependencies
run: pnpm install --no-frozen-lockfile

# Lint ran on nothing for months: `next lint` was removed in Next 16
# and no eslint config existed, so `pnpm lint` just errored and no
# workflow called it. Wired in here so it cannot rot silently again.
# Source-only — needs no content sync.
- name: Lint
run: pnpm lint

# `prebuild` + `pretypecheck` both run scripts/sync-content.mjs
# which clones github.com/agentproto/ts into .cache/ at depth 1.
# Public repo — no auth needed.
Expand Down
49 changes: 49 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// ESLint flat config — Next.js 16 dropped the `next lint` subcommand, so
// `pnpm lint` runs the `eslint` binary directly against this file.
//
// `eslint-config-next` ships flat configs natively (no @eslint/eslintrc
// FlatCompat shim needed). `core-web-vitals` already spreads the base
// `eslint-config-next` config, so the two entries below are the flat
// equivalent of the legacy `extends: ["next/core-web-vitals",
// "next/typescript"]`.
//
// Kept byte-identical with the sibling repo (agentproto/site ⇄
// agentproto/cli-site) — the two are near-identical Next + fumadocs
// codebases sharing components and scripts.
import nextCoreWebVitals from "eslint-config-next/core-web-vitals"
import nextTypescript from "eslint-config-next/typescript"

const config = [
{
// `eslint-config-next` already ignores .next/, out/, build/ and
// next-env.d.ts. These are the repo-specific generated trees:
// .source/ — fumadocs-mdx compiled content tree
// .cache/ — depth-1 clone of the upstream content repo, pulled by
// scripts/sync-content.mjs at dev/build time
// content/ — synced MDX + authored specs, not linted as source
ignores: [".source/**", ".cache/**", ".turbo/**", "content/**"],
},
{
// A stale `eslint-disable` is how lint silently rots: the rule stops
// running, the comment stays, nobody notices. Fail on it — in editors
// too, which a CLI flag would not cover.
linterOptions: { reportUnusedDisableDirectives: "error" },
},
...nextCoreWebVitals,
...nextTypescript,
{
rules: {
// React-Compiler-era advisories, new in eslint-plugin-react-hooks v7
// (pulled in by eslint-config-next 16). They are performance advice,
// not correctness bugs, and the cli-site daemon panel is built on the
// patterns they flag: reset-state-on-session-change effects and refs
// mirrored during render. Converting ~11 of those call sites is a
// behavioural refactor of a live interactive UI — its own change, not
// a rider on the lint migration. Off for now, tracked separately.
"react-hooks/set-state-in-effect": "off",
"react-hooks/refs": "off",
},
},
]

export default config
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"prebuild": "node scripts/sync-content.mjs",
"build": "next build",
"start": "next start",
"lint": "next lint",
"lint": "eslint . --max-warnings=0",
"pretypecheck": "node scripts/sync-content.mjs && fumadocs-mdx",
"typecheck": "tsc --noEmit",
"clean": "rm -rf .next .source content/docs .cache"
Expand All @@ -41,6 +41,8 @@
"@types/node": "^24.12.3",
"@types/react": "19.2.14",
"@types/react-dom": "19.2.3",
"eslint": "^9.39.4",
"eslint-config-next": "^16.2.6",
"tailwindcss": "^4.3.0",
"typescript": "^5.9.3"
},
Expand Down
4 changes: 3 additions & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export default {
const config = {
plugins: {
"@tailwindcss/postcss": {},
},
}

export default config
3 changes: 1 addition & 2 deletions src/components/SessionChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ function parseCost(n: number): string {
* Accepts any wire value — normalises to string via toDisplayText first. */
function cleanToolText(raw: unknown): string {
const s0 = toDisplayText(raw)
// eslint-disable-next-line no-control-regex
let s = s0.replace(/\x1b\[[0-9;]*[A-Za-z]/g, "")
s = s.replace(/\[[0-9;]*m/g, "")
s = s
Expand Down Expand Up @@ -952,7 +951,7 @@ export function SessionChatView({ daemonUrl, sessionId, sessionStatus }: Props)
}}
>
<div>no structured transcript for this session</div>
<div style={{ fontSize: 10 }}>PTY / terminal sessions don't produce a structured export</div>
<div style={{ fontSize: 10 }}>PTY / terminal sessions don&apos;t produce a structured export</div>
</div>
)}

Expand Down
2 changes: 1 addition & 1 deletion src/components/SessionTerminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function attachPty({
}
})

sock.addEventListener("close", ev => {
sock.addEventListener("close", () => {
if (!active || exited) return
attempts++
if (attempts > MAX) {
Expand Down
1 change: 0 additions & 1 deletion src/components/ToolBlocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export function toDisplayText(value: unknown): string {
* Accepts any wire value and normalises it first via toDisplayText. */
export function cleanToolText(raw: unknown): string {
const s0 = toDisplayText(raw)
// eslint-disable-next-line no-control-regex
let s = s0.replace(/\x1b\[[0-9;]*[A-Za-z]/g, "")
s = s.replace(/\[[0-9;]*m/g, "")
s = s
Expand Down
Loading