@v1nvn/md 0.31.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -20,19 +20,19 @@ claude plugin install md@agentic
|
|
|
20
20
|
In a terminal, last reply or a named file:
|
|
21
21
|
|
|
22
22
|
```sh
|
|
23
|
-
npx -y @v1nvn/md@0.
|
|
24
|
-
npx -y @v1nvn/md@0.
|
|
25
|
-
npx -y @v1nvn/md@0.
|
|
23
|
+
npx -y @v1nvn/md@0.33.0 # editable — both panes
|
|
24
|
+
npx -y @v1nvn/md@0.33.0 --view # read-only — preview pane only
|
|
25
|
+
npx -y @v1nvn/md@0.33.0 reply.md
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
## Usage
|
|
29
29
|
|
|
30
30
|
| Invocation | Does |
|
|
31
31
|
|---|---|
|
|
32
|
-
| `npx -y @v1nvn/md@0.
|
|
33
|
-
| `npx -y @v1nvn/md@0.
|
|
34
|
-
| `npx -y @v1nvn/md@0.
|
|
35
|
-
| `npx -y @v1nvn/md@0.
|
|
32
|
+
| `npx -y @v1nvn/md@0.33.0` | last reply → viewer, edit pane enabled, link copied |
|
|
33
|
+
| `npx -y @v1nvn/md@0.33.0 --view` | read-only share |
|
|
34
|
+
| `npx -y @v1nvn/md@0.33.0 reply.md` | that file instead of the last reply |
|
|
35
|
+
| `npx -y @v1nvn/md@0.33.0 -` | Markdown from stdin |
|
|
36
36
|
|
|
37
37
|
`MD_VIEWER_URL` sets the viewer (default `https://md.v1n.space`); any set
|
|
38
38
|
`MD_NO_OPEN` value (not just `1`) skips opening the browser.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../core/dist/index.js","../src/share.ts","../src/index.ts"],"sourcesContent":["import { existsSync, readFileSync, readdirSync, statSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\n//#region src/input.ts\nfunction readAll(stream) {\n\treturn new Promise((resolve, reject) => {\n\t\tlet data = \"\";\n\t\tstream.setEncoding(\"utf8\");\n\t\tstream.on(\"data\", (chunk) => {\n\t\t\tdata += chunk;\n\t\t});\n\t\tstream.on(\"end\", () => {\n\t\t\tresolve(data);\n\t\t});\n\t\tstream.on(\"error\", reject);\n\t});\n}\nfunction readStdin(stream = process.stdin) {\n\treturn readAll(stream);\n}\n/** A markdown file's contents, with the CLI's no-such-file error. */\nfunction readMarkdownFile(path) {\n\tif (!statSync(path, { throwIfNoEntry: false })?.isFile()) throw new Error(`no such file: ${path}`);\n\treturn readFileSync(path, \"utf8\");\n}\n//#endregion\n//#region src/hook.ts\n/**\n* Read the Claude Code hook event JSON from stdin; empty or unparseable input\n* yields an empty event, never a thrown error — a hook must always answer.\n*/\nfunction readHookEvent(stream = process.stdin) {\n\treturn readAll(stream).then((data) => {\n\t\ttry {\n\t\t\treturn JSON.parse(data);\n\t\t} catch {\n\t\t\treturn {};\n\t\t}\n\t}, () => ({}));\n}\n/**\n* Which transcript lastReply should read, per the hook event: transcript_path\n* when it names a real file, else session_id, else nothing (lastReply then\n* falls back to the newest session for the current project).\n*/\nfunction replyTarget(event) {\n\tif (event.transcript_path !== void 0 && isFile(event.transcript_path)) return event.transcript_path;\n\treturn event.session_id || void 0;\n}\nfunction isFile(path) {\n\ttry {\n\t\treturn statSync(path).isFile();\n\t} catch {\n\t\treturn false;\n\t}\n}\n/**\n* Print the UserPromptExpansion decision for a zero-token command: `block`\n* keeps the command from reaching the model, with the output as the `reason`.\n*/\nfunction emitHookBlock(reason) {\n\tprocess.stdout.write(`${JSON.stringify({\n\t\tdecision: \"block\",\n\t\treason\n\t})}\\n`);\n}\n//#endregion\n//#region src/cli.ts\nfunction parseQuietly(program, args, recover) {\n\ttry {\n\t\tprogram.allowExcessArguments(false).exitOverride().configureOutput({\n\t\t\twriteOut: () => void 0,\n\t\t\twriteErr: () => void 0\n\t\t}).parse([...args], { from: \"user\" });\n\t\treturn program;\n\t} catch (err) {\n\t\treturn recover?.(err);\n\t}\n}\nfunction printUsageAndExit(program) {\n\tconsole.error(program.helpInformation());\n\tprocess.exit(1);\n}\nasync function hookOrPrint(hook, failure, run, stdin = process.stdin) {\n\tif (hook) {\n\t\tlet reason;\n\t\ttry {\n\t\t\treason = await run(await readHookEvent(stdin));\n\t\t} catch (e) {\n\t\t\treason = `${failure}: ${e.message}`;\n\t\t}\n\t\temitHookBlock(reason);\n\t\treturn;\n\t}\n\ttry {\n\t\tconsole.log(await run(void 0));\n\t} catch (e) {\n\t\tconsole.error(e.message);\n\t\tprocess.exit(1);\n\t}\n}\n//#endregion\n//#region src/dev.ts\nvar RELOAD_DEBOUNCE_MS = 150;\nvar IGNORED_SEGMENTS = [\n\t\"/node_modules/\",\n\t\"/dist/\",\n\t\"/.git/\",\n\t\"/coverage/\"\n];\nfunction shouldReload(file) {\n\treturn IGNORED_SEGMENTS.every((seg) => !file.includes(seg));\n}\n/**\n* Debounced file-change reloads, serialized via a promise chain: concurrent\n* saves never overlap, and a mid-reload save still produces a follow-up.\n*/\nfunction watchWithReload(vite, reload) {\n\tlet chain = Promise.resolve();\n\tlet timer;\n\tvite.watcher.on(\"change\", (file) => {\n\t\tif (!shouldReload(file)) return;\n\t\tif (timer) clearTimeout(timer);\n\t\ttimer = setTimeout(() => {\n\t\t\ttimer = void 0;\n\t\t\tchain = chain.then(reload);\n\t\t}, RELOAD_DEBOUNCE_MS);\n\t});\n}\n//#endregion\n//#region src/last-reply.ts\nfunction textBlocks(entry) {\n\tconst content = entry.message?.content;\n\tif (entry.type !== \"assistant\" || !Array.isArray(content)) return;\n\tconst blocks = content.filter((b) => typeof b === \"object\" && b !== null && b.type === \"text\");\n\treturn blocks.length > 0 ? blocks : void 0;\n}\nfunction claudeProjectsDir() {\n\tconst claudeDir = process.env.CLAUDE_DIR ?? join(homedir(), \".claude\");\n\treturn join(claudeDir, \"projects\");\n}\n/**\n* The last assistant text reply from a Claude Code session, reproducing Claude\n* Code's `/copy` byte-for-byte: the last assistant entry that contains a\n* `text` block, only its `text` block(s) (tool_use / thinking dropped), blocks\n* joined with a blank line, and no trailing newline.\n*\n* @param arg a transcript file, a session UUID under the project dir, or\n* nothing to use the newest session for the current project.\n*/\nfunction lastReply(arg) {\n\tconst proj = (process.env.CLAUDE_PROJECT_DIR ?? process.cwd()).replaceAll(\"/\", \"-\");\n\tconst projDir = join(claudeProjectsDir(), proj);\n\tlet file;\n\tif (arg !== void 0) file = isFile(arg) ? arg : join(projDir, `${arg}.jsonl`);\n\telse if (existsSync(projDir)) {\n\t\tconst newest = readdirSync(projDir).filter((f) => f.endsWith(\".jsonl\")).map((f) => ({\n\t\t\tf,\n\t\t\tmtimeMs: statSync(join(projDir, f)).mtimeMs\n\t\t})).sort((a, b) => b.mtimeMs - a.mtimeMs).at(0);\n\t\tif (newest) file = join(projDir, newest.f);\n\t}\n\tif (file === void 0 || !isFile(file)) throw new Error(`no session transcript found in ${projDir}`);\n\tlet last;\n\tfor (const line of readFileSync(file, \"utf8\").split(\"\\n\")) {\n\t\tif (!line.includes(\"\\\"assistant\\\"\")) continue;\n\t\tlet entry;\n\t\ttry {\n\t\t\tentry = JSON.parse(line);\n\t\t} catch {\n\t\t\tcontinue;\n\t\t}\n\t\tconst blocks = textBlocks(entry);\n\t\tif (blocks) last = blocks;\n\t}\n\treturn (last ?? []).map((b) => b.text ?? \"\").join(\"\\n\\n\");\n}\n//#endregion\n//#region src/logger.ts\nvar LEVEL_RANK = {\n\tdebug: 10,\n\tinfo: 20,\n\twarn: 30,\n\terror: 40,\n\tsilent: Number.MAX_SAFE_INTEGER\n};\nfunction levelEnabled(active, wanted) {\n\treturn LEVEL_RANK[wanted] >= LEVEL_RANK[active];\n}\nvar LEVEL_LABEL = {\n\tdebug: \"DEBUG\",\n\terror: \"ERROR\",\n\tinfo: \"INFO\",\n\twarn: \"WARN\"\n};\nvar Logger = class {\n\tactiveLevel;\n\tstderr;\n\tconstructor(activeLevel, stderr = (line) => process.stderr.write(`${line}\\n`)) {\n\t\tthis.activeLevel = activeLevel;\n\t\tthis.stderr = stderr;\n\t}\n\tdebug(message) {\n\t\tthis.log(\"debug\", message);\n\t}\n\terror(message) {\n\t\tthis.log(\"error\", message);\n\t}\n\tinfo(message) {\n\t\tthis.log(\"info\", message);\n\t}\n\twarn(message) {\n\t\tthis.log(\"warn\", message);\n\t}\n\tlog(level, message) {\n\t\tif (levelEnabled(this.activeLevel, level)) this.stderr(`${LEVEL_LABEL[level]} ${message}`);\n\t}\n};\n//#endregion\n//#region src/shutdown.ts\n/** Close each closable in order (best-effort), then force-exit. */\nfunction shutdownOnSignals(closables, signals = [\"SIGINT\", \"SIGTERM\"]) {\n\tfunction shutdown() {\n\t\tclosables.reduce((acc, closable) => acc.then(async () => {\n\t\t\ttry {\n\t\t\t\tawait closable.close();\n\t\t\t} catch {}\n\t\t}), Promise.resolve()).finally(() => {\n\t\t\tprocess.exit(0);\n\t\t});\n\t}\n\tfor (const signal of signals) process.on(signal, shutdown);\n}\n//#endregion\n//#region src/text-format.ts\n/**\n* Plain-text rendering primitives shared by the zai and tokens report\n* renderers. Output targets a monospace terminal / hook-block `reason`, so\n* everything here is fixed-width: padding, block-glyph bars, and compact\n* number formatting.\n*/\nvar MONTHS = [\n\t\"Jan\",\n\t\"Feb\",\n\t\"Mar\",\n\t\"Apr\",\n\t\"May\",\n\t\"Jun\",\n\t\"Jul\",\n\t\"Aug\",\n\t\"Sep\",\n\t\"Oct\",\n\t\"Nov\",\n\t\"Dec\"\n];\nvar EIGHTHS = [\n\t\"\",\n\t\"▏\",\n\t\"▎\",\n\t\"▍\",\n\t\"▌\",\n\t\"▋\",\n\t\"▊\",\n\t\"▉\"\n];\nvar RULE_WIDTH = 68;\nfunction rule() {\n\treturn \"─\".repeat(68);\n}\nfunction pad2(n) {\n\treturn String(n).padStart(2, \"0\");\n}\n/** Local-time `YYYY-MM-DD` key. */\nfunction ymd(date) {\n\treturn `${date.getFullYear()}-${pad2(date.getMonth() + 1)}-${pad2(date.getDate())}`;\n}\nfunction fmtTokens(n) {\n\tif (n == null || Number.isNaN(n)) return \"—\";\n\tif (n >= 1e9) return (n / 1e9).toFixed(1) + \"B\";\n\tif (n >= 1e6) return (n / 1e6).toFixed(1) + \"M\";\n\tif (n >= 1e3) return (n / 1e3).toFixed(1) + \"K\";\n\treturn String(n);\n}\nfunction fmtNum(n) {\n\treturn (n || 0).toLocaleString(\"en-US\");\n}\nfunction padR(s, n) {\n\treturn s.length >= n ? s : s + \" \".repeat(n - s.length);\n}\nfunction padL(s, n) {\n\treturn s.length >= n ? s : \" \".repeat(n - s.length) + s;\n}\n/** Fixed-width bar field (width cols): █ blocks + an eighth-fraction + trailing spaces. */\nfunction barField(v, max, width) {\n\tif (!v || v <= 0 || max <= 0) return \" \".repeat(width);\n\tconst scaled = v / max * width;\n\tlet full = Math.floor(scaled);\n\tlet fi = Math.round((scaled - full) * 8);\n\tif (fi === 8) {\n\t\tfull += 1;\n\t\tfi = 0;\n\t}\n\tif (full === 0 && fi === 0) fi = 1;\n\tlet s = \"█\".repeat(Math.min(full, width));\n\tif (full < width && fi > 0) s += EIGHTHS[fi];\n\tif (s.length < width) s += \" \".repeat(width - s.length);\n\treturn s.slice(0, width);\n}\n/** Filled/empty meter: █ for used, ░ for remaining. */\nfunction meter(pct, width) {\n\tlet filled = Math.round((pct || 0) / 100 * width);\n\tfilled = Math.max(0, Math.min(width, filled));\n\treturn \"█\".repeat(filled) + \"░\".repeat(width - filled);\n}\n//#endregion\nexport { Logger, MONTHS, RULE_WIDTH, barField, claudeProjectsDir, emitHookBlock, fmtNum, fmtTokens, hookOrPrint, isFile, lastReply, levelEnabled, meter, pad2, padL, padR, parseQuietly, printUsageAndExit, readAll, readHookEvent, readMarkdownFile, readStdin, replyTarget, rule, shutdownOnSignals, watchWithReload, ymd };\n\n//# sourceMappingURL=index.js.map","/**\n * Send Markdown to the self-hosted Markdown-Viewer as a #share= URL — opens it\n * in the browser and copies the URL.\n *\n * md-send path/to/reply.md # from a file\n * md-send - # from stdin\n * md-send # from the last Claude reply (core.lastReply)\n * md-send --view # open read-only (no edit pane)\n *\n * Env knobs: MD_VIEWER_URL (default: https://md.v1n.space), MD_NO_OPEN=1 (skip browser).\n */\n\nimport { spawnSync } from 'node:child_process';\nimport { deflateSync } from 'node:zlib';\n\n/**\n * Encode Markdown into the Markdown-Viewer share token.\n *\n * Pipeline: UTF-8 bytes → zlib deflate (RFC 1950, pako.deflate-compatible) →\n * base64url. Matches Markdown-Viewer's encodeMarkdownForShare() in script.js\n * byte-for-byte — the decoder (pako.inflate) accepts any valid zlib stream, so\n * compression level is irrelevant.\n */\nexport function encodeShare(markdown: string): string {\n return deflateSync(Buffer.from(markdown, 'utf8'))\n .toString('base64')\n .replaceAll('+', '-')\n .replaceAll('/', '_')\n .replace(/=+$/, '');\n}\n\nexport function shareUrl(markdown: string, view = false): string {\n const base = (process.env.MD_VIEWER_URL ?? 'https://md.v1n.space').replace(\n /\\/+$/,\n '',\n );\n const mode = view ? '' : '&edit=1';\n // Without `edit=1` the viewer opens the snapshot read-only — preview pane\n // only, with edit and split disabled (Markdown-Viewer script.js: loadFromShareHash).\n return `${base}/#share=${encodeShare(markdown)}${mode}`;\n}\n\nfunction copyToClipboard(text: string): boolean {\n try {\n return (\n spawnSync('pbcopy', { input: text, stdio: ['pipe', 'ignore', 'ignore'] })\n .status === 0\n );\n } catch {\n return false;\n }\n}\n\nfunction openUrl(url: string): boolean {\n try {\n return spawnSync('open', [url], { stdio: 'ignore' }).status === 0;\n } catch {\n return false;\n }\n}\n\nexport function statusLine(opened: boolean, copied: boolean): string {\n if (opened && copied) {\n return 'Opened in Markdown-Viewer (link copied).';\n }\n if (opened) {\n return 'Opened in Markdown-Viewer.';\n }\n if (copied) {\n return 'Markdown-Viewer link copied to clipboard.';\n }\n return 'Markdown-Viewer link ready.';\n}\n\n/** Shares the markdown and returns the status line; the URL itself is never printed. */\nexport function mdSend(markdown: string, view = false): string {\n const url = shareUrl(markdown, view);\n const copied = copyToClipboard(url);\n const opened = process.env.MD_NO_OPEN === undefined && openUrl(url);\n return statusLine(opened, copied);\n}\n","import {\n hookOrPrint,\n lastReply,\n parseQuietly,\n printUsageAndExit,\n readMarkdownFile,\n readStdin,\n replyTarget,\n} from '@v1nvn/agentic-core';\nimport { Command } from 'commander';\n\nimport { mdSend } from './share.js';\n\nconst program = new Command()\n .name('md-send')\n .description('Send a Markdown reply to the Markdown-Viewer as a #share= URL')\n .argument('[file]', 'Markdown file, - for stdin; the last reply when omitted')\n .option('--view', 'open the viewer read-only, without the edit pane')\n .option('--hook', 'emit a UserPromptExpansion block instead of printing');\n\nconst parsed =\n parseQuietly(program, process.argv.slice(2)) ?? printUsageAndExit(program);\nconst arg = parsed.args.at(0);\nconst { hook, view } = parsed.opts<{\n hook: boolean | undefined;\n view: boolean | undefined;\n}>();\n\nfunction readMarkdown(): Promise<string> | string {\n if (arg === '-') {\n return readStdin();\n }\n if (arg === undefined) {\n return lastReply();\n }\n return readMarkdownFile(arg);\n}\n\nawait hookOrPrint(hook ?? false, 'send failed', async event =>\n mdSend(\n event === undefined ? await readMarkdown() : lastReply(replyTarget(event)),\n view ?? false,\n ),\n);\n"],"mappings":";;;;;;;;AAIA,SAAS,QAAQ,QAAQ;CACxB,OAAO,IAAI,SAAS,SAAS,WAAW;EACvC,IAAI,OAAO;EACX,OAAO,YAAY,MAAM;EACzB,OAAO,GAAG,SAAS,UAAU;GAC5B,QAAQ;EACT,CAAC;EACD,OAAO,GAAG,aAAa;GACtB,QAAQ,IAAI;EACb,CAAC;EACD,OAAO,GAAG,SAAS,MAAM;CAC1B,CAAC;AACF;AACA,SAAS,UAAU,SAAS,QAAQ,OAAO;CAC1C,OAAO,QAAQ,MAAM;AACtB;;AAEA,SAAS,iBAAiB,MAAM;CAC/B,IAAI,CAAC,SAAS,MAAM,EAAE,gBAAgB,MA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U,QACZ,OAAO;CAET,IAAI,QACF,OAAO;CAET,IAAI,QACF,OAAO;CAET,OAAO;AACT;;AAGA,SAAgB,OAAO,UAAkB,OAAO,OAAe;CAC7D,MAAM,MAAM,SAAS,UAAU,IAAI;CACnC,MAAM,SAAS,gBAAgB,GAAG;CAElC,OAAO,WADQ,QAAQ,IAAI,eAAe,KAAA,KAAa,QAAQ,GAAG,GACxC,MAAM;AAClC;;;ACnEA,IAAM,UAAU,IAAI,QAAQ,CAAC,CAC1B,KAAK,SAAS,CAAC,CACf,YAAY,+DAA+D,CAAC,CAC5E,SAAS,UAAU,yDAAyD,CAAC,CAC7E,OAAO,UAAU,kDAAkD,CAAC,CACpE,OAAO,UAAU,sDAAsD;AAE1E,IAAM,SACJ,aAAa,SAAS,QAAQ,KAAK,MAAM,CAAC,CAAC,KAAK,kBAAkB,OAAO;AAC3E,IAAM,MAAM,OAAO,KAAK,GAAG,CAAC;AAC5B,IAAM,EAAE,MAAM,SAAS,OAAO,KAG3B;AAEH,SAAS,eAAyC;CAChD,IAAI,QAAQ,KACV,OAAO,UAAU;CAEnB,IAAI,QAAQ,KAAA,GACV,OAAO,UAAU;CAEnB,OAAO,iBAAiB,GAAG;AAC7B;AAEA,MAAM,YAAY,QAAQ,OAAO,eAAe,OAAM,UACpD,OACE,UAAU,KAAA,IAAY,MAAM,aAAa,IAAI,UAAU,YAAY,KAAK,CAAC,GACzE,QAAQ,KACV,CACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../core/dist/index.js","../src/share.ts","../src/index.ts"],"sourcesContent":["import { existsSync, readFileSync, readdirSync, statSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\n//#region src/input.ts\nfunction readAll(stream) {\n\treturn new Promise((resolve, reject) => {\n\t\tlet data = \"\";\n\t\tstream.setEncoding(\"utf8\");\n\t\tstream.on(\"data\", (chunk) => {\n\t\t\tdata += chunk;\n\t\t});\n\t\tstream.on(\"end\", () => {\n\t\t\tresolve(data);\n\t\t});\n\t\tstream.on(\"error\", reject);\n\t});\n}\nfunction readStdin(stream = process.stdin) {\n\treturn readAll(stream);\n}\n/** A markdown file's contents, with the CLI's no-such-file error. */\nfunction readMarkdownFile(path) {\n\tif (!statSync(path, { throwIfNoEntry: false })?.isFile()) throw new Error(`no such file: ${path}`);\n\treturn readFileSync(path, \"utf8\");\n}\n//#endregion\n//#region src/hook.ts\n/**\n* Read the Claude Code hook event JSON from stdin; empty or unparseable input\n* yields an empty event, never a thrown error — a hook must always answer.\n*/\nfunction readHookEvent(stream = process.stdin) {\n\treturn readAll(stream).then((data) => {\n\t\ttry {\n\t\t\treturn JSON.parse(data);\n\t\t} catch {\n\t\t\treturn {};\n\t\t}\n\t}, () => ({}));\n}\n/**\n* Which transcript lastReply should read, per the hook event: transcript_path\n* when it names a real file, else session_id, else nothing (lastReply then\n* falls back to the newest session for the current project).\n*/\nfunction replyTarget(event) {\n\tif (event.transcript_path !== void 0 && isFile(event.transcript_path)) return event.transcript_path;\n\treturn event.session_id || void 0;\n}\nfunction isFile(path) {\n\ttry {\n\t\treturn statSync(path).isFile();\n\t} catch {\n\t\treturn false;\n\t}\n}\n/**\n* Print the UserPromptExpansion decision for a zero-token command: `block`\n* keeps the command from reaching the model, with the output as the `reason`.\n*/\nfunction emitHookBlock(reason) {\n\tprocess.stdout.write(`${JSON.stringify({\n\t\tdecision: \"block\",\n\t\treason\n\t})}\\n`);\n}\n//#endregion\n//#region src/cli.ts\nfunction parseQuietly(program, args, recover) {\n\ttry {\n\t\tprogram.allowExcessArguments(false).exitOverride().configureOutput({\n\t\t\twriteOut: () => void 0,\n\t\t\twriteErr: () => void 0\n\t\t}).parse([...args], { from: \"user\" });\n\t\treturn program;\n\t} catch (err) {\n\t\treturn recover?.(err);\n\t}\n}\nfunction printUsageAndExit(program) {\n\tconsole.error(program.helpInformation());\n\tprocess.exit(1);\n}\nasync function hookOrPrint(hook, failure, run, stdin = process.stdin) {\n\tif (hook) {\n\t\tlet reason;\n\t\ttry {\n\t\t\treason = await run(await readHookEvent(stdin));\n\t\t} catch (e) {\n\t\t\treason = `${failure}: ${e.message}`;\n\t\t}\n\t\temitHookBlock(reason);\n\t\treturn;\n\t}\n\ttry {\n\t\tconsole.log(await run(void 0));\n\t} catch (e) {\n\t\tconsole.error(e.message);\n\t\tprocess.exit(1);\n\t}\n}\n//#endregion\n//#region src/dev.ts\nvar RELOAD_DEBOUNCE_MS = 150;\nvar IGNORED_SEGMENTS = [\n\t\"/node_modules/\",\n\t\"/dist/\",\n\t\"/.git/\",\n\t\"/coverage/\"\n];\nfunction shouldReload(file) {\n\treturn IGNORED_SEGMENTS.every((seg) => !file.includes(seg));\n}\n/**\n* Debounced file-change reloads, serialized via a promise chain: concurrent\n* saves never overlap, and a mid-reload save still produces a follow-up.\n*/\nfunction watchWithReload(vite, reload) {\n\tlet chain = Promise.resolve();\n\tlet timer;\n\tvite.watcher.on(\"change\", (file) => {\n\t\tif (!shouldReload(file)) return;\n\t\tif (timer) clearTimeout(timer);\n\t\ttimer = setTimeout(() => {\n\t\t\ttimer = void 0;\n\t\t\tchain = chain.then(reload);\n\t\t}, RELOAD_DEBOUNCE_MS);\n\t});\n}\n//#endregion\n//#region src/last-reply.ts\nfunction textBlocks(entry) {\n\tconst content = entry.message?.content;\n\tif (entry.type !== \"assistant\" || !Array.isArray(content)) return;\n\tconst blocks = content.filter((b) => typeof b === \"object\" && b !== null && b.type === \"text\");\n\treturn blocks.length > 0 ? blocks : void 0;\n}\nfunction claudeProjectsDir() {\n\tconst claudeDir = process.env.CLAUDE_DIR ?? join(homedir(), \".claude\");\n\treturn join(claudeDir, \"projects\");\n}\n/**\n* The last assistant text reply from a Claude Code session, reproducing Claude\n* Code's `/copy` byte-for-byte: the last assistant entry that contains a\n* `text` block, only its `text` block(s) (tool_use / thinking dropped), blocks\n* joined with a blank line, and no trailing newline.\n*\n* @param arg a transcript file, a session UUID under the project dir, or\n* nothing to use the newest session for the current project.\n*/\nfunction lastReply(arg) {\n\tconst proj = (process.env.CLAUDE_PROJECT_DIR ?? process.cwd()).replaceAll(\"/\", \"-\");\n\tconst projDir = join(claudeProjectsDir(), proj);\n\tlet file;\n\tif (arg !== void 0) file = isFile(arg) ? arg : join(projDir, `${arg}.jsonl`);\n\telse if (existsSync(projDir)) {\n\t\tconst newest = readdirSync(projDir).filter((f) => f.endsWith(\".jsonl\")).map((f) => ({\n\t\t\tf,\n\t\t\tmtimeMs: statSync(join(projDir, f)).mtimeMs\n\t\t})).sort((a, b) => b.mtimeMs - a.mtimeMs).at(0);\n\t\tif (newest) file = join(projDir, newest.f);\n\t}\n\tif (file === void 0 || !isFile(file)) throw new Error(`no session transcript found in ${projDir}`);\n\tlet last;\n\tfor (const line of readFileSync(file, \"utf8\").split(\"\\n\")) {\n\t\tif (!line.includes(\"\\\"assistant\\\"\")) continue;\n\t\tlet entry;\n\t\ttry {\n\t\t\tentry = JSON.parse(line);\n\t\t} catch {\n\t\t\tcontinue;\n\t\t}\n\t\tconst blocks = textBlocks(entry);\n\t\tif (blocks) last = blocks;\n\t}\n\treturn (last ?? []).map((b) => b.text ?? \"\").join(\"\\n\\n\");\n}\n//#endregion\n//#region src/logger.ts\nvar LEVEL_RANK = {\n\tdebug: 10,\n\tinfo: 20,\n\twarn: 30,\n\terror: 40,\n\tsilent: Number.MAX_SAFE_INTEGER\n};\nfunction levelEnabled(active, wanted) {\n\treturn LEVEL_RANK[wanted] >= LEVEL_RANK[active];\n}\nvar LEVEL_LABEL = {\n\tdebug: \"DEBUG\",\n\terror: \"ERROR\",\n\tinfo: \"INFO\",\n\twarn: \"WARN\"\n};\nvar Logger = class {\n\tactiveLevel;\n\tstderr;\n\tconstructor(activeLevel, stderr = (line) => process.stderr.write(`${line}\\n`)) {\n\t\tthis.activeLevel = activeLevel;\n\t\tthis.stderr = stderr;\n\t}\n\tdebug(message) {\n\t\tthis.log(\"debug\", message);\n\t}\n\terror(message) {\n\t\tthis.log(\"error\", message);\n\t}\n\tinfo(message) {\n\t\tthis.log(\"info\", message);\n\t}\n\twarn(message) {\n\t\tthis.log(\"warn\", message);\n\t}\n\tlog(level, message) {\n\t\tif (levelEnabled(this.activeLevel, level)) this.stderr(`${LEVEL_LABEL[level]} ${message}`);\n\t}\n};\n//#endregion\n//#region src/shutdown.ts\n/** Close each closable in order (best-effort), then force-exit. */\nfunction shutdownOnSignals(closables, signals = [\"SIGINT\", \"SIGTERM\"]) {\n\tfunction shutdown() {\n\t\tclosables.reduce((acc, closable) => acc.then(async () => {\n\t\t\ttry {\n\t\t\t\tawait closable.close();\n\t\t\t} catch {}\n\t\t}), Promise.resolve()).finally(() => {\n\t\t\tprocess.exit(0);\n\t\t});\n\t}\n\tfor (const signal of signals) process.on(signal, shutdown);\n}\n//#endregion\nexport { Logger, claudeProjectsDir, emitHookBlock, hookOrPrint, isFile, lastReply, levelEnabled, parseQuietly, printUsageAndExit, readAll, readHookEvent, readMarkdownFile, readStdin, replyTarget, shutdownOnSignals, watchWithReload };\n\n//# sourceMappingURL=index.js.map","/**\n * Send Markdown to the self-hosted Markdown-Viewer as a #share= URL — opens it\n * in the browser and copies the URL.\n *\n * md-send path/to/reply.md # from a file\n * md-send - # from stdin\n * md-send # from the last Claude reply (core.lastReply)\n * md-send --view # open read-only (no edit pane)\n *\n * Env knobs: MD_VIEWER_URL (default: https://md.v1n.space), MD_NO_OPEN=1 (skip browser).\n */\n\nimport { spawnSync } from 'node:child_process';\nimport { deflateSync } from 'node:zlib';\n\n/**\n * Encode Markdown into the Markdown-Viewer share token.\n *\n * Pipeline: UTF-8 bytes → zlib deflate (RFC 1950, pako.deflate-compatible) →\n * base64url. Matches Markdown-Viewer's encodeMarkdownForShare() in script.js\n * byte-for-byte — the decoder (pako.inflate) accepts any valid zlib stream, so\n * compression level is irrelevant.\n */\nexport function encodeShare(markdown: string): string {\n return deflateSync(Buffer.from(markdown, 'utf8'))\n .toString('base64')\n .replaceAll('+', '-')\n .replaceAll('/', '_')\n .replace(/=+$/, '');\n}\n\nexport function shareUrl(markdown: string, view = false): string {\n const base = (process.env.MD_VIEWER_URL ?? 'https://md.v1n.space').replace(\n /\\/+$/,\n '',\n );\n const mode = view ? '' : '&edit=1';\n // Without `edit=1` the viewer opens the snapshot read-only — preview pane\n // only, with edit and split disabled (Markdown-Viewer script.js: loadFromShareHash).\n return `${base}/#share=${encodeShare(markdown)}${mode}`;\n}\n\nfunction copyToClipboard(text: string): boolean {\n try {\n return (\n spawnSync('pbcopy', { input: text, stdio: ['pipe', 'ignore', 'ignore'] })\n .status === 0\n );\n } catch {\n return false;\n }\n}\n\nfunction openUrl(url: string): boolean {\n try {\n return spawnSync('open', [url], { stdio: 'ignore' }).status === 0;\n } catch {\n return false;\n }\n}\n\nexport function statusLine(opened: boolean, copied: boolean): string {\n if (opened && copied) {\n return 'Opened in Markdown-Viewer (link copied).';\n }\n if (opened) {\n return 'Opened in Markdown-Viewer.';\n }\n if (copied) {\n return 'Markdown-Viewer link copied to clipboard.';\n }\n return 'Markdown-Viewer link ready.';\n}\n\n/** Shares the markdown and returns the status line; the URL itself is never printed. */\nexport function mdSend(markdown: string, view = false): string {\n const url = shareUrl(markdown, view);\n const copied = copyToClipboard(url);\n const opened = process.env.MD_NO_OPEN === undefined && openUrl(url);\n return statusLine(opened, copied);\n}\n","import {\n hookOrPrint,\n lastReply,\n parseQuietly,\n printUsageAndExit,\n readMarkdownFile,\n readStdin,\n replyTarget,\n} from '@v1nvn/agentic-core';\nimport { Command } from 'commander';\n\nimport { mdSend } from './share.js';\n\nconst program = new Command()\n .name('md-send')\n .description('Send a Markdown reply to the Markdown-Viewer as a #share= URL')\n .argument('[file]', 'Markdown file, - for stdin; the last reply when omitted')\n .option('--view', 'open the viewer read-only, without the edit pane')\n .option('--hook', 'emit a UserPromptExpansion block instead of printing');\n\nconst parsed =\n parseQuietly(program, process.argv.slice(2)) ?? printUsageAndExit(program);\nconst arg = parsed.args.at(0);\nconst { hook, view } = parsed.opts<{\n hook: boolean | undefined;\n view: boolean | undefined;\n}>();\n\nfunction readMarkdown(): Promise<string> | string {\n if (arg === '-') {\n return readStdin();\n }\n if (arg === undefined) {\n return lastReply();\n }\n return readMarkdownFile(arg);\n}\n\nawait hookOrPrint(hook ?? false, 'send failed', async event =>\n mdSend(\n event === undefined ? await readMarkdown() : lastReply(replyTarget(event)),\n view ?? false,\n ),\n);\n"],"mappings":";;;;;;;;AAIA,SAAS,QAAQ,QAAQ;CACxB,OAAO,IAAI,SAAS,SAAS,WAAW;EACvC,IAAI,OAAO;EACX,OAAO,YAAY,MAAM;EACzB,OAAO,GAAG,SAAS,UAAU;GAC5B,QAAQ;EACT,CAAC;EACD,OAAO,GAAG,aAAa;GACtB,QAAQ,IAAI;EACb,CAAC;EACD,OAAO,GAAG,SAAS,MAAM;CAC1B,CAAC;AACF;AACA,SAAS,UAAU,SAAS,QAAQ,OAAO;CAC1C,OAAO,QAAQ,MAAM;AACtB;;AAEA,SAAS,iBAAiB,MAAM;CAC/B,IAAI,CAAC,SAAS,MAAM,EAAE,gBAAgB,MAAM,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,IAAI,MAAM,iBAAiB,MAAM;CACjG,OAAO,aAAa,MAAM,MAAM;AACjC;;;;;AAOA,SAAS,cAAc,SAAS,QAAQ,OAAO;CAC9C,OAAO,QAAQ,MAAM,CAAC,CAAC,MAAM,SAAS;EACrC,IAAI;GACH,OAAO,KAAK,MAAM,IAAI;EACvB,QAAQ;GACP,OAAO,CAAC;EACT;CACD,UAAU,CAAC,EAAE;AACd;;;;;;AAMA,SAAS,YAAY,OAAO;CAC3B,IAAI,MAAM,oBAAoB,KAAK,KAAK,OAAO,MAAM,eAAe,GAAG,OAAO,MAAM;CACpF,OAAO,MAAM,cAAc,KAAK;AACjC;AACA,SAAS,OAAO,MAAM;CACrB,IAAI;EACH,OAAO,SAAS,IAAI,CAAC,CAAC,OAAO;CAC9B,QAAQ;EACP,OAAO;CACR;AACD;;;;;AAKA,SAAS,cAAc,QAAQ;CA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AAM,EAAE,MAAM,SAAS,OAAO,KAG3B;AAEH,SAAS,eAAyC;CAChD,IAAI,QAAQ,KACV,OAAO,UAAU;CAEnB,IAAI,QAAQ,KAAA,GACV,OAAO,UAAU;CAEnB,OAAO,iBAAiB,GAAG;AAC7B;AAEA,MAAM,YAAY,QAAQ,OAAO,eAAe,OAAM,UACpD,OACE,UAAU,KAAA,IAAY,MAAM,aAAa,IAAI,UAAU,YAAY,KAAK,CAAC,GACzE,QAAQ,KACV,CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v1nvn/md",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.0",
|
|
4
4
|
"description": "Send a Markdown reply to a self-hosted Markdown-Viewer as a #share= URL — the md-send CLI behind the md plugin.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"node": ">=22"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@v1nvn/agentic-core": "^0.
|
|
40
|
+
"@v1nvn/agentic-core": "^0.33.0",
|
|
41
41
|
"commander": "^15.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|