Lines 33-80javascript
33 * own icon (DESIGN §4.2, optional hardening).
35 * The injected code references ZERO minified identifiers (no `ue`/`dn`/`r`);
36 * it only uses `require("fs"|"path"|"vscode"|"os")`, `this`, and `Date`. The
37 * only version-sensitive surface is therefore the two anchor strings below,
38 * which are asserted to match exactly once before any byte is written.
40 * SVG WIRING (DESIGN §5 — absolute path to a PERSISTENT copy, not the project)
41 * Our SVGs (claude-logo-idle.svg + claude-logo-running.svg + claude-logo-done.svg
42 * + claude-logo-error.svg = 4 files, ALL STATIC) are COPIED from this project's
43 * resources/ into INSTALL_DIR (~/.claude/cc-status-dot/resources/) at install
44 * time, and the injected IIFE references that absolute path — so it survives
45 * BOTH a CC auto-update (which wipes the extension dir) AND deletion of the
46 * source project / npx cache purge. Just re-run the patcher after a CC update.
47 * The interrupted "off-frame" reuses CC's own claude-logo.svg via
48 * this.context.extensionPath.
50 * LIMITATIONS (read before extending)
51 * - If the CC extension updates and the minified anchor strings drift, the
52 * patcher will refuse to write and ask the user to file an issue. It never
53 * partially mutates extension.js.
54 * - settings.json is round-tripped through JSON.parse/stringify, which drops
55 * comments. The original is preserved as settings.json.cc-status-dot.bak
56 * on first run. Revert does surgical marker-based removal (not a restore),
57 * so subsequent manual edits survive.
58 * - Each CC panel instance runs its own 500 ms timer (N tabs = N timers).
59 * Each tick is one tiny readFileSync; acceptable for normal use.
60 * ------------------------------------------------------------------------- */
61import * as cp from "child_process";
62import * as crypto from "crypto";
HighChild Process
Package source references child process execution.
dist/patch.jsView on unpkg · L60 63import * as fs from "fs";
64import * as os from "os";
65import * as path from "path";
66import { fileURLToPath } from "url";
67// ---------------------------------------------------------------------------
69// ---------------------------------------------------------------------------
70/** Directory this script FILE lives in.
71 * Works under `tsx` (patch.ts at project root) and compiled ESM
72 * (dist/patch.js in the published package): this package is always ESM
73 * (package.json "type":"module" + tsconfig NodeNext), so import.meta.url is
74 * always available and is the reliable locator (under ESM __dirname is unset). */
75const SCRIPT_DIR = (() => {
LowWeak Crypto
Package source references weak cryptographic algorithms.
dist/patch.jsView on unpkg · L53 77 const url = import.meta.url;
79 return path.dirname(fileURLToPath(url));