refactor(linkedin-studio): M0-8 — voice read via getDataRoot (SC7)

This commit is contained in:
Kjell Tore Guttormsen 2026-06-18 11:45:14 +02:00
commit 6e0bbfef22
2 changed files with 71 additions and 9 deletions

View file

@ -13,13 +13,10 @@
// 0 - Always allow (informational hook)
import { readFileSync, existsSync } from 'node:fs';
import { join, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { join } from 'node:path';
import { getDataRoot, getStateFile } from './data-root.mjs';
const __dirname = dirname(fileURLToPath(import.meta.url));
const pluginRoot = join(__dirname, '..', '..');
const home = process.env.HOME || process.env.USERPROFILE || '';
const stateFile = join(home, '.claude', 'linkedin-studio.local.md');
const stateFile = getStateFile();
// Read stdin JSON
let input;
@ -98,10 +95,10 @@ if (!isLinkedin) {
// === Build context enrichment ===
let context = '**LinkedIn Context Enrichment (auto-injected):**\n\n';
// 1. Voice profile reference
const voiceFile = join(pluginRoot, 'assets', 'voice-samples', 'authentic-voice-samples.md');
// 1. Voice profile reference — the REAL artefact in the external data root (SC7).
const voiceFile = join(getDataRoot('voice-samples'), 'authentic-voice-samples.md');
if (existsSync(voiceFile)) {
context += '**Voice Profile:** Read `assets/voice-samples/authentic-voice-samples.md` for tone matching.\n\n';
context += `**Voice Profile:** Read \`${voiceFile}\` for tone matching.\n\n`;
}
// 2-4. State file data