Lines 1-34javascript
3 * Linear Grab bridge — delegate tasks from the browser panel to LOCAL Claude
4 * Code sessions running in this repo.
6 * npx linear-grab-bridge [--port 4577] [--dir .] [--claude claude]
8 * v0.9: interactive sessions. Each task runs `claude -p` with stream-json
9 * INPUT + OUTPUT — the session stays alive after each result, so the panel
10 * can send follow-up messages, switch models (applied via --resume respawn),
11 * read live token/context usage, and copy a `claude --resume <id>` command.
12 * Task history persists to ~/.linear-grab/ across restarts. Zero deps.
13 * Binds 127.0.0.1 only — never exposed to the network.
15import { createServer } from 'node:http';
16import { spawn, execFile } from 'node:child_process';
17import { randomUUID } from 'node:crypto';
18import { createHash } from 'node:crypto';
19import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
20import { homedir } from 'node:os';
21import { join } from 'node:path';
23const argv = process.argv.slice(2);
24const flag = (name, fallback) => {
25 const i = argv.indexOf(name);
26 return i >= 0 && argv[i + 1] ? argv[i + 1] : fallback;
28const PORT = Number(flag('--port', '4577'));
29const DIR = flag('--dir', process.cwd());
30const CLAUDE_BIN = flag('--claude', 'claude');
LowWeak Crypto
Package source references weak cryptographic algorithms.
bin/linear-grab-bridge.mjsView on unpkg · L14 31const VERSION = '0.22.0';
33/** Best-effort command runner (git/gh introspection). Never throws. */
34function run(cmd, args, cwd = DIR) {