Files
辰ing 06e88e50b3 Improve session polling performance and add cross-platform script support
* fix: harden test suite for Windows/CRLF cross-platform compatibility

- oss-readiness: use \r?\n in .gitignore regex boundaries for CRLF support
- oss-readiness: update PUBLIC_FILES to match actual repo filenames
- phase9-routes-commands: invoke node directly instead of spawn('npm')
  to avoid ENOENT on Windows where npm requires .cmd extension
- phase9-routes-commands: normalize path separators in export path assertion
- ui-render-smoke: normalize CRLF to LF before multiline source includes()
- usage-cost: normalize backslashes in sourcePath before glob assertion

All 87 tests now pass on Windows.

* fix: add cross-platform Node.js UI smoke script for Windows compatibility

* fix: improve session polling performance and add cross-platform script support (#13)

- Reduce monitor polling interval from 5s to 30s to cut background I/O by 83%
- Add incremental status queries in snapshot() — only refresh active/new sessions instead of all 500+
- Replace O(n) usage-cost cache key serialization with O(1) generatedAt-based key
- Use cross-env for all env-prefixed npm scripts to fix Windows cmd compatibility
- Reduce default session preview historyLimit and pageSize for faster dashboard loads

* fix: add final status refresh for sessions leaving active state

When a session transitions from running/blocked to idle/error, perform
one last status query to capture final usage metrics (cost, tokens).
Without this, cachedStatuses would retain pre-completion values
permanently, causing stale aggregate usage/budget totals.

Addresses review feedback on PR #17.

* fix: tune polling interval to 10s and use content-based cache key

- Change sessionsList polling from 30s to 10s as a compromise between
  the original 5s (too aggressive) and the PR's 30s (too slow for
  near real-time UX).
- Replace generatedAt-based cache key in buildUsageCostCacheKey with
  content-based fingerprint using session.state and status.updatedAt,
  so the cache only invalidates when data actually changes.
2026-03-14 09:49:45 +01:00

46 lines
2.5 KiB
JSON

{
"name": "openclaw-control-center",
"version": "0.1.1",
"description": "Safety-first local control center for OpenClaw observability, task operations, and operator review.",
"license": "MIT",
"type": "commonjs",
"scripts": {
"dev": "node --import tsx src/index.ts",
"dev:continuous": "cross-env MONITOR_CONTINUOUS=true node --import tsx src/index.ts",
"dev:ui": "cross-env UI_MODE=true node --import tsx src/index.ts",
"smoke:ui": "node scripts/ui-smoke.js",
"command:backup-export": "cross-env APP_COMMAND=backup-export node --import tsx src/index.ts",
"avatars:export": "node --import tsx scripts/export-staff-avatars.ts",
"command:import-validate": "cross-env APP_COMMAND=import-validate node --import tsx src/index.ts",
"command:acks-prune": "cross-env APP_COMMAND=acks-prune node --import tsx src/index.ts",
"command:task-heartbeat": "cross-env APP_COMMAND=task-heartbeat node --import tsx src/index.ts",
"test": "node --import tsx --test test/**/*.test.ts",
"build": "tsc -p tsconfig.json",
"release:audit": "bash scripts/release-audit.sh",
"validate:task-store": "node --import tsx scripts/validate-task-store.ts",
"validate:budget": "node --import tsx scripts/validate-budget-compute.ts",
"validate": "npm run validate:task-store && npm run validate:budget",
"lock:status": "node --import tsx scripts/run-lock.ts status",
"lock:acquire": "node --import tsx scripts/run-lock.ts acquire",
"lock:renew": "node --import tsx scripts/run-lock.ts renew",
"lock:release": "node --import tsx scripts/run-lock.ts release",
"evidence:emit": "node --import tsx scripts/evidence-gate.ts emit",
"evidence:validate": "node --import tsx scripts/evidence-gate.ts validate",
"evidence:report": "node --import tsx scripts/evidence-reporter.ts",
"heal:check": "node --import tsx scripts/stall-auto-heal.ts",
"watchdog:run": "node --import tsx scripts/watchdog-orchestrator.ts",
"goal:gate": "node --import tsx scripts/goal-gate.ts",
"health:snapshot": "node --import tsx scripts/health-snapshot.ts",
"health:snapshot:periodic": "node --import tsx scripts/periodic-snapshot.ts",
"worker:resident": "node --import tsx scripts/resident-worker.ts",
"supervisor:resident": "node --import tsx scripts/resident-supervisor.ts",
"dod:check": "node --import tsx scripts/dod-check.ts"
},
"devDependencies": {
"@types/node": "^22.13.10",
"cross-env": "^7.0.3",
"tsx": "^4.20.0",
"typescript": "^5.8.2"
}
}