Files
epiral__bb-browser/packages/daemon/package.json
Yanwu fb1a9b0644 chore: add harness — tests, CI, protocol types, design invariants (#133)
* chore: add harness — tests, CI, protocol types, design invariants

Context layer:
- Rewrite AGENTS.md: new daemon architecture, 3-file command pattern,
  7 design invariants (INV-1 through INV-7), testing section
- Update protocol.ts: add tab/seq/cursor/since fields, update
  DaemonStatus, remove SSE types, widen TabInfo.tabId to string

Constraints layer:
- Unit tests: RingBuffer (14), TabState + TabStateManager (36)
- Contract tests: all 7 invariants verified (48)
- Protocol drift tests: real daemon HTTP response shape checks (13,
  skipped when Chrome unavailable)
- CI workflow: build + lint + test on push/PR to main
- Pre-commit hook: pnpm build && pnpm test via husky

GC layer:
- Harness scenarios doc: 6 reusable Agent workflow scenarios for
  periodic UX validation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: resolve lint errors caught by CI

- Remove unused imports (TabState, TabInfo, JsonObject, Response)
- Remove unused variable assignments in tests (r1-r4)
- Change `let items` to `const items` in command-dispatch
- Remove stale eslint-disable directive, use proper cast
- Exclude .d.ts files from eslint in daemon package

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address Codex review findings

- cursor returns since threshold instead of 0 on empty results,
  preventing infinite re-fetch in incremental polling loops
- Guard shutdown against double-call (SIGINT + /shutdown race)
- Fix timer leak in discoverCdpPort when fetch fails

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: update READMEs — remove Extension references, update architecture diagram

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 15:47:10 +08:00

30 lines
724 B
JSON

{
"name": "@bb-browser/daemon",
"version": "0.0.1",
"private": true,
"type": "module",
"bin": {
"bb-browser-daemon": "./dist/index.js"
},
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"test": "tsx --test src/__tests__/*.test.ts",
"test:drift": "tsx --test src/__tests__/protocol-drift.test.ts",
"lint": "eslint src tsup.config.ts --ignore-pattern 'src/**/*.d.ts'",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@bb-browser/shared": "workspace:*"
},
"devDependencies": {
"@types/node": "^22.0.0",
"tsup": "^8.0.0",
"tsx": "^4.20.6",
"typescript": "^5.7.0",
"ws": "^8.19.0"
}
}