/** * `gsk design [path]` — local cc-bridge daemon for Genspark Designer V2 / V3. * * Hosts two HTTP servers on 127.0.0.1, mirroring the protocol Tiffany's * private Anthropic CC binary speaks to claude.ai/design. Once the URL is * opened in the user's browser, the FE side of cc-bridge (see * `frontend-nuxt/utils/cc_bridge.ts`) redeems the nonce, registers the 6 * cc_* tool handlers in the client-tool dispatcher, and dispatches LLM * tool calls over this bridge. * * Servers: * - Exchange: port 47820 (well-known), POST /exchange {nonce} → * {port, token, prompt, cwd, ls_tree}. Single-use — second hit on * the same nonce returns 410 Gone. * - Data: random port, bearer-authenticated routes * /ls /read /grep /exec /back_to_cc /context. Auth = Authorization: * Bearer + X-Bridge-Token (both headers must match the issued token, * to force a fetch/CORS preflight and block
/ CSRF). * * Security: * - Bind 127.0.0.1 only — never 0.0.0.0. * - Origin allowlist enforced via CORS preflight (`https://www.genspark.ai` * + `http://localhost:3000-3099` for dev). * - Host header strict-check: must be `127.0.0.1:` or * `localhost:` — blocks DNS rebinding. * - Path inputs are normalized + rejected on `..`, absolute paths, * NUL bytes. Symlink escape blocked via realpath check. * - cc_exec allowlist defaults to read-only inspection commands; * `--allow-build-tools` opens up build CLIs (git/npm/python/etc). * Per-arg blocklist refuses `-c`, `--exec`, shell metacharacters * and newlines regardless of allowlist. * - 30s exec timeout (overridable per call up to 300s), 900 KB * stdout/stderr cap, 5 req/sec rate limit on /exec. */ import { Command } from 'commander'; interface DesignOpts { prompt?: string; launchUrl?: string; allowBuildTools?: boolean; open?: boolean; } /** Only an explicit `--no-open` skips the browser; unset `open` means open. */ export declare function shouldOpenBrowser(opts: DesignOpts): boolean; export declare function registerDesignCommand(program: Command): void; export {}; //# sourceMappingURL=design.d.ts.map