hooks/hooks.json was generated from a template by scripts/gen-hooks.mjs. Once every
hook became a command hook that reads hook.secret from $GLANCE_HOME itself, the
template had exactly two placeholders left: {{HOOK_TOKEN}}, which nothing had ever
substituted into anything, and {{APPROVAL_TIMEOUT_SECS}}. Generating a whole file to
compute one number is not a good trade, so the number is now fixed at 125s in the
committed hooks.json and the coupling is enforced in code instead: the daemon clamps
approval.timeoutMs to APPROVAL_MAX_WAIT_MS (90s), which keeps the script inside its
own hook timeout no matter what a hand-edited config.json says. Losing that clamp is
what would actually hurt — a killed script never runs its fail-open path.
Also removed:
- `glance sync-hooks`, `npm run build:hooks`, and hookSecret({create}). The daemon is
the only thing that should ever mint the secret.
- The ?k= query-string carrier for the hook secret. It existed for hooks that cannot
set headers; there are none, and a secret in a URL lands in logs and shell history.
- Snapshot.now and SessionView.startedAt, which were written on every snapshot and
every persist and read by nobody.
- An unused crypto import.
Docs and the e2e suite follow. The suite's ~12 sync-hooks assertions become static
checks on the committed file, plus new ones that hooks.json, APPROVAL_HOOK_TIMEOUT_SECS
and APPROVAL_MAX_WAIT_MS still agree, and that ?k= is refused. 220 checks, all passing.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
38 lines
1023 B
JSON
38 lines
1023 B
JSON
{
|
|
"name": "grok-glance",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"description": "Glance at what Grok Build is doing, from your phone, behind a passkey.",
|
|
"engines": {
|
|
"node": ">=20"
|
|
},
|
|
"scripts": {
|
|
"build": "npm run build:server && npm run build:web",
|
|
"build:server": "tsc -p tsconfig.server.json",
|
|
"build:web": "tsc -p tsconfig.web.json && vite build",
|
|
"dev": "vite",
|
|
"start": "node dist/server/index.js",
|
|
"glance": "node bin/glance"
|
|
},
|
|
"dependencies": {
|
|
"@heroui/react": "3.2.4",
|
|
"@heroui/styles": "3.2.4",
|
|
"@simplewebauthn/browser": "13.3.0",
|
|
"@simplewebauthn/server": "13.3.2",
|
|
"react": "^19.0.0",
|
|
"react-dom": "^19.0.0"
|
|
},
|
|
"devDependencies": {
|
|
"@tailwindcss/vite": "4.3.1",
|
|
"@types/node": "22.12.0",
|
|
"@types/react": "^19.0.0",
|
|
"@types/react-dom": "^19.0.0",
|
|
"@vitejs/plugin-react": "6.0.2",
|
|
"tailwind-variants": "3.3.0",
|
|
"tailwindcss": "4.3.1",
|
|
"typescript": "5.6.3",
|
|
"vite": "8.0.16"
|
|
}
|
|
}
|