matthewwong525/WongStack / .agents/skills/reply-link
reply-link
VerifiedReply links and the live line's helper.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 362 B |
| scripts/helper.mjs | script | 17.1 KB |
| scripts/lib/computer.mjs | script | 13.1 KB |
| scripts/lib/helper-log.mjs | script | 1.4 KB |
| scripts/lib/inbox.mjs | script | 4.0 KB |
| scripts/lib/line.mjs | script | 3.8 KB |
| scripts/lib/uploads.mjs | script | 3.8 KB |
| scripts/lib/wake.mjs | script | 2.9 KB |
| scripts/reply-link.mjs | script | 53.3 KB |
scripts/lib/helper-log.mjs
View on GitHub// The background helper's action log: one JSON line per thing it did, never a message's words. wiki/stack/live-line.md
import { appendFileSync, mkdirSync, renameSync, statSync } from 'node:fs';
import { helperFiles } from './computer.mjs';
const FIELDS = ['event', 'app', 'item', 'tap', 'action', 'outcome', 'key', 'run', 'reason', 'chat', 'message', 'warning'];
// A run's warning can join two of them, a fetch's and a rename's, so it keeps more than the 200 of any other field.
const LONG = { warning: 1000 };
export const LOG_LIMIT = 1024 * 1024;
/** Appends `entry`'s allowed fields to the helper's log.jsonl, rolled to log.1.jsonl at 1 MB: project `root`'s own
* helper's, or with none the shared ~/.wong-stack/helper/log.jsonl. Never throws. */
export function logAction(entry, { env = process.env, root = null, now = Date.now } = {}) {
const line = { at: new Date(now()).toISOString() };
for (const field of FIELDS) if (entry?.[field] != null) line[field] = String(entry[field]).slice(0, LONG[field] ?? 200);
try {
const { dir, log } = helperFiles(env, root);
mkdirSync(dir, { recursive: true, mode: 0o700 });
let size = 0;
try { size = statSync(log).size; } catch { /* no log yet */ }
if (size >= LOG_LIMIT) renameSync(log, log.replace(/\.jsonl$/, '.1.jsonl'));
appendFileSync(log, `${JSON.stringify(line)}\n`, { mode: 0o600 });
} catch { /* a log never stops the helper */ }
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |